[WRT] Add node_modules for wrt 65/157265/3
authorYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 24 Oct 2017 01:43:42 +0000 (10:43 +0900)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 24 Oct 2017 04:02:44 +0000 (13:02 +0900)
Change-Id: I665be92cbf40a01aae26e46d674b98b3e0e82444
Signed-off-by: Youngsoo Choi <kenshin.choi@samsung.com>
1436 files changed:
wrt/node_modules/.bin/mime [new symlink]
wrt/node_modules/.bin/mkdirp [new symlink]
wrt/node_modules/.bin/ncp [new symlink]
wrt/node_modules/.bin/rimraf [new symlink]
wrt/node_modules/.bin/show_dialog [new symlink]
wrt/node_modules/.bin/strip-ansi [new symlink]
wrt/node_modules/.bin/uuid [new symlink]
wrt/node_modules/.bin/window-size [new symlink]
wrt/node_modules/accepts/HISTORY.md [new file with mode: 0644]
wrt/node_modules/accepts/LICENSE [new file with mode: 0644]
wrt/node_modules/accepts/README.md [new file with mode: 0644]
wrt/node_modules/accepts/index.js [new file with mode: 0644]
wrt/node_modules/accepts/package.json [new file with mode: 0644]
wrt/node_modules/after/.npmignore [new file with mode: 0644]
wrt/node_modules/after/.travis.yml [new file with mode: 0644]
wrt/node_modules/after/LICENCE [new file with mode: 0644]
wrt/node_modules/after/README.md [new file with mode: 0644]
wrt/node_modules/after/index.js [new file with mode: 0644]
wrt/node_modules/after/package.json [new file with mode: 0644]
wrt/node_modules/after/test/after-test.js [new file with mode: 0644]
wrt/node_modules/align-text/LICENSE [new file with mode: 0644]
wrt/node_modules/align-text/README.md [new file with mode: 0644]
wrt/node_modules/align-text/index.js [new file with mode: 0644]
wrt/node_modules/align-text/package.json [new file with mode: 0644]
wrt/node_modules/ansi-styles/index.js [new file with mode: 0644]
wrt/node_modules/ansi-styles/license [new file with mode: 0644]
wrt/node_modules/ansi-styles/package.json [new file with mode: 0644]
wrt/node_modules/ansi-styles/readme.md [new file with mode: 0644]
wrt/node_modules/array-flatten/LICENSE [new file with mode: 0644]
wrt/node_modules/array-flatten/README.md [new file with mode: 0644]
wrt/node_modules/array-flatten/array-flatten.js [new file with mode: 0644]
wrt/node_modules/array-flatten/package.json [new file with mode: 0644]
wrt/node_modules/arraybuffer.slice/.npmignore [new file with mode: 0644]
wrt/node_modules/arraybuffer.slice/Makefile [new file with mode: 0644]
wrt/node_modules/arraybuffer.slice/README.md [new file with mode: 0644]
wrt/node_modules/arraybuffer.slice/index.js [new file with mode: 0644]
wrt/node_modules/arraybuffer.slice/package.json [new file with mode: 0644]
wrt/node_modules/arraybuffer.slice/test/slice-buffer.js [new file with mode: 0644]
wrt/node_modules/async/CHANGELOG.md [new file with mode: 0644]
wrt/node_modules/async/LICENSE [new file with mode: 0644]
wrt/node_modules/async/README.md [new file with mode: 0644]
wrt/node_modules/async/dist/async.js [new file with mode: 0644]
wrt/node_modules/async/dist/async.min.js [new file with mode: 0644]
wrt/node_modules/async/lib/async.js [new file with mode: 0644]
wrt/node_modules/async/package.json [new file with mode: 0644]
wrt/node_modules/backo2/.npmignore [new file with mode: 0644]
wrt/node_modules/backo2/History.md [new file with mode: 0644]
wrt/node_modules/backo2/Makefile [new file with mode: 0644]
wrt/node_modules/backo2/Readme.md [new file with mode: 0644]
wrt/node_modules/backo2/component.json [new file with mode: 0644]
wrt/node_modules/backo2/index.js [new file with mode: 0644]
wrt/node_modules/backo2/package.json [new file with mode: 0644]
wrt/node_modules/backo2/test/index.js [new file with mode: 0644]
wrt/node_modules/balanced-match/.npmignore [new file with mode: 0644]
wrt/node_modules/balanced-match/LICENSE.md [new file with mode: 0644]
wrt/node_modules/balanced-match/README.md [new file with mode: 0644]
wrt/node_modules/balanced-match/index.js [new file with mode: 0644]
wrt/node_modules/balanced-match/package.json [new file with mode: 0644]
wrt/node_modules/base64-arraybuffer/.npmignore [new file with mode: 0644]
wrt/node_modules/base64-arraybuffer/.travis.yml [new file with mode: 0644]
wrt/node_modules/base64-arraybuffer/LICENSE-MIT [new file with mode: 0644]
wrt/node_modules/base64-arraybuffer/README.md [new file with mode: 0644]
wrt/node_modules/base64-arraybuffer/lib/base64-arraybuffer.js [new file with mode: 0644]
wrt/node_modules/base64-arraybuffer/package.json [new file with mode: 0644]
wrt/node_modules/base64id/.npmignore [new file with mode: 0644]
wrt/node_modules/base64id/LICENSE [new file with mode: 0644]
wrt/node_modules/base64id/README.md [new file with mode: 0644]
wrt/node_modules/base64id/lib/base64id.js [new file with mode: 0644]
wrt/node_modules/base64id/package.json [new file with mode: 0644]
wrt/node_modules/better-assert/.npmignore [new file with mode: 0644]
wrt/node_modules/better-assert/History.md [new file with mode: 0644]
wrt/node_modules/better-assert/Makefile [new file with mode: 0644]
wrt/node_modules/better-assert/Readme.md [new file with mode: 0644]
wrt/node_modules/better-assert/example.js [new file with mode: 0644]
wrt/node_modules/better-assert/index.js [new file with mode: 0644]
wrt/node_modules/better-assert/package.json [new file with mode: 0644]
wrt/node_modules/binary/.npmignore [new file with mode: 0644]
wrt/node_modules/binary/.travis.yml [new file with mode: 0644]
wrt/node_modules/binary/README.markdown [new file with mode: 0644]
wrt/node_modules/binary/example/buf.js [new file with mode: 0644]
wrt/node_modules/binary/example/parse.js [new file with mode: 0644]
wrt/node_modules/binary/example/stream.js [new file with mode: 0644]
wrt/node_modules/binary/index.js [new file with mode: 0644]
wrt/node_modules/binary/lib/vars.js [new file with mode: 0644]
wrt/node_modules/binary/package.json [new file with mode: 0644]
wrt/node_modules/binary/perf/loop.js [new file with mode: 0644]
wrt/node_modules/binary/perf/small.js [new file with mode: 0644]
wrt/node_modules/binary/test/bu.js [new file with mode: 0644]
wrt/node_modules/binary/test/deferred.js [new file with mode: 0644]
wrt/node_modules/binary/test/dots.js [new file with mode: 0644]
wrt/node_modules/binary/test/eof.js [new file with mode: 0644]
wrt/node_modules/binary/test/flush.js [new file with mode: 0644]
wrt/node_modules/binary/test/from_buffer.js [new file with mode: 0644]
wrt/node_modules/binary/test/get_buffer.js [new file with mode: 0644]
wrt/node_modules/binary/test/immediate.js [new file with mode: 0644]
wrt/node_modules/binary/test/interval.js [new file with mode: 0644]
wrt/node_modules/binary/test/into_buffer.js [new file with mode: 0644]
wrt/node_modules/binary/test/into_stream.js [new file with mode: 0644]
wrt/node_modules/binary/test/loop.js [new file with mode: 0644]
wrt/node_modules/binary/test/loop_scan.js [new file with mode: 0644]
wrt/node_modules/binary/test/lu.js [new file with mode: 0644]
wrt/node_modules/binary/test/negbs.js [new file with mode: 0644]
wrt/node_modules/binary/test/negls.js [new file with mode: 0644]
wrt/node_modules/binary/test/nested.js [new file with mode: 0644]
wrt/node_modules/binary/test/not_enough_buf.js [new file with mode: 0644]
wrt/node_modules/binary/test/not_enough_parse.js [new file with mode: 0644]
wrt/node_modules/binary/test/parse.js [new file with mode: 0644]
wrt/node_modules/binary/test/peek.js [new file with mode: 0644]
wrt/node_modules/binary/test/pipe.js [new file with mode: 0644]
wrt/node_modules/binary/test/posbs.js [new file with mode: 0644]
wrt/node_modules/binary/test/posls.js [new file with mode: 0644]
wrt/node_modules/binary/test/scan.js [new file with mode: 0644]
wrt/node_modules/binary/test/scan_buf.js [new file with mode: 0644]
wrt/node_modules/binary/test/scan_buf_null.js [new file with mode: 0644]
wrt/node_modules/binary/test/skip.js [new file with mode: 0644]
wrt/node_modules/binary/test/split.js [new file with mode: 0644]
wrt/node_modules/blob/.npmignore [new file with mode: 0644]
wrt/node_modules/blob/.zuul.yml [new file with mode: 0644]
wrt/node_modules/blob/Makefile [new file with mode: 0644]
wrt/node_modules/blob/README.md [new file with mode: 0644]
wrt/node_modules/blob/index.js [new file with mode: 0644]
wrt/node_modules/blob/package.json [new file with mode: 0644]
wrt/node_modules/blob/test/index.js [new file with mode: 0644]
wrt/node_modules/brace-expansion/README.md [new file with mode: 0644]
wrt/node_modules/brace-expansion/index.js [new file with mode: 0644]
wrt/node_modules/brace-expansion/package.json [new file with mode: 0644]
wrt/node_modules/buffers/README.markdown [new file with mode: 0644]
wrt/node_modules/buffers/examples/slice.js [new file with mode: 0644]
wrt/node_modules/buffers/examples/splice.js [new file with mode: 0644]
wrt/node_modules/buffers/index.js [new file with mode: 0644]
wrt/node_modules/buffers/package.json [new file with mode: 0644]
wrt/node_modules/buffers/test/buffers.js [new file with mode: 0644]
wrt/node_modules/callsite/.npmignore [new file with mode: 0644]
wrt/node_modules/callsite/History.md [new file with mode: 0644]
wrt/node_modules/callsite/Makefile [new file with mode: 0644]
wrt/node_modules/callsite/Readme.md [new file with mode: 0644]
wrt/node_modules/callsite/index.js [new file with mode: 0644]
wrt/node_modules/callsite/package.json [new file with mode: 0644]
wrt/node_modules/center-align/LICENSE [new file with mode: 0644]
wrt/node_modules/center-align/README.md [new file with mode: 0644]
wrt/node_modules/center-align/index.js [new file with mode: 0644]
wrt/node_modules/center-align/package.json [new file with mode: 0644]
wrt/node_modules/center-align/utils.js [new file with mode: 0644]
wrt/node_modules/chainsaw/.npmignore [new file with mode: 0644]
wrt/node_modules/chainsaw/README.markdown [new file with mode: 0644]
wrt/node_modules/chainsaw/examples/add_do.js [new file with mode: 0644]
wrt/node_modules/chainsaw/examples/prompt.js [new file with mode: 0644]
wrt/node_modules/chainsaw/index.js [new file with mode: 0755]
wrt/node_modules/chainsaw/package.json [new file with mode: 0644]
wrt/node_modules/chainsaw/test/chainsaw.js [new file with mode: 0644]
wrt/node_modules/chalk/index.js [new file with mode: 0644]
wrt/node_modules/chalk/license [new file with mode: 0644]
wrt/node_modules/chalk/package.json [new file with mode: 0644]
wrt/node_modules/chalk/readme.md [new file with mode: 0644]
wrt/node_modules/chalk/templates.js [new file with mode: 0644]
wrt/node_modules/color-convert/CHANGELOG.md [new file with mode: 0644]
wrt/node_modules/color-convert/LICENSE [new file with mode: 0644]
wrt/node_modules/color-convert/README.md [new file with mode: 0644]
wrt/node_modules/color-convert/conversions.js [new file with mode: 0644]
wrt/node_modules/color-convert/index.js [new file with mode: 0644]
wrt/node_modules/color-convert/package.json [new file with mode: 0644]
wrt/node_modules/color-convert/route.js [new file with mode: 0644]
wrt/node_modules/color-name/.eslintrc.json [new file with mode: 0644]
wrt/node_modules/color-name/.npmignore [new file with mode: 0644]
wrt/node_modules/color-name/LICENSE [new file with mode: 0644]
wrt/node_modules/color-name/README.md [new file with mode: 0644]
wrt/node_modules/color-name/index.js [new file with mode: 0644]
wrt/node_modules/color-name/package.json [new file with mode: 0644]
wrt/node_modules/color-name/test.js [new file with mode: 0644]
wrt/node_modules/component-bind/.npmignore [new file with mode: 0644]
wrt/node_modules/component-bind/History.md [new file with mode: 0644]
wrt/node_modules/component-bind/Makefile [new file with mode: 0644]
wrt/node_modules/component-bind/Readme.md [new file with mode: 0644]
wrt/node_modules/component-bind/component.json [new file with mode: 0644]
wrt/node_modules/component-bind/index.js [new file with mode: 0644]
wrt/node_modules/component-bind/package.json [new file with mode: 0644]
wrt/node_modules/component-emitter/History.md [new file with mode: 0644]
wrt/node_modules/component-emitter/LICENSE [new file with mode: 0644]
wrt/node_modules/component-emitter/Readme.md [new file with mode: 0644]
wrt/node_modules/component-emitter/index.js [new file with mode: 0644]
wrt/node_modules/component-emitter/package.json [new file with mode: 0644]
wrt/node_modules/component-inherit/.npmignore [new file with mode: 0644]
wrt/node_modules/component-inherit/History.md [new file with mode: 0644]
wrt/node_modules/component-inherit/Makefile [new file with mode: 0644]
wrt/node_modules/component-inherit/Readme.md [new file with mode: 0644]
wrt/node_modules/component-inherit/component.json [new file with mode: 0644]
wrt/node_modules/component-inherit/index.js [new file with mode: 0644]
wrt/node_modules/component-inherit/package.json [new file with mode: 0644]
wrt/node_modules/component-inherit/test/inherit.js [new file with mode: 0644]
wrt/node_modules/concat-map/.travis.yml [new file with mode: 0644]
wrt/node_modules/concat-map/LICENSE [new file with mode: 0644]
wrt/node_modules/concat-map/README.markdown [new file with mode: 0644]
wrt/node_modules/concat-map/example/map.js [new file with mode: 0644]
wrt/node_modules/concat-map/index.js [new file with mode: 0644]
wrt/node_modules/concat-map/package.json [new file with mode: 0644]
wrt/node_modules/concat-map/test/map.js [new file with mode: 0644]
wrt/node_modules/content-disposition/HISTORY.md [new file with mode: 0644]
wrt/node_modules/content-disposition/LICENSE [new file with mode: 0644]
wrt/node_modules/content-disposition/README.md [new file with mode: 0644]
wrt/node_modules/content-disposition/index.js [new file with mode: 0644]
wrt/node_modules/content-disposition/package.json [new file with mode: 0644]
wrt/node_modules/content-type/HISTORY.md [new file with mode: 0644]
wrt/node_modules/content-type/LICENSE [new file with mode: 0644]
wrt/node_modules/content-type/README.md [new file with mode: 0644]
wrt/node_modules/content-type/index.js [new file with mode: 0644]
wrt/node_modules/content-type/package.json [new file with mode: 0644]
wrt/node_modules/cookie-signature/.npmignore [new file with mode: 0644]
wrt/node_modules/cookie-signature/History.md [new file with mode: 0644]
wrt/node_modules/cookie-signature/Readme.md [new file with mode: 0644]
wrt/node_modules/cookie-signature/index.js [new file with mode: 0644]
wrt/node_modules/cookie-signature/package.json [new file with mode: 0644]
wrt/node_modules/cookie/HISTORY.md [new file with mode: 0644]
wrt/node_modules/cookie/LICENSE [new file with mode: 0644]
wrt/node_modules/cookie/README.md [new file with mode: 0644]
wrt/node_modules/cookie/index.js [new file with mode: 0644]
wrt/node_modules/cookie/package.json [new file with mode: 0644]
wrt/node_modules/core-util-is/LICENSE [new file with mode: 0644]
wrt/node_modules/core-util-is/README.md [new file with mode: 0644]
wrt/node_modules/core-util-is/float.patch [new file with mode: 0644]
wrt/node_modules/core-util-is/lib/util.js [new file with mode: 0644]
wrt/node_modules/core-util-is/package.json [new file with mode: 0644]
wrt/node_modules/core-util-is/test.js [new file with mode: 0644]
wrt/node_modules/debug/.coveralls.yml [new file with mode: 0644]
wrt/node_modules/debug/.eslintrc [new file with mode: 0644]
wrt/node_modules/debug/.npmignore [new file with mode: 0644]
wrt/node_modules/debug/.travis.yml [new file with mode: 0644]
wrt/node_modules/debug/CHANGELOG.md [new file with mode: 0644]
wrt/node_modules/debug/LICENSE [new file with mode: 0644]
wrt/node_modules/debug/Makefile [new file with mode: 0644]
wrt/node_modules/debug/README.md [new file with mode: 0644]
wrt/node_modules/debug/component.json [new file with mode: 0644]
wrt/node_modules/debug/karma.conf.js [new file with mode: 0644]
wrt/node_modules/debug/node.js [new file with mode: 0644]
wrt/node_modules/debug/package.json [new file with mode: 0644]
wrt/node_modules/debug/src/browser.js [new file with mode: 0644]
wrt/node_modules/debug/src/debug.js [new file with mode: 0644]
wrt/node_modules/debug/src/index.js [new file with mode: 0644]
wrt/node_modules/debug/src/node.js [new file with mode: 0644]
wrt/node_modules/decamelize/index.js [new file with mode: 0644]
wrt/node_modules/decamelize/license [new file with mode: 0644]
wrt/node_modules/decamelize/package.json [new file with mode: 0644]
wrt/node_modules/decamelize/readme.md [new file with mode: 0644]
wrt/node_modules/depd/History.md [new file with mode: 0644]
wrt/node_modules/depd/LICENSE [new file with mode: 0644]
wrt/node_modules/depd/Readme.md [new file with mode: 0644]
wrt/node_modules/depd/index.js [new file with mode: 0644]
wrt/node_modules/depd/lib/browser/index.js [new file with mode: 0644]
wrt/node_modules/depd/lib/compat/callsite-tostring.js [new file with mode: 0644]
wrt/node_modules/depd/lib/compat/event-listener-count.js [new file with mode: 0644]
wrt/node_modules/depd/lib/compat/index.js [new file with mode: 0644]
wrt/node_modules/depd/package.json [new file with mode: 0644]
wrt/node_modules/destroy/LICENSE [new file with mode: 0644]
wrt/node_modules/destroy/README.md [new file with mode: 0644]
wrt/node_modules/destroy/index.js [new file with mode: 0644]
wrt/node_modules/destroy/package.json [new file with mode: 0644]
wrt/node_modules/dialog/README.md [new file with mode: 0644]
wrt/node_modules/dialog/bin/dialog.js [new file with mode: 0755]
wrt/node_modules/dialog/index.js [new file with mode: 0644]
wrt/node_modules/dialog/msgbox.vbs [new file with mode: 0644]
wrt/node_modules/dialog/package.json [new file with mode: 0644]
wrt/node_modules/diskdb/README.md [new file with mode: 0644]
wrt/node_modules/diskdb/lib/collection.js [new file with mode: 0644]
wrt/node_modules/diskdb/lib/diskdb.js [new file with mode: 0644]
wrt/node_modules/diskdb/lib/util.js [new file with mode: 0644]
wrt/node_modules/diskdb/node_modules/ansi-styles/ansi-styles.js [new file with mode: 0644]
wrt/node_modules/diskdb/node_modules/ansi-styles/package.json [new file with mode: 0644]
wrt/node_modules/diskdb/node_modules/ansi-styles/readme.md [new file with mode: 0644]
wrt/node_modules/diskdb/node_modules/chalk/index.js [new file with mode: 0644]
wrt/node_modules/diskdb/node_modules/chalk/package.json [new file with mode: 0644]
wrt/node_modules/diskdb/node_modules/chalk/readme.md [new file with mode: 0644]
wrt/node_modules/diskdb/package.json [new file with mode: 0644]
wrt/node_modules/ee-first/LICENSE [new file with mode: 0644]
wrt/node_modules/ee-first/README.md [new file with mode: 0644]
wrt/node_modules/ee-first/index.js [new file with mode: 0644]
wrt/node_modules/ee-first/package.json [new file with mode: 0644]
wrt/node_modules/encodeurl/HISTORY.md [new file with mode: 0644]
wrt/node_modules/encodeurl/LICENSE [new file with mode: 0644]
wrt/node_modules/encodeurl/README.md [new file with mode: 0644]
wrt/node_modules/encodeurl/index.js [new file with mode: 0644]
wrt/node_modules/encodeurl/package.json [new file with mode: 0644]
wrt/node_modules/engine.io-client/History.md [new file with mode: 0644]
wrt/node_modules/engine.io-client/LICENSE [new file with mode: 0644]
wrt/node_modules/engine.io-client/README.md [new file with mode: 0644]
wrt/node_modules/engine.io-client/engine.io.js [new file with mode: 0644]
wrt/node_modules/engine.io-client/index.js [new file with mode: 0644]
wrt/node_modules/engine.io-client/lib/index.js [new file with mode: 0644]
wrt/node_modules/engine.io-client/lib/socket.js [new file with mode: 0644]
wrt/node_modules/engine.io-client/lib/transport.js [new file with mode: 0644]
wrt/node_modules/engine.io-client/lib/transports/index.js [new file with mode: 0755]
wrt/node_modules/engine.io-client/lib/transports/polling-jsonp.js [new file with mode: 0644]
wrt/node_modules/engine.io-client/lib/transports/polling-xhr.js [new file with mode: 0755]
wrt/node_modules/engine.io-client/lib/transports/polling.js [new file with mode: 0644]
wrt/node_modules/engine.io-client/lib/transports/websocket.js [new file with mode: 0644]
wrt/node_modules/engine.io-client/lib/xmlhttprequest.js [new file with mode: 0644]
wrt/node_modules/engine.io-client/node_modules/debug/.coveralls.yml [new file with mode: 0644]
wrt/node_modules/engine.io-client/node_modules/debug/.eslintrc [new file with mode: 0644]
wrt/node_modules/engine.io-client/node_modules/debug/.npmignore [new file with mode: 0644]
wrt/node_modules/engine.io-client/node_modules/debug/.travis.yml [new file with mode: 0644]
wrt/node_modules/engine.io-client/node_modules/debug/CHANGELOG.md [new file with mode: 0644]
wrt/node_modules/engine.io-client/node_modules/debug/LICENSE [new file with mode: 0644]
wrt/node_modules/engine.io-client/node_modules/debug/Makefile [new file with mode: 0644]
wrt/node_modules/engine.io-client/node_modules/debug/README.md [new file with mode: 0644]
wrt/node_modules/engine.io-client/node_modules/debug/component.json [new file with mode: 0644]
wrt/node_modules/engine.io-client/node_modules/debug/karma.conf.js [new file with mode: 0644]
wrt/node_modules/engine.io-client/node_modules/debug/node.js [new file with mode: 0644]
wrt/node_modules/engine.io-client/node_modules/debug/package.json [new file with mode: 0644]
wrt/node_modules/engine.io-client/node_modules/debug/src/browser.js [new file with mode: 0644]
wrt/node_modules/engine.io-client/node_modules/debug/src/debug.js [new file with mode: 0644]
wrt/node_modules/engine.io-client/node_modules/debug/src/index.js [new file with mode: 0644]
wrt/node_modules/engine.io-client/node_modules/debug/src/inspector-log.js [new file with mode: 0644]
wrt/node_modules/engine.io-client/node_modules/debug/src/node.js [new file with mode: 0644]
wrt/node_modules/engine.io-client/package.json [new file with mode: 0644]
wrt/node_modules/engine.io-parser/History.md [new file with mode: 0644]
wrt/node_modules/engine.io-parser/LICENSE [new file with mode: 0644]
wrt/node_modules/engine.io-parser/Readme.md [new file with mode: 0644]
wrt/node_modules/engine.io-parser/index.js [new file with mode: 0644]
wrt/node_modules/engine.io-parser/lib/browser.js [new file with mode: 0644]
wrt/node_modules/engine.io-parser/lib/index.js [new file with mode: 0644]
wrt/node_modules/engine.io-parser/lib/keys.js [new file with mode: 0644]
wrt/node_modules/engine.io-parser/lib/utf8.js [new file with mode: 0644]
wrt/node_modules/engine.io-parser/package.json [new file with mode: 0644]
wrt/node_modules/engine.io/LICENSE [new file with mode: 0644]
wrt/node_modules/engine.io/README.md [new file with mode: 0644]
wrt/node_modules/engine.io/lib/engine.io.js [new file with mode: 0644]
wrt/node_modules/engine.io/lib/server.js [new file with mode: 0644]
wrt/node_modules/engine.io/lib/socket.js [new file with mode: 0644]
wrt/node_modules/engine.io/lib/transport.js [new file with mode: 0644]
wrt/node_modules/engine.io/lib/transports/index.js [new file with mode: 0644]
wrt/node_modules/engine.io/lib/transports/polling-jsonp.js [new file with mode: 0644]
wrt/node_modules/engine.io/lib/transports/polling-xhr.js [new file with mode: 0644]
wrt/node_modules/engine.io/lib/transports/polling.js [new file with mode: 0644]
wrt/node_modules/engine.io/lib/transports/websocket.js [new file with mode: 0644]
wrt/node_modules/engine.io/node_modules/debug/.coveralls.yml [new file with mode: 0644]
wrt/node_modules/engine.io/node_modules/debug/.eslintrc [new file with mode: 0644]
wrt/node_modules/engine.io/node_modules/debug/.npmignore [new file with mode: 0644]
wrt/node_modules/engine.io/node_modules/debug/.travis.yml [new file with mode: 0644]
wrt/node_modules/engine.io/node_modules/debug/CHANGELOG.md [new file with mode: 0644]
wrt/node_modules/engine.io/node_modules/debug/LICENSE [new file with mode: 0644]
wrt/node_modules/engine.io/node_modules/debug/Makefile [new file with mode: 0644]
wrt/node_modules/engine.io/node_modules/debug/README.md [new file with mode: 0644]
wrt/node_modules/engine.io/node_modules/debug/component.json [new file with mode: 0644]
wrt/node_modules/engine.io/node_modules/debug/karma.conf.js [new file with mode: 0644]
wrt/node_modules/engine.io/node_modules/debug/node.js [new file with mode: 0644]
wrt/node_modules/engine.io/node_modules/debug/package.json [new file with mode: 0644]
wrt/node_modules/engine.io/node_modules/debug/src/browser.js [new file with mode: 0644]
wrt/node_modules/engine.io/node_modules/debug/src/debug.js [new file with mode: 0644]
wrt/node_modules/engine.io/node_modules/debug/src/index.js [new file with mode: 0644]
wrt/node_modules/engine.io/node_modules/debug/src/inspector-log.js [new file with mode: 0644]
wrt/node_modules/engine.io/node_modules/debug/src/node.js [new file with mode: 0644]
wrt/node_modules/engine.io/package.json [new file with mode: 0644]
wrt/node_modules/escape-html/LICENSE [new file with mode: 0644]
wrt/node_modules/escape-html/Readme.md [new file with mode: 0644]
wrt/node_modules/escape-html/index.js [new file with mode: 0644]
wrt/node_modules/escape-html/package.json [new file with mode: 0644]
wrt/node_modules/escape-string-regexp/index.js [new file with mode: 0644]
wrt/node_modules/escape-string-regexp/license [new file with mode: 0644]
wrt/node_modules/escape-string-regexp/package.json [new file with mode: 0644]
wrt/node_modules/escape-string-regexp/readme.md [new file with mode: 0644]
wrt/node_modules/etag/HISTORY.md [new file with mode: 0644]
wrt/node_modules/etag/LICENSE [new file with mode: 0644]
wrt/node_modules/etag/README.md [new file with mode: 0644]
wrt/node_modules/etag/index.js [new file with mode: 0644]
wrt/node_modules/etag/package.json [new file with mode: 0644]
wrt/node_modules/express/History.md [new file with mode: 0644]
wrt/node_modules/express/LICENSE [new file with mode: 0644]
wrt/node_modules/express/Readme.md [new file with mode: 0644]
wrt/node_modules/express/index.js [new file with mode: 0644]
wrt/node_modules/express/lib/application.js [new file with mode: 0644]
wrt/node_modules/express/lib/express.js [new file with mode: 0644]
wrt/node_modules/express/lib/middleware/init.js [new file with mode: 0644]
wrt/node_modules/express/lib/middleware/query.js [new file with mode: 0644]
wrt/node_modules/express/lib/request.js [new file with mode: 0644]
wrt/node_modules/express/lib/response.js [new file with mode: 0644]
wrt/node_modules/express/lib/router/index.js [new file with mode: 0644]
wrt/node_modules/express/lib/router/layer.js [new file with mode: 0644]
wrt/node_modules/express/lib/router/route.js [new file with mode: 0644]
wrt/node_modules/express/lib/utils.js [new file with mode: 0644]
wrt/node_modules/express/lib/view.js [new file with mode: 0644]
wrt/node_modules/express/node_modules/debug/.coveralls.yml [new file with mode: 0644]
wrt/node_modules/express/node_modules/debug/.eslintrc [new file with mode: 0644]
wrt/node_modules/express/node_modules/debug/.npmignore [new file with mode: 0644]
wrt/node_modules/express/node_modules/debug/.travis.yml [new file with mode: 0644]
wrt/node_modules/express/node_modules/debug/CHANGELOG.md [new file with mode: 0644]
wrt/node_modules/express/node_modules/debug/LICENSE [new file with mode: 0644]
wrt/node_modules/express/node_modules/debug/Makefile [new file with mode: 0644]
wrt/node_modules/express/node_modules/debug/README.md [new file with mode: 0644]
wrt/node_modules/express/node_modules/debug/component.json [new file with mode: 0644]
wrt/node_modules/express/node_modules/debug/karma.conf.js [new file with mode: 0644]
wrt/node_modules/express/node_modules/debug/node.js [new file with mode: 0644]
wrt/node_modules/express/node_modules/debug/package.json [new file with mode: 0644]
wrt/node_modules/express/node_modules/debug/src/browser.js [new file with mode: 0644]
wrt/node_modules/express/node_modules/debug/src/debug.js [new file with mode: 0644]
wrt/node_modules/express/node_modules/debug/src/index.js [new file with mode: 0644]
wrt/node_modules/express/node_modules/debug/src/node.js [new file with mode: 0644]
wrt/node_modules/express/package.json [new file with mode: 0644]
wrt/node_modules/finalhandler/HISTORY.md [new file with mode: 0644]
wrt/node_modules/finalhandler/LICENSE [new file with mode: 0644]
wrt/node_modules/finalhandler/README.md [new file with mode: 0644]
wrt/node_modules/finalhandler/index.js [new file with mode: 0644]
wrt/node_modules/finalhandler/node_modules/debug/.coveralls.yml [new file with mode: 0644]
wrt/node_modules/finalhandler/node_modules/debug/.eslintrc [new file with mode: 0644]
wrt/node_modules/finalhandler/node_modules/debug/.npmignore [new file with mode: 0644]
wrt/node_modules/finalhandler/node_modules/debug/.travis.yml [new file with mode: 0644]
wrt/node_modules/finalhandler/node_modules/debug/CHANGELOG.md [new file with mode: 0644]
wrt/node_modules/finalhandler/node_modules/debug/LICENSE [new file with mode: 0644]
wrt/node_modules/finalhandler/node_modules/debug/Makefile [new file with mode: 0644]
wrt/node_modules/finalhandler/node_modules/debug/README.md [new file with mode: 0644]
wrt/node_modules/finalhandler/node_modules/debug/component.json [new file with mode: 0644]
wrt/node_modules/finalhandler/node_modules/debug/karma.conf.js [new file with mode: 0644]
wrt/node_modules/finalhandler/node_modules/debug/node.js [new file with mode: 0644]
wrt/node_modules/finalhandler/node_modules/debug/package.json [new file with mode: 0644]
wrt/node_modules/finalhandler/node_modules/debug/src/browser.js [new file with mode: 0644]
wrt/node_modules/finalhandler/node_modules/debug/src/debug.js [new file with mode: 0644]
wrt/node_modules/finalhandler/node_modules/debug/src/index.js [new file with mode: 0644]
wrt/node_modules/finalhandler/node_modules/debug/src/inspector-log.js [new file with mode: 0644]
wrt/node_modules/finalhandler/node_modules/debug/src/node.js [new file with mode: 0644]
wrt/node_modules/finalhandler/package.json [new file with mode: 0644]
wrt/node_modules/forwarded/HISTORY.md [new file with mode: 0644]
wrt/node_modules/forwarded/LICENSE [new file with mode: 0644]
wrt/node_modules/forwarded/README.md [new file with mode: 0644]
wrt/node_modules/forwarded/index.js [new file with mode: 0644]
wrt/node_modules/forwarded/package.json [new file with mode: 0644]
wrt/node_modules/fresh/HISTORY.md [new file with mode: 0644]
wrt/node_modules/fresh/LICENSE [new file with mode: 0644]
wrt/node_modules/fresh/README.md [new file with mode: 0644]
wrt/node_modules/fresh/index.js [new file with mode: 0644]
wrt/node_modules/fresh/package.json [new file with mode: 0644]
wrt/node_modules/fs-plus/LICENSE.md [new file with mode: 0644]
wrt/node_modules/fs-plus/README.md [new file with mode: 0644]
wrt/node_modules/fs-plus/appveyor.yml [new file with mode: 0644]
wrt/node_modules/fs-plus/lib/fs-plus.js [new file with mode: 0644]
wrt/node_modules/fs-plus/package.json [new file with mode: 0644]
wrt/node_modules/fs.realpath/LICENSE [new file with mode: 0644]
wrt/node_modules/fs.realpath/README.md [new file with mode: 0644]
wrt/node_modules/fs.realpath/index.js [new file with mode: 0644]
wrt/node_modules/fs.realpath/old.js [new file with mode: 0644]
wrt/node_modules/fs.realpath/package.json [new file with mode: 0644]
wrt/node_modules/fstream/.npmignore [new file with mode: 0644]
wrt/node_modules/fstream/.travis.yml [new file with mode: 0644]
wrt/node_modules/fstream/LICENSE [new file with mode: 0644]
wrt/node_modules/fstream/README.md [new file with mode: 0644]
wrt/node_modules/fstream/examples/filter-pipe.js [new file with mode: 0644]
wrt/node_modules/fstream/examples/pipe.js [new file with mode: 0644]
wrt/node_modules/fstream/examples/reader.js [new file with mode: 0644]
wrt/node_modules/fstream/examples/symlink-write.js [new file with mode: 0644]
wrt/node_modules/fstream/fstream.js [new file with mode: 0644]
wrt/node_modules/fstream/lib/abstract.js [new file with mode: 0644]
wrt/node_modules/fstream/lib/collect.js [new file with mode: 0644]
wrt/node_modules/fstream/lib/dir-reader.js [new file with mode: 0644]
wrt/node_modules/fstream/lib/dir-writer.js [new file with mode: 0644]
wrt/node_modules/fstream/lib/file-reader.js [new file with mode: 0644]
wrt/node_modules/fstream/lib/file-writer.js [new file with mode: 0644]
wrt/node_modules/fstream/lib/get-type.js [new file with mode: 0644]
wrt/node_modules/fstream/lib/link-reader.js [new file with mode: 0644]
wrt/node_modules/fstream/lib/link-writer.js [new file with mode: 0644]
wrt/node_modules/fstream/lib/proxy-reader.js [new file with mode: 0644]
wrt/node_modules/fstream/lib/proxy-writer.js [new file with mode: 0644]
wrt/node_modules/fstream/lib/reader.js [new file with mode: 0644]
wrt/node_modules/fstream/lib/socket-reader.js [new file with mode: 0644]
wrt/node_modules/fstream/lib/writer.js [new file with mode: 0644]
wrt/node_modules/fstream/package.json [new file with mode: 0644]
wrt/node_modules/glob/LICENSE [new file with mode: 0644]
wrt/node_modules/glob/README.md [new file with mode: 0644]
wrt/node_modules/glob/common.js [new file with mode: 0644]
wrt/node_modules/glob/glob.js [new file with mode: 0644]
wrt/node_modules/glob/package.json [new file with mode: 0644]
wrt/node_modules/glob/sync.js [new file with mode: 0644]
wrt/node_modules/graceful-fs/.npmignore [new file with mode: 0644]
wrt/node_modules/graceful-fs/.travis.yml [new file with mode: 0644]
wrt/node_modules/graceful-fs/LICENSE [new file with mode: 0644]
wrt/node_modules/graceful-fs/README.md [new file with mode: 0644]
wrt/node_modules/graceful-fs/fs.js [new file with mode: 0644]
wrt/node_modules/graceful-fs/graceful-fs.js [new file with mode: 0644]
wrt/node_modules/graceful-fs/package.json [new file with mode: 0644]
wrt/node_modules/graceful-fs/polyfills.js [new file with mode: 0644]
wrt/node_modules/graceful-fs/test/max-open.js [new file with mode: 0644]
wrt/node_modules/graceful-fs/test/open.js [new file with mode: 0644]
wrt/node_modules/graceful-fs/test/readdir-sort.js [new file with mode: 0644]
wrt/node_modules/graceful-fs/test/write-then-read.js [new file with mode: 0644]
wrt/node_modules/has-binary2/History.md [new file with mode: 0644]
wrt/node_modules/has-binary2/LICENSE [new file with mode: 0644]
wrt/node_modules/has-binary2/README.md [new file with mode: 0644]
wrt/node_modules/has-binary2/index.js [new file with mode: 0644]
wrt/node_modules/has-binary2/node_modules/isarray/README.md [new file with mode: 0644]
wrt/node_modules/has-binary2/node_modules/isarray/index.js [new file with mode: 0644]
wrt/node_modules/has-binary2/node_modules/isarray/package.json [new file with mode: 0644]
wrt/node_modules/has-binary2/package.json [new file with mode: 0644]
wrt/node_modules/has-color/index.js [new file with mode: 0644]
wrt/node_modules/has-color/package.json [new file with mode: 0644]
wrt/node_modules/has-color/readme.md [new file with mode: 0644]
wrt/node_modules/has-cors/.npmignore [new file with mode: 0644]
wrt/node_modules/has-cors/History.md [new file with mode: 0644]
wrt/node_modules/has-cors/Makefile [new file with mode: 0644]
wrt/node_modules/has-cors/Readme.md [new file with mode: 0644]
wrt/node_modules/has-cors/component.json [new file with mode: 0644]
wrt/node_modules/has-cors/index.js [new file with mode: 0644]
wrt/node_modules/has-cors/package.json [new file with mode: 0644]
wrt/node_modules/has-cors/test.js [new file with mode: 0644]
wrt/node_modules/has-flag/index.js [new file with mode: 0644]
wrt/node_modules/has-flag/license [new file with mode: 0644]
wrt/node_modules/has-flag/package.json [new file with mode: 0644]
wrt/node_modules/has-flag/readme.md [new file with mode: 0644]
wrt/node_modules/http-errors/HISTORY.md [new file with mode: 0644]
wrt/node_modules/http-errors/LICENSE [new file with mode: 0644]
wrt/node_modules/http-errors/README.md [new file with mode: 0644]
wrt/node_modules/http-errors/index.js [new file with mode: 0644]
wrt/node_modules/http-errors/package.json [new file with mode: 0644]
wrt/node_modules/indexof/.npmignore [new file with mode: 0644]
wrt/node_modules/indexof/Makefile [new file with mode: 0644]
wrt/node_modules/indexof/Readme.md [new file with mode: 0644]
wrt/node_modules/indexof/component.json [new file with mode: 0644]
wrt/node_modules/indexof/index.js [new file with mode: 0644]
wrt/node_modules/indexof/package.json [new file with mode: 0644]
wrt/node_modules/inflight/LICENSE [new file with mode: 0644]
wrt/node_modules/inflight/README.md [new file with mode: 0644]
wrt/node_modules/inflight/inflight.js [new file with mode: 0644]
wrt/node_modules/inflight/package.json [new file with mode: 0644]
wrt/node_modules/inherits/LICENSE [new file with mode: 0644]
wrt/node_modules/inherits/README.md [new file with mode: 0644]
wrt/node_modules/inherits/inherits.js [new file with mode: 0644]
wrt/node_modules/inherits/inherits_browser.js [new file with mode: 0644]
wrt/node_modules/inherits/package.json [new file with mode: 0644]
wrt/node_modules/ipaddr.js/.npmignore [new file with mode: 0644]
wrt/node_modules/ipaddr.js/.travis.yml [new file with mode: 0644]
wrt/node_modules/ipaddr.js/Cakefile [new file with mode: 0644]
wrt/node_modules/ipaddr.js/LICENSE [new file with mode: 0644]
wrt/node_modules/ipaddr.js/README.md [new file with mode: 0644]
wrt/node_modules/ipaddr.js/bower.json [new file with mode: 0644]
wrt/node_modules/ipaddr.js/ipaddr.min.js [new file with mode: 0644]
wrt/node_modules/ipaddr.js/lib/ipaddr.js [new file with mode: 0644]
wrt/node_modules/ipaddr.js/package.json [new file with mode: 0644]
wrt/node_modules/ipaddr.js/src/ipaddr.coffee [new file with mode: 0644]
wrt/node_modules/ipaddr.js/src/ipaddr.js [new file with mode: 0644]
wrt/node_modules/ipaddr.js/test/ipaddr.js [new file with mode: 0644]
wrt/node_modules/ipaddr.js/test/ipaddr.test.coffee [new file with mode: 0644]
wrt/node_modules/is-buffer/.npmignore [new file with mode: 0644]
wrt/node_modules/is-buffer/LICENSE [new file with mode: 0644]
wrt/node_modules/is-buffer/README.md [new file with mode: 0644]
wrt/node_modules/is-buffer/index.js [new file with mode: 0644]
wrt/node_modules/is-buffer/package.json [new file with mode: 0644]
wrt/node_modules/is-buffer/test/basic.js [new file with mode: 0644]
wrt/node_modules/isarray/README.md [new file with mode: 0644]
wrt/node_modules/isarray/build/build.js [new file with mode: 0644]
wrt/node_modules/isarray/component.json [new file with mode: 0644]
wrt/node_modules/isarray/index.js [new file with mode: 0644]
wrt/node_modules/isarray/package.json [new file with mode: 0644]
wrt/node_modules/kind-of/LICENSE [new file with mode: 0644]
wrt/node_modules/kind-of/README.md [new file with mode: 0644]
wrt/node_modules/kind-of/index.js [new file with mode: 0644]
wrt/node_modules/kind-of/package.json [new file with mode: 0644]
wrt/node_modules/lazy-cache/LICENSE [new file with mode: 0644]
wrt/node_modules/lazy-cache/README.md [new file with mode: 0644]
wrt/node_modules/lazy-cache/index.js [new file with mode: 0644]
wrt/node_modules/lazy-cache/package.json [new file with mode: 0644]
wrt/node_modules/longest/LICENSE [new file with mode: 0644]
wrt/node_modules/longest/README.md [new file with mode: 0644]
wrt/node_modules/longest/index.js [new file with mode: 0644]
wrt/node_modules/longest/package.json [new file with mode: 0644]
wrt/node_modules/match-stream/.idea/.name [new file with mode: 0644]
wrt/node_modules/match-stream/.idea/encodings.xml [new file with mode: 0644]
wrt/node_modules/match-stream/.idea/jsLibraryMappings.xml [new file with mode: 0644]
wrt/node_modules/match-stream/.idea/match-stream.iml [new file with mode: 0644]
wrt/node_modules/match-stream/.idea/misc.xml [new file with mode: 0644]
wrt/node_modules/match-stream/.idea/modules.xml [new file with mode: 0644]
wrt/node_modules/match-stream/.idea/scopes/scope_settings.xml [new file with mode: 0644]
wrt/node_modules/match-stream/.idea/vcs.xml [new file with mode: 0644]
wrt/node_modules/match-stream/.idea/workspace.xml [new file with mode: 0644]
wrt/node_modules/match-stream/.travis.yml [new file with mode: 0644]
wrt/node_modules/match-stream/LICENSE [new file with mode: 0644]
wrt/node_modules/match-stream/README.md [new file with mode: 0644]
wrt/node_modules/match-stream/examples/lorem.txt [new file with mode: 0644]
wrt/node_modules/match-stream/examples/split.js [new file with mode: 0644]
wrt/node_modules/match-stream/examples/until.js [new file with mode: 0644]
wrt/node_modules/match-stream/match.js [new file with mode: 0644]
wrt/node_modules/match-stream/package.json [new file with mode: 0644]
wrt/node_modules/match-stream/test/split.js [new file with mode: 0644]
wrt/node_modules/match-stream/test/until.js [new file with mode: 0644]
wrt/node_modules/media-typer/HISTORY.md [new file with mode: 0644]
wrt/node_modules/media-typer/LICENSE [new file with mode: 0644]
wrt/node_modules/media-typer/README.md [new file with mode: 0644]
wrt/node_modules/media-typer/index.js [new file with mode: 0644]
wrt/node_modules/media-typer/package.json [new file with mode: 0644]
wrt/node_modules/merge-descriptors/HISTORY.md [new file with mode: 0644]
wrt/node_modules/merge-descriptors/LICENSE [new file with mode: 0644]
wrt/node_modules/merge-descriptors/README.md [new file with mode: 0644]
wrt/node_modules/merge-descriptors/index.js [new file with mode: 0644]
wrt/node_modules/merge-descriptors/package.json [new file with mode: 0644]
wrt/node_modules/merge/.npmignore [new file with mode: 0644]
wrt/node_modules/merge/LICENSE [new file with mode: 0644]
wrt/node_modules/merge/README.md [new file with mode: 0644]
wrt/node_modules/merge/bower.json [new file with mode: 0644]
wrt/node_modules/merge/merge.js [new file with mode: 0644]
wrt/node_modules/merge/merge.min.js [new file with mode: 0644]
wrt/node_modules/merge/package.json [new file with mode: 0644]
wrt/node_modules/methods/HISTORY.md [new file with mode: 0644]
wrt/node_modules/methods/LICENSE [new file with mode: 0644]
wrt/node_modules/methods/README.md [new file with mode: 0644]
wrt/node_modules/methods/index.js [new file with mode: 0644]
wrt/node_modules/methods/package.json [new file with mode: 0644]
wrt/node_modules/mime-db/HISTORY.md [new file with mode: 0644]
wrt/node_modules/mime-db/LICENSE [new file with mode: 0644]
wrt/node_modules/mime-db/README.md [new file with mode: 0644]
wrt/node_modules/mime-db/db.json [new file with mode: 0644]
wrt/node_modules/mime-db/index.js [new file with mode: 0644]
wrt/node_modules/mime-db/package.json [new file with mode: 0644]
wrt/node_modules/mime-types/HISTORY.md [new file with mode: 0644]
wrt/node_modules/mime-types/LICENSE [new file with mode: 0644]
wrt/node_modules/mime-types/README.md [new file with mode: 0644]
wrt/node_modules/mime-types/index.js [new file with mode: 0644]
wrt/node_modules/mime-types/package.json [new file with mode: 0644]
wrt/node_modules/mime/.npmignore [new file with mode: 0644]
wrt/node_modules/mime/LICENSE [new file with mode: 0644]
wrt/node_modules/mime/README.md [new file with mode: 0644]
wrt/node_modules/mime/build/build.js [new file with mode: 0644]
wrt/node_modules/mime/build/test.js [new file with mode: 0644]
wrt/node_modules/mime/cli.js [new file with mode: 0755]
wrt/node_modules/mime/mime.js [new file with mode: 0644]
wrt/node_modules/mime/package.json [new file with mode: 0644]
wrt/node_modules/mime/types.json [new file with mode: 0644]
wrt/node_modules/minimatch/LICENSE [new file with mode: 0644]
wrt/node_modules/minimatch/README.md [new file with mode: 0644]
wrt/node_modules/minimatch/minimatch.js [new file with mode: 0644]
wrt/node_modules/minimatch/package.json [new file with mode: 0644]
wrt/node_modules/minimist/.travis.yml [new file with mode: 0644]
wrt/node_modules/minimist/LICENSE [new file with mode: 0644]
wrt/node_modules/minimist/example/parse.js [new file with mode: 0644]
wrt/node_modules/minimist/index.js [new file with mode: 0644]
wrt/node_modules/minimist/package.json [new file with mode: 0644]
wrt/node_modules/minimist/readme.markdown [new file with mode: 0644]
wrt/node_modules/minimist/test/dash.js [new file with mode: 0644]
wrt/node_modules/minimist/test/default_bool.js [new file with mode: 0644]
wrt/node_modules/minimist/test/dotted.js [new file with mode: 0644]
wrt/node_modules/minimist/test/long.js [new file with mode: 0644]
wrt/node_modules/minimist/test/parse.js [new file with mode: 0644]
wrt/node_modules/minimist/test/parse_modified.js [new file with mode: 0644]
wrt/node_modules/minimist/test/short.js [new file with mode: 0644]
wrt/node_modules/minimist/test/whitespace.js [new file with mode: 0644]
wrt/node_modules/mkdirp/.travis.yml [new file with mode: 0644]
wrt/node_modules/mkdirp/LICENSE [new file with mode: 0644]
wrt/node_modules/mkdirp/examples/pow.js [new file with mode: 0644]
wrt/node_modules/mkdirp/index.js [new file with mode: 0644]
wrt/node_modules/mkdirp/package.json [new file with mode: 0644]
wrt/node_modules/mkdirp/readme.markdown [new file with mode: 0644]
wrt/node_modules/mkdirp/test/chmod.js [new file with mode: 0644]
wrt/node_modules/mkdirp/test/clobber.js [new file with mode: 0644]
wrt/node_modules/mkdirp/test/mkdirp.js [new file with mode: 0644]
wrt/node_modules/mkdirp/test/opts_fs.js [new file with mode: 0644]
wrt/node_modules/mkdirp/test/opts_fs_sync.js [new file with mode: 0644]
wrt/node_modules/mkdirp/test/perm.js [new file with mode: 0644]
wrt/node_modules/mkdirp/test/perm_sync.js [new file with mode: 0644]
wrt/node_modules/mkdirp/test/race.js [new file with mode: 0644]
wrt/node_modules/mkdirp/test/rel.js [new file with mode: 0644]
wrt/node_modules/mkdirp/test/return.js [new file with mode: 0644]
wrt/node_modules/mkdirp/test/return_sync.js [new file with mode: 0644]
wrt/node_modules/mkdirp/test/root.js [new file with mode: 0644]
wrt/node_modules/mkdirp/test/sync.js [new file with mode: 0644]
wrt/node_modules/mkdirp/test/umask.js [new file with mode: 0644]
wrt/node_modules/mkdirp/test/umask_sync.js [new file with mode: 0644]
wrt/node_modules/ms/index.js [new file with mode: 0644]
wrt/node_modules/ms/license.md [new file with mode: 0644]
wrt/node_modules/ms/package.json [new file with mode: 0644]
wrt/node_modules/ms/readme.md [new file with mode: 0644]
wrt/node_modules/mv/.npmignore [new file with mode: 0644]
wrt/node_modules/mv/.travis.yml [new file with mode: 0644]
wrt/node_modules/mv/LICENSE [new file with mode: 0644]
wrt/node_modules/mv/README.md [new file with mode: 0644]
wrt/node_modules/mv/index.js [new file with mode: 0644]
wrt/node_modules/mv/node_modules/.bin/rimraf [new symlink]
wrt/node_modules/mv/node_modules/rimraf/LICENSE [new file with mode: 0644]
wrt/node_modules/mv/node_modules/rimraf/README.md [new file with mode: 0644]
wrt/node_modules/mv/node_modules/rimraf/bin.js [new file with mode: 0755]
wrt/node_modules/mv/node_modules/rimraf/package.json [new file with mode: 0644]
wrt/node_modules/mv/node_modules/rimraf/rimraf.js [new file with mode: 0644]
wrt/node_modules/mv/package.json [new file with mode: 0644]
wrt/node_modules/mv/test/a-file [new file with mode: 0644]
wrt/node_modules/mv/test/a-folder/another-file [new file with mode: 0644]
wrt/node_modules/mv/test/a-folder/another-folder/file3 [new file with mode: 0644]
wrt/node_modules/mv/test/test.js [new file with mode: 0644]
wrt/node_modules/natives/README.md [new file with mode: 0644]
wrt/node_modules/natives/index.js [new file with mode: 0644]
wrt/node_modules/natives/package.json [new file with mode: 0644]
wrt/node_modules/ncp/.npmignore [new file with mode: 0644]
wrt/node_modules/ncp/.travis.yml [new file with mode: 0644]
wrt/node_modules/ncp/LICENSE.md [new file with mode: 0644]
wrt/node_modules/ncp/README.md [new file with mode: 0644]
wrt/node_modules/ncp/bin/ncp [new file with mode: 0755]
wrt/node_modules/ncp/lib/ncp.js [new file with mode: 0644]
wrt/node_modules/ncp/package.json [new file with mode: 0644]
wrt/node_modules/ncp/test/modified-files/out/a [new file with mode: 0644]
wrt/node_modules/ncp/test/modified-files/src/a [new file with mode: 0644]
wrt/node_modules/ncp/test/ncp.js [new file with mode: 0644]
wrt/node_modules/ncp/test/regular-fixtures/src/a [new file with mode: 0644]
wrt/node_modules/ncp/test/regular-fixtures/src/b [new file with mode: 0644]
wrt/node_modules/ncp/test/regular-fixtures/src/c [new file with mode: 0644]
wrt/node_modules/ncp/test/regular-fixtures/src/d [new file with mode: 0644]
wrt/node_modules/ncp/test/regular-fixtures/src/e [new file with mode: 0644]
wrt/node_modules/ncp/test/regular-fixtures/src/f [new file with mode: 0644]
wrt/node_modules/ncp/test/regular-fixtures/src/sub/a [new file with mode: 0644]
wrt/node_modules/ncp/test/regular-fixtures/src/sub/b [new file with mode: 0644]
wrt/node_modules/ncp/test/symlink-fixtures/src/dir/bar [new file with mode: 0644]
wrt/node_modules/ncp/test/symlink-fixtures/src/foo [new file with mode: 0644]
wrt/node_modules/negotiator/HISTORY.md [new file with mode: 0644]
wrt/node_modules/negotiator/LICENSE [new file with mode: 0644]
wrt/node_modules/negotiator/README.md [new file with mode: 0644]
wrt/node_modules/negotiator/index.js [new file with mode: 0644]
wrt/node_modules/negotiator/lib/charset.js [new file with mode: 0644]
wrt/node_modules/negotiator/lib/encoding.js [new file with mode: 0644]
wrt/node_modules/negotiator/lib/language.js [new file with mode: 0644]
wrt/node_modules/negotiator/lib/mediaType.js [new file with mode: 0644]
wrt/node_modules/negotiator/package.json [new file with mode: 0644]
wrt/node_modules/node-constants/.npmignore [new file with mode: 0644]
wrt/node_modules/node-constants/LICENSE [new file with mode: 0644]
wrt/node_modules/node-constants/README.md [new file with mode: 0644]
wrt/node_modules/node-constants/examples/define.js [new file with mode: 0644]
wrt/node_modules/node-constants/examples/definer.js [new file with mode: 0644]
wrt/node_modules/node-constants/examples/not_exports.js [new file with mode: 0644]
wrt/node_modules/node-constants/examples/quick_definer.js [new file with mode: 0644]
wrt/node_modules/node-constants/index.js [new file with mode: 0644]
wrt/node_modules/node-constants/lib/index.js [new file with mode: 0644]
wrt/node_modules/node-constants/package.json [new file with mode: 0644]
wrt/node_modules/node-constants/test/main.js [new file with mode: 0644]
wrt/node_modules/node-constants/test/mocha.opts [new file with mode: 0644]
wrt/node_modules/node-uuid/.npmignore [new file with mode: 0644]
wrt/node_modules/node-uuid/LICENSE.md [new file with mode: 0644]
wrt/node_modules/node-uuid/README.md [new file with mode: 0644]
wrt/node_modules/node-uuid/benchmark/README.md [new file with mode: 0644]
wrt/node_modules/node-uuid/benchmark/bench.gnu [new file with mode: 0644]
wrt/node_modules/node-uuid/benchmark/bench.sh [new file with mode: 0755]
wrt/node_modules/node-uuid/benchmark/benchmark-native.c [new file with mode: 0644]
wrt/node_modules/node-uuid/benchmark/benchmark.js [new file with mode: 0644]
wrt/node_modules/node-uuid/bin/uuid [new file with mode: 0755]
wrt/node_modules/node-uuid/bower.json [new file with mode: 0644]
wrt/node_modules/node-uuid/component.json [new file with mode: 0644]
wrt/node_modules/node-uuid/lib/sha1-browser.js [new file with mode: 0644]
wrt/node_modules/node-uuid/package.json [new file with mode: 0644]
wrt/node_modules/node-uuid/test/compare_v1.js [new file with mode: 0644]
wrt/node_modules/node-uuid/test/test.html [new file with mode: 0644]
wrt/node_modules/node-uuid/test/test.js [new file with mode: 0644]
wrt/node_modules/node-uuid/uuid.js [new file with mode: 0644]
wrt/node_modules/node-uuid/v3.js [new file with mode: 0644]
wrt/node_modules/object-assign/index.js [new file with mode: 0644]
wrt/node_modules/object-assign/license [new file with mode: 0644]
wrt/node_modules/object-assign/package.json [new file with mode: 0644]
wrt/node_modules/object-assign/readme.md [new file with mode: 0644]
wrt/node_modules/object-component/.npmignore [new file with mode: 0644]
wrt/node_modules/object-component/History.md [new file with mode: 0644]
wrt/node_modules/object-component/Makefile [new file with mode: 0644]
wrt/node_modules/object-component/Readme.md [new file with mode: 0644]
wrt/node_modules/object-component/component.json [new file with mode: 0644]
wrt/node_modules/object-component/index.js [new file with mode: 0644]
wrt/node_modules/object-component/package.json [new file with mode: 0644]
wrt/node_modules/object-component/test/object.js [new file with mode: 0644]
wrt/node_modules/on-finished/HISTORY.md [new file with mode: 0644]
wrt/node_modules/on-finished/LICENSE [new file with mode: 0644]
wrt/node_modules/on-finished/README.md [new file with mode: 0644]
wrt/node_modules/on-finished/index.js [new file with mode: 0644]
wrt/node_modules/on-finished/package.json [new file with mode: 0644]
wrt/node_modules/once/LICENSE [new file with mode: 0644]
wrt/node_modules/once/README.md [new file with mode: 0644]
wrt/node_modules/once/once.js [new file with mode: 0644]
wrt/node_modules/once/package.json [new file with mode: 0644]
wrt/node_modules/over/.npmignore [new file with mode: 0644]
wrt/node_modules/over/README.md [new file with mode: 0644]
wrt/node_modules/over/overload.js [new file with mode: 0644]
wrt/node_modules/over/package.json [new file with mode: 0644]
wrt/node_modules/over/test/defFunctionsTest.js [new file with mode: 0644]
wrt/node_modules/over/test/overloadTest.js [new file with mode: 0644]
wrt/node_modules/parsejson/.npmignore [new file with mode: 0644]
wrt/node_modules/parsejson/LICENSE [new file with mode: 0644]
wrt/node_modules/parsejson/Makefile [new file with mode: 0644]
wrt/node_modules/parsejson/README.md [new file with mode: 0644]
wrt/node_modules/parsejson/index.js [new file with mode: 0644]
wrt/node_modules/parsejson/package.json [new file with mode: 0644]
wrt/node_modules/parsejson/test.js [new file with mode: 0644]
wrt/node_modules/parseqs/.npmignore [new file with mode: 0644]
wrt/node_modules/parseqs/LICENSE [new file with mode: 0644]
wrt/node_modules/parseqs/Makefile [new file with mode: 0644]
wrt/node_modules/parseqs/README.md [new file with mode: 0644]
wrt/node_modules/parseqs/index.js [new file with mode: 0644]
wrt/node_modules/parseqs/package.json [new file with mode: 0644]
wrt/node_modules/parseqs/test.js [new file with mode: 0644]
wrt/node_modules/parseuri/.npmignore [new file with mode: 0644]
wrt/node_modules/parseuri/History.md [new file with mode: 0644]
wrt/node_modules/parseuri/LICENSE [new file with mode: 0644]
wrt/node_modules/parseuri/Makefile [new file with mode: 0644]
wrt/node_modules/parseuri/README.md [new file with mode: 0644]
wrt/node_modules/parseuri/index.js [new file with mode: 0644]
wrt/node_modules/parseuri/package.json [new file with mode: 0644]
wrt/node_modules/parseuri/test.js [new file with mode: 0644]
wrt/node_modules/parseurl/HISTORY.md [new file with mode: 0644]
wrt/node_modules/parseurl/LICENSE [new file with mode: 0644]
wrt/node_modules/parseurl/README.md [new file with mode: 0644]
wrt/node_modules/parseurl/index.js [new file with mode: 0644]
wrt/node_modules/parseurl/package.json [new file with mode: 0644]
wrt/node_modules/path-is-absolute/index.js [new file with mode: 0644]
wrt/node_modules/path-is-absolute/license [new file with mode: 0644]
wrt/node_modules/path-is-absolute/package.json [new file with mode: 0644]
wrt/node_modules/path-is-absolute/readme.md [new file with mode: 0644]
wrt/node_modules/path-to-regexp/History.md [new file with mode: 0644]
wrt/node_modules/path-to-regexp/LICENSE [new file with mode: 0644]
wrt/node_modules/path-to-regexp/Readme.md [new file with mode: 0644]
wrt/node_modules/path-to-regexp/index.js [new file with mode: 0644]
wrt/node_modules/path-to-regexp/package.json [new file with mode: 0644]
wrt/node_modules/proxy-addr/HISTORY.md [new file with mode: 0644]
wrt/node_modules/proxy-addr/LICENSE [new file with mode: 0644]
wrt/node_modules/proxy-addr/README.md [new file with mode: 0644]
wrt/node_modules/proxy-addr/index.js [new file with mode: 0644]
wrt/node_modules/proxy-addr/package.json [new file with mode: 0644]
wrt/node_modules/pullstream/.npmignore [new file with mode: 0644]
wrt/node_modules/pullstream/.travis.yml [new file with mode: 0644]
wrt/node_modules/pullstream/.vimrc [new file with mode: 0644]
wrt/node_modules/pullstream/LICENSE [new file with mode: 0644]
wrt/node_modules/pullstream/README.md [new file with mode: 0644]
wrt/node_modules/pullstream/examples/loremIpsum.txt [new file with mode: 0644]
wrt/node_modules/pullstream/examples/pullFromFile.js [new file with mode: 0644]
wrt/node_modules/pullstream/package.json [new file with mode: 0644]
wrt/node_modules/pullstream/pullstream.js [new file with mode: 0644]
wrt/node_modules/pullstream/test/pullStreamTest.js [new file with mode: 0644]
wrt/node_modules/pullstream/test/testFile.txt [new file with mode: 0644]
wrt/node_modules/qs/.editorconfig [new file with mode: 0644]
wrt/node_modules/qs/.eslintignore [new file with mode: 0644]
wrt/node_modules/qs/.eslintrc [new file with mode: 0644]
wrt/node_modules/qs/CHANGELOG.md [new file with mode: 0644]
wrt/node_modules/qs/LICENSE [new file with mode: 0644]
wrt/node_modules/qs/README.md [new file with mode: 0644]
wrt/node_modules/qs/dist/qs.js [new file with mode: 0644]
wrt/node_modules/qs/lib/formats.js [new file with mode: 0644]
wrt/node_modules/qs/lib/index.js [new file with mode: 0644]
wrt/node_modules/qs/lib/parse.js [new file with mode: 0644]
wrt/node_modules/qs/lib/stringify.js [new file with mode: 0644]
wrt/node_modules/qs/lib/utils.js [new file with mode: 0644]
wrt/node_modules/qs/package.json [new file with mode: 0644]
wrt/node_modules/qs/test/.eslintrc [new file with mode: 0644]
wrt/node_modules/qs/test/index.js [new file with mode: 0644]
wrt/node_modules/qs/test/parse.js [new file with mode: 0644]
wrt/node_modules/qs/test/stringify.js [new file with mode: 0644]
wrt/node_modules/qs/test/utils.js [new file with mode: 0644]
wrt/node_modules/range-parser/HISTORY.md [new file with mode: 0644]
wrt/node_modules/range-parser/LICENSE [new file with mode: 0644]
wrt/node_modules/range-parser/README.md [new file with mode: 0644]
wrt/node_modules/range-parser/index.js [new file with mode: 0644]
wrt/node_modules/range-parser/package.json [new file with mode: 0644]
wrt/node_modules/readable-stream/.npmignore [new file with mode: 0644]
wrt/node_modules/readable-stream/LICENSE [new file with mode: 0644]
wrt/node_modules/readable-stream/README.md [new file with mode: 0644]
wrt/node_modules/readable-stream/duplex.js [new file with mode: 0644]
wrt/node_modules/readable-stream/lib/_stream_duplex.js [new file with mode: 0644]
wrt/node_modules/readable-stream/lib/_stream_passthrough.js [new file with mode: 0644]
wrt/node_modules/readable-stream/lib/_stream_readable.js [new file with mode: 0644]
wrt/node_modules/readable-stream/lib/_stream_transform.js [new file with mode: 0644]
wrt/node_modules/readable-stream/lib/_stream_writable.js [new file with mode: 0644]
wrt/node_modules/readable-stream/package.json [new file with mode: 0644]
wrt/node_modules/readable-stream/passthrough.js [new file with mode: 0644]
wrt/node_modules/readable-stream/readable.js [new file with mode: 0644]
wrt/node_modules/readable-stream/transform.js [new file with mode: 0644]
wrt/node_modules/readable-stream/writable.js [new file with mode: 0644]
wrt/node_modules/repeat-string/LICENSE [new file with mode: 0644]
wrt/node_modules/repeat-string/README.md [new file with mode: 0644]
wrt/node_modules/repeat-string/index.js [new file with mode: 0644]
wrt/node_modules/repeat-string/package.json [new file with mode: 0644]
wrt/node_modules/right-align/LICENSE [new file with mode: 0644]
wrt/node_modules/right-align/README.md [new file with mode: 0644]
wrt/node_modules/right-align/index.js [new file with mode: 0644]
wrt/node_modules/right-align/package.json [new file with mode: 0644]
wrt/node_modules/rimraf/LICENSE [new file with mode: 0644]
wrt/node_modules/rimraf/README.md [new file with mode: 0644]
wrt/node_modules/rimraf/bin.js [new file with mode: 0755]
wrt/node_modules/rimraf/node_modules/glob/LICENSE [new file with mode: 0644]
wrt/node_modules/rimraf/node_modules/glob/README.md [new file with mode: 0644]
wrt/node_modules/rimraf/node_modules/glob/changelog.md [new file with mode: 0644]
wrt/node_modules/rimraf/node_modules/glob/common.js [new file with mode: 0644]
wrt/node_modules/rimraf/node_modules/glob/glob.js [new file with mode: 0644]
wrt/node_modules/rimraf/node_modules/glob/package.json [new file with mode: 0644]
wrt/node_modules/rimraf/node_modules/glob/sync.js [new file with mode: 0644]
wrt/node_modules/rimraf/package.json [new file with mode: 0644]
wrt/node_modules/rimraf/rimraf.js [new file with mode: 0644]
wrt/node_modules/run-series/.travis.yml [new file with mode: 0644]
wrt/node_modules/run-series/.zuul.yml [new file with mode: 0644]
wrt/node_modules/run-series/LICENSE [new file with mode: 0644]
wrt/node_modules/run-series/README.md [new file with mode: 0644]
wrt/node_modules/run-series/img.png [new file with mode: 0644]
wrt/node_modules/run-series/index.js [new file with mode: 0644]
wrt/node_modules/run-series/package.json [new file with mode: 0644]
wrt/node_modules/run-series/test/basic.js [new file with mode: 0644]
wrt/node_modules/run-series/test/empty-array.js [new file with mode: 0644]
wrt/node_modules/run-series/test/error.js [new file with mode: 0644]
wrt/node_modules/run-series/test/no-callback.js [new file with mode: 0644]
wrt/node_modules/safe-buffer/.travis.yml [new file with mode: 0644]
wrt/node_modules/safe-buffer/LICENSE [new file with mode: 0644]
wrt/node_modules/safe-buffer/README.md [new file with mode: 0644]
wrt/node_modules/safe-buffer/browser.js [new file with mode: 0644]
wrt/node_modules/safe-buffer/index.js [new file with mode: 0644]
wrt/node_modules/safe-buffer/package.json [new file with mode: 0644]
wrt/node_modules/safe-buffer/test.js [new file with mode: 0644]
wrt/node_modules/sax/LICENSE [new file with mode: 0644]
wrt/node_modules/sax/README.md [new file with mode: 0644]
wrt/node_modules/sax/lib/sax.js [new file with mode: 0644]
wrt/node_modules/sax/package.json [new file with mode: 0644]
wrt/node_modules/send/HISTORY.md [new file with mode: 0644]
wrt/node_modules/send/LICENSE [new file with mode: 0644]
wrt/node_modules/send/README.md [new file with mode: 0644]
wrt/node_modules/send/index.js [new file with mode: 0644]
wrt/node_modules/send/node_modules/debug/.coveralls.yml [new file with mode: 0644]
wrt/node_modules/send/node_modules/debug/.eslintrc [new file with mode: 0644]
wrt/node_modules/send/node_modules/debug/.npmignore [new file with mode: 0644]
wrt/node_modules/send/node_modules/debug/.travis.yml [new file with mode: 0644]
wrt/node_modules/send/node_modules/debug/CHANGELOG.md [new file with mode: 0644]
wrt/node_modules/send/node_modules/debug/LICENSE [new file with mode: 0644]
wrt/node_modules/send/node_modules/debug/Makefile [new file with mode: 0644]
wrt/node_modules/send/node_modules/debug/README.md [new file with mode: 0644]
wrt/node_modules/send/node_modules/debug/component.json [new file with mode: 0644]
wrt/node_modules/send/node_modules/debug/karma.conf.js [new file with mode: 0644]
wrt/node_modules/send/node_modules/debug/node.js [new file with mode: 0644]
wrt/node_modules/send/node_modules/debug/package.json [new file with mode: 0644]
wrt/node_modules/send/node_modules/debug/src/browser.js [new file with mode: 0644]
wrt/node_modules/send/node_modules/debug/src/debug.js [new file with mode: 0644]
wrt/node_modules/send/node_modules/debug/src/index.js [new file with mode: 0644]
wrt/node_modules/send/node_modules/debug/src/node.js [new file with mode: 0644]
wrt/node_modules/send/package.json [new file with mode: 0644]
wrt/node_modules/serve-static/HISTORY.md [new file with mode: 0644]
wrt/node_modules/serve-static/LICENSE [new file with mode: 0644]
wrt/node_modules/serve-static/README.md [new file with mode: 0644]
wrt/node_modules/serve-static/index.js [new file with mode: 0644]
wrt/node_modules/serve-static/package.json [new file with mode: 0644]
wrt/node_modules/setimmediate/LICENSE.txt [new file with mode: 0644]
wrt/node_modules/setimmediate/package.json [new file with mode: 0644]
wrt/node_modules/setimmediate/setImmediate.js [new file with mode: 0644]
wrt/node_modules/setprototypeof/LICENSE [new file with mode: 0644]
wrt/node_modules/setprototypeof/README.md [new file with mode: 0644]
wrt/node_modules/setprototypeof/index.js [new file with mode: 0644]
wrt/node_modules/setprototypeof/package.json [new file with mode: 0644]
wrt/node_modules/slice-stream/.travis.yml [new file with mode: 0644]
wrt/node_modules/slice-stream/LICENSE [new file with mode: 0644]
wrt/node_modules/slice-stream/README.md [new file with mode: 0644]
wrt/node_modules/slice-stream/examples/until.js [new file with mode: 0644]
wrt/node_modules/slice-stream/package.json [new file with mode: 0644]
wrt/node_modules/slice-stream/slicestream.js [new file with mode: 0644]
wrt/node_modules/slice-stream/test/until.js [new file with mode: 0644]
wrt/node_modules/socket.io-adapter/.npmignore [new file with mode: 0644]
wrt/node_modules/socket.io-adapter/LICENSE [new file with mode: 0644]
wrt/node_modules/socket.io-adapter/Readme.md [new file with mode: 0644]
wrt/node_modules/socket.io-adapter/index.js [new file with mode: 0644]
wrt/node_modules/socket.io-adapter/package.json [new file with mode: 0644]
wrt/node_modules/socket.io-client/History.md [new file with mode: 0644]
wrt/node_modules/socket.io-client/LICENSE [new file with mode: 0644]
wrt/node_modules/socket.io-client/README.md [new file with mode: 0644]
wrt/node_modules/socket.io-client/dist/socket.io.js [new file with mode: 0644]
wrt/node_modules/socket.io-client/dist/socket.io.js.map [new file with mode: 0644]
wrt/node_modules/socket.io-client/dist/socket.io.slim.js [new file with mode: 0644]
wrt/node_modules/socket.io-client/dist/socket.io.slim.js.map [new file with mode: 0644]
wrt/node_modules/socket.io-client/lib/index.js [new file with mode: 0644]
wrt/node_modules/socket.io-client/lib/manager.js [new file with mode: 0644]
wrt/node_modules/socket.io-client/lib/on.js [new file with mode: 0644]
wrt/node_modules/socket.io-client/lib/socket.js [new file with mode: 0644]
wrt/node_modules/socket.io-client/lib/url.js [new file with mode: 0644]
wrt/node_modules/socket.io-client/node_modules/debug/.coveralls.yml [new file with mode: 0644]
wrt/node_modules/socket.io-client/node_modules/debug/.eslintrc [new file with mode: 0644]
wrt/node_modules/socket.io-client/node_modules/debug/.npmignore [new file with mode: 0644]
wrt/node_modules/socket.io-client/node_modules/debug/.travis.yml [new file with mode: 0644]
wrt/node_modules/socket.io-client/node_modules/debug/CHANGELOG.md [new file with mode: 0644]
wrt/node_modules/socket.io-client/node_modules/debug/LICENSE [new file with mode: 0644]
wrt/node_modules/socket.io-client/node_modules/debug/Makefile [new file with mode: 0644]
wrt/node_modules/socket.io-client/node_modules/debug/README.md [new file with mode: 0644]
wrt/node_modules/socket.io-client/node_modules/debug/component.json [new file with mode: 0644]
wrt/node_modules/socket.io-client/node_modules/debug/karma.conf.js [new file with mode: 0644]
wrt/node_modules/socket.io-client/node_modules/debug/node.js [new file with mode: 0644]
wrt/node_modules/socket.io-client/node_modules/debug/package.json [new file with mode: 0644]
wrt/node_modules/socket.io-client/node_modules/debug/src/browser.js [new file with mode: 0644]
wrt/node_modules/socket.io-client/node_modules/debug/src/debug.js [new file with mode: 0644]
wrt/node_modules/socket.io-client/node_modules/debug/src/index.js [new file with mode: 0644]
wrt/node_modules/socket.io-client/node_modules/debug/src/inspector-log.js [new file with mode: 0644]
wrt/node_modules/socket.io-client/node_modules/debug/src/node.js [new file with mode: 0644]
wrt/node_modules/socket.io-client/package.json [new file with mode: 0644]
wrt/node_modules/socket.io-parser/History.md [new file with mode: 0644]
wrt/node_modules/socket.io-parser/LICENSE [new file with mode: 0644]
wrt/node_modules/socket.io-parser/Readme.md [new file with mode: 0644]
wrt/node_modules/socket.io-parser/binary.js [new file with mode: 0644]
wrt/node_modules/socket.io-parser/index.js [new file with mode: 0644]
wrt/node_modules/socket.io-parser/is-buffer.js [new file with mode: 0644]
wrt/node_modules/socket.io-parser/node_modules/debug/.coveralls.yml [new file with mode: 0644]
wrt/node_modules/socket.io-parser/node_modules/debug/.eslintrc [new file with mode: 0644]
wrt/node_modules/socket.io-parser/node_modules/debug/.npmignore [new file with mode: 0644]
wrt/node_modules/socket.io-parser/node_modules/debug/.travis.yml [new file with mode: 0644]
wrt/node_modules/socket.io-parser/node_modules/debug/CHANGELOG.md [new file with mode: 0644]
wrt/node_modules/socket.io-parser/node_modules/debug/LICENSE [new file with mode: 0644]
wrt/node_modules/socket.io-parser/node_modules/debug/Makefile [new file with mode: 0644]
wrt/node_modules/socket.io-parser/node_modules/debug/README.md [new file with mode: 0644]
wrt/node_modules/socket.io-parser/node_modules/debug/component.json [new file with mode: 0644]
wrt/node_modules/socket.io-parser/node_modules/debug/karma.conf.js [new file with mode: 0644]
wrt/node_modules/socket.io-parser/node_modules/debug/node.js [new file with mode: 0644]
wrt/node_modules/socket.io-parser/node_modules/debug/package.json [new file with mode: 0644]
wrt/node_modules/socket.io-parser/node_modules/debug/src/browser.js [new file with mode: 0644]
wrt/node_modules/socket.io-parser/node_modules/debug/src/debug.js [new file with mode: 0644]
wrt/node_modules/socket.io-parser/node_modules/debug/src/index.js [new file with mode: 0644]
wrt/node_modules/socket.io-parser/node_modules/debug/src/inspector-log.js [new file with mode: 0644]
wrt/node_modules/socket.io-parser/node_modules/debug/src/node.js [new file with mode: 0644]
wrt/node_modules/socket.io-parser/node_modules/isarray/README.md [new file with mode: 0644]
wrt/node_modules/socket.io-parser/node_modules/isarray/index.js [new file with mode: 0644]
wrt/node_modules/socket.io-parser/node_modules/isarray/package.json [new file with mode: 0644]
wrt/node_modules/socket.io-parser/package.json [new file with mode: 0644]
wrt/node_modules/socket.io/History.md [new file with mode: 0644]
wrt/node_modules/socket.io/LICENSE [new file with mode: 0644]
wrt/node_modules/socket.io/Readme.md [new file with mode: 0644]
wrt/node_modules/socket.io/lib/client.js [new file with mode: 0644]
wrt/node_modules/socket.io/lib/index.js [new file with mode: 0644]
wrt/node_modules/socket.io/lib/namespace.js [new file with mode: 0644]
wrt/node_modules/socket.io/lib/socket.js [new file with mode: 0644]
wrt/node_modules/socket.io/node_modules/debug/.coveralls.yml [new file with mode: 0644]
wrt/node_modules/socket.io/node_modules/debug/.eslintrc [new file with mode: 0644]
wrt/node_modules/socket.io/node_modules/debug/.npmignore [new file with mode: 0644]
wrt/node_modules/socket.io/node_modules/debug/.travis.yml [new file with mode: 0644]
wrt/node_modules/socket.io/node_modules/debug/CHANGELOG.md [new file with mode: 0644]
wrt/node_modules/socket.io/node_modules/debug/LICENSE [new file with mode: 0644]
wrt/node_modules/socket.io/node_modules/debug/Makefile [new file with mode: 0644]
wrt/node_modules/socket.io/node_modules/debug/README.md [new file with mode: 0644]
wrt/node_modules/socket.io/node_modules/debug/component.json [new file with mode: 0644]
wrt/node_modules/socket.io/node_modules/debug/karma.conf.js [new file with mode: 0644]
wrt/node_modules/socket.io/node_modules/debug/node.js [new file with mode: 0644]
wrt/node_modules/socket.io/node_modules/debug/package.json [new file with mode: 0644]
wrt/node_modules/socket.io/node_modules/debug/src/browser.js [new file with mode: 0644]
wrt/node_modules/socket.io/node_modules/debug/src/debug.js [new file with mode: 0644]
wrt/node_modules/socket.io/node_modules/debug/src/index.js [new file with mode: 0644]
wrt/node_modules/socket.io/node_modules/debug/src/inspector-log.js [new file with mode: 0644]
wrt/node_modules/socket.io/node_modules/debug/src/node.js [new file with mode: 0644]
wrt/node_modules/socket.io/package.json [new file with mode: 0644]
wrt/node_modules/sprintf-js/.editorconfig [new file with mode: 0644]
wrt/node_modules/sprintf-js/.eslintignore [new file with mode: 0644]
wrt/node_modules/sprintf-js/.eslintrc.js [new file with mode: 0644]
wrt/node_modules/sprintf-js/.npmignore [new file with mode: 0644]
wrt/node_modules/sprintf-js/.travis.yml [new file with mode: 0644]
wrt/node_modules/sprintf-js/CHANGELOG.md [new file with mode: 0644]
wrt/node_modules/sprintf-js/CONTRIBUTORS [new file with mode: 0644]
wrt/node_modules/sprintf-js/LICENSE [new file with mode: 0644]
wrt/node_modules/sprintf-js/README.md [new file with mode: 0644]
wrt/node_modules/sprintf-js/benchmark/benchmark.js [new file with mode: 0644]
wrt/node_modules/sprintf-js/bower.json [new file with mode: 0644]
wrt/node_modules/sprintf-js/demo/angular.html [new file with mode: 0644]
wrt/node_modules/sprintf-js/dist/.gitattributes [new file with mode: 0644]
wrt/node_modules/sprintf-js/dist/angular-sprintf.min.js [new file with mode: 0644]
wrt/node_modules/sprintf-js/dist/angular-sprintf.min.js.map [new file with mode: 0644]
wrt/node_modules/sprintf-js/dist/sprintf.min.js [new file with mode: 0644]
wrt/node_modules/sprintf-js/dist/sprintf.min.js.map [new file with mode: 0644]
wrt/node_modules/sprintf-js/gulpfile.js [new file with mode: 0644]
wrt/node_modules/sprintf-js/package.json [new file with mode: 0644]
wrt/node_modules/sprintf-js/src/angular-sprintf.js [new file with mode: 0644]
wrt/node_modules/sprintf-js/src/sprintf.js [new file with mode: 0644]
wrt/node_modules/sprintf-js/test/test.js [new file with mode: 0644]
wrt/node_modules/sprintf-js/test/test_validation.js [new file with mode: 0644]
wrt/node_modules/statuses/HISTORY.md [new file with mode: 0644]
wrt/node_modules/statuses/LICENSE [new file with mode: 0644]
wrt/node_modules/statuses/README.md [new file with mode: 0644]
wrt/node_modules/statuses/codes.json [new file with mode: 0644]
wrt/node_modules/statuses/index.js [new file with mode: 0644]
wrt/node_modules/statuses/package.json [new file with mode: 0644]
wrt/node_modules/string_decoder/.npmignore [new file with mode: 0644]
wrt/node_modules/string_decoder/LICENSE [new file with mode: 0644]
wrt/node_modules/string_decoder/README.md [new file with mode: 0644]
wrt/node_modules/string_decoder/index.js [new file with mode: 0644]
wrt/node_modules/string_decoder/package.json [new file with mode: 0644]
wrt/node_modules/strip-ansi/cli.js [new file with mode: 0755]
wrt/node_modules/strip-ansi/index.js [new file with mode: 0644]
wrt/node_modules/strip-ansi/package.json [new file with mode: 0644]
wrt/node_modules/strip-ansi/readme.md [new file with mode: 0644]
wrt/node_modules/supports-color/browser.js [new file with mode: 0644]
wrt/node_modules/supports-color/index.js [new file with mode: 0644]
wrt/node_modules/supports-color/license [new file with mode: 0644]
wrt/node_modules/supports-color/package.json [new file with mode: 0644]
wrt/node_modules/supports-color/readme.md [new file with mode: 0644]
wrt/node_modules/to-array/.npmignore [new file with mode: 0644]
wrt/node_modules/to-array/LICENCE [new file with mode: 0644]
wrt/node_modules/to-array/README.md [new file with mode: 0644]
wrt/node_modules/to-array/index.js [new file with mode: 0644]
wrt/node_modules/to-array/package.json [new file with mode: 0644]
wrt/node_modules/traverse/.npmignore [new file with mode: 0644]
wrt/node_modules/traverse/LICENSE [new file with mode: 0644]
wrt/node_modules/traverse/README.markdown [new file with mode: 0644]
wrt/node_modules/traverse/examples/json.js [new file with mode: 0755]
wrt/node_modules/traverse/examples/leaves.js [new file with mode: 0755]
wrt/node_modules/traverse/examples/negative.js [new file with mode: 0755]
wrt/node_modules/traverse/examples/stringify.js [new file with mode: 0755]
wrt/node_modules/traverse/index.js [new file with mode: 0755]
wrt/node_modules/traverse/package.json [new file with mode: 0644]
wrt/node_modules/traverse/test/circular.js [new file with mode: 0644]
wrt/node_modules/traverse/test/date.js [new file with mode: 0644]
wrt/node_modules/traverse/test/equal.js [new file with mode: 0644]
wrt/node_modules/traverse/test/instance.js [new file with mode: 0644]
wrt/node_modules/traverse/test/interface.js [new file with mode: 0644]
wrt/node_modules/traverse/test/json.js [new file with mode: 0644]
wrt/node_modules/traverse/test/leaves.js [new file with mode: 0644]
wrt/node_modules/traverse/test/mutability.js [new file with mode: 0644]
wrt/node_modules/traverse/test/negative.js [new file with mode: 0644]
wrt/node_modules/traverse/test/obj.js [new file with mode: 0644]
wrt/node_modules/traverse/test/stop.js [new file with mode: 0644]
wrt/node_modules/traverse/test/stringify.js [new file with mode: 0644]
wrt/node_modules/traverse/test/super_deep.js [new file with mode: 0644]
wrt/node_modules/type-is/HISTORY.md [new file with mode: 0644]
wrt/node_modules/type-is/LICENSE [new file with mode: 0644]
wrt/node_modules/type-is/README.md [new file with mode: 0644]
wrt/node_modules/type-is/index.js [new file with mode: 0644]
wrt/node_modules/type-is/package.json [new file with mode: 0644]
wrt/node_modules/ultron/LICENSE [new file with mode: 0644]
wrt/node_modules/ultron/index.js [new file with mode: 0644]
wrt/node_modules/ultron/package.json [new file with mode: 0644]
wrt/node_modules/underscore-plus/LICENSE.md [new file with mode: 0644]
wrt/node_modules/underscore-plus/README.md [new file with mode: 0644]
wrt/node_modules/underscore-plus/lib/underscore-plus.js [new file with mode: 0644]
wrt/node_modules/underscore-plus/package.json [new file with mode: 0644]
wrt/node_modules/underscore.string/.editorconfig [new file with mode: 0644]
wrt/node_modules/underscore.string/.eslintignore [new file with mode: 0644]
wrt/node_modules/underscore.string/.eslintrc [new file with mode: 0644]
wrt/node_modules/underscore.string/.npmignore [new file with mode: 0644]
wrt/node_modules/underscore.string/.travis.yml [new file with mode: 0644]
wrt/node_modules/underscore.string/CHANGELOG.markdown [new file with mode: 0644]
wrt/node_modules/underscore.string/CONTRIBUTING.markdown [new file with mode: 0644]
wrt/node_modules/underscore.string/README.markdown [new file with mode: 0644]
wrt/node_modules/underscore.string/bower.json [new file with mode: 0644]
wrt/node_modules/underscore.string/camelize.js [new file with mode: 0644]
wrt/node_modules/underscore.string/capitalize.js [new file with mode: 0644]
wrt/node_modules/underscore.string/chars.js [new file with mode: 0644]
wrt/node_modules/underscore.string/chop.js [new file with mode: 0644]
wrt/node_modules/underscore.string/classify.js [new file with mode: 0644]
wrt/node_modules/underscore.string/clean.js [new file with mode: 0644]
wrt/node_modules/underscore.string/cleanDiacritics.js [new file with mode: 0644]
wrt/node_modules/underscore.string/component.json [new file with mode: 0644]
wrt/node_modules/underscore.string/count.js [new file with mode: 0644]
wrt/node_modules/underscore.string/dasherize.js [new file with mode: 0644]
wrt/node_modules/underscore.string/decapitalize.js [new file with mode: 0644]
wrt/node_modules/underscore.string/dedent.js [new file with mode: 0644]
wrt/node_modules/underscore.string/dist/underscore.string.js [new file with mode: 0644]
wrt/node_modules/underscore.string/dist/underscore.string.min.js [new file with mode: 0644]
wrt/node_modules/underscore.string/endsWith.js [new file with mode: 0644]
wrt/node_modules/underscore.string/escapeHTML.js [new file with mode: 0644]
wrt/node_modules/underscore.string/exports.js [new file with mode: 0644]
wrt/node_modules/underscore.string/helper/adjacent.js [new file with mode: 0644]
wrt/node_modules/underscore.string/helper/defaultToWhiteSpace.js [new file with mode: 0644]
wrt/node_modules/underscore.string/helper/escapeChars.js [new file with mode: 0644]
wrt/node_modules/underscore.string/helper/escapeRegExp.js [new file with mode: 0644]
wrt/node_modules/underscore.string/helper/htmlEntities.js [new file with mode: 0644]
wrt/node_modules/underscore.string/helper/makeString.js [new file with mode: 0644]
wrt/node_modules/underscore.string/helper/strRepeat.js [new file with mode: 0644]
wrt/node_modules/underscore.string/helper/toPositive.js [new file with mode: 0644]
wrt/node_modules/underscore.string/humanize.js [new file with mode: 0644]
wrt/node_modules/underscore.string/include.js [new file with mode: 0644]
wrt/node_modules/underscore.string/index.js [new file with mode: 0644]
wrt/node_modules/underscore.string/insert.js [new file with mode: 0644]
wrt/node_modules/underscore.string/isBlank.js [new file with mode: 0644]
wrt/node_modules/underscore.string/join.js [new file with mode: 0644]
wrt/node_modules/underscore.string/levenshtein.js [new file with mode: 0644]
wrt/node_modules/underscore.string/lines.js [new file with mode: 0644]
wrt/node_modules/underscore.string/lpad.js [new file with mode: 0644]
wrt/node_modules/underscore.string/lrpad.js [new file with mode: 0644]
wrt/node_modules/underscore.string/ltrim.js [new file with mode: 0644]
wrt/node_modules/underscore.string/map.js [new file with mode: 0644]
wrt/node_modules/underscore.string/meteor-post.js [new file with mode: 0644]
wrt/node_modules/underscore.string/meteor-pre.js [new file with mode: 0644]
wrt/node_modules/underscore.string/naturalCmp.js [new file with mode: 0644]
wrt/node_modules/underscore.string/numberFormat.js [new file with mode: 0644]
wrt/node_modules/underscore.string/package.js [new file with mode: 0644]
wrt/node_modules/underscore.string/package.json [new file with mode: 0644]
wrt/node_modules/underscore.string/pad.js [new file with mode: 0644]
wrt/node_modules/underscore.string/pred.js [new file with mode: 0644]
wrt/node_modules/underscore.string/prune.js [new file with mode: 0644]
wrt/node_modules/underscore.string/quote.js [new file with mode: 0644]
wrt/node_modules/underscore.string/repeat.js [new file with mode: 0644]
wrt/node_modules/underscore.string/replaceAll.js [new file with mode: 0644]
wrt/node_modules/underscore.string/reverse.js [new file with mode: 0644]
wrt/node_modules/underscore.string/rpad.js [new file with mode: 0644]
wrt/node_modules/underscore.string/rtrim.js [new file with mode: 0644]
wrt/node_modules/underscore.string/slugify.js [new file with mode: 0644]
wrt/node_modules/underscore.string/splice.js [new file with mode: 0644]
wrt/node_modules/underscore.string/sprintf.js [new file with mode: 0644]
wrt/node_modules/underscore.string/startsWith.js [new file with mode: 0644]
wrt/node_modules/underscore.string/strLeft.js [new file with mode: 0644]
wrt/node_modules/underscore.string/strLeftBack.js [new file with mode: 0644]
wrt/node_modules/underscore.string/strRight.js [new file with mode: 0644]
wrt/node_modules/underscore.string/strRightBack.js [new file with mode: 0644]
wrt/node_modules/underscore.string/stripTags.js [new file with mode: 0644]
wrt/node_modules/underscore.string/succ.js [new file with mode: 0644]
wrt/node_modules/underscore.string/surround.js [new file with mode: 0644]
wrt/node_modules/underscore.string/swapCase.js [new file with mode: 0644]
wrt/node_modules/underscore.string/titleize.js [new file with mode: 0644]
wrt/node_modules/underscore.string/toBoolean.js [new file with mode: 0644]
wrt/node_modules/underscore.string/toNumber.js [new file with mode: 0644]
wrt/node_modules/underscore.string/toSentence.js [new file with mode: 0644]
wrt/node_modules/underscore.string/toSentenceSerial.js [new file with mode: 0644]
wrt/node_modules/underscore.string/trim.js [new file with mode: 0644]
wrt/node_modules/underscore.string/truncate.js [new file with mode: 0644]
wrt/node_modules/underscore.string/underscored.js [new file with mode: 0644]
wrt/node_modules/underscore.string/unescapeHTML.js [new file with mode: 0644]
wrt/node_modules/underscore.string/unquote.js [new file with mode: 0644]
wrt/node_modules/underscore.string/vsprintf.js [new file with mode: 0644]
wrt/node_modules/underscore.string/words.js [new file with mode: 0644]
wrt/node_modules/underscore.string/wrap.js [new file with mode: 0644]
wrt/node_modules/underscore/LICENSE [new file with mode: 0644]
wrt/node_modules/underscore/README.md [new file with mode: 0644]
wrt/node_modules/underscore/package.json [new file with mode: 0644]
wrt/node_modules/underscore/underscore-min.js [new file with mode: 0644]
wrt/node_modules/underscore/underscore.js [new file with mode: 0644]
wrt/node_modules/unpipe/HISTORY.md [new file with mode: 0644]
wrt/node_modules/unpipe/LICENSE [new file with mode: 0644]
wrt/node_modules/unpipe/README.md [new file with mode: 0644]
wrt/node_modules/unpipe/index.js [new file with mode: 0644]
wrt/node_modules/unpipe/package.json [new file with mode: 0644]
wrt/node_modules/unzip/.npmignore [new file with mode: 0644]
wrt/node_modules/unzip/.travis.yml [new file with mode: 0644]
wrt/node_modules/unzip/LICENSE [new file with mode: 0644]
wrt/node_modules/unzip/README.md [new file with mode: 0644]
wrt/node_modules/unzip/lib/entry.js [new file with mode: 0644]
wrt/node_modules/unzip/lib/extract.js [new file with mode: 0644]
wrt/node_modules/unzip/lib/parse.js [new file with mode: 0644]
wrt/node_modules/unzip/package.json [new file with mode: 0644]
wrt/node_modules/unzip/test/compressed.js [new file with mode: 0644]
wrt/node_modules/unzip/test/fileSizeUnknownFlag.js [new file with mode: 0644]
wrt/node_modules/unzip/test/pipeSingleEntry.js [new file with mode: 0644]
wrt/node_modules/unzip/test/uncompressed.js [new file with mode: 0644]
wrt/node_modules/unzip/testData/compressed-OSX-Finder/archive.zip [new file with mode: 0644]
wrt/node_modules/unzip/testData/compressed-OSX-Finder/inflated/dir/fileInsideDir.txt [new file with mode: 0644]
wrt/node_modules/unzip/testData/compressed-OSX-Finder/inflated/file.txt [new file with mode: 0644]
wrt/node_modules/unzip/testData/compressed-flags-set/archive.zip [new file with mode: 0644]
wrt/node_modules/unzip/testData/compressed-flags-set/inflated/dir/fileInsideDir.txt [new file with mode: 0644]
wrt/node_modules/unzip/testData/compressed-flags-set/inflated/file.txt [new file with mode: 0644]
wrt/node_modules/unzip/testData/compressed-standard/archive.zip [new file with mode: 0644]
wrt/node_modules/unzip/testData/compressed-standard/inflated/dir/fileInsideDir.txt [new file with mode: 0644]
wrt/node_modules/unzip/testData/compressed-standard/inflated/file.txt [new file with mode: 0644]
wrt/node_modules/unzip/testData/uncompressed/archive.zip [new file with mode: 0644]
wrt/node_modules/unzip/testData/uncompressed/inflated/dir/fileInsideDir.txt [new file with mode: 0644]
wrt/node_modules/unzip/testData/uncompressed/inflated/file.txt [new file with mode: 0644]
wrt/node_modules/unzip/unzip.js [new file with mode: 0644]
wrt/node_modules/util-deprecate/History.md [new file with mode: 0644]
wrt/node_modules/util-deprecate/LICENSE [new file with mode: 0644]
wrt/node_modules/util-deprecate/README.md [new file with mode: 0644]
wrt/node_modules/util-deprecate/browser.js [new file with mode: 0644]
wrt/node_modules/util-deprecate/node.js [new file with mode: 0644]
wrt/node_modules/util-deprecate/package.json [new file with mode: 0644]
wrt/node_modules/utils-merge/.travis.yml [new file with mode: 0644]
wrt/node_modules/utils-merge/LICENSE [new file with mode: 0644]
wrt/node_modules/utils-merge/README.md [new file with mode: 0644]
wrt/node_modules/utils-merge/index.js [new file with mode: 0644]
wrt/node_modules/utils-merge/package.json [new file with mode: 0644]
wrt/node_modules/uws/LICENSE [new file with mode: 0644]
wrt/node_modules/uws/README.md [new file with mode: 0644]
wrt/node_modules/uws/binding.gyp [new file with mode: 0644]
wrt/node_modules/uws/build/Makefile [new file with mode: 0644]
wrt/node_modules/uws/build/Release/.deps/Release/obj.target/action_after_build.stamp.d [new file with mode: 0644]
wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws.node.d [new file with mode: 0644]
wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws/src/Extensions.o.d [new file with mode: 0644]
wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws/src/Group.o.d [new file with mode: 0644]
wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws/src/HTTPSocket.o.d [new file with mode: 0644]
wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws/src/Hub.o.d [new file with mode: 0644]
wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws/src/Networking.o.d [new file with mode: 0644]
wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws/src/Node.o.d [new file with mode: 0644]
wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws/src/Socket.o.d [new file with mode: 0644]
wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws/src/WebSocket.o.d [new file with mode: 0644]
wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws/src/addon.o.d [new file with mode: 0644]
wrt/node_modules/uws/build/Release/.deps/Release/uws.node.d [new file with mode: 0644]
wrt/node_modules/uws/build/Release/.deps/uws.d [new file with mode: 0644]
wrt/node_modules/uws/build/Release/obj.target/action_after_build.stamp [new file with mode: 0644]
wrt/node_modules/uws/build/Release/obj.target/uws.node [new file with mode: 0755]
wrt/node_modules/uws/build/Release/obj.target/uws/src/Extensions.o [new file with mode: 0644]
wrt/node_modules/uws/build/Release/obj.target/uws/src/Group.o [new file with mode: 0644]
wrt/node_modules/uws/build/Release/obj.target/uws/src/HTTPSocket.o [new file with mode: 0644]
wrt/node_modules/uws/build/Release/obj.target/uws/src/Hub.o [new file with mode: 0644]
wrt/node_modules/uws/build/Release/obj.target/uws/src/Networking.o [new file with mode: 0644]
wrt/node_modules/uws/build/Release/obj.target/uws/src/Node.o [new file with mode: 0644]
wrt/node_modules/uws/build/Release/obj.target/uws/src/Socket.o [new file with mode: 0644]
wrt/node_modules/uws/build/Release/obj.target/uws/src/WebSocket.o [new file with mode: 0644]
wrt/node_modules/uws/build/Release/obj.target/uws/src/addon.o [new file with mode: 0644]
wrt/node_modules/uws/build/Release/uws.node [new file with mode: 0755]
wrt/node_modules/uws/build/action_after_build.target.mk [new file with mode: 0644]
wrt/node_modules/uws/build/binding.Makefile [new file with mode: 0644]
wrt/node_modules/uws/build/config.gypi [new file with mode: 0644]
wrt/node_modules/uws/build/uws.target.mk [new file with mode: 0644]
wrt/node_modules/uws/build_log.txt [new file with mode: 0644]
wrt/node_modules/uws/package.json [new file with mode: 0644]
wrt/node_modules/uws/src/Asio.h [new file with mode: 0644]
wrt/node_modules/uws/src/Backend.h [new file with mode: 0644]
wrt/node_modules/uws/src/Epoll.cpp [new file with mode: 0644]
wrt/node_modules/uws/src/Epoll.h [new file with mode: 0644]
wrt/node_modules/uws/src/Extensions.cpp [new file with mode: 0644]
wrt/node_modules/uws/src/Extensions.h [new file with mode: 0644]
wrt/node_modules/uws/src/Group.cpp [new file with mode: 0644]
wrt/node_modules/uws/src/Group.h [new file with mode: 0644]
wrt/node_modules/uws/src/HTTPSocket.cpp [new file with mode: 0644]
wrt/node_modules/uws/src/HTTPSocket.h [new file with mode: 0644]
wrt/node_modules/uws/src/Hub.cpp [new file with mode: 0644]
wrt/node_modules/uws/src/Hub.h [new file with mode: 0644]
wrt/node_modules/uws/src/Libuv.h [new file with mode: 0644]
wrt/node_modules/uws/src/Networking.cpp [new file with mode: 0644]
wrt/node_modules/uws/src/Networking.h [new file with mode: 0644]
wrt/node_modules/uws/src/Node.cpp [new file with mode: 0644]
wrt/node_modules/uws/src/Node.h [new file with mode: 0644]
wrt/node_modules/uws/src/Socket.cpp [new file with mode: 0644]
wrt/node_modules/uws/src/Socket.h [new file with mode: 0644]
wrt/node_modules/uws/src/WebSocket.cpp [new file with mode: 0644]
wrt/node_modules/uws/src/WebSocket.h [new file with mode: 0644]
wrt/node_modules/uws/src/WebSocketProtocol.h [new file with mode: 0644]
wrt/node_modules/uws/src/addon.cpp [new file with mode: 0644]
wrt/node_modules/uws/src/addon.h [new file with mode: 0644]
wrt/node_modules/uws/src/http.h [new file with mode: 0644]
wrt/node_modules/uws/src/uWS.h [new file with mode: 0644]
wrt/node_modules/uws/uws.js [new file with mode: 0644]
wrt/node_modules/uws/uws_darwin_46.node [new file with mode: 0755]
wrt/node_modules/uws/uws_darwin_47.node [new file with mode: 0755]
wrt/node_modules/uws/uws_darwin_48.node [new file with mode: 0755]
wrt/node_modules/uws/uws_darwin_51.node [new file with mode: 0755]
wrt/node_modules/uws/uws_linux_46.node [new file with mode: 0755]
wrt/node_modules/uws/uws_linux_47.node [new file with mode: 0755]
wrt/node_modules/uws/uws_linux_48.node [new file with mode: 0755]
wrt/node_modules/uws/uws_linux_51.node [new file with mode: 0755]
wrt/node_modules/uws/uws_win32_48.node [new file with mode: 0755]
wrt/node_modules/uws/uws_win32_51.node [new file with mode: 0755]
wrt/node_modules/vary/HISTORY.md [new file with mode: 0644]
wrt/node_modules/vary/LICENSE [new file with mode: 0644]
wrt/node_modules/vary/README.md [new file with mode: 0644]
wrt/node_modules/vary/index.js [new file with mode: 0644]
wrt/node_modules/vary/package.json [new file with mode: 0644]
wrt/node_modules/window-size/LICENSE [new file with mode: 0644]
wrt/node_modules/window-size/README.md [new file with mode: 0644]
wrt/node_modules/window-size/cli.js [new file with mode: 0755]
wrt/node_modules/window-size/index.js [new file with mode: 0644]
wrt/node_modules/window-size/package.json [new file with mode: 0644]
wrt/node_modules/wrappy/LICENSE [new file with mode: 0644]
wrt/node_modules/wrappy/README.md [new file with mode: 0644]
wrt/node_modules/wrappy/package.json [new file with mode: 0644]
wrt/node_modules/wrappy/wrappy.js [new file with mode: 0644]
wrt/node_modules/ws/LICENSE [new file with mode: 0644]
wrt/node_modules/ws/README.md [new file with mode: 0644]
wrt/node_modules/ws/index.js [new file with mode: 0644]
wrt/node_modules/ws/lib/BufferUtil.js [new file with mode: 0644]
wrt/node_modules/ws/lib/Constants.js [new file with mode: 0644]
wrt/node_modules/ws/lib/ErrorCodes.js [new file with mode: 0644]
wrt/node_modules/ws/lib/EventTarget.js [new file with mode: 0644]
wrt/node_modules/ws/lib/Extensions.js [new file with mode: 0644]
wrt/node_modules/ws/lib/PerMessageDeflate.js [new file with mode: 0644]
wrt/node_modules/ws/lib/Receiver.js [new file with mode: 0644]
wrt/node_modules/ws/lib/Sender.js [new file with mode: 0644]
wrt/node_modules/ws/lib/Validation.js [new file with mode: 0644]
wrt/node_modules/ws/lib/WebSocket.js [new file with mode: 0644]
wrt/node_modules/ws/lib/WebSocketServer.js [new file with mode: 0644]
wrt/node_modules/ws/package.json [new file with mode: 0644]
wrt/node_modules/xml2js/LICENSE [new file with mode: 0644]
wrt/node_modules/xml2js/README.md [new file with mode: 0644]
wrt/node_modules/xml2js/lib/bom.js [new file with mode: 0644]
wrt/node_modules/xml2js/lib/builder.js [new file with mode: 0644]
wrt/node_modules/xml2js/lib/defaults.js [new file with mode: 0644]
wrt/node_modules/xml2js/lib/parser.js [new file with mode: 0644]
wrt/node_modules/xml2js/lib/processors.js [new file with mode: 0644]
wrt/node_modules/xml2js/lib/xml2js.js [new file with mode: 0644]
wrt/node_modules/xml2js/package.json [new file with mode: 0644]
wrt/node_modules/xmlbuilder/.npmignore [new file with mode: 0644]
wrt/node_modules/xmlbuilder/CHANGELOG.md [new file with mode: 0644]
wrt/node_modules/xmlbuilder/LICENSE [new file with mode: 0644]
wrt/node_modules/xmlbuilder/README.md [new file with mode: 0644]
wrt/node_modules/xmlbuilder/lib/Utility.js [new file with mode: 0644]
wrt/node_modules/xmlbuilder/lib/XMLAttribute.js [new file with mode: 0644]
wrt/node_modules/xmlbuilder/lib/XMLCData.js [new file with mode: 0644]
wrt/node_modules/xmlbuilder/lib/XMLComment.js [new file with mode: 0644]
wrt/node_modules/xmlbuilder/lib/XMLDTDAttList.js [new file with mode: 0644]
wrt/node_modules/xmlbuilder/lib/XMLDTDElement.js [new file with mode: 0644]
wrt/node_modules/xmlbuilder/lib/XMLDTDEntity.js [new file with mode: 0644]
wrt/node_modules/xmlbuilder/lib/XMLDTDNotation.js [new file with mode: 0644]
wrt/node_modules/xmlbuilder/lib/XMLDeclaration.js [new file with mode: 0644]
wrt/node_modules/xmlbuilder/lib/XMLDocType.js [new file with mode: 0644]
wrt/node_modules/xmlbuilder/lib/XMLDocument.js [new file with mode: 0644]
wrt/node_modules/xmlbuilder/lib/XMLDocumentCB.js [new file with mode: 0644]
wrt/node_modules/xmlbuilder/lib/XMLElement.js [new file with mode: 0644]
wrt/node_modules/xmlbuilder/lib/XMLNode.js [new file with mode: 0644]
wrt/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js [new file with mode: 0644]
wrt/node_modules/xmlbuilder/lib/XMLRaw.js [new file with mode: 0644]
wrt/node_modules/xmlbuilder/lib/XMLStreamWriter.js [new file with mode: 0644]
wrt/node_modules/xmlbuilder/lib/XMLStringWriter.js [new file with mode: 0644]
wrt/node_modules/xmlbuilder/lib/XMLStringifier.js [new file with mode: 0644]
wrt/node_modules/xmlbuilder/lib/XMLText.js [new file with mode: 0644]
wrt/node_modules/xmlbuilder/lib/XMLWriterBase.js [new file with mode: 0644]
wrt/node_modules/xmlbuilder/lib/index.js [new file with mode: 0644]
wrt/node_modules/xmlbuilder/package.json [new file with mode: 0644]
wrt/node_modules/xmlhttprequest-ssl/LICENSE [new file with mode: 0644]
wrt/node_modules/xmlhttprequest-ssl/README.md [new file with mode: 0644]
wrt/node_modules/xmlhttprequest-ssl/autotest.watchr [new file with mode: 0644]
wrt/node_modules/xmlhttprequest-ssl/example/demo.js [new file with mode: 0644]
wrt/node_modules/xmlhttprequest-ssl/lib/XMLHttpRequest.js [new file with mode: 0644]
wrt/node_modules/xmlhttprequest-ssl/package.json [new file with mode: 0644]
wrt/node_modules/xmlhttprequest-ssl/tests/test-constants.js [new file with mode: 0644]
wrt/node_modules/xmlhttprequest-ssl/tests/test-events.js [new file with mode: 0644]
wrt/node_modules/xmlhttprequest-ssl/tests/test-exceptions.js [new file with mode: 0644]
wrt/node_modules/xmlhttprequest-ssl/tests/test-headers.js [new file with mode: 0644]
wrt/node_modules/xmlhttprequest-ssl/tests/test-redirect-302.js [new file with mode: 0644]
wrt/node_modules/xmlhttprequest-ssl/tests/test-redirect-303.js [new file with mode: 0644]
wrt/node_modules/xmlhttprequest-ssl/tests/test-redirect-307.js [new file with mode: 0644]
wrt/node_modules/xmlhttprequest-ssl/tests/test-request-methods.js [new file with mode: 0644]
wrt/node_modules/xmlhttprequest-ssl/tests/test-request-protocols.js [new file with mode: 0644]
wrt/node_modules/xmlhttprequest-ssl/tests/testdata.txt [new file with mode: 0644]
wrt/node_modules/y18n/LICENSE [new file with mode: 0644]
wrt/node_modules/y18n/README.md [new file with mode: 0644]
wrt/node_modules/y18n/index.js [new file with mode: 0644]
wrt/node_modules/y18n/package.json [new file with mode: 0644]
wrt/node_modules/yargs/CHANGELOG.md [new file with mode: 0644]
wrt/node_modules/yargs/LICENSE [new file with mode: 0644]
wrt/node_modules/yargs/README.md [new file with mode: 0644]
wrt/node_modules/yargs/completion.sh.hbs [new file with mode: 0644]
wrt/node_modules/yargs/index.js [new file with mode: 0644]
wrt/node_modules/yargs/lib/completion.js [new file with mode: 0644]
wrt/node_modules/yargs/lib/parser.js [new file with mode: 0644]
wrt/node_modules/yargs/lib/usage.js [new file with mode: 0644]
wrt/node_modules/yargs/lib/validation.js [new file with mode: 0644]
wrt/node_modules/yargs/locales/en.json [new file with mode: 0644]
wrt/node_modules/yargs/locales/es.json [new file with mode: 0644]
wrt/node_modules/yargs/locales/fr.json [new file with mode: 0644]
wrt/node_modules/yargs/locales/pirate.json [new file with mode: 0644]
wrt/node_modules/yargs/locales/pt.json [new file with mode: 0644]
wrt/node_modules/yargs/node_modules/camelcase/index.js [new file with mode: 0644]
wrt/node_modules/yargs/node_modules/camelcase/license [new file with mode: 0644]
wrt/node_modules/yargs/node_modules/camelcase/package.json [new file with mode: 0644]
wrt/node_modules/yargs/node_modules/camelcase/readme.md [new file with mode: 0644]
wrt/node_modules/yargs/node_modules/cliui/.coveralls.yml [new file with mode: 0644]
wrt/node_modules/yargs/node_modules/cliui/.npmignore [new file with mode: 0644]
wrt/node_modules/yargs/node_modules/cliui/.travis.yml [new file with mode: 0644]
wrt/node_modules/yargs/node_modules/cliui/LICENSE.txt [new file with mode: 0644]
wrt/node_modules/yargs/node_modules/cliui/README.md [new file with mode: 0644]
wrt/node_modules/yargs/node_modules/cliui/index.js [new file with mode: 0644]
wrt/node_modules/yargs/node_modules/cliui/package.json [new file with mode: 0644]
wrt/node_modules/yargs/node_modules/cliui/test/cliui.js [new file with mode: 0644]
wrt/node_modules/yargs/node_modules/wordwrap/.npmignore [new file with mode: 0644]
wrt/node_modules/yargs/node_modules/wordwrap/README.markdown [new file with mode: 0644]
wrt/node_modules/yargs/node_modules/wordwrap/example/center.js [new file with mode: 0644]
wrt/node_modules/yargs/node_modules/wordwrap/example/meat.js [new file with mode: 0644]
wrt/node_modules/yargs/node_modules/wordwrap/index.js [new file with mode: 0644]
wrt/node_modules/yargs/node_modules/wordwrap/package.json [new file with mode: 0644]
wrt/node_modules/yargs/node_modules/wordwrap/test/break.js [new file with mode: 0644]
wrt/node_modules/yargs/node_modules/wordwrap/test/idleness.txt [new file with mode: 0644]
wrt/node_modules/yargs/node_modules/wordwrap/test/wrap.js [new file with mode: 0644]
wrt/node_modules/yargs/package.json [new file with mode: 0644]
wrt/node_modules/yeast/LICENSE [new file with mode: 0644]
wrt/node_modules/yeast/README.md [new file with mode: 0644]
wrt/node_modules/yeast/index.js [new file with mode: 0644]
wrt/node_modules/yeast/package.json [new file with mode: 0644]

diff --git a/wrt/node_modules/.bin/mime b/wrt/node_modules/.bin/mime
new file mode 120000 (symlink)
index 0000000..fbb7ee0
--- /dev/null
@@ -0,0 +1 @@
+../mime/cli.js
\ No newline at end of file
diff --git a/wrt/node_modules/.bin/mkdirp b/wrt/node_modules/.bin/mkdirp
new file mode 120000 (symlink)
index 0000000..017896c
--- /dev/null
@@ -0,0 +1 @@
+../mkdirp/bin/cmd.js
\ No newline at end of file
diff --git a/wrt/node_modules/.bin/ncp b/wrt/node_modules/.bin/ncp
new file mode 120000 (symlink)
index 0000000..1c02648
--- /dev/null
@@ -0,0 +1 @@
+../ncp/bin/ncp
\ No newline at end of file
diff --git a/wrt/node_modules/.bin/rimraf b/wrt/node_modules/.bin/rimraf
new file mode 120000 (symlink)
index 0000000..4cd49a4
--- /dev/null
@@ -0,0 +1 @@
+../rimraf/bin.js
\ No newline at end of file
diff --git a/wrt/node_modules/.bin/show_dialog b/wrt/node_modules/.bin/show_dialog
new file mode 120000 (symlink)
index 0000000..6f57ae8
--- /dev/null
@@ -0,0 +1 @@
+../dialog/bin/dialog.js
\ No newline at end of file
diff --git a/wrt/node_modules/.bin/strip-ansi b/wrt/node_modules/.bin/strip-ansi
new file mode 120000 (symlink)
index 0000000..b65c9f8
--- /dev/null
@@ -0,0 +1 @@
+../strip-ansi/cli.js
\ No newline at end of file
diff --git a/wrt/node_modules/.bin/uuid b/wrt/node_modules/.bin/uuid
new file mode 120000 (symlink)
index 0000000..80eb14a
--- /dev/null
@@ -0,0 +1 @@
+../node-uuid/bin/uuid
\ No newline at end of file
diff --git a/wrt/node_modules/.bin/window-size b/wrt/node_modules/.bin/window-size
new file mode 120000 (symlink)
index 0000000..e84c8ec
--- /dev/null
@@ -0,0 +1 @@
+../window-size/cli.js
\ No newline at end of file
diff --git a/wrt/node_modules/accepts/HISTORY.md b/wrt/node_modules/accepts/HISTORY.md
new file mode 100644 (file)
index 0000000..0477ed7
--- /dev/null
@@ -0,0 +1,212 @@
+1.3.3 / 2016-05-02
+==================
+
+  * deps: mime-types@~2.1.11
+    - deps: mime-db@~1.23.0
+  * deps: negotiator@0.6.1
+    - perf: improve `Accept` parsing speed
+    - perf: improve `Accept-Charset` parsing speed
+    - perf: improve `Accept-Encoding` parsing speed
+    - perf: improve `Accept-Language` parsing speed
+
+1.3.2 / 2016-03-08
+==================
+
+  * deps: mime-types@~2.1.10
+    - Fix extension of `application/dash+xml`
+    - Update primary extension for `audio/mp4`
+    - deps: mime-db@~1.22.0
+
+1.3.1 / 2016-01-19
+==================
+
+  * deps: mime-types@~2.1.9
+    - deps: mime-db@~1.21.0
+
+1.3.0 / 2015-09-29
+==================
+
+  * deps: mime-types@~2.1.7
+    - deps: mime-db@~1.19.0
+  * deps: negotiator@0.6.0
+    - Fix including type extensions in parameters in `Accept` parsing
+    - Fix parsing `Accept` parameters with quoted equals
+    - Fix parsing `Accept` parameters with quoted semicolons
+    - Lazy-load modules from main entry point
+    - perf: delay type concatenation until needed
+    - perf: enable strict mode
+    - perf: hoist regular expressions
+    - perf: remove closures getting spec properties
+    - perf: remove a closure from media type parsing
+    - perf: remove property delete from media type parsing
+
+1.2.13 / 2015-09-06
+===================
+
+  * deps: mime-types@~2.1.6
+    - deps: mime-db@~1.18.0
+
+1.2.12 / 2015-07-30
+===================
+
+  * deps: mime-types@~2.1.4
+    - deps: mime-db@~1.16.0
+
+1.2.11 / 2015-07-16
+===================
+
+  * deps: mime-types@~2.1.3
+    - deps: mime-db@~1.15.0
+
+1.2.10 / 2015-07-01
+===================
+
+  * deps: mime-types@~2.1.2
+    - deps: mime-db@~1.14.0
+
+1.2.9 / 2015-06-08
+==================
+
+  * deps: mime-types@~2.1.1
+    - perf: fix deopt during mapping
+
+1.2.8 / 2015-06-07
+==================
+
+  * deps: mime-types@~2.1.0
+    - deps: mime-db@~1.13.0
+  * perf: avoid argument reassignment & argument slice
+  * perf: avoid negotiator recursive construction
+  * perf: enable strict mode
+  * perf: remove unnecessary bitwise operator
+
+1.2.7 / 2015-05-10
+==================
+
+  * deps: negotiator@0.5.3
+    - Fix media type parameter matching to be case-insensitive
+
+1.2.6 / 2015-05-07
+==================
+
+  * deps: mime-types@~2.0.11
+    - deps: mime-db@~1.9.1
+  * deps: negotiator@0.5.2
+    - Fix comparing media types with quoted values
+    - Fix splitting media types with quoted commas
+
+1.2.5 / 2015-03-13
+==================
+
+  * deps: mime-types@~2.0.10
+    - deps: mime-db@~1.8.0
+
+1.2.4 / 2015-02-14
+==================
+
+  * Support Node.js 0.6
+  * deps: mime-types@~2.0.9
+    - deps: mime-db@~1.7.0
+  * deps: negotiator@0.5.1
+    - Fix preference sorting to be stable for long acceptable lists
+
+1.2.3 / 2015-01-31
+==================
+
+  * deps: mime-types@~2.0.8
+    - deps: mime-db@~1.6.0
+
+1.2.2 / 2014-12-30
+==================
+
+  * deps: mime-types@~2.0.7
+    - deps: mime-db@~1.5.0
+
+1.2.1 / 2014-12-30
+==================
+
+  * deps: mime-types@~2.0.5
+    - deps: mime-db@~1.3.1
+
+1.2.0 / 2014-12-19
+==================
+
+  * deps: negotiator@0.5.0
+    - Fix list return order when large accepted list
+    - Fix missing identity encoding when q=0 exists
+    - Remove dynamic building of Negotiator class
+
+1.1.4 / 2014-12-10
+==================
+
+  * deps: mime-types@~2.0.4
+    - deps: mime-db@~1.3.0
+
+1.1.3 / 2014-11-09
+==================
+
+  * deps: mime-types@~2.0.3
+    - deps: mime-db@~1.2.0
+
+1.1.2 / 2014-10-14
+==================
+
+  * deps: negotiator@0.4.9
+    - Fix error when media type has invalid parameter
+
+1.1.1 / 2014-09-28
+==================
+
+  * deps: mime-types@~2.0.2
+    - deps: mime-db@~1.1.0
+  * deps: negotiator@0.4.8
+    - Fix all negotiations to be case-insensitive
+    - Stable sort preferences of same quality according to client order
+
+1.1.0 / 2014-09-02
+==================
+
+  * update `mime-types`
+
+1.0.7 / 2014-07-04
+==================
+
+  * Fix wrong type returned from `type` when match after unknown extension
+
+1.0.6 / 2014-06-24
+==================
+
+  * deps: negotiator@0.4.7
+
+1.0.5 / 2014-06-20
+==================
+
+ * fix crash when unknown extension given
+
+1.0.4 / 2014-06-19
+==================
+
+  * use `mime-types`
+
+1.0.3 / 2014-06-11
+==================
+
+  * deps: negotiator@0.4.6
+    - Order by specificity when quality is the same
+
+1.0.2 / 2014-05-29
+==================
+
+  * Fix interpretation when header not in request
+  * deps: pin negotiator@0.4.5
+
+1.0.1 / 2014-01-18
+==================
+
+  * Identity encoding isn't always acceptable
+  * deps: negotiator@~0.4.0
+
+1.0.0 / 2013-12-27
+==================
+
+  * Genesis
diff --git a/wrt/node_modules/accepts/LICENSE b/wrt/node_modules/accepts/LICENSE
new file mode 100644 (file)
index 0000000..0616607
--- /dev/null
@@ -0,0 +1,23 @@
+(The MIT License)
+
+Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
+Copyright (c) 2015 Douglas Christopher Wilson <doug@somethingdoug.com>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/accepts/README.md b/wrt/node_modules/accepts/README.md
new file mode 100644 (file)
index 0000000..ae36676
--- /dev/null
@@ -0,0 +1,135 @@
+# accepts
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+Higher level content negotiation based on [negotiator](https://www.npmjs.com/package/negotiator). Extracted from [koa](https://www.npmjs.com/package/koa) for general use.
+
+In addition to negotiator, it allows:
+
+- Allows types as an array or arguments list, ie `(['text/html', 'application/json'])` as well as `('text/html', 'application/json')`.
+- Allows type shorthands such as `json`.
+- Returns `false` when no types match
+- Treats non-existent headers as `*`
+
+## Installation
+
+```sh
+npm install accepts
+```
+
+## API
+
+```js
+var accepts = require('accepts')
+```
+
+### accepts(req)
+
+Create a new `Accepts` object for the given `req`.
+
+#### .charset(charsets)
+
+Return the first accepted charset. If nothing in `charsets` is accepted,
+then `false` is returned.
+
+#### .charsets()
+
+Return the charsets that the request accepts, in the order of the client's
+preference (most preferred first).
+
+#### .encoding(encodings)
+
+Return the first accepted encoding. If nothing in `encodings` is accepted,
+then `false` is returned.
+
+#### .encodings()
+
+Return the encodings that the request accepts, in the order of the client's
+preference (most preferred first).
+
+#### .language(languages)
+
+Return the first accepted language. If nothing in `languages` is accepted,
+then `false` is returned.
+
+#### .languages()
+
+Return the languages that the request accepts, in the order of the client's
+preference (most preferred first).
+
+#### .type(types)
+
+Return the first accepted type (and it is returned as the same text as what
+appears in the `types` array). If nothing in `types` is accepted, then `false`
+is returned.
+
+The `types` array can contain full MIME types or file extensions. Any value
+that is not a full MIME types is passed to `require('mime-types').lookup`.
+
+#### .types()
+
+Return the types that the request accepts, in the order of the client's
+preference (most preferred first).
+
+## Examples
+
+### Simple type negotiation
+
+This simple example shows how to use `accepts` to return a different typed
+respond body based on what the client wants to accept. The server lists it's
+preferences in order and will get back the best match between the client and
+server.
+
+```js
+var accepts = require('accepts')
+var http = require('http')
+
+function app(req, res) {
+  var accept = accepts(req)
+
+  // the order of this list is significant; should be server preferred order
+  switch(accept.type(['json', 'html'])) {
+    case 'json':
+      res.setHeader('Content-Type', 'application/json')
+      res.write('{"hello":"world!"}')
+      break
+    case 'html':
+      res.setHeader('Content-Type', 'text/html')
+      res.write('<b>hello, world!</b>')
+      break
+    default:
+      // the fallback is text/plain, so no need to specify it above
+      res.setHeader('Content-Type', 'text/plain')
+      res.write('hello, world!')
+      break
+  }
+
+  res.end()
+}
+
+http.createServer(app).listen(3000)
+```
+
+You can test this out with the cURL program:
+```sh
+curl -I -H'Accept: text/html' http://localhost:3000/
+```
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/accepts.svg
+[npm-url]: https://npmjs.org/package/accepts
+[node-version-image]: https://img.shields.io/node/v/accepts.svg
+[node-version-url]: http://nodejs.org/download/
+[travis-image]: https://img.shields.io/travis/jshttp/accepts/master.svg
+[travis-url]: https://travis-ci.org/jshttp/accepts
+[coveralls-image]: https://img.shields.io/coveralls/jshttp/accepts/master.svg
+[coveralls-url]: https://coveralls.io/r/jshttp/accepts
+[downloads-image]: https://img.shields.io/npm/dm/accepts.svg
+[downloads-url]: https://npmjs.org/package/accepts
diff --git a/wrt/node_modules/accepts/index.js b/wrt/node_modules/accepts/index.js
new file mode 100644 (file)
index 0000000..e80192a
--- /dev/null
@@ -0,0 +1,231 @@
+/*!
+ * accepts
+ * Copyright(c) 2014 Jonathan Ong
+ * Copyright(c) 2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var Negotiator = require('negotiator')
+var mime = require('mime-types')
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = Accepts
+
+/**
+ * Create a new Accepts object for the given req.
+ *
+ * @param {object} req
+ * @public
+ */
+
+function Accepts(req) {
+  if (!(this instanceof Accepts))
+    return new Accepts(req)
+
+  this.headers = req.headers
+  this.negotiator = new Negotiator(req)
+}
+
+/**
+ * Check if the given `type(s)` is acceptable, returning
+ * the best match when true, otherwise `undefined`, in which
+ * case you should respond with 406 "Not Acceptable".
+ *
+ * The `type` value may be a single mime type string
+ * such as "application/json", the extension name
+ * such as "json" or an array `["json", "html", "text/plain"]`. When a list
+ * or array is given the _best_ match, if any is returned.
+ *
+ * Examples:
+ *
+ *     // Accept: text/html
+ *     this.types('html');
+ *     // => "html"
+ *
+ *     // Accept: text/*, application/json
+ *     this.types('html');
+ *     // => "html"
+ *     this.types('text/html');
+ *     // => "text/html"
+ *     this.types('json', 'text');
+ *     // => "json"
+ *     this.types('application/json');
+ *     // => "application/json"
+ *
+ *     // Accept: text/*, application/json
+ *     this.types('image/png');
+ *     this.types('png');
+ *     // => undefined
+ *
+ *     // Accept: text/*;q=.5, application/json
+ *     this.types(['html', 'json']);
+ *     this.types('html', 'json');
+ *     // => "json"
+ *
+ * @param {String|Array} types...
+ * @return {String|Array|Boolean}
+ * @public
+ */
+
+Accepts.prototype.type =
+Accepts.prototype.types = function (types_) {
+  var types = types_
+
+  // support flattened arguments
+  if (types && !Array.isArray(types)) {
+    types = new Array(arguments.length)
+    for (var i = 0; i < types.length; i++) {
+      types[i] = arguments[i]
+    }
+  }
+
+  // no types, return all requested types
+  if (!types || types.length === 0) {
+    return this.negotiator.mediaTypes()
+  }
+
+  if (!this.headers.accept) return types[0];
+  var mimes = types.map(extToMime);
+  var accepts = this.negotiator.mediaTypes(mimes.filter(validMime));
+  var first = accepts[0];
+  if (!first) return false;
+  return types[mimes.indexOf(first)];
+}
+
+/**
+ * Return accepted encodings or best fit based on `encodings`.
+ *
+ * Given `Accept-Encoding: gzip, deflate`
+ * an array sorted by quality is returned:
+ *
+ *     ['gzip', 'deflate']
+ *
+ * @param {String|Array} encodings...
+ * @return {String|Array}
+ * @public
+ */
+
+Accepts.prototype.encoding =
+Accepts.prototype.encodings = function (encodings_) {
+  var encodings = encodings_
+
+  // support flattened arguments
+  if (encodings && !Array.isArray(encodings)) {
+    encodings = new Array(arguments.length)
+    for (var i = 0; i < encodings.length; i++) {
+      encodings[i] = arguments[i]
+    }
+  }
+
+  // no encodings, return all requested encodings
+  if (!encodings || encodings.length === 0) {
+    return this.negotiator.encodings()
+  }
+
+  return this.negotiator.encodings(encodings)[0] || false
+}
+
+/**
+ * Return accepted charsets or best fit based on `charsets`.
+ *
+ * Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5`
+ * an array sorted by quality is returned:
+ *
+ *     ['utf-8', 'utf-7', 'iso-8859-1']
+ *
+ * @param {String|Array} charsets...
+ * @return {String|Array}
+ * @public
+ */
+
+Accepts.prototype.charset =
+Accepts.prototype.charsets = function (charsets_) {
+  var charsets = charsets_
+
+  // support flattened arguments
+  if (charsets && !Array.isArray(charsets)) {
+    charsets = new Array(arguments.length)
+    for (var i = 0; i < charsets.length; i++) {
+      charsets[i] = arguments[i]
+    }
+  }
+
+  // no charsets, return all requested charsets
+  if (!charsets || charsets.length === 0) {
+    return this.negotiator.charsets()
+  }
+
+  return this.negotiator.charsets(charsets)[0] || false
+}
+
+/**
+ * Return accepted languages or best fit based on `langs`.
+ *
+ * Given `Accept-Language: en;q=0.8, es, pt`
+ * an array sorted by quality is returned:
+ *
+ *     ['es', 'pt', 'en']
+ *
+ * @param {String|Array} langs...
+ * @return {Array|String}
+ * @public
+ */
+
+Accepts.prototype.lang =
+Accepts.prototype.langs =
+Accepts.prototype.language =
+Accepts.prototype.languages = function (languages_) {
+  var languages = languages_
+
+  // support flattened arguments
+  if (languages && !Array.isArray(languages)) {
+    languages = new Array(arguments.length)
+    for (var i = 0; i < languages.length; i++) {
+      languages[i] = arguments[i]
+    }
+  }
+
+  // no languages, return all requested languages
+  if (!languages || languages.length === 0) {
+    return this.negotiator.languages()
+  }
+
+  return this.negotiator.languages(languages)[0] || false
+}
+
+/**
+ * Convert extnames to mime.
+ *
+ * @param {String} type
+ * @return {String}
+ * @private
+ */
+
+function extToMime(type) {
+  return type.indexOf('/') === -1
+    ? mime.lookup(type)
+    : type
+}
+
+/**
+ * Check if mime is valid.
+ *
+ * @param {String} type
+ * @return {String}
+ * @private
+ */
+
+function validMime(type) {
+  return typeof type === 'string';
+}
diff --git a/wrt/node_modules/accepts/package.json b/wrt/node_modules/accepts/package.json
new file mode 100644 (file)
index 0000000..32a7717
--- /dev/null
@@ -0,0 +1,112 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "accepts@1.3.3",
+        "scope": null,
+        "escapedName": "accepts",
+        "name": "accepts",
+        "rawSpec": "1.3.3",
+        "spec": "1.3.3",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io"
+    ]
+  ],
+  "_from": "accepts@1.3.3",
+  "_id": "accepts@1.3.3",
+  "_inCache": true,
+  "_location": "/accepts",
+  "_nodeVersion": "4.4.3",
+  "_npmOperationalInternal": {
+    "host": "packages-16-east.internal.npmjs.com",
+    "tmp": "tmp/accepts-1.3.3.tgz_1462251932032_0.7092335098423064"
+  },
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "2.15.1",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "accepts@1.3.3",
+    "scope": null,
+    "escapedName": "accepts",
+    "name": "accepts",
+    "rawSpec": "1.3.3",
+    "spec": "1.3.3",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/engine.io"
+  ],
+  "_resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz",
+  "_shasum": "c3ca7434938648c3e0d9c1e328dd68b622c284ca",
+  "_shrinkwrap": null,
+  "_spec": "accepts@1.3.3",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io",
+  "bugs": {
+    "url": "https://github.com/jshttp/accepts/issues"
+  },
+  "contributors": [
+    {
+      "name": "Douglas Christopher Wilson",
+      "email": "doug@somethingdoug.com"
+    },
+    {
+      "name": "Jonathan Ong",
+      "email": "me@jongleberry.com",
+      "url": "http://jongleberry.com"
+    }
+  ],
+  "dependencies": {
+    "mime-types": "~2.1.11",
+    "negotiator": "0.6.1"
+  },
+  "description": "Higher-level content negotiation",
+  "devDependencies": {
+    "istanbul": "0.4.3",
+    "mocha": "~1.21.5"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "c3ca7434938648c3e0d9c1e328dd68b622c284ca",
+    "tarball": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz"
+  },
+  "engines": {
+    "node": ">= 0.6"
+  },
+  "files": [
+    "LICENSE",
+    "HISTORY.md",
+    "index.js"
+  ],
+  "gitHead": "3e925b1e65ed7da2798849683d49814680dfa426",
+  "homepage": "https://github.com/jshttp/accepts#readme",
+  "keywords": [
+    "content",
+    "negotiation",
+    "accept",
+    "accepts"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "name": "accepts",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/jshttp/accepts.git"
+  },
+  "scripts": {
+    "test": "mocha --reporter spec --check-leaks --bail test/",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
+    "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
+  },
+  "version": "1.3.3"
+}
diff --git a/wrt/node_modules/after/.npmignore b/wrt/node_modules/after/.npmignore
new file mode 100644 (file)
index 0000000..6c78602
--- /dev/null
@@ -0,0 +1,2 @@
+node_modules
+.monitor
diff --git a/wrt/node_modules/after/.travis.yml b/wrt/node_modules/after/.travis.yml
new file mode 100644 (file)
index 0000000..afd72d0
--- /dev/null
@@ -0,0 +1,12 @@
+language: node_js
+node_js:
+  - 0.6
+  - 0.8
+  - 0.9
+  - 0.10
+  - 0.12
+  - 4.2.4
+  - 5.4.1
+  - iojs-1
+  - iojs-2
+  - iojs-3
diff --git a/wrt/node_modules/after/LICENCE b/wrt/node_modules/after/LICENCE
new file mode 100644 (file)
index 0000000..7c35130
--- /dev/null
@@ -0,0 +1,19 @@
+Copyright (c) 2011 Raynos.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
\ No newline at end of file
diff --git a/wrt/node_modules/after/README.md b/wrt/node_modules/after/README.md
new file mode 100644 (file)
index 0000000..fc69096
--- /dev/null
@@ -0,0 +1,115 @@
+# After [![Build Status][1]][2]
+
+Invoke callback after n calls
+
+## Status: production ready
+
+## Example
+
+```js
+var after = require("after")
+var db = require("./db") // some db.
+
+var updateUser = function (req, res) {
+  // use after to run two tasks in parallel,
+  // namely get request body and get session
+  // then run updateUser with the results
+  var next = after(2, updateUser)
+  var results = {}
+  
+  getJSONBody(req, res, function (err, body) {
+    if (err) return next(err)
+    
+    results.body = body
+    next(null, results)
+  })
+  
+  getSessionUser(req, res, function (err, user) {
+    if (err) return next(err)
+    
+    results.user = user
+    next(null, results)
+  })
+  
+  // now do the thing!
+  function updateUser(err, result) {
+    if (err) {
+      res.statusCode = 500
+      return res.end("Unexpected Error")
+    }
+    
+    if (!result.user || result.user.role !== "admin") {
+      res.statusCode = 403
+      return res.end("Permission Denied")
+    }
+    
+    db.put("users:" + req.params.userId, result.body, function (err) {
+      if (err) {
+        res.statusCode = 500
+        return res.end("Unexpected Error")
+      }
+      
+      res.statusCode = 200
+      res.end("Ok")  
+    })   
+  }
+}
+```
+
+## Naive Example
+
+```js
+var after = require("after")
+    , next = after(3, logItWorks)
+
+next()
+next()
+next() // it works
+
+function logItWorks() {
+    console.log("it works!")
+}
+```
+
+## Example with error handling
+
+```js
+var after = require("after")
+    , next = after(3, logError)
+
+next()
+next(new Error("oops")) // logs oops
+next() // does nothing
+
+// This callback is only called once.
+// If there is an error the callback gets called immediately
+// this avoids the situation where errors get lost.
+function logError(err) {
+    console.log(err)
+}
+```
+
+## Installation
+
+`npm install after`
+
+## Tests
+
+`npm test`
+
+## Contributors
+
+ - Raynos
+ - defunctzombie
+
+## MIT Licenced
+
+  [1]: https://secure.travis-ci.org/Raynos/after.png
+  [2]: http://travis-ci.org/Raynos/after
+  [3]: http://raynos.org/blog/2/Flow-control-in-node.js
+  [4]: http://stackoverflow.com/questions/6852059/determining-the-end-of-asynchronous-operations-javascript/6852307#6852307
+  [5]: http://stackoverflow.com/questions/6869872/in-javascript-what-are-best-practices-for-executing-multiple-asynchronous-functi/6870031#6870031
+  [6]: http://stackoverflow.com/questions/6864397/javascript-performance-long-running-tasks/6889419#6889419
+  [7]: http://stackoverflow.com/questions/6597493/synchronous-database-queries-with-node-js/6620091#6620091
+  [8]: http://github.com/Raynos/iterators
+  [9]: http://github.com/Raynos/composite
diff --git a/wrt/node_modules/after/index.js b/wrt/node_modules/after/index.js
new file mode 100644 (file)
index 0000000..ec24879
--- /dev/null
@@ -0,0 +1,28 @@
+module.exports = after
+
+function after(count, callback, err_cb) {
+    var bail = false
+    err_cb = err_cb || noop
+    proxy.count = count
+
+    return (count === 0) ? callback() : proxy
+
+    function proxy(err, result) {
+        if (proxy.count <= 0) {
+            throw new Error('after called too many times')
+        }
+        --proxy.count
+
+        // after first error, rest are passed to err_cb
+        if (err) {
+            bail = true
+            callback(err)
+            // future error callbacks will go to error handler
+            callback = err_cb
+        } else if (proxy.count === 0 && !bail) {
+            callback(null, result)
+        }
+    }
+}
+
+function noop() {}
diff --git a/wrt/node_modules/after/package.json b/wrt/node_modules/after/package.json
new file mode 100644 (file)
index 0000000..af7970e
--- /dev/null
@@ -0,0 +1,103 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "after@0.8.2",
+        "scope": null,
+        "escapedName": "after",
+        "name": "after",
+        "rawSpec": "0.8.2",
+        "spec": "0.8.2",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io-parser"
+    ]
+  ],
+  "_from": "after@0.8.2",
+  "_id": "after@0.8.2",
+  "_inCache": true,
+  "_location": "/after",
+  "_nodeVersion": "0.10.32",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/after-0.8.2.tgz_1471308639186_0.9132961586583406"
+  },
+  "_npmUser": {
+    "name": "raynos",
+    "email": "raynos2@gmail.com"
+  },
+  "_npmVersion": "2.15.9",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "after@0.8.2",
+    "scope": null,
+    "escapedName": "after",
+    "name": "after",
+    "rawSpec": "0.8.2",
+    "spec": "0.8.2",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/engine.io-parser"
+  ],
+  "_resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz",
+  "_shasum": "fedb394f9f0e02aa9768e702bda23b505fae7e1f",
+  "_shrinkwrap": null,
+  "_spec": "after@0.8.2",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io-parser",
+  "author": {
+    "name": "Raynos",
+    "email": "raynos2@gmail.com"
+  },
+  "bugs": {
+    "url": "https://github.com/Raynos/after/issues"
+  },
+  "contributors": [
+    {
+      "name": "Raynos",
+      "email": "raynos2@gmail.com",
+      "url": "http://raynos.org"
+    }
+  ],
+  "dependencies": {},
+  "description": "after - tiny flow control",
+  "devDependencies": {
+    "mocha": "~1.8.1"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "fedb394f9f0e02aa9768e702bda23b505fae7e1f",
+    "tarball": "https://registry.npmjs.org/after/-/after-0.8.2.tgz"
+  },
+  "gitHead": "e8c26046f36962b90e68dc5df33a9672a54b25f5",
+  "homepage": "https://github.com/Raynos/after#readme",
+  "keywords": [
+    "flowcontrol",
+    "after",
+    "flow",
+    "control",
+    "arch"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "raynos",
+      "email": "raynos2@gmail.com"
+    },
+    {
+      "name": "defunctzombie",
+      "email": "shtylman@gmail.com"
+    }
+  ],
+  "name": "after",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/Raynos/after.git"
+  },
+  "scripts": {
+    "test": "mocha --ui tdd --reporter spec test/*.js"
+  },
+  "version": "0.8.2"
+}
diff --git a/wrt/node_modules/after/test/after-test.js b/wrt/node_modules/after/test/after-test.js
new file mode 100644 (file)
index 0000000..0d63f4c
--- /dev/null
@@ -0,0 +1,120 @@
+/*global suite, test*/
+
+var assert = require("assert")
+    , after = require("../")
+
+test("exists", function () {
+    assert(typeof after === "function", "after is not a function")
+})
+
+test("after when called with 0 invokes", function (done) {
+    after(0, done)
+});
+
+test("after 1", function (done) {
+    var next = after(1, done)
+    next()
+})
+
+test("after 5", function (done) {
+    var next = after(5, done)
+    , i = 5
+
+    while (i--) {
+        next()
+    }
+})
+
+test("manipulate count", function (done) {
+    var next = after(1, done)
+    , i = 5
+
+    next.count = i
+    while (i--) {
+        next()
+    }
+})
+
+test("after terminates on error", function (done) {
+    var next = after(2, function(err) {
+        assert.equal(err.message, 'test');
+        done();
+    })
+    next(new Error('test'))
+    next(new Error('test2'))
+})
+
+test('gee', function(done) {
+    done = after(2, done)
+
+    function cb(err) {
+        assert.equal(err.message, 1);
+        done()
+    }
+
+    var next = after(3, cb, function(err) {
+        assert.equal(err.message, 2)
+        done()
+    });
+
+    next()
+    next(new Error(1))
+    next(new Error(2))
+})
+
+test('eee', function(done) {
+    done = after(3, done)
+
+    function cb(err) {
+        assert.equal(err.message, 1);
+        done()
+    }
+
+    var next = after(3, cb, function(err) {
+        assert.equal(err.message, 2)
+        done()
+    });
+
+    next(new Error(1))
+    next(new Error(2))
+    next(new Error(2))
+})
+
+test('gge', function(done) {
+    function cb(err) {
+        assert.equal(err.message, 1);
+        done()
+    }
+
+    var next = after(3, cb, function(err) {
+        // should not happen
+        assert.ok(false);
+    });
+
+    next()
+    next()
+    next(new Error(1))
+})
+
+test('egg', function(done) {
+    function cb(err) {
+        assert.equal(err.message, 1);
+        done()
+    }
+
+    var next = after(3, cb, function(err) {
+        // should not happen
+        assert.ok(false);
+    });
+
+    next(new Error(1))
+    next()
+    next()
+})
+
+test('throws on too many calls', function(done) {
+    var next = after(1, done);
+    next()
+    assert.throws(next, /after called too many times/);
+});
+
diff --git a/wrt/node_modules/align-text/LICENSE b/wrt/node_modules/align-text/LICENSE
new file mode 100644 (file)
index 0000000..65f90ac
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2015, Jon Schlinkert.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/align-text/README.md b/wrt/node_modules/align-text/README.md
new file mode 100644 (file)
index 0000000..476b97f
--- /dev/null
@@ -0,0 +1,236 @@
+# align-text [![NPM version](https://badge.fury.io/js/align-text.svg)](http://badge.fury.io/js/align-text)  [![Build Status](https://travis-ci.org/jonschlinkert/align-text.svg)](https://travis-ci.org/jonschlinkert/align-text)
+
+> Align the text in a string.
+
+**Examples**
+
+Align text values in an array:
+
+```js
+align([1, 2, 3, 100]);
+//=> ['  1', '  2', '  3', '100']
+```
+
+Or [do stuff like this](./example.js):
+
+[![screen shot 2015-06-09 at 2 08 34 am](https://cloud.githubusercontent.com/assets/383994/8051597/7b716fbc-0e4c-11e5-9aef-4493fd22db58.png)](./example.js)
+
+Visit [the example](./example.js) to see how this works.
+
+## Install
+
+Install with [npm](https://www.npmjs.com/)
+
+```sh
+$ npm i align-text --save
+```
+
+## Usage
+
+```js
+var align = require('align-text');
+align(text, callback_function_or_integer);
+```
+
+**Params**
+
+* `text` can be a **string or array**. If a string is passed, a string will be returned. If an array is passed, an array will be returned.
+* `callback|integer`: if an integer, the text will be indented by that amount. If a function, it must return an integer representing the amount of leading indentation to use as `align` loops over each line.
+
+**Example**
+
+```js
+align(text, 4);
+```
+
+Would align:
+
+```
+abc
+abc
+abc
+```
+
+To:
+
+```
+    abc
+    abc
+    abc
+```
+
+## callback
+
+### params
+
+The callback is used to determine the indentation of each line and gets the following params:
+
+* `len` the length of the "current" line
+* `longest` the length of the longest line
+* `line` the current line (string) being aligned
+* `lines` the array of all lines
+
+### return
+
+The callback may return:
+
+* an integer that represents the number of spaces to use for padding,
+* or an object with the following properties:
+  - `indent`: **{Number}** the amount of indentation to use. Default is `0` when an object is returned.
+  - `character`: **{String}** the character to use for indentation. Default is `''` (empty string) when an object is returned.
+  - `prefix`: **{String}** leading characters to use at the beginning of each line. `''` (empty string) when an object is returned.
+
+**Integer example:**
+
+```js
+// calculate half the difference between the length
+// of the current line and the longest line
+function centerAlign(len, longest, line, lines) {
+  return Math.floor((longest - len) / 2);
+}
+```
+
+**Object example:**
+
+```js
+function centerAlign(len, longest, line, lines) {
+  return {
+    character: '\t',
+    indent: Math.floor((longest - len) / 2),
+    prefix: '~ ',
+  }
+}
+```
+
+## Usage examples
+
+### Center align
+
+Using the `centerAlign` function from above:
+
+```js
+align(text, centerAlign);
+```
+
+Would align this text:
+
+```js
+Lorem ipsum dolor sit amet
+consectetur adipiscin
+elit, sed do eiusmod tempor incididun
+ut labore et dolor
+magna aliqua. Ut enim ad mini
+veniam, quis
+```
+
+Resulting in this:
+
+```
+     Lorem ipsum dolor sit amet,
+        consectetur adipiscing
+elit, sed do eiusmod tempor incididunt
+         ut labore et dolore
+    magna aliqua. Ut enim ad minim
+             veniam, quis
+```
+
+**Customize**
+
+If you wanted to add more padding on the left, just pass the number in the callback.
+
+For example, to add 4 spaces before every line:
+
+```js
+function centerAlign(len, longest, line, lines) {
+  return 4 + Math.floor((longest - len) / 2);
+}
+```
+
+Would result in:
+
+```
+         Lorem ipsum dolor sit amet,
+            consectetur adipiscing
+    elit, sed do eiusmod tempor incididunt
+             ut labore et dolore
+        magna aliqua. Ut enim ad minim
+                 veniam, quis
+```
+
+### Bullets
+
+```js
+align(text, function (len, max, line, lines) {
+  return {prefix: ' - '};
+});
+```
+
+Would return:
+
+```
+- Lorem ipsum dolor sit amet,
+- consectetur adipiscing
+- elit, sed do eiusmod tempor incididunt
+- ut labore et dolore
+- magna aliqua. Ut enim ad minim
+- veniam, quis
+```
+
+### Different indent character
+
+```js
+align(text, function (len, max, line, lines) {
+  return { 
+    indent: Math.floor((max - len) / 2), 
+    character: '~', 
+  };
+});
+```
+
+Would return
+
+```
+~~~~~Lorem ipsum dolor sit amet,
+~~~~~~~~consectetur adipiscing
+elit, sed do eiusmod tempor incididunt
+~~~~~~~~~ut labore et dolore
+~~~~magna aliqua. Ut enim ad minim
+~~~~~~~~~~~~~veniam, quis
+```
+
+## Related projects
+
+* [center-align](https://github.com/jonschlinkert/center-align): Center-align the text in a string.
+* [justify](https://github.com/bahamas10/node-justify): Left or right (or both) justify text using a custom width and character
+* [longest](https://github.com/jonschlinkert/longest): Get the longest item in an array.
+* [right-align](https://github.com/jonschlinkert/right-align): Right-align the text in a string.
+* [repeat-string](https://github.com/jonschlinkert/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string.
+* [word-wrap](https://github.com/jonschlinkert/word-wrap): Wrap words to a specified length.
+
+## Running tests
+
+Install dev dependencies:
+
+```sh
+$ npm i -d && npm test
+```
+
+## Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/align-text/issues/new)
+
+## Author
+
+**Jon Schlinkert**
+
++ [github/jonschlinkert](https://github.com/jonschlinkert)
++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
+
+## License
+
+Copyright © 2015 [Jon Schlinkert](https://github.com/jonschlinkert)
+Released under the MIT license.
+
+***
+
+_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 09, 2015._
diff --git a/wrt/node_modules/align-text/index.js b/wrt/node_modules/align-text/index.js
new file mode 100644 (file)
index 0000000..75902a3
--- /dev/null
@@ -0,0 +1,52 @@
+/*!
+ * align-text <https://github.com/jonschlinkert/align-text>
+ *
+ * Copyright (c) 2015, Jon Schlinkert.
+ * Licensed under the MIT License.
+ */
+
+'use strict';
+
+var typeOf = require('kind-of');
+var repeat = require('repeat-string');
+var longest = require('longest');
+
+module.exports = function alignText(val, fn) {
+  var lines, type = typeOf(val);
+
+  if (type === 'array') {
+    lines = val;
+  } else if (type === 'string') {
+    lines = val.split(/(?:\r\n|\n)/);
+  } else {
+    throw new TypeError('align-text expects a string or array.');
+  }
+
+  var fnType = typeOf(fn);
+  var len = lines.length;
+  var max = longest(lines);
+  var res = [], i = 0;
+
+  while (len--) {
+    var line = String(lines[i++]);
+    var diff;
+
+    if (fnType === 'function') {
+      diff = fn(line.length, max.length, line, lines, i);
+    } else if (fnType === 'number') {
+      diff = fn;
+    } else {
+      diff = max.length - line.length;
+    }
+
+    if (typeOf(diff) === 'number') {
+      res.push(repeat(' ', diff) + line);
+    } else if (typeOf(diff) === 'object') {
+      var result = repeat(diff.character || ' ', diff.indent || 0);
+      res.push((diff.prefix || '') + result + line);
+    }
+  }
+
+  if (type === 'array') return res;
+  return res.join('\n');
+};
diff --git a/wrt/node_modules/align-text/package.json b/wrt/node_modules/align-text/package.json
new file mode 100644 (file)
index 0000000..b2d356e
--- /dev/null
@@ -0,0 +1,78 @@
+{
+  "_from": "align-text@^0.1.3",
+  "_id": "align-text@0.1.4",
+  "_inBundle": false,
+  "_integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=",
+  "_location": "/align-text",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "align-text@^0.1.3",
+    "name": "align-text",
+    "escapedName": "align-text",
+    "rawSpec": "^0.1.3",
+    "saveSpec": null,
+    "fetchSpec": "^0.1.3"
+  },
+  "_requiredBy": [
+    "/center-align",
+    "/right-align"
+  ],
+  "_resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz",
+  "_shasum": "0cd90a561093f35d0a99256c22b7069433fad117",
+  "_spec": "align-text@^0.1.3",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was/node_modules/center-align",
+  "author": {
+    "name": "Jon Schlinkert",
+    "url": "https://github.com/jonschlinkert"
+  },
+  "bugs": {
+    "url": "https://github.com/jonschlinkert/align-text/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {
+    "kind-of": "^3.0.2",
+    "longest": "^1.0.1",
+    "repeat-string": "^1.5.2"
+  },
+  "deprecated": false,
+  "description": "Align the text in a string.",
+  "devDependencies": {
+    "mocha": "*",
+    "should": "*",
+    "word-wrap": "^1.0.3"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/jonschlinkert/align-text",
+  "keywords": [
+    "align",
+    "align-center",
+    "alignment",
+    "center",
+    "center-align",
+    "indent",
+    "pad",
+    "padding",
+    "right",
+    "right-align",
+    "text",
+    "typography"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "name": "align-text",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/jonschlinkert/align-text.git"
+  },
+  "scripts": {
+    "test": "mocha"
+  },
+  "version": "0.1.4"
+}
diff --git a/wrt/node_modules/ansi-styles/index.js b/wrt/node_modules/ansi-styles/index.js
new file mode 100644 (file)
index 0000000..3d3baa6
--- /dev/null
@@ -0,0 +1,152 @@
+'use strict';
+const colorConvert = require('color-convert');
+
+const wrapAnsi16 = (fn, offset) => function () {
+       const code = fn.apply(colorConvert, arguments);
+       return `\u001B[${code + offset}m`;
+};
+
+const wrapAnsi256 = (fn, offset) => function () {
+       const code = fn.apply(colorConvert, arguments);
+       return `\u001B[${38 + offset};5;${code}m`;
+};
+
+const wrapAnsi16m = (fn, offset) => function () {
+       const rgb = fn.apply(colorConvert, arguments);
+       return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
+};
+
+function assembleStyles() {
+       const codes = new Map();
+       const styles = {
+               modifier: {
+                       reset: [0, 0],
+                       // 21 isn't widely supported and 22 does the same thing
+                       bold: [1, 22],
+                       dim: [2, 22],
+                       italic: [3, 23],
+                       underline: [4, 24],
+                       inverse: [7, 27],
+                       hidden: [8, 28],
+                       strikethrough: [9, 29]
+               },
+               color: {
+                       black: [30, 39],
+                       red: [31, 39],
+                       green: [32, 39],
+                       yellow: [33, 39],
+                       blue: [34, 39],
+                       magenta: [35, 39],
+                       cyan: [36, 39],
+                       white: [37, 39],
+                       gray: [90, 39],
+
+                       // Bright color
+                       redBright: [91, 39],
+                       greenBright: [92, 39],
+                       yellowBright: [93, 39],
+                       blueBright: [94, 39],
+                       magentaBright: [95, 39],
+                       cyanBright: [96, 39],
+                       whiteBright: [97, 39]
+               },
+               bgColor: {
+                       bgBlack: [40, 49],
+                       bgRed: [41, 49],
+                       bgGreen: [42, 49],
+                       bgYellow: [43, 49],
+                       bgBlue: [44, 49],
+                       bgMagenta: [45, 49],
+                       bgCyan: [46, 49],
+                       bgWhite: [47, 49],
+
+                       // Bright color
+                       bgBlackBright: [100, 49],
+                       bgRedBright: [101, 49],
+                       bgGreenBright: [102, 49],
+                       bgYellowBright: [103, 49],
+                       bgBlueBright: [104, 49],
+                       bgMagentaBright: [105, 49],
+                       bgCyanBright: [106, 49],
+                       bgWhiteBright: [107, 49]
+               }
+       };
+
+       // Fix humans
+       styles.color.grey = styles.color.gray;
+
+       for (const groupName of Object.keys(styles)) {
+               const group = styles[groupName];
+
+               for (const styleName of Object.keys(group)) {
+                       const style = group[styleName];
+
+                       styles[styleName] = {
+                               open: `\u001B[${style[0]}m`,
+                               close: `\u001B[${style[1]}m`
+                       };
+
+                       group[styleName] = styles[styleName];
+
+                       codes.set(style[0], style[1]);
+               }
+
+               Object.defineProperty(styles, groupName, {
+                       value: group,
+                       enumerable: false
+               });
+
+               Object.defineProperty(styles, 'codes', {
+                       value: codes,
+                       enumerable: false
+               });
+       }
+
+       const rgb2rgb = (r, g, b) => [r, g, b];
+
+       styles.color.close = '\u001B[39m';
+       styles.bgColor.close = '\u001B[49m';
+
+       styles.color.ansi = {};
+       styles.color.ansi256 = {};
+       styles.color.ansi16m = {
+               rgb: wrapAnsi16m(rgb2rgb, 0)
+       };
+
+       styles.bgColor.ansi = {};
+       styles.bgColor.ansi256 = {};
+       styles.bgColor.ansi16m = {
+               rgb: wrapAnsi16m(rgb2rgb, 10)
+       };
+
+       for (const key of Object.keys(colorConvert)) {
+               if (typeof colorConvert[key] !== 'object') {
+                       continue;
+               }
+
+               const suite = colorConvert[key];
+
+               if ('ansi16' in suite) {
+                       styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0);
+                       styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10);
+               }
+
+               if ('ansi256' in suite) {
+                       styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0);
+                       styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10);
+               }
+
+               if ('rgb' in suite) {
+                       styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0);
+                       styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10);
+               }
+       }
+
+       return styles;
+}
+
+// Make the export immutable
+Object.defineProperty(module, 'exports', {
+       enumerable: true,
+       get: assembleStyles
+});
diff --git a/wrt/node_modules/ansi-styles/license b/wrt/node_modules/ansi-styles/license
new file mode 100644 (file)
index 0000000..e7af2f7
--- /dev/null
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/ansi-styles/package.json b/wrt/node_modules/ansi-styles/package.json
new file mode 100644 (file)
index 0000000..3c3045c
--- /dev/null
@@ -0,0 +1,126 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "ansi-styles",
+        "scope": null,
+        "escapedName": "ansi-styles",
+        "name": "ansi-styles",
+        "rawSpec": "",
+        "spec": "latest",
+        "type": "tag"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt"
+    ]
+  ],
+  "_from": "ansi-styles@latest",
+  "_id": "ansi-styles@3.2.0",
+  "_inCache": true,
+  "_location": "/ansi-styles",
+  "_nodeVersion": "8.2.1",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/ansi-styles-3.2.0.tgz_1500809147099_0.7141686324030161"
+  },
+  "_npmUser": {
+    "name": "sindresorhus",
+    "email": "sindresorhus@gmail.com"
+  },
+  "_npmVersion": "5.3.0",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "ansi-styles",
+    "scope": null,
+    "escapedName": "ansi-styles",
+    "name": "ansi-styles",
+    "rawSpec": "",
+    "spec": "latest",
+    "type": "tag"
+  },
+  "_requiredBy": [
+    "#USER"
+  ],
+  "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
+  "_shasum": "c159b8d5be0f9e5a6f346dab94f16ce022161b88",
+  "_shrinkwrap": null,
+  "_spec": "ansi-styles",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt",
+  "author": {
+    "name": "Sindre Sorhus",
+    "email": "sindresorhus@gmail.com",
+    "url": "sindresorhus.com"
+  },
+  "ava": {
+    "require": "babel-polyfill"
+  },
+  "bugs": {
+    "url": "https://github.com/chalk/ansi-styles/issues"
+  },
+  "dependencies": {
+    "color-convert": "^1.9.0"
+  },
+  "description": "ANSI escape codes for styling strings in the terminal",
+  "devDependencies": {
+    "ava": "*",
+    "babel-polyfill": "^6.23.0",
+    "xo": "*"
+  },
+  "directories": {},
+  "dist": {
+    "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==",
+    "shasum": "c159b8d5be0f9e5a6f346dab94f16ce022161b88",
+    "tarball": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz"
+  },
+  "engines": {
+    "node": ">=4"
+  },
+  "files": [
+    "index.js"
+  ],
+  "gitHead": "3340c4d536078a51fd7b5049e939c43c5ab05db3",
+  "homepage": "https://github.com/chalk/ansi-styles#readme",
+  "keywords": [
+    "ansi",
+    "styles",
+    "color",
+    "colour",
+    "colors",
+    "terminal",
+    "console",
+    "cli",
+    "string",
+    "tty",
+    "escape",
+    "formatting",
+    "rgb",
+    "256",
+    "shell",
+    "xterm",
+    "log",
+    "logging",
+    "command-line",
+    "text"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "qix",
+      "email": "i.am.qix@gmail.com"
+    },
+    {
+      "name": "sindresorhus",
+      "email": "sindresorhus@gmail.com"
+    }
+  ],
+  "name": "ansi-styles",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/chalk/ansi-styles.git"
+  },
+  "scripts": {
+    "test": "xo && ava"
+  },
+  "version": "3.2.0"
+}
diff --git a/wrt/node_modules/ansi-styles/readme.md b/wrt/node_modules/ansi-styles/readme.md
new file mode 100644 (file)
index 0000000..dce3687
--- /dev/null
@@ -0,0 +1,147 @@
+# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles)
+
+> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal
+
+You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings.
+
+![](screenshot.png)
+
+
+## Install
+
+```
+$ npm install ansi-styles
+```
+
+
+## Usage
+
+```js
+const style = require('ansi-styles');
+
+console.log(`${style.green.open}Hello world!${style.green.close}`);
+
+
+// Color conversion between 16/256/truecolor
+// NOTE: If conversion goes to 16 colors or 256 colors, the original color
+//       may be degraded to fit that color palette. This means terminals
+//       that do not support 16 million colors will best-match the
+//       original color.
+console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close);
+console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close);
+console.log(style.color.ansi16m.hex('#ABCDEF') + 'Hello world!' + style.color.close);
+```
+
+## API
+
+Each style has an `open` and `close` property.
+
+
+## Styles
+
+### Modifiers
+
+- `reset`
+- `bold`
+- `dim`
+- `italic` *(Not widely supported)*
+- `underline`
+- `inverse`
+- `hidden`
+- `strikethrough` *(Not widely supported)*
+
+### Colors
+
+- `black`
+- `red`
+- `green`
+- `yellow`
+- `blue`
+- `magenta`
+- `cyan`
+- `white`
+- `gray` ("bright black")
+- `redBright`
+- `greenBright`
+- `yellowBright`
+- `blueBright`
+- `magentaBright`
+- `cyanBright`
+- `whiteBright`
+
+### Background colors
+
+- `bgBlack`
+- `bgRed`
+- `bgGreen`
+- `bgYellow`
+- `bgBlue`
+- `bgMagenta`
+- `bgCyan`
+- `bgWhite`
+- `bgBlackBright`
+- `bgRedBright`
+- `bgGreenBright`
+- `bgYellowBright`
+- `bgBlueBright`
+- `bgMagentaBright`
+- `bgCyanBright`
+- `bgWhiteBright`
+
+
+## Advanced usage
+
+By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module.
+
+- `style.modifier`
+- `style.color`
+- `style.bgColor`
+
+###### Example
+
+```js
+console.log(style.color.green.open);
+```
+
+Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values.
+
+###### Example
+
+```js
+console.log(style.codes.get(36));
+//=> 39
+```
+
+
+## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728)
+
+`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors.
+
+To use these, call the associated conversion function with the intended output, for example:
+
+```js
+style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code
+style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code
+
+style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code
+style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code
+
+style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code
+style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code
+```
+
+
+## Related
+
+- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal
+
+
+## Maintainers
+
+- [Sindre Sorhus](https://github.com/sindresorhus)
+- [Josh Junon](https://github.com/qix-)
+
+
+## License
+
+MIT
diff --git a/wrt/node_modules/array-flatten/LICENSE b/wrt/node_modules/array-flatten/LICENSE
new file mode 100644 (file)
index 0000000..983fbe8
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/array-flatten/README.md b/wrt/node_modules/array-flatten/README.md
new file mode 100644 (file)
index 0000000..91fa5b6
--- /dev/null
@@ -0,0 +1,43 @@
+# Array Flatten
+
+[![NPM version][npm-image]][npm-url]
+[![NPM downloads][downloads-image]][downloads-url]
+[![Build status][travis-image]][travis-url]
+[![Test coverage][coveralls-image]][coveralls-url]
+
+> Flatten an array of nested arrays into a single flat array. Accepts an optional depth.
+
+## Installation
+
+```
+npm install array-flatten --save
+```
+
+## Usage
+
+```javascript
+var flatten = require('array-flatten')
+
+flatten([1, [2, [3, [4, [5], 6], 7], 8], 9])
+//=> [1, 2, 3, 4, 5, 6, 7, 8, 9]
+
+flatten([1, [2, [3, [4, [5], 6], 7], 8], 9], 2)
+//=> [1, 2, 3, [4, [5], 6], 7, 8, 9]
+
+(function () {
+  flatten(arguments) //=> [1, 2, 3]
+})(1, [2, 3])
+```
+
+## License
+
+MIT
+
+[npm-image]: https://img.shields.io/npm/v/array-flatten.svg?style=flat
+[npm-url]: https://npmjs.org/package/array-flatten
+[downloads-image]: https://img.shields.io/npm/dm/array-flatten.svg?style=flat
+[downloads-url]: https://npmjs.org/package/array-flatten
+[travis-image]: https://img.shields.io/travis/blakeembrey/array-flatten.svg?style=flat
+[travis-url]: https://travis-ci.org/blakeembrey/array-flatten
+[coveralls-image]: https://img.shields.io/coveralls/blakeembrey/array-flatten.svg?style=flat
+[coveralls-url]: https://coveralls.io/r/blakeembrey/array-flatten?branch=master
diff --git a/wrt/node_modules/array-flatten/array-flatten.js b/wrt/node_modules/array-flatten/array-flatten.js
new file mode 100644 (file)
index 0000000..089117b
--- /dev/null
@@ -0,0 +1,64 @@
+'use strict'
+
+/**
+ * Expose `arrayFlatten`.
+ */
+module.exports = arrayFlatten
+
+/**
+ * Recursive flatten function with depth.
+ *
+ * @param  {Array}  array
+ * @param  {Array}  result
+ * @param  {Number} depth
+ * @return {Array}
+ */
+function flattenWithDepth (array, result, depth) {
+  for (var i = 0; i < array.length; i++) {
+    var value = array[i]
+
+    if (depth > 0 && Array.isArray(value)) {
+      flattenWithDepth(value, result, depth - 1)
+    } else {
+      result.push(value)
+    }
+  }
+
+  return result
+}
+
+/**
+ * Recursive flatten function. Omitting depth is slightly faster.
+ *
+ * @param  {Array} array
+ * @param  {Array} result
+ * @return {Array}
+ */
+function flattenForever (array, result) {
+  for (var i = 0; i < array.length; i++) {
+    var value = array[i]
+
+    if (Array.isArray(value)) {
+      flattenForever(value, result)
+    } else {
+      result.push(value)
+    }
+  }
+
+  return result
+}
+
+/**
+ * Flatten an array, with the ability to define a depth.
+ *
+ * @param  {Array}  array
+ * @param  {Number} depth
+ * @return {Array}
+ */
+function arrayFlatten (array, depth) {
+  if (depth == null) {
+    return flattenForever(array, [])
+  }
+
+  return flattenWithDepth(array, [], depth)
+}
diff --git a/wrt/node_modules/array-flatten/package.json b/wrt/node_modules/array-flatten/package.json
new file mode 100644 (file)
index 0000000..3c9c6b0
--- /dev/null
@@ -0,0 +1,96 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "array-flatten@1.1.1",
+        "scope": null,
+        "escapedName": "array-flatten",
+        "name": "array-flatten",
+        "rawSpec": "1.1.1",
+        "spec": "1.1.1",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express"
+    ]
+  ],
+  "_from": "array-flatten@1.1.1",
+  "_id": "array-flatten@1.1.1",
+  "_inCache": true,
+  "_location": "/array-flatten",
+  "_nodeVersion": "2.3.3",
+  "_npmUser": {
+    "name": "blakeembrey",
+    "email": "hello@blakeembrey.com"
+  },
+  "_npmVersion": "2.11.3",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "array-flatten@1.1.1",
+    "scope": null,
+    "escapedName": "array-flatten",
+    "name": "array-flatten",
+    "rawSpec": "1.1.1",
+    "spec": "1.1.1",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/express"
+  ],
+  "_resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
+  "_shasum": "9a5f699051b1e7073328f2a008968b64ea2955d2",
+  "_shrinkwrap": null,
+  "_spec": "array-flatten@1.1.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express",
+  "author": {
+    "name": "Blake Embrey",
+    "email": "hello@blakeembrey.com",
+    "url": "http://blakeembrey.me"
+  },
+  "bugs": {
+    "url": "https://github.com/blakeembrey/array-flatten/issues"
+  },
+  "dependencies": {},
+  "description": "Flatten an array of nested arrays into a single flat array",
+  "devDependencies": {
+    "istanbul": "^0.3.13",
+    "mocha": "^2.2.4",
+    "pre-commit": "^1.0.7",
+    "standard": "^3.7.3"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "9a5f699051b1e7073328f2a008968b64ea2955d2",
+    "tarball": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz"
+  },
+  "files": [
+    "array-flatten.js",
+    "LICENSE"
+  ],
+  "gitHead": "1963a9189229d408e1e8f585a00c8be9edbd1803",
+  "homepage": "https://github.com/blakeembrey/array-flatten",
+  "keywords": [
+    "array",
+    "flatten",
+    "arguments",
+    "depth"
+  ],
+  "license": "MIT",
+  "main": "array-flatten.js",
+  "maintainers": [
+    {
+      "name": "blakeembrey",
+      "email": "hello@blakeembrey.com"
+    }
+  ],
+  "name": "array-flatten",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/blakeembrey/array-flatten.git"
+  },
+  "scripts": {
+    "test": "istanbul cover _mocha -- -R spec"
+  },
+  "version": "1.1.1"
+}
diff --git a/wrt/node_modules/arraybuffer.slice/.npmignore b/wrt/node_modules/arraybuffer.slice/.npmignore
new file mode 100644 (file)
index 0000000..cfbee8d
--- /dev/null
@@ -0,0 +1,17 @@
+lib-cov
+lcov.info
+*.seed
+*.log
+*.csv
+*.dat
+*.out
+*.pid
+*.gz
+
+pids
+logs
+results
+build
+.grunt
+
+node_modules
diff --git a/wrt/node_modules/arraybuffer.slice/Makefile b/wrt/node_modules/arraybuffer.slice/Makefile
new file mode 100644 (file)
index 0000000..849887f
--- /dev/null
@@ -0,0 +1,8 @@
+
+REPORTER = dot
+
+test:
+       @./node_modules/.bin/mocha \
+               --reporter $(REPORTER)
+
+.PHONY: test
diff --git a/wrt/node_modules/arraybuffer.slice/README.md b/wrt/node_modules/arraybuffer.slice/README.md
new file mode 100644 (file)
index 0000000..15e465e
--- /dev/null
@@ -0,0 +1,17 @@
+# How to
+```javascript
+var sliceBuffer = require('arraybuffer.slice');
+var ab = (new Int8Array(5)).buffer;
+var sliced = sliceBuffer(ab, 1, 3);
+sliced = sliceBuffer(ab, 1);
+```
+
+# Licence (MIT)
+Copyright (C) 2013 Rase-
+
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/arraybuffer.slice/index.js b/wrt/node_modules/arraybuffer.slice/index.js
new file mode 100644 (file)
index 0000000..11ac556
--- /dev/null
@@ -0,0 +1,29 @@
+/**
+ * An abstraction for slicing an arraybuffer even when
+ * ArrayBuffer.prototype.slice is not supported
+ *
+ * @api public
+ */
+
+module.exports = function(arraybuffer, start, end) {
+  var bytes = arraybuffer.byteLength;
+  start = start || 0;
+  end = end || bytes;
+
+  if (arraybuffer.slice) { return arraybuffer.slice(start, end); }
+
+  if (start < 0) { start += bytes; }
+  if (end < 0) { end += bytes; }
+  if (end > bytes) { end = bytes; }
+
+  if (start >= bytes || start >= end || bytes === 0) {
+    return new ArrayBuffer(0);
+  }
+
+  var abv = new Uint8Array(arraybuffer);
+  var result = new Uint8Array(end - start);
+  for (var i = start, ii = 0; i < end; i++, ii++) {
+    result[ii] = abv[i];
+  }
+  return result.buffer;
+};
diff --git a/wrt/node_modules/arraybuffer.slice/package.json b/wrt/node_modules/arraybuffer.slice/package.json
new file mode 100644 (file)
index 0000000..34d4975
--- /dev/null
@@ -0,0 +1,72 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "arraybuffer.slice@0.0.6",
+        "scope": null,
+        "escapedName": "arraybuffer.slice",
+        "name": "arraybuffer.slice",
+        "rawSpec": "0.0.6",
+        "spec": "0.0.6",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io-parser"
+    ]
+  ],
+  "_from": "arraybuffer.slice@0.0.6",
+  "_id": "arraybuffer.slice@0.0.6",
+  "_inCache": true,
+  "_location": "/arraybuffer.slice",
+  "_npmUser": {
+    "name": "rase-",
+    "email": "tonykovanen@hotmail.com"
+  },
+  "_npmVersion": "1.3.5",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "arraybuffer.slice@0.0.6",
+    "scope": null,
+    "escapedName": "arraybuffer.slice",
+    "name": "arraybuffer.slice",
+    "rawSpec": "0.0.6",
+    "spec": "0.0.6",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/engine.io-parser"
+  ],
+  "_resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.6.tgz",
+  "_shasum": "f33b2159f0532a3f3107a272c0ccfbd1ad2979ca",
+  "_shrinkwrap": null,
+  "_spec": "arraybuffer.slice@0.0.6",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io-parser",
+  "bugs": {
+    "url": "https://github.com/rase-/arraybuffer.slice/issues"
+  },
+  "dependencies": {},
+  "description": "Exports a function for slicing ArrayBuffers (no polyfilling)",
+  "devDependencies": {
+    "expect.js": "0.2.0",
+    "mocha": "1.17.1"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "f33b2159f0532a3f3107a272c0ccfbd1ad2979ca",
+    "tarball": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.6.tgz"
+  },
+  "homepage": "https://github.com/rase-/arraybuffer.slice",
+  "maintainers": [
+    {
+      "name": "rase-",
+      "email": "tonykovanen@hotmail.com"
+    }
+  ],
+  "name": "arraybuffer.slice",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+ssh://git@github.com/rase-/arraybuffer.slice.git"
+  },
+  "version": "0.0.6"
+}
diff --git a/wrt/node_modules/arraybuffer.slice/test/slice-buffer.js b/wrt/node_modules/arraybuffer.slice/test/slice-buffer.js
new file mode 100644 (file)
index 0000000..4778da6
--- /dev/null
@@ -0,0 +1,227 @@
+/*
+ * Test dependencies
+ */
+
+var sliceBuffer = require('../index.js');
+var expect = require('expect.js');
+
+/**
+ * Tests
+ */
+
+describe('sliceBuffer', function() {
+  describe('using standard slice', function() {
+    it('should slice correctly with only start provided', function() {
+      var abv = new Uint8Array(10);
+      for (var i = 0; i < abv.length; i++) {
+        abv[i] = i;
+      }
+
+      var sliced = sliceBuffer(abv.buffer, 3);
+      var sabv = new Uint8Array(sliced);
+      for (var i = 3, ii = 0; i < abv.length; i++, ii++) {
+        expect(abv[i]).to.equal(sabv[ii]);
+      }
+    });
+
+    it('should slice correctly with start and end provided', function() {
+      var abv = new Uint8Array(10);
+      for (var i = 0; i < abv.length; i++) {
+        abv[i] = i;
+      }
+
+      var sliced = sliceBuffer(abv.buffer, 3, 8);
+      var sabv = new Uint8Array(sliced);
+      for (var i = 3, ii = 0; i < 8; i++, ii++) {
+        expect(abv[i]).to.equal(sabv[ii]);
+      }
+    });
+
+    it('should slice correctly with negative start', function() {
+      var abv = new Uint8Array(10);
+      for (var i = 0; i < abv.length; i++) {
+        abv[i] = i;
+      }
+
+      var sliced = sliceBuffer(abv.buffer, -3);
+      var sabv = new Uint8Array(sliced);
+      for (var i = abv.length - 3, ii = 0; i < abv.length; i++, ii++) {
+        expect(abv[i]).to.equal(sabv[ii]);
+      }
+    });
+
+    it('should slice correctly with negative end', function() {
+      var abv = new Uint8Array(10);
+      for (var i = 0; i < abv.length; i++) {
+        abv[i] = i;
+      }
+
+      var sliced = sliceBuffer(abv.buffer, 0, -3);
+      var sabv = new Uint8Array(sliced);
+      for (var i = 0, ii = 0; i < abv.length - 3; i++, ii++) {
+        expect(abv[i]).to.equal(sabv[ii]);
+      }
+    });
+
+    it('should slice correctly with negative start and end', function() {
+      var abv = new Uint8Array(10);
+      for (var i = 0; i < abv.length; i++) {
+        abv[i] = i;
+      }
+
+      var sliced = sliceBuffer(abv.buffer, -6, -3);
+      var sabv = new Uint8Array(sliced);
+      for (var i = abv.length - 6, ii = 0; i < abv.length - 3; i++, ii++) {
+        expect(abv[i]).to.equal(sabv[ii]);
+      }
+    });
+
+    it('should slice correctly with equal start and end', function() {
+      var abv = new Uint8Array(10);
+      for (var i = 0; i < abv.length; i++) {
+        abv[i] = i;
+      }
+
+      var sliced = sliceBuffer(abv.buffer, 1, 1);
+      expect(sliced.byteLength).to.equal(0);
+    });
+    
+    it('should slice correctly when end larger than buffer', function() {
+      var abv = new Uint8Array(10);
+      for (var i = 0; i < abv.length; i++) {
+        abv[i] = i;
+      }
+
+      var sliced = sliceBuffer(abv.buffer, 0, 100);
+      expect(new Uint8Array(sliced)).to.eql(abv);
+    });
+
+    it('shoud slice correctly when start larger than end', function() {
+      var abv = new Uint8Array(10);
+      for (var i = 0; i < abv.length; i++) {
+        abv[i] = i;
+      }
+
+      var sliced = sliceBuffer(abv.buffer, 6, 5);
+      expect(sliced.byteLength).to.equal(0);
+    });
+  });
+
+  describe('using fallback', function() {
+    it('should slice correctly with only start provided', function() {
+      var abv = new Uint8Array(10);
+      for (var i = 0; i < abv.length; i++) {
+        abv[i] = i;
+      }
+      var ab = abv.buffer;
+      ab.slice = undefined;
+
+      var sliced = sliceBuffer(ab, 3);
+      var sabv = new Uint8Array(sliced);
+      for (var i = 3, ii = 0; i < abv.length; i++, ii++) {
+        expect(abv[i]).to.equal(sabv[ii]);
+      }
+    });
+
+    it('should slice correctly with start and end provided', function() {
+      var abv = new Uint8Array(10);
+      for (var i = 0; i < abv.length; i++) {
+        abv[i] = i;
+      }
+      var ab = abv.buffer;
+      ab.slice = undefined;
+
+
+      var sliced = sliceBuffer(ab, 3, 8);
+      var sabv = new Uint8Array(sliced);
+      for (var i = 3, ii = 0; i < 8; i++, ii++) {
+        expect(abv[i]).to.equal(sabv[ii]);
+      }
+    });
+
+    it('should slice correctly with negative start', function() {
+      var abv = new Uint8Array(10);
+      for (var i = 0; i < abv.length; i++) {
+        abv[i] = i;
+      }
+      var ab = abv.buffer;
+      ab.slice = undefined;
+
+
+      var sliced = sliceBuffer(ab, -3);
+      var sabv = new Uint8Array(sliced);
+      for (var i = abv.length - 3, ii = 0; i < abv.length; i++, ii++) {
+        expect(abv[i]).to.equal(sabv[ii]);
+      }
+    });
+
+    it('should slice correctly with negative end', function() {
+      var abv = new Uint8Array(10);
+      for (var i = 0; i < abv.length; i++) {
+        abv[i] = i;
+      }
+      var ab = abv.buffer;
+      ab.slice = undefined;
+
+      var sliced = sliceBuffer(ab, 0, -3);
+      var sabv = new Uint8Array(sliced);
+      for (var i = 0, ii = 0; i < abv.length - 3; i++, ii++) {
+        expect(abv[i]).to.equal(sabv[ii]);
+      }
+    });
+
+    it('should slice correctly with negative start and end', function() {
+      var abv = new Uint8Array(10);
+      for (var i = 0; i < abv.length; i++) {
+        abv[i] = i;
+      }
+      var ab = abv.buffer;
+      ab.slice = undefined;
+
+      var sliced = sliceBuffer(ab, -6, -3);
+      var sabv = new Uint8Array(sliced);
+      for (var i = abv.length - 6, ii = 0; i < abv.length - 3; i++, ii++) {
+        expect(abv[i]).to.equal(sabv[ii]);
+      }
+    });
+
+    it('should slice correctly with equal start and end', function() {
+      var abv = new Uint8Array(10);
+      for (var i = 0; i < abv.length; i++) {
+        abv[i] = i;
+      }
+      var ab = abv.buffer;
+      ab.slice = undefined;
+
+      var sliced = sliceBuffer(ab, 1, 1);
+      expect(sliced.byteLength).to.equal(0);
+    });
+
+    it('should slice correctly when end larger than buffer', function() {
+      var abv = new Uint8Array(10);
+      for (var i = 0; i < abv.length; i++) {
+        abv[i] = i;
+      }
+      var ab = abv.buffer;
+      ab.slice = undefined;
+
+      var sliced = sliceBuffer(ab, 0, 100);
+      var sabv = new Uint8Array(sliced);
+      for (var i = 0; i < abv.length; i++) {
+        expect(abv[i]).to.equal(sabv[i]);
+      }
+    });
+
+    it('shoud slice correctly when start larger than end', function() {
+      var abv = new Uint8Array(10);
+      for (var i = 0; i < abv.length; i++) {
+        abv[i] = i;
+      }
+      var ab = abv.buffer;
+      ab.slice = undefined;
+
+      var sliced = sliceBuffer(ab, 6, 5);
+      expect(sliced.byteLength).to.equal(0);
+    });
+  });
+});
diff --git a/wrt/node_modules/async/CHANGELOG.md b/wrt/node_modules/async/CHANGELOG.md
new file mode 100644 (file)
index 0000000..f15e081
--- /dev/null
@@ -0,0 +1,125 @@
+# v1.5.2
+- Allow using `"consructor"` as an argument in `memoize` (#998)
+- Give a better error messsage when `auto` dependency checking fails (#994)
+- Various doc updates (#936, #956, #979, #1002)
+
+# v1.5.1
+- Fix issue with `pause` in `queue` with concurrency enabled (#946)
+- `while` and `until` now pass the final result to callback (#963)
+- `auto` will properly handle concurrency when there is no callback (#966)
+- `auto` will now  properly stop execution when an error occurs (#988, #993)
+- Various doc fixes (#971, #980)
+
+# v1.5.0
+
+- Added `transform`, analogous to [`_.transform`](http://lodash.com/docs#transform) (#892)
+- `map` now returns an object when an object is passed in, rather than array with non-numeric keys. `map` will begin always returning an array with numeric indexes in the next major release. (#873)
+- `auto` now accepts an optional `concurrency` argument to limit the number of  running tasks (#637)
+- Added `queue#workersList()`, to retrieve the list  of currently running tasks. (#891)
+- Various code simplifications (#896, #904)
+- Various doc fixes :scroll: (#890, #894, #903, #905, #912)
+
+# v1.4.2
+
+- Ensure coverage files don't get published on npm (#879)
+
+# v1.4.1
+
+- Add in overlooked `detectLimit` method (#866)
+- Removed unnecessary files from npm releases (#861)
+- Removed usage of a reserved word to prevent :boom: in older environments (#870)
+
+# v1.4.0
+
+- `asyncify` now supports promises (#840)
+- Added `Limit` versions of `filter` and `reject` (#836)
+- Add `Limit` versions of `detect`, `some` and `every` (#828, #829)
+- `some`, `every` and `detect` now short circuit early (#828, #829)
+- Improve detection of the global object (#804), enabling use in WebWorkers
+- `whilst` now called with arguments from iterator (#823)
+- `during` now gets called with arguments from iterator (#824)
+- Code simplifications and optimizations aplenty ([diff](https://github.com/caolan/async/compare/v1.3.0...v1.4.0))
+
+
+# v1.3.0
+
+New Features:
+- Added `constant`
+- Added `asyncify`/`wrapSync` for making sync functions work with callbacks. (#671, #806)
+- Added `during` and `doDuring`, which are like `whilst` with an async truth test. (#800)
+- `retry` now accepts an `interval` parameter to specify a delay between retries. (#793)
+- `async` should work better in Web Workers due to better `root` detection (#804)
+- Callbacks are now optional in `whilst`, `doWhilst`, `until`, and `doUntil` (#642)
+- Various internal updates (#786, #801, #802, #803)
+- Various doc fixes (#790, #794)
+
+Bug Fixes:
+- `cargo` now exposes the `payload` size, and `cargo.payload` can be changed on the fly after the `cargo` is created. (#740, #744, #783)
+
+
+# v1.2.1
+
+Bug Fix:
+
+- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array.  Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores.  In 2.0.0, it will be called on the next tick.  (#782)
+
+
+# v1.2.0
+
+New Features:
+
+- Added `timesLimit` (#743)
+- `concurrency` can be changed after initialization in `queue` by setting `q.concurrency`.  The new concurrency will be reflected the next time a task is processed. (#747, #772)
+
+Bug Fixes:
+
+- Fixed a regression in `each` and family with empty arrays that have additional properties. (#775, #777)
+
+
+# v1.1.1
+
+Bug Fix:
+
+- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array.  Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores.  In 2.0.0, it will be called on the next tick.  (#782) 
+
+
+# v1.1.0
+
+New Features:
+
+- `cargo` now supports all of the same methods and event callbacks as `queue`.
+- Added `ensureAsync` - A wrapper that ensures an async function calls its callback on a later tick. (#769)
+- Optimized `map`, `eachOf`, and `waterfall` families of functions
+- Passing a `null` or `undefined` array to `map`, `each`, `parallel` and families will be treated as an empty array (#667).
+- The callback is now optional for the composed results of `compose` and `seq`. (#618)
+- Reduced file size by 4kb, (minified version by 1kb) 
+- Added code coverage through `nyc` and `coveralls` (#768)
+
+Bug Fixes:
+
+- `forever` will no longer stack overflow with a synchronous iterator (#622)
+- `eachLimit` and other limit functions will stop iterating once an error occurs (#754)
+- Always pass `null` in callbacks when there is no error (#439)
+- Ensure proper conditions when calling `drain()` after pushing an empty data set to a queue (#668)
+- `each` and family will properly handle an empty array (#578)
+- `eachSeries` and family will finish if the underlying array is modified during execution (#557)
+- `queue` will throw if a non-function is passed to `q.push()` (#593)
+- Doc fixes (#629, #766)
+
+
+# v1.0.0
+
+No known breaking changes, we are simply complying with semver from here on out.
+
+Changes:
+
+- Start using a changelog!
+- Add `forEachOf` for iterating over Objects (or to iterate Arrays with indexes available) (#168 #704 #321)
+- Detect deadlocks in `auto` (#663)
+- Better support for require.js (#527)
+- Throw if queue created with concurrency `0` (#714)
+- Fix unneeded iteration in `queue.resume()` (#758)
+- Guard against timer mocking overriding `setImmediate` (#609 #611)
+- Miscellaneous doc fixes (#542 #596 #615 #628 #631 #690 #729)
+- Use single noop function internally (#546)
+- Optimize internal `_each`, `_map` and `_keys` functions.
diff --git a/wrt/node_modules/async/LICENSE b/wrt/node_modules/async/LICENSE
new file mode 100644 (file)
index 0000000..8f29698
--- /dev/null
@@ -0,0 +1,19 @@
+Copyright (c) 2010-2014 Caolan McMahon
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/async/README.md b/wrt/node_modules/async/README.md
new file mode 100644 (file)
index 0000000..316c405
--- /dev/null
@@ -0,0 +1,1877 @@
+# Async.js
+
+[![Build Status via Travis CI](https://travis-ci.org/caolan/async.svg?branch=master)](https://travis-ci.org/caolan/async)
+[![NPM version](http://img.shields.io/npm/v/async.svg)](https://www.npmjs.org/package/async)
+[![Coverage Status](https://coveralls.io/repos/caolan/async/badge.svg?branch=master)](https://coveralls.io/r/caolan/async?branch=master)
+[![Join the chat at https://gitter.im/caolan/async](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/caolan/async?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+
+
+Async is a utility module which provides straight-forward, powerful functions
+for working with asynchronous JavaScript. Although originally designed for
+use with [Node.js](http://nodejs.org) and installable via `npm install async`,
+it can also be used directly in the browser.
+
+Async is also installable via:
+
+- [bower](http://bower.io/): `bower install async`
+- [component](https://github.com/component/component): `component install
+  caolan/async`
+- [jam](http://jamjs.org/): `jam install async`
+- [spm](http://spmjs.io/): `spm install async`
+
+Async provides around 20 functions that include the usual 'functional'
+suspects (`map`, `reduce`, `filter`, `each`…) as well as some common patterns
+for asynchronous control flow (`parallel`, `series`, `waterfall`…). All these
+functions assume you follow the Node.js convention of providing a single
+callback as the last argument of your `async` function.
+
+
+## Quick Examples
+
+```javascript
+async.map(['file1','file2','file3'], fs.stat, function(err, results){
+    // results is now an array of stats for each file
+});
+
+async.filter(['file1','file2','file3'], fs.exists, function(results){
+    // results now equals an array of the existing files
+});
+
+async.parallel([
+    function(){ ... },
+    function(){ ... }
+], callback);
+
+async.series([
+    function(){ ... },
+    function(){ ... }
+]);
+```
+
+There are many more functions available so take a look at the docs below for a
+full list. This module aims to be comprehensive, so if you feel anything is
+missing please create a GitHub issue for it.
+
+## Common Pitfalls <sub>[(StackOverflow)](http://stackoverflow.com/questions/tagged/async.js)</sub>
+### Synchronous iteration functions
+
+If you get an error like `RangeError: Maximum call stack size exceeded.` or other stack overflow issues when using async, you are likely using a synchronous iterator.  By *synchronous* we mean a function that calls its callback on the same tick in the javascript event loop, without doing any I/O or using any timers.  Calling many callbacks iteratively will quickly overflow the stack. If you run into this issue, just defer your callback with `async.setImmediate` to start a new call stack on the next tick of the event loop.
+
+This can also arise by accident if you callback early in certain cases:
+
+```js
+async.eachSeries(hugeArray, function iterator(item, callback) {
+  if (inCache(item)) {
+    callback(null, cache[item]); // if many items are cached, you'll overflow
+  } else {
+    doSomeIO(item, callback);
+  }
+}, function done() {
+  //...
+});
+```
+
+Just change it to:
+
+```js
+async.eachSeries(hugeArray, function iterator(item, callback) {
+  if (inCache(item)) {
+    async.setImmediate(function () {
+      callback(null, cache[item]);
+    });
+  } else {
+    doSomeIO(item, callback);
+  //...
+```
+
+Async guards against synchronous functions in some, but not all, cases.  If you are still running into stack overflows, you can defer as suggested above, or wrap functions with [`async.ensureAsync`](#ensureAsync)  Functions that are asynchronous by their nature do not have this problem and don't need the extra callback deferral.
+
+If JavaScript's event loop is still a bit nebulous, check out [this article](http://blog.carbonfive.com/2013/10/27/the-javascript-event-loop-explained/) or [this talk](http://2014.jsconf.eu/speakers/philip-roberts-what-the-heck-is-the-event-loop-anyway.html) for more detailed information about how it works.
+
+
+### Multiple callbacks
+
+Make sure to always `return` when calling a callback early, otherwise you will cause multiple callbacks and unpredictable behavior in many cases.
+
+```js
+async.waterfall([
+    function (callback) {
+        getSomething(options, function (err, result) {
+          if (err) {
+            callback(new Error("failed getting something:" + err.message));
+            // we should return here
+          }
+          // since we did not return, this callback still will be called and
+          // `processData` will be called twice
+          callback(null, result);
+        });
+    },
+    processData
+], done)
+```
+
+It is always good practice to `return callback(err, result)`  whenever a callback call is not the last statement of a function.
+
+
+### Binding a context to an iterator
+
+This section is really about `bind`, not about `async`. If you are wondering how to
+make `async` execute your iterators in a given context, or are confused as to why
+a method of another library isn't working as an iterator, study this example:
+
+```js
+// Here is a simple object with an (unnecessarily roundabout) squaring method
+var AsyncSquaringLibrary = {
+  squareExponent: 2,
+  square: function(number, callback){
+    var result = Math.pow(number, this.squareExponent);
+    setTimeout(function(){
+      callback(null, result);
+    }, 200);
+  }
+};
+
+async.map([1, 2, 3], AsyncSquaringLibrary.square, function(err, result){
+  // result is [NaN, NaN, NaN]
+  // This fails because the `this.squareExponent` expression in the square
+  // function is not evaluated in the context of AsyncSquaringLibrary, and is
+  // therefore undefined.
+});
+
+async.map([1, 2, 3], AsyncSquaringLibrary.square.bind(AsyncSquaringLibrary), function(err, result){
+  // result is [1, 4, 9]
+  // With the help of bind we can attach a context to the iterator before
+  // passing it to async. Now the square function will be executed in its
+  // 'home' AsyncSquaringLibrary context and the value of `this.squareExponent`
+  // will be as expected.
+});
+```
+
+## Download
+
+The source is available for download from
+[GitHub](https://github.com/caolan/async/blob/master/lib/async.js).
+Alternatively, you can install using Node Package Manager (`npm`):
+
+    npm install async
+
+As well as using Bower:
+
+    bower install async
+
+__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 29.6kb Uncompressed
+
+## In the Browser
+
+So far it's been tested in IE6, IE7, IE8, FF3.6 and Chrome 5.
+
+Usage:
+
+```html
+<script type="text/javascript" src="async.js"></script>
+<script type="text/javascript">
+
+    async.map(data, asyncProcess, function(err, results){
+        alert(results);
+    });
+
+</script>
+```
+
+## Documentation
+
+Some functions are also available in the following forms:
+* `<name>Series` - the same as `<name>` but runs only a single async operation at a time
+* `<name>Limit` - the same as `<name>` but runs a maximum of `limit` async operations at a time
+
+### Collections
+
+* [`each`](#each), `eachSeries`, `eachLimit`
+* [`forEachOf`](#forEachOf), `forEachOfSeries`, `forEachOfLimit`
+* [`map`](#map), `mapSeries`, `mapLimit`
+* [`filter`](#filter), `filterSeries`, `filterLimit`
+* [`reject`](#reject), `rejectSeries`, `rejectLimit`
+* [`reduce`](#reduce), [`reduceRight`](#reduceRight)
+* [`detect`](#detect), `detectSeries`, `detectLimit`
+* [`sortBy`](#sortBy)
+* [`some`](#some), `someLimit`
+* [`every`](#every), `everyLimit`
+* [`concat`](#concat), `concatSeries`
+
+### Control Flow
+
+* [`series`](#seriestasks-callback)
+* [`parallel`](#parallel), `parallelLimit`
+* [`whilst`](#whilst), [`doWhilst`](#doWhilst)
+* [`until`](#until), [`doUntil`](#doUntil)
+* [`during`](#during), [`doDuring`](#doDuring)
+* [`forever`](#forever)
+* [`waterfall`](#waterfall)
+* [`compose`](#compose)
+* [`seq`](#seq)
+* [`applyEach`](#applyEach), `applyEachSeries`
+* [`queue`](#queue), [`priorityQueue`](#priorityQueue)
+* [`cargo`](#cargo)
+* [`auto`](#auto)
+* [`retry`](#retry)
+* [`iterator`](#iterator)
+* [`times`](#times), `timesSeries`, `timesLimit`
+
+### Utils
+
+* [`apply`](#apply)
+* [`nextTick`](#nextTick)
+* [`memoize`](#memoize)
+* [`unmemoize`](#unmemoize)
+* [`ensureAsync`](#ensureAsync)
+* [`constant`](#constant)
+* [`asyncify`](#asyncify)
+* [`wrapSync`](#wrapSync)
+* [`log`](#log)
+* [`dir`](#dir)
+* [`noConflict`](#noConflict)
+
+## Collections
+
+<a name="forEach" />
+<a name="each" />
+### each(arr, iterator, [callback])
+
+Applies the function `iterator` to each item in `arr`, in parallel.
+The `iterator` is called with an item from the list, and a callback for when it
+has finished. If the `iterator` passes an error to its `callback`, the main
+`callback` (for the `each` function) is immediately called with the error.
+
+Note, that since this function applies `iterator` to each item in parallel,
+there is no guarantee that the iterator functions will complete in order.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A function to apply to each item in `arr`.
+  The iterator is passed a `callback(err)` which must be called once it has
+  completed. If no error has occurred, the `callback` should be run without
+  arguments or with an explicit `null` argument.  The array index is not passed
+  to the iterator.  If you need the index, use [`forEachOf`](#forEachOf).
+* `callback(err)` - *Optional* A callback which is called when all `iterator` functions
+  have finished, or an error occurs.
+
+__Examples__
+
+
+```js
+// assuming openFiles is an array of file names and saveFile is a function
+// to save the modified contents of that file:
+
+async.each(openFiles, saveFile, function(err){
+    // if any of the saves produced an error, err would equal that error
+});
+```
+
+```js
+// assuming openFiles is an array of file names
+
+async.each(openFiles, function(file, callback) {
+
+  // Perform operation on file here.
+  console.log('Processing file ' + file);
+
+  if( file.length > 32 ) {
+    console.log('This file name is too long');
+    callback('File name too long');
+  } else {
+    // Do work to process file here
+    console.log('File processed');
+    callback();
+  }
+}, function(err){
+    // if any of the file processing produced an error, err would equal that error
+    if( err ) {
+      // One of the iterations produced an error.
+      // All processing will now stop.
+      console.log('A file failed to process');
+    } else {
+      console.log('All files have been processed successfully');
+    }
+});
+```
+
+__Related__
+
+* eachSeries(arr, iterator, [callback])
+* eachLimit(arr, limit, iterator, [callback])
+
+---------------------------------------
+
+<a name="forEachOf" />
+<a name="eachOf" />
+
+### forEachOf(obj, iterator, [callback])
+
+Like `each`, except that it iterates over objects, and passes the key as the second argument to the iterator.
+
+__Arguments__
+
+* `obj` - An object or array to iterate over.
+* `iterator(item, key, callback)` - A function to apply to each item in `obj`.
+The `key` is the item's key, or index in the case of an array. The iterator is
+passed a `callback(err)` which must be called once it has completed. If no
+error has occurred, the callback should be run without arguments or with an
+explicit `null` argument.
+* `callback(err)` - *Optional* A callback which is called when all `iterator` functions have finished, or an error occurs.
+
+__Example__
+
+```js
+var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"};
+var configs = {};
+
+async.forEachOf(obj, function (value, key, callback) {
+  fs.readFile(__dirname + value, "utf8", function (err, data) {
+    if (err) return callback(err);
+    try {
+      configs[key] = JSON.parse(data);
+    } catch (e) {
+      return callback(e);
+    }
+    callback();
+  })
+}, function (err) {
+  if (err) console.error(err.message);
+  // configs is now a map of JSON data
+  doSomethingWith(configs);
+})
+```
+
+__Related__
+
+* forEachOfSeries(obj, iterator, [callback])
+* forEachOfLimit(obj, limit, iterator, [callback])
+
+---------------------------------------
+
+<a name="map" />
+### map(arr, iterator, [callback])
+
+Produces a new array of values by mapping each value in `arr` through
+the `iterator` function. The `iterator` is called with an item from `arr` and a
+callback for when it has finished processing. Each of these callback takes 2 arguments:
+an `error`, and the transformed item from `arr`. If `iterator` passes an error to its
+callback, the main `callback` (for the `map` function) is immediately called with the error.
+
+Note, that since this function applies the `iterator` to each item in parallel,
+there is no guarantee that the `iterator` functions will complete in order.
+However, the results array will be in the same order as the original `arr`.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A function to apply to each item in `arr`.
+  The iterator is passed a `callback(err, transformed)` which must be called once
+  it has completed with an error (which can be `null`) and a transformed item.
+* `callback(err, results)` - *Optional* A callback which is called when all `iterator`
+  functions have finished, or an error occurs. Results is an array of the
+  transformed items from the `arr`.
+
+__Example__
+
+```js
+async.map(['file1','file2','file3'], fs.stat, function(err, results){
+    // results is now an array of stats for each file
+});
+```
+
+__Related__
+* mapSeries(arr, iterator, [callback])
+* mapLimit(arr, limit, iterator, [callback])
+
+---------------------------------------
+
+<a name="select" />
+<a name="filter" />
+### filter(arr, iterator, [callback])
+
+__Alias:__ `select`
+
+Returns a new array of all the values in `arr` which pass an async truth test.
+_The callback for each `iterator` call only accepts a single argument of `true` or
+`false`; it does not accept an error argument first!_ This is in-line with the
+way node libraries work with truth tests like `fs.exists`. This operation is
+performed in parallel, but the results array will be in the same order as the
+original.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A truth test to apply to each item in `arr`.
+  The `iterator` is passed a `callback(truthValue)`, which must be called with a
+  boolean argument once it has completed.
+* `callback(results)` - *Optional* A callback which is called after all the `iterator`
+  functions have finished.
+
+__Example__
+
+```js
+async.filter(['file1','file2','file3'], fs.exists, function(results){
+    // results now equals an array of the existing files
+});
+```
+
+__Related__
+
+* filterSeries(arr, iterator, [callback])
+* filterLimit(arr, limit, iterator, [callback])
+
+---------------------------------------
+
+<a name="reject" />
+### reject(arr, iterator, [callback])
+
+The opposite of [`filter`](#filter). Removes values that pass an `async` truth test.
+
+__Related__
+
+* rejectSeries(arr, iterator, [callback])
+* rejectLimit(arr, limit, iterator, [callback])
+
+---------------------------------------
+
+<a name="reduce" />
+### reduce(arr, memo, iterator, [callback])
+
+__Aliases:__ `inject`, `foldl`
+
+Reduces `arr` into a single value using an async `iterator` to return
+each successive step. `memo` is the initial state of the reduction.
+This function only operates in series.
+
+For performance reasons, it may make sense to split a call to this function into
+a parallel map, and then use the normal `Array.prototype.reduce` on the results.
+This function is for situations where each step in the reduction needs to be async;
+if you can get the data before reducing it, then it's probably a good idea to do so.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `memo` - The initial state of the reduction.
+* `iterator(memo, item, callback)` - A function applied to each item in the
+  array to produce the next step in the reduction. The `iterator` is passed a
+  `callback(err, reduction)` which accepts an optional error as its first
+  argument, and the state of the reduction as the second. If an error is
+  passed to the callback, the reduction is stopped and the main `callback` is
+  immediately called with the error.
+* `callback(err, result)` - *Optional* A callback which is called after all the `iterator`
+  functions have finished. Result is the reduced value.
+
+__Example__
+
+```js
+async.reduce([1,2,3], 0, function(memo, item, callback){
+    // pointless async:
+    process.nextTick(function(){
+        callback(null, memo + item)
+    });
+}, function(err, result){
+    // result is now equal to the last value of memo, which is 6
+});
+```
+
+---------------------------------------
+
+<a name="reduceRight" />
+### reduceRight(arr, memo, iterator, [callback])
+
+__Alias:__ `foldr`
+
+Same as [`reduce`](#reduce), only operates on `arr` in reverse order.
+
+
+---------------------------------------
+
+<a name="detect" />
+### detect(arr, iterator, [callback])
+
+Returns the first value in `arr` that passes an async truth test. The
+`iterator` is applied in parallel, meaning the first iterator to return `true` will
+fire the detect `callback` with that result. That means the result might not be
+the first item in the original `arr` (in terms of order) that passes the test.
+
+If order within the original `arr` is important, then look at [`detectSeries`](#detectSeries).
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A truth test to apply to each item in `arr`.
+  The iterator is passed a `callback(truthValue)` which must be called with a
+  boolean argument once it has completed. **Note: this callback does not take an error as its first argument.**
+* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns
+  `true`, or after all the `iterator` functions have finished. Result will be
+  the first item in the array that passes the truth test (iterator) or the
+  value `undefined` if none passed.  **Note: this callback does not take an error as its first argument.**
+
+__Example__
+
+```js
+async.detect(['file1','file2','file3'], fs.exists, function(result){
+    // result now equals the first file in the list that exists
+});
+```
+
+__Related__
+
+* detectSeries(arr, iterator, [callback])
+* detectLimit(arr, limit, iterator, [callback])
+
+---------------------------------------
+
+<a name="sortBy" />
+### sortBy(arr, iterator, [callback])
+
+Sorts a list by the results of running each `arr` value through an async `iterator`.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A function to apply to each item in `arr`.
+  The iterator is passed a `callback(err, sortValue)` which must be called once it
+  has completed with an error (which can be `null`) and a value to use as the sort
+  criteria.
+* `callback(err, results)` - *Optional* A callback which is called after all the `iterator`
+  functions have finished, or an error occurs. Results is the items from
+  the original `arr` sorted by the values returned by the `iterator` calls.
+
+__Example__
+
+```js
+async.sortBy(['file1','file2','file3'], function(file, callback){
+    fs.stat(file, function(err, stats){
+        callback(err, stats.mtime);
+    });
+}, function(err, results){
+    // results is now the original array of files sorted by
+    // modified date
+});
+```
+
+__Sort Order__
+
+By modifying the callback parameter the sorting order can be influenced:
+
+```js
+//ascending order
+async.sortBy([1,9,3,5], function(x, callback){
+    callback(null, x);
+}, function(err,result){
+    //result callback
+} );
+
+//descending order
+async.sortBy([1,9,3,5], function(x, callback){
+    callback(null, x*-1);    //<- x*-1 instead of x, turns the order around
+}, function(err,result){
+    //result callback
+} );
+```
+
+---------------------------------------
+
+<a name="some" />
+### some(arr, iterator, [callback])
+
+__Alias:__ `any`
+
+Returns `true` if at least one element in the `arr` satisfies an async test.
+_The callback for each iterator call only accepts a single argument of `true` or
+`false`; it does not accept an error argument first!_ This is in-line with the
+way node libraries work with truth tests like `fs.exists`. Once any iterator
+call returns `true`, the main `callback` is immediately called.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A truth test to apply to each item in the array
+  in parallel. The iterator is passed a `callback(truthValue)`` which must be
+  called with a boolean argument once it has completed.
+* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns
+  `true`, or after all the iterator functions have finished. Result will be
+  either `true` or `false` depending on the values of the async tests.
+
+ **Note: the callbacks do not take an error as their first argument.**
+__Example__
+
+```js
+async.some(['file1','file2','file3'], fs.exists, function(result){
+    // if result is true then at least one of the files exists
+});
+```
+
+__Related__
+
+* someLimit(arr, limit, iterator, callback)
+
+---------------------------------------
+
+<a name="every" />
+### every(arr, iterator, [callback])
+
+__Alias:__ `all`
+
+Returns `true` if every element in `arr` satisfies an async test.
+_The callback for each `iterator` call only accepts a single argument of `true` or
+`false`; it does not accept an error argument first!_ This is in-line with the
+way node libraries work with truth tests like `fs.exists`.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A truth test to apply to each item in the array
+  in parallel. The iterator is passed a `callback(truthValue)` which must be
+  called with a  boolean argument once it has completed.
+* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns
+  `false`, or after all the iterator functions have finished. Result will be
+  either `true` or `false` depending on the values of the async tests.
+
+ **Note: the callbacks do not take an error as their first argument.**
+
+__Example__
+
+```js
+async.every(['file1','file2','file3'], fs.exists, function(result){
+    // if result is true then every file exists
+});
+```
+
+__Related__
+
+* everyLimit(arr, limit, iterator, callback)
+
+---------------------------------------
+
+<a name="concat" />
+### concat(arr, iterator, [callback])
+
+Applies `iterator` to each item in `arr`, concatenating the results. Returns the
+concatenated list. The `iterator`s are called in parallel, and the results are
+concatenated as they return. There is no guarantee that the results array will
+be returned in the original order of `arr` passed to the `iterator` function.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A function to apply to each item in `arr`.
+  The iterator is passed a `callback(err, results)` which must be called once it
+  has completed with an error (which can be `null`) and an array of results.
+* `callback(err, results)` - *Optional* A callback which is called after all the `iterator`
+  functions have finished, or an error occurs. Results is an array containing
+  the concatenated results of the `iterator` function.
+
+__Example__
+
+```js
+async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){
+    // files is now a list of filenames that exist in the 3 directories
+});
+```
+
+__Related__
+
+* concatSeries(arr, iterator, [callback])
+
+
+## Control Flow
+
+<a name="series" />
+### series(tasks, [callback])
+
+Run the functions in the `tasks` array in series, each one running once the previous
+function has completed. If any functions in the series pass an error to its
+callback, no more functions are run, and `callback` is immediately called with the value of the error.
+Otherwise, `callback` receives an array of results when `tasks` have completed.
+
+It is also possible to use an object instead of an array. Each property will be
+run as a function, and the results will be passed to the final `callback` as an object
+instead of an array. This can be a more readable way of handling results from
+[`series`](#series).
+
+**Note** that while many implementations preserve the order of object properties, the
+[ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)
+explicitly states that
+
+> The mechanics and order of enumerating the properties is not specified.
+
+So if you rely on the order in which your series of functions are executed, and want
+this to work on all platforms, consider using an array.
+
+__Arguments__
+
+* `tasks` - An array or object containing functions to run, each function is passed
+  a `callback(err, result)` it must call on completion with an error `err` (which can
+  be `null`) and an optional `result` value.
+* `callback(err, results)` - An optional callback to run once all the functions
+  have completed. This function gets a results array (or object) containing all
+  the result arguments passed to the `task` callbacks.
+
+__Example__
+
+```js
+async.series([
+    function(callback){
+        // do some stuff ...
+        callback(null, 'one');
+    },
+    function(callback){
+        // do some more stuff ...
+        callback(null, 'two');
+    }
+],
+// optional callback
+function(err, results){
+    // results is now equal to ['one', 'two']
+});
+
+
+// an example using an object instead of an array
+async.series({
+    one: function(callback){
+        setTimeout(function(){
+            callback(null, 1);
+        }, 200);
+    },
+    two: function(callback){
+        setTimeout(function(){
+            callback(null, 2);
+        }, 100);
+    }
+},
+function(err, results) {
+    // results is now equal to: {one: 1, two: 2}
+});
+```
+
+---------------------------------------
+
+<a name="parallel" />
+### parallel(tasks, [callback])
+
+Run the `tasks` array of functions in parallel, without waiting until the previous
+function has completed. If any of the functions pass an error to its
+callback, the main `callback` is immediately called with the value of the error.
+Once the `tasks` have completed, the results are passed to the final `callback` as an
+array.
+
+**Note:** `parallel` is about kicking-off I/O tasks in parallel, not about parallel execution of code.  If your tasks do not use any timers or perform any I/O, they will actually be executed in series.  Any synchronous setup sections for each task will happen one after the other.  JavaScript remains single-threaded.
+
+It is also possible to use an object instead of an array. Each property will be
+run as a function and the results will be passed to the final `callback` as an object
+instead of an array. This can be a more readable way of handling results from
+[`parallel`](#parallel).
+
+
+__Arguments__
+
+* `tasks` - An array or object containing functions to run. Each function is passed
+  a `callback(err, result)` which it must call on completion with an error `err`
+  (which can be `null`) and an optional `result` value.
+* `callback(err, results)` - An optional callback to run once all the functions
+  have completed successfully. This function gets a results array (or object) containing all
+  the result arguments passed to the task callbacks.
+
+__Example__
+
+```js
+async.parallel([
+    function(callback){
+        setTimeout(function(){
+            callback(null, 'one');
+        }, 200);
+    },
+    function(callback){
+        setTimeout(function(){
+            callback(null, 'two');
+        }, 100);
+    }
+],
+// optional callback
+function(err, results){
+    // the results array will equal ['one','two'] even though
+    // the second function had a shorter timeout.
+});
+
+
+// an example using an object instead of an array
+async.parallel({
+    one: function(callback){
+        setTimeout(function(){
+            callback(null, 1);
+        }, 200);
+    },
+    two: function(callback){
+        setTimeout(function(){
+            callback(null, 2);
+        }, 100);
+    }
+},
+function(err, results) {
+    // results is now equals to: {one: 1, two: 2}
+});
+```
+
+__Related__
+
+* parallelLimit(tasks, limit, [callback])
+
+---------------------------------------
+
+<a name="whilst" />
+### whilst(test, fn, callback)
+
+Repeatedly call `fn`, while `test` returns `true`. Calls `callback` when stopped,
+or an error occurs.
+
+__Arguments__
+
+* `test()` - synchronous truth test to perform before each execution of `fn`.
+* `fn(callback)` - A function which is called each time `test` passes. The function is
+  passed a `callback(err)`, which must be called once it has completed with an
+  optional `err` argument.
+* `callback(err, [results])` - A callback which is called after the test
+  function has failed and repeated execution of `fn` has stopped. `callback`
+  will be passed an error and any arguments passed to the final `fn`'s callback.
+
+__Example__
+
+```js
+var count = 0;
+
+async.whilst(
+    function () { return count < 5; },
+    function (callback) {
+        count++;
+        setTimeout(function () {
+            callback(null, count);
+        }, 1000);
+    },
+    function (err, n) {
+        // 5 seconds have passed, n = 5
+    }
+);
+```
+
+---------------------------------------
+
+<a name="doWhilst" />
+### doWhilst(fn, test, callback)
+
+The post-check version of [`whilst`](#whilst). To reflect the difference in
+the order of operations, the arguments `test` and `fn` are switched.
+
+`doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.
+
+---------------------------------------
+
+<a name="until" />
+### until(test, fn, callback)
+
+Repeatedly call `fn` until `test` returns `true`. Calls `callback` when stopped,
+or an error occurs. `callback` will be passed an error and any arguments passed
+to the final `fn`'s callback.
+
+The inverse of [`whilst`](#whilst).
+
+---------------------------------------
+
+<a name="doUntil" />
+### doUntil(fn, test, callback)
+
+Like [`doWhilst`](#doWhilst), except the `test` is inverted. Note the argument ordering differs from `until`.
+
+---------------------------------------
+
+<a name="during" />
+### during(test, fn, callback)
+
+Like [`whilst`](#whilst), except the `test` is an asynchronous function that is passed a callback in the form of `function (err, truth)`. If error is passed to `test` or `fn`, the main callback is immediately called with the value of the error.
+
+__Example__
+
+```js
+var count = 0;
+
+async.during(
+    function (callback) {
+      return callback(null, count < 5);
+    },
+    function (callback) {
+        count++;
+        setTimeout(callback, 1000);
+    },
+    function (err) {
+        // 5 seconds have passed
+    }
+);
+```
+
+---------------------------------------
+
+<a name="doDuring" />
+### doDuring(fn, test, callback)
+
+The post-check version of [`during`](#during). To reflect the difference in
+the order of operations, the arguments `test` and `fn` are switched.
+
+Also a version of [`doWhilst`](#doWhilst) with asynchronous `test` function.
+
+---------------------------------------
+
+<a name="forever" />
+### forever(fn, [errback])
+
+Calls the asynchronous function `fn` with a callback parameter that allows it to
+call itself again, in series, indefinitely.
+
+If an error is passed to the callback then `errback` is called with the
+error, and execution stops, otherwise it will never be called.
+
+```js
+async.forever(
+    function(next) {
+        // next is suitable for passing to things that need a callback(err [, whatever]);
+        // it will result in this function being called again.
+    },
+    function(err) {
+        // if next is called with a value in its first parameter, it will appear
+        // in here as 'err', and execution will stop.
+    }
+);
+```
+
+---------------------------------------
+
+<a name="waterfall" />
+### waterfall(tasks, [callback])
+
+Runs the `tasks` array of functions in series, each passing their results to the next in
+the array. However, if any of the `tasks` pass an error to their own callback, the
+next function is not executed, and the main `callback` is immediately called with
+the error.
+
+__Arguments__
+
+* `tasks` - An array of functions to run, each function is passed a
+  `callback(err, result1, result2, ...)` it must call on completion. The first
+  argument is an error (which can be `null`) and any further arguments will be
+  passed as arguments in order to the next task.
+* `callback(err, [results])` - An optional callback to run once all the functions
+  have completed. This will be passed the results of the last task's callback.
+
+
+
+__Example__
+
+```js
+async.waterfall([
+    function(callback) {
+        callback(null, 'one', 'two');
+    },
+    function(arg1, arg2, callback) {
+      // arg1 now equals 'one' and arg2 now equals 'two'
+        callback(null, 'three');
+    },
+    function(arg1, callback) {
+        // arg1 now equals 'three'
+        callback(null, 'done');
+    }
+], function (err, result) {
+    // result now equals 'done'
+});
+```
+Or, with named functions:
+
+```js
+async.waterfall([
+    myFirstFunction,
+    mySecondFunction,
+    myLastFunction,
+], function (err, result) {
+    // result now equals 'done'
+});
+function myFirstFunction(callback) {
+  callback(null, 'one', 'two');
+}
+function mySecondFunction(arg1, arg2, callback) {
+  // arg1 now equals 'one' and arg2 now equals 'two'
+  callback(null, 'three');
+}
+function myLastFunction(arg1, callback) {
+  // arg1 now equals 'three'
+  callback(null, 'done');
+}
+```
+
+Or, if you need to pass any argument to the first function:
+
+```js
+async.waterfall([
+    async.apply(myFirstFunction, 'zero'),
+    mySecondFunction,
+    myLastFunction,
+], function (err, result) {
+    // result now equals 'done'
+});
+function myFirstFunction(arg1, callback) {
+  // arg1 now equals 'zero'
+  callback(null, 'one', 'two');
+}
+function mySecondFunction(arg1, arg2, callback) {
+  // arg1 now equals 'one' and arg2 now equals 'two'
+  callback(null, 'three');
+}
+function myLastFunction(arg1, callback) {
+  // arg1 now equals 'three'
+  callback(null, 'done');
+}
+```
+
+---------------------------------------
+<a name="compose" />
+### compose(fn1, fn2...)
+
+Creates a function which is a composition of the passed asynchronous
+functions. Each function consumes the return value of the function that
+follows. Composing functions `f()`, `g()`, and `h()` would produce the result of
+`f(g(h()))`, only this version uses callbacks to obtain the return values.
+
+Each function is executed with the `this` binding of the composed function.
+
+__Arguments__
+
+* `functions...` - the asynchronous functions to compose
+
+
+__Example__
+
+```js
+function add1(n, callback) {
+    setTimeout(function () {
+        callback(null, n + 1);
+    }, 10);
+}
+
+function mul3(n, callback) {
+    setTimeout(function () {
+        callback(null, n * 3);
+    }, 10);
+}
+
+var add1mul3 = async.compose(mul3, add1);
+
+add1mul3(4, function (err, result) {
+   // result now equals 15
+});
+```
+
+---------------------------------------
+<a name="seq" />
+### seq(fn1, fn2...)
+
+Version of the compose function that is more natural to read.
+Each function consumes the return value of the previous function.
+It is the equivalent of [`compose`](#compose) with the arguments reversed.
+
+Each function is executed with the `this` binding of the composed function.
+
+__Arguments__
+
+* `functions...` - the asynchronous functions to compose
+
+
+__Example__
+
+```js
+// Requires lodash (or underscore), express3 and dresende's orm2.
+// Part of an app, that fetches cats of the logged user.
+// This example uses `seq` function to avoid overnesting and error
+// handling clutter.
+app.get('/cats', function(request, response) {
+  var User = request.models.User;
+  async.seq(
+    _.bind(User.get, User),  // 'User.get' has signature (id, callback(err, data))
+    function(user, fn) {
+      user.getCats(fn);      // 'getCats' has signature (callback(err, data))
+    }
+  )(req.session.user_id, function (err, cats) {
+    if (err) {
+      console.error(err);
+      response.json({ status: 'error', message: err.message });
+    } else {
+      response.json({ status: 'ok', message: 'Cats found', data: cats });
+    }
+  });
+});
+```
+
+---------------------------------------
+<a name="applyEach" />
+### applyEach(fns, args..., callback)
+
+Applies the provided arguments to each function in the array, calling
+`callback` after all functions have completed. If you only provide the first
+argument, then it will return a function which lets you pass in the
+arguments as if it were a single function call.
+
+__Arguments__
+
+* `fns` - the asynchronous functions to all call with the same arguments
+* `args...` - any number of separate arguments to pass to the function
+* `callback` - the final argument should be the callback, called when all
+  functions have completed processing
+
+
+__Example__
+
+```js
+async.applyEach([enableSearch, updateSchema], 'bucket', callback);
+
+// partial application example:
+async.each(
+    buckets,
+    async.applyEach([enableSearch, updateSchema]),
+    callback
+);
+```
+
+__Related__
+
+* applyEachSeries(tasks, args..., [callback])
+
+---------------------------------------
+
+<a name="queue" />
+### queue(worker, [concurrency])
+
+Creates a `queue` object with the specified `concurrency`. Tasks added to the
+`queue` are processed in parallel (up to the `concurrency` limit). If all
+`worker`s are in progress, the task is queued until one becomes available.
+Once a `worker` completes a `task`, that `task`'s callback is called.
+
+__Arguments__
+
+* `worker(task, callback)` - An asynchronous function for processing a queued
+  task, which must call its `callback(err)` argument when finished, with an
+  optional `error` as an argument.  If you want to handle errors from an individual task, pass a callback to `q.push()`.
+* `concurrency` - An `integer` for determining how many `worker` functions should be
+  run in parallel.  If omitted, the concurrency defaults to `1`.  If the concurrency is `0`, an error is thrown.
+
+__Queue objects__
+
+The `queue` object returned by this function has the following properties and
+methods:
+
+* `length()` - a function returning the number of items waiting to be processed.
+* `started` - a function returning whether or not any items have been pushed and processed by the queue
+* `running()` - a function returning the number of items currently being processed.
+* `workersList()` - a function returning the array of items currently being processed.
+* `idle()` - a function returning false if there are items waiting or being processed, or true if not.
+* `concurrency` - an integer for determining how many `worker` functions should be
+  run in parallel. This property can be changed after a `queue` is created to
+  alter the concurrency on-the-fly.
+* `push(task, [callback])` - add a new task to the `queue`. Calls `callback` once
+  the `worker` has finished processing the task. Instead of a single task, a `tasks` array
+  can be submitted. The respective callback is used for every task in the list.
+* `unshift(task, [callback])` - add a new task to the front of the `queue`.
+* `saturated` - a callback that is called when the `queue` length hits the `concurrency` limit,
+   and further tasks will be queued.
+* `empty` - a callback that is called when the last item from the `queue` is given to a `worker`.
+* `drain` - a callback that is called when the last item from the `queue` has returned from the `worker`.
+* `paused` - a boolean for determining whether the queue is in a paused state
+* `pause()` - a function that pauses the processing of tasks until `resume()` is called.
+* `resume()` - a function that resumes the processing of queued tasks when the queue is paused.
+* `kill()` - a function that removes the `drain` callback and empties remaining tasks from the queue forcing it to go idle.
+
+__Example__
+
+```js
+// create a queue object with concurrency 2
+
+var q = async.queue(function (task, callback) {
+    console.log('hello ' + task.name);
+    callback();
+}, 2);
+
+
+// assign a callback
+q.drain = function() {
+    console.log('all items have been processed');
+}
+
+// add some items to the queue
+
+q.push({name: 'foo'}, function (err) {
+    console.log('finished processing foo');
+});
+q.push({name: 'bar'}, function (err) {
+    console.log('finished processing bar');
+});
+
+// add some items to the queue (batch-wise)
+
+q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {
+    console.log('finished processing item');
+});
+
+// add some items to the front of the queue
+
+q.unshift({name: 'bar'}, function (err) {
+    console.log('finished processing bar');
+});
+```
+
+
+---------------------------------------
+
+<a name="priorityQueue" />
+### priorityQueue(worker, concurrency)
+
+The same as [`queue`](#queue) only tasks are assigned a priority and completed in ascending priority order. There are two differences between `queue` and `priorityQueue` objects:
+
+* `push(task, priority, [callback])` - `priority` should be a number. If an array of
+  `tasks` is given, all tasks will be assigned the same priority.
+* The `unshift` method was removed.
+
+---------------------------------------
+
+<a name="cargo" />
+### cargo(worker, [payload])
+
+Creates a `cargo` object with the specified payload. Tasks added to the
+cargo will be processed altogether (up to the `payload` limit). If the
+`worker` is in progress, the task is queued until it becomes available. Once
+the `worker` has completed some tasks, each callback of those tasks is called.
+Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) for how `cargo` and `queue` work.
+
+While [queue](#queue) passes only one task to one of a group of workers
+at a time, cargo passes an array of tasks to a single worker, repeating
+when the worker is finished.
+
+__Arguments__
+
+* `worker(tasks, callback)` - An asynchronous function for processing an array of
+  queued tasks, which must call its `callback(err)` argument when finished, with
+  an optional `err` argument.
+* `payload` - An optional `integer` for determining how many tasks should be
+  processed per round; if omitted, the default is unlimited.
+
+__Cargo objects__
+
+The `cargo` object returned by this function has the following properties and
+methods:
+
+* `length()` - A function returning the number of items waiting to be processed.
+* `payload` - An `integer` for determining how many tasks should be
+  process per round. This property can be changed after a `cargo` is created to
+  alter the payload on-the-fly.
+* `push(task, [callback])` - Adds `task` to the `queue`. The callback is called
+  once the `worker` has finished processing the task. Instead of a single task, an array of `tasks`
+  can be submitted. The respective callback is used for every task in the list.
+* `saturated` - A callback that is called when the `queue.length()` hits the concurrency and further tasks will be queued.
+* `empty` - A callback that is called when the last item from the `queue` is given to a `worker`.
+* `drain` - A callback that is called when the last item from the `queue` has returned from the `worker`.
+* `idle()`, `pause()`, `resume()`, `kill()` - cargo inherits all of the same methods and event calbacks as [`queue`](#queue)
+
+__Example__
+
+```js
+// create a cargo object with payload 2
+
+var cargo = async.cargo(function (tasks, callback) {
+    for(var i=0; i<tasks.length; i++){
+      console.log('hello ' + tasks[i].name);
+    }
+    callback();
+}, 2);
+
+
+// add some items
+
+cargo.push({name: 'foo'}, function (err) {
+    console.log('finished processing foo');
+});
+cargo.push({name: 'bar'}, function (err) {
+    console.log('finished processing bar');
+});
+cargo.push({name: 'baz'}, function (err) {
+    console.log('finished processing baz');
+});
+```
+
+---------------------------------------
+
+<a name="auto" />
+### auto(tasks, [concurrency], [callback])
+
+Determines the best order for running the functions in `tasks`, based on their requirements. Each function can optionally depend on other functions being completed first, and each function is run as soon as its requirements are satisfied.
+
+If any of the functions pass an error to their callback, the `auto` sequence will stop. Further tasks will not execute (so any other functions depending on it will not run), and the main `callback` is immediately called with the error.  Functions also receive an object containing the results of functions which have completed so far.
+
+Note, all functions are called with a `results` object as a second argument,
+so it is unsafe to pass functions in the `tasks` object which cannot handle the
+extra argument.
+
+For example, this snippet of code:
+
+```js
+async.auto({
+  readData: async.apply(fs.readFile, 'data.txt', 'utf-8')
+}, callback);
+```
+
+will have the effect of calling `readFile` with the results object as the last
+argument, which will fail:
+
+```js
+fs.readFile('data.txt', 'utf-8', cb, {});
+```
+
+Instead, wrap the call to `readFile` in a function which does not forward the
+`results` object:
+
+```js
+async.auto({
+  readData: function(cb, results){
+    fs.readFile('data.txt', 'utf-8', cb);
+  }
+}, callback);
+```
+
+__Arguments__
+
+* `tasks` - An object. Each of its properties is either a function or an array of
+  requirements, with the function itself the last item in the array. The object's key
+  of a property serves as the name of the task defined by that property,
+  i.e. can be used when specifying requirements for other tasks.
+  The function receives two arguments: (1) a `callback(err, result)` which must be
+  called when finished, passing an `error` (which can be `null`) and the result of
+  the function's execution, and (2) a `results` object, containing the results of
+  the previously executed functions.
+* `concurrency` - An optional `integer` for determining the maximum number of tasks that can be run in parallel. By default, as many as possible.
+* `callback(err, results)` - An optional callback which is called when all the
+  tasks have been completed. It receives the `err` argument if any `tasks`
+  pass an error to their callback. Results are always returned; however, if
+  an error occurs, no further `tasks` will be performed, and the results
+  object will only contain partial results.
+
+
+__Example__
+
+```js
+async.auto({
+    get_data: function(callback){
+        console.log('in get_data');
+        // async code to get some data
+        callback(null, 'data', 'converted to array');
+    },
+    make_folder: function(callback){
+        console.log('in make_folder');
+        // async code to create a directory to store a file in
+        // this is run at the same time as getting the data
+        callback(null, 'folder');
+    },
+    write_file: ['get_data', 'make_folder', function(callback, results){
+        console.log('in write_file', JSON.stringify(results));
+        // once there is some data and the directory exists,
+        // write the data to a file in the directory
+        callback(null, 'filename');
+    }],
+    email_link: ['write_file', function(callback, results){
+        console.log('in email_link', JSON.stringify(results));
+        // once the file is written let's email a link to it...
+        // results.write_file contains the filename returned by write_file.
+        callback(null, {'file':results.write_file, 'email':'user@example.com'});
+    }]
+}, function(err, results) {
+    console.log('err = ', err);
+    console.log('results = ', results);
+});
+```
+
+This is a fairly trivial example, but to do this using the basic parallel and
+series functions would look like this:
+
+```js
+async.parallel([
+    function(callback){
+        console.log('in get_data');
+        // async code to get some data
+        callback(null, 'data', 'converted to array');
+    },
+    function(callback){
+        console.log('in make_folder');
+        // async code to create a directory to store a file in
+        // this is run at the same time as getting the data
+        callback(null, 'folder');
+    }
+],
+function(err, results){
+    async.series([
+        function(callback){
+            console.log('in write_file', JSON.stringify(results));
+            // once there is some data and the directory exists,
+            // write the data to a file in the directory
+            results.push('filename');
+            callback(null);
+        },
+        function(callback){
+            console.log('in email_link', JSON.stringify(results));
+            // once the file is written let's email a link to it...
+            callback(null, {'file':results.pop(), 'email':'user@example.com'});
+        }
+    ]);
+});
+```
+
+For a complicated series of `async` tasks, using the [`auto`](#auto) function makes adding
+new tasks much easier (and the code more readable).
+
+
+---------------------------------------
+
+<a name="retry" />
+### retry([opts = {times: 5, interval: 0}| 5], task, [callback])
+
+Attempts to get a successful response from `task` no more than `times` times before
+returning an error. If the task is successful, the `callback` will be passed the result
+of the successful task. If all attempts fail, the callback will be passed the error and
+result (if any) of the final attempt.
+
+__Arguments__
+
+* `opts` - Can be either an object with `times` and `interval` or a number.
+  * `times` - The number of attempts to make before giving up.  The default is `5`.
+  * `interval` - The time to wait between retries, in milliseconds.  The default is `0`.
+  * If `opts` is a number, the number specifies the number of times to retry, with the default interval of `0`. 
+* `task(callback, results)` - A function which receives two arguments: (1) a `callback(err, result)`
+  which must be called when finished, passing `err` (which can be `null`) and the `result` of
+  the function's execution, and (2) a `results` object, containing the results of
+  the previously executed functions (if nested inside another control flow).
+* `callback(err, results)` - An optional callback which is called when the
+  task has succeeded, or after the final failed attempt. It receives the `err` and `result` arguments of the last attempt at completing the `task`.
+
+The [`retry`](#retry) function can be used as a stand-alone control flow by passing a callback, as shown below:
+
+```js
+// try calling apiMethod 3 times
+async.retry(3, apiMethod, function(err, result) {
+    // do something with the result
+});
+```
+
+```js
+// try calling apiMethod 3 times, waiting 200 ms between each retry 
+async.retry({times: 3, interval: 200}, apiMethod, function(err, result) {
+    // do something with the result
+});
+```
+
+```js
+// try calling apiMethod the default 5 times no delay between each retry 
+async.retry(apiMethod, function(err, result) {
+    // do something with the result
+});
+```
+
+It can also be embedded within other control flow functions to retry individual methods
+that are not as reliable, like this:
+
+```js
+async.auto({
+    users: api.getUsers.bind(api),
+    payments: async.retry(3, api.getPayments.bind(api))
+}, function(err, results) {
+  // do something with the results
+});
+```
+
+
+---------------------------------------
+
+<a name="iterator" />
+### iterator(tasks)
+
+Creates an iterator function which calls the next function in the `tasks` array,
+returning a continuation to call the next one after that. It's also possible to
+“peek” at the next iterator with `iterator.next()`.
+
+This function is used internally by the `async` module, but can be useful when
+you want to manually control the flow of functions in series.
+
+__Arguments__
+
+* `tasks` - An array of functions to run.
+
+__Example__
+
+```js
+var iterator = async.iterator([
+    function(){ sys.p('one'); },
+    function(){ sys.p('two'); },
+    function(){ sys.p('three'); }
+]);
+
+node> var iterator2 = iterator();
+'one'
+node> var iterator3 = iterator2();
+'two'
+node> iterator3();
+'three'
+node> var nextfn = iterator2.next();
+node> nextfn();
+'three'
+```
+
+---------------------------------------
+
+<a name="apply" />
+### apply(function, arguments..)
+
+Creates a continuation function with some arguments already applied.
+
+Useful as a shorthand when combined with other control flow functions. Any arguments
+passed to the returned function are added to the arguments originally passed
+to apply.
+
+__Arguments__
+
+* `function` - The function you want to eventually apply all arguments to.
+* `arguments...` - Any number of arguments to automatically apply when the
+  continuation is called.
+
+__Example__
+
+```js
+// using apply
+
+async.parallel([
+    async.apply(fs.writeFile, 'testfile1', 'test1'),
+    async.apply(fs.writeFile, 'testfile2', 'test2'),
+]);
+
+
+// the same process without using apply
+
+async.parallel([
+    function(callback){
+        fs.writeFile('testfile1', 'test1', callback);
+    },
+    function(callback){
+        fs.writeFile('testfile2', 'test2', callback);
+    }
+]);
+```
+
+It's possible to pass any number of additional arguments when calling the
+continuation:
+
+```js
+node> var fn = async.apply(sys.puts, 'one');
+node> fn('two', 'three');
+one
+two
+three
+```
+
+---------------------------------------
+
+<a name="nextTick" />
+### nextTick(callback), setImmediate(callback)
+
+Calls `callback` on a later loop around the event loop. In Node.js this just
+calls `process.nextTick`; in the browser it falls back to `setImmediate(callback)`
+if available, otherwise `setTimeout(callback, 0)`, which means other higher priority
+events may precede the execution of `callback`.
+
+This is used internally for browser-compatibility purposes.
+
+__Arguments__
+
+* `callback` - The function to call on a later loop around the event loop.
+
+__Example__
+
+```js
+var call_order = [];
+async.nextTick(function(){
+    call_order.push('two');
+    // call_order now equals ['one','two']
+});
+call_order.push('one')
+```
+
+<a name="times" />
+### times(n, iterator, [callback])
+
+Calls the `iterator` function `n` times, and accumulates results in the same manner
+you would use with [`map`](#map).
+
+__Arguments__
+
+* `n` - The number of times to run the function.
+* `iterator` - The function to call `n` times.
+* `callback` - see [`map`](#map)
+
+__Example__
+
+```js
+// Pretend this is some complicated async factory
+var createUser = function(id, callback) {
+  callback(null, {
+    id: 'user' + id
+  })
+}
+// generate 5 users
+async.times(5, function(n, next){
+    createUser(n, function(err, user) {
+      next(err, user)
+    })
+}, function(err, users) {
+  // we should now have 5 users
+});
+```
+
+__Related__
+
+* timesSeries(n, iterator, [callback])
+* timesLimit(n, limit, iterator, [callback])
+
+
+## Utils
+
+<a name="memoize" />
+### memoize(fn, [hasher])
+
+Caches the results of an `async` function. When creating a hash to store function
+results against, the callback is omitted from the hash and an optional hash
+function can be used.
+
+If no hash function is specified, the first argument is used as a hash key, which may work reasonably if it is a string or a data type that converts to a distinct string. Note that objects and arrays will not behave reasonably. Neither will cases where the other arguments are significant. In such cases, specify your own hash function.
+
+The cache of results is exposed as the `memo` property of the function returned
+by `memoize`.
+
+__Arguments__
+
+* `fn` - The function to proxy and cache results from.
+* `hasher` - An optional function for generating a custom hash for storing
+  results. It has all the arguments applied to it apart from the callback, and
+  must be synchronous.
+
+__Example__
+
+```js
+var slow_fn = function (name, callback) {
+    // do something
+    callback(null, result);
+};
+var fn = async.memoize(slow_fn);
+
+// fn can now be used as if it were slow_fn
+fn('some name', function () {
+    // callback
+});
+```
+
+<a name="unmemoize" />
+### unmemoize(fn)
+
+Undoes a [`memoize`](#memoize)d function, reverting it to the original, unmemoized
+form. Handy for testing.
+
+__Arguments__
+
+* `fn` - the memoized function
+
+---------------------------------------
+
+<a name="ensureAsync" />
+### ensureAsync(fn)
+
+Wrap an async function and ensure it calls its callback on a later tick of the event loop.  If the function already calls its callback on a next tick, no extra deferral is added. This is useful for preventing stack overflows (`RangeError: Maximum call stack size exceeded`) and generally keeping [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) contained.
+
+__Arguments__
+
+* `fn` - an async function, one that expects a node-style callback as its last argument
+
+Returns a wrapped function with the exact same call signature as the function passed in.
+
+__Example__
+
+```js
+function sometimesAsync(arg, callback) {
+  if (cache[arg]) {
+    return callback(null, cache[arg]); // this would be synchronous!!
+  } else {
+    doSomeIO(arg, callback); // this IO would be asynchronous
+  }
+}
+
+// this has a risk of stack overflows if many results are cached in a row
+async.mapSeries(args, sometimesAsync, done);
+
+// this will defer sometimesAsync's callback if necessary,
+// preventing stack overflows
+async.mapSeries(args, async.ensureAsync(sometimesAsync), done);
+
+```
+
+---------------------------------------
+
+<a name="constant">
+### constant(values...)
+
+Returns a function that when called, calls-back with the values provided.  Useful as the first function in a `waterfall`, or for plugging values in to `auto`.
+
+__Example__
+
+```js
+async.waterfall([
+  async.constant(42),
+  function (value, next) {
+    // value === 42
+  },
+  //...
+], callback);
+
+async.waterfall([
+  async.constant(filename, "utf8"),
+  fs.readFile,
+  function (fileData, next) {
+    //...
+  }
+  //...
+], callback);
+
+async.auto({
+  hostname: async.constant("https://server.net/"),
+  port: findFreePort,
+  launchServer: ["hostname", "port", function (cb, options) {
+    startServer(options, cb);
+  }],
+  //...
+}, callback);
+
+```
+
+---------------------------------------
+
+<a name="asyncify">
+<a name="wrapSync">
+### asyncify(func)
+
+__Alias:__ `wrapSync`
+
+Take a sync function and make it async, passing its return value to a callback. This is useful for plugging sync functions into a waterfall, series, or other async functions. Any arguments passed to the generated function will be passed to the wrapped function (except for the final callback argument). Errors thrown will be passed to the callback.
+
+__Example__
+
+```js
+async.waterfall([
+  async.apply(fs.readFile, filename, "utf8"),
+  async.asyncify(JSON.parse),
+  function (data, next) {
+    // data is the result of parsing the text.
+    // If there was a parsing error, it would have been caught.
+  }
+], callback)
+```
+
+If the function passed to `asyncify` returns a Promise, that promises's resolved/rejected state will be used to call the callback, rather than simply the synchronous return value.  Example:
+
+```js
+async.waterfall([
+  async.apply(fs.readFile, filename, "utf8"),
+  async.asyncify(function (contents) {
+    return db.model.create(contents);
+  }),
+  function (model, next) {
+    // `model` is the instantiated model object. 
+    // If there was an error, this function would be skipped.
+  }
+], callback)
+```
+
+This also means you can asyncify ES2016 `async` functions.
+
+```js
+var q = async.queue(async.asyncify(async function (file) {
+  var intermediateStep = await processFile(file);
+  return await somePromise(intermediateStep)
+}));
+
+q.push(files);
+```
+
+---------------------------------------
+
+<a name="log" />
+### log(function, arguments)
+
+Logs the result of an `async` function to the `console`. Only works in Node.js or
+in browsers that support `console.log` and `console.error` (such as FF and Chrome).
+If multiple arguments are returned from the async function, `console.log` is
+called on each argument in order.
+
+__Arguments__
+
+* `function` - The function you want to eventually apply all arguments to.
+* `arguments...` - Any number of arguments to apply to the function.
+
+__Example__
+
+```js
+var hello = function(name, callback){
+    setTimeout(function(){
+        callback(null, 'hello ' + name);
+    }, 1000);
+};
+```
+```js
+node> async.log(hello, 'world');
+'hello world'
+```
+
+---------------------------------------
+
+<a name="dir" />
+### dir(function, arguments)
+
+Logs the result of an `async` function to the `console` using `console.dir` to
+display the properties of the resulting object. Only works in Node.js or
+in browsers that support `console.dir` and `console.error` (such as FF and Chrome).
+If multiple arguments are returned from the async function, `console.dir` is
+called on each argument in order.
+
+__Arguments__
+
+* `function` - The function you want to eventually apply all arguments to.
+* `arguments...` - Any number of arguments to apply to the function.
+
+__Example__
+
+```js
+var hello = function(name, callback){
+    setTimeout(function(){
+        callback(null, {hello: name});
+    }, 1000);
+};
+```
+```js
+node> async.dir(hello, 'world');
+{hello: 'world'}
+```
+
+---------------------------------------
+
+<a name="noConflict" />
+### noConflict()
+
+Changes the value of `async` back to its original value, returning a reference to the
+`async` object.
diff --git a/wrt/node_modules/async/dist/async.js b/wrt/node_modules/async/dist/async.js
new file mode 100644 (file)
index 0000000..31e7620
--- /dev/null
@@ -0,0 +1,1265 @@
+/*!
+ * async
+ * https://github.com/caolan/async
+ *
+ * Copyright 2010-2014 Caolan McMahon
+ * Released under the MIT license
+ */
+(function () {
+
+    var async = {};
+    function noop() {}
+    function identity(v) {
+        return v;
+    }
+    function toBool(v) {
+        return !!v;
+    }
+    function notId(v) {
+        return !v;
+    }
+
+    // global on the server, window in the browser
+    var previous_async;
+
+    // Establish the root object, `window` (`self`) in the browser, `global`
+    // on the server, or `this` in some virtual machines. We use `self`
+    // instead of `window` for `WebWorker` support.
+    var root = typeof self === 'object' && self.self === self && self ||
+            typeof global === 'object' && global.global === global && global ||
+            this;
+
+    if (root != null) {
+        previous_async = root.async;
+    }
+
+    async.noConflict = function () {
+        root.async = previous_async;
+        return async;
+    };
+
+    function only_once(fn) {
+        return function() {
+            if (fn === null) throw new Error("Callback was already called.");
+            fn.apply(this, arguments);
+            fn = null;
+        };
+    }
+
+    function _once(fn) {
+        return function() {
+            if (fn === null) return;
+            fn.apply(this, arguments);
+            fn = null;
+        };
+    }
+
+    //// cross-browser compatiblity functions ////
+
+    var _toString = Object.prototype.toString;
+
+    var _isArray = Array.isArray || function (obj) {
+        return _toString.call(obj) === '[object Array]';
+    };
+
+    // Ported from underscore.js isObject
+    var _isObject = function(obj) {
+        var type = typeof obj;
+        return type === 'function' || type === 'object' && !!obj;
+    };
+
+    function _isArrayLike(arr) {
+        return _isArray(arr) || (
+            // has a positive integer length property
+            typeof arr.length === "number" &&
+            arr.length >= 0 &&
+            arr.length % 1 === 0
+        );
+    }
+
+    function _arrayEach(arr, iterator) {
+        var index = -1,
+            length = arr.length;
+
+        while (++index < length) {
+            iterator(arr[index], index, arr);
+        }
+    }
+
+    function _map(arr, iterator) {
+        var index = -1,
+            length = arr.length,
+            result = Array(length);
+
+        while (++index < length) {
+            result[index] = iterator(arr[index], index, arr);
+        }
+        return result;
+    }
+
+    function _range(count) {
+        return _map(Array(count), function (v, i) { return i; });
+    }
+
+    function _reduce(arr, iterator, memo) {
+        _arrayEach(arr, function (x, i, a) {
+            memo = iterator(memo, x, i, a);
+        });
+        return memo;
+    }
+
+    function _forEachOf(object, iterator) {
+        _arrayEach(_keys(object), function (key) {
+            iterator(object[key], key);
+        });
+    }
+
+    function _indexOf(arr, item) {
+        for (var i = 0; i < arr.length; i++) {
+            if (arr[i] === item) return i;
+        }
+        return -1;
+    }
+
+    var _keys = Object.keys || function (obj) {
+        var keys = [];
+        for (var k in obj) {
+            if (obj.hasOwnProperty(k)) {
+                keys.push(k);
+            }
+        }
+        return keys;
+    };
+
+    function _keyIterator(coll) {
+        var i = -1;
+        var len;
+        var keys;
+        if (_isArrayLike(coll)) {
+            len = coll.length;
+            return function next() {
+                i++;
+                return i < len ? i : null;
+            };
+        } else {
+            keys = _keys(coll);
+            len = keys.length;
+            return function next() {
+                i++;
+                return i < len ? keys[i] : null;
+            };
+        }
+    }
+
+    // Similar to ES6's rest param (http://ariya.ofilabs.com/2013/03/es6-and-rest-parameter.html)
+    // This accumulates the arguments passed into an array, after a given index.
+    // From underscore.js (https://github.com/jashkenas/underscore/pull/2140).
+    function _restParam(func, startIndex) {
+        startIndex = startIndex == null ? func.length - 1 : +startIndex;
+        return function() {
+            var length = Math.max(arguments.length - startIndex, 0);
+            var rest = Array(length);
+            for (var index = 0; index < length; index++) {
+                rest[index] = arguments[index + startIndex];
+            }
+            switch (startIndex) {
+                case 0: return func.call(this, rest);
+                case 1: return func.call(this, arguments[0], rest);
+            }
+            // Currently unused but handle cases outside of the switch statement:
+            // var args = Array(startIndex + 1);
+            // for (index = 0; index < startIndex; index++) {
+            //     args[index] = arguments[index];
+            // }
+            // args[startIndex] = rest;
+            // return func.apply(this, args);
+        };
+    }
+
+    function _withoutIndex(iterator) {
+        return function (value, index, callback) {
+            return iterator(value, callback);
+        };
+    }
+
+    //// exported async module functions ////
+
+    //// nextTick implementation with browser-compatible fallback ////
+
+    // capture the global reference to guard against fakeTimer mocks
+    var _setImmediate = typeof setImmediate === 'function' && setImmediate;
+
+    var _delay = _setImmediate ? function(fn) {
+        // not a direct alias for IE10 compatibility
+        _setImmediate(fn);
+    } : function(fn) {
+        setTimeout(fn, 0);
+    };
+
+    if (typeof process === 'object' && typeof process.nextTick === 'function') {
+        async.nextTick = process.nextTick;
+    } else {
+        async.nextTick = _delay;
+    }
+    async.setImmediate = _setImmediate ? _delay : async.nextTick;
+
+
+    async.forEach =
+    async.each = function (arr, iterator, callback) {
+        return async.eachOf(arr, _withoutIndex(iterator), callback);
+    };
+
+    async.forEachSeries =
+    async.eachSeries = function (arr, iterator, callback) {
+        return async.eachOfSeries(arr, _withoutIndex(iterator), callback);
+    };
+
+
+    async.forEachLimit =
+    async.eachLimit = function (arr, limit, iterator, callback) {
+        return _eachOfLimit(limit)(arr, _withoutIndex(iterator), callback);
+    };
+
+    async.forEachOf =
+    async.eachOf = function (object, iterator, callback) {
+        callback = _once(callback || noop);
+        object = object || [];
+
+        var iter = _keyIterator(object);
+        var key, completed = 0;
+
+        while ((key = iter()) != null) {
+            completed += 1;
+            iterator(object[key], key, only_once(done));
+        }
+
+        if (completed === 0) callback(null);
+
+        function done(err) {
+            completed--;
+            if (err) {
+                callback(err);
+            }
+            // Check key is null in case iterator isn't exhausted
+            // and done resolved synchronously.
+            else if (key === null && completed <= 0) {
+                callback(null);
+            }
+        }
+    };
+
+    async.forEachOfSeries =
+    async.eachOfSeries = function (obj, iterator, callback) {
+        callback = _once(callback || noop);
+        obj = obj || [];
+        var nextKey = _keyIterator(obj);
+        var key = nextKey();
+        function iterate() {
+            var sync = true;
+            if (key === null) {
+                return callback(null);
+            }
+            iterator(obj[key], key, only_once(function (err) {
+                if (err) {
+                    callback(err);
+                }
+                else {
+                    key = nextKey();
+                    if (key === null) {
+                        return callback(null);
+                    } else {
+                        if (sync) {
+                            async.setImmediate(iterate);
+                        } else {
+                            iterate();
+                        }
+                    }
+                }
+            }));
+            sync = false;
+        }
+        iterate();
+    };
+
+
+
+    async.forEachOfLimit =
+    async.eachOfLimit = function (obj, limit, iterator, callback) {
+        _eachOfLimit(limit)(obj, iterator, callback);
+    };
+
+    function _eachOfLimit(limit) {
+
+        return function (obj, iterator, callback) {
+            callback = _once(callback || noop);
+            obj = obj || [];
+            var nextKey = _keyIterator(obj);
+            if (limit <= 0) {
+                return callback(null);
+            }
+            var done = false;
+            var running = 0;
+            var errored = false;
+
+            (function replenish () {
+                if (done && running <= 0) {
+                    return callback(null);
+                }
+
+                while (running < limit && !errored) {
+                    var key = nextKey();
+                    if (key === null) {
+                        done = true;
+                        if (running <= 0) {
+                            callback(null);
+                        }
+                        return;
+                    }
+                    running += 1;
+                    iterator(obj[key], key, only_once(function (err) {
+                        running -= 1;
+                        if (err) {
+                            callback(err);
+                            errored = true;
+                        }
+                        else {
+                            replenish();
+                        }
+                    }));
+                }
+            })();
+        };
+    }
+
+
+    function doParallel(fn) {
+        return function (obj, iterator, callback) {
+            return fn(async.eachOf, obj, iterator, callback);
+        };
+    }
+    function doParallelLimit(fn) {
+        return function (obj, limit, iterator, callback) {
+            return fn(_eachOfLimit(limit), obj, iterator, callback);
+        };
+    }
+    function doSeries(fn) {
+        return function (obj, iterator, callback) {
+            return fn(async.eachOfSeries, obj, iterator, callback);
+        };
+    }
+
+    function _asyncMap(eachfn, arr, iterator, callback) {
+        callback = _once(callback || noop);
+        arr = arr || [];
+        var results = _isArrayLike(arr) ? [] : {};
+        eachfn(arr, function (value, index, callback) {
+            iterator(value, function (err, v) {
+                results[index] = v;
+                callback(err);
+            });
+        }, function (err) {
+            callback(err, results);
+        });
+    }
+
+    async.map = doParallel(_asyncMap);
+    async.mapSeries = doSeries(_asyncMap);
+    async.mapLimit = doParallelLimit(_asyncMap);
+
+    // reduce only has a series version, as doing reduce in parallel won't
+    // work in many situations.
+    async.inject =
+    async.foldl =
+    async.reduce = function (arr, memo, iterator, callback) {
+        async.eachOfSeries(arr, function (x, i, callback) {
+            iterator(memo, x, function (err, v) {
+                memo = v;
+                callback(err);
+            });
+        }, function (err) {
+            callback(err, memo);
+        });
+    };
+
+    async.foldr =
+    async.reduceRight = function (arr, memo, iterator, callback) {
+        var reversed = _map(arr, identity).reverse();
+        async.reduce(reversed, memo, iterator, callback);
+    };
+
+    async.transform = function (arr, memo, iterator, callback) {
+        if (arguments.length === 3) {
+            callback = iterator;
+            iterator = memo;
+            memo = _isArray(arr) ? [] : {};
+        }
+
+        async.eachOf(arr, function(v, k, cb) {
+            iterator(memo, v, k, cb);
+        }, function(err) {
+            callback(err, memo);
+        });
+    };
+
+    function _filter(eachfn, arr, iterator, callback) {
+        var results = [];
+        eachfn(arr, function (x, index, callback) {
+            iterator(x, function (v) {
+                if (v) {
+                    results.push({index: index, value: x});
+                }
+                callback();
+            });
+        }, function () {
+            callback(_map(results.sort(function (a, b) {
+                return a.index - b.index;
+            }), function (x) {
+                return x.value;
+            }));
+        });
+    }
+
+    async.select =
+    async.filter = doParallel(_filter);
+
+    async.selectLimit =
+    async.filterLimit = doParallelLimit(_filter);
+
+    async.selectSeries =
+    async.filterSeries = doSeries(_filter);
+
+    function _reject(eachfn, arr, iterator, callback) {
+        _filter(eachfn, arr, function(value, cb) {
+            iterator(value, function(v) {
+                cb(!v);
+            });
+        }, callback);
+    }
+    async.reject = doParallel(_reject);
+    async.rejectLimit = doParallelLimit(_reject);
+    async.rejectSeries = doSeries(_reject);
+
+    function _createTester(eachfn, check, getResult) {
+        return function(arr, limit, iterator, cb) {
+            function done() {
+                if (cb) cb(getResult(false, void 0));
+            }
+            function iteratee(x, _, callback) {
+                if (!cb) return callback();
+                iterator(x, function (v) {
+                    if (cb && check(v)) {
+                        cb(getResult(true, x));
+                        cb = iterator = false;
+                    }
+                    callback();
+                });
+            }
+            if (arguments.length > 3) {
+                eachfn(arr, limit, iteratee, done);
+            } else {
+                cb = iterator;
+                iterator = limit;
+                eachfn(arr, iteratee, done);
+            }
+        };
+    }
+
+    async.any =
+    async.some = _createTester(async.eachOf, toBool, identity);
+
+    async.someLimit = _createTester(async.eachOfLimit, toBool, identity);
+
+    async.all =
+    async.every = _createTester(async.eachOf, notId, notId);
+
+    async.everyLimit = _createTester(async.eachOfLimit, notId, notId);
+
+    function _findGetResult(v, x) {
+        return x;
+    }
+    async.detect = _createTester(async.eachOf, identity, _findGetResult);
+    async.detectSeries = _createTester(async.eachOfSeries, identity, _findGetResult);
+    async.detectLimit = _createTester(async.eachOfLimit, identity, _findGetResult);
+
+    async.sortBy = function (arr, iterator, callback) {
+        async.map(arr, function (x, callback) {
+            iterator(x, function (err, criteria) {
+                if (err) {
+                    callback(err);
+                }
+                else {
+                    callback(null, {value: x, criteria: criteria});
+                }
+            });
+        }, function (err, results) {
+            if (err) {
+                return callback(err);
+            }
+            else {
+                callback(null, _map(results.sort(comparator), function (x) {
+                    return x.value;
+                }));
+            }
+
+        });
+
+        function comparator(left, right) {
+            var a = left.criteria, b = right.criteria;
+            return a < b ? -1 : a > b ? 1 : 0;
+        }
+    };
+
+    async.auto = function (tasks, concurrency, callback) {
+        if (typeof arguments[1] === 'function') {
+            // concurrency is optional, shift the args.
+            callback = concurrency;
+            concurrency = null;
+        }
+        callback = _once(callback || noop);
+        var keys = _keys(tasks);
+        var remainingTasks = keys.length;
+        if (!remainingTasks) {
+            return callback(null);
+        }
+        if (!concurrency) {
+            concurrency = remainingTasks;
+        }
+
+        var results = {};
+        var runningTasks = 0;
+
+        var hasError = false;
+
+        var listeners = [];
+        function addListener(fn) {
+            listeners.unshift(fn);
+        }
+        function removeListener(fn) {
+            var idx = _indexOf(listeners, fn);
+            if (idx >= 0) listeners.splice(idx, 1);
+        }
+        function taskComplete() {
+            remainingTasks--;
+            _arrayEach(listeners.slice(0), function (fn) {
+                fn();
+            });
+        }
+
+        addListener(function () {
+            if (!remainingTasks) {
+                callback(null, results);
+            }
+        });
+
+        _arrayEach(keys, function (k) {
+            if (hasError) return;
+            var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]];
+            var taskCallback = _restParam(function(err, args) {
+                runningTasks--;
+                if (args.length <= 1) {
+                    args = args[0];
+                }
+                if (err) {
+                    var safeResults = {};
+                    _forEachOf(results, function(val, rkey) {
+                        safeResults[rkey] = val;
+                    });
+                    safeResults[k] = args;
+                    hasError = true;
+
+                    callback(err, safeResults);
+                }
+                else {
+                    results[k] = args;
+                    async.setImmediate(taskComplete);
+                }
+            });
+            var requires = task.slice(0, task.length - 1);
+            // prevent dead-locks
+            var len = requires.length;
+            var dep;
+            while (len--) {
+                if (!(dep = tasks[requires[len]])) {
+                    throw new Error('Has nonexistent dependency in ' + requires.join(', '));
+                }
+                if (_isArray(dep) && _indexOf(dep, k) >= 0) {
+                    throw new Error('Has cyclic dependencies');
+                }
+            }
+            function ready() {
+                return runningTasks < concurrency && _reduce(requires, function (a, x) {
+                    return (a && results.hasOwnProperty(x));
+                }, true) && !results.hasOwnProperty(k);
+            }
+            if (ready()) {
+                runningTasks++;
+                task[task.length - 1](taskCallback, results);
+            }
+            else {
+                addListener(listener);
+            }
+            function listener() {
+                if (ready()) {
+                    runningTasks++;
+                    removeListener(listener);
+                    task[task.length - 1](taskCallback, results);
+                }
+            }
+        });
+    };
+
+
+
+    async.retry = function(times, task, callback) {
+        var DEFAULT_TIMES = 5;
+        var DEFAULT_INTERVAL = 0;
+
+        var attempts = [];
+
+        var opts = {
+            times: DEFAULT_TIMES,
+            interval: DEFAULT_INTERVAL
+        };
+
+        function parseTimes(acc, t){
+            if(typeof t === 'number'){
+                acc.times = parseInt(t, 10) || DEFAULT_TIMES;
+            } else if(typeof t === 'object'){
+                acc.times = parseInt(t.times, 10) || DEFAULT_TIMES;
+                acc.interval = parseInt(t.interval, 10) || DEFAULT_INTERVAL;
+            } else {
+                throw new Error('Unsupported argument type for \'times\': ' + typeof t);
+            }
+        }
+
+        var length = arguments.length;
+        if (length < 1 || length > 3) {
+            throw new Error('Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)');
+        } else if (length <= 2 && typeof times === 'function') {
+            callback = task;
+            task = times;
+        }
+        if (typeof times !== 'function') {
+            parseTimes(opts, times);
+        }
+        opts.callback = callback;
+        opts.task = task;
+
+        function wrappedTask(wrappedCallback, wrappedResults) {
+            function retryAttempt(task, finalAttempt) {
+                return function(seriesCallback) {
+                    task(function(err, result){
+                        seriesCallback(!err || finalAttempt, {err: err, result: result});
+                    }, wrappedResults);
+                };
+            }
+
+            function retryInterval(interval){
+                return function(seriesCallback){
+                    setTimeout(function(){
+                        seriesCallback(null);
+                    }, interval);
+                };
+            }
+
+            while (opts.times) {
+
+                var finalAttempt = !(opts.times-=1);
+                attempts.push(retryAttempt(opts.task, finalAttempt));
+                if(!finalAttempt && opts.interval > 0){
+                    attempts.push(retryInterval(opts.interval));
+                }
+            }
+
+            async.series(attempts, function(done, data){
+                data = data[data.length - 1];
+                (wrappedCallback || opts.callback)(data.err, data.result);
+            });
+        }
+
+        // If a callback is passed, run this as a controll flow
+        return opts.callback ? wrappedTask() : wrappedTask;
+    };
+
+    async.waterfall = function (tasks, callback) {
+        callback = _once(callback || noop);
+        if (!_isArray(tasks)) {
+            var err = new Error('First argument to waterfall must be an array of functions');
+            return callback(err);
+        }
+        if (!tasks.length) {
+            return callback();
+        }
+        function wrapIterator(iterator) {
+            return _restParam(function (err, args) {
+                if (err) {
+                    callback.apply(null, [err].concat(args));
+                }
+                else {
+                    var next = iterator.next();
+                    if (next) {
+                        args.push(wrapIterator(next));
+                    }
+                    else {
+                        args.push(callback);
+                    }
+                    ensureAsync(iterator).apply(null, args);
+                }
+            });
+        }
+        wrapIterator(async.iterator(tasks))();
+    };
+
+    function _parallel(eachfn, tasks, callback) {
+        callback = callback || noop;
+        var results = _isArrayLike(tasks) ? [] : {};
+
+        eachfn(tasks, function (task, key, callback) {
+            task(_restParam(function (err, args) {
+                if (args.length <= 1) {
+                    args = args[0];
+                }
+                results[key] = args;
+                callback(err);
+            }));
+        }, function (err) {
+            callback(err, results);
+        });
+    }
+
+    async.parallel = function (tasks, callback) {
+        _parallel(async.eachOf, tasks, callback);
+    };
+
+    async.parallelLimit = function(tasks, limit, callback) {
+        _parallel(_eachOfLimit(limit), tasks, callback);
+    };
+
+    async.series = function(tasks, callback) {
+        _parallel(async.eachOfSeries, tasks, callback);
+    };
+
+    async.iterator = function (tasks) {
+        function makeCallback(index) {
+            function fn() {
+                if (tasks.length) {
+                    tasks[index].apply(null, arguments);
+                }
+                return fn.next();
+            }
+            fn.next = function () {
+                return (index < tasks.length - 1) ? makeCallback(index + 1): null;
+            };
+            return fn;
+        }
+        return makeCallback(0);
+    };
+
+    async.apply = _restParam(function (fn, args) {
+        return _restParam(function (callArgs) {
+            return fn.apply(
+                null, args.concat(callArgs)
+            );
+        });
+    });
+
+    function _concat(eachfn, arr, fn, callback) {
+        var result = [];
+        eachfn(arr, function (x, index, cb) {
+            fn(x, function (err, y) {
+                result = result.concat(y || []);
+                cb(err);
+            });
+        }, function (err) {
+            callback(err, result);
+        });
+    }
+    async.concat = doParallel(_concat);
+    async.concatSeries = doSeries(_concat);
+
+    async.whilst = function (test, iterator, callback) {
+        callback = callback || noop;
+        if (test()) {
+            var next = _restParam(function(err, args) {
+                if (err) {
+                    callback(err);
+                } else if (test.apply(this, args)) {
+                    iterator(next);
+                } else {
+                    callback.apply(null, [null].concat(args));
+                }
+            });
+            iterator(next);
+        } else {
+            callback(null);
+        }
+    };
+
+    async.doWhilst = function (iterator, test, callback) {
+        var calls = 0;
+        return async.whilst(function() {
+            return ++calls <= 1 || test.apply(this, arguments);
+        }, iterator, callback);
+    };
+
+    async.until = function (test, iterator, callback) {
+        return async.whilst(function() {
+            return !test.apply(this, arguments);
+        }, iterator, callback);
+    };
+
+    async.doUntil = function (iterator, test, callback) {
+        return async.doWhilst(iterator, function() {
+            return !test.apply(this, arguments);
+        }, callback);
+    };
+
+    async.during = function (test, iterator, callback) {
+        callback = callback || noop;
+
+        var next = _restParam(function(err, args) {
+            if (err) {
+                callback(err);
+            } else {
+                args.push(check);
+                test.apply(this, args);
+            }
+        });
+
+        var check = function(err, truth) {
+            if (err) {
+                callback(err);
+            } else if (truth) {
+                iterator(next);
+            } else {
+                callback(null);
+            }
+        };
+
+        test(check);
+    };
+
+    async.doDuring = function (iterator, test, callback) {
+        var calls = 0;
+        async.during(function(next) {
+            if (calls++ < 1) {
+                next(null, true);
+            } else {
+                test.apply(this, arguments);
+            }
+        }, iterator, callback);
+    };
+
+    function _queue(worker, concurrency, payload) {
+        if (concurrency == null) {
+            concurrency = 1;
+        }
+        else if(concurrency === 0) {
+            throw new Error('Concurrency must not be zero');
+        }
+        function _insert(q, data, pos, callback) {
+            if (callback != null && typeof callback !== "function") {
+                throw new Error("task callback must be a function");
+            }
+            q.started = true;
+            if (!_isArray(data)) {
+                data = [data];
+            }
+            if(data.length === 0 && q.idle()) {
+                // call drain immediately if there are no tasks
+                return async.setImmediate(function() {
+                    q.drain();
+                });
+            }
+            _arrayEach(data, function(task) {
+                var item = {
+                    data: task,
+                    callback: callback || noop
+                };
+
+                if (pos) {
+                    q.tasks.unshift(item);
+                } else {
+                    q.tasks.push(item);
+                }
+
+                if (q.tasks.length === q.concurrency) {
+                    q.saturated();
+                }
+            });
+            async.setImmediate(q.process);
+        }
+        function _next(q, tasks) {
+            return function(){
+                workers -= 1;
+
+                var removed = false;
+                var args = arguments;
+                _arrayEach(tasks, function (task) {
+                    _arrayEach(workersList, function (worker, index) {
+                        if (worker === task && !removed) {
+                            workersList.splice(index, 1);
+                            removed = true;
+                        }
+                    });
+
+                    task.callback.apply(task, args);
+                });
+                if (q.tasks.length + workers === 0) {
+                    q.drain();
+                }
+                q.process();
+            };
+        }
+
+        var workers = 0;
+        var workersList = [];
+        var q = {
+            tasks: [],
+            concurrency: concurrency,
+            payload: payload,
+            saturated: noop,
+            empty: noop,
+            drain: noop,
+            started: false,
+            paused: false,
+            push: function (data, callback) {
+                _insert(q, data, false, callback);
+            },
+            kill: function () {
+                q.drain = noop;
+                q.tasks = [];
+            },
+            unshift: function (data, callback) {
+                _insert(q, data, true, callback);
+            },
+            process: function () {
+                while(!q.paused && workers < q.concurrency && q.tasks.length){
+
+                    var tasks = q.payload ?
+                        q.tasks.splice(0, q.payload) :
+                        q.tasks.splice(0, q.tasks.length);
+
+                    var data = _map(tasks, function (task) {
+                        return task.data;
+                    });
+
+                    if (q.tasks.length === 0) {
+                        q.empty();
+                    }
+                    workers += 1;
+                    workersList.push(tasks[0]);
+                    var cb = only_once(_next(q, tasks));
+                    worker(data, cb);
+                }
+            },
+            length: function () {
+                return q.tasks.length;
+            },
+            running: function () {
+                return workers;
+            },
+            workersList: function () {
+                return workersList;
+            },
+            idle: function() {
+                return q.tasks.length + workers === 0;
+            },
+            pause: function () {
+                q.paused = true;
+            },
+            resume: function () {
+                if (q.paused === false) { return; }
+                q.paused = false;
+                var resumeCount = Math.min(q.concurrency, q.tasks.length);
+                // Need to call q.process once per concurrent
+                // worker to preserve full concurrency after pause
+                for (var w = 1; w <= resumeCount; w++) {
+                    async.setImmediate(q.process);
+                }
+            }
+        };
+        return q;
+    }
+
+    async.queue = function (worker, concurrency) {
+        var q = _queue(function (items, cb) {
+            worker(items[0], cb);
+        }, concurrency, 1);
+
+        return q;
+    };
+
+    async.priorityQueue = function (worker, concurrency) {
+
+        function _compareTasks(a, b){
+            return a.priority - b.priority;
+        }
+
+        function _binarySearch(sequence, item, compare) {
+            var beg = -1,
+                end = sequence.length - 1;
+            while (beg < end) {
+                var mid = beg + ((end - beg + 1) >>> 1);
+                if (compare(item, sequence[mid]) >= 0) {
+                    beg = mid;
+                } else {
+                    end = mid - 1;
+                }
+            }
+            return beg;
+        }
+
+        function _insert(q, data, priority, callback) {
+            if (callback != null && typeof callback !== "function") {
+                throw new Error("task callback must be a function");
+            }
+            q.started = true;
+            if (!_isArray(data)) {
+                data = [data];
+            }
+            if(data.length === 0) {
+                // call drain immediately if there are no tasks
+                return async.setImmediate(function() {
+                    q.drain();
+                });
+            }
+            _arrayEach(data, function(task) {
+                var item = {
+                    data: task,
+                    priority: priority,
+                    callback: typeof callback === 'function' ? callback : noop
+                };
+
+                q.tasks.splice(_binarySearch(q.tasks, item, _compareTasks) + 1, 0, item);
+
+                if (q.tasks.length === q.concurrency) {
+                    q.saturated();
+                }
+                async.setImmediate(q.process);
+            });
+        }
+
+        // Start with a normal queue
+        var q = async.queue(worker, concurrency);
+
+        // Override push to accept second parameter representing priority
+        q.push = function (data, priority, callback) {
+            _insert(q, data, priority, callback);
+        };
+
+        // Remove unshift function
+        delete q.unshift;
+
+        return q;
+    };
+
+    async.cargo = function (worker, payload) {
+        return _queue(worker, 1, payload);
+    };
+
+    function _console_fn(name) {
+        return _restParam(function (fn, args) {
+            fn.apply(null, args.concat([_restParam(function (err, args) {
+                if (typeof console === 'object') {
+                    if (err) {
+                        if (console.error) {
+                            console.error(err);
+                        }
+                    }
+                    else if (console[name]) {
+                        _arrayEach(args, function (x) {
+                            console[name](x);
+                        });
+                    }
+                }
+            })]));
+        });
+    }
+    async.log = _console_fn('log');
+    async.dir = _console_fn('dir');
+    /*async.info = _console_fn('info');
+    async.warn = _console_fn('warn');
+    async.error = _console_fn('error');*/
+
+    async.memoize = function (fn, hasher) {
+        var memo = {};
+        var queues = {};
+        var has = Object.prototype.hasOwnProperty;
+        hasher = hasher || identity;
+        var memoized = _restParam(function memoized(args) {
+            var callback = args.pop();
+            var key = hasher.apply(null, args);
+            if (has.call(memo, key)) {   
+                async.setImmediate(function () {
+                    callback.apply(null, memo[key]);
+                });
+            }
+            else if (has.call(queues, key)) {
+                queues[key].push(callback);
+            }
+            else {
+                queues[key] = [callback];
+                fn.apply(null, args.concat([_restParam(function (args) {
+                    memo[key] = args;
+                    var q = queues[key];
+                    delete queues[key];
+                    for (var i = 0, l = q.length; i < l; i++) {
+                        q[i].apply(null, args);
+                    }
+                })]));
+            }
+        });
+        memoized.memo = memo;
+        memoized.unmemoized = fn;
+        return memoized;
+    };
+
+    async.unmemoize = function (fn) {
+        return function () {
+            return (fn.unmemoized || fn).apply(null, arguments);
+        };
+    };
+
+    function _times(mapper) {
+        return function (count, iterator, callback) {
+            mapper(_range(count), iterator, callback);
+        };
+    }
+
+    async.times = _times(async.map);
+    async.timesSeries = _times(async.mapSeries);
+    async.timesLimit = function (count, limit, iterator, callback) {
+        return async.mapLimit(_range(count), limit, iterator, callback);
+    };
+
+    async.seq = function (/* functions... */) {
+        var fns = arguments;
+        return _restParam(function (args) {
+            var that = this;
+
+            var callback = args[args.length - 1];
+            if (typeof callback == 'function') {
+                args.pop();
+            } else {
+                callback = noop;
+            }
+
+            async.reduce(fns, args, function (newargs, fn, cb) {
+                fn.apply(that, newargs.concat([_restParam(function (err, nextargs) {
+                    cb(err, nextargs);
+                })]));
+            },
+            function (err, results) {
+                callback.apply(that, [err].concat(results));
+            });
+        });
+    };
+
+    async.compose = function (/* functions... */) {
+        return async.seq.apply(null, Array.prototype.reverse.call(arguments));
+    };
+
+
+    function _applyEach(eachfn) {
+        return _restParam(function(fns, args) {
+            var go = _restParam(function(args) {
+                var that = this;
+                var callback = args.pop();
+                return eachfn(fns, function (fn, _, cb) {
+                    fn.apply(that, args.concat([cb]));
+                },
+                callback);
+            });
+            if (args.length) {
+                return go.apply(this, args);
+            }
+            else {
+                return go;
+            }
+        });
+    }
+
+    async.applyEach = _applyEach(async.eachOf);
+    async.applyEachSeries = _applyEach(async.eachOfSeries);
+
+
+    async.forever = function (fn, callback) {
+        var done = only_once(callback || noop);
+        var task = ensureAsync(fn);
+        function next(err) {
+            if (err) {
+                return done(err);
+            }
+            task(next);
+        }
+        next();
+    };
+
+    function ensureAsync(fn) {
+        return _restParam(function (args) {
+            var callback = args.pop();
+            args.push(function () {
+                var innerArgs = arguments;
+                if (sync) {
+                    async.setImmediate(function () {
+                        callback.apply(null, innerArgs);
+                    });
+                } else {
+                    callback.apply(null, innerArgs);
+                }
+            });
+            var sync = true;
+            fn.apply(this, args);
+            sync = false;
+        });
+    }
+
+    async.ensureAsync = ensureAsync;
+
+    async.constant = _restParam(function(values) {
+        var args = [null].concat(values);
+        return function (callback) {
+            return callback.apply(this, args);
+        };
+    });
+
+    async.wrapSync =
+    async.asyncify = function asyncify(func) {
+        return _restParam(function (args) {
+            var callback = args.pop();
+            var result;
+            try {
+                result = func.apply(this, args);
+            } catch (e) {
+                return callback(e);
+            }
+            // if result is Promise object
+            if (_isObject(result) && typeof result.then === "function") {
+                result.then(function(value) {
+                    callback(null, value);
+                })["catch"](function(err) {
+                    callback(err.message ? err : new Error(err));
+                });
+            } else {
+                callback(null, result);
+            }
+        });
+    };
+
+    // Node.js
+    if (typeof module === 'object' && module.exports) {
+        module.exports = async;
+    }
+    // AMD / RequireJS
+    else if (typeof define === 'function' && define.amd) {
+        define([], function () {
+            return async;
+        });
+    }
+    // included directly via <script> tag
+    else {
+        root.async = async;
+    }
+
+}());
diff --git a/wrt/node_modules/async/dist/async.min.js b/wrt/node_modules/async/dist/async.min.js
new file mode 100644 (file)
index 0000000..2490016
--- /dev/null
@@ -0,0 +1,2 @@
+!function(){function n(){}function t(n){return n}function e(n){return!!n}function r(n){return!n}function u(n){return function(){if(null===n)throw new Error("Callback was already called.");n.apply(this,arguments),n=null}}function i(n){return function(){null!==n&&(n.apply(this,arguments),n=null)}}function o(n){return M(n)||"number"==typeof n.length&&n.length>=0&&n.length%1===0}function c(n,t){for(var e=-1,r=n.length;++e<r;)t(n[e],e,n)}function a(n,t){for(var e=-1,r=n.length,u=Array(r);++e<r;)u[e]=t(n[e],e,n);return u}function f(n){return a(Array(n),function(n,t){return t})}function l(n,t,e){return c(n,function(n,r,u){e=t(e,n,r,u)}),e}function s(n,t){c(W(n),function(e){t(n[e],e)})}function p(n,t){for(var e=0;e<n.length;e++)if(n[e]===t)return e;return-1}function h(n){var t,e,r=-1;return o(n)?(t=n.length,function(){return r++,t>r?r:null}):(e=W(n),t=e.length,function(){return r++,t>r?e[r]:null})}function m(n,t){return t=null==t?n.length-1:+t,function(){for(var e=Math.max(arguments.length-t,0),r=Array(e),u=0;e>u;u++)r[u]=arguments[u+t];switch(t){case 0:return n.call(this,r);case 1:return n.call(this,arguments[0],r)}}}function y(n){return function(t,e,r){return n(t,r)}}function v(t){return function(e,r,o){o=i(o||n),e=e||[];var c=h(e);if(0>=t)return o(null);var a=!1,f=0,l=!1;!function s(){if(a&&0>=f)return o(null);for(;t>f&&!l;){var n=c();if(null===n)return a=!0,void(0>=f&&o(null));f+=1,r(e[n],n,u(function(n){f-=1,n?(o(n),l=!0):s()}))}}()}}function d(n){return function(t,e,r){return n(P.eachOf,t,e,r)}}function g(n){return function(t,e,r,u){return n(v(e),t,r,u)}}function k(n){return function(t,e,r){return n(P.eachOfSeries,t,e,r)}}function b(t,e,r,u){u=i(u||n),e=e||[];var c=o(e)?[]:{};t(e,function(n,t,e){r(n,function(n,r){c[t]=r,e(n)})},function(n){u(n,c)})}function w(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(e){e&&u.push({index:t,value:n}),r()})},function(){r(a(u.sort(function(n,t){return n.index-t.index}),function(n){return n.value}))})}function O(n,t,e,r){w(n,t,function(n,t){e(n,function(n){t(!n)})},r)}function S(n,t,e){return function(r,u,i,o){function c(){o&&o(e(!1,void 0))}function a(n,r,u){return o?void i(n,function(r){o&&t(r)&&(o(e(!0,n)),o=i=!1),u()}):u()}arguments.length>3?n(r,u,a,c):(o=i,i=u,n(r,a,c))}}function E(n,t){return t}function L(t,e,r){r=r||n;var u=o(e)?[]:{};t(e,function(n,t,e){n(m(function(n,r){r.length<=1&&(r=r[0]),u[t]=r,e(n)}))},function(n){r(n,u)})}function j(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(n,t){u=u.concat(t||[]),r(n)})},function(n){r(n,u)})}function I(t,e,r){function i(t,e,r,u){if(null!=u&&"function"!=typeof u)throw new Error("task callback must be a function");return t.started=!0,M(e)||(e=[e]),0===e.length&&t.idle()?P.setImmediate(function(){t.drain()}):(c(e,function(e){var i={data:e,callback:u||n};r?t.tasks.unshift(i):t.tasks.push(i),t.tasks.length===t.concurrency&&t.saturated()}),void P.setImmediate(t.process))}function o(n,t){return function(){f-=1;var e=!1,r=arguments;c(t,function(n){c(l,function(t,r){t!==n||e||(l.splice(r,1),e=!0)}),n.callback.apply(n,r)}),n.tasks.length+f===0&&n.drain(),n.process()}}if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var f=0,l=[],s={tasks:[],concurrency:e,payload:r,saturated:n,empty:n,drain:n,started:!1,paused:!1,push:function(n,t){i(s,n,!1,t)},kill:function(){s.drain=n,s.tasks=[]},unshift:function(n,t){i(s,n,!0,t)},process:function(){for(;!s.paused&&f<s.concurrency&&s.tasks.length;){var n=s.payload?s.tasks.splice(0,s.payload):s.tasks.splice(0,s.tasks.length),e=a(n,function(n){return n.data});0===s.tasks.length&&s.empty(),f+=1,l.push(n[0]);var r=u(o(s,n));t(e,r)}},length:function(){return s.tasks.length},running:function(){return f},workersList:function(){return l},idle:function(){return s.tasks.length+f===0},pause:function(){s.paused=!0},resume:function(){if(s.paused!==!1){s.paused=!1;for(var n=Math.min(s.concurrency,s.tasks.length),t=1;n>=t;t++)P.setImmediate(s.process)}}};return s}function x(n){return m(function(t,e){t.apply(null,e.concat([m(function(t,e){"object"==typeof console&&(t?console.error&&console.error(t):console[n]&&c(e,function(t){console[n](t)}))})]))})}function A(n){return function(t,e,r){n(f(t),e,r)}}function T(n){return m(function(t,e){var r=m(function(e){var r=this,u=e.pop();return n(t,function(n,t,u){n.apply(r,e.concat([u]))},u)});return e.length?r.apply(this,e):r})}function z(n){return m(function(t){var e=t.pop();t.push(function(){var n=arguments;r?P.setImmediate(function(){e.apply(null,n)}):e.apply(null,n)});var r=!0;n.apply(this,t),r=!1})}var q,P={},C="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||this;null!=C&&(q=C.async),P.noConflict=function(){return C.async=q,P};var H=Object.prototype.toString,M=Array.isArray||function(n){return"[object Array]"===H.call(n)},U=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},W=Object.keys||function(n){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push(e);return t},B="function"==typeof setImmediate&&setImmediate,D=B?function(n){B(n)}:function(n){setTimeout(n,0)};"object"==typeof process&&"function"==typeof process.nextTick?P.nextTick=process.nextTick:P.nextTick=D,P.setImmediate=B?D:P.nextTick,P.forEach=P.each=function(n,t,e){return P.eachOf(n,y(t),e)},P.forEachSeries=P.eachSeries=function(n,t,e){return P.eachOfSeries(n,y(t),e)},P.forEachLimit=P.eachLimit=function(n,t,e,r){return v(t)(n,y(e),r)},P.forEachOf=P.eachOf=function(t,e,r){function o(n){f--,n?r(n):null===c&&0>=f&&r(null)}r=i(r||n),t=t||[];for(var c,a=h(t),f=0;null!=(c=a());)f+=1,e(t[c],c,u(o));0===f&&r(null)},P.forEachOfSeries=P.eachOfSeries=function(t,e,r){function o(){var n=!0;return null===a?r(null):(e(t[a],a,u(function(t){if(t)r(t);else{if(a=c(),null===a)return r(null);n?P.setImmediate(o):o()}})),void(n=!1))}r=i(r||n),t=t||[];var c=h(t),a=c();o()},P.forEachOfLimit=P.eachOfLimit=function(n,t,e,r){v(t)(n,e,r)},P.map=d(b),P.mapSeries=k(b),P.mapLimit=g(b),P.inject=P.foldl=P.reduce=function(n,t,e,r){P.eachOfSeries(n,function(n,r,u){e(t,n,function(n,e){t=e,u(n)})},function(n){r(n,t)})},P.foldr=P.reduceRight=function(n,e,r,u){var i=a(n,t).reverse();P.reduce(i,e,r,u)},P.transform=function(n,t,e,r){3===arguments.length&&(r=e,e=t,t=M(n)?[]:{}),P.eachOf(n,function(n,r,u){e(t,n,r,u)},function(n){r(n,t)})},P.select=P.filter=d(w),P.selectLimit=P.filterLimit=g(w),P.selectSeries=P.filterSeries=k(w),P.reject=d(O),P.rejectLimit=g(O),P.rejectSeries=k(O),P.any=P.some=S(P.eachOf,e,t),P.someLimit=S(P.eachOfLimit,e,t),P.all=P.every=S(P.eachOf,r,r),P.everyLimit=S(P.eachOfLimit,r,r),P.detect=S(P.eachOf,t,E),P.detectSeries=S(P.eachOfSeries,t,E),P.detectLimit=S(P.eachOfLimit,t,E),P.sortBy=function(n,t,e){function r(n,t){var e=n.criteria,r=t.criteria;return r>e?-1:e>r?1:0}P.map(n,function(n,e){t(n,function(t,r){t?e(t):e(null,{value:n,criteria:r})})},function(n,t){return n?e(n):void e(null,a(t.sort(r),function(n){return n.value}))})},P.auto=function(t,e,r){function u(n){g.unshift(n)}function o(n){var t=p(g,n);t>=0&&g.splice(t,1)}function a(){h--,c(g.slice(0),function(n){n()})}"function"==typeof arguments[1]&&(r=e,e=null),r=i(r||n);var f=W(t),h=f.length;if(!h)return r(null);e||(e=h);var y={},v=0,d=!1,g=[];u(function(){h||r(null,y)}),c(f,function(n){function i(){return e>v&&l(k,function(n,t){return n&&y.hasOwnProperty(t)},!0)&&!y.hasOwnProperty(n)}function c(){i()&&(v++,o(c),h[h.length-1](g,y))}if(!d){for(var f,h=M(t[n])?t[n]:[t[n]],g=m(function(t,e){if(v--,e.length<=1&&(e=e[0]),t){var u={};s(y,function(n,t){u[t]=n}),u[n]=e,d=!0,r(t,u)}else y[n]=e,P.setImmediate(a)}),k=h.slice(0,h.length-1),b=k.length;b--;){if(!(f=t[k[b]]))throw new Error("Has nonexistent dependency in "+k.join(", "));if(M(f)&&p(f,n)>=0)throw new Error("Has cyclic dependencies")}i()?(v++,h[h.length-1](g,y)):u(c)}})},P.retry=function(n,t,e){function r(n,t){if("number"==typeof t)n.times=parseInt(t,10)||i;else{if("object"!=typeof t)throw new Error("Unsupported argument type for 'times': "+typeof t);n.times=parseInt(t.times,10)||i,n.interval=parseInt(t.interval,10)||o}}function u(n,t){function e(n,e){return function(r){n(function(n,t){r(!n||e,{err:n,result:t})},t)}}function r(n){return function(t){setTimeout(function(){t(null)},n)}}for(;a.times;){var u=!(a.times-=1);c.push(e(a.task,u)),!u&&a.interval>0&&c.push(r(a.interval))}P.series(c,function(t,e){e=e[e.length-1],(n||a.callback)(e.err,e.result)})}var i=5,o=0,c=[],a={times:i,interval:o},f=arguments.length;if(1>f||f>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return 2>=f&&"function"==typeof n&&(e=t,t=n),"function"!=typeof n&&r(a,n),a.callback=e,a.task=t,a.callback?u():u},P.waterfall=function(t,e){function r(n){return m(function(t,u){if(t)e.apply(null,[t].concat(u));else{var i=n.next();i?u.push(r(i)):u.push(e),z(n).apply(null,u)}})}if(e=i(e||n),!M(t)){var u=new Error("First argument to waterfall must be an array of functions");return e(u)}return t.length?void r(P.iterator(t))():e()},P.parallel=function(n,t){L(P.eachOf,n,t)},P.parallelLimit=function(n,t,e){L(v(t),n,e)},P.series=function(n,t){L(P.eachOfSeries,n,t)},P.iterator=function(n){function t(e){function r(){return n.length&&n[e].apply(null,arguments),r.next()}return r.next=function(){return e<n.length-1?t(e+1):null},r}return t(0)},P.apply=m(function(n,t){return m(function(e){return n.apply(null,t.concat(e))})}),P.concat=d(j),P.concatSeries=k(j),P.whilst=function(t,e,r){if(r=r||n,t()){var u=m(function(n,i){n?r(n):t.apply(this,i)?e(u):r.apply(null,[null].concat(i))});e(u)}else r(null)},P.doWhilst=function(n,t,e){var r=0;return P.whilst(function(){return++r<=1||t.apply(this,arguments)},n,e)},P.until=function(n,t,e){return P.whilst(function(){return!n.apply(this,arguments)},t,e)},P.doUntil=function(n,t,e){return P.doWhilst(n,function(){return!t.apply(this,arguments)},e)},P.during=function(t,e,r){r=r||n;var u=m(function(n,e){n?r(n):(e.push(i),t.apply(this,e))}),i=function(n,t){n?r(n):t?e(u):r(null)};t(i)},P.doDuring=function(n,t,e){var r=0;P.during(function(n){r++<1?n(null,!0):t.apply(this,arguments)},n,e)},P.queue=function(n,t){var e=I(function(t,e){n(t[0],e)},t,1);return e},P.priorityQueue=function(t,e){function r(n,t){return n.priority-t.priority}function u(n,t,e){for(var r=-1,u=n.length-1;u>r;){var i=r+(u-r+1>>>1);e(t,n[i])>=0?r=i:u=i-1}return r}function i(t,e,i,o){if(null!=o&&"function"!=typeof o)throw new Error("task callback must be a function");return t.started=!0,M(e)||(e=[e]),0===e.length?P.setImmediate(function(){t.drain()}):void c(e,function(e){var c={data:e,priority:i,callback:"function"==typeof o?o:n};t.tasks.splice(u(t.tasks,c,r)+1,0,c),t.tasks.length===t.concurrency&&t.saturated(),P.setImmediate(t.process)})}var o=P.queue(t,e);return o.push=function(n,t,e){i(o,n,t,e)},delete o.unshift,o},P.cargo=function(n,t){return I(n,1,t)},P.log=x("log"),P.dir=x("dir"),P.memoize=function(n,e){var r={},u={},i=Object.prototype.hasOwnProperty;e=e||t;var o=m(function(t){var o=t.pop(),c=e.apply(null,t);i.call(r,c)?P.setImmediate(function(){o.apply(null,r[c])}):i.call(u,c)?u[c].push(o):(u[c]=[o],n.apply(null,t.concat([m(function(n){r[c]=n;var t=u[c];delete u[c];for(var e=0,i=t.length;i>e;e++)t[e].apply(null,n)})])))});return o.memo=r,o.unmemoized=n,o},P.unmemoize=function(n){return function(){return(n.unmemoized||n).apply(null,arguments)}},P.times=A(P.map),P.timesSeries=A(P.mapSeries),P.timesLimit=function(n,t,e,r){return P.mapLimit(f(n),t,e,r)},P.seq=function(){var t=arguments;return m(function(e){var r=this,u=e[e.length-1];"function"==typeof u?e.pop():u=n,P.reduce(t,e,function(n,t,e){t.apply(r,n.concat([m(function(n,t){e(n,t)})]))},function(n,t){u.apply(r,[n].concat(t))})})},P.compose=function(){return P.seq.apply(null,Array.prototype.reverse.call(arguments))},P.applyEach=T(P.eachOf),P.applyEachSeries=T(P.eachOfSeries),P.forever=function(t,e){function r(n){return n?i(n):void o(r)}var i=u(e||n),o=z(t);r()},P.ensureAsync=z,P.constant=m(function(n){var t=[null].concat(n);return function(n){return n.apply(this,t)}}),P.wrapSync=P.asyncify=function(n){return m(function(t){var e,r=t.pop();try{e=n.apply(this,t)}catch(u){return r(u)}U(e)&&"function"==typeof e.then?e.then(function(n){r(null,n)})["catch"](function(n){r(n.message?n:new Error(n))}):r(null,e)})},"object"==typeof module&&module.exports?module.exports=P:"function"==typeof define&&define.amd?define([],function(){return P}):C.async=P}();
+//# sourceMappingURL=dist/async.min.map
\ No newline at end of file
diff --git a/wrt/node_modules/async/lib/async.js b/wrt/node_modules/async/lib/async.js
new file mode 100644 (file)
index 0000000..31e7620
--- /dev/null
@@ -0,0 +1,1265 @@
+/*!
+ * async
+ * https://github.com/caolan/async
+ *
+ * Copyright 2010-2014 Caolan McMahon
+ * Released under the MIT license
+ */
+(function () {
+
+    var async = {};
+    function noop() {}
+    function identity(v) {
+        return v;
+    }
+    function toBool(v) {
+        return !!v;
+    }
+    function notId(v) {
+        return !v;
+    }
+
+    // global on the server, window in the browser
+    var previous_async;
+
+    // Establish the root object, `window` (`self`) in the browser, `global`
+    // on the server, or `this` in some virtual machines. We use `self`
+    // instead of `window` for `WebWorker` support.
+    var root = typeof self === 'object' && self.self === self && self ||
+            typeof global === 'object' && global.global === global && global ||
+            this;
+
+    if (root != null) {
+        previous_async = root.async;
+    }
+
+    async.noConflict = function () {
+        root.async = previous_async;
+        return async;
+    };
+
+    function only_once(fn) {
+        return function() {
+            if (fn === null) throw new Error("Callback was already called.");
+            fn.apply(this, arguments);
+            fn = null;
+        };
+    }
+
+    function _once(fn) {
+        return function() {
+            if (fn === null) return;
+            fn.apply(this, arguments);
+            fn = null;
+        };
+    }
+
+    //// cross-browser compatiblity functions ////
+
+    var _toString = Object.prototype.toString;
+
+    var _isArray = Array.isArray || function (obj) {
+        return _toString.call(obj) === '[object Array]';
+    };
+
+    // Ported from underscore.js isObject
+    var _isObject = function(obj) {
+        var type = typeof obj;
+        return type === 'function' || type === 'object' && !!obj;
+    };
+
+    function _isArrayLike(arr) {
+        return _isArray(arr) || (
+            // has a positive integer length property
+            typeof arr.length === "number" &&
+            arr.length >= 0 &&
+            arr.length % 1 === 0
+        );
+    }
+
+    function _arrayEach(arr, iterator) {
+        var index = -1,
+            length = arr.length;
+
+        while (++index < length) {
+            iterator(arr[index], index, arr);
+        }
+    }
+
+    function _map(arr, iterator) {
+        var index = -1,
+            length = arr.length,
+            result = Array(length);
+
+        while (++index < length) {
+            result[index] = iterator(arr[index], index, arr);
+        }
+        return result;
+    }
+
+    function _range(count) {
+        return _map(Array(count), function (v, i) { return i; });
+    }
+
+    function _reduce(arr, iterator, memo) {
+        _arrayEach(arr, function (x, i, a) {
+            memo = iterator(memo, x, i, a);
+        });
+        return memo;
+    }
+
+    function _forEachOf(object, iterator) {
+        _arrayEach(_keys(object), function (key) {
+            iterator(object[key], key);
+        });
+    }
+
+    function _indexOf(arr, item) {
+        for (var i = 0; i < arr.length; i++) {
+            if (arr[i] === item) return i;
+        }
+        return -1;
+    }
+
+    var _keys = Object.keys || function (obj) {
+        var keys = [];
+        for (var k in obj) {
+            if (obj.hasOwnProperty(k)) {
+                keys.push(k);
+            }
+        }
+        return keys;
+    };
+
+    function _keyIterator(coll) {
+        var i = -1;
+        var len;
+        var keys;
+        if (_isArrayLike(coll)) {
+            len = coll.length;
+            return function next() {
+                i++;
+                return i < len ? i : null;
+            };
+        } else {
+            keys = _keys(coll);
+            len = keys.length;
+            return function next() {
+                i++;
+                return i < len ? keys[i] : null;
+            };
+        }
+    }
+
+    // Similar to ES6's rest param (http://ariya.ofilabs.com/2013/03/es6-and-rest-parameter.html)
+    // This accumulates the arguments passed into an array, after a given index.
+    // From underscore.js (https://github.com/jashkenas/underscore/pull/2140).
+    function _restParam(func, startIndex) {
+        startIndex = startIndex == null ? func.length - 1 : +startIndex;
+        return function() {
+            var length = Math.max(arguments.length - startIndex, 0);
+            var rest = Array(length);
+            for (var index = 0; index < length; index++) {
+                rest[index] = arguments[index + startIndex];
+            }
+            switch (startIndex) {
+                case 0: return func.call(this, rest);
+                case 1: return func.call(this, arguments[0], rest);
+            }
+            // Currently unused but handle cases outside of the switch statement:
+            // var args = Array(startIndex + 1);
+            // for (index = 0; index < startIndex; index++) {
+            //     args[index] = arguments[index];
+            // }
+            // args[startIndex] = rest;
+            // return func.apply(this, args);
+        };
+    }
+
+    function _withoutIndex(iterator) {
+        return function (value, index, callback) {
+            return iterator(value, callback);
+        };
+    }
+
+    //// exported async module functions ////
+
+    //// nextTick implementation with browser-compatible fallback ////
+
+    // capture the global reference to guard against fakeTimer mocks
+    var _setImmediate = typeof setImmediate === 'function' && setImmediate;
+
+    var _delay = _setImmediate ? function(fn) {
+        // not a direct alias for IE10 compatibility
+        _setImmediate(fn);
+    } : function(fn) {
+        setTimeout(fn, 0);
+    };
+
+    if (typeof process === 'object' && typeof process.nextTick === 'function') {
+        async.nextTick = process.nextTick;
+    } else {
+        async.nextTick = _delay;
+    }
+    async.setImmediate = _setImmediate ? _delay : async.nextTick;
+
+
+    async.forEach =
+    async.each = function (arr, iterator, callback) {
+        return async.eachOf(arr, _withoutIndex(iterator), callback);
+    };
+
+    async.forEachSeries =
+    async.eachSeries = function (arr, iterator, callback) {
+        return async.eachOfSeries(arr, _withoutIndex(iterator), callback);
+    };
+
+
+    async.forEachLimit =
+    async.eachLimit = function (arr, limit, iterator, callback) {
+        return _eachOfLimit(limit)(arr, _withoutIndex(iterator), callback);
+    };
+
+    async.forEachOf =
+    async.eachOf = function (object, iterator, callback) {
+        callback = _once(callback || noop);
+        object = object || [];
+
+        var iter = _keyIterator(object);
+        var key, completed = 0;
+
+        while ((key = iter()) != null) {
+            completed += 1;
+            iterator(object[key], key, only_once(done));
+        }
+
+        if (completed === 0) callback(null);
+
+        function done(err) {
+            completed--;
+            if (err) {
+                callback(err);
+            }
+            // Check key is null in case iterator isn't exhausted
+            // and done resolved synchronously.
+            else if (key === null && completed <= 0) {
+                callback(null);
+            }
+        }
+    };
+
+    async.forEachOfSeries =
+    async.eachOfSeries = function (obj, iterator, callback) {
+        callback = _once(callback || noop);
+        obj = obj || [];
+        var nextKey = _keyIterator(obj);
+        var key = nextKey();
+        function iterate() {
+            var sync = true;
+            if (key === null) {
+                return callback(null);
+            }
+            iterator(obj[key], key, only_once(function (err) {
+                if (err) {
+                    callback(err);
+                }
+                else {
+                    key = nextKey();
+                    if (key === null) {
+                        return callback(null);
+                    } else {
+                        if (sync) {
+                            async.setImmediate(iterate);
+                        } else {
+                            iterate();
+                        }
+                    }
+                }
+            }));
+            sync = false;
+        }
+        iterate();
+    };
+
+
+
+    async.forEachOfLimit =
+    async.eachOfLimit = function (obj, limit, iterator, callback) {
+        _eachOfLimit(limit)(obj, iterator, callback);
+    };
+
+    function _eachOfLimit(limit) {
+
+        return function (obj, iterator, callback) {
+            callback = _once(callback || noop);
+            obj = obj || [];
+            var nextKey = _keyIterator(obj);
+            if (limit <= 0) {
+                return callback(null);
+            }
+            var done = false;
+            var running = 0;
+            var errored = false;
+
+            (function replenish () {
+                if (done && running <= 0) {
+                    return callback(null);
+                }
+
+                while (running < limit && !errored) {
+                    var key = nextKey();
+                    if (key === null) {
+                        done = true;
+                        if (running <= 0) {
+                            callback(null);
+                        }
+                        return;
+                    }
+                    running += 1;
+                    iterator(obj[key], key, only_once(function (err) {
+                        running -= 1;
+                        if (err) {
+                            callback(err);
+                            errored = true;
+                        }
+                        else {
+                            replenish();
+                        }
+                    }));
+                }
+            })();
+        };
+    }
+
+
+    function doParallel(fn) {
+        return function (obj, iterator, callback) {
+            return fn(async.eachOf, obj, iterator, callback);
+        };
+    }
+    function doParallelLimit(fn) {
+        return function (obj, limit, iterator, callback) {
+            return fn(_eachOfLimit(limit), obj, iterator, callback);
+        };
+    }
+    function doSeries(fn) {
+        return function (obj, iterator, callback) {
+            return fn(async.eachOfSeries, obj, iterator, callback);
+        };
+    }
+
+    function _asyncMap(eachfn, arr, iterator, callback) {
+        callback = _once(callback || noop);
+        arr = arr || [];
+        var results = _isArrayLike(arr) ? [] : {};
+        eachfn(arr, function (value, index, callback) {
+            iterator(value, function (err, v) {
+                results[index] = v;
+                callback(err);
+            });
+        }, function (err) {
+            callback(err, results);
+        });
+    }
+
+    async.map = doParallel(_asyncMap);
+    async.mapSeries = doSeries(_asyncMap);
+    async.mapLimit = doParallelLimit(_asyncMap);
+
+    // reduce only has a series version, as doing reduce in parallel won't
+    // work in many situations.
+    async.inject =
+    async.foldl =
+    async.reduce = function (arr, memo, iterator, callback) {
+        async.eachOfSeries(arr, function (x, i, callback) {
+            iterator(memo, x, function (err, v) {
+                memo = v;
+                callback(err);
+            });
+        }, function (err) {
+            callback(err, memo);
+        });
+    };
+
+    async.foldr =
+    async.reduceRight = function (arr, memo, iterator, callback) {
+        var reversed = _map(arr, identity).reverse();
+        async.reduce(reversed, memo, iterator, callback);
+    };
+
+    async.transform = function (arr, memo, iterator, callback) {
+        if (arguments.length === 3) {
+            callback = iterator;
+            iterator = memo;
+            memo = _isArray(arr) ? [] : {};
+        }
+
+        async.eachOf(arr, function(v, k, cb) {
+            iterator(memo, v, k, cb);
+        }, function(err) {
+            callback(err, memo);
+        });
+    };
+
+    function _filter(eachfn, arr, iterator, callback) {
+        var results = [];
+        eachfn(arr, function (x, index, callback) {
+            iterator(x, function (v) {
+                if (v) {
+                    results.push({index: index, value: x});
+                }
+                callback();
+            });
+        }, function () {
+            callback(_map(results.sort(function (a, b) {
+                return a.index - b.index;
+            }), function (x) {
+                return x.value;
+            }));
+        });
+    }
+
+    async.select =
+    async.filter = doParallel(_filter);
+
+    async.selectLimit =
+    async.filterLimit = doParallelLimit(_filter);
+
+    async.selectSeries =
+    async.filterSeries = doSeries(_filter);
+
+    function _reject(eachfn, arr, iterator, callback) {
+        _filter(eachfn, arr, function(value, cb) {
+            iterator(value, function(v) {
+                cb(!v);
+            });
+        }, callback);
+    }
+    async.reject = doParallel(_reject);
+    async.rejectLimit = doParallelLimit(_reject);
+    async.rejectSeries = doSeries(_reject);
+
+    function _createTester(eachfn, check, getResult) {
+        return function(arr, limit, iterator, cb) {
+            function done() {
+                if (cb) cb(getResult(false, void 0));
+            }
+            function iteratee(x, _, callback) {
+                if (!cb) return callback();
+                iterator(x, function (v) {
+                    if (cb && check(v)) {
+                        cb(getResult(true, x));
+                        cb = iterator = false;
+                    }
+                    callback();
+                });
+            }
+            if (arguments.length > 3) {
+                eachfn(arr, limit, iteratee, done);
+            } else {
+                cb = iterator;
+                iterator = limit;
+                eachfn(arr, iteratee, done);
+            }
+        };
+    }
+
+    async.any =
+    async.some = _createTester(async.eachOf, toBool, identity);
+
+    async.someLimit = _createTester(async.eachOfLimit, toBool, identity);
+
+    async.all =
+    async.every = _createTester(async.eachOf, notId, notId);
+
+    async.everyLimit = _createTester(async.eachOfLimit, notId, notId);
+
+    function _findGetResult(v, x) {
+        return x;
+    }
+    async.detect = _createTester(async.eachOf, identity, _findGetResult);
+    async.detectSeries = _createTester(async.eachOfSeries, identity, _findGetResult);
+    async.detectLimit = _createTester(async.eachOfLimit, identity, _findGetResult);
+
+    async.sortBy = function (arr, iterator, callback) {
+        async.map(arr, function (x, callback) {
+            iterator(x, function (err, criteria) {
+                if (err) {
+                    callback(err);
+                }
+                else {
+                    callback(null, {value: x, criteria: criteria});
+                }
+            });
+        }, function (err, results) {
+            if (err) {
+                return callback(err);
+            }
+            else {
+                callback(null, _map(results.sort(comparator), function (x) {
+                    return x.value;
+                }));
+            }
+
+        });
+
+        function comparator(left, right) {
+            var a = left.criteria, b = right.criteria;
+            return a < b ? -1 : a > b ? 1 : 0;
+        }
+    };
+
+    async.auto = function (tasks, concurrency, callback) {
+        if (typeof arguments[1] === 'function') {
+            // concurrency is optional, shift the args.
+            callback = concurrency;
+            concurrency = null;
+        }
+        callback = _once(callback || noop);
+        var keys = _keys(tasks);
+        var remainingTasks = keys.length;
+        if (!remainingTasks) {
+            return callback(null);
+        }
+        if (!concurrency) {
+            concurrency = remainingTasks;
+        }
+
+        var results = {};
+        var runningTasks = 0;
+
+        var hasError = false;
+
+        var listeners = [];
+        function addListener(fn) {
+            listeners.unshift(fn);
+        }
+        function removeListener(fn) {
+            var idx = _indexOf(listeners, fn);
+            if (idx >= 0) listeners.splice(idx, 1);
+        }
+        function taskComplete() {
+            remainingTasks--;
+            _arrayEach(listeners.slice(0), function (fn) {
+                fn();
+            });
+        }
+
+        addListener(function () {
+            if (!remainingTasks) {
+                callback(null, results);
+            }
+        });
+
+        _arrayEach(keys, function (k) {
+            if (hasError) return;
+            var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]];
+            var taskCallback = _restParam(function(err, args) {
+                runningTasks--;
+                if (args.length <= 1) {
+                    args = args[0];
+                }
+                if (err) {
+                    var safeResults = {};
+                    _forEachOf(results, function(val, rkey) {
+                        safeResults[rkey] = val;
+                    });
+                    safeResults[k] = args;
+                    hasError = true;
+
+                    callback(err, safeResults);
+                }
+                else {
+                    results[k] = args;
+                    async.setImmediate(taskComplete);
+                }
+            });
+            var requires = task.slice(0, task.length - 1);
+            // prevent dead-locks
+            var len = requires.length;
+            var dep;
+            while (len--) {
+                if (!(dep = tasks[requires[len]])) {
+                    throw new Error('Has nonexistent dependency in ' + requires.join(', '));
+                }
+                if (_isArray(dep) && _indexOf(dep, k) >= 0) {
+                    throw new Error('Has cyclic dependencies');
+                }
+            }
+            function ready() {
+                return runningTasks < concurrency && _reduce(requires, function (a, x) {
+                    return (a && results.hasOwnProperty(x));
+                }, true) && !results.hasOwnProperty(k);
+            }
+            if (ready()) {
+                runningTasks++;
+                task[task.length - 1](taskCallback, results);
+            }
+            else {
+                addListener(listener);
+            }
+            function listener() {
+                if (ready()) {
+                    runningTasks++;
+                    removeListener(listener);
+                    task[task.length - 1](taskCallback, results);
+                }
+            }
+        });
+    };
+
+
+
+    async.retry = function(times, task, callback) {
+        var DEFAULT_TIMES = 5;
+        var DEFAULT_INTERVAL = 0;
+
+        var attempts = [];
+
+        var opts = {
+            times: DEFAULT_TIMES,
+            interval: DEFAULT_INTERVAL
+        };
+
+        function parseTimes(acc, t){
+            if(typeof t === 'number'){
+                acc.times = parseInt(t, 10) || DEFAULT_TIMES;
+            } else if(typeof t === 'object'){
+                acc.times = parseInt(t.times, 10) || DEFAULT_TIMES;
+                acc.interval = parseInt(t.interval, 10) || DEFAULT_INTERVAL;
+            } else {
+                throw new Error('Unsupported argument type for \'times\': ' + typeof t);
+            }
+        }
+
+        var length = arguments.length;
+        if (length < 1 || length > 3) {
+            throw new Error('Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)');
+        } else if (length <= 2 && typeof times === 'function') {
+            callback = task;
+            task = times;
+        }
+        if (typeof times !== 'function') {
+            parseTimes(opts, times);
+        }
+        opts.callback = callback;
+        opts.task = task;
+
+        function wrappedTask(wrappedCallback, wrappedResults) {
+            function retryAttempt(task, finalAttempt) {
+                return function(seriesCallback) {
+                    task(function(err, result){
+                        seriesCallback(!err || finalAttempt, {err: err, result: result});
+                    }, wrappedResults);
+                };
+            }
+
+            function retryInterval(interval){
+                return function(seriesCallback){
+                    setTimeout(function(){
+                        seriesCallback(null);
+                    }, interval);
+                };
+            }
+
+            while (opts.times) {
+
+                var finalAttempt = !(opts.times-=1);
+                attempts.push(retryAttempt(opts.task, finalAttempt));
+                if(!finalAttempt && opts.interval > 0){
+                    attempts.push(retryInterval(opts.interval));
+                }
+            }
+
+            async.series(attempts, function(done, data){
+                data = data[data.length - 1];
+                (wrappedCallback || opts.callback)(data.err, data.result);
+            });
+        }
+
+        // If a callback is passed, run this as a controll flow
+        return opts.callback ? wrappedTask() : wrappedTask;
+    };
+
+    async.waterfall = function (tasks, callback) {
+        callback = _once(callback || noop);
+        if (!_isArray(tasks)) {
+            var err = new Error('First argument to waterfall must be an array of functions');
+            return callback(err);
+        }
+        if (!tasks.length) {
+            return callback();
+        }
+        function wrapIterator(iterator) {
+            return _restParam(function (err, args) {
+                if (err) {
+                    callback.apply(null, [err].concat(args));
+                }
+                else {
+                    var next = iterator.next();
+                    if (next) {
+                        args.push(wrapIterator(next));
+                    }
+                    else {
+                        args.push(callback);
+                    }
+                    ensureAsync(iterator).apply(null, args);
+                }
+            });
+        }
+        wrapIterator(async.iterator(tasks))();
+    };
+
+    function _parallel(eachfn, tasks, callback) {
+        callback = callback || noop;
+        var results = _isArrayLike(tasks) ? [] : {};
+
+        eachfn(tasks, function (task, key, callback) {
+            task(_restParam(function (err, args) {
+                if (args.length <= 1) {
+                    args = args[0];
+                }
+                results[key] = args;
+                callback(err);
+            }));
+        }, function (err) {
+            callback(err, results);
+        });
+    }
+
+    async.parallel = function (tasks, callback) {
+        _parallel(async.eachOf, tasks, callback);
+    };
+
+    async.parallelLimit = function(tasks, limit, callback) {
+        _parallel(_eachOfLimit(limit), tasks, callback);
+    };
+
+    async.series = function(tasks, callback) {
+        _parallel(async.eachOfSeries, tasks, callback);
+    };
+
+    async.iterator = function (tasks) {
+        function makeCallback(index) {
+            function fn() {
+                if (tasks.length) {
+                    tasks[index].apply(null, arguments);
+                }
+                return fn.next();
+            }
+            fn.next = function () {
+                return (index < tasks.length - 1) ? makeCallback(index + 1): null;
+            };
+            return fn;
+        }
+        return makeCallback(0);
+    };
+
+    async.apply = _restParam(function (fn, args) {
+        return _restParam(function (callArgs) {
+            return fn.apply(
+                null, args.concat(callArgs)
+            );
+        });
+    });
+
+    function _concat(eachfn, arr, fn, callback) {
+        var result = [];
+        eachfn(arr, function (x, index, cb) {
+            fn(x, function (err, y) {
+                result = result.concat(y || []);
+                cb(err);
+            });
+        }, function (err) {
+            callback(err, result);
+        });
+    }
+    async.concat = doParallel(_concat);
+    async.concatSeries = doSeries(_concat);
+
+    async.whilst = function (test, iterator, callback) {
+        callback = callback || noop;
+        if (test()) {
+            var next = _restParam(function(err, args) {
+                if (err) {
+                    callback(err);
+                } else if (test.apply(this, args)) {
+                    iterator(next);
+                } else {
+                    callback.apply(null, [null].concat(args));
+                }
+            });
+            iterator(next);
+        } else {
+            callback(null);
+        }
+    };
+
+    async.doWhilst = function (iterator, test, callback) {
+        var calls = 0;
+        return async.whilst(function() {
+            return ++calls <= 1 || test.apply(this, arguments);
+        }, iterator, callback);
+    };
+
+    async.until = function (test, iterator, callback) {
+        return async.whilst(function() {
+            return !test.apply(this, arguments);
+        }, iterator, callback);
+    };
+
+    async.doUntil = function (iterator, test, callback) {
+        return async.doWhilst(iterator, function() {
+            return !test.apply(this, arguments);
+        }, callback);
+    };
+
+    async.during = function (test, iterator, callback) {
+        callback = callback || noop;
+
+        var next = _restParam(function(err, args) {
+            if (err) {
+                callback(err);
+            } else {
+                args.push(check);
+                test.apply(this, args);
+            }
+        });
+
+        var check = function(err, truth) {
+            if (err) {
+                callback(err);
+            } else if (truth) {
+                iterator(next);
+            } else {
+                callback(null);
+            }
+        };
+
+        test(check);
+    };
+
+    async.doDuring = function (iterator, test, callback) {
+        var calls = 0;
+        async.during(function(next) {
+            if (calls++ < 1) {
+                next(null, true);
+            } else {
+                test.apply(this, arguments);
+            }
+        }, iterator, callback);
+    };
+
+    function _queue(worker, concurrency, payload) {
+        if (concurrency == null) {
+            concurrency = 1;
+        }
+        else if(concurrency === 0) {
+            throw new Error('Concurrency must not be zero');
+        }
+        function _insert(q, data, pos, callback) {
+            if (callback != null && typeof callback !== "function") {
+                throw new Error("task callback must be a function");
+            }
+            q.started = true;
+            if (!_isArray(data)) {
+                data = [data];
+            }
+            if(data.length === 0 && q.idle()) {
+                // call drain immediately if there are no tasks
+                return async.setImmediate(function() {
+                    q.drain();
+                });
+            }
+            _arrayEach(data, function(task) {
+                var item = {
+                    data: task,
+                    callback: callback || noop
+                };
+
+                if (pos) {
+                    q.tasks.unshift(item);
+                } else {
+                    q.tasks.push(item);
+                }
+
+                if (q.tasks.length === q.concurrency) {
+                    q.saturated();
+                }
+            });
+            async.setImmediate(q.process);
+        }
+        function _next(q, tasks) {
+            return function(){
+                workers -= 1;
+
+                var removed = false;
+                var args = arguments;
+                _arrayEach(tasks, function (task) {
+                    _arrayEach(workersList, function (worker, index) {
+                        if (worker === task && !removed) {
+                            workersList.splice(index, 1);
+                            removed = true;
+                        }
+                    });
+
+                    task.callback.apply(task, args);
+                });
+                if (q.tasks.length + workers === 0) {
+                    q.drain();
+                }
+                q.process();
+            };
+        }
+
+        var workers = 0;
+        var workersList = [];
+        var q = {
+            tasks: [],
+            concurrency: concurrency,
+            payload: payload,
+            saturated: noop,
+            empty: noop,
+            drain: noop,
+            started: false,
+            paused: false,
+            push: function (data, callback) {
+                _insert(q, data, false, callback);
+            },
+            kill: function () {
+                q.drain = noop;
+                q.tasks = [];
+            },
+            unshift: function (data, callback) {
+                _insert(q, data, true, callback);
+            },
+            process: function () {
+                while(!q.paused && workers < q.concurrency && q.tasks.length){
+
+                    var tasks = q.payload ?
+                        q.tasks.splice(0, q.payload) :
+                        q.tasks.splice(0, q.tasks.length);
+
+                    var data = _map(tasks, function (task) {
+                        return task.data;
+                    });
+
+                    if (q.tasks.length === 0) {
+                        q.empty();
+                    }
+                    workers += 1;
+                    workersList.push(tasks[0]);
+                    var cb = only_once(_next(q, tasks));
+                    worker(data, cb);
+                }
+            },
+            length: function () {
+                return q.tasks.length;
+            },
+            running: function () {
+                return workers;
+            },
+            workersList: function () {
+                return workersList;
+            },
+            idle: function() {
+                return q.tasks.length + workers === 0;
+            },
+            pause: function () {
+                q.paused = true;
+            },
+            resume: function () {
+                if (q.paused === false) { return; }
+                q.paused = false;
+                var resumeCount = Math.min(q.concurrency, q.tasks.length);
+                // Need to call q.process once per concurrent
+                // worker to preserve full concurrency after pause
+                for (var w = 1; w <= resumeCount; w++) {
+                    async.setImmediate(q.process);
+                }
+            }
+        };
+        return q;
+    }
+
+    async.queue = function (worker, concurrency) {
+        var q = _queue(function (items, cb) {
+            worker(items[0], cb);
+        }, concurrency, 1);
+
+        return q;
+    };
+
+    async.priorityQueue = function (worker, concurrency) {
+
+        function _compareTasks(a, b){
+            return a.priority - b.priority;
+        }
+
+        function _binarySearch(sequence, item, compare) {
+            var beg = -1,
+                end = sequence.length - 1;
+            while (beg < end) {
+                var mid = beg + ((end - beg + 1) >>> 1);
+                if (compare(item, sequence[mid]) >= 0) {
+                    beg = mid;
+                } else {
+                    end = mid - 1;
+                }
+            }
+            return beg;
+        }
+
+        function _insert(q, data, priority, callback) {
+            if (callback != null && typeof callback !== "function") {
+                throw new Error("task callback must be a function");
+            }
+            q.started = true;
+            if (!_isArray(data)) {
+                data = [data];
+            }
+            if(data.length === 0) {
+                // call drain immediately if there are no tasks
+                return async.setImmediate(function() {
+                    q.drain();
+                });
+            }
+            _arrayEach(data, function(task) {
+                var item = {
+                    data: task,
+                    priority: priority,
+                    callback: typeof callback === 'function' ? callback : noop
+                };
+
+                q.tasks.splice(_binarySearch(q.tasks, item, _compareTasks) + 1, 0, item);
+
+                if (q.tasks.length === q.concurrency) {
+                    q.saturated();
+                }
+                async.setImmediate(q.process);
+            });
+        }
+
+        // Start with a normal queue
+        var q = async.queue(worker, concurrency);
+
+        // Override push to accept second parameter representing priority
+        q.push = function (data, priority, callback) {
+            _insert(q, data, priority, callback);
+        };
+
+        // Remove unshift function
+        delete q.unshift;
+
+        return q;
+    };
+
+    async.cargo = function (worker, payload) {
+        return _queue(worker, 1, payload);
+    };
+
+    function _console_fn(name) {
+        return _restParam(function (fn, args) {
+            fn.apply(null, args.concat([_restParam(function (err, args) {
+                if (typeof console === 'object') {
+                    if (err) {
+                        if (console.error) {
+                            console.error(err);
+                        }
+                    }
+                    else if (console[name]) {
+                        _arrayEach(args, function (x) {
+                            console[name](x);
+                        });
+                    }
+                }
+            })]));
+        });
+    }
+    async.log = _console_fn('log');
+    async.dir = _console_fn('dir');
+    /*async.info = _console_fn('info');
+    async.warn = _console_fn('warn');
+    async.error = _console_fn('error');*/
+
+    async.memoize = function (fn, hasher) {
+        var memo = {};
+        var queues = {};
+        var has = Object.prototype.hasOwnProperty;
+        hasher = hasher || identity;
+        var memoized = _restParam(function memoized(args) {
+            var callback = args.pop();
+            var key = hasher.apply(null, args);
+            if (has.call(memo, key)) {   
+                async.setImmediate(function () {
+                    callback.apply(null, memo[key]);
+                });
+            }
+            else if (has.call(queues, key)) {
+                queues[key].push(callback);
+            }
+            else {
+                queues[key] = [callback];
+                fn.apply(null, args.concat([_restParam(function (args) {
+                    memo[key] = args;
+                    var q = queues[key];
+                    delete queues[key];
+                    for (var i = 0, l = q.length; i < l; i++) {
+                        q[i].apply(null, args);
+                    }
+                })]));
+            }
+        });
+        memoized.memo = memo;
+        memoized.unmemoized = fn;
+        return memoized;
+    };
+
+    async.unmemoize = function (fn) {
+        return function () {
+            return (fn.unmemoized || fn).apply(null, arguments);
+        };
+    };
+
+    function _times(mapper) {
+        return function (count, iterator, callback) {
+            mapper(_range(count), iterator, callback);
+        };
+    }
+
+    async.times = _times(async.map);
+    async.timesSeries = _times(async.mapSeries);
+    async.timesLimit = function (count, limit, iterator, callback) {
+        return async.mapLimit(_range(count), limit, iterator, callback);
+    };
+
+    async.seq = function (/* functions... */) {
+        var fns = arguments;
+        return _restParam(function (args) {
+            var that = this;
+
+            var callback = args[args.length - 1];
+            if (typeof callback == 'function') {
+                args.pop();
+            } else {
+                callback = noop;
+            }
+
+            async.reduce(fns, args, function (newargs, fn, cb) {
+                fn.apply(that, newargs.concat([_restParam(function (err, nextargs) {
+                    cb(err, nextargs);
+                })]));
+            },
+            function (err, results) {
+                callback.apply(that, [err].concat(results));
+            });
+        });
+    };
+
+    async.compose = function (/* functions... */) {
+        return async.seq.apply(null, Array.prototype.reverse.call(arguments));
+    };
+
+
+    function _applyEach(eachfn) {
+        return _restParam(function(fns, args) {
+            var go = _restParam(function(args) {
+                var that = this;
+                var callback = args.pop();
+                return eachfn(fns, function (fn, _, cb) {
+                    fn.apply(that, args.concat([cb]));
+                },
+                callback);
+            });
+            if (args.length) {
+                return go.apply(this, args);
+            }
+            else {
+                return go;
+            }
+        });
+    }
+
+    async.applyEach = _applyEach(async.eachOf);
+    async.applyEachSeries = _applyEach(async.eachOfSeries);
+
+
+    async.forever = function (fn, callback) {
+        var done = only_once(callback || noop);
+        var task = ensureAsync(fn);
+        function next(err) {
+            if (err) {
+                return done(err);
+            }
+            task(next);
+        }
+        next();
+    };
+
+    function ensureAsync(fn) {
+        return _restParam(function (args) {
+            var callback = args.pop();
+            args.push(function () {
+                var innerArgs = arguments;
+                if (sync) {
+                    async.setImmediate(function () {
+                        callback.apply(null, innerArgs);
+                    });
+                } else {
+                    callback.apply(null, innerArgs);
+                }
+            });
+            var sync = true;
+            fn.apply(this, args);
+            sync = false;
+        });
+    }
+
+    async.ensureAsync = ensureAsync;
+
+    async.constant = _restParam(function(values) {
+        var args = [null].concat(values);
+        return function (callback) {
+            return callback.apply(this, args);
+        };
+    });
+
+    async.wrapSync =
+    async.asyncify = function asyncify(func) {
+        return _restParam(function (args) {
+            var callback = args.pop();
+            var result;
+            try {
+                result = func.apply(this, args);
+            } catch (e) {
+                return callback(e);
+            }
+            // if result is Promise object
+            if (_isObject(result) && typeof result.then === "function") {
+                result.then(function(value) {
+                    callback(null, value);
+                })["catch"](function(err) {
+                    callback(err.message ? err : new Error(err));
+                });
+            } else {
+                callback(null, result);
+            }
+        });
+    };
+
+    // Node.js
+    if (typeof module === 'object' && module.exports) {
+        module.exports = async;
+    }
+    // AMD / RequireJS
+    else if (typeof define === 'function' && define.amd) {
+        define([], function () {
+            return async;
+        });
+    }
+    // included directly via <script> tag
+    else {
+        root.async = async;
+    }
+
+}());
diff --git a/wrt/node_modules/async/package.json b/wrt/node_modules/async/package.json
new file mode 100644 (file)
index 0000000..ca00513
--- /dev/null
@@ -0,0 +1,114 @@
+{
+  "_from": "async@^1.4.2",
+  "_id": "async@1.5.2",
+  "_inBundle": false,
+  "_integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=",
+  "_location": "/async",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "async@^1.4.2",
+    "name": "async",
+    "escapedName": "async",
+    "rawSpec": "^1.4.2",
+    "saveSpec": null,
+    "fetchSpec": "^1.4.2"
+  },
+  "_requiredBy": [
+    "#DEV:/",
+    "/fs-plus"
+  ],
+  "_resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz",
+  "_shasum": "ec6a61ae56480c0c3cb241c95618e20892f9672a",
+  "_spec": "async@^1.4.2",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was",
+  "author": {
+    "name": "Caolan McMahon"
+  },
+  "bugs": {
+    "url": "https://github.com/caolan/async/issues"
+  },
+  "bundleDependencies": false,
+  "deprecated": false,
+  "description": "Higher-order functions and common patterns for asynchronous code",
+  "devDependencies": {
+    "benchmark": "github:bestiejs/benchmark.js",
+    "bluebird": "^2.9.32",
+    "chai": "^3.1.0",
+    "coveralls": "^2.11.2",
+    "es6-promise": "^2.3.0",
+    "jscs": "^1.13.1",
+    "jshint": "~2.8.0",
+    "karma": "^0.13.2",
+    "karma-browserify": "^4.2.1",
+    "karma-firefox-launcher": "^0.1.6",
+    "karma-mocha": "^0.2.0",
+    "karma-mocha-reporter": "^1.0.2",
+    "lodash": "^3.9.0",
+    "mkdirp": "~0.5.1",
+    "mocha": "^2.2.5",
+    "native-promise-only": "^0.8.0-a",
+    "nodeunit": ">0.0.0",
+    "nyc": "^2.1.0",
+    "rsvp": "^3.0.18",
+    "semver": "^4.3.6",
+    "uglify-js": "~2.4.0",
+    "xyz": "^0.5.0",
+    "yargs": "~3.9.1"
+  },
+  "files": [
+    "lib",
+    "dist/async.js",
+    "dist/async.min.js"
+  ],
+  "homepage": "https://github.com/caolan/async#readme",
+  "jam": {
+    "main": "lib/async.js",
+    "include": [
+      "lib/async.js",
+      "README.md",
+      "LICENSE"
+    ],
+    "categories": [
+      "Utilities"
+    ]
+  },
+  "keywords": [
+    "async",
+    "callback",
+    "utility",
+    "module"
+  ],
+  "license": "MIT",
+  "main": "lib/async.js",
+  "name": "async",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/caolan/async.git"
+  },
+  "scripts": {
+    "coverage": "nyc npm test && nyc report",
+    "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls",
+    "lint": "jshint lib/*.js test/*.js perf/*.js && jscs lib/*.js test/*.js perf/*.js",
+    "mocha-browser-test": "karma start",
+    "mocha-node-test": "mocha mocha_test/",
+    "mocha-test": "npm run mocha-node-test && npm run mocha-browser-test",
+    "nodeunit-test": "nodeunit test/test-async.js",
+    "test": "npm run-script lint && npm run nodeunit-test && npm run mocha-test"
+  },
+  "spm": {
+    "main": "lib/async.js"
+  },
+  "version": "1.5.2",
+  "volo": {
+    "main": "lib/async.js",
+    "ignore": [
+      "**/.*",
+      "node_modules",
+      "bower_components",
+      "test",
+      "tests"
+    ]
+  }
+}
diff --git a/wrt/node_modules/backo2/.npmignore b/wrt/node_modules/backo2/.npmignore
new file mode 100644 (file)
index 0000000..c2658d7
--- /dev/null
@@ -0,0 +1 @@
+node_modules/
diff --git a/wrt/node_modules/backo2/History.md b/wrt/node_modules/backo2/History.md
new file mode 100644 (file)
index 0000000..8eb28b8
--- /dev/null
@@ -0,0 +1,12 @@
+
+1.0.1 / 2014-02-17
+==================
+
+ * go away decimal point
+ * history
+
+1.0.0 / 2014-02-17
+==================
+
+ * add jitter option
+ * Initial commit
diff --git a/wrt/node_modules/backo2/Makefile b/wrt/node_modules/backo2/Makefile
new file mode 100644 (file)
index 0000000..9987df8
--- /dev/null
@@ -0,0 +1,8 @@
+
+test:
+       @./node_modules/.bin/mocha \
+               --require should \
+               --reporter dot \
+               --bail
+
+.PHONY: test
\ No newline at end of file
diff --git a/wrt/node_modules/backo2/Readme.md b/wrt/node_modules/backo2/Readme.md
new file mode 100644 (file)
index 0000000..0df2a39
--- /dev/null
@@ -0,0 +1,34 @@
+# backo
+
+  Simple exponential backoff because the others seem to have weird abstractions.
+
+## Installation
+
+```
+$ npm install backo
+```
+
+## Options
+
+ - `min` initial timeout in milliseconds [100]
+ - `max` max timeout [10000]
+ - `jitter` [0]
+ - `factor` [2]
+
+## Example
+
+```js
+var Backoff = require('backo');
+var backoff = new Backoff({ min: 100, max: 20000 });
+
+setTimeout(function(){
+  something.reconnect();
+}, backoff.duration());
+
+// later when something works
+backoff.reset()
+```
+
+# License
+
+  MIT
diff --git a/wrt/node_modules/backo2/component.json b/wrt/node_modules/backo2/component.json
new file mode 100644 (file)
index 0000000..994845a
--- /dev/null
@@ -0,0 +1,11 @@
+{
+  "name": "backo",
+  "repo": "segmentio/backo",
+  "dependencies": {},
+  "version": "1.0.1",
+  "description": "simple backoff without the weird abstractions",
+  "keywords": ["backoff"],
+  "license": "MIT",
+  "scripts": ["index.js"],
+  "main": "index.js"
+}
diff --git a/wrt/node_modules/backo2/index.js b/wrt/node_modules/backo2/index.js
new file mode 100644 (file)
index 0000000..fac4429
--- /dev/null
@@ -0,0 +1,85 @@
+
+/**
+ * Expose `Backoff`.
+ */
+
+module.exports = Backoff;
+
+/**
+ * Initialize backoff timer with `opts`.
+ *
+ * - `min` initial timeout in milliseconds [100]
+ * - `max` max timeout [10000]
+ * - `jitter` [0]
+ * - `factor` [2]
+ *
+ * @param {Object} opts
+ * @api public
+ */
+
+function Backoff(opts) {
+  opts = opts || {};
+  this.ms = opts.min || 100;
+  this.max = opts.max || 10000;
+  this.factor = opts.factor || 2;
+  this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;
+  this.attempts = 0;
+}
+
+/**
+ * Return the backoff duration.
+ *
+ * @return {Number}
+ * @api public
+ */
+
+Backoff.prototype.duration = function(){
+  var ms = this.ms * Math.pow(this.factor, this.attempts++);
+  if (this.jitter) {
+    var rand =  Math.random();
+    var deviation = Math.floor(rand * this.jitter * ms);
+    ms = (Math.floor(rand * 10) & 1) == 0  ? ms - deviation : ms + deviation;
+  }
+  return Math.min(ms, this.max) | 0;
+};
+
+/**
+ * Reset the number of attempts.
+ *
+ * @api public
+ */
+
+Backoff.prototype.reset = function(){
+  this.attempts = 0;
+};
+
+/**
+ * Set the minimum duration
+ *
+ * @api public
+ */
+
+Backoff.prototype.setMin = function(min){
+  this.ms = min;
+};
+
+/**
+ * Set the maximum duration
+ *
+ * @api public
+ */
+
+Backoff.prototype.setMax = function(max){
+  this.max = max;
+};
+
+/**
+ * Set the jitter
+ *
+ * @api public
+ */
+
+Backoff.prototype.setJitter = function(jitter){
+  this.jitter = jitter;
+};
+
diff --git a/wrt/node_modules/backo2/package.json b/wrt/node_modules/backo2/package.json
new file mode 100644 (file)
index 0000000..70b13b2
--- /dev/null
@@ -0,0 +1,78 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "backo2@1.0.2",
+        "scope": null,
+        "escapedName": "backo2",
+        "name": "backo2",
+        "rawSpec": "1.0.2",
+        "spec": "1.0.2",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io-client"
+    ]
+  ],
+  "_from": "backo2@1.0.2",
+  "_id": "backo2@1.0.2",
+  "_inCache": true,
+  "_location": "/backo2",
+  "_npmUser": {
+    "name": "mokesmokes",
+    "email": "mokesmokes@gmail.com"
+  },
+  "_npmVersion": "1.4.28",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "backo2@1.0.2",
+    "scope": null,
+    "escapedName": "backo2",
+    "name": "backo2",
+    "rawSpec": "1.0.2",
+    "spec": "1.0.2",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/socket.io-client"
+  ],
+  "_resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz",
+  "_shasum": "31ab1ac8b129363463e35b3ebb69f4dfcfba7947",
+  "_shrinkwrap": null,
+  "_spec": "backo2@1.0.2",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io-client",
+  "bugs": {
+    "url": "https://github.com/mokesmokes/backo/issues"
+  },
+  "dependencies": {},
+  "description": "simple backoff based on segmentio/backo",
+  "devDependencies": {
+    "mocha": "*",
+    "should": "*"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "31ab1ac8b129363463e35b3ebb69f4dfcfba7947",
+    "tarball": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz"
+  },
+  "gitHead": "3e695bade7756fef2295e8883bf3570a06e5d9ec",
+  "homepage": "https://github.com/mokesmokes/backo",
+  "keywords": [
+    "backoff"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "mokesmokes",
+      "email": "mokesmokes@gmail.com"
+    }
+  ],
+  "name": "backo2",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/mokesmokes/backo.git"
+  },
+  "scripts": {},
+  "version": "1.0.2"
+}
diff --git a/wrt/node_modules/backo2/test/index.js b/wrt/node_modules/backo2/test/index.js
new file mode 100644 (file)
index 0000000..ea1f6de
--- /dev/null
@@ -0,0 +1,18 @@
+
+var Backoff = require('..');
+var assert = require('assert');
+
+describe('.duration()', function(){
+  it('should increase the backoff', function(){
+    var b = new Backoff;
+
+    assert(100 == b.duration());
+    assert(200 == b.duration());
+    assert(400 == b.duration());
+    assert(800 == b.duration());
+
+    b.reset();
+    assert(100 == b.duration());
+    assert(200 == b.duration());
+  })
+})
\ No newline at end of file
diff --git a/wrt/node_modules/balanced-match/.npmignore b/wrt/node_modules/balanced-match/.npmignore
new file mode 100644 (file)
index 0000000..ae5d8c3
--- /dev/null
@@ -0,0 +1,5 @@
+test
+.gitignore
+.travis.yml
+Makefile
+example.js
diff --git a/wrt/node_modules/balanced-match/LICENSE.md b/wrt/node_modules/balanced-match/LICENSE.md
new file mode 100644 (file)
index 0000000..2cdc8e4
--- /dev/null
@@ -0,0 +1,21 @@
+(MIT)
+
+Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/wrt/node_modules/balanced-match/README.md b/wrt/node_modules/balanced-match/README.md
new file mode 100644 (file)
index 0000000..08e918c
--- /dev/null
@@ -0,0 +1,91 @@
+# balanced-match
+
+Match balanced string pairs, like `{` and `}` or `<b>` and `</b>`. Supports regular expressions as well!
+
+[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match)
+[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match)
+
+[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match)
+
+## Example
+
+Get the first matching pair of braces:
+
+```js
+var balanced = require('balanced-match');
+
+console.log(balanced('{', '}', 'pre{in{nested}}post'));
+console.log(balanced('{', '}', 'pre{first}between{second}post'));
+console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre  {   in{nest}   }  post'));
+```
+
+The matches are:
+
+```bash
+$ node example.js
+{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' }
+{ start: 3,
+  end: 9,
+  pre: 'pre',
+  body: 'first',
+  post: 'between{second}post' }
+{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' }
+```
+
+## API
+
+### var m = balanced(a, b, str)
+
+For the first non-nested matching pair of `a` and `b` in `str`, return an
+object with those keys:
+
+* **start** the index of the first match of `a`
+* **end** the index of the matching `b`
+* **pre** the preamble, `a` and `b` not included
+* **body** the match, `a` and `b` not included
+* **post** the postscript, `a` and `b` not included
+
+If there's no match, `undefined` will be returned.
+
+If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`.
+
+### var r = balanced.range(a, b, str)
+
+For the first non-nested matching pair of `a` and `b` in `str`, return an
+array with indexes: `[ <a index>, <b index> ]`.
+
+If there's no match, `undefined` will be returned.
+
+If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`.
+
+## Installation
+
+With [npm](https://npmjs.org) do:
+
+```bash
+npm install balanced-match
+```
+
+## License
+
+(MIT)
+
+Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/wrt/node_modules/balanced-match/index.js b/wrt/node_modules/balanced-match/index.js
new file mode 100644 (file)
index 0000000..1685a76
--- /dev/null
@@ -0,0 +1,59 @@
+'use strict';
+module.exports = balanced;
+function balanced(a, b, str) {
+  if (a instanceof RegExp) a = maybeMatch(a, str);
+  if (b instanceof RegExp) b = maybeMatch(b, str);
+
+  var r = range(a, b, str);
+
+  return r && {
+    start: r[0],
+    end: r[1],
+    pre: str.slice(0, r[0]),
+    body: str.slice(r[0] + a.length, r[1]),
+    post: str.slice(r[1] + b.length)
+  };
+}
+
+function maybeMatch(reg, str) {
+  var m = str.match(reg);
+  return m ? m[0] : null;
+}
+
+balanced.range = range;
+function range(a, b, str) {
+  var begs, beg, left, right, result;
+  var ai = str.indexOf(a);
+  var bi = str.indexOf(b, ai + 1);
+  var i = ai;
+
+  if (ai >= 0 && bi > 0) {
+    begs = [];
+    left = str.length;
+
+    while (i >= 0 && !result) {
+      if (i == ai) {
+        begs.push(i);
+        ai = str.indexOf(a, i + 1);
+      } else if (begs.length == 1) {
+        result = [ begs.pop(), bi ];
+      } else {
+        beg = begs.pop();
+        if (beg < left) {
+          left = beg;
+          right = bi;
+        }
+
+        bi = str.indexOf(b, i + 1);
+      }
+
+      i = ai < bi && ai >= 0 ? ai : bi;
+    }
+
+    if (begs.length) {
+      result = [ left, right ];
+    }
+  }
+
+  return result;
+}
diff --git a/wrt/node_modules/balanced-match/package.json b/wrt/node_modules/balanced-match/package.json
new file mode 100644 (file)
index 0000000..2154caf
--- /dev/null
@@ -0,0 +1,77 @@
+{
+  "_from": "balanced-match@^1.0.0",
+  "_id": "balanced-match@1.0.0",
+  "_inBundle": false,
+  "_integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
+  "_location": "/balanced-match",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "balanced-match@^1.0.0",
+    "name": "balanced-match",
+    "escapedName": "balanced-match",
+    "rawSpec": "^1.0.0",
+    "saveSpec": null,
+    "fetchSpec": "^1.0.0"
+  },
+  "_requiredBy": [
+    "/brace-expansion"
+  ],
+  "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
+  "_shasum": "89b4d199ab2bee49de164ea02b89ce462d71b767",
+  "_spec": "balanced-match@^1.0.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was/node_modules/brace-expansion",
+  "author": {
+    "name": "Julian Gruber",
+    "email": "mail@juliangruber.com",
+    "url": "http://juliangruber.com"
+  },
+  "bugs": {
+    "url": "https://github.com/juliangruber/balanced-match/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {},
+  "deprecated": false,
+  "description": "Match balanced character pairs, like \"{\" and \"}\"",
+  "devDependencies": {
+    "matcha": "^0.7.0",
+    "tape": "^4.6.0"
+  },
+  "homepage": "https://github.com/juliangruber/balanced-match",
+  "keywords": [
+    "match",
+    "regexp",
+    "test",
+    "balanced",
+    "parse"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "name": "balanced-match",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/juliangruber/balanced-match.git"
+  },
+  "scripts": {
+    "bench": "make bench",
+    "test": "make test"
+  },
+  "testling": {
+    "files": "test/*.js",
+    "browsers": [
+      "ie/8..latest",
+      "firefox/20..latest",
+      "firefox/nightly",
+      "chrome/25..latest",
+      "chrome/canary",
+      "opera/12..latest",
+      "opera/next",
+      "safari/5.1..latest",
+      "ipad/6.0..latest",
+      "iphone/6.0..latest",
+      "android-browser/4.2..latest"
+    ]
+  },
+  "version": "1.0.0"
+}
diff --git a/wrt/node_modules/base64-arraybuffer/.npmignore b/wrt/node_modules/base64-arraybuffer/.npmignore
new file mode 100644 (file)
index 0000000..332ee5a
--- /dev/null
@@ -0,0 +1,3 @@
+/node_modules/
+Gruntfile.js
+/test/
diff --git a/wrt/node_modules/base64-arraybuffer/.travis.yml b/wrt/node_modules/base64-arraybuffer/.travis.yml
new file mode 100644 (file)
index 0000000..19259a5
--- /dev/null
@@ -0,0 +1,19 @@
+language: node_js
+node_js:
+- '0.12'
+- iojs-1
+- iojs-2
+- iojs-3
+- '4.1'
+before_script:
+- npm install
+before_install: npm install -g npm@'>=2.13.5'
+deploy:
+  provider: npm
+  email: niklasvh@gmail.com
+  api_key:
+    secure: oHV9ArprTj5WOk7MP1UF7QMJ70huXw+y7xXb5wF4+V2H8Hyfa5TfE0DiOmqrube1WXTeH1FLgq54shp/sJWi47Hkg/GyeoB5NnsPhYEaJkaON9UG5blML+ODiNVsEnq/1kNBQ8e0+0JItMPLGySKyFmuZ3yflulXKS8O88mfINo=
+  on:
+    tags: true
+    branch: master
+    repo: niklasvh/base64-arraybuffer
diff --git a/wrt/node_modules/base64-arraybuffer/LICENSE-MIT b/wrt/node_modules/base64-arraybuffer/LICENSE-MIT
new file mode 100644 (file)
index 0000000..ed27b41
--- /dev/null
@@ -0,0 +1,22 @@
+Copyright (c) 2012 Niklas von Hertzen
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/base64-arraybuffer/README.md b/wrt/node_modules/base64-arraybuffer/README.md
new file mode 100644 (file)
index 0000000..50009e4
--- /dev/null
@@ -0,0 +1,20 @@
+# base64-arraybuffer
+
+[![Build Status](https://travis-ci.org/niklasvh/base64-arraybuffer.png)](https://travis-ci.org/niklasvh/base64-arraybuffer)
+[![NPM Downloads](https://img.shields.io/npm/dm/base64-arraybuffer.svg)](https://www.npmjs.org/package/base64-arraybuffer)
+[![NPM Version](https://img.shields.io/npm/v/base64-arraybuffer.svg)](https://www.npmjs.org/package/base64-arraybuffer)
+
+Encode/decode base64 data into ArrayBuffers
+
+## Getting Started
+Install the module with: `npm install base64-arraybuffer`
+
+## API
+The library encodes and decodes base64 to and from ArrayBuffers
+
+ - __encode(buffer)__ - Encodes `ArrayBuffer` into base64 string
+ - __decode(str)__ - Decodes base64 string to `ArrayBuffer`
+
+## License
+Copyright (c) 2012 Niklas von Hertzen
+Licensed under the MIT license.
diff --git a/wrt/node_modules/base64-arraybuffer/lib/base64-arraybuffer.js b/wrt/node_modules/base64-arraybuffer/lib/base64-arraybuffer.js
new file mode 100644 (file)
index 0000000..e6b6306
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * base64-arraybuffer
+ * https://github.com/niklasvh/base64-arraybuffer
+ *
+ * Copyright (c) 2012 Niklas von Hertzen
+ * Licensed under the MIT license.
+ */
+(function(){
+  "use strict";
+
+  var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+
+  // Use a lookup table to find the index.
+  var lookup = new Uint8Array(256);
+  for (var i = 0; i < chars.length; i++) {
+    lookup[chars.charCodeAt(i)] = i;
+  }
+
+  exports.encode = function(arraybuffer) {
+    var bytes = new Uint8Array(arraybuffer),
+    i, len = bytes.length, base64 = "";
+
+    for (i = 0; i < len; i+=3) {
+      base64 += chars[bytes[i] >> 2];
+      base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];
+      base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];
+      base64 += chars[bytes[i + 2] & 63];
+    }
+
+    if ((len % 3) === 2) {
+      base64 = base64.substring(0, base64.length - 1) + "=";
+    } else if (len % 3 === 1) {
+      base64 = base64.substring(0, base64.length - 2) + "==";
+    }
+
+    return base64;
+  };
+
+  exports.decode =  function(base64) {
+    var bufferLength = base64.length * 0.75,
+    len = base64.length, i, p = 0,
+    encoded1, encoded2, encoded3, encoded4;
+
+    if (base64[base64.length - 1] === "=") {
+      bufferLength--;
+      if (base64[base64.length - 2] === "=") {
+        bufferLength--;
+      }
+    }
+
+    var arraybuffer = new ArrayBuffer(bufferLength),
+    bytes = new Uint8Array(arraybuffer);
+
+    for (i = 0; i < len; i+=4) {
+      encoded1 = lookup[base64.charCodeAt(i)];
+      encoded2 = lookup[base64.charCodeAt(i+1)];
+      encoded3 = lookup[base64.charCodeAt(i+2)];
+      encoded4 = lookup[base64.charCodeAt(i+3)];
+
+      bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);
+      bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);
+      bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);
+    }
+
+    return arraybuffer;
+  };
+})();
diff --git a/wrt/node_modules/base64-arraybuffer/package.json b/wrt/node_modules/base64-arraybuffer/package.json
new file mode 100644 (file)
index 0000000..4d70762
--- /dev/null
@@ -0,0 +1,97 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "base64-arraybuffer@0.1.5",
+        "scope": null,
+        "escapedName": "base64-arraybuffer",
+        "name": "base64-arraybuffer",
+        "rawSpec": "0.1.5",
+        "spec": "0.1.5",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io-parser"
+    ]
+  ],
+  "_from": "base64-arraybuffer@0.1.5",
+  "_id": "base64-arraybuffer@0.1.5",
+  "_inCache": true,
+  "_location": "/base64-arraybuffer",
+  "_nodeVersion": "2.5.0",
+  "_npmUser": {
+    "name": "niklasvh",
+    "email": "niklasvh@gmail.com"
+  },
+  "_npmVersion": "3.4.0",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "base64-arraybuffer@0.1.5",
+    "scope": null,
+    "escapedName": "base64-arraybuffer",
+    "name": "base64-arraybuffer",
+    "rawSpec": "0.1.5",
+    "spec": "0.1.5",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/engine.io-parser",
+    "/socket.io-client"
+  ],
+  "_resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz",
+  "_shasum": "73926771923b5a19747ad666aa5cd4bf9c6e9ce8",
+  "_shrinkwrap": null,
+  "_spec": "base64-arraybuffer@0.1.5",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io-parser",
+  "author": {
+    "name": "Niklas von Hertzen",
+    "email": "niklasvh@gmail.com",
+    "url": "http://hertzen.com"
+  },
+  "bugs": {
+    "url": "https://github.com/niklasvh/base64-arraybuffer/issues"
+  },
+  "dependencies": {},
+  "description": "Encode/decode base64 data into ArrayBuffers",
+  "devDependencies": {
+    "grunt": "^0.4.5",
+    "grunt-cli": "^0.1.13",
+    "grunt-contrib-jshint": "^0.11.2",
+    "grunt-contrib-nodeunit": "^0.4.1",
+    "grunt-contrib-watch": "^0.6.1"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "73926771923b5a19747ad666aa5cd4bf9c6e9ce8",
+    "tarball": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz"
+  },
+  "engines": {
+    "node": ">= 0.6.0"
+  },
+  "gitHead": "e9457ccb7b140f5ae54a2880c8e9b967ffb03a7d",
+  "homepage": "https://github.com/niklasvh/base64-arraybuffer",
+  "keywords": [],
+  "licenses": [
+    {
+      "type": "MIT",
+      "url": "https://github.com/niklasvh/base64-arraybuffer/blob/master/LICENSE-MIT"
+    }
+  ],
+  "main": "lib/base64-arraybuffer",
+  "maintainers": [
+    {
+      "name": "niklasvh",
+      "email": "niklasvh@gmail.com"
+    }
+  ],
+  "name": "base64-arraybuffer",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/niklasvh/base64-arraybuffer.git"
+  },
+  "scripts": {
+    "test": "grunt nodeunit"
+  },
+  "version": "0.1.5"
+}
diff --git a/wrt/node_modules/base64id/.npmignore b/wrt/node_modules/base64id/.npmignore
new file mode 100644 (file)
index 0000000..39e9864
--- /dev/null
@@ -0,0 +1,3 @@
+support
+test
+examples
diff --git a/wrt/node_modules/base64id/LICENSE b/wrt/node_modules/base64id/LICENSE
new file mode 100644 (file)
index 0000000..0d03c83
--- /dev/null
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2012-2016 Kristian Faeldt <faeldt_kristian@cyberagent.co.jp>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/base64id/README.md b/wrt/node_modules/base64id/README.md
new file mode 100644 (file)
index 0000000..17689e6
--- /dev/null
@@ -0,0 +1,18 @@
+base64id
+========
+
+Node.js module that generates a base64 id.
+
+Uses crypto.randomBytes when available, falls back to unsafe methods for node.js <= 0.4.
+
+To increase performance, random bytes are buffered to minimize the number of synchronous calls to crypto.randomBytes.
+
+## Installation
+
+   $ npm install base64id
+
+## Usage
+
+   var base64id = require('base64id');
+
+   var id = base64id.generateId();
diff --git a/wrt/node_modules/base64id/lib/base64id.js b/wrt/node_modules/base64id/lib/base64id.js
new file mode 100644 (file)
index 0000000..f688159
--- /dev/null
@@ -0,0 +1,103 @@
+/*!
+ * base64id v0.1.0
+ */
+
+/**
+ * Module dependencies
+ */
+
+var crypto = require('crypto');
+
+/**
+ * Constructor
+ */
+
+var Base64Id = function() { };
+
+/**
+ * Get random bytes
+ *
+ * Uses a buffer if available, falls back to crypto.randomBytes
+ */
+
+Base64Id.prototype.getRandomBytes = function(bytes) {
+
+  var BUFFER_SIZE = 4096
+  var self = this;  
+  
+  bytes = bytes || 12;
+
+  if (bytes > BUFFER_SIZE) {
+    return crypto.randomBytes(bytes);
+  }
+  
+  var bytesInBuffer = parseInt(BUFFER_SIZE/bytes);
+  var threshold = parseInt(bytesInBuffer*0.85);
+
+  if (!threshold) {
+    return crypto.randomBytes(bytes);
+  }
+
+  if (this.bytesBufferIndex == null) {
+     this.bytesBufferIndex = -1;
+  }
+
+  if (this.bytesBufferIndex == bytesInBuffer) {
+    this.bytesBuffer = null;
+    this.bytesBufferIndex = -1;
+  }
+
+  // No buffered bytes available or index above threshold
+  if (this.bytesBufferIndex == -1 || this.bytesBufferIndex > threshold) {
+     
+    if (!this.isGeneratingBytes) {
+      this.isGeneratingBytes = true;
+      crypto.randomBytes(BUFFER_SIZE, function(err, bytes) {
+        self.bytesBuffer = bytes;
+        self.bytesBufferIndex = 0;
+        self.isGeneratingBytes = false;
+      }); 
+    }
+    
+    // Fall back to sync call when no buffered bytes are available
+    if (this.bytesBufferIndex == -1) {
+      return crypto.randomBytes(bytes);
+    }
+  }
+  
+  var result = this.bytesBuffer.slice(bytes*this.bytesBufferIndex, bytes*(this.bytesBufferIndex+1)); 
+  this.bytesBufferIndex++; 
+  
+  return result;
+}
+
+/**
+ * Generates a base64 id
+ *
+ * (Original version from socket.io <http://socket.io>)
+ */
+
+Base64Id.prototype.generateId = function () {
+  var rand = new Buffer(15); // multiple of 3 for base64
+  if (!rand.writeInt32BE) {
+    return Math.abs(Math.random() * Math.random() * Date.now() | 0).toString()
+      + Math.abs(Math.random() * Math.random() * Date.now() | 0).toString();
+  }
+  this.sequenceNumber = (this.sequenceNumber + 1) | 0;
+  rand.writeInt32BE(this.sequenceNumber, 11);
+  if (crypto.randomBytes) {
+    this.getRandomBytes(12).copy(rand);
+  } else {
+    // not secure for node 0.4
+    [0, 4, 8].forEach(function(i) {
+      rand.writeInt32BE(Math.random() * Math.pow(2, 32) | 0, i);
+    });
+  }
+  return rand.toString('base64').replace(/\//g, '_').replace(/\+/g, '-');
+};
+
+/**
+ * Export
+ */
+
+exports = module.exports = new Base64Id();
diff --git a/wrt/node_modules/base64id/package.json b/wrt/node_modules/base64id/package.json
new file mode 100644 (file)
index 0000000..68cf35b
--- /dev/null
@@ -0,0 +1,89 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "base64id@1.0.0",
+        "scope": null,
+        "escapedName": "base64id",
+        "name": "base64id",
+        "rawSpec": "1.0.0",
+        "spec": "1.0.0",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io"
+    ]
+  ],
+  "_from": "base64id@1.0.0",
+  "_id": "base64id@1.0.0",
+  "_inCache": true,
+  "_location": "/base64id",
+  "_nodeVersion": "4.4.7",
+  "_npmOperationalInternal": {
+    "host": "packages-18-east.internal.npmjs.com",
+    "tmp": "tmp/base64id-1.0.0.tgz_1480551701495_0.042360062478110194"
+  },
+  "_npmUser": {
+    "name": "darrachequesne",
+    "email": "damien.arrachequesne@gmail.com"
+  },
+  "_npmVersion": "2.15.8",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "base64id@1.0.0",
+    "scope": null,
+    "escapedName": "base64id",
+    "name": "base64id",
+    "rawSpec": "1.0.0",
+    "spec": "1.0.0",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/engine.io"
+  ],
+  "_resolved": "https://registry.npmjs.org/base64id/-/base64id-1.0.0.tgz",
+  "_shasum": "47688cb99bb6804f0e06d3e763b1c32e57d8e6b6",
+  "_shrinkwrap": null,
+  "_spec": "base64id@1.0.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io",
+  "author": {
+    "name": "Kristian Faeldt",
+    "email": "faeldt_kristian@cyberagent.co.jp"
+  },
+  "bugs": {
+    "url": "https://github.com/faeldt/base64id/issues"
+  },
+  "dependencies": {},
+  "description": "Generates a base64 id",
+  "devDependencies": {},
+  "directories": {},
+  "dist": {
+    "shasum": "47688cb99bb6804f0e06d3e763b1c32e57d8e6b6",
+    "tarball": "https://registry.npmjs.org/base64id/-/base64id-1.0.0.tgz"
+  },
+  "engines": {
+    "node": ">= 0.4.0"
+  },
+  "gitHead": "3c846f0818ff88b683ad39fde2f8e015ce0f9807",
+  "homepage": "https://github.com/faeldt/base64id#readme",
+  "license": "MIT",
+  "main": "./lib/base64id.js",
+  "maintainers": [
+    {
+      "name": "darrachequesne",
+      "email": "damien.arrachequesne@gmail.com"
+    },
+    {
+      "name": "faeldt_kristian",
+      "email": "kristian.faeldt@gmail.com"
+    }
+  ],
+  "name": "base64id",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/faeldt/base64id.git"
+  },
+  "scripts": {},
+  "version": "1.0.0"
+}
diff --git a/wrt/node_modules/better-assert/.npmignore b/wrt/node_modules/better-assert/.npmignore
new file mode 100644 (file)
index 0000000..f1250e5
--- /dev/null
@@ -0,0 +1,4 @@
+support
+test
+examples
+*.sock
diff --git a/wrt/node_modules/better-assert/History.md b/wrt/node_modules/better-assert/History.md
new file mode 100644 (file)
index 0000000..cbb579b
--- /dev/null
@@ -0,0 +1,15 @@
+
+1.0.0 / 2013-02-03 
+==================
+
+  * Stop using the removed magic __stack global getter
+
+0.1.0 / 2012-10-04 
+==================
+
+  * add throwing of AssertionError for test frameworks etc
+
+0.0.1 / 2010-01-03
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/better-assert/Makefile b/wrt/node_modules/better-assert/Makefile
new file mode 100644 (file)
index 0000000..36a3ed7
--- /dev/null
@@ -0,0 +1,5 @@
+
+test:
+       @echo "populate me"
+
+.PHONY: test
\ No newline at end of file
diff --git a/wrt/node_modules/better-assert/Readme.md b/wrt/node_modules/better-assert/Readme.md
new file mode 100644 (file)
index 0000000..d8d3a63
--- /dev/null
@@ -0,0 +1,61 @@
+
+# better-assert
+
+  Better c-style assertions using [callsite](https://github.com/visionmedia/callsite) for
+  self-documenting failure messages.
+
+## Installation
+
+    $ npm install better-assert
+
+## Example
+
+ By default assertions are enabled, however the __NO_ASSERT__ environment variable 
+ will deactivate them when truthy.
+
+```js
+var assert = require('better-assert');
+
+test();
+
+function test() {
+  var user = { name: 'tobi' };
+  assert('tobi' == user.name);
+  assert('number' == typeof user.age);
+}
+
+AssertionError: 'number' == typeof user.age
+    at test (/Users/tj/projects/better-assert/example.js:9:3)
+    at Object.<anonymous> (/Users/tj/projects/better-assert/example.js:4:1)
+    at Module._compile (module.js:449:26)
+    at Object.Module._extensions..js (module.js:467:10)
+    at Module.load (module.js:356:32)
+    at Function.Module._load (module.js:312:12)
+    at Module.runMain (module.js:492:10)
+    at process.startup.processNextTick.process._tickCallback (node.js:244:9)
+```
+
+## License 
+
+(The MIT License)
+
+Copyright (c) 2012 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/wrt/node_modules/better-assert/example.js b/wrt/node_modules/better-assert/example.js
new file mode 100644 (file)
index 0000000..688c29e
--- /dev/null
@@ -0,0 +1,10 @@
+
+var assert = require('./');
+
+test();
+
+function test() {
+  var user = { name: 'tobi' };
+  assert('tobi' == user.name);
+  assert('number' == typeof user.age);
+}
\ No newline at end of file
diff --git a/wrt/node_modules/better-assert/index.js b/wrt/node_modules/better-assert/index.js
new file mode 100644 (file)
index 0000000..fd1c9b7
--- /dev/null
@@ -0,0 +1,38 @@
+/**
+ * Module dependencies.
+ */
+
+var AssertionError = require('assert').AssertionError
+  , callsite = require('callsite')
+  , fs = require('fs')
+
+/**
+ * Expose `assert`.
+ */
+
+module.exports = process.env.NO_ASSERT
+  ? function(){}
+  : assert;
+
+/**
+ * Assert the given `expr`.
+ */
+
+function assert(expr) {
+  if (expr) return;
+
+  var stack = callsite();
+  var call = stack[1];
+  var file = call.getFileName();
+  var lineno = call.getLineNumber();
+  var src = fs.readFileSync(file, 'utf8');
+  var line = src.split('\n')[lineno-1];
+  var src = line.match(/assert\((.*)\)/)[1];
+
+  var err = new AssertionError({
+    message: src,
+    stackStartFunction: stack[0].getFunction()
+  });
+
+  throw err;
+}
diff --git a/wrt/node_modules/better-assert/package.json b/wrt/node_modules/better-assert/package.json
new file mode 100644 (file)
index 0000000..12ec6cf
--- /dev/null
@@ -0,0 +1,100 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "better-assert@~1.0.0",
+        "scope": null,
+        "escapedName": "better-assert",
+        "name": "better-assert",
+        "rawSpec": "~1.0.0",
+        "spec": ">=1.0.0 <1.1.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/parsejson"
+    ]
+  ],
+  "_from": "better-assert@>=1.0.0 <1.1.0",
+  "_id": "better-assert@1.0.2",
+  "_inCache": true,
+  "_location": "/better-assert",
+  "_npmUser": {
+    "name": "tony_ado",
+    "email": "coolhzb@163.com"
+  },
+  "_npmVersion": "1.4.9",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "better-assert@~1.0.0",
+    "scope": null,
+    "escapedName": "better-assert",
+    "name": "better-assert",
+    "rawSpec": "~1.0.0",
+    "spec": ">=1.0.0 <1.1.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/parsejson",
+    "/parseqs",
+    "/parseuri"
+  ],
+  "_resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz",
+  "_shasum": "40866b9e1b9e0b55b481894311e68faffaebc522",
+  "_shrinkwrap": null,
+  "_spec": "better-assert@~1.0.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/parsejson",
+  "author": {
+    "name": "TJ Holowaychuk",
+    "email": "tj@vision-media.ca"
+  },
+  "bugs": {
+    "url": "https://github.com/visionmedia/better-assert/issues"
+  },
+  "contributors": [
+    {
+      "name": "TonyHe",
+      "email": "coolhzb@163.com"
+    },
+    {
+      "name": "ForbesLindesay"
+    }
+  ],
+  "dependencies": {
+    "callsite": "1.0.0"
+  },
+  "description": "Better assertions for node, reporting the expr, filename, lineno etc",
+  "devDependencies": {},
+  "directories": {},
+  "dist": {
+    "shasum": "40866b9e1b9e0b55b481894311e68faffaebc522",
+    "tarball": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz"
+  },
+  "engines": {
+    "node": "*"
+  },
+  "homepage": "https://github.com/visionmedia/better-assert",
+  "keywords": [
+    "assert",
+    "stack",
+    "trace",
+    "debug"
+  ],
+  "main": "index",
+  "maintainers": [
+    {
+      "name": "tjholowaychuk",
+      "email": "tj@vision-media.ca"
+    },
+    {
+      "name": "tony_ado",
+      "email": "coolhzb@163.com"
+    }
+  ],
+  "name": "better-assert",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/visionmedia/better-assert.git"
+  },
+  "version": "1.0.2"
+}
diff --git a/wrt/node_modules/binary/.npmignore b/wrt/node_modules/binary/.npmignore
new file mode 100644 (file)
index 0000000..3c3629e
--- /dev/null
@@ -0,0 +1 @@
+node_modules
diff --git a/wrt/node_modules/binary/.travis.yml b/wrt/node_modules/binary/.travis.yml
new file mode 100644 (file)
index 0000000..f1d0f13
--- /dev/null
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+  - 0.4
+  - 0.6
diff --git a/wrt/node_modules/binary/README.markdown b/wrt/node_modules/binary/README.markdown
new file mode 100644 (file)
index 0000000..bbeac2e
--- /dev/null
@@ -0,0 +1,177 @@
+binary
+======
+
+Unpack multibyte binary values from buffers and streams.
+You can specify the endianness and signedness of the fields to be unpacked too.
+
+This module is a cleaner and more complete version of
+[bufferlist](https://github.com/substack/node-bufferlist)'s binary module that
+runs on pre-allocated buffers instead of a linked list.
+
+[![build status](https://secure.travis-ci.org/substack/node-binary.png)](http://travis-ci.org/substack/node-binary)
+
+examples
+========
+
+stream.js
+---------
+
+``` js
+var binary = require('binary');
+
+var ws = binary()
+    .word32lu('x')
+    .word16bs('y')
+    .word16bu('z')
+    .tap(function (vars) {
+        console.dir(vars);
+    })
+;
+process.stdin.pipe(ws);
+process.stdin.resume();
+```
+
+output:
+
+```
+$ node examples/stream.js
+abcdefgh
+{ x: 1684234849, y: 25958, z: 26472 }
+^D
+```
+
+parse.js
+--------
+
+``` js
+var buf = new Buffer([ 97, 98, 99, 100, 101, 102, 0 ]);
+
+var binary = require('binary');
+var vars = binary.parse(buf)
+    .word16ls('ab')
+    .word32bu('cf')
+    .word8('x')
+    .vars
+;
+console.dir(vars);
+```
+
+output:
+
+```
+{ ab: 25185, cf: 1667523942, x: 0 }
+```
+
+methods
+=======
+
+`var binary = require('binary')`
+
+var b = binary()
+----------------
+
+Return a new writable stream `b` that has the chainable methods documented below
+for buffering binary input.
+
+binary.parse(buf)
+-----------------
+
+Parse a static buffer in one pass. Returns a chainable interface with the
+methods below plus a `vars` field to get at the variable stash as the last item
+in a chain.
+
+In parse mode, methods will set their keys to `null` if the buffer isn't big
+enough except `buffer()` and `scan()` which read up up to the end of the buffer
+and stop.
+
+b.word{8,16,32,64}{l,b}{e,u,s}(key)
+-----------------------------------
+
+Parse bytes in the buffer or stream given:
+
+* number of bits
+* endianness ( l : little, b : big ),
+* signedness ( u and e : unsigned, s : signed )
+
+These functions won't start parsing until all previous parser functions have run
+and the data is available.
+
+The result of the parse goes into the variable stash at `key`.
+If `key` has dots (`.`s), it refers to a nested address. If parent container
+values don't exist they will be created automatically, so for instance you can
+assign into `dst.addr` and `dst.port` and the `dst` key in the variable stash
+will be `{ addr : x, port : y }` afterwards.
+
+b.buffer(key, size)
+-------------------
+
+Take `size` bytes directly off the buffer stream, putting the resulting buffer
+slice in the variable stash at `key`. If `size` is a string, use the value at
+`vars[size]`. The key follows the same dotted address rules as the word
+functions.
+
+b.scan(key, buffer)
+-------------------
+
+Search for `buffer` in the stream and store all the intervening data in the
+stash at at `key`, excluding the search buffer. If `buffer` passed as a string,
+it will be converted into a Buffer internally.
+
+For example, to read in a line you can just do:
+
+``` js
+var b = binary()
+    .scan('line', new Buffer('\r\n'))
+    .tap(function (vars) {
+        console.log(vars.line)
+    })
+;
+stream.pipe(b);
+```
+
+b.tap(cb)
+---------
+
+The callback `cb` is provided with the variable stash from all the previous
+actions once they've all finished.
+
+You can nest additional actions onto `this` inside the callback.
+
+b.into(key, cb)
+---------------
+
+Like `.tap()`, except all nested actions will assign into a `key` in the `vars`
+stash.
+
+b.loop(cb)
+----------
+
+Loop, each time calling `cb(end, vars)` for function `end` and the variable
+stash with `this` set to a new chain for nested parsing. The loop terminates
+once `end` is called.
+
+b.flush()
+---------
+
+Clear the variable stash entirely.
+
+installation
+============
+
+To install with [npm](http://github.com/isaacs/npm):
+
+```
+npm install binary
+```
+
+notes
+=====
+
+The word64 functions will only return approximations since javascript uses ieee
+floating point for all number types. Mind the loss of precision.
+
+license
+=======
+
+MIT
+
diff --git a/wrt/node_modules/binary/example/buf.js b/wrt/node_modules/binary/example/buf.js
new file mode 100644 (file)
index 0000000..7f5d30b
--- /dev/null
@@ -0,0 +1,11 @@
+var buf = new Buffer([ 97, 98, 99, 100, 101, 102, 0 ]);
+
+var binary = require('binary');
+binary(buf)
+    .word16ls('ab')
+    .word32bu('cf')
+    .word8('x')
+    .tap(function (vars) {
+        console.dir(vars);
+    })
+;
diff --git a/wrt/node_modules/binary/example/parse.js b/wrt/node_modules/binary/example/parse.js
new file mode 100644 (file)
index 0000000..b326883
--- /dev/null
@@ -0,0 +1,10 @@
+var buf = new Buffer([ 97, 98, 99, 100, 101, 102, 0 ]);
+
+var binary = require('binary');
+var vars = binary.parse(buf)
+    .word16ls('ab')
+    .word32bu('cf')
+    .word8('x')
+    .vars
+;
+console.dir(vars);
diff --git a/wrt/node_modules/binary/example/stream.js b/wrt/node_modules/binary/example/stream.js
new file mode 100644 (file)
index 0000000..28a6f96
--- /dev/null
@@ -0,0 +1,12 @@
+var binary = require('binary');
+
+var ws = binary()
+    .word32lu('x')
+    .word16bs('y')
+    .word16bu('z')
+    .tap(function (vars) {
+        console.dir(vars);
+    })
+;
+process.stdin.pipe(ws);
+process.stdin.resume();
diff --git a/wrt/node_modules/binary/index.js b/wrt/node_modules/binary/index.js
new file mode 100644 (file)
index 0000000..bf2ba4b
--- /dev/null
@@ -0,0 +1,397 @@
+var Chainsaw = require('chainsaw');
+var EventEmitter = require('events').EventEmitter;
+var Buffers = require('buffers');
+var Vars = require('./lib/vars.js');
+var Stream = require('stream').Stream;
+
+exports = module.exports = function (bufOrEm, eventName) {
+    if (Buffer.isBuffer(bufOrEm)) {
+        return exports.parse(bufOrEm);
+    }
+    
+    var s = exports.stream();
+    if (bufOrEm && bufOrEm.pipe) {
+        bufOrEm.pipe(s);
+    }
+    else if (bufOrEm) {
+        bufOrEm.on(eventName || 'data', function (buf) {
+            s.write(buf);
+        });
+        
+        bufOrEm.on('end', function () {
+            s.end();
+        });
+    }
+    return s;
+};
+
+exports.stream = function (input) {
+    if (input) return exports.apply(null, arguments);
+    
+    var pending = null;
+    function getBytes (bytes, cb, skip) {
+        pending = {
+            bytes : bytes,
+            skip : skip,
+            cb : function (buf) {
+                pending = null;
+                cb(buf);
+            },
+        };
+        dispatch();
+    }
+    
+    var offset = null;
+    function dispatch () {
+        if (!pending) {
+            if (caughtEnd) done = true;
+            return;
+        }
+        if (typeof pending === 'function') {
+            pending();
+        }
+        else {
+            var bytes = offset + pending.bytes;
+            
+            if (buffers.length >= bytes) {
+                var buf;
+                if (offset == null) {
+                    buf = buffers.splice(0, bytes);
+                    if (!pending.skip) {
+                        buf = buf.slice();
+                    }
+                }
+                else {
+                    if (!pending.skip) {
+                        buf = buffers.slice(offset, bytes);
+                    }
+                    offset = bytes;
+                }
+                
+                if (pending.skip) {
+                    pending.cb();
+                }
+                else {
+                    pending.cb(buf);
+                }
+            }
+        }
+    }
+    
+    function builder (saw) {
+        function next () { if (!done) saw.next() }
+        
+        var self = words(function (bytes, cb) {
+            return function (name) {
+                getBytes(bytes, function (buf) {
+                    vars.set(name, cb(buf));
+                    next();
+                });
+            };
+        });
+        
+        self.tap = function (cb) {
+            saw.nest(cb, vars.store);
+        };
+        
+        self.into = function (key, cb) {
+            if (!vars.get(key)) vars.set(key, {});
+            var parent = vars;
+            vars = Vars(parent.get(key));
+            
+            saw.nest(function () {
+                cb.apply(this, arguments);
+                this.tap(function () {
+                    vars = parent;
+                });
+            }, vars.store);
+        };
+        
+        self.flush = function () {
+            vars.store = {};
+            next();
+        };
+        
+        self.loop = function (cb) {
+            var end = false;
+            
+            saw.nest(false, function loop () {
+                this.vars = vars.store;
+                cb.call(this, function () {
+                    end = true;
+                    next();
+                }, vars.store);
+                this.tap(function () {
+                    if (end) saw.next()
+                    else loop.call(this)
+                }.bind(this));
+            }, vars.store);
+        };
+        
+        self.buffer = function (name, bytes) {
+            if (typeof bytes === 'string') {
+                bytes = vars.get(bytes);
+            }
+            
+            getBytes(bytes, function (buf) {
+                vars.set(name, buf);
+                next();
+            });
+        };
+        
+        self.skip = function (bytes) {
+            if (typeof bytes === 'string') {
+                bytes = vars.get(bytes);
+            }
+            
+            getBytes(bytes, function () {
+                next();
+            });
+        };
+        
+        self.scan = function find (name, search) {
+            if (typeof search === 'string') {
+                search = new Buffer(search);
+            }
+            else if (!Buffer.isBuffer(search)) {
+                throw new Error('search must be a Buffer or a string');
+            }
+            
+            var taken = 0;
+            pending = function () {
+                var pos = buffers.indexOf(search, offset + taken);
+                var i = pos-offset-taken;
+                if (pos !== -1) {
+                    pending = null;
+                    if (offset != null) {
+                        vars.set(
+                            name,
+                            buffers.slice(offset, offset + taken + i)
+                        );
+                        offset += taken + i + search.length;
+                    }
+                    else {
+                        vars.set(
+                            name,
+                            buffers.slice(0, taken + i)
+                        );
+                        buffers.splice(0, taken + i + search.length);
+                    }
+                    next();
+                    dispatch();
+                } else {
+                    i = Math.max(buffers.length - search.length - offset - taken, 0);
+                               }
+                taken += i;
+            };
+            dispatch();
+        };
+        
+        self.peek = function (cb) {
+            offset = 0;
+            saw.nest(function () {
+                cb.call(this, vars.store);
+                this.tap(function () {
+                    offset = null;
+                });
+            });
+        };
+        
+        return self;
+    };
+    
+    var stream = Chainsaw.light(builder);
+    stream.writable = true;
+    
+    var buffers = Buffers();
+    
+    stream.write = function (buf) {
+        buffers.push(buf);
+        dispatch();
+    };
+    
+    var vars = Vars();
+    
+    var done = false, caughtEnd = false;
+    stream.end = function () {
+        caughtEnd = true;
+    };
+    
+    stream.pipe = Stream.prototype.pipe;
+    Object.getOwnPropertyNames(EventEmitter.prototype).forEach(function (name) {
+        stream[name] = EventEmitter.prototype[name];
+    });
+    
+    return stream;
+};
+
+exports.parse = function parse (buffer) {
+    var self = words(function (bytes, cb) {
+        return function (name) {
+            if (offset + bytes <= buffer.length) {
+                var buf = buffer.slice(offset, offset + bytes);
+                offset += bytes;
+                vars.set(name, cb(buf));
+            }
+            else {
+                vars.set(name, null);
+            }
+            return self;
+        };
+    });
+    
+    var offset = 0;
+    var vars = Vars();
+    self.vars = vars.store;
+    
+    self.tap = function (cb) {
+        cb.call(self, vars.store);
+        return self;
+    };
+    
+    self.into = function (key, cb) {
+        if (!vars.get(key)) {
+            vars.set(key, {});
+        }
+        var parent = vars;
+        vars = Vars(parent.get(key));
+        cb.call(self, vars.store);
+        vars = parent;
+        return self;
+    };
+    
+    self.loop = function (cb) {
+        var end = false;
+        var ender = function () { end = true };
+        while (end === false) {
+            cb.call(self, ender, vars.store);
+        }
+        return self;
+    };
+    
+    self.buffer = function (name, size) {
+        if (typeof size === 'string') {
+            size = vars.get(size);
+        }
+        var buf = buffer.slice(offset, Math.min(buffer.length, offset + size));
+        offset += size;
+        vars.set(name, buf);
+        
+        return self;
+    };
+    
+    self.skip = function (bytes) {
+        if (typeof bytes === 'string') {
+            bytes = vars.get(bytes);
+        }
+        offset += bytes;
+        
+        return self;
+    };
+    
+    self.scan = function (name, search) {
+        if (typeof search === 'string') {
+            search = new Buffer(search);
+        }
+        else if (!Buffer.isBuffer(search)) {
+            throw new Error('search must be a Buffer or a string');
+        }
+        vars.set(name, null);
+        
+        // simple but slow string search
+        for (var i = 0; i + offset <= buffer.length - search.length + 1; i++) {
+            for (
+                var j = 0;
+                j < search.length && buffer[offset+i+j] === search[j];
+                j++
+            );
+            if (j === search.length) break;
+        }
+        
+        vars.set(name, buffer.slice(offset, offset + i));
+        offset += i + search.length;
+        return self;
+    };
+    
+    self.peek = function (cb) {
+        var was = offset;
+        cb.call(self, vars.store);
+        offset = was;
+        return self;
+    };
+    
+    self.flush = function () {
+        vars.store = {};
+        return self;
+    };
+    
+    self.eof = function () {
+        return offset >= buffer.length;
+    };
+    
+    return self;
+};
+
+// convert byte strings to unsigned little endian numbers
+function decodeLEu (bytes) {
+    var acc = 0;
+    for (var i = 0; i < bytes.length; i++) {
+        acc += Math.pow(256,i) * bytes[i];
+    }
+    return acc;
+}
+
+// convert byte strings to unsigned big endian numbers
+function decodeBEu (bytes) {
+    var acc = 0;
+    for (var i = 0; i < bytes.length; i++) {
+        acc += Math.pow(256, bytes.length - i - 1) * bytes[i];
+    }
+    return acc;
+}
+
+// convert byte strings to signed big endian numbers
+function decodeBEs (bytes) {
+    var val = decodeBEu(bytes);
+    if ((bytes[0] & 0x80) == 0x80) {
+        val -= Math.pow(256, bytes.length);
+    }
+    return val;
+}
+
+// convert byte strings to signed little endian numbers
+function decodeLEs (bytes) {
+    var val = decodeLEu(bytes);
+    if ((bytes[bytes.length - 1] & 0x80) == 0x80) {
+        val -= Math.pow(256, bytes.length);
+    }
+    return val;
+}
+
+function words (decode) {
+    var self = {};
+    
+    [ 1, 2, 4, 8 ].forEach(function (bytes) {
+        var bits = bytes * 8;
+        
+        self['word' + bits + 'le']
+        = self['word' + bits + 'lu']
+        = decode(bytes, decodeLEu);
+        
+        self['word' + bits + 'ls']
+        = decode(bytes, decodeLEs);
+        
+        self['word' + bits + 'be']
+        = self['word' + bits + 'bu']
+        = decode(bytes, decodeBEu);
+        
+        self['word' + bits + 'bs']
+        = decode(bytes, decodeBEs);
+    });
+    
+    // word8be(n) == word8le(n) for all n
+    self.word8 = self.word8u = self.word8be;
+    self.word8s = self.word8bs;
+    
+    return self;
+}
diff --git a/wrt/node_modules/binary/lib/vars.js b/wrt/node_modules/binary/lib/vars.js
new file mode 100644 (file)
index 0000000..00d6df6
--- /dev/null
@@ -0,0 +1,28 @@
+module.exports = function (store) {
+    function getset (name, value) {
+        var node = vars.store;
+        var keys = name.split('.');
+        keys.slice(0,-1).forEach(function (k) {
+            if (node[k] === undefined) node[k] = {};
+            node = node[k]
+        });
+        var key = keys[keys.length - 1];
+        if (arguments.length == 1) {
+            return node[key];
+        }
+        else {
+            return node[key] = value;
+        }
+    }
+    
+    var vars = {
+        get : function (name) {
+            return getset(name);
+        },
+        set : function (name, value) {
+            return getset(name, value);
+        },
+        store : store || {},
+    };
+    return vars;
+};
diff --git a/wrt/node_modules/binary/package.json b/wrt/node_modules/binary/package.json
new file mode 100644 (file)
index 0000000..8a6fb60
--- /dev/null
@@ -0,0 +1,102 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "binary@>= 0.3.0 < 1",
+        "scope": null,
+        "escapedName": "binary",
+        "name": "binary",
+        "rawSpec": ">= 0.3.0 < 1",
+        "spec": ">=0.3.0 <1.0.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/unzip"
+    ]
+  ],
+  "_defaultsLoaded": true,
+  "_engineSupported": true,
+  "_from": "binary@>=0.3.0 <1.0.0",
+  "_id": "binary@0.3.0",
+  "_inCache": true,
+  "_location": "/binary",
+  "_nodeVersion": "v0.6.11",
+  "_npmUser": {
+    "name": "substack",
+    "email": "mail@substack.net"
+  },
+  "_npmVersion": "1.1.19",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "binary@>= 0.3.0 < 1",
+    "scope": null,
+    "escapedName": "binary",
+    "name": "binary",
+    "rawSpec": ">= 0.3.0 < 1",
+    "spec": ">=0.3.0 <1.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/unzip"
+  ],
+  "_resolved": "https://registry.npmjs.org/binary/-/binary-0.3.0.tgz",
+  "_shasum": "9f60553bc5ce8c3386f3b553cff47462adecaa79",
+  "_shrinkwrap": null,
+  "_spec": "binary@>= 0.3.0 < 1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/unzip",
+  "author": {
+    "name": "James Halliday",
+    "email": "mail@substack.net",
+    "url": "http://substack.net"
+  },
+  "bugs": {
+    "url": "https://github.com/substack/node-binary/issues"
+  },
+  "dependencies": {
+    "buffers": "~0.1.1",
+    "chainsaw": "~0.1.0"
+  },
+  "description": "Unpack multibyte binary values from buffers",
+  "devDependencies": {
+    "seq": "~0.2.5",
+    "tap": "~0.2.4"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "9f60553bc5ce8c3386f3b553cff47462adecaa79",
+    "tarball": "https://registry.npmjs.org/binary/-/binary-0.3.0.tgz"
+  },
+  "engine": {
+    "node": ">=0.4.0"
+  },
+  "engines": {
+    "node": "*"
+  },
+  "homepage": "https://github.com/substack/node-binary#readme",
+  "keywords": [
+    "binary",
+    "decode",
+    "endian",
+    "unpack",
+    "signed",
+    "unsigned"
+  ],
+  "license": "MIT",
+  "main": "./index.js",
+  "maintainers": [
+    {
+      "name": "substack",
+      "email": "mail@substack.net"
+    }
+  ],
+  "name": "binary",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/substack/node-binary.git"
+  },
+  "scripts": {
+    "test": "tap test/*.js"
+  },
+  "version": "0.3.0"
+}
diff --git a/wrt/node_modules/binary/perf/loop.js b/wrt/node_modules/binary/perf/loop.js
new file mode 100644 (file)
index 0000000..bec60a8
--- /dev/null
@@ -0,0 +1,92 @@
+var Seq = require('seq');
+var Hash = require('hashish');
+var EventEmitter = require('events').EventEmitter;
+
+var Bin = require('binary');
+var Buf = require('bufferlist/binary');
+var BufferList = require('bufferlist');
+
+console.log('loop');
+function emitter () {
+    var em = new EventEmitter;
+    
+    var i = 0;
+    var iv = setInterval(function () {
+        var buf = new Buffer(10000);
+        buf[0] = 0xff;
+        
+        if (++ i >= 2000) {
+            buf[0] = 0;
+            clearInterval(iv);
+        }
+        em.emit('data', buf);
+    }, 1);
+    
+    return em;
+}
+
+Seq()
+    .seq(function () {
+        var next = this.bind({}, null);
+        bufferlist(next);
+    })
+    .seq(function () {
+        var next = this.bind({}, null);
+        binary(next);
+    })
+;
+
+function binary (next) {
+    var em = emitter();
+    var t0 = Date.now();
+    
+    Bin(em)
+        .loop(function (end) {
+            this
+            .word8('x')
+            .word8('y')
+            .word32be('z')
+            .word32le('w')
+            .buffer('buf', 10000 - 10)
+            .tap(function (vars) {
+                if (vars.x === 0) {
+                    var tf = Date.now();
+                    console.log('    binary: ' + (tf - t0) + ' ms');
+                    end();
+                    setTimeout(next, 20);
+                }
+            })
+        })
+    ;
+}
+
+function bufferlist (next) {
+    var em = emitter();
+    var t0 = Date.now();
+    
+    var blist = new BufferList;
+    em.on('data', function (buf) {
+        blist.push(buf);
+    });
+    
+    Buf(blist)
+        .forever(function () {
+            var top = this;
+            this
+            .getWord8('x')
+            .getWord8('y')
+            .getWord32be('z')
+            .getWord32le('w')
+            .getBuffer('buf', 10000 - 10)
+            .tap(function (vars) {
+                if (vars.x === 0) {
+                    var tf = Date.now();
+                    console.log('    bufferlist: ' + (tf - t0) + ' ms');
+                    top.exit();
+                    setTimeout(next, 20);
+                }
+            })
+        })
+        .end()
+    ;
+}
diff --git a/wrt/node_modules/binary/perf/small.js b/wrt/node_modules/binary/perf/small.js
new file mode 100644 (file)
index 0000000..2a5ed52
--- /dev/null
@@ -0,0 +1,80 @@
+var Seq = require('seq');
+var Hash = require('hashish');
+
+var Bin = require('binary');
+var Buf = require('bufferlist/binary');
+var BufferList = require('bufferlist');
+var EventEmitter = require('events').EventEmitter;
+
+function binary (buf, cb) {
+    Bin(buf)
+        .word32le('x')
+        .word16be('y')
+        .word16be('z')
+        .word32le('w')
+        .tap(cb)
+    ;
+};
+
+function stream (buf, cb) {
+    var em = new EventEmitter;
+    Bin(em)
+        .word32le('x')
+        .word16be('y')
+        .word16be('z')
+        .word32le('w')
+        .tap(cb)
+    ;
+    em.emit('data', buf);
+};
+
+function parse (buf, cb) {
+    cb(Bin.parse(buf)
+        .word32le('x')
+        .word16be('y')
+        .word16be('z')
+        .word32le('w')
+        .vars
+    );
+};
+
+function bufferlist (buf, cb) {
+    var blist = new BufferList;
+    blist.push(buf);
+    Buf(blist)
+        .getWord32le('x')
+        .getWord16be('y')
+        .getWord16be('z')
+        .getWord32le('w')
+        .tap(cb)
+        .end()
+    ;
+};
+
+
+var buffers = [];
+for (var i = 0; i < 200; i++) {
+    buffers.push(new Buffer(12));
+}
+
+console.log('small');
+Seq(binary, stream, parse, bufferlist)
+    .seqEach(function (f) {
+        var t = this;
+        var t0 = Date.now();
+        Seq()
+            .extend(buffers)
+            .seqEach(function (buf) {
+                f(buf, this.bind(this, null));
+            })
+            .seq(function () {
+                var tf = Date.now();
+                console.log('    ' + f.name + ': ' + (tf - t0));
+                t(null);
+            })
+        ;
+    })
+    .seq(function () {
+        this(null);
+    })
+;
diff --git a/wrt/node_modules/binary/test/bu.js b/wrt/node_modules/binary/test/bu.js
new file mode 100644 (file)
index 0000000..d557e3c
--- /dev/null
@@ -0,0 +1,46 @@
+var binary = require('../');
+var test = require('tap').test;
+
+test('bu', function (t) {
+    t.plan(8);
+    
+    // note: can't store -12667700813876161 exactly in an ieee float
+    
+    var buf = new Buffer([
+        44, // a == 44
+        2, 43, // b == 555
+        164, 213, 37, 37, // c == 2765432101
+        29, 81, 180, 20, 155, 115, 203, 193, // d == 2112667700813876161
+    ]);
+    
+    binary.parse(buf)
+        .word8bu('a')
+        .word16bu('b')
+        .word32bu('c')
+        .word64bu('d')
+        .tap(function (vars) {
+            t.same(vars.a, 44);
+            t.same(vars.b, 555);
+            t.same(vars.c, 2765432101);
+            t.ok(
+                Math.abs(vars.d - 2112667700813876161) < 1500
+            );
+        })
+    ;
+    
+    // also check aliases here:
+    binary.parse(buf)
+        .word8be('a')
+        .word16be('b')
+        .word32be('c')
+        .word64be('d')
+        .tap(function (vars) {
+            t.same(vars.a, 44);
+            t.same(vars.b, 555);
+            t.same(vars.c, 2765432101);
+            t.ok(
+                Math.abs(vars.d - 2112667700813876161) < 1500
+            );
+        })
+    ;
+});
diff --git a/wrt/node_modules/binary/test/deferred.js b/wrt/node_modules/binary/test/deferred.js
new file mode 100644 (file)
index 0000000..52623f7
--- /dev/null
@@ -0,0 +1,20 @@
+var binary = require('../');
+var test = require('tap').test;
+var EventEmitter = require('events').EventEmitter;
+
+test('deferred', function (t) {
+    t.plan(1);
+    
+    var em = new EventEmitter;
+    binary.stream(em)
+        .word8('a')
+        .word16be('bc')
+        .tap(function (vars) {
+            t.same(vars, { a : 97, bc : 25187 });
+        })
+    ;
+    
+    setTimeout(function () {
+        em.emit('data', new Buffer([ 97, 98, 99 ]));
+    }, 10);
+});
diff --git a/wrt/node_modules/binary/test/dots.js b/wrt/node_modules/binary/test/dots.js
new file mode 100644 (file)
index 0000000..f730eb3
--- /dev/null
@@ -0,0 +1,23 @@
+var binary = require('../');
+var test = require('tap').test;
+
+test('dots', function (t) {
+    t.plan(1);
+    
+    binary.parse(new Buffer([ 97, 98, 99, 100, 101, 102 ]))
+        .word8('a')
+        .word16be('b.x')
+        .word16be('b.y')
+        .word8('b.z')
+        .tap(function (vars) {
+            t.same(vars, {
+                a : 97,
+                b : {
+                    x : 256 * 98 + 99,
+                    y : 256 * 100 + 101,
+                    z : 102
+                },
+            });
+        })
+    ;
+});
diff --git a/wrt/node_modules/binary/test/eof.js b/wrt/node_modules/binary/test/eof.js
new file mode 100644 (file)
index 0000000..e5268ff
--- /dev/null
@@ -0,0 +1,41 @@
+var binary = require('../');
+var test = require('tap').test;
+var EventEmitter = require('events').EventEmitter;
+
+test('eof', function (t) {
+    t.plan(4);
+    
+    var stream = new EventEmitter;
+    binary.stream(stream)
+        .buffer('sixone', 5)
+        .peek(function () {
+            this.word32le('len');
+        })
+        .buffer('buf', 'len')
+        .word8('x')
+        .tap(function (vars) {
+            t.same(
+                [].slice.call(vars.sixone),
+                [].slice.call(new Buffer([ 6, 1, 6, 1, 6 ]))
+            );
+            t.same(vars.buf.length, vars.len);
+            t.same(
+                [].slice.call(vars.buf),
+                [ 9, 0, 0, 0, 97, 98, 99, 100, 101 ]
+            );
+            t.same(vars.x, 102);
+        })
+    ;
+    
+    var bufs = [
+        new Buffer([ 6, 1, 6, 1, 6, 9, 0, 0, 0, 97 ]),
+        new Buffer([ 98, 99 ]),
+        new Buffer([ 100, 101, 102 ]),
+    ];
+    
+    bufs.forEach(function (buf) {
+        stream.emit('data', buf);
+    });
+    
+    stream.emit('end');
+});
diff --git a/wrt/node_modules/binary/test/flush.js b/wrt/node_modules/binary/test/flush.js
new file mode 100644 (file)
index 0000000..b9c0dde
--- /dev/null
@@ -0,0 +1,17 @@
+var binary = require('../');
+var test = require('tap').test;
+
+test('flush', function (t) {
+    t.plan(1);
+    
+    binary.parse(new Buffer([ 97, 98, 99, 100, 101, 102 ]))
+        .word8('a')
+        .word16be('b')
+        .word16be('c')
+        .flush()
+        .word8('d')
+        .tap(function (vars) {
+            t.same(vars, { d : 102 });
+        })
+    ;
+});
diff --git a/wrt/node_modules/binary/test/from_buffer.js b/wrt/node_modules/binary/test/from_buffer.js
new file mode 100644 (file)
index 0000000..b5061e7
--- /dev/null
@@ -0,0 +1,14 @@
+var binary = require('../');
+var test = require('tap').test;
+
+test('from buffer', function (t) {
+    t.plan(1);
+    
+    binary(new Buffer([ 97, 98, 99 ]))
+        .word8('a')
+        .word16be('bc')
+        .tap(function (vars) {
+            t.same(vars, { a : 97, bc : 25187 });
+        })
+    ;
+});
diff --git a/wrt/node_modules/binary/test/get_buffer.js b/wrt/node_modules/binary/test/get_buffer.js
new file mode 100644 (file)
index 0000000..1c62192
--- /dev/null
@@ -0,0 +1,28 @@
+var binary = require('../');
+var test = require('tap').test;
+
+test('get buffer', function (t) {
+    t.plan(4);
+    
+    var buf = new Buffer([ 4, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 ]);
+    binary.parse(buf)
+        .word8('a')
+        .buffer('b', 7)
+        .word16lu('c')
+        .tap(function (vars) {
+            t.equal(vars.a, 4);
+            t.equal(
+                vars.b.toString(), 
+                new Buffer([ 2, 3, 4, 5, 6, 7, 8 ]).toString()
+            );
+            t.equal(vars.c, 2569);
+        })
+        .buffer('d', 'a')
+        .tap(function (vars) {
+            t.equal(
+                vars.d.toString(),
+                new Buffer([ 11, 12, 13, 14 ]).toString()
+            );
+        })
+    ;
+});
diff --git a/wrt/node_modules/binary/test/immediate.js b/wrt/node_modules/binary/test/immediate.js
new file mode 100644 (file)
index 0000000..1f0ea77
--- /dev/null
@@ -0,0 +1,18 @@
+var binary = require('../');
+var test = require('tap').test;
+var EventEmitter = require('events').EventEmitter;
+
+test('immediate', function (t) {
+    t.plan(1);
+    
+    var em = new EventEmitter;
+    binary.stream(em, 'moo')
+        .word8('a')
+        .word16be('bc')
+        .tap(function (vars) {
+            t.same(vars, { a : 97, bc : 25187 });
+        })
+    ;
+    
+    em.emit('moo', new Buffer([ 97, 98, 99 ]));
+});
diff --git a/wrt/node_modules/binary/test/interval.js b/wrt/node_modules/binary/test/interval.js
new file mode 100644 (file)
index 0000000..b17c0cb
--- /dev/null
@@ -0,0 +1,38 @@
+var binary = require('../');
+var test = require('tap').test;
+var EventEmitter = require('events').EventEmitter;
+
+test('interval', function (t) {
+    t.plan(1);
+    
+    var em = new EventEmitter;
+    var i = 0;
+    var iv = setInterval(function () {
+        var buf = new Buffer(1000);
+        buf[0] = 0xff;
+        if (++i >= 1000) {
+            clearInterval(iv);
+            buf[0] = 0;
+        }
+        em.emit('data', buf);
+    }, 1);
+    
+    var loops = 0;
+    binary(em)
+        .loop(function (end) {
+            this
+            .word8('x')
+            .word8('y')
+            .word32be('z')
+            .word32le('w')
+            .buffer('buf', 1000 - 10)
+            .tap(function (vars) {
+                loops ++;
+                if (vars.x == 0) end();
+            })
+        })
+        .tap(function () {
+            t.same(loops, 1000);
+        })
+    ;
+});
diff --git a/wrt/node_modules/binary/test/into_buffer.js b/wrt/node_modules/binary/test/into_buffer.js
new file mode 100644 (file)
index 0000000..10d3d4a
--- /dev/null
@@ -0,0 +1,35 @@
+var binary = require('../');
+var test = require('tap').test;
+
+test('intoBuffer', function (t) {
+    t.plan(3);
+    var buf = new Buffer([ 1, 2, 3, 4, 5, 6 ])
+    
+    binary.parse(buf)
+        .into('moo', function () {
+            this
+                .word8('x')
+                .word8('y')
+                .word8('z')
+            ;
+        })
+        .tap(function (vars) {
+            t.same(vars, { moo : { x : 1, y : 2, z : 3 } });
+        })
+        .word8('w')
+        .tap(function (vars) {
+            t.same(vars, {
+                moo : { x : 1, y : 2, z : 3 },
+                w : 4,
+            });
+        })
+        .word8('x')
+        .tap(function (vars) {
+            t.same(vars, {
+                moo : { x : 1, y : 2, z : 3 },
+                w : 4,
+                x : 5,
+            });
+        })
+    ;
+});
diff --git a/wrt/node_modules/binary/test/into_stream.js b/wrt/node_modules/binary/test/into_stream.js
new file mode 100644 (file)
index 0000000..db77092
--- /dev/null
@@ -0,0 +1,43 @@
+var binary = require('../');
+var test = require('tap').test;
+var EventEmitter = require('events').EventEmitter;
+
+test('into stream', function (t) {
+    t.plan(3);
+    
+    var digits = [ 1, 2, 3, 4, 5, 6 ];
+    var stream = new EventEmitter;
+    var iv = setInterval(function () {
+        var d = digits.shift();
+        if (d) stream.emit('data', new Buffer([ d ]))
+        else clearInterval(iv)
+    }, 20);
+    
+    binary.stream(stream)
+        .into('moo', function () {
+            this
+                .word8('x')
+                .word8('y')
+                .word8('z')
+            ;
+        })
+        .tap(function (vars) {
+            t.same(vars, { moo : { x : 1, y : 2, z : 3 } });
+        })
+        .word8('w')
+        .tap(function (vars) {
+            t.same(vars, {
+                moo : { x : 1, y : 2, z : 3 },
+                w : 4,
+            });
+        })
+        .word8('x')
+        .tap(function (vars) {
+            t.same(vars, {
+                moo : { x : 1, y : 2, z : 3 },
+                w : 4,
+                x : 5,
+            });
+        })
+    ;
+});
diff --git a/wrt/node_modules/binary/test/loop.js b/wrt/node_modules/binary/test/loop.js
new file mode 100644 (file)
index 0000000..74576a9
--- /dev/null
@@ -0,0 +1,44 @@
+var binary = require('../');
+var test = require('tap').test;
+var EventEmitter = require('events').EventEmitter;
+
+test('loop', function (t) {
+    t.plan(3 * 2 + 1);
+    
+    var em = new EventEmitter;
+    
+    binary.stream(em)
+        .loop(function (end, vars) {
+            t.strictEqual(vars, this.vars);
+            this
+                .word16lu('a')
+                .word8u('b')
+                .word8s('c')
+                .tap(function (vars_) {
+                    t.strictEqual(vars, vars_);
+                    if (vars.c < 0) end();
+                })
+            ;
+        })
+        .tap(function (vars) {
+            t.same(vars, { a : 1337, b : 55, c : -5 });
+        })
+    ;
+    
+    setTimeout(function () {
+        em.emit('data', new Buffer([ 2, 10, 88 ]));
+    }, 10);
+    setTimeout(function () {
+        em.emit('data', new Buffer([ 100, 3, 6, 242, 30 ]));
+    }, 20);
+    setTimeout(function () {
+        em.emit('data', new Buffer([ 60, 60, 199, 44 ]));
+    }, 30);
+    
+    setTimeout(function () {
+        em.emit('data', new Buffer([ 57, 5 ]));
+    }, 80);
+    setTimeout(function () {
+        em.emit('data', new Buffer([ 55, 251 ]));
+    }, 90);
+});
diff --git a/wrt/node_modules/binary/test/loop_scan.js b/wrt/node_modules/binary/test/loop_scan.js
new file mode 100644 (file)
index 0000000..394603a
--- /dev/null
@@ -0,0 +1,54 @@
+var binary = require('../');
+var test = require('tap').test;
+var EventEmitter = require('events').EventEmitter;
+
+test('loop scan', function (t) {
+    t.plan(8 + 6 + 2);
+    
+    var em = new EventEmitter;
+    
+    binary.stream(em)
+        .loop(function (end) {
+            var vars_ = this.vars;
+            this
+                .scan('filler', 'BEGINMSG')
+                .buffer('cmd', 3)
+                .word8('num')
+                .tap(function (vars) {
+                    t.strictEqual(vars, vars_);
+                    if (vars.num != 0x02 && vars.num != 0x06) {
+                        t.same(vars.filler.length, 0);
+                    }
+                    if (vars.cmd.toString() == 'end') end();
+                })
+            ;
+        })
+        .tap(function (vars) {
+            t.same(vars.cmd.toString(), 'end');
+                       t.same(vars.num, 0x08);
+        })
+    ;
+    
+    setTimeout(function () {
+        em.emit('data', new Buffer(
+            'BEGINMSGcmd\x01'
+            + 'GARBAGEDATAXXXX'
+            + 'BEGINMSGcmd\x02'
+            + 'BEGINMSGcmd\x03'
+        ));
+    }, 10);
+    
+    setTimeout(function () {
+        em.emit('data', new Buffer(
+            'BEGINMSGcmd\x04'
+            + 'BEGINMSGcmd\x05'
+            + 'GARBAGEDATAXXXX'
+            + 'BEGINMSGcmd\x06'
+        ));
+        em.emit('data', new Buffer('BEGINMSGcmd\x07'));
+    }, 20);
+    
+    setTimeout(function () {
+        em.emit('data', new Buffer('BEGINMSGend\x08'));
+    }, 30);
+});
diff --git a/wrt/node_modules/binary/test/lu.js b/wrt/node_modules/binary/test/lu.js
new file mode 100644 (file)
index 0000000..8d3e9e7
--- /dev/null
@@ -0,0 +1,46 @@
+var binary = require('../');
+var test = require('tap').test;
+
+test('lu', function (t) {
+    t.plan(8);
+    
+    // note: can't store -12667700813876161 exactly in an ieee float
+    
+    var buf = new Buffer([
+        44, // a == 44
+        43, 2, // b == 555
+        37, 37, 213, 164, // c == 2765432101
+        193, 203, 115, 155, 20, 180, 81, 29, // d == 2112667700813876161
+    ]);
+    
+    binary.parse(buf)
+        .word8lu('a')
+        .word16lu('b')
+        .word32lu('c')
+        .word64lu('d')
+        .tap(function (vars) {
+            t.same(vars.a, 44);
+            t.same(vars.b, 555);
+            t.same(vars.c, 2765432101);
+            t.ok(
+                Math.abs(vars.d - 2112667700813876161) < 1500
+            );
+        })
+    ;
+    
+    // also check aliases here:
+    binary.parse(buf)
+        .word8le('a')
+        .word16le('b')
+        .word32le('c')
+        .word64le('d')
+        .tap(function (vars) {
+            t.same(vars.a, 44);
+            t.same(vars.b, 555);
+            t.same(vars.c, 2765432101);
+            t.ok(
+                Math.abs(vars.d - 2112667700813876161) < 1500
+            );
+        })
+    ;
+});
diff --git a/wrt/node_modules/binary/test/negbs.js b/wrt/node_modules/binary/test/negbs.js
new file mode 100644 (file)
index 0000000..dd23a9a
--- /dev/null
@@ -0,0 +1,29 @@
+var binary = require('../');
+var test = require('tap').test;
+
+test('negbs', function (t) {
+    t.plan(4);
+    // note: can't store -12667700813876161 exactly in an ieee float
+    
+    var buf = new Buffer([
+        226, // a == -30
+        246, 219, // b == -2341
+        255, 243, 245, 236, // c == -789012
+        255, 210, 254, 203, 16, 222, 52, 63, // d == -12667700813876161
+    ]);
+    
+    binary.parse(buf)
+        .word8bs('a')
+        .word16bs('b')
+        .word32bs('c')
+        .word64bs('d')
+        .tap(function (vars) {
+            t.same(vars.a, -30);
+            t.same(vars.b, -2341);
+            t.same(vars.c, -789012);
+            t.ok(
+                Math.abs(vars.d - -12667700813876161) < 1500
+            );
+        })
+    ;
+});
diff --git a/wrt/node_modules/binary/test/negls.js b/wrt/node_modules/binary/test/negls.js
new file mode 100644 (file)
index 0000000..2a229f4
--- /dev/null
@@ -0,0 +1,29 @@
+var binary = require('../');
+var test = require('tap').test;
+
+test('negls', function (t) {
+    t.plan(4);
+    // note: can't store -12667700813876161 exactly in an ieee float
+    
+    var buf = new Buffer([
+        226, // a == -30
+        219, 246, // b == -2341
+        236, 245, 243, 255, // c == -789012
+        63, 52, 222, 16, 203, 254, 210, 255, // d == -12667700813876161
+    ]);
+    
+    binary.parse(buf)
+        .word8ls('a')
+        .word16ls('b')
+        .word32ls('c')
+        .word64ls('d')
+        .tap(function (vars) {
+            t.same(vars.a, -30);
+            t.same(vars.b, -2341);
+            t.same(vars.c, -789012);
+            t.ok(
+                Math.abs(vars.d - -12667700813876161) < 1000
+            );
+        })
+    ;
+});
diff --git a/wrt/node_modules/binary/test/nested.js b/wrt/node_modules/binary/test/nested.js
new file mode 100644 (file)
index 0000000..869d51c
--- /dev/null
@@ -0,0 +1,35 @@
+var binary = require('../');
+var test = require('tap').test;
+var EventEmitter = require('events').EventEmitter;
+
+test('nested', function (t) {
+    t.plan(3);
+    var insideDone = false;
+    
+    var em = new EventEmitter;
+    binary.stream(em)
+        .word16be('ab')
+        .tap(function () {
+            this
+                .word8('c')
+                .word8('d')
+                .tap(function () {
+                    insideDone = true;
+                })
+            ;
+        })
+        .tap(function (vars) {
+            t.ok(insideDone);
+            t.same(vars.c, 'c'.charCodeAt(0));
+            t.same(vars.d, 'd'.charCodeAt(0));
+            
+        })
+    ;
+    
+    var strs = [ 'abc', 'def', 'hi', 'jkl' ];
+    var iv = setInterval(function () {
+        var s = strs.shift();
+        if (s) em.emit('data', new Buffer(s));
+        else clearInterval(iv);
+    }, 50);
+});
diff --git a/wrt/node_modules/binary/test/not_enough_buf.js b/wrt/node_modules/binary/test/not_enough_buf.js
new file mode 100644 (file)
index 0000000..bbf8fff
--- /dev/null
@@ -0,0 +1,17 @@
+var binary = require('../');
+var test = require('tap').test;
+
+test('not enough buf', function (t) {
+    t.plan(3);
+    
+    var vars = binary(new Buffer([1,2,3,4]))
+        .word8('a')
+        .buffer('b', 10)
+        .word8('c')
+        .vars
+    ;
+    
+    t.same(vars.a, 1);
+    t.equal(vars.b.toString(), new Buffer([2,3,4]).toString());
+    t.strictEqual(vars.c, null);
+});
diff --git a/wrt/node_modules/binary/test/not_enough_parse.js b/wrt/node_modules/binary/test/not_enough_parse.js
new file mode 100644 (file)
index 0000000..f9a32e2
--- /dev/null
@@ -0,0 +1,19 @@
+var binary = require('../');
+var test = require('tap').test;
+
+test('not enough parse', function (t) {
+    t.plan(4);
+    
+    var vars = binary(new Buffer([1,2]))
+        .word8('a')
+        .word8('b')
+        .word8('c')
+        .word8('d')
+        .vars
+    ;
+    
+    t.same(vars.a, 1);
+    t.same(vars.b, 2);
+    t.strictEqual(vars.c, null);
+    t.strictEqual(vars.d, null);
+});
diff --git a/wrt/node_modules/binary/test/parse.js b/wrt/node_modules/binary/test/parse.js
new file mode 100644 (file)
index 0000000..fbc9f5b
--- /dev/null
@@ -0,0 +1,54 @@
+var binary = require('../');
+var test = require('tap').test;
+
+test('parse', function (t) {
+    t.plan(6);
+    var res = binary.parse(new Buffer([ 97, 98, 99, 99, 99, 99, 1, 2, 3 ]))
+        .word8('a')
+        .word16be('bc')
+        .skip(3)
+        .buffer('def', 3)
+        .tap(function (vars) {
+            t.equal(vars.a, 97);
+            t.equal(vars.bc, 25187);
+            t.same(
+                [].slice.call(vars.def),
+                [].slice.call(new Buffer([ 1, 2, 3]))
+            );
+        })
+        .vars
+    ;
+    t.equal(res.a, 97);
+    t.equal(res.bc, 25187);
+    t.same(
+        [].slice.call(res.def),
+        [].slice.call(new Buffer([ 1, 2, 3 ]))
+    );
+});
+
+test('loop', function (t) {
+    t.plan(2);
+    var res = binary.parse(new Buffer([ 97, 98, 99, 4, 5, 2, -3, 9 ]))
+        .word8('a')
+        .word16be('bc')
+        .loop(function (end) {
+            var x = this.word8s('x').vars.x;
+            if (x < 0) end();
+        })
+        .tap(function (vars) {
+            t.same(vars, {
+                a : 97,
+                bc : 25187,
+                x : -3,
+            });
+        })
+        .word8('y')
+        .vars
+    ;
+    t.same(res, {
+        a : 97,
+        bc : 25187,
+        x : -3,
+        y : 9,
+    });
+});
diff --git a/wrt/node_modules/binary/test/peek.js b/wrt/node_modules/binary/test/peek.js
new file mode 100644 (file)
index 0000000..00109d3
--- /dev/null
@@ -0,0 +1,40 @@
+var binary = require('../');
+var test = require('tap').test;
+var EventEmitter = require('events').EventEmitter;
+
+test('peek', function (t) {
+    t.plan(4);
+    var bufs = [
+        new Buffer([ 6, 1, 6, 1, 6, 9, 0, 0, 0, 97 ]),
+        new Buffer([ 98, 99 ]),
+        new Buffer([ 100, 101, 102 ]),
+    ];
+    
+    var stream = new EventEmitter;
+    var iv = setInterval(function () {
+        var buf = bufs.shift();
+        if (buf) stream.emit('data', buf)
+        else clearInterval(iv)
+    }, 20);
+    
+    binary.stream(stream)
+        .buffer('sixone', 5)
+        .peek(function () {
+            this.word32le('len');
+        })
+        .buffer('buf', 'len')
+        .word8('x')
+        .tap(function (vars) {
+            t.same(
+                [].slice.call(vars.sixone),
+                [].slice.call(new Buffer([ 6, 1, 6, 1, 6 ]))
+            );
+            t.same(vars.buf.length, vars.len);
+            t.same(
+                [].slice.call(vars.buf),
+                [ 9, 0, 0, 0, 97, 98, 99, 100, 101 ]
+            );
+            t.same(vars.x, 102);
+        })
+    ;
+});
diff --git a/wrt/node_modules/binary/test/pipe.js b/wrt/node_modules/binary/test/pipe.js
new file mode 100644 (file)
index 0000000..7c260cd
--- /dev/null
@@ -0,0 +1,49 @@
+var binary = require('../');
+var test = require('tap').test;
+var Stream = require('stream').Stream;
+
+test('loop', function (t) {
+    t.plan(3 * 2 + 1);
+    
+    var rs = new Stream;
+    rs.readable = true;
+    
+    var ws = binary()
+        .loop(function (end, vars) {
+            t.strictEqual(vars, this.vars);
+            this
+                .word16lu('a')
+                .word8u('b')
+                .word8s('c')
+                .tap(function (vars_) {
+                    t.strictEqual(vars, vars_);
+                    if (vars.c < 0) end();
+                })
+            ;
+        })
+        .tap(function (vars) {
+            t.same(vars, { a : 1337, b : 55, c : -5 });
+        })
+    ;
+    rs.pipe(ws);
+    
+    setTimeout(function () {
+        rs.emit('data', new Buffer([ 2, 10, 88 ]));
+    }, 10);
+    setTimeout(function () {
+        rs.emit('data', new Buffer([ 100, 3, 6, 242, 30 ]));
+    }, 20);
+    setTimeout(function () {
+        rs.emit('data', new Buffer([ 60, 60, 199, 44 ]));
+    }, 30);
+    
+    setTimeout(function () {
+        rs.emit('data', new Buffer([ 57, 5 ]));
+    }, 80);
+    setTimeout(function () {
+        rs.emit('data', new Buffer([ 55, 251 ]));
+    }, 90);
+    setTimeout(function () {
+        rs.emit('end');
+    }, 100);
+});
diff --git a/wrt/node_modules/binary/test/posbs.js b/wrt/node_modules/binary/test/posbs.js
new file mode 100644 (file)
index 0000000..0642948
--- /dev/null
@@ -0,0 +1,29 @@
+var binary = require('../');
+var test = require('tap').test;
+
+test('posbs', function (t) {
+    t.plan(4);
+    // note: can't store 12667700813876161 exactly in an ieee float
+    
+    var buf = new Buffer([
+        30, // a == -30
+        9, 37, // b == -2341
+        0, 12, 10, 20, // c == -789012
+        0, 45, 1, 52, 239, 33, 203, 193, // d == 12667700813876161
+    ]);
+    
+    binary.parse(buf)
+        .word8bs('a')
+        .word16bs('b')
+        .word32bs('c')
+        .word64bs('d')
+        .tap(function (vars) {
+            t.same(vars.a, 30);
+            t.same(vars.b, 2341);
+            t.same(vars.c, 789012);
+            t.ok(
+                Math.abs(vars.d - 12667700813876161) < 1000
+            );
+        })
+    ;
+});
diff --git a/wrt/node_modules/binary/test/posls.js b/wrt/node_modules/binary/test/posls.js
new file mode 100644 (file)
index 0000000..2b8f208
--- /dev/null
@@ -0,0 +1,29 @@
+var binary = require('../');
+var test = require('tap').test;
+
+test('posls', function (t) {
+    t.plan(4);
+    
+    // note: can't store 12667700813876161 exactly in an ieee float
+    var buf = new Buffer([
+        30, // a == -30
+        37, 9, // b == -2341
+        20, 10, 12, 0, // c == -789012
+        193, 203, 33, 239, 52, 1, 45, 0, // d == 12667700813876161
+    ]);
+    
+    binary.parse(buf)
+        .word8ls('a')
+        .word16ls('b')
+        .word32ls('c')
+        .word64ls('d')
+        .tap(function (vars) {
+            t.same(vars.a, 30);
+            t.same(vars.b, 2341);
+            t.same(vars.c, 789012);
+            t.ok(
+                Math.abs(vars.d - 12667700813876161) < 1000
+            );
+        })
+    ;
+});
diff --git a/wrt/node_modules/binary/test/scan.js b/wrt/node_modules/binary/test/scan.js
new file mode 100644 (file)
index 0000000..6acf2b2
--- /dev/null
@@ -0,0 +1,33 @@
+var binary = require('../');
+var test = require('tap').test;
+var EventEmitter = require('events').EventEmitter;
+
+test('scan', function (t) {
+    t.plan(4);
+    
+    var em = new EventEmitter;
+    binary(em)
+        .word8('a')
+        .scan('l1', new Buffer('\r\n'))
+        .scan('l2', '\r\n')
+        .word8('z')
+        .tap(function (vars) {
+            t.same(vars.a, 99);
+            t.same(vars.l1.toString(), 'foo bar');
+            t.same(vars.l2.toString(), 'baz');
+            t.same(vars.z, 42);
+        })
+    ;
+    
+    setTimeout(function () {
+        em.emit('data', new Buffer([99,0x66,0x6f,0x6f,0x20]));
+    }, 20);
+    
+    setTimeout(function () {
+        em.emit('data', new Buffer('bar\r'));
+    }, 40);
+    
+    setTimeout(function () {
+        em.emit('data', new Buffer('\nbaz\r\n*'));
+    }, 60);
+});
diff --git a/wrt/node_modules/binary/test/scan_buf.js b/wrt/node_modules/binary/test/scan_buf.js
new file mode 100644 (file)
index 0000000..5e975c8
--- /dev/null
@@ -0,0 +1,18 @@
+var binary = require('../');
+var test = require('tap').test;
+
+test('scan buf', function (t) {
+    t.plan(4);
+    
+    var vars = binary(new Buffer('\x63foo bar\r\nbaz\r\n*'))
+        .word8('a')
+        .scan('l1', new Buffer('\r\n'))
+        .scan('l2', '\r\n')
+        .word8('z')
+        .vars
+    ;
+    t.same(vars.a, 99);
+    t.same(vars.z, 42);
+    t.same(vars.l1.toString(), 'foo bar');
+    t.same(vars.l2.toString(), 'baz');
+});
diff --git a/wrt/node_modules/binary/test/scan_buf_null.js b/wrt/node_modules/binary/test/scan_buf_null.js
new file mode 100644 (file)
index 0000000..96d9767
--- /dev/null
@@ -0,0 +1,16 @@
+var binary = require('../');
+var test = require('tap').test;
+
+test('scan buf null', function (t) {
+    t.plan(3);
+    var vars = binary(new Buffer('\x63foo bar baz'))
+        .word8('a')
+        .scan('b', '\r\n')
+        .word8('c')
+        .vars
+    ;
+    
+    t.same(vars.a, 99);
+    t.same(vars.b.toString(), 'foo bar baz');
+    t.strictEqual(vars.c, null);
+});
diff --git a/wrt/node_modules/binary/test/skip.js b/wrt/node_modules/binary/test/skip.js
new file mode 100644 (file)
index 0000000..6a26051
--- /dev/null
@@ -0,0 +1,58 @@
+var binary = require('../');
+var test = require('tap').test;
+var EventEmitter = require('events').EventEmitter;
+var seq = require('seq');
+
+test('skip', function (t) {
+    t.plan(7);
+    var em = new EventEmitter;
+    var state = 0;
+    
+    binary(em)
+        .word16lu('a')
+        .tap(function () { state = 1 })
+        .skip(7)
+        .tap(function () { state = 2 })
+        .word8('b')
+        .tap(function () { state = 3 })
+        .tap(function (vars) {
+            t.same(state, 3);
+            t.same(vars, {
+                a : 2569,
+                b : 8,
+            });
+        })
+    ;
+    
+    seq()
+        .seq(setTimeout, seq, 20)
+        .seq(function () {
+            t.same(state, 0);
+            em.emit('data', new Buffer([ 9 ]));
+            this(null);
+        })
+        .seq(setTimeout, seq, 5)
+        .seq(function () {
+            t.same(state, 0);
+            em.emit('data', new Buffer([ 10, 1, 2 ]));
+            this(null);
+        })
+        .seq(setTimeout, seq, 30)
+        .seq(function () {
+            t.same(state, 1);
+            em.emit('data', new Buffer([ 3, 4, 5 ]));
+            this(null);
+        })
+        .seq(setTimeout, seq, 15)
+        .seq(function () {
+            t.same(state, 1);
+            em.emit('data', new Buffer([ 6, 7 ]));
+            this(null);
+        })
+        .seq(function () {
+            t.same(state, 2);
+            em.emit('data', new Buffer([ 8 ]));
+            this(null);
+        })
+    ;
+});
diff --git a/wrt/node_modules/binary/test/split.js b/wrt/node_modules/binary/test/split.js
new file mode 100644 (file)
index 0000000..cb9dffc
--- /dev/null
@@ -0,0 +1,34 @@
+var binary = require('../');
+var test = require('tap').test;
+var EventEmitter = require('events').EventEmitter;
+
+test('split', function (t) {
+    t.plan(1);
+    
+    var em = new EventEmitter;
+    binary.stream(em)
+        .word8('a')
+        .word16be('bc')
+        .word32ls('x')
+        .word32bs('y')
+        .tap(function (vars) {
+            t.same(vars, {
+                a : 97,
+                bc : 25187,
+                x : 621609828,
+                y : 621609828,
+            });
+        })
+    ;
+    
+    em.emit('data', new Buffer([ 97, 98 ]));
+    setTimeout(function () {
+        em.emit('data', new Buffer([ 99, 100 ]));
+    }, 25);
+    setTimeout(function () {
+        em.emit('data', new Buffer([ 3, 13, 37, 37 ]));
+    }, 30);
+    setTimeout(function () {
+        em.emit('data', new Buffer([ 13, 3, 100 ]));
+    }, 40);
+});
diff --git a/wrt/node_modules/blob/.npmignore b/wrt/node_modules/blob/.npmignore
new file mode 100644 (file)
index 0000000..548a368
--- /dev/null
@@ -0,0 +1,2 @@
+node_modules
+blob.js
diff --git a/wrt/node_modules/blob/.zuul.yml b/wrt/node_modules/blob/.zuul.yml
new file mode 100644 (file)
index 0000000..380c395
--- /dev/null
@@ -0,0 +1,14 @@
+ui: mocha-bdd
+browsers:
+  - name: chrome
+    version: 8..latest
+  - name: firefox
+    version: 7..latest
+  - name: safari
+    version: 6..latest
+  - name: opera
+    version: 12.1..latest
+  - name: ie
+    version: 10..latest
+  - name: android
+    version: latest
diff --git a/wrt/node_modules/blob/Makefile b/wrt/node_modules/blob/Makefile
new file mode 100644 (file)
index 0000000..7d9601a
--- /dev/null
@@ -0,0 +1,14 @@
+REPORTER = dot
+
+build: blob.js
+
+blob.js:
+       @./node_modules/.bin/browserify --standalone blob index.js > blob.js
+
+test:
+       @./node_modules/.bin/zuul -- test/index.js
+
+clean:
+       rm blob.js
+
+.PHONY: test blob.js
diff --git a/wrt/node_modules/blob/README.md b/wrt/node_modules/blob/README.md
new file mode 100644 (file)
index 0000000..6915955
--- /dev/null
@@ -0,0 +1,14 @@
+Blob
+====
+
+A module that exports a constructor that uses window.Blob when available, and a BlobBuilder with any vendor prefix in other cases. If neither is available, it exports undefined.
+
+Usage:
+
+```javascript
+var Blob = require('blob');
+var b = new Blob(['hi', 'constructing', 'a', 'blob']);
+```
+
+## Licence
+MIT
diff --git a/wrt/node_modules/blob/index.js b/wrt/node_modules/blob/index.js
new file mode 100644 (file)
index 0000000..cad3f84
--- /dev/null
@@ -0,0 +1,96 @@
+/**
+ * Create a blob builder even when vendor prefixes exist
+ */
+
+var BlobBuilder = global.BlobBuilder
+  || global.WebKitBlobBuilder
+  || global.MSBlobBuilder
+  || global.MozBlobBuilder;
+
+/**
+ * Check if Blob constructor is supported
+ */
+
+var blobSupported = (function() {
+  try {
+    var a = new Blob(['hi']);
+    return a.size === 2;
+  } catch(e) {
+    return false;
+  }
+})();
+
+/**
+ * Check if Blob constructor supports ArrayBufferViews
+ * Fails in Safari 6, so we need to map to ArrayBuffers there.
+ */
+
+var blobSupportsArrayBufferView = blobSupported && (function() {
+  try {
+    var b = new Blob([new Uint8Array([1,2])]);
+    return b.size === 2;
+  } catch(e) {
+    return false;
+  }
+})();
+
+/**
+ * Check if BlobBuilder is supported
+ */
+
+var blobBuilderSupported = BlobBuilder
+  && BlobBuilder.prototype.append
+  && BlobBuilder.prototype.getBlob;
+
+/**
+ * Helper function that maps ArrayBufferViews to ArrayBuffers
+ * Used by BlobBuilder constructor and old browsers that didn't
+ * support it in the Blob constructor.
+ */
+
+function mapArrayBufferViews(ary) {
+  for (var i = 0; i < ary.length; i++) {
+    var chunk = ary[i];
+    if (chunk.buffer instanceof ArrayBuffer) {
+      var buf = chunk.buffer;
+
+      // if this is a subarray, make a copy so we only
+      // include the subarray region from the underlying buffer
+      if (chunk.byteLength !== buf.byteLength) {
+        var copy = new Uint8Array(chunk.byteLength);
+        copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));
+        buf = copy.buffer;
+      }
+
+      ary[i] = buf;
+    }
+  }
+}
+
+function BlobBuilderConstructor(ary, options) {
+  options = options || {};
+
+  var bb = new BlobBuilder();
+  mapArrayBufferViews(ary);
+
+  for (var i = 0; i < ary.length; i++) {
+    bb.append(ary[i]);
+  }
+
+  return (options.type) ? bb.getBlob(options.type) : bb.getBlob();
+};
+
+function BlobConstructor(ary, options) {
+  mapArrayBufferViews(ary);
+  return new Blob(ary, options || {});
+};
+
+module.exports = (function() {
+  if (blobSupported) {
+    return blobSupportsArrayBufferView ? global.Blob : BlobConstructor;
+  } else if (blobBuilderSupported) {
+    return BlobBuilderConstructor;
+  } else {
+    return undefined;
+  }
+})();
diff --git a/wrt/node_modules/blob/package.json b/wrt/node_modules/blob/package.json
new file mode 100644 (file)
index 0000000..4431ad0
--- /dev/null
@@ -0,0 +1,77 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "blob@0.0.4",
+        "scope": null,
+        "escapedName": "blob",
+        "name": "blob",
+        "rawSpec": "0.0.4",
+        "spec": "0.0.4",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io-parser"
+    ]
+  ],
+  "_from": "blob@0.0.4",
+  "_id": "blob@0.0.4",
+  "_inCache": true,
+  "_location": "/blob",
+  "_npmUser": {
+    "name": "rase-",
+    "email": "tonykovanen@hotmail.com"
+  },
+  "_npmVersion": "1.4.6",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "blob@0.0.4",
+    "scope": null,
+    "escapedName": "blob",
+    "name": "blob",
+    "rawSpec": "0.0.4",
+    "spec": "0.0.4",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/engine.io-parser"
+  ],
+  "_resolved": "https://registry.npmjs.org/blob/-/blob-0.0.4.tgz",
+  "_shasum": "bcf13052ca54463f30f9fc7e95b9a47630a94921",
+  "_shrinkwrap": null,
+  "_spec": "blob@0.0.4",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io-parser",
+  "bugs": {
+    "url": "https://github.com/rase-/blob/issues"
+  },
+  "dependencies": {},
+  "description": "Abstracts out Blob and uses BlobBulder in cases where it is supported with any vendor prefix.",
+  "devDependencies": {
+    "browserify": "3.30.1",
+    "expect.js": "0.2.0",
+    "mocha": "1.17.1",
+    "zuul": "1.5.4"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "bcf13052ca54463f30f9fc7e95b9a47630a94921",
+    "tarball": "https://registry.npmjs.org/blob/-/blob-0.0.4.tgz"
+  },
+  "homepage": "https://github.com/rase-/blob",
+  "maintainers": [
+    {
+      "name": "rase-",
+      "email": "tonykovanen@hotmail.com"
+    }
+  ],
+  "name": "blob",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+ssh://git@github.com/rase-/blob.git"
+  },
+  "scripts": {
+    "test": "make test"
+  },
+  "version": "0.0.4"
+}
diff --git a/wrt/node_modules/blob/test/index.js b/wrt/node_modules/blob/test/index.js
new file mode 100644 (file)
index 0000000..df9303f
--- /dev/null
@@ -0,0 +1,94 @@
+var Blob = require('../');
+var expect = require('expect.js');
+
+describe('blob', function() {
+  if (!Blob) {
+    it('should not have a blob or a blob builder in the global namespace, or blob should not be a constructor function if the module exports false', function() {
+      try {
+        var ab = (new Uint8Array(5)).buffer;
+        global.Blob([ab]);
+        expect().fail('Blob shouldn\'t be constructable');
+      } catch (e) {}
+
+      var BlobBuilder = global.BlobBuilder
+        || global.WebKitBlobBuilder
+        || global.MSBlobBuilder
+        || global.MozBlobBuilder;
+      expect(BlobBuilder).to.be(undefined);
+    });
+  } else {
+    it('should encode a proper sized blob when given a string argument', function() {
+      var b = new Blob(['hi']);
+      expect(b.size).to.be(2);
+    });
+
+    it('should encode a blob with proper size when given two strings as arguments', function() {
+      var b = new Blob(['hi', 'hello']);
+      expect(b.size).to.be(7);
+    });
+
+    it('should encode arraybuffers with right content', function(done) {
+      var ary = new Uint8Array(5);
+      for (var i = 0; i < 5; i++) ary[i] = i;
+      var b = new Blob([ary.buffer]);
+      var fr = new FileReader();
+      fr.onload = function() {
+        var newAry = new Uint8Array(this.result);
+        for (var i = 0; i < 5; i++) expect(newAry[i]).to.be(i);
+        done();
+      };
+      fr.readAsArrayBuffer(b);
+    });
+
+    it('should encode typed arrays with right content', function(done) {
+      var ary = new Uint8Array(5);
+      for (var i = 0; i < 5; i++) ary[i] = i;
+      var b = new Blob([ary]);
+      var fr = new FileReader();
+      fr.onload = function() {
+        var newAry = new Uint8Array(this.result);
+        for (var i = 0; i < 5; i++) expect(newAry[i]).to.be(i);
+        done();
+      };
+      fr.readAsArrayBuffer(b);
+    });
+
+    it('should encode sliced typed arrays with right content', function(done) {
+      var ary = new Uint8Array(5);
+      for (var i = 0; i < 5; i++) ary[i] = i;
+      var b = new Blob([ary.subarray(2)]);
+      var fr = new FileReader();
+      fr.onload = function() {
+        var newAry = new Uint8Array(this.result);
+        for (var i = 0; i < 3; i++) expect(newAry[i]).to.be(i + 2);
+        done();
+      };
+      fr.readAsArrayBuffer(b);
+    });
+
+    it('should encode with blobs', function(done) {
+      var ary = new Uint8Array(5);
+      for (var i = 0; i < 5; i++) ary[i] = i;
+      var b = new Blob([new Blob([ary.buffer])]);
+      var fr = new FileReader();
+      fr.onload = function() {
+        var newAry = new Uint8Array(this.result);
+        for (var i = 0; i < 5; i++) expect(newAry[i]).to.be(i);
+        done();
+      };
+      fr.readAsArrayBuffer(b);
+    });
+
+    it('should enode mixed contents to right size', function() {
+      var ary = new Uint8Array(5);
+      for (var i = 0; i < 5; i++) ary[i] = i;
+      var b = new Blob([ary.buffer, 'hello']);
+      expect(b.size).to.be(10);
+    });
+
+    it('should accept mime type', function() {
+      var b = new Blob(['hi', 'hello'], { type: 'text/html' });
+      expect(b.type).to.be('text/html');
+    });
+  }
+});
diff --git a/wrt/node_modules/brace-expansion/README.md b/wrt/node_modules/brace-expansion/README.md
new file mode 100644 (file)
index 0000000..ed2ec1f
--- /dev/null
@@ -0,0 +1,123 @@
+# brace-expansion
+
+[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), 
+as known from sh/bash, in JavaScript.
+
+[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion)
+[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion)
+[![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/)
+
+[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion)
+
+## Example
+
+```js
+var expand = require('brace-expansion');
+
+expand('file-{a,b,c}.jpg')
+// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
+
+expand('-v{,,}')
+// => ['-v', '-v', '-v']
+
+expand('file{0..2}.jpg')
+// => ['file0.jpg', 'file1.jpg', 'file2.jpg']
+
+expand('file-{a..c}.jpg')
+// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
+
+expand('file{2..0}.jpg')
+// => ['file2.jpg', 'file1.jpg', 'file0.jpg']
+
+expand('file{0..4..2}.jpg')
+// => ['file0.jpg', 'file2.jpg', 'file4.jpg']
+
+expand('file-{a..e..2}.jpg')
+// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg']
+
+expand('file{00..10..5}.jpg')
+// => ['file00.jpg', 'file05.jpg', 'file10.jpg']
+
+expand('{{A..C},{a..c}}')
+// => ['A', 'B', 'C', 'a', 'b', 'c']
+
+expand('ppp{,config,oe{,conf}}')
+// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf']
+```
+
+## API
+
+```js
+var expand = require('brace-expansion');
+```
+
+### var expanded = expand(str)
+
+Return an array of all possible and valid expansions of `str`. If none are
+found, `[str]` is returned.
+
+Valid expansions are:
+
+```js
+/^(.*,)+(.+)?$/
+// {a,b,...}
+```
+
+A comma seperated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`.
+
+```js
+/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
+// {x..y[..incr]}
+```
+
+A numeric sequence from `x` to `y` inclusive, with optional increment.
+If `x` or `y` start with a leading `0`, all the numbers will be padded
+to have equal length. Negative numbers and backwards iteration work too.
+
+```js
+/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
+// {x..y[..incr]}
+```
+
+An alphabetic sequence from `x` to `y` inclusive, with optional increment.
+`x` and `y` must be exactly one character, and if given, `incr` must be a
+number.
+
+For compatibility reasons, the string `${` is not eligible for brace expansion.
+
+## Installation
+
+With [npm](https://npmjs.org) do:
+
+```bash
+npm install brace-expansion
+```
+
+## Contributors
+
+- [Julian Gruber](https://github.com/juliangruber)
+- [Isaac Z. Schlueter](https://github.com/isaacs)
+
+## License
+
+(MIT)
+
+Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/wrt/node_modules/brace-expansion/index.js b/wrt/node_modules/brace-expansion/index.js
new file mode 100644 (file)
index 0000000..0478be8
--- /dev/null
@@ -0,0 +1,201 @@
+var concatMap = require('concat-map');
+var balanced = require('balanced-match');
+
+module.exports = expandTop;
+
+var escSlash = '\0SLASH'+Math.random()+'\0';
+var escOpen = '\0OPEN'+Math.random()+'\0';
+var escClose = '\0CLOSE'+Math.random()+'\0';
+var escComma = '\0COMMA'+Math.random()+'\0';
+var escPeriod = '\0PERIOD'+Math.random()+'\0';
+
+function numeric(str) {
+  return parseInt(str, 10) == str
+    ? parseInt(str, 10)
+    : str.charCodeAt(0);
+}
+
+function escapeBraces(str) {
+  return str.split('\\\\').join(escSlash)
+            .split('\\{').join(escOpen)
+            .split('\\}').join(escClose)
+            .split('\\,').join(escComma)
+            .split('\\.').join(escPeriod);
+}
+
+function unescapeBraces(str) {
+  return str.split(escSlash).join('\\')
+            .split(escOpen).join('{')
+            .split(escClose).join('}')
+            .split(escComma).join(',')
+            .split(escPeriod).join('.');
+}
+
+
+// Basically just str.split(","), but handling cases
+// where we have nested braced sections, which should be
+// treated as individual members, like {a,{b,c},d}
+function parseCommaParts(str) {
+  if (!str)
+    return [''];
+
+  var parts = [];
+  var m = balanced('{', '}', str);
+
+  if (!m)
+    return str.split(',');
+
+  var pre = m.pre;
+  var body = m.body;
+  var post = m.post;
+  var p = pre.split(',');
+
+  p[p.length-1] += '{' + body + '}';
+  var postParts = parseCommaParts(post);
+  if (post.length) {
+    p[p.length-1] += postParts.shift();
+    p.push.apply(p, postParts);
+  }
+
+  parts.push.apply(parts, p);
+
+  return parts;
+}
+
+function expandTop(str) {
+  if (!str)
+    return [];
+
+  // I don't know why Bash 4.3 does this, but it does.
+  // Anything starting with {} will have the first two bytes preserved
+  // but *only* at the top level, so {},a}b will not expand to anything,
+  // but a{},b}c will be expanded to [a}c,abc].
+  // One could argue that this is a bug in Bash, but since the goal of
+  // this module is to match Bash's rules, we escape a leading {}
+  if (str.substr(0, 2) === '{}') {
+    str = '\\{\\}' + str.substr(2);
+  }
+
+  return expand(escapeBraces(str), true).map(unescapeBraces);
+}
+
+function identity(e) {
+  return e;
+}
+
+function embrace(str) {
+  return '{' + str + '}';
+}
+function isPadded(el) {
+  return /^-?0\d/.test(el);
+}
+
+function lte(i, y) {
+  return i <= y;
+}
+function gte(i, y) {
+  return i >= y;
+}
+
+function expand(str, isTop) {
+  var expansions = [];
+
+  var m = balanced('{', '}', str);
+  if (!m || /\$$/.test(m.pre)) return [str];
+
+  var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
+  var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
+  var isSequence = isNumericSequence || isAlphaSequence;
+  var isOptions = m.body.indexOf(',') >= 0;
+  if (!isSequence && !isOptions) {
+    // {a},b}
+    if (m.post.match(/,.*\}/)) {
+      str = m.pre + '{' + m.body + escClose + m.post;
+      return expand(str);
+    }
+    return [str];
+  }
+
+  var n;
+  if (isSequence) {
+    n = m.body.split(/\.\./);
+  } else {
+    n = parseCommaParts(m.body);
+    if (n.length === 1) {
+      // x{{a,b}}y ==> x{a}y x{b}y
+      n = expand(n[0], false).map(embrace);
+      if (n.length === 1) {
+        var post = m.post.length
+          ? expand(m.post, false)
+          : [''];
+        return post.map(function(p) {
+          return m.pre + n[0] + p;
+        });
+      }
+    }
+  }
+
+  // at this point, n is the parts, and we know it's not a comma set
+  // with a single entry.
+
+  // no need to expand pre, since it is guaranteed to be free of brace-sets
+  var pre = m.pre;
+  var post = m.post.length
+    ? expand(m.post, false)
+    : [''];
+
+  var N;
+
+  if (isSequence) {
+    var x = numeric(n[0]);
+    var y = numeric(n[1]);
+    var width = Math.max(n[0].length, n[1].length)
+    var incr = n.length == 3
+      ? Math.abs(numeric(n[2]))
+      : 1;
+    var test = lte;
+    var reverse = y < x;
+    if (reverse) {
+      incr *= -1;
+      test = gte;
+    }
+    var pad = n.some(isPadded);
+
+    N = [];
+
+    for (var i = x; test(i, y); i += incr) {
+      var c;
+      if (isAlphaSequence) {
+        c = String.fromCharCode(i);
+        if (c === '\\')
+          c = '';
+      } else {
+        c = String(i);
+        if (pad) {
+          var need = width - c.length;
+          if (need > 0) {
+            var z = new Array(need + 1).join('0');
+            if (i < 0)
+              c = '-' + z + c.slice(1);
+            else
+              c = z + c;
+          }
+        }
+      }
+      N.push(c);
+    }
+  } else {
+    N = concatMap(n, function(el) { return expand(el, false) });
+  }
+
+  for (var j = 0; j < N.length; j++) {
+    for (var k = 0; k < post.length; k++) {
+      var expansion = pre + N[j] + post[k];
+      if (!isTop || isSequence || expansion)
+        expansions.push(expansion);
+    }
+  }
+
+  return expansions;
+}
+
diff --git a/wrt/node_modules/brace-expansion/package.json b/wrt/node_modules/brace-expansion/package.json
new file mode 100644 (file)
index 0000000..6a3dfd3
--- /dev/null
@@ -0,0 +1,76 @@
+{
+  "_from": "brace-expansion@^1.1.7",
+  "_id": "brace-expansion@1.1.8",
+  "_inBundle": false,
+  "_integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=",
+  "_location": "/brace-expansion",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "brace-expansion@^1.1.7",
+    "name": "brace-expansion",
+    "escapedName": "brace-expansion",
+    "rawSpec": "^1.1.7",
+    "saveSpec": null,
+    "fetchSpec": "^1.1.7"
+  },
+  "_requiredBy": [
+    "/asar/minimatch",
+    "/minimatch"
+  ],
+  "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz",
+  "_shasum": "c07b211c7c952ec1f8efd51a77ef0d1d3990a292",
+  "_spec": "brace-expansion@^1.1.7",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was/node_modules/minimatch",
+  "author": {
+    "name": "Julian Gruber",
+    "email": "mail@juliangruber.com",
+    "url": "http://juliangruber.com"
+  },
+  "bugs": {
+    "url": "https://github.com/juliangruber/brace-expansion/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {
+    "balanced-match": "^1.0.0",
+    "concat-map": "0.0.1"
+  },
+  "deprecated": false,
+  "description": "Brace expansion as known from sh/bash",
+  "devDependencies": {
+    "matcha": "^0.7.0",
+    "tape": "^4.6.0"
+  },
+  "homepage": "https://github.com/juliangruber/brace-expansion",
+  "keywords": [],
+  "license": "MIT",
+  "main": "index.js",
+  "name": "brace-expansion",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/juliangruber/brace-expansion.git"
+  },
+  "scripts": {
+    "bench": "matcha test/perf/bench.js",
+    "gentest": "bash test/generate.sh",
+    "test": "tape test/*.js"
+  },
+  "testling": {
+    "files": "test/*.js",
+    "browsers": [
+      "ie/8..latest",
+      "firefox/20..latest",
+      "firefox/nightly",
+      "chrome/25..latest",
+      "chrome/canary",
+      "opera/12..latest",
+      "opera/next",
+      "safari/5.1..latest",
+      "ipad/6.0..latest",
+      "iphone/6.0..latest",
+      "android-browser/4.2..latest"
+    ]
+  },
+  "version": "1.1.8"
+}
diff --git a/wrt/node_modules/buffers/README.markdown b/wrt/node_modules/buffers/README.markdown
new file mode 100644 (file)
index 0000000..73a18a4
--- /dev/null
@@ -0,0 +1,122 @@
+buffers
+=======
+
+Treat a collection of Buffers as a single contiguous partially mutable Buffer.
+
+Where possible, operations execute without creating a new Buffer and copying
+everything over.
+
+This is a cleaner more Buffery rehash of
+[bufferlist](http://github.com/substack/node-bufferlist).
+
+example
+=======
+
+slice
+-----
+
+    var Buffers = require('buffers');
+    var bufs = Buffers();
+    bufs.push(new Buffer([1,2,3]));
+    bufs.push(new Buffer([4,5,6,7]));
+    bufs.push(new Buffer([8,9,10]));
+    
+    console.dir(bufs.slice(2,8))
+
+output:
+
+    $ node examples/slice.js 
+    <Buffer 03 04 05 06 07 08>
+
+splice
+------
+
+    var Buffers = require('buffers');
+    var bufs = Buffers([
+        new Buffer([1,2,3]),
+        new Buffer([4,5,6,7]),
+        new Buffer([8,9,10]),
+    ]);
+    
+    var removed = bufs.splice(2, 4);
+    console.dir({
+        removed : removed.slice(),
+        bufs : bufs.slice(),
+    });
+    
+output:
+
+    $ node examples/splice.js
+    { removed: <Buffer 03 04 05 06>,
+      bufs: <Buffer 01 02 07 08 09 0a> }
+
+methods
+=======
+
+Buffers(buffers)
+----------------
+
+Create a Buffers with an array of `Buffer`s if specified, else `[]`.
+
+.push(buf1, buf2...)
+--------------------
+
+Push buffers onto the end. Just like `Array.prototype.push`.
+
+.unshift(buf1, buf2...)
+-----------------------
+
+Unshift buffers onto the head. Just like `Array.prototype.unshift`.
+
+.slice(i, j)
+------------
+
+Slice a range out of the buffer collection as if it were contiguous.
+Works just like the `Array.prototype.slice` version.
+
+.splice(i, howMany, replacements)
+---------------------------------
+
+Splice the buffer collection as if it were contiguous.
+Works just like `Array.prototype.splice`, even the replacement part!
+
+.copy(dst, dstStart, start, end)
+--------------------------------
+
+Copy the buffer collection as if it were contiguous to the `dst` Buffer with the
+specified bounds.
+Works just like `Buffer.prototype.copy`.
+
+.get(i)
+-------
+
+Get a single element at index `i`.
+
+.set(i, x)
+----------
+
+Set a single element's value at index `i`.
+
+.indexOf(needle, offset)
+----------
+
+Find a string or buffer `needle` inside the buffer collection. Returns
+the position of the search string or -1 if the search string was not
+found.
+
+Provide an `offset` to skip that number of characters at the beginning
+of the search. This can be used to find additional matches.
+
+This function will return the correct result even if the search string
+is spread out over multiple internal buffers.
+
+.toBuffer()
+-----------
+
+Convert the buffer collection to a single buffer, equivalent with `.slice(0, buffers.length)`;
+
+.toString(encoding, start, end)
+-----------
+
+Decodes and returns a string from the buffer collection.
+Works just like `Buffer.prototype.toString`
diff --git a/wrt/node_modules/buffers/examples/slice.js b/wrt/node_modules/buffers/examples/slice.js
new file mode 100644 (file)
index 0000000..0bea38c
--- /dev/null
@@ -0,0 +1,9 @@
+var Buffers = require('buffers');
+var bufs = Buffers();
+bufs.push(new Buffer([1,2,3]));
+bufs.push(new Buffer([4,5,6,7]));
+bufs.push(new Buffer([8,9,10]));
+
+console.dir(bufs.slice(2,8))
+
+// Output: <Buffer 03 04 05 06 07 08>
diff --git a/wrt/node_modules/buffers/examples/splice.js b/wrt/node_modules/buffers/examples/splice.js
new file mode 100644 (file)
index 0000000..56a1751
--- /dev/null
@@ -0,0 +1,17 @@
+var Buffers = require('buffers');
+var bufs = Buffers([
+    new Buffer([1,2,3]),
+    new Buffer([4,5,6,7]),
+    new Buffer([8,9,10]),
+]);
+
+var removed = bufs.splice(2, 4, new Buffer('ab'), new Buffer('cd'));
+console.dir({
+    removed : removed.slice(),
+    bufs : bufs.slice(),
+});
+
+/* Output:
+{ removed: <Buffer 03 04 05 06>,
+  bufs: <Buffer 01 02 07 08 09 0a> }
+*/
diff --git a/wrt/node_modules/buffers/index.js b/wrt/node_modules/buffers/index.js
new file mode 100644 (file)
index 0000000..86a9696
--- /dev/null
@@ -0,0 +1,269 @@
+module.exports = Buffers;
+
+function Buffers (bufs) {
+    if (!(this instanceof Buffers)) return new Buffers(bufs);
+    this.buffers = bufs || [];
+    this.length = this.buffers.reduce(function (size, buf) {
+        return size + buf.length
+    }, 0);
+}
+
+Buffers.prototype.push = function () {
+    for (var i = 0; i < arguments.length; i++) {
+        if (!Buffer.isBuffer(arguments[i])) {
+            throw new TypeError('Tried to push a non-buffer');
+        }
+    }
+    
+    for (var i = 0; i < arguments.length; i++) {
+        var buf = arguments[i];
+        this.buffers.push(buf);
+        this.length += buf.length;
+    }
+    return this.length;
+};
+
+Buffers.prototype.unshift = function () {
+    for (var i = 0; i < arguments.length; i++) {
+        if (!Buffer.isBuffer(arguments[i])) {
+            throw new TypeError('Tried to unshift a non-buffer');
+        }
+    }
+    
+    for (var i = 0; i < arguments.length; i++) {
+        var buf = arguments[i];
+        this.buffers.unshift(buf);
+        this.length += buf.length;
+    }
+    return this.length;
+};
+
+Buffers.prototype.copy = function (dst, dStart, start, end) {
+    return this.slice(start, end).copy(dst, dStart, 0, end - start);
+};
+
+Buffers.prototype.splice = function (i, howMany) {
+    var buffers = this.buffers;
+    var index = i >= 0 ? i : this.length - i;
+    var reps = [].slice.call(arguments, 2);
+    
+    if (howMany === undefined) {
+        howMany = this.length - index;
+    }
+    else if (howMany > this.length - index) {
+        howMany = this.length - index;
+    }
+    
+    for (var i = 0; i < reps.length; i++) {
+        this.length += reps[i].length;
+    }
+    
+    var removed = new Buffers();
+    var bytes = 0;
+    
+    var startBytes = 0;
+    for (
+        var ii = 0;
+        ii < buffers.length && startBytes + buffers[ii].length < index;
+        ii ++
+    ) { startBytes += buffers[ii].length }
+    
+    if (index - startBytes > 0) {
+        var start = index - startBytes;
+        
+        if (start + howMany < buffers[ii].length) {
+            removed.push(buffers[ii].slice(start, start + howMany));
+            
+            var orig = buffers[ii];
+            //var buf = new Buffer(orig.length - howMany);
+            var buf0 = new Buffer(start);
+            for (var i = 0; i < start; i++) {
+                buf0[i] = orig[i];
+            }
+            
+            var buf1 = new Buffer(orig.length - start - howMany);
+            for (var i = start + howMany; i < orig.length; i++) {
+                buf1[ i - howMany - start ] = orig[i]
+            }
+            
+            if (reps.length > 0) {
+                var reps_ = reps.slice();
+                reps_.unshift(buf0);
+                reps_.push(buf1);
+                buffers.splice.apply(buffers, [ ii, 1 ].concat(reps_));
+                ii += reps_.length;
+                reps = [];
+            }
+            else {
+                buffers.splice(ii, 1, buf0, buf1);
+                //buffers[ii] = buf;
+                ii += 2;
+            }
+        }
+        else {
+            removed.push(buffers[ii].slice(start));
+            buffers[ii] = buffers[ii].slice(0, start);
+            ii ++;
+        }
+    }
+    
+    if (reps.length > 0) {
+        buffers.splice.apply(buffers, [ ii, 0 ].concat(reps));
+        ii += reps.length;
+    }
+    
+    while (removed.length < howMany) {
+        var buf = buffers[ii];
+        var len = buf.length;
+        var take = Math.min(len, howMany - removed.length);
+        
+        if (take === len) {
+            removed.push(buf);
+            buffers.splice(ii, 1);
+        }
+        else {
+            removed.push(buf.slice(0, take));
+            buffers[ii] = buffers[ii].slice(take);
+        }
+    }
+    
+    this.length -= removed.length;
+    
+    return removed;
+};
+Buffers.prototype.slice = function (i, j) {
+    var buffers = this.buffers;
+    if (j === undefined) j = this.length;
+    if (i === undefined) i = 0;
+    
+    if (j > this.length) j = this.length;
+    
+    var startBytes = 0;
+    for (
+        var si = 0;
+        si < buffers.length && startBytes + buffers[si].length <= i;
+        si ++
+    ) { startBytes += buffers[si].length }
+    
+    var target = new Buffer(j - i);
+    
+    var ti = 0;
+    for (var ii = si; ti < j - i && ii < buffers.length; ii++) {
+        var len = buffers[ii].length;
+        
+        var start = ti === 0 ? i - startBytes : 0;
+        var end = ti + len >= j - i
+            ? Math.min(start + (j - i) - ti, len)
+            : len
+        ;
+        
+        buffers[ii].copy(target, ti, start, end);
+        ti += end - start;
+    }
+    
+    return target;
+};
+
+Buffers.prototype.pos = function (i) {
+    if (i < 0 || i >= this.length) throw new Error('oob');
+    var l = i, bi = 0, bu = null;
+    for (;;) {
+        bu = this.buffers[bi];
+        if (l < bu.length) {
+            return {buf: bi, offset: l};
+        } else {
+            l -= bu.length;
+        }
+        bi++;
+    }
+};
+
+Buffers.prototype.get = function get (i) {
+    var pos = this.pos(i);
+
+    return this.buffers[pos.buf].get(pos.offset);
+};
+
+Buffers.prototype.set = function set (i, b) {
+    var pos = this.pos(i);
+
+    return this.buffers[pos.buf].set(pos.offset, b);
+};
+
+Buffers.prototype.indexOf = function (needle, offset) {
+    if ("string" === typeof needle) {
+        needle = new Buffer(needle);
+    } else if (needle instanceof Buffer) {
+        // already a buffer
+    } else {
+        throw new Error('Invalid type for a search string');
+    }
+
+    if (!needle.length) {
+        return 0;
+    }
+
+    if (!this.length) {
+        return -1;
+    }
+
+    var i = 0, j = 0, match = 0, mstart, pos = 0;
+
+    // start search from a particular point in the virtual buffer
+    if (offset) {
+        var p = this.pos(offset);
+        i = p.buf;
+        j = p.offset;
+        pos = offset;
+    }
+
+    // for each character in virtual buffer
+    for (;;) {
+        while (j >= this.buffers[i].length) {
+            j = 0;
+            i++;
+
+            if (i >= this.buffers.length) {
+                // search string not found
+                return -1;
+            }
+        }
+
+        var char = this.buffers[i][j];
+
+        if (char == needle[match]) {
+            // keep track where match started
+            if (match == 0) {
+                mstart = {
+                    i: i,
+                    j: j,
+                    pos: pos
+                };
+            }
+            match++;
+            if (match == needle.length) {
+                // full match
+                return mstart.pos;
+            }
+        } else if (match != 0) {
+            // a partial match ended, go back to match starting position
+            // this will continue the search at the next character
+            i = mstart.i;
+            j = mstart.j;
+            pos = mstart.pos;
+            match = 0;
+        }
+
+        j++;
+        pos++;
+    }
+};
+
+Buffers.prototype.toBuffer = function() {
+    return this.slice();
+}
+
+Buffers.prototype.toString = function(encoding, start, end) {
+    return this.slice(start, end).toString(encoding);
+}
diff --git a/wrt/node_modules/buffers/package.json b/wrt/node_modules/buffers/package.json
new file mode 100644 (file)
index 0000000..172f47c
--- /dev/null
@@ -0,0 +1,87 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "buffers@~0.1.1",
+        "scope": null,
+        "escapedName": "buffers",
+        "name": "buffers",
+        "rawSpec": "~0.1.1",
+        "spec": ">=0.1.1 <0.2.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/binary"
+    ]
+  ],
+  "_defaultsLoaded": true,
+  "_engineSupported": true,
+  "_from": "buffers@>=0.1.1 <0.2.0",
+  "_id": "buffers@0.1.1",
+  "_inCache": true,
+  "_location": "/buffers",
+  "_nodeVersion": "v0.4.12",
+  "_npmJsonOpts": {
+    "file": "/home/substack/.npm/buffers/0.1.1/package/package.json",
+    "wscript": false,
+    "contributors": false,
+    "serverjs": false
+  },
+  "_npmVersion": "1.0.30",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "buffers@~0.1.1",
+    "scope": null,
+    "escapedName": "buffers",
+    "name": "buffers",
+    "rawSpec": "~0.1.1",
+    "spec": ">=0.1.1 <0.2.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/binary",
+    "/match-stream"
+  ],
+  "_resolved": "https://registry.npmjs.org/buffers/-/buffers-0.1.1.tgz",
+  "_shasum": "b24579c3bed4d6d396aeee6d9a8ae7f5482ab7bb",
+  "_shrinkwrap": null,
+  "_spec": "buffers@~0.1.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/binary",
+  "author": {
+    "name": "James Halliday",
+    "email": "mail@substack.net",
+    "url": "http://substack.net"
+  },
+  "bugs": {
+    "url": "https://github.com/substack/node-buffers/issues"
+  },
+  "dependencies": {},
+  "description": "Treat a collection of Buffers as a single contiguous partially mutable Buffer.",
+  "devDependencies": {},
+  "directories": {},
+  "dist": {
+    "shasum": "b24579c3bed4d6d396aeee6d9a8ae7f5482ab7bb",
+    "tarball": "https://registry.npmjs.org/buffers/-/buffers-0.1.1.tgz"
+  },
+  "engines": {
+    "node": ">=0.2.0"
+  },
+  "homepage": "https://github.com/substack/node-buffers#readme",
+  "main": "./index",
+  "maintainers": [
+    {
+      "name": "substack",
+      "email": "mail@substack.net"
+    }
+  ],
+  "name": "buffers",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/substack/node-buffers.git"
+  },
+  "scripts": {
+    "test": "expresso"
+  },
+  "version": "0.1.1"
+}
diff --git a/wrt/node_modules/buffers/test/buffers.js b/wrt/node_modules/buffers/test/buffers.js
new file mode 100644 (file)
index 0000000..0c24066
--- /dev/null
@@ -0,0 +1,209 @@
+var assert = require('assert');
+var Buffers = require('../');
+
+function create (xs, split) {
+    var bufs = Buffers();
+    var offset = 0;
+    split.forEach(function (i) {
+        bufs.push(new Buffer(xs.slice(offset, offset + i)));
+        offset += i;
+    });
+    return bufs;
+}
+
+exports.slice = function () {
+    var xs = [0,1,2,3,4,5,6,7,8,9];
+    var splits = [ [4,2,3,1], [2,2,2,2,2], [1,6,3,1], [9,2], [10], [5,5] ];
+    
+    splits.forEach(function (split) {
+        var bufs = create(xs, split);
+        assert.eql(new Buffer(xs), bufs.slice(),
+            '[' + xs.join(',') + ']'
+                + ' != ' + 
+            '[' + [].join.call(bufs.slice(), ',') + ']'
+        );
+        
+        for (var i = 0; i < xs.length; i++) {
+            for (var j = i; j < xs.length; j++) {
+                var a = bufs.slice(i,j);
+                var b = new Buffer(xs.slice(i,j));
+                
+                assert.eql(a, b,
+                    '[' + [].join.call(a, ',') + ']'
+                        + ' != ' + 
+                    '[' + [].join.call(b, ',') + ']'
+                );
+            }
+        }
+    });
+};
+
+exports.splice = function () {
+    var xs = [0,1,2,3,4,5,6,7,8,9];
+    var splits = [ [4,2,3,1], [2,2,2,2,2], [1,6,3,1], [9,2], [10], [5,5] ];
+    
+    splits.forEach(function (split) {
+        for (var i = 0; i < xs.length; i++) {
+            for (var j = i; j < xs.length; j++) {
+                var bufs = create(xs, split);
+                var xs_ = xs.slice();
+                
+                var a_ = bufs.splice(i,j);
+                var a = [].slice.call(a_.slice());
+                var b = xs_.splice(i,j);
+                assert.eql(a, b,
+                    '[' + a.join(',') + ']'
+                        + ' != ' + 
+                    '[' + b.join(',') + ']'
+                );
+                
+                assert.eql(bufs.slice(), new Buffer(xs_),
+                    '[' + [].join.call(bufs.slice(), ',') + ']'
+                        + ' != ' + 
+                    '[' + [].join.call(xs_, ',') + ']'
+                );
+            }
+        }
+    });
+};
+
+exports.spliceRep = function () {
+    var xs = [0,1,2,3,4,5,6,7,8,9];
+    var splits = [ [4,2,3,1], [2,2,2,2,2], [1,6,3,1], [9,2], [10], [5,5] ];
+    var reps = [ [], [1], [5,6], [3,1,3,3,7], [9,8,7,6,5,4,3,2,1,2,3,4,5] ];
+    
+    splits.forEach(function (split) {
+        reps.forEach(function (rep) {
+            for (var i = 0; i < xs.length; i++) {
+                for (var j = i; j < xs.length; j++) {
+                    var bufs = create(xs, split);
+                    var xs_ = xs.slice();
+                    
+                    var a_ = bufs.splice.apply(
+                        bufs, [ i, j ].concat(new Buffer(rep))
+                    );
+                    var a = [].slice.call(a_.slice());
+                    var b = xs_.splice.apply(xs_, [ i, j ].concat(rep));
+                    
+                    assert.eql(a, b,
+                        '[' + a.join(',') + ']'
+                            + ' != ' + 
+                        '[' + b.join(',') + ']'
+                    );
+                    
+                    assert.eql(bufs.slice(), new Buffer(xs_),
+                        '[' + [].join.call(bufs.slice(), ',') + ']'
+                            + ' != ' + 
+                        '[' + [].join.call(xs_, ',') + ']'
+                    );
+                }
+            }
+        });
+    });
+}; 
+
+exports.copy = function () {
+    var xs = [0,1,2,3,4,5,6,7,8,9];
+    var splits = [ [4,2,3,1], [2,2,2,2,2], [1,6,3,1], [9,2], [10], [5,5] ];
+    
+    splits.forEach(function (split) {
+        var bufs = create(xs, split);
+        var buf = new Buffer(xs);
+        
+        for (var i = 0; i < xs.length; i++) {
+            for (var j = i; j < xs.length; j++) {
+                var t0 = new Buffer(j - i);
+                var t1 = new Buffer(j - i);
+                
+                assert.eql(
+                    bufs.copy(t0, 0, i, j),
+                    buf.copy(t1, 0, i, j)
+                );
+                
+                assert.eql(
+                    [].slice.call(t0),
+                    [].slice.call(t1)
+                );
+            }
+        }
+    });
+};
+
+exports.push = function () {
+    var bufs = Buffers();
+    bufs.push(new Buffer([0]));
+    bufs.push(new Buffer([1,2,3]));
+    bufs.push(new Buffer([4,5]));
+    bufs.push(new Buffer([6,7,8,9]));
+    assert.eql(
+        [].slice.call(bufs.slice()),
+        [0,1,2,3,4,5,6,7,8,9]
+    );
+    
+    assert.throws(function () {
+        bufs.push(new Buffer([11,12]), 'moo');
+    });
+    assert.eql(bufs.buffers.length, 4);
+};
+
+exports.unshift = function () {
+    var bufs = Buffers();
+    bufs.unshift(new Buffer([6,7,8,9]));
+    bufs.unshift(new Buffer([4,5]));
+    bufs.unshift(new Buffer([1,2,3]));
+    bufs.unshift(new Buffer([0]));
+    assert.eql(
+        [].slice.call(bufs.slice()),
+        [0,1,2,3,4,5,6,7,8,9]
+    );
+    assert.throws(function () {
+        bufs.unshift(new Buffer([-2,-1]), 'moo');
+    });
+    assert.eql(bufs.buffers.length, 4);
+};
+
+exports.get = function () {
+    var bufs = Buffers();
+    bufs.unshift(new Buffer([6,7,8,9]));
+    bufs.unshift(new Buffer([4,5]));
+    bufs.unshift(new Buffer([1,2,3]));
+    bufs.unshift(new Buffer([0]));
+    assert.eql( bufs.get(0), 0 );
+    assert.eql( bufs.get(1), 1 );
+    assert.eql( bufs.get(2), 2 );
+    assert.eql( bufs.get(3), 3 );
+    assert.eql( bufs.get(4), 4 );
+    assert.eql( bufs.get(5), 5 );
+    assert.eql( bufs.get(6), 6 );
+    assert.eql( bufs.get(7), 7 );
+    assert.eql( bufs.get(8), 8 );
+    assert.eql( bufs.get(9), 9 );
+};
+
+exports.set = function () {
+    var bufs = Buffers();
+    bufs.push(new Buffer("Hel"));
+    bufs.push(new Buffer("lo"));
+    bufs.push(new Buffer("!"));
+    bufs.set(0, 'h'.charCodeAt(0) );
+    bufs.set(3, 'L'.charCodeAt(0) );
+    bufs.set(5, '.'.charCodeAt(0) );
+    assert.eql( bufs.slice(0).toString(), 'helLo.' );
+};
+
+exports.indexOf = function () {
+    var bufs = Buffers();
+    bufs.push(new Buffer("Hel"));
+    bufs.push(new Buffer("lo,"));
+    bufs.push(new Buffer(" how are "));
+    bufs.push(new Buffer("you"));
+    bufs.push(new Buffer("?"));
+    assert.eql( bufs.indexOf("Hello"), 0 );
+    assert.eql( bufs.indexOf("Hello", 1), -1 );
+    assert.eql( bufs.indexOf("ello"), 1 );
+    assert.eql( bufs.indexOf("ello", 1), 1 );
+    assert.eql( bufs.indexOf("ello", 2), -1 );
+    assert.eql( bufs.indexOf("e"), 1 );
+    assert.eql( bufs.indexOf("e", 2), 13 );
+    assert.eql( bufs.indexOf(new Buffer([0x65]), 2), 13 );
+};
diff --git a/wrt/node_modules/callsite/.npmignore b/wrt/node_modules/callsite/.npmignore
new file mode 100644 (file)
index 0000000..f1250e5
--- /dev/null
@@ -0,0 +1,4 @@
+support
+test
+examples
+*.sock
diff --git a/wrt/node_modules/callsite/History.md b/wrt/node_modules/callsite/History.md
new file mode 100644 (file)
index 0000000..4994198
--- /dev/null
@@ -0,0 +1,10 @@
+
+1.0.0 / 2013-01-24 
+==================
+
+  * remove lame magical getters
+
+0.0.1 / 2010-01-03
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/callsite/Makefile b/wrt/node_modules/callsite/Makefile
new file mode 100644 (file)
index 0000000..634e372
--- /dev/null
@@ -0,0 +1,6 @@
+
+test:
+       @./node_modules/.bin/mocha \
+               --require should
+
+.PHONY: test
\ No newline at end of file
diff --git a/wrt/node_modules/callsite/Readme.md b/wrt/node_modules/callsite/Readme.md
new file mode 100644 (file)
index 0000000..0dbd16a
--- /dev/null
@@ -0,0 +1,44 @@
+# callstack
+
+  Access to v8's "raw" `CallSite`s.
+
+## Installation
+
+    $ npm install callsite
+
+## Example
+
+```js
+var stack = require('callsite');
+
+foo();
+
+function foo() {
+  bar();
+}
+
+function bar() {
+  baz();
+}
+
+function baz() {
+  console.log();
+  stack().forEach(function(site){
+    console.log('  \033[36m%s\033[90m in %s:%d\033[0m'
+      , site.getFunctionName() || 'anonymous'
+      , site.getFileName()
+      , site.getLineNumber());
+  });
+  console.log();
+}
+```
+
+## Why?
+
+  Because you can do weird, stupid, clever, wacky things such as:
+
+  - [better-assert](https://github.com/visionmedia/better-assert)
+
+## License
+
+  MIT
diff --git a/wrt/node_modules/callsite/index.js b/wrt/node_modules/callsite/index.js
new file mode 100644 (file)
index 0000000..d3ee6f8
--- /dev/null
@@ -0,0 +1,10 @@
+
+module.exports = function(){
+  var orig = Error.prepareStackTrace;
+  Error.prepareStackTrace = function(_, stack){ return stack; };
+  var err = new Error;
+  Error.captureStackTrace(err, arguments.callee);
+  var stack = err.stack;
+  Error.prepareStackTrace = orig;
+  return stack;
+};
diff --git a/wrt/node_modules/callsite/package.json b/wrt/node_modules/callsite/package.json
new file mode 100644 (file)
index 0000000..cccac3b
--- /dev/null
@@ -0,0 +1,77 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "callsite@1.0.0",
+        "scope": null,
+        "escapedName": "callsite",
+        "name": "callsite",
+        "rawSpec": "1.0.0",
+        "spec": "1.0.0",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/better-assert"
+    ]
+  ],
+  "_from": "callsite@1.0.0",
+  "_id": "callsite@1.0.0",
+  "_inCache": true,
+  "_location": "/callsite",
+  "_npmUser": {
+    "name": "tjholowaychuk",
+    "email": "tj@vision-media.ca"
+  },
+  "_npmVersion": "1.2.2",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "callsite@1.0.0",
+    "scope": null,
+    "escapedName": "callsite",
+    "name": "callsite",
+    "rawSpec": "1.0.0",
+    "spec": "1.0.0",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/better-assert"
+  ],
+  "_resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz",
+  "_shasum": "280398e5d664bd74038b6f0905153e6e8af1bc20",
+  "_shrinkwrap": null,
+  "_spec": "callsite@1.0.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/better-assert",
+  "author": {
+    "name": "TJ Holowaychuk",
+    "email": "tj@vision-media.ca"
+  },
+  "dependencies": {},
+  "description": "access to v8's CallSites",
+  "devDependencies": {
+    "mocha": "*",
+    "should": "*"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "280398e5d664bd74038b6f0905153e6e8af1bc20",
+    "tarball": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz"
+  },
+  "engines": {
+    "node": "*"
+  },
+  "keywords": [
+    "stack",
+    "trace",
+    "line"
+  ],
+  "main": "index",
+  "maintainers": [
+    {
+      "name": "tjholowaychuk",
+      "email": "tj@vision-media.ca"
+    }
+  ],
+  "name": "callsite",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "version": "1.0.0"
+}
diff --git a/wrt/node_modules/center-align/LICENSE b/wrt/node_modules/center-align/LICENSE
new file mode 100644 (file)
index 0000000..65f90ac
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2015, Jon Schlinkert.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/center-align/README.md b/wrt/node_modules/center-align/README.md
new file mode 100644 (file)
index 0000000..cbcf3be
--- /dev/null
@@ -0,0 +1,74 @@
+# center-align [![NPM version](https://badge.fury.io/js/center-align.svg)](http://badge.fury.io/js/center-align)
+
+> Center-align the text in a string.
+
+Install with [npm](https://www.npmjs.com/)
+
+```sh
+$ npm i center-align --save
+```
+
+## Usage
+
+```js
+var centerAlign = require('center-align');
+```
+
+**Example**
+
+If used on the following:
+
+```
+Lorem ipsum dolor sit amet,
+consectetur adipiscing
+elit, sed do eiusmod tempor incididunt
+ut labore et dolore
+magna aliqua. Ut enim ad minim
+veniam, quis
+```
+
+The result would be:
+
+```
+     Lorem ipsum dolor sit amet,
+        consectetur adipiscing
+elit, sed do eiusmod tempor incididunt
+         ut labore et dolore
+    magna aliqua. Ut enim ad minim
+             veniam, quis
+```
+
+## Related projects
+
+* [align-text](https://www.npmjs.com/package/align-text): Align the text in a string. | [homepage](https://github.com/jonschlinkert/align-text)
+* [justified](https://www.npmjs.com/package/justified): Wrap words to a specified length and justified the text. | [homepage](https://github.com/jonschlinkert/justified)
+* [right-align](https://www.npmjs.com/package/right-align): Right-align the text in a string. | [homepage](https://github.com/jonschlinkert/right-align)
+* [word-wrap](https://www.npmjs.com/package/word-wrap): Wrap words to a specified length. | [homepage](https://github.com/jonschlinkert/word-wrap)
+
+## Running tests
+
+Install dev dependencies:
+
+```sh
+$ npm i -d && npm test
+```
+
+## Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/center-align/issues/new).
+
+## Author
+
+**Jon Schlinkert**
+
++ [github/jonschlinkert](https://github.com/jonschlinkert)
++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
+
+## License
+
+Copyright © 2015 Jon Schlinkert
+Released under the MIT license.
+
+***
+
+_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 27, 2015._
\ No newline at end of file
diff --git a/wrt/node_modules/center-align/index.js b/wrt/node_modules/center-align/index.js
new file mode 100644 (file)
index 0000000..c6ed54a
--- /dev/null
@@ -0,0 +1,16 @@
+/*!
+ * center-align <https://github.com/jonschlinkert/center-align>
+ *
+ * Copycenter (c) 2015, Jon Schlinkert.
+ * Licensed under the MIT License.
+ */
+
+'use strict';
+
+var utils = require('./utils');
+
+module.exports = function centerAlign(val) {
+  return utils.align(val, function (len, longest) {
+    return Math.floor((longest - len) / 2);
+  });
+};
diff --git a/wrt/node_modules/center-align/package.json b/wrt/node_modules/center-align/package.json
new file mode 100644 (file)
index 0000000..dd0c756
--- /dev/null
@@ -0,0 +1,82 @@
+{
+  "_from": "center-align@^0.1.1",
+  "_id": "center-align@0.1.3",
+  "_inBundle": false,
+  "_integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=",
+  "_location": "/center-align",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "center-align@^0.1.1",
+    "name": "center-align",
+    "escapedName": "center-align",
+    "rawSpec": "^0.1.1",
+    "saveSpec": null,
+    "fetchSpec": "^0.1.1"
+  },
+  "_requiredBy": [
+    "/yargs/cliui"
+  ],
+  "_resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz",
+  "_shasum": "aa0d32629b6ee972200411cbd4461c907bc2b7ad",
+  "_spec": "center-align@^0.1.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was/node_modules/yargs/node_modules/cliui",
+  "author": {
+    "name": "Jon Schlinkert",
+    "url": "https://github.com/jonschlinkert"
+  },
+  "bugs": {
+    "url": "https://github.com/jonschlinkert/center-align/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {
+    "align-text": "^0.1.3",
+    "lazy-cache": "^1.0.3"
+  },
+  "deprecated": false,
+  "description": "Center-align the text in a string.",
+  "devDependencies": {
+    "mocha": "^2.2.0"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "files": [
+    "index.js",
+    "utils.js"
+  ],
+  "homepage": "https://github.com/jonschlinkert/center-align",
+  "keywords": [
+    "align",
+    "align-center",
+    "center",
+    "center-align",
+    "right",
+    "right-align",
+    "text",
+    "typography"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "name": "center-align",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/jonschlinkert/center-align.git"
+  },
+  "scripts": {
+    "test": "mocha"
+  },
+  "verb": {
+    "related": {
+      "description": "",
+      "list": [
+        "align-text",
+        "right-align",
+        "justified",
+        "word-wrap"
+      ]
+    }
+  },
+  "version": "0.1.3"
+}
diff --git a/wrt/node_modules/center-align/utils.js b/wrt/node_modules/center-align/utils.js
new file mode 100644 (file)
index 0000000..aead6d2
--- /dev/null
@@ -0,0 +1,40 @@
+'use strict';
+
+/**
+ * Lazily-required module dependencies (makes the application
+ * faster)
+ */
+
+var utils = require('lazy-cache')(require);
+
+/**
+ * Temporarily re-assign `require` to trick browserify and
+ * webpack into reconizing lazy dependencies.
+ *
+ * This tiny bit of ugliness has the huge dual advantage of
+ * only loading modules that are actually called at some
+ * point in the lifecycle of the application, whilst also
+ * allowing browserify and webpack to find modules that
+ * are depended on but never actually called.
+ */
+
+var fn = require;
+require = utils;
+
+/**
+ * Lazily required module dependencies
+ */
+
+require('align-text', 'align');
+
+/**
+ * Restore `require`
+ */
+
+require = fn;
+
+/**
+ * Expose `utils` modules
+ */
+
+module.exports = utils;
diff --git a/wrt/node_modules/chainsaw/.npmignore b/wrt/node_modules/chainsaw/.npmignore
new file mode 100644 (file)
index 0000000..3c3629e
--- /dev/null
@@ -0,0 +1 @@
+node_modules
diff --git a/wrt/node_modules/chainsaw/README.markdown b/wrt/node_modules/chainsaw/README.markdown
new file mode 100644 (file)
index 0000000..4721f78
--- /dev/null
@@ -0,0 +1,157 @@
+Chainsaw
+========
+
+Build chainable fluent interfaces the easy way in node.js.
+
+With this meta-module you can write modules with chainable interfaces.
+Chainsaw takes care of all of the boring details and makes nested flow control
+super simple too.
+
+Just call `Chainsaw` with a constructor function like in the examples below.
+In your methods, just do `saw.next()` to move along to the next event and
+`saw.nest()` to create a nested chain.
+
+Examples
+========
+
+add_do.js
+---------
+
+This silly example adds values with a chainsaw.
+
+    var Chainsaw = require('chainsaw');
+    
+    function AddDo (sum) {
+        return Chainsaw(function (saw) {
+            this.add = function (n) {
+                sum += n;
+                saw.next();
+            };
+             
+            this.do = function (cb) {
+                saw.nest(cb, sum);
+            };
+        });
+    }
+    
+    AddDo(0)
+        .add(5)
+        .add(10)
+        .do(function (sum) {
+            if (sum > 12) this.add(-10);
+        })
+        .do(function (sum) {
+            console.log('Sum: ' + sum);
+        })
+    ;
+
+Output:
+    Sum: 5
+
+prompt.js
+---------
+
+This example provides a wrapper on top of stdin with the help of
+[node-lazy](https://github.com/pkrumins/node-lazy) for line-processing.
+
+    var Chainsaw = require('chainsaw');
+    var Lazy = require('lazy');
+    
+    module.exports = Prompt;
+    function Prompt (stream) {
+        var waiting = [];
+        var lines = [];
+        var lazy = Lazy(stream).lines.map(String)
+            .forEach(function (line) {
+                if (waiting.length) {
+                    var w = waiting.shift();
+                    w(line);
+                }
+                else lines.push(line);
+            })
+        ;
+        
+        var vars = {};
+        return Chainsaw(function (saw) {
+            this.getline = function (f) {
+                var g = function (line) {
+                    saw.nest(f, line, vars);
+                };
+                
+                if (lines.length) g(lines.shift());
+                else waiting.push(g);
+            };
+            
+            this.do = function (cb) {
+                saw.nest(cb, vars);
+            };
+        });
+    }
+
+And now for the new Prompt() module in action:
+
+    var util = require('util');
+    var stdin = process.openStdin();
+     
+    Prompt(stdin)
+        .do(function () {
+            util.print('x = ');
+        })
+        .getline(function (line, vars) {
+            vars.x = parseInt(line, 10);
+        })
+        .do(function () {
+            util.print('y = ');
+        })
+        .getline(function (line, vars) {
+            vars.y = parseInt(line, 10);
+        })
+        .do(function (vars) {
+            if (vars.x + vars.y < 10) {
+                util.print('z = ');
+                this.getline(function (line) {
+                    vars.z = parseInt(line, 10);
+                })
+            }
+            else {
+                vars.z = 0;
+            }
+        })
+        .do(function (vars) {
+            console.log('x + y + z = ' + (vars.x + vars.y + vars.z));
+            process.exit();
+        })
+    ;
+
+Installation
+============
+
+With [npm](http://github.com/isaacs/npm), just do:
+    npm install chainsaw
+
+or clone this project on github:
+
+    git clone http://github.com/substack/node-chainsaw.git
+
+To run the tests with [expresso](http://github.com/visionmedia/expresso),
+just do:
+
+    expresso
+
+
+Light Mode vs Full Mode
+=======================
+
+`node-chainsaw` supports two different modes. In full mode, every
+action is recorded, which allows you to replay actions using the
+`jump()`, `trap()` and `down()` methods.
+
+However, if your chainsaws are long-lived, recording every action can
+consume a tremendous amount of memory, so we also offer a "light" mode
+where actions are not recorded and the aforementioned methods are
+disabled.
+
+To enable light mode simply use `Chainsaw.light()` to construct your
+saw, instead of `Chainsaw()`.
+
+
diff --git a/wrt/node_modules/chainsaw/examples/add_do.js b/wrt/node_modules/chainsaw/examples/add_do.js
new file mode 100644 (file)
index 0000000..378705d
--- /dev/null
@@ -0,0 +1,25 @@
+var Chainsaw = require('chainsaw');
+
+function AddDo (sum) {
+    return Chainsaw(function (saw) {
+        this.add = function (n) {
+            sum += n;
+            saw.next();
+        };
+        
+        this.do = function (cb) {
+            saw.nest(cb, sum);
+        };
+    });
+}
+
+AddDo(0)
+    .add(5)
+    .add(10)
+    .do(function (sum) {
+        if (sum > 12) this.add(-10);
+    })
+    .do(function (sum) {
+        console.log('Sum: ' + sum);
+    })
+;
diff --git a/wrt/node_modules/chainsaw/examples/prompt.js b/wrt/node_modules/chainsaw/examples/prompt.js
new file mode 100644 (file)
index 0000000..0a06d71
--- /dev/null
@@ -0,0 +1,67 @@
+var Chainsaw = require('chainsaw');
+var Lazy = require('lazy');
+
+module.exports = Prompt;
+function Prompt (stream) {
+    var waiting = [];
+    var lines = [];
+    var lazy = Lazy(stream).lines.map(String)
+        .forEach(function (line) {
+            if (waiting.length) {
+                var w = waiting.shift();
+                w(line);
+            }
+            else lines.push(line);
+        })
+    ;
+    
+    var vars = {};
+    return Chainsaw(function (saw) {
+        this.getline = function (f) {
+            var g = function (line) {
+                saw.nest(f, line, vars);
+            };
+            
+            if (lines.length) g(lines.shift());
+            else waiting.push(g);
+        };
+        
+        this.do = function (cb) {
+            saw.nest(cb, vars);
+        };
+    });
+}
+
+var util = require('util');
+if (__filename === process.argv[1]) {
+    var stdin = process.openStdin();
+    Prompt(stdin)
+        .do(function () {
+            util.print('x = ');
+        })
+        .getline(function (line, vars) {
+            vars.x = parseInt(line, 10);
+        })
+        .do(function () {
+            util.print('y = ');
+        })
+        .getline(function (line, vars) {
+            vars.y = parseInt(line, 10);
+        })
+        .do(function (vars) {
+            if (vars.x + vars.y < 10) {
+                util.print('z = ');
+                this.getline(function (line) {
+                    vars.z = parseInt(line, 10);
+                })
+            }
+            else {
+                vars.z = 0;
+            }
+        })
+        .do(function (vars) {
+            console.log('x + y + z = ' + (vars.x + vars.y + vars.z));
+            process.exit();
+        })
+    ;
+}
diff --git a/wrt/node_modules/chainsaw/index.js b/wrt/node_modules/chainsaw/index.js
new file mode 100755 (executable)
index 0000000..39f8c07
--- /dev/null
@@ -0,0 +1,145 @@
+var Traverse = require('traverse');
+var EventEmitter = require('events').EventEmitter;
+
+module.exports = Chainsaw;
+function Chainsaw (builder) {
+    var saw = Chainsaw.saw(builder, {});
+    var r = builder.call(saw.handlers, saw);
+    if (r !== undefined) saw.handlers = r;
+    saw.record();
+    return saw.chain();
+};
+
+Chainsaw.light = function ChainsawLight (builder) {
+    var saw = Chainsaw.saw(builder, {});
+    var r = builder.call(saw.handlers, saw);
+    if (r !== undefined) saw.handlers = r;
+    return saw.chain();
+};
+
+Chainsaw.saw = function (builder, handlers) {
+    var saw = new EventEmitter;
+    saw.handlers = handlers;
+    saw.actions = [];
+
+    saw.chain = function () {
+        var ch = Traverse(saw.handlers).map(function (node) {
+            if (this.isRoot) return node;
+            var ps = this.path;
+
+            if (typeof node === 'function') {
+                this.update(function () {
+                    saw.actions.push({
+                        path : ps,
+                        args : [].slice.call(arguments)
+                    });
+                    return ch;
+                });
+            }
+        });
+
+        process.nextTick(function () {
+            saw.emit('begin');
+            saw.next();
+        });
+
+        return ch;
+    };
+
+    saw.pop = function () {
+        return saw.actions.shift();
+    };
+
+    saw.next = function () {
+        var action = saw.pop();
+
+        if (!action) {
+            saw.emit('end');
+        }
+        else if (!action.trap) {
+            var node = saw.handlers;
+            action.path.forEach(function (key) { node = node[key] });
+            node.apply(saw.handlers, action.args);
+        }
+    };
+
+    saw.nest = function (cb) {
+        var args = [].slice.call(arguments, 1);
+        var autonext = true;
+
+        if (typeof cb === 'boolean') {
+            var autonext = cb;
+            cb = args.shift();
+        }
+
+        var s = Chainsaw.saw(builder, {});
+        var r = builder.call(s.handlers, s);
+
+        if (r !== undefined) s.handlers = r;
+
+        // If we are recording...
+        if ("undefined" !== typeof saw.step) {
+            // ... our children should, too
+            s.record();
+        }
+
+        cb.apply(s.chain(), args);
+        if (autonext !== false) s.on('end', saw.next);
+    };
+
+    saw.record = function () {
+        upgradeChainsaw(saw);
+    };
+
+    ['trap', 'down', 'jump'].forEach(function (method) {
+        saw[method] = function () {
+            throw new Error("To use the trap, down and jump features, please "+
+                            "call record() first to start recording actions.");
+        };
+    });
+
+    return saw;
+};
+
+function upgradeChainsaw(saw) {
+    saw.step = 0;
+
+    // override pop
+    saw.pop = function () {
+        return saw.actions[saw.step++];
+    };
+
+    saw.trap = function (name, cb) {
+        var ps = Array.isArray(name) ? name : [name];
+        saw.actions.push({
+            path : ps,
+            step : saw.step,
+            cb : cb,
+            trap : true
+        });
+    };
+
+    saw.down = function (name) {
+        var ps = (Array.isArray(name) ? name : [name]).join('/');
+        var i = saw.actions.slice(saw.step).map(function (x) {
+            if (x.trap && x.step <= saw.step) return false;
+            return x.path.join('/') == ps;
+        }).indexOf(true);
+
+        if (i >= 0) saw.step += i;
+        else saw.step = saw.actions.length;
+
+        var act = saw.actions[saw.step - 1];
+        if (act && act.trap) {
+            // It's a trap!
+            saw.step = act.step;
+            act.cb();
+        }
+        else saw.next();
+    };
+
+    saw.jump = function (step) {
+        saw.step = step;
+        saw.next();
+    };
+};
diff --git a/wrt/node_modules/chainsaw/package.json b/wrt/node_modules/chainsaw/package.json
new file mode 100644 (file)
index 0000000..25bb0e2
--- /dev/null
@@ -0,0 +1,85 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "chainsaw@~0.1.0",
+        "scope": null,
+        "escapedName": "chainsaw",
+        "name": "chainsaw",
+        "rawSpec": "~0.1.0",
+        "spec": ">=0.1.0 <0.2.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/binary"
+    ]
+  ],
+  "_defaultsLoaded": true,
+  "_engineSupported": true,
+  "_from": "chainsaw@>=0.1.0 <0.2.0",
+  "_id": "chainsaw@0.1.0",
+  "_inCache": true,
+  "_location": "/chainsaw",
+  "_nodeVersion": "v0.5.0-pre",
+  "_npmVersion": "1.0.10",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "chainsaw@~0.1.0",
+    "scope": null,
+    "escapedName": "chainsaw",
+    "name": "chainsaw",
+    "rawSpec": "~0.1.0",
+    "spec": ">=0.1.0 <0.2.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/binary"
+  ],
+  "_resolved": "https://registry.npmjs.org/chainsaw/-/chainsaw-0.1.0.tgz",
+  "_shasum": "5eab50b28afe58074d0d58291388828b5e5fbc98",
+  "_shrinkwrap": null,
+  "_spec": "chainsaw@~0.1.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/binary",
+  "author": {
+    "name": "James Halliday",
+    "email": "mail@substack.net",
+    "url": "http://substack.net"
+  },
+  "bugs": {
+    "url": "https://github.com/substack/node-chainsaw/issues"
+  },
+  "dependencies": {
+    "traverse": ">=0.3.0 <0.4"
+  },
+  "description": "Build chainable fluent interfaces the easy way... with a freakin' chainsaw!",
+  "devDependencies": {},
+  "directories": {},
+  "dist": {
+    "shasum": "5eab50b28afe58074d0d58291388828b5e5fbc98",
+    "tarball": "https://registry.npmjs.org/chainsaw/-/chainsaw-0.1.0.tgz"
+  },
+  "engine": {
+    "node": ">=0.4.0"
+  },
+  "engines": {
+    "node": "*"
+  },
+  "homepage": "https://github.com/substack/node-chainsaw#readme",
+  "keywords": [
+    "chain",
+    "fluent",
+    "interface",
+    "monad",
+    "monadic"
+  ],
+  "license": "MIT/X11",
+  "main": "./index.js",
+  "name": "chainsaw",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/substack/node-chainsaw.git"
+  },
+  "scripts": {},
+  "version": "0.1.0"
+}
diff --git a/wrt/node_modules/chainsaw/test/chainsaw.js b/wrt/node_modules/chainsaw/test/chainsaw.js
new file mode 100644 (file)
index 0000000..8895e89
--- /dev/null
@@ -0,0 +1,418 @@
+var assert = require('assert');
+var Chainsaw = require('../index');
+
+exports.getset = function () {
+    var to = setTimeout(function () {
+        assert.fail('builder never fired');
+    }, 1000);
+    
+    var ch = Chainsaw(function (saw) {
+        clearTimeout(to);
+        var num = 0;
+        
+        this.get = function (cb) {
+            cb(num);
+            saw.next();
+        };
+        
+        this.set = function (n) {
+            num = n;
+            saw.next();
+        };
+        
+        var ti = setTimeout(function () {
+            assert.fail('end event not emitted');
+        }, 50);
+        
+        saw.on('end', function () {
+            clearTimeout(ti);
+            assert.equal(times, 3);
+        });
+    });
+    
+    var times = 0;
+    ch
+        .get(function (x) {
+            assert.equal(x, 0);
+            times ++;
+        })
+        .set(10)
+        .get(function (x) {
+            assert.equal(x, 10);
+            times ++;
+        })
+        .set(20)
+        .get(function (x) {
+            assert.equal(x, 20);
+            times ++;
+        })
+    ;
+};
+
+exports.nest = function () {
+    var ch = (function () {
+        var vars = {};
+        return Chainsaw(function (saw) {
+            this.do = function (cb) {
+                saw.nest(cb, vars);
+            };
+        });
+    })();
+    
+    var order = [];
+    var to = setTimeout(function () {
+        assert.fail("Didn't get to the end");
+    }, 50);
+    
+    ch
+        .do(function (vars) {
+            vars.x = 'y';
+            order.push(1);
+            
+            this
+                .do(function (vs) {
+                    order.push(2);
+                    vs.x = 'x';
+                })
+                .do(function (vs) {
+                    order.push(3);
+                    vs.z = 'z';
+                })
+            ;
+        })
+        .do(function (vars) {
+            vars.y = 'y';
+            order.push(4);
+        })
+        .do(function (vars) {
+            assert.eql(order, [1,2,3,4]);
+            assert.eql(vars, { x : 'x', y : 'y', z : 'z' });
+            clearTimeout(to);
+        })
+    ;
+};
+
+exports.nestWait = function () {
+    var ch = (function () {
+        var vars = {};
+        return Chainsaw(function (saw) {
+            this.do = function (cb) {
+                saw.nest(cb, vars);
+            };
+            
+            this.wait = function (n) {
+                setTimeout(function () {
+                    saw.next();
+                }, n);
+            };
+        });
+    })();
+    
+    var order = [];
+    var to = setTimeout(function () {
+        assert.fail("Didn't get to the end");
+    }, 1000);
+    
+    var times = {};
+    
+    ch
+        .do(function (vars) {
+            vars.x = 'y';
+            order.push(1);
+            
+            this
+                .do(function (vs) {
+                    order.push(2);
+                    vs.x = 'x';
+                    times.x = Date.now();
+                })
+                .wait(50)
+                .do(function (vs) {
+                    order.push(3);
+                    vs.z = 'z';
+                    
+                    times.z = Date.now();
+                    var dt = times.z - times.x;
+                    assert.ok(dt >= 50 && dt < 75);
+                })
+            ;
+        })
+        .do(function (vars) {
+            vars.y = 'y';
+            order.push(4);
+            
+            times.y = Date.now();
+        })
+        .wait(100)
+        .do(function (vars) {
+            assert.eql(order, [1,2,3,4]);
+            assert.eql(vars, { x : 'x', y : 'y', z : 'z' });
+            clearTimeout(to);
+            
+            times.end = Date.now();
+            var dt = times.end - times.y;
+            assert.ok(dt >= 100 && dt < 125)
+        })
+    ;
+};
+
+exports.nestNext = function () {
+    var ch = (function () {
+        var vars = {};
+        return Chainsaw(function (saw) {
+            this.do = function (cb) {
+                saw.nest(false, function () {
+                    var args = [].slice.call(arguments);
+                    args.push(saw.next);
+                    cb.apply(this, args);
+                }, vars);
+            };
+        });
+    })();
+    
+    var order = [];
+    var to = setTimeout(function () {
+        assert.fail("Didn't get to the end");
+    }, 500);
+    
+    var times = [];
+    
+    ch
+        .do(function (vars, next_) {
+            vars.x = 'y';
+            order.push(1);
+            
+            this
+                .do(function (vs, next) {
+                    order.push(2);
+                    vs.x = 'x';
+                    setTimeout(next, 30);
+                })
+                .do(function (vs, next) {
+                    order.push(3);
+                    vs.z = 'z';
+                    setTimeout(next, 10);
+                })
+                .do(function () {
+                    setTimeout(next_, 20);
+                })
+            ;
+        })
+        .do(function (vars, next) {
+            vars.y = 'y';
+            order.push(4);
+            setTimeout(next, 5);
+        })
+        .do(function (vars) {
+            assert.eql(order, [1,2,3,4]);
+            assert.eql(vars, { x : 'x', y : 'y', z : 'z' });
+            
+            clearTimeout(to);
+        })
+    ;
+};
+
+exports.builder = function () {
+    var cx = Chainsaw(function (saw) {
+        this.x = function () {};
+    });
+    assert.ok(cx.x);
+    
+    var cy = Chainsaw(function (saw) {
+        return { y : function () {} };
+    });
+    assert.ok(cy.y);
+    
+    var cz = Chainsaw(function (saw) {
+        return { z : function (cb) { saw.nest(cb) } };
+    });
+    assert.ok(cz.z);
+    
+    var to = setTimeout(function () {
+        assert.fail("Nested z didn't run");
+    }, 50);
+    
+    cz.z(function () {
+        clearTimeout(to);
+        assert.ok(this.z);
+    });
+};
+
+this.attr = function () {
+    var to = setTimeout(function () {
+        assert.fail("attr chain didn't finish");
+    }, 50);
+    
+    var xy = [];
+    var ch = Chainsaw(function (saw) {
+        this.h = {
+            x : function () { 
+                xy.push('x');
+                saw.next();
+            },
+            y : function () {
+                xy.push('y');
+                saw.next();
+                assert.eql(xy, ['x','y']);
+                clearTimeout(to);
+            }
+        };
+    });
+    assert.ok(ch.h);
+    assert.ok(ch.h.x);
+    assert.ok(ch.h.y);
+    
+    ch.h.x().h.y();
+};
+
+exports.down = function () {
+    var error = null;
+    var s;
+    var ch = Chainsaw(function (saw) {
+        s = saw;
+        this.raise = function (err) {
+            error = err;
+            saw.down('catch');
+        };
+        
+        this.do = function (cb) {
+            cb.call(this);
+        };
+        
+        this.catch = function (cb) {
+            if (error) {
+                saw.nest(cb, error);
+                error = null;
+            }
+            else saw.next();
+        };
+    });
+    
+    var to = setTimeout(function () {
+        assert.fail(".do() after .catch() didn't fire");
+    }, 50);
+    
+    ch
+        .do(function () {
+            this.raise('pow');
+        })
+        .do(function () {
+            assert.fail("raise didn't skip over this do block");
+        })
+        .catch(function (err) {
+            assert.equal(err, 'pow');
+        })
+        .do(function () {
+            clearTimeout(to);
+        })
+    ;
+};
+
+exports.trap = function () {
+    var error = null;
+    var ch = Chainsaw(function (saw) {
+        var pars = 0;
+        var stack = [];
+        var i = 0;
+        
+        this.par = function (cb) {
+            pars ++;
+            var j = i ++;
+            cb.call(function () {
+                pars --;
+                stack[j] = [].slice.call(arguments);
+                saw.down('result');
+            });
+            saw.next();
+        };
+        
+        this.join = function (cb) {
+            saw.trap('result', function () {
+                if (pars == 0) {
+                    cb.apply(this, stack);
+                    saw.next();
+                }
+            });
+        };
+        
+        this.raise = function (err) {
+            error = err;
+            saw.down('catch');
+        };
+        
+        this.do = function (cb) {
+            cb.call(this);
+        };
+        
+        this.catch = function (cb) {
+            if (error) {
+                saw.nest(cb, error);
+                error = null;
+            }
+            else saw.next();
+        };
+    });
+    
+    var to = setTimeout(function () {
+        assert.fail(".do() after .join() didn't fire");
+    }, 100);
+    var tj = setTimeout(function () {
+        assert.fail('.join() never fired');
+    }, 100);
+    
+    var joined = false;
+    ch
+        .par(function () {
+            setTimeout(this.bind(null, 1), 50);
+        })
+        .par(function () {
+            setTimeout(this.bind(null, 2), 25);
+        })
+        .join(function (x, y) {
+            assert.equal(x[0], 1);
+            assert.equal(y[0], 2);
+            clearTimeout(tj);
+            joined = true;
+        })
+        .do(function () {
+            clearTimeout(to);
+            assert.ok(joined);
+        })
+    ;
+};
+
+exports.jump = function () {
+    var to = setTimeout(function () {
+        assert.fail('builder never fired');
+    }, 50);
+    
+    var xs = [ 4, 5, 6, -4, 8, 9, -1, 8 ];
+    var xs_ = [];
+    
+    var ch = Chainsaw(function (saw) {
+        this.x = function (i) {
+            xs_.push(i);
+            saw.next();
+        };
+        
+        this.y = function (step) {
+            var x = xs.shift();
+            if (x > 0) saw.jump(step);
+            else saw.next();
+        };
+        
+        saw.on('end', function () {
+            clearTimeout(to);
+            assert.eql(xs, [ 8 ]);
+            assert.eql(xs_, [ 1, 1, 1, 1, 2, 3, 2, 3, 2, 3 ]);
+        });
+    });
+    
+    ch
+        .x(1)
+        .y(0)
+        .x(2)
+        .x(3)
+        .y(2)
+    ;
+};
diff --git a/wrt/node_modules/chalk/index.js b/wrt/node_modules/chalk/index.js
new file mode 100644 (file)
index 0000000..4c81d6d
--- /dev/null
@@ -0,0 +1,220 @@
+'use strict';
+const escapeStringRegexp = require('escape-string-regexp');
+const ansiStyles = require('ansi-styles');
+const supportsColor = require('supports-color');
+
+const template = require('./templates.js');
+
+const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm');
+
+// `supportsColor.level` → `ansiStyles.color[name]` mapping
+const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m'];
+
+// `color-convert` models to exclude from the Chalk API due to conflicts and such
+const skipModels = new Set(['gray']);
+
+const styles = Object.create(null);
+
+function applyOptions(obj, options) {
+       options = options || {};
+
+       // Detect level if not set manually
+       const scLevel = supportsColor ? supportsColor.level : 0;
+       obj.level = options.level === undefined ? scLevel : options.level;
+       obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0;
+}
+
+function Chalk(options) {
+       // We check for this.template here since calling `chalk.constructor()`
+       // by itself will have a `this` of a previously constructed chalk object
+       if (!this || !(this instanceof Chalk) || this.template) {
+               const chalk = {};
+               applyOptions(chalk, options);
+
+               chalk.template = function () {
+                       const args = [].slice.call(arguments);
+                       return chalkTag.apply(null, [chalk.template].concat(args));
+               };
+
+               Object.setPrototypeOf(chalk, Chalk.prototype);
+               Object.setPrototypeOf(chalk.template, chalk);
+
+               chalk.template.constructor = Chalk;
+
+               return chalk.template;
+       }
+
+       applyOptions(this, options);
+}
+
+// Use bright blue on Windows as the normal blue color is illegible
+if (isSimpleWindowsTerm) {
+       ansiStyles.blue.open = '\u001B[94m';
+}
+
+for (const key of Object.keys(ansiStyles)) {
+       ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
+
+       styles[key] = {
+               get() {
+                       const codes = ansiStyles[key];
+                       return build.call(this, this._styles ? this._styles.concat(codes) : [codes], key);
+               }
+       };
+}
+
+ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g');
+for (const model of Object.keys(ansiStyles.color.ansi)) {
+       if (skipModels.has(model)) {
+               continue;
+       }
+
+       styles[model] = {
+               get() {
+                       const level = this.level;
+                       return function () {
+                               const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments);
+                               const codes = {
+                                       open,
+                                       close: ansiStyles.color.close,
+                                       closeRe: ansiStyles.color.closeRe
+                               };
+                               return build.call(this, this._styles ? this._styles.concat(codes) : [codes], model);
+                       };
+               }
+       };
+}
+
+ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g');
+for (const model of Object.keys(ansiStyles.bgColor.ansi)) {
+       if (skipModels.has(model)) {
+               continue;
+       }
+
+       const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);
+       styles[bgModel] = {
+               get() {
+                       const level = this.level;
+                       return function () {
+                               const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments);
+                               const codes = {
+                                       open,
+                                       close: ansiStyles.bgColor.close,
+                                       closeRe: ansiStyles.bgColor.closeRe
+                               };
+                               return build.call(this, this._styles ? this._styles.concat(codes) : [codes], model);
+                       };
+               }
+       };
+}
+
+const proto = Object.defineProperties(() => {}, styles);
+
+function build(_styles, key) {
+       const builder = function () {
+               return applyStyle.apply(builder, arguments);
+       };
+
+       builder._styles = _styles;
+
+       const self = this;
+
+       Object.defineProperty(builder, 'level', {
+               enumerable: true,
+               get() {
+                       return self.level;
+               },
+               set(level) {
+                       self.level = level;
+               }
+       });
+
+       Object.defineProperty(builder, 'enabled', {
+               enumerable: true,
+               get() {
+                       return self.enabled;
+               },
+               set(enabled) {
+                       self.enabled = enabled;
+               }
+       });
+
+       // See below for fix regarding invisible grey/dim combination on Windows
+       builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey';
+
+       // `__proto__` is used because we must return a function, but there is
+       // no way to create a function with a different prototype
+       builder.__proto__ = proto; // eslint-disable-line no-proto
+
+       return builder;
+}
+
+function applyStyle() {
+       // Support varags, but simply cast to string in case there's only one arg
+       const args = arguments;
+       const argsLen = args.length;
+       let str = String(arguments[0]);
+
+       if (argsLen === 0) {
+               return '';
+       }
+
+       if (argsLen > 1) {
+               // Don't slice `arguments`, it prevents V8 optimizations
+               for (let a = 1; a < argsLen; a++) {
+                       str += ' ' + args[a];
+               }
+       }
+
+       if (!this.enabled || this.level <= 0 || !str) {
+               return str;
+       }
+
+       // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe,
+       // see https://github.com/chalk/chalk/issues/58
+       // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop.
+       const originalDim = ansiStyles.dim.open;
+       if (isSimpleWindowsTerm && this.hasGrey) {
+               ansiStyles.dim.open = '';
+       }
+
+       for (const code of this._styles.slice().reverse()) {
+               // Replace any instances already present with a re-opening code
+               // otherwise only the part of the string until said closing code
+               // will be colored, and the rest will simply be 'plain'.
+               str = code.open + str.replace(code.closeRe, code.open) + code.close;
+
+               // Close the styling before a linebreak and reopen
+               // after next line to fix a bleed issue on macOS
+               // https://github.com/chalk/chalk/pull/92
+               str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`);
+       }
+
+       // Reset the original `dim` if we changed it to work around the Windows dimmed gray issue
+       ansiStyles.dim.open = originalDim;
+
+       return str;
+}
+
+function chalkTag(chalk, strings) {
+       if (!Array.isArray(strings)) {
+               // If chalk() was called by itself or with a string,
+               // return the string itself as a string.
+               return [].slice.call(arguments, 1).join(' ');
+       }
+
+       const args = [].slice.call(arguments, 2);
+       const parts = [strings.raw[0]];
+
+       for (let i = 1; i < strings.length; i++) {
+               parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&'));
+               parts.push(String(strings.raw[i]));
+       }
+
+       return template(chalk, parts.join(''));
+}
+
+Object.defineProperties(Chalk.prototype, styles);
+
+module.exports = Chalk(); // eslint-disable-line new-cap
+module.exports.supportsColor = supportsColor;
diff --git a/wrt/node_modules/chalk/license b/wrt/node_modules/chalk/license
new file mode 100644 (file)
index 0000000..e7af2f7
--- /dev/null
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/chalk/package.json b/wrt/node_modules/chalk/package.json
new file mode 100644 (file)
index 0000000..47cf8a6
--- /dev/null
@@ -0,0 +1,139 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "chalk",
+        "scope": null,
+        "escapedName": "chalk",
+        "name": "chalk",
+        "rawSpec": "",
+        "spec": "latest",
+        "type": "tag"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt"
+    ]
+  ],
+  "_from": "chalk@latest",
+  "_id": "chalk@2.1.0",
+  "_inCache": true,
+  "_location": "/chalk",
+  "_nodeVersion": "8.2.1",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/chalk-2.1.0.tgz_1502078203099_0.6595528507605195"
+  },
+  "_npmUser": {
+    "name": "qix",
+    "email": "i.am.qix@gmail.com"
+  },
+  "_npmVersion": "5.3.0",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "chalk",
+    "scope": null,
+    "escapedName": "chalk",
+    "name": "chalk",
+    "rawSpec": "",
+    "spec": "latest",
+    "type": "tag"
+  },
+  "_requiredBy": [
+    "#USER"
+  ],
+  "_resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz",
+  "_shasum": "ac5becf14fa21b99c6c92ca7a7d7cfd5b17e743e",
+  "_shrinkwrap": null,
+  "_spec": "chalk",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt",
+  "bugs": {
+    "url": "https://github.com/chalk/chalk/issues"
+  },
+  "dependencies": {
+    "ansi-styles": "^3.1.0",
+    "escape-string-regexp": "^1.0.5",
+    "supports-color": "^4.0.0"
+  },
+  "description": "Terminal string styling done right",
+  "devDependencies": {
+    "ava": "*",
+    "coveralls": "^2.11.2",
+    "execa": "^0.7.0",
+    "import-fresh": "^2.0.0",
+    "matcha": "^0.7.0",
+    "nyc": "^11.0.2",
+    "resolve-from": "^3.0.0",
+    "xo": "*"
+  },
+  "directories": {},
+  "dist": {
+    "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==",
+    "shasum": "ac5becf14fa21b99c6c92ca7a7d7cfd5b17e743e",
+    "tarball": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz"
+  },
+  "engines": {
+    "node": ">=4"
+  },
+  "files": [
+    "index.js",
+    "templates.js"
+  ],
+  "gitHead": "38f641a222d7ee0e607e4e5209d3931d2af1e409",
+  "homepage": "https://github.com/chalk/chalk#readme",
+  "keywords": [
+    "color",
+    "colour",
+    "colors",
+    "terminal",
+    "console",
+    "cli",
+    "string",
+    "str",
+    "ansi",
+    "style",
+    "styles",
+    "tty",
+    "formatting",
+    "rgb",
+    "256",
+    "shell",
+    "xterm",
+    "log",
+    "logging",
+    "command-line",
+    "text"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "qix",
+      "email": "i.am.qix@gmail.com"
+    },
+    {
+      "name": "unicorn",
+      "email": "sindresorhus+unicorn@gmail.com"
+    },
+    {
+      "name": "sindresorhus",
+      "email": "sindresorhus@gmail.com"
+    }
+  ],
+  "name": "chalk",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/chalk/chalk.git"
+  },
+  "scripts": {
+    "bench": "matcha benchmark.js",
+    "coveralls": "nyc report --reporter=text-lcov | coveralls",
+    "test": "xo && nyc ava"
+  },
+  "version": "2.1.0",
+  "xo": {
+    "envs": [
+      "node",
+      "mocha"
+    ]
+  }
+}
diff --git a/wrt/node_modules/chalk/readme.md b/wrt/node_modules/chalk/readme.md
new file mode 100644 (file)
index 0000000..dfcfdf2
--- /dev/null
@@ -0,0 +1,306 @@
+<h1 align="center">
+       <br>
+       <br>
+       <img width="320" src="https://cdn.rawgit.com/chalk/chalk/19935d6484811c5e468817f846b7b3d417d7bf4a/logo.svg" alt="chalk">
+       <br>
+       <br>
+       <br>
+</h1>
+
+> Terminal string styling done right
+
+[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)
+
+### [See what's new in Chalk 2](https://github.com/chalk/chalk/releases/tag/v2.0.0)
+
+![](https://github.com/chalk/ansi-styles/raw/master/screenshot.png)
+
+
+## Highlights
+
+- Expressive API
+- Highly performant
+- Ability to nest styles
+- [256/Truecolor color support](#256-and-truecolor-color-support)
+- Auto-detects color support
+- Doesn't extend `String.prototype`
+- Clean and focused
+- Actively maintained
+- [Used by ~17,000 packages](https://www.npmjs.com/browse/depended/chalk) as of June 20th, 2017
+
+
+## Install
+
+```console
+$ npm install chalk
+```
+
+
+## Usage
+
+```js
+const chalk = require('chalk');
+
+console.log(chalk.blue('Hello world!'));
+```
+
+Chalk comes with an easy to use composable API where you just chain and nest the styles you want.
+
+```js
+const chalk = require('chalk');
+const log = console.log;
+
+// Combine styled and normal strings
+log(chalk.blue('Hello') + 'World' + chalk.red('!'));
+
+// Compose multiple styles using the chainable API
+log(chalk.blue.bgRed.bold('Hello world!'));
+
+// Pass in multiple arguments
+log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz'));
+
+// Nest styles
+log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!'));
+
+// Nest styles of the same type even (color, underline, background)
+log(chalk.green(
+       'I am a green line ' +
+       chalk.blue.underline.bold('with a blue substring') +
+       ' that becomes green again!'
+));
+
+// ES2015 template literal
+log(`
+CPU: ${chalk.red('90%')}
+RAM: ${chalk.green('40%')}
+DISK: ${chalk.yellow('70%')}
+`);
+
+// ES2015 tagged template literal
+log(chalk`
+CPU: {red ${cpu.totalPercent}%}
+RAM: {green ${ram.used / ram.total * 100}%}
+DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%}
+`);
+
+// Use RGB colors in terminal emulators that support it.
+log(chalk.keyword('orange')('Yay for orange colored text!'));
+log(chalk.rgb(123, 45, 67).underline('Underlined reddish color'));
+log(chalk.hex('#DEADED').bold('Bold gray!'));
+```
+
+Easily define your own themes:
+
+```js
+const chalk = require('chalk');
+
+const error = chalk.bold.red;
+const warning = chalk.keyword('orange');
+
+console.log(error('Error!'));
+console.log(warning('Warning!'));
+```
+
+Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args):
+
+```js
+const name = 'Sindre';
+console.log(chalk.green('Hello %s'), name);
+//=> 'Hello Sindre'
+```
+
+
+## API
+
+### chalk.`<style>[.<style>...](string, [string...])`
+
+Example: `chalk.red.bold.underline('Hello', 'world');`
+
+Chain [styles](#styles) and call the last one as a method with a string argument. Order doesn't matter, and later styles take precedent in case of a conflict. This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`.
+
+Multiple arguments will be separated by space.
+
+### chalk.enabled
+
+Color support is automatically detected, as is the level (see `chalk.level`). However, if you'd like to simply enable/disable Chalk, you can do so via the `.enabled` property.
+
+Chalk is enabled by default unless expicitly disabled via the constructor or `chalk.level` is `0`.
+
+If you need to change this in a reusable module, create a new instance:
+
+```js
+const ctx = new chalk.constructor({enabled: false});
+```
+
+### chalk.level
+
+Color support is automatically detected, but you can override it by setting the `level` property. You should however only do this in your own code as it applies globally to all Chalk consumers.
+
+If you need to change this in a reusable module, create a new instance:
+
+```js
+const ctx = new chalk.constructor({level: 0});
+```
+
+Levels are as follows:
+
+0. All colors disabled
+1. Basic color support (16 colors)
+2. 256 color support
+3. Truecolor support (16 million colors)
+
+### chalk.supportsColor
+
+Detect whether the terminal [supports color](https://github.com/chalk/supports-color). Used internally and handled for you, but exposed for convenience.
+
+Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add the environment variable `FORCE_COLOR=1` to forcefully enable color or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks.
+
+Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively.
+
+
+## Styles
+
+### Modifiers
+
+- `reset`
+- `bold`
+- `dim`
+- `italic` *(Not widely supported)*
+- `underline`
+- `inverse`
+- `hidden`
+- `strikethrough` *(Not widely supported)*
+
+### Colors
+
+- `black`
+- `red`
+- `green`
+- `yellow`
+- `blue` *(On Windows the bright version is used since normal blue is illegible)*
+- `magenta`
+- `cyan`
+- `white`
+- `gray` ("bright black")
+- `redBright`
+- `greenBright`
+- `yellowBright`
+- `blueBright`
+- `magentaBright`
+- `cyanBright`
+- `whiteBright`
+
+### Background colors
+
+- `bgBlack`
+- `bgRed`
+- `bgGreen`
+- `bgYellow`
+- `bgBlue`
+- `bgMagenta`
+- `bgCyan`
+- `bgWhite`
+- `bgBlackBright`
+- `bgRedBright`
+- `bgGreenBright`
+- `bgYellowBright`
+- `bgBlueBright`
+- `bgMagentaBright`
+- `bgCyanBright`
+- `bgWhiteBright`
+
+
+## Tagged template literal
+
+Chalk can be used as a [tagged template literal](http://exploringjs.com/es6/ch_template-literals.html#_tagged-template-literals).
+
+```js
+const chalk = require('chalk');
+
+const miles = 18;
+const calculateFeet = miles => miles * 5280;
+
+console.log(chalk`
+  There are {bold 5280 feet} in a mile.
+  In {bold ${miles} miles}, there are {green.bold ${calculateFeet(miles)} feet}.
+`);
+```
+
+Blocks are delimited by an opening curly brace (`{`), a style, some content, and a closing curly brace (`}`).
+
+Template styles are chained exactly like normal Chalk styles. The following two statements are equivalent:
+
+```js
+console.log(chalk.bold.rgb(10, 100, 200)('Hello!'));
+console.log(chalk`{bold.rgb(10,100,200) Hello!}`);
+```
+
+Note that function styles (`rgb()`, `hsl()`, `keyword()`, etc.) may not contain spaces between parameters.
+
+All interpolated values (`` chalk`${foo}` ``) are converted to strings via the `.toString()` method. All curly braces (`{` and `}`) in interpolated value strings are escaped.
+
+
+## 256 and Truecolor color support
+
+Chalk supports 256 colors and [Truecolor](https://gist.github.com/XVilka/8346728) (16 million colors) on supported terminal apps.
+
+Colors are downsampled from 16 million RGB values to an ANSI color format that is supported by the terminal emulator (or by specifying `{level: n}` as a Chalk option). For example, Chalk configured to run at level 1 (basic color support) will downsample an RGB value of #FF0000 (red) to 31 (ANSI escape for red).
+
+Examples:
+
+- `chalk.hex('#DEADED').underline('Hello, world!')`
+- `chalk.keyword('orange')('Some orange text')`
+- `chalk.rgb(15, 100, 204).inverse('Hello!')`
+
+Background versions of these models are prefixed with `bg` and the first level of the module capitalized (e.g. `keyword` for foreground colors and `bgKeyword` for background colors).
+
+- `chalk.bgHex('#DEADED').underline('Hello, world!')`
+- `chalk.bgKeyword('orange')('Some orange text')`
+- `chalk.bgRgb(15, 100, 204).inverse('Hello!')`
+
+The following color models can be used:
+
+- [`rgb`](https://en.wikipedia.org/wiki/RGB_color_model) - Example: `chalk.rgb(255, 136, 0).bold('Orange!')`
+- [`hex`](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) - Example: `chalk.hex('#FF8800').bold('Orange!')`
+- [`keyword`](https://www.w3.org/wiki/CSS/Properties/color/keywords) (CSS keywords) - Example: `chalk.keyword('orange').bold('Orange!')`
+- [`hsl`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsl(32, 100, 50).bold('Orange!')`
+- [`hsv`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsl(32, 1, 1).bold('Orange!')`
+- [`hwb`](https://en.wikipedia.org/wiki/HWB_color_model)  - Example: `chalk.hsl(32, 0, 50).bold('Orange!')`
+- `ansi16`
+- `ansi256`
+
+
+## Windows
+
+If you're on Windows, do yourself a favor and use [`cmder`](http://cmder.net/) instead of `cmd.exe`.
+
+
+## Origin story
+
+[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68) and the package is unmaintained. Although there are other packages, they either do too much or not enough. Chalk is a clean and focused alternative.
+
+
+## Related
+
+- [chalk-cli](https://github.com/chalk/chalk-cli) - CLI for this module
+- [ansi-styles](https://github.com/chalk/ansi-styles) - ANSI escape codes for styling strings in the terminal
+- [supports-color](https://github.com/chalk/supports-color) - Detect whether a terminal supports color
+- [strip-ansi](https://github.com/chalk/strip-ansi) - Strip ANSI escape codes
+- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes
+- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
+- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes
+- [slice-ansi](https://github.com/chalk/slice-ansi) - Slice a string with ANSI escape codes
+- [color-convert](https://github.com/qix-/color-convert) - Converts colors between different models
+- [chalk-animation](https://github.com/bokub/chalk-animation) - Animate strings in the terminal
+- [gradient-string](https://github.com/bokub/gradient-string) - Apply color gradients to strings
+
+
+## Maintainers
+
+- [Sindre Sorhus](https://github.com/sindresorhus)
+- [Josh Junon](https://github.com/qix-)
+
+
+## License
+
+MIT
diff --git a/wrt/node_modules/chalk/templates.js b/wrt/node_modules/chalk/templates.js
new file mode 100644 (file)
index 0000000..1015515
--- /dev/null
@@ -0,0 +1,128 @@
+'use strict';
+const TEMPLATE_REGEX = /(?:\\(u[a-f0-9]{4}|x[a-f0-9]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
+const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
+const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
+const ESCAPE_REGEX = /\\(u[0-9a-f]{4}|x[0-9a-f]{2}|.)|([^\\])/gi;
+
+const ESCAPES = {
+       n: '\n',
+       r: '\r',
+       t: '\t',
+       b: '\b',
+       f: '\f',
+       v: '\v',
+       0: '\0',
+       '\\': '\\',
+       e: '\u001b',
+       a: '\u0007'
+};
+
+function unescape(c) {
+       if ((c[0] === 'u' && c.length === 5) || (c[0] === 'x' && c.length === 3)) {
+               return String.fromCharCode(parseInt(c.slice(1), 16));
+       }
+
+       return ESCAPES[c] || c;
+}
+
+function parseArguments(name, args) {
+       const results = [];
+       const chunks = args.trim().split(/\s*,\s*/g);
+       let matches;
+
+       for (const chunk of chunks) {
+               if (!isNaN(chunk)) {
+                       results.push(Number(chunk));
+               } else if ((matches = chunk.match(STRING_REGEX))) {
+                       results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, chr) => escape ? unescape(escape) : chr));
+               } else {
+                       throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
+               }
+       }
+
+       return results;
+}
+
+function parseStyle(style) {
+       STYLE_REGEX.lastIndex = 0;
+
+       const results = [];
+       let matches;
+
+       while ((matches = STYLE_REGEX.exec(style)) !== null) {
+               const name = matches[1];
+
+               if (matches[2]) {
+                       const args = parseArguments(name, matches[2]);
+                       results.push([name].concat(args));
+               } else {
+                       results.push([name]);
+               }
+       }
+
+       return results;
+}
+
+function buildStyle(chalk, styles) {
+       const enabled = {};
+
+       for (const layer of styles) {
+               for (const style of layer.styles) {
+                       enabled[style[0]] = layer.inverse ? null : style.slice(1);
+               }
+       }
+
+       let current = chalk;
+       for (const styleName of Object.keys(enabled)) {
+               if (Array.isArray(enabled[styleName])) {
+                       if (!(styleName in current)) {
+                               throw new Error(`Unknown Chalk style: ${styleName}`);
+                       }
+
+                       if (enabled[styleName].length > 0) {
+                               current = current[styleName].apply(current, enabled[styleName]);
+                       } else {
+                               current = current[styleName];
+                       }
+               }
+       }
+
+       return current;
+}
+
+module.exports = (chalk, tmp) => {
+       const styles = [];
+       const chunks = [];
+       let chunk = [];
+
+       // eslint-disable-next-line max-params
+       tmp.replace(TEMPLATE_REGEX, (m, escapeChar, inverse, style, close, chr) => {
+               if (escapeChar) {
+                       chunk.push(unescape(escapeChar));
+               } else if (style) {
+                       const str = chunk.join('');
+                       chunk = [];
+                       chunks.push(styles.length === 0 ? str : buildStyle(chalk, styles)(str));
+                       styles.push({inverse, styles: parseStyle(style)});
+               } else if (close) {
+                       if (styles.length === 0) {
+                               throw new Error('Found extraneous } in Chalk template literal');
+                       }
+
+                       chunks.push(buildStyle(chalk, styles)(chunk.join('')));
+                       chunk = [];
+                       styles.pop();
+               } else {
+                       chunk.push(chr);
+               }
+       });
+
+       chunks.push(chunk.join(''));
+
+       if (styles.length > 0) {
+               const errMsg = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`;
+               throw new Error(errMsg);
+       }
+
+       return chunks.join('');
+};
diff --git a/wrt/node_modules/color-convert/CHANGELOG.md b/wrt/node_modules/color-convert/CHANGELOG.md
new file mode 100644 (file)
index 0000000..0a7bce4
--- /dev/null
@@ -0,0 +1,54 @@
+# 1.0.0 - 2016-01-07
+
+- Removed: unused speed test
+- Added: Automatic routing between previously unsupported conversions
+([#27](https://github.com/Qix-/color-convert/pull/27))
+- Removed: `xxx2xxx()` and `xxx2xxxRaw()` functions
+([#27](https://github.com/Qix-/color-convert/pull/27))
+- Removed: `convert()` class
+([#27](https://github.com/Qix-/color-convert/pull/27))
+- Changed: all functions to lookup dictionary
+([#27](https://github.com/Qix-/color-convert/pull/27))
+- Changed: `ansi` to `ansi256`
+([#27](https://github.com/Qix-/color-convert/pull/27))
+- Fixed: argument grouping for functions requiring only one argument
+([#27](https://github.com/Qix-/color-convert/pull/27))
+
+# 0.6.0 - 2015-07-23
+
+- Added: methods to handle
+[ANSI](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors) 16/256 colors:
+  - rgb2ansi16
+  - rgb2ansi
+  - hsl2ansi16
+  - hsl2ansi
+  - hsv2ansi16
+  - hsv2ansi
+  - hwb2ansi16
+  - hwb2ansi
+  - cmyk2ansi16
+  - cmyk2ansi
+  - keyword2ansi16
+  - keyword2ansi
+  - ansi162rgb
+  - ansi162hsl
+  - ansi162hsv
+  - ansi162hwb
+  - ansi162cmyk
+  - ansi162keyword
+  - ansi2rgb
+  - ansi2hsl
+  - ansi2hsv
+  - ansi2hwb
+  - ansi2cmyk
+  - ansi2keyword
+([#18](https://github.com/harthur/color-convert/pull/18))
+
+# 0.5.3 - 2015-06-02
+
+- Fixed: hsl2hsv does not return `NaN` anymore when using `[0,0,0]`
+([#15](https://github.com/harthur/color-convert/issues/15))
+
+---
+
+Check out commit logs for older releases
diff --git a/wrt/node_modules/color-convert/LICENSE b/wrt/node_modules/color-convert/LICENSE
new file mode 100644 (file)
index 0000000..5b4c386
--- /dev/null
@@ -0,0 +1,21 @@
+Copyright (c) 2011-2016 Heather Arthur <fayearthur@gmail.com>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/wrt/node_modules/color-convert/README.md b/wrt/node_modules/color-convert/README.md
new file mode 100644 (file)
index 0000000..d4b08fc
--- /dev/null
@@ -0,0 +1,68 @@
+# color-convert
+
+[![Build Status](https://travis-ci.org/Qix-/color-convert.svg?branch=master)](https://travis-ci.org/Qix-/color-convert)
+
+Color-convert is a color conversion library for JavaScript and node.
+It converts all ways between `rgb`, `hsl`, `hsv`, `hwb`, `cmyk`, `ansi`, `ansi16`, `hex` strings, and CSS `keyword`s (will round to closest):
+
+```js
+var convert = require('color-convert');
+
+convert.rgb.hsl(140, 200, 100);             // [96, 48, 59]
+convert.keyword.rgb('blue');                // [0, 0, 255]
+
+var rgbChannels = convert.rgb.channels;     // 3
+var cmykChannels = convert.cmyk.channels;   // 4
+var ansiChannels = convert.ansi16.channels; // 1
+```
+
+# Install
+
+```console
+$ npm install color-convert
+```
+
+# API
+
+Simply get the property of the _from_ and _to_ conversion that you're looking for.
+
+All functions have a rounded and unrounded variant. By default, return values are rounded. To get the unrounded (raw) results, simply tack on `.raw` to the function.
+
+All 'from' functions have a hidden property called `.channels` that indicates the number of channels the function expects (not including alpha).
+
+```js
+var convert = require('color-convert');
+
+// Hex to LAB
+convert.hex.lab('DEADBF');         // [ 76, 21, -2 ]
+convert.hex.lab.raw('DEADBF');     // [ 75.56213190997677, 20.653827952644754, -2.290532499330533 ]
+
+// RGB to CMYK
+convert.rgb.cmyk(167, 255, 4);     // [ 35, 0, 98, 0 ]
+convert.rgb.cmyk.raw(167, 255, 4); // [ 34.509803921568626, 0, 98.43137254901961, 0 ]
+```
+
+### Arrays
+All functions that accept multiple arguments also support passing an array.
+
+Note that this does **not** apply to functions that convert from a color that only requires one value (e.g. `keyword`, `ansi256`, `hex`, etc.)
+
+```js
+var convert = require('color-convert');
+
+convert.rgb.hex(123, 45, 67);      // '7B2D43'
+convert.rgb.hex([123, 45, 67]);    // '7B2D43'
+```
+
+## Routing
+
+Conversions that don't have an _explicitly_ defined conversion (in [conversions.js](conversions.js)), but can be converted by means of sub-conversions (e.g. XYZ -> **RGB** -> CMYK), are automatically routed together. This allows just about any color model supported by `color-convert` to be converted to any other model, so long as a sub-conversion path exists. This is also true for conversions requiring more than one step in between (e.g. LCH -> **LAB** -> **XYZ** -> **RGB** -> Hex).
+
+Keep in mind that extensive conversions _may_ result in a loss of precision, and exist only to be complete. For a list of "direct" (single-step) conversions, see [conversions.js](conversions.js).
+
+# Contribute
+
+If there is a new model you would like to support, or want to add a direct conversion between two existing models, please send us a pull request.
+
+# License
+Copyright &copy; 2011-2016, Heather Arthur and Josh Junon. Licensed under the [MIT License](LICENSE).
diff --git a/wrt/node_modules/color-convert/conversions.js b/wrt/node_modules/color-convert/conversions.js
new file mode 100644 (file)
index 0000000..19ca4a9
--- /dev/null
@@ -0,0 +1,861 @@
+/* MIT license */
+var cssKeywords = require('color-name');
+
+// NOTE: conversions should only return primitive values (i.e. arrays, or
+//       values that give correct `typeof` results).
+//       do not use box values types (i.e. Number(), String(), etc.)
+
+var reverseKeywords = {};
+for (var key in cssKeywords) {
+       if (cssKeywords.hasOwnProperty(key)) {
+               reverseKeywords[cssKeywords[key]] = key;
+       }
+}
+
+var convert = module.exports = {
+       rgb: {channels: 3, labels: 'rgb'},
+       hsl: {channels: 3, labels: 'hsl'},
+       hsv: {channels: 3, labels: 'hsv'},
+       hwb: {channels: 3, labels: 'hwb'},
+       cmyk: {channels: 4, labels: 'cmyk'},
+       xyz: {channels: 3, labels: 'xyz'},
+       lab: {channels: 3, labels: 'lab'},
+       lch: {channels: 3, labels: 'lch'},
+       hex: {channels: 1, labels: ['hex']},
+       keyword: {channels: 1, labels: ['keyword']},
+       ansi16: {channels: 1, labels: ['ansi16']},
+       ansi256: {channels: 1, labels: ['ansi256']},
+       hcg: {channels: 3, labels: ['h', 'c', 'g']},
+       apple: {channels: 3, labels: ['r16', 'g16', 'b16']},
+       gray: {channels: 1, labels: ['gray']}
+};
+
+// hide .channels and .labels properties
+for (var model in convert) {
+       if (convert.hasOwnProperty(model)) {
+               if (!('channels' in convert[model])) {
+                       throw new Error('missing channels property: ' + model);
+               }
+
+               if (!('labels' in convert[model])) {
+                       throw new Error('missing channel labels property: ' + model);
+               }
+
+               if (convert[model].labels.length !== convert[model].channels) {
+                       throw new Error('channel and label counts mismatch: ' + model);
+               }
+
+               var channels = convert[model].channels;
+               var labels = convert[model].labels;
+               delete convert[model].channels;
+               delete convert[model].labels;
+               Object.defineProperty(convert[model], 'channels', {value: channels});
+               Object.defineProperty(convert[model], 'labels', {value: labels});
+       }
+}
+
+convert.rgb.hsl = function (rgb) {
+       var r = rgb[0] / 255;
+       var g = rgb[1] / 255;
+       var b = rgb[2] / 255;
+       var min = Math.min(r, g, b);
+       var max = Math.max(r, g, b);
+       var delta = max - min;
+       var h;
+       var s;
+       var l;
+
+       if (max === min) {
+               h = 0;
+       } else if (r === max) {
+               h = (g - b) / delta;
+       } else if (g === max) {
+               h = 2 + (b - r) / delta;
+       } else if (b === max) {
+               h = 4 + (r - g) / delta;
+       }
+
+       h = Math.min(h * 60, 360);
+
+       if (h < 0) {
+               h += 360;
+       }
+
+       l = (min + max) / 2;
+
+       if (max === min) {
+               s = 0;
+       } else if (l <= 0.5) {
+               s = delta / (max + min);
+       } else {
+               s = delta / (2 - max - min);
+       }
+
+       return [h, s * 100, l * 100];
+};
+
+convert.rgb.hsv = function (rgb) {
+       var r = rgb[0];
+       var g = rgb[1];
+       var b = rgb[2];
+       var min = Math.min(r, g, b);
+       var max = Math.max(r, g, b);
+       var delta = max - min;
+       var h;
+       var s;
+       var v;
+
+       if (max === 0) {
+               s = 0;
+       } else {
+               s = (delta / max * 1000) / 10;
+       }
+
+       if (max === min) {
+               h = 0;
+       } else if (r === max) {
+               h = (g - b) / delta;
+       } else if (g === max) {
+               h = 2 + (b - r) / delta;
+       } else if (b === max) {
+               h = 4 + (r - g) / delta;
+       }
+
+       h = Math.min(h * 60, 360);
+
+       if (h < 0) {
+               h += 360;
+       }
+
+       v = ((max / 255) * 1000) / 10;
+
+       return [h, s, v];
+};
+
+convert.rgb.hwb = function (rgb) {
+       var r = rgb[0];
+       var g = rgb[1];
+       var b = rgb[2];
+       var h = convert.rgb.hsl(rgb)[0];
+       var w = 1 / 255 * Math.min(r, Math.min(g, b));
+
+       b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
+
+       return [h, w * 100, b * 100];
+};
+
+convert.rgb.cmyk = function (rgb) {
+       var r = rgb[0] / 255;
+       var g = rgb[1] / 255;
+       var b = rgb[2] / 255;
+       var c;
+       var m;
+       var y;
+       var k;
+
+       k = Math.min(1 - r, 1 - g, 1 - b);
+       c = (1 - r - k) / (1 - k) || 0;
+       m = (1 - g - k) / (1 - k) || 0;
+       y = (1 - b - k) / (1 - k) || 0;
+
+       return [c * 100, m * 100, y * 100, k * 100];
+};
+
+/**
+ * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
+ * */
+function comparativeDistance(x, y) {
+       return (
+               Math.pow(x[0] - y[0], 2) +
+               Math.pow(x[1] - y[1], 2) +
+               Math.pow(x[2] - y[2], 2)
+       );
+}
+
+convert.rgb.keyword = function (rgb) {
+       var reversed = reverseKeywords[rgb];
+       if (reversed) {
+               return reversed;
+       }
+
+       var currentClosestDistance = Infinity;
+       var currentClosestKeyword;
+
+       for (var keyword in cssKeywords) {
+               if (cssKeywords.hasOwnProperty(keyword)) {
+                       var value = cssKeywords[keyword];
+
+                       // Compute comparative distance
+                       var distance = comparativeDistance(rgb, value);
+
+                       // Check if its less, if so set as closest
+                       if (distance < currentClosestDistance) {
+                               currentClosestDistance = distance;
+                               currentClosestKeyword = keyword;
+                       }
+               }
+       }
+
+       return currentClosestKeyword;
+};
+
+convert.keyword.rgb = function (keyword) {
+       return cssKeywords[keyword];
+};
+
+convert.rgb.xyz = function (rgb) {
+       var r = rgb[0] / 255;
+       var g = rgb[1] / 255;
+       var b = rgb[2] / 255;
+
+       // assume sRGB
+       r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92);
+       g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92);
+       b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92);
+
+       var x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);
+       var y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);
+       var z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);
+
+       return [x * 100, y * 100, z * 100];
+};
+
+convert.rgb.lab = function (rgb) {
+       var xyz = convert.rgb.xyz(rgb);
+       var x = xyz[0];
+       var y = xyz[1];
+       var z = xyz[2];
+       var l;
+       var a;
+       var b;
+
+       x /= 95.047;
+       y /= 100;
+       z /= 108.883;
+
+       x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);
+       y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);
+       z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);
+
+       l = (116 * y) - 16;
+       a = 500 * (x - y);
+       b = 200 * (y - z);
+
+       return [l, a, b];
+};
+
+convert.hsl.rgb = function (hsl) {
+       var h = hsl[0] / 360;
+       var s = hsl[1] / 100;
+       var l = hsl[2] / 100;
+       var t1;
+       var t2;
+       var t3;
+       var rgb;
+       var val;
+
+       if (s === 0) {
+               val = l * 255;
+               return [val, val, val];
+       }
+
+       if (l < 0.5) {
+               t2 = l * (1 + s);
+       } else {
+               t2 = l + s - l * s;
+       }
+
+       t1 = 2 * l - t2;
+
+       rgb = [0, 0, 0];
+       for (var i = 0; i < 3; i++) {
+               t3 = h + 1 / 3 * -(i - 1);
+               if (t3 < 0) {
+                       t3++;
+               }
+               if (t3 > 1) {
+                       t3--;
+               }
+
+               if (6 * t3 < 1) {
+                       val = t1 + (t2 - t1) * 6 * t3;
+               } else if (2 * t3 < 1) {
+                       val = t2;
+               } else if (3 * t3 < 2) {
+                       val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
+               } else {
+                       val = t1;
+               }
+
+               rgb[i] = val * 255;
+       }
+
+       return rgb;
+};
+
+convert.hsl.hsv = function (hsl) {
+       var h = hsl[0];
+       var s = hsl[1] / 100;
+       var l = hsl[2] / 100;
+       var smin = s;
+       var lmin = Math.max(l, 0.01);
+       var sv;
+       var v;
+
+       l *= 2;
+       s *= (l <= 1) ? l : 2 - l;
+       smin *= lmin <= 1 ? lmin : 2 - lmin;
+       v = (l + s) / 2;
+       sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);
+
+       return [h, sv * 100, v * 100];
+};
+
+convert.hsv.rgb = function (hsv) {
+       var h = hsv[0] / 60;
+       var s = hsv[1] / 100;
+       var v = hsv[2] / 100;
+       var hi = Math.floor(h) % 6;
+
+       var f = h - Math.floor(h);
+       var p = 255 * v * (1 - s);
+       var q = 255 * v * (1 - (s * f));
+       var t = 255 * v * (1 - (s * (1 - f)));
+       v *= 255;
+
+       switch (hi) {
+               case 0:
+                       return [v, t, p];
+               case 1:
+                       return [q, v, p];
+               case 2:
+                       return [p, v, t];
+               case 3:
+                       return [p, q, v];
+               case 4:
+                       return [t, p, v];
+               case 5:
+                       return [v, p, q];
+       }
+};
+
+convert.hsv.hsl = function (hsv) {
+       var h = hsv[0];
+       var s = hsv[1] / 100;
+       var v = hsv[2] / 100;
+       var vmin = Math.max(v, 0.01);
+       var lmin;
+       var sl;
+       var l;
+
+       l = (2 - s) * v;
+       lmin = (2 - s) * vmin;
+       sl = s * vmin;
+       sl /= (lmin <= 1) ? lmin : 2 - lmin;
+       sl = sl || 0;
+       l /= 2;
+
+       return [h, sl * 100, l * 100];
+};
+
+// http://dev.w3.org/csswg/css-color/#hwb-to-rgb
+convert.hwb.rgb = function (hwb) {
+       var h = hwb[0] / 360;
+       var wh = hwb[1] / 100;
+       var bl = hwb[2] / 100;
+       var ratio = wh + bl;
+       var i;
+       var v;
+       var f;
+       var n;
+
+       // wh + bl cant be > 1
+       if (ratio > 1) {
+               wh /= ratio;
+               bl /= ratio;
+       }
+
+       i = Math.floor(6 * h);
+       v = 1 - bl;
+       f = 6 * h - i;
+
+       if ((i & 0x01) !== 0) {
+               f = 1 - f;
+       }
+
+       n = wh + f * (v - wh); // linear interpolation
+
+       var r;
+       var g;
+       var b;
+       switch (i) {
+               default:
+               case 6:
+               case 0: r = v; g = n; b = wh; break;
+               case 1: r = n; g = v; b = wh; break;
+               case 2: r = wh; g = v; b = n; break;
+               case 3: r = wh; g = n; b = v; break;
+               case 4: r = n; g = wh; b = v; break;
+               case 5: r = v; g = wh; b = n; break;
+       }
+
+       return [r * 255, g * 255, b * 255];
+};
+
+convert.cmyk.rgb = function (cmyk) {
+       var c = cmyk[0] / 100;
+       var m = cmyk[1] / 100;
+       var y = cmyk[2] / 100;
+       var k = cmyk[3] / 100;
+       var r;
+       var g;
+       var b;
+
+       r = 1 - Math.min(1, c * (1 - k) + k);
+       g = 1 - Math.min(1, m * (1 - k) + k);
+       b = 1 - Math.min(1, y * (1 - k) + k);
+
+       return [r * 255, g * 255, b * 255];
+};
+
+convert.xyz.rgb = function (xyz) {
+       var x = xyz[0] / 100;
+       var y = xyz[1] / 100;
+       var z = xyz[2] / 100;
+       var r;
+       var g;
+       var b;
+
+       r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);
+       g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);
+       b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);
+
+       // assume sRGB
+       r = r > 0.0031308
+               ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055)
+               : r * 12.92;
+
+       g = g > 0.0031308
+               ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055)
+               : g * 12.92;
+
+       b = b > 0.0031308
+               ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055)
+               : b * 12.92;
+
+       r = Math.min(Math.max(0, r), 1);
+       g = Math.min(Math.max(0, g), 1);
+       b = Math.min(Math.max(0, b), 1);
+
+       return [r * 255, g * 255, b * 255];
+};
+
+convert.xyz.lab = function (xyz) {
+       var x = xyz[0];
+       var y = xyz[1];
+       var z = xyz[2];
+       var l;
+       var a;
+       var b;
+
+       x /= 95.047;
+       y /= 100;
+       z /= 108.883;
+
+       x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);
+       y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);
+       z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);
+
+       l = (116 * y) - 16;
+       a = 500 * (x - y);
+       b = 200 * (y - z);
+
+       return [l, a, b];
+};
+
+convert.lab.xyz = function (lab) {
+       var l = lab[0];
+       var a = lab[1];
+       var b = lab[2];
+       var x;
+       var y;
+       var z;
+
+       y = (l + 16) / 116;
+       x = a / 500 + y;
+       z = y - b / 200;
+
+       var y2 = Math.pow(y, 3);
+       var x2 = Math.pow(x, 3);
+       var z2 = Math.pow(z, 3);
+       y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
+       x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
+       z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
+
+       x *= 95.047;
+       y *= 100;
+       z *= 108.883;
+
+       return [x, y, z];
+};
+
+convert.lab.lch = function (lab) {
+       var l = lab[0];
+       var a = lab[1];
+       var b = lab[2];
+       var hr;
+       var h;
+       var c;
+
+       hr = Math.atan2(b, a);
+       h = hr * 360 / 2 / Math.PI;
+
+       if (h < 0) {
+               h += 360;
+       }
+
+       c = Math.sqrt(a * a + b * b);
+
+       return [l, c, h];
+};
+
+convert.lch.lab = function (lch) {
+       var l = lch[0];
+       var c = lch[1];
+       var h = lch[2];
+       var a;
+       var b;
+       var hr;
+
+       hr = h / 360 * 2 * Math.PI;
+       a = c * Math.cos(hr);
+       b = c * Math.sin(hr);
+
+       return [l, a, b];
+};
+
+convert.rgb.ansi16 = function (args) {
+       var r = args[0];
+       var g = args[1];
+       var b = args[2];
+       var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization
+
+       value = Math.round(value / 50);
+
+       if (value === 0) {
+               return 30;
+       }
+
+       var ansi = 30
+               + ((Math.round(b / 255) << 2)
+               | (Math.round(g / 255) << 1)
+               | Math.round(r / 255));
+
+       if (value === 2) {
+               ansi += 60;
+       }
+
+       return ansi;
+};
+
+convert.hsv.ansi16 = function (args) {
+       // optimization here; we already know the value and don't need to get
+       // it converted for us.
+       return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
+};
+
+convert.rgb.ansi256 = function (args) {
+       var r = args[0];
+       var g = args[1];
+       var b = args[2];
+
+       // we use the extended greyscale palette here, with the exception of
+       // black and white. normal palette only has 4 greyscale shades.
+       if (r === g && g === b) {
+               if (r < 8) {
+                       return 16;
+               }
+
+               if (r > 248) {
+                       return 231;
+               }
+
+               return Math.round(((r - 8) / 247) * 24) + 232;
+       }
+
+       var ansi = 16
+               + (36 * Math.round(r / 255 * 5))
+               + (6 * Math.round(g / 255 * 5))
+               + Math.round(b / 255 * 5);
+
+       return ansi;
+};
+
+convert.ansi16.rgb = function (args) {
+       var color = args % 10;
+
+       // handle greyscale
+       if (color === 0 || color === 7) {
+               if (args > 50) {
+                       color += 3.5;
+               }
+
+               color = color / 10.5 * 255;
+
+               return [color, color, color];
+       }
+
+       var mult = (~~(args > 50) + 1) * 0.5;
+       var r = ((color & 1) * mult) * 255;
+       var g = (((color >> 1) & 1) * mult) * 255;
+       var b = (((color >> 2) & 1) * mult) * 255;
+
+       return [r, g, b];
+};
+
+convert.ansi256.rgb = function (args) {
+       // handle greyscale
+       if (args >= 232) {
+               var c = (args - 232) * 10 + 8;
+               return [c, c, c];
+       }
+
+       args -= 16;
+
+       var rem;
+       var r = Math.floor(args / 36) / 5 * 255;
+       var g = Math.floor((rem = args % 36) / 6) / 5 * 255;
+       var b = (rem % 6) / 5 * 255;
+
+       return [r, g, b];
+};
+
+convert.rgb.hex = function (args) {
+       var integer = ((Math.round(args[0]) & 0xFF) << 16)
+               + ((Math.round(args[1]) & 0xFF) << 8)
+               + (Math.round(args[2]) & 0xFF);
+
+       var string = integer.toString(16).toUpperCase();
+       return '000000'.substring(string.length) + string;
+};
+
+convert.hex.rgb = function (args) {
+       var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
+       if (!match) {
+               return [0, 0, 0];
+       }
+
+       var colorString = match[0];
+
+       if (match[0].length === 3) {
+               colorString = colorString.split('').map(function (char) {
+                       return char + char;
+               }).join('');
+       }
+
+       var integer = parseInt(colorString, 16);
+       var r = (integer >> 16) & 0xFF;
+       var g = (integer >> 8) & 0xFF;
+       var b = integer & 0xFF;
+
+       return [r, g, b];
+};
+
+convert.rgb.hcg = function (rgb) {
+       var r = rgb[0] / 255;
+       var g = rgb[1] / 255;
+       var b = rgb[2] / 255;
+       var max = Math.max(Math.max(r, g), b);
+       var min = Math.min(Math.min(r, g), b);
+       var chroma = (max - min);
+       var grayscale;
+       var hue;
+
+       if (chroma < 1) {
+               grayscale = min / (1 - chroma);
+       } else {
+               grayscale = 0;
+       }
+
+       if (chroma <= 0) {
+               hue = 0;
+       } else
+       if (max === r) {
+               hue = ((g - b) / chroma) % 6;
+       } else
+       if (max === g) {
+               hue = 2 + (b - r) / chroma;
+       } else {
+               hue = 4 + (r - g) / chroma + 4;
+       }
+
+       hue /= 6;
+       hue %= 1;
+
+       return [hue * 360, chroma * 100, grayscale * 100];
+};
+
+convert.hsl.hcg = function (hsl) {
+       var s = hsl[1] / 100;
+       var l = hsl[2] / 100;
+       var c = 1;
+       var f = 0;
+
+       if (l < 0.5) {
+               c = 2.0 * s * l;
+       } else {
+               c = 2.0 * s * (1.0 - l);
+       }
+
+       if (c < 1.0) {
+               f = (l - 0.5 * c) / (1.0 - c);
+       }
+
+       return [hsl[0], c * 100, f * 100];
+};
+
+convert.hsv.hcg = function (hsv) {
+       var s = hsv[1] / 100;
+       var v = hsv[2] / 100;
+
+       var c = s * v;
+       var f = 0;
+
+       if (c < 1.0) {
+               f = (v - c) / (1 - c);
+       }
+
+       return [hsv[0], c * 100, f * 100];
+};
+
+convert.hcg.rgb = function (hcg) {
+       var h = hcg[0] / 360;
+       var c = hcg[1] / 100;
+       var g = hcg[2] / 100;
+
+       if (c === 0.0) {
+               return [g * 255, g * 255, g * 255];
+       }
+
+       var pure = [0, 0, 0];
+       var hi = (h % 1) * 6;
+       var v = hi % 1;
+       var w = 1 - v;
+       var mg = 0;
+
+       switch (Math.floor(hi)) {
+               case 0:
+                       pure[0] = 1; pure[1] = v; pure[2] = 0; break;
+               case 1:
+                       pure[0] = w; pure[1] = 1; pure[2] = 0; break;
+               case 2:
+                       pure[0] = 0; pure[1] = 1; pure[2] = v; break;
+               case 3:
+                       pure[0] = 0; pure[1] = w; pure[2] = 1; break;
+               case 4:
+                       pure[0] = v; pure[1] = 0; pure[2] = 1; break;
+               default:
+                       pure[0] = 1; pure[1] = 0; pure[2] = w;
+       }
+
+       mg = (1.0 - c) * g;
+
+       return [
+               (c * pure[0] + mg) * 255,
+               (c * pure[1] + mg) * 255,
+               (c * pure[2] + mg) * 255
+       ];
+};
+
+convert.hcg.hsv = function (hcg) {
+       var c = hcg[1] / 100;
+       var g = hcg[2] / 100;
+
+       var v = c + g * (1.0 - c);
+       var f = 0;
+
+       if (v > 0.0) {
+               f = c / v;
+       }
+
+       return [hcg[0], f * 100, v * 100];
+};
+
+convert.hcg.hsl = function (hcg) {
+       var c = hcg[1] / 100;
+       var g = hcg[2] / 100;
+
+       var l = g * (1.0 - c) + 0.5 * c;
+       var s = 0;
+
+       if (l > 0.0 && l < 0.5) {
+               s = c / (2 * l);
+       } else
+       if (l >= 0.5 && l < 1.0) {
+               s = c / (2 * (1 - l));
+       }
+
+       return [hcg[0], s * 100, l * 100];
+};
+
+convert.hcg.hwb = function (hcg) {
+       var c = hcg[1] / 100;
+       var g = hcg[2] / 100;
+       var v = c + g * (1.0 - c);
+       return [hcg[0], (v - c) * 100, (1 - v) * 100];
+};
+
+convert.hwb.hcg = function (hwb) {
+       var w = hwb[1] / 100;
+       var b = hwb[2] / 100;
+       var v = 1 - b;
+       var c = v - w;
+       var g = 0;
+
+       if (c < 1) {
+               g = (v - c) / (1 - c);
+       }
+
+       return [hwb[0], c * 100, g * 100];
+};
+
+convert.apple.rgb = function (apple) {
+       return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];
+};
+
+convert.rgb.apple = function (rgb) {
+       return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];
+};
+
+convert.gray.rgb = function (args) {
+       return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
+};
+
+convert.gray.hsl = convert.gray.hsv = function (args) {
+       return [0, 0, args[0]];
+};
+
+convert.gray.hwb = function (gray) {
+       return [0, 100, gray[0]];
+};
+
+convert.gray.cmyk = function (gray) {
+       return [0, 0, 0, gray[0]];
+};
+
+convert.gray.lab = function (gray) {
+       return [gray[0], 0, 0];
+};
+
+convert.gray.hex = function (gray) {
+       var val = Math.round(gray[0] / 100 * 255) & 0xFF;
+       var integer = (val << 16) + (val << 8) + val;
+
+       var string = integer.toString(16).toUpperCase();
+       return '000000'.substring(string.length) + string;
+};
+
+convert.rgb.gray = function (rgb) {
+       var val = (rgb[0] + rgb[1] + rgb[2]) / 3;
+       return [val / 255 * 100];
+};
diff --git a/wrt/node_modules/color-convert/index.js b/wrt/node_modules/color-convert/index.js
new file mode 100644 (file)
index 0000000..e65b5d7
--- /dev/null
@@ -0,0 +1,78 @@
+var conversions = require('./conversions');
+var route = require('./route');
+
+var convert = {};
+
+var models = Object.keys(conversions);
+
+function wrapRaw(fn) {
+       var wrappedFn = function (args) {
+               if (args === undefined || args === null) {
+                       return args;
+               }
+
+               if (arguments.length > 1) {
+                       args = Array.prototype.slice.call(arguments);
+               }
+
+               return fn(args);
+       };
+
+       // preserve .conversion property if there is one
+       if ('conversion' in fn) {
+               wrappedFn.conversion = fn.conversion;
+       }
+
+       return wrappedFn;
+}
+
+function wrapRounded(fn) {
+       var wrappedFn = function (args) {
+               if (args === undefined || args === null) {
+                       return args;
+               }
+
+               if (arguments.length > 1) {
+                       args = Array.prototype.slice.call(arguments);
+               }
+
+               var result = fn(args);
+
+               // we're assuming the result is an array here.
+               // see notice in conversions.js; don't use box types
+               // in conversion functions.
+               if (typeof result === 'object') {
+                       for (var len = result.length, i = 0; i < len; i++) {
+                               result[i] = Math.round(result[i]);
+                       }
+               }
+
+               return result;
+       };
+
+       // preserve .conversion property if there is one
+       if ('conversion' in fn) {
+               wrappedFn.conversion = fn.conversion;
+       }
+
+       return wrappedFn;
+}
+
+models.forEach(function (fromModel) {
+       convert[fromModel] = {};
+
+       Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});
+       Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});
+
+       var routes = route(fromModel);
+       var routeModels = Object.keys(routes);
+
+       routeModels.forEach(function (toModel) {
+               var fn = routes[toModel];
+
+               convert[fromModel][toModel] = wrapRounded(fn);
+               convert[fromModel][toModel].raw = wrapRaw(fn);
+       });
+});
+
+module.exports = convert;
diff --git a/wrt/node_modules/color-convert/package.json b/wrt/node_modules/color-convert/package.json
new file mode 100644 (file)
index 0000000..15e1672
--- /dev/null
@@ -0,0 +1,124 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "color-convert@^1.9.0",
+        "scope": null,
+        "escapedName": "color-convert",
+        "name": "color-convert",
+        "rawSpec": "^1.9.0",
+        "spec": ">=1.9.0 <2.0.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/ansi-styles"
+    ]
+  ],
+  "_from": "color-convert@>=1.9.0 <2.0.0",
+  "_id": "color-convert@1.9.0",
+  "_inCache": true,
+  "_location": "/color-convert",
+  "_nodeVersion": "0.10.32",
+  "_npmOperationalInternal": {
+    "host": "packages-18-east.internal.npmjs.com",
+    "tmp": "tmp/color-convert-1.9.0.tgz_1484684133840_0.4650497359689325"
+  },
+  "_npmUser": {
+    "name": "qix",
+    "email": "i.am.qix@gmail.com"
+  },
+  "_npmVersion": "2.14.2",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "color-convert@^1.9.0",
+    "scope": null,
+    "escapedName": "color-convert",
+    "name": "color-convert",
+    "rawSpec": "^1.9.0",
+    "spec": ">=1.9.0 <2.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/ansi-styles"
+  ],
+  "_resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.0.tgz",
+  "_shasum": "1accf97dd739b983bf994d56fec8f95853641b7a",
+  "_shrinkwrap": null,
+  "_spec": "color-convert@^1.9.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/ansi-styles",
+  "author": {
+    "name": "Heather Arthur",
+    "email": "fayearthur@gmail.com"
+  },
+  "bugs": {
+    "url": "https://github.com/qix-/color-convert/issues"
+  },
+  "dependencies": {
+    "color-name": "^1.1.1"
+  },
+  "description": "Plain color conversion functions",
+  "devDependencies": {
+    "chalk": "^1.1.1",
+    "xo": "^0.11.2"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "1accf97dd739b983bf994d56fec8f95853641b7a",
+    "tarball": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.0.tgz"
+  },
+  "files": [
+    "index.js",
+    "conversions.js",
+    "css-keywords.js",
+    "route.js"
+  ],
+  "gitHead": "f8b2cf64544c551f22b74947d511f0e97c4e6ef1",
+  "homepage": "https://github.com/qix-/color-convert#readme",
+  "keywords": [
+    "color",
+    "colour",
+    "convert",
+    "converter",
+    "conversion",
+    "rgb",
+    "hsl",
+    "hsv",
+    "hwb",
+    "cmyk",
+    "ansi",
+    "ansi16"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "harth",
+      "email": "fayearthur@gmail.com"
+    },
+    {
+      "name": "moox",
+      "email": "m@moox.io"
+    },
+    {
+      "name": "qix",
+      "email": "i.am.qix@gmail.com"
+    }
+  ],
+  "name": "color-convert",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/qix-/color-convert.git"
+  },
+  "scripts": {
+    "pretest": "xo",
+    "test": "node test/basic.js"
+  },
+  "version": "1.9.0",
+  "xo": {
+    "rules": {
+      "default-case": 0,
+      "no-inline-comments": 0,
+      "operator-linebreak": 0
+    }
+  }
+}
diff --git a/wrt/node_modules/color-convert/route.js b/wrt/node_modules/color-convert/route.js
new file mode 100644 (file)
index 0000000..c365e1e
--- /dev/null
@@ -0,0 +1,98 @@
+var conversions = require('./conversions');
+
+/*
+       this function routes a model to all other models.
+
+       all functions that are routed have a property `.conversion` attached
+       to the returned synthetic function. This property is an array
+       of strings, each with the steps in between the 'from' and 'to'
+       color models (inclusive).
+
+       conversions that are not possible simply are not included.
+*/
+
+// https://jsperf.com/object-keys-vs-for-in-with-closure/3
+var models = Object.keys(conversions);
+
+function buildGraph() {
+       var graph = {};
+
+       for (var len = models.length, i = 0; i < len; i++) {
+               graph[models[i]] = {
+                       // http://jsperf.com/1-vs-infinity
+                       // micro-opt, but this is simple.
+                       distance: -1,
+                       parent: null
+               };
+       }
+
+       return graph;
+}
+
+// https://en.wikipedia.org/wiki/Breadth-first_search
+function deriveBFS(fromModel) {
+       var graph = buildGraph();
+       var queue = [fromModel]; // unshift -> queue -> pop
+
+       graph[fromModel].distance = 0;
+
+       while (queue.length) {
+               var current = queue.pop();
+               var adjacents = Object.keys(conversions[current]);
+
+               for (var len = adjacents.length, i = 0; i < len; i++) {
+                       var adjacent = adjacents[i];
+                       var node = graph[adjacent];
+
+                       if (node.distance === -1) {
+                               node.distance = graph[current].distance + 1;
+                               node.parent = current;
+                               queue.unshift(adjacent);
+                       }
+               }
+       }
+
+       return graph;
+}
+
+function link(from, to) {
+       return function (args) {
+               return to(from(args));
+       };
+}
+
+function wrapConversion(toModel, graph) {
+       var path = [graph[toModel].parent, toModel];
+       var fn = conversions[graph[toModel].parent][toModel];
+
+       var cur = graph[toModel].parent;
+       while (graph[cur].parent) {
+               path.unshift(graph[cur].parent);
+               fn = link(conversions[graph[cur].parent][cur], fn);
+               cur = graph[cur].parent;
+       }
+
+       fn.conversion = path;
+       return fn;
+}
+
+module.exports = function (fromModel) {
+       var graph = deriveBFS(fromModel);
+       var conversion = {};
+
+       var models = Object.keys(graph);
+       for (var len = models.length, i = 0; i < len; i++) {
+               var toModel = models[i];
+               var node = graph[toModel];
+
+               if (node.parent === null) {
+                       // no possible conversion, or this node is the source model.
+                       continue;
+               }
+
+               conversion[toModel] = wrapConversion(toModel, graph);
+       }
+
+       return conversion;
+};
+
diff --git a/wrt/node_modules/color-name/.eslintrc.json b/wrt/node_modules/color-name/.eslintrc.json
new file mode 100644 (file)
index 0000000..c50c250
--- /dev/null
@@ -0,0 +1,43 @@
+{
+    "env": {
+        "browser": true,
+        "node": true,
+        "commonjs": true,
+        "es6": true
+    },
+    "extends": "eslint:recommended",
+    "rules": {
+        "strict": 2,
+        "indent": 0,
+        "linebreak-style": 0,
+        "quotes": 0,
+        "semi": 0,
+        "no-cond-assign": 1,
+        "no-constant-condition": 1,
+        "no-duplicate-case": 1,
+        "no-empty": 1,
+        "no-ex-assign": 1,
+        "no-extra-boolean-cast": 1,
+        "no-extra-semi": 1,
+        "no-fallthrough": 1,
+        "no-func-assign": 1,
+        "no-global-assign": 1,
+        "no-implicit-globals": 2,
+        "no-inner-declarations": ["error", "functions"],
+        "no-irregular-whitespace": 2,
+        "no-loop-func": 1,
+        "no-multi-str": 1,
+        "no-mixed-spaces-and-tabs": 1,
+        "no-proto": 1,
+        "no-sequences": 1,
+        "no-throw-literal": 1,
+        "no-unmodified-loop-condition": 1,
+        "no-useless-call": 1,
+        "no-void": 1,
+        "no-with": 2,
+        "wrap-iife": 1,
+        "no-redeclare": 1,
+        "no-unused-vars": ["error", { "vars": "all", "args": "none" }],
+        "no-sparse-arrays": 1
+    }
+}
diff --git a/wrt/node_modules/color-name/.npmignore b/wrt/node_modules/color-name/.npmignore
new file mode 100644 (file)
index 0000000..f9f2816
--- /dev/null
@@ -0,0 +1,107 @@
+//this will affect all the git repos\r
+git config --global core.excludesfile ~/.gitignore\r
+\r
+\r
+//update files since .ignore won't if already tracked\r
+git rm --cached <file>\r
+\r
+# Compiled source #\r
+###################\r
+*.com\r
+*.class\r
+*.dll\r
+*.exe\r
+*.o\r
+*.so\r
+\r
+# Packages #\r
+############\r
+# it's better to unpack these files and commit the raw source\r
+# git has its own built in compression methods\r
+*.7z\r
+*.dmg\r
+*.gz\r
+*.iso\r
+*.jar\r
+*.rar\r
+*.tar\r
+*.zip\r
+\r
+# Logs and databases #\r
+######################\r
+*.log\r
+*.sql\r
+*.sqlite\r
+\r
+# OS generated files #\r
+######################\r
+.DS_Store\r
+.DS_Store?\r
+._*\r
+.Spotlight-V100\r
+.Trashes\r
+# Icon?\r
+ehthumbs.db\r
+Thumbs.db\r
+.cache\r
+.project\r
+.settings\r
+.tmproj\r
+*.esproj\r
+nbproject\r
+\r
+# Numerous always-ignore extensions #\r
+#####################################\r
+*.diff\r
+*.err\r
+*.orig\r
+*.rej\r
+*.swn\r
+*.swo\r
+*.swp\r
+*.vi\r
+*~\r
+*.sass-cache\r
+*.grunt\r
+*.tmp\r
+\r
+# Dreamweaver added files #\r
+###########################\r
+_notes\r
+dwsync.xml\r
+\r
+# Komodo #\r
+###########################\r
+*.komodoproject\r
+.komodotools\r
+\r
+# Node #\r
+#####################\r
+node_modules\r
+\r
+# Bower #\r
+#####################\r
+bower_components\r
+\r
+# Folders to ignore #\r
+#####################\r
+.hg\r
+.svn\r
+.CVS\r
+intermediate\r
+publish\r
+.idea\r
+.graphics\r
+_test\r
+_archive\r
+uploads\r
+tmp\r
+\r
+# Vim files to ignore #\r
+#######################\r
+.VimballRecord\r
+.netrwhist\r
+\r
+bundle.*\r
+\r
+_demo
\ No newline at end of file
diff --git a/wrt/node_modules/color-name/LICENSE b/wrt/node_modules/color-name/LICENSE
new file mode 100644 (file)
index 0000000..c6b1001
--- /dev/null
@@ -0,0 +1,8 @@
+The MIT License (MIT)\r
+Copyright (c) 2015 Dmitry Ivanov\r
+\r
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\r
+\r
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\r
+\r
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/wrt/node_modules/color-name/README.md b/wrt/node_modules/color-name/README.md
new file mode 100644 (file)
index 0000000..932b979
--- /dev/null
@@ -0,0 +1,11 @@
+A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors.\r
+\r
+[![NPM](https://nodei.co/npm/color-name.png?mini=true)](https://nodei.co/npm/color-name/)\r
+\r
+\r
+```js\r
+var colors = require('color-name');\r
+colors.red //[255,0,0]\r
+```\r
+\r
+<a href="LICENSE"><img src="https://upload.wikimedia.org/wikipedia/commons/0/0c/MIT_logo.svg" width="120"/></a>\r
diff --git a/wrt/node_modules/color-name/index.js b/wrt/node_modules/color-name/index.js
new file mode 100644 (file)
index 0000000..b7c198a
--- /dev/null
@@ -0,0 +1,152 @@
+'use strict'\r
+\r
+module.exports = {\r
+       "aliceblue": [240, 248, 255],\r
+       "antiquewhite": [250, 235, 215],\r
+       "aqua": [0, 255, 255],\r
+       "aquamarine": [127, 255, 212],\r
+       "azure": [240, 255, 255],\r
+       "beige": [245, 245, 220],\r
+       "bisque": [255, 228, 196],\r
+       "black": [0, 0, 0],\r
+       "blanchedalmond": [255, 235, 205],\r
+       "blue": [0, 0, 255],\r
+       "blueviolet": [138, 43, 226],\r
+       "brown": [165, 42, 42],\r
+       "burlywood": [222, 184, 135],\r
+       "cadetblue": [95, 158, 160],\r
+       "chartreuse": [127, 255, 0],\r
+       "chocolate": [210, 105, 30],\r
+       "coral": [255, 127, 80],\r
+       "cornflowerblue": [100, 149, 237],\r
+       "cornsilk": [255, 248, 220],\r
+       "crimson": [220, 20, 60],\r
+       "cyan": [0, 255, 255],\r
+       "darkblue": [0, 0, 139],\r
+       "darkcyan": [0, 139, 139],\r
+       "darkgoldenrod": [184, 134, 11],\r
+       "darkgray": [169, 169, 169],\r
+       "darkgreen": [0, 100, 0],\r
+       "darkgrey": [169, 169, 169],\r
+       "darkkhaki": [189, 183, 107],\r
+       "darkmagenta": [139, 0, 139],\r
+       "darkolivegreen": [85, 107, 47],\r
+       "darkorange": [255, 140, 0],\r
+       "darkorchid": [153, 50, 204],\r
+       "darkred": [139, 0, 0],\r
+       "darksalmon": [233, 150, 122],\r
+       "darkseagreen": [143, 188, 143],\r
+       "darkslateblue": [72, 61, 139],\r
+       "darkslategray": [47, 79, 79],\r
+       "darkslategrey": [47, 79, 79],\r
+       "darkturquoise": [0, 206, 209],\r
+       "darkviolet": [148, 0, 211],\r
+       "deeppink": [255, 20, 147],\r
+       "deepskyblue": [0, 191, 255],\r
+       "dimgray": [105, 105, 105],\r
+       "dimgrey": [105, 105, 105],\r
+       "dodgerblue": [30, 144, 255],\r
+       "firebrick": [178, 34, 34],\r
+       "floralwhite": [255, 250, 240],\r
+       "forestgreen": [34, 139, 34],\r
+       "fuchsia": [255, 0, 255],\r
+       "gainsboro": [220, 220, 220],\r
+       "ghostwhite": [248, 248, 255],\r
+       "gold": [255, 215, 0],\r
+       "goldenrod": [218, 165, 32],\r
+       "gray": [128, 128, 128],\r
+       "green": [0, 128, 0],\r
+       "greenyellow": [173, 255, 47],\r
+       "grey": [128, 128, 128],\r
+       "honeydew": [240, 255, 240],\r
+       "hotpink": [255, 105, 180],\r
+       "indianred": [205, 92, 92],\r
+       "indigo": [75, 0, 130],\r
+       "ivory": [255, 255, 240],\r
+       "khaki": [240, 230, 140],\r
+       "lavender": [230, 230, 250],\r
+       "lavenderblush": [255, 240, 245],\r
+       "lawngreen": [124, 252, 0],\r
+       "lemonchiffon": [255, 250, 205],\r
+       "lightblue": [173, 216, 230],\r
+       "lightcoral": [240, 128, 128],\r
+       "lightcyan": [224, 255, 255],\r
+       "lightgoldenrodyellow": [250, 250, 210],\r
+       "lightgray": [211, 211, 211],\r
+       "lightgreen": [144, 238, 144],\r
+       "lightgrey": [211, 211, 211],\r
+       "lightpink": [255, 182, 193],\r
+       "lightsalmon": [255, 160, 122],\r
+       "lightseagreen": [32, 178, 170],\r
+       "lightskyblue": [135, 206, 250],\r
+       "lightslategray": [119, 136, 153],\r
+       "lightslategrey": [119, 136, 153],\r
+       "lightsteelblue": [176, 196, 222],\r
+       "lightyellow": [255, 255, 224],\r
+       "lime": [0, 255, 0],\r
+       "limegreen": [50, 205, 50],\r
+       "linen": [250, 240, 230],\r
+       "magenta": [255, 0, 255],\r
+       "maroon": [128, 0, 0],\r
+       "mediumaquamarine": [102, 205, 170],\r
+       "mediumblue": [0, 0, 205],\r
+       "mediumorchid": [186, 85, 211],\r
+       "mediumpurple": [147, 112, 219],\r
+       "mediumseagreen": [60, 179, 113],\r
+       "mediumslateblue": [123, 104, 238],\r
+       "mediumspringgreen": [0, 250, 154],\r
+       "mediumturquoise": [72, 209, 204],\r
+       "mediumvioletred": [199, 21, 133],\r
+       "midnightblue": [25, 25, 112],\r
+       "mintcream": [245, 255, 250],\r
+       "mistyrose": [255, 228, 225],\r
+       "moccasin": [255, 228, 181],\r
+       "navajowhite": [255, 222, 173],\r
+       "navy": [0, 0, 128],\r
+       "oldlace": [253, 245, 230],\r
+       "olive": [128, 128, 0],\r
+       "olivedrab": [107, 142, 35],\r
+       "orange": [255, 165, 0],\r
+       "orangered": [255, 69, 0],\r
+       "orchid": [218, 112, 214],\r
+       "palegoldenrod": [238, 232, 170],\r
+       "palegreen": [152, 251, 152],\r
+       "paleturquoise": [175, 238, 238],\r
+       "palevioletred": [219, 112, 147],\r
+       "papayawhip": [255, 239, 213],\r
+       "peachpuff": [255, 218, 185],\r
+       "peru": [205, 133, 63],\r
+       "pink": [255, 192, 203],\r
+       "plum": [221, 160, 221],\r
+       "powderblue": [176, 224, 230],\r
+       "purple": [128, 0, 128],\r
+       "rebeccapurple": [102, 51, 153],\r
+       "red": [255, 0, 0],\r
+       "rosybrown": [188, 143, 143],\r
+       "royalblue": [65, 105, 225],\r
+       "saddlebrown": [139, 69, 19],\r
+       "salmon": [250, 128, 114],\r
+       "sandybrown": [244, 164, 96],\r
+       "seagreen": [46, 139, 87],\r
+       "seashell": [255, 245, 238],\r
+       "sienna": [160, 82, 45],\r
+       "silver": [192, 192, 192],\r
+       "skyblue": [135, 206, 235],\r
+       "slateblue": [106, 90, 205],\r
+       "slategray": [112, 128, 144],\r
+       "slategrey": [112, 128, 144],\r
+       "snow": [255, 250, 250],\r
+       "springgreen": [0, 255, 127],\r
+       "steelblue": [70, 130, 180],\r
+       "tan": [210, 180, 140],\r
+       "teal": [0, 128, 128],\r
+       "thistle": [216, 191, 216],\r
+       "tomato": [255, 99, 71],\r
+       "turquoise": [64, 224, 208],\r
+       "violet": [238, 130, 238],\r
+       "wheat": [245, 222, 179],\r
+       "white": [255, 255, 255],\r
+       "whitesmoke": [245, 245, 245],\r
+       "yellow": [255, 255, 0],\r
+       "yellowgreen": [154, 205, 50]\r
+};\r
diff --git a/wrt/node_modules/color-name/package.json b/wrt/node_modules/color-name/package.json
new file mode 100644 (file)
index 0000000..4e27a3a
--- /dev/null
@@ -0,0 +1,90 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "color-name@^1.1.1",
+        "scope": null,
+        "escapedName": "color-name",
+        "name": "color-name",
+        "rawSpec": "^1.1.1",
+        "spec": ">=1.1.1 <2.0.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/color-convert"
+    ]
+  ],
+  "_from": "color-name@>=1.1.1 <2.0.0",
+  "_id": "color-name@1.1.3",
+  "_inCache": true,
+  "_location": "/color-name",
+  "_nodeVersion": "8.1.2",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/color-name-1.1.3.tgz_1500157027207_0.5641644957941025"
+  },
+  "_npmUser": {
+    "name": "dfcreative",
+    "email": "df.creative@gmail.com"
+  },
+  "_npmVersion": "4.6.1",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "color-name@^1.1.1",
+    "scope": null,
+    "escapedName": "color-name",
+    "name": "color-name",
+    "rawSpec": "^1.1.1",
+    "spec": ">=1.1.1 <2.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/color-convert"
+  ],
+  "_resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
+  "_shasum": "a7d0558bd89c42f795dd42328f740831ca53bc25",
+  "_shrinkwrap": null,
+  "_spec": "color-name@^1.1.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/color-convert",
+  "author": {
+    "name": "DY",
+    "email": "dfcreative@gmail.com"
+  },
+  "bugs": {
+    "url": "https://github.com/dfcreative/color-name/issues"
+  },
+  "dependencies": {},
+  "description": "A list of color names and its values",
+  "devDependencies": {},
+  "directories": {},
+  "dist": {
+    "shasum": "a7d0558bd89c42f795dd42328f740831ca53bc25",
+    "tarball": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz"
+  },
+  "gitHead": "cb7d4629b00fe38564f741a0779f6ad84d8007a2",
+  "homepage": "https://github.com/dfcreative/color-name",
+  "keywords": [
+    "color-name",
+    "color",
+    "color-keyword",
+    "keyword"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "dfcreative",
+      "email": "df.creative@gmail.com"
+    }
+  ],
+  "name": "color-name",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+ssh://git@github.com/dfcreative/color-name.git"
+  },
+  "scripts": {
+    "test": "node test.js"
+  },
+  "version": "1.1.3"
+}
diff --git a/wrt/node_modules/color-name/test.js b/wrt/node_modules/color-name/test.js
new file mode 100644 (file)
index 0000000..6e6bf30
--- /dev/null
@@ -0,0 +1,7 @@
+'use strict'\r
+\r
+var names = require('./');\r
+var assert = require('assert');\r
+\r
+assert.deepEqual(names.red, [255,0,0]);\r
+assert.deepEqual(names.aliceblue, [240,248,255]);\r
diff --git a/wrt/node_modules/component-bind/.npmignore b/wrt/node_modules/component-bind/.npmignore
new file mode 100644 (file)
index 0000000..f1250e5
--- /dev/null
@@ -0,0 +1,4 @@
+support
+test
+examples
+*.sock
diff --git a/wrt/node_modules/component-bind/History.md b/wrt/node_modules/component-bind/History.md
new file mode 100644 (file)
index 0000000..2795fdb
--- /dev/null
@@ -0,0 +1,13 @@
+
+1.0.0 / 2014-05-27
+==================
+
+  * index: use slice ref (#7, @viatropos)
+  * package: rename package to "component-bind"
+  * package: add "repository" field (#6, @repoify)
+  * package: add "component" section
+
+0.0.1 / 2010-01-03
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/component-bind/Makefile b/wrt/node_modules/component-bind/Makefile
new file mode 100644 (file)
index 0000000..4e9c8d3
--- /dev/null
@@ -0,0 +1,7 @@
+
+test:
+       @./node_modules/.bin/mocha \
+               --require should \
+               --reporter spec
+
+.PHONY: test
\ No newline at end of file
diff --git a/wrt/node_modules/component-bind/Readme.md b/wrt/node_modules/component-bind/Readme.md
new file mode 100644 (file)
index 0000000..6a8febc
--- /dev/null
@@ -0,0 +1,64 @@
+# bind
+
+  Function binding utility.
+
+## Installation
+
+```
+$ component install component/bind
+```
+
+## API
+
+   - [bind(obj, fn)](#bindobj-fn)
+   - [bind(obj, fn, ...)](#bindobj-fn-)
+   - [bind(obj, name)](#bindobj-name)
+<a name=""></a>
+<a name="bindobj-fn"></a>
+### bind(obj, fn)
+should bind the function to the given object.
+
+```js
+var tobi = { name: 'tobi' };
+
+function name() {
+  return this.name;
+}
+
+var fn = bind(tobi, name);
+fn().should.equal('tobi');
+```
+
+<a name="bindobj-fn-"></a>
+### bind(obj, fn, ...)
+should curry the remaining arguments.
+
+```js
+function add(a, b) {
+  return a + b;
+}
+
+bind(null, add)(1, 2).should.equal(3);
+bind(null, add, 1)(2).should.equal(3);
+bind(null, add, 1, 2)().should.equal(3);
+```
+
+<a name="bindobj-name"></a>
+### bind(obj, name)
+should bind the method of the given name.
+
+```js
+var tobi = { name: 'tobi' };
+
+tobi.getName = function() {
+  return this.name;
+};
+
+var fn = bind(tobi, 'getName');
+fn().should.equal('tobi');
+```
+
+## License 
+
+  MIT
\ No newline at end of file
diff --git a/wrt/node_modules/component-bind/component.json b/wrt/node_modules/component-bind/component.json
new file mode 100644 (file)
index 0000000..4e1e93f
--- /dev/null
@@ -0,0 +1,13 @@
+{
+  "name": "bind",
+  "version": "1.0.0",
+  "description": "function binding utility",
+  "keywords": [
+    "bind",
+    "utility"
+  ],
+  "dependencies": {},
+  "scripts": [
+    "index.js"
+  ]
+}
diff --git a/wrt/node_modules/component-bind/index.js b/wrt/node_modules/component-bind/index.js
new file mode 100644 (file)
index 0000000..4eeb2c0
--- /dev/null
@@ -0,0 +1,23 @@
+/**
+ * Slice reference.
+ */
+
+var slice = [].slice;
+
+/**
+ * Bind `obj` to `fn`.
+ *
+ * @param {Object} obj
+ * @param {Function|String} fn or string
+ * @return {Function}
+ * @api public
+ */
+
+module.exports = function(obj, fn){
+  if ('string' == typeof fn) fn = obj[fn];
+  if ('function' != typeof fn) throw new Error('bind() requires a function');
+  var args = slice.call(arguments, 2);
+  return function(){
+    return fn.apply(obj, args.concat(slice.call(arguments)));
+  }
+};
diff --git a/wrt/node_modules/component-bind/package.json b/wrt/node_modules/component-bind/package.json
new file mode 100644 (file)
index 0000000..48c1d1f
--- /dev/null
@@ -0,0 +1,81 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "component-bind@1.0.0",
+        "scope": null,
+        "escapedName": "component-bind",
+        "name": "component-bind",
+        "rawSpec": "1.0.0",
+        "spec": "1.0.0",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io-client"
+    ]
+  ],
+  "_from": "component-bind@1.0.0",
+  "_id": "component-bind@1.0.0",
+  "_inCache": true,
+  "_location": "/component-bind",
+  "_npmUser": {
+    "name": "tootallnate",
+    "email": "nathan@tootallnate.net"
+  },
+  "_npmVersion": "1.4.9",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "component-bind@1.0.0",
+    "scope": null,
+    "escapedName": "component-bind",
+    "name": "component-bind",
+    "rawSpec": "1.0.0",
+    "spec": "1.0.0",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/socket.io-client"
+  ],
+  "_resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz",
+  "_shasum": "00c608ab7dcd93897c0009651b1d3a8e1e73bbd1",
+  "_shrinkwrap": null,
+  "_spec": "component-bind@1.0.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io-client",
+  "bugs": {
+    "url": "https://github.com/component/bind/issues"
+  },
+  "component": {
+    "scripts": {
+      "bind/index.js": "index.js"
+    }
+  },
+  "dependencies": {},
+  "description": "function binding utility",
+  "devDependencies": {
+    "mocha": "*",
+    "should": "*"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "00c608ab7dcd93897c0009651b1d3a8e1e73bbd1",
+    "tarball": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz"
+  },
+  "homepage": "https://github.com/component/bind",
+  "keywords": [
+    "bind",
+    "utility"
+  ],
+  "maintainers": [
+    {
+      "name": "tootallnate",
+      "email": "nathan@tootallnate.net"
+    }
+  ],
+  "name": "component-bind",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/component/bind.git"
+  },
+  "version": "1.0.0"
+}
diff --git a/wrt/node_modules/component-emitter/History.md b/wrt/node_modules/component-emitter/History.md
new file mode 100644 (file)
index 0000000..9189c60
--- /dev/null
@@ -0,0 +1,68 @@
+\r
+1.2.1 / 2016-04-18\r
+==================\r
+\r
+ * enable client side use\r
+\r
+1.2.0 / 2014-02-12\r
+==================\r
+\r
+ * prefix events with `$` to support object prototype method names\r
+\r
+1.1.3 / 2014-06-20\r
+==================\r
+\r
+ * republish for npm\r
+ * add LICENSE file\r
+\r
+1.1.2 / 2014-02-10\r
+==================\r
+\r
+  * package: rename to "component-emitter"\r
+  * package: update "main" and "component" fields\r
+  * Add license to Readme (same format as the other components)\r
+  * created .npmignore\r
+  * travis stuff\r
+\r
+1.1.1 / 2013-12-01\r
+==================\r
+\r
+  * fix .once adding .on to the listener\r
+  * docs: Emitter#off()\r
+  * component: add `.repo` prop\r
+\r
+1.1.0 / 2013-10-20\r
+==================\r
+\r
+ * add `.addEventListener()` and `.removeEventListener()` aliases\r
+\r
+1.0.1 / 2013-06-27\r
+==================\r
+\r
+ * add support for legacy ie\r
+\r
+1.0.0 / 2013-02-26\r
+==================\r
+\r
+  * add `.off()` support for removing all listeners\r
+\r
+0.0.6 / 2012-10-08\r
+==================\r
+\r
+  * add `this._callbacks` initialization to prevent funky gotcha\r
+\r
+0.0.5 / 2012-09-07\r
+==================\r
+\r
+  * fix `Emitter.call(this)` usage\r
+\r
+0.0.3 / 2012-07-11\r
+==================\r
+\r
+  * add `.listeners()`\r
+  * rename `.has()` to `.hasListeners()`\r
+\r
+0.0.2 / 2012-06-28\r
+==================\r
+\r
+  * fix `.off()` with `.once()`-registered callbacks\r
diff --git a/wrt/node_modules/component-emitter/LICENSE b/wrt/node_modules/component-emitter/LICENSE
new file mode 100644 (file)
index 0000000..d6e43f2
--- /dev/null
@@ -0,0 +1,24 @@
+(The MIT License)\r
+\r
+Copyright (c) 2014 Component contributors <dev@component.io>\r
+\r
+Permission is hereby granted, free of charge, to any person\r
+obtaining a copy of this software and associated documentation\r
+files (the "Software"), to deal in the Software without\r
+restriction, including without limitation the rights to use,\r
+copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+copies of the Software, and to permit persons to whom the\r
+Software is furnished to do so, subject to the following\r
+conditions:\r
+\r
+The above copyright notice and this permission notice shall be\r
+included in all copies or substantial portions of the Software.\r
+\r
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\r
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\r
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\r
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\r
+OTHER DEALINGS IN THE SOFTWARE.\r
diff --git a/wrt/node_modules/component-emitter/Readme.md b/wrt/node_modules/component-emitter/Readme.md
new file mode 100644 (file)
index 0000000..0466411
--- /dev/null
@@ -0,0 +1,74 @@
+# Emitter [![Build Status](https://travis-ci.org/component/emitter.png)](https://travis-ci.org/component/emitter)\r
+\r
+  Event emitter component.\r
+\r
+## Installation\r
+\r
+```\r
+$ component install component/emitter\r
+```\r
+\r
+## API\r
+\r
+### Emitter(obj)\r
+\r
+  The `Emitter` may also be used as a mixin. For example\r
+  a "plain" object may become an emitter, or you may\r
+  extend an existing prototype.\r
+\r
+  As an `Emitter` instance:\r
+\r
+```js\r
+var Emitter = require('emitter');\r
+var emitter = new Emitter;\r
+emitter.emit('something');\r
+```\r
+\r
+  As a mixin:\r
+\r
+```js\r
+var Emitter = require('emitter');\r
+var user = { name: 'tobi' };\r
+Emitter(user);\r
+\r
+user.emit('im a user');\r
+```\r
+\r
+  As a prototype mixin:\r
+\r
+```js\r
+var Emitter = require('emitter');\r
+Emitter(User.prototype);\r
+```\r
+\r
+### Emitter#on(event, fn)\r
+\r
+  Register an `event` handler `fn`.\r
+\r
+### Emitter#once(event, fn)\r
+\r
+  Register a single-shot `event` handler `fn`,\r
+  removed immediately after it is invoked the\r
+  first time.\r
+\r
+### Emitter#off(event, fn)\r
+\r
+  * Pass `event` and `fn` to remove a listener.\r
+  * Pass `event` to remove all listeners on that event.\r
+  * Pass nothing to remove all listeners on all events.\r
+\r
+### Emitter#emit(event, ...)\r
+\r
+  Emit an `event` with variable option args.\r
+\r
+### Emitter#listeners(event)\r
+\r
+  Return an array of callbacks, or an empty array.\r
+\r
+### Emitter#hasListeners(event)\r
+\r
+  Check if this emitter has `event` handlers.\r
+\r
+## License\r
+\r
+MIT\r
diff --git a/wrt/node_modules/component-emitter/index.js b/wrt/node_modules/component-emitter/index.js
new file mode 100644 (file)
index 0000000..df94c78
--- /dev/null
@@ -0,0 +1,163 @@
+\r
+/**\r
+ * Expose `Emitter`.\r
+ */\r
+\r
+if (typeof module !== 'undefined') {\r
+  module.exports = Emitter;\r
+}\r
+\r
+/**\r
+ * Initialize a new `Emitter`.\r
+ *\r
+ * @api public\r
+ */\r
+\r
+function Emitter(obj) {\r
+  if (obj) return mixin(obj);\r
+};\r
+\r
+/**\r
+ * Mixin the emitter properties.\r
+ *\r
+ * @param {Object} obj\r
+ * @return {Object}\r
+ * @api private\r
+ */\r
+\r
+function mixin(obj) {\r
+  for (var key in Emitter.prototype) {\r
+    obj[key] = Emitter.prototype[key];\r
+  }\r
+  return obj;\r
+}\r
+\r
+/**\r
+ * Listen on the given `event` with `fn`.\r
+ *\r
+ * @param {String} event\r
+ * @param {Function} fn\r
+ * @return {Emitter}\r
+ * @api public\r
+ */\r
+\r
+Emitter.prototype.on =\r
+Emitter.prototype.addEventListener = function(event, fn){\r
+  this._callbacks = this._callbacks || {};\r
+  (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\r
+    .push(fn);\r
+  return this;\r
+};\r
+\r
+/**\r
+ * Adds an `event` listener that will be invoked a single\r
+ * time then automatically removed.\r
+ *\r
+ * @param {String} event\r
+ * @param {Function} fn\r
+ * @return {Emitter}\r
+ * @api public\r
+ */\r
+\r
+Emitter.prototype.once = function(event, fn){\r
+  function on() {\r
+    this.off(event, on);\r
+    fn.apply(this, arguments);\r
+  }\r
+\r
+  on.fn = fn;\r
+  this.on(event, on);\r
+  return this;\r
+};\r
+\r
+/**\r
+ * Remove the given callback for `event` or all\r
+ * registered callbacks.\r
+ *\r
+ * @param {String} event\r
+ * @param {Function} fn\r
+ * @return {Emitter}\r
+ * @api public\r
+ */\r
+\r
+Emitter.prototype.off =\r
+Emitter.prototype.removeListener =\r
+Emitter.prototype.removeAllListeners =\r
+Emitter.prototype.removeEventListener = function(event, fn){\r
+  this._callbacks = this._callbacks || {};\r
+\r
+  // all\r
+  if (0 == arguments.length) {\r
+    this._callbacks = {};\r
+    return this;\r
+  }\r
+\r
+  // specific event\r
+  var callbacks = this._callbacks['$' + event];\r
+  if (!callbacks) return this;\r
+\r
+  // remove all handlers\r
+  if (1 == arguments.length) {\r
+    delete this._callbacks['$' + event];\r
+    return this;\r
+  }\r
+\r
+  // remove specific handler\r
+  var cb;\r
+  for (var i = 0; i < callbacks.length; i++) {\r
+    cb = callbacks[i];\r
+    if (cb === fn || cb.fn === fn) {\r
+      callbacks.splice(i, 1);\r
+      break;\r
+    }\r
+  }\r
+  return this;\r
+};\r
+\r
+/**\r
+ * Emit `event` with the given args.\r
+ *\r
+ * @param {String} event\r
+ * @param {Mixed} ...\r
+ * @return {Emitter}\r
+ */\r
+\r
+Emitter.prototype.emit = function(event){\r
+  this._callbacks = this._callbacks || {};\r
+  var args = [].slice.call(arguments, 1)\r
+    , callbacks = this._callbacks['$' + event];\r
+\r
+  if (callbacks) {\r
+    callbacks = callbacks.slice(0);\r
+    for (var i = 0, len = callbacks.length; i < len; ++i) {\r
+      callbacks[i].apply(this, args);\r
+    }\r
+  }\r
+\r
+  return this;\r
+};\r
+\r
+/**\r
+ * Return array of callbacks for `event`.\r
+ *\r
+ * @param {String} event\r
+ * @return {Array}\r
+ * @api public\r
+ */\r
+\r
+Emitter.prototype.listeners = function(event){\r
+  this._callbacks = this._callbacks || {};\r
+  return this._callbacks['$' + event] || [];\r
+};\r
+\r
+/**\r
+ * Check if this emitter has `event` handlers.\r
+ *\r
+ * @param {String} event\r
+ * @return {Boolean}\r
+ * @api public\r
+ */\r
+\r
+Emitter.prototype.hasListeners = function(event){\r
+  return !! this.listeners(event).length;\r
+};\r
diff --git a/wrt/node_modules/component-emitter/package.json b/wrt/node_modules/component-emitter/package.json
new file mode 100644 (file)
index 0000000..48a07bc
--- /dev/null
@@ -0,0 +1,218 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "component-emitter@1.2.1",
+        "scope": null,
+        "escapedName": "component-emitter",
+        "name": "component-emitter",
+        "rawSpec": "1.2.1",
+        "spec": "1.2.1",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io-client"
+    ]
+  ],
+  "_from": "component-emitter@1.2.1",
+  "_id": "component-emitter@1.2.1",
+  "_inCache": true,
+  "_location": "/component-emitter",
+  "_nodeVersion": "0.12.4",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/component-emitter-1.2.1.tgz_1461005707641_0.14232611074112356"
+  },
+  "_npmUser": {
+    "name": "nami-doc",
+    "email": "karp@hotmail.fr"
+  },
+  "_npmVersion": "2.10.1",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "component-emitter@1.2.1",
+    "scope": null,
+    "escapedName": "component-emitter",
+    "name": "component-emitter",
+    "rawSpec": "1.2.1",
+    "spec": "1.2.1",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/engine.io-client",
+    "/socket.io-client",
+    "/socket.io-parser"
+  ],
+  "_resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz",
+  "_shasum": "137918d6d78283f7df7a6b7c5a63e140e69425e6",
+  "_shrinkwrap": null,
+  "_spec": "component-emitter@1.2.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io-client",
+  "bugs": {
+    "url": "https://github.com/component/emitter/issues"
+  },
+  "component": {
+    "scripts": {
+      "emitter/index.js": "index.js"
+    }
+  },
+  "dependencies": {},
+  "description": "Event emitter",
+  "devDependencies": {
+    "mocha": "*",
+    "should": "*"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "137918d6d78283f7df7a6b7c5a63e140e69425e6",
+    "tarball": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz"
+  },
+  "files": [
+    "index.js",
+    "LICENSE"
+  ],
+  "gitHead": "187492ab8028c7221b589bdfd482b715149cd868",
+  "homepage": "https://github.com/component/emitter#readme",
+  "license": "MIT",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "tootallnate",
+      "email": "nathan@tootallnate.net"
+    },
+    {
+      "name": "hughsk",
+      "email": "hughskennedy@gmail.com"
+    },
+    {
+      "name": "trevorgerhardt",
+      "email": "trevorgerhardt@gmail.com"
+    },
+    {
+      "name": "timaschew",
+      "email": "timaschew@gmail.com"
+    },
+    {
+      "name": "tjholowaychuk",
+      "email": "tj@vision-media.ca"
+    },
+    {
+      "name": "rauchg",
+      "email": "rauchg@gmail.com"
+    },
+    {
+      "name": "retrofox",
+      "email": "rdsuarez@gmail.com"
+    },
+    {
+      "name": "coreh",
+      "email": "thecoreh@gmail.com"
+    },
+    {
+      "name": "forbeslindesay",
+      "email": "forbes@lindesay.co.uk"
+    },
+    {
+      "name": "kelonye",
+      "email": "kelonyemitchel@gmail.com"
+    },
+    {
+      "name": "mattmueller",
+      "email": "mattmuelle@gmail.com"
+    },
+    {
+      "name": "yields",
+      "email": "yields@icloud.com"
+    },
+    {
+      "name": "anthonyshort",
+      "email": "antshort@gmail.com"
+    },
+    {
+      "name": "jongleberry",
+      "email": "jonathanrichardong@gmail.com"
+    },
+    {
+      "name": "ianstormtaylor",
+      "email": "ian@ianstormtaylor.com"
+    },
+    {
+      "name": "cristiandouce",
+      "email": "cristian@gravityonmars.com"
+    },
+    {
+      "name": "swatinem",
+      "email": "arpad.borsos@googlemail.com"
+    },
+    {
+      "name": "stagas",
+      "email": "gstagas@gmail.com"
+    },
+    {
+      "name": "amasad",
+      "email": "amjad.masad@gmail.com"
+    },
+    {
+      "name": "juliangruber",
+      "email": "julian@juliangruber.com"
+    },
+    {
+      "name": "calvinfo",
+      "email": "calvin@calv.info"
+    },
+    {
+      "name": "dominicbarnes",
+      "email": "dominic@dbarnes.info"
+    },
+    {
+      "name": "blakeembrey",
+      "email": "hello@blakeembrey.com"
+    },
+    {
+      "name": "timoxley",
+      "email": "secoif@gmail.com"
+    },
+    {
+      "name": "jonathanong",
+      "email": "jonathanrichardong@gmail.com"
+    },
+    {
+      "name": "queckezz",
+      "email": "fabian.eichenberger@gmail.com"
+    },
+    {
+      "name": "nami-doc",
+      "email": "vendethiel@hotmail.fr"
+    },
+    {
+      "name": "clintwood",
+      "email": "clint@anotherway.co.za"
+    },
+    {
+      "name": "thehydroimpulse",
+      "email": "dnfagnan@gmail.com"
+    },
+    {
+      "name": "stephenmathieson",
+      "email": "me@stephenmathieson.com"
+    },
+    {
+      "name": "dfcreative",
+      "email": "df.creative@gmail.com"
+    },
+    {
+      "name": "defunctzombie",
+      "email": "shtylman@gmail.com"
+    }
+  ],
+  "name": "component-emitter",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/component/emitter.git"
+  },
+  "scripts": {
+    "test": "make test"
+  },
+  "version": "1.2.1"
+}
diff --git a/wrt/node_modules/component-inherit/.npmignore b/wrt/node_modules/component-inherit/.npmignore
new file mode 100644 (file)
index 0000000..665aa21
--- /dev/null
@@ -0,0 +1,3 @@
+components
+build
+node_modules
diff --git a/wrt/node_modules/component-inherit/History.md b/wrt/node_modules/component-inherit/History.md
new file mode 100644 (file)
index 0000000..22d87e1
--- /dev/null
@@ -0,0 +1,5 @@
+
+0.0.2 / 2012-09-03 
+==================
+
+  * fix typo in package.json
diff --git a/wrt/node_modules/component-inherit/Makefile b/wrt/node_modules/component-inherit/Makefile
new file mode 100644 (file)
index 0000000..ebbc52a
--- /dev/null
@@ -0,0 +1,16 @@
+
+build: components index.js
+       @component build
+
+components:
+       @Component install
+
+clean:
+       rm -fr build components template.js
+
+test:
+       @node_modules/.bin/mocha \
+               --require should \
+               --reporter spec
+
+.PHONY: clean test
diff --git a/wrt/node_modules/component-inherit/Readme.md b/wrt/node_modules/component-inherit/Readme.md
new file mode 100644 (file)
index 0000000..f03ab27
--- /dev/null
@@ -0,0 +1,24 @@
+# inherit
+
+  Prototype inheritance utility.
+
+## Installation
+
+```
+$ component install component/inherit
+```
+
+## Example
+
+```js
+var inherit = require('inherit');
+
+function Human() {}
+function Woman() {}
+
+inherit(Woman, Human);
+```
+
+## License
+
+  MIT
diff --git a/wrt/node_modules/component-inherit/component.json b/wrt/node_modules/component-inherit/component.json
new file mode 100644 (file)
index 0000000..ae57747
--- /dev/null
@@ -0,0 +1,10 @@
+{
+  "name": "inherit",
+  "description": "Prototype inheritance utility",
+  "version": "0.0.3",
+  "keywords": ["inherit", "utility"],
+  "dependencies": {},
+  "scripts": [
+    "index.js"
+  ]
+}
diff --git a/wrt/node_modules/component-inherit/index.js b/wrt/node_modules/component-inherit/index.js
new file mode 100644 (file)
index 0000000..aaebc03
--- /dev/null
@@ -0,0 +1,7 @@
+
+module.exports = function(a, b){
+  var fn = function(){};
+  fn.prototype = b.prototype;
+  a.prototype = new fn;
+  a.prototype.constructor = a;
+};
\ No newline at end of file
diff --git a/wrt/node_modules/component-inherit/package.json b/wrt/node_modules/component-inherit/package.json
new file mode 100644 (file)
index 0000000..f1001ed
--- /dev/null
@@ -0,0 +1,78 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "component-inherit@0.0.3",
+        "scope": null,
+        "escapedName": "component-inherit",
+        "name": "component-inherit",
+        "rawSpec": "0.0.3",
+        "spec": "0.0.3",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io-client"
+    ]
+  ],
+  "_from": "component-inherit@0.0.3",
+  "_id": "component-inherit@0.0.3",
+  "_inCache": true,
+  "_location": "/component-inherit",
+  "_npmUser": {
+    "name": "coreh",
+    "email": "thecoreh@gmail.com"
+  },
+  "_npmVersion": "1.3.24",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "component-inherit@0.0.3",
+    "scope": null,
+    "escapedName": "component-inherit",
+    "name": "component-inherit",
+    "rawSpec": "0.0.3",
+    "spec": "0.0.3",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/engine.io-client"
+  ],
+  "_resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz",
+  "_shasum": "645fc4adf58b72b649d5cae65135619db26ff143",
+  "_shrinkwrap": null,
+  "_spec": "component-inherit@0.0.3",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io-client",
+  "bugs": {
+    "url": "https://github.com/component/inherit/issues"
+  },
+  "component": {
+    "scripts": {
+      "inherit/index.js": "index.js"
+    }
+  },
+  "dependencies": {},
+  "description": "Prototype inheritance utility",
+  "devDependencies": {},
+  "directories": {},
+  "dist": {
+    "shasum": "645fc4adf58b72b649d5cae65135619db26ff143",
+    "tarball": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz"
+  },
+  "homepage": "https://github.com/component/inherit",
+  "keywords": [
+    "inherit",
+    "utility"
+  ],
+  "maintainers": [
+    {
+      "name": "coreh",
+      "email": "thecoreh@gmail.com"
+    }
+  ],
+  "name": "component-inherit",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/component/inherit.git"
+  },
+  "version": "0.0.3"
+}
diff --git a/wrt/node_modules/component-inherit/test/inherit.js b/wrt/node_modules/component-inherit/test/inherit.js
new file mode 100644 (file)
index 0000000..14852f2
--- /dev/null
@@ -0,0 +1,21 @@
+
+/**
+ * Module dependencies.
+ */
+
+var inherit = require('..');
+
+describe('inherit(a, b)', function(){
+  it('should inherit b\'s prototype', function(){
+    function Loki(){}
+    function Animal(){}
+
+    Animal.prototype.species = 'unknown';
+
+    inherit(Loki, Animal);
+
+    var loki = new Loki;
+    loki.species.should.equal('unknown');
+    loki.constructor.should.equal(Loki);
+  })
+})
\ No newline at end of file
diff --git a/wrt/node_modules/concat-map/.travis.yml b/wrt/node_modules/concat-map/.travis.yml
new file mode 100644 (file)
index 0000000..f1d0f13
--- /dev/null
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+  - 0.4
+  - 0.6
diff --git a/wrt/node_modules/concat-map/LICENSE b/wrt/node_modules/concat-map/LICENSE
new file mode 100644 (file)
index 0000000..ee27ba4
--- /dev/null
@@ -0,0 +1,18 @@
+This software is released under the MIT license:
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/concat-map/README.markdown b/wrt/node_modules/concat-map/README.markdown
new file mode 100644 (file)
index 0000000..408f70a
--- /dev/null
@@ -0,0 +1,62 @@
+concat-map
+==========
+
+Concatenative mapdashery.
+
+[![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map)
+
+[![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map)
+
+example
+=======
+
+``` js
+var concatMap = require('concat-map');
+var xs = [ 1, 2, 3, 4, 5, 6 ];
+var ys = concatMap(xs, function (x) {
+    return x % 2 ? [ x - 0.1, x, x + 0.1 ] : [];
+});
+console.dir(ys);
+```
+
+***
+
+```
+[ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]
+```
+
+methods
+=======
+
+``` js
+var concatMap = require('concat-map')
+```
+
+concatMap(xs, fn)
+-----------------
+
+Return an array of concatenated elements by calling `fn(x, i)` for each element
+`x` and each index `i` in the array `xs`.
+
+When `fn(x, i)` returns an array, its result will be concatenated with the
+result array. If `fn(x, i)` returns anything else, that value will be pushed
+onto the end of the result array.
+
+install
+=======
+
+With [npm](http://npmjs.org) do:
+
+```
+npm install concat-map
+```
+
+license
+=======
+
+MIT
+
+notes
+=====
+
+This module was written while sitting high above the ground in a tree.
diff --git a/wrt/node_modules/concat-map/example/map.js b/wrt/node_modules/concat-map/example/map.js
new file mode 100644 (file)
index 0000000..3365621
--- /dev/null
@@ -0,0 +1,6 @@
+var concatMap = require('../');
+var xs = [ 1, 2, 3, 4, 5, 6 ];
+var ys = concatMap(xs, function (x) {
+    return x % 2 ? [ x - 0.1, x, x + 0.1 ] : [];
+});
+console.dir(ys);
diff --git a/wrt/node_modules/concat-map/index.js b/wrt/node_modules/concat-map/index.js
new file mode 100644 (file)
index 0000000..b29a781
--- /dev/null
@@ -0,0 +1,13 @@
+module.exports = function (xs, fn) {
+    var res = [];
+    for (var i = 0; i < xs.length; i++) {
+        var x = fn(xs[i], i);
+        if (isArray(x)) res.push.apply(res, x);
+        else res.push(x);
+    }
+    return res;
+};
+
+var isArray = Array.isArray || function (xs) {
+    return Object.prototype.toString.call(xs) === '[object Array]';
+};
diff --git a/wrt/node_modules/concat-map/package.json b/wrt/node_modules/concat-map/package.json
new file mode 100644 (file)
index 0000000..321ebef
--- /dev/null
@@ -0,0 +1,88 @@
+{
+  "_from": "concat-map@0.0.1",
+  "_id": "concat-map@0.0.1",
+  "_inBundle": false,
+  "_integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
+  "_location": "/concat-map",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "concat-map@0.0.1",
+    "name": "concat-map",
+    "escapedName": "concat-map",
+    "rawSpec": "0.0.1",
+    "saveSpec": null,
+    "fetchSpec": "0.0.1"
+  },
+  "_requiredBy": [
+    "/brace-expansion"
+  ],
+  "_resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
+  "_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b",
+  "_spec": "concat-map@0.0.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was/node_modules/brace-expansion",
+  "author": {
+    "name": "James Halliday",
+    "email": "mail@substack.net",
+    "url": "http://substack.net"
+  },
+  "bugs": {
+    "url": "https://github.com/substack/node-concat-map/issues"
+  },
+  "bundleDependencies": false,
+  "deprecated": false,
+  "description": "concatenative mapdashery",
+  "devDependencies": {
+    "tape": "~2.4.0"
+  },
+  "directories": {
+    "example": "example",
+    "test": "test"
+  },
+  "homepage": "https://github.com/substack/node-concat-map#readme",
+  "keywords": [
+    "concat",
+    "concatMap",
+    "map",
+    "functional",
+    "higher-order"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "name": "concat-map",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/substack/node-concat-map.git"
+  },
+  "scripts": {
+    "test": "tape test/*.js"
+  },
+  "testling": {
+    "files": "test/*.js",
+    "browsers": {
+      "ie": [
+        6,
+        7,
+        8,
+        9
+      ],
+      "ff": [
+        3.5,
+        10,
+        15
+      ],
+      "chrome": [
+        10,
+        22
+      ],
+      "safari": [
+        5.1
+      ],
+      "opera": [
+        12
+      ]
+    }
+  },
+  "version": "0.0.1"
+}
diff --git a/wrt/node_modules/concat-map/test/map.js b/wrt/node_modules/concat-map/test/map.js
new file mode 100644 (file)
index 0000000..fdbd702
--- /dev/null
@@ -0,0 +1,39 @@
+var concatMap = require('../');
+var test = require('tape');
+
+test('empty or not', function (t) {
+    var xs = [ 1, 2, 3, 4, 5, 6 ];
+    var ixes = [];
+    var ys = concatMap(xs, function (x, ix) {
+        ixes.push(ix);
+        return x % 2 ? [ x - 0.1, x, x + 0.1 ] : [];
+    });
+    t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]);
+    t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]);
+    t.end();
+});
+
+test('always something', function (t) {
+    var xs = [ 'a', 'b', 'c', 'd' ];
+    var ys = concatMap(xs, function (x) {
+        return x === 'b' ? [ 'B', 'B', 'B' ] : [ x ];
+    });
+    t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]);
+    t.end();
+});
+
+test('scalars', function (t) {
+    var xs = [ 'a', 'b', 'c', 'd' ];
+    var ys = concatMap(xs, function (x) {
+        return x === 'b' ? [ 'B', 'B', 'B' ] : x;
+    });
+    t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]);
+    t.end();
+});
+
+test('undefs', function (t) {
+    var xs = [ 'a', 'b', 'c', 'd' ];
+    var ys = concatMap(xs, function () {});
+    t.same(ys, [ undefined, undefined, undefined, undefined ]);
+    t.end();
+});
diff --git a/wrt/node_modules/content-disposition/HISTORY.md b/wrt/node_modules/content-disposition/HISTORY.md
new file mode 100644 (file)
index 0000000..53849b6
--- /dev/null
@@ -0,0 +1,50 @@
+0.5.2 / 2016-12-08
+==================
+
+  * Fix `parse` to accept any linear whitespace character
+
+0.5.1 / 2016-01-17
+==================
+
+  * perf: enable strict mode
+
+0.5.0 / 2014-10-11
+==================
+
+  * Add `parse` function
+
+0.4.0 / 2014-09-21
+==================
+
+  * Expand non-Unicode `filename` to the full ISO-8859-1 charset
+
+0.3.0 / 2014-09-20
+==================
+
+  * Add `fallback` option
+  * Add `type` option
+
+0.2.0 / 2014-09-19
+==================
+
+  * Reduce ambiguity of file names with hex escape in buggy browsers
+
+0.1.2 / 2014-09-19
+==================
+
+  * Fix periodic invalid Unicode filename header
+
+0.1.1 / 2014-09-19
+==================
+
+  * Fix invalid characters appearing in `filename*` parameter
+
+0.1.0 / 2014-09-18
+==================
+
+  * Make the `filename` argument optional
+
+0.0.0 / 2014-09-18
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/content-disposition/LICENSE b/wrt/node_modules/content-disposition/LICENSE
new file mode 100644 (file)
index 0000000..b7dce6c
--- /dev/null
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2014 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/content-disposition/README.md b/wrt/node_modules/content-disposition/README.md
new file mode 100644 (file)
index 0000000..992d19a
--- /dev/null
@@ -0,0 +1,141 @@
+# content-disposition
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+Create and parse HTTP `Content-Disposition` header
+
+## Installation
+
+```sh
+$ npm install content-disposition
+```
+
+## API
+
+```js
+var contentDisposition = require('content-disposition')
+```
+
+### contentDisposition(filename, options)
+
+Create an attachment `Content-Disposition` header value using the given file name,
+if supplied. The `filename` is optional and if no file name is desired, but you
+want to specify `options`, set `filename` to `undefined`.
+
+```js
+res.setHeader('Content-Disposition', contentDisposition('∫ maths.pdf'))
+```
+
+**note** HTTP headers are of the ISO-8859-1 character set. If you are writing this
+header through a means different from `setHeader` in Node.js, you'll want to specify
+the `'binary'` encoding in Node.js.
+
+#### Options
+
+`contentDisposition` accepts these properties in the options object.
+
+##### fallback
+
+If the `filename` option is outside ISO-8859-1, then the file name is actually
+stored in a supplemental field for clients that support Unicode file names and
+a ISO-8859-1 version of the file name is automatically generated.
+
+This specifies the ISO-8859-1 file name to override the automatic generation or
+disables the generation all together, defaults to `true`.
+
+  - A string will specify the ISO-8859-1 file name to use in place of automatic
+    generation.
+  - `false` will disable including a ISO-8859-1 file name and only include the
+    Unicode version (unless the file name is already ISO-8859-1).
+  - `true` will enable automatic generation if the file name is outside ISO-8859-1.
+
+If the `filename` option is ISO-8859-1 and this option is specified and has a
+different value, then the `filename` option is encoded in the extended field
+and this set as the fallback field, even though they are both ISO-8859-1.
+
+##### type
+
+Specifies the disposition type, defaults to `"attachment"`. This can also be
+`"inline"`, or any other value (all values except inline are treated like
+`attachment`, but can convey additional information if both parties agree to
+it). The type is normalized to lower-case.
+
+### contentDisposition.parse(string)
+
+```js
+var disposition = contentDisposition.parse('attachment; filename="EURO rates.txt"; filename*=UTF-8\'\'%e2%82%ac%20rates.txt');
+```
+
+Parse a `Content-Disposition` header string. This automatically handles extended
+("Unicode") parameters by decoding them and providing them under the standard
+parameter name. This will return an object with the following properties (examples
+are shown for the string `'attachment; filename="EURO rates.txt"; filename*=UTF-8\'\'%e2%82%ac%20rates.txt'`):
+
+ - `type`: The disposition type (always lower case). Example: `'attachment'`
+
+ - `parameters`: An object of the parameters in the disposition (name of parameter
+   always lower case and extended versions replace non-extended versions). Example:
+   `{filename: "€ rates.txt"}`
+
+## Examples
+
+### Send a file for download
+
+```js
+var contentDisposition = require('content-disposition')
+var destroy = require('destroy')
+var http = require('http')
+var onFinished = require('on-finished')
+
+var filePath = '/path/to/public/plans.pdf'
+
+http.createServer(function onRequest(req, res) {
+  // set headers
+  res.setHeader('Content-Type', 'application/pdf')
+  res.setHeader('Content-Disposition', contentDisposition(filePath))
+
+  // send file
+  var stream = fs.createReadStream(filePath)
+  stream.pipe(res)
+  onFinished(res, function (err) {
+    destroy(stream)
+  })
+})
+```
+
+## Testing
+
+```sh
+$ npm test
+```
+
+## References
+
+- [RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1][rfc-2616]
+- [RFC 5987: Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters][rfc-5987]
+- [RFC 6266: Use of the Content-Disposition Header Field in the Hypertext Transfer Protocol (HTTP)][rfc-6266]
+- [Test Cases for HTTP Content-Disposition header field (RFC 6266) and the Encodings defined in RFCs 2047, 2231 and 5987][tc-2231]
+
+[rfc-2616]: https://tools.ietf.org/html/rfc2616
+[rfc-5987]: https://tools.ietf.org/html/rfc5987
+[rfc-6266]: https://tools.ietf.org/html/rfc6266
+[tc-2231]: http://greenbytes.de/tech/tc2231/
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/content-disposition.svg?style=flat
+[npm-url]: https://npmjs.org/package/content-disposition
+[node-version-image]: https://img.shields.io/node/v/content-disposition.svg?style=flat
+[node-version-url]: https://nodejs.org/en/download
+[travis-image]: https://img.shields.io/travis/jshttp/content-disposition.svg?style=flat
+[travis-url]: https://travis-ci.org/jshttp/content-disposition
+[coveralls-image]: https://img.shields.io/coveralls/jshttp/content-disposition.svg?style=flat
+[coveralls-url]: https://coveralls.io/r/jshttp/content-disposition?branch=master
+[downloads-image]: https://img.shields.io/npm/dm/content-disposition.svg?style=flat
+[downloads-url]: https://npmjs.org/package/content-disposition
diff --git a/wrt/node_modules/content-disposition/index.js b/wrt/node_modules/content-disposition/index.js
new file mode 100644 (file)
index 0000000..88a0d0a
--- /dev/null
@@ -0,0 +1,445 @@
+/*!
+ * content-disposition
+ * Copyright(c) 2014 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module exports.
+ */
+
+module.exports = contentDisposition
+module.exports.parse = parse
+
+/**
+ * Module dependencies.
+ */
+
+var basename = require('path').basename
+
+/**
+ * RegExp to match non attr-char, *after* encodeURIComponent (i.e. not including "%")
+ */
+
+var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g // eslint-disable-line no-control-regex
+
+/**
+ * RegExp to match percent encoding escape.
+ */
+
+var HEX_ESCAPE_REGEXP = /%[0-9A-Fa-f]{2}/
+var HEX_ESCAPE_REPLACE_REGEXP = /%([0-9A-Fa-f]{2})/g
+
+/**
+ * RegExp to match non-latin1 characters.
+ */
+
+var NON_LATIN1_REGEXP = /[^\x20-\x7e\xa0-\xff]/g
+
+/**
+ * RegExp to match quoted-pair in RFC 2616
+ *
+ * quoted-pair = "\" CHAR
+ * CHAR        = <any US-ASCII character (octets 0 - 127)>
+ */
+
+var QESC_REGEXP = /\\([\u0000-\u007f])/g
+
+/**
+ * RegExp to match chars that must be quoted-pair in RFC 2616
+ */
+
+var QUOTE_REGEXP = /([\\"])/g
+
+/**
+ * RegExp for various RFC 2616 grammar
+ *
+ * parameter     = token "=" ( token | quoted-string )
+ * token         = 1*<any CHAR except CTLs or separators>
+ * separators    = "(" | ")" | "<" | ">" | "@"
+ *               | "," | ";" | ":" | "\" | <">
+ *               | "/" | "[" | "]" | "?" | "="
+ *               | "{" | "}" | SP | HT
+ * quoted-string = ( <"> *(qdtext | quoted-pair ) <"> )
+ * qdtext        = <any TEXT except <">>
+ * quoted-pair   = "\" CHAR
+ * CHAR          = <any US-ASCII character (octets 0 - 127)>
+ * TEXT          = <any OCTET except CTLs, but including LWS>
+ * LWS           = [CRLF] 1*( SP | HT )
+ * CRLF          = CR LF
+ * CR            = <US-ASCII CR, carriage return (13)>
+ * LF            = <US-ASCII LF, linefeed (10)>
+ * SP            = <US-ASCII SP, space (32)>
+ * HT            = <US-ASCII HT, horizontal-tab (9)>
+ * CTL           = <any US-ASCII control character (octets 0 - 31) and DEL (127)>
+ * OCTET         = <any 8-bit sequence of data>
+ */
+
+var PARAM_REGEXP = /;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g // eslint-disable-line no-control-regex
+var TEXT_REGEXP = /^[\x20-\x7e\x80-\xff]+$/
+var TOKEN_REGEXP = /^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/
+
+/**
+ * RegExp for various RFC 5987 grammar
+ *
+ * ext-value     = charset  "'" [ language ] "'" value-chars
+ * charset       = "UTF-8" / "ISO-8859-1" / mime-charset
+ * mime-charset  = 1*mime-charsetc
+ * mime-charsetc = ALPHA / DIGIT
+ *               / "!" / "#" / "$" / "%" / "&"
+ *               / "+" / "-" / "^" / "_" / "`"
+ *               / "{" / "}" / "~"
+ * language      = ( 2*3ALPHA [ extlang ] )
+ *               / 4ALPHA
+ *               / 5*8ALPHA
+ * extlang       = *3( "-" 3ALPHA )
+ * value-chars   = *( pct-encoded / attr-char )
+ * pct-encoded   = "%" HEXDIG HEXDIG
+ * attr-char     = ALPHA / DIGIT
+ *               / "!" / "#" / "$" / "&" / "+" / "-" / "."
+ *               / "^" / "_" / "`" / "|" / "~"
+ */
+
+var EXT_VALUE_REGEXP = /^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/
+
+/**
+ * RegExp for various RFC 6266 grammar
+ *
+ * disposition-type = "inline" | "attachment" | disp-ext-type
+ * disp-ext-type    = token
+ * disposition-parm = filename-parm | disp-ext-parm
+ * filename-parm    = "filename" "=" value
+ *                  | "filename*" "=" ext-value
+ * disp-ext-parm    = token "=" value
+ *                  | ext-token "=" ext-value
+ * ext-token        = <the characters in token, followed by "*">
+ */
+
+var DISPOSITION_TYPE_REGEXP = /^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/ // eslint-disable-line no-control-regex
+
+/**
+ * Create an attachment Content-Disposition header.
+ *
+ * @param {string} [filename]
+ * @param {object} [options]
+ * @param {string} [options.type=attachment]
+ * @param {string|boolean} [options.fallback=true]
+ * @return {string}
+ * @api public
+ */
+
+function contentDisposition (filename, options) {
+  var opts = options || {}
+
+  // get type
+  var type = opts.type || 'attachment'
+
+  // get parameters
+  var params = createparams(filename, opts.fallback)
+
+  // format into string
+  return format(new ContentDisposition(type, params))
+}
+
+/**
+ * Create parameters object from filename and fallback.
+ *
+ * @param {string} [filename]
+ * @param {string|boolean} [fallback=true]
+ * @return {object}
+ * @api private
+ */
+
+function createparams (filename, fallback) {
+  if (filename === undefined) {
+    return
+  }
+
+  var params = {}
+
+  if (typeof filename !== 'string') {
+    throw new TypeError('filename must be a string')
+  }
+
+  // fallback defaults to true
+  if (fallback === undefined) {
+    fallback = true
+  }
+
+  if (typeof fallback !== 'string' && typeof fallback !== 'boolean') {
+    throw new TypeError('fallback must be a string or boolean')
+  }
+
+  if (typeof fallback === 'string' && NON_LATIN1_REGEXP.test(fallback)) {
+    throw new TypeError('fallback must be ISO-8859-1 string')
+  }
+
+  // restrict to file base name
+  var name = basename(filename)
+
+  // determine if name is suitable for quoted string
+  var isQuotedString = TEXT_REGEXP.test(name)
+
+  // generate fallback name
+  var fallbackName = typeof fallback !== 'string'
+    ? fallback && getlatin1(name)
+    : basename(fallback)
+  var hasFallback = typeof fallbackName === 'string' && fallbackName !== name
+
+  // set extended filename parameter
+  if (hasFallback || !isQuotedString || HEX_ESCAPE_REGEXP.test(name)) {
+    params['filename*'] = name
+  }
+
+  // set filename parameter
+  if (isQuotedString || hasFallback) {
+    params.filename = hasFallback
+      ? fallbackName
+      : name
+  }
+
+  return params
+}
+
+/**
+ * Format object to Content-Disposition header.
+ *
+ * @param {object} obj
+ * @param {string} obj.type
+ * @param {object} [obj.parameters]
+ * @return {string}
+ * @api private
+ */
+
+function format (obj) {
+  var parameters = obj.parameters
+  var type = obj.type
+
+  if (!type || typeof type !== 'string' || !TOKEN_REGEXP.test(type)) {
+    throw new TypeError('invalid type')
+  }
+
+  // start with normalized type
+  var string = String(type).toLowerCase()
+
+  // append parameters
+  if (parameters && typeof parameters === 'object') {
+    var param
+    var params = Object.keys(parameters).sort()
+
+    for (var i = 0; i < params.length; i++) {
+      param = params[i]
+
+      var val = param.substr(-1) === '*'
+        ? ustring(parameters[param])
+        : qstring(parameters[param])
+
+      string += '; ' + param + '=' + val
+    }
+  }
+
+  return string
+}
+
+/**
+ * Decode a RFC 6987 field value (gracefully).
+ *
+ * @param {string} str
+ * @return {string}
+ * @api private
+ */
+
+function decodefield (str) {
+  var match = EXT_VALUE_REGEXP.exec(str)
+
+  if (!match) {
+    throw new TypeError('invalid extended field value')
+  }
+
+  var charset = match[1].toLowerCase()
+  var encoded = match[2]
+  var value
+
+  // to binary string
+  var binary = encoded.replace(HEX_ESCAPE_REPLACE_REGEXP, pdecode)
+
+  switch (charset) {
+    case 'iso-8859-1':
+      value = getlatin1(binary)
+      break
+    case 'utf-8':
+      value = new Buffer(binary, 'binary').toString('utf8')
+      break
+    default:
+      throw new TypeError('unsupported charset in extended field')
+  }
+
+  return value
+}
+
+/**
+ * Get ISO-8859-1 version of string.
+ *
+ * @param {string} val
+ * @return {string}
+ * @api private
+ */
+
+function getlatin1 (val) {
+  // simple Unicode -> ISO-8859-1 transformation
+  return String(val).replace(NON_LATIN1_REGEXP, '?')
+}
+
+/**
+ * Parse Content-Disposition header string.
+ *
+ * @param {string} string
+ * @return {object}
+ * @api private
+ */
+
+function parse (string) {
+  if (!string || typeof string !== 'string') {
+    throw new TypeError('argument string is required')
+  }
+
+  var match = DISPOSITION_TYPE_REGEXP.exec(string)
+
+  if (!match) {
+    throw new TypeError('invalid type format')
+  }
+
+  // normalize type
+  var index = match[0].length
+  var type = match[1].toLowerCase()
+
+  var key
+  var names = []
+  var params = {}
+  var value
+
+  // calculate index to start at
+  index = PARAM_REGEXP.lastIndex = match[0].substr(-1) === ';'
+    ? index - 1
+    : index
+
+  // match parameters
+  while ((match = PARAM_REGEXP.exec(string))) {
+    if (match.index !== index) {
+      throw new TypeError('invalid parameter format')
+    }
+
+    index += match[0].length
+    key = match[1].toLowerCase()
+    value = match[2]
+
+    if (names.indexOf(key) !== -1) {
+      throw new TypeError('invalid duplicate parameter')
+    }
+
+    names.push(key)
+
+    if (key.indexOf('*') + 1 === key.length) {
+      // decode extended value
+      key = key.slice(0, -1)
+      value = decodefield(value)
+
+      // overwrite existing value
+      params[key] = value
+      continue
+    }
+
+    if (typeof params[key] === 'string') {
+      continue
+    }
+
+    if (value[0] === '"') {
+      // remove quotes and escapes
+      value = value
+        .substr(1, value.length - 2)
+        .replace(QESC_REGEXP, '$1')
+    }
+
+    params[key] = value
+  }
+
+  if (index !== -1 && index !== string.length) {
+    throw new TypeError('invalid parameter format')
+  }
+
+  return new ContentDisposition(type, params)
+}
+
+/**
+ * Percent decode a single character.
+ *
+ * @param {string} str
+ * @param {string} hex
+ * @return {string}
+ * @api private
+ */
+
+function pdecode (str, hex) {
+  return String.fromCharCode(parseInt(hex, 16))
+}
+
+/**
+ * Percent encode a single character.
+ *
+ * @param {string} char
+ * @return {string}
+ * @api private
+ */
+
+function pencode (char) {
+  var hex = String(char)
+    .charCodeAt(0)
+    .toString(16)
+    .toUpperCase()
+  return hex.length === 1
+    ? '%0' + hex
+    : '%' + hex
+}
+
+/**
+ * Quote a string for HTTP.
+ *
+ * @param {string} val
+ * @return {string}
+ * @api private
+ */
+
+function qstring (val) {
+  var str = String(val)
+
+  return '"' + str.replace(QUOTE_REGEXP, '\\$1') + '"'
+}
+
+/**
+ * Encode a Unicode string for HTTP (RFC 5987).
+ *
+ * @param {string} val
+ * @return {string}
+ * @api private
+ */
+
+function ustring (val) {
+  var str = String(val)
+
+  // percent encode as UTF-8
+  var encoded = encodeURIComponent(str)
+    .replace(ENCODE_URL_ATTR_CHAR_REGEXP, pencode)
+
+  return 'UTF-8\'\'' + encoded
+}
+
+/**
+ * Class for parsed Content-Disposition header for v8 optimization
+ */
+
+function ContentDisposition (type, parameters) {
+  this.type = type
+  this.parameters = parameters
+}
diff --git a/wrt/node_modules/content-disposition/package.json b/wrt/node_modules/content-disposition/package.json
new file mode 100644 (file)
index 0000000..b6eda4c
--- /dev/null
@@ -0,0 +1,110 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "content-disposition@0.5.2",
+        "scope": null,
+        "escapedName": "content-disposition",
+        "name": "content-disposition",
+        "rawSpec": "0.5.2",
+        "spec": "0.5.2",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express"
+    ]
+  ],
+  "_from": "content-disposition@0.5.2",
+  "_id": "content-disposition@0.5.2",
+  "_inCache": true,
+  "_location": "/content-disposition",
+  "_nodeVersion": "4.6.0",
+  "_npmOperationalInternal": {
+    "host": "packages-18-east.internal.npmjs.com",
+    "tmp": "tmp/content-disposition-0.5.2.tgz_1481246224565_0.35659545403905213"
+  },
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "2.15.9",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "content-disposition@0.5.2",
+    "scope": null,
+    "escapedName": "content-disposition",
+    "name": "content-disposition",
+    "rawSpec": "0.5.2",
+    "spec": "0.5.2",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/express"
+  ],
+  "_resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz",
+  "_shasum": "0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4",
+  "_shrinkwrap": null,
+  "_spec": "content-disposition@0.5.2",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express",
+  "bugs": {
+    "url": "https://github.com/jshttp/content-disposition/issues"
+  },
+  "contributors": [
+    {
+      "name": "Douglas Christopher Wilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "dependencies": {},
+  "description": "Create and parse Content-Disposition header",
+  "devDependencies": {
+    "eslint": "3.11.1",
+    "eslint-config-standard": "6.2.1",
+    "eslint-plugin-promise": "3.3.0",
+    "eslint-plugin-standard": "2.0.1",
+    "istanbul": "0.4.5",
+    "mocha": "1.21.5"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4",
+    "tarball": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz"
+  },
+  "engines": {
+    "node": ">= 0.6"
+  },
+  "files": [
+    "LICENSE",
+    "HISTORY.md",
+    "README.md",
+    "index.js"
+  ],
+  "gitHead": "2a08417377cf55678c9f870b305f3c6c088920f3",
+  "homepage": "https://github.com/jshttp/content-disposition#readme",
+  "keywords": [
+    "content-disposition",
+    "http",
+    "rfc6266",
+    "res"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "name": "content-disposition",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/jshttp/content-disposition.git"
+  },
+  "scripts": {
+    "lint": "eslint .",
+    "test": "mocha --reporter spec --bail --check-leaks test/",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
+    "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
+  },
+  "version": "0.5.2"
+}
diff --git a/wrt/node_modules/content-type/HISTORY.md b/wrt/node_modules/content-type/HISTORY.md
new file mode 100644 (file)
index 0000000..8f5cb70
--- /dev/null
@@ -0,0 +1,24 @@
+1.0.4 / 2017-09-11
+==================
+
+  * perf: skip parameter parsing when no parameters
+
+1.0.3 / 2017-09-10
+==================
+
+  * perf: remove argument reassignment
+
+1.0.2 / 2016-05-09
+==================
+
+  * perf: enable strict mode
+
+1.0.1 / 2015-02-13
+==================
+
+  * Improve missing `Content-Type` header error message
+
+1.0.0 / 2015-02-01
+==================
+
+  * Initial implementation, derived from `media-typer@0.3.0`
diff --git a/wrt/node_modules/content-type/LICENSE b/wrt/node_modules/content-type/LICENSE
new file mode 100644 (file)
index 0000000..34b1a2d
--- /dev/null
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2015 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/content-type/README.md b/wrt/node_modules/content-type/README.md
new file mode 100644 (file)
index 0000000..3ed6741
--- /dev/null
@@ -0,0 +1,92 @@
+# content-type
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+Create and parse HTTP Content-Type header according to RFC 7231
+
+## Installation
+
+```sh
+$ npm install content-type
+```
+
+## API
+
+```js
+var contentType = require('content-type')
+```
+
+### contentType.parse(string)
+
+```js
+var obj = contentType.parse('image/svg+xml; charset=utf-8')
+```
+
+Parse a content type string. This will return an object with the following
+properties (examples are shown for the string `'image/svg+xml; charset=utf-8'`):
+
+ - `type`: The media type (the type and subtype, always lower case).
+   Example: `'image/svg+xml'`
+
+ - `parameters`: An object of the parameters in the media type (name of parameter
+   always lower case). Example: `{charset: 'utf-8'}`
+
+Throws a `TypeError` if the string is missing or invalid.
+
+### contentType.parse(req)
+
+```js
+var obj = contentType.parse(req)
+```
+
+Parse the `content-type` header from the given `req`. Short-cut for
+`contentType.parse(req.headers['content-type'])`.
+
+Throws a `TypeError` if the `Content-Type` header is missing or invalid.
+
+### contentType.parse(res)
+
+```js
+var obj = contentType.parse(res)
+```
+
+Parse the `content-type` header set on the given `res`. Short-cut for
+`contentType.parse(res.getHeader('content-type'))`.
+
+Throws a `TypeError` if the `Content-Type` header is missing or invalid.
+
+### contentType.format(obj)
+
+```js
+var str = contentType.format({type: 'image/svg+xml'})
+```
+
+Format an object into a content type string. This will return a string of the
+content type for the given object with the following properties (examples are
+shown that produce the string `'image/svg+xml; charset=utf-8'`):
+
+ - `type`: The media type (will be lower-cased). Example: `'image/svg+xml'`
+
+ - `parameters`: An object of the parameters in the media type (name of the
+   parameter will be lower-cased). Example: `{charset: 'utf-8'}`
+
+Throws a `TypeError` if the object contains an invalid type or parameter names.
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/content-type.svg
+[npm-url]: https://npmjs.org/package/content-type
+[node-version-image]: https://img.shields.io/node/v/content-type.svg
+[node-version-url]: http://nodejs.org/download/
+[travis-image]: https://img.shields.io/travis/jshttp/content-type/master.svg
+[travis-url]: https://travis-ci.org/jshttp/content-type
+[coveralls-image]: https://img.shields.io/coveralls/jshttp/content-type/master.svg
+[coveralls-url]: https://coveralls.io/r/jshttp/content-type
+[downloads-image]: https://img.shields.io/npm/dm/content-type.svg
+[downloads-url]: https://npmjs.org/package/content-type
diff --git a/wrt/node_modules/content-type/index.js b/wrt/node_modules/content-type/index.js
new file mode 100644 (file)
index 0000000..6ce03f2
--- /dev/null
@@ -0,0 +1,222 @@
+/*!
+ * content-type
+ * Copyright(c) 2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * RegExp to match *( ";" parameter ) in RFC 7231 sec 3.1.1.1
+ *
+ * parameter     = token "=" ( token / quoted-string )
+ * token         = 1*tchar
+ * tchar         = "!" / "#" / "$" / "%" / "&" / "'" / "*"
+ *               / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
+ *               / DIGIT / ALPHA
+ *               ; any VCHAR, except delimiters
+ * quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE
+ * qdtext        = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text
+ * obs-text      = %x80-FF
+ * quoted-pair   = "\" ( HTAB / SP / VCHAR / obs-text )
+ */
+var PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g
+var TEXT_REGEXP = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/
+var TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/
+
+/**
+ * RegExp to match quoted-pair in RFC 7230 sec 3.2.6
+ *
+ * quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
+ * obs-text    = %x80-FF
+ */
+var QESC_REGEXP = /\\([\u000b\u0020-\u00ff])/g
+
+/**
+ * RegExp to match chars that must be quoted-pair in RFC 7230 sec 3.2.6
+ */
+var QUOTE_REGEXP = /([\\"])/g
+
+/**
+ * RegExp to match type in RFC 7231 sec 3.1.1.1
+ *
+ * media-type = type "/" subtype
+ * type       = token
+ * subtype    = token
+ */
+var TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/
+
+/**
+ * Module exports.
+ * @public
+ */
+
+exports.format = format
+exports.parse = parse
+
+/**
+ * Format object to media type.
+ *
+ * @param {object} obj
+ * @return {string}
+ * @public
+ */
+
+function format (obj) {
+  if (!obj || typeof obj !== 'object') {
+    throw new TypeError('argument obj is required')
+  }
+
+  var parameters = obj.parameters
+  var type = obj.type
+
+  if (!type || !TYPE_REGEXP.test(type)) {
+    throw new TypeError('invalid type')
+  }
+
+  var string = type
+
+  // append parameters
+  if (parameters && typeof parameters === 'object') {
+    var param
+    var params = Object.keys(parameters).sort()
+
+    for (var i = 0; i < params.length; i++) {
+      param = params[i]
+
+      if (!TOKEN_REGEXP.test(param)) {
+        throw new TypeError('invalid parameter name')
+      }
+
+      string += '; ' + param + '=' + qstring(parameters[param])
+    }
+  }
+
+  return string
+}
+
+/**
+ * Parse media type to object.
+ *
+ * @param {string|object} string
+ * @return {Object}
+ * @public
+ */
+
+function parse (string) {
+  if (!string) {
+    throw new TypeError('argument string is required')
+  }
+
+  // support req/res-like objects as argument
+  var header = typeof string === 'object'
+    ? getcontenttype(string)
+    : string
+
+  if (typeof header !== 'string') {
+    throw new TypeError('argument string is required to be a string')
+  }
+
+  var index = header.indexOf(';')
+  var type = index !== -1
+    ? header.substr(0, index).trim()
+    : header.trim()
+
+  if (!TYPE_REGEXP.test(type)) {
+    throw new TypeError('invalid media type')
+  }
+
+  var obj = new ContentType(type.toLowerCase())
+
+  // parse parameters
+  if (index !== -1) {
+    var key
+    var match
+    var value
+
+    PARAM_REGEXP.lastIndex = index
+
+    while ((match = PARAM_REGEXP.exec(header))) {
+      if (match.index !== index) {
+        throw new TypeError('invalid parameter format')
+      }
+
+      index += match[0].length
+      key = match[1].toLowerCase()
+      value = match[2]
+
+      if (value[0] === '"') {
+        // remove quotes and escapes
+        value = value
+          .substr(1, value.length - 2)
+          .replace(QESC_REGEXP, '$1')
+      }
+
+      obj.parameters[key] = value
+    }
+
+    if (index !== header.length) {
+      throw new TypeError('invalid parameter format')
+    }
+  }
+
+  return obj
+}
+
+/**
+ * Get content-type from req/res objects.
+ *
+ * @param {object}
+ * @return {Object}
+ * @private
+ */
+
+function getcontenttype (obj) {
+  var header
+
+  if (typeof obj.getHeader === 'function') {
+    // res-like
+    header = obj.getHeader('content-type')
+  } else if (typeof obj.headers === 'object') {
+    // req-like
+    header = obj.headers && obj.headers['content-type']
+  }
+
+  if (typeof header !== 'string') {
+    throw new TypeError('content-type header is missing from object')
+  }
+
+  return header
+}
+
+/**
+ * Quote a string if necessary.
+ *
+ * @param {string} val
+ * @return {string}
+ * @private
+ */
+
+function qstring (val) {
+  var str = String(val)
+
+  // no need to quote tokens
+  if (TOKEN_REGEXP.test(str)) {
+    return str
+  }
+
+  if (str.length > 0 && !TEXT_REGEXP.test(str)) {
+    throw new TypeError('invalid parameter value')
+  }
+
+  return '"' + str.replace(QUOTE_REGEXP, '\\$1') + '"'
+}
+
+/**
+ * Class to represent a content type.
+ * @private
+ */
+function ContentType (type) {
+  this.parameters = Object.create(null)
+  this.type = type
+}
diff --git a/wrt/node_modules/content-type/package.json b/wrt/node_modules/content-type/package.json
new file mode 100644 (file)
index 0000000..ab45a8e
--- /dev/null
@@ -0,0 +1,112 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "content-type@~1.0.2",
+        "scope": null,
+        "escapedName": "content-type",
+        "name": "content-type",
+        "rawSpec": "~1.0.2",
+        "spec": ">=1.0.2 <1.1.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express"
+    ]
+  ],
+  "_from": "content-type@>=1.0.2 <1.1.0",
+  "_id": "content-type@1.0.4",
+  "_inCache": true,
+  "_location": "/content-type",
+  "_nodeVersion": "6.11.3",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/content-type-1.0.4.tgz_1505166155546_0.06956395204178989"
+  },
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "5.3.0",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "content-type@~1.0.2",
+    "scope": null,
+    "escapedName": "content-type",
+    "name": "content-type",
+    "rawSpec": "~1.0.2",
+    "spec": ">=1.0.2 <1.1.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/express"
+  ],
+  "_resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
+  "_shasum": "e138cc75e040c727b1966fe5e5f8c9aee256fe3b",
+  "_shrinkwrap": null,
+  "_spec": "content-type@~1.0.2",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express",
+  "author": {
+    "name": "Douglas Christopher Wilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "bugs": {
+    "url": "https://github.com/jshttp/content-type/issues"
+  },
+  "dependencies": {},
+  "description": "Create and parse HTTP Content-Type header",
+  "devDependencies": {
+    "eslint": "3.19.0",
+    "eslint-config-standard": "10.2.1",
+    "eslint-plugin-import": "2.7.0",
+    "eslint-plugin-node": "5.1.1",
+    "eslint-plugin-promise": "3.5.0",
+    "eslint-plugin-standard": "3.0.1",
+    "istanbul": "0.4.5",
+    "mocha": "~1.21.5"
+  },
+  "directories": {},
+  "dist": {
+    "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==",
+    "shasum": "e138cc75e040c727b1966fe5e5f8c9aee256fe3b",
+    "tarball": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz"
+  },
+  "engines": {
+    "node": ">= 0.6"
+  },
+  "files": [
+    "LICENSE",
+    "HISTORY.md",
+    "README.md",
+    "index.js"
+  ],
+  "gitHead": "d22f8ac6c407789c906bd6fed137efde8f772b09",
+  "homepage": "https://github.com/jshttp/content-type#readme",
+  "keywords": [
+    "content-type",
+    "http",
+    "req",
+    "res",
+    "rfc7231"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "name": "content-type",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/jshttp/content-type.git"
+  },
+  "scripts": {
+    "lint": "eslint .",
+    "test": "mocha --reporter spec --check-leaks --bail test/",
+    "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/"
+  },
+  "version": "1.0.4"
+}
diff --git a/wrt/node_modules/cookie-signature/.npmignore b/wrt/node_modules/cookie-signature/.npmignore
new file mode 100644 (file)
index 0000000..f1250e5
--- /dev/null
@@ -0,0 +1,4 @@
+support
+test
+examples
+*.sock
diff --git a/wrt/node_modules/cookie-signature/History.md b/wrt/node_modules/cookie-signature/History.md
new file mode 100644 (file)
index 0000000..78513cc
--- /dev/null
@@ -0,0 +1,38 @@
+1.0.6 / 2015-02-03
+==================
+
+* use `npm test` instead of `make test` to run tests
+* clearer assertion messages when checking input
+
+
+1.0.5 / 2014-09-05
+==================
+
+* add license to package.json
+
+1.0.4 / 2014-06-25
+==================
+
+ * corrected avoidance of timing attacks (thanks @tenbits!)
+
+1.0.3 / 2014-01-28
+==================
+
+ * [incorrect] fix for timing attacks
+
+1.0.2 / 2014-01-28
+==================
+
+ * fix missing repository warning
+ * fix typo in test
+
+1.0.1 / 2013-04-15
+==================
+
+  * Revert "Changed underlying HMAC algo. to sha512."
+  * Revert "Fix for timing attacks on MAC verification."
+
+0.0.1 / 2010-01-03
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/cookie-signature/Readme.md b/wrt/node_modules/cookie-signature/Readme.md
new file mode 100644 (file)
index 0000000..2559e84
--- /dev/null
@@ -0,0 +1,42 @@
+
+# cookie-signature
+
+  Sign and unsign cookies.
+
+## Example
+
+```js
+var cookie = require('cookie-signature');
+
+var val = cookie.sign('hello', 'tobiiscool');
+val.should.equal('hello.DGDUkGlIkCzPz+C0B064FNgHdEjox7ch8tOBGslZ5QI');
+
+var val = cookie.sign('hello', 'tobiiscool');
+cookie.unsign(val, 'tobiiscool').should.equal('hello');
+cookie.unsign(val, 'luna').should.be.false;
+```
+
+## License 
+
+(The MIT License)
+
+Copyright (c) 2012 LearnBoost &lt;tj@learnboost.com&gt;
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/wrt/node_modules/cookie-signature/index.js b/wrt/node_modules/cookie-signature/index.js
new file mode 100644 (file)
index 0000000..b8c9463
--- /dev/null
@@ -0,0 +1,51 @@
+/**
+ * Module dependencies.
+ */
+
+var crypto = require('crypto');
+
+/**
+ * Sign the given `val` with `secret`.
+ *
+ * @param {String} val
+ * @param {String} secret
+ * @return {String}
+ * @api private
+ */
+
+exports.sign = function(val, secret){
+  if ('string' != typeof val) throw new TypeError("Cookie value must be provided as a string.");
+  if ('string' != typeof secret) throw new TypeError("Secret string must be provided.");
+  return val + '.' + crypto
+    .createHmac('sha256', secret)
+    .update(val)
+    .digest('base64')
+    .replace(/\=+$/, '');
+};
+
+/**
+ * Unsign and decode the given `val` with `secret`,
+ * returning `false` if the signature is invalid.
+ *
+ * @param {String} val
+ * @param {String} secret
+ * @return {String|Boolean}
+ * @api private
+ */
+
+exports.unsign = function(val, secret){
+  if ('string' != typeof val) throw new TypeError("Signed cookie string must be provided.");
+  if ('string' != typeof secret) throw new TypeError("Secret string must be provided.");
+  var str = val.slice(0, val.lastIndexOf('.'))
+    , mac = exports.sign(str, secret);
+  
+  return sha1(mac) == sha1(val) ? str : false;
+};
+
+/**
+ * Private
+ */
+
+function sha1(str){
+  return crypto.createHash('sha1').update(str).digest('hex');
+}
diff --git a/wrt/node_modules/cookie-signature/package.json b/wrt/node_modules/cookie-signature/package.json
new file mode 100644 (file)
index 0000000..67eff04
--- /dev/null
@@ -0,0 +1,92 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "cookie-signature@1.0.6",
+        "scope": null,
+        "escapedName": "cookie-signature",
+        "name": "cookie-signature",
+        "rawSpec": "1.0.6",
+        "spec": "1.0.6",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express"
+    ]
+  ],
+  "_from": "cookie-signature@1.0.6",
+  "_id": "cookie-signature@1.0.6",
+  "_inCache": true,
+  "_location": "/cookie-signature",
+  "_nodeVersion": "0.10.36",
+  "_npmUser": {
+    "name": "natevw",
+    "email": "natevw@yahoo.com"
+  },
+  "_npmVersion": "2.3.0",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "cookie-signature@1.0.6",
+    "scope": null,
+    "escapedName": "cookie-signature",
+    "name": "cookie-signature",
+    "rawSpec": "1.0.6",
+    "spec": "1.0.6",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/express"
+  ],
+  "_resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
+  "_shasum": "e303a882b342cc3ee8ca513a79999734dab3ae2c",
+  "_shrinkwrap": null,
+  "_spec": "cookie-signature@1.0.6",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express",
+  "author": {
+    "name": "TJ Holowaychuk",
+    "email": "tj@learnboost.com"
+  },
+  "bugs": {
+    "url": "https://github.com/visionmedia/node-cookie-signature/issues"
+  },
+  "dependencies": {},
+  "description": "Sign and unsign cookies",
+  "devDependencies": {
+    "mocha": "*",
+    "should": "*"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "e303a882b342cc3ee8ca513a79999734dab3ae2c",
+    "tarball": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz"
+  },
+  "gitHead": "391b56cf44d88c493491b7e3fc53208cfb976d2a",
+  "homepage": "https://github.com/visionmedia/node-cookie-signature",
+  "keywords": [
+    "cookie",
+    "sign",
+    "unsign"
+  ],
+  "license": "MIT",
+  "main": "index",
+  "maintainers": [
+    {
+      "name": "tjholowaychuk",
+      "email": "tj@vision-media.ca"
+    },
+    {
+      "name": "natevw",
+      "email": "natevw@yahoo.com"
+    }
+  ],
+  "name": "cookie-signature",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/visionmedia/node-cookie-signature.git"
+  },
+  "scripts": {
+    "test": "mocha --require should --reporter spec"
+  },
+  "version": "1.0.6"
+}
diff --git a/wrt/node_modules/cookie/HISTORY.md b/wrt/node_modules/cookie/HISTORY.md
new file mode 100644 (file)
index 0000000..5bd6485
--- /dev/null
@@ -0,0 +1,118 @@
+0.3.1 / 2016-05-26
+==================
+
+  * Fix `sameSite: true` to work with draft-7 clients
+    - `true` now sends `SameSite=Strict` instead of `SameSite`
+
+0.3.0 / 2016-05-26
+==================
+
+  * Add `sameSite` option
+    - Replaces `firstPartyOnly` option, never implemented by browsers
+  * Improve error message when `encode` is not a function
+  * Improve error message when `expires` is not a `Date`
+
+0.2.4 / 2016-05-20
+==================
+
+  * perf: enable strict mode
+  * perf: use for loop in parse
+  * perf: use string concatination for serialization
+
+0.2.3 / 2015-10-25
+==================
+
+  * Fix cookie `Max-Age` to never be a floating point number
+
+0.2.2 / 2015-09-17
+==================
+
+  * Fix regression when setting empty cookie value
+    - Ease the new restriction, which is just basic header-level validation
+  * Fix typo in invalid value errors
+
+0.2.1 / 2015-09-17
+==================
+
+  * Throw on invalid values provided to `serialize`
+    - Ensures the resulting string is a valid HTTP header value
+
+0.2.0 / 2015-08-13
+==================
+
+  * Add `firstPartyOnly` option
+  * Throw better error for invalid argument to parse
+  * perf: hoist regular expression
+
+0.1.5 / 2015-09-17
+==================
+
+  * Fix regression when setting empty cookie value
+    - Ease the new restriction, which is just basic header-level validation
+  * Fix typo in invalid value errors
+
+0.1.4 / 2015-09-17
+==================
+
+  * Throw better error for invalid argument to parse
+  * Throw on invalid values provided to `serialize`
+    - Ensures the resulting string is a valid HTTP header value
+
+0.1.3 / 2015-05-19
+==================
+
+  * Reduce the scope of try-catch deopt
+  * Remove argument reassignments
+
+0.1.2 / 2014-04-16
+==================
+
+  * Remove unnecessary files from npm package
+
+0.1.1 / 2014-02-23
+==================
+
+  * Fix bad parse when cookie value contained a comma
+  * Fix support for `maxAge` of `0`
+
+0.1.0 / 2013-05-01
+==================
+
+  * Add `decode` option
+  * Add `encode` option
+
+0.0.6 / 2013-04-08
+==================
+
+  * Ignore cookie parts missing `=`
+
+0.0.5 / 2012-10-29
+==================
+
+  * Return raw cookie value if value unescape errors
+
+0.0.4 / 2012-06-21
+==================
+
+  * Use encode/decodeURIComponent for cookie encoding/decoding
+    - Improve server/client interoperability
+
+0.0.3 / 2012-06-06
+==================
+
+  * Only escape special characters per the cookie RFC
+
+0.0.2 / 2012-06-01
+==================
+
+  * Fix `maxAge` option to not throw error
+
+0.0.1 / 2012-05-28
+==================
+
+  * Add more tests
+
+0.0.0 / 2012-05-28
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/cookie/LICENSE b/wrt/node_modules/cookie/LICENSE
new file mode 100644 (file)
index 0000000..058b6b4
--- /dev/null
@@ -0,0 +1,24 @@
+(The MIT License)
+
+Copyright (c) 2012-2014 Roman Shtylman <shtylman@gmail.com>
+Copyright (c) 2015 Douglas Christopher Wilson <doug@somethingdoug.com>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/wrt/node_modules/cookie/README.md b/wrt/node_modules/cookie/README.md
new file mode 100644 (file)
index 0000000..db0d078
--- /dev/null
@@ -0,0 +1,220 @@
+# cookie
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+Basic HTTP cookie parser and serializer for HTTP servers.
+
+## Installation
+
+```sh
+$ npm install cookie
+```
+
+## API
+
+```js
+var cookie = require('cookie');
+```
+
+### cookie.parse(str, options)
+
+Parse an HTTP `Cookie` header string and returning an object of all cookie name-value pairs.
+The `str` argument is the string representing a `Cookie` header value and `options` is an
+optional object containing additional parsing options.
+
+```js
+var cookies = cookie.parse('foo=bar; equation=E%3Dmc%5E2');
+// { foo: 'bar', equation: 'E=mc^2' }
+```
+
+#### Options
+
+`cookie.parse` accepts these properties in the options object.
+
+##### decode
+
+Specifies a function that will be used to decode a cookie's value. Since the value of a cookie
+has a limited character set (and must be a simple string), this function can be used to decode
+a previously-encoded cookie value into a JavaScript string or other object.
+
+The default function is the global `decodeURIComponent`, which will decode any URL-encoded
+sequences into their byte representations.
+
+**note** if an error is thrown from this function, the original, non-decoded cookie value will
+be returned as the cookie's value.
+
+### cookie.serialize(name, value, options)
+
+Serialize a cookie name-value pair into a `Set-Cookie` header string. The `name` argument is the
+name for the cookie, the `value` argument is the value to set the cookie to, and the `options`
+argument is an optional object containing additional serialization options.
+
+```js
+var setCookie = cookie.serialize('foo', 'bar');
+// foo=bar
+```
+
+#### Options
+
+`cookie.serialize` accepts these properties in the options object.
+
+##### domain
+
+Specifies the value for the [`Domain` `Set-Cookie` attribute][rfc-6266-5.2.3]. By default, no
+domain is set, and most clients will consider the cookie to apply to only the current domain.
+
+##### encode
+
+Specifies a function that will be used to encode a cookie's value. Since value of a cookie
+has a limited character set (and must be a simple string), this function can be used to encode
+a value into a string suited for a cookie's value.
+
+The default function is the global `ecodeURIComponent`, which will encode a JavaScript string
+into UTF-8 byte sequences and then URL-encode any that fall outside of the cookie range.
+
+##### expires
+
+Specifies the `Date` object to be the value for the [`Expires` `Set-Cookie` attribute][rfc-6266-5.2.1].
+By default, no expiration is set, and most clients will consider this a "non-persistent cookie" and
+will delete it on a condition like exiting a web browser application.
+
+**note** the [cookie storage model specification][rfc-6266-5.3] states that if both `expires` and
+`magAge` are set, then `maxAge` takes precedence, but it is possiblke not all clients by obey this,
+so if both are set, they should point to the same date and time.
+
+##### httpOnly
+
+Specifies the `boolean` value for the [`HttpOnly` `Set-Cookie` attribute][rfc-6266-5.2.6]. When truthy,
+the `HttpOnly` attribute is set, otherwise it is not. By default, the `HttpOnly` attribute is not set.
+
+**note** be careful when setting this to `true`, as compliant clients will not allow client-side
+JavaScript to see the cookie in `document.cookie`.
+
+##### maxAge
+
+Specifies the `number` (in seconds) to be the value for the [`Max-Age` `Set-Cookie` attribute][rfc-6266-5.2.2].
+The given number will be converted to an integer by rounding down. By default, no maximum age is set.
+
+**note** the [cookie storage model specification][rfc-6266-5.3] states that if both `expires` and
+`magAge` are set, then `maxAge` takes precedence, but it is possiblke not all clients by obey this,
+so if both are set, they should point to the same date and time.
+
+##### path
+
+Specifies the value for the [`Path` `Set-Cookie` attribute][rfc-6266-5.2.4]. By default, the path
+is considered the ["default path"][rfc-6266-5.1.4]. By default, no maximum age is set, and most
+clients will consider this a "non-persistent cookie" and will delete it on a condition like exiting
+a web browser application.
+
+##### sameSite
+
+Specifies the `boolean` or `string` to be the value for the [`SameSite` `Set-Cookie` attribute][draft-west-first-party-cookies-07].
+
+  - `true` will set the `SameSite` attribute to `Strict` for strict same site enforcement.
+  - `false` will not set the `SameSite` attribute.
+  - `'lax'` will set the `SameSite` attribute to `Lax` for lax same site enforcement.
+  - `'strict'` will set the `SameSite` attribute to `Strict` for strict same site enforcement.
+
+More information about the different enforcement levels can be found in the specification
+https://tools.ietf.org/html/draft-west-first-party-cookies-07#section-4.1.1
+
+**note** This is an attribute that has not yet been fully standardized, and may change in the future.
+This also means many clients may ignore this attribute until they understand it.
+
+##### secure
+
+Specifies the `boolean` value for the [`Secure` `Set-Cookie` attribute][rfc-6266-5.2.5]. When truthy,
+the `Secure` attribute is set, otherwise it is not. By default, the `Secure` attribute is not set.
+
+**note** be careful when setting this to `true`, as compliant clients will not send the cookie back to
+the server in the future if the browser does not have an HTTPS connection.
+
+## Example
+
+The following example uses this module in conjunction with the Node.js core HTTP server
+to prompt a user for their name and display it back on future visits.
+
+```js
+var cookie = require('cookie');
+var escapeHtml = require('escape-html');
+var http = require('http');
+var url = require('url');
+
+function onRequest(req, res) {
+  // Parse the query string
+  var query = url.parse(req.url, true, true).query;
+
+  if (query && query.name) {
+    // Set a new cookie with the name
+    res.setHeader('Set-Cookie', cookie.serialize('name', String(query.name), {
+      httpOnly: true,
+      maxAge: 60 * 60 * 24 * 7 // 1 week
+    }));
+
+    // Redirect back after setting cookie
+    res.statusCode = 302;
+    res.setHeader('Location', req.headers.referer || '/');
+    res.end();
+    return;
+  }
+
+  // Parse the cookies on the request
+  var cookies = cookie.parse(req.headers.cookie || '');
+
+  // Get the visitor name set in the cookie
+  var name = cookies.name;
+
+  res.setHeader('Content-Type', 'text/html; charset=UTF-8');
+
+  if (name) {
+    res.write('<p>Welcome back, <b>' + escapeHtml(name) + '</b>!</p>');
+  } else {
+    res.write('<p>Hello, new visitor!</p>');
+  }
+
+  res.write('<form method="GET">');
+  res.write('<input placeholder="enter your name" name="name"> <input type="submit" value="Set Name">');
+  res.end('</form');
+}
+
+http.createServer(onRequest).listen(3000);
+```
+
+## Testing
+
+```sh
+$ npm test
+```
+
+## References
+
+- [RFC 6266: HTTP State Management Mechanism][rfc-6266]
+- [Same-site Cookies][draft-west-first-party-cookies-07]
+
+[draft-west-first-party-cookies-07]: https://tools.ietf.org/html/draft-west-first-party-cookies-07
+[rfc-6266]: https://tools.ietf.org/html/rfc6266
+[rfc-6266-5.1.4]: https://tools.ietf.org/html/rfc6266#section-5.1.4
+[rfc-6266-5.2.1]: https://tools.ietf.org/html/rfc6266#section-5.2.1
+[rfc-6266-5.2.2]: https://tools.ietf.org/html/rfc6266#section-5.2.2
+[rfc-6266-5.2.3]: https://tools.ietf.org/html/rfc6266#section-5.2.3
+[rfc-6266-5.2.4]: https://tools.ietf.org/html/rfc6266#section-5.2.4
+[rfc-6266-5.3]: https://tools.ietf.org/html/rfc6266#section-5.3
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/cookie.svg
+[npm-url]: https://npmjs.org/package/cookie
+[node-version-image]: https://img.shields.io/node/v/cookie.svg
+[node-version-url]: https://nodejs.org/en/download
+[travis-image]: https://img.shields.io/travis/jshttp/cookie/master.svg
+[travis-url]: https://travis-ci.org/jshttp/cookie
+[coveralls-image]: https://img.shields.io/coveralls/jshttp/cookie/master.svg
+[coveralls-url]: https://coveralls.io/r/jshttp/cookie?branch=master
+[downloads-image]: https://img.shields.io/npm/dm/cookie.svg
+[downloads-url]: https://npmjs.org/package/cookie
diff --git a/wrt/node_modules/cookie/index.js b/wrt/node_modules/cookie/index.js
new file mode 100644 (file)
index 0000000..ab2e467
--- /dev/null
@@ -0,0 +1,195 @@
+/*!
+ * cookie
+ * Copyright(c) 2012-2014 Roman Shtylman
+ * Copyright(c) 2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict';
+
+/**
+ * Module exports.
+ * @public
+ */
+
+exports.parse = parse;
+exports.serialize = serialize;
+
+/**
+ * Module variables.
+ * @private
+ */
+
+var decode = decodeURIComponent;
+var encode = encodeURIComponent;
+var pairSplitRegExp = /; */;
+
+/**
+ * RegExp to match field-content in RFC 7230 sec 3.2
+ *
+ * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]
+ * field-vchar   = VCHAR / obs-text
+ * obs-text      = %x80-FF
+ */
+
+var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
+
+/**
+ * Parse a cookie header.
+ *
+ * Parse the given cookie header string into an object
+ * The object has the various cookies as keys(names) => values
+ *
+ * @param {string} str
+ * @param {object} [options]
+ * @return {object}
+ * @public
+ */
+
+function parse(str, options) {
+  if (typeof str !== 'string') {
+    throw new TypeError('argument str must be a string');
+  }
+
+  var obj = {}
+  var opt = options || {};
+  var pairs = str.split(pairSplitRegExp);
+  var dec = opt.decode || decode;
+
+  for (var i = 0; i < pairs.length; i++) {
+    var pair = pairs[i];
+    var eq_idx = pair.indexOf('=');
+
+    // skip things that don't look like key=value
+    if (eq_idx < 0) {
+      continue;
+    }
+
+    var key = pair.substr(0, eq_idx).trim()
+    var val = pair.substr(++eq_idx, pair.length).trim();
+
+    // quoted values
+    if ('"' == val[0]) {
+      val = val.slice(1, -1);
+    }
+
+    // only assign once
+    if (undefined == obj[key]) {
+      obj[key] = tryDecode(val, dec);
+    }
+  }
+
+  return obj;
+}
+
+/**
+ * Serialize data into a cookie header.
+ *
+ * Serialize the a name value pair into a cookie string suitable for
+ * http headers. An optional options object specified cookie parameters.
+ *
+ * serialize('foo', 'bar', { httpOnly: true })
+ *   => "foo=bar; httpOnly"
+ *
+ * @param {string} name
+ * @param {string} val
+ * @param {object} [options]
+ * @return {string}
+ * @public
+ */
+
+function serialize(name, val, options) {
+  var opt = options || {};
+  var enc = opt.encode || encode;
+
+  if (typeof enc !== 'function') {
+    throw new TypeError('option encode is invalid');
+  }
+
+  if (!fieldContentRegExp.test(name)) {
+    throw new TypeError('argument name is invalid');
+  }
+
+  var value = enc(val);
+
+  if (value && !fieldContentRegExp.test(value)) {
+    throw new TypeError('argument val is invalid');
+  }
+
+  var str = name + '=' + value;
+
+  if (null != opt.maxAge) {
+    var maxAge = opt.maxAge - 0;
+    if (isNaN(maxAge)) throw new Error('maxAge should be a Number');
+    str += '; Max-Age=' + Math.floor(maxAge);
+  }
+
+  if (opt.domain) {
+    if (!fieldContentRegExp.test(opt.domain)) {
+      throw new TypeError('option domain is invalid');
+    }
+
+    str += '; Domain=' + opt.domain;
+  }
+
+  if (opt.path) {
+    if (!fieldContentRegExp.test(opt.path)) {
+      throw new TypeError('option path is invalid');
+    }
+
+    str += '; Path=' + opt.path;
+  }
+
+  if (opt.expires) {
+    if (typeof opt.expires.toUTCString !== 'function') {
+      throw new TypeError('option expires is invalid');
+    }
+
+    str += '; Expires=' + opt.expires.toUTCString();
+  }
+
+  if (opt.httpOnly) {
+    str += '; HttpOnly';
+  }
+
+  if (opt.secure) {
+    str += '; Secure';
+  }
+
+  if (opt.sameSite) {
+    var sameSite = typeof opt.sameSite === 'string'
+      ? opt.sameSite.toLowerCase() : opt.sameSite;
+
+    switch (sameSite) {
+      case true:
+        str += '; SameSite=Strict';
+        break;
+      case 'lax':
+        str += '; SameSite=Lax';
+        break;
+      case 'strict':
+        str += '; SameSite=Strict';
+        break;
+      default:
+        throw new TypeError('option sameSite is invalid');
+    }
+  }
+
+  return str;
+}
+
+/**
+ * Try decoding a string using a decoding function.
+ *
+ * @param {string} str
+ * @param {function} decode
+ * @private
+ */
+
+function tryDecode(str, decode) {
+  try {
+    return decode(str);
+  } catch (e) {
+    return str;
+  }
+}
diff --git a/wrt/node_modules/cookie/package.json b/wrt/node_modules/cookie/package.json
new file mode 100644 (file)
index 0000000..90d2170
--- /dev/null
@@ -0,0 +1,106 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "cookie@0.3.1",
+        "scope": null,
+        "escapedName": "cookie",
+        "name": "cookie",
+        "rawSpec": "0.3.1",
+        "spec": "0.3.1",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io"
+    ]
+  ],
+  "_from": "cookie@0.3.1",
+  "_id": "cookie@0.3.1",
+  "_inCache": true,
+  "_location": "/cookie",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/cookie-0.3.1.tgz_1464323556714_0.6435900838114321"
+  },
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "1.4.28",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "cookie@0.3.1",
+    "scope": null,
+    "escapedName": "cookie",
+    "name": "cookie",
+    "rawSpec": "0.3.1",
+    "spec": "0.3.1",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/engine.io"
+  ],
+  "_resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz",
+  "_shasum": "e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb",
+  "_shrinkwrap": null,
+  "_spec": "cookie@0.3.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io",
+  "author": {
+    "name": "Roman Shtylman",
+    "email": "shtylman@gmail.com"
+  },
+  "bugs": {
+    "url": "https://github.com/jshttp/cookie/issues"
+  },
+  "contributors": [
+    {
+      "name": "Douglas Christopher Wilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "dependencies": {},
+  "description": "HTTP server cookie parsing and serialization",
+  "devDependencies": {
+    "istanbul": "0.4.3",
+    "mocha": "1.21.5"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb",
+    "tarball": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz"
+  },
+  "engines": {
+    "node": ">= 0.6"
+  },
+  "files": [
+    "HISTORY.md",
+    "LICENSE",
+    "README.md",
+    "index.js"
+  ],
+  "gitHead": "e3c77d497d66c8b8d4b677b8954c1b192a09f0b3",
+  "homepage": "https://github.com/jshttp/cookie",
+  "keywords": [
+    "cookie",
+    "cookies"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "name": "cookie",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/jshttp/cookie.git"
+  },
+  "scripts": {
+    "test": "mocha --reporter spec --bail --check-leaks test/",
+    "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/"
+  },
+  "version": "0.3.1"
+}
diff --git a/wrt/node_modules/core-util-is/LICENSE b/wrt/node_modules/core-util-is/LICENSE
new file mode 100644 (file)
index 0000000..d8d7f94
--- /dev/null
@@ -0,0 +1,19 @@
+Copyright Node.js contributors. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
diff --git a/wrt/node_modules/core-util-is/README.md b/wrt/node_modules/core-util-is/README.md
new file mode 100644 (file)
index 0000000..5a76b41
--- /dev/null
@@ -0,0 +1,3 @@
+# core-util-is
+
+The `util.is*` functions introduced in Node v0.12.
diff --git a/wrt/node_modules/core-util-is/float.patch b/wrt/node_modules/core-util-is/float.patch
new file mode 100644 (file)
index 0000000..a06d5c0
--- /dev/null
@@ -0,0 +1,604 @@
+diff --git a/lib/util.js b/lib/util.js
+index a03e874..9074e8e 100644
+--- a/lib/util.js
++++ b/lib/util.js
+@@ -19,430 +19,6 @@
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+-var formatRegExp = /%[sdj%]/g;
+-exports.format = function(f) {
+-  if (!isString(f)) {
+-    var objects = [];
+-    for (var i = 0; i < arguments.length; i++) {
+-      objects.push(inspect(arguments[i]));
+-    }
+-    return objects.join(' ');
+-  }
+-
+-  var i = 1;
+-  var args = arguments;
+-  var len = args.length;
+-  var str = String(f).replace(formatRegExp, function(x) {
+-    if (x === '%%') return '%';
+-    if (i >= len) return x;
+-    switch (x) {
+-      case '%s': return String(args[i++]);
+-      case '%d': return Number(args[i++]);
+-      case '%j':
+-        try {
+-          return JSON.stringify(args[i++]);
+-        } catch (_) {
+-          return '[Circular]';
+-        }
+-      default:
+-        return x;
+-    }
+-  });
+-  for (var x = args[i]; i < len; x = args[++i]) {
+-    if (isNull(x) || !isObject(x)) {
+-      str += ' ' + x;
+-    } else {
+-      str += ' ' + inspect(x);
+-    }
+-  }
+-  return str;
+-};
+-
+-
+-// Mark that a method should not be used.
+-// Returns a modified function which warns once by default.
+-// If --no-deprecation is set, then it is a no-op.
+-exports.deprecate = function(fn, msg) {
+-  // Allow for deprecating things in the process of starting up.
+-  if (isUndefined(global.process)) {
+-    return function() {
+-      return exports.deprecate(fn, msg).apply(this, arguments);
+-    };
+-  }
+-
+-  if (process.noDeprecation === true) {
+-    return fn;
+-  }
+-
+-  var warned = false;
+-  function deprecated() {
+-    if (!warned) {
+-      if (process.throwDeprecation) {
+-        throw new Error(msg);
+-      } else if (process.traceDeprecation) {
+-        console.trace(msg);
+-      } else {
+-        console.error(msg);
+-      }
+-      warned = true;
+-    }
+-    return fn.apply(this, arguments);
+-  }
+-
+-  return deprecated;
+-};
+-
+-
+-var debugs = {};
+-var debugEnviron;
+-exports.debuglog = function(set) {
+-  if (isUndefined(debugEnviron))
+-    debugEnviron = process.env.NODE_DEBUG || '';
+-  set = set.toUpperCase();
+-  if (!debugs[set]) {
+-    if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
+-      var pid = process.pid;
+-      debugs[set] = function() {
+-        var msg = exports.format.apply(exports, arguments);
+-        console.error('%s %d: %s', set, pid, msg);
+-      };
+-    } else {
+-      debugs[set] = function() {};
+-    }
+-  }
+-  return debugs[set];
+-};
+-
+-
+-/**
+- * Echos the value of a value. Trys to print the value out
+- * in the best way possible given the different types.
+- *
+- * @param {Object} obj The object to print out.
+- * @param {Object} opts Optional options object that alters the output.
+- */
+-/* legacy: obj, showHidden, depth, colors*/
+-function inspect(obj, opts) {
+-  // default options
+-  var ctx = {
+-    seen: [],
+-    stylize: stylizeNoColor
+-  };
+-  // legacy...
+-  if (arguments.length >= 3) ctx.depth = arguments[2];
+-  if (arguments.length >= 4) ctx.colors = arguments[3];
+-  if (isBoolean(opts)) {
+-    // legacy...
+-    ctx.showHidden = opts;
+-  } else if (opts) {
+-    // got an "options" object
+-    exports._extend(ctx, opts);
+-  }
+-  // set default options
+-  if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
+-  if (isUndefined(ctx.depth)) ctx.depth = 2;
+-  if (isUndefined(ctx.colors)) ctx.colors = false;
+-  if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
+-  if (ctx.colors) ctx.stylize = stylizeWithColor;
+-  return formatValue(ctx, obj, ctx.depth);
+-}
+-exports.inspect = inspect;
+-
+-
+-// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
+-inspect.colors = {
+-  'bold' : [1, 22],
+-  'italic' : [3, 23],
+-  'underline' : [4, 24],
+-  'inverse' : [7, 27],
+-  'white' : [37, 39],
+-  'grey' : [90, 39],
+-  'black' : [30, 39],
+-  'blue' : [34, 39],
+-  'cyan' : [36, 39],
+-  'green' : [32, 39],
+-  'magenta' : [35, 39],
+-  'red' : [31, 39],
+-  'yellow' : [33, 39]
+-};
+-
+-// Don't use 'blue' not visible on cmd.exe
+-inspect.styles = {
+-  'special': 'cyan',
+-  'number': 'yellow',
+-  'boolean': 'yellow',
+-  'undefined': 'grey',
+-  'null': 'bold',
+-  'string': 'green',
+-  'date': 'magenta',
+-  // "name": intentionally not styling
+-  'regexp': 'red'
+-};
+-
+-
+-function stylizeWithColor(str, styleType) {
+-  var style = inspect.styles[styleType];
+-
+-  if (style) {
+-    return '\u001b[' + inspect.colors[style][0] + 'm' + str +
+-           '\u001b[' + inspect.colors[style][1] + 'm';
+-  } else {
+-    return str;
+-  }
+-}
+-
+-
+-function stylizeNoColor(str, styleType) {
+-  return str;
+-}
+-
+-
+-function arrayToHash(array) {
+-  var hash = {};
+-
+-  array.forEach(function(val, idx) {
+-    hash[val] = true;
+-  });
+-
+-  return hash;
+-}
+-
+-
+-function formatValue(ctx, value, recurseTimes) {
+-  // Provide a hook for user-specified inspect functions.
+-  // Check that value is an object with an inspect function on it
+-  if (ctx.customInspect &&
+-      value &&
+-      isFunction(value.inspect) &&
+-      // Filter out the util module, it's inspect function is special
+-      value.inspect !== exports.inspect &&
+-      // Also filter out any prototype objects using the circular check.
+-      !(value.constructor && value.constructor.prototype === value)) {
+-    var ret = value.inspect(recurseTimes, ctx);
+-    if (!isString(ret)) {
+-      ret = formatValue(ctx, ret, recurseTimes);
+-    }
+-    return ret;
+-  }
+-
+-  // Primitive types cannot have properties
+-  var primitive = formatPrimitive(ctx, value);
+-  if (primitive) {
+-    return primitive;
+-  }
+-
+-  // Look up the keys of the object.
+-  var keys = Object.keys(value);
+-  var visibleKeys = arrayToHash(keys);
+-
+-  if (ctx.showHidden) {
+-    keys = Object.getOwnPropertyNames(value);
+-  }
+-
+-  // Some type of object without properties can be shortcutted.
+-  if (keys.length === 0) {
+-    if (isFunction(value)) {
+-      var name = value.name ? ': ' + value.name : '';
+-      return ctx.stylize('[Function' + name + ']', 'special');
+-    }
+-    if (isRegExp(value)) {
+-      return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
+-    }
+-    if (isDate(value)) {
+-      return ctx.stylize(Date.prototype.toString.call(value), 'date');
+-    }
+-    if (isError(value)) {
+-      return formatError(value);
+-    }
+-  }
+-
+-  var base = '', array = false, braces = ['{', '}'];
+-
+-  // Make Array say that they are Array
+-  if (isArray(value)) {
+-    array = true;
+-    braces = ['[', ']'];
+-  }
+-
+-  // Make functions say that they are functions
+-  if (isFunction(value)) {
+-    var n = value.name ? ': ' + value.name : '';
+-    base = ' [Function' + n + ']';
+-  }
+-
+-  // Make RegExps say that they are RegExps
+-  if (isRegExp(value)) {
+-    base = ' ' + RegExp.prototype.toString.call(value);
+-  }
+-
+-  // Make dates with properties first say the date
+-  if (isDate(value)) {
+-    base = ' ' + Date.prototype.toUTCString.call(value);
+-  }
+-
+-  // Make error with message first say the error
+-  if (isError(value)) {
+-    base = ' ' + formatError(value);
+-  }
+-
+-  if (keys.length === 0 && (!array || value.length == 0)) {
+-    return braces[0] + base + braces[1];
+-  }
+-
+-  if (recurseTimes < 0) {
+-    if (isRegExp(value)) {
+-      return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
+-    } else {
+-      return ctx.stylize('[Object]', 'special');
+-    }
+-  }
+-
+-  ctx.seen.push(value);
+-
+-  var output;
+-  if (array) {
+-    output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
+-  } else {
+-    output = keys.map(function(key) {
+-      return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
+-    });
+-  }
+-
+-  ctx.seen.pop();
+-
+-  return reduceToSingleString(output, base, braces);
+-}
+-
+-
+-function formatPrimitive(ctx, value) {
+-  if (isUndefined(value))
+-    return ctx.stylize('undefined', 'undefined');
+-  if (isString(value)) {
+-    var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
+-                                             .replace(/'/g, "\\'")
+-                                             .replace(/\\"/g, '"') + '\'';
+-    return ctx.stylize(simple, 'string');
+-  }
+-  if (isNumber(value)) {
+-    // Format -0 as '-0'. Strict equality won't distinguish 0 from -0,
+-    // so instead we use the fact that 1 / -0 < 0 whereas 1 / 0 > 0 .
+-    if (value === 0 && 1 / value < 0)
+-      return ctx.stylize('-0', 'number');
+-    return ctx.stylize('' + value, 'number');
+-  }
+-  if (isBoolean(value))
+-    return ctx.stylize('' + value, 'boolean');
+-  // For some reason typeof null is "object", so special case here.
+-  if (isNull(value))
+-    return ctx.stylize('null', 'null');
+-}
+-
+-
+-function formatError(value) {
+-  return '[' + Error.prototype.toString.call(value) + ']';
+-}
+-
+-
+-function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
+-  var output = [];
+-  for (var i = 0, l = value.length; i < l; ++i) {
+-    if (hasOwnProperty(value, String(i))) {
+-      output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
+-          String(i), true));
+-    } else {
+-      output.push('');
+-    }
+-  }
+-  keys.forEach(function(key) {
+-    if (!key.match(/^\d+$/)) {
+-      output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
+-          key, true));
+-    }
+-  });
+-  return output;
+-}
+-
+-
+-function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
+-  var name, str, desc;
+-  desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
+-  if (desc.get) {
+-    if (desc.set) {
+-      str = ctx.stylize('[Getter/Setter]', 'special');
+-    } else {
+-      str = ctx.stylize('[Getter]', 'special');
+-    }
+-  } else {
+-    if (desc.set) {
+-      str = ctx.stylize('[Setter]', 'special');
+-    }
+-  }
+-  if (!hasOwnProperty(visibleKeys, key)) {
+-    name = '[' + key + ']';
+-  }
+-  if (!str) {
+-    if (ctx.seen.indexOf(desc.value) < 0) {
+-      if (isNull(recurseTimes)) {
+-        str = formatValue(ctx, desc.value, null);
+-      } else {
+-        str = formatValue(ctx, desc.value, recurseTimes - 1);
+-      }
+-      if (str.indexOf('\n') > -1) {
+-        if (array) {
+-          str = str.split('\n').map(function(line) {
+-            return '  ' + line;
+-          }).join('\n').substr(2);
+-        } else {
+-          str = '\n' + str.split('\n').map(function(line) {
+-            return '   ' + line;
+-          }).join('\n');
+-        }
+-      }
+-    } else {
+-      str = ctx.stylize('[Circular]', 'special');
+-    }
+-  }
+-  if (isUndefined(name)) {
+-    if (array && key.match(/^\d+$/)) {
+-      return str;
+-    }
+-    name = JSON.stringify('' + key);
+-    if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
+-      name = name.substr(1, name.length - 2);
+-      name = ctx.stylize(name, 'name');
+-    } else {
+-      name = name.replace(/'/g, "\\'")
+-                 .replace(/\\"/g, '"')
+-                 .replace(/(^"|"$)/g, "'");
+-      name = ctx.stylize(name, 'string');
+-    }
+-  }
+-
+-  return name + ': ' + str;
+-}
+-
+-
+-function reduceToSingleString(output, base, braces) {
+-  var numLinesEst = 0;
+-  var length = output.reduce(function(prev, cur) {
+-    numLinesEst++;
+-    if (cur.indexOf('\n') >= 0) numLinesEst++;
+-    return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
+-  }, 0);
+-
+-  if (length > 60) {
+-    return braces[0] +
+-           (base === '' ? '' : base + '\n ') +
+-           ' ' +
+-           output.join(',\n  ') +
+-           ' ' +
+-           braces[1];
+-  }
+-
+-  return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
+-}
+-
+-
+ // NOTE: These type checking functions intentionally don't use `instanceof`
+ // because it is fragile and can be easily faked with `Object.create()`.
+ function isArray(ar) {
+@@ -522,166 +98,10 @@ function isPrimitive(arg) {
+ exports.isPrimitive = isPrimitive;
+
+ function isBuffer(arg) {
+-  return arg instanceof Buffer;
++  return Buffer.isBuffer(arg);
+ }
+ exports.isBuffer = isBuffer;
+
+ function objectToString(o) {
+   return Object.prototype.toString.call(o);
+-}
+-
+-
+-function pad(n) {
+-  return n < 10 ? '0' + n.toString(10) : n.toString(10);
+-}
+-
+-
+-var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
+-              'Oct', 'Nov', 'Dec'];
+-
+-// 26 Feb 16:19:34
+-function timestamp() {
+-  var d = new Date();
+-  var time = [pad(d.getHours()),
+-              pad(d.getMinutes()),
+-              pad(d.getSeconds())].join(':');
+-  return [d.getDate(), months[d.getMonth()], time].join(' ');
+-}
+-
+-
+-// log is just a thin wrapper to console.log that prepends a timestamp
+-exports.log = function() {
+-  console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
+-};
+-
+-
+-/**
+- * Inherit the prototype methods from one constructor into another.
+- *
+- * The Function.prototype.inherits from lang.js rewritten as a standalone
+- * function (not on Function.prototype). NOTE: If this file is to be loaded
+- * during bootstrapping this function needs to be rewritten using some native
+- * functions as prototype setup using normal JavaScript does not work as
+- * expected during bootstrapping (see mirror.js in r114903).
+- *
+- * @param {function} ctor Constructor function which needs to inherit the
+- *     prototype.
+- * @param {function} superCtor Constructor function to inherit prototype from.
+- */
+-exports.inherits = function(ctor, superCtor) {
+-  ctor.super_ = superCtor;
+-  ctor.prototype = Object.create(superCtor.prototype, {
+-    constructor: {
+-      value: ctor,
+-      enumerable: false,
+-      writable: true,
+-      configurable: true
+-    }
+-  });
+-};
+-
+-exports._extend = function(origin, add) {
+-  // Don't do anything if add isn't an object
+-  if (!add || !isObject(add)) return origin;
+-
+-  var keys = Object.keys(add);
+-  var i = keys.length;
+-  while (i--) {
+-    origin[keys[i]] = add[keys[i]];
+-  }
+-  return origin;
+-};
+-
+-function hasOwnProperty(obj, prop) {
+-  return Object.prototype.hasOwnProperty.call(obj, prop);
+-}
+-
+-
+-// Deprecated old stuff.
+-
+-exports.p = exports.deprecate(function() {
+-  for (var i = 0, len = arguments.length; i < len; ++i) {
+-    console.error(exports.inspect(arguments[i]));
+-  }
+-}, 'util.p: Use console.error() instead');
+-
+-
+-exports.exec = exports.deprecate(function() {
+-  return require('child_process').exec.apply(this, arguments);
+-}, 'util.exec is now called `child_process.exec`.');
+-
+-
+-exports.print = exports.deprecate(function() {
+-  for (var i = 0, len = arguments.length; i < len; ++i) {
+-    process.stdout.write(String(arguments[i]));
+-  }
+-}, 'util.print: Use console.log instead');
+-
+-
+-exports.puts = exports.deprecate(function() {
+-  for (var i = 0, len = arguments.length; i < len; ++i) {
+-    process.stdout.write(arguments[i] + '\n');
+-  }
+-}, 'util.puts: Use console.log instead');
+-
+-
+-exports.debug = exports.deprecate(function(x) {
+-  process.stderr.write('DEBUG: ' + x + '\n');
+-}, 'util.debug: Use console.error instead');
+-
+-
+-exports.error = exports.deprecate(function(x) {
+-  for (var i = 0, len = arguments.length; i < len; ++i) {
+-    process.stderr.write(arguments[i] + '\n');
+-  }
+-}, 'util.error: Use console.error instead');
+-
+-
+-exports.pump = exports.deprecate(function(readStream, writeStream, callback) {
+-  var callbackCalled = false;
+-
+-  function call(a, b, c) {
+-    if (callback && !callbackCalled) {
+-      callback(a, b, c);
+-      callbackCalled = true;
+-    }
+-  }
+-
+-  readStream.addListener('data', function(chunk) {
+-    if (writeStream.write(chunk) === false) readStream.pause();
+-  });
+-
+-  writeStream.addListener('drain', function() {
+-    readStream.resume();
+-  });
+-
+-  readStream.addListener('end', function() {
+-    writeStream.end();
+-  });
+-
+-  readStream.addListener('close', function() {
+-    call();
+-  });
+-
+-  readStream.addListener('error', function(err) {
+-    writeStream.end();
+-    call(err);
+-  });
+-
+-  writeStream.addListener('error', function(err) {
+-    readStream.destroy();
+-    call(err);
+-  });
+-}, 'util.pump(): Use readableStream.pipe() instead');
+-
+-
+-var uv;
+-exports._errnoException = function(err, syscall) {
+-  if (isUndefined(uv)) uv = process.binding('uv');
+-  var errname = uv.errname(err);
+-  var e = new Error(syscall + ' ' + errname);
+-  e.code = errname;
+-  e.errno = errname;
+-  e.syscall = syscall;
+-  return e;
+-};
++}
\ No newline at end of file
diff --git a/wrt/node_modules/core-util-is/lib/util.js b/wrt/node_modules/core-util-is/lib/util.js
new file mode 100644 (file)
index 0000000..ff4c851
--- /dev/null
@@ -0,0 +1,107 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// NOTE: These type checking functions intentionally don't use `instanceof`
+// because it is fragile and can be easily faked with `Object.create()`.
+
+function isArray(arg) {
+  if (Array.isArray) {
+    return Array.isArray(arg);
+  }
+  return objectToString(arg) === '[object Array]';
+}
+exports.isArray = isArray;
+
+function isBoolean(arg) {
+  return typeof arg === 'boolean';
+}
+exports.isBoolean = isBoolean;
+
+function isNull(arg) {
+  return arg === null;
+}
+exports.isNull = isNull;
+
+function isNullOrUndefined(arg) {
+  return arg == null;
+}
+exports.isNullOrUndefined = isNullOrUndefined;
+
+function isNumber(arg) {
+  return typeof arg === 'number';
+}
+exports.isNumber = isNumber;
+
+function isString(arg) {
+  return typeof arg === 'string';
+}
+exports.isString = isString;
+
+function isSymbol(arg) {
+  return typeof arg === 'symbol';
+}
+exports.isSymbol = isSymbol;
+
+function isUndefined(arg) {
+  return arg === void 0;
+}
+exports.isUndefined = isUndefined;
+
+function isRegExp(re) {
+  return objectToString(re) === '[object RegExp]';
+}
+exports.isRegExp = isRegExp;
+
+function isObject(arg) {
+  return typeof arg === 'object' && arg !== null;
+}
+exports.isObject = isObject;
+
+function isDate(d) {
+  return objectToString(d) === '[object Date]';
+}
+exports.isDate = isDate;
+
+function isError(e) {
+  return (objectToString(e) === '[object Error]' || e instanceof Error);
+}
+exports.isError = isError;
+
+function isFunction(arg) {
+  return typeof arg === 'function';
+}
+exports.isFunction = isFunction;
+
+function isPrimitive(arg) {
+  return arg === null ||
+         typeof arg === 'boolean' ||
+         typeof arg === 'number' ||
+         typeof arg === 'string' ||
+         typeof arg === 'symbol' ||  // ES6 symbol
+         typeof arg === 'undefined';
+}
+exports.isPrimitive = isPrimitive;
+
+exports.isBuffer = Buffer.isBuffer;
+
+function objectToString(o) {
+  return Object.prototype.toString.call(o);
+}
diff --git a/wrt/node_modules/core-util-is/package.json b/wrt/node_modules/core-util-is/package.json
new file mode 100644 (file)
index 0000000..d1e0eba
--- /dev/null
@@ -0,0 +1,94 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "core-util-is@~1.0.0",
+        "scope": null,
+        "escapedName": "core-util-is",
+        "name": "core-util-is",
+        "rawSpec": "~1.0.0",
+        "spec": ">=1.0.0 <1.1.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/readable-stream"
+    ]
+  ],
+  "_from": "core-util-is@>=1.0.0 <1.1.0",
+  "_id": "core-util-is@1.0.2",
+  "_inCache": true,
+  "_location": "/core-util-is",
+  "_nodeVersion": "4.0.0",
+  "_npmUser": {
+    "name": "isaacs",
+    "email": "i@izs.me"
+  },
+  "_npmVersion": "3.3.2",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "core-util-is@~1.0.0",
+    "scope": null,
+    "escapedName": "core-util-is",
+    "name": "core-util-is",
+    "rawSpec": "~1.0.0",
+    "spec": ">=1.0.0 <1.1.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/readable-stream"
+  ],
+  "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
+  "_shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7",
+  "_shrinkwrap": null,
+  "_spec": "core-util-is@~1.0.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/readable-stream",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bugs": {
+    "url": "https://github.com/isaacs/core-util-is/issues"
+  },
+  "dependencies": {},
+  "description": "The `util.is*` functions introduced in Node v0.12.",
+  "devDependencies": {
+    "tap": "^2.3.0"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7",
+    "tarball": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz"
+  },
+  "gitHead": "a177da234df5638b363ddc15fa324619a38577c8",
+  "homepage": "https://github.com/isaacs/core-util-is#readme",
+  "keywords": [
+    "util",
+    "isBuffer",
+    "isArray",
+    "isNumber",
+    "isString",
+    "isRegExp",
+    "isThis",
+    "isThat",
+    "polyfill"
+  ],
+  "license": "MIT",
+  "main": "lib/util.js",
+  "maintainers": [
+    {
+      "name": "isaacs",
+      "email": "i@izs.me"
+    }
+  ],
+  "name": "core-util-is",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/core-util-is.git"
+  },
+  "scripts": {
+    "test": "tap test.js"
+  },
+  "version": "1.0.2"
+}
diff --git a/wrt/node_modules/core-util-is/test.js b/wrt/node_modules/core-util-is/test.js
new file mode 100644 (file)
index 0000000..1a490c6
--- /dev/null
@@ -0,0 +1,68 @@
+var assert = require('tap');
+
+var t = require('./lib/util');
+
+assert.equal(t.isArray([]), true);
+assert.equal(t.isArray({}), false);
+
+assert.equal(t.isBoolean(null), false);
+assert.equal(t.isBoolean(true), true);
+assert.equal(t.isBoolean(false), true);
+
+assert.equal(t.isNull(null), true);
+assert.equal(t.isNull(undefined), false);
+assert.equal(t.isNull(false), false);
+assert.equal(t.isNull(), false);
+
+assert.equal(t.isNullOrUndefined(null), true);
+assert.equal(t.isNullOrUndefined(undefined), true);
+assert.equal(t.isNullOrUndefined(false), false);
+assert.equal(t.isNullOrUndefined(), true);
+
+assert.equal(t.isNumber(null), false);
+assert.equal(t.isNumber('1'), false);
+assert.equal(t.isNumber(1), true);
+
+assert.equal(t.isString(null), false);
+assert.equal(t.isString('1'), true);
+assert.equal(t.isString(1), false);
+
+assert.equal(t.isSymbol(null), false);
+assert.equal(t.isSymbol('1'), false);
+assert.equal(t.isSymbol(1), false);
+assert.equal(t.isSymbol(Symbol()), true);
+
+assert.equal(t.isUndefined(null), false);
+assert.equal(t.isUndefined(undefined), true);
+assert.equal(t.isUndefined(false), false);
+assert.equal(t.isUndefined(), true);
+
+assert.equal(t.isRegExp(null), false);
+assert.equal(t.isRegExp('1'), false);
+assert.equal(t.isRegExp(new RegExp()), true);
+
+assert.equal(t.isObject({}), true);
+assert.equal(t.isObject([]), true);
+assert.equal(t.isObject(new RegExp()), true);
+assert.equal(t.isObject(new Date()), true);
+
+assert.equal(t.isDate(null), false);
+assert.equal(t.isDate('1'), false);
+assert.equal(t.isDate(new Date()), true);
+
+assert.equal(t.isError(null), false);
+assert.equal(t.isError({ err: true }), false);
+assert.equal(t.isError(new Error()), true);
+
+assert.equal(t.isFunction(null), false);
+assert.equal(t.isFunction({ }), false);
+assert.equal(t.isFunction(function() {}), true);
+
+assert.equal(t.isPrimitive(null), true);
+assert.equal(t.isPrimitive(''), true);
+assert.equal(t.isPrimitive(0), true);
+assert.equal(t.isPrimitive(new Date()), false);
+
+assert.equal(t.isBuffer(null), false);
+assert.equal(t.isBuffer({}), false);
+assert.equal(t.isBuffer(new Buffer(0)), true);
diff --git a/wrt/node_modules/debug/.coveralls.yml b/wrt/node_modules/debug/.coveralls.yml
new file mode 100644 (file)
index 0000000..20a7068
--- /dev/null
@@ -0,0 +1 @@
+repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve
diff --git a/wrt/node_modules/debug/.eslintrc b/wrt/node_modules/debug/.eslintrc
new file mode 100644 (file)
index 0000000..146371e
--- /dev/null
@@ -0,0 +1,14 @@
+{
+  "env": {
+    "browser": true,
+    "node": true
+  },
+  "globals": {
+    "chrome": true
+  },
+  "rules": {
+    "no-console": 0,
+    "no-empty": [1, { "allowEmptyCatch": true }]
+  },
+  "extends": "eslint:recommended"
+}
diff --git a/wrt/node_modules/debug/.npmignore b/wrt/node_modules/debug/.npmignore
new file mode 100644 (file)
index 0000000..5f60eec
--- /dev/null
@@ -0,0 +1,9 @@
+support
+test
+examples
+example
+*.sock
+dist
+yarn.lock
+coverage
+bower.json
diff --git a/wrt/node_modules/debug/.travis.yml b/wrt/node_modules/debug/.travis.yml
new file mode 100644 (file)
index 0000000..a764300
--- /dev/null
@@ -0,0 +1,20 @@
+sudo: false
+
+language: node_js
+
+node_js:
+  - "4"
+  - "6"
+  - "8"
+
+install:
+  - make install
+
+script:
+  - make lint
+  - make test
+
+matrix:
+  include:
+  - node_js: '8'
+    env: BROWSER=1
diff --git a/wrt/node_modules/debug/CHANGELOG.md b/wrt/node_modules/debug/CHANGELOG.md
new file mode 100644 (file)
index 0000000..a1c0eaf
--- /dev/null
@@ -0,0 +1,378 @@
+
+3.0.1 / 2017-08-24
+==================
+
+  * Fix: Disable colors in Edge and Internet Explorer (#489)
+
+3.0.0 / 2017-08-08
+==================
+
+  * Breaking: Remove DEBUG_FD (#406)
+  * Breaking: Use `Date#toISOString()` instead to `Date#toUTCString()` when output is not a TTY (#418)
+  * Breaking: Make millisecond timer namespace specific and allow 'always enabled' output (#408)
+  * Addition: document `enabled` flag (#465)
+  * Addition: add 256 colors mode (#481)
+  * Addition: `enabled()` updates existing debug instances, add `destroy()` function (#440)
+  * Update: component: update "ms" to v2.0.0
+  * Update: separate the Node and Browser tests in Travis-CI
+  * Update: refactor Readme, fixed documentation, added "Namespace Colors" section, redid screenshots
+  * Update: separate Node.js and web browser examples for organization
+  * Update: update "browserify" to v14.4.0
+  * Fix: fix Readme typo (#473)
+
+2.6.8 / 2017-05-18
+==================
+
+  * Fix: Check for undefined on browser globals (#462, @marbemac)
+
+2.6.7 / 2017-05-16
+==================
+
+  * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom)
+  * Fix: Inline extend function in node implementation (#452, @dougwilson)
+  * Docs: Fix typo (#455, @msasad)
+
+2.6.5 / 2017-04-27
+==================
+  
+  * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek)
+  * Misc: clean up browser reference checks (#447, @thebigredgeek)
+  * Misc: add npm-debug.log to .gitignore (@thebigredgeek)
+
+
+2.6.4 / 2017-04-20
+==================
+
+  * Fix: bug that would occure if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo)
+  * Chore: ignore bower.json in npm installations. (#437, @joaovieira)
+  * Misc: update "ms" to v0.7.3 (@tootallnate)
+
+2.6.3 / 2017-03-13
+==================
+
+  * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts)
+  * Docs: Changelog fix (@thebigredgeek)
+
+2.6.2 / 2017-03-10
+==================
+
+  * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin)
+  * Docs: Add backers and sponsors from Open Collective (#422, @piamancini)
+  * Docs: Add Slackin invite badge (@tootallnate)
+
+2.6.1 / 2017-02-10
+==================
+
+  * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error
+  * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0)
+  * Fix: IE8 "Expected identifier" error (#414, @vgoma)
+  * Fix: Namespaces would not disable once enabled (#409, @musikov)
+
+2.6.0 / 2016-12-28
+==================
+
+  * Fix: added better null pointer checks for browser useColors (@thebigredgeek)
+  * Improvement: removed explicit `window.debug` export (#404, @tootallnate)
+  * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate)
+
+2.5.2 / 2016-12-25
+==================
+
+  * Fix: reference error on window within webworkers (#393, @KlausTrainer)
+  * Docs: fixed README typo (#391, @lurch)
+  * Docs: added notice about v3 api discussion (@thebigredgeek)
+
+2.5.1 / 2016-12-20
+==================
+
+  * Fix: babel-core compatibility
+
+2.5.0 / 2016-12-20
+==================
+
+  * Fix: wrong reference in bower file (@thebigredgeek)
+  * Fix: webworker compatibility (@thebigredgeek)
+  * Fix: output formatting issue (#388, @kribblo)
+  * Fix: babel-loader compatibility (#383, @escwald)
+  * Misc: removed built asset from repo and publications (@thebigredgeek)
+  * Misc: moved source files to /src (#378, @yamikuronue)
+  * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue)
+  * Test: coveralls integration (#378, @yamikuronue)
+  * Docs: simplified language in the opening paragraph (#373, @yamikuronue)
+
+2.4.5 / 2016-12-17
+==================
+
+  * Fix: `navigator` undefined in Rhino (#376, @jochenberger)
+  * Fix: custom log function (#379, @hsiliev)
+  * Improvement: bit of cleanup + linting fixes (@thebigredgeek)
+  * Improvement: rm non-maintainted `dist/` dir (#375, @freewil)
+  * Docs: simplified language in the opening paragraph. (#373, @yamikuronue)
+
+2.4.4 / 2016-12-14
+==================
+
+  * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts)
+
+2.4.3 / 2016-12-14
+==================
+
+  * Fix: navigation.userAgent error for react native (#364, @escwald)
+
+2.4.2 / 2016-12-14
+==================
+
+  * Fix: browser colors (#367, @tootallnate)
+  * Misc: travis ci integration (@thebigredgeek)
+  * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek)
+
+2.4.1 / 2016-12-13
+==================
+
+  * Fix: typo that broke the package (#356)
+
+2.4.0 / 2016-12-13
+==================
+
+  * Fix: bower.json references unbuilt src entry point (#342, @justmatt)
+  * Fix: revert "handle regex special characters" (@tootallnate)
+  * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate)
+  * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate)
+  * Improvement: allow colors in workers (#335, @botverse)
+  * Improvement: use same color for same namespace. (#338, @lchenay)
+
+2.3.3 / 2016-11-09
+==================
+
+  * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne)
+  * Fix: Returning `localStorage` saved values (#331, Levi Thomason)
+  * Improvement: Don't create an empty object when no `process` (Nathan Rajlich)
+
+2.3.2 / 2016-11-09
+==================
+
+  * Fix: be super-safe in index.js as well (@TooTallNate)
+  * Fix: should check whether process exists (Tom Newby)
+
+2.3.1 / 2016-11-09
+==================
+
+  * Fix: Added electron compatibility (#324, @paulcbetts)
+  * Improvement: Added performance optimizations (@tootallnate)
+  * Readme: Corrected PowerShell environment variable example (#252, @gimre)
+  * Misc: Removed yarn lock file from source control (#321, @fengmk2)
+
+2.3.0 / 2016-11-07
+==================
+
+  * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic)
+  * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos)
+  * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15)
+  * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran)
+  * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom)
+  * Package: Update "ms" to 0.7.2 (#315, @DevSide)
+  * Package: removed superfluous version property from bower.json (#207 @kkirsche)
+  * Readme: fix USE_COLORS to DEBUG_COLORS
+  * Readme: Doc fixes for format string sugar (#269, @mlucool)
+  * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0)
+  * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable)
+  * Readme: better docs for browser support (#224, @matthewmueller)
+  * Tooling: Added yarn integration for development (#317, @thebigredgeek)
+  * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek)
+  * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman)
+  * Misc: Updated contributors (@thebigredgeek)
+
+2.2.0 / 2015-05-09
+==================
+
+  * package: update "ms" to v0.7.1 (#202, @dougwilson)
+  * README: add logging to file example (#193, @DanielOchoa)
+  * README: fixed a typo (#191, @amir-s)
+  * browser: expose `storage` (#190, @stephenmathieson)
+  * Makefile: add a `distclean` target (#189, @stephenmathieson)
+
+2.1.3 / 2015-03-13
+==================
+
+  * Updated stdout/stderr example (#186)
+  * Updated example/stdout.js to match debug current behaviour
+  * Renamed example/stderr.js to stdout.js
+  * Update Readme.md (#184)
+  * replace high intensity foreground color for bold (#182, #183)
+
+2.1.2 / 2015-03-01
+==================
+
+  * dist: recompile
+  * update "ms" to v0.7.0
+  * package: update "browserify" to v9.0.3
+  * component: fix "ms.js" repo location
+  * changed bower package name
+  * updated documentation about using debug in a browser
+  * fix: security error on safari (#167, #168, @yields)
+
+2.1.1 / 2014-12-29
+==================
+
+  * browser: use `typeof` to check for `console` existence
+  * browser: check for `console.log` truthiness (fix IE 8/9)
+  * browser: add support for Chrome apps
+  * Readme: added Windows usage remarks
+  * Add `bower.json` to properly support bower install
+
+2.1.0 / 2014-10-15
+==================
+
+  * node: implement `DEBUG_FD` env variable support
+  * package: update "browserify" to v6.1.0
+  * package: add "license" field to package.json (#135, @panuhorsmalahti)
+
+2.0.0 / 2014-09-01
+==================
+
+  * package: update "browserify" to v5.11.0
+  * node: use stderr rather than stdout for logging (#29, @stephenmathieson)
+
+1.0.4 / 2014-07-15
+==================
+
+  * dist: recompile
+  * example: remove `console.info()` log usage
+  * example: add "Content-Type" UTF-8 header to browser example
+  * browser: place %c marker after the space character
+  * browser: reset the "content" color via `color: inherit`
+  * browser: add colors support for Firefox >= v31
+  * debug: prefer an instance `log()` function over the global one (#119)
+  * Readme: update documentation about styled console logs for FF v31 (#116, @wryk)
+
+1.0.3 / 2014-07-09
+==================
+
+  * Add support for multiple wildcards in namespaces (#122, @seegno)
+  * browser: fix lint
+
+1.0.2 / 2014-06-10
+==================
+
+  * browser: update color palette (#113, @gscottolson)
+  * common: make console logging function configurable (#108, @timoxley)
+  * node: fix %o colors on old node <= 0.8.x
+  * Makefile: find node path using shell/which (#109, @timoxley)
+
+1.0.1 / 2014-06-06
+==================
+
+  * browser: use `removeItem()` to clear localStorage
+  * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777)
+  * package: add "contributors" section
+  * node: fix comment typo
+  * README: list authors
+
+1.0.0 / 2014-06-04
+==================
+
+  * make ms diff be global, not be scope
+  * debug: ignore empty strings in enable()
+  * node: make DEBUG_COLORS able to disable coloring
+  * *: export the `colors` array
+  * npmignore: don't publish the `dist` dir
+  * Makefile: refactor to use browserify
+  * package: add "browserify" as a dev dependency
+  * Readme: add Web Inspector Colors section
+  * node: reset terminal color for the debug content
+  * node: map "%o" to `util.inspect()`
+  * browser: map "%j" to `JSON.stringify()`
+  * debug: add custom "formatters"
+  * debug: use "ms" module for humanizing the diff
+  * Readme: add "bash" syntax highlighting
+  * browser: add Firebug color support
+  * browser: add colors for WebKit browsers
+  * node: apply log to `console`
+  * rewrite: abstract common logic for Node & browsers
+  * add .jshintrc file
+
+0.8.1 / 2014-04-14
+==================
+
+  * package: re-add the "component" section
+
+0.8.0 / 2014-03-30
+==================
+
+  * add `enable()` method for nodejs. Closes #27
+  * change from stderr to stdout
+  * remove unnecessary index.js file
+
+0.7.4 / 2013-11-13
+==================
+
+  * remove "browserify" key from package.json (fixes something in browserify)
+
+0.7.3 / 2013-10-30
+==================
+
+  * fix: catch localStorage security error when cookies are blocked (Chrome)
+  * add debug(err) support. Closes #46
+  * add .browser prop to package.json. Closes #42
+
+0.7.2 / 2013-02-06
+==================
+
+  * fix package.json
+  * fix: Mobile Safari (private mode) is broken with debug
+  * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript
+
+0.7.1 / 2013-02-05
+==================
+
+  * add repository URL to package.json
+  * add DEBUG_COLORED to force colored output
+  * add browserify support
+  * fix component. Closes #24
+
+0.7.0 / 2012-05-04
+==================
+
+  * Added .component to package.json
+  * Added debug.component.js build
+
+0.6.0 / 2012-03-16
+==================
+
+  * Added support for "-" prefix in DEBUG [Vinay Pulim]
+  * Added `.enabled` flag to the node version [TooTallNate]
+
+0.5.0 / 2012-02-02
+==================
+
+  * Added: humanize diffs. Closes #8
+  * Added `debug.disable()` to the CS variant
+  * Removed padding. Closes #10
+  * Fixed: persist client-side variant again. Closes #9
+
+0.4.0 / 2012-02-01
+==================
+
+  * Added browser variant support for older browsers [TooTallNate]
+  * Added `debug.enable('project:*')` to browser variant [TooTallNate]
+  * Added padding to diff (moved it to the right)
+
+0.3.0 / 2012-01-26
+==================
+
+  * Added millisecond diff when isatty, otherwise UTC string
+
+0.2.0 / 2012-01-22
+==================
+
+  * Added wildcard support
+
+0.1.0 / 2011-12-02
+==================
+
+  * Added: remove colors unless stderr isatty [TooTallNate]
+
+0.0.1 / 2010-01-03
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/debug/LICENSE b/wrt/node_modules/debug/LICENSE
new file mode 100644 (file)
index 0000000..658c933
--- /dev/null
@@ -0,0 +1,19 @@
+(The MIT License)
+
+Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software 
+and associated documentation files (the 'Software'), to deal in the Software without restriction, 
+including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial 
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 
+LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/wrt/node_modules/debug/Makefile b/wrt/node_modules/debug/Makefile
new file mode 100644 (file)
index 0000000..3ddd136
--- /dev/null
@@ -0,0 +1,58 @@
+# get Makefile directory name: http://stackoverflow.com/a/5982798/376773
+THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
+THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)
+
+# BIN directory
+BIN := $(THIS_DIR)/node_modules/.bin
+
+# Path
+PATH := node_modules/.bin:$(PATH)
+SHELL := /bin/bash
+
+# applications
+NODE ?= $(shell which node)
+YARN ?= $(shell which yarn)
+PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm))
+BROWSERIFY ?= $(NODE) $(BIN)/browserify
+
+install: node_modules
+
+browser: dist/debug.js
+
+node_modules: package.json
+       @NODE_ENV= $(PKG) install
+       @touch node_modules
+
+dist/debug.js: src/*.js node_modules
+       @mkdir -p dist
+       @$(BROWSERIFY) \
+               --standalone debug \
+               . > dist/debug.js
+
+lint:
+       @eslint *.js src/*.js
+
+test-node:
+       @istanbul cover node_modules/mocha/bin/_mocha -- test/**.js
+       @cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
+
+test-browser:
+       @$(MAKE) browser
+       @karma start --single-run
+
+test-all:
+       @concurrently \
+               "make test-node" \
+               "make test-browser"
+
+test:
+       @if [ "x$(BROWSER)" = "x" ]; then \
+               $(MAKE) test-node; \
+               else \
+               $(MAKE) test-browser; \
+       fi
+
+clean:
+       rimraf dist coverage
+
+.PHONY: browser install clean lint test test-all test-node test-browser
diff --git a/wrt/node_modules/debug/README.md b/wrt/node_modules/debug/README.md
new file mode 100644 (file)
index 0000000..1f3b08e
--- /dev/null
@@ -0,0 +1,367 @@
+# debug
+[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug)  [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master)  [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) 
+[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors)
+
+<img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png">
+
+A tiny JavaScript debugging utility modelled after Node.js core's debugging
+technique. Works in Node.js and web browsers.
+
+## Installation
+
+```bash
+$ npm install debug
+```
+
+## Usage
+
+`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole.
+
+Example [_app.js_](./examples/node/app.js):
+
+```js
+var debug = require('debug')('http')
+  , http = require('http')
+  , name = 'My App';
+
+// fake app
+
+debug('booting %o', name);
+
+http.createServer(function(req, res){
+  debug(req.method + ' ' + req.url);
+  res.end('hello\n');
+}).listen(3000, function(){
+  debug('listening');
+});
+
+// fake worker of some kind
+
+require('./worker');
+```
+
+Example [_worker.js_](./examples/node/worker.js):
+
+```js
+var a = require('debug')('worker:a')
+  , b = require('debug')('worker:b');
+
+function work() {
+  a('doing lots of uninteresting work');
+  setTimeout(work, Math.random() * 1000);
+}
+
+work();
+
+function workb() {
+  b('doing some work');
+  setTimeout(workb, Math.random() * 2000);
+}
+
+workb();
+```
+
+The `DEBUG` environment variable is then used to enable these based on space or
+comma-delimited names.
+
+Here are some examples:
+
+<img width="647" alt="screen shot 2017-08-08 at 12 53 04 pm" src="https://user-images.githubusercontent.com/71256/29091703-a6302cdc-7c38-11e7-8304-7c0b3bc600cd.png">
+<img width="647" alt="screen shot 2017-08-08 at 12 53 38 pm" src="https://user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png">
+<img width="647" alt="screen shot 2017-08-08 at 12 53 25 pm" src="https://user-images.githubusercontent.com/71256/29091701-a62ea114-7c38-11e7-826a-2692bedca740.png">
+
+#### Windows note
+
+On Windows the environment variable is set using the `set` command.
+
+```cmd
+set DEBUG=*,-not_this
+```
+
+Note that PowerShell uses different syntax to set environment variables.
+
+```cmd
+$env:DEBUG = "*,-not_this"
+```
+
+Then, run the program to be debugged as usual.
+
+
+## Namespace Colors
+
+Every debug instance has a color generated for it based on its namespace name.
+This helps when visually parsing the debug output to identify which debug instance
+a debug line belongs to.
+
+#### Node.js
+
+In Node.js, colors are enabled when stderr is a TTY. You also _should_ install
+the [`supports-color`](https://npmjs.org/supports-color) module alongside debug,
+otherwise debug will only use a small handful of basic colors.
+
+<img width="521" src="https://user-images.githubusercontent.com/71256/29092181-47f6a9e6-7c3a-11e7-9a14-1928d8a711cd.png">
+
+#### Web Browser
+
+Colors are also enabled on "Web Inspectors" that understand the `%c` formatting
+option. These are WebKit web inspectors, Firefox ([since version
+31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))
+and the Firebug plugin for Firefox (any version).
+
+<img width="524" src="https://user-images.githubusercontent.com/71256/29092033-b65f9f2e-7c39-11e7-8e32-f6f0d8e865c1.png">
+
+
+## Millisecond diff
+
+When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.
+
+<img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png">
+
+When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below:
+
+<img width="647" src="https://user-images.githubusercontent.com/71256/29091956-6bd78372-7c39-11e7-8c55-c948396d6edd.png">
+
+
+## Conventions
+
+If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser".  If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable.  You can then use it for normal output as well as debug output.
+
+## Wildcards
+
+The `*` character may be used as a wildcard. Suppose for example your library has
+debuggers named "connect:bodyParser", "connect:compress", "connect:session",
+instead of listing all three with
+`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do
+`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.
+
+You can also exclude specific debuggers by prefixing them with a "-" character.
+For example, `DEBUG=*,-connect:*` would include all debuggers except those
+starting with "connect:".
+
+## Environment Variables
+
+When running through Node.js, you can set a few environment variables that will
+change the behavior of the debug logging:
+
+| Name      | Purpose                                         |
+|-----------|-------------------------------------------------|
+| `DEBUG`   | Enables/disables specific debugging namespaces. |
+| `DEBUG_COLORS`| Whether or not to use colors in the debug output. |
+| `DEBUG_DEPTH` | Object inspection depth. |
+| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. |
+
+
+__Note:__ The environment variables beginning with `DEBUG_` end up being
+converted into an Options object that gets used with `%o`/`%O` formatters.
+See the Node.js documentation for
+[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options)
+for the complete list.
+
+## Formatters
+
+Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting.
+Below are the officially supported formatters:
+
+| Formatter | Representation |
+|-----------|----------------|
+| `%O`      | Pretty-print an Object on multiple lines. |
+| `%o`      | Pretty-print an Object all on a single line. |
+| `%s`      | String. |
+| `%d`      | Number (both integer and float). |
+| `%j`      | JSON. Replaced with the string '[Circular]' if the argument contains circular references. |
+| `%%`      | Single percent sign ('%'). This does not consume an argument. |
+
+
+### Custom formatters
+
+You can add custom formatters by extending the `debug.formatters` object.
+For example, if you wanted to add support for rendering a Buffer as hex with
+`%h`, you could do something like:
+
+```js
+const createDebug = require('debug')
+createDebug.formatters.h = (v) => {
+  return v.toString('hex')
+}
+
+// …elsewhere
+const debug = createDebug('foo')
+debug('this is hex: %h', new Buffer('hello world'))
+//   foo this is hex: 68656c6c6f20776f726c6421 +0ms
+```
+
+
+## Browser Support
+
+You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify),
+or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest),
+if you don't want to build it yourself.
+
+Debug's enable state is currently persisted by `localStorage`.
+Consider the situation shown below where you have `worker:a` and `worker:b`,
+and wish to debug both. You can enable this using `localStorage.debug`:
+
+```js
+localStorage.debug = 'worker:*'
+```
+
+And then refresh the page.
+
+```js
+a = debug('worker:a');
+b = debug('worker:b');
+
+setInterval(function(){
+  a('doing some work');
+}, 1000);
+
+setInterval(function(){
+  b('doing some work');
+}, 1200);
+```
+
+
+## Output streams
+
+  By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method:
+
+Example [_stdout.js_](./examples/node/stdout.js):
+
+```js
+var debug = require('debug');
+var error = debug('app:error');
+
+// by default stderr is used
+error('goes to stderr!');
+
+var log = debug('app:log');
+// set this namespace to log via console.log
+log.log = console.log.bind(console); // don't forget to bind to console!
+log('goes to stdout');
+error('still goes to stderr!');
+
+// set all output to go via console.info
+// overrides all per-namespace log settings
+debug.log = console.info.bind(console);
+error('now goes to stdout via console.info');
+log('still goes to stdout, but via console.info now');
+```
+
+## Checking whether a debug target is enabled
+
+After you've created a debug instance, you can determine whether or not it is
+enabled by checking the `enabled` property:
+
+```javascript
+const debug = require('debug')('http');
+
+if (debug.enabled) {
+  // do stuff...
+}
+```
+
+You can also manually toggle this property to force the debug instance to be
+enabled or disabled.
+
+
+## Authors
+
+ - TJ Holowaychuk
+ - Nathan Rajlich
+ - Andrew Rhyne
+## Backers
+
+Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)]
+
+<a href="https://opencollective.com/debug/backer/0/website" target="_blank"><img src="https://opencollective.com/debug/backer/0/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/1/website" target="_blank"><img src="https://opencollective.com/debug/backer/1/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/2/website" target="_blank"><img src="https://opencollective.com/debug/backer/2/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/3/website" target="_blank"><img src="https://opencollective.com/debug/backer/3/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/4/website" target="_blank"><img src="https://opencollective.com/debug/backer/4/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/5/website" target="_blank"><img src="https://opencollective.com/debug/backer/5/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/6/website" target="_blank"><img src="https://opencollective.com/debug/backer/6/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/7/website" target="_blank"><img src="https://opencollective.com/debug/backer/7/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/8/website" target="_blank"><img src="https://opencollective.com/debug/backer/8/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/9/website" target="_blank"><img src="https://opencollective.com/debug/backer/9/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/10/website" target="_blank"><img src="https://opencollective.com/debug/backer/10/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/11/website" target="_blank"><img src="https://opencollective.com/debug/backer/11/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/12/website" target="_blank"><img src="https://opencollective.com/debug/backer/12/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/13/website" target="_blank"><img src="https://opencollective.com/debug/backer/13/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/14/website" target="_blank"><img src="https://opencollective.com/debug/backer/14/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/15/website" target="_blank"><img src="https://opencollective.com/debug/backer/15/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/16/website" target="_blank"><img src="https://opencollective.com/debug/backer/16/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/17/website" target="_blank"><img src="https://opencollective.com/debug/backer/17/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/18/website" target="_blank"><img src="https://opencollective.com/debug/backer/18/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/19/website" target="_blank"><img src="https://opencollective.com/debug/backer/19/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/20/website" target="_blank"><img src="https://opencollective.com/debug/backer/20/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/21/website" target="_blank"><img src="https://opencollective.com/debug/backer/21/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/22/website" target="_blank"><img src="https://opencollective.com/debug/backer/22/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/23/website" target="_blank"><img src="https://opencollective.com/debug/backer/23/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/24/website" target="_blank"><img src="https://opencollective.com/debug/backer/24/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/25/website" target="_blank"><img src="https://opencollective.com/debug/backer/25/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/26/website" target="_blank"><img src="https://opencollective.com/debug/backer/26/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/27/website" target="_blank"><img src="https://opencollective.com/debug/backer/27/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/28/website" target="_blank"><img src="https://opencollective.com/debug/backer/28/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/29/website" target="_blank"><img src="https://opencollective.com/debug/backer/29/avatar.svg"></a>
+
+
+## Sponsors
+
+Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)]
+
+<a href="https://opencollective.com/debug/sponsor/0/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/0/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/1/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/1/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/2/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/2/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/3/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/3/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/4/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/4/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/5/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/5/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/6/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/6/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/7/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/7/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/8/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/8/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/9/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/9/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/10/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/10/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/11/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/11/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/12/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/12/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/13/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/13/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/14/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/14/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/15/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/15/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/16/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/16/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/17/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/17/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/18/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/18/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/19/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/19/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/20/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/20/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/21/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/21/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/22/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/22/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/23/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/23/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/24/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/24/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/25/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/25/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/26/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/26/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/27/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/27/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/28/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/28/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/29/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/29/avatar.svg"></a>
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2014-2017 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/debug/component.json b/wrt/node_modules/debug/component.json
new file mode 100644 (file)
index 0000000..a2e9ad3
--- /dev/null
@@ -0,0 +1,19 @@
+{
+  "name": "debug",
+  "repo": "visionmedia/debug",
+  "description": "small debugging utility",
+  "version": "3.0.1",
+  "keywords": [
+    "debug",
+    "log",
+    "debugger"
+  ],
+  "main": "src/browser.js",
+  "scripts": [
+    "src/browser.js",
+    "src/debug.js"
+  ],
+  "dependencies": {
+    "rauchg/ms.js": "2.0.0"
+  }
+}
diff --git a/wrt/node_modules/debug/karma.conf.js b/wrt/node_modules/debug/karma.conf.js
new file mode 100644 (file)
index 0000000..103a82d
--- /dev/null
@@ -0,0 +1,70 @@
+// Karma configuration
+// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC)
+
+module.exports = function(config) {
+  config.set({
+
+    // base path that will be used to resolve all patterns (eg. files, exclude)
+    basePath: '',
+
+
+    // frameworks to use
+    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
+    frameworks: ['mocha', 'chai', 'sinon'],
+
+
+    // list of files / patterns to load in the browser
+    files: [
+      'dist/debug.js',
+      'test/*spec.js'
+    ],
+
+
+    // list of files to exclude
+    exclude: [
+      'src/node.js'
+    ],
+
+
+    // preprocess matching files before serving them to the browser
+    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
+    preprocessors: {
+    },
+
+    // test results reporter to use
+    // possible values: 'dots', 'progress'
+    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
+    reporters: ['progress'],
+
+
+    // web server port
+    port: 9876,
+
+
+    // enable / disable colors in the output (reporters and logs)
+    colors: true,
+
+
+    // level of logging
+    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
+    logLevel: config.LOG_INFO,
+
+
+    // enable / disable watching file and executing tests whenever any file changes
+    autoWatch: true,
+
+
+    // start these browsers
+    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
+    browsers: ['PhantomJS'],
+
+
+    // Continuous Integration mode
+    // if true, Karma captures browsers, runs the tests and exits
+    singleRun: false,
+
+    // Concurrency level
+    // how many browser should be started simultaneous
+    concurrency: Infinity
+  })
+}
diff --git a/wrt/node_modules/debug/node.js b/wrt/node_modules/debug/node.js
new file mode 100644 (file)
index 0000000..7fc36fe
--- /dev/null
@@ -0,0 +1 @@
+module.exports = require('./src/node');
diff --git a/wrt/node_modules/debug/package.json b/wrt/node_modules/debug/package.json
new file mode 100644 (file)
index 0000000..84e99a6
--- /dev/null
@@ -0,0 +1,136 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "debug",
+        "scope": null,
+        "escapedName": "debug",
+        "name": "debug",
+        "rawSpec": "",
+        "spec": "latest",
+        "type": "tag"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt"
+    ]
+  ],
+  "_from": "debug@latest",
+  "_id": "debug@3.0.1",
+  "_inCache": true,
+  "_location": "/debug",
+  "_nodeVersion": "8.4.0",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/debug-3.0.1.tgz_1503603871771_0.21796362148597836"
+  },
+  "_npmUser": {
+    "name": "tootallnate",
+    "email": "nathan@tootallnate.net"
+  },
+  "_npmVersion": "5.3.0",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "debug",
+    "scope": null,
+    "escapedName": "debug",
+    "name": "debug",
+    "rawSpec": "",
+    "spec": "latest",
+    "type": "tag"
+  },
+  "_requiredBy": [
+    "#USER"
+  ],
+  "_resolved": "https://registry.npmjs.org/debug/-/debug-3.0.1.tgz",
+  "_shasum": "0564c612b521dc92d9f2988f0549e34f9c98db64",
+  "_shrinkwrap": null,
+  "_spec": "debug",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt",
+  "author": {
+    "name": "TJ Holowaychuk",
+    "email": "tj@vision-media.ca"
+  },
+  "browser": "./src/browser.js",
+  "bugs": {
+    "url": "https://github.com/visionmedia/debug/issues"
+  },
+  "component": {
+    "scripts": {
+      "debug/index.js": "browser.js",
+      "debug/debug.js": "debug.js"
+    }
+  },
+  "contributors": [
+    {
+      "name": "Nathan Rajlich",
+      "email": "nathan@tootallnate.net",
+      "url": "http://n8.io"
+    },
+    {
+      "name": "Andrew Rhyne",
+      "email": "rhyneandrew@gmail.com"
+    }
+  ],
+  "dependencies": {
+    "ms": "2.0.0"
+  },
+  "description": "small debugging utility",
+  "devDependencies": {
+    "browserify": "14.4.0",
+    "chai": "^3.5.0",
+    "concurrently": "^3.1.0",
+    "coveralls": "^2.11.15",
+    "eslint": "^3.12.1",
+    "istanbul": "^0.4.5",
+    "karma": "^1.3.0",
+    "karma-chai": "^0.1.0",
+    "karma-mocha": "^1.3.0",
+    "karma-phantomjs-launcher": "^1.0.2",
+    "karma-sinon": "^1.0.5",
+    "mocha": "^3.2.0",
+    "mocha-lcov-reporter": "^1.2.0",
+    "rimraf": "^2.5.4",
+    "sinon": "^1.17.6",
+    "sinon-chai": "^2.8.0"
+  },
+  "directories": {},
+  "dist": {
+    "integrity": "sha512-6nVc6S36qbt/mutyt+UGMnawAMrPDZUPQjRZI3FS9tCtDRhvxJbK79unYBLPi+z5SLXQ3ftoVBFCblQtNSls8w==",
+    "shasum": "0564c612b521dc92d9f2988f0549e34f9c98db64",
+    "tarball": "https://registry.npmjs.org/debug/-/debug-3.0.1.tgz"
+  },
+  "gitHead": "3e1849d3aaa1b9a325ad6d054acf695fddb4efe9",
+  "homepage": "https://github.com/visionmedia/debug#readme",
+  "keywords": [
+    "debug",
+    "log",
+    "debugger"
+  ],
+  "license": "MIT",
+  "main": "./src/index.js",
+  "maintainers": [
+    {
+      "name": "thebigredgeek",
+      "email": "rhyneandrew@gmail.com"
+    },
+    {
+      "name": "kolban",
+      "email": "kolban1@kolban.com"
+    },
+    {
+      "name": "tootallnate",
+      "email": "nathan@tootallnate.net"
+    },
+    {
+      "name": "tjholowaychuk",
+      "email": "tj@vision-media.ca"
+    }
+  ],
+  "name": "debug",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/visionmedia/debug.git"
+  },
+  "version": "3.0.1"
+}
diff --git a/wrt/node_modules/debug/src/browser.js b/wrt/node_modules/debug/src/browser.js
new file mode 100644 (file)
index 0000000..f5149ff
--- /dev/null
@@ -0,0 +1,195 @@
+/**
+ * This is the web browser implementation of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = require('./debug');
+exports.log = log;
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+exports.storage = 'undefined' != typeof chrome
+               && 'undefined' != typeof chrome.storage
+                  ? chrome.storage.local
+                  : localstorage();
+
+/**
+ * Colors.
+ */
+
+exports.colors = [
+  '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC',
+  '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF',
+  '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC',
+  '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF',
+  '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC',
+  '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033',
+  '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366',
+  '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933',
+  '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC',
+  '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF',
+  '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'
+];
+
+/**
+ * Currently only WebKit-based Web Inspectors, Firefox >= v31,
+ * and the Firebug extension (any Firefox version) are known
+ * to support "%c" CSS customizations.
+ *
+ * TODO: add a `localStorage` variable to explicitly enable/disable colors
+ */
+
+function useColors() {
+  // NB: In an Electron preload script, document will be defined but not fully
+  // initialized. Since we know we're in Chrome, we'll just detect this case
+  // explicitly
+  if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
+    return true;
+  }
+
+  // Internet Explorer and Edge do not support colors.
+  if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
+    return false;
+  }
+
+  // is webkit? http://stackoverflow.com/a/16459606/376773
+  // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
+  return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
+    // is firebug? http://stackoverflow.com/a/398120/376773
+    (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
+    // is firefox >= v31?
+    // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
+    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
+    // double check webkit in userAgent just in case we are in a worker
+    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
+}
+
+/**
+ * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
+ */
+
+exports.formatters.j = function(v) {
+  try {
+    return JSON.stringify(v);
+  } catch (err) {
+    return '[UnexpectedJSONParseError]: ' + err.message;
+  }
+};
+
+
+/**
+ * Colorize log arguments if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+  var useColors = this.useColors;
+
+  args[0] = (useColors ? '%c' : '')
+    + this.namespace
+    + (useColors ? ' %c' : ' ')
+    + args[0]
+    + (useColors ? '%c ' : ' ')
+    + '+' + exports.humanize(this.diff);
+
+  if (!useColors) return;
+
+  var c = 'color: ' + this.color;
+  args.splice(1, 0, c, 'color: inherit')
+
+  // the final "%c" is somewhat tricky, because there could be other
+  // arguments passed either before or after the %c, so we need to
+  // figure out the correct index to insert the CSS into
+  var index = 0;
+  var lastC = 0;
+  args[0].replace(/%[a-zA-Z%]/g, function(match) {
+    if ('%%' === match) return;
+    index++;
+    if ('%c' === match) {
+      // we only are interested in the *last* %c
+      // (the user may have provided their own)
+      lastC = index;
+    }
+  });
+
+  args.splice(lastC, 0, c);
+}
+
+/**
+ * Invokes `console.log()` when available.
+ * No-op when `console.log` is not a "function".
+ *
+ * @api public
+ */
+
+function log() {
+  // this hackery is required for IE8/9, where
+  // the `console.log` function doesn't have 'apply'
+  return 'object' === typeof console
+    && console.log
+    && Function.prototype.apply.call(console.log, console, arguments);
+}
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+
+function save(namespaces) {
+  try {
+    if (null == namespaces) {
+      exports.storage.removeItem('debug');
+    } else {
+      exports.storage.debug = namespaces;
+    }
+  } catch(e) {}
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+
+function load() {
+  var r;
+  try {
+    r = exports.storage.debug;
+  } catch(e) {}
+
+  // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
+  if (!r && typeof process !== 'undefined' && 'env' in process) {
+    r = process.env.DEBUG;
+  }
+
+  return r;
+}
+
+/**
+ * Enable namespaces listed in `localStorage.debug` initially.
+ */
+
+exports.enable(load());
+
+/**
+ * Localstorage attempts to return the localstorage.
+ *
+ * This is necessary because safari throws
+ * when a user disables cookies/localstorage
+ * and you attempt to access it.
+ *
+ * @return {LocalStorage}
+ * @api private
+ */
+
+function localstorage() {
+  try {
+    return window.localStorage;
+  } catch (e) {}
+}
diff --git a/wrt/node_modules/debug/src/debug.js b/wrt/node_modules/debug/src/debug.js
new file mode 100644 (file)
index 0000000..77e6384
--- /dev/null
@@ -0,0 +1,225 @@
+
+/**
+ * This is the common logic for both the Node.js and web browser
+ * implementations of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
+exports.coerce = coerce;
+exports.disable = disable;
+exports.enable = enable;
+exports.enabled = enabled;
+exports.humanize = require('ms');
+
+/**
+ * Active `debug` instances.
+ */
+exports.instances = [];
+
+/**
+ * The currently active debug mode names, and names to skip.
+ */
+
+exports.names = [];
+exports.skips = [];
+
+/**
+ * Map of special "%n" handling functions, for the debug "format" argument.
+ *
+ * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
+ */
+
+exports.formatters = {};
+
+/**
+ * Select a color.
+ * @param {String} namespace
+ * @return {Number}
+ * @api private
+ */
+
+function selectColor(namespace) {
+  var hash = 0, i;
+
+  for (i in namespace) {
+    hash  = ((hash << 5) - hash) + namespace.charCodeAt(i);
+    hash |= 0; // Convert to 32bit integer
+  }
+
+  return exports.colors[Math.abs(hash) % exports.colors.length];
+}
+
+/**
+ * Create a debugger with the given `namespace`.
+ *
+ * @param {String} namespace
+ * @return {Function}
+ * @api public
+ */
+
+function createDebug(namespace) {
+
+  var prevTime;
+
+  function debug() {
+    // disabled?
+    if (!debug.enabled) return;
+
+    var self = debug;
+
+    // set `diff` timestamp
+    var curr = +new Date();
+    var ms = curr - (prevTime || curr);
+    self.diff = ms;
+    self.prev = prevTime;
+    self.curr = curr;
+    prevTime = curr;
+
+    // turn the `arguments` into a proper Array
+    var args = new Array(arguments.length);
+    for (var i = 0; i < args.length; i++) {
+      args[i] = arguments[i];
+    }
+
+    args[0] = exports.coerce(args[0]);
+
+    if ('string' !== typeof args[0]) {
+      // anything else let's inspect with %O
+      args.unshift('%O');
+    }
+
+    // apply any `formatters` transformations
+    var index = 0;
+    args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
+      // if we encounter an escaped % then don't increase the array index
+      if (match === '%%') return match;
+      index++;
+      var formatter = exports.formatters[format];
+      if ('function' === typeof formatter) {
+        var val = args[index];
+        match = formatter.call(self, val);
+
+        // now we need to remove `args[index]` since it's inlined in the `format`
+        args.splice(index, 1);
+        index--;
+      }
+      return match;
+    });
+
+    // apply env-specific formatting (colors, etc.)
+    exports.formatArgs.call(self, args);
+
+    var logFn = debug.log || exports.log || console.log.bind(console);
+    logFn.apply(self, args);
+  }
+
+  debug.namespace = namespace;
+  debug.enabled = exports.enabled(namespace);
+  debug.useColors = exports.useColors();
+  debug.color = selectColor(namespace);
+  debug.destroy = destroy;
+
+  // env-specific initialization logic for debug instances
+  if ('function' === typeof exports.init) {
+    exports.init(debug);
+  }
+
+  exports.instances.push(debug);
+
+  return debug;
+}
+
+function destroy () {
+  var index = exports.instances.indexOf(this);
+  if (index !== -1) {
+    exports.instances.splice(index, 1);
+    return true;
+  } else {
+    return false;
+  }
+}
+
+/**
+ * Enables a debug mode by namespaces. This can include modes
+ * separated by a colon and wildcards.
+ *
+ * @param {String} namespaces
+ * @api public
+ */
+
+function enable(namespaces) {
+  exports.save(namespaces);
+
+  exports.names = [];
+  exports.skips = [];
+
+  var i;
+  var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
+  var len = split.length;
+
+  for (i = 0; i < len; i++) {
+    if (!split[i]) continue; // ignore empty strings
+    namespaces = split[i].replace(/\*/g, '.*?');
+    if (namespaces[0] === '-') {
+      exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
+    } else {
+      exports.names.push(new RegExp('^' + namespaces + '$'));
+    }
+  }
+
+  for (i = 0; i < exports.instances.length; i++) {
+    var instance = exports.instances[i];
+    instance.enabled = exports.enabled(instance.namespace);
+  }
+}
+
+/**
+ * Disable debug output.
+ *
+ * @api public
+ */
+
+function disable() {
+  exports.enable('');
+}
+
+/**
+ * Returns true if the given mode name is enabled, false otherwise.
+ *
+ * @param {String} name
+ * @return {Boolean}
+ * @api public
+ */
+
+function enabled(name) {
+  if (name[name.length - 1] === '*') {
+    return true;
+  }
+  var i, len;
+  for (i = 0, len = exports.skips.length; i < len; i++) {
+    if (exports.skips[i].test(name)) {
+      return false;
+    }
+  }
+  for (i = 0, len = exports.names.length; i < len; i++) {
+    if (exports.names[i].test(name)) {
+      return true;
+    }
+  }
+  return false;
+}
+
+/**
+ * Coerce `val`.
+ *
+ * @param {Mixed} val
+ * @return {Mixed}
+ * @api private
+ */
+
+function coerce(val) {
+  if (val instanceof Error) return val.stack || val.message;
+  return val;
+}
diff --git a/wrt/node_modules/debug/src/index.js b/wrt/node_modules/debug/src/index.js
new file mode 100644 (file)
index 0000000..e12cf4d
--- /dev/null
@@ -0,0 +1,10 @@
+/**
+ * Detect Electron renderer process, which is node, but we should
+ * treat as a browser.
+ */
+
+if (typeof process !== 'undefined' && process.type === 'renderer') {
+  module.exports = require('./browser.js');
+} else {
+  module.exports = require('./node.js');
+}
diff --git a/wrt/node_modules/debug/src/node.js b/wrt/node_modules/debug/src/node.js
new file mode 100644 (file)
index 0000000..b85ec7e
--- /dev/null
@@ -0,0 +1,177 @@
+/**
+ * Module dependencies.
+ */
+
+var tty = require('tty');
+var util = require('util');
+
+/**
+ * This is the Node.js implementation of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = require('./debug');
+exports.init = init;
+exports.log = log;
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+
+/**
+ * Colors.
+ */
+
+exports.colors = [ 6, 2, 3, 4, 5, 1 ];
+
+try {
+  var supportsColor = require('supports-color');
+  if (supportsColor && supportsColor.level >= 2) {
+    exports.colors = [
+      20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68,
+      69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134,
+      135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171,
+      172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204,
+      205, 206, 207, 208, 209, 214, 215, 220, 221
+    ];
+  }
+} catch (err) {
+  // swallow - we only care if `supports-color` is available; it doesn't have to be.
+}
+
+/**
+ * Build up the default `inspectOpts` object from the environment variables.
+ *
+ *   $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
+ */
+
+exports.inspectOpts = Object.keys(process.env).filter(function (key) {
+  return /^debug_/i.test(key);
+}).reduce(function (obj, key) {
+  // camel-case
+  var prop = key
+    .substring(6)
+    .toLowerCase()
+    .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });
+
+  // coerce string value into JS value
+  var val = process.env[key];
+  if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
+  else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
+  else if (val === 'null') val = null;
+  else val = Number(val);
+
+  obj[prop] = val;
+  return obj;
+}, {});
+
+/**
+ * Is stdout a TTY? Colored output is enabled when `true`.
+ */
+
+function useColors() {
+  return 'colors' in exports.inspectOpts
+    ? Boolean(exports.inspectOpts.colors)
+    : tty.isatty(process.stderr.fd);
+}
+
+/**
+ * Map %o to `util.inspect()`, all on a single line.
+ */
+
+exports.formatters.o = function(v) {
+  this.inspectOpts.colors = this.useColors;
+  return util.inspect(v, this.inspectOpts)
+    .replace(/\s*\n\s*/g, ' ');
+};
+
+/**
+ * Map %o to `util.inspect()`, allowing multiple lines if needed.
+ */
+
+exports.formatters.O = function(v) {
+  this.inspectOpts.colors = this.useColors;
+  return util.inspect(v, this.inspectOpts);
+};
+
+/**
+ * Adds ANSI color escape codes if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+  var name = this.namespace;
+  var useColors = this.useColors;
+
+  if (useColors) {
+    var c = this.color;
+    var colorCode = '\u001b[3' + (c < 8 ? c : '8;5;' + c);
+    var prefix = '  ' + colorCode + ';1m' + name + ' ' + '\u001b[0m';
+
+    args[0] = prefix + args[0].split('\n').join('\n' + prefix);
+    args.push(colorCode + 'm+' + exports.humanize(this.diff) + '\u001b[0m');
+  } else {
+    args[0] = new Date().toISOString()
+      + ' ' + name + ' ' + args[0];
+  }
+}
+
+/**
+ * Invokes `util.format()` with the specified arguments and writes to stderr.
+ */
+
+function log() {
+  return process.stderr.write(util.format.apply(util, arguments) + '\n');
+}
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+
+function save(namespaces) {
+  if (null == namespaces) {
+    // If you set a process.env field to null or undefined, it gets cast to the
+    // string 'null' or 'undefined'. Just delete instead.
+    delete process.env.DEBUG;
+  } else {
+    process.env.DEBUG = namespaces;
+  }
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+
+function load() {
+  return process.env.DEBUG;
+}
+
+/**
+ * Init logic for `debug` instances.
+ *
+ * Create a new `inspectOpts` object in case `useColors` is set
+ * differently for a particular `debug` instance.
+ */
+
+function init (debug) {
+  debug.inspectOpts = {};
+
+  var keys = Object.keys(exports.inspectOpts);
+  for (var i = 0; i < keys.length; i++) {
+    debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
+  }
+}
+
+/**
+ * Enable namespaces listed in `process.env.DEBUG` initially.
+ */
+
+exports.enable(load());
diff --git a/wrt/node_modules/decamelize/index.js b/wrt/node_modules/decamelize/index.js
new file mode 100644 (file)
index 0000000..8d5bab7
--- /dev/null
@@ -0,0 +1,13 @@
+'use strict';
+module.exports = function (str, sep) {
+       if (typeof str !== 'string') {
+               throw new TypeError('Expected a string');
+       }
+
+       sep = typeof sep === 'undefined' ? '_' : sep;
+
+       return str
+               .replace(/([a-z\d])([A-Z])/g, '$1' + sep + '$2')
+               .replace(/([A-Z]+)([A-Z][a-z\d]+)/g, '$1' + sep + '$2')
+               .toLowerCase();
+};
diff --git a/wrt/node_modules/decamelize/license b/wrt/node_modules/decamelize/license
new file mode 100644 (file)
index 0000000..654d0bf
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/decamelize/package.json b/wrt/node_modules/decamelize/package.json
new file mode 100644 (file)
index 0000000..8d89123
--- /dev/null
@@ -0,0 +1,71 @@
+{
+  "_from": "decamelize@^1.1.1",
+  "_id": "decamelize@1.2.0",
+  "_inBundle": false,
+  "_integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=",
+  "_location": "/decamelize",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "decamelize@^1.1.1",
+    "name": "decamelize",
+    "escapedName": "decamelize",
+    "rawSpec": "^1.1.1",
+    "saveSpec": null,
+    "fetchSpec": "^1.1.1"
+  },
+  "_requiredBy": [
+    "/electron-rebuild/yargs",
+    "/yargs"
+  ],
+  "_resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
+  "_shasum": "f6534d15148269b20352e7bee26f501f9a191290",
+  "_spec": "decamelize@^1.1.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was/node_modules/electron-rebuild/node_modules/yargs",
+  "author": {
+    "name": "Sindre Sorhus",
+    "email": "sindresorhus@gmail.com",
+    "url": "sindresorhus.com"
+  },
+  "bugs": {
+    "url": "https://github.com/sindresorhus/decamelize/issues"
+  },
+  "bundleDependencies": false,
+  "deprecated": false,
+  "description": "Convert a camelized string into a lowercased one with a custom separator: unicornRainbow → unicorn_rainbow",
+  "devDependencies": {
+    "ava": "*",
+    "xo": "*"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/sindresorhus/decamelize#readme",
+  "keywords": [
+    "decamelize",
+    "decamelcase",
+    "camelcase",
+    "lowercase",
+    "case",
+    "dash",
+    "hyphen",
+    "string",
+    "str",
+    "text",
+    "convert"
+  ],
+  "license": "MIT",
+  "name": "decamelize",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/sindresorhus/decamelize.git"
+  },
+  "scripts": {
+    "test": "xo && ava"
+  },
+  "version": "1.2.0"
+}
diff --git a/wrt/node_modules/decamelize/readme.md b/wrt/node_modules/decamelize/readme.md
new file mode 100644 (file)
index 0000000..624c7ee
--- /dev/null
@@ -0,0 +1,48 @@
+# decamelize [![Build Status](https://travis-ci.org/sindresorhus/decamelize.svg?branch=master)](https://travis-ci.org/sindresorhus/decamelize)
+
+> Convert a camelized string into a lowercased one with a custom separator<br>
+> Example: `unicornRainbow` → `unicorn_rainbow`
+
+
+## Install
+
+```
+$ npm install --save decamelize
+```
+
+
+## Usage
+
+```js
+const decamelize = require('decamelize');
+
+decamelize('unicornRainbow');
+//=> 'unicorn_rainbow'
+
+decamelize('unicornRainbow', '-');
+//=> 'unicorn-rainbow'
+```
+
+
+## API
+
+### decamelize(input, [separator])
+
+#### input
+
+Type: `string`
+
+#### separator
+
+Type: `string`<br>
+Default: `_`
+
+
+## Related
+
+See [`camelcase`](https://github.com/sindresorhus/camelcase) for the inverse.
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/wrt/node_modules/depd/History.md b/wrt/node_modules/depd/History.md
new file mode 100644 (file)
index 0000000..f001649
--- /dev/null
@@ -0,0 +1,90 @@
+1.1.1 / 2017-07-27
+==================
+
+  * Remove unnecessary `Buffer` loading
+  * Support Node.js 0.6 to 8.x
+
+1.1.0 / 2015-09-14
+==================
+
+  * Enable strict mode in more places
+  * Support io.js 3.x
+  * Support io.js 2.x
+  * Support web browser loading
+    - Requires bundler like Browserify or webpack
+
+1.0.1 / 2015-04-07
+==================
+
+  * Fix `TypeError`s when under `'use strict'` code
+  * Fix useless type name on auto-generated messages
+  * Support io.js 1.x
+  * Support Node.js 0.12
+
+1.0.0 / 2014-09-17
+==================
+
+  * No changes
+
+0.4.5 / 2014-09-09
+==================
+
+  * Improve call speed to functions using the function wrapper
+  * Support Node.js 0.6
+
+0.4.4 / 2014-07-27
+==================
+
+  * Work-around v8 generating empty stack traces
+
+0.4.3 / 2014-07-26
+==================
+
+  * Fix exception when global `Error.stackTraceLimit` is too low
+
+0.4.2 / 2014-07-19
+==================
+
+  * Correct call site for wrapped functions and properties
+
+0.4.1 / 2014-07-19
+==================
+
+  * Improve automatic message generation for function properties
+
+0.4.0 / 2014-07-19
+==================
+
+  * Add `TRACE_DEPRECATION` environment variable
+  * Remove non-standard grey color from color output
+  * Support `--no-deprecation` argument
+  * Support `--trace-deprecation` argument
+  * Support `deprecate.property(fn, prop, message)`
+
+0.3.0 / 2014-06-16
+==================
+
+  * Add `NO_DEPRECATION` environment variable
+
+0.2.0 / 2014-06-15
+==================
+
+  * Add `deprecate.property(obj, prop, message)`
+  * Remove `supports-color` dependency for node.js 0.8
+
+0.1.0 / 2014-06-15
+==================
+
+  * Add `deprecate.function(fn, message)`
+  * Add `process.on('deprecation', fn)` emitter
+  * Automatically generate message when omitted from `deprecate()`
+
+0.0.1 / 2014-06-15
+==================
+
+  * Fix warning for dynamic calls at singe call site
+
+0.0.0 / 2014-06-15
+==================
+
+  * Initial implementation
diff --git a/wrt/node_modules/depd/LICENSE b/wrt/node_modules/depd/LICENSE
new file mode 100644 (file)
index 0000000..84441fb
--- /dev/null
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2014-2017 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/depd/Readme.md b/wrt/node_modules/depd/Readme.md
new file mode 100644 (file)
index 0000000..9e7d872
--- /dev/null
@@ -0,0 +1,283 @@
+# depd
+
+[![NPM Version][npm-version-image]][npm-url]
+[![NPM Downloads][npm-downloads-image]][npm-url]
+[![Node.js Version][node-image]][node-url]
+[![Linux Build][travis-image]][travis-url]
+[![Windows Build][appveyor-image]][appveyor-url]
+[![Coverage Status][coveralls-image]][coveralls-url]
+[![Gratipay][gratipay-image]][gratipay-url]
+
+Deprecate all the things
+
+> With great modules comes great responsibility; mark things deprecated!
+
+## Install
+
+This module is installed directly using `npm`:
+
+```sh
+$ npm install depd
+```
+
+This module can also be bundled with systems like
+[Browserify](http://browserify.org/) or [webpack](https://webpack.github.io/),
+though by default this module will alter it's API to no longer display or
+track deprecations.
+
+## API
+
+<!-- eslint-disable no-unused-vars -->
+
+```js
+var deprecate = require('depd')('my-module')
+```
+
+This library allows you to display deprecation messages to your users.
+This library goes above and beyond with deprecation warnings by
+introspection of the call stack (but only the bits that it is interested
+in).
+
+Instead of just warning on the first invocation of a deprecated
+function and never again, this module will warn on the first invocation
+of a deprecated function per unique call site, making it ideal to alert
+users of all deprecated uses across the code base, rather than just
+whatever happens to execute first.
+
+The deprecation warnings from this module also include the file and line
+information for the call into the module that the deprecated function was
+in.
+
+**NOTE** this library has a similar interface to the `debug` module, and
+this module uses the calling file to get the boundary for the call stacks,
+so you should always create a new `deprecate` object in each file and not
+within some central file.
+
+### depd(namespace)
+
+Create a new deprecate function that uses the given namespace name in the
+messages and will display the call site prior to the stack entering the
+file this function was called from. It is highly suggested you use the
+name of your module as the namespace.
+
+### deprecate(message)
+
+Call this function from deprecated code to display a deprecation message.
+This message will appear once per unique caller site. Caller site is the
+first call site in the stack in a different file from the caller of this
+function.
+
+If the message is omitted, a message is generated for you based on the site
+of the `deprecate()` call and will display the name of the function called,
+similar to the name displayed in a stack trace.
+
+### deprecate.function(fn, message)
+
+Call this function to wrap a given function in a deprecation message on any
+call to the function. An optional message can be supplied to provide a custom
+message.
+
+### deprecate.property(obj, prop, message)
+
+Call this function to wrap a given property on object in a deprecation message
+on any accessing or setting of the property. An optional message can be supplied
+to provide a custom message.
+
+The method must be called on the object where the property belongs (not
+inherited from the prototype).
+
+If the property is a data descriptor, it will be converted to an accessor
+descriptor in order to display the deprecation message.
+
+### process.on('deprecation', fn)
+
+This module will allow easy capturing of deprecation errors by emitting the
+errors as the type "deprecation" on the global `process`. If there are no
+listeners for this type, the errors are written to STDERR as normal, but if
+there are any listeners, nothing will be written to STDERR and instead only
+emitted. From there, you can write the errors in a different format or to a
+logging source.
+
+The error represents the deprecation and is emitted only once with the same
+rules as writing to STDERR. The error has the following properties:
+
+  - `message` - This is the message given by the library
+  - `name` - This is always `'DeprecationError'`
+  - `namespace` - This is the namespace the deprecation came from
+  - `stack` - This is the stack of the call to the deprecated thing
+
+Example `error.stack` output:
+
+```
+DeprecationError: my-cool-module deprecated oldfunction
+    at Object.<anonymous> ([eval]-wrapper:6:22)
+    at Module._compile (module.js:456:26)
+    at evalScript (node.js:532:25)
+    at startup (node.js:80:7)
+    at node.js:902:3
+```
+
+### process.env.NO_DEPRECATION
+
+As a user of modules that are deprecated, the environment variable `NO_DEPRECATION`
+is provided as a quick solution to silencing deprecation warnings from being
+output. The format of this is similar to that of `DEBUG`:
+
+```sh
+$ NO_DEPRECATION=my-module,othermod node app.js
+```
+
+This will suppress deprecations from being output for "my-module" and "othermod".
+The value is a list of comma-separated namespaces. To suppress every warning
+across all namespaces, use the value `*` for a namespace.
+
+Providing the argument `--no-deprecation` to the `node` executable will suppress
+all deprecations (only available in Node.js 0.8 or higher).
+
+**NOTE** This will not suppress the deperecations given to any "deprecation"
+event listeners, just the output to STDERR.
+
+### process.env.TRACE_DEPRECATION
+
+As a user of modules that are deprecated, the environment variable `TRACE_DEPRECATION`
+is provided as a solution to getting more detailed location information in deprecation
+warnings by including the entire stack trace. The format of this is the same as
+`NO_DEPRECATION`:
+
+```sh
+$ TRACE_DEPRECATION=my-module,othermod node app.js
+```
+
+This will include stack traces for deprecations being output for "my-module" and
+"othermod". The value is a list of comma-separated namespaces. To trace every
+warning across all namespaces, use the value `*` for a namespace.
+
+Providing the argument `--trace-deprecation` to the `node` executable will trace
+all deprecations (only available in Node.js 0.8 or higher).
+
+**NOTE** This will not trace the deperecations silenced by `NO_DEPRECATION`.
+
+## Display
+
+![message](files/message.png)
+
+When a user calls a function in your library that you mark deprecated, they
+will see the following written to STDERR (in the given colors, similar colors
+and layout to the `debug` module):
+
+```
+bright cyan    bright yellow
+|              |          reset       cyan
+|              |          |           |
+▼              ▼          ▼           ▼
+my-cool-module deprecated oldfunction [eval]-wrapper:6:22
+▲              ▲          ▲           ▲
+|              |          |           |
+namespace      |          |           location of mycoolmod.oldfunction() call
+               |          deprecation message
+               the word "deprecated"
+```
+
+If the user redirects their STDERR to a file or somewhere that does not support
+colors, they see (similar layout to the `debug` module):
+
+```
+Sun, 15 Jun 2014 05:21:37 GMT my-cool-module deprecated oldfunction at [eval]-wrapper:6:22
+▲                             ▲              ▲          ▲              ▲
+|                             |              |          |              |
+timestamp of message          namespace      |          |             location of mycoolmod.oldfunction() call
+                                             |          deprecation message
+                                             the word "deprecated"
+```
+
+## Examples
+
+### Deprecating all calls to a function
+
+This will display a deprecated message about "oldfunction" being deprecated
+from "my-module" on STDERR.
+
+```js
+var deprecate = require('depd')('my-cool-module')
+
+// message automatically derived from function name
+// Object.oldfunction
+exports.oldfunction = deprecate.function(function oldfunction () {
+  // all calls to function are deprecated
+})
+
+// specific message
+exports.oldfunction = deprecate.function(function () {
+  // all calls to function are deprecated
+}, 'oldfunction')
+```
+
+### Conditionally deprecating a function call
+
+This will display a deprecated message about "weirdfunction" being deprecated
+from "my-module" on STDERR when called with less than 2 arguments.
+
+```js
+var deprecate = require('depd')('my-cool-module')
+
+exports.weirdfunction = function () {
+  if (arguments.length < 2) {
+    // calls with 0 or 1 args are deprecated
+    deprecate('weirdfunction args < 2')
+  }
+}
+```
+
+When calling `deprecate` as a function, the warning is counted per call site
+within your own module, so you can display different deprecations depending
+on different situations and the users will still get all the warnings:
+
+```js
+var deprecate = require('depd')('my-cool-module')
+
+exports.weirdfunction = function () {
+  if (arguments.length < 2) {
+    // calls with 0 or 1 args are deprecated
+    deprecate('weirdfunction args < 2')
+  } else if (typeof arguments[0] !== 'string') {
+    // calls with non-string first argument are deprecated
+    deprecate('weirdfunction non-string first arg')
+  }
+}
+```
+
+### Deprecating property access
+
+This will display a deprecated message about "oldprop" being deprecated
+from "my-module" on STDERR when accessed. A deprecation will be displayed
+when setting the value and when getting the value.
+
+```js
+var deprecate = require('depd')('my-cool-module')
+
+exports.oldprop = 'something'
+
+// message automatically derives from property name
+deprecate.property(exports, 'oldprop')
+
+// explicit message
+deprecate.property(exports, 'oldprop', 'oldprop >= 0.10')
+```
+
+## License
+
+[MIT](LICENSE)
+
+[npm-version-image]: https://img.shields.io/npm/v/depd.svg
+[npm-downloads-image]: https://img.shields.io/npm/dm/depd.svg
+[npm-url]: https://npmjs.org/package/depd
+[travis-image]: https://img.shields.io/travis/dougwilson/nodejs-depd/master.svg?label=linux
+[travis-url]: https://travis-ci.org/dougwilson/nodejs-depd
+[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/nodejs-depd/master.svg?label=windows
+[appveyor-url]: https://ci.appveyor.com/project/dougwilson/nodejs-depd
+[coveralls-image]: https://img.shields.io/coveralls/dougwilson/nodejs-depd/master.svg
+[coveralls-url]: https://coveralls.io/r/dougwilson/nodejs-depd?branch=master
+[node-image]: https://img.shields.io/node/v/depd.svg
+[node-url]: https://nodejs.org/en/download/
+[gratipay-image]: https://img.shields.io/gratipay/dougwilson.svg
+[gratipay-url]: https://www.gratipay.com/dougwilson/
diff --git a/wrt/node_modules/depd/index.js b/wrt/node_modules/depd/index.js
new file mode 100644 (file)
index 0000000..73d81ab
--- /dev/null
@@ -0,0 +1,520 @@
+/*!
+ * depd
+ * Copyright(c) 2014-2017 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var callSiteToString = require('./lib/compat').callSiteToString
+var eventListenerCount = require('./lib/compat').eventListenerCount
+var relative = require('path').relative
+
+/**
+ * Module exports.
+ */
+
+module.exports = depd
+
+/**
+ * Get the path to base files on.
+ */
+
+var basePath = process.cwd()
+
+/**
+ * Determine if namespace is contained in the string.
+ */
+
+function containsNamespace (str, namespace) {
+  var val = str.split(/[ ,]+/)
+
+  namespace = String(namespace).toLowerCase()
+
+  for (var i = 0; i < val.length; i++) {
+    if (!(str = val[i])) continue
+
+    // namespace contained
+    if (str === '*' || str.toLowerCase() === namespace) {
+      return true
+    }
+  }
+
+  return false
+}
+
+/**
+ * Convert a data descriptor to accessor descriptor.
+ */
+
+function convertDataDescriptorToAccessor (obj, prop, message) {
+  var descriptor = Object.getOwnPropertyDescriptor(obj, prop)
+  var value = descriptor.value
+
+  descriptor.get = function getter () { return value }
+
+  if (descriptor.writable) {
+    descriptor.set = function setter (val) { return (value = val) }
+  }
+
+  delete descriptor.value
+  delete descriptor.writable
+
+  Object.defineProperty(obj, prop, descriptor)
+
+  return descriptor
+}
+
+/**
+ * Create arguments string to keep arity.
+ */
+
+function createArgumentsString (arity) {
+  var str = ''
+
+  for (var i = 0; i < arity; i++) {
+    str += ', arg' + i
+  }
+
+  return str.substr(2)
+}
+
+/**
+ * Create stack string from stack.
+ */
+
+function createStackString (stack) {
+  var str = this.name + ': ' + this.namespace
+
+  if (this.message) {
+    str += ' deprecated ' + this.message
+  }
+
+  for (var i = 0; i < stack.length; i++) {
+    str += '\n    at ' + callSiteToString(stack[i])
+  }
+
+  return str
+}
+
+/**
+ * Create deprecate for namespace in caller.
+ */
+
+function depd (namespace) {
+  if (!namespace) {
+    throw new TypeError('argument namespace is required')
+  }
+
+  var stack = getStack()
+  var site = callSiteLocation(stack[1])
+  var file = site[0]
+
+  function deprecate (message) {
+    // call to self as log
+    log.call(deprecate, message)
+  }
+
+  deprecate._file = file
+  deprecate._ignored = isignored(namespace)
+  deprecate._namespace = namespace
+  deprecate._traced = istraced(namespace)
+  deprecate._warned = Object.create(null)
+
+  deprecate.function = wrapfunction
+  deprecate.property = wrapproperty
+
+  return deprecate
+}
+
+/**
+ * Determine if namespace is ignored.
+ */
+
+function isignored (namespace) {
+  /* istanbul ignore next: tested in a child processs */
+  if (process.noDeprecation) {
+    // --no-deprecation support
+    return true
+  }
+
+  var str = process.env.NO_DEPRECATION || ''
+
+  // namespace ignored
+  return containsNamespace(str, namespace)
+}
+
+/**
+ * Determine if namespace is traced.
+ */
+
+function istraced (namespace) {
+  /* istanbul ignore next: tested in a child processs */
+  if (process.traceDeprecation) {
+    // --trace-deprecation support
+    return true
+  }
+
+  var str = process.env.TRACE_DEPRECATION || ''
+
+  // namespace traced
+  return containsNamespace(str, namespace)
+}
+
+/**
+ * Display deprecation message.
+ */
+
+function log (message, site) {
+  var haslisteners = eventListenerCount(process, 'deprecation') !== 0
+
+  // abort early if no destination
+  if (!haslisteners && this._ignored) {
+    return
+  }
+
+  var caller
+  var callFile
+  var callSite
+  var i = 0
+  var seen = false
+  var stack = getStack()
+  var file = this._file
+
+  if (site) {
+    // provided site
+    callSite = callSiteLocation(stack[1])
+    callSite.name = site.name
+    file = callSite[0]
+  } else {
+    // get call site
+    i = 2
+    site = callSiteLocation(stack[i])
+    callSite = site
+  }
+
+  // get caller of deprecated thing in relation to file
+  for (; i < stack.length; i++) {
+    caller = callSiteLocation(stack[i])
+    callFile = caller[0]
+
+    if (callFile === file) {
+      seen = true
+    } else if (callFile === this._file) {
+      file = this._file
+    } else if (seen) {
+      break
+    }
+  }
+
+  var key = caller
+    ? site.join(':') + '__' + caller.join(':')
+    : undefined
+
+  if (key !== undefined && key in this._warned) {
+    // already warned
+    return
+  }
+
+  this._warned[key] = true
+
+  // generate automatic message from call site
+  if (!message) {
+    message = callSite === site || !callSite.name
+      ? defaultMessage(site)
+      : defaultMessage(callSite)
+  }
+
+  // emit deprecation if listeners exist
+  if (haslisteners) {
+    var err = DeprecationError(this._namespace, message, stack.slice(i))
+    process.emit('deprecation', err)
+    return
+  }
+
+  // format and write message
+  var format = process.stderr.isTTY
+    ? formatColor
+    : formatPlain
+  var msg = format.call(this, message, caller, stack.slice(i))
+  process.stderr.write(msg + '\n', 'utf8')
+}
+
+/**
+ * Get call site location as array.
+ */
+
+function callSiteLocation (callSite) {
+  var file = callSite.getFileName() || '<anonymous>'
+  var line = callSite.getLineNumber()
+  var colm = callSite.getColumnNumber()
+
+  if (callSite.isEval()) {
+    file = callSite.getEvalOrigin() + ', ' + file
+  }
+
+  var site = [file, line, colm]
+
+  site.callSite = callSite
+  site.name = callSite.getFunctionName()
+
+  return site
+}
+
+/**
+ * Generate a default message from the site.
+ */
+
+function defaultMessage (site) {
+  var callSite = site.callSite
+  var funcName = site.name
+
+  // make useful anonymous name
+  if (!funcName) {
+    funcName = '<anonymous@' + formatLocation(site) + '>'
+  }
+
+  var context = callSite.getThis()
+  var typeName = context && callSite.getTypeName()
+
+  // ignore useless type name
+  if (typeName === 'Object') {
+    typeName = undefined
+  }
+
+  // make useful type name
+  if (typeName === 'Function') {
+    typeName = context.name || typeName
+  }
+
+  return typeName && callSite.getMethodName()
+    ? typeName + '.' + funcName
+    : funcName
+}
+
+/**
+ * Format deprecation message without color.
+ */
+
+function formatPlain (msg, caller, stack) {
+  var timestamp = new Date().toUTCString()
+
+  var formatted = timestamp +
+    ' ' + this._namespace +
+    ' deprecated ' + msg
+
+  // add stack trace
+  if (this._traced) {
+    for (var i = 0; i < stack.length; i++) {
+      formatted += '\n    at ' + callSiteToString(stack[i])
+    }
+
+    return formatted
+  }
+
+  if (caller) {
+    formatted += ' at ' + formatLocation(caller)
+  }
+
+  return formatted
+}
+
+/**
+ * Format deprecation message with color.
+ */
+
+function formatColor (msg, caller, stack) {
+  var formatted = '\x1b[36;1m' + this._namespace + '\x1b[22;39m' + // bold cyan
+    ' \x1b[33;1mdeprecated\x1b[22;39m' + // bold yellow
+    ' \x1b[0m' + msg + '\x1b[39m' // reset
+
+  // add stack trace
+  if (this._traced) {
+    for (var i = 0; i < stack.length; i++) {
+      formatted += '\n    \x1b[36mat ' + callSiteToString(stack[i]) + '\x1b[39m' // cyan
+    }
+
+    return formatted
+  }
+
+  if (caller) {
+    formatted += ' \x1b[36m' + formatLocation(caller) + '\x1b[39m' // cyan
+  }
+
+  return formatted
+}
+
+/**
+ * Format call site location.
+ */
+
+function formatLocation (callSite) {
+  return relative(basePath, callSite[0]) +
+    ':' + callSite[1] +
+    ':' + callSite[2]
+}
+
+/**
+ * Get the stack as array of call sites.
+ */
+
+function getStack () {
+  var limit = Error.stackTraceLimit
+  var obj = {}
+  var prep = Error.prepareStackTrace
+
+  Error.prepareStackTrace = prepareObjectStackTrace
+  Error.stackTraceLimit = Math.max(10, limit)
+
+  // capture the stack
+  Error.captureStackTrace(obj)
+
+  // slice this function off the top
+  var stack = obj.stack.slice(1)
+
+  Error.prepareStackTrace = prep
+  Error.stackTraceLimit = limit
+
+  return stack
+}
+
+/**
+ * Capture call site stack from v8.
+ */
+
+function prepareObjectStackTrace (obj, stack) {
+  return stack
+}
+
+/**
+ * Return a wrapped function in a deprecation message.
+ */
+
+function wrapfunction (fn, message) {
+  if (typeof fn !== 'function') {
+    throw new TypeError('argument fn must be a function')
+  }
+
+  var args = createArgumentsString(fn.length)
+  var deprecate = this // eslint-disable-line no-unused-vars
+  var stack = getStack()
+  var site = callSiteLocation(stack[1])
+
+  site.name = fn.name
+
+   // eslint-disable-next-line no-eval
+  var deprecatedfn = eval('(function (' + args + ') {\n' +
+    '"use strict"\n' +
+    'log.call(deprecate, message, site)\n' +
+    'return fn.apply(this, arguments)\n' +
+    '})')
+
+  return deprecatedfn
+}
+
+/**
+ * Wrap property in a deprecation message.
+ */
+
+function wrapproperty (obj, prop, message) {
+  if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
+    throw new TypeError('argument obj must be object')
+  }
+
+  var descriptor = Object.getOwnPropertyDescriptor(obj, prop)
+
+  if (!descriptor) {
+    throw new TypeError('must call property on owner object')
+  }
+
+  if (!descriptor.configurable) {
+    throw new TypeError('property must be configurable')
+  }
+
+  var deprecate = this
+  var stack = getStack()
+  var site = callSiteLocation(stack[1])
+
+  // set site name
+  site.name = prop
+
+  // convert data descriptor
+  if ('value' in descriptor) {
+    descriptor = convertDataDescriptorToAccessor(obj, prop, message)
+  }
+
+  var get = descriptor.get
+  var set = descriptor.set
+
+  // wrap getter
+  if (typeof get === 'function') {
+    descriptor.get = function getter () {
+      log.call(deprecate, message, site)
+      return get.apply(this, arguments)
+    }
+  }
+
+  // wrap setter
+  if (typeof set === 'function') {
+    descriptor.set = function setter () {
+      log.call(deprecate, message, site)
+      return set.apply(this, arguments)
+    }
+  }
+
+  Object.defineProperty(obj, prop, descriptor)
+}
+
+/**
+ * Create DeprecationError for deprecation
+ */
+
+function DeprecationError (namespace, message, stack) {
+  var error = new Error()
+  var stackString
+
+  Object.defineProperty(error, 'constructor', {
+    value: DeprecationError
+  })
+
+  Object.defineProperty(error, 'message', {
+    configurable: true,
+    enumerable: false,
+    value: message,
+    writable: true
+  })
+
+  Object.defineProperty(error, 'name', {
+    enumerable: false,
+    configurable: true,
+    value: 'DeprecationError',
+    writable: true
+  })
+
+  Object.defineProperty(error, 'namespace', {
+    configurable: true,
+    enumerable: false,
+    value: namespace,
+    writable: true
+  })
+
+  Object.defineProperty(error, 'stack', {
+    configurable: true,
+    enumerable: false,
+    get: function () {
+      if (stackString !== undefined) {
+        return stackString
+      }
+
+      // prepare stack trace
+      return (stackString = createStackString.call(this, stack))
+    },
+    set: function setter (val) {
+      stackString = val
+    }
+  })
+
+  return error
+}
diff --git a/wrt/node_modules/depd/lib/browser/index.js b/wrt/node_modules/depd/lib/browser/index.js
new file mode 100644 (file)
index 0000000..6be45cc
--- /dev/null
@@ -0,0 +1,77 @@
+/*!
+ * depd
+ * Copyright(c) 2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = depd
+
+/**
+ * Create deprecate for namespace in caller.
+ */
+
+function depd (namespace) {
+  if (!namespace) {
+    throw new TypeError('argument namespace is required')
+  }
+
+  function deprecate (message) {
+    // no-op in browser
+  }
+
+  deprecate._file = undefined
+  deprecate._ignored = true
+  deprecate._namespace = namespace
+  deprecate._traced = false
+  deprecate._warned = Object.create(null)
+
+  deprecate.function = wrapfunction
+  deprecate.property = wrapproperty
+
+  return deprecate
+}
+
+/**
+ * Return a wrapped function in a deprecation message.
+ *
+ * This is a no-op version of the wrapper, which does nothing but call
+ * validation.
+ */
+
+function wrapfunction (fn, message) {
+  if (typeof fn !== 'function') {
+    throw new TypeError('argument fn must be a function')
+  }
+
+  return fn
+}
+
+/**
+ * Wrap property in a deprecation message.
+ *
+ * This is a no-op version of the wrapper, which does nothing but call
+ * validation.
+ */
+
+function wrapproperty (obj, prop, message) {
+  if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
+    throw new TypeError('argument obj must be object')
+  }
+
+  var descriptor = Object.getOwnPropertyDescriptor(obj, prop)
+
+  if (!descriptor) {
+    throw new TypeError('must call property on owner object')
+  }
+
+  if (!descriptor.configurable) {
+    throw new TypeError('property must be configurable')
+  }
+}
diff --git a/wrt/node_modules/depd/lib/compat/callsite-tostring.js b/wrt/node_modules/depd/lib/compat/callsite-tostring.js
new file mode 100644 (file)
index 0000000..73186dc
--- /dev/null
@@ -0,0 +1,103 @@
+/*!
+ * depd
+ * Copyright(c) 2014 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module exports.
+ */
+
+module.exports = callSiteToString
+
+/**
+ * Format a CallSite file location to a string.
+ */
+
+function callSiteFileLocation (callSite) {
+  var fileName
+  var fileLocation = ''
+
+  if (callSite.isNative()) {
+    fileLocation = 'native'
+  } else if (callSite.isEval()) {
+    fileName = callSite.getScriptNameOrSourceURL()
+    if (!fileName) {
+      fileLocation = callSite.getEvalOrigin()
+    }
+  } else {
+    fileName = callSite.getFileName()
+  }
+
+  if (fileName) {
+    fileLocation += fileName
+
+    var lineNumber = callSite.getLineNumber()
+    if (lineNumber != null) {
+      fileLocation += ':' + lineNumber
+
+      var columnNumber = callSite.getColumnNumber()
+      if (columnNumber) {
+        fileLocation += ':' + columnNumber
+      }
+    }
+  }
+
+  return fileLocation || 'unknown source'
+}
+
+/**
+ * Format a CallSite to a string.
+ */
+
+function callSiteToString (callSite) {
+  var addSuffix = true
+  var fileLocation = callSiteFileLocation(callSite)
+  var functionName = callSite.getFunctionName()
+  var isConstructor = callSite.isConstructor()
+  var isMethodCall = !(callSite.isToplevel() || isConstructor)
+  var line = ''
+
+  if (isMethodCall) {
+    var methodName = callSite.getMethodName()
+    var typeName = getConstructorName(callSite)
+
+    if (functionName) {
+      if (typeName && functionName.indexOf(typeName) !== 0) {
+        line += typeName + '.'
+      }
+
+      line += functionName
+
+      if (methodName && functionName.lastIndexOf('.' + methodName) !== functionName.length - methodName.length - 1) {
+        line += ' [as ' + methodName + ']'
+      }
+    } else {
+      line += typeName + '.' + (methodName || '<anonymous>')
+    }
+  } else if (isConstructor) {
+    line += 'new ' + (functionName || '<anonymous>')
+  } else if (functionName) {
+    line += functionName
+  } else {
+    addSuffix = false
+    line += fileLocation
+  }
+
+  if (addSuffix) {
+    line += ' (' + fileLocation + ')'
+  }
+
+  return line
+}
+
+/**
+ * Get constructor name of reviver.
+ */
+
+function getConstructorName (obj) {
+  var receiver = obj.receiver
+  return (receiver.constructor && receiver.constructor.name) || null
+}
diff --git a/wrt/node_modules/depd/lib/compat/event-listener-count.js b/wrt/node_modules/depd/lib/compat/event-listener-count.js
new file mode 100644 (file)
index 0000000..3a8925d
--- /dev/null
@@ -0,0 +1,22 @@
+/*!
+ * depd
+ * Copyright(c) 2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = eventListenerCount
+
+/**
+ * Get the count of listeners on an event emitter of a specific type.
+ */
+
+function eventListenerCount (emitter, type) {
+  return emitter.listeners(type).length
+}
diff --git a/wrt/node_modules/depd/lib/compat/index.js b/wrt/node_modules/depd/lib/compat/index.js
new file mode 100644 (file)
index 0000000..955b333
--- /dev/null
@@ -0,0 +1,79 @@
+/*!
+ * depd
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var EventEmitter = require('events').EventEmitter
+
+/**
+ * Module exports.
+ * @public
+ */
+
+lazyProperty(module.exports, 'callSiteToString', function callSiteToString () {
+  var limit = Error.stackTraceLimit
+  var obj = {}
+  var prep = Error.prepareStackTrace
+
+  function prepareObjectStackTrace (obj, stack) {
+    return stack
+  }
+
+  Error.prepareStackTrace = prepareObjectStackTrace
+  Error.stackTraceLimit = 2
+
+  // capture the stack
+  Error.captureStackTrace(obj)
+
+  // slice the stack
+  var stack = obj.stack.slice()
+
+  Error.prepareStackTrace = prep
+  Error.stackTraceLimit = limit
+
+  return stack[0].toString ? toString : require('./callsite-tostring')
+})
+
+lazyProperty(module.exports, 'eventListenerCount', function eventListenerCount () {
+  return EventEmitter.listenerCount || require('./event-listener-count')
+})
+
+/**
+ * Define a lazy property.
+ */
+
+function lazyProperty (obj, prop, getter) {
+  function get () {
+    var val = getter()
+
+    Object.defineProperty(obj, prop, {
+      configurable: true,
+      enumerable: true,
+      value: val
+    })
+
+    return val
+  }
+
+  Object.defineProperty(obj, prop, {
+    configurable: true,
+    enumerable: true,
+    get: get
+  })
+}
+
+/**
+ * Call toString() on the obj
+ */
+
+function toString (obj) {
+  return obj.toString()
+}
diff --git a/wrt/node_modules/depd/package.json b/wrt/node_modules/depd/package.json
new file mode 100644 (file)
index 0000000..ac71e34
--- /dev/null
@@ -0,0 +1,114 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "depd@~1.1.1",
+        "scope": null,
+        "escapedName": "depd",
+        "name": "depd",
+        "rawSpec": "~1.1.1",
+        "spec": ">=1.1.1 <1.2.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express"
+    ]
+  ],
+  "_from": "depd@>=1.1.1 <1.2.0",
+  "_id": "depd@1.1.1",
+  "_inCache": true,
+  "_location": "/depd",
+  "_nodeVersion": "6.11.1",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/depd-1.1.1.tgz_1501197028677_0.8715836545452476"
+  },
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "3.10.10",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "depd@~1.1.1",
+    "scope": null,
+    "escapedName": "depd",
+    "name": "depd",
+    "rawSpec": "~1.1.1",
+    "spec": ">=1.1.1 <1.2.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/express",
+    "/http-errors",
+    "/send"
+  ],
+  "_resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz",
+  "_shasum": "5783b4e1c459f06fa5ca27f991f3d06e7a310359",
+  "_shrinkwrap": null,
+  "_spec": "depd@~1.1.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express",
+  "author": {
+    "name": "Douglas Christopher Wilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "browser": "lib/browser/index.js",
+  "bugs": {
+    "url": "https://github.com/dougwilson/nodejs-depd/issues"
+  },
+  "dependencies": {},
+  "description": "Deprecate all the things",
+  "devDependencies": {
+    "beautify-benchmark": "0.2.4",
+    "benchmark": "2.1.4",
+    "eslint": "3.19.0",
+    "eslint-config-standard": "7.1.0",
+    "eslint-plugin-markdown": "1.0.0-beta.7",
+    "eslint-plugin-promise": "3.5.0",
+    "eslint-plugin-standard": "2.3.1",
+    "istanbul": "0.4.5",
+    "mocha": "~1.21.5"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "5783b4e1c459f06fa5ca27f991f3d06e7a310359",
+    "tarball": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz"
+  },
+  "engines": {
+    "node": ">= 0.6"
+  },
+  "files": [
+    "lib/",
+    "History.md",
+    "LICENSE",
+    "index.js",
+    "Readme.md"
+  ],
+  "gitHead": "15c5604aaab7befd413506e86670168d7481043a",
+  "homepage": "https://github.com/dougwilson/nodejs-depd#readme",
+  "keywords": [
+    "deprecate",
+    "deprecated"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "name": "depd",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/dougwilson/nodejs-depd.git"
+  },
+  "scripts": {
+    "bench": "node benchmark/index.js",
+    "lint": "eslint --plugin markdown --ext js,md .",
+    "test": "mocha --reporter spec --bail test/",
+    "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --no-exit test/",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/"
+  },
+  "version": "1.1.1"
+}
diff --git a/wrt/node_modules/destroy/LICENSE b/wrt/node_modules/destroy/LICENSE
new file mode 100644 (file)
index 0000000..a7ae8ee
--- /dev/null
@@ -0,0 +1,22 @@
+
+The MIT License (MIT)
+
+Copyright (c) 2014 Jonathan Ong me@jongleberry.com
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/destroy/README.md b/wrt/node_modules/destroy/README.md
new file mode 100644 (file)
index 0000000..6474bc3
--- /dev/null
@@ -0,0 +1,60 @@
+# Destroy
+
+[![NPM version][npm-image]][npm-url]
+[![Build status][travis-image]][travis-url]
+[![Test coverage][coveralls-image]][coveralls-url]
+[![License][license-image]][license-url]
+[![Downloads][downloads-image]][downloads-url]
+[![Gittip][gittip-image]][gittip-url]
+
+Destroy a stream.
+
+This module is meant to ensure a stream gets destroyed, handling different APIs
+and Node.js bugs.
+
+## API
+
+```js
+var destroy = require('destroy')
+```
+
+### destroy(stream)
+
+Destroy the given stream. In most cases, this is identical to a simple
+`stream.destroy()` call. The rules are as follows for a given stream:
+
+  1. If the `stream` is an instance of `ReadStream`, then call `stream.destroy()`
+     and add a listener to the `open` event to call `stream.close()` if it is
+     fired. This is for a Node.js bug that will leak a file descriptor if
+     `.destroy()` is called before `open`.
+  2. If the `stream` is not an instance of `Stream`, then nothing happens.
+  3. If the `stream` has a `.destroy()` method, then call it.
+
+The function returns the `stream` passed in as the argument.
+
+## Example
+
+```js
+var destroy = require('destroy')
+
+var fs = require('fs')
+var stream = fs.createReadStream('package.json')
+
+// ... and later
+destroy(stream)
+```
+
+[npm-image]: https://img.shields.io/npm/v/destroy.svg?style=flat-square
+[npm-url]: https://npmjs.org/package/destroy
+[github-tag]: http://img.shields.io/github/tag/stream-utils/destroy.svg?style=flat-square
+[github-url]: https://github.com/stream-utils/destroy/tags
+[travis-image]: https://img.shields.io/travis/stream-utils/destroy.svg?style=flat-square
+[travis-url]: https://travis-ci.org/stream-utils/destroy
+[coveralls-image]: https://img.shields.io/coveralls/stream-utils/destroy.svg?style=flat-square
+[coveralls-url]: https://coveralls.io/r/stream-utils/destroy?branch=master
+[license-image]: http://img.shields.io/npm/l/destroy.svg?style=flat-square
+[license-url]: LICENSE.md
+[downloads-image]: http://img.shields.io/npm/dm/destroy.svg?style=flat-square
+[downloads-url]: https://npmjs.org/package/destroy
+[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square
+[gittip-url]: https://www.gittip.com/jonathanong/
diff --git a/wrt/node_modules/destroy/index.js b/wrt/node_modules/destroy/index.js
new file mode 100644 (file)
index 0000000..6da2d26
--- /dev/null
@@ -0,0 +1,75 @@
+/*!
+ * destroy
+ * Copyright(c) 2014 Jonathan Ong
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var ReadStream = require('fs').ReadStream
+var Stream = require('stream')
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = destroy
+
+/**
+ * Destroy a stream.
+ *
+ * @param {object} stream
+ * @public
+ */
+
+function destroy(stream) {
+  if (stream instanceof ReadStream) {
+    return destroyReadStream(stream)
+  }
+
+  if (!(stream instanceof Stream)) {
+    return stream
+  }
+
+  if (typeof stream.destroy === 'function') {
+    stream.destroy()
+  }
+
+  return stream
+}
+
+/**
+ * Destroy a ReadStream.
+ *
+ * @param {object} stream
+ * @private
+ */
+
+function destroyReadStream(stream) {
+  stream.destroy()
+
+  if (typeof stream.close === 'function') {
+    // node.js core bug work-around
+    stream.on('open', onOpenClose)
+  }
+
+  return stream
+}
+
+/**
+ * On open handler to close stream.
+ * @private
+ */
+
+function onOpenClose() {
+  if (typeof this.fd === 'number') {
+    // actually close down the fd
+    this.close()
+  }
+}
diff --git a/wrt/node_modules/destroy/package.json b/wrt/node_modules/destroy/package.json
new file mode 100644 (file)
index 0000000..a462259
--- /dev/null
@@ -0,0 +1,106 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "destroy@~1.0.4",
+        "scope": null,
+        "escapedName": "destroy",
+        "name": "destroy",
+        "rawSpec": "~1.0.4",
+        "spec": ">=1.0.4 <1.1.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/send"
+    ]
+  ],
+  "_from": "destroy@>=1.0.4 <1.1.0",
+  "_id": "destroy@1.0.4",
+  "_inCache": true,
+  "_location": "/destroy",
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "1.4.28",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "destroy@~1.0.4",
+    "scope": null,
+    "escapedName": "destroy",
+    "name": "destroy",
+    "rawSpec": "~1.0.4",
+    "spec": ">=1.0.4 <1.1.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/send"
+  ],
+  "_resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
+  "_shasum": "978857442c44749e4206613e37946205826abd80",
+  "_shrinkwrap": null,
+  "_spec": "destroy@~1.0.4",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/send",
+  "author": {
+    "name": "Jonathan Ong",
+    "email": "me@jongleberry.com",
+    "url": "http://jongleberry.com"
+  },
+  "bugs": {
+    "url": "https://github.com/stream-utils/destroy/issues"
+  },
+  "contributors": [
+    {
+      "name": "Douglas Christopher Wilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "dependencies": {},
+  "description": "destroy a stream if possible",
+  "devDependencies": {
+    "istanbul": "0.4.2",
+    "mocha": "2.3.4"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "978857442c44749e4206613e37946205826abd80",
+    "tarball": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz"
+  },
+  "files": [
+    "index.js",
+    "LICENSE"
+  ],
+  "gitHead": "86edea01456f5fa1027f6a47250c34c713cbcc3b",
+  "homepage": "https://github.com/stream-utils/destroy",
+  "keywords": [
+    "stream",
+    "streams",
+    "destroy",
+    "cleanup",
+    "leak",
+    "fd"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "jongleberry",
+      "email": "jonathanrichardong@gmail.com"
+    },
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "name": "destroy",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/stream-utils/destroy.git"
+  },
+  "scripts": {
+    "test": "mocha --reporter spec",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot",
+    "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"
+  },
+  "version": "1.0.4"
+}
diff --git a/wrt/node_modules/dialog/README.md b/wrt/node_modules/dialog/README.md
new file mode 100644 (file)
index 0000000..5e9f9fd
--- /dev/null
@@ -0,0 +1,57 @@
+Dialog
+======
+
+Simple wrapper around zenity, osascript and vbscript that lets you
+show native alert dialogs on Linux, OSX and Windows, respectively.
+
+Example
+-----
+
+``` js
+var dialog = require('dialog');
+
+dialog.info('Hello there');
+```
+
+Usage
+-------
+To show an error dialog:
+
+``` js
+dialog.err(msg, title, callback);
+```
+
+To show a generic info dialog:
+
+``` js
+dialog.info(msg, title, callback);
+
+// example, setting title
+dialog.info('Ground control to major Tom.', 'My app', function(exitCode) {
+       if (exitCode == 0) console.log('User clicked OK');
+})
+```
+
+To show a warning dialog:
+
+``` js
+dialog.warn(msg, title, callback);
+
+// example, without setting title
+dialog.warn('This computer will autoterminate itself in 5 seconds.', function(exitCode){
+       if (exitCode == 1) console.log('User closed window');
+})
+```
+
+`exitCode` indicates whether the user clicked the default (OK) button (value `0`), or if they closed the window or clicked the "No/Cancel" button (value `1`).
+
+Both `title` and `callback` are optional. Default title shown is "Important".
+
+Credits
+-------
+Written by Tomás Pollak, except for the MsgBox script which was written by
+[StackOverflow user boflynn](http://stackoverflow.com/a/774197).
+
+Copyright
+---------
+(c) 2012 Fork Ltd. MIT license.
diff --git a/wrt/node_modules/dialog/bin/dialog.js b/wrt/node_modules/dialog/bin/dialog.js
new file mode 100755 (executable)
index 0000000..0ac4c3b
--- /dev/null
@@ -0,0 +1,19 @@
+#!/usr/bin/env node
+
+function abort(msg) {
+  console.log(msg) || process.exit(1);
+}
+
+if (!process.argv[3])
+  abort("Usage: show_dialog [err|info|warn] [message]")
+
+var dialog  = require('./..'),
+    type    = process.argv[2],
+    message = process.argv.slice(3).join(' ');
+
+if (!dialog[type])
+  return abort("Unknown message type: " + type);
+
+dialog[type](message, function(err) {
+  if (err) console.log(err.message.trim());
+});
diff --git a/wrt/node_modules/dialog/index.js b/wrt/node_modules/dialog/index.js
new file mode 100644 (file)
index 0000000..6403dd2
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+ By Tomas Pollak <tomas@forkhq.com>.
+ MIT License.
+*/
+
+var join  = require('path').join,
+    spawn = require('child_process').spawn;
+
+var Dialog = module.exports = {
+
+  err: function(str, title, callback) {
+    this.show('error', str, title, callback);
+  },
+
+  info: function(str, title, callback) {
+    this.show('info', str, title, callback);
+  },
+
+  warn: function(str, title, callback) {
+    this.show('warning', str, title, callback);
+  },
+
+  show: function(type, str, title, callback) {
+    if (!str || str.trim() == '')
+      throw new Error('Empty or no string passed!');
+
+    if (typeof title == 'function') {
+      callback = title;
+      title = null;
+    }
+
+    var cmd     = [],
+        os_name = process.platform,
+        title   = title ? title : 'Important';
+
+    var str = (str + '').replace(/([.?*+^$[\]\\(){}<>|`-])/g, "\$1");
+
+    // return codes for zenity are 0 on "OK" 
+    // and 1 on "No/Cancel" or close window
+    if (os_name == 'linux') {
+
+      str = str.replace(/[<>]/g, '');
+      cmd.push('zenity');
+      cmd.push('--' + type);
+      cmd.push('--text') && cmd.push(str);
+      cmd.push('--title') && cmd.push(title);
+      if (str.length > 30) cmd.push('--width') && cmd.push('300');
+
+    // return codes in macOS are exactly as in Linux
+    // 0 for 'OK', 1 for 'Cancel'
+    } else if (os_name == 'darwin') {
+      
+      switch (type) { // Set dialog icon
+        case 'error':
+          type = 0;
+          break;
+        case 'info':
+          type = 1;
+          break;
+        case 'warning':
+          type = 2;
+          break;
+        default:
+          type = '';
+      }
+
+      str = str.replace(/"/g, "'"); // double quotes to single quotes
+      cmd.push('osascript') && cmd.push('-e');
+      var script = 'tell app \"System Events\" to display dialog ';
+      script += '\"' + str + '\" with title \"' + title + '\" buttons \"OK\"';
+      script += ' with icon ' + type;
+      cmd.push(script);
+
+    } else { // windows
+
+      // return codes for Windows (default value minus 1)
+      // defaults in https://www.tutorialspoint.com/vbscript/vbscript_dialog_boxes.htm
+
+      // 0 - vbOK
+      // 1 - vbCancel
+      // 2 - vbAbort
+      // 3 - vbRetry
+      // 4 - vbIgnore
+      // 5 - vbYes
+      // 6 - vbNo
+     
+      switch (type) { // Set MsgBox icon
+        case 'error':
+          type = 16;
+          break;
+        case 'info':
+          type = 64;
+          break;
+        case 'warning':
+          type = 48;
+          break;
+        default:
+          type = 0;
+      }
+
+      str = str.replace(/"/g, "'"); // double quotes to single quotes
+     
+      // msgbox.vbs script from http://stackoverflow.com/questions/774175
+      cmd.push('cscript');
+      cmd.push(join(__dirname, 'msgbox.vbs'));
+      cmd.push(str) && cmd.push(type) && cmd.push(title);
+
+    }
+
+    this.run(cmd, callback);
+
+  },
+
+  run: function(cmd, cb) {
+    var bin    = cmd[0],
+        args   = cmd.splice(1),
+        stdout = '',
+        stderr = '';
+
+    var child = spawn(bin, args);
+
+    child.stdout.on('data', function(data) {
+      stdout += data.toString();
+    })
+
+    child.stderr.on('data', function(data) {
+      stderr += data.toString();
+    })
+
+    child.on('exit', function(code) {
+      cb && cb(code, stdout, stderr);
+    })
+  }
+
+}
diff --git a/wrt/node_modules/dialog/msgbox.vbs b/wrt/node_modules/dialog/msgbox.vbs
new file mode 100644 (file)
index 0000000..03b5276
--- /dev/null
@@ -0,0 +1,6 @@
+Set objArgs = WScript.Arguments
+messageText = objArgs(0)
+messageType = objArgs(1)
+messageTitle = objArgs(2)
+retValue = MsgBox(messageText, messageType, messageTitle)
+WScript.Quit (retValue - 1)
diff --git a/wrt/node_modules/dialog/package.json b/wrt/node_modules/dialog/package.json
new file mode 100644 (file)
index 0000000..dbf1888
--- /dev/null
@@ -0,0 +1,52 @@
+{
+  "_from": "dialog",
+  "_id": "dialog@0.3.1",
+  "_inBundle": false,
+  "_integrity": "sha1-j9m0f9sne7noIXK7bia8V4qmElQ=",
+  "_location": "/dialog",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "tag",
+    "registry": true,
+    "raw": "dialog",
+    "name": "dialog",
+    "escapedName": "dialog",
+    "rawSpec": "",
+    "saveSpec": null,
+    "fetchSpec": "latest"
+  },
+  "_requiredBy": [
+    "#USER",
+    "/"
+  ],
+  "_resolved": "https://registry.npmjs.org/dialog/-/dialog-0.3.1.tgz",
+  "_shasum": "8fd9b47fdb277bb9e82172bb6e26bc578aa61254",
+  "_spec": "dialog",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt",
+  "author": {
+    "name": "Tomás Pollak",
+    "email": "tomas@forkhq.com",
+    "url": "http://forkhq.com"
+  },
+  "bin": {
+    "show_dialog": "./bin/dialog.js"
+  },
+  "bugs": {
+    "url": "https://github.com/tomas/dialog/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {},
+  "deprecated": false,
+  "description": "Show alert dialogs using Node.",
+  "devDependencies": {},
+  "engines": {
+    "node": "*"
+  },
+  "homepage": "https://github.com/tomas/dialog#readme",
+  "name": "dialog",
+  "optionalDependencies": {},
+  "repository": {
+    "url": "git+https://github.com/tomas/dialog.git"
+  },
+  "version": "0.3.1"
+}
diff --git a/wrt/node_modules/diskdb/README.md b/wrt/node_modules/diskdb/README.md
new file mode 100644 (file)
index 0000000..6a3f317
--- /dev/null
@@ -0,0 +1,362 @@
+# diskDB [![Build Status](https://secure.travis-ci.org/arvindr21/diskDB.png?branch=master)](https://travis-ci.org/arvindr21/diskDB) [![NPM version](https://badge-me.herokuapp.com/api/npm/diskdb.png)](http://badges.enytc.com/for/npm/diskdb) [![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/arvindr21/diskDB?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+
+[![NPM](https://nodei.co/npm/diskdb.png?downloads=true&stars=true)](https://nodei.co/npm/diskdb/)
+
+A Lightweight Disk based JSON Database with a MongoDB like API for Node.
+
+_You will never know that you are interacting with a File System_
+
+## Contents
+
+* [Getting Started](#getting-started)
+* [Documentation](#documentation)
+  * [Connect](#connect-to-db)
+  * [Load Collections](#load-collections)
+  * [Write/Save](#writesave-to-collection)
+  * [Read](#read-from-collection)
+  * [Update](#update-collection)
+  * [Remove](#remove-collection)
+  * [Count](#count)
+* [Examples](#examples)
+* [Performance](#performance)
+* [Contributing](#contributing)
+* [Release History](#release-history)
+
+## Getting Started
+Install the module locally :  
+```bash
+$ npm install diskdb
+```
+
+```js
+var db = require('diskdb');
+db = db.connect('/path/to/db-folder', ['collection-name']);
+// you can access the traditional JSON DB methods here
+```
+
+## Documentation
+### Connect to DB
+```js
+db.connect(pathToFolder, ['filename']);
+```
+Filename will be the name of the JSON file. You can omit the extension, diskDB will take care of it for you.
+
+```js
+var db = require('diskdb');
+db = db.connect('/examples/db', ['articles']);
+// or simply
+db.connect('/examples/db', ['articles']);
+```
+
+This will check for a directory at given path, if it does not exits, diskDB will throw an error and exit.
+
+If the directory exists but the file/collection does not exist, diskDB will create it for you.
+
+**Note** : If you have manually created an empty JSON file, please make sure that it contains at least an empty array.
+
+```js
+[]
+```
+Else it will throw an error like
+
+```bash
+undefined:0
+
+^
+SyntaxError: Unexpected end of input
+```
+---
+### Load Collections
+Alternatively you can also load collections like
+
+```js
+var db = require('diskdb');
+// this
+db = db.connect('/examples/db');
+db.loadCollections(['articles']);
+//or
+db.connect('/examples/db');
+db.loadCollections(['articles']);
+//or
+db.connect('/examples/db')
+  .loadCollections(['articles']);
+//or
+db.connect('/examples/db', ['articles']);
+```
+#### Load Multiple Collections
+
+```js
+var db = require('diskdb');
+db.connect('/examples/db', ['articles','comments','users']);
+```
+---
+### Write/Save to Collection
+```js
+db.collectionName.save(object);
+```
+Once you have loaded a collection, you can access the collection's methods using the dot notation like
+
+```js
+db.[collectionName].[methodname]
+```
+To save the data, you can use
+```js
+var db = require('diskdb');
+db.connect('db', ['articles']);
+var article = {
+    title : "diskDB rocks",
+    published : "today",
+    rating : "5 stars"
+}
+db.articles.save(article);
+// or
+db.articles.save([article]);
+```
+The saved data will be
+```js
+[
+    {
+        "title": "diskDB rocks",
+        "published": "today",
+        "rating": "5 stars",
+        "_id": "0f6047c6c69149f0be0c8f5943be91be"
+    }
+]
+```
+You can also save multiple objects at once like
+
+```js
+var db = require('diskdb');
+db.connect('db', ['articles']);
+var article1 = {
+    title : 'diskDB rocks',
+    published : 'today',
+    rating : '5 stars'
+}
+
+var article2 = {
+    title : 'diskDB rocks',
+    published : 'yesterday',
+    rating : '5 stars'
+}
+
+var article3 = {
+    title : 'diskDB rocks',
+    published : 'today',
+    rating : '4 stars'
+}
+db.articles.save([article1, article2, article3]);
+```
+And this will return the inserted objects
+
+```js
+[ { title: 'diskDB rocks',
+    published: 'today',
+    rating: '4 stars',
+    _id: 'b1cdbb3525b84e8c822fc78896d0ca7b' },
+  { title: 'diskDB rocks',
+    published: 'yesterday',
+    rating: '5 stars',
+    _id: '42997c62e1714e9f9d88bf3b87901f3b' },
+  { title: 'diskDB rocks',
+    published: 'today',
+    rating: '5 stars',
+    _id: '4ca1c1597ddc4020bc41b4418e7a568e' } ]
+```
+---
+### Read from Collection
+There are 2 methods available for reading the JSON collection
+* db.collectionName.find(query)
+* db.collectionName.findOne(query)
+
+
+#### db.collectionName.find()
+```js
+var db = require('diskdb');
+db.connect('/examples/db', ['articles']);
+db.articles.find();
+```
+This will return all the records
+```js
+[{
+    title: 'diskDB rocks',
+    published: 'today',
+    rating: '5 stars',
+    _id: '0f6047c6c69149f0be0c8f5943be91be'
+}]
+```
+You can also query with a criteria like
+```js
+var db = require('diskdb');
+db.connect('/examples/db', ['articles']);
+db.articles.find({rating : "5 stars"});
+```
+This will return all the articles which have a rating of 5.
+
+Find can take multiple criteria
+```js
+var db = require('diskdb');
+db.connect('/examples/db', ['articles']);
+db.articles.find({rating : "5 stars", published: "yesterday"});
+```
+This will return all the articles with a rating of 5, published yesterday.
+
+Nested JSON :
+
+```js
+var articleComments = {
+    title: 'diskDB rocks',
+    published: '2 days ago',
+    comments: [{
+        name: 'a user',
+        comment: 'this is cool',
+        rating: 2
+    }, {
+        name: 'b user',
+        comment: 'this is ratchet',
+        rating: 3
+    }, {
+        name: 'c user',
+        comment: 'this is awesome',
+        rating: 2
+    }]
+}
+```
+```js
+var savedArticle = db.articles.save([articleComments);
+foundArticles = db.articles.find({rating : 2});
+```
+Since diskDB is mostly for light weight data storage, avoid nested structures and huge datasets.
+
+#### db.collectionName.findOne(query)
+```js
+var db = require('diskdb');
+db.connect('/examples/db', ['articles']);
+db.articles.findOne();
+```
+
+If you do not pass a query, diskDB will return the first article in the collection. If you pass a query, it will return first article in the filtered data.
+
+```js
+var db = require('diskdb');
+db.connect('/examples/db', ['articles']);
+db.articles.findOne({_id: '0f6047c6c69149f0be0c8f5943be91be'});
+```
+---
+### Update Collection
+```js
+db.collectionName.update(query, data, options);
+```
+
+You can also update one or many objects in the collection
+```js
+options = {
+    multi: false, // update multiple - default false
+    upsert: false // if object is not found, add it (update-insert) - default false
+}
+```
+Usage
+```js
+var db = require('diskdb');
+db.connect('/examples/db', ['articles']);
+
+var query = {
+  title : 'diskDB rocks'
+};
+
+var dataToBeUpdate = {
+  title : 'diskDB rocks again!',
+};
+
+var options = {
+   multi: false,
+   upsert: false
+};
+
+var updated = db.articles.update(query, dataToBeUpdate, options);
+console.log(updated); // { updated: 1, inserted: 0 }
+```
+---
+### Remove Collection
+```js
+db.collectionName.remove(query, multi);
+```
+You can remove the entire collection (including the file) or you can remove the matched objects by passing in a query. When you pass a query, you can either delete all the matched objects or only the first one by passing `multi` as `false`. The default value of `multi` is `true`.
+
+```js
+var db = require('diskdb');
+db.connect('/examples/db', ['articles']);
+db.articles.remove({rating : "5 stars"});
+```
+```js
+var db = require('diskdb');
+db.connect('/examples/db', ['articles']);
+db.articles.remove({rating : "5 stars"}, true); // remove all matched. Default - multi = true
+```
+
+```js
+var db = require('diskdb');
+db.connect('/examples/db', ['articles']);
+db.articles.remove({rating : "5 stars"}, false); // remove only the first match
+```
+Using remove without any params will delete the file and will remove the db instance.
+```js
+var db = require('diskdb');
+db.connect('/examples/db', ['articles']);
+db.articles.remove();
+```
+After the above operation `db.articles` is `undefined`.
+
+---
+### Count
+```js
+db.collectionName.count();
+```
+Will return the count of objects in the Collection
+```js
+var db = require('diskdb');
+db.connect('/examples/db', ['articles']);
+db.articles.count(); // will give the count
+```
+
+## Examples
+Refer to the [examples](https://github.com/arvindr21/diskDB/tree/master/examples) folder.
+
+## Performance
+To validate diskDB's performance and to check if it meets your needs, you can clone this repo and run
+
+```bash
+$ node performance/time.js
+```
+An average of few tests (run on OS X - 10.9.3 | 2.9GHZ i7 | 8GB 1600MHz DDR3) can be found below
+
+#### Time taken to process x number of objects (in ms) vs Action Performed
+
+\# of objects          | 1          | 1000       | 10000      | 100000     | 1000000
+-----------------------|------------|------------|------------|------------|-------------
+Save                   | 1 ms       | 15 ms      | 137 ms     | 1728 ms    | 14425 ms   
+Find all without query | 0 ms       | 2 ms       | 12 ms      | 204 ms     | 2923 ms    
+Find all with query    | 0 ms       | 2 ms       | 17 ms      | 738 ms     | 1985 ms    
+Find one without query | 0 ms       | 1 ms       | 9 ms       | 791 ms     | 1676 ms    
+Find one with query    | 0 ms       | 1 ms       | 8 ms       | 219 ms     | 1410 ms    
+Update all records     | 1 ms       | 7 ms       | 61 ms      | 206 ms     | 48035 ms   
+Get count              | 0 ms       | 3 ms       | 11 ms      | 260 ms     | 2420 ms    
+Remove with query      | 0 ms       | 7 ms       | 59 ms      | 984 ms     | 48191 ms   
+Remove collection      | 0 ms       | 1 ms       | 4 ms       | 52 ms      | 154 ms     
+File size              | 0.000111 MB| 0.116671 MB| 1.196671 MB| 12.26667 MB| 125.66667 MB
+
+
+## Contributing
+See the [CONTRIBUTING Guidelines](https://github.com/arvindr21/diskDB/blob/master/CONTRIBUTING.md)
+
+## Release History
+* 0.1.x
+  * Base Module with
+    * Connect to a Folder
+    * Access a Collection/File
+    * Create Read Update Delete on JSON object
+    * Minor fixes and tests
+    * Performance improvements
+
+## License
+Copyright (c) 2014 Arvind Ravulavaru. Licensed under the MIT license.
diff --git a/wrt/node_modules/diskdb/lib/collection.js b/wrt/node_modules/diskdb/lib/collection.js
new file mode 100644 (file)
index 0000000..1924f03
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+ * diskDB
+ * http://arvindr21.github.io/diskDB
+ *
+ * Copyright (c) 2014 Arvind Ravulavaru
+ * Licensed under the MIT license.
+ */
+
+var util = require('./util'),
+    path = require('path'),
+    uuid = require('node-uuid');
+
+module.exports = function(db, collectionName) {
+    var coltn = {};
+    coltn.collectionName = collectionName;
+    coltn._f = path.join(db._db.path, (collectionName + '.json'));
+
+    coltn.find = function(query) {
+        var collection = JSON.parse(util.readFromFile(this._f));
+        if (!query || Object.keys(query).length === 0) {
+            return collection;
+        } else {
+            var searcher = new util.ObjectSearcher(); 
+            return searcher.findAllInObject(collection, query, true);
+        }
+    };
+
+    coltn.findOne = function(query) {
+        var collection = JSON.parse(util.readFromFile(this._f));
+        if (!query) {
+            return collection[0];
+        } else {
+            var searcher = new util.ObjectSearcher(); 
+            return searcher.findAllInObject(collection, query, false)[0];
+        }
+    };
+
+    coltn.save = function(data) {
+        var collection = JSON.parse(util.readFromFile(this._f));
+        if (typeof data === 'object' && data.length) {
+            if (data.length === 1) {
+                if (data[0].length > 0) {
+                    data = data[0];
+                }
+            }
+            var retCollection = [];
+            for (var i = data.length - 1; i >= 0; i--) {
+                var d = data[i];
+                d._id = uuid.v4().replace(/-/g, '');
+                collection.push(d);
+                retCollection.push(d);
+            }
+            util.writeToFile(this._f, collection);
+            return retCollection;
+        } {
+            data._id = uuid.v4().replace(/-/g, '');
+            collection.push(data);
+            util.writeToFile(this._f, collection);
+            return data;
+        }
+    };
+
+    coltn.update = function(query, data, options) {
+        var ret = {},
+            collection = JSON.parse(util.readFromFile(this._f)); // update
+        var records = util.finder(collection, query, true);
+        if (records.length) {
+            if (options && options.multi) {
+                collection = util.updateFiltered(collection, query, data, true);
+                ret.updated = records.length;
+                ret.inserted = 0;
+            } else {
+                collection = util.updateFiltered(collection, query, data, false);
+                ret.updated = 1;
+                ret.inserted = 0;
+            }
+        } else {
+            if (options && options.upsert) {
+                data._id = uuid.v4().replace(/-/g, '');
+                collection.push(data);
+                ret.updated = 0;
+                ret.inserted = 1;
+            } else {
+                ret.updated = 0;
+                ret.inserted = 0;
+            }
+        }
+        util.writeToFile(this._f, collection);
+        return ret;
+    };
+
+    coltn.remove = function(query, multi) {
+        if (query) {
+            var collection = JSON.parse(util.readFromFile(this._f));
+            if (typeof multi === 'undefined') {
+                multi = true;
+            }
+            collection = util.removeFiltered(collection, query, multi);
+
+            util.writeToFile(this._f, collection);
+        } else {
+            util.removeFile(this._f);
+            delete db[collectionName];
+        }
+        return true;
+    };
+
+    coltn.count = function() {
+        return (JSON.parse(util.readFromFile(this._f))).length;
+    };
+
+    return coltn;
+};
diff --git a/wrt/node_modules/diskdb/lib/diskdb.js b/wrt/node_modules/diskdb/lib/diskdb.js
new file mode 100644 (file)
index 0000000..bc13a11
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * diskDB
+ * http://arvindr21.github.io/diskDB
+ *
+ * Copyright (c) 2014 Arvind Ravulavaru
+ * Licensed under the MIT license.
+ */
+
+'use strict';
+//global modules
+var path = require('path'),
+    c = require('chalk'),
+    e = c.red,
+    s = c.green;
+
+//local modules
+var util = require('./util');
+
+
+var db = {
+    connect: function(path, collections) {
+        if (util.isValidPath(path)) {
+            var _db = {};
+            _db.path = path;
+            this._db = _db;
+            console.log(s('Successfully connected to : ' + path));
+            if (collections) {
+                this.loadCollections(collections);
+            }
+        } else {
+            console.log(e('The DB Path [' + path + '] does not seem to be valid. Recheck the path and try again'));
+            return false;
+        }
+        return this;
+    },
+    loadCollections: function(collections) {
+        if (!this._db) {
+            console.log(e('Initialize the DB before you add collections. Use : ', 'db.connect(\'path-to-db\');'));
+            return false;
+        }
+        if (typeof collections === 'object' && collections.length) {
+            for (var i = 0; i < collections.length; i++) {
+                var p = path.join(this._db.path, (collections[i].indexOf('.json') >= 0 ? collections[i] : collections[i] + '.json'));
+                if (!util.isValidPath(p)) {
+                    util.writeToFile(p);
+                }
+                var _c = collections[i].replace('.json', '');
+                this[_c] = new require('./collection')(this, _c);
+            }
+        } else {
+            console.log(e('Invalid Collections Array.', 'Expected Format : ', '[\'collection1\',\'collection2\',\'collection3\']'));
+        }
+        return this;
+    }
+
+};
+
+module.exports = db;
diff --git a/wrt/node_modules/diskdb/lib/util.js b/wrt/node_modules/diskdb/lib/util.js
new file mode 100644 (file)
index 0000000..9885c0c
--- /dev/null
@@ -0,0 +1,159 @@
+/*
+ * diskDB
+ * http://arvindr21.github.io/diskDB
+ *
+ * Copyright (c) 2014 Arvind Ravulavaru
+ * Licensed under the MIT license.
+ */
+
+/*jshint -W027*/
+var fs = require('fs');
+var merge = require('merge');
+var util = {};
+
+util.isValidPath = function(path) {
+    return fs.existsSync(path);
+};
+
+util.writeToFile = function(outputFilename, content) {
+    if (!content) {
+        content = [];
+    }
+    fs.writeFileSync(outputFilename, JSON.stringify(content, null, 0));
+};
+
+util.readFromFile = function(file) {
+    return fs.readFileSync(file, 'utf-8');
+};
+
+util.removeFile = function(file) {
+    return fs.unlinkSync(file);
+};
+
+util.updateFiltered = function(collection, query, data, multi) {
+    // break 2 loops at once - multi : false
+    loop: for (var i = collection.length - 1; i >= 0; i--) {
+        var c = collection[i];
+        for (var p in query) {
+            if (p in c && c[p] == query[p]) {
+                collection[i] = merge(c, data);
+                if (!multi) {
+                    break loop;
+                }
+            }
+        }
+    }
+    return collection;
+};
+
+// [TODO] : Performance
+util.removeFiltered = function(collection, query, multi) {
+    // break 2 loops at once -  multi : false
+    loop: for (var i = collection.length - 1; i >= 0; i--) {
+        var c = collection[i];
+        for (var p in query) {
+            if (p in c && c[p] == query[p]) {
+                collection.splice(i, 1);
+                if (!multi) {
+                    break loop;
+                }
+            }
+        }
+    }
+    return collection;
+};
+
+// [TODO] : Performance
+util.finder = function(collection, query, multi) {
+    var retCollection = [];
+    loop: for (var i = collection.length - 1; i >= 0; i--) {
+        var c = collection[i];
+        for (var p in query) {
+            if (p in c && c[p] == query[p]) {
+                retCollection.push(collection[i]);
+                if (!multi) {
+                    break loop;
+                }
+            }
+        }
+    }
+    return retCollection;
+};
+
+/** recursive finder **/
+util.ObjectSearcher = function() {
+    this.results = [];
+    this.objects = [];
+    this.resultIDS = {};
+};
+
+util.ObjectSearcher.prototype.findAllInObject = function(object, valueOBj, isMulti) {
+    for (var objKey in object) {
+        this.performSearch(object[objKey], valueOBj, object[objKey]);
+        if (!isMulti && this.results.length == 1) {
+            return this.results;
+        }
+    }
+
+    while (this.objects.length !== 0) {
+        var objRef = this.objects.pop();
+        this.performSearch(objRef['_obj'], valueOBj, objRef['parent']);
+        if (!isMulti && this.results.length == 1) {
+            return this.results;
+        }
+    }
+
+    return this.results;
+};
+
+util.ObjectSearcher.prototype.performSearch = function(object, valueOBj, opt_parentObj) {
+  for (var criteria in valueOBj) {
+    var query = {};
+    query[criteria] = valueOBj[criteria];
+    this.searchObject(object, query, opt_parentObj);
+  }
+
+  for (var i = 0; i < this.results.length; i++) {
+    var result = this.results[i];
+    for (var field in valueOBj) {
+      if (result[field] !== undefined) {
+        if (result[field] !== valueOBj[field]) {
+          this.results.splice(i, 1);
+        }
+      }
+    }
+  }
+};
+
+util.ObjectSearcher.prototype.searchObject = function(object, valueOBj, opt_parentObj) {
+    for (var objKey in object) {
+        if (typeof object[objKey] != 'object') {
+            if (valueOBj[objKey] == object[objKey]) {
+                if (opt_parentObj !== undefined) {
+                    if (this.resultIDS[opt_parentObj['_id']] === undefined) {
+                        this.results.push(opt_parentObj);
+                        this.resultIDS[opt_parentObj['_id']] = '';
+                    }
+                } else {
+                    if (this.resultIDS[object['_id']] === undefined) {
+                        this.results.push(object);
+                        this.resultIDS[object['_id']] = '';
+                    }
+                }
+            }
+        } else {
+            var obj = object;
+            if (opt_parentObj !== undefined) {
+                obj = opt_parentObj;
+            }
+            var objRef = {
+                parent: obj,
+                _obj: object[objKey]
+            };
+
+            this.objects.push(objRef);
+        }
+    }
+};
+
+module.exports = util;
diff --git a/wrt/node_modules/diskdb/node_modules/ansi-styles/ansi-styles.js b/wrt/node_modules/diskdb/node_modules/ansi-styles/ansi-styles.js
new file mode 100644 (file)
index 0000000..3da548c
--- /dev/null
@@ -0,0 +1,38 @@
+'use strict';
+var styles = module.exports;
+
+var codes = {
+       reset: [0, 0],
+
+       bold: [1, 22],
+       italic: [3, 23],
+       underline: [4, 24],
+       inverse: [7, 27],
+       strikethrough: [9, 29],
+
+       black: [30, 39],
+       red: [31, 39],
+       green: [32, 39],
+       yellow: [33, 39],
+       blue: [34, 39],
+       magenta: [35, 39],
+       cyan: [36, 39],
+       white: [37, 39],
+       gray: [90, 39],
+
+       bgBlack: [40, 49],
+       bgRed: [41, 49],
+       bgGreen: [42, 49],
+       bgYellow: [43, 49],
+       bgBlue: [44, 49],
+       bgMagenta: [45, 49],
+       bgCyan: [46, 49],
+       bgWhite: [47, 49]
+};
+
+Object.keys(codes).forEach(function (key) {
+       var val = codes[key];
+       var style = styles[key] = {};
+       style.open = '\x1b[' + val[0] + 'm';
+       style.close = '\x1b[' + val[1] + 'm';
+});
diff --git a/wrt/node_modules/diskdb/node_modules/ansi-styles/package.json b/wrt/node_modules/diskdb/node_modules/ansi-styles/package.json
new file mode 100644 (file)
index 0000000..95cb77f
--- /dev/null
@@ -0,0 +1,109 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "ansi-styles@~1.0.0",
+        "scope": null,
+        "escapedName": "ansi-styles",
+        "name": "ansi-styles",
+        "rawSpec": "~1.0.0",
+        "spec": ">=1.0.0 <1.1.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/diskdb/node_modules/chalk"
+    ]
+  ],
+  "_from": "ansi-styles@>=1.0.0 <1.1.0",
+  "_id": "ansi-styles@1.0.0",
+  "_inCache": true,
+  "_location": "/diskdb/ansi-styles",
+  "_npmUser": {
+    "name": "sindresorhus",
+    "email": "sindresorhus@gmail.com"
+  },
+  "_npmVersion": "1.3.15",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "ansi-styles@~1.0.0",
+    "scope": null,
+    "escapedName": "ansi-styles",
+    "name": "ansi-styles",
+    "rawSpec": "~1.0.0",
+    "spec": ">=1.0.0 <1.1.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/diskdb/chalk"
+  ],
+  "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.0.0.tgz",
+  "_shasum": "cb102df1c56f5123eab8b67cd7b98027a0279178",
+  "_shrinkwrap": null,
+  "_spec": "ansi-styles@~1.0.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/diskdb/node_modules/chalk",
+  "author": {
+    "name": "Sindre Sorhus",
+    "email": "sindresorhus@gmail.com",
+    "url": "http://sindresorhus.com"
+  },
+  "bugs": {
+    "url": "https://github.com/sindresorhus/ansi-styles/issues"
+  },
+  "dependencies": {},
+  "description": "ANSI escape codes for colorizing strings in the terminal",
+  "devDependencies": {
+    "mocha": "~1.12.0"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "cb102df1c56f5123eab8b67cd7b98027a0279178",
+    "tarball": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.0.0.tgz"
+  },
+  "engines": {
+    "node": ">=0.8.0"
+  },
+  "files": [
+    "ansi-styles.js"
+  ],
+  "homepage": "https://github.com/sindresorhus/ansi-styles",
+  "keywords": [
+    "ansi",
+    "styles",
+    "color",
+    "colour",
+    "colors",
+    "terminal",
+    "console",
+    "cli",
+    "string",
+    "tty",
+    "escape",
+    "formatting",
+    "rgb",
+    "256",
+    "shell",
+    "xterm",
+    "log",
+    "logging",
+    "command-line",
+    "text"
+  ],
+  "license": "MIT",
+  "main": "ansi-styles",
+  "maintainers": [
+    {
+      "name": "sindresorhus",
+      "email": "sindresorhus@gmail.com"
+    }
+  ],
+  "name": "ansi-styles",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/sindresorhus/ansi-styles.git"
+  },
+  "scripts": {
+    "test": "mocha"
+  },
+  "version": "1.0.0"
+}
diff --git a/wrt/node_modules/diskdb/node_modules/ansi-styles/readme.md b/wrt/node_modules/diskdb/node_modules/ansi-styles/readme.md
new file mode 100644 (file)
index 0000000..4ac8cbd
--- /dev/null
@@ -0,0 +1,65 @@
+# ansi-styles [![Build Status](https://secure.travis-ci.org/sindresorhus/ansi-styles.png?branch=master)](http://travis-ci.org/sindresorhus/ansi-styles)
+
+> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for colorizing strings in the terminal.
+
+You probably want the higher-level [chalk](https://github.com/sindresorhus/chalk) module for styling your strings.
+
+![screenshot](screenshot.png)
+
+
+## Install
+
+Install with [npm](https://npmjs.org/package/ansi-styles): `npm install --save ansi-styles`
+
+
+## Example
+
+```js
+var ansi = require('ansi-styles');
+
+console.log(ansi.green.open + 'Hello world!' + ansi.green.close);
+```
+
+## API
+
+Each style has an `open` and `close` property.
+
+
+## Styles
+
+### General
+
+- reset
+- bold
+- italic
+- underline
+- inverse
+- strikethrough
+
+### Text colors
+
+- black
+- red
+- green
+- yellow
+- blue
+- magenta
+- cyan
+- white
+- gray
+
+### Background colors
+
+- bgBlack
+- bgRed
+- bgGreen
+- bgYellow
+- bgBlue
+- bgMagenta
+- bgCyan
+- bgWhite
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/wrt/node_modules/diskdb/node_modules/chalk/index.js b/wrt/node_modules/diskdb/node_modules/chalk/index.js
new file mode 100644 (file)
index 0000000..a21f702
--- /dev/null
@@ -0,0 +1,63 @@
+'use strict';
+var ansi = require('ansi-styles');
+var stripAnsi = require('strip-ansi');
+var hasColor = require('has-color');
+var defineProps = Object.defineProperties;
+var chalk = module.exports;
+
+var styles = (function () {
+       var ret = {};
+
+       ansi.grey = ansi.gray;
+
+       Object.keys(ansi).forEach(function (key) {
+               ret[key] = {
+                       get: function () {
+                               this._styles.push(key);
+                               return this;
+                       }
+               };
+       });
+
+       return ret;
+})();
+
+function init() {
+       var ret = {};
+
+       Object.keys(styles).forEach(function (name) {
+               ret[name] = {
+                       get: function () {
+                               var obj = defineProps(function self() {
+                                       var str = [].slice.call(arguments).join(' ');
+
+                                       if (!chalk.enabled) {
+                                               return str;
+                                       }
+
+                                       return self._styles.reduce(function (str, name) {
+                                               var code = ansi[name];
+                                               return str ? code.open + str + code.close : '';
+                                       }, str);
+                               }, styles);
+
+                               obj._styles = [];
+
+                               return obj[name];
+                       }
+               }
+       });
+
+       return ret;
+}
+
+defineProps(chalk, init());
+
+chalk.styles = ansi;
+chalk.stripColor = stripAnsi;
+chalk.supportsColor = hasColor;
+
+// detect mode if not set manually
+if (chalk.enabled === undefined) {
+       chalk.enabled = chalk.supportsColor;
+}
diff --git a/wrt/node_modules/diskdb/node_modules/chalk/package.json b/wrt/node_modules/diskdb/node_modules/chalk/package.json
new file mode 100644 (file)
index 0000000..59fe55b
--- /dev/null
@@ -0,0 +1,111 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "chalk@^0.4.0",
+        "scope": null,
+        "escapedName": "chalk",
+        "name": "chalk",
+        "rawSpec": "^0.4.0",
+        "spec": ">=0.4.0 <0.5.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/diskdb"
+    ]
+  ],
+  "_from": "chalk@>=0.4.0 <0.5.0",
+  "_id": "chalk@0.4.0",
+  "_inCache": true,
+  "_location": "/diskdb/chalk",
+  "_npmUser": {
+    "name": "sindresorhus",
+    "email": "sindresorhus@gmail.com"
+  },
+  "_npmVersion": "1.3.17",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "chalk@^0.4.0",
+    "scope": null,
+    "escapedName": "chalk",
+    "name": "chalk",
+    "rawSpec": "^0.4.0",
+    "spec": ">=0.4.0 <0.5.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/diskdb"
+  ],
+  "_resolved": "https://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz",
+  "_shasum": "5199a3ddcd0c1efe23bc08c1b027b06176e0c64f",
+  "_shrinkwrap": null,
+  "_spec": "chalk@^0.4.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/diskdb",
+  "author": {
+    "name": "Sindre Sorhus",
+    "email": "sindresorhus@gmail.com",
+    "url": "http://sindresorhus.com"
+  },
+  "bugs": {
+    "url": "https://github.com/sindresorhus/chalk/issues"
+  },
+  "dependencies": {
+    "ansi-styles": "~1.0.0",
+    "has-color": "~0.1.0",
+    "strip-ansi": "~0.1.0"
+  },
+  "description": "Terminal string styling done right. Created because the `colors` module does some really horrible things.",
+  "devDependencies": {
+    "mocha": "~1.x"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "5199a3ddcd0c1efe23bc08c1b027b06176e0c64f",
+    "tarball": "https://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz"
+  },
+  "engines": {
+    "node": ">=0.8.0"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/sindresorhus/chalk",
+  "keywords": [
+    "color",
+    "colour",
+    "colors",
+    "terminal",
+    "console",
+    "cli",
+    "string",
+    "ansi",
+    "styles",
+    "tty",
+    "formatting",
+    "rgb",
+    "256",
+    "shell",
+    "xterm",
+    "log",
+    "logging",
+    "command-line",
+    "text"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "sindresorhus",
+      "email": "sindresorhus@gmail.com"
+    }
+  ],
+  "name": "chalk",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/sindresorhus/chalk.git"
+  },
+  "scripts": {
+    "test": "mocha"
+  },
+  "version": "0.4.0"
+}
diff --git a/wrt/node_modules/diskdb/node_modules/chalk/readme.md b/wrt/node_modules/diskdb/node_modules/chalk/readme.md
new file mode 100644 (file)
index 0000000..46813ac
--- /dev/null
@@ -0,0 +1,158 @@
+# <img width="250" src="logo.png" alt="chalk">
+
+> Terminal string styling done right
+
+[![Build Status](https://secure.travis-ci.org/sindresorhus/chalk.png?branch=master)](http://travis-ci.org/sindresorhus/chalk)
+
+[colors.js](https://github.com/Marak/colors.js) is currently the most popular string styling module, but it has serious deficiencies like extending String.prototype which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68). Although there are other ones, they either do too much or not enough.
+
+**Chalk is a clean and focused alternative.**
+
+![screenshot](screenshot.png)
+
+
+## Why
+
+- **Doesn't extend String.prototype**
+- Expressive API
+- Clean and focused
+- Auto-detects color support
+- Actively maintained
+- [Used by 150+ modules](https://npmjs.org/browse/depended/chalk)
+
+
+## Install
+
+Install with [npm](https://npmjs.org/package/chalk): `npm install --save chalk`
+
+
+## Example
+
+Chalk comes with an easy to use composable API where you just chain and nest the styles you want.
+
+```js
+var chalk = require('chalk');
+
+// style a string
+console.log(  chalk.blue('Hello world!')  );
+
+// combine styled and normal strings
+console.log(  chalk.blue('Hello'), 'World' + chalk.red('!')  );
+
+// compose multiple styles using the chainable API
+console.log(  chalk.blue.bgRed.bold('Hello world!')  );
+
+// nest styles
+console.log(  chalk.red('Hello', chalk.underline.bgBlue('world') + '!')  );
+
+// pass in multiple arguments
+console.log(  chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz')  );
+```
+
+You can easily define your own themes.
+
+```js
+var chalk = require('chalk');
+var error = chalk.bold.red;
+console.log(error('Error!'));
+```
+
+
+## API
+
+### chalk.`<style>[.<style>...](string, [string...])`
+
+Example: `chalk.red.bold.underline('Hello', 'world');`
+
+Chain [styles](#styles) and call the last one as a method with a string argument. Order doesn't matter.
+
+Multiple arguments will be separated by space.
+
+### chalk.enabled
+
+Color support is automatically detected, but you can override it.
+
+### chalk.supportsColor
+
+Detect whether the terminal [supports color](https://github.com/sindresorhus/has-color).
+
+Can be overridden by the user with the flags `--color` and `--no-color`.
+
+Used internally and handled for you, but exposed for convenience.
+
+### chalk.styles
+
+Exposes the styles as [ANSI escape codes](https://github.com/sindresorhus/ansi-styles).
+
+Generally not useful, but you might need just the `.open` or `.close` escape code if you're mixing externally styled strings with yours.
+
+```js
+var chalk = require('chalk');
+
+console.log(chalk.styles.red);
+//=> {open: '\x1b[31m', close: '\x1b[39m'}
+
+console.log(chalk.styles.red.open + 'Hello' + chalk.styles.red.close);
+```
+
+### chalk.stripColor(string)
+
+[Strip color](https://github.com/sindresorhus/strip-ansi) from a string.
+
+Can be useful in combination with `.supportsColor` to strip color on externally styled text when it's not supported.
+
+Example:
+
+```js
+var chalk = require('chalk');
+var styledString = fromExternal();
+
+if (!chalk.supportsColor) {
+       chalk.stripColor(styledString);
+}
+```
+
+
+## Styles
+
+### General
+
+- reset
+- bold
+- italic
+- underline
+- inverse
+- strikethrough
+
+### Text colors
+
+- black
+- red
+- green
+- yellow
+- blue
+- magenta
+- cyan
+- white
+- gray
+
+### Background colors
+
+- bgBlack
+- bgRed
+- bgGreen
+- bgYellow
+- bgBlue
+- bgMagenta
+- bgCyan
+- bgWhite
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
+
+
+-
+
+[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/sindresorhus/chalk/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
diff --git a/wrt/node_modules/diskdb/package.json b/wrt/node_modules/diskdb/package.json
new file mode 100644 (file)
index 0000000..abff810
--- /dev/null
@@ -0,0 +1,111 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "diskdb",
+        "scope": null,
+        "escapedName": "diskdb",
+        "name": "diskdb",
+        "rawSpec": "",
+        "spec": "latest",
+        "type": "tag"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt"
+    ]
+  ],
+  "_from": "diskdb@latest",
+  "_id": "diskdb@0.1.17",
+  "_inCache": true,
+  "_location": "/diskdb",
+  "_nodeVersion": "4.4.6",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/diskdb-0.1.17.tgz_1477493956175_0.15308092231862247"
+  },
+  "_npmUser": {
+    "name": "arvindr21",
+    "email": "arvind.ravulavaru@gmail.com"
+  },
+  "_npmVersion": "3.10.2",
+  "_phantomChildren": {
+    "has-color": "0.1.7",
+    "strip-ansi": "0.1.1"
+  },
+  "_requested": {
+    "raw": "diskdb",
+    "scope": null,
+    "escapedName": "diskdb",
+    "name": "diskdb",
+    "rawSpec": "",
+    "spec": "latest",
+    "type": "tag"
+  },
+  "_requiredBy": [
+    "#USER"
+  ],
+  "_resolved": "https://registry.npmjs.org/diskdb/-/diskdb-0.1.17.tgz",
+  "_shasum": "8abd095196b33b406791f1494b6b13b4422240c4",
+  "_shrinkwrap": null,
+  "_spec": "diskdb",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt",
+  "author": {
+    "name": "Arvind Ravulavaru",
+    "email": "arvind.ravulavaru@gmail.com",
+    "url": "http://thejackalofjavascript.com/"
+  },
+  "bugs": {
+    "url": "https://github.com/arvindr21/diskdb/issues"
+  },
+  "dependencies": {
+    "chalk": "^0.4.0",
+    "merge": "^1.1.3",
+    "node-uuid": "^1.4.1"
+  },
+  "description": "A Lightweight Disk based JSON Database with a MongoDB like API",
+  "devDependencies": {
+    "grunt": "^1.0.0",
+    "grunt-contrib-jshint": "^1.0.0",
+    "grunt-contrib-nodeunit": "^1.0.0",
+    "grunt-contrib-watch": "^1.0.0",
+    "jshint-stylish": "^0.2.0",
+    "load-grunt-tasks": "^0.4.0",
+    "time-grunt": "^0.3.1"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "8abd095196b33b406791f1494b6b13b4422240c4",
+    "tarball": "https://registry.npmjs.org/diskdb/-/diskdb-0.1.17.tgz"
+  },
+  "files": [
+    "lib"
+  ],
+  "gitHead": "dd4a3ec7df52ae55c2247ba9e9892fdd1249a909",
+  "homepage": "http://arvindr21.github.io/diskDB",
+  "keywords": [
+    "diskDB",
+    "JSON",
+    "Database",
+    "file system",
+    "CRUD",
+    "lightweight"
+  ],
+  "license": "MIT",
+  "main": "lib/diskdb.js",
+  "maintainers": [
+    {
+      "name": "arvindr21",
+      "email": "arvind.ravulavaru@gmail.com"
+    }
+  ],
+  "name": "diskdb",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/arvindr21/diskdb.git"
+  },
+  "scripts": {
+    "test": "grunt"
+  },
+  "version": "0.1.17"
+}
diff --git a/wrt/node_modules/ee-first/LICENSE b/wrt/node_modules/ee-first/LICENSE
new file mode 100644 (file)
index 0000000..a7ae8ee
--- /dev/null
@@ -0,0 +1,22 @@
+
+The MIT License (MIT)
+
+Copyright (c) 2014 Jonathan Ong me@jongleberry.com
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/ee-first/README.md b/wrt/node_modules/ee-first/README.md
new file mode 100644 (file)
index 0000000..cbd2478
--- /dev/null
@@ -0,0 +1,80 @@
+# EE First
+
+[![NPM version][npm-image]][npm-url]
+[![Build status][travis-image]][travis-url]
+[![Test coverage][coveralls-image]][coveralls-url]
+[![License][license-image]][license-url]
+[![Downloads][downloads-image]][downloads-url]
+[![Gittip][gittip-image]][gittip-url]
+
+Get the first event in a set of event emitters and event pairs,
+then clean up after itself.
+
+## Install
+
+```sh
+$ npm install ee-first
+```
+
+## API
+
+```js
+var first = require('ee-first')
+```
+
+### first(arr, listener)
+
+Invoke `listener` on the first event from the list specified in `arr`. `arr` is
+an array of arrays, with each array in the format `[ee, ...event]`. `listener`
+will be called only once, the first time any of the given events are emitted. If
+`error` is one of the listened events, then if that fires first, the `listener`
+will be given the `err` argument.
+
+The `listener` is invoked as `listener(err, ee, event, args)`, where `err` is the
+first argument emitted from an `error` event, if applicable; `ee` is the event
+emitter that fired; `event` is the string event name that fired; and `args` is an
+array of the arguments that were emitted on the event.
+
+```js
+var ee1 = new EventEmitter()
+var ee2 = new EventEmitter()
+
+first([
+  [ee1, 'close', 'end', 'error'],
+  [ee2, 'error']
+], function (err, ee, event, args) {
+  // listener invoked
+})
+```
+
+#### .cancel()
+
+The group of listeners can be cancelled before being invoked and have all the event
+listeners removed from the underlying event emitters.
+
+```js
+var thunk = first([
+  [ee1, 'close', 'end', 'error'],
+  [ee2, 'error']
+], function (err, ee, event, args) {
+  // listener invoked
+})
+
+// cancel and clean up
+thunk.cancel()
+```
+
+[npm-image]: https://img.shields.io/npm/v/ee-first.svg?style=flat-square
+[npm-url]: https://npmjs.org/package/ee-first
+[github-tag]: http://img.shields.io/github/tag/jonathanong/ee-first.svg?style=flat-square
+[github-url]: https://github.com/jonathanong/ee-first/tags
+[travis-image]: https://img.shields.io/travis/jonathanong/ee-first.svg?style=flat-square
+[travis-url]: https://travis-ci.org/jonathanong/ee-first
+[coveralls-image]: https://img.shields.io/coveralls/jonathanong/ee-first.svg?style=flat-square
+[coveralls-url]: https://coveralls.io/r/jonathanong/ee-first?branch=master
+[license-image]: http://img.shields.io/npm/l/ee-first.svg?style=flat-square
+[license-url]: LICENSE.md
+[downloads-image]: http://img.shields.io/npm/dm/ee-first.svg?style=flat-square
+[downloads-url]: https://npmjs.org/package/ee-first
+[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square
+[gittip-url]: https://www.gittip.com/jonathanong/
diff --git a/wrt/node_modules/ee-first/index.js b/wrt/node_modules/ee-first/index.js
new file mode 100644 (file)
index 0000000..501287c
--- /dev/null
@@ -0,0 +1,95 @@
+/*!
+ * ee-first
+ * Copyright(c) 2014 Jonathan Ong
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = first
+
+/**
+ * Get the first event in a set of event emitters and event pairs.
+ *
+ * @param {array} stuff
+ * @param {function} done
+ * @public
+ */
+
+function first(stuff, done) {
+  if (!Array.isArray(stuff))
+    throw new TypeError('arg must be an array of [ee, events...] arrays')
+
+  var cleanups = []
+
+  for (var i = 0; i < stuff.length; i++) {
+    var arr = stuff[i]
+
+    if (!Array.isArray(arr) || arr.length < 2)
+      throw new TypeError('each array member must be [ee, events...]')
+
+    var ee = arr[0]
+
+    for (var j = 1; j < arr.length; j++) {
+      var event = arr[j]
+      var fn = listener(event, callback)
+
+      // listen to the event
+      ee.on(event, fn)
+      // push this listener to the list of cleanups
+      cleanups.push({
+        ee: ee,
+        event: event,
+        fn: fn,
+      })
+    }
+  }
+
+  function callback() {
+    cleanup()
+    done.apply(null, arguments)
+  }
+
+  function cleanup() {
+    var x
+    for (var i = 0; i < cleanups.length; i++) {
+      x = cleanups[i]
+      x.ee.removeListener(x.event, x.fn)
+    }
+  }
+
+  function thunk(fn) {
+    done = fn
+  }
+
+  thunk.cancel = cleanup
+
+  return thunk
+}
+
+/**
+ * Create the event listener.
+ * @private
+ */
+
+function listener(event, done) {
+  return function onevent(arg1) {
+    var args = new Array(arguments.length)
+    var ee = this
+    var err = event === 'error'
+      ? arg1
+      : null
+
+    // copy args to prevent arguments escaping scope
+    for (var i = 0; i < args.length; i++) {
+      args[i] = arguments[i]
+    }
+
+    done(err, ee, event, args)
+  }
+}
diff --git a/wrt/node_modules/ee-first/package.json b/wrt/node_modules/ee-first/package.json
new file mode 100644 (file)
index 0000000..4393a42
--- /dev/null
@@ -0,0 +1,98 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "ee-first@1.1.1",
+        "scope": null,
+        "escapedName": "ee-first",
+        "name": "ee-first",
+        "rawSpec": "1.1.1",
+        "spec": "1.1.1",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/on-finished"
+    ]
+  ],
+  "_from": "ee-first@1.1.1",
+  "_id": "ee-first@1.1.1",
+  "_inCache": true,
+  "_location": "/ee-first",
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "1.4.28",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "ee-first@1.1.1",
+    "scope": null,
+    "escapedName": "ee-first",
+    "name": "ee-first",
+    "rawSpec": "1.1.1",
+    "spec": "1.1.1",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/on-finished"
+  ],
+  "_resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
+  "_shasum": "590c61156b0ae2f4f0255732a158b266bc56b21d",
+  "_shrinkwrap": null,
+  "_spec": "ee-first@1.1.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/on-finished",
+  "author": {
+    "name": "Jonathan Ong",
+    "email": "me@jongleberry.com",
+    "url": "http://jongleberry.com"
+  },
+  "bugs": {
+    "url": "https://github.com/jonathanong/ee-first/issues"
+  },
+  "contributors": [
+    {
+      "name": "Douglas Christopher Wilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "dependencies": {},
+  "description": "return the first event in a set of ee/event pairs",
+  "devDependencies": {
+    "istanbul": "0.3.9",
+    "mocha": "2.2.5"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "590c61156b0ae2f4f0255732a158b266bc56b21d",
+    "tarball": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz"
+  },
+  "files": [
+    "index.js",
+    "LICENSE"
+  ],
+  "gitHead": "512e0ce4cc3643f603708f965a97b61b1a9c0441",
+  "homepage": "https://github.com/jonathanong/ee-first",
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "jongleberry",
+      "email": "jonathanrichardong@gmail.com"
+    },
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "name": "ee-first",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/jonathanong/ee-first.git"
+  },
+  "scripts": {
+    "test": "mocha --reporter spec --bail --check-leaks test/",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
+    "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
+  },
+  "version": "1.1.1"
+}
diff --git a/wrt/node_modules/encodeurl/HISTORY.md b/wrt/node_modules/encodeurl/HISTORY.md
new file mode 100644 (file)
index 0000000..06d34a5
--- /dev/null
@@ -0,0 +1,9 @@
+1.0.1 / 2016-06-09
+==================
+
+  * Fix encoding unpaired surrogates at start/end of string
+
+1.0.0 / 2016-06-08
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/encodeurl/LICENSE b/wrt/node_modules/encodeurl/LICENSE
new file mode 100644 (file)
index 0000000..8812229
--- /dev/null
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2016 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/encodeurl/README.md b/wrt/node_modules/encodeurl/README.md
new file mode 100644 (file)
index 0000000..b086133
--- /dev/null
@@ -0,0 +1,124 @@
+# encodeurl
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+Encode a URL to a percent-encoded form, excluding already-encoded sequences
+
+## Installation
+
+```sh
+$ npm install encodeurl
+```
+
+## API
+
+```js
+var encodeUrl = require('encodeurl')
+```
+
+### encodeUrl(url)
+
+Encode a URL to a percent-encoded form, excluding already-encoded sequences.
+
+This function will take an already-encoded URL and encode all the non-URL
+code points (as UTF-8 byte sequences). This function will not encode the
+"%" character unless it is not part of a valid sequence (`%20` will be
+left as-is, but `%foo` will be encoded as `%25foo`).
+
+This encode is meant to be "safe" and does not throw errors. It will try as
+hard as it can to properly encode the given URL, including replacing any raw,
+unpaired surrogate pairs with the Unicode replacement character prior to
+encoding.
+
+This function is _similar_ to the intrinsic function `encodeURI`, except it
+will not encode the `%` character if that is part of a valid sequence, will
+not encode `[` and `]` (for IPv6 hostnames) and will replace raw, unpaired
+surrogate pairs with the Unicode replacement character (instead of throwing).
+
+## Examples
+
+### Encode a URL containing user-controled data
+
+```js
+var encodeUrl = require('encodeurl')
+var escapeHtml = require('escape-html')
+
+http.createServer(function onRequest (req, res) {
+  // get encoded form of inbound url
+  var url = encodeUrl(req.url)
+
+  // create html message
+  var body = '<p>Location ' + escapeHtml(url) + ' not found</p>'
+
+  // send a 404
+  res.statusCode = 404
+  res.setHeader('Content-Type', 'text/html; charset=UTF-8')
+  res.setHeader('Content-Length', String(Buffer.byteLength(body, 'utf-8')))
+  res.end(body, 'utf-8')
+})
+```
+
+### Encode a URL for use in a header field
+
+```js
+var encodeUrl = require('encodeurl')
+var escapeHtml = require('escape-html')
+var url = require('url')
+
+http.createServer(function onRequest (req, res) {
+  // parse inbound url
+  var href = url.parse(req)
+
+  // set new host for redirect
+  href.host = 'localhost'
+  href.protocol = 'https:'
+  href.slashes = true
+
+  // create location header
+  var location = encodeUrl(url.format(href))
+
+  // create html message
+  var body = '<p>Redirecting to new site: ' + escapeHtml(location) + '</p>'
+
+  // send a 301
+  res.statusCode = 301
+  res.setHeader('Content-Type', 'text/html; charset=UTF-8')
+  res.setHeader('Content-Length', String(Buffer.byteLength(body, 'utf-8')))
+  res.setHeader('Location', location)
+  res.end(body, 'utf-8')
+})
+```
+
+## Testing
+
+```sh
+$ npm test
+$ npm run lint
+```
+
+## References
+
+- [RFC 3986: Uniform Resource Identifier (URI): Generic Syntax][rfc-3986]
+- [WHATWG URL Living Standard][whatwg-url]
+
+[rfc-3986]: https://tools.ietf.org/html/rfc3986
+[whatwg-url]: https://url.spec.whatwg.org/
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/encodeurl.svg
+[npm-url]: https://npmjs.org/package/encodeurl
+[node-version-image]: https://img.shields.io/node/v/encodeurl.svg
+[node-version-url]: https://nodejs.org/en/download
+[travis-image]: https://img.shields.io/travis/pillarjs/encodeurl.svg
+[travis-url]: https://travis-ci.org/pillarjs/encodeurl
+[coveralls-image]: https://img.shields.io/coveralls/pillarjs/encodeurl.svg
+[coveralls-url]: https://coveralls.io/r/pillarjs/encodeurl?branch=master
+[downloads-image]: https://img.shields.io/npm/dm/encodeurl.svg
+[downloads-url]: https://npmjs.org/package/encodeurl
diff --git a/wrt/node_modules/encodeurl/index.js b/wrt/node_modules/encodeurl/index.js
new file mode 100644 (file)
index 0000000..ae77cc9
--- /dev/null
@@ -0,0 +1,60 @@
+/*!
+ * encodeurl
+ * Copyright(c) 2016 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = encodeUrl
+
+/**
+ * RegExp to match non-URL code points, *after* encoding (i.e. not including "%")
+ * and including invalid escape sequences.
+ * @private
+ */
+
+var ENCODE_CHARS_REGEXP = /(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]))+/g
+
+/**
+ * RegExp to match unmatched surrogate pair.
+ * @private
+ */
+
+var UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g
+
+/**
+ * String to replace unmatched surrogate pair with.
+ * @private
+ */
+
+var UNMATCHED_SURROGATE_PAIR_REPLACE = '$1\uFFFD$2'
+
+/**
+ * Encode a URL to a percent-encoded form, excluding already-encoded sequences.
+ *
+ * This function will take an already-encoded URL and encode all the non-URL
+ * code points. This function will not encode the "%" character unless it is
+ * not part of a valid sequence (`%20` will be left as-is, but `%foo` will
+ * be encoded as `%25foo`).
+ *
+ * This encode is meant to be "safe" and does not throw errors. It will try as
+ * hard as it can to properly encode the given URL, including replacing any raw,
+ * unpaired surrogate pairs with the Unicode replacement character prior to
+ * encoding.
+ *
+ * @param {string} url
+ * @return {string}
+ * @public
+ */
+
+function encodeUrl (url) {
+  return String(url)
+    .replace(UNMATCHED_SURROGATE_PAIR_REGEXP, UNMATCHED_SURROGATE_PAIR_REPLACE)
+    .replace(ENCODE_CHARS_REGEXP, encodeURI)
+}
diff --git a/wrt/node_modules/encodeurl/package.json b/wrt/node_modules/encodeurl/package.json
new file mode 100644 (file)
index 0000000..88cc3b9
--- /dev/null
@@ -0,0 +1,112 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "encodeurl@~1.0.1",
+        "scope": null,
+        "escapedName": "encodeurl",
+        "name": "encodeurl",
+        "rawSpec": "~1.0.1",
+        "spec": ">=1.0.1 <1.1.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express"
+    ]
+  ],
+  "_from": "encodeurl@>=1.0.1 <1.1.0",
+  "_id": "encodeurl@1.0.1",
+  "_inCache": true,
+  "_location": "/encodeurl",
+  "_nodeVersion": "4.4.3",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/encodeurl-1.0.1.tgz_1465519736251_0.09314409433864057"
+  },
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "2.15.1",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "encodeurl@~1.0.1",
+    "scope": null,
+    "escapedName": "encodeurl",
+    "name": "encodeurl",
+    "rawSpec": "~1.0.1",
+    "spec": ">=1.0.1 <1.1.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/express",
+    "/finalhandler",
+    "/send",
+    "/serve-static"
+  ],
+  "_resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.1.tgz",
+  "_shasum": "79e3d58655346909fe6f0f45a5de68103b294d20",
+  "_shrinkwrap": null,
+  "_spec": "encodeurl@~1.0.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express",
+  "bugs": {
+    "url": "https://github.com/pillarjs/encodeurl/issues"
+  },
+  "contributors": [
+    {
+      "name": "Douglas Christopher Wilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "dependencies": {},
+  "description": "Encode a URL to a percent-encoded form, excluding already-encoded sequences",
+  "devDependencies": {
+    "eslint": "2.11.1",
+    "eslint-config-standard": "5.3.1",
+    "eslint-plugin-promise": "1.3.2",
+    "eslint-plugin-standard": "1.3.2",
+    "istanbul": "0.4.3",
+    "mocha": "2.5.3"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "79e3d58655346909fe6f0f45a5de68103b294d20",
+    "tarball": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.1.tgz"
+  },
+  "engines": {
+    "node": ">= 0.8"
+  },
+  "files": [
+    "LICENSE",
+    "HISTORY.md",
+    "README.md",
+    "index.js"
+  ],
+  "gitHead": "39ed0c235fed4cea7d012038fd6bb0480561d226",
+  "homepage": "https://github.com/pillarjs/encodeurl#readme",
+  "keywords": [
+    "encode",
+    "encodeurl",
+    "url"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "name": "encodeurl",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/pillarjs/encodeurl.git"
+  },
+  "scripts": {
+    "lint": "eslint **/*.js",
+    "test": "mocha --reporter spec --bail --check-leaks test/",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
+    "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
+  },
+  "version": "1.0.1"
+}
diff --git a/wrt/node_modules/engine.io-client/History.md b/wrt/node_modules/engine.io-client/History.md
new file mode 100644 (file)
index 0000000..3259896
--- /dev/null
@@ -0,0 +1,683 @@
+
+3.1.1 / 2017-05-19
+===================
+
+  * [test] Launch browser tests on localhost by default (#571)
+  * [chore] Unpin debug version (#568)
+
+3.1.0 / 2017-04-28
+===================
+
+  * [chore] Bump engine.io-parser to version 2.1.1 (#566)
+  * [chore] Pin debug to version 2.6.4 (#567)
+  * [chore] Bump engine.io-parser to version 2.1.0 (#565)
+  * [chore] Bump ws to version 2.3.1 (#564)
+  * [chore] Bump debug to version 2.6.4 (#563)
+  * [refactor] Set responseType based on 'Content-Type' header (#562)
+
+3.0.0 / 2017-04-06
+===================
+
+  * [chore] Bump dependencies (#560)
+  * [fix] Default `rejectUnauthorized` to `true` (#558)
+  * [chore] Drop support for old nodejs versions (0.10 & 0.12) (#557)
+
+2.1.1  / 2017-03-22
+===================
+
+  * [chore] Bump engine.io-parser to version 2.0.2 (#555)
+
+2.1.0  / 2017-03-11
+===================
+
+  * [chore] Bump engine.io-parser to version 2.0.1 (#549)
+  * [chore] Bump concat-stream to version 1.5.2 (#548)
+  * [feat] Allow to set the protocols for the websocket transport (#546)
+
+2.0.2  / 2017-02-16
+===================
+
+  * [chore] Bump ws to version 1.1.2 (vulnerability fix) (#539)
+  * [fix] Fix extraHeaders option in browser (#536)
+
+2.0.1  / 2017-01-30
+===================
+
+(bump following engine.io version)
+
+2.0.0  / 2017-01-22
+===================
+
+  * [chore] Fix Saucelabs tests (#532)
+  * [chore] Actually run tests in Saucelabs (#527)
+  * [feature] Allow extraHeaders to be set for browser clients in XHR requests (#519)
+  * [feature] Add support for per transport options (#518)
+  * [chore] Bump engine.io-parser to version 2.0.0 (#525)
+  * [chore] Update zuul config to speed up tests (#526)
+
+1.8.2  / 2016-12-11
+===================
+
+  * [chore] Bump engine.io-parser to version 1.3.2 (#523)
+
+1.8.1 / 2016-11-27
+===================
+
+  * [fix] Only add defined callbacks to the stack (#447)
+
+1.8.0 / 2016-11-20
+===================
+
+  * [fix] Fixed regression creating connection over https from node (#513)
+  * [fix] Fixed regression creating connection over wss from node (#514)
+  * [feature] Enable definition of timeouts for xhr-polling (#456)
+  * [feature] Added flag forceNode to override the normal behavior of prefering Browser based implementations. (#469)
+  * [feature] add localAddress option (#487)
+  * [chore] update dependencies (#516)
+  * [chore] Speed up lint by avoiding '**/*.js' matching pattern (#517)
+  * [chore] Bump debug to version 2.3.3 (#520)
+
+1.7.2 / 2016-10-24
+===================
+
+  * [fix] Set accept header to */* to support react app proxy (#508)
+  * [fix] remove a workaround for ios (#465)
+  * [fix] onPacket now emits data on 'closing' state as well (#484)
+  * [fix] Obfuscate `ActiveXObject` occurrences (#509)
+  * [docs] Add missing `onlyBinaryUpgrades` option in the docs (#510)
+  * [chore] Add Github issue and PR templates (#511)
+
+1.7.1 / 2016-10-20
+===================
+
+  * [fix] Define "requestsCount" var and "requests" hash unconditionally (#490)
+  * [perf] Add all properties to the socket in the constructor (#488)
+  * [chore] Update zuul browser settings (#504)
+  * [chore] Bump engine.io-parser to 1.3.1 (#505)
+  * [chore] Use more-specific imports for StealJS compatibility (#467)
+
+1.7.0 / 2016-10-05
+===================
+
+  * [fix] Revert "default `rejectUnauthorized` to `true`" (#496)
+  * [fix] Use xhr.responseText if xhr.response is not provided (#483)
+  * [fix] Fix issue with errors during WebSocket creation not being caught (#475)
+  * [style] Add missing semi-colon (#501)
+  * [chore] Add gulp & babel in the build process (#455)
+  * [chore] Add eslint (#458)
+  * [chore] Bump zuul (#464)
+  * [chore] Remove unused submodule (#466)
+  * [chore] Bumping ws to 1.1.1 (#478)
+  * [chore] Update zuul browser settings following EOL notices (#486)
+  * [chore] Bump engine.io-parser (#492)
+  * [chore] Make the build status badge point towards master (#497)
+  * [chore] Bump zuul to 3.11.0 & zuul-ngrok to 4.0.0 (#498)
+  * [chore] Restrict files included in npm package (#499)
+
+1.6.11 / 2016-06-23
+===================
+
+  * bump version
+
+1.6.10 / 2016-06-23
+===================
+
+  * bump version
+
+1.6.9 / 2016-05-02
+==================
+
+  * default `rejectUnauthorized` to `true`
+
+1.6.8 / 2016-01-25
+==================
+
+  * safely resolve `ws` module
+
+1.6.7 / 2016-01-10
+==================
+
+  * prevent `ws` from being added to the bundle
+  * added jsonp fix for when no `<script>` is found
+
+1.6.6 / 2016-01-07
+==================
+
+  * support: add fallback to `global` for nativescript [@ligaz]
+  * exclude `ws` instead of ignoring it from build [@lpinca]
+
+1.6.5 / 2016-01-05
+==================
+
+  * package: bump `ws` for sec advisory
+
+1.6.4 / 2015-12-04
+==================
+
+  * ipv6 url support
+  * README: fix the description of the `timestampRequests` option
+  * transports: use `yeast` to generate the cache busting id
+  * fix arraybuffer > base64 for binary sends
+
+1.6.3 / 2015-12-01
+==================
+
+  * remove compress option from control packets
+  * threshold for permessage-deflate
+
+1.6.2 / 2015-11-30
+==================
+
+  * package: bump `ws` for memory fix with compression
+  * fix response parsing error for polling (unused)
+
+1.6.1 / 2015-11-28
+==================
+
+  * fix packet options that `ws` changes [Nibbler999]
+  * package: use published `engine.io-parser`
+
+1.6.0 / 2015-11-28
+==================
+
+  * test with travis containers
+  * socket: remove duplicate declaration (fixes #434)
+  * package: bump `debug` (fixes #433)
+  * bump zuul and zuul-ngrok
+  * package: fix repository url
+  * bump `ws` for several improvements
+  * fix rejectUnauthorized bug
+  * websocket: improve firing of `drain` in websocket transport
+  * socket: clean up buffers right after `close` event
+  * change semantics of the write callback for polling
+    (fire upon flush instead drain)
+  * socket: fix host parsing for IPv6 URLs
+  * socket: handle parser errors appropriately
+  * expose `ping` and `pong` events
+  * enable `supportsBinary` when running as a node client
+  * introduce `extraHeaders` support
+  * fix error when passing `WebSocket#send` second argument on Safari
+  * support compression
+
+1.5.4 / 2015-09-09
+==================
+
+  * package: bump `engine.io-parser`
+
+1.5.3 / 2015-09-09
+==================
+
+  * package: bump `ws` to fix node 0.4.0
+
+1.5.2 / 2015-07-09
+==================
+
+  * package: bump `ws` to fix windows build issues
+
+1.5.1 / 2015-01-19
+==================
+
+ * do not rely on `git(1)` for dep, point to tarball instead
+
+1.5.0 / 2015-01-18
+==================
+
+ * package: bump `engine.io-parser`
+ * fix IE tests firing too many connections [rase-]
+ * fix default port detection when host is specified [defunctzombie]
+ * add support for custom SSL options in constructor [rase-]
+ * only call xhr.abort() on error cases in `polling-xhr` [samcday]
+
+1.4.3 / 2014-11-21
+==================
+
+ * support: make the build system work with the latest browserify
+ * test: remove test with partial browser support
+ * Fixed calls to addEventListener in old browsers
+
+1.4.2 / 2014-10-27
+==================
+
+ * remove invalid value for strict mode
+ * IE10 should prefer using XHR2 over XDR because it's safer
+ * fixed transport close deferring logic [nkzawa]
+ * wait for buffer to be drained before closing [nkzawa]
+
+1.4.1 / 2014-10-03
+==================
+
+ * Fixed "jsonp polling iframe removal error"
+ * Move ws upgrade needing connection tests to a block checking browser support.
+ * check `readyState` in `sendPacket` and close on `upgradeError` too
+ * defer close while upgrading a transport
+
+1.4.0 / 2014-09-03
+==================
+
+ * add matrix support for travis runs.
+ * add `enablesXDR` option to turn on `XDomainRequest`
+ * package: bump `browserify`
+ * package: bump `engine.io-parser`
+ * style and close socket after assert
+ * add support for `jsonp` option to turn it off
+
+1.3.1 / 2014-06-19
+==================
+
+ * transport: catch utf8 decode errors
+
+1.3.0 / 2014-06-13
+==================
+
+ * smaller inherits utility
+ * fix a test for ws
+ * upgrade emitter dep to not rely on tarball
+
+1.2.2 / 2014-05-30
+==================
+
+ * package: bump `engine.io-parser` for binary utf8 fix
+
+1.2.1 / 2014-05-22
+==================
+
+ * build
+
+1.2.0 / 2014-05-18
+==================
+
+ * removed flashsocket, moving to userland
+ * new build
+
+1.1.1 / 2014-05-14
+==================
+
+ * jsonp-polling: fixed newline double escaping
+ * package: bump parser
+ * remove legacy Socket#onopen call
+ * added tests for multibyte strings
+
+1.1.0 / 2014-04-27
+==================
+
+ * bump zuul version
+ * renamed removeAllListeners to cleanup
+ * use inherits package instead of inherit
+ * removed all references to util.js
+ * fix if statement in FlashWS.ready method
+ * polling-jsonp: prevent spurious errors from being emitted when the window is unloaded
+ * polling-xhr: fix a comment and remove unneeded `document` reference
+ * enforce cache busting for all user agents
+ * JSONP and test fixes for fails in IE
+ * package: bump `engine.io-parser`
+ * polling-xhr: abort the request when the window is unloaded
+
+1.0.5 / 2014-03-18
+==================
+
+ * package: bump `engine.io-parser` for android binary fix
+
+1.0.4 / 2014-03-14
+==================
+
+ * no base64 encoding for no reason when using websockets
+
+1.0.3 / 2014-03-12
+==================
+
+ * fix browserify
+
+1.0.2 / 2014-03-12
+==================
+
+ * bump `engine.io-parser`
+ * made `parseJSON` and `parseURI` from `util` their own modules [gkoren]
+ * clean up tests
+ * clean up browserify
+
+1.0.1 / 2014-03-06
+==================
+
+ * package: bump `engine.io-parser`
+
+1.0.0 / 2014-03-06
+==================
+
+ * run browserify without shims
+ * emit socket upgrade event after upgrade done
+ * better feature detection for XHR2
+ * added `rememberUpgrade` option
+ * binary support
+
+0.9.0 / 2014-02-09
+==================
+
+ * Fix simple `host:port` URLs and IPV6 [bmalehorn]
+ * Fix XHR cleanup method [poohlty]
+ * Match semantics of `close` event with `WebSocket`. If an error occurs
+   and `open` hadn't fired before, we still emit `close` as per
+   WebSocket spec [mokesmokes].
+ * Removed SPEC (now in `engine.io-protocol` repository)
+ * Remove `Socket#open` docs (private API) [mokesmokes]
+
+0.8.2 / 2014-01-18
+==================
+
+ * polling-xhr: avoid catching user-thrown errors
+ * util: remove unused `hasCORS`
+ * polling: remove deferring for faster startup (fixes #174)
+ * engine now works perfectly on workers
+
+0.8.1 / 2014-01-17
+==================
+
+ * package: bump debug to fix `localStorage` issue (fixes #213)
+ * remove duplicate xmlhttprequest code
+ * add iphone automated testing
+ * bump zuul to 1.3.0 to improve tests performance
+ * use invalid ip address for incorrect connection test
+ * Fix GH-224, remove sockets array
+
+0.8.0 / 2014-01-05
+==================
+
+ * socket: emit upgrade errors as `upgradeError` instead of `error`
+
+0.7.14 / 2014-01-01
+===================
+
+ * test: increase timeouts for network tests
+ * test: whitelist globals
+ * test: improve socket closing test
+ * polling: improve url timestamp for ie11 and allow force disabling
+ * polling-xhr: handle errors for xhr creation (fixes `access denied` issues)
+ * polling-xhr: style
+ * socket: more instrumentation for transport creation
+ * socket: allow explicit `false` for `timestampRequests`
+ * socket: accept `null` as first argument
+ * Makefile: cleanup
+ * .travis: deprecate 0.6
+
+0.7.13 / 2013-12-20
+===================
+
+ * use `jsonp` in favor of `XDomainRequest` to preserve `Cookie`
+   headers in all situations [3rd-eden] (fixes #217)
+ * run zuul tests after node tests [defunctzombie]
+ * add zuul support for easier browser testing [defunctzombie]
+
+0.7.12 / 2013-11-11
+===================
+
+ * engine.io: updated build to fix WebSocket constructor issue
+ * package: move browserify into devDeps
+
+0.7.11 / 2013-11-06
+===================
+
+ * AMD support
+ * Makefile: build now smaller thanks to browserify
+ * add browserify support
+
+0.7.10 / 2013-10-28
+===================
+
+ * fixed issue which prevented IE9 and under to pass Cookies to server during handshake
+ * package: update "ws" to v0.4.31
+ * fixed - there is no host property only hostname
+ * fixed - flash socket creation
+ * fixed - emit errors thrown by xhr.send()
+
+0.7.9 / 2013-08-30
+==================
+
+ * websocket: pass `undefined` as the WebSocket "protocols"
+
+0.7.8 / 2013-08-30
+==================
+
+ * package: update "ws"
+
+0.7.7 / 2013-08-30
+==================
+
+ * package: bump ws to 0.4.30
+ * websocket: no more env sniffing, just require `ws` [TooTallNate]
+ * websocket: remove the "bufferedAmount" checking logic [TooTallNate]
+
+0.7.6 / 2013-08-30
+==================
+
+ * package: revert ws to avoid upgrade fail now
+
+0.7.5 / 2013-08-30
+==================
+
+ * package: bump ws to 0.4.30
+
+0.7.4 / 2013-08-25
+==================
+
+ * package: rolling back to `ws` `0.4.25` due to disconnection bug
+
+0.7.3 / 2013-08-23
+==================
+
+ * noop bump
+
+0.7.2 / 2013-08-23
+==================
+
+ * transports: fix WebSocket transport in the web browser (again)
+
+0.7.1 / 2013-08-23
+==================
+
+ * transports: fix WebSocket transport in the web browser
+ * package: upgrade "ws" to v0.4.29
+
+0.7.0 / 2013-08-23
+==================
+
+ * socket: add `agent` option
+ * package: point "xmlhttprequest" to our LearnBoost fork for agent support
+ * package: specify a newer version of "ws" that includes `agent` support
+ * util: use "component/has-cors"
+ * transport: fix whitespace
+ * util: use "component/global"
+ * package: Add repository field to readme
+ * socket: Don't lose packets writen during upgrade after a re-open
+ * socket: use a consistent "debug" name for socket.js
+ * package: Update emitter dep to 1.0.1 for old IE support
+
+0.6.3 / 2013-06-21
+==================
+
+  * fix check readyState in polling transport (Naoyuki Kanezawa)
+  * use http url in npm dependencies for emitter (Eric Schoffstall)
+
+0.6.2 / 2013-06-15
+==================
+
+  * transports: improve polling orderly close (fixes #164)
+  * socket: ignore further transport communication upon `onClose`
+  * socket: added missing `socket#onerror` support
+  * socket: don't call `socket#onclose` if previous state was not `open`
+  * transports: fix iOS5 crash issue
+  * Makefile: extra precaution when building to avoid 0.6.0 build problem
+
+0.6.1 / 2013-06-06
+==================
+
+  * engine.io: fixed build
+
+0.6.0 / 2013-05-31
+==================
+
+  * does not emit close on incorrect socket connection
+  * use indexof component for ie8 and below
+  * improved x-domain handling
+  * introduce public `ping` api
+  * added drain event
+  * fix `flush` and `flushComplete` events
+  * fixed `drain` bug splicing with upgrading
+  * add support for callbacks with socket.send()
+
+0.5.0 / 2013-03-16
+==================
+
+  * socket: implement qs support for `string`
+  * added query.EIO to take protocol version from parser
+  * use istanbul for code coverage
+  * integrated engine.io-protocol 0.3.0
+  * updated ws
+  * fixed JSONPPolling iframe removal error
+  * changed error message to match xhr error message on jsonp transport script tag
+  * Added onerror handler for script tag in jsonp transport
+  * remove uid qs
+  * Added missing colon in payload. Thanks @lsm
+
+0.4.3 / 2013-02-08
+==================
+
+  * package: removed unusued `parser.js`
+
+0.4.2 / 2013-02-08
+==================
+
+  * polling-jsonp: fix ie6 JSONP on SSL
+  * close also if socket.readyState is on "opening"
+  * parser.js: removed the file package.json: added the engine.io-parser dependency everything else: switched to engine.io-parser
+  * fix "TypeError: Object #<Object> has no method 'global'"
+  * client now ignores unsupported upgrades
+
+0.4.1 / 2013-01-18
+==================
+
+  * do not shadow global XMLHttpRequest
+  * socket: added `data` event (as synonym to `message`)
+  * socket: remove `resource` and fix `path`
+  * socket: fixed access to `opts`
+  * test: fixed transports tests
+  * socket: constructor can accept uri/opts simultaneously
+  * SPEC: simplified: removed resource from SPEC
+  * socket: proper `host`/`hostname` support
+  * socket: ensure `onclose` idempotency
+  * socket: added `onerror` instrumentation
+  * socket: fix style
+  * use window to detect platform and fix global reference
+  * *: fix references to `global` (fixes #79)
+
+0.4.0 / 2012-12-09
+==================
+
+  * *: now based on `component(1)`
+  * *: module now exports `Socket`
+  * socket: export constructors, utils and `protocol`
+  * *: implemented `emitter` component
+  * *: removed browserbuild and preprocessor instructions
+
+0.3.10 / 2012-12-03
+===================
+
+  * socket: fix closing the socket in an `open` listener [mmastrac]
+  * socket: perform ping interval/timer cleanup [mmastrac]
+  * fix SPEC (packages -> packets) [jxck]
+  * socket: handle probe's transport errors [indutny]
+
+0.3.9 / 2012-10-23
+==================
+
+  * socket: fix `hostname` instead of `host`
+  * socket: avoid duplicate `port` defaults
+
+0.3.8 / 2012-10-23
+==================
+
+  * socket: introduce introspection hooks
+  * socket: introduced `host` and `port` `location` defaults
+  * flashsocket: obfuscate activex (fixes #31)
+  * README: documented reconnect (closes #45)
+  * socket: unset `id` upon close
+  * socket: clear transport listeners upon force close
+
+0.3.7 / 2012-10-21
+==================
+
+  * fix `version` [quackingduck]
+  * ping timeout gets reset upon any packet received [indutny]
+  * timeout fixes [cadorn, indutny]
+  * transport: fix xdomain detection in absence of location.port (GH-38)
+  * socket: fix passing `false` as secure getting overridden
+  * socket: default `secure` to `true` for SSL-served pages
+  * socket: fix default port for SSL when `secure` is not supplied
+
+0.3.6 / 2012-10-16
+==================
+
+  * socket: reset timeout on any incoming data [indutny]
+
+0.3.5 / 2012-10-14
+==================
+
+  * new build
+
+0.3.4 / 2012-10-14
+==================
+
+  * package: fix `component` exports
+
+0.3.3 / 2012-10-10
+==================
+
+  * socket: fix `secure` default value discovery [quackingduck]
+
+0.3.2 / 2012-10-08
+==================
+
+  * Bump
+
+0.3.1 / 2012-10-08
+==================
+
+  * socket: added `write` alias for `send`
+  * package: added `component`
+
+0.3.0 / 2012-09-04
+==================
+
+  * IE's XDomainRequest cannot do requests that go from HTTPS to HTTP or HTTP to HTTPS [mixu]
+  * Switch to client-initiated ping, and set interval in handshake [cadorn]
+
+0.2.2 / 2012-08-26
+==================
+
+  * polling-jsonp: allow unneeded global leak (fixes #41)
+  * polling-jsonp: allow for multiple eio's in the same page
+
+0.2.1 / 2012-08-13
+==================
+
+  * Bump
+
+0.2.0 / 2012-08-06
+==================
+
+  * polling: introduced `poll` and `pollComplete` (formerly `poll`) events
+
+0.1.2 / 2012-08-02
+==================
+
+  * Bump
+
+0.1.1 / 2012-08-01
+==================
+
+  * Added options for request timestamping
+  * Made timestamp query param customizable
+  * Added automatic timestamping for Android
+
+0.1.0 / 2012-07-03
+==================
+
+  * Initial release.
diff --git a/wrt/node_modules/engine.io-client/LICENSE b/wrt/node_modules/engine.io-client/LICENSE
new file mode 100644 (file)
index 0000000..b248ba1
--- /dev/null
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2014-2015 Automattic <dev@cloudup.com>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/engine.io-client/README.md b/wrt/node_modules/engine.io-client/README.md
new file mode 100644 (file)
index 0000000..7e335a3
--- /dev/null
@@ -0,0 +1,299 @@
+
+# Engine.IO client
+
+[![Build Status](https://travis-ci.org/socketio/engine.io-client.svg?branch=master)](http://travis-ci.org/socketio/engine.io-client)
+[![NPM version](https://badge.fury.io/js/engine.io-client.svg)](http://badge.fury.io/js/engine.io-client)
+
+This is the client for [Engine.IO](http://github.com/socketio/engine.io),
+the implementation of transport-based cross-browser/cross-device
+bi-directional communication layer for [Socket.IO](http://github.com/socketio/socket.io).
+
+## How to use
+
+### Standalone
+
+You can find an `engine.io.js` file in this repository, which is a
+standalone build you can use as follows:
+
+```html
+<script src="/path/to/engine.io.js"></script>
+<script>
+  // eio = Socket
+  var socket = eio('ws://localhost');
+  socket.on('open', function(){
+    socket.on('message', function(data){});
+    socket.on('close', function(){});
+  });
+</script>
+```
+
+### With browserify
+
+Engine.IO is a commonjs module, which means you can include it by using
+`require` on the browser and package using [browserify](http://browserify.org/):
+
+1. install the client package
+
+    ```bash
+    $ npm install engine.io-client
+    ```
+
+1. write your app code
+
+    ```js
+    var socket = require('engine.io-client')('ws://localhost');
+    socket.on('open', function(){
+      socket.on('message', function(data){});
+      socket.on('close', function(){});
+    });
+    ```
+
+1. build your app bundle
+
+    ```bash
+    $ browserify app.js > bundle.js
+    ```
+
+1. include on your page
+
+    ```html
+    <script src="/path/to/bundle.js"></script>
+    ```
+
+### Sending and receiving binary
+
+```html
+<script src="/path/to/engine.io.js"></script>
+<script>
+  var socket = new eio.Socket('ws://localhost/');
+  socket.binaryType = 'blob';
+  socket.on('open', function () {
+    socket.send(new Int8Array(5));
+    socket.on('message', function(blob){});
+    socket.on('close', function(){ });
+  });
+</script>
+```
+
+### Node.JS
+
+Add `engine.io-client` to your `package.json` and then:
+
+```js
+var socket = require('engine.io-client')('ws://localhost');
+socket.on('open', function(){
+  socket.on('message', function(data){});
+  socket.on('close', function(){});
+});
+```
+
+### Node.js with certificates
+```js
+var opts = {
+  key: fs.readFileSync('test/fixtures/client.key'),
+  cert: fs.readFileSync('test/fixtures/client.crt'),
+  ca: fs.readFileSync('test/fixtures/ca.crt')
+};
+
+var socket = require('engine.io-client')('ws://localhost', opts);
+socket.on('open', function(){
+  socket.on('message', function(data){});
+  socket.on('close', function(){});
+});
+```
+
+### Node.js with extraHeaders
+```js
+var opts = {
+  extraHeaders: {
+    'X-Custom-Header-For-My-Project': 'my-secret-access-token',
+    'Cookie': 'user_session=NI2JlCKF90aE0sJZD9ZzujtdsUqNYSBYxzlTsvdSUe35ZzdtVRGqYFr0kdGxbfc5gUOkR9RGp20GVKza; path=/; expires=Tue, 07-Apr-2015 18:18:08 GMT; secure; HttpOnly'
+  }
+};
+
+var socket = require('engine.io-client')('ws://localhost', opts);
+socket.on('open', function(){
+  socket.on('message', function(data){});
+  socket.on('close', function(){});
+});
+```
+
+## Features
+
+- Lightweight
+- Runs on browser and node.js seamlessly
+- Transports are independent of `Engine`
+  - Easy to debug
+  - Easy to unit test
+- Runs inside HTML5 WebWorker
+- Can send and receive binary data
+  - Receives as ArrayBuffer or Blob when in browser, and Buffer or ArrayBuffer
+    in Node
+  - When XHR2 or WebSockets are used, binary is emitted directly. Otherwise
+    binary is encoded into base64 strings, and decoded when binary types are
+    supported.
+  - With browsers that don't support ArrayBuffer, an object { base64: true,
+    data: dataAsBase64String } is emitted on the `message` event.
+
+## API
+
+### Socket
+
+The client class. Mixes in [Emitter](http://github.com/component/emitter).
+Exposed as `eio` in the browser standalone build.
+
+#### Properties
+
+- `protocol` _(Number)_: protocol revision number
+- `binaryType` _(String)_ : can be set to 'arraybuffer' or 'blob' in browsers,
+  and `buffer` or `arraybuffer` in Node. Blob is only used in browser if it's
+  supported.
+
+#### Events
+
+- `open`
+  - Fired upon successful connection.
+- `message`
+  - Fired when data is received from the server.
+  - **Arguments**
+    - `String` | `ArrayBuffer`: utf-8 encoded data or ArrayBuffer containing
+      binary data
+- `close`
+  - Fired upon disconnection. In compliance with the WebSocket API spec, this event may be
+    fired even if the `open` event does not occur (i.e. due to connection error or `close()`).
+- `error`
+  - Fired when an error occurs.
+- `flush`
+  - Fired upon completing a buffer flush
+- `drain`
+  - Fired after `drain` event of transport if writeBuffer is empty
+- `upgradeError`
+  - Fired if an error occurs with a transport we're trying to upgrade to.
+- `upgrade`
+  - Fired upon upgrade success, after the new transport is set
+- `ping`
+  - Fired upon _flushing_ a ping packet (ie: actual packet write out)
+- `pong`
+  - Fired upon receiving a pong packet.
+
+#### Methods
+
+- **constructor**
+    - Initializes the client
+    - **Parameters**
+      - `String` uri
+      - `Object`: optional, options object
+    - **Options**
+      - `agent` (`http.Agent`): `http.Agent` to use, defaults to `false` (NodeJS only)
+      - `upgrade` (`Boolean`): defaults to true, whether the client should try
+      to upgrade the transport from long-polling to something better.
+      - `forceJSONP` (`Boolean`): forces JSONP for polling transport.
+      - `jsonp` (`Boolean`): determines whether to use JSONP when
+        necessary for polling. If disabled (by settings to false) an error will
+        be emitted (saying "No transports available") if no other transports
+        are available. If another transport is available for opening a
+        connection (e.g. WebSocket) that transport
+        will be used instead.
+      - `forceBase64` (`Boolean`): forces base 64 encoding for polling transport even when XHR2 responseType is available and WebSocket even if the used standard supports binary.
+      - `enablesXDR` (`Boolean`): enables XDomainRequest for IE8 to avoid loading bar flashing with click sound. default to `false` because XDomainRequest has a flaw of not sending cookie.
+      - `timestampRequests` (`Boolean`): whether to add the timestamp with each
+        transport request. Note: polling requests are always stamped unless this
+        option is explicitly set to `false` (`false`)
+      - `timestampParam` (`String`): timestamp parameter (`t`)
+      - `policyPort` (`Number`): port the policy server listens on (`843`)
+      - `path` (`String`): path to connect to, default is `/engine.io`
+      - `transports` (`Array`): a list of transports to try (in order).
+      Defaults to `['polling', 'websocket']`. `Engine`
+      always attempts to connect directly with the first one, provided the
+      feature detection test for it passes.
+      - `transportOptions` (`Object`): hash of options, indexed by transport name, overriding the common options for the given transport
+      - `rememberUpgrade` (`Boolean`): defaults to false.
+        If true and if the previous websocket connection to the server succeeded,
+        the connection attempt will bypass the normal upgrade process and will initially
+        try websocket. A connection attempt following a transport error will use the
+        normal upgrade process. It is recommended you turn this on only when using
+        SSL/TLS connections, or if you know that your network does not block websockets.
+      - `pfx` (`String`): Certificate, Private key and CA certificates to use for SSL. Can be used in Node.js client environment to manually specify certificate information.
+      - `key` (`String`): Private key to use for SSL. Can be used in Node.js client environment to manually specify certificate information.
+      - `passphrase` (`String`): A string of passphrase for the private key or pfx. Can be used in Node.js client environment to manually specify certificate information.
+      - `cert` (`String`): Public x509 certificate to use. Can be used in Node.js client environment to manually specify certificate information.
+      - `ca` (`String`|`Array`): An authority certificate or array of authority certificates to check the remote host against.. Can be used in Node.js client environment to manually specify certificate information.
+      - `ciphers` (`String`): A string describing the ciphers to use or exclude. Consult the [cipher format list](http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT) for details on the format. Can be used in Node.js client environment to manually specify certificate information.
+      - `rejectUnauthorized` (`Boolean`): If true, the server certificate is verified against the list of supplied CAs. An 'error' event is emitted if verification fails. Verification happens at the connection level, before the HTTP request is sent. Can be used in Node.js client environment to manually specify certificate information.
+      - `perMessageDeflate` (`Object|Boolean`): parameters of the WebSocket permessage-deflate extension
+        (see [ws module](https://github.com/einaros/ws) api docs). Set to `false` to disable. (`true`)
+        - `threshold` (`Number`): data is compressed only if the byte size is above this value. This option is ignored on the browser. (`1024`)
+      - `extraHeaders` (`Object`): Headers that will be passed for each request to the server (via xhr-polling and via websockets). These values then can be used during handshake or for special proxies. Can only be used in Node.js client environment.
+      - `onlyBinaryUpgrades` (`Boolean`): whether transport upgrades should be restricted to transports supporting binary data (`false`)
+      - `forceNode` (`Boolean`): Uses NodeJS implementation for websockets - even if there is a native Browser-Websocket available, which is preferred by default over the NodeJS implementation. (This is useful when using hybrid platforms like nw.js or electron) (`false`, NodeJS only)
+      - `localAddress` (`String`): the local IP address to connect to
+    - **Polling-only options**
+      - `requestTimeout` (`Number`): Timeout for xhr-polling requests in milliseconds (`0`)
+    - **Websocket-only options**
+      - `protocols` (`Array`): a list of subprotocols (see [MDN reference](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers#Subprotocols))
+- `send`
+    - Sends a message to the server
+    - **Parameters**
+      - `String` | `ArrayBuffer` | `ArrayBufferView` | `Blob`: data to send
+      - `Object`: optional, options object
+      - `Function`: optional, callback upon `drain`
+    - **Options**
+      - `compress` (`Boolean`): whether to compress sending data. This option is ignored and forced to be `true` on the browser. (`true`)
+- `close`
+    - Disconnects the client.
+
+### Transport
+
+The transport class. Private. _Inherits from EventEmitter_.
+
+#### Events
+
+- `poll`: emitted by polling transports upon starting a new request
+- `pollComplete`: emitted by polling transports upon completing a request
+- `drain`: emitted by polling transports upon a buffer drain
+
+## Tests
+
+`engine.io-client` is used to test
+[engine](http://github.com/socketio/engine.io). Running the `engine.io`
+test suite ensures the client works and vice-versa.
+
+Browser tests are run using [zuul](https://github.com/defunctzombie/zuul). You can
+run the tests locally using the following command.
+
+```
+./node_modules/.bin/zuul --local 8080 -- test/index.js
+```
+
+Additionally, `engine.io-client` has a standalone test suite you can run
+with `make test` which will run node.js and browser tests. You must have zuul setup with
+a saucelabs account.
+
+## Support
+
+The support channels for `engine.io-client` are the same as `socket.io`:
+  - irc.freenode.net **#socket.io**
+  - [Google Groups](http://groups.google.com/group/socket_io)
+  - [Website](http://socket.io)
+
+## Development
+
+To contribute patches, run tests or benchmarks, make sure to clone the
+repository:
+
+```bash
+git clone git://github.com/socketio/engine.io-client.git
+```
+
+Then:
+
+```bash
+cd engine.io-client
+npm install
+```
+
+See the `Tests` section above for how to run tests before submitting any patches.
+
+## License
+
+MIT - Copyright (c) 2014 Automattic, Inc.
diff --git a/wrt/node_modules/engine.io-client/engine.io.js b/wrt/node_modules/engine.io-client/engine.io.js
new file mode 100644 (file)
index 0000000..0109c17
--- /dev/null
@@ -0,0 +1,4707 @@
+(function webpackUniversalModuleDefinition(root, factory) {
+       if(typeof exports === 'object' && typeof module === 'object')
+               module.exports = factory();
+       else if(typeof define === 'function' && define.amd)
+               define([], factory);
+       else if(typeof exports === 'object')
+               exports["eio"] = factory();
+       else
+               root["eio"] = factory();
+})(this, function() {
+return /******/ (function(modules) { // webpackBootstrap
+/******/       // The module cache
+/******/       var installedModules = {};
+
+/******/       // The require function
+/******/       function __webpack_require__(moduleId) {
+
+/******/               // Check if module is in cache
+/******/               if(installedModules[moduleId])
+/******/                       return installedModules[moduleId].exports;
+
+/******/               // Create a new module (and put it into the cache)
+/******/               var module = installedModules[moduleId] = {
+/******/                       exports: {},
+/******/                       id: moduleId,
+/******/                       loaded: false
+/******/               };
+
+/******/               // Execute the module function
+/******/               modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/               // Flag the module as loaded
+/******/               module.loaded = true;
+
+/******/               // Return the exports of the module
+/******/               return module.exports;
+/******/       }
+
+
+/******/       // expose the modules object (__webpack_modules__)
+/******/       __webpack_require__.m = modules;
+
+/******/       // expose the module cache
+/******/       __webpack_require__.c = installedModules;
+
+/******/       // __webpack_public_path__
+/******/       __webpack_require__.p = "";
+
+/******/       // Load entry module and return exports
+/******/       return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
+
+       'use strict';
+
+       module.exports = __webpack_require__(1);
+
+/***/ },
+/* 1 */
+/***/ function(module, exports, __webpack_require__) {
+
+       'use strict';
+
+       module.exports = __webpack_require__(2);
+
+       /**
+        * Exports parser
+        *
+        * @api public
+        *
+        */
+       module.exports.parser = __webpack_require__(9);
+
+/***/ },
+/* 2 */
+/***/ function(module, exports, __webpack_require__) {
+
+       /* WEBPACK VAR INJECTION */(function(global) {'use strict';
+
+       var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
+       /**
+        * Module dependencies.
+        */
+
+       var transports = __webpack_require__(3);
+       var Emitter = __webpack_require__(19);
+       var debug = __webpack_require__(23)('engine.io-client:socket');
+       var index = __webpack_require__(30);
+       var parser = __webpack_require__(9);
+       var parseuri = __webpack_require__(31);
+       var parsejson = __webpack_require__(32);
+       var parseqs = __webpack_require__(20);
+
+       /**
+        * Module exports.
+        */
+
+       module.exports = Socket;
+
+       /**
+        * Socket constructor.
+        *
+        * @param {String|Object} uri or options
+        * @param {Object} options
+        * @api public
+        */
+
+       function Socket(uri, opts) {
+         if (!(this instanceof Socket)) return new Socket(uri, opts);
+
+         opts = opts || {};
+
+         if (uri && 'object' === (typeof uri === 'undefined' ? 'undefined' : _typeof(uri))) {
+           opts = uri;
+           uri = null;
+         }
+
+         if (uri) {
+           uri = parseuri(uri);
+           opts.hostname = uri.host;
+           opts.secure = uri.protocol === 'https' || uri.protocol === 'wss';
+           opts.port = uri.port;
+           if (uri.query) opts.query = uri.query;
+         } else if (opts.host) {
+           opts.hostname = parseuri(opts.host).host;
+         }
+
+         this.secure = null != opts.secure ? opts.secure : global.location && 'https:' === location.protocol;
+
+         if (opts.hostname && !opts.port) {
+           // if no port is specified manually, use the protocol default
+           opts.port = this.secure ? '443' : '80';
+         }
+
+         this.agent = opts.agent || false;
+         this.hostname = opts.hostname || (global.location ? location.hostname : 'localhost');
+         this.port = opts.port || (global.location && location.port ? location.port : this.secure ? 443 : 80);
+         this.query = opts.query || {};
+         if ('string' === typeof this.query) this.query = parseqs.decode(this.query);
+         this.upgrade = false !== opts.upgrade;
+         this.path = (opts.path || '/engine.io').replace(/\/$/, '') + '/';
+         this.forceJSONP = !!opts.forceJSONP;
+         this.jsonp = false !== opts.jsonp;
+         this.forceBase64 = !!opts.forceBase64;
+         this.enablesXDR = !!opts.enablesXDR;
+         this.timestampParam = opts.timestampParam || 't';
+         this.timestampRequests = opts.timestampRequests;
+         this.transports = opts.transports || ['polling', 'websocket'];
+         this.transportOptions = opts.transportOptions || {};
+         this.readyState = '';
+         this.writeBuffer = [];
+         this.prevBufferLen = 0;
+         this.policyPort = opts.policyPort || 843;
+         this.rememberUpgrade = opts.rememberUpgrade || false;
+         this.binaryType = null;
+         this.onlyBinaryUpgrades = opts.onlyBinaryUpgrades;
+         this.perMessageDeflate = false !== opts.perMessageDeflate ? opts.perMessageDeflate || {} : false;
+
+         if (true === this.perMessageDeflate) this.perMessageDeflate = {};
+         if (this.perMessageDeflate && null == this.perMessageDeflate.threshold) {
+           this.perMessageDeflate.threshold = 1024;
+         }
+
+         // SSL options for Node.js client
+         this.pfx = opts.pfx || null;
+         this.key = opts.key || null;
+         this.passphrase = opts.passphrase || null;
+         this.cert = opts.cert || null;
+         this.ca = opts.ca || null;
+         this.ciphers = opts.ciphers || null;
+         this.rejectUnauthorized = opts.rejectUnauthorized === undefined ? true : opts.rejectUnauthorized;
+         this.forceNode = !!opts.forceNode;
+
+         // other options for Node.js client
+         var freeGlobal = (typeof global === 'undefined' ? 'undefined' : _typeof(global)) === 'object' && global;
+         if (freeGlobal.global === freeGlobal) {
+           if (opts.extraHeaders && Object.keys(opts.extraHeaders).length > 0) {
+             this.extraHeaders = opts.extraHeaders;
+           }
+
+           if (opts.localAddress) {
+             this.localAddress = opts.localAddress;
+           }
+         }
+
+         // set on handshake
+         this.id = null;
+         this.upgrades = null;
+         this.pingInterval = null;
+         this.pingTimeout = null;
+
+         // set on heartbeat
+         this.pingIntervalTimer = null;
+         this.pingTimeoutTimer = null;
+
+         this.open();
+       }
+
+       Socket.priorWebsocketSuccess = false;
+
+       /**
+        * Mix in `Emitter`.
+        */
+
+       Emitter(Socket.prototype);
+
+       /**
+        * Protocol version.
+        *
+        * @api public
+        */
+
+       Socket.protocol = parser.protocol; // this is an int
+
+       /**
+        * Expose deps for legacy compatibility
+        * and standalone browser access.
+        */
+
+       Socket.Socket = Socket;
+       Socket.Transport = __webpack_require__(8);
+       Socket.transports = __webpack_require__(3);
+       Socket.parser = __webpack_require__(9);
+
+       /**
+        * Creates transport of the given type.
+        *
+        * @param {String} transport name
+        * @return {Transport}
+        * @api private
+        */
+
+       Socket.prototype.createTransport = function (name) {
+         debug('creating transport "%s"', name);
+         var query = clone(this.query);
+
+         // append engine.io protocol identifier
+         query.EIO = parser.protocol;
+
+         // transport name
+         query.transport = name;
+
+         // per-transport options
+         var options = this.transportOptions[name] || {};
+
+         // session id if we already have one
+         if (this.id) query.sid = this.id;
+
+         var transport = new transports[name]({
+           query: query,
+           socket: this,
+           agent: options.agent || this.agent,
+           hostname: options.hostname || this.hostname,
+           port: options.port || this.port,
+           secure: options.secure || this.secure,
+           path: options.path || this.path,
+           forceJSONP: options.forceJSONP || this.forceJSONP,
+           jsonp: options.jsonp || this.jsonp,
+           forceBase64: options.forceBase64 || this.forceBase64,
+           enablesXDR: options.enablesXDR || this.enablesXDR,
+           timestampRequests: options.timestampRequests || this.timestampRequests,
+           timestampParam: options.timestampParam || this.timestampParam,
+           policyPort: options.policyPort || this.policyPort,
+           pfx: options.pfx || this.pfx,
+           key: options.key || this.key,
+           passphrase: options.passphrase || this.passphrase,
+           cert: options.cert || this.cert,
+           ca: options.ca || this.ca,
+           ciphers: options.ciphers || this.ciphers,
+           rejectUnauthorized: options.rejectUnauthorized || this.rejectUnauthorized,
+           perMessageDeflate: options.perMessageDeflate || this.perMessageDeflate,
+           extraHeaders: options.extraHeaders || this.extraHeaders,
+           forceNode: options.forceNode || this.forceNode,
+           localAddress: options.localAddress || this.localAddress,
+           requestTimeout: options.requestTimeout || this.requestTimeout,
+           protocols: options.protocols || void 0
+         });
+
+         return transport;
+       };
+
+       function clone(obj) {
+         var o = {};
+         for (var i in obj) {
+           if (obj.hasOwnProperty(i)) {
+             o[i] = obj[i];
+           }
+         }
+         return o;
+       }
+
+       /**
+        * Initializes transport to use and starts probe.
+        *
+        * @api private
+        */
+       Socket.prototype.open = function () {
+         var transport;
+         if (this.rememberUpgrade && Socket.priorWebsocketSuccess && this.transports.indexOf('websocket') !== -1) {
+           transport = 'websocket';
+         } else if (0 === this.transports.length) {
+           // Emit error on next tick so it can be listened to
+           var self = this;
+           setTimeout(function () {
+             self.emit('error', 'No transports available');
+           }, 0);
+           return;
+         } else {
+           transport = this.transports[0];
+         }
+         this.readyState = 'opening';
+
+         // Retry with the next transport if the transport is disabled (jsonp: false)
+         try {
+           transport = this.createTransport(transport);
+         } catch (e) {
+           this.transports.shift();
+           this.open();
+           return;
+         }
+
+         transport.open();
+         this.setTransport(transport);
+       };
+
+       /**
+        * Sets the current transport. Disables the existing one (if any).
+        *
+        * @api private
+        */
+
+       Socket.prototype.setTransport = function (transport) {
+         debug('setting transport %s', transport.name);
+         var self = this;
+
+         if (this.transport) {
+           debug('clearing existing transport %s', this.transport.name);
+           this.transport.removeAllListeners();
+         }
+
+         // set up transport
+         this.transport = transport;
+
+         // set up transport listeners
+         transport.on('drain', function () {
+           self.onDrain();
+         }).on('packet', function (packet) {
+           self.onPacket(packet);
+         }).on('error', function (e) {
+           self.onError(e);
+         }).on('close', function () {
+           self.onClose('transport close');
+         });
+       };
+
+       /**
+        * Probes a transport.
+        *
+        * @param {String} transport name
+        * @api private
+        */
+
+       Socket.prototype.probe = function (name) {
+         debug('probing transport "%s"', name);
+         var transport = this.createTransport(name, { probe: 1 });
+         var failed = false;
+         var self = this;
+
+         Socket.priorWebsocketSuccess = false;
+
+         function onTransportOpen() {
+           if (self.onlyBinaryUpgrades) {
+             var upgradeLosesBinary = !this.supportsBinary && self.transport.supportsBinary;
+             failed = failed || upgradeLosesBinary;
+           }
+           if (failed) return;
+
+           debug('probe transport "%s" opened', name);
+           transport.send([{ type: 'ping', data: 'probe' }]);
+           transport.once('packet', function (msg) {
+             if (failed) return;
+             if ('pong' === msg.type && 'probe' === msg.data) {
+               debug('probe transport "%s" pong', name);
+               self.upgrading = true;
+               self.emit('upgrading', transport);
+               if (!transport) return;
+               Socket.priorWebsocketSuccess = 'websocket' === transport.name;
+
+               debug('pausing current transport "%s"', self.transport.name);
+               self.transport.pause(function () {
+                 if (failed) return;
+                 if ('closed' === self.readyState) return;
+                 debug('changing transport and sending upgrade packet');
+
+                 cleanup();
+
+                 self.setTransport(transport);
+                 transport.send([{ type: 'upgrade' }]);
+                 self.emit('upgrade', transport);
+                 transport = null;
+                 self.upgrading = false;
+                 self.flush();
+               });
+             } else {
+               debug('probe transport "%s" failed', name);
+               var err = new Error('probe error');
+               err.transport = transport.name;
+               self.emit('upgradeError', err);
+             }
+           });
+         }
+
+         function freezeTransport() {
+           if (failed) return;
+
+           // Any callback called by transport should be ignored since now
+           failed = true;
+
+           cleanup();
+
+           transport.close();
+           transport = null;
+         }
+
+         // Handle any error that happens while probing
+         function onerror(err) {
+           var error = new Error('probe error: ' + err);
+           error.transport = transport.name;
+
+           freezeTransport();
+
+           debug('probe transport "%s" failed because of error: %s', name, err);
+
+           self.emit('upgradeError', error);
+         }
+
+         function onTransportClose() {
+           onerror('transport closed');
+         }
+
+         // When the socket is closed while we're probing
+         function onclose() {
+           onerror('socket closed');
+         }
+
+         // When the socket is upgraded while we're probing
+         function onupgrade(to) {
+           if (transport && to.name !== transport.name) {
+             debug('"%s" works - aborting "%s"', to.name, transport.name);
+             freezeTransport();
+           }
+         }
+
+         // Remove all listeners on the transport and on self
+         function cleanup() {
+           transport.removeListener('open', onTransportOpen);
+           transport.removeListener('error', onerror);
+           transport.removeListener('close', onTransportClose);
+           self.removeListener('close', onclose);
+           self.removeListener('upgrading', onupgrade);
+         }
+
+         transport.once('open', onTransportOpen);
+         transport.once('error', onerror);
+         transport.once('close', onTransportClose);
+
+         this.once('close', onclose);
+         this.once('upgrading', onupgrade);
+
+         transport.open();
+       };
+
+       /**
+        * Called when connection is deemed open.
+        *
+        * @api public
+        */
+
+       Socket.prototype.onOpen = function () {
+         debug('socket open');
+         this.readyState = 'open';
+         Socket.priorWebsocketSuccess = 'websocket' === this.transport.name;
+         this.emit('open');
+         this.flush();
+
+         // we check for `readyState` in case an `open`
+         // listener already closed the socket
+         if ('open' === this.readyState && this.upgrade && this.transport.pause) {
+           debug('starting upgrade probes');
+           for (var i = 0, l = this.upgrades.length; i < l; i++) {
+             this.probe(this.upgrades[i]);
+           }
+         }
+       };
+
+       /**
+        * Handles a packet.
+        *
+        * @api private
+        */
+
+       Socket.prototype.onPacket = function (packet) {
+         if ('opening' === this.readyState || 'open' === this.readyState || 'closing' === this.readyState) {
+           debug('socket receive: type "%s", data "%s"', packet.type, packet.data);
+
+           this.emit('packet', packet);
+
+           // Socket is live - any packet counts
+           this.emit('heartbeat');
+
+           switch (packet.type) {
+             case 'open':
+               this.onHandshake(parsejson(packet.data));
+               break;
+
+             case 'pong':
+               this.setPing();
+               this.emit('pong');
+               break;
+
+             case 'error':
+               var err = new Error('server error');
+               err.code = packet.data;
+               this.onError(err);
+               break;
+
+             case 'message':
+               this.emit('data', packet.data);
+               this.emit('message', packet.data);
+               break;
+           }
+         } else {
+           debug('packet received with socket readyState "%s"', this.readyState);
+         }
+       };
+
+       /**
+        * Called upon handshake completion.
+        *
+        * @param {Object} handshake obj
+        * @api private
+        */
+
+       Socket.prototype.onHandshake = function (data) {
+         this.emit('handshake', data);
+         this.id = data.sid;
+         this.transport.query.sid = data.sid;
+         this.upgrades = this.filterUpgrades(data.upgrades);
+         this.pingInterval = data.pingInterval;
+         this.pingTimeout = data.pingTimeout;
+         this.onOpen();
+         // In case open handler closes socket
+         if ('closed' === this.readyState) return;
+         this.setPing();
+
+         // Prolong liveness of socket on heartbeat
+         this.removeListener('heartbeat', this.onHeartbeat);
+         this.on('heartbeat', this.onHeartbeat);
+       };
+
+       /**
+        * Resets ping timeout.
+        *
+        * @api private
+        */
+
+       Socket.prototype.onHeartbeat = function (timeout) {
+         clearTimeout(this.pingTimeoutTimer);
+         var self = this;
+         self.pingTimeoutTimer = setTimeout(function () {
+           if ('closed' === self.readyState) return;
+           self.onClose('ping timeout');
+         }, timeout || self.pingInterval + self.pingTimeout);
+       };
+
+       /**
+        * Pings server every `this.pingInterval` and expects response
+        * within `this.pingTimeout` or closes connection.
+        *
+        * @api private
+        */
+
+       Socket.prototype.setPing = function () {
+         var self = this;
+         clearTimeout(self.pingIntervalTimer);
+         self.pingIntervalTimer = setTimeout(function () {
+           debug('writing ping packet - expecting pong within %sms', self.pingTimeout);
+           self.ping();
+           self.onHeartbeat(self.pingTimeout);
+         }, self.pingInterval);
+       };
+
+       /**
+       * Sends a ping packet.
+       *
+       * @api private
+       */
+
+       Socket.prototype.ping = function () {
+         var self = this;
+         this.sendPacket('ping', function () {
+           self.emit('ping');
+         });
+       };
+
+       /**
+        * Called on `drain` event
+        *
+        * @api private
+        */
+
+       Socket.prototype.onDrain = function () {
+         this.writeBuffer.splice(0, this.prevBufferLen);
+
+         // setting prevBufferLen = 0 is very important
+         // for example, when upgrading, upgrade packet is sent over,
+         // and a nonzero prevBufferLen could cause problems on `drain`
+         this.prevBufferLen = 0;
+
+         if (0 === this.writeBuffer.length) {
+           this.emit('drain');
+         } else {
+           this.flush();
+         }
+       };
+
+       /**
+        * Flush write buffers.
+        *
+        * @api private
+        */
+
+       Socket.prototype.flush = function () {
+         if ('closed' !== this.readyState && this.transport.writable && !this.upgrading && this.writeBuffer.length) {
+           debug('flushing %d packets in socket', this.writeBuffer.length);
+           this.transport.send(this.writeBuffer);
+           // keep track of current length of writeBuffer
+           // splice writeBuffer and callbackBuffer on `drain`
+           this.prevBufferLen = this.writeBuffer.length;
+           this.emit('flush');
+         }
+       };
+
+       /**
+        * Sends a message.
+        *
+        * @param {String} message.
+        * @param {Function} callback function.
+        * @param {Object} options.
+        * @return {Socket} for chaining.
+        * @api public
+        */
+
+       Socket.prototype.write = Socket.prototype.send = function (msg, options, fn) {
+         this.sendPacket('message', msg, options, fn);
+         return this;
+       };
+
+       /**
+        * Sends a packet.
+        *
+        * @param {String} packet type.
+        * @param {String} data.
+        * @param {Object} options.
+        * @param {Function} callback function.
+        * @api private
+        */
+
+       Socket.prototype.sendPacket = function (type, data, options, fn) {
+         if ('function' === typeof data) {
+           fn = data;
+           data = undefined;
+         }
+
+         if ('function' === typeof options) {
+           fn = options;
+           options = null;
+         }
+
+         if ('closing' === this.readyState || 'closed' === this.readyState) {
+           return;
+         }
+
+         options = options || {};
+         options.compress = false !== options.compress;
+
+         var packet = {
+           type: type,
+           data: data,
+           options: options
+         };
+         this.emit('packetCreate', packet);
+         this.writeBuffer.push(packet);
+         if (fn) this.once('flush', fn);
+         this.flush();
+       };
+
+       /**
+        * Closes the connection.
+        *
+        * @api private
+        */
+
+       Socket.prototype.close = function () {
+         if ('opening' === this.readyState || 'open' === this.readyState) {
+           this.readyState = 'closing';
+
+           var self = this;
+
+           if (this.writeBuffer.length) {
+             this.once('drain', function () {
+               if (this.upgrading) {
+                 waitForUpgrade();
+               } else {
+                 close();
+               }
+             });
+           } else if (this.upgrading) {
+             waitForUpgrade();
+           } else {
+             close();
+           }
+         }
+
+         function close() {
+           self.onClose('forced close');
+           debug('socket closing - telling transport to close');
+           self.transport.close();
+         }
+
+         function cleanupAndClose() {
+           self.removeListener('upgrade', cleanupAndClose);
+           self.removeListener('upgradeError', cleanupAndClose);
+           close();
+         }
+
+         function waitForUpgrade() {
+           // wait for upgrade to finish since we can't send packets while pausing a transport
+           self.once('upgrade', cleanupAndClose);
+           self.once('upgradeError', cleanupAndClose);
+         }
+
+         return this;
+       };
+
+       /**
+        * Called upon transport error
+        *
+        * @api private
+        */
+
+       Socket.prototype.onError = function (err) {
+         debug('socket error %j', err);
+         Socket.priorWebsocketSuccess = false;
+         this.emit('error', err);
+         this.onClose('transport error', err);
+       };
+
+       /**
+        * Called upon transport close.
+        *
+        * @api private
+        */
+
+       Socket.prototype.onClose = function (reason, desc) {
+         if ('opening' === this.readyState || 'open' === this.readyState || 'closing' === this.readyState) {
+           debug('socket close with reason: "%s"', reason);
+           var self = this;
+
+           // clear timers
+           clearTimeout(this.pingIntervalTimer);
+           clearTimeout(this.pingTimeoutTimer);
+
+           // stop event from firing again for transport
+           this.transport.removeAllListeners('close');
+
+           // ensure transport won't stay open
+           this.transport.close();
+
+           // ignore further transport communication
+           this.transport.removeAllListeners();
+
+           // set ready state
+           this.readyState = 'closed';
+
+           // clear session id
+           this.id = null;
+
+           // emit close event
+           this.emit('close', reason, desc);
+
+           // clean buffers after, so users can still
+           // grab the buffers on `close` event
+           self.writeBuffer = [];
+           self.prevBufferLen = 0;
+         }
+       };
+
+       /**
+        * Filters upgrades, returning only those matching client transports.
+        *
+        * @param {Array} server upgrades
+        * @api private
+        *
+        */
+
+       Socket.prototype.filterUpgrades = function (upgrades) {
+         var filteredUpgrades = [];
+         for (var i = 0, j = upgrades.length; i < j; i++) {
+           if (~index(this.transports, upgrades[i])) filteredUpgrades.push(upgrades[i]);
+         }
+         return filteredUpgrades;
+       };
+       /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
+
+/***/ },
+/* 3 */
+/***/ function(module, exports, __webpack_require__) {
+
+       /* WEBPACK VAR INJECTION */(function(global) {'use strict';
+
+       /**
+        * Module dependencies
+        */
+
+       var XMLHttpRequest = __webpack_require__(4);
+       var XHR = __webpack_require__(6);
+       var JSONP = __webpack_require__(27);
+       var websocket = __webpack_require__(28);
+
+       /**
+        * Export transports.
+        */
+
+       exports.polling = polling;
+       exports.websocket = websocket;
+
+       /**
+        * Polling transport polymorphic constructor.
+        * Decides on xhr vs jsonp based on feature detection.
+        *
+        * @api private
+        */
+
+       function polling(opts) {
+         var xhr;
+         var xd = false;
+         var xs = false;
+         var jsonp = false !== opts.jsonp;
+
+         if (global.location) {
+           var isSSL = 'https:' === location.protocol;
+           var port = location.port;
+
+           // some user agents have empty `location.port`
+           if (!port) {
+             port = isSSL ? 443 : 80;
+           }
+
+           xd = opts.hostname !== location.hostname || port !== opts.port;
+           xs = opts.secure !== isSSL;
+         }
+
+         opts.xdomain = xd;
+         opts.xscheme = xs;
+         xhr = new XMLHttpRequest(opts);
+
+         if ('open' in xhr && !opts.forceJSONP) {
+           return new XHR(opts);
+         } else {
+           if (!jsonp) throw new Error('JSONP disabled');
+           return new JSONP(opts);
+         }
+       }
+       /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
+
+/***/ },
+/* 4 */
+/***/ function(module, exports, __webpack_require__) {
+
+       /* WEBPACK VAR INJECTION */(function(global) {'use strict';
+
+       // browser shim for xmlhttprequest module
+
+       var hasCORS = __webpack_require__(5);
+
+       module.exports = function (opts) {
+         var xdomain = opts.xdomain;
+
+         // scheme must be same when usign XDomainRequest
+         // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx
+         var xscheme = opts.xscheme;
+
+         // XDomainRequest has a flow of not sending cookie, therefore it should be disabled as a default.
+         // https://github.com/Automattic/engine.io-client/pull/217
+         var enablesXDR = opts.enablesXDR;
+
+         // XMLHttpRequest can be disabled on IE
+         try {
+           if ('undefined' !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {
+             return new XMLHttpRequest();
+           }
+         } catch (e) {}
+
+         // Use XDomainRequest for IE8 if enablesXDR is true
+         // because loading bar keeps flashing when using jsonp-polling
+         // https://github.com/yujiosaka/socke.io-ie8-loading-example
+         try {
+           if ('undefined' !== typeof XDomainRequest && !xscheme && enablesXDR) {
+             return new XDomainRequest();
+           }
+         } catch (e) {}
+
+         if (!xdomain) {
+           try {
+             return new global[['Active'].concat('Object').join('X')]('Microsoft.XMLHTTP');
+           } catch (e) {}
+         }
+       };
+       /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
+
+/***/ },
+/* 5 */
+/***/ function(module, exports) {
+
+       
+       /**
+        * Module exports.
+        *
+        * Logic borrowed from Modernizr:
+        *
+        *   - https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cors.js
+        */
+
+       try {
+         module.exports = typeof XMLHttpRequest !== 'undefined' &&
+           'withCredentials' in new XMLHttpRequest();
+       } catch (err) {
+         // if XMLHttp support is disabled in IE then it will throw
+         // when trying to create
+         module.exports = false;
+       }
+
+
+/***/ },
+/* 6 */
+/***/ function(module, exports, __webpack_require__) {
+
+       /* WEBPACK VAR INJECTION */(function(global) {'use strict';
+
+       /**
+        * Module requirements.
+        */
+
+       var XMLHttpRequest = __webpack_require__(4);
+       var Polling = __webpack_require__(7);
+       var Emitter = __webpack_require__(19);
+       var inherit = __webpack_require__(21);
+       var debug = __webpack_require__(23)('engine.io-client:polling-xhr');
+
+       /**
+        * Module exports.
+        */
+
+       module.exports = XHR;
+       module.exports.Request = Request;
+
+       /**
+        * Empty function
+        */
+
+       function empty() {}
+
+       /**
+        * XHR Polling constructor.
+        *
+        * @param {Object} opts
+        * @api public
+        */
+
+       function XHR(opts) {
+         Polling.call(this, opts);
+         this.requestTimeout = opts.requestTimeout;
+         this.extraHeaders = opts.extraHeaders;
+
+         if (global.location) {
+           var isSSL = 'https:' === location.protocol;
+           var port = location.port;
+
+           // some user agents have empty `location.port`
+           if (!port) {
+             port = isSSL ? 443 : 80;
+           }
+
+           this.xd = opts.hostname !== global.location.hostname || port !== opts.port;
+           this.xs = opts.secure !== isSSL;
+         }
+       }
+
+       /**
+        * Inherits from Polling.
+        */
+
+       inherit(XHR, Polling);
+
+       /**
+        * XHR supports binary
+        */
+
+       XHR.prototype.supportsBinary = true;
+
+       /**
+        * Creates a request.
+        *
+        * @param {String} method
+        * @api private
+        */
+
+       XHR.prototype.request = function (opts) {
+         opts = opts || {};
+         opts.uri = this.uri();
+         opts.xd = this.xd;
+         opts.xs = this.xs;
+         opts.agent = this.agent || false;
+         opts.supportsBinary = this.supportsBinary;
+         opts.enablesXDR = this.enablesXDR;
+
+         // SSL options for Node.js client
+         opts.pfx = this.pfx;
+         opts.key = this.key;
+         opts.passphrase = this.passphrase;
+         opts.cert = this.cert;
+         opts.ca = this.ca;
+         opts.ciphers = this.ciphers;
+         opts.rejectUnauthorized = this.rejectUnauthorized;
+         opts.requestTimeout = this.requestTimeout;
+
+         // other options for Node.js client
+         opts.extraHeaders = this.extraHeaders;
+
+         return new Request(opts);
+       };
+
+       /**
+        * Sends data.
+        *
+        * @param {String} data to send.
+        * @param {Function} called upon flush.
+        * @api private
+        */
+
+       XHR.prototype.doWrite = function (data, fn) {
+         var isBinary = typeof data !== 'string' && data !== undefined;
+         var req = this.request({ method: 'POST', data: data, isBinary: isBinary });
+         var self = this;
+         req.on('success', fn);
+         req.on('error', function (err) {
+           self.onError('xhr post error', err);
+         });
+         this.sendXhr = req;
+       };
+
+       /**
+        * Starts a poll cycle.
+        *
+        * @api private
+        */
+
+       XHR.prototype.doPoll = function () {
+         debug('xhr poll');
+         var req = this.request();
+         var self = this;
+         req.on('data', function (data) {
+           self.onData(data);
+         });
+         req.on('error', function (err) {
+           self.onError('xhr poll error', err);
+         });
+         this.pollXhr = req;
+       };
+
+       /**
+        * Request constructor
+        *
+        * @param {Object} options
+        * @api public
+        */
+
+       function Request(opts) {
+         this.method = opts.method || 'GET';
+         this.uri = opts.uri;
+         this.xd = !!opts.xd;
+         this.xs = !!opts.xs;
+         this.async = false !== opts.async;
+         this.data = undefined !== opts.data ? opts.data : null;
+         this.agent = opts.agent;
+         this.isBinary = opts.isBinary;
+         this.supportsBinary = opts.supportsBinary;
+         this.enablesXDR = opts.enablesXDR;
+         this.requestTimeout = opts.requestTimeout;
+
+         // SSL options for Node.js client
+         this.pfx = opts.pfx;
+         this.key = opts.key;
+         this.passphrase = opts.passphrase;
+         this.cert = opts.cert;
+         this.ca = opts.ca;
+         this.ciphers = opts.ciphers;
+         this.rejectUnauthorized = opts.rejectUnauthorized;
+
+         // other options for Node.js client
+         this.extraHeaders = opts.extraHeaders;
+
+         this.create();
+       }
+
+       /**
+        * Mix in `Emitter`.
+        */
+
+       Emitter(Request.prototype);
+
+       /**
+        * Creates the XHR object and sends the request.
+        *
+        * @api private
+        */
+
+       Request.prototype.create = function () {
+         var opts = { agent: this.agent, xdomain: this.xd, xscheme: this.xs, enablesXDR: this.enablesXDR };
+
+         // SSL options for Node.js client
+         opts.pfx = this.pfx;
+         opts.key = this.key;
+         opts.passphrase = this.passphrase;
+         opts.cert = this.cert;
+         opts.ca = this.ca;
+         opts.ciphers = this.ciphers;
+         opts.rejectUnauthorized = this.rejectUnauthorized;
+
+         var xhr = this.xhr = new XMLHttpRequest(opts);
+         var self = this;
+
+         try {
+           debug('xhr open %s: %s', this.method, this.uri);
+           xhr.open(this.method, this.uri, this.async);
+           try {
+             if (this.extraHeaders) {
+               xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);
+               for (var i in this.extraHeaders) {
+                 if (this.extraHeaders.hasOwnProperty(i)) {
+                   xhr.setRequestHeader(i, this.extraHeaders[i]);
+                 }
+               }
+             }
+           } catch (e) {}
+
+           if ('POST' === this.method) {
+             try {
+               if (this.isBinary) {
+                 xhr.setRequestHeader('Content-type', 'application/octet-stream');
+               } else {
+                 xhr.setRequestHeader('Content-type', 'text/plain;charset=UTF-8');
+               }
+             } catch (e) {}
+           }
+
+           try {
+             xhr.setRequestHeader('Accept', '*/*');
+           } catch (e) {}
+
+           // ie6 check
+           if ('withCredentials' in xhr) {
+             xhr.withCredentials = true;
+           }
+
+           if (this.requestTimeout) {
+             xhr.timeout = this.requestTimeout;
+           }
+
+           if (this.hasXDR()) {
+             xhr.onload = function () {
+               self.onLoad();
+             };
+             xhr.onerror = function () {
+               self.onError(xhr.responseText);
+             };
+           } else {
+             xhr.onreadystatechange = function () {
+               if (xhr.readyState === 2) {
+                 var contentType;
+                 try {
+                   contentType = xhr.getResponseHeader('Content-Type');
+                 } catch (e) {}
+                 if (contentType === 'application/octet-stream') {
+                   xhr.responseType = 'arraybuffer';
+                 }
+               }
+               if (4 !== xhr.readyState) return;
+               if (200 === xhr.status || 1223 === xhr.status) {
+                 self.onLoad();
+               } else {
+                 // make sure the `error` event handler that's user-set
+                 // does not throw in the same tick and gets caught here
+                 setTimeout(function () {
+                   self.onError(xhr.status);
+                 }, 0);
+               }
+             };
+           }
+
+           debug('xhr data %s', this.data);
+           xhr.send(this.data);
+         } catch (e) {
+           // Need to defer since .create() is called directly fhrom the constructor
+           // and thus the 'error' event can only be only bound *after* this exception
+           // occurs.  Therefore, also, we cannot throw here at all.
+           setTimeout(function () {
+             self.onError(e);
+           }, 0);
+           return;
+         }
+
+         if (global.document) {
+           this.index = Request.requestsCount++;
+           Request.requests[this.index] = this;
+         }
+       };
+
+       /**
+        * Called upon successful response.
+        *
+        * @api private
+        */
+
+       Request.prototype.onSuccess = function () {
+         this.emit('success');
+         this.cleanup();
+       };
+
+       /**
+        * Called if we have data.
+        *
+        * @api private
+        */
+
+       Request.prototype.onData = function (data) {
+         this.emit('data', data);
+         this.onSuccess();
+       };
+
+       /**
+        * Called upon error.
+        *
+        * @api private
+        */
+
+       Request.prototype.onError = function (err) {
+         this.emit('error', err);
+         this.cleanup(true);
+       };
+
+       /**
+        * Cleans up house.
+        *
+        * @api private
+        */
+
+       Request.prototype.cleanup = function (fromError) {
+         if ('undefined' === typeof this.xhr || null === this.xhr) {
+           return;
+         }
+         // xmlhttprequest
+         if (this.hasXDR()) {
+           this.xhr.onload = this.xhr.onerror = empty;
+         } else {
+           this.xhr.onreadystatechange = empty;
+         }
+
+         if (fromError) {
+           try {
+             this.xhr.abort();
+           } catch (e) {}
+         }
+
+         if (global.document) {
+           delete Request.requests[this.index];
+         }
+
+         this.xhr = null;
+       };
+
+       /**
+        * Called upon load.
+        *
+        * @api private
+        */
+
+       Request.prototype.onLoad = function () {
+         var data;
+         try {
+           var contentType;
+           try {
+             contentType = this.xhr.getResponseHeader('Content-Type');
+           } catch (e) {}
+           if (contentType === 'application/octet-stream') {
+             data = this.xhr.response || this.xhr.responseText;
+           } else {
+             data = this.xhr.responseText;
+           }
+         } catch (e) {
+           this.onError(e);
+         }
+         if (null != data) {
+           this.onData(data);
+         }
+       };
+
+       /**
+        * Check if it has XDomainRequest.
+        *
+        * @api private
+        */
+
+       Request.prototype.hasXDR = function () {
+         return 'undefined' !== typeof global.XDomainRequest && !this.xs && this.enablesXDR;
+       };
+
+       /**
+        * Aborts the request.
+        *
+        * @api public
+        */
+
+       Request.prototype.abort = function () {
+         this.cleanup();
+       };
+
+       /**
+        * Aborts pending requests when unloading the window. This is needed to prevent
+        * memory leaks (e.g. when using IE) and to ensure that no spurious error is
+        * emitted.
+        */
+
+       Request.requestsCount = 0;
+       Request.requests = {};
+
+       if (global.document) {
+         if (global.attachEvent) {
+           global.attachEvent('onunload', unloadHandler);
+         } else if (global.addEventListener) {
+           global.addEventListener('beforeunload', unloadHandler, false);
+         }
+       }
+
+       function unloadHandler() {
+         for (var i in Request.requests) {
+           if (Request.requests.hasOwnProperty(i)) {
+             Request.requests[i].abort();
+           }
+         }
+       }
+       /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
+
+/***/ },
+/* 7 */
+/***/ function(module, exports, __webpack_require__) {
+
+       'use strict';
+
+       /**
+        * Module dependencies.
+        */
+
+       var Transport = __webpack_require__(8);
+       var parseqs = __webpack_require__(20);
+       var parser = __webpack_require__(9);
+       var inherit = __webpack_require__(21);
+       var yeast = __webpack_require__(22);
+       var debug = __webpack_require__(23)('engine.io-client:polling');
+
+       /**
+        * Module exports.
+        */
+
+       module.exports = Polling;
+
+       /**
+        * Is XHR2 supported?
+        */
+
+       var hasXHR2 = function () {
+         var XMLHttpRequest = __webpack_require__(4);
+         var xhr = new XMLHttpRequest({ xdomain: false });
+         return null != xhr.responseType;
+       }();
+
+       /**
+        * Polling interface.
+        *
+        * @param {Object} opts
+        * @api private
+        */
+
+       function Polling(opts) {
+         var forceBase64 = opts && opts.forceBase64;
+         if (!hasXHR2 || forceBase64) {
+           this.supportsBinary = false;
+         }
+         Transport.call(this, opts);
+       }
+
+       /**
+        * Inherits from Transport.
+        */
+
+       inherit(Polling, Transport);
+
+       /**
+        * Transport name.
+        */
+
+       Polling.prototype.name = 'polling';
+
+       /**
+        * Opens the socket (triggers polling). We write a PING message to determine
+        * when the transport is open.
+        *
+        * @api private
+        */
+
+       Polling.prototype.doOpen = function () {
+         this.poll();
+       };
+
+       /**
+        * Pauses polling.
+        *
+        * @param {Function} callback upon buffers are flushed and transport is paused
+        * @api private
+        */
+
+       Polling.prototype.pause = function (onPause) {
+         var self = this;
+
+         this.readyState = 'pausing';
+
+         function pause() {
+           debug('paused');
+           self.readyState = 'paused';
+           onPause();
+         }
+
+         if (this.polling || !this.writable) {
+           var total = 0;
+
+           if (this.polling) {
+             debug('we are currently polling - waiting to pause');
+             total++;
+             this.once('pollComplete', function () {
+               debug('pre-pause polling complete');
+               --total || pause();
+             });
+           }
+
+           if (!this.writable) {
+             debug('we are currently writing - waiting to pause');
+             total++;
+             this.once('drain', function () {
+               debug('pre-pause writing complete');
+               --total || pause();
+             });
+           }
+         } else {
+           pause();
+         }
+       };
+
+       /**
+        * Starts polling cycle.
+        *
+        * @api public
+        */
+
+       Polling.prototype.poll = function () {
+         debug('polling');
+         this.polling = true;
+         this.doPoll();
+         this.emit('poll');
+       };
+
+       /**
+        * Overloads onData to detect payloads.
+        *
+        * @api private
+        */
+
+       Polling.prototype.onData = function (data) {
+         var self = this;
+         debug('polling got data %s', data);
+         var callback = function callback(packet, index, total) {
+           // if its the first message we consider the transport open
+           if ('opening' === self.readyState) {
+             self.onOpen();
+           }
+
+           // if its a close packet, we close the ongoing requests
+           if ('close' === packet.type) {
+             self.onClose();
+             return false;
+           }
+
+           // otherwise bypass onData and handle the message
+           self.onPacket(packet);
+         };
+
+         // decode payload
+         parser.decodePayload(data, this.socket.binaryType, callback);
+
+         // if an event did not trigger closing
+         if ('closed' !== this.readyState) {
+           // if we got data we're not polling
+           this.polling = false;
+           this.emit('pollComplete');
+
+           if ('open' === this.readyState) {
+             this.poll();
+           } else {
+             debug('ignoring poll - transport state "%s"', this.readyState);
+           }
+         }
+       };
+
+       /**
+        * For polling, send a close packet.
+        *
+        * @api private
+        */
+
+       Polling.prototype.doClose = function () {
+         var self = this;
+
+         function close() {
+           debug('writing close packet');
+           self.write([{ type: 'close' }]);
+         }
+
+         if ('open' === this.readyState) {
+           debug('transport open - closing');
+           close();
+         } else {
+           // in case we're trying to close while
+           // handshaking is in progress (GH-164)
+           debug('transport not open - deferring close');
+           this.once('open', close);
+         }
+       };
+
+       /**
+        * Writes a packets payload.
+        *
+        * @param {Array} data packets
+        * @param {Function} drain callback
+        * @api private
+        */
+
+       Polling.prototype.write = function (packets) {
+         var self = this;
+         this.writable = false;
+         var callbackfn = function callbackfn() {
+           self.writable = true;
+           self.emit('drain');
+         };
+
+         parser.encodePayload(packets, this.supportsBinary, function (data) {
+           self.doWrite(data, callbackfn);
+         });
+       };
+
+       /**
+        * Generates uri for connection.
+        *
+        * @api private
+        */
+
+       Polling.prototype.uri = function () {
+         var query = this.query || {};
+         var schema = this.secure ? 'https' : 'http';
+         var port = '';
+
+         // cache busting is forced
+         if (false !== this.timestampRequests) {
+           query[this.timestampParam] = yeast();
+         }
+
+         if (!this.supportsBinary && !query.sid) {
+           query.b64 = 1;
+         }
+
+         query = parseqs.encode(query);
+
+         // avoid port if default for schema
+         if (this.port && ('https' === schema && Number(this.port) !== 443 || 'http' === schema && Number(this.port) !== 80)) {
+           port = ':' + this.port;
+         }
+
+         // prepend ? to query
+         if (query.length) {
+           query = '?' + query;
+         }
+
+         var ipv6 = this.hostname.indexOf(':') !== -1;
+         return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;
+       };
+
+/***/ },
+/* 8 */
+/***/ function(module, exports, __webpack_require__) {
+
+       'use strict';
+
+       /**
+        * Module dependencies.
+        */
+
+       var parser = __webpack_require__(9);
+       var Emitter = __webpack_require__(19);
+
+       /**
+        * Module exports.
+        */
+
+       module.exports = Transport;
+
+       /**
+        * Transport abstract constructor.
+        *
+        * @param {Object} options.
+        * @api private
+        */
+
+       function Transport(opts) {
+         this.path = opts.path;
+         this.hostname = opts.hostname;
+         this.port = opts.port;
+         this.secure = opts.secure;
+         this.query = opts.query;
+         this.timestampParam = opts.timestampParam;
+         this.timestampRequests = opts.timestampRequests;
+         this.readyState = '';
+         this.agent = opts.agent || false;
+         this.socket = opts.socket;
+         this.enablesXDR = opts.enablesXDR;
+
+         // SSL options for Node.js client
+         this.pfx = opts.pfx;
+         this.key = opts.key;
+         this.passphrase = opts.passphrase;
+         this.cert = opts.cert;
+         this.ca = opts.ca;
+         this.ciphers = opts.ciphers;
+         this.rejectUnauthorized = opts.rejectUnauthorized;
+         this.forceNode = opts.forceNode;
+
+         // other options for Node.js client
+         this.extraHeaders = opts.extraHeaders;
+         this.localAddress = opts.localAddress;
+       }
+
+       /**
+        * Mix in `Emitter`.
+        */
+
+       Emitter(Transport.prototype);
+
+       /**
+        * Emits an error.
+        *
+        * @param {String} str
+        * @return {Transport} for chaining
+        * @api public
+        */
+
+       Transport.prototype.onError = function (msg, desc) {
+         var err = new Error(msg);
+         err.type = 'TransportError';
+         err.description = desc;
+         this.emit('error', err);
+         return this;
+       };
+
+       /**
+        * Opens the transport.
+        *
+        * @api public
+        */
+
+       Transport.prototype.open = function () {
+         if ('closed' === this.readyState || '' === this.readyState) {
+           this.readyState = 'opening';
+           this.doOpen();
+         }
+
+         return this;
+       };
+
+       /**
+        * Closes the transport.
+        *
+        * @api private
+        */
+
+       Transport.prototype.close = function () {
+         if ('opening' === this.readyState || 'open' === this.readyState) {
+           this.doClose();
+           this.onClose();
+         }
+
+         return this;
+       };
+
+       /**
+        * Sends multiple packets.
+        *
+        * @param {Array} packets
+        * @api private
+        */
+
+       Transport.prototype.send = function (packets) {
+         if ('open' === this.readyState) {
+           this.write(packets);
+         } else {
+           throw new Error('Transport not open');
+         }
+       };
+
+       /**
+        * Called upon open
+        *
+        * @api private
+        */
+
+       Transport.prototype.onOpen = function () {
+         this.readyState = 'open';
+         this.writable = true;
+         this.emit('open');
+       };
+
+       /**
+        * Called with data.
+        *
+        * @param {String} data
+        * @api private
+        */
+
+       Transport.prototype.onData = function (data) {
+         var packet = parser.decodePacket(data, this.socket.binaryType);
+         this.onPacket(packet);
+       };
+
+       /**
+        * Called with a decoded packet.
+        */
+
+       Transport.prototype.onPacket = function (packet) {
+         this.emit('packet', packet);
+       };
+
+       /**
+        * Called upon close.
+        *
+        * @api private
+        */
+
+       Transport.prototype.onClose = function () {
+         this.readyState = 'closed';
+         this.emit('close');
+       };
+
+/***/ },
+/* 9 */
+/***/ function(module, exports, __webpack_require__) {
+
+       /* WEBPACK VAR INJECTION */(function(global) {/**
+        * Module dependencies.
+        */
+
+       var keys = __webpack_require__(10);
+       var hasBinary = __webpack_require__(11);
+       var sliceBuffer = __webpack_require__(13);
+       var after = __webpack_require__(14);
+       var utf8 = __webpack_require__(15);
+
+       var base64encoder;
+       if (global && global.ArrayBuffer) {
+         base64encoder = __webpack_require__(17);
+       }
+
+       /**
+        * Check if we are running an android browser. That requires us to use
+        * ArrayBuffer with polling transports...
+        *
+        * http://ghinda.net/jpeg-blob-ajax-android/
+        */
+
+       var isAndroid = typeof navigator !== 'undefined' && /Android/i.test(navigator.userAgent);
+
+       /**
+        * Check if we are running in PhantomJS.
+        * Uploading a Blob with PhantomJS does not work correctly, as reported here:
+        * https://github.com/ariya/phantomjs/issues/11395
+        * @type boolean
+        */
+       var isPhantomJS = typeof navigator !== 'undefined' && /PhantomJS/i.test(navigator.userAgent);
+
+       /**
+        * When true, avoids using Blobs to encode payloads.
+        * @type boolean
+        */
+       var dontSendBlobs = isAndroid || isPhantomJS;
+
+       /**
+        * Current protocol version.
+        */
+
+       exports.protocol = 3;
+
+       /**
+        * Packet types.
+        */
+
+       var packets = exports.packets = {
+           open:     0    // non-ws
+         , close:    1    // non-ws
+         , ping:     2
+         , pong:     3
+         , message:  4
+         , upgrade:  5
+         , noop:     6
+       };
+
+       var packetslist = keys(packets);
+
+       /**
+        * Premade error packet.
+        */
+
+       var err = { type: 'error', data: 'parser error' };
+
+       /**
+        * Create a blob api even for blob builder when vendor prefixes exist
+        */
+
+       var Blob = __webpack_require__(18);
+
+       /**
+        * Encodes a packet.
+        *
+        *     <packet type id> [ <data> ]
+        *
+        * Example:
+        *
+        *     5hello world
+        *     3
+        *     4
+        *
+        * Binary is encoded in an identical principle
+        *
+        * @api private
+        */
+
+       exports.encodePacket = function (packet, supportsBinary, utf8encode, callback) {
+         if (typeof supportsBinary === 'function') {
+           callback = supportsBinary;
+           supportsBinary = false;
+         }
+
+         if (typeof utf8encode === 'function') {
+           callback = utf8encode;
+           utf8encode = null;
+         }
+
+         var data = (packet.data === undefined)
+           ? undefined
+           : packet.data.buffer || packet.data;
+
+         if (global.ArrayBuffer && data instanceof ArrayBuffer) {
+           return encodeArrayBuffer(packet, supportsBinary, callback);
+         } else if (Blob && data instanceof global.Blob) {
+           return encodeBlob(packet, supportsBinary, callback);
+         }
+
+         // might be an object with { base64: true, data: dataAsBase64String }
+         if (data && data.base64) {
+           return encodeBase64Object(packet, callback);
+         }
+
+         // Sending data as a utf-8 string
+         var encoded = packets[packet.type];
+
+         // data fragment is optional
+         if (undefined !== packet.data) {
+           encoded += utf8encode ? utf8.encode(String(packet.data), { strict: false }) : String(packet.data);
+         }
+
+         return callback('' + encoded);
+
+       };
+
+       function encodeBase64Object(packet, callback) {
+         // packet data is an object { base64: true, data: dataAsBase64String }
+         var message = 'b' + exports.packets[packet.type] + packet.data.data;
+         return callback(message);
+       }
+
+       /**
+        * Encode packet helpers for binary types
+        */
+
+       function encodeArrayBuffer(packet, supportsBinary, callback) {
+         if (!supportsBinary) {
+           return exports.encodeBase64Packet(packet, callback);
+         }
+
+         var data = packet.data;
+         var contentArray = new Uint8Array(data);
+         var resultBuffer = new Uint8Array(1 + data.byteLength);
+
+         resultBuffer[0] = packets[packet.type];
+         for (var i = 0; i < contentArray.length; i++) {
+           resultBuffer[i+1] = contentArray[i];
+         }
+
+         return callback(resultBuffer.buffer);
+       }
+
+       function encodeBlobAsArrayBuffer(packet, supportsBinary, callback) {
+         if (!supportsBinary) {
+           return exports.encodeBase64Packet(packet, callback);
+         }
+
+         var fr = new FileReader();
+         fr.onload = function() {
+           packet.data = fr.result;
+           exports.encodePacket(packet, supportsBinary, true, callback);
+         };
+         return fr.readAsArrayBuffer(packet.data);
+       }
+
+       function encodeBlob(packet, supportsBinary, callback) {
+         if (!supportsBinary) {
+           return exports.encodeBase64Packet(packet, callback);
+         }
+
+         if (dontSendBlobs) {
+           return encodeBlobAsArrayBuffer(packet, supportsBinary, callback);
+         }
+
+         var length = new Uint8Array(1);
+         length[0] = packets[packet.type];
+         var blob = new Blob([length.buffer, packet.data]);
+
+         return callback(blob);
+       }
+
+       /**
+        * Encodes a packet with binary data in a base64 string
+        *
+        * @param {Object} packet, has `type` and `data`
+        * @return {String} base64 encoded message
+        */
+
+       exports.encodeBase64Packet = function(packet, callback) {
+         var message = 'b' + exports.packets[packet.type];
+         if (Blob && packet.data instanceof global.Blob) {
+           var fr = new FileReader();
+           fr.onload = function() {
+             var b64 = fr.result.split(',')[1];
+             callback(message + b64);
+           };
+           return fr.readAsDataURL(packet.data);
+         }
+
+         var b64data;
+         try {
+           b64data = String.fromCharCode.apply(null, new Uint8Array(packet.data));
+         } catch (e) {
+           // iPhone Safari doesn't let you apply with typed arrays
+           var typed = new Uint8Array(packet.data);
+           var basic = new Array(typed.length);
+           for (var i = 0; i < typed.length; i++) {
+             basic[i] = typed[i];
+           }
+           b64data = String.fromCharCode.apply(null, basic);
+         }
+         message += global.btoa(b64data);
+         return callback(message);
+       };
+
+       /**
+        * Decodes a packet. Changes format to Blob if requested.
+        *
+        * @return {Object} with `type` and `data` (if any)
+        * @api private
+        */
+
+       exports.decodePacket = function (data, binaryType, utf8decode) {
+         if (data === undefined) {
+           return err;
+         }
+         // String data
+         if (typeof data === 'string') {
+           if (data.charAt(0) === 'b') {
+             return exports.decodeBase64Packet(data.substr(1), binaryType);
+           }
+
+           if (utf8decode) {
+             data = tryDecode(data);
+             if (data === false) {
+               return err;
+             }
+           }
+           var type = data.charAt(0);
+
+           if (Number(type) != type || !packetslist[type]) {
+             return err;
+           }
+
+           if (data.length > 1) {
+             return { type: packetslist[type], data: data.substring(1) };
+           } else {
+             return { type: packetslist[type] };
+           }
+         }
+
+         var asArray = new Uint8Array(data);
+         var type = asArray[0];
+         var rest = sliceBuffer(data, 1);
+         if (Blob && binaryType === 'blob') {
+           rest = new Blob([rest]);
+         }
+         return { type: packetslist[type], data: rest };
+       };
+
+       function tryDecode(data) {
+         try {
+           data = utf8.decode(data, { strict: false });
+         } catch (e) {
+           return false;
+         }
+         return data;
+       }
+
+       /**
+        * Decodes a packet encoded in a base64 string
+        *
+        * @param {String} base64 encoded message
+        * @return {Object} with `type` and `data` (if any)
+        */
+
+       exports.decodeBase64Packet = function(msg, binaryType) {
+         var type = packetslist[msg.charAt(0)];
+         if (!base64encoder) {
+           return { type: type, data: { base64: true, data: msg.substr(1) } };
+         }
+
+         var data = base64encoder.decode(msg.substr(1));
+
+         if (binaryType === 'blob' && Blob) {
+           data = new Blob([data]);
+         }
+
+         return { type: type, data: data };
+       };
+
+       /**
+        * Encodes multiple messages (payload).
+        *
+        *     <length>:data
+        *
+        * Example:
+        *
+        *     11:hello world2:hi
+        *
+        * If any contents are binary, they will be encoded as base64 strings. Base64
+        * encoded strings are marked with a b before the length specifier
+        *
+        * @param {Array} packets
+        * @api private
+        */
+
+       exports.encodePayload = function (packets, supportsBinary, callback) {
+         if (typeof supportsBinary === 'function') {
+           callback = supportsBinary;
+           supportsBinary = null;
+         }
+
+         var isBinary = hasBinary(packets);
+
+         if (supportsBinary && isBinary) {
+           if (Blob && !dontSendBlobs) {
+             return exports.encodePayloadAsBlob(packets, callback);
+           }
+
+           return exports.encodePayloadAsArrayBuffer(packets, callback);
+         }
+
+         if (!packets.length) {
+           return callback('0:');
+         }
+
+         function setLengthHeader(message) {
+           return message.length + ':' + message;
+         }
+
+         function encodeOne(packet, doneCallback) {
+           exports.encodePacket(packet, !isBinary ? false : supportsBinary, false, function(message) {
+             doneCallback(null, setLengthHeader(message));
+           });
+         }
+
+         map(packets, encodeOne, function(err, results) {
+           return callback(results.join(''));
+         });
+       };
+
+       /**
+        * Async array map using after
+        */
+
+       function map(ary, each, done) {
+         var result = new Array(ary.length);
+         var next = after(ary.length, done);
+
+         var eachWithIndex = function(i, el, cb) {
+           each(el, function(error, msg) {
+             result[i] = msg;
+             cb(error, result);
+           });
+         };
+
+         for (var i = 0; i < ary.length; i++) {
+           eachWithIndex(i, ary[i], next);
+         }
+       }
+
+       /*
+        * Decodes data when a payload is maybe expected. Possible binary contents are
+        * decoded from their base64 representation
+        *
+        * @param {String} data, callback method
+        * @api public
+        */
+
+       exports.decodePayload = function (data, binaryType, callback) {
+         if (typeof data !== 'string') {
+           return exports.decodePayloadAsBinary(data, binaryType, callback);
+         }
+
+         if (typeof binaryType === 'function') {
+           callback = binaryType;
+           binaryType = null;
+         }
+
+         var packet;
+         if (data === '') {
+           // parser error - ignoring payload
+           return callback(err, 0, 1);
+         }
+
+         var length = '', n, msg;
+
+         for (var i = 0, l = data.length; i < l; i++) {
+           var chr = data.charAt(i);
+
+           if (chr !== ':') {
+             length += chr;
+             continue;
+           }
+
+           if (length === '' || (length != (n = Number(length)))) {
+             // parser error - ignoring payload
+             return callback(err, 0, 1);
+           }
+
+           msg = data.substr(i + 1, n);
+
+           if (length != msg.length) {
+             // parser error - ignoring payload
+             return callback(err, 0, 1);
+           }
+
+           if (msg.length) {
+             packet = exports.decodePacket(msg, binaryType, false);
+
+             if (err.type === packet.type && err.data === packet.data) {
+               // parser error in individual packet - ignoring payload
+               return callback(err, 0, 1);
+             }
+
+             var ret = callback(packet, i + n, l);
+             if (false === ret) return;
+           }
+
+           // advance cursor
+           i += n;
+           length = '';
+         }
+
+         if (length !== '') {
+           // parser error - ignoring payload
+           return callback(err, 0, 1);
+         }
+
+       };
+
+       /**
+        * Encodes multiple messages (payload) as binary.
+        *
+        * <1 = binary, 0 = string><number from 0-9><number from 0-9>[...]<number
+        * 255><data>
+        *
+        * Example:
+        * 1 3 255 1 2 3, if the binary contents are interpreted as 8 bit integers
+        *
+        * @param {Array} packets
+        * @return {ArrayBuffer} encoded payload
+        * @api private
+        */
+
+       exports.encodePayloadAsArrayBuffer = function(packets, callback) {
+         if (!packets.length) {
+           return callback(new ArrayBuffer(0));
+         }
+
+         function encodeOne(packet, doneCallback) {
+           exports.encodePacket(packet, true, true, function(data) {
+             return doneCallback(null, data);
+           });
+         }
+
+         map(packets, encodeOne, function(err, encodedPackets) {
+           var totalLength = encodedPackets.reduce(function(acc, p) {
+             var len;
+             if (typeof p === 'string'){
+               len = p.length;
+             } else {
+               len = p.byteLength;
+             }
+             return acc + len.toString().length + len + 2; // string/binary identifier + separator = 2
+           }, 0);
+
+           var resultArray = new Uint8Array(totalLength);
+
+           var bufferIndex = 0;
+           encodedPackets.forEach(function(p) {
+             var isString = typeof p === 'string';
+             var ab = p;
+             if (isString) {
+               var view = new Uint8Array(p.length);
+               for (var i = 0; i < p.length; i++) {
+                 view[i] = p.charCodeAt(i);
+               }
+               ab = view.buffer;
+             }
+
+             if (isString) { // not true binary
+               resultArray[bufferIndex++] = 0;
+             } else { // true binary
+               resultArray[bufferIndex++] = 1;
+             }
+
+             var lenStr = ab.byteLength.toString();
+             for (var i = 0; i < lenStr.length; i++) {
+               resultArray[bufferIndex++] = parseInt(lenStr[i]);
+             }
+             resultArray[bufferIndex++] = 255;
+
+             var view = new Uint8Array(ab);
+             for (var i = 0; i < view.length; i++) {
+               resultArray[bufferIndex++] = view[i];
+             }
+           });
+
+           return callback(resultArray.buffer);
+         });
+       };
+
+       /**
+        * Encode as Blob
+        */
+
+       exports.encodePayloadAsBlob = function(packets, callback) {
+         function encodeOne(packet, doneCallback) {
+           exports.encodePacket(packet, true, true, function(encoded) {
+             var binaryIdentifier = new Uint8Array(1);
+             binaryIdentifier[0] = 1;
+             if (typeof encoded === 'string') {
+               var view = new Uint8Array(encoded.length);
+               for (var i = 0; i < encoded.length; i++) {
+                 view[i] = encoded.charCodeAt(i);
+               }
+               encoded = view.buffer;
+               binaryIdentifier[0] = 0;
+             }
+
+             var len = (encoded instanceof ArrayBuffer)
+               ? encoded.byteLength
+               : encoded.size;
+
+             var lenStr = len.toString();
+             var lengthAry = new Uint8Array(lenStr.length + 1);
+             for (var i = 0; i < lenStr.length; i++) {
+               lengthAry[i] = parseInt(lenStr[i]);
+             }
+             lengthAry[lenStr.length] = 255;
+
+             if (Blob) {
+               var blob = new Blob([binaryIdentifier.buffer, lengthAry.buffer, encoded]);
+               doneCallback(null, blob);
+             }
+           });
+         }
+
+         map(packets, encodeOne, function(err, results) {
+           return callback(new Blob(results));
+         });
+       };
+
+       /*
+        * Decodes data when a payload is maybe expected. Strings are decoded by
+        * interpreting each byte as a key code for entries marked to start with 0. See
+        * description of encodePayloadAsBinary
+        *
+        * @param {ArrayBuffer} data, callback method
+        * @api public
+        */
+
+       exports.decodePayloadAsBinary = function (data, binaryType, callback) {
+         if (typeof binaryType === 'function') {
+           callback = binaryType;
+           binaryType = null;
+         }
+
+         var bufferTail = data;
+         var buffers = [];
+
+         while (bufferTail.byteLength > 0) {
+           var tailArray = new Uint8Array(bufferTail);
+           var isString = tailArray[0] === 0;
+           var msgLength = '';
+
+           for (var i = 1; ; i++) {
+             if (tailArray[i] === 255) break;
+
+             // 310 = char length of Number.MAX_VALUE
+             if (msgLength.length > 310) {
+               return callback(err, 0, 1);
+             }
+
+             msgLength += tailArray[i];
+           }
+
+           bufferTail = sliceBuffer(bufferTail, 2 + msgLength.length);
+           msgLength = parseInt(msgLength);
+
+           var msg = sliceBuffer(bufferTail, 0, msgLength);
+           if (isString) {
+             try {
+               msg = String.fromCharCode.apply(null, new Uint8Array(msg));
+             } catch (e) {
+               // iPhone Safari doesn't let you apply to typed arrays
+               var typed = new Uint8Array(msg);
+               msg = '';
+               for (var i = 0; i < typed.length; i++) {
+                 msg += String.fromCharCode(typed[i]);
+               }
+             }
+           }
+
+           buffers.push(msg);
+           bufferTail = sliceBuffer(bufferTail, msgLength);
+         }
+
+         var total = buffers.length;
+         buffers.forEach(function(buffer, i) {
+           callback(exports.decodePacket(buffer, binaryType, true), i, total);
+         });
+       };
+
+       /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
+
+/***/ },
+/* 10 */
+/***/ function(module, exports) {
+
+       
+       /**
+        * Gets the keys for an object.
+        *
+        * @return {Array} keys
+        * @api private
+        */
+
+       module.exports = Object.keys || function keys (obj){
+         var arr = [];
+         var has = Object.prototype.hasOwnProperty;
+
+         for (var i in obj) {
+           if (has.call(obj, i)) {
+             arr.push(i);
+           }
+         }
+         return arr;
+       };
+
+
+/***/ },
+/* 11 */
+/***/ function(module, exports, __webpack_require__) {
+
+       /* WEBPACK VAR INJECTION */(function(global) {/* global Blob File */
+
+       /*
+        * Module requirements.
+        */
+
+       var isArray = __webpack_require__(12);
+
+       var toString = Object.prototype.toString;
+       var withNativeBlob = typeof global.Blob === 'function' || toString.call(global.Blob) === '[object BlobConstructor]';
+       var withNativeFile = typeof global.File === 'function' || toString.call(global.File) === '[object FileConstructor]';
+
+       /**
+        * Module exports.
+        */
+
+       module.exports = hasBinary;
+
+       /**
+        * Checks for binary data.
+        *
+        * Supports Buffer, ArrayBuffer, Blob and File.
+        *
+        * @param {Object} anything
+        * @api public
+        */
+
+       function hasBinary (obj) {
+         if (!obj || typeof obj !== 'object') {
+           return false;
+         }
+
+         if (isArray(obj)) {
+           for (var i = 0, l = obj.length; i < l; i++) {
+             if (hasBinary(obj[i])) {
+               return true;
+             }
+           }
+           return false;
+         }
+
+         if ((typeof global.Buffer === 'function' && global.Buffer.isBuffer && global.Buffer.isBuffer(obj)) ||
+            (typeof global.ArrayBuffer === 'function' && obj instanceof ArrayBuffer) ||
+            (withNativeBlob && obj instanceof Blob) ||
+            (withNativeFile && obj instanceof File)
+           ) {
+           return true;
+         }
+
+         // see: https://github.com/Automattic/has-binary/pull/4
+         if (obj.toJSON && typeof obj.toJSON === 'function' && arguments.length === 1) {
+           return hasBinary(obj.toJSON(), true);
+         }
+
+         for (var key in obj) {
+           if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) {
+             return true;
+           }
+         }
+
+         return false;
+       }
+
+       /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
+
+/***/ },
+/* 12 */
+/***/ function(module, exports) {
+
+       var toString = {}.toString;
+
+       module.exports = Array.isArray || function (arr) {
+         return toString.call(arr) == '[object Array]';
+       };
+
+
+/***/ },
+/* 13 */
+/***/ function(module, exports) {
+
+       /**
+        * An abstraction for slicing an arraybuffer even when
+        * ArrayBuffer.prototype.slice is not supported
+        *
+        * @api public
+        */
+
+       module.exports = function(arraybuffer, start, end) {
+         var bytes = arraybuffer.byteLength;
+         start = start || 0;
+         end = end || bytes;
+
+         if (arraybuffer.slice) { return arraybuffer.slice(start, end); }
+
+         if (start < 0) { start += bytes; }
+         if (end < 0) { end += bytes; }
+         if (end > bytes) { end = bytes; }
+
+         if (start >= bytes || start >= end || bytes === 0) {
+           return new ArrayBuffer(0);
+         }
+
+         var abv = new Uint8Array(arraybuffer);
+         var result = new Uint8Array(end - start);
+         for (var i = start, ii = 0; i < end; i++, ii++) {
+           result[ii] = abv[i];
+         }
+         return result.buffer;
+       };
+
+
+/***/ },
+/* 14 */
+/***/ function(module, exports) {
+
+       module.exports = after
+
+       function after(count, callback, err_cb) {
+           var bail = false
+           err_cb = err_cb || noop
+           proxy.count = count
+
+           return (count === 0) ? callback() : proxy
+
+           function proxy(err, result) {
+               if (proxy.count <= 0) {
+                   throw new Error('after called too many times')
+               }
+               --proxy.count
+
+               // after first error, rest are passed to err_cb
+               if (err) {
+                   bail = true
+                   callback(err)
+                   // future error callbacks will go to error handler
+                   callback = err_cb
+               } else if (proxy.count === 0 && !bail) {
+                   callback(null, result)
+               }
+           }
+       }
+
+       function noop() {}
+
+
+/***/ },
+/* 15 */
+/***/ function(module, exports, __webpack_require__) {
+
+       var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! https://mths.be/utf8js v2.1.2 by @mathias */
+       ;(function(root) {
+
+               // Detect free variables `exports`
+               var freeExports = typeof exports == 'object' && exports;
+
+               // Detect free variable `module`
+               var freeModule = typeof module == 'object' && module &&
+                       module.exports == freeExports && module;
+
+               // Detect free variable `global`, from Node.js or Browserified code,
+               // and use it as `root`
+               var freeGlobal = typeof global == 'object' && global;
+               if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
+                       root = freeGlobal;
+               }
+
+               /*--------------------------------------------------------------------------*/
+
+               var stringFromCharCode = String.fromCharCode;
+
+               // Taken from https://mths.be/punycode
+               function ucs2decode(string) {
+                       var output = [];
+                       var counter = 0;
+                       var length = string.length;
+                       var value;
+                       var extra;
+                       while (counter < length) {
+                               value = string.charCodeAt(counter++);
+                               if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
+                                       // high surrogate, and there is a next character
+                                       extra = string.charCodeAt(counter++);
+                                       if ((extra & 0xFC00) == 0xDC00) { // low surrogate
+                                               output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
+                                       } else {
+                                               // unmatched surrogate; only append this code unit, in case the next
+                                               // code unit is the high surrogate of a surrogate pair
+                                               output.push(value);
+                                               counter--;
+                                       }
+                               } else {
+                                       output.push(value);
+                               }
+                       }
+                       return output;
+               }
+
+               // Taken from https://mths.be/punycode
+               function ucs2encode(array) {
+                       var length = array.length;
+                       var index = -1;
+                       var value;
+                       var output = '';
+                       while (++index < length) {
+                               value = array[index];
+                               if (value > 0xFFFF) {
+                                       value -= 0x10000;
+                                       output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
+                                       value = 0xDC00 | value & 0x3FF;
+                               }
+                               output += stringFromCharCode(value);
+                       }
+                       return output;
+               }
+
+               function checkScalarValue(codePoint, strict) {
+                       if (codePoint >= 0xD800 && codePoint <= 0xDFFF) {
+                               if (strict) {
+                                       throw Error(
+                                               'Lone surrogate U+' + codePoint.toString(16).toUpperCase() +
+                                               ' is not a scalar value'
+                                       );
+                               }
+                               return false;
+                       }
+                       return true;
+               }
+               /*--------------------------------------------------------------------------*/
+
+               function createByte(codePoint, shift) {
+                       return stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80);
+               }
+
+               function encodeCodePoint(codePoint, strict) {
+                       if ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence
+                               return stringFromCharCode(codePoint);
+                       }
+                       var symbol = '';
+                       if ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence
+                               symbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0);
+                       }
+                       else if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence
+                               if (!checkScalarValue(codePoint, strict)) {
+                                       codePoint = 0xFFFD;
+                               }
+                               symbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0);
+                               symbol += createByte(codePoint, 6);
+                       }
+                       else if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence
+                               symbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0);
+                               symbol += createByte(codePoint, 12);
+                               symbol += createByte(codePoint, 6);
+                       }
+                       symbol += stringFromCharCode((codePoint & 0x3F) | 0x80);
+                       return symbol;
+               }
+
+               function utf8encode(string, opts) {
+                       opts = opts || {};
+                       var strict = false !== opts.strict;
+
+                       var codePoints = ucs2decode(string);
+                       var length = codePoints.length;
+                       var index = -1;
+                       var codePoint;
+                       var byteString = '';
+                       while (++index < length) {
+                               codePoint = codePoints[index];
+                               byteString += encodeCodePoint(codePoint, strict);
+                       }
+                       return byteString;
+               }
+
+               /*--------------------------------------------------------------------------*/
+
+               function readContinuationByte() {
+                       if (byteIndex >= byteCount) {
+                               throw Error('Invalid byte index');
+                       }
+
+                       var continuationByte = byteArray[byteIndex] & 0xFF;
+                       byteIndex++;
+
+                       if ((continuationByte & 0xC0) == 0x80) {
+                               return continuationByte & 0x3F;
+                       }
+
+                       // If we end up here, it’s not a continuation byte
+                       throw Error('Invalid continuation byte');
+               }
+
+               function decodeSymbol(strict) {
+                       var byte1;
+                       var byte2;
+                       var byte3;
+                       var byte4;
+                       var codePoint;
+
+                       if (byteIndex > byteCount) {
+                               throw Error('Invalid byte index');
+                       }
+
+                       if (byteIndex == byteCount) {
+                               return false;
+                       }
+
+                       // Read first byte
+                       byte1 = byteArray[byteIndex] & 0xFF;
+                       byteIndex++;
+
+                       // 1-byte sequence (no continuation bytes)
+                       if ((byte1 & 0x80) == 0) {
+                               return byte1;
+                       }
+
+                       // 2-byte sequence
+                       if ((byte1 & 0xE0) == 0xC0) {
+                               byte2 = readContinuationByte();
+                               codePoint = ((byte1 & 0x1F) << 6) | byte2;
+                               if (codePoint >= 0x80) {
+                                       return codePoint;
+                               } else {
+                                       throw Error('Invalid continuation byte');
+                               }
+                       }
+
+                       // 3-byte sequence (may include unpaired surrogates)
+                       if ((byte1 & 0xF0) == 0xE0) {
+                               byte2 = readContinuationByte();
+                               byte3 = readContinuationByte();
+                               codePoint = ((byte1 & 0x0F) << 12) | (byte2 << 6) | byte3;
+                               if (codePoint >= 0x0800) {
+                                       return checkScalarValue(codePoint, strict) ? codePoint : 0xFFFD;
+                               } else {
+                                       throw Error('Invalid continuation byte');
+                               }
+                       }
+
+                       // 4-byte sequence
+                       if ((byte1 & 0xF8) == 0xF0) {
+                               byte2 = readContinuationByte();
+                               byte3 = readContinuationByte();
+                               byte4 = readContinuationByte();
+                               codePoint = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0C) |
+                                       (byte3 << 0x06) | byte4;
+                               if (codePoint >= 0x010000 && codePoint <= 0x10FFFF) {
+                                       return codePoint;
+                               }
+                       }
+
+                       throw Error('Invalid UTF-8 detected');
+               }
+
+               var byteArray;
+               var byteCount;
+               var byteIndex;
+               function utf8decode(byteString, opts) {
+                       opts = opts || {};
+                       var strict = false !== opts.strict;
+
+                       byteArray = ucs2decode(byteString);
+                       byteCount = byteArray.length;
+                       byteIndex = 0;
+                       var codePoints = [];
+                       var tmp;
+                       while ((tmp = decodeSymbol(strict)) !== false) {
+                               codePoints.push(tmp);
+                       }
+                       return ucs2encode(codePoints);
+               }
+
+               /*--------------------------------------------------------------------------*/
+
+               var utf8 = {
+                       'version': '2.1.2',
+                       'encode': utf8encode,
+                       'decode': utf8decode
+               };
+
+               // Some AMD build optimizers, like r.js, check for specific condition patterns
+               // like the following:
+               if (
+                       true
+               ) {
+                       !(__WEBPACK_AMD_DEFINE_RESULT__ = function() {
+                               return utf8;
+                       }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
+               }       else if (freeExports && !freeExports.nodeType) {
+                       if (freeModule) { // in Node.js or RingoJS v0.8.0+
+                               freeModule.exports = utf8;
+                       } else { // in Narwhal or RingoJS v0.7.0-
+                               var object = {};
+                               var hasOwnProperty = object.hasOwnProperty;
+                               for (var key in utf8) {
+                                       hasOwnProperty.call(utf8, key) && (freeExports[key] = utf8[key]);
+                               }
+                       }
+               } else { // in Rhino or a web browser
+                       root.utf8 = utf8;
+               }
+
+       }(this));
+
+       /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(16)(module), (function() { return this; }())))
+
+/***/ },
+/* 16 */
+/***/ function(module, exports) {
+
+       module.exports = function(module) {\r
+               if(!module.webpackPolyfill) {\r
+                       module.deprecate = function() {};\r
+                       module.paths = [];\r
+                       // module.parent = undefined by default\r
+                       module.children = [];\r
+                       module.webpackPolyfill = 1;\r
+               }\r
+               return module;\r
+       }\r
+
+
+/***/ },
+/* 17 */
+/***/ function(module, exports) {
+
+       /*
+        * base64-arraybuffer
+        * https://github.com/niklasvh/base64-arraybuffer
+        *
+        * Copyright (c) 2012 Niklas von Hertzen
+        * Licensed under the MIT license.
+        */
+       (function(){
+         "use strict";
+
+         var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+
+         // Use a lookup table to find the index.
+         var lookup = new Uint8Array(256);
+         for (var i = 0; i < chars.length; i++) {
+           lookup[chars.charCodeAt(i)] = i;
+         }
+
+         exports.encode = function(arraybuffer) {
+           var bytes = new Uint8Array(arraybuffer),
+           i, len = bytes.length, base64 = "";
+
+           for (i = 0; i < len; i+=3) {
+             base64 += chars[bytes[i] >> 2];
+             base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];
+             base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];
+             base64 += chars[bytes[i + 2] & 63];
+           }
+
+           if ((len % 3) === 2) {
+             base64 = base64.substring(0, base64.length - 1) + "=";
+           } else if (len % 3 === 1) {
+             base64 = base64.substring(0, base64.length - 2) + "==";
+           }
+
+           return base64;
+         };
+
+         exports.decode =  function(base64) {
+           var bufferLength = base64.length * 0.75,
+           len = base64.length, i, p = 0,
+           encoded1, encoded2, encoded3, encoded4;
+
+           if (base64[base64.length - 1] === "=") {
+             bufferLength--;
+             if (base64[base64.length - 2] === "=") {
+               bufferLength--;
+             }
+           }
+
+           var arraybuffer = new ArrayBuffer(bufferLength),
+           bytes = new Uint8Array(arraybuffer);
+
+           for (i = 0; i < len; i+=4) {
+             encoded1 = lookup[base64.charCodeAt(i)];
+             encoded2 = lookup[base64.charCodeAt(i+1)];
+             encoded3 = lookup[base64.charCodeAt(i+2)];
+             encoded4 = lookup[base64.charCodeAt(i+3)];
+
+             bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);
+             bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);
+             bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);
+           }
+
+           return arraybuffer;
+         };
+       })();
+
+
+/***/ },
+/* 18 */
+/***/ function(module, exports) {
+
+       /* WEBPACK VAR INJECTION */(function(global) {/**
+        * Create a blob builder even when vendor prefixes exist
+        */
+
+       var BlobBuilder = global.BlobBuilder
+         || global.WebKitBlobBuilder
+         || global.MSBlobBuilder
+         || global.MozBlobBuilder;
+
+       /**
+        * Check if Blob constructor is supported
+        */
+
+       var blobSupported = (function() {
+         try {
+           var a = new Blob(['hi']);
+           return a.size === 2;
+         } catch(e) {
+           return false;
+         }
+       })();
+
+       /**
+        * Check if Blob constructor supports ArrayBufferViews
+        * Fails in Safari 6, so we need to map to ArrayBuffers there.
+        */
+
+       var blobSupportsArrayBufferView = blobSupported && (function() {
+         try {
+           var b = new Blob([new Uint8Array([1,2])]);
+           return b.size === 2;
+         } catch(e) {
+           return false;
+         }
+       })();
+
+       /**
+        * Check if BlobBuilder is supported
+        */
+
+       var blobBuilderSupported = BlobBuilder
+         && BlobBuilder.prototype.append
+         && BlobBuilder.prototype.getBlob;
+
+       /**
+        * Helper function that maps ArrayBufferViews to ArrayBuffers
+        * Used by BlobBuilder constructor and old browsers that didn't
+        * support it in the Blob constructor.
+        */
+
+       function mapArrayBufferViews(ary) {
+         for (var i = 0; i < ary.length; i++) {
+           var chunk = ary[i];
+           if (chunk.buffer instanceof ArrayBuffer) {
+             var buf = chunk.buffer;
+
+             // if this is a subarray, make a copy so we only
+             // include the subarray region from the underlying buffer
+             if (chunk.byteLength !== buf.byteLength) {
+               var copy = new Uint8Array(chunk.byteLength);
+               copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));
+               buf = copy.buffer;
+             }
+
+             ary[i] = buf;
+           }
+         }
+       }
+
+       function BlobBuilderConstructor(ary, options) {
+         options = options || {};
+
+         var bb = new BlobBuilder();
+         mapArrayBufferViews(ary);
+
+         for (var i = 0; i < ary.length; i++) {
+           bb.append(ary[i]);
+         }
+
+         return (options.type) ? bb.getBlob(options.type) : bb.getBlob();
+       };
+
+       function BlobConstructor(ary, options) {
+         mapArrayBufferViews(ary);
+         return new Blob(ary, options || {});
+       };
+
+       module.exports = (function() {
+         if (blobSupported) {
+           return blobSupportsArrayBufferView ? global.Blob : BlobConstructor;
+         } else if (blobBuilderSupported) {
+           return BlobBuilderConstructor;
+         } else {
+           return undefined;
+         }
+       })();
+
+       /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
+
+/***/ },
+/* 19 */
+/***/ function(module, exports, __webpack_require__) {
+
+       \r
+       /**\r
+        * Expose `Emitter`.\r
+        */\r
+\r
+       if (true) {\r
+         module.exports = Emitter;\r
+       }\r
+\r
+       /**\r
+        * Initialize a new `Emitter`.\r
+        *\r
+        * @api public\r
+        */\r
+\r
+       function Emitter(obj) {\r
+         if (obj) return mixin(obj);\r
+       };\r
+\r
+       /**\r
+        * Mixin the emitter properties.\r
+        *\r
+        * @param {Object} obj\r
+        * @return {Object}\r
+        * @api private\r
+        */\r
+\r
+       function mixin(obj) {\r
+         for (var key in Emitter.prototype) {\r
+           obj[key] = Emitter.prototype[key];\r
+         }\r
+         return obj;\r
+       }\r
+\r
+       /**\r
+        * Listen on the given `event` with `fn`.\r
+        *\r
+        * @param {String} event\r
+        * @param {Function} fn\r
+        * @return {Emitter}\r
+        * @api public\r
+        */\r
+\r
+       Emitter.prototype.on =\r
+       Emitter.prototype.addEventListener = function(event, fn){\r
+         this._callbacks = this._callbacks || {};\r
+         (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\r
+           .push(fn);\r
+         return this;\r
+       };\r
+\r
+       /**\r
+        * Adds an `event` listener that will be invoked a single\r
+        * time then automatically removed.\r
+        *\r
+        * @param {String} event\r
+        * @param {Function} fn\r
+        * @return {Emitter}\r
+        * @api public\r
+        */\r
+\r
+       Emitter.prototype.once = function(event, fn){\r
+         function on() {\r
+           this.off(event, on);\r
+           fn.apply(this, arguments);\r
+         }\r
+\r
+         on.fn = fn;\r
+         this.on(event, on);\r
+         return this;\r
+       };\r
+\r
+       /**\r
+        * Remove the given callback for `event` or all\r
+        * registered callbacks.\r
+        *\r
+        * @param {String} event\r
+        * @param {Function} fn\r
+        * @return {Emitter}\r
+        * @api public\r
+        */\r
+\r
+       Emitter.prototype.off =\r
+       Emitter.prototype.removeListener =\r
+       Emitter.prototype.removeAllListeners =\r
+       Emitter.prototype.removeEventListener = function(event, fn){\r
+         this._callbacks = this._callbacks || {};\r
+\r
+         // all\r
+         if (0 == arguments.length) {\r
+           this._callbacks = {};\r
+           return this;\r
+         }\r
+\r
+         // specific event\r
+         var callbacks = this._callbacks['$' + event];\r
+         if (!callbacks) return this;\r
+\r
+         // remove all handlers\r
+         if (1 == arguments.length) {\r
+           delete this._callbacks['$' + event];\r
+           return this;\r
+         }\r
+\r
+         // remove specific handler\r
+         var cb;\r
+         for (var i = 0; i < callbacks.length; i++) {\r
+           cb = callbacks[i];\r
+           if (cb === fn || cb.fn === fn) {\r
+             callbacks.splice(i, 1);\r
+             break;\r
+           }\r
+         }\r
+         return this;\r
+       };\r
+\r
+       /**\r
+        * Emit `event` with the given args.\r
+        *\r
+        * @param {String} event\r
+        * @param {Mixed} ...\r
+        * @return {Emitter}\r
+        */\r
+\r
+       Emitter.prototype.emit = function(event){\r
+         this._callbacks = this._callbacks || {};\r
+         var args = [].slice.call(arguments, 1)\r
+           , callbacks = this._callbacks['$' + event];\r
+\r
+         if (callbacks) {\r
+           callbacks = callbacks.slice(0);\r
+           for (var i = 0, len = callbacks.length; i < len; ++i) {\r
+             callbacks[i].apply(this, args);\r
+           }\r
+         }\r
+\r
+         return this;\r
+       };\r
+\r
+       /**\r
+        * Return array of callbacks for `event`.\r
+        *\r
+        * @param {String} event\r
+        * @return {Array}\r
+        * @api public\r
+        */\r
+\r
+       Emitter.prototype.listeners = function(event){\r
+         this._callbacks = this._callbacks || {};\r
+         return this._callbacks['$' + event] || [];\r
+       };\r
+\r
+       /**\r
+        * Check if this emitter has `event` handlers.\r
+        *\r
+        * @param {String} event\r
+        * @return {Boolean}\r
+        * @api public\r
+        */\r
+\r
+       Emitter.prototype.hasListeners = function(event){\r
+         return !! this.listeners(event).length;\r
+       };\r
+
+
+/***/ },
+/* 20 */
+/***/ function(module, exports) {
+
+       /**\r
+        * Compiles a querystring\r
+        * Returns string representation of the object\r
+        *\r
+        * @param {Object}\r
+        * @api private\r
+        */\r
+\r
+       exports.encode = function (obj) {\r
+         var str = '';\r
+\r
+         for (var i in obj) {\r
+           if (obj.hasOwnProperty(i)) {\r
+             if (str.length) str += '&';\r
+             str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]);\r
+           }\r
+         }\r
+\r
+         return str;\r
+       };\r
+\r
+       /**\r
+        * Parses a simple querystring into an object\r
+        *\r
+        * @param {String} qs\r
+        * @api private\r
+        */\r
+\r
+       exports.decode = function(qs){\r
+         var qry = {};\r
+         var pairs = qs.split('&');\r
+         for (var i = 0, l = pairs.length; i < l; i++) {\r
+           var pair = pairs[i].split('=');\r
+           qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);\r
+         }\r
+         return qry;\r
+       };\r
+
+
+/***/ },
+/* 21 */
+/***/ function(module, exports) {
+
+       
+       module.exports = function(a, b){
+         var fn = function(){};
+         fn.prototype = b.prototype;
+         a.prototype = new fn;
+         a.prototype.constructor = a;
+       };
+
+/***/ },
+/* 22 */
+/***/ function(module, exports) {
+
+       'use strict';
+
+       var alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split('')
+         , length = 64
+         , map = {}
+         , seed = 0
+         , i = 0
+         , prev;
+
+       /**
+        * Return a string representing the specified number.
+        *
+        * @param {Number} num The number to convert.
+        * @returns {String} The string representation of the number.
+        * @api public
+        */
+       function encode(num) {
+         var encoded = '';
+
+         do {
+           encoded = alphabet[num % length] + encoded;
+           num = Math.floor(num / length);
+         } while (num > 0);
+
+         return encoded;
+       }
+
+       /**
+        * Return the integer value specified by the given string.
+        *
+        * @param {String} str The string to convert.
+        * @returns {Number} The integer value represented by the string.
+        * @api public
+        */
+       function decode(str) {
+         var decoded = 0;
+
+         for (i = 0; i < str.length; i++) {
+           decoded = decoded * length + map[str.charAt(i)];
+         }
+
+         return decoded;
+       }
+
+       /**
+        * Yeast: A tiny growing id generator.
+        *
+        * @returns {String} A unique id.
+        * @api public
+        */
+       function yeast() {
+         var now = encode(+new Date());
+
+         if (now !== prev) return seed = 0, prev = now;
+         return now +'.'+ encode(seed++);
+       }
+
+       //
+       // Map each character to its index.
+       //
+       for (; i < length; i++) map[alphabet[i]] = i;
+
+       //
+       // Expose the `yeast`, `encode` and `decode` functions.
+       //
+       yeast.encode = encode;
+       yeast.decode = decode;
+       module.exports = yeast;
+
+
+/***/ },
+/* 23 */
+/***/ function(module, exports, __webpack_require__) {
+
+       /* WEBPACK VAR INJECTION */(function(process) {/**
+        * This is the web browser implementation of `debug()`.
+        *
+        * Expose `debug()` as the module.
+        */
+
+       exports = module.exports = __webpack_require__(25);
+       exports.log = log;
+       exports.formatArgs = formatArgs;
+       exports.save = save;
+       exports.load = load;
+       exports.useColors = useColors;
+       exports.storage = 'undefined' != typeof chrome
+                      && 'undefined' != typeof chrome.storage
+                         ? chrome.storage.local
+                         : localstorage();
+
+       /**
+        * Colors.
+        */
+
+       exports.colors = [
+         'lightseagreen',
+         'forestgreen',
+         'goldenrod',
+         'dodgerblue',
+         'darkorchid',
+         'crimson'
+       ];
+
+       /**
+        * Currently only WebKit-based Web Inspectors, Firefox >= v31,
+        * and the Firebug extension (any Firefox version) are known
+        * to support "%c" CSS customizations.
+        *
+        * TODO: add a `localStorage` variable to explicitly enable/disable colors
+        */
+
+       function useColors() {
+         // NB: In an Electron preload script, document will be defined but not fully
+         // initialized. Since we know we're in Chrome, we'll just detect this case
+         // explicitly
+         if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
+           return true;
+         }
+
+         // is webkit? http://stackoverflow.com/a/16459606/376773
+         // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
+         return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
+           // is firebug? http://stackoverflow.com/a/398120/376773
+           (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
+           // is firefox >= v31?
+           // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
+           (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
+           // double check webkit in userAgent just in case we are in a worker
+           (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
+       }
+
+       /**
+        * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
+        */
+
+       exports.formatters.j = function(v) {
+         try {
+           return JSON.stringify(v);
+         } catch (err) {
+           return '[UnexpectedJSONParseError]: ' + err.message;
+         }
+       };
+
+
+       /**
+        * Colorize log arguments if enabled.
+        *
+        * @api public
+        */
+
+       function formatArgs(args) {
+         var useColors = this.useColors;
+
+         args[0] = (useColors ? '%c' : '')
+           + this.namespace
+           + (useColors ? ' %c' : ' ')
+           + args[0]
+           + (useColors ? '%c ' : ' ')
+           + '+' + exports.humanize(this.diff);
+
+         if (!useColors) return;
+
+         var c = 'color: ' + this.color;
+         args.splice(1, 0, c, 'color: inherit')
+
+         // the final "%c" is somewhat tricky, because there could be other
+         // arguments passed either before or after the %c, so we need to
+         // figure out the correct index to insert the CSS into
+         var index = 0;
+         var lastC = 0;
+         args[0].replace(/%[a-zA-Z%]/g, function(match) {
+           if ('%%' === match) return;
+           index++;
+           if ('%c' === match) {
+             // we only are interested in the *last* %c
+             // (the user may have provided their own)
+             lastC = index;
+           }
+         });
+
+         args.splice(lastC, 0, c);
+       }
+
+       /**
+        * Invokes `console.log()` when available.
+        * No-op when `console.log` is not a "function".
+        *
+        * @api public
+        */
+
+       function log() {
+         // this hackery is required for IE8/9, where
+         // the `console.log` function doesn't have 'apply'
+         return 'object' === typeof console
+           && console.log
+           && Function.prototype.apply.call(console.log, console, arguments);
+       }
+
+       /**
+        * Save `namespaces`.
+        *
+        * @param {String} namespaces
+        * @api private
+        */
+
+       function save(namespaces) {
+         try {
+           if (null == namespaces) {
+             exports.storage.removeItem('debug');
+           } else {
+             exports.storage.debug = namespaces;
+           }
+         } catch(e) {}
+       }
+
+       /**
+        * Load `namespaces`.
+        *
+        * @return {String} returns the previously persisted debug modes
+        * @api private
+        */
+
+       function load() {
+         var r;
+         try {
+           r = exports.storage.debug;
+         } catch(e) {}
+
+         // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
+         if (!r && typeof process !== 'undefined' && 'env' in process) {
+           r = process.env.DEBUG;
+         }
+
+         return r;
+       }
+
+       /**
+        * Enable namespaces listed in `localStorage.debug` initially.
+        */
+
+       exports.enable(load());
+
+       /**
+        * Localstorage attempts to return the localstorage.
+        *
+        * This is necessary because safari throws
+        * when a user disables cookies/localstorage
+        * and you attempt to access it.
+        *
+        * @return {LocalStorage}
+        * @api private
+        */
+
+       function localstorage() {
+         try {
+           return window.localStorage;
+         } catch (e) {}
+       }
+
+       /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(24)))
+
+/***/ },
+/* 24 */
+/***/ function(module, exports) {
+
+       // shim for using process in browser
+       var process = module.exports = {};
+
+       // cached from whatever global is present so that test runners that stub it
+       // don't break things.  But we need to wrap it in a try catch in case it is
+       // wrapped in strict mode code which doesn't define any globals.  It's inside a
+       // function because try/catches deoptimize in certain engines.
+
+       var cachedSetTimeout;
+       var cachedClearTimeout;
+
+       function defaultSetTimout() {
+           throw new Error('setTimeout has not been defined');
+       }
+       function defaultClearTimeout () {
+           throw new Error('clearTimeout has not been defined');
+       }
+       (function () {
+           try {
+               if (typeof setTimeout === 'function') {
+                   cachedSetTimeout = setTimeout;
+               } else {
+                   cachedSetTimeout = defaultSetTimout;
+               }
+           } catch (e) {
+               cachedSetTimeout = defaultSetTimout;
+           }
+           try {
+               if (typeof clearTimeout === 'function') {
+                   cachedClearTimeout = clearTimeout;
+               } else {
+                   cachedClearTimeout = defaultClearTimeout;
+               }
+           } catch (e) {
+               cachedClearTimeout = defaultClearTimeout;
+           }
+       } ())
+       function runTimeout(fun) {
+           if (cachedSetTimeout === setTimeout) {
+               //normal enviroments in sane situations
+               return setTimeout(fun, 0);
+           }
+           // if setTimeout wasn't available but was latter defined
+           if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
+               cachedSetTimeout = setTimeout;
+               return setTimeout(fun, 0);
+           }
+           try {
+               // when when somebody has screwed with setTimeout but no I.E. maddness
+               return cachedSetTimeout(fun, 0);
+           } catch(e){
+               try {
+                   // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
+                   return cachedSetTimeout.call(null, fun, 0);
+               } catch(e){
+                   // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
+                   return cachedSetTimeout.call(this, fun, 0);
+               }
+           }
+
+
+       }
+       function runClearTimeout(marker) {
+           if (cachedClearTimeout === clearTimeout) {
+               //normal enviroments in sane situations
+               return clearTimeout(marker);
+           }
+           // if clearTimeout wasn't available but was latter defined
+           if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
+               cachedClearTimeout = clearTimeout;
+               return clearTimeout(marker);
+           }
+           try {
+               // when when somebody has screwed with setTimeout but no I.E. maddness
+               return cachedClearTimeout(marker);
+           } catch (e){
+               try {
+                   // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally
+                   return cachedClearTimeout.call(null, marker);
+               } catch (e){
+                   // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
+                   // Some versions of I.E. have different rules for clearTimeout vs setTimeout
+                   return cachedClearTimeout.call(this, marker);
+               }
+           }
+
+
+
+       }
+       var queue = [];
+       var draining = false;
+       var currentQueue;
+       var queueIndex = -1;
+
+       function cleanUpNextTick() {
+           if (!draining || !currentQueue) {
+               return;
+           }
+           draining = false;
+           if (currentQueue.length) {
+               queue = currentQueue.concat(queue);
+           } else {
+               queueIndex = -1;
+           }
+           if (queue.length) {
+               drainQueue();
+           }
+       }
+
+       function drainQueue() {
+           if (draining) {
+               return;
+           }
+           var timeout = runTimeout(cleanUpNextTick);
+           draining = true;
+
+           var len = queue.length;
+           while(len) {
+               currentQueue = queue;
+               queue = [];
+               while (++queueIndex < len) {
+                   if (currentQueue) {
+                       currentQueue[queueIndex].run();
+                   }
+               }
+               queueIndex = -1;
+               len = queue.length;
+           }
+           currentQueue = null;
+           draining = false;
+           runClearTimeout(timeout);
+       }
+
+       process.nextTick = function (fun) {
+           var args = new Array(arguments.length - 1);
+           if (arguments.length > 1) {
+               for (var i = 1; i < arguments.length; i++) {
+                   args[i - 1] = arguments[i];
+               }
+           }
+           queue.push(new Item(fun, args));
+           if (queue.length === 1 && !draining) {
+               runTimeout(drainQueue);
+           }
+       };
+
+       // v8 likes predictible objects
+       function Item(fun, array) {
+           this.fun = fun;
+           this.array = array;
+       }
+       Item.prototype.run = function () {
+           this.fun.apply(null, this.array);
+       };
+       process.title = 'browser';
+       process.browser = true;
+       process.env = {};
+       process.argv = [];
+       process.version = ''; // empty string to avoid regexp issues
+       process.versions = {};
+
+       function noop() {}
+
+       process.on = noop;
+       process.addListener = noop;
+       process.once = noop;
+       process.off = noop;
+       process.removeListener = noop;
+       process.removeAllListeners = noop;
+       process.emit = noop;
+       process.prependListener = noop;
+       process.prependOnceListener = noop;
+
+       process.listeners = function (name) { return [] }
+
+       process.binding = function (name) {
+           throw new Error('process.binding is not supported');
+       };
+
+       process.cwd = function () { return '/' };
+       process.chdir = function (dir) {
+           throw new Error('process.chdir is not supported');
+       };
+       process.umask = function() { return 0; };
+
+
+/***/ },
+/* 25 */
+/***/ function(module, exports, __webpack_require__) {
+
+       
+       /**
+        * This is the common logic for both the Node.js and web browser
+        * implementations of `debug()`.
+        *
+        * Expose `debug()` as the module.
+        */
+
+       exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
+       exports.coerce = coerce;
+       exports.disable = disable;
+       exports.enable = enable;
+       exports.enabled = enabled;
+       exports.humanize = __webpack_require__(26);
+
+       /**
+        * The currently active debug mode names, and names to skip.
+        */
+
+       exports.names = [];
+       exports.skips = [];
+
+       /**
+        * Map of special "%n" handling functions, for the debug "format" argument.
+        *
+        * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
+        */
+
+       exports.formatters = {};
+
+       /**
+        * Previous log timestamp.
+        */
+
+       var prevTime;
+
+       /**
+        * Select a color.
+        * @param {String} namespace
+        * @return {Number}
+        * @api private
+        */
+
+       function selectColor(namespace) {
+         var hash = 0, i;
+
+         for (i in namespace) {
+           hash  = ((hash << 5) - hash) + namespace.charCodeAt(i);
+           hash |= 0; // Convert to 32bit integer
+         }
+
+         return exports.colors[Math.abs(hash) % exports.colors.length];
+       }
+
+       /**
+        * Create a debugger with the given `namespace`.
+        *
+        * @param {String} namespace
+        * @return {Function}
+        * @api public
+        */
+
+       function createDebug(namespace) {
+
+         function debug() {
+           // disabled?
+           if (!debug.enabled) return;
+
+           var self = debug;
+
+           // set `diff` timestamp
+           var curr = +new Date();
+           var ms = curr - (prevTime || curr);
+           self.diff = ms;
+           self.prev = prevTime;
+           self.curr = curr;
+           prevTime = curr;
+
+           // turn the `arguments` into a proper Array
+           var args = new Array(arguments.length);
+           for (var i = 0; i < args.length; i++) {
+             args[i] = arguments[i];
+           }
+
+           args[0] = exports.coerce(args[0]);
+
+           if ('string' !== typeof args[0]) {
+             // anything else let's inspect with %O
+             args.unshift('%O');
+           }
+
+           // apply any `formatters` transformations
+           var index = 0;
+           args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
+             // if we encounter an escaped % then don't increase the array index
+             if (match === '%%') return match;
+             index++;
+             var formatter = exports.formatters[format];
+             if ('function' === typeof formatter) {
+               var val = args[index];
+               match = formatter.call(self, val);
+
+               // now we need to remove `args[index]` since it's inlined in the `format`
+               args.splice(index, 1);
+               index--;
+             }
+             return match;
+           });
+
+           // apply env-specific formatting (colors, etc.)
+           exports.formatArgs.call(self, args);
+
+           var logFn = debug.log || exports.log || console.log.bind(console);
+           logFn.apply(self, args);
+         }
+
+         debug.namespace = namespace;
+         debug.enabled = exports.enabled(namespace);
+         debug.useColors = exports.useColors();
+         debug.color = selectColor(namespace);
+
+         // env-specific initialization logic for debug instances
+         if ('function' === typeof exports.init) {
+           exports.init(debug);
+         }
+
+         return debug;
+       }
+
+       /**
+        * Enables a debug mode by namespaces. This can include modes
+        * separated by a colon and wildcards.
+        *
+        * @param {String} namespaces
+        * @api public
+        */
+
+       function enable(namespaces) {
+         exports.save(namespaces);
+
+         exports.names = [];
+         exports.skips = [];
+
+         var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
+         var len = split.length;
+
+         for (var i = 0; i < len; i++) {
+           if (!split[i]) continue; // ignore empty strings
+           namespaces = split[i].replace(/\*/g, '.*?');
+           if (namespaces[0] === '-') {
+             exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
+           } else {
+             exports.names.push(new RegExp('^' + namespaces + '$'));
+           }
+         }
+       }
+
+       /**
+        * Disable debug output.
+        *
+        * @api public
+        */
+
+       function disable() {
+         exports.enable('');
+       }
+
+       /**
+        * Returns true if the given mode name is enabled, false otherwise.
+        *
+        * @param {String} name
+        * @return {Boolean}
+        * @api public
+        */
+
+       function enabled(name) {
+         var i, len;
+         for (i = 0, len = exports.skips.length; i < len; i++) {
+           if (exports.skips[i].test(name)) {
+             return false;
+           }
+         }
+         for (i = 0, len = exports.names.length; i < len; i++) {
+           if (exports.names[i].test(name)) {
+             return true;
+           }
+         }
+         return false;
+       }
+
+       /**
+        * Coerce `val`.
+        *
+        * @param {Mixed} val
+        * @return {Mixed}
+        * @api private
+        */
+
+       function coerce(val) {
+         if (val instanceof Error) return val.stack || val.message;
+         return val;
+       }
+
+
+/***/ },
+/* 26 */
+/***/ function(module, exports) {
+
+       /**
+        * Helpers.
+        */
+
+       var s = 1000;
+       var m = s * 60;
+       var h = m * 60;
+       var d = h * 24;
+       var y = d * 365.25;
+
+       /**
+        * Parse or format the given `val`.
+        *
+        * Options:
+        *
+        *  - `long` verbose formatting [false]
+        *
+        * @param {String|Number} val
+        * @param {Object} [options]
+        * @throws {Error} throw an error if val is not a non-empty string or a number
+        * @return {String|Number}
+        * @api public
+        */
+
+       module.exports = function(val, options) {
+         options = options || {};
+         var type = typeof val;
+         if (type === 'string' && val.length > 0) {
+           return parse(val);
+         } else if (type === 'number' && isNaN(val) === false) {
+           return options.long ? fmtLong(val) : fmtShort(val);
+         }
+         throw new Error(
+           'val is not a non-empty string or a valid number. val=' +
+             JSON.stringify(val)
+         );
+       };
+
+       /**
+        * Parse the given `str` and return milliseconds.
+        *
+        * @param {String} str
+        * @return {Number}
+        * @api private
+        */
+
+       function parse(str) {
+         str = String(str);
+         if (str.length > 100) {
+           return;
+         }
+         var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
+           str
+         );
+         if (!match) {
+           return;
+         }
+         var n = parseFloat(match[1]);
+         var type = (match[2] || 'ms').toLowerCase();
+         switch (type) {
+           case 'years':
+           case 'year':
+           case 'yrs':
+           case 'yr':
+           case 'y':
+             return n * y;
+           case 'days':
+           case 'day':
+           case 'd':
+             return n * d;
+           case 'hours':
+           case 'hour':
+           case 'hrs':
+           case 'hr':
+           case 'h':
+             return n * h;
+           case 'minutes':
+           case 'minute':
+           case 'mins':
+           case 'min':
+           case 'm':
+             return n * m;
+           case 'seconds':
+           case 'second':
+           case 'secs':
+           case 'sec':
+           case 's':
+             return n * s;
+           case 'milliseconds':
+           case 'millisecond':
+           case 'msecs':
+           case 'msec':
+           case 'ms':
+             return n;
+           default:
+             return undefined;
+         }
+       }
+
+       /**
+        * Short format for `ms`.
+        *
+        * @param {Number} ms
+        * @return {String}
+        * @api private
+        */
+
+       function fmtShort(ms) {
+         if (ms >= d) {
+           return Math.round(ms / d) + 'd';
+         }
+         if (ms >= h) {
+           return Math.round(ms / h) + 'h';
+         }
+         if (ms >= m) {
+           return Math.round(ms / m) + 'm';
+         }
+         if (ms >= s) {
+           return Math.round(ms / s) + 's';
+         }
+         return ms + 'ms';
+       }
+
+       /**
+        * Long format for `ms`.
+        *
+        * @param {Number} ms
+        * @return {String}
+        * @api private
+        */
+
+       function fmtLong(ms) {
+         return plural(ms, d, 'day') ||
+           plural(ms, h, 'hour') ||
+           plural(ms, m, 'minute') ||
+           plural(ms, s, 'second') ||
+           ms + ' ms';
+       }
+
+       /**
+        * Pluralization helper.
+        */
+
+       function plural(ms, n, name) {
+         if (ms < n) {
+           return;
+         }
+         if (ms < n * 1.5) {
+           return Math.floor(ms / n) + ' ' + name;
+         }
+         return Math.ceil(ms / n) + ' ' + name + 's';
+       }
+
+
+/***/ },
+/* 27 */
+/***/ function(module, exports, __webpack_require__) {
+
+       /* WEBPACK VAR INJECTION */(function(global) {'use strict';
+
+       /**
+        * Module requirements.
+        */
+
+       var Polling = __webpack_require__(7);
+       var inherit = __webpack_require__(21);
+
+       /**
+        * Module exports.
+        */
+
+       module.exports = JSONPPolling;
+
+       /**
+        * Cached regular expressions.
+        */
+
+       var rNewline = /\n/g;
+       var rEscapedNewline = /\\n/g;
+
+       /**
+        * Global JSONP callbacks.
+        */
+
+       var callbacks;
+
+       /**
+        * Noop.
+        */
+
+       function empty() {}
+
+       /**
+        * JSONP Polling constructor.
+        *
+        * @param {Object} opts.
+        * @api public
+        */
+
+       function JSONPPolling(opts) {
+         Polling.call(this, opts);
+
+         this.query = this.query || {};
+
+         // define global callbacks array if not present
+         // we do this here (lazily) to avoid unneeded global pollution
+         if (!callbacks) {
+           // we need to consider multiple engines in the same page
+           if (!global.___eio) global.___eio = [];
+           callbacks = global.___eio;
+         }
+
+         // callback identifier
+         this.index = callbacks.length;
+
+         // add callback to jsonp global
+         var self = this;
+         callbacks.push(function (msg) {
+           self.onData(msg);
+         });
+
+         // append to query string
+         this.query.j = this.index;
+
+         // prevent spurious errors from being emitted when the window is unloaded
+         if (global.document && global.addEventListener) {
+           global.addEventListener('beforeunload', function () {
+             if (self.script) self.script.onerror = empty;
+           }, false);
+         }
+       }
+
+       /**
+        * Inherits from Polling.
+        */
+
+       inherit(JSONPPolling, Polling);
+
+       /*
+        * JSONP only supports binary as base64 encoded strings
+        */
+
+       JSONPPolling.prototype.supportsBinary = false;
+
+       /**
+        * Closes the socket.
+        *
+        * @api private
+        */
+
+       JSONPPolling.prototype.doClose = function () {
+         if (this.script) {
+           this.script.parentNode.removeChild(this.script);
+           this.script = null;
+         }
+
+         if (this.form) {
+           this.form.parentNode.removeChild(this.form);
+           this.form = null;
+           this.iframe = null;
+         }
+
+         Polling.prototype.doClose.call(this);
+       };
+
+       /**
+        * Starts a poll cycle.
+        *
+        * @api private
+        */
+
+       JSONPPolling.prototype.doPoll = function () {
+         var self = this;
+         var script = document.createElement('script');
+
+         if (this.script) {
+           this.script.parentNode.removeChild(this.script);
+           this.script = null;
+         }
+
+         script.async = true;
+         script.src = this.uri();
+         script.onerror = function (e) {
+           self.onError('jsonp poll error', e);
+         };
+
+         var insertAt = document.getElementsByTagName('script')[0];
+         if (insertAt) {
+           insertAt.parentNode.insertBefore(script, insertAt);
+         } else {
+           (document.head || document.body).appendChild(script);
+         }
+         this.script = script;
+
+         var isUAgecko = 'undefined' !== typeof navigator && /gecko/i.test(navigator.userAgent);
+
+         if (isUAgecko) {
+           setTimeout(function () {
+             var iframe = document.createElement('iframe');
+             document.body.appendChild(iframe);
+             document.body.removeChild(iframe);
+           }, 100);
+         }
+       };
+
+       /**
+        * Writes with a hidden iframe.
+        *
+        * @param {String} data to send
+        * @param {Function} called upon flush.
+        * @api private
+        */
+
+       JSONPPolling.prototype.doWrite = function (data, fn) {
+         var self = this;
+
+         if (!this.form) {
+           var form = document.createElement('form');
+           var area = document.createElement('textarea');
+           var id = this.iframeId = 'eio_iframe_' + this.index;
+           var iframe;
+
+           form.className = 'socketio';
+           form.style.position = 'absolute';
+           form.style.top = '-1000px';
+           form.style.left = '-1000px';
+           form.target = id;
+           form.method = 'POST';
+           form.setAttribute('accept-charset', 'utf-8');
+           area.name = 'd';
+           form.appendChild(area);
+           document.body.appendChild(form);
+
+           this.form = form;
+           this.area = area;
+         }
+
+         this.form.action = this.uri();
+
+         function complete() {
+           initIframe();
+           fn();
+         }
+
+         function initIframe() {
+           if (self.iframe) {
+             try {
+               self.form.removeChild(self.iframe);
+             } catch (e) {
+               self.onError('jsonp polling iframe removal error', e);
+             }
+           }
+
+           try {
+             // ie6 dynamic iframes with target="" support (thanks Chris Lambacher)
+             var html = '<iframe src="javascript:0" name="' + self.iframeId + '">';
+             iframe = document.createElement(html);
+           } catch (e) {
+             iframe = document.createElement('iframe');
+             iframe.name = self.iframeId;
+             iframe.src = 'javascript:0';
+           }
+
+           iframe.id = self.iframeId;
+
+           self.form.appendChild(iframe);
+           self.iframe = iframe;
+         }
+
+         initIframe();
+
+         // escape \n to prevent it from being converted into \r\n by some UAs
+         // double escaping is required for escaped new lines because unescaping of new lines can be done safely on server-side
+         data = data.replace(rEscapedNewline, '\\\n');
+         this.area.value = data.replace(rNewline, '\\n');
+
+         try {
+           this.form.submit();
+         } catch (e) {}
+
+         if (this.iframe.attachEvent) {
+           this.iframe.onreadystatechange = function () {
+             if (self.iframe.readyState === 'complete') {
+               complete();
+             }
+           };
+         } else {
+           this.iframe.onload = complete;
+         }
+       };
+       /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
+
+/***/ },
+/* 28 */
+/***/ function(module, exports, __webpack_require__) {
+
+       /* WEBPACK VAR INJECTION */(function(global) {'use strict';
+
+       /**
+        * Module dependencies.
+        */
+
+       var Transport = __webpack_require__(8);
+       var parser = __webpack_require__(9);
+       var parseqs = __webpack_require__(20);
+       var inherit = __webpack_require__(21);
+       var yeast = __webpack_require__(22);
+       var debug = __webpack_require__(23)('engine.io-client:websocket');
+       var BrowserWebSocket = global.WebSocket || global.MozWebSocket;
+       var NodeWebSocket;
+       if (typeof window === 'undefined') {
+         try {
+           NodeWebSocket = __webpack_require__(29);
+         } catch (e) {}
+       }
+
+       /**
+        * Get either the `WebSocket` or `MozWebSocket` globals
+        * in the browser or try to resolve WebSocket-compatible
+        * interface exposed by `ws` for Node-like environment.
+        */
+
+       var WebSocket = BrowserWebSocket;
+       if (!WebSocket && typeof window === 'undefined') {
+         WebSocket = NodeWebSocket;
+       }
+
+       /**
+        * Module exports.
+        */
+
+       module.exports = WS;
+
+       /**
+        * WebSocket transport constructor.
+        *
+        * @api {Object} connection options
+        * @api public
+        */
+
+       function WS(opts) {
+         var forceBase64 = opts && opts.forceBase64;
+         if (forceBase64) {
+           this.supportsBinary = false;
+         }
+         this.perMessageDeflate = opts.perMessageDeflate;
+         this.usingBrowserWebSocket = BrowserWebSocket && !opts.forceNode;
+         this.protocols = opts.protocols;
+         if (!this.usingBrowserWebSocket) {
+           WebSocket = NodeWebSocket;
+         }
+         Transport.call(this, opts);
+       }
+
+       /**
+        * Inherits from Transport.
+        */
+
+       inherit(WS, Transport);
+
+       /**
+        * Transport name.
+        *
+        * @api public
+        */
+
+       WS.prototype.name = 'websocket';
+
+       /*
+        * WebSockets support binary
+        */
+
+       WS.prototype.supportsBinary = true;
+
+       /**
+        * Opens socket.
+        *
+        * @api private
+        */
+
+       WS.prototype.doOpen = function () {
+         if (!this.check()) {
+           // let probe timeout
+           return;
+         }
+
+         var uri = this.uri();
+         var protocols = this.protocols;
+         var opts = {
+           agent: this.agent,
+           perMessageDeflate: this.perMessageDeflate
+         };
+
+         // SSL options for Node.js client
+         opts.pfx = this.pfx;
+         opts.key = this.key;
+         opts.passphrase = this.passphrase;
+         opts.cert = this.cert;
+         opts.ca = this.ca;
+         opts.ciphers = this.ciphers;
+         opts.rejectUnauthorized = this.rejectUnauthorized;
+         if (this.extraHeaders) {
+           opts.headers = this.extraHeaders;
+         }
+         if (this.localAddress) {
+           opts.localAddress = this.localAddress;
+         }
+
+         try {
+           this.ws = this.usingBrowserWebSocket ? protocols ? new WebSocket(uri, protocols) : new WebSocket(uri) : new WebSocket(uri, protocols, opts);
+         } catch (err) {
+           return this.emit('error', err);
+         }
+
+         if (this.ws.binaryType === undefined) {
+           this.supportsBinary = false;
+         }
+
+         if (this.ws.supports && this.ws.supports.binary) {
+           this.supportsBinary = true;
+           this.ws.binaryType = 'nodebuffer';
+         } else {
+           this.ws.binaryType = 'arraybuffer';
+         }
+
+         this.addEventListeners();
+       };
+
+       /**
+        * Adds event listeners to the socket
+        *
+        * @api private
+        */
+
+       WS.prototype.addEventListeners = function () {
+         var self = this;
+
+         this.ws.onopen = function () {
+           self.onOpen();
+         };
+         this.ws.onclose = function () {
+           self.onClose();
+         };
+         this.ws.onmessage = function (ev) {
+           self.onData(ev.data);
+         };
+         this.ws.onerror = function (e) {
+           self.onError('websocket error', e);
+         };
+       };
+
+       /**
+        * Writes data to socket.
+        *
+        * @param {Array} array of packets.
+        * @api private
+        */
+
+       WS.prototype.write = function (packets) {
+         var self = this;
+         this.writable = false;
+
+         // encodePacket efficient as it uses WS framing
+         // no need for encodePayload
+         var total = packets.length;
+         for (var i = 0, l = total; i < l; i++) {
+           (function (packet) {
+             parser.encodePacket(packet, self.supportsBinary, function (data) {
+               if (!self.usingBrowserWebSocket) {
+                 // always create a new object (GH-437)
+                 var opts = {};
+                 if (packet.options) {
+                   opts.compress = packet.options.compress;
+                 }
+
+                 if (self.perMessageDeflate) {
+                   var len = 'string' === typeof data ? global.Buffer.byteLength(data) : data.length;
+                   if (len < self.perMessageDeflate.threshold) {
+                     opts.compress = false;
+                   }
+                 }
+               }
+
+               // Sometimes the websocket has already been closed but the browser didn't
+               // have a chance of informing us about it yet, in that case send will
+               // throw an error
+               try {
+                 if (self.usingBrowserWebSocket) {
+                   // TypeError is thrown when passing the second argument on Safari
+                   self.ws.send(data);
+                 } else {
+                   self.ws.send(data, opts);
+                 }
+               } catch (e) {
+                 debug('websocket closed before onclose event');
+               }
+
+               --total || done();
+             });
+           })(packets[i]);
+         }
+
+         function done() {
+           self.emit('flush');
+
+           // fake drain
+           // defer to next tick to allow Socket to clear writeBuffer
+           setTimeout(function () {
+             self.writable = true;
+             self.emit('drain');
+           }, 0);
+         }
+       };
+
+       /**
+        * Called upon close
+        *
+        * @api private
+        */
+
+       WS.prototype.onClose = function () {
+         Transport.prototype.onClose.call(this);
+       };
+
+       /**
+        * Closes socket.
+        *
+        * @api private
+        */
+
+       WS.prototype.doClose = function () {
+         if (typeof this.ws !== 'undefined') {
+           this.ws.close();
+         }
+       };
+
+       /**
+        * Generates uri for connection.
+        *
+        * @api private
+        */
+
+       WS.prototype.uri = function () {
+         var query = this.query || {};
+         var schema = this.secure ? 'wss' : 'ws';
+         var port = '';
+
+         // avoid port if default for schema
+         if (this.port && ('wss' === schema && Number(this.port) !== 443 || 'ws' === schema && Number(this.port) !== 80)) {
+           port = ':' + this.port;
+         }
+
+         // append timestamp to URI
+         if (this.timestampRequests) {
+           query[this.timestampParam] = yeast();
+         }
+
+         // communicate binary support capabilities
+         if (!this.supportsBinary) {
+           query.b64 = 1;
+         }
+
+         query = parseqs.encode(query);
+
+         // prepend ? to query
+         if (query.length) {
+           query = '?' + query;
+         }
+
+         var ipv6 = this.hostname.indexOf(':') !== -1;
+         return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;
+       };
+
+       /**
+        * Feature detection for WebSocket.
+        *
+        * @return {Boolean} whether this transport is available.
+        * @api public
+        */
+
+       WS.prototype.check = function () {
+         return !!WebSocket && !('__initialize' in WebSocket && this.name === WS.prototype.name);
+       };
+       /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
+
+/***/ },
+/* 29 */
+/***/ function(module, exports) {
+
+       /* (ignored) */
+
+/***/ },
+/* 30 */
+/***/ function(module, exports) {
+
+       
+       var indexOf = [].indexOf;
+
+       module.exports = function(arr, obj){
+         if (indexOf) return arr.indexOf(obj);
+         for (var i = 0; i < arr.length; ++i) {
+           if (arr[i] === obj) return i;
+         }
+         return -1;
+       };
+
+/***/ },
+/* 31 */
+/***/ function(module, exports) {
+
+       /**\r
+        * Parses an URI\r
+        *\r
+        * @author Steven Levithan <stevenlevithan.com> (MIT license)\r
+        * @api private\r
+        */\r
+\r
+       var re = /^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/;\r
+\r
+       var parts = [\r
+           'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'\r
+       ];\r
+\r
+       module.exports = function parseuri(str) {\r
+           var src = str,\r
+               b = str.indexOf('['),\r
+               e = str.indexOf(']');\r
+\r
+           if (b != -1 && e != -1) {\r
+               str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length);\r
+           }\r
+\r
+           var m = re.exec(str || ''),\r
+               uri = {},\r
+               i = 14;\r
+\r
+           while (i--) {\r
+               uri[parts[i]] = m[i] || '';\r
+           }\r
+\r
+           if (b != -1 && e != -1) {\r
+               uri.source = src;\r
+               uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':');\r
+               uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':');\r
+               uri.ipv6uri = true;\r
+           }\r
+\r
+           return uri;\r
+       };\r
+
+
+/***/ },
+/* 32 */
+/***/ function(module, exports) {
+
+       /* WEBPACK VAR INJECTION */(function(global) {/**\r
+        * JSON parse.\r
+        *\r
+        * @see Based on jQuery#parseJSON (MIT) and JSON2\r
+        * @api private\r
+        */\r
+\r
+       var rvalidchars = /^[\],:{}\s]*$/;\r
+       var rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g;\r
+       var rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g;\r
+       var rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g;\r
+       var rtrimLeft = /^\s+/;\r
+       var rtrimRight = /\s+$/;\r
+\r
+       module.exports = function parsejson(data) {\r
+         if ('string' != typeof data || !data) {\r
+           return null;\r
+         }\r
+\r
+         data = data.replace(rtrimLeft, '').replace(rtrimRight, '');\r
+\r
+         // Attempt to parse using the native JSON parser first\r
+         if (global.JSON && JSON.parse) {\r
+           return JSON.parse(data);\r
+         }\r
+\r
+         if (rvalidchars.test(data.replace(rvalidescape, '@')\r
+             .replace(rvalidtokens, ']')\r
+             .replace(rvalidbraces, ''))) {\r
+           return (new Function('return ' + data))();\r
+         }\r
+       };
+       /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
+
+/***/ }
+/******/ ])
+});
+;
\ No newline at end of file
diff --git a/wrt/node_modules/engine.io-client/index.js b/wrt/node_modules/engine.io-client/index.js
new file mode 100644 (file)
index 0000000..4c9d01c
--- /dev/null
@@ -0,0 +1,2 @@
+
+module.exports = require('./lib/index');
diff --git a/wrt/node_modules/engine.io-client/lib/index.js b/wrt/node_modules/engine.io-client/lib/index.js
new file mode 100644 (file)
index 0000000..0bf4058
--- /dev/null
@@ -0,0 +1,10 @@
+
+module.exports = require('./socket');
+
+/**
+ * Exports parser
+ *
+ * @api public
+ *
+ */
+module.exports.parser = require('engine.io-parser');
diff --git a/wrt/node_modules/engine.io-client/lib/socket.js b/wrt/node_modules/engine.io-client/lib/socket.js
new file mode 100644 (file)
index 0000000..04d3279
--- /dev/null
@@ -0,0 +1,744 @@
+/**
+ * Module dependencies.
+ */
+
+var transports = require('./transports/index');
+var Emitter = require('component-emitter');
+var debug = require('debug')('engine.io-client:socket');
+var index = require('indexof');
+var parser = require('engine.io-parser');
+var parseuri = require('parseuri');
+var parsejson = require('parsejson');
+var parseqs = require('parseqs');
+
+/**
+ * Module exports.
+ */
+
+module.exports = Socket;
+
+/**
+ * Socket constructor.
+ *
+ * @param {String|Object} uri or options
+ * @param {Object} options
+ * @api public
+ */
+
+function Socket (uri, opts) {
+  if (!(this instanceof Socket)) return new Socket(uri, opts);
+
+  opts = opts || {};
+
+  if (uri && 'object' === typeof uri) {
+    opts = uri;
+    uri = null;
+  }
+
+  if (uri) {
+    uri = parseuri(uri);
+    opts.hostname = uri.host;
+    opts.secure = uri.protocol === 'https' || uri.protocol === 'wss';
+    opts.port = uri.port;
+    if (uri.query) opts.query = uri.query;
+  } else if (opts.host) {
+    opts.hostname = parseuri(opts.host).host;
+  }
+
+  this.secure = null != opts.secure ? opts.secure
+    : (global.location && 'https:' === location.protocol);
+
+  if (opts.hostname && !opts.port) {
+    // if no port is specified manually, use the protocol default
+    opts.port = this.secure ? '443' : '80';
+  }
+
+  this.agent = opts.agent || false;
+  this.hostname = opts.hostname ||
+    (global.location ? location.hostname : 'localhost');
+  this.port = opts.port || (global.location && location.port
+      ? location.port
+      : (this.secure ? 443 : 80));
+  this.query = opts.query || {};
+  if ('string' === typeof this.query) this.query = parseqs.decode(this.query);
+  this.upgrade = false !== opts.upgrade;
+  this.path = (opts.path || '/engine.io').replace(/\/$/, '') + '/';
+  this.forceJSONP = !!opts.forceJSONP;
+  this.jsonp = false !== opts.jsonp;
+  this.forceBase64 = !!opts.forceBase64;
+  this.enablesXDR = !!opts.enablesXDR;
+  this.timestampParam = opts.timestampParam || 't';
+  this.timestampRequests = opts.timestampRequests;
+  this.transports = opts.transports || ['polling', 'websocket'];
+  this.transportOptions = opts.transportOptions || {};
+  this.readyState = '';
+  this.writeBuffer = [];
+  this.prevBufferLen = 0;
+  this.policyPort = opts.policyPort || 843;
+  this.rememberUpgrade = opts.rememberUpgrade || false;
+  this.binaryType = null;
+  this.onlyBinaryUpgrades = opts.onlyBinaryUpgrades;
+  this.perMessageDeflate = false !== opts.perMessageDeflate ? (opts.perMessageDeflate || {}) : false;
+
+  if (true === this.perMessageDeflate) this.perMessageDeflate = {};
+  if (this.perMessageDeflate && null == this.perMessageDeflate.threshold) {
+    this.perMessageDeflate.threshold = 1024;
+  }
+
+  // SSL options for Node.js client
+  this.pfx = opts.pfx || null;
+  this.key = opts.key || null;
+  this.passphrase = opts.passphrase || null;
+  this.cert = opts.cert || null;
+  this.ca = opts.ca || null;
+  this.ciphers = opts.ciphers || null;
+  this.rejectUnauthorized = opts.rejectUnauthorized === undefined ? true : opts.rejectUnauthorized;
+  this.forceNode = !!opts.forceNode;
+
+  // other options for Node.js client
+  var freeGlobal = typeof global === 'object' && global;
+  if (freeGlobal.global === freeGlobal) {
+    if (opts.extraHeaders && Object.keys(opts.extraHeaders).length > 0) {
+      this.extraHeaders = opts.extraHeaders;
+    }
+
+    if (opts.localAddress) {
+      this.localAddress = opts.localAddress;
+    }
+  }
+
+  // set on handshake
+  this.id = null;
+  this.upgrades = null;
+  this.pingInterval = null;
+  this.pingTimeout = null;
+
+  // set on heartbeat
+  this.pingIntervalTimer = null;
+  this.pingTimeoutTimer = null;
+
+  this.open();
+}
+
+Socket.priorWebsocketSuccess = false;
+
+/**
+ * Mix in `Emitter`.
+ */
+
+Emitter(Socket.prototype);
+
+/**
+ * Protocol version.
+ *
+ * @api public
+ */
+
+Socket.protocol = parser.protocol; // this is an int
+
+/**
+ * Expose deps for legacy compatibility
+ * and standalone browser access.
+ */
+
+Socket.Socket = Socket;
+Socket.Transport = require('./transport');
+Socket.transports = require('./transports/index');
+Socket.parser = require('engine.io-parser');
+
+/**
+ * Creates transport of the given type.
+ *
+ * @param {String} transport name
+ * @return {Transport}
+ * @api private
+ */
+
+Socket.prototype.createTransport = function (name) {
+  debug('creating transport "%s"', name);
+  var query = clone(this.query);
+
+  // append engine.io protocol identifier
+  query.EIO = parser.protocol;
+
+  // transport name
+  query.transport = name;
+
+  // per-transport options
+  var options = this.transportOptions[name] || {};
+
+  // session id if we already have one
+  if (this.id) query.sid = this.id;
+
+  var transport = new transports[name]({
+    query: query,
+    socket: this,
+    agent: options.agent || this.agent,
+    hostname: options.hostname || this.hostname,
+    port: options.port || this.port,
+    secure: options.secure || this.secure,
+    path: options.path || this.path,
+    forceJSONP: options.forceJSONP || this.forceJSONP,
+    jsonp: options.jsonp || this.jsonp,
+    forceBase64: options.forceBase64 || this.forceBase64,
+    enablesXDR: options.enablesXDR || this.enablesXDR,
+    timestampRequests: options.timestampRequests || this.timestampRequests,
+    timestampParam: options.timestampParam || this.timestampParam,
+    policyPort: options.policyPort || this.policyPort,
+    pfx: options.pfx || this.pfx,
+    key: options.key || this.key,
+    passphrase: options.passphrase || this.passphrase,
+    cert: options.cert || this.cert,
+    ca: options.ca || this.ca,
+    ciphers: options.ciphers || this.ciphers,
+    rejectUnauthorized: options.rejectUnauthorized || this.rejectUnauthorized,
+    perMessageDeflate: options.perMessageDeflate || this.perMessageDeflate,
+    extraHeaders: options.extraHeaders || this.extraHeaders,
+    forceNode: options.forceNode || this.forceNode,
+    localAddress: options.localAddress || this.localAddress,
+    requestTimeout: options.requestTimeout || this.requestTimeout,
+    protocols: options.protocols || void (0)
+  });
+
+  return transport;
+};
+
+function clone (obj) {
+  var o = {};
+  for (var i in obj) {
+    if (obj.hasOwnProperty(i)) {
+      o[i] = obj[i];
+    }
+  }
+  return o;
+}
+
+/**
+ * Initializes transport to use and starts probe.
+ *
+ * @api private
+ */
+Socket.prototype.open = function () {
+  var transport;
+  if (this.rememberUpgrade && Socket.priorWebsocketSuccess && this.transports.indexOf('websocket') !== -1) {
+    transport = 'websocket';
+  } else if (0 === this.transports.length) {
+    // Emit error on next tick so it can be listened to
+    var self = this;
+    setTimeout(function () {
+      self.emit('error', 'No transports available');
+    }, 0);
+    return;
+  } else {
+    transport = this.transports[0];
+  }
+  this.readyState = 'opening';
+
+  // Retry with the next transport if the transport is disabled (jsonp: false)
+  try {
+    transport = this.createTransport(transport);
+  } catch (e) {
+    this.transports.shift();
+    this.open();
+    return;
+  }
+
+  transport.open();
+  this.setTransport(transport);
+};
+
+/**
+ * Sets the current transport. Disables the existing one (if any).
+ *
+ * @api private
+ */
+
+Socket.prototype.setTransport = function (transport) {
+  debug('setting transport %s', transport.name);
+  var self = this;
+
+  if (this.transport) {
+    debug('clearing existing transport %s', this.transport.name);
+    this.transport.removeAllListeners();
+  }
+
+  // set up transport
+  this.transport = transport;
+
+  // set up transport listeners
+  transport
+  .on('drain', function () {
+    self.onDrain();
+  })
+  .on('packet', function (packet) {
+    self.onPacket(packet);
+  })
+  .on('error', function (e) {
+    self.onError(e);
+  })
+  .on('close', function () {
+    self.onClose('transport close');
+  });
+};
+
+/**
+ * Probes a transport.
+ *
+ * @param {String} transport name
+ * @api private
+ */
+
+Socket.prototype.probe = function (name) {
+  debug('probing transport "%s"', name);
+  var transport = this.createTransport(name, { probe: 1 });
+  var failed = false;
+  var self = this;
+
+  Socket.priorWebsocketSuccess = false;
+
+  function onTransportOpen () {
+    if (self.onlyBinaryUpgrades) {
+      var upgradeLosesBinary = !this.supportsBinary && self.transport.supportsBinary;
+      failed = failed || upgradeLosesBinary;
+    }
+    if (failed) return;
+
+    debug('probe transport "%s" opened', name);
+    transport.send([{ type: 'ping', data: 'probe' }]);
+    transport.once('packet', function (msg) {
+      if (failed) return;
+      if ('pong' === msg.type && 'probe' === msg.data) {
+        debug('probe transport "%s" pong', name);
+        self.upgrading = true;
+        self.emit('upgrading', transport);
+        if (!transport) return;
+        Socket.priorWebsocketSuccess = 'websocket' === transport.name;
+
+        debug('pausing current transport "%s"', self.transport.name);
+        self.transport.pause(function () {
+          if (failed) return;
+          if ('closed' === self.readyState) return;
+          debug('changing transport and sending upgrade packet');
+
+          cleanup();
+
+          self.setTransport(transport);
+          transport.send([{ type: 'upgrade' }]);
+          self.emit('upgrade', transport);
+          transport = null;
+          self.upgrading = false;
+          self.flush();
+        });
+      } else {
+        debug('probe transport "%s" failed', name);
+        var err = new Error('probe error');
+        err.transport = transport.name;
+        self.emit('upgradeError', err);
+      }
+    });
+  }
+
+  function freezeTransport () {
+    if (failed) return;
+
+    // Any callback called by transport should be ignored since now
+    failed = true;
+
+    cleanup();
+
+    transport.close();
+    transport = null;
+  }
+
+  // Handle any error that happens while probing
+  function onerror (err) {
+    var error = new Error('probe error: ' + err);
+    error.transport = transport.name;
+
+    freezeTransport();
+
+    debug('probe transport "%s" failed because of error: %s', name, err);
+
+    self.emit('upgradeError', error);
+  }
+
+  function onTransportClose () {
+    onerror('transport closed');
+  }
+
+  // When the socket is closed while we're probing
+  function onclose () {
+    onerror('socket closed');
+  }
+
+  // When the socket is upgraded while we're probing
+  function onupgrade (to) {
+    if (transport && to.name !== transport.name) {
+      debug('"%s" works - aborting "%s"', to.name, transport.name);
+      freezeTransport();
+    }
+  }
+
+  // Remove all listeners on the transport and on self
+  function cleanup () {
+    transport.removeListener('open', onTransportOpen);
+    transport.removeListener('error', onerror);
+    transport.removeListener('close', onTransportClose);
+    self.removeListener('close', onclose);
+    self.removeListener('upgrading', onupgrade);
+  }
+
+  transport.once('open', onTransportOpen);
+  transport.once('error', onerror);
+  transport.once('close', onTransportClose);
+
+  this.once('close', onclose);
+  this.once('upgrading', onupgrade);
+
+  transport.open();
+};
+
+/**
+ * Called when connection is deemed open.
+ *
+ * @api public
+ */
+
+Socket.prototype.onOpen = function () {
+  debug('socket open');
+  this.readyState = 'open';
+  Socket.priorWebsocketSuccess = 'websocket' === this.transport.name;
+  this.emit('open');
+  this.flush();
+
+  // we check for `readyState` in case an `open`
+  // listener already closed the socket
+  if ('open' === this.readyState && this.upgrade && this.transport.pause) {
+    debug('starting upgrade probes');
+    for (var i = 0, l = this.upgrades.length; i < l; i++) {
+      this.probe(this.upgrades[i]);
+    }
+  }
+};
+
+/**
+ * Handles a packet.
+ *
+ * @api private
+ */
+
+Socket.prototype.onPacket = function (packet) {
+  if ('opening' === this.readyState || 'open' === this.readyState ||
+      'closing' === this.readyState) {
+    debug('socket receive: type "%s", data "%s"', packet.type, packet.data);
+
+    this.emit('packet', packet);
+
+    // Socket is live - any packet counts
+    this.emit('heartbeat');
+
+    switch (packet.type) {
+      case 'open':
+        this.onHandshake(parsejson(packet.data));
+        break;
+
+      case 'pong':
+        this.setPing();
+        this.emit('pong');
+        break;
+
+      case 'error':
+        var err = new Error('server error');
+        err.code = packet.data;
+        this.onError(err);
+        break;
+
+      case 'message':
+        this.emit('data', packet.data);
+        this.emit('message', packet.data);
+        break;
+    }
+  } else {
+    debug('packet received with socket readyState "%s"', this.readyState);
+  }
+};
+
+/**
+ * Called upon handshake completion.
+ *
+ * @param {Object} handshake obj
+ * @api private
+ */
+
+Socket.prototype.onHandshake = function (data) {
+  this.emit('handshake', data);
+  this.id = data.sid;
+  this.transport.query.sid = data.sid;
+  this.upgrades = this.filterUpgrades(data.upgrades);
+  this.pingInterval = data.pingInterval;
+  this.pingTimeout = data.pingTimeout;
+  this.onOpen();
+  // In case open handler closes socket
+  if ('closed' === this.readyState) return;
+  this.setPing();
+
+  // Prolong liveness of socket on heartbeat
+  this.removeListener('heartbeat', this.onHeartbeat);
+  this.on('heartbeat', this.onHeartbeat);
+};
+
+/**
+ * Resets ping timeout.
+ *
+ * @api private
+ */
+
+Socket.prototype.onHeartbeat = function (timeout) {
+  clearTimeout(this.pingTimeoutTimer);
+  var self = this;
+  self.pingTimeoutTimer = setTimeout(function () {
+    if ('closed' === self.readyState) return;
+    self.onClose('ping timeout');
+  }, timeout || (self.pingInterval + self.pingTimeout));
+};
+
+/**
+ * Pings server every `this.pingInterval` and expects response
+ * within `this.pingTimeout` or closes connection.
+ *
+ * @api private
+ */
+
+Socket.prototype.setPing = function () {
+  var self = this;
+  clearTimeout(self.pingIntervalTimer);
+  self.pingIntervalTimer = setTimeout(function () {
+    debug('writing ping packet - expecting pong within %sms', self.pingTimeout);
+    self.ping();
+    self.onHeartbeat(self.pingTimeout);
+  }, self.pingInterval);
+};
+
+/**
+* Sends a ping packet.
+*
+* @api private
+*/
+
+Socket.prototype.ping = function () {
+  var self = this;
+  this.sendPacket('ping', function () {
+    self.emit('ping');
+  });
+};
+
+/**
+ * Called on `drain` event
+ *
+ * @api private
+ */
+
+Socket.prototype.onDrain = function () {
+  this.writeBuffer.splice(0, this.prevBufferLen);
+
+  // setting prevBufferLen = 0 is very important
+  // for example, when upgrading, upgrade packet is sent over,
+  // and a nonzero prevBufferLen could cause problems on `drain`
+  this.prevBufferLen = 0;
+
+  if (0 === this.writeBuffer.length) {
+    this.emit('drain');
+  } else {
+    this.flush();
+  }
+};
+
+/**
+ * Flush write buffers.
+ *
+ * @api private
+ */
+
+Socket.prototype.flush = function () {
+  if ('closed' !== this.readyState && this.transport.writable &&
+    !this.upgrading && this.writeBuffer.length) {
+    debug('flushing %d packets in socket', this.writeBuffer.length);
+    this.transport.send(this.writeBuffer);
+    // keep track of current length of writeBuffer
+    // splice writeBuffer and callbackBuffer on `drain`
+    this.prevBufferLen = this.writeBuffer.length;
+    this.emit('flush');
+  }
+};
+
+/**
+ * Sends a message.
+ *
+ * @param {String} message.
+ * @param {Function} callback function.
+ * @param {Object} options.
+ * @return {Socket} for chaining.
+ * @api public
+ */
+
+Socket.prototype.write =
+Socket.prototype.send = function (msg, options, fn) {
+  this.sendPacket('message', msg, options, fn);
+  return this;
+};
+
+/**
+ * Sends a packet.
+ *
+ * @param {String} packet type.
+ * @param {String} data.
+ * @param {Object} options.
+ * @param {Function} callback function.
+ * @api private
+ */
+
+Socket.prototype.sendPacket = function (type, data, options, fn) {
+  if ('function' === typeof data) {
+    fn = data;
+    data = undefined;
+  }
+
+  if ('function' === typeof options) {
+    fn = options;
+    options = null;
+  }
+
+  if ('closing' === this.readyState || 'closed' === this.readyState) {
+    return;
+  }
+
+  options = options || {};
+  options.compress = false !== options.compress;
+
+  var packet = {
+    type: type,
+    data: data,
+    options: options
+  };
+  this.emit('packetCreate', packet);
+  this.writeBuffer.push(packet);
+  if (fn) this.once('flush', fn);
+  this.flush();
+};
+
+/**
+ * Closes the connection.
+ *
+ * @api private
+ */
+
+Socket.prototype.close = function () {
+  if ('opening' === this.readyState || 'open' === this.readyState) {
+    this.readyState = 'closing';
+
+    var self = this;
+
+    if (this.writeBuffer.length) {
+      this.once('drain', function () {
+        if (this.upgrading) {
+          waitForUpgrade();
+        } else {
+          close();
+        }
+      });
+    } else if (this.upgrading) {
+      waitForUpgrade();
+    } else {
+      close();
+    }
+  }
+
+  function close () {
+    self.onClose('forced close');
+    debug('socket closing - telling transport to close');
+    self.transport.close();
+  }
+
+  function cleanupAndClose () {
+    self.removeListener('upgrade', cleanupAndClose);
+    self.removeListener('upgradeError', cleanupAndClose);
+    close();
+  }
+
+  function waitForUpgrade () {
+    // wait for upgrade to finish since we can't send packets while pausing a transport
+    self.once('upgrade', cleanupAndClose);
+    self.once('upgradeError', cleanupAndClose);
+  }
+
+  return this;
+};
+
+/**
+ * Called upon transport error
+ *
+ * @api private
+ */
+
+Socket.prototype.onError = function (err) {
+  debug('socket error %j', err);
+  Socket.priorWebsocketSuccess = false;
+  this.emit('error', err);
+  this.onClose('transport error', err);
+};
+
+/**
+ * Called upon transport close.
+ *
+ * @api private
+ */
+
+Socket.prototype.onClose = function (reason, desc) {
+  if ('opening' === this.readyState || 'open' === this.readyState || 'closing' === this.readyState) {
+    debug('socket close with reason: "%s"', reason);
+    var self = this;
+
+    // clear timers
+    clearTimeout(this.pingIntervalTimer);
+    clearTimeout(this.pingTimeoutTimer);
+
+    // stop event from firing again for transport
+    this.transport.removeAllListeners('close');
+
+    // ensure transport won't stay open
+    this.transport.close();
+
+    // ignore further transport communication
+    this.transport.removeAllListeners();
+
+    // set ready state
+    this.readyState = 'closed';
+
+    // clear session id
+    this.id = null;
+
+    // emit close event
+    this.emit('close', reason, desc);
+
+    // clean buffers after, so users can still
+    // grab the buffers on `close` event
+    self.writeBuffer = [];
+    self.prevBufferLen = 0;
+  }
+};
+
+/**
+ * Filters upgrades, returning only those matching client transports.
+ *
+ * @param {Array} server upgrades
+ * @api private
+ *
+ */
+
+Socket.prototype.filterUpgrades = function (upgrades) {
+  var filteredUpgrades = [];
+  for (var i = 0, j = upgrades.length; i < j; i++) {
+    if (~index(this.transports, upgrades[i])) filteredUpgrades.push(upgrades[i]);
+  }
+  return filteredUpgrades;
+};
diff --git a/wrt/node_modules/engine.io-client/lib/transport.js b/wrt/node_modules/engine.io-client/lib/transport.js
new file mode 100644 (file)
index 0000000..f2a90a4
--- /dev/null
@@ -0,0 +1,157 @@
+/**
+ * Module dependencies.
+ */
+
+var parser = require('engine.io-parser');
+var Emitter = require('component-emitter');
+
+/**
+ * Module exports.
+ */
+
+module.exports = Transport;
+
+/**
+ * Transport abstract constructor.
+ *
+ * @param {Object} options.
+ * @api private
+ */
+
+function Transport (opts) {
+  this.path = opts.path;
+  this.hostname = opts.hostname;
+  this.port = opts.port;
+  this.secure = opts.secure;
+  this.query = opts.query;
+  this.timestampParam = opts.timestampParam;
+  this.timestampRequests = opts.timestampRequests;
+  this.readyState = '';
+  this.agent = opts.agent || false;
+  this.socket = opts.socket;
+  this.enablesXDR = opts.enablesXDR;
+
+  // SSL options for Node.js client
+  this.pfx = opts.pfx;
+  this.key = opts.key;
+  this.passphrase = opts.passphrase;
+  this.cert = opts.cert;
+  this.ca = opts.ca;
+  this.ciphers = opts.ciphers;
+  this.rejectUnauthorized = opts.rejectUnauthorized;
+  this.forceNode = opts.forceNode;
+
+  // other options for Node.js client
+  this.extraHeaders = opts.extraHeaders;
+  this.localAddress = opts.localAddress;
+}
+
+/**
+ * Mix in `Emitter`.
+ */
+
+Emitter(Transport.prototype);
+
+/**
+ * Emits an error.
+ *
+ * @param {String} str
+ * @return {Transport} for chaining
+ * @api public
+ */
+
+Transport.prototype.onError = function (msg, desc) {
+  var err = new Error(msg);
+  err.type = 'TransportError';
+  err.description = desc;
+  this.emit('error', err);
+  return this;
+};
+
+/**
+ * Opens the transport.
+ *
+ * @api public
+ */
+
+Transport.prototype.open = function () {
+  if ('closed' === this.readyState || '' === this.readyState) {
+    this.readyState = 'opening';
+    this.doOpen();
+  }
+
+  return this;
+};
+
+/**
+ * Closes the transport.
+ *
+ * @api private
+ */
+
+Transport.prototype.close = function () {
+  if ('opening' === this.readyState || 'open' === this.readyState) {
+    this.doClose();
+    this.onClose();
+  }
+
+  return this;
+};
+
+/**
+ * Sends multiple packets.
+ *
+ * @param {Array} packets
+ * @api private
+ */
+
+Transport.prototype.send = function (packets) {
+  if ('open' === this.readyState) {
+    this.write(packets);
+  } else {
+    throw new Error('Transport not open');
+  }
+};
+
+/**
+ * Called upon open
+ *
+ * @api private
+ */
+
+Transport.prototype.onOpen = function () {
+  this.readyState = 'open';
+  this.writable = true;
+  this.emit('open');
+};
+
+/**
+ * Called with data.
+ *
+ * @param {String} data
+ * @api private
+ */
+
+Transport.prototype.onData = function (data) {
+  var packet = parser.decodePacket(data, this.socket.binaryType);
+  this.onPacket(packet);
+};
+
+/**
+ * Called with a decoded packet.
+ */
+
+Transport.prototype.onPacket = function (packet) {
+  this.emit('packet', packet);
+};
+
+/**
+ * Called upon close.
+ *
+ * @api private
+ */
+
+Transport.prototype.onClose = function () {
+  this.readyState = 'closed';
+  this.emit('close');
+};
diff --git a/wrt/node_modules/engine.io-client/lib/transports/index.js b/wrt/node_modules/engine.io-client/lib/transports/index.js
new file mode 100755 (executable)
index 0000000..df68fb9
--- /dev/null
@@ -0,0 +1,53 @@
+/**
+ * Module dependencies
+ */
+
+var XMLHttpRequest = require('xmlhttprequest-ssl');
+var XHR = require('./polling-xhr');
+var JSONP = require('./polling-jsonp');
+var websocket = require('./websocket');
+
+/**
+ * Export transports.
+ */
+
+exports.polling = polling;
+exports.websocket = websocket;
+
+/**
+ * Polling transport polymorphic constructor.
+ * Decides on xhr vs jsonp based on feature detection.
+ *
+ * @api private
+ */
+
+function polling (opts) {
+  var xhr;
+  var xd = false;
+  var xs = false;
+  var jsonp = false !== opts.jsonp;
+
+  if (global.location) {
+    var isSSL = 'https:' === location.protocol;
+    var port = location.port;
+
+    // some user agents have empty `location.port`
+    if (!port) {
+      port = isSSL ? 443 : 80;
+    }
+
+    xd = opts.hostname !== location.hostname || port !== opts.port;
+    xs = opts.secure !== isSSL;
+  }
+
+  opts.xdomain = xd;
+  opts.xscheme = xs;
+  xhr = new XMLHttpRequest(opts);
+
+  if ('open' in xhr && !opts.forceJSONP) {
+    return new XHR(opts);
+  } else {
+    if (!jsonp) throw new Error('JSONP disabled');
+    return new JSONP(opts);
+  }
+}
diff --git a/wrt/node_modules/engine.io-client/lib/transports/polling-jsonp.js b/wrt/node_modules/engine.io-client/lib/transports/polling-jsonp.js
new file mode 100644 (file)
index 0000000..8ba4833
--- /dev/null
@@ -0,0 +1,231 @@
+
+/**
+ * Module requirements.
+ */
+
+var Polling = require('./polling');
+var inherit = require('component-inherit');
+
+/**
+ * Module exports.
+ */
+
+module.exports = JSONPPolling;
+
+/**
+ * Cached regular expressions.
+ */
+
+var rNewline = /\n/g;
+var rEscapedNewline = /\\n/g;
+
+/**
+ * Global JSONP callbacks.
+ */
+
+var callbacks;
+
+/**
+ * Noop.
+ */
+
+function empty () { }
+
+/**
+ * JSONP Polling constructor.
+ *
+ * @param {Object} opts.
+ * @api public
+ */
+
+function JSONPPolling (opts) {
+  Polling.call(this, opts);
+
+  this.query = this.query || {};
+
+  // define global callbacks array if not present
+  // we do this here (lazily) to avoid unneeded global pollution
+  if (!callbacks) {
+    // we need to consider multiple engines in the same page
+    if (!global.___eio) global.___eio = [];
+    callbacks = global.___eio;
+  }
+
+  // callback identifier
+  this.index = callbacks.length;
+
+  // add callback to jsonp global
+  var self = this;
+  callbacks.push(function (msg) {
+    self.onData(msg);
+  });
+
+  // append to query string
+  this.query.j = this.index;
+
+  // prevent spurious errors from being emitted when the window is unloaded
+  if (global.document && global.addEventListener) {
+    global.addEventListener('beforeunload', function () {
+      if (self.script) self.script.onerror = empty;
+    }, false);
+  }
+}
+
+/**
+ * Inherits from Polling.
+ */
+
+inherit(JSONPPolling, Polling);
+
+/*
+ * JSONP only supports binary as base64 encoded strings
+ */
+
+JSONPPolling.prototype.supportsBinary = false;
+
+/**
+ * Closes the socket.
+ *
+ * @api private
+ */
+
+JSONPPolling.prototype.doClose = function () {
+  if (this.script) {
+    this.script.parentNode.removeChild(this.script);
+    this.script = null;
+  }
+
+  if (this.form) {
+    this.form.parentNode.removeChild(this.form);
+    this.form = null;
+    this.iframe = null;
+  }
+
+  Polling.prototype.doClose.call(this);
+};
+
+/**
+ * Starts a poll cycle.
+ *
+ * @api private
+ */
+
+JSONPPolling.prototype.doPoll = function () {
+  var self = this;
+  var script = document.createElement('script');
+
+  if (this.script) {
+    this.script.parentNode.removeChild(this.script);
+    this.script = null;
+  }
+
+  script.async = true;
+  script.src = this.uri();
+  script.onerror = function (e) {
+    self.onError('jsonp poll error', e);
+  };
+
+  var insertAt = document.getElementsByTagName('script')[0];
+  if (insertAt) {
+    insertAt.parentNode.insertBefore(script, insertAt);
+  } else {
+    (document.head || document.body).appendChild(script);
+  }
+  this.script = script;
+
+  var isUAgecko = 'undefined' !== typeof navigator && /gecko/i.test(navigator.userAgent);
+
+  if (isUAgecko) {
+    setTimeout(function () {
+      var iframe = document.createElement('iframe');
+      document.body.appendChild(iframe);
+      document.body.removeChild(iframe);
+    }, 100);
+  }
+};
+
+/**
+ * Writes with a hidden iframe.
+ *
+ * @param {String} data to send
+ * @param {Function} called upon flush.
+ * @api private
+ */
+
+JSONPPolling.prototype.doWrite = function (data, fn) {
+  var self = this;
+
+  if (!this.form) {
+    var form = document.createElement('form');
+    var area = document.createElement('textarea');
+    var id = this.iframeId = 'eio_iframe_' + this.index;
+    var iframe;
+
+    form.className = 'socketio';
+    form.style.position = 'absolute';
+    form.style.top = '-1000px';
+    form.style.left = '-1000px';
+    form.target = id;
+    form.method = 'POST';
+    form.setAttribute('accept-charset', 'utf-8');
+    area.name = 'd';
+    form.appendChild(area);
+    document.body.appendChild(form);
+
+    this.form = form;
+    this.area = area;
+  }
+
+  this.form.action = this.uri();
+
+  function complete () {
+    initIframe();
+    fn();
+  }
+
+  function initIframe () {
+    if (self.iframe) {
+      try {
+        self.form.removeChild(self.iframe);
+      } catch (e) {
+        self.onError('jsonp polling iframe removal error', e);
+      }
+    }
+
+    try {
+      // ie6 dynamic iframes with target="" support (thanks Chris Lambacher)
+      var html = '<iframe src="javascript:0" name="' + self.iframeId + '">';
+      iframe = document.createElement(html);
+    } catch (e) {
+      iframe = document.createElement('iframe');
+      iframe.name = self.iframeId;
+      iframe.src = 'javascript:0';
+    }
+
+    iframe.id = self.iframeId;
+
+    self.form.appendChild(iframe);
+    self.iframe = iframe;
+  }
+
+  initIframe();
+
+  // escape \n to prevent it from being converted into \r\n by some UAs
+  // double escaping is required for escaped new lines because unescaping of new lines can be done safely on server-side
+  data = data.replace(rEscapedNewline, '\\\n');
+  this.area.value = data.replace(rNewline, '\\n');
+
+  try {
+    this.form.submit();
+  } catch (e) {}
+
+  if (this.iframe.attachEvent) {
+    this.iframe.onreadystatechange = function () {
+      if (self.iframe.readyState === 'complete') {
+        complete();
+      }
+    };
+  } else {
+    this.iframe.onload = complete;
+  }
+};
diff --git a/wrt/node_modules/engine.io-client/lib/transports/polling-xhr.js b/wrt/node_modules/engine.io-client/lib/transports/polling-xhr.js
new file mode 100755 (executable)
index 0000000..297bac5
--- /dev/null
@@ -0,0 +1,413 @@
+/**
+ * Module requirements.
+ */
+
+var XMLHttpRequest = require('xmlhttprequest-ssl');
+var Polling = require('./polling');
+var Emitter = require('component-emitter');
+var inherit = require('component-inherit');
+var debug = require('debug')('engine.io-client:polling-xhr');
+
+/**
+ * Module exports.
+ */
+
+module.exports = XHR;
+module.exports.Request = Request;
+
+/**
+ * Empty function
+ */
+
+function empty () {}
+
+/**
+ * XHR Polling constructor.
+ *
+ * @param {Object} opts
+ * @api public
+ */
+
+function XHR (opts) {
+  Polling.call(this, opts);
+  this.requestTimeout = opts.requestTimeout;
+  this.extraHeaders = opts.extraHeaders;
+
+  if (global.location) {
+    var isSSL = 'https:' === location.protocol;
+    var port = location.port;
+
+    // some user agents have empty `location.port`
+    if (!port) {
+      port = isSSL ? 443 : 80;
+    }
+
+    this.xd = opts.hostname !== global.location.hostname ||
+      port !== opts.port;
+    this.xs = opts.secure !== isSSL;
+  }
+}
+
+/**
+ * Inherits from Polling.
+ */
+
+inherit(XHR, Polling);
+
+/**
+ * XHR supports binary
+ */
+
+XHR.prototype.supportsBinary = true;
+
+/**
+ * Creates a request.
+ *
+ * @param {String} method
+ * @api private
+ */
+
+XHR.prototype.request = function (opts) {
+  opts = opts || {};
+  opts.uri = this.uri();
+  opts.xd = this.xd;
+  opts.xs = this.xs;
+  opts.agent = this.agent || false;
+  opts.supportsBinary = this.supportsBinary;
+  opts.enablesXDR = this.enablesXDR;
+
+  // SSL options for Node.js client
+  opts.pfx = this.pfx;
+  opts.key = this.key;
+  opts.passphrase = this.passphrase;
+  opts.cert = this.cert;
+  opts.ca = this.ca;
+  opts.ciphers = this.ciphers;
+  opts.rejectUnauthorized = this.rejectUnauthorized;
+  opts.requestTimeout = this.requestTimeout;
+
+  // other options for Node.js client
+  opts.extraHeaders = this.extraHeaders;
+
+  return new Request(opts);
+};
+
+/**
+ * Sends data.
+ *
+ * @param {String} data to send.
+ * @param {Function} called upon flush.
+ * @api private
+ */
+
+XHR.prototype.doWrite = function (data, fn) {
+  var isBinary = typeof data !== 'string' && data !== undefined;
+  var req = this.request({ method: 'POST', data: data, isBinary: isBinary });
+  var self = this;
+  req.on('success', fn);
+  req.on('error', function (err) {
+    self.onError('xhr post error', err);
+  });
+  this.sendXhr = req;
+};
+
+/**
+ * Starts a poll cycle.
+ *
+ * @api private
+ */
+
+XHR.prototype.doPoll = function () {
+  debug('xhr poll');
+  var req = this.request();
+  var self = this;
+  req.on('data', function (data) {
+    self.onData(data);
+  });
+  req.on('error', function (err) {
+    self.onError('xhr poll error', err);
+  });
+  this.pollXhr = req;
+};
+
+/**
+ * Request constructor
+ *
+ * @param {Object} options
+ * @api public
+ */
+
+function Request (opts) {
+  this.method = opts.method || 'GET';
+  this.uri = opts.uri;
+  this.xd = !!opts.xd;
+  this.xs = !!opts.xs;
+  this.async = false !== opts.async;
+  this.data = undefined !== opts.data ? opts.data : null;
+  this.agent = opts.agent;
+  this.isBinary = opts.isBinary;
+  this.supportsBinary = opts.supportsBinary;
+  this.enablesXDR = opts.enablesXDR;
+  this.requestTimeout = opts.requestTimeout;
+
+  // SSL options for Node.js client
+  this.pfx = opts.pfx;
+  this.key = opts.key;
+  this.passphrase = opts.passphrase;
+  this.cert = opts.cert;
+  this.ca = opts.ca;
+  this.ciphers = opts.ciphers;
+  this.rejectUnauthorized = opts.rejectUnauthorized;
+
+  // other options for Node.js client
+  this.extraHeaders = opts.extraHeaders;
+
+  this.create();
+}
+
+/**
+ * Mix in `Emitter`.
+ */
+
+Emitter(Request.prototype);
+
+/**
+ * Creates the XHR object and sends the request.
+ *
+ * @api private
+ */
+
+Request.prototype.create = function () {
+  var opts = { agent: this.agent, xdomain: this.xd, xscheme: this.xs, enablesXDR: this.enablesXDR };
+
+  // SSL options for Node.js client
+  opts.pfx = this.pfx;
+  opts.key = this.key;
+  opts.passphrase = this.passphrase;
+  opts.cert = this.cert;
+  opts.ca = this.ca;
+  opts.ciphers = this.ciphers;
+  opts.rejectUnauthorized = this.rejectUnauthorized;
+
+  var xhr = this.xhr = new XMLHttpRequest(opts);
+  var self = this;
+
+  try {
+    debug('xhr open %s: %s', this.method, this.uri);
+    xhr.open(this.method, this.uri, this.async);
+    try {
+      if (this.extraHeaders) {
+        xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);
+        for (var i in this.extraHeaders) {
+          if (this.extraHeaders.hasOwnProperty(i)) {
+            xhr.setRequestHeader(i, this.extraHeaders[i]);
+          }
+        }
+      }
+    } catch (e) {}
+
+    if ('POST' === this.method) {
+      try {
+        if (this.isBinary) {
+          xhr.setRequestHeader('Content-type', 'application/octet-stream');
+        } else {
+          xhr.setRequestHeader('Content-type', 'text/plain;charset=UTF-8');
+        }
+      } catch (e) {}
+    }
+
+    try {
+      xhr.setRequestHeader('Accept', '*/*');
+    } catch (e) {}
+
+    // ie6 check
+    if ('withCredentials' in xhr) {
+      xhr.withCredentials = true;
+    }
+
+    if (this.requestTimeout) {
+      xhr.timeout = this.requestTimeout;
+    }
+
+    if (this.hasXDR()) {
+      xhr.onload = function () {
+        self.onLoad();
+      };
+      xhr.onerror = function () {
+        self.onError(xhr.responseText);
+      };
+    } else {
+      xhr.onreadystatechange = function () {
+        if (xhr.readyState === 2) {
+          var contentType;
+          try {
+            contentType = xhr.getResponseHeader('Content-Type');
+          } catch (e) {}
+          if (contentType === 'application/octet-stream') {
+            xhr.responseType = 'arraybuffer';
+          }
+        }
+        if (4 !== xhr.readyState) return;
+        if (200 === xhr.status || 1223 === xhr.status) {
+          self.onLoad();
+        } else {
+          // make sure the `error` event handler that's user-set
+          // does not throw in the same tick and gets caught here
+          setTimeout(function () {
+            self.onError(xhr.status);
+          }, 0);
+        }
+      };
+    }
+
+    debug('xhr data %s', this.data);
+    xhr.send(this.data);
+  } catch (e) {
+    // Need to defer since .create() is called directly fhrom the constructor
+    // and thus the 'error' event can only be only bound *after* this exception
+    // occurs.  Therefore, also, we cannot throw here at all.
+    setTimeout(function () {
+      self.onError(e);
+    }, 0);
+    return;
+  }
+
+  if (global.document) {
+    this.index = Request.requestsCount++;
+    Request.requests[this.index] = this;
+  }
+};
+
+/**
+ * Called upon successful response.
+ *
+ * @api private
+ */
+
+Request.prototype.onSuccess = function () {
+  this.emit('success');
+  this.cleanup();
+};
+
+/**
+ * Called if we have data.
+ *
+ * @api private
+ */
+
+Request.prototype.onData = function (data) {
+  this.emit('data', data);
+  this.onSuccess();
+};
+
+/**
+ * Called upon error.
+ *
+ * @api private
+ */
+
+Request.prototype.onError = function (err) {
+  this.emit('error', err);
+  this.cleanup(true);
+};
+
+/**
+ * Cleans up house.
+ *
+ * @api private
+ */
+
+Request.prototype.cleanup = function (fromError) {
+  if ('undefined' === typeof this.xhr || null === this.xhr) {
+    return;
+  }
+  // xmlhttprequest
+  if (this.hasXDR()) {
+    this.xhr.onload = this.xhr.onerror = empty;
+  } else {
+    this.xhr.onreadystatechange = empty;
+  }
+
+  if (fromError) {
+    try {
+      this.xhr.abort();
+    } catch (e) {}
+  }
+
+  if (global.document) {
+    delete Request.requests[this.index];
+  }
+
+  this.xhr = null;
+};
+
+/**
+ * Called upon load.
+ *
+ * @api private
+ */
+
+Request.prototype.onLoad = function () {
+  var data;
+  try {
+    var contentType;
+    try {
+      contentType = this.xhr.getResponseHeader('Content-Type');
+    } catch (e) {}
+    if (contentType === 'application/octet-stream') {
+      data = this.xhr.response || this.xhr.responseText;
+    } else {
+      data = this.xhr.responseText;
+    }
+  } catch (e) {
+    this.onError(e);
+  }
+  if (null != data) {
+    this.onData(data);
+  }
+};
+
+/**
+ * Check if it has XDomainRequest.
+ *
+ * @api private
+ */
+
+Request.prototype.hasXDR = function () {
+  return 'undefined' !== typeof global.XDomainRequest && !this.xs && this.enablesXDR;
+};
+
+/**
+ * Aborts the request.
+ *
+ * @api public
+ */
+
+Request.prototype.abort = function () {
+  this.cleanup();
+};
+
+/**
+ * Aborts pending requests when unloading the window. This is needed to prevent
+ * memory leaks (e.g. when using IE) and to ensure that no spurious error is
+ * emitted.
+ */
+
+Request.requestsCount = 0;
+Request.requests = {};
+
+if (global.document) {
+  if (global.attachEvent) {
+    global.attachEvent('onunload', unloadHandler);
+  } else if (global.addEventListener) {
+    global.addEventListener('beforeunload', unloadHandler, false);
+  }
+}
+
+function unloadHandler () {
+  for (var i in Request.requests) {
+    if (Request.requests.hasOwnProperty(i)) {
+      Request.requests[i].abort();
+    }
+  }
+}
diff --git a/wrt/node_modules/engine.io-client/lib/transports/polling.js b/wrt/node_modules/engine.io-client/lib/transports/polling.js
new file mode 100644 (file)
index 0000000..970313e
--- /dev/null
@@ -0,0 +1,245 @@
+/**
+ * Module dependencies.
+ */
+
+var Transport = require('../transport');
+var parseqs = require('parseqs');
+var parser = require('engine.io-parser');
+var inherit = require('component-inherit');
+var yeast = require('yeast');
+var debug = require('debug')('engine.io-client:polling');
+
+/**
+ * Module exports.
+ */
+
+module.exports = Polling;
+
+/**
+ * Is XHR2 supported?
+ */
+
+var hasXHR2 = (function () {
+  var XMLHttpRequest = require('xmlhttprequest-ssl');
+  var xhr = new XMLHttpRequest({ xdomain: false });
+  return null != xhr.responseType;
+})();
+
+/**
+ * Polling interface.
+ *
+ * @param {Object} opts
+ * @api private
+ */
+
+function Polling (opts) {
+  var forceBase64 = (opts && opts.forceBase64);
+  if (!hasXHR2 || forceBase64) {
+    this.supportsBinary = false;
+  }
+  Transport.call(this, opts);
+}
+
+/**
+ * Inherits from Transport.
+ */
+
+inherit(Polling, Transport);
+
+/**
+ * Transport name.
+ */
+
+Polling.prototype.name = 'polling';
+
+/**
+ * Opens the socket (triggers polling). We write a PING message to determine
+ * when the transport is open.
+ *
+ * @api private
+ */
+
+Polling.prototype.doOpen = function () {
+  this.poll();
+};
+
+/**
+ * Pauses polling.
+ *
+ * @param {Function} callback upon buffers are flushed and transport is paused
+ * @api private
+ */
+
+Polling.prototype.pause = function (onPause) {
+  var self = this;
+
+  this.readyState = 'pausing';
+
+  function pause () {
+    debug('paused');
+    self.readyState = 'paused';
+    onPause();
+  }
+
+  if (this.polling || !this.writable) {
+    var total = 0;
+
+    if (this.polling) {
+      debug('we are currently polling - waiting to pause');
+      total++;
+      this.once('pollComplete', function () {
+        debug('pre-pause polling complete');
+        --total || pause();
+      });
+    }
+
+    if (!this.writable) {
+      debug('we are currently writing - waiting to pause');
+      total++;
+      this.once('drain', function () {
+        debug('pre-pause writing complete');
+        --total || pause();
+      });
+    }
+  } else {
+    pause();
+  }
+};
+
+/**
+ * Starts polling cycle.
+ *
+ * @api public
+ */
+
+Polling.prototype.poll = function () {
+  debug('polling');
+  this.polling = true;
+  this.doPoll();
+  this.emit('poll');
+};
+
+/**
+ * Overloads onData to detect payloads.
+ *
+ * @api private
+ */
+
+Polling.prototype.onData = function (data) {
+  var self = this;
+  debug('polling got data %s', data);
+  var callback = function (packet, index, total) {
+    // if its the first message we consider the transport open
+    if ('opening' === self.readyState) {
+      self.onOpen();
+    }
+
+    // if its a close packet, we close the ongoing requests
+    if ('close' === packet.type) {
+      self.onClose();
+      return false;
+    }
+
+    // otherwise bypass onData and handle the message
+    self.onPacket(packet);
+  };
+
+  // decode payload
+  parser.decodePayload(data, this.socket.binaryType, callback);
+
+  // if an event did not trigger closing
+  if ('closed' !== this.readyState) {
+    // if we got data we're not polling
+    this.polling = false;
+    this.emit('pollComplete');
+
+    if ('open' === this.readyState) {
+      this.poll();
+    } else {
+      debug('ignoring poll - transport state "%s"', this.readyState);
+    }
+  }
+};
+
+/**
+ * For polling, send a close packet.
+ *
+ * @api private
+ */
+
+Polling.prototype.doClose = function () {
+  var self = this;
+
+  function close () {
+    debug('writing close packet');
+    self.write([{ type: 'close' }]);
+  }
+
+  if ('open' === this.readyState) {
+    debug('transport open - closing');
+    close();
+  } else {
+    // in case we're trying to close while
+    // handshaking is in progress (GH-164)
+    debug('transport not open - deferring close');
+    this.once('open', close);
+  }
+};
+
+/**
+ * Writes a packets payload.
+ *
+ * @param {Array} data packets
+ * @param {Function} drain callback
+ * @api private
+ */
+
+Polling.prototype.write = function (packets) {
+  var self = this;
+  this.writable = false;
+  var callbackfn = function () {
+    self.writable = true;
+    self.emit('drain');
+  };
+
+  parser.encodePayload(packets, this.supportsBinary, function (data) {
+    self.doWrite(data, callbackfn);
+  });
+};
+
+/**
+ * Generates uri for connection.
+ *
+ * @api private
+ */
+
+Polling.prototype.uri = function () {
+  var query = this.query || {};
+  var schema = this.secure ? 'https' : 'http';
+  var port = '';
+
+  // cache busting is forced
+  if (false !== this.timestampRequests) {
+    query[this.timestampParam] = yeast();
+  }
+
+  if (!this.supportsBinary && !query.sid) {
+    query.b64 = 1;
+  }
+
+  query = parseqs.encode(query);
+
+  // avoid port if default for schema
+  if (this.port && (('https' === schema && Number(this.port) !== 443) ||
+     ('http' === schema && Number(this.port) !== 80))) {
+    port = ':' + this.port;
+  }
+
+  // prepend ? to query
+  if (query.length) {
+    query = '?' + query;
+  }
+
+  var ipv6 = this.hostname.indexOf(':') !== -1;
+  return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;
+};
diff --git a/wrt/node_modules/engine.io-client/lib/transports/websocket.js b/wrt/node_modules/engine.io-client/lib/transports/websocket.js
new file mode 100644 (file)
index 0000000..de14ba0
--- /dev/null
@@ -0,0 +1,286 @@
+/**
+ * Module dependencies.
+ */
+
+var Transport = require('../transport');
+var parser = require('engine.io-parser');
+var parseqs = require('parseqs');
+var inherit = require('component-inherit');
+var yeast = require('yeast');
+var debug = require('debug')('engine.io-client:websocket');
+var BrowserWebSocket = global.WebSocket || global.MozWebSocket;
+var NodeWebSocket;
+if (typeof window === 'undefined') {
+  try {
+    NodeWebSocket = require('ws');
+  } catch (e) { }
+}
+
+/**
+ * Get either the `WebSocket` or `MozWebSocket` globals
+ * in the browser or try to resolve WebSocket-compatible
+ * interface exposed by `ws` for Node-like environment.
+ */
+
+var WebSocket = BrowserWebSocket;
+if (!WebSocket && typeof window === 'undefined') {
+  WebSocket = NodeWebSocket;
+}
+
+/**
+ * Module exports.
+ */
+
+module.exports = WS;
+
+/**
+ * WebSocket transport constructor.
+ *
+ * @api {Object} connection options
+ * @api public
+ */
+
+function WS (opts) {
+  var forceBase64 = (opts && opts.forceBase64);
+  if (forceBase64) {
+    this.supportsBinary = false;
+  }
+  this.perMessageDeflate = opts.perMessageDeflate;
+  this.usingBrowserWebSocket = BrowserWebSocket && !opts.forceNode;
+  this.protocols = opts.protocols;
+  if (!this.usingBrowserWebSocket) {
+    WebSocket = NodeWebSocket;
+  }
+  Transport.call(this, opts);
+}
+
+/**
+ * Inherits from Transport.
+ */
+
+inherit(WS, Transport);
+
+/**
+ * Transport name.
+ *
+ * @api public
+ */
+
+WS.prototype.name = 'websocket';
+
+/*
+ * WebSockets support binary
+ */
+
+WS.prototype.supportsBinary = true;
+
+/**
+ * Opens socket.
+ *
+ * @api private
+ */
+
+WS.prototype.doOpen = function () {
+  if (!this.check()) {
+    // let probe timeout
+    return;
+  }
+
+  var uri = this.uri();
+  var protocols = this.protocols;
+  var opts = {
+    agent: this.agent,
+    perMessageDeflate: this.perMessageDeflate
+  };
+
+  // SSL options for Node.js client
+  opts.pfx = this.pfx;
+  opts.key = this.key;
+  opts.passphrase = this.passphrase;
+  opts.cert = this.cert;
+  opts.ca = this.ca;
+  opts.ciphers = this.ciphers;
+  opts.rejectUnauthorized = this.rejectUnauthorized;
+  if (this.extraHeaders) {
+    opts.headers = this.extraHeaders;
+  }
+  if (this.localAddress) {
+    opts.localAddress = this.localAddress;
+  }
+
+  try {
+    this.ws = this.usingBrowserWebSocket ? (protocols ? new WebSocket(uri, protocols) : new WebSocket(uri)) : new WebSocket(uri, protocols, opts);
+  } catch (err) {
+    return this.emit('error', err);
+  }
+
+  if (this.ws.binaryType === undefined) {
+    this.supportsBinary = false;
+  }
+
+  if (this.ws.supports && this.ws.supports.binary) {
+    this.supportsBinary = true;
+    this.ws.binaryType = 'nodebuffer';
+  } else {
+    this.ws.binaryType = 'arraybuffer';
+  }
+
+  this.addEventListeners();
+};
+
+/**
+ * Adds event listeners to the socket
+ *
+ * @api private
+ */
+
+WS.prototype.addEventListeners = function () {
+  var self = this;
+
+  this.ws.onopen = function () {
+    self.onOpen();
+  };
+  this.ws.onclose = function () {
+    self.onClose();
+  };
+  this.ws.onmessage = function (ev) {
+    self.onData(ev.data);
+  };
+  this.ws.onerror = function (e) {
+    self.onError('websocket error', e);
+  };
+};
+
+/**
+ * Writes data to socket.
+ *
+ * @param {Array} array of packets.
+ * @api private
+ */
+
+WS.prototype.write = function (packets) {
+  var self = this;
+  this.writable = false;
+
+  // encodePacket efficient as it uses WS framing
+  // no need for encodePayload
+  var total = packets.length;
+  for (var i = 0, l = total; i < l; i++) {
+    (function (packet) {
+      parser.encodePacket(packet, self.supportsBinary, function (data) {
+        if (!self.usingBrowserWebSocket) {
+          // always create a new object (GH-437)
+          var opts = {};
+          if (packet.options) {
+            opts.compress = packet.options.compress;
+          }
+
+          if (self.perMessageDeflate) {
+            var len = 'string' === typeof data ? global.Buffer.byteLength(data) : data.length;
+            if (len < self.perMessageDeflate.threshold) {
+              opts.compress = false;
+            }
+          }
+        }
+
+        // Sometimes the websocket has already been closed but the browser didn't
+        // have a chance of informing us about it yet, in that case send will
+        // throw an error
+        try {
+          if (self.usingBrowserWebSocket) {
+            // TypeError is thrown when passing the second argument on Safari
+            self.ws.send(data);
+          } else {
+            self.ws.send(data, opts);
+          }
+        } catch (e) {
+          debug('websocket closed before onclose event');
+        }
+
+        --total || done();
+      });
+    })(packets[i]);
+  }
+
+  function done () {
+    self.emit('flush');
+
+    // fake drain
+    // defer to next tick to allow Socket to clear writeBuffer
+    setTimeout(function () {
+      self.writable = true;
+      self.emit('drain');
+    }, 0);
+  }
+};
+
+/**
+ * Called upon close
+ *
+ * @api private
+ */
+
+WS.prototype.onClose = function () {
+  Transport.prototype.onClose.call(this);
+};
+
+/**
+ * Closes socket.
+ *
+ * @api private
+ */
+
+WS.prototype.doClose = function () {
+  if (typeof this.ws !== 'undefined') {
+    this.ws.close();
+  }
+};
+
+/**
+ * Generates uri for connection.
+ *
+ * @api private
+ */
+
+WS.prototype.uri = function () {
+  var query = this.query || {};
+  var schema = this.secure ? 'wss' : 'ws';
+  var port = '';
+
+  // avoid port if default for schema
+  if (this.port && (('wss' === schema && Number(this.port) !== 443) ||
+    ('ws' === schema && Number(this.port) !== 80))) {
+    port = ':' + this.port;
+  }
+
+  // append timestamp to URI
+  if (this.timestampRequests) {
+    query[this.timestampParam] = yeast();
+  }
+
+  // communicate binary support capabilities
+  if (!this.supportsBinary) {
+    query.b64 = 1;
+  }
+
+  query = parseqs.encode(query);
+
+  // prepend ? to query
+  if (query.length) {
+    query = '?' + query;
+  }
+
+  var ipv6 = this.hostname.indexOf(':') !== -1;
+  return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;
+};
+
+/**
+ * Feature detection for WebSocket.
+ *
+ * @return {Boolean} whether this transport is available.
+ * @api public
+ */
+
+WS.prototype.check = function () {
+  return !!WebSocket && !('__initialize' in WebSocket && this.name === WS.prototype.name);
+};
diff --git a/wrt/node_modules/engine.io-client/lib/xmlhttprequest.js b/wrt/node_modules/engine.io-client/lib/xmlhttprequest.js
new file mode 100644 (file)
index 0000000..d76d9c7
--- /dev/null
@@ -0,0 +1,37 @@
+// browser shim for xmlhttprequest module
+
+var hasCORS = require('has-cors');
+
+module.exports = function (opts) {
+  var xdomain = opts.xdomain;
+
+  // scheme must be same when usign XDomainRequest
+  // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx
+  var xscheme = opts.xscheme;
+
+  // XDomainRequest has a flow of not sending cookie, therefore it should be disabled as a default.
+  // https://github.com/Automattic/engine.io-client/pull/217
+  var enablesXDR = opts.enablesXDR;
+
+  // XMLHttpRequest can be disabled on IE
+  try {
+    if ('undefined' !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {
+      return new XMLHttpRequest();
+    }
+  } catch (e) { }
+
+  // Use XDomainRequest for IE8 if enablesXDR is true
+  // because loading bar keeps flashing when using jsonp-polling
+  // https://github.com/yujiosaka/socke.io-ie8-loading-example
+  try {
+    if ('undefined' !== typeof XDomainRequest && !xscheme && enablesXDR) {
+      return new XDomainRequest();
+    }
+  } catch (e) { }
+
+  if (!xdomain) {
+    try {
+      return new global[['Active'].concat('Object').join('X')]('Microsoft.XMLHTTP');
+    } catch (e) { }
+  }
+};
diff --git a/wrt/node_modules/engine.io-client/node_modules/debug/.coveralls.yml b/wrt/node_modules/engine.io-client/node_modules/debug/.coveralls.yml
new file mode 100644 (file)
index 0000000..20a7068
--- /dev/null
@@ -0,0 +1 @@
+repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve
diff --git a/wrt/node_modules/engine.io-client/node_modules/debug/.eslintrc b/wrt/node_modules/engine.io-client/node_modules/debug/.eslintrc
new file mode 100644 (file)
index 0000000..8a37ae2
--- /dev/null
@@ -0,0 +1,11 @@
+{
+  "env": {
+    "browser": true,
+    "node": true
+  },
+  "rules": {
+    "no-console": 0,
+    "no-empty": [1, { "allowEmptyCatch": true }]
+  },
+  "extends": "eslint:recommended"
+}
diff --git a/wrt/node_modules/engine.io-client/node_modules/debug/.npmignore b/wrt/node_modules/engine.io-client/node_modules/debug/.npmignore
new file mode 100644 (file)
index 0000000..5f60eec
--- /dev/null
@@ -0,0 +1,9 @@
+support
+test
+examples
+example
+*.sock
+dist
+yarn.lock
+coverage
+bower.json
diff --git a/wrt/node_modules/engine.io-client/node_modules/debug/.travis.yml b/wrt/node_modules/engine.io-client/node_modules/debug/.travis.yml
new file mode 100644 (file)
index 0000000..6c6090c
--- /dev/null
@@ -0,0 +1,14 @@
+
+language: node_js
+node_js:
+  - "6"
+  - "5"
+  - "4"
+
+install:
+  - make node_modules
+
+script:
+  - make lint
+  - make test
+  - make coveralls
diff --git a/wrt/node_modules/engine.io-client/node_modules/debug/CHANGELOG.md b/wrt/node_modules/engine.io-client/node_modules/debug/CHANGELOG.md
new file mode 100644 (file)
index 0000000..eadaa18
--- /dev/null
@@ -0,0 +1,362 @@
+
+2.6.9 / 2017-09-22
+==================
+
+  * remove ReDoS regexp in %o formatter (#504)
+
+2.6.8 / 2017-05-18
+==================
+
+  * Fix: Check for undefined on browser globals (#462, @marbemac)
+
+2.6.7 / 2017-05-16
+==================
+
+  * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom)
+  * Fix: Inline extend function in node implementation (#452, @dougwilson)
+  * Docs: Fix typo (#455, @msasad)
+
+2.6.5 / 2017-04-27
+==================
+  
+  * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek)
+  * Misc: clean up browser reference checks (#447, @thebigredgeek)
+  * Misc: add npm-debug.log to .gitignore (@thebigredgeek)
+
+
+2.6.4 / 2017-04-20
+==================
+
+  * Fix: bug that would occure if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo)
+  * Chore: ignore bower.json in npm installations. (#437, @joaovieira)
+  * Misc: update "ms" to v0.7.3 (@tootallnate)
+
+2.6.3 / 2017-03-13
+==================
+
+  * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts)
+  * Docs: Changelog fix (@thebigredgeek)
+
+2.6.2 / 2017-03-10
+==================
+
+  * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin)
+  * Docs: Add backers and sponsors from Open Collective (#422, @piamancini)
+  * Docs: Add Slackin invite badge (@tootallnate)
+
+2.6.1 / 2017-02-10
+==================
+
+  * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error
+  * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0)
+  * Fix: IE8 "Expected identifier" error (#414, @vgoma)
+  * Fix: Namespaces would not disable once enabled (#409, @musikov)
+
+2.6.0 / 2016-12-28
+==================
+
+  * Fix: added better null pointer checks for browser useColors (@thebigredgeek)
+  * Improvement: removed explicit `window.debug` export (#404, @tootallnate)
+  * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate)
+
+2.5.2 / 2016-12-25
+==================
+
+  * Fix: reference error on window within webworkers (#393, @KlausTrainer)
+  * Docs: fixed README typo (#391, @lurch)
+  * Docs: added notice about v3 api discussion (@thebigredgeek)
+
+2.5.1 / 2016-12-20
+==================
+
+  * Fix: babel-core compatibility
+
+2.5.0 / 2016-12-20
+==================
+
+  * Fix: wrong reference in bower file (@thebigredgeek)
+  * Fix: webworker compatibility (@thebigredgeek)
+  * Fix: output formatting issue (#388, @kribblo)
+  * Fix: babel-loader compatibility (#383, @escwald)
+  * Misc: removed built asset from repo and publications (@thebigredgeek)
+  * Misc: moved source files to /src (#378, @yamikuronue)
+  * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue)
+  * Test: coveralls integration (#378, @yamikuronue)
+  * Docs: simplified language in the opening paragraph (#373, @yamikuronue)
+
+2.4.5 / 2016-12-17
+==================
+
+  * Fix: `navigator` undefined in Rhino (#376, @jochenberger)
+  * Fix: custom log function (#379, @hsiliev)
+  * Improvement: bit of cleanup + linting fixes (@thebigredgeek)
+  * Improvement: rm non-maintainted `dist/` dir (#375, @freewil)
+  * Docs: simplified language in the opening paragraph. (#373, @yamikuronue)
+
+2.4.4 / 2016-12-14
+==================
+
+  * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts)
+
+2.4.3 / 2016-12-14
+==================
+
+  * Fix: navigation.userAgent error for react native (#364, @escwald)
+
+2.4.2 / 2016-12-14
+==================
+
+  * Fix: browser colors (#367, @tootallnate)
+  * Misc: travis ci integration (@thebigredgeek)
+  * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek)
+
+2.4.1 / 2016-12-13
+==================
+
+  * Fix: typo that broke the package (#356)
+
+2.4.0 / 2016-12-13
+==================
+
+  * Fix: bower.json references unbuilt src entry point (#342, @justmatt)
+  * Fix: revert "handle regex special characters" (@tootallnate)
+  * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate)
+  * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate)
+  * Improvement: allow colors in workers (#335, @botverse)
+  * Improvement: use same color for same namespace. (#338, @lchenay)
+
+2.3.3 / 2016-11-09
+==================
+
+  * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne)
+  * Fix: Returning `localStorage` saved values (#331, Levi Thomason)
+  * Improvement: Don't create an empty object when no `process` (Nathan Rajlich)
+
+2.3.2 / 2016-11-09
+==================
+
+  * Fix: be super-safe in index.js as well (@TooTallNate)
+  * Fix: should check whether process exists (Tom Newby)
+
+2.3.1 / 2016-11-09
+==================
+
+  * Fix: Added electron compatibility (#324, @paulcbetts)
+  * Improvement: Added performance optimizations (@tootallnate)
+  * Readme: Corrected PowerShell environment variable example (#252, @gimre)
+  * Misc: Removed yarn lock file from source control (#321, @fengmk2)
+
+2.3.0 / 2016-11-07
+==================
+
+  * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic)
+  * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos)
+  * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15)
+  * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran)
+  * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom)
+  * Package: Update "ms" to 0.7.2 (#315, @DevSide)
+  * Package: removed superfluous version property from bower.json (#207 @kkirsche)
+  * Readme: fix USE_COLORS to DEBUG_COLORS
+  * Readme: Doc fixes for format string sugar (#269, @mlucool)
+  * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0)
+  * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable)
+  * Readme: better docs for browser support (#224, @matthewmueller)
+  * Tooling: Added yarn integration for development (#317, @thebigredgeek)
+  * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek)
+  * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman)
+  * Misc: Updated contributors (@thebigredgeek)
+
+2.2.0 / 2015-05-09
+==================
+
+  * package: update "ms" to v0.7.1 (#202, @dougwilson)
+  * README: add logging to file example (#193, @DanielOchoa)
+  * README: fixed a typo (#191, @amir-s)
+  * browser: expose `storage` (#190, @stephenmathieson)
+  * Makefile: add a `distclean` target (#189, @stephenmathieson)
+
+2.1.3 / 2015-03-13
+==================
+
+  * Updated stdout/stderr example (#186)
+  * Updated example/stdout.js to match debug current behaviour
+  * Renamed example/stderr.js to stdout.js
+  * Update Readme.md (#184)
+  * replace high intensity foreground color for bold (#182, #183)
+
+2.1.2 / 2015-03-01
+==================
+
+  * dist: recompile
+  * update "ms" to v0.7.0
+  * package: update "browserify" to v9.0.3
+  * component: fix "ms.js" repo location
+  * changed bower package name
+  * updated documentation about using debug in a browser
+  * fix: security error on safari (#167, #168, @yields)
+
+2.1.1 / 2014-12-29
+==================
+
+  * browser: use `typeof` to check for `console` existence
+  * browser: check for `console.log` truthiness (fix IE 8/9)
+  * browser: add support for Chrome apps
+  * Readme: added Windows usage remarks
+  * Add `bower.json` to properly support bower install
+
+2.1.0 / 2014-10-15
+==================
+
+  * node: implement `DEBUG_FD` env variable support
+  * package: update "browserify" to v6.1.0
+  * package: add "license" field to package.json (#135, @panuhorsmalahti)
+
+2.0.0 / 2014-09-01
+==================
+
+  * package: update "browserify" to v5.11.0
+  * node: use stderr rather than stdout for logging (#29, @stephenmathieson)
+
+1.0.4 / 2014-07-15
+==================
+
+  * dist: recompile
+  * example: remove `console.info()` log usage
+  * example: add "Content-Type" UTF-8 header to browser example
+  * browser: place %c marker after the space character
+  * browser: reset the "content" color via `color: inherit`
+  * browser: add colors support for Firefox >= v31
+  * debug: prefer an instance `log()` function over the global one (#119)
+  * Readme: update documentation about styled console logs for FF v31 (#116, @wryk)
+
+1.0.3 / 2014-07-09
+==================
+
+  * Add support for multiple wildcards in namespaces (#122, @seegno)
+  * browser: fix lint
+
+1.0.2 / 2014-06-10
+==================
+
+  * browser: update color palette (#113, @gscottolson)
+  * common: make console logging function configurable (#108, @timoxley)
+  * node: fix %o colors on old node <= 0.8.x
+  * Makefile: find node path using shell/which (#109, @timoxley)
+
+1.0.1 / 2014-06-06
+==================
+
+  * browser: use `removeItem()` to clear localStorage
+  * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777)
+  * package: add "contributors" section
+  * node: fix comment typo
+  * README: list authors
+
+1.0.0 / 2014-06-04
+==================
+
+  * make ms diff be global, not be scope
+  * debug: ignore empty strings in enable()
+  * node: make DEBUG_COLORS able to disable coloring
+  * *: export the `colors` array
+  * npmignore: don't publish the `dist` dir
+  * Makefile: refactor to use browserify
+  * package: add "browserify" as a dev dependency
+  * Readme: add Web Inspector Colors section
+  * node: reset terminal color for the debug content
+  * node: map "%o" to `util.inspect()`
+  * browser: map "%j" to `JSON.stringify()`
+  * debug: add custom "formatters"
+  * debug: use "ms" module for humanizing the diff
+  * Readme: add "bash" syntax highlighting
+  * browser: add Firebug color support
+  * browser: add colors for WebKit browsers
+  * node: apply log to `console`
+  * rewrite: abstract common logic for Node & browsers
+  * add .jshintrc file
+
+0.8.1 / 2014-04-14
+==================
+
+  * package: re-add the "component" section
+
+0.8.0 / 2014-03-30
+==================
+
+  * add `enable()` method for nodejs. Closes #27
+  * change from stderr to stdout
+  * remove unnecessary index.js file
+
+0.7.4 / 2013-11-13
+==================
+
+  * remove "browserify" key from package.json (fixes something in browserify)
+
+0.7.3 / 2013-10-30
+==================
+
+  * fix: catch localStorage security error when cookies are blocked (Chrome)
+  * add debug(err) support. Closes #46
+  * add .browser prop to package.json. Closes #42
+
+0.7.2 / 2013-02-06
+==================
+
+  * fix package.json
+  * fix: Mobile Safari (private mode) is broken with debug
+  * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript
+
+0.7.1 / 2013-02-05
+==================
+
+  * add repository URL to package.json
+  * add DEBUG_COLORED to force colored output
+  * add browserify support
+  * fix component. Closes #24
+
+0.7.0 / 2012-05-04
+==================
+
+  * Added .component to package.json
+  * Added debug.component.js build
+
+0.6.0 / 2012-03-16
+==================
+
+  * Added support for "-" prefix in DEBUG [Vinay Pulim]
+  * Added `.enabled` flag to the node version [TooTallNate]
+
+0.5.0 / 2012-02-02
+==================
+
+  * Added: humanize diffs. Closes #8
+  * Added `debug.disable()` to the CS variant
+  * Removed padding. Closes #10
+  * Fixed: persist client-side variant again. Closes #9
+
+0.4.0 / 2012-02-01
+==================
+
+  * Added browser variant support for older browsers [TooTallNate]
+  * Added `debug.enable('project:*')` to browser variant [TooTallNate]
+  * Added padding to diff (moved it to the right)
+
+0.3.0 / 2012-01-26
+==================
+
+  * Added millisecond diff when isatty, otherwise UTC string
+
+0.2.0 / 2012-01-22
+==================
+
+  * Added wildcard support
+
+0.1.0 / 2011-12-02
+==================
+
+  * Added: remove colors unless stderr isatty [TooTallNate]
+
+0.0.1 / 2010-01-03
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/engine.io-client/node_modules/debug/LICENSE b/wrt/node_modules/engine.io-client/node_modules/debug/LICENSE
new file mode 100644 (file)
index 0000000..658c933
--- /dev/null
@@ -0,0 +1,19 @@
+(The MIT License)
+
+Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software 
+and associated documentation files (the 'Software'), to deal in the Software without restriction, 
+including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial 
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 
+LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/wrt/node_modules/engine.io-client/node_modules/debug/Makefile b/wrt/node_modules/engine.io-client/node_modules/debug/Makefile
new file mode 100644 (file)
index 0000000..584da8b
--- /dev/null
@@ -0,0 +1,50 @@
+# get Makefile directory name: http://stackoverflow.com/a/5982798/376773
+THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
+THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)
+
+# BIN directory
+BIN := $(THIS_DIR)/node_modules/.bin
+
+# Path
+PATH := node_modules/.bin:$(PATH)
+SHELL := /bin/bash
+
+# applications
+NODE ?= $(shell which node)
+YARN ?= $(shell which yarn)
+PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm))
+BROWSERIFY ?= $(NODE) $(BIN)/browserify
+
+.FORCE:
+
+install: node_modules
+
+node_modules: package.json
+       @NODE_ENV= $(PKG) install
+       @touch node_modules
+
+lint: .FORCE
+       eslint browser.js debug.js index.js node.js
+
+test-node: .FORCE
+       istanbul cover node_modules/mocha/bin/_mocha -- test/**.js
+
+test-browser: .FORCE
+       mkdir -p dist
+
+       @$(BROWSERIFY) \
+               --standalone debug \
+               . > dist/debug.js
+
+       karma start --single-run
+       rimraf dist
+
+test: .FORCE
+       concurrently \
+               "make test-node" \
+               "make test-browser"
+
+coveralls:
+       cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
+
+.PHONY: all install clean distclean
diff --git a/wrt/node_modules/engine.io-client/node_modules/debug/README.md b/wrt/node_modules/engine.io-client/node_modules/debug/README.md
new file mode 100644 (file)
index 0000000..f67be6b
--- /dev/null
@@ -0,0 +1,312 @@
+# debug
+[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug)  [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master)  [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) 
+[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors)
+
+
+
+A tiny node.js debugging utility modelled after node core's debugging technique.
+
+**Discussion around the V3 API is under way [here](https://github.com/visionmedia/debug/issues/370)**
+
+## Installation
+
+```bash
+$ npm install debug
+```
+
+## Usage
+
+`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole.
+
+Example _app.js_:
+
+```js
+var debug = require('debug')('http')
+  , http = require('http')
+  , name = 'My App';
+
+// fake app
+
+debug('booting %s', name);
+
+http.createServer(function(req, res){
+  debug(req.method + ' ' + req.url);
+  res.end('hello\n');
+}).listen(3000, function(){
+  debug('listening');
+});
+
+// fake worker of some kind
+
+require('./worker');
+```
+
+Example _worker.js_:
+
+```js
+var debug = require('debug')('worker');
+
+setInterval(function(){
+  debug('doing some work');
+}, 1000);
+```
+
+ The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:
+
+  ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png)
+
+  ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png)
+
+#### Windows note
+
+ On Windows the environment variable is set using the `set` command.
+
+ ```cmd
+ set DEBUG=*,-not_this
+ ```
+
+ Note that PowerShell uses different syntax to set environment variables.
+
+ ```cmd
+ $env:DEBUG = "*,-not_this"
+  ```
+
+Then, run the program to be debugged as usual.
+
+## Millisecond diff
+
+  When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.
+
+  ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png)
+
+  When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:
+
+  ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png)
+
+## Conventions
+
+  If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser".
+
+## Wildcards
+
+  The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.
+
+  You can also exclude specific debuggers by prefixing them with a "-" character.  For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:".
+
+## Environment Variables
+
+  When running through Node.js, you can set a few environment variables that will
+  change the behavior of the debug logging:
+
+| Name      | Purpose                                         |
+|-----------|-------------------------------------------------|
+| `DEBUG`   | Enables/disables specific debugging namespaces. |
+| `DEBUG_COLORS`| Whether or not to use colors in the debug output. |
+| `DEBUG_DEPTH` | Object inspection depth. |
+| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. |
+
+
+  __Note:__ The environment variables beginning with `DEBUG_` end up being
+  converted into an Options object that gets used with `%o`/`%O` formatters.
+  See the Node.js documentation for
+  [`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options)
+  for the complete list.
+
+## Formatters
+
+
+  Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. Below are the officially supported formatters:
+
+| Formatter | Representation |
+|-----------|----------------|
+| `%O`      | Pretty-print an Object on multiple lines. |
+| `%o`      | Pretty-print an Object all on a single line. |
+| `%s`      | String. |
+| `%d`      | Number (both integer and float). |
+| `%j`      | JSON. Replaced with the string '[Circular]' if the argument contains circular references. |
+| `%%`      | Single percent sign ('%'). This does not consume an argument. |
+
+### Custom formatters
+
+  You can add custom formatters by extending the `debug.formatters` object. For example, if you wanted to add support for rendering a Buffer as hex with `%h`, you could do something like:
+
+```js
+const createDebug = require('debug')
+createDebug.formatters.h = (v) => {
+  return v.toString('hex')
+}
+
+// …elsewhere
+const debug = createDebug('foo')
+debug('this is hex: %h', new Buffer('hello world'))
+//   foo this is hex: 68656c6c6f20776f726c6421 +0ms
+```
+
+## Browser support
+  You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify),
+  or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest),
+  if you don't want to build it yourself.
+
+  Debug's enable state is currently persisted by `localStorage`.
+  Consider the situation shown below where you have `worker:a` and `worker:b`,
+  and wish to debug both. You can enable this using `localStorage.debug`:
+
+```js
+localStorage.debug = 'worker:*'
+```
+
+And then refresh the page.
+
+```js
+a = debug('worker:a');
+b = debug('worker:b');
+
+setInterval(function(){
+  a('doing some work');
+}, 1000);
+
+setInterval(function(){
+  b('doing some work');
+}, 1200);
+```
+
+#### Web Inspector Colors
+
+  Colors are also enabled on "Web Inspectors" that understand the `%c` formatting
+  option. These are WebKit web inspectors, Firefox ([since version
+  31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))
+  and the Firebug plugin for Firefox (any version).
+
+  Colored output looks something like:
+
+  ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png)
+
+
+## Output streams
+
+  By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method:
+
+Example _stdout.js_:
+
+```js
+var debug = require('debug');
+var error = debug('app:error');
+
+// by default stderr is used
+error('goes to stderr!');
+
+var log = debug('app:log');
+// set this namespace to log via console.log
+log.log = console.log.bind(console); // don't forget to bind to console!
+log('goes to stdout');
+error('still goes to stderr!');
+
+// set all output to go via console.info
+// overrides all per-namespace log settings
+debug.log = console.info.bind(console);
+error('now goes to stdout via console.info');
+log('still goes to stdout, but via console.info now');
+```
+
+
+## Authors
+
+ - TJ Holowaychuk
+ - Nathan Rajlich
+ - Andrew Rhyne
+## Backers
+
+Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)]
+
+<a href="https://opencollective.com/debug/backer/0/website" target="_blank"><img src="https://opencollective.com/debug/backer/0/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/1/website" target="_blank"><img src="https://opencollective.com/debug/backer/1/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/2/website" target="_blank"><img src="https://opencollective.com/debug/backer/2/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/3/website" target="_blank"><img src="https://opencollective.com/debug/backer/3/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/4/website" target="_blank"><img src="https://opencollective.com/debug/backer/4/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/5/website" target="_blank"><img src="https://opencollective.com/debug/backer/5/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/6/website" target="_blank"><img src="https://opencollective.com/debug/backer/6/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/7/website" target="_blank"><img src="https://opencollective.com/debug/backer/7/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/8/website" target="_blank"><img src="https://opencollective.com/debug/backer/8/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/9/website" target="_blank"><img src="https://opencollective.com/debug/backer/9/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/10/website" target="_blank"><img src="https://opencollective.com/debug/backer/10/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/11/website" target="_blank"><img src="https://opencollective.com/debug/backer/11/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/12/website" target="_blank"><img src="https://opencollective.com/debug/backer/12/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/13/website" target="_blank"><img src="https://opencollective.com/debug/backer/13/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/14/website" target="_blank"><img src="https://opencollective.com/debug/backer/14/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/15/website" target="_blank"><img src="https://opencollective.com/debug/backer/15/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/16/website" target="_blank"><img src="https://opencollective.com/debug/backer/16/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/17/website" target="_blank"><img src="https://opencollective.com/debug/backer/17/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/18/website" target="_blank"><img src="https://opencollective.com/debug/backer/18/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/19/website" target="_blank"><img src="https://opencollective.com/debug/backer/19/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/20/website" target="_blank"><img src="https://opencollective.com/debug/backer/20/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/21/website" target="_blank"><img src="https://opencollective.com/debug/backer/21/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/22/website" target="_blank"><img src="https://opencollective.com/debug/backer/22/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/23/website" target="_blank"><img src="https://opencollective.com/debug/backer/23/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/24/website" target="_blank"><img src="https://opencollective.com/debug/backer/24/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/25/website" target="_blank"><img src="https://opencollective.com/debug/backer/25/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/26/website" target="_blank"><img src="https://opencollective.com/debug/backer/26/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/27/website" target="_blank"><img src="https://opencollective.com/debug/backer/27/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/28/website" target="_blank"><img src="https://opencollective.com/debug/backer/28/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/29/website" target="_blank"><img src="https://opencollective.com/debug/backer/29/avatar.svg"></a>
+
+
+## Sponsors
+
+Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)]
+
+<a href="https://opencollective.com/debug/sponsor/0/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/0/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/1/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/1/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/2/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/2/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/3/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/3/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/4/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/4/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/5/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/5/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/6/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/6/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/7/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/7/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/8/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/8/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/9/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/9/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/10/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/10/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/11/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/11/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/12/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/12/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/13/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/13/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/14/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/14/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/15/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/15/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/16/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/16/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/17/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/17/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/18/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/18/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/19/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/19/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/20/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/20/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/21/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/21/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/22/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/22/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/23/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/23/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/24/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/24/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/25/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/25/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/26/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/26/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/27/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/27/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/28/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/28/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/29/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/29/avatar.svg"></a>
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2014-2016 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/engine.io-client/node_modules/debug/component.json b/wrt/node_modules/engine.io-client/node_modules/debug/component.json
new file mode 100644 (file)
index 0000000..9de2641
--- /dev/null
@@ -0,0 +1,19 @@
+{
+  "name": "debug",
+  "repo": "visionmedia/debug",
+  "description": "small debugging utility",
+  "version": "2.6.9",
+  "keywords": [
+    "debug",
+    "log",
+    "debugger"
+  ],
+  "main": "src/browser.js",
+  "scripts": [
+    "src/browser.js",
+    "src/debug.js"
+  ],
+  "dependencies": {
+    "rauchg/ms.js": "0.7.1"
+  }
+}
diff --git a/wrt/node_modules/engine.io-client/node_modules/debug/karma.conf.js b/wrt/node_modules/engine.io-client/node_modules/debug/karma.conf.js
new file mode 100644 (file)
index 0000000..103a82d
--- /dev/null
@@ -0,0 +1,70 @@
+// Karma configuration
+// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC)
+
+module.exports = function(config) {
+  config.set({
+
+    // base path that will be used to resolve all patterns (eg. files, exclude)
+    basePath: '',
+
+
+    // frameworks to use
+    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
+    frameworks: ['mocha', 'chai', 'sinon'],
+
+
+    // list of files / patterns to load in the browser
+    files: [
+      'dist/debug.js',
+      'test/*spec.js'
+    ],
+
+
+    // list of files to exclude
+    exclude: [
+      'src/node.js'
+    ],
+
+
+    // preprocess matching files before serving them to the browser
+    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
+    preprocessors: {
+    },
+
+    // test results reporter to use
+    // possible values: 'dots', 'progress'
+    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
+    reporters: ['progress'],
+
+
+    // web server port
+    port: 9876,
+
+
+    // enable / disable colors in the output (reporters and logs)
+    colors: true,
+
+
+    // level of logging
+    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
+    logLevel: config.LOG_INFO,
+
+
+    // enable / disable watching file and executing tests whenever any file changes
+    autoWatch: true,
+
+
+    // start these browsers
+    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
+    browsers: ['PhantomJS'],
+
+
+    // Continuous Integration mode
+    // if true, Karma captures browsers, runs the tests and exits
+    singleRun: false,
+
+    // Concurrency level
+    // how many browser should be started simultaneous
+    concurrency: Infinity
+  })
+}
diff --git a/wrt/node_modules/engine.io-client/node_modules/debug/node.js b/wrt/node_modules/engine.io-client/node_modules/debug/node.js
new file mode 100644 (file)
index 0000000..7fc36fe
--- /dev/null
@@ -0,0 +1 @@
+module.exports = require('./src/node');
diff --git a/wrt/node_modules/engine.io-client/node_modules/debug/package.json b/wrt/node_modules/engine.io-client/node_modules/debug/package.json
new file mode 100644 (file)
index 0000000..79ec4bf
--- /dev/null
@@ -0,0 +1,148 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "debug@~2.6.6",
+        "scope": null,
+        "escapedName": "debug",
+        "name": "debug",
+        "rawSpec": "~2.6.6",
+        "spec": ">=2.6.6 <2.7.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io"
+    ],
+    [
+      {
+        "raw": "debug@~2.6.4",
+        "scope": null,
+        "escapedName": "debug",
+        "name": "debug",
+        "rawSpec": "~2.6.4",
+        "spec": ">=2.6.4 <2.7.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io-client"
+    ]
+  ],
+  "_from": "debug@~2.6.4",
+  "_id": "debug@2.6.9",
+  "_inCache": true,
+  "_location": "/engine.io-client/debug",
+  "_nodeVersion": "8.4.0",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/debug-2.6.9.tgz_1506087154503_0.5196126794908196"
+  },
+  "_npmUser": {
+    "name": "tootallnate",
+    "email": "nathan@tootallnate.net"
+  },
+  "_npmVersion": "5.3.0",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "debug@~2.6.4",
+    "scope": null,
+    "escapedName": "debug",
+    "name": "debug",
+    "rawSpec": "~2.6.4",
+    "spec": ">=2.6.4 <2.7.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/engine.io-client"
+  ],
+  "_resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+  "_shasum": "5d128515df134ff327e90a4c93f4e077a536341f",
+  "_shrinkwrap": null,
+  "_spec": "debug@~2.6.4",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io-client",
+  "author": {
+    "name": "TJ Holowaychuk",
+    "email": "tj@vision-media.ca"
+  },
+  "browser": "./src/browser.js",
+  "bugs": {
+    "url": "https://github.com/visionmedia/debug/issues"
+  },
+  "component": {
+    "scripts": {
+      "debug/index.js": "browser.js",
+      "debug/debug.js": "debug.js"
+    }
+  },
+  "contributors": [
+    {
+      "name": "Nathan Rajlich",
+      "email": "nathan@tootallnate.net",
+      "url": "http://n8.io"
+    },
+    {
+      "name": "Andrew Rhyne",
+      "email": "rhyneandrew@gmail.com"
+    }
+  ],
+  "dependencies": {
+    "ms": "2.0.0"
+  },
+  "description": "small debugging utility",
+  "devDependencies": {
+    "browserify": "9.0.3",
+    "chai": "^3.5.0",
+    "concurrently": "^3.1.0",
+    "coveralls": "^2.11.15",
+    "eslint": "^3.12.1",
+    "istanbul": "^0.4.5",
+    "karma": "^1.3.0",
+    "karma-chai": "^0.1.0",
+    "karma-mocha": "^1.3.0",
+    "karma-phantomjs-launcher": "^1.0.2",
+    "karma-sinon": "^1.0.5",
+    "mocha": "^3.2.0",
+    "mocha-lcov-reporter": "^1.2.0",
+    "rimraf": "^2.5.4",
+    "sinon": "^1.17.6",
+    "sinon-chai": "^2.8.0"
+  },
+  "directories": {},
+  "dist": {
+    "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+    "shasum": "5d128515df134ff327e90a4c93f4e077a536341f",
+    "tarball": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz"
+  },
+  "gitHead": "13abeae468fea297d0dccc50bc55590809241083",
+  "homepage": "https://github.com/visionmedia/debug#readme",
+  "keywords": [
+    "debug",
+    "log",
+    "debugger"
+  ],
+  "license": "MIT",
+  "main": "./src/index.js",
+  "maintainers": [
+    {
+      "name": "thebigredgeek",
+      "email": "rhyneandrew@gmail.com"
+    },
+    {
+      "name": "kolban",
+      "email": "kolban1@kolban.com"
+    },
+    {
+      "name": "tootallnate",
+      "email": "nathan@tootallnate.net"
+    },
+    {
+      "name": "tjholowaychuk",
+      "email": "tj@vision-media.ca"
+    }
+  ],
+  "name": "debug",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/visionmedia/debug.git"
+  },
+  "version": "2.6.9"
+}
diff --git a/wrt/node_modules/engine.io-client/node_modules/debug/src/browser.js b/wrt/node_modules/engine.io-client/node_modules/debug/src/browser.js
new file mode 100644 (file)
index 0000000..7106924
--- /dev/null
@@ -0,0 +1,185 @@
+/**
+ * This is the web browser implementation of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = require('./debug');
+exports.log = log;
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+exports.storage = 'undefined' != typeof chrome
+               && 'undefined' != typeof chrome.storage
+                  ? chrome.storage.local
+                  : localstorage();
+
+/**
+ * Colors.
+ */
+
+exports.colors = [
+  'lightseagreen',
+  'forestgreen',
+  'goldenrod',
+  'dodgerblue',
+  'darkorchid',
+  'crimson'
+];
+
+/**
+ * Currently only WebKit-based Web Inspectors, Firefox >= v31,
+ * and the Firebug extension (any Firefox version) are known
+ * to support "%c" CSS customizations.
+ *
+ * TODO: add a `localStorage` variable to explicitly enable/disable colors
+ */
+
+function useColors() {
+  // NB: In an Electron preload script, document will be defined but not fully
+  // initialized. Since we know we're in Chrome, we'll just detect this case
+  // explicitly
+  if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
+    return true;
+  }
+
+  // is webkit? http://stackoverflow.com/a/16459606/376773
+  // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
+  return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
+    // is firebug? http://stackoverflow.com/a/398120/376773
+    (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
+    // is firefox >= v31?
+    // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
+    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
+    // double check webkit in userAgent just in case we are in a worker
+    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
+}
+
+/**
+ * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
+ */
+
+exports.formatters.j = function(v) {
+  try {
+    return JSON.stringify(v);
+  } catch (err) {
+    return '[UnexpectedJSONParseError]: ' + err.message;
+  }
+};
+
+
+/**
+ * Colorize log arguments if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+  var useColors = this.useColors;
+
+  args[0] = (useColors ? '%c' : '')
+    + this.namespace
+    + (useColors ? ' %c' : ' ')
+    + args[0]
+    + (useColors ? '%c ' : ' ')
+    + '+' + exports.humanize(this.diff);
+
+  if (!useColors) return;
+
+  var c = 'color: ' + this.color;
+  args.splice(1, 0, c, 'color: inherit')
+
+  // the final "%c" is somewhat tricky, because there could be other
+  // arguments passed either before or after the %c, so we need to
+  // figure out the correct index to insert the CSS into
+  var index = 0;
+  var lastC = 0;
+  args[0].replace(/%[a-zA-Z%]/g, function(match) {
+    if ('%%' === match) return;
+    index++;
+    if ('%c' === match) {
+      // we only are interested in the *last* %c
+      // (the user may have provided their own)
+      lastC = index;
+    }
+  });
+
+  args.splice(lastC, 0, c);
+}
+
+/**
+ * Invokes `console.log()` when available.
+ * No-op when `console.log` is not a "function".
+ *
+ * @api public
+ */
+
+function log() {
+  // this hackery is required for IE8/9, where
+  // the `console.log` function doesn't have 'apply'
+  return 'object' === typeof console
+    && console.log
+    && Function.prototype.apply.call(console.log, console, arguments);
+}
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+
+function save(namespaces) {
+  try {
+    if (null == namespaces) {
+      exports.storage.removeItem('debug');
+    } else {
+      exports.storage.debug = namespaces;
+    }
+  } catch(e) {}
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+
+function load() {
+  var r;
+  try {
+    r = exports.storage.debug;
+  } catch(e) {}
+
+  // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
+  if (!r && typeof process !== 'undefined' && 'env' in process) {
+    r = process.env.DEBUG;
+  }
+
+  return r;
+}
+
+/**
+ * Enable namespaces listed in `localStorage.debug` initially.
+ */
+
+exports.enable(load());
+
+/**
+ * Localstorage attempts to return the localstorage.
+ *
+ * This is necessary because safari throws
+ * when a user disables cookies/localstorage
+ * and you attempt to access it.
+ *
+ * @return {LocalStorage}
+ * @api private
+ */
+
+function localstorage() {
+  try {
+    return window.localStorage;
+  } catch (e) {}
+}
diff --git a/wrt/node_modules/engine.io-client/node_modules/debug/src/debug.js b/wrt/node_modules/engine.io-client/node_modules/debug/src/debug.js
new file mode 100644 (file)
index 0000000..6a5e3fc
--- /dev/null
@@ -0,0 +1,202 @@
+
+/**
+ * This is the common logic for both the Node.js and web browser
+ * implementations of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
+exports.coerce = coerce;
+exports.disable = disable;
+exports.enable = enable;
+exports.enabled = enabled;
+exports.humanize = require('ms');
+
+/**
+ * The currently active debug mode names, and names to skip.
+ */
+
+exports.names = [];
+exports.skips = [];
+
+/**
+ * Map of special "%n" handling functions, for the debug "format" argument.
+ *
+ * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
+ */
+
+exports.formatters = {};
+
+/**
+ * Previous log timestamp.
+ */
+
+var prevTime;
+
+/**
+ * Select a color.
+ * @param {String} namespace
+ * @return {Number}
+ * @api private
+ */
+
+function selectColor(namespace) {
+  var hash = 0, i;
+
+  for (i in namespace) {
+    hash  = ((hash << 5) - hash) + namespace.charCodeAt(i);
+    hash |= 0; // Convert to 32bit integer
+  }
+
+  return exports.colors[Math.abs(hash) % exports.colors.length];
+}
+
+/**
+ * Create a debugger with the given `namespace`.
+ *
+ * @param {String} namespace
+ * @return {Function}
+ * @api public
+ */
+
+function createDebug(namespace) {
+
+  function debug() {
+    // disabled?
+    if (!debug.enabled) return;
+
+    var self = debug;
+
+    // set `diff` timestamp
+    var curr = +new Date();
+    var ms = curr - (prevTime || curr);
+    self.diff = ms;
+    self.prev = prevTime;
+    self.curr = curr;
+    prevTime = curr;
+
+    // turn the `arguments` into a proper Array
+    var args = new Array(arguments.length);
+    for (var i = 0; i < args.length; i++) {
+      args[i] = arguments[i];
+    }
+
+    args[0] = exports.coerce(args[0]);
+
+    if ('string' !== typeof args[0]) {
+      // anything else let's inspect with %O
+      args.unshift('%O');
+    }
+
+    // apply any `formatters` transformations
+    var index = 0;
+    args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
+      // if we encounter an escaped % then don't increase the array index
+      if (match === '%%') return match;
+      index++;
+      var formatter = exports.formatters[format];
+      if ('function' === typeof formatter) {
+        var val = args[index];
+        match = formatter.call(self, val);
+
+        // now we need to remove `args[index]` since it's inlined in the `format`
+        args.splice(index, 1);
+        index--;
+      }
+      return match;
+    });
+
+    // apply env-specific formatting (colors, etc.)
+    exports.formatArgs.call(self, args);
+
+    var logFn = debug.log || exports.log || console.log.bind(console);
+    logFn.apply(self, args);
+  }
+
+  debug.namespace = namespace;
+  debug.enabled = exports.enabled(namespace);
+  debug.useColors = exports.useColors();
+  debug.color = selectColor(namespace);
+
+  // env-specific initialization logic for debug instances
+  if ('function' === typeof exports.init) {
+    exports.init(debug);
+  }
+
+  return debug;
+}
+
+/**
+ * Enables a debug mode by namespaces. This can include modes
+ * separated by a colon and wildcards.
+ *
+ * @param {String} namespaces
+ * @api public
+ */
+
+function enable(namespaces) {
+  exports.save(namespaces);
+
+  exports.names = [];
+  exports.skips = [];
+
+  var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
+  var len = split.length;
+
+  for (var i = 0; i < len; i++) {
+    if (!split[i]) continue; // ignore empty strings
+    namespaces = split[i].replace(/\*/g, '.*?');
+    if (namespaces[0] === '-') {
+      exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
+    } else {
+      exports.names.push(new RegExp('^' + namespaces + '$'));
+    }
+  }
+}
+
+/**
+ * Disable debug output.
+ *
+ * @api public
+ */
+
+function disable() {
+  exports.enable('');
+}
+
+/**
+ * Returns true if the given mode name is enabled, false otherwise.
+ *
+ * @param {String} name
+ * @return {Boolean}
+ * @api public
+ */
+
+function enabled(name) {
+  var i, len;
+  for (i = 0, len = exports.skips.length; i < len; i++) {
+    if (exports.skips[i].test(name)) {
+      return false;
+    }
+  }
+  for (i = 0, len = exports.names.length; i < len; i++) {
+    if (exports.names[i].test(name)) {
+      return true;
+    }
+  }
+  return false;
+}
+
+/**
+ * Coerce `val`.
+ *
+ * @param {Mixed} val
+ * @return {Mixed}
+ * @api private
+ */
+
+function coerce(val) {
+  if (val instanceof Error) return val.stack || val.message;
+  return val;
+}
diff --git a/wrt/node_modules/engine.io-client/node_modules/debug/src/index.js b/wrt/node_modules/engine.io-client/node_modules/debug/src/index.js
new file mode 100644 (file)
index 0000000..e12cf4d
--- /dev/null
@@ -0,0 +1,10 @@
+/**
+ * Detect Electron renderer process, which is node, but we should
+ * treat as a browser.
+ */
+
+if (typeof process !== 'undefined' && process.type === 'renderer') {
+  module.exports = require('./browser.js');
+} else {
+  module.exports = require('./node.js');
+}
diff --git a/wrt/node_modules/engine.io-client/node_modules/debug/src/inspector-log.js b/wrt/node_modules/engine.io-client/node_modules/debug/src/inspector-log.js
new file mode 100644 (file)
index 0000000..60ea6c0
--- /dev/null
@@ -0,0 +1,15 @@
+module.exports = inspectorLog;
+
+// black hole
+const nullStream = new (require('stream').Writable)();
+nullStream._write = () => {};
+
+/**
+ * Outputs a `console.log()` to the Node.js Inspector console *only*.
+ */
+function inspectorLog() {
+  const stdout = console._stdout;
+  console._stdout = nullStream;
+  console.log.apply(console, arguments);
+  console._stdout = stdout;
+}
diff --git a/wrt/node_modules/engine.io-client/node_modules/debug/src/node.js b/wrt/node_modules/engine.io-client/node_modules/debug/src/node.js
new file mode 100644 (file)
index 0000000..b15109c
--- /dev/null
@@ -0,0 +1,248 @@
+/**
+ * Module dependencies.
+ */
+
+var tty = require('tty');
+var util = require('util');
+
+/**
+ * This is the Node.js implementation of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = require('./debug');
+exports.init = init;
+exports.log = log;
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+
+/**
+ * Colors.
+ */
+
+exports.colors = [6, 2, 3, 4, 5, 1];
+
+/**
+ * Build up the default `inspectOpts` object from the environment variables.
+ *
+ *   $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
+ */
+
+exports.inspectOpts = Object.keys(process.env).filter(function (key) {
+  return /^debug_/i.test(key);
+}).reduce(function (obj, key) {
+  // camel-case
+  var prop = key
+    .substring(6)
+    .toLowerCase()
+    .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });
+
+  // coerce string value into JS value
+  var val = process.env[key];
+  if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
+  else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
+  else if (val === 'null') val = null;
+  else val = Number(val);
+
+  obj[prop] = val;
+  return obj;
+}, {});
+
+/**
+ * The file descriptor to write the `debug()` calls to.
+ * Set the `DEBUG_FD` env variable to override with another value. i.e.:
+ *
+ *   $ DEBUG_FD=3 node script.js 3>debug.log
+ */
+
+var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
+
+if (1 !== fd && 2 !== fd) {
+  util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')()
+}
+
+var stream = 1 === fd ? process.stdout :
+             2 === fd ? process.stderr :
+             createWritableStdioStream(fd);
+
+/**
+ * Is stdout a TTY? Colored output is enabled when `true`.
+ */
+
+function useColors() {
+  return 'colors' in exports.inspectOpts
+    ? Boolean(exports.inspectOpts.colors)
+    : tty.isatty(fd);
+}
+
+/**
+ * Map %o to `util.inspect()`, all on a single line.
+ */
+
+exports.formatters.o = function(v) {
+  this.inspectOpts.colors = this.useColors;
+  return util.inspect(v, this.inspectOpts)
+    .split('\n').map(function(str) {
+      return str.trim()
+    }).join(' ');
+};
+
+/**
+ * Map %o to `util.inspect()`, allowing multiple lines if needed.
+ */
+
+exports.formatters.O = function(v) {
+  this.inspectOpts.colors = this.useColors;
+  return util.inspect(v, this.inspectOpts);
+};
+
+/**
+ * Adds ANSI color escape codes if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+  var name = this.namespace;
+  var useColors = this.useColors;
+
+  if (useColors) {
+    var c = this.color;
+    var prefix = '  \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m';
+
+    args[0] = prefix + args[0].split('\n').join('\n' + prefix);
+    args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m');
+  } else {
+    args[0] = new Date().toUTCString()
+      + ' ' + name + ' ' + args[0];
+  }
+}
+
+/**
+ * Invokes `util.format()` with the specified arguments and writes to `stream`.
+ */
+
+function log() {
+  return stream.write(util.format.apply(util, arguments) + '\n');
+}
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+
+function save(namespaces) {
+  if (null == namespaces) {
+    // If you set a process.env field to null or undefined, it gets cast to the
+    // string 'null' or 'undefined'. Just delete instead.
+    delete process.env.DEBUG;
+  } else {
+    process.env.DEBUG = namespaces;
+  }
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+
+function load() {
+  return process.env.DEBUG;
+}
+
+/**
+ * Copied from `node/src/node.js`.
+ *
+ * XXX: It's lame that node doesn't expose this API out-of-the-box. It also
+ * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.
+ */
+
+function createWritableStdioStream (fd) {
+  var stream;
+  var tty_wrap = process.binding('tty_wrap');
+
+  // Note stream._type is used for test-module-load-list.js
+
+  switch (tty_wrap.guessHandleType(fd)) {
+    case 'TTY':
+      stream = new tty.WriteStream(fd);
+      stream._type = 'tty';
+
+      // Hack to have stream not keep the event loop alive.
+      // See https://github.com/joyent/node/issues/1726
+      if (stream._handle && stream._handle.unref) {
+        stream._handle.unref();
+      }
+      break;
+
+    case 'FILE':
+      var fs = require('fs');
+      stream = new fs.SyncWriteStream(fd, { autoClose: false });
+      stream._type = 'fs';
+      break;
+
+    case 'PIPE':
+    case 'TCP':
+      var net = require('net');
+      stream = new net.Socket({
+        fd: fd,
+        readable: false,
+        writable: true
+      });
+
+      // FIXME Should probably have an option in net.Socket to create a
+      // stream from an existing fd which is writable only. But for now
+      // we'll just add this hack and set the `readable` member to false.
+      // Test: ./node test/fixtures/echo.js < /etc/passwd
+      stream.readable = false;
+      stream.read = null;
+      stream._type = 'pipe';
+
+      // FIXME Hack to have stream not keep the event loop alive.
+      // See https://github.com/joyent/node/issues/1726
+      if (stream._handle && stream._handle.unref) {
+        stream._handle.unref();
+      }
+      break;
+
+    default:
+      // Probably an error on in uv_guess_handle()
+      throw new Error('Implement me. Unknown stream file type!');
+  }
+
+  // For supporting legacy API we put the FD here.
+  stream.fd = fd;
+
+  stream._isStdio = true;
+
+  return stream;
+}
+
+/**
+ * Init logic for `debug` instances.
+ *
+ * Create a new `inspectOpts` object in case `useColors` is set
+ * differently for a particular `debug` instance.
+ */
+
+function init (debug) {
+  debug.inspectOpts = {};
+
+  var keys = Object.keys(exports.inspectOpts);
+  for (var i = 0; i < keys.length; i++) {
+    debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
+  }
+}
+
+/**
+ * Enable namespaces listed in `process.env.DEBUG` initially.
+ */
+
+exports.enable(load());
diff --git a/wrt/node_modules/engine.io-client/package.json b/wrt/node_modules/engine.io-client/package.json
new file mode 100644 (file)
index 0000000..ec8d14b
--- /dev/null
@@ -0,0 +1,152 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "engine.io-client@~3.1.0",
+        "scope": null,
+        "escapedName": "engine.io-client",
+        "name": "engine.io-client",
+        "rawSpec": "~3.1.0",
+        "spec": ">=3.1.0 <3.2.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io-client"
+    ]
+  ],
+  "_from": "engine.io-client@>=3.1.0 <3.2.0",
+  "_id": "engine.io-client@3.1.1",
+  "_inCache": true,
+  "_location": "/engine.io-client",
+  "_nodeVersion": "6.9.4",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/engine.io-client-3.1.1.tgz_1495176579365_0.10497027798555791"
+  },
+  "_npmUser": {
+    "name": "darrachequesne",
+    "email": "damien.arrachequesne@gmail.com"
+  },
+  "_npmVersion": "3.10.10",
+  "_phantomChildren": {
+    "ms": "2.0.0"
+  },
+  "_requested": {
+    "raw": "engine.io-client@~3.1.0",
+    "scope": null,
+    "escapedName": "engine.io-client",
+    "name": "engine.io-client",
+    "rawSpec": "~3.1.0",
+    "spec": ">=3.1.0 <3.2.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/socket.io-client"
+  ],
+  "_resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.1.1.tgz",
+  "_shasum": "415a9852badb14fa008fa3ef1e31608db6761325",
+  "_shrinkwrap": null,
+  "_spec": "engine.io-client@~3.1.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io-client",
+  "browser": {
+    "ws": false,
+    "xmlhttprequest-ssl": "./lib/xmlhttprequest.js"
+  },
+  "bugs": {
+    "url": "https://github.com/socketio/engine.io-client/issues"
+  },
+  "contributors": [
+    {
+      "name": "Guillermo Rauch",
+      "email": "rauchg@gmail.com"
+    },
+    {
+      "name": "Vladimir Dronnikov",
+      "email": "dronnikov@gmail.com"
+    },
+    {
+      "name": "Christoph Dorn",
+      "url": "https://github.com/cadorn"
+    },
+    {
+      "name": "Mark Mokryn",
+      "email": "mokesmokes@gmail.com"
+    }
+  ],
+  "dependencies": {
+    "component-emitter": "1.2.1",
+    "component-inherit": "0.0.3",
+    "debug": "~2.6.4",
+    "engine.io-parser": "~2.1.1",
+    "has-cors": "1.1.0",
+    "indexof": "0.0.1",
+    "parsejson": "0.0.3",
+    "parseqs": "0.0.5",
+    "parseuri": "0.0.5",
+    "ws": "~2.3.1",
+    "xmlhttprequest-ssl": "1.5.3",
+    "yeast": "0.1.2"
+  },
+  "description": "Client for the realtime Engine",
+  "devDependencies": {
+    "babel-core": "^6.24.0",
+    "babel-eslint": "4.1.7",
+    "babel-loader": "^6.4.1",
+    "babel-preset-es2015": "^6.24.0",
+    "blob": "^0.0.4",
+    "concat-stream": "^1.6.0",
+    "del": "^2.2.2",
+    "derequire": "^2.0.6",
+    "engine.io": "3.1.0",
+    "eslint-config-standard": "4.4.0",
+    "eslint-plugin-standard": "1.3.1",
+    "expect.js": "^0.3.1",
+    "express": "4.15.2",
+    "gulp": "3.9.1",
+    "gulp-eslint": "1.1.1",
+    "gulp-file": "^0.3.0",
+    "gulp-istanbul": "^1.1.1",
+    "gulp-mocha": "^4.3.0",
+    "gulp-task-listing": "1.0.1",
+    "istanbul": "^0.4.5",
+    "mocha": "^3.2.0",
+    "webpack": "1.12.12",
+    "webpack-stream": "^3.2.0",
+    "zuul": "^3.11.1",
+    "zuul-builder-webpack": "^1.2.0",
+    "zuul-ngrok": "4.0.0"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "415a9852badb14fa008fa3ef1e31608db6761325",
+    "tarball": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.1.1.tgz"
+  },
+  "files": [
+    "index.js",
+    "lib/",
+    "engine.io.js"
+  ],
+  "gitHead": "b949abc6e11e507449b0063c7e45b29eb1b6d1f5",
+  "homepage": "https://github.com/socketio/engine.io-client",
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "darrachequesne",
+      "email": "damien.arrachequesne@gmail.com"
+    },
+    {
+      "name": "rauchg",
+      "email": "rauchg@gmail.com"
+    }
+  ],
+  "name": "engine.io-client",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/socketio/engine.io-client.git"
+  },
+  "scripts": {
+    "test": "gulp test"
+  },
+  "version": "3.1.1"
+}
diff --git a/wrt/node_modules/engine.io-parser/History.md b/wrt/node_modules/engine.io-parser/History.md
new file mode 100644 (file)
index 0000000..a22d0eb
--- /dev/null
@@ -0,0 +1,177 @@
+
+2.1.1 / 2017-04-27
+==================
+
+  * [chore] Bump has-binary2 to version 1.0.2 (#93)
+
+2.1.0 / 2017-04-24
+==================
+
+  * [chore] Drop support for old nodejs versions (0.10 & 0.12) (#92)
+  * [revert] "[fix] Enable to utf8-decode string payloads (#88)" (#91)
+
+2.0.3 / 2017-04-05
+==================
+
+  * (chore] Use has-binary2 (#90)
+
+2.0.2 / 2017-03-21
+==================
+
+  * [fix] Enable to utf8-decode string payloads (#88)
+
+2.0.1 / 2017-03-06
+==================
+
+  * [fix] Encode string payloads as strings even if binary supported (#85)
+
+2.0.0 / 2016-12-23
+==================
+
+  * [perf] Micro optimisations (#84)
+  * [fix] Sanitize strings by removing lone surrogates (#82)
+  * [perf] Use strict equality where possible (#77)
+  * [style] Minor style changes (#83)
+  * [fix] Fix double utf8 encoding for payloads (#81)
+  * [chore] Update zuul config to speed up tests (#76)
+
+1.3.2 / 2016-12-07
+==================
+
+  * [chore] Bump dependencies (#78)
+
+1.3.1 / 2016-10-20
+==================
+
+  * [fix] Add safety check for global object (#71)
+  * [fix] decodePacket now accepts both Buffer and ArrayBuffer as data (#64)
+  * [fix] Handle undefined case properly when decoding packet (#74)
+  * [chore] Bump zuul to 3.11.0 & zuul-ngrok to 4.0.0 (#70)
+  * [chore] Update zuul browser settings (#73)
+
+1.3.0 / 2016-09-26
+==================
+
+  * [fix] Fix crashes in React Native "navigator is not defined" (#55)
+  * [refactor] Require base64-arraybuffer module conditionally. (#58)
+  * [perf] Split try catch into separate function (#65)
+  * [chore] Use wtf-8 instead of utf8 to prevent lone surrogates from generating parsing error (#68)
+  * [chore] Restrict files included in npm package (#67)
+  * [chore] Update license and repository url (#66)
+  * [chore] Update zuul browser settings following EOL notices (#62)
+  * [chore] bump zuul (#56)
+
+1.2.4 / 2015-12-04
+==================
+
+  * fix `ArrayBuffer` encoding in base64 string
+
+1.2.3 / 2015-11-28
+==================
+
+  * fix encoding blob as base64
+
+1.2.2 / 2015-09-09
+==================
+
+  * fixes for iojs/node
+
+1.2.1 / 2015-01-17
+==================
+
+ * pass has-binary result to encodePacket [rase-]
+ * Fix parse error [rase-]
+
+1.2.0 / 2015-01-11
+==================
+
+ * fix return type for decodePacket
+ * README fixes
+ * use travis matrix for better test runs
+ * encode into binary only if needed
+ * add test cases for base64 object encoding.
+ * add encodeBase64Object to encoder for browser
+ * avoid sending Blobs on PhantomJS (as on Android)
+ * test that utf8 encoding is not on by default but can be switched on manually
+
+1.1.0 / 2014-07-16
+==================
+
+ * make utf8 encoding/decoding optional
+
+1.0.8 / 2014-07-16
+==================
+
+ * adjust protocol revision
+ * handle invalid utf8 errors gracefully
+ * fix memory leak on browser
+
+1.0.7 / 2014-06-24
+==================
+
+ * fix decodePayloadAsBinary memory leak [christophwitzko]
+ * README improvements
+
+1.0.6 / 2014-05-30
+==================
+
+ * utf8 fixes when using binary encoding [nkzawa]
+
+1.0.5 / 2014-05-06
+==================
+
+ * fix range error
+
+1.0.4 / 2014-04-13
+==================
+
+ * fix `encodePayloadAsBinary` method encodes packets to base64
+
+1.0.3 / 2014-04-10
+==================
+
+ * Fix length calculation when encoding as binary [binlain]
+
+1.0.2 / 2014-03-16
+==================
+
+ * fix binary for android due to a bug in Blob XHR2 implementation [Rase-]
+
+1.0.1 / 2014-03-06
+==================
+
+ * implement `blob` module to simplify code
+ * bump `arraybuffer.slice`
+ * style fixes
+
+1.0.0 / 2014-02-18
+==================
+
+ * parser: added binary encoding [Rase-]
+ * parser: switched to an async interface [Rase-]
+
+0.3.0 / 2013-03-16
+==================
+
+  * parser: if callback returns `false` ignore rest of payload
+  * test: fixed all broken tests
+
+0.2.1 / 2013-03-16
+==================
+
+  * added protocol version to index.js [albertyfwu]
+
+0.2.0 / 2013-02-26
+==================
+
+  * Changed `decodePayload` to use a callback instead of returning an array [sweetieSong, albertyfwu]
+
+0.1.1 / 2013-01-26
+==================
+
+  * package.json fixes
+
+0.1.0 / 2013-01-19
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/engine.io-parser/LICENSE b/wrt/node_modules/engine.io-parser/LICENSE
new file mode 100644 (file)
index 0000000..d8fdaec
--- /dev/null
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2016 Guillermo Rauch (@rauchg)
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/wrt/node_modules/engine.io-parser/Readme.md b/wrt/node_modules/engine.io-parser/Readme.md
new file mode 100644 (file)
index 0000000..02bf538
--- /dev/null
@@ -0,0 +1,202 @@
+
+# engine.io-parser
+
+[![Build Status](https://secure.travis-ci.org/socketio/engine.io-parser.svg)](http://travis-ci.org/socketio/engine.io-parser)
+[![NPM version](https://badge.fury.io/js/engine.io-parser.svg)](http://badge.fury.io/js/engine.io-parser)
+
+This is the JavaScript parser for the engine.io protocol encoding,
+shared by both
+[engine.io-client](https://github.com/socketio/engine.io-client) and
+[engine.io](https://github.com/socketio/engine.io).
+
+## How to use
+
+### Standalone
+
+The parser can encode/decode packets, payloads, and payloads as binary
+with the following methods: `encodePacket`, `decodePacket`, `encodePayload`,
+`decodePayload`, `encodePayloadAsBinary`, `decodePayloadAsBinary`.
+
+The browser-side parser also includes `encodePayloadAsArrayBuffer` and `encodePayloadAsBlob`.
+
+Example:
+
+```js
+var parser = require('engine.io-parser');
+
+var data = new Buffer(5);
+for (var i = 0; i < data.length; i++) { data[i] = i; }
+
+parser.encodePacket({ type: 'message', data: data }, function(encoded) {
+  var decodedData = parser.decodePacket(encoded); // { type: 'message', data: data }
+});
+```
+
+### With browserify
+
+Engine.IO Parser is a commonjs module, which means you can include it by using
+`require` on the browser and package using [browserify](http://browserify.org/):
+
+1. install the parser package
+
+    ```shell
+    npm install engine.io-parser
+    ```
+
+1. write your app code
+
+    ```js
+    var parser = require('engine.io-parser');
+
+    var testBuffer = new Int8Array(10);
+    for (var i = 0; i < testBuffer.length; i++) testBuffer[i] = i;
+
+    var packets = [{ type: 'message', data: testBuffer.buffer }, { type: 'message', data: 'hello' }];
+
+    parser.encodePayload(packets, function(encoded) {
+      parser.decodePayload(encoded,
+        function(packet, index, total) {
+          var isLast = index + 1 == total;
+          if (!isLast) {
+            var buffer = new Int8Array(packet.data); // testBuffer
+          } else {
+            var message = packet.data; // 'hello'
+          }
+        });
+    });
+    ```
+
+1. build your app bundle
+
+    ```bash
+    $ browserify app.js > bundle.js
+    ```
+
+1. include on your page
+
+    ```html
+    <script src="/path/to/bundle.js"></script>
+    ```
+
+## Features
+
+- Runs on browser and node.js seamlessly
+- Runs inside HTML5 WebWorker
+- Can encode and decode packets
+  - Encodes from/to ArrayBuffer or Blob when in browser, and Buffer or ArrayBuffer in Node
+
+## API
+
+Note: `cb(type)` means the type is a callback function that contains a parameter of type `type` when called.
+
+### Node
+
+- `encodePacket`
+    - Encodes a packet.
+    - **Parameters**
+      - `Object`: the packet to encode, has `type` and `data`.
+        - `data`: can be a `String`, `Number`, `Buffer`, `ArrayBuffer`
+      - `Boolean`: optional, binary support
+      - `Function`: callback, returns the encoded packet (`cb(String)`)
+- `decodePacket`
+    - Decodes a packet. Data also available as an ArrayBuffer if requested.
+    - Returns data as `String` or (`Blob` on browser, `ArrayBuffer` on Node)
+    - **Parameters**
+      - `String` | `ArrayBuffer`: the packet to decode, has `type` and `data`
+      - `String`: optional, the binary type
+
+- `encodeBase64Packet`
+    - Encodes a packet with binary data in a base64 string (`String`)
+    - **Parameters**
+      - `Object`: the packet to encode, has `type` and `data`
+      - `Function`: callback, returns the base64 encoded message (`cb(String)`)
+- `decodeBase64Packet`
+    - Decodes a packet encoded in a base64 string.
+    - **Parameters**
+      - `String`: the base64 encoded message
+      - `String`: optional, the binary type
+
+- `encodePayload`
+    - Encodes multiple messages (payload).
+    - If any contents are binary, they will be encoded as base64 strings. Base64
+      encoded strings are marked with a b before the length specifier
+    - **Parameters**
+      - `Array`: an array of packets
+      - `Boolean`: optional, binary support
+      - `Function`: callback, returns the encoded payload (`cb(String)`)
+- `decodePayload`
+    - Decodes data when a payload is maybe expected. Possible binary contents are
+      decoded from their base64 representation.
+    - **Parameters**
+      - `String`: the payload
+      - `String`: optional, the binary type
+      - `Function`: callback, returns (cb(`Object`: packet, `Number`:packet index, `Number`:packet total))
+
+- `encodePayloadAsBinary`
+    - Encodes multiple messages (payload) as binary.
+    - **Parameters**
+      - `Array`: an array of packets
+      - `Function`: callback, returns the encoded payload (`cb(Buffer)`)
+- `decodePayloadAsBinary`
+    - Decodes data when a payload is maybe expected. Strings are decoded by
+      interpreting each byte as a key code for entries marked to start with 0. See
+      description of encodePayloadAsBinary.
+    - **Parameters**
+      - `Buffer`: the buffer
+      - `String`: optional, the binary type
+      - `Function`: callback, returns the decoded packet (`cb(Object)`)
+
+### Browser
+
+- `encodePayloadAsArrayBuffer`
+    - Encodes multiple messages (payload) as binary.
+    - **Parameters**
+      - `Array`: an array of packets
+      - `Function`: callback, returns the encoded payload (`cb(ArrayBuffer)`)
+- `encodePayloadAsBlob`
+    - Encodes multiple messages (payload) as blob.
+    - **Parameters**
+      - `Array`: an array of packets
+      - `Function`: callback, returns the encoded payload (`cb(Blob)`)
+
+## Tests
+
+Standalone tests can be run with `make test` which will run both node.js and browser tests.
+
+Browser tests are run using [zuul](https://github.com/defunctzombie/zuul).
+(You must have zuul setup with a saucelabs account.)
+
+You can run the tests locally using the following command:
+
+```
+./node_modules/.bin/zuul --local 8080 -- test/index.js
+```
+
+## Support
+
+The support channels for `engine.io-parser` are the same as `socket.io`:
+  - irc.freenode.net **#socket.io**
+  - [Google Groups](http://groups.google.com/group/socket_io)
+  - [Website](http://socket.io)
+
+## Development
+
+To contribute patches, run tests or benchmarks, make sure to clone the
+repository:
+
+```bash
+git clone git://github.com/LearnBoost/engine.io-parser.git
+```
+
+Then:
+
+```bash
+cd engine.io-parser
+npm install
+```
+
+See the `Tests` section above for how to run tests before submitting any patches.
+
+## License
+
+MIT
diff --git a/wrt/node_modules/engine.io-parser/index.js b/wrt/node_modules/engine.io-parser/index.js
new file mode 100644 (file)
index 0000000..887727f
--- /dev/null
@@ -0,0 +1,2 @@
+
+module.exports = require('./lib/');
diff --git a/wrt/node_modules/engine.io-parser/lib/browser.js b/wrt/node_modules/engine.io-parser/lib/browser.js
new file mode 100644 (file)
index 0000000..5a5e506
--- /dev/null
@@ -0,0 +1,606 @@
+/**
+ * Module dependencies.
+ */
+
+var keys = require('./keys');
+var hasBinary = require('has-binary2');
+var sliceBuffer = require('arraybuffer.slice');
+var after = require('after');
+var utf8 = require('./utf8');
+
+var base64encoder;
+if (global && global.ArrayBuffer) {
+  base64encoder = require('base64-arraybuffer');
+}
+
+/**
+ * Check if we are running an android browser. That requires us to use
+ * ArrayBuffer with polling transports...
+ *
+ * http://ghinda.net/jpeg-blob-ajax-android/
+ */
+
+var isAndroid = typeof navigator !== 'undefined' && /Android/i.test(navigator.userAgent);
+
+/**
+ * Check if we are running in PhantomJS.
+ * Uploading a Blob with PhantomJS does not work correctly, as reported here:
+ * https://github.com/ariya/phantomjs/issues/11395
+ * @type boolean
+ */
+var isPhantomJS = typeof navigator !== 'undefined' && /PhantomJS/i.test(navigator.userAgent);
+
+/**
+ * When true, avoids using Blobs to encode payloads.
+ * @type boolean
+ */
+var dontSendBlobs = isAndroid || isPhantomJS;
+
+/**
+ * Current protocol version.
+ */
+
+exports.protocol = 3;
+
+/**
+ * Packet types.
+ */
+
+var packets = exports.packets = {
+    open:     0    // non-ws
+  , close:    1    // non-ws
+  , ping:     2
+  , pong:     3
+  , message:  4
+  , upgrade:  5
+  , noop:     6
+};
+
+var packetslist = keys(packets);
+
+/**
+ * Premade error packet.
+ */
+
+var err = { type: 'error', data: 'parser error' };
+
+/**
+ * Create a blob api even for blob builder when vendor prefixes exist
+ */
+
+var Blob = require('blob');
+
+/**
+ * Encodes a packet.
+ *
+ *     <packet type id> [ <data> ]
+ *
+ * Example:
+ *
+ *     5hello world
+ *     3
+ *     4
+ *
+ * Binary is encoded in an identical principle
+ *
+ * @api private
+ */
+
+exports.encodePacket = function (packet, supportsBinary, utf8encode, callback) {
+  if (typeof supportsBinary === 'function') {
+    callback = supportsBinary;
+    supportsBinary = false;
+  }
+
+  if (typeof utf8encode === 'function') {
+    callback = utf8encode;
+    utf8encode = null;
+  }
+
+  var data = (packet.data === undefined)
+    ? undefined
+    : packet.data.buffer || packet.data;
+
+  if (global.ArrayBuffer && data instanceof ArrayBuffer) {
+    return encodeArrayBuffer(packet, supportsBinary, callback);
+  } else if (Blob && data instanceof global.Blob) {
+    return encodeBlob(packet, supportsBinary, callback);
+  }
+
+  // might be an object with { base64: true, data: dataAsBase64String }
+  if (data && data.base64) {
+    return encodeBase64Object(packet, callback);
+  }
+
+  // Sending data as a utf-8 string
+  var encoded = packets[packet.type];
+
+  // data fragment is optional
+  if (undefined !== packet.data) {
+    encoded += utf8encode ? utf8.encode(String(packet.data), { strict: false }) : String(packet.data);
+  }
+
+  return callback('' + encoded);
+
+};
+
+function encodeBase64Object(packet, callback) {
+  // packet data is an object { base64: true, data: dataAsBase64String }
+  var message = 'b' + exports.packets[packet.type] + packet.data.data;
+  return callback(message);
+}
+
+/**
+ * Encode packet helpers for binary types
+ */
+
+function encodeArrayBuffer(packet, supportsBinary, callback) {
+  if (!supportsBinary) {
+    return exports.encodeBase64Packet(packet, callback);
+  }
+
+  var data = packet.data;
+  var contentArray = new Uint8Array(data);
+  var resultBuffer = new Uint8Array(1 + data.byteLength);
+
+  resultBuffer[0] = packets[packet.type];
+  for (var i = 0; i < contentArray.length; i++) {
+    resultBuffer[i+1] = contentArray[i];
+  }
+
+  return callback(resultBuffer.buffer);
+}
+
+function encodeBlobAsArrayBuffer(packet, supportsBinary, callback) {
+  if (!supportsBinary) {
+    return exports.encodeBase64Packet(packet, callback);
+  }
+
+  var fr = new FileReader();
+  fr.onload = function() {
+    packet.data = fr.result;
+    exports.encodePacket(packet, supportsBinary, true, callback);
+  };
+  return fr.readAsArrayBuffer(packet.data);
+}
+
+function encodeBlob(packet, supportsBinary, callback) {
+  if (!supportsBinary) {
+    return exports.encodeBase64Packet(packet, callback);
+  }
+
+  if (dontSendBlobs) {
+    return encodeBlobAsArrayBuffer(packet, supportsBinary, callback);
+  }
+
+  var length = new Uint8Array(1);
+  length[0] = packets[packet.type];
+  var blob = new Blob([length.buffer, packet.data]);
+
+  return callback(blob);
+}
+
+/**
+ * Encodes a packet with binary data in a base64 string
+ *
+ * @param {Object} packet, has `type` and `data`
+ * @return {String} base64 encoded message
+ */
+
+exports.encodeBase64Packet = function(packet, callback) {
+  var message = 'b' + exports.packets[packet.type];
+  if (Blob && packet.data instanceof global.Blob) {
+    var fr = new FileReader();
+    fr.onload = function() {
+      var b64 = fr.result.split(',')[1];
+      callback(message + b64);
+    };
+    return fr.readAsDataURL(packet.data);
+  }
+
+  var b64data;
+  try {
+    b64data = String.fromCharCode.apply(null, new Uint8Array(packet.data));
+  } catch (e) {
+    // iPhone Safari doesn't let you apply with typed arrays
+    var typed = new Uint8Array(packet.data);
+    var basic = new Array(typed.length);
+    for (var i = 0; i < typed.length; i++) {
+      basic[i] = typed[i];
+    }
+    b64data = String.fromCharCode.apply(null, basic);
+  }
+  message += global.btoa(b64data);
+  return callback(message);
+};
+
+/**
+ * Decodes a packet. Changes format to Blob if requested.
+ *
+ * @return {Object} with `type` and `data` (if any)
+ * @api private
+ */
+
+exports.decodePacket = function (data, binaryType, utf8decode) {
+  if (data === undefined) {
+    return err;
+  }
+  // String data
+  if (typeof data === 'string') {
+    if (data.charAt(0) === 'b') {
+      return exports.decodeBase64Packet(data.substr(1), binaryType);
+    }
+
+    if (utf8decode) {
+      data = tryDecode(data);
+      if (data === false) {
+        return err;
+      }
+    }
+    var type = data.charAt(0);
+
+    if (Number(type) != type || !packetslist[type]) {
+      return err;
+    }
+
+    if (data.length > 1) {
+      return { type: packetslist[type], data: data.substring(1) };
+    } else {
+      return { type: packetslist[type] };
+    }
+  }
+
+  var asArray = new Uint8Array(data);
+  var type = asArray[0];
+  var rest = sliceBuffer(data, 1);
+  if (Blob && binaryType === 'blob') {
+    rest = new Blob([rest]);
+  }
+  return { type: packetslist[type], data: rest };
+};
+
+function tryDecode(data) {
+  try {
+    data = utf8.decode(data, { strict: false });
+  } catch (e) {
+    return false;
+  }
+  return data;
+}
+
+/**
+ * Decodes a packet encoded in a base64 string
+ *
+ * @param {String} base64 encoded message
+ * @return {Object} with `type` and `data` (if any)
+ */
+
+exports.decodeBase64Packet = function(msg, binaryType) {
+  var type = packetslist[msg.charAt(0)];
+  if (!base64encoder) {
+    return { type: type, data: { base64: true, data: msg.substr(1) } };
+  }
+
+  var data = base64encoder.decode(msg.substr(1));
+
+  if (binaryType === 'blob' && Blob) {
+    data = new Blob([data]);
+  }
+
+  return { type: type, data: data };
+};
+
+/**
+ * Encodes multiple messages (payload).
+ *
+ *     <length>:data
+ *
+ * Example:
+ *
+ *     11:hello world2:hi
+ *
+ * If any contents are binary, they will be encoded as base64 strings. Base64
+ * encoded strings are marked with a b before the length specifier
+ *
+ * @param {Array} packets
+ * @api private
+ */
+
+exports.encodePayload = function (packets, supportsBinary, callback) {
+  if (typeof supportsBinary === 'function') {
+    callback = supportsBinary;
+    supportsBinary = null;
+  }
+
+  var isBinary = hasBinary(packets);
+
+  if (supportsBinary && isBinary) {
+    if (Blob && !dontSendBlobs) {
+      return exports.encodePayloadAsBlob(packets, callback);
+    }
+
+    return exports.encodePayloadAsArrayBuffer(packets, callback);
+  }
+
+  if (!packets.length) {
+    return callback('0:');
+  }
+
+  function setLengthHeader(message) {
+    return message.length + ':' + message;
+  }
+
+  function encodeOne(packet, doneCallback) {
+    exports.encodePacket(packet, !isBinary ? false : supportsBinary, false, function(message) {
+      doneCallback(null, setLengthHeader(message));
+    });
+  }
+
+  map(packets, encodeOne, function(err, results) {
+    return callback(results.join(''));
+  });
+};
+
+/**
+ * Async array map using after
+ */
+
+function map(ary, each, done) {
+  var result = new Array(ary.length);
+  var next = after(ary.length, done);
+
+  var eachWithIndex = function(i, el, cb) {
+    each(el, function(error, msg) {
+      result[i] = msg;
+      cb(error, result);
+    });
+  };
+
+  for (var i = 0; i < ary.length; i++) {
+    eachWithIndex(i, ary[i], next);
+  }
+}
+
+/*
+ * Decodes data when a payload is maybe expected. Possible binary contents are
+ * decoded from their base64 representation
+ *
+ * @param {String} data, callback method
+ * @api public
+ */
+
+exports.decodePayload = function (data, binaryType, callback) {
+  if (typeof data !== 'string') {
+    return exports.decodePayloadAsBinary(data, binaryType, callback);
+  }
+
+  if (typeof binaryType === 'function') {
+    callback = binaryType;
+    binaryType = null;
+  }
+
+  var packet;
+  if (data === '') {
+    // parser error - ignoring payload
+    return callback(err, 0, 1);
+  }
+
+  var length = '', n, msg;
+
+  for (var i = 0, l = data.length; i < l; i++) {
+    var chr = data.charAt(i);
+
+    if (chr !== ':') {
+      length += chr;
+      continue;
+    }
+
+    if (length === '' || (length != (n = Number(length)))) {
+      // parser error - ignoring payload
+      return callback(err, 0, 1);
+    }
+
+    msg = data.substr(i + 1, n);
+
+    if (length != msg.length) {
+      // parser error - ignoring payload
+      return callback(err, 0, 1);
+    }
+
+    if (msg.length) {
+      packet = exports.decodePacket(msg, binaryType, false);
+
+      if (err.type === packet.type && err.data === packet.data) {
+        // parser error in individual packet - ignoring payload
+        return callback(err, 0, 1);
+      }
+
+      var ret = callback(packet, i + n, l);
+      if (false === ret) return;
+    }
+
+    // advance cursor
+    i += n;
+    length = '';
+  }
+
+  if (length !== '') {
+    // parser error - ignoring payload
+    return callback(err, 0, 1);
+  }
+
+};
+
+/**
+ * Encodes multiple messages (payload) as binary.
+ *
+ * <1 = binary, 0 = string><number from 0-9><number from 0-9>[...]<number
+ * 255><data>
+ *
+ * Example:
+ * 1 3 255 1 2 3, if the binary contents are interpreted as 8 bit integers
+ *
+ * @param {Array} packets
+ * @return {ArrayBuffer} encoded payload
+ * @api private
+ */
+
+exports.encodePayloadAsArrayBuffer = function(packets, callback) {
+  if (!packets.length) {
+    return callback(new ArrayBuffer(0));
+  }
+
+  function encodeOne(packet, doneCallback) {
+    exports.encodePacket(packet, true, true, function(data) {
+      return doneCallback(null, data);
+    });
+  }
+
+  map(packets, encodeOne, function(err, encodedPackets) {
+    var totalLength = encodedPackets.reduce(function(acc, p) {
+      var len;
+      if (typeof p === 'string'){
+        len = p.length;
+      } else {
+        len = p.byteLength;
+      }
+      return acc + len.toString().length + len + 2; // string/binary identifier + separator = 2
+    }, 0);
+
+    var resultArray = new Uint8Array(totalLength);
+
+    var bufferIndex = 0;
+    encodedPackets.forEach(function(p) {
+      var isString = typeof p === 'string';
+      var ab = p;
+      if (isString) {
+        var view = new Uint8Array(p.length);
+        for (var i = 0; i < p.length; i++) {
+          view[i] = p.charCodeAt(i);
+        }
+        ab = view.buffer;
+      }
+
+      if (isString) { // not true binary
+        resultArray[bufferIndex++] = 0;
+      } else { // true binary
+        resultArray[bufferIndex++] = 1;
+      }
+
+      var lenStr = ab.byteLength.toString();
+      for (var i = 0; i < lenStr.length; i++) {
+        resultArray[bufferIndex++] = parseInt(lenStr[i]);
+      }
+      resultArray[bufferIndex++] = 255;
+
+      var view = new Uint8Array(ab);
+      for (var i = 0; i < view.length; i++) {
+        resultArray[bufferIndex++] = view[i];
+      }
+    });
+
+    return callback(resultArray.buffer);
+  });
+};
+
+/**
+ * Encode as Blob
+ */
+
+exports.encodePayloadAsBlob = function(packets, callback) {
+  function encodeOne(packet, doneCallback) {
+    exports.encodePacket(packet, true, true, function(encoded) {
+      var binaryIdentifier = new Uint8Array(1);
+      binaryIdentifier[0] = 1;
+      if (typeof encoded === 'string') {
+        var view = new Uint8Array(encoded.length);
+        for (var i = 0; i < encoded.length; i++) {
+          view[i] = encoded.charCodeAt(i);
+        }
+        encoded = view.buffer;
+        binaryIdentifier[0] = 0;
+      }
+
+      var len = (encoded instanceof ArrayBuffer)
+        ? encoded.byteLength
+        : encoded.size;
+
+      var lenStr = len.toString();
+      var lengthAry = new Uint8Array(lenStr.length + 1);
+      for (var i = 0; i < lenStr.length; i++) {
+        lengthAry[i] = parseInt(lenStr[i]);
+      }
+      lengthAry[lenStr.length] = 255;
+
+      if (Blob) {
+        var blob = new Blob([binaryIdentifier.buffer, lengthAry.buffer, encoded]);
+        doneCallback(null, blob);
+      }
+    });
+  }
+
+  map(packets, encodeOne, function(err, results) {
+    return callback(new Blob(results));
+  });
+};
+
+/*
+ * Decodes data when a payload is maybe expected. Strings are decoded by
+ * interpreting each byte as a key code for entries marked to start with 0. See
+ * description of encodePayloadAsBinary
+ *
+ * @param {ArrayBuffer} data, callback method
+ * @api public
+ */
+
+exports.decodePayloadAsBinary = function (data, binaryType, callback) {
+  if (typeof binaryType === 'function') {
+    callback = binaryType;
+    binaryType = null;
+  }
+
+  var bufferTail = data;
+  var buffers = [];
+
+  while (bufferTail.byteLength > 0) {
+    var tailArray = new Uint8Array(bufferTail);
+    var isString = tailArray[0] === 0;
+    var msgLength = '';
+
+    for (var i = 1; ; i++) {
+      if (tailArray[i] === 255) break;
+
+      // 310 = char length of Number.MAX_VALUE
+      if (msgLength.length > 310) {
+        return callback(err, 0, 1);
+      }
+
+      msgLength += tailArray[i];
+    }
+
+    bufferTail = sliceBuffer(bufferTail, 2 + msgLength.length);
+    msgLength = parseInt(msgLength);
+
+    var msg = sliceBuffer(bufferTail, 0, msgLength);
+    if (isString) {
+      try {
+        msg = String.fromCharCode.apply(null, new Uint8Array(msg));
+      } catch (e) {
+        // iPhone Safari doesn't let you apply to typed arrays
+        var typed = new Uint8Array(msg);
+        msg = '';
+        for (var i = 0; i < typed.length; i++) {
+          msg += String.fromCharCode(typed[i]);
+        }
+      }
+    }
+
+    buffers.push(msg);
+    bufferTail = sliceBuffer(bufferTail, msgLength);
+  }
+
+  var total = buffers.length;
+  buffers.forEach(function(buffer, i) {
+    callback(exports.decodePacket(buffer, binaryType, true), i, total);
+  });
+};
diff --git a/wrt/node_modules/engine.io-parser/lib/index.js b/wrt/node_modules/engine.io-parser/lib/index.js
new file mode 100644 (file)
index 0000000..c01b0a0
--- /dev/null
@@ -0,0 +1,480 @@
+/**
+ * Module dependencies.
+ */
+
+var utf8 = require('./utf8');
+var hasBinary = require('has-binary2');
+var after = require('after');
+var keys = require('./keys');
+
+/**
+ * Current protocol version.
+ */
+exports.protocol = 3;
+
+/**
+ * Packet types.
+ */
+
+var packets = exports.packets = {
+    open:     0    // non-ws
+  , close:    1    // non-ws
+  , ping:     2
+  , pong:     3
+  , message:  4
+  , upgrade:  5
+  , noop:     6
+};
+
+var packetslist = keys(packets);
+
+/**
+ * Premade error packet.
+ */
+
+var err = { type: 'error', data: 'parser error' };
+
+/**
+ * Encodes a packet.
+ *
+ *     <packet type id> [ <data> ]
+ *
+ * Example:
+ *
+ *     5hello world
+ *     3
+ *     4
+ *
+ * Binary is encoded in an identical principle
+ *
+ * @api private
+ */
+
+exports.encodePacket = function (packet, supportsBinary, utf8encode, callback) {
+  if (typeof supportsBinary === 'function') {
+    callback = supportsBinary;
+    supportsBinary = null;
+  }
+
+  if (typeof utf8encode === 'function') {
+    callback = utf8encode;
+    utf8encode = null;
+  }
+
+  if (Buffer.isBuffer(packet.data)) {
+    return encodeBuffer(packet, supportsBinary, callback);
+  } else if (packet.data && (packet.data.buffer || packet.data) instanceof ArrayBuffer) {
+    packet.data = arrayBufferToBuffer(packet.data);
+    return encodeBuffer(packet, supportsBinary, callback);
+  }
+
+  // Sending data as a utf-8 string
+  var encoded = packets[packet.type];
+
+  // data fragment is optional
+  if (undefined !== packet.data) {
+    encoded += utf8encode ? utf8.encode(String(packet.data), { strict: false }) : String(packet.data);
+  }
+
+  return callback('' + encoded);
+};
+
+/**
+ * Encode Buffer data
+ */
+
+function encodeBuffer(packet, supportsBinary, callback) {
+  if (!supportsBinary) {
+    return exports.encodeBase64Packet(packet, callback);
+  }
+
+  var data = packet.data;
+  var typeBuffer = new Buffer(1);
+  typeBuffer[0] = packets[packet.type];
+  return callback(Buffer.concat([typeBuffer, data]));
+}
+
+/**
+ * Encodes a packet with binary data in a base64 string
+ *
+ * @param {Object} packet, has `type` and `data`
+ * @return {String} base64 encoded message
+ */
+
+exports.encodeBase64Packet = function(packet, callback){
+  if (!Buffer.isBuffer(packet.data)) {
+    packet.data = arrayBufferToBuffer(packet.data);
+  }
+
+  var message = 'b' + packets[packet.type];
+  message += packet.data.toString('base64');
+  return callback(message);
+};
+
+/**
+ * Decodes a packet. Data also available as an ArrayBuffer if requested.
+ *
+ * @return {Object} with `type` and `data` (if any)
+ * @api private
+ */
+
+exports.decodePacket = function (data, binaryType, utf8decode) {
+  if (data === undefined) {
+    return err;
+  }
+
+  var type;
+
+  // String data
+  if (typeof data === 'string') {
+
+    type = data.charAt(0);
+
+    if (type === 'b') {
+      return exports.decodeBase64Packet(data.substr(1), binaryType);
+    }
+
+    if (utf8decode) {
+      data = tryDecode(data);
+      if (data === false) {
+        return err;
+      }
+    }
+
+    if (Number(type) != type || !packetslist[type]) {
+      return err;
+    }
+
+    if (data.length > 1) {
+      return { type: packetslist[type], data: data.substring(1) };
+    } else {
+      return { type: packetslist[type] };
+    }
+  }
+
+  // Binary data
+  if (binaryType === 'arraybuffer') {
+    // wrap Buffer/ArrayBuffer data into an Uint8Array
+    var intArray = new Uint8Array(data);
+    type = intArray[0];
+    return { type: packetslist[type], data: intArray.buffer.slice(1) };
+  }
+
+  if (data instanceof ArrayBuffer) {
+    data = arrayBufferToBuffer(data);
+  }
+  type = data[0];
+  return { type: packetslist[type], data: data.slice(1) };
+};
+
+function tryDecode(data) {
+  try {
+    data = utf8.decode(data, { strict: false });
+  } catch (e) {
+    return false;
+  }
+  return data;
+}
+
+/**
+ * Decodes a packet encoded in a base64 string.
+ *
+ * @param {String} base64 encoded message
+ * @return {Object} with `type` and `data` (if any)
+ */
+
+exports.decodeBase64Packet = function(msg, binaryType) {
+  var type = packetslist[msg.charAt(0)];
+  var data = new Buffer(msg.substr(1), 'base64');
+  if (binaryType === 'arraybuffer') {
+    var abv = new Uint8Array(data.length);
+    for (var i = 0; i < abv.length; i++){
+      abv[i] = data[i];
+    }
+    data = abv.buffer;
+  }
+  return { type: type, data: data };
+};
+
+/**
+ * Encodes multiple messages (payload).
+ *
+ *     <length>:data
+ *
+ * Example:
+ *
+ *     11:hello world2:hi
+ *
+ * If any contents are binary, they will be encoded as base64 strings. Base64
+ * encoded strings are marked with a b before the length specifier
+ *
+ * @param {Array} packets
+ * @api private
+ */
+
+exports.encodePayload = function (packets, supportsBinary, callback) {
+  if (typeof supportsBinary === 'function') {
+    callback = supportsBinary;
+    supportsBinary = null;
+  }
+
+  if (supportsBinary && hasBinary(packets)) {
+    return exports.encodePayloadAsBinary(packets, callback);
+  }
+
+  if (!packets.length) {
+    return callback('0:');
+  }
+
+  function encodeOne(packet, doneCallback) {
+    exports.encodePacket(packet, supportsBinary, false, function(message) {
+      doneCallback(null, setLengthHeader(message));
+    });
+  }
+
+  map(packets, encodeOne, function(err, results) {
+    return callback(results.join(''));
+  });
+};
+
+function setLengthHeader(message) {
+  return message.length + ':' + message;
+}
+
+/**
+ * Async array map using after
+ */
+
+function map(ary, each, done) {
+  var result = new Array(ary.length);
+  var next = after(ary.length, done);
+
+  for (var i = 0; i < ary.length; i++) {
+    each(ary[i], function(error, msg) {
+      result[i] = msg;
+      next(error, result);
+    });
+  }
+}
+
+/*
+ * Decodes data when a payload is maybe expected. Possible binary contents are
+ * decoded from their base64 representation
+ *
+ * @param {String} data, callback method
+ * @api public
+ */
+
+exports.decodePayload = function (data, binaryType, callback) {
+  if (typeof data !== 'string') {
+    return exports.decodePayloadAsBinary(data, binaryType, callback);
+  }
+
+  if (typeof binaryType === 'function') {
+    callback = binaryType;
+    binaryType = null;
+  }
+
+  if (data === '') {
+    // parser error - ignoring payload
+    return callback(err, 0, 1);
+  }
+
+  var length = '', n, msg, packet;
+
+  for (var i = 0, l = data.length; i < l; i++) {
+    var chr = data.charAt(i);
+
+    if (chr !== ':') {
+      length += chr;
+      continue;
+    }
+
+    if (length === '' || (length != (n = Number(length)))) {
+      // parser error - ignoring payload
+      return callback(err, 0, 1);
+    }
+
+    msg = data.substr(i + 1, n);
+
+    if (length != msg.length) {
+      // parser error - ignoring payload
+      return callback(err, 0, 1);
+    }
+
+    if (msg.length) {
+      packet = exports.decodePacket(msg, binaryType, false);
+
+      if (err.type === packet.type && err.data === packet.data) {
+        // parser error in individual packet - ignoring payload
+        return callback(err, 0, 1);
+      }
+
+      var more = callback(packet, i + n, l);
+      if (false === more) return;
+    }
+
+    // advance cursor
+    i += n;
+    length = '';
+  }
+
+  if (length !== '') {
+    // parser error - ignoring payload
+    return callback(err, 0, 1);
+  }
+
+};
+
+/**
+ *
+ * Converts a buffer to a utf8.js encoded string
+ *
+ * @api private
+ */
+
+function bufferToString(buffer) {
+  var str = '';
+  for (var i = 0, l = buffer.length; i < l; i++) {
+    str += String.fromCharCode(buffer[i]);
+  }
+  return str;
+}
+
+/**
+ *
+ * Converts a utf8.js encoded string to a buffer
+ *
+ * @api private
+ */
+
+function stringToBuffer(string) {
+  var buf = new Buffer(string.length);
+  for (var i = 0, l = string.length; i < l; i++) {
+    buf.writeUInt8(string.charCodeAt(i), i);
+  }
+  return buf;
+}
+
+/**
+ *
+ * Converts an ArrayBuffer to a Buffer
+ *
+ * @api private
+ */
+
+function arrayBufferToBuffer(data) {
+  // data is either an ArrayBuffer or ArrayBufferView.
+  var array = new Uint8Array(data.buffer || data);
+  var length = data.byteLength || data.length;
+  var offset = data.byteOffset || 0;
+  var buffer = new Buffer(length);
+
+  for (var i = 0; i < length; i++) {
+    buffer[i] = array[offset + i];
+  }
+  return buffer;
+}
+
+/**
+ * Encodes multiple messages (payload) as binary.
+ *
+ * <1 = binary, 0 = string><number from 0-9><number from 0-9>[...]<number
+ * 255><data>
+ *
+ * Example:
+ * 1 3 255 1 2 3, if the binary contents are interpreted as 8 bit integers
+ *
+ * @param {Array} packets
+ * @return {Buffer} encoded payload
+ * @api private
+ */
+
+exports.encodePayloadAsBinary = function (packets, callback) {
+  if (!packets.length) {
+    return callback(new Buffer(0));
+  }
+
+  map(packets, encodeOneBinaryPacket, function(err, results) {
+    return callback(Buffer.concat(results));
+  });
+};
+
+function encodeOneBinaryPacket(p, doneCallback) {
+
+  function onBinaryPacketEncode(packet) {
+
+    var encodingLength = '' + packet.length;
+    var sizeBuffer;
+
+    if (typeof packet === 'string') {
+      sizeBuffer = new Buffer(encodingLength.length + 2);
+      sizeBuffer[0] = 0; // is a string (not true binary = 0)
+      for (var i = 0; i < encodingLength.length; i++) {
+        sizeBuffer[i + 1] = parseInt(encodingLength[i], 10);
+      }
+      sizeBuffer[sizeBuffer.length - 1] = 255;
+      return doneCallback(null, Buffer.concat([sizeBuffer, stringToBuffer(packet)]));
+    }
+
+    sizeBuffer = new Buffer(encodingLength.length + 2);
+    sizeBuffer[0] = 1; // is binary (true binary = 1)
+    for (var i = 0; i < encodingLength.length; i++) {
+      sizeBuffer[i + 1] = parseInt(encodingLength[i], 10);
+    }
+    sizeBuffer[sizeBuffer.length - 1] = 255;
+
+    doneCallback(null, Buffer.concat([sizeBuffer, packet]));
+  }
+
+  exports.encodePacket(p, true, true, onBinaryPacketEncode);
+
+}
+
+
+/*
+ * Decodes data when a payload is maybe expected. Strings are decoded by
+ * interpreting each byte as a key code for entries marked to start with 0. See
+ * description of encodePayloadAsBinary
+
+ * @param {Buffer} data, callback method
+ * @api public
+ */
+
+exports.decodePayloadAsBinary = function (data, binaryType, callback) {
+  if (typeof binaryType === 'function') {
+    callback = binaryType;
+    binaryType = null;
+  }
+
+  var bufferTail = data;
+  var buffers = [];
+  var i;
+
+  while (bufferTail.length > 0) {
+    var strLen = '';
+    var isString = bufferTail[0] === 0;
+    for (i = 1; ; i++) {
+      if (bufferTail[i] === 255)  break;
+      // 310 = char length of Number.MAX_VALUE
+      if (strLen.length > 310) {
+        return callback(err, 0, 1);
+      }
+      strLen += '' + bufferTail[i];
+    }
+    bufferTail = bufferTail.slice(strLen.length + 1);
+
+    var msgLength = parseInt(strLen, 10);
+
+    var msg = bufferTail.slice(1, msgLength + 1);
+    if (isString) msg = bufferToString(msg);
+    buffers.push(msg);
+    bufferTail = bufferTail.slice(msgLength + 1);
+  }
+
+  var total = buffers.length;
+  for (i = 0; i < total; i++) {
+    var buffer = buffers[i];
+    callback(exports.decodePacket(buffer, binaryType, true), i, total);
+  }
+};
diff --git a/wrt/node_modules/engine.io-parser/lib/keys.js b/wrt/node_modules/engine.io-parser/lib/keys.js
new file mode 100644 (file)
index 0000000..947dafd
--- /dev/null
@@ -0,0 +1,19 @@
+
+/**
+ * Gets the keys for an object.
+ *
+ * @return {Array} keys
+ * @api private
+ */
+
+module.exports = Object.keys || function keys (obj){
+  var arr = [];
+  var has = Object.prototype.hasOwnProperty;
+
+  for (var i in obj) {
+    if (has.call(obj, i)) {
+      arr.push(i);
+    }
+  }
+  return arr;
+};
diff --git a/wrt/node_modules/engine.io-parser/lib/utf8.js b/wrt/node_modules/engine.io-parser/lib/utf8.js
new file mode 100644 (file)
index 0000000..83e2dd7
--- /dev/null
@@ -0,0 +1,255 @@
+/*! https://mths.be/utf8js v2.1.2 by @mathias */
+;(function(root) {
+
+       // Detect free variables `exports`
+       var freeExports = typeof exports == 'object' && exports;
+
+       // Detect free variable `module`
+       var freeModule = typeof module == 'object' && module &&
+               module.exports == freeExports && module;
+
+       // Detect free variable `global`, from Node.js or Browserified code,
+       // and use it as `root`
+       var freeGlobal = typeof global == 'object' && global;
+       if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
+               root = freeGlobal;
+       }
+
+       /*--------------------------------------------------------------------------*/
+
+       var stringFromCharCode = String.fromCharCode;
+
+       // Taken from https://mths.be/punycode
+       function ucs2decode(string) {
+               var output = [];
+               var counter = 0;
+               var length = string.length;
+               var value;
+               var extra;
+               while (counter < length) {
+                       value = string.charCodeAt(counter++);
+                       if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
+                               // high surrogate, and there is a next character
+                               extra = string.charCodeAt(counter++);
+                               if ((extra & 0xFC00) == 0xDC00) { // low surrogate
+                                       output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
+                               } else {
+                                       // unmatched surrogate; only append this code unit, in case the next
+                                       // code unit is the high surrogate of a surrogate pair
+                                       output.push(value);
+                                       counter--;
+                               }
+                       } else {
+                               output.push(value);
+                       }
+               }
+               return output;
+       }
+
+       // Taken from https://mths.be/punycode
+       function ucs2encode(array) {
+               var length = array.length;
+               var index = -1;
+               var value;
+               var output = '';
+               while (++index < length) {
+                       value = array[index];
+                       if (value > 0xFFFF) {
+                               value -= 0x10000;
+                               output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
+                               value = 0xDC00 | value & 0x3FF;
+                       }
+                       output += stringFromCharCode(value);
+               }
+               return output;
+       }
+
+       function checkScalarValue(codePoint, strict) {
+               if (codePoint >= 0xD800 && codePoint <= 0xDFFF) {
+                       if (strict) {
+                               throw Error(
+                                       'Lone surrogate U+' + codePoint.toString(16).toUpperCase() +
+                                       ' is not a scalar value'
+                               );
+                       }
+                       return false;
+               }
+               return true;
+       }
+       /*--------------------------------------------------------------------------*/
+
+       function createByte(codePoint, shift) {
+               return stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80);
+       }
+
+       function encodeCodePoint(codePoint, strict) {
+               if ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence
+                       return stringFromCharCode(codePoint);
+               }
+               var symbol = '';
+               if ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence
+                       symbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0);
+               }
+               else if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence
+                       if (!checkScalarValue(codePoint, strict)) {
+                               codePoint = 0xFFFD;
+                       }
+                       symbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0);
+                       symbol += createByte(codePoint, 6);
+               }
+               else if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence
+                       symbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0);
+                       symbol += createByte(codePoint, 12);
+                       symbol += createByte(codePoint, 6);
+               }
+               symbol += stringFromCharCode((codePoint & 0x3F) | 0x80);
+               return symbol;
+       }
+
+       function utf8encode(string, opts) {
+               opts = opts || {};
+               var strict = false !== opts.strict;
+
+               var codePoints = ucs2decode(string);
+               var length = codePoints.length;
+               var index = -1;
+               var codePoint;
+               var byteString = '';
+               while (++index < length) {
+                       codePoint = codePoints[index];
+                       byteString += encodeCodePoint(codePoint, strict);
+               }
+               return byteString;
+       }
+
+       /*--------------------------------------------------------------------------*/
+
+       function readContinuationByte() {
+               if (byteIndex >= byteCount) {
+                       throw Error('Invalid byte index');
+               }
+
+               var continuationByte = byteArray[byteIndex] & 0xFF;
+               byteIndex++;
+
+               if ((continuationByte & 0xC0) == 0x80) {
+                       return continuationByte & 0x3F;
+               }
+
+               // If we end up here, it’s not a continuation byte
+               throw Error('Invalid continuation byte');
+       }
+
+       function decodeSymbol(strict) {
+               var byte1;
+               var byte2;
+               var byte3;
+               var byte4;
+               var codePoint;
+
+               if (byteIndex > byteCount) {
+                       throw Error('Invalid byte index');
+               }
+
+               if (byteIndex == byteCount) {
+                       return false;
+               }
+
+               // Read first byte
+               byte1 = byteArray[byteIndex] & 0xFF;
+               byteIndex++;
+
+               // 1-byte sequence (no continuation bytes)
+               if ((byte1 & 0x80) == 0) {
+                       return byte1;
+               }
+
+               // 2-byte sequence
+               if ((byte1 & 0xE0) == 0xC0) {
+                       byte2 = readContinuationByte();
+                       codePoint = ((byte1 & 0x1F) << 6) | byte2;
+                       if (codePoint >= 0x80) {
+                               return codePoint;
+                       } else {
+                               throw Error('Invalid continuation byte');
+                       }
+               }
+
+               // 3-byte sequence (may include unpaired surrogates)
+               if ((byte1 & 0xF0) == 0xE0) {
+                       byte2 = readContinuationByte();
+                       byte3 = readContinuationByte();
+                       codePoint = ((byte1 & 0x0F) << 12) | (byte2 << 6) | byte3;
+                       if (codePoint >= 0x0800) {
+                               return checkScalarValue(codePoint, strict) ? codePoint : 0xFFFD;
+                       } else {
+                               throw Error('Invalid continuation byte');
+                       }
+               }
+
+               // 4-byte sequence
+               if ((byte1 & 0xF8) == 0xF0) {
+                       byte2 = readContinuationByte();
+                       byte3 = readContinuationByte();
+                       byte4 = readContinuationByte();
+                       codePoint = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0C) |
+                               (byte3 << 0x06) | byte4;
+                       if (codePoint >= 0x010000 && codePoint <= 0x10FFFF) {
+                               return codePoint;
+                       }
+               }
+
+               throw Error('Invalid UTF-8 detected');
+       }
+
+       var byteArray;
+       var byteCount;
+       var byteIndex;
+       function utf8decode(byteString, opts) {
+               opts = opts || {};
+               var strict = false !== opts.strict;
+
+               byteArray = ucs2decode(byteString);
+               byteCount = byteArray.length;
+               byteIndex = 0;
+               var codePoints = [];
+               var tmp;
+               while ((tmp = decodeSymbol(strict)) !== false) {
+                       codePoints.push(tmp);
+               }
+               return ucs2encode(codePoints);
+       }
+
+       /*--------------------------------------------------------------------------*/
+
+       var utf8 = {
+               'version': '2.1.2',
+               'encode': utf8encode,
+               'decode': utf8decode
+       };
+
+       // Some AMD build optimizers, like r.js, check for specific condition patterns
+       // like the following:
+       if (
+               typeof define == 'function' &&
+               typeof define.amd == 'object' &&
+               define.amd
+       ) {
+               define(function() {
+                       return utf8;
+               });
+       }       else if (freeExports && !freeExports.nodeType) {
+               if (freeModule) { // in Node.js or RingoJS v0.8.0+
+                       freeModule.exports = utf8;
+               } else { // in Narwhal or RingoJS v0.7.0-
+                       var object = {};
+                       var hasOwnProperty = object.hasOwnProperty;
+                       for (var key in utf8) {
+                               hasOwnProperty.call(utf8, key) && (freeExports[key] = utf8[key]);
+                       }
+               }
+       } else { // in Rhino or a web browser
+               root.utf8 = utf8;
+       }
+
+}(this));
diff --git a/wrt/node_modules/engine.io-parser/package.json b/wrt/node_modules/engine.io-parser/package.json
new file mode 100644 (file)
index 0000000..c28e885
--- /dev/null
@@ -0,0 +1,101 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "engine.io-parser@~2.1.0",
+        "scope": null,
+        "escapedName": "engine.io-parser",
+        "name": "engine.io-parser",
+        "rawSpec": "~2.1.0",
+        "spec": ">=2.1.0 <2.2.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io"
+    ]
+  ],
+  "_from": "engine.io-parser@>=2.1.0 <2.2.0",
+  "_id": "engine.io-parser@2.1.1",
+  "_inCache": true,
+  "_location": "/engine.io-parser",
+  "_nodeVersion": "6.9.4",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/engine.io-parser-2.1.1.tgz_1493327149955_0.6413915157318115"
+  },
+  "_npmUser": {
+    "name": "darrachequesne",
+    "email": "damien.arrachequesne@gmail.com"
+  },
+  "_npmVersion": "3.10.10",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "engine.io-parser@~2.1.0",
+    "scope": null,
+    "escapedName": "engine.io-parser",
+    "name": "engine.io-parser",
+    "rawSpec": "~2.1.0",
+    "spec": ">=2.1.0 <2.2.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/engine.io",
+    "/engine.io-client"
+  ],
+  "_resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.1.1.tgz",
+  "_shasum": "e0fb3f0e0462f7f58bb77c1a52e9f5a7e26e4668",
+  "_shrinkwrap": null,
+  "_spec": "engine.io-parser@~2.1.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io",
+  "browser": "./lib/browser.js",
+  "bugs": {
+    "url": "https://github.com/socketio/engine.io-parser/issues"
+  },
+  "dependencies": {
+    "after": "0.8.2",
+    "arraybuffer.slice": "0.0.6",
+    "base64-arraybuffer": "0.1.5",
+    "blob": "0.0.4",
+    "has-binary2": "~1.0.2"
+  },
+  "description": "Parser for the client for the realtime Engine",
+  "devDependencies": {
+    "expect.js": "0.3.1",
+    "mocha": "3.2.0",
+    "socket.io-browsers": "^1.0.0",
+    "zuul": "3.11.1",
+    "zuul-ngrok": "4.0.0"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "e0fb3f0e0462f7f58bb77c1a52e9f5a7e26e4668",
+    "tarball": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.1.1.tgz"
+  },
+  "files": [
+    "index.js",
+    "lib/"
+  ],
+  "gitHead": "e2422c300e96766c951fdf2432e992c29fc12f1a",
+  "homepage": "https://github.com/socketio/engine.io-parser",
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "darrachequesne",
+      "email": "damien.arrachequesne@gmail.com"
+    },
+    {
+      "name": "rauchg",
+      "email": "rauchg@gmail.com"
+    }
+  ],
+  "name": "engine.io-parser",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+ssh://git@github.com/socketio/engine.io-parser.git"
+  },
+  "scripts": {
+    "test": "make test"
+  },
+  "version": "2.1.1"
+}
diff --git a/wrt/node_modules/engine.io/LICENSE b/wrt/node_modules/engine.io/LICENSE
new file mode 100644 (file)
index 0000000..6494c3c
--- /dev/null
@@ -0,0 +1,19 @@
+(The MIT License)
+
+Copyright (c) 2014 Guillermo Rauch <guillermo@learnboost.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software 
+and associated documentation files (the 'Software'), to deal in the Software without restriction, 
+including without limitation the rights to use, copy, modify, merge, publish, distribute, 
+sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or 
+substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 
+BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/wrt/node_modules/engine.io/README.md b/wrt/node_modules/engine.io/README.md
new file mode 100644 (file)
index 0000000..1f5226d
--- /dev/null
@@ -0,0 +1,539 @@
+
+# Engine.IO: the realtime engine
+
+[![Build Status](https://travis-ci.org/socketio/engine.io.svg?branch=master)](http://travis-ci.org/socketio/engine.io)
+[![NPM version](https://badge.fury.io/js/engine.io.svg)](http://badge.fury.io/js/engine.io)
+
+`Engine.IO` is the implementation of transport-based
+cross-browser/cross-device bi-directional communication layer for
+[Socket.IO](http://github.com/socketio/socket.io).
+
+## How to use
+
+### Server
+
+#### (A) Listening on a port
+
+```js
+var engine = require('engine.io');
+var server = engine.listen(80);
+
+server.on('connection', function(socket){
+  socket.send('utf 8 string');
+  socket.send(new Buffer([0, 1, 2, 3, 4, 5])); // binary data
+});
+```
+
+#### (B) Intercepting requests for a http.Server
+
+```js
+var engine = require('engine.io');
+var http = require('http').createServer().listen(3000);
+var server = engine.attach(http);
+
+server.on('connection', function (socket) {
+  socket.on('message', function(data){ });
+  socket.on('close', function(){ });
+});
+```
+
+#### (C) Passing in requests
+
+```js
+var engine = require('engine.io');
+var server = new engine.Server();
+
+server.on('connection', function(socket){
+  socket.send('hi');
+});
+
+// …
+httpServer.on('upgrade', function(req, socket, head){
+  server.handleUpgrade(req, socket, head);
+});
+httpServer.on('request', function(req, res){
+  server.handleRequest(req, res);
+});
+```
+
+### Client
+
+```html
+<script src="/path/to/engine.io.js"></script>
+<script>
+  var socket = new eio.Socket('ws://localhost/');
+  socket.on('open', function(){
+    socket.on('message', function(data){});
+    socket.on('close', function(){});
+  });
+</script>
+```
+
+For more information on the client refer to the
+[engine-client](http://github.com/learnboost/engine.io-client) repository.
+
+## What features does it have?
+
+- **Maximum reliability**. Connections are established even in the presence of:
+  - proxies and load balancers.
+  - personal firewall and antivirus software.
+  - for more information refer to **Goals** and **Architecture** sections
+- **Minimal client size** aided by:
+  - lazy loading of flash transports.
+  - lack of redundant transports.
+- **Scalable**
+  - load balancer friendly
+- **Future proof**
+- **100% Node.JS core style**
+  - No API sugar (left for higher level projects)
+  - Written in readable vanilla JavaScript
+
+## API
+
+### Server
+
+<hr><br>
+
+#### Top-level
+
+These are exposed by `require('engine.io')`:
+
+##### Events
+
+- `flush`
+    - Called when a socket buffer is being flushed.
+    - **Arguments**
+      - `Socket`: socket being flushed
+      - `Array`: write buffer
+- `drain`
+    - Called when a socket buffer is drained
+    - **Arguments**
+      - `Socket`: socket being flushed
+
+##### Properties
+
+- `protocol` _(Number)_: protocol revision number
+- `Server`: Server class constructor
+- `Socket`: Socket class constructor
+- `Transport` _(Function)_: transport constructor
+- `transports` _(Object)_: map of available transports
+
+##### Methods
+
+- `()`
+    - Returns a new `Server` instance. If the first argument is an `http.Server` then the
+      new `Server` instance will be attached to it. Otherwise, the arguments are passed
+      directly to the `Server` constructor.
+    - **Parameters**
+      - `http.Server`: optional, server to attach to.
+      - `Object`: optional, options object (see `Server#constructor` api docs below)
+
+  The following are identical ways to instantiate a server and then attach it.
+  ```js
+  var httpServer; // previously created with `http.createServer();` from node.js api.
+
+  // create a server first, and then attach
+  var eioServer = require('engine.io').Server();
+  eioServer.attach(httpServer);
+
+  // or call the module as a function to get `Server`
+  var eioServer = require('engine.io')();
+  eioServer.attach(httpServer);
+
+  // immediately attach
+  var eioServer = require('engine.io')(httpServer);
+  ```
+
+- `listen`
+    - Creates an `http.Server` which listens on the given port and attaches WS
+      to it. It returns `501 Not Implemented` for regular http requests.
+    - **Parameters**
+      - `Number`: port to listen on.
+      - `Object`: optional, options object
+      - `Function`: callback for `listen`.
+    - **Options**
+      - All options from `Server.attach` method, documented below.
+      - **Additionally** See Server `constructor` below for options you can pass for creating the new Server
+    - **Returns** `Server`
+- `attach`
+    - Captures `upgrade` requests for a `http.Server`. In other words, makes
+      a regular http.Server WebSocket-compatible.
+    - **Parameters**
+      - `http.Server`: server to attach to.
+      - `Object`: optional, options object
+    - **Options**
+      - All options from `Server.attach` method, documented below.
+      - **Additionally** See Server `constructor` below for options you can pass for creating the new Server
+    - **Returns** `Server` a new Server instance.
+
+<hr><br>
+
+#### Server
+
+The main server/manager. _Inherits from EventEmitter_.
+
+##### Events
+
+- `connection`
+    - Fired when a new connection is established.
+    - **Arguments**
+      - `Socket`: a Socket object
+
+##### Properties
+
+**Important**: if you plan to use Engine.IO in a scalable way, please
+keep in mind the properties below will only reflect the clients connected
+to a single process.
+
+- `clients` _(Object)_: hash of connected clients by id.
+- `clientsCount` _(Number)_: number of connected clients.
+
+##### Methods
+
+- **constructor**
+    - Initializes the server
+    - **Parameters**
+      - `Object`: optional, options object
+    - **Options**
+      - `pingTimeout` (`Number`): how many ms without a pong packet to
+        consider the connection closed (`60000`)
+      - `pingInterval` (`Number`): how many ms before sending a new ping
+        packet (`25000`)
+      - `upgradeTimeout` (`Number`): how many ms before an uncompleted transport upgrade is cancelled (`10000`)
+      - `maxHttpBufferSize` (`Number`): how many bytes or characters a message
+        can be, before closing the session (to avoid DoS). Default
+        value is `10E7`.
+      - `allowRequest` (`Function`): A function that receives a given handshake
+        or upgrade request as its first parameter, and can decide whether to
+        continue or not. The second argument is a function that needs to be
+        called with the decided information: `fn(err, success)`, where
+        `success` is a boolean value where false means that the request is
+        rejected, and err is an error code.
+      - `transports` (`<Array> String`): transports to allow connections
+        to (`['polling', 'websocket']`)
+      - `allowUpgrades` (`Boolean`): whether to allow transport upgrades
+        (`true`)
+      - `perMessageDeflate` (`Object|Boolean`): parameters of the WebSocket permessage-deflate extension
+        (see [ws module](https://github.com/einaros/ws) api docs). Set to `false` to disable. (`true`)
+        - `threshold` (`Number`): data is compressed only if the byte size is above this value (`1024`)
+      - `httpCompression` (`Object|Boolean`): parameters of the http compression for the polling transports
+        (see [zlib](http://nodejs.org/api/zlib.html#zlib_options) api docs). Set to `false` to disable. (`true`)
+        - `threshold` (`Number`): data is compressed only if the byte size is above this value (`1024`)
+      - `cookie` (`String|Boolean`): name of the HTTP cookie that
+        contains the client sid to send as part of handshake response
+        headers. Set to `false` to not send one. (`io`)
+      - `cookiePath` (`String|Boolean`): path of the above `cookie`
+        option. If false, no path will be sent, which means browsers will only send the cookie on the engine.io attached path (`/engine.io`).
+        Set false to not save io cookie on all requests. (`/`)
+      - `cookieHttpOnly` (`Boolean`): If `true` HttpOnly io cookie cannot be accessed by client-side APIs, such as JavaScript. (`true`) _This option has no effect if `cookie` or `cookiePath` is set to `false`._
+      - `wsEngine` (`String`): what WebSocket server implementation to use. Specified module must conform to the `ws` interface (see [ws module api docs](https://github.com/websockets/ws/blob/master/doc/ws.md)). Default value is `uws` (see [µWebSockets](https://github.com/uWebSockets/uWebSockets)).
+      - `initialPacket` (`Object`): an optional packet which will be concatenated to the handshake packet emitted by Engine.IO.
+- `close`
+    - Closes all clients
+    - **Returns** `Server` for chaining
+- `handleRequest`
+    - Called internally when a `Engine` request is intercepted.
+    - **Parameters**
+      - `http.IncomingMessage`: a node request object
+      - `http.ServerResponse`: a node response object
+    - **Returns** `Server` for chaining
+- `handleUpgrade`
+    - Called internally when a `Engine` ws upgrade is intercepted.
+    - **Parameters** (same as `upgrade` event)
+      - `http.IncomingMessage`: a node request object
+      - `net.Stream`: TCP socket for the request
+      - `Buffer`: legacy tail bytes
+    - **Returns** `Server` for chaining
+- `attach`
+    - Attach this Server instance to an `http.Server`
+    - Captures `upgrade` requests for a `http.Server`. In other words, makes
+      a regular http.Server WebSocket-compatible.
+    - **Parameters**
+      - `http.Server`: server to attach to.
+      - `Object`: optional, options object
+    - **Options**
+      - `path` (`String`): name of the path to capture (`/engine.io`).
+      - `destroyUpgrade` (`Boolean`): destroy unhandled upgrade requests (`true`)
+      - `destroyUpgradeTimeout` (`Number`): milliseconds after which unhandled requests are ended (`1000`)
+      - `handlePreflightRequest` (`Boolean|Function`): whether to let engine.io handle the OPTIONS requests. You can also pass a custom function to handle the requests (`true`)
+- `generateId`
+    - Generate a socket id.
+    - Overwrite this method to generate your custom socket id.
+    - **Parameters**
+      - `http.IncomingMessage`: a node request object
+  - **Returns** A socket id for connected client.
+
+<hr><br>
+
+#### Socket
+
+A representation of a client. _Inherits from EventEmitter_.
+
+##### Events
+
+- `close`
+    - Fired when the client is disconnected.
+    - **Arguments**
+      - `String`: reason for closing
+      - `Object`: description object (optional)
+- `message`
+    - Fired when the client sends a message.
+    - **Arguments**
+      - `String` or `Buffer`: Unicode string or Buffer with binary contents
+- `error`
+    - Fired when an error occurs.
+    - **Arguments**
+      - `Error`: error object
+- `flush`
+    - Called when the write buffer is being flushed.
+    - **Arguments**
+      - `Array`: write buffer
+- `drain`
+    - Called when the write buffer is drained
+- `packet`
+    - Called when a socket received a packet (`message`, `ping`)
+    - **Arguments**
+      - `type`: packet type
+      - `data`: packet data (if type is message)
+- `packetCreate`
+    - Called before a socket sends a packet (`message`, `pong`)
+    - **Arguments**
+      - `type`: packet type
+      - `data`: packet data (if type is message)
+
+##### Properties
+
+- `id` _(String)_: unique identifier
+- `server` _(Server)_: engine parent reference
+- `request` _(http.IncomingMessage)_: request that originated the Socket
+- `upgraded` _(Boolean)_: whether the transport has been upgraded
+- `readyState` _(String)_: opening|open|closing|closed
+- `transport` _(Transport)_: transport reference
+
+##### Methods
+
+- `send`:
+    - Sends a message, performing `message = toString(arguments[0])` unless
+      sending binary data, which is sent as is.
+    - **Parameters**
+      - `String` | `Buffer` | `ArrayBuffer` | `ArrayBufferView`: a string or any object implementing `toString()`, with outgoing data, or a Buffer or ArrayBuffer with binary data. Also any ArrayBufferView can be sent as is.
+      - `Object`: optional, options object
+      - `Function`: optional, a callback executed when the message gets flushed out by the transport
+    - **Options**
+      - `compress` (`Boolean`): whether to compress sending data. This option might be ignored and forced to be `true` when using polling. (`true`)
+    - **Returns** `Socket` for chaining
+- `close`
+    - Disconnects the client
+    - **Returns** `Socket` for chaining
+
+### Client
+
+<hr><br>
+
+Exposed in the `eio` global namespace (in the browser), or by
+`require('engine.io-client')` (in Node.JS).
+
+For the client API refer to the
+[engine-client](http://github.com/learnboost/engine.io-client) repository.
+
+## Debug / logging
+
+Engine.IO is powered by [debug](http://github.com/visionmedia/debug).
+In order to see all the debug output, run your app with the environment variable
+`DEBUG` including the desired scope.
+
+To see the output from all of Engine.IO's debugging scopes you can use:
+
+```
+DEBUG=engine* node myapp
+```
+
+## Transports
+
+- `polling`: XHR / JSONP polling transport.
+- `websocket`: WebSocket transport.
+
+## Plugins
+
+- [engine.io-conflation](https://github.com/EugenDueck/engine.io-conflation): Makes **conflation and aggregation** of messages straightforward.
+
+## Support
+
+The support channels for `engine.io` are the same as `socket.io`:
+  - irc.freenode.net **#socket.io**
+  - [Google Groups](http://groups.google.com/group/socket_io)
+  - [Website](http://socket.io)
+
+## Development
+
+To contribute patches, run tests or benchmarks, make sure to clone the
+repository:
+
+```
+git clone git://github.com/LearnBoost/engine.io.git
+```
+
+Then:
+
+```
+cd engine.io
+npm install
+```
+
+## Tests
+
+Tests run with `make test`. It runs the server tests that are aided by
+the usage of `engine.io-client`.
+
+Make sure `npm install` is run first.
+
+## Goals
+
+The main goal of `Engine` is ensuring the most reliable realtime communication.
+Unlike the previous Socket.IO core, it always establishes a long-polling
+connection first, then tries to upgrade to better transports that are "tested" on
+the side.
+
+During the lifetime of the Socket.IO projects, we've found countless drawbacks
+to relying on `HTML5 WebSocket` or `Flash Socket` as the first connection
+mechanisms.
+
+Both are clearly the _right way_ of establishing a bidirectional communication,
+with HTML5 WebSocket being the way of the future. However, to answer most business
+needs, alternative traditional HTTP 1.1 mechanisms are just as good as delivering
+the same solution.
+
+WebSocket based connections have two fundamental benefits:
+
+1. **Better server performance**
+  - _A: Load balancers_<br>
+      Load balancing a long polling connection poses a serious architectural nightmare
+      since requests can come from any number of open sockets by the user agent, but
+      they all need to be routed to the process and computer that owns the `Engine`
+      connection. This negatively impacts RAM and CPU usage.
+  - _B: Network traffic_<br>
+      WebSocket is designed around the premise that each message frame has to be
+      surrounded by the least amount of data. In HTTP 1.1 transports, each message
+      frame is surrounded by HTTP headers and chunked encoding frames. If you try to
+      send the message _"Hello world"_ with xhr-polling, the message ultimately
+      becomes larger than if you were to send it with WebSocket.
+  - _C: Lightweight parser_<br>
+      As an effect of **B**, the server has to do a lot more work to parse the network
+      data and figure out the message when traditional HTTP requests are used
+      (as in long polling). This means that another advantage of WebSocket is
+      less server CPU usage.
+
+2. **Better user experience**
+
+    Due to the reasons stated in point **1**, the most important effect of being able
+    to establish a WebSocket connection is raw data transfer speed, which translates
+    in _some_ cases in better user experience.
+
+    Applications with heavy realtime interaction (such as games) will benefit greatly,
+    whereas applications like realtime chat (Gmail/Facebook), newsfeeds (Facebook) or
+    timelines (Twitter) will have negligible user experience improvements.
+
+Having said this, attempting to establish a WebSocket connection directly so far has
+proven problematic:
+
+1. **Proxies**<br>
+    Many corporate proxies block WebSocket traffic.
+
+2. **Personal firewall and antivirus software**<br>
+    As a result of our research, we've found that at least 3 personal security
+    applications block WebSocket traffic.
+
+3. **Cloud application platforms**<br>
+    Platforms like Heroku or No.de have had trouble keeping up with the fast-paced
+    nature of the evolution of the WebSocket protocol. Applications therefore end up
+    inevitably using long polling, but the seamless installation experience of
+    Socket.IO we strive for (_"require() it and it just works"_) disappears.
+
+Some of these problems have solutions. In the case of proxies and personal programs,
+however, the solutions many times involve upgrading software. Experience has shown
+that relying on client software upgrades to deliver a business solution is
+fruitless: the very existence of this project has to do with a fragmented panorama
+of user agent distribution, with clients connecting with latest versions of the most
+modern user agents (Chrome, Firefox and Safari), but others with versions as low as
+IE 5.5.
+
+From the user perspective, an unsuccessful WebSocket connection can translate in
+up to at least 10 seconds of waiting for the realtime application to begin
+exchanging data. This **perceptively** hurts user experience.
+
+To summarize, **Engine** focuses on reliability and user experience first, marginal
+potential UX improvements and increased server performance second. `Engine` is the
+result of all the lessons learned with WebSocket in the wild.
+
+## Architecture
+
+The main premise of `Engine`, and the core of its existence, is the ability to
+swap transports on the fly. A connection starts as xhr-polling, but it can
+switch to WebSocket.
+
+The central problem this poses is: how do we switch transports without losing
+messages?
+
+`Engine` only switches from polling to another transport in between polling
+cycles. Since the server closes the connection after a certain timeout when
+there's no activity, and the polling transport implementation buffers messages
+in between connections, this ensures no message loss and optimal performance.
+
+Another benefit of this design is that we workaround almost all the limitations
+of **Flash Socket**, such as slow connection times, increased file size (we can
+safely lazy load it without hurting user experience), etc.
+
+## FAQ
+
+### Can I use engine without Socket.IO ?
+
+Absolutely. Although the recommended framework for building realtime applications
+is Socket.IO, since it provides fundamental features for real-world applications
+such as multiplexing, reconnection support, etc.
+
+`Engine` is to Socket.IO what Connect is to Express. An essential piece for building
+realtime frameworks, but something you _probably_ won't be using for building
+actual applications.
+
+### Does the server serve the client?
+
+No. The main reason is that `Engine` is meant to be bundled with frameworks.
+Socket.IO includes `Engine`, therefore serving two clients is not necessary. If
+you use Socket.IO, including
+
+```html
+<script src="/socket.io/socket.io.js">
+```
+
+has you covered.
+
+### Can I implement `Engine` in other languages?
+
+Absolutely. The [engine.io-protocol](https://github.com/LearnBoost/engine.io-protocol)
+repository contains the most up to date description of the specification
+at all times, and the parser implementation in JavaScript.
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2014 Guillermo Rauch &lt;guillermo@learnboost.com&gt;
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/engine.io/lib/engine.io.js b/wrt/node_modules/engine.io/lib/engine.io.js
new file mode 100644 (file)
index 0000000..2a211c2
--- /dev/null
@@ -0,0 +1,126 @@
+/**
+ * Module dependencies.
+ */
+
+var http = require('http');
+
+/**
+ * Invoking the library as a function delegates to attach if the first argument
+ * is an `http.Server`.
+ *
+ * If there are no arguments or the first argument is an options object, then
+ * a new Server instance is returned.
+ *
+ * @param {http.Server} server (if specified, will be attached to by the new Server instance)
+ * @param {Object} options
+ * @return {Server} engine server
+ * @api public
+ */
+
+exports = module.exports = function () {
+  // backwards compatible use as `.attach`
+  // if first argument is an http server
+  if (arguments.length && arguments[0] instanceof http.Server) {
+    return attach.apply(this, arguments);
+  }
+
+  // if first argument is not an http server, then just make a regular eio server
+  return exports.Server.apply(null, arguments);
+};
+
+/**
+ * Protocol revision number.
+ *
+ * @api public
+ */
+
+exports.protocol = 1;
+
+/**
+ * Expose Server constructor.
+ *
+ * @api public
+ */
+
+exports.Server = require('./server');
+
+/**
+ * Expose Socket constructor.
+ *
+ * @api public
+ */
+
+exports.Socket = require('./socket');
+
+/**
+ * Expose Transport constructor.
+ *
+ * @api public
+ */
+
+exports.Transport = require('./transport');
+
+/**
+ * Expose mutable list of available transports.
+ *
+ * @api public
+ */
+
+exports.transports = require('./transports');
+
+/**
+ * Exports parser.
+ *
+ * @api public
+ */
+
+exports.parser = require('engine.io-parser');
+
+/**
+ * Creates an http.Server exclusively used for WS upgrades.
+ *
+ * @param {Number} port
+ * @param {Function} callback
+ * @param {Object} options
+ * @return {Server} websocket.io server
+ * @api public
+ */
+
+exports.listen = listen;
+
+function listen (port, options, fn) {
+  if ('function' === typeof options) {
+    fn = options;
+    options = {};
+  }
+
+  var server = http.createServer(function (req, res) {
+    res.writeHead(501);
+    res.end('Not Implemented');
+  });
+
+  // create engine server
+  var engine = exports.attach(server, options);
+  engine.httpServer = server;
+
+  server.listen(port, fn);
+
+  return engine;
+}
+
+/**
+ * Captures upgrade requests for a http.Server.
+ *
+ * @param {http.Server} server
+ * @param {Object} options
+ * @return {Server} engine server
+ * @api public
+ */
+
+exports.attach = attach;
+
+function attach (server, options) {
+  var engine = new exports.Server(options);
+  engine.attach(server, options);
+  return engine;
+}
diff --git a/wrt/node_modules/engine.io/lib/server.js b/wrt/node_modules/engine.io/lib/server.js
new file mode 100644 (file)
index 0000000..d52120a
--- /dev/null
@@ -0,0 +1,579 @@
+
+/**
+ * Module dependencies.
+ */
+
+var qs = require('querystring');
+var parse = require('url').parse;
+var base64id = require('base64id');
+var transports = require('./transports');
+var EventEmitter = require('events').EventEmitter;
+var Socket = require('./socket');
+var util = require('util');
+var debug = require('debug')('engine');
+var cookieMod = require('cookie');
+
+/**
+ * Module exports.
+ */
+
+module.exports = Server;
+
+/**
+ * Server constructor.
+ *
+ * @param {Object} options
+ * @api public
+ */
+
+function Server (opts) {
+  if (!(this instanceof Server)) {
+    return new Server(opts);
+  }
+
+  this.clients = {};
+  this.clientsCount = 0;
+
+  opts = opts || {};
+
+  this.wsEngine = opts.wsEngine || process.env.EIO_WS_ENGINE || 'uws';
+  this.pingTimeout = opts.pingTimeout || 60000;
+  this.pingInterval = opts.pingInterval || 25000;
+  this.upgradeTimeout = opts.upgradeTimeout || 10000;
+  this.maxHttpBufferSize = opts.maxHttpBufferSize || 10E7;
+  this.transports = opts.transports || Object.keys(transports);
+  this.allowUpgrades = false !== opts.allowUpgrades;
+  this.allowRequest = opts.allowRequest;
+  this.cookie = false !== opts.cookie ? (opts.cookie || 'io') : false;
+  this.cookiePath = false !== opts.cookiePath ? (opts.cookiePath || '/') : false;
+  this.cookieHttpOnly = false !== opts.cookieHttpOnly;
+  this.perMessageDeflate = false !== opts.perMessageDeflate ? (opts.perMessageDeflate || true) : false;
+  this.httpCompression = false !== opts.httpCompression ? (opts.httpCompression || {}) : false;
+  this.initialPacket = opts.initialPacket;
+
+  var self = this;
+
+  // initialize compression options
+  ['perMessageDeflate', 'httpCompression'].forEach(function (type) {
+    var compression = self[type];
+    if (true === compression) self[type] = compression = {};
+    if (compression && null == compression.threshold) {
+      compression.threshold = 1024;
+    }
+  });
+
+  this.init();
+}
+
+/**
+ * Protocol errors mappings.
+ */
+
+Server.errors = {
+  UNKNOWN_TRANSPORT: 0,
+  UNKNOWN_SID: 1,
+  BAD_HANDSHAKE_METHOD: 2,
+  BAD_REQUEST: 3,
+  FORBIDDEN: 4
+};
+
+Server.errorMessages = {
+  0: 'Transport unknown',
+  1: 'Session ID unknown',
+  2: 'Bad handshake method',
+  3: 'Bad request',
+  4: 'Forbidden'
+};
+
+/**
+ * Inherits from EventEmitter.
+ */
+
+util.inherits(Server, EventEmitter);
+
+/**
+ * Initialize websocket server
+ *
+ * @api private
+ */
+
+Server.prototype.init = function () {
+  if (!~this.transports.indexOf('websocket')) return;
+
+  if (this.ws) this.ws.close();
+
+  var wsModule;
+  try {
+    switch (this.wsEngine) {
+      case 'uws': wsModule = require('uws'); break;
+      case 'ws': wsModule = require('ws'); break;
+      default: throw new Error('unknown wsEngine');
+    }
+  } catch (ex) {
+    this.wsEngine = 'ws';
+    // keep require('ws') as separate expression for packers (browserify, etc)
+    wsModule = require('ws');
+  }
+  this.ws = new wsModule.Server({
+    noServer: true,
+    clientTracking: false,
+    perMessageDeflate: this.perMessageDeflate,
+    maxPayload: this.maxHttpBufferSize
+  });
+};
+
+/**
+ * Returns a list of available transports for upgrade given a certain transport.
+ *
+ * @return {Array}
+ * @api public
+ */
+
+Server.prototype.upgrades = function (transport) {
+  if (!this.allowUpgrades) return [];
+  return transports[transport].upgradesTo || [];
+};
+
+/**
+ * Verifies a request.
+ *
+ * @param {http.IncomingMessage}
+ * @return {Boolean} whether the request is valid
+ * @api private
+ */
+
+Server.prototype.verify = function (req, upgrade, fn) {
+  // transport check
+  var transport = req._query.transport;
+  if (!~this.transports.indexOf(transport)) {
+    debug('unknown transport "%s"', transport);
+    return fn(Server.errors.UNKNOWN_TRANSPORT, false);
+  }
+
+  // 'Origin' header check
+  var isOriginInvalid = checkInvalidHeaderChar(req.headers.origin);
+  if (isOriginInvalid) {
+    req.headers.origin = null;
+    return fn(Server.errors.BAD_REQUEST, false);
+  }
+
+  // sid check
+  var sid = req._query.sid;
+  if (sid) {
+    if (!this.clients.hasOwnProperty(sid)) {
+      return fn(Server.errors.UNKNOWN_SID, false);
+    }
+    if (!upgrade && this.clients[sid].transport.name !== transport) {
+      debug('bad request: unexpected transport without upgrade');
+      return fn(Server.errors.BAD_REQUEST, false);
+    }
+  } else {
+    // handshake is GET only
+    if ('GET' !== req.method) return fn(Server.errors.BAD_HANDSHAKE_METHOD, false);
+    if (!this.allowRequest) return fn(null, true);
+    return this.allowRequest(req, fn);
+  }
+
+  fn(null, true);
+};
+
+/**
+ * Prepares a request by processing the query string.
+ *
+ * @api private
+ */
+
+Server.prototype.prepare = function (req) {
+  // try to leverage pre-existing `req._query` (e.g: from connect)
+  if (!req._query) {
+    req._query = ~req.url.indexOf('?') ? qs.parse(parse(req.url).query) : {};
+  }
+};
+
+/**
+ * Closes all clients.
+ *
+ * @api public
+ */
+
+Server.prototype.close = function () {
+  debug('closing all open clients');
+  for (var i in this.clients) {
+    if (this.clients.hasOwnProperty(i)) {
+      this.clients[i].close(true);
+    }
+  }
+  if (this.ws) {
+    debug('closing webSocketServer');
+    this.ws.close();
+    // don't delete this.ws because it can be used again if the http server starts listening again
+  }
+  return this;
+};
+
+/**
+ * Handles an Engine.IO HTTP request.
+ *
+ * @param {http.IncomingMessage} request
+ * @param {http.ServerResponse|http.OutgoingMessage} response
+ * @api public
+ */
+
+Server.prototype.handleRequest = function (req, res) {
+  debug('handling "%s" http request "%s"', req.method, req.url);
+  this.prepare(req);
+  req.res = res;
+
+  var self = this;
+  this.verify(req, false, function (err, success) {
+    if (!success) {
+      sendErrorMessage(req, res, err);
+      return;
+    }
+
+    if (req._query.sid) {
+      debug('setting new request for existing client');
+      self.clients[req._query.sid].transport.onRequest(req);
+    } else {
+      self.handshake(req._query.transport, req);
+    }
+  });
+};
+
+/**
+ * Sends an Engine.IO Error Message
+ *
+ * @param {http.ServerResponse} response
+ * @param {code} error code
+ * @api private
+ */
+
+function sendErrorMessage (req, res, code) {
+  var headers = { 'Content-Type': 'application/json' };
+
+  var isForbidden = !Server.errorMessages.hasOwnProperty(code);
+  if (isForbidden) {
+    res.writeHead(403, headers);
+    res.end(JSON.stringify({
+      code: Server.errors.FORBIDDEN,
+      message: code || Server.errorMessages[Server.errors.FORBIDDEN]
+    }));
+    return;
+  }
+  if (req.headers.origin) {
+    headers['Access-Control-Allow-Credentials'] = 'true';
+    headers['Access-Control-Allow-Origin'] = req.headers.origin;
+  } else {
+    headers['Access-Control-Allow-Origin'] = '*';
+  }
+  res.writeHead(400, headers);
+  res.end(JSON.stringify({
+    code: code,
+    message: Server.errorMessages[code]
+  }));
+}
+
+/**
+ * generate a socket id.
+ * Overwrite this method to generate your custom socket id
+ *
+ * @param {Object} request object
+ * @api public
+ */
+
+Server.prototype.generateId = function (req) {
+  return base64id.generateId();
+};
+
+/**
+ * Handshakes a new client.
+ *
+ * @param {String} transport name
+ * @param {Object} request object
+ * @api private
+ */
+
+Server.prototype.handshake = function (transportName, req) {
+  var id = this.generateId(req);
+
+  debug('handshaking client "%s"', id);
+
+  try {
+    var transport = new transports[transportName](req);
+    if ('polling' === transportName) {
+      transport.maxHttpBufferSize = this.maxHttpBufferSize;
+      transport.httpCompression = this.httpCompression;
+    } else if ('websocket' === transportName) {
+      transport.perMessageDeflate = this.perMessageDeflate;
+    }
+
+    if (req._query && req._query.b64) {
+      transport.supportsBinary = false;
+    } else {
+      transport.supportsBinary = true;
+    }
+  } catch (e) {
+    sendErrorMessage(req, req.res, Server.errors.BAD_REQUEST);
+    return;
+  }
+  var socket = new Socket(id, this, transport, req);
+  var self = this;
+
+  if (false !== this.cookie) {
+    transport.on('headers', function (headers) {
+      headers['Set-Cookie'] = cookieMod.serialize(self.cookie, id,
+        {
+          path: self.cookiePath,
+          httpOnly: self.cookiePath ? self.cookieHttpOnly : false
+        });
+    });
+  }
+
+  transport.onRequest(req);
+
+  this.clients[id] = socket;
+  this.clientsCount++;
+
+  socket.once('close', function () {
+    delete self.clients[id];
+    self.clientsCount--;
+  });
+
+  this.emit('connection', socket);
+};
+
+/**
+ * Handles an Engine.IO HTTP Upgrade.
+ *
+ * @api public
+ */
+
+Server.prototype.handleUpgrade = function (req, socket, upgradeHead) {
+  this.prepare(req);
+
+  var self = this;
+  this.verify(req, true, function (err, success) {
+    if (!success) {
+      abortConnection(socket, err);
+      return;
+    }
+
+    var head = new Buffer(upgradeHead.length); // eslint-disable-line node/no-deprecated-api
+    upgradeHead.copy(head);
+    upgradeHead = null;
+
+    // delegate to ws
+    self.ws.handleUpgrade(req, socket, head, function (conn) {
+      self.onWebSocket(req, conn);
+    });
+  });
+};
+
+/**
+ * Called upon a ws.io connection.
+ *
+ * @param {ws.Socket} websocket
+ * @api private
+ */
+
+Server.prototype.onWebSocket = function (req, socket) {
+  socket.on('error', onUpgradeError);
+
+  if (!transports[req._query.transport].prototype.handlesUpgrades) {
+    debug('transport doesnt handle upgraded requests');
+    socket.close();
+    return;
+  }
+
+  // get client id
+  var id = req._query.sid;
+
+  // keep a reference to the ws.Socket
+  req.websocket = socket;
+
+  if (id) {
+    var client = this.clients[id];
+    if (!client) {
+      debug('upgrade attempt for closed client');
+      socket.close();
+    } else if (client.upgrading) {
+      debug('transport has already been trying to upgrade');
+      socket.close();
+    } else if (client.upgraded) {
+      debug('transport had already been upgraded');
+      socket.close();
+    } else {
+      debug('upgrading existing transport');
+
+      // transport error handling takes over
+      socket.removeListener('error', onUpgradeError);
+
+      var transport = new transports[req._query.transport](req);
+      if (req._query && req._query.b64) {
+        transport.supportsBinary = false;
+      } else {
+        transport.supportsBinary = true;
+      }
+      transport.perMessageDeflate = this.perMessageDeflate;
+      client.maybeUpgrade(transport);
+    }
+  } else {
+    // transport error handling takes over
+    socket.removeListener('error', onUpgradeError);
+
+    this.handshake(req._query.transport, req);
+  }
+
+  function onUpgradeError () {
+    debug('websocket error before upgrade');
+    // socket.close() not needed
+  }
+};
+
+/**
+ * Captures upgrade requests for a http.Server.
+ *
+ * @param {http.Server} server
+ * @param {Object} options
+ * @api public
+ */
+
+Server.prototype.attach = function (server, options) {
+  var self = this;
+  options = options || {};
+  var path = (options.path || '/engine.io').replace(/\/$/, '');
+
+  var destroyUpgradeTimeout = options.destroyUpgradeTimeout || 1000;
+
+  // normalize path
+  path += '/';
+
+  function check (req) {
+    if ('OPTIONS' === req.method && false === options.handlePreflightRequest) {
+      return false;
+    }
+    return path === req.url.substr(0, path.length);
+  }
+
+  // cache and clean up listeners
+  var listeners = server.listeners('request').slice(0);
+  server.removeAllListeners('request');
+  server.on('close', self.close.bind(self));
+  server.on('listening', self.init.bind(self));
+
+  // add request handler
+  server.on('request', function (req, res) {
+    if (check(req)) {
+      debug('intercepting request for path "%s"', path);
+      if ('OPTIONS' === req.method && 'function' === typeof options.handlePreflightRequest) {
+        options.handlePreflightRequest.call(server, req, res);
+      } else {
+        self.handleRequest(req, res);
+      }
+    } else {
+      for (var i = 0, l = listeners.length; i < l; i++) {
+        listeners[i].call(server, req, res);
+      }
+    }
+  });
+
+  if (~self.transports.indexOf('websocket')) {
+    server.on('upgrade', function (req, socket, head) {
+      if (check(req)) {
+        self.handleUpgrade(req, socket, head);
+      } else if (false !== options.destroyUpgrade) {
+        // default node behavior is to disconnect when no handlers
+        // but by adding a handler, we prevent that
+        // and if no eio thing handles the upgrade
+        // then the socket needs to die!
+        setTimeout(function () {
+          if (socket.writable && socket.bytesWritten <= 0) {
+            return socket.end();
+          }
+        }, destroyUpgradeTimeout);
+      }
+    });
+  }
+};
+
+/**
+ * Closes the connection
+ *
+ * @param {net.Socket} socket
+ * @param {code} error code
+ * @api private
+ */
+
+function abortConnection (socket, code) {
+  if (socket.writable) {
+    var message = Server.errorMessages.hasOwnProperty(code) ? Server.errorMessages[code] : (code || '');
+    var length = Buffer.byteLength(message);
+    socket.write(
+      'HTTP/1.1 400 Bad Request\r\n' +
+      'Connection: close\r\n' +
+      'Content-type: text/html\r\n' +
+      'Content-Length: ' + length + '\r\n' +
+      '\r\n' +
+      message
+    );
+  }
+  socket.destroy();
+}
+
+/* eslint-disable */
+
+/**
+ * From https://github.com/nodejs/node/blob/v8.4.0/lib/_http_common.js#L303-L354
+ *
+ * True if val contains an invalid field-vchar
+ *  field-value    = *( field-content / obs-fold )
+ *  field-content  = field-vchar [ 1*( SP / HTAB ) field-vchar ]
+ *  field-vchar    = VCHAR / obs-text
+ *
+ * checkInvalidHeaderChar() is currently designed to be inlinable by v8,
+ * so take care when making changes to the implementation so that the source
+ * code size does not exceed v8's default max_inlined_source_size setting.
+ **/
+var validHdrChars = [
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, // 0 - 15
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 - 31
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 32 - 47
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 48 - 63
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 64 - 79
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 80 - 95
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 96 - 111
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, // 112 - 127
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 128 ...
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+  1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1  // ... 255
+];
+
+function checkInvalidHeaderChar(val) {
+  val += '';
+  if (val.length < 1)
+    return false;
+  if (!validHdrChars[val.charCodeAt(0)])
+    return true;
+  if (val.length < 2)
+    return false;
+  if (!validHdrChars[val.charCodeAt(1)])
+    return true;
+  if (val.length < 3)
+    return false;
+  if (!validHdrChars[val.charCodeAt(2)])
+    return true;
+  if (val.length < 4)
+    return false;
+  if (!validHdrChars[val.charCodeAt(3)])
+    return true;
+  for (var i = 4; i < val.length; ++i) {
+    if (!validHdrChars[val.charCodeAt(i)])
+      return true;
+  }
+  return false;
+}
diff --git a/wrt/node_modules/engine.io/lib/socket.js b/wrt/node_modules/engine.io/lib/socket.js
new file mode 100644 (file)
index 0000000..526707c
--- /dev/null
@@ -0,0 +1,482 @@
+/**
+ * Module dependencies.
+ */
+
+var EventEmitter = require('events').EventEmitter;
+var util = require('util');
+var debug = require('debug')('engine:socket');
+
+/**
+ * Module exports.
+ */
+
+module.exports = Socket;
+
+/**
+ * Client class (abstract).
+ *
+ * @api private
+ */
+
+function Socket (id, server, transport, req) {
+  this.id = id;
+  this.server = server;
+  this.upgrading = false;
+  this.upgraded = false;
+  this.readyState = 'opening';
+  this.writeBuffer = [];
+  this.packetsFn = [];
+  this.sentCallbackFn = [];
+  this.cleanupFn = [];
+  this.request = req;
+
+  // Cache IP since it might not be in the req later
+  this.remoteAddress = req.connection.remoteAddress;
+
+  this.checkIntervalTimer = null;
+  this.upgradeTimeoutTimer = null;
+  this.pingTimeoutTimer = null;
+
+  this.setTransport(transport);
+  this.onOpen();
+}
+
+/**
+ * Inherits from EventEmitter.
+ */
+
+util.inherits(Socket, EventEmitter);
+
+/**
+ * Called upon transport considered open.
+ *
+ * @api private
+ */
+
+Socket.prototype.onOpen = function () {
+  this.readyState = 'open';
+
+  // sends an `open` packet
+  this.transport.sid = this.id;
+  this.sendPacket('open', JSON.stringify({
+    sid: this.id,
+    upgrades: this.getAvailableUpgrades(),
+    pingInterval: this.server.pingInterval,
+    pingTimeout: this.server.pingTimeout
+  }));
+
+  if (this.server.initialPacket) {
+    this.sendPacket('message', this.server.initialPacket);
+  }
+
+  this.emit('open');
+  this.setPingTimeout();
+};
+
+/**
+ * Called upon transport packet.
+ *
+ * @param {Object} packet
+ * @api private
+ */
+
+Socket.prototype.onPacket = function (packet) {
+  if ('open' === this.readyState) {
+    // export packet event
+    debug('packet');
+    this.emit('packet', packet);
+
+    // Reset ping timeout on any packet, incoming data is a good sign of
+    // other side's liveness
+    this.setPingTimeout();
+
+    switch (packet.type) {
+      case 'ping':
+        debug('got ping');
+        this.sendPacket('pong');
+        this.emit('heartbeat');
+        break;
+
+      case 'error':
+        this.onClose('parse error');
+        break;
+
+      case 'message':
+        this.emit('data', packet.data);
+        this.emit('message', packet.data);
+        break;
+    }
+  } else {
+    debug('packet received with closed socket');
+  }
+};
+
+/**
+ * Called upon transport error.
+ *
+ * @param {Error} error object
+ * @api private
+ */
+
+Socket.prototype.onError = function (err) {
+  debug('transport error');
+  this.onClose('transport error', err);
+};
+
+/**
+ * Sets and resets ping timeout timer based on client pings.
+ *
+ * @api private
+ */
+
+Socket.prototype.setPingTimeout = function () {
+  var self = this;
+  clearTimeout(self.pingTimeoutTimer);
+  self.pingTimeoutTimer = setTimeout(function () {
+    self.onClose('ping timeout');
+  }, self.server.pingInterval + self.server.pingTimeout);
+};
+
+/**
+ * Attaches handlers for the given transport.
+ *
+ * @param {Transport} transport
+ * @api private
+ */
+
+Socket.prototype.setTransport = function (transport) {
+  var onError = this.onError.bind(this);
+  var onPacket = this.onPacket.bind(this);
+  var flush = this.flush.bind(this);
+  var onClose = this.onClose.bind(this, 'transport close');
+
+  this.transport = transport;
+  this.transport.once('error', onError);
+  this.transport.on('packet', onPacket);
+  this.transport.on('drain', flush);
+  this.transport.once('close', onClose);
+  // this function will manage packet events (also message callbacks)
+  this.setupSendCallback();
+
+  this.cleanupFn.push(function () {
+    transport.removeListener('error', onError);
+    transport.removeListener('packet', onPacket);
+    transport.removeListener('drain', flush);
+    transport.removeListener('close', onClose);
+  });
+};
+
+/**
+ * Upgrades socket to the given transport
+ *
+ * @param {Transport} transport
+ * @api private
+ */
+
+Socket.prototype.maybeUpgrade = function (transport) {
+  debug('might upgrade socket transport from "%s" to "%s"'
+    , this.transport.name, transport.name);
+
+  this.upgrading = true;
+
+  var self = this;
+
+  // set transport upgrade timer
+  self.upgradeTimeoutTimer = setTimeout(function () {
+    debug('client did not complete upgrade - closing transport');
+    cleanup();
+    if ('open' === transport.readyState) {
+      transport.close();
+    }
+  }, this.server.upgradeTimeout);
+
+  function onPacket (packet) {
+    if ('ping' === packet.type && 'probe' === packet.data) {
+      transport.send([{ type: 'pong', data: 'probe' }]);
+      self.emit('upgrading', transport);
+      clearInterval(self.checkIntervalTimer);
+      self.checkIntervalTimer = setInterval(check, 100);
+    } else if ('upgrade' === packet.type && self.readyState !== 'closed') {
+      debug('got upgrade packet - upgrading');
+      cleanup();
+      self.transport.discard();
+      self.upgraded = true;
+      self.clearTransport();
+      self.setTransport(transport);
+      self.emit('upgrade', transport);
+      self.setPingTimeout();
+      self.flush();
+      if (self.readyState === 'closing') {
+        transport.close(function () {
+          self.onClose('forced close');
+        });
+      }
+    } else {
+      cleanup();
+      transport.close();
+    }
+  }
+
+  // we force a polling cycle to ensure a fast upgrade
+  function check () {
+    if ('polling' === self.transport.name && self.transport.writable) {
+      debug('writing a noop packet to polling for fast upgrade');
+      self.transport.send([{ type: 'noop' }]);
+    }
+  }
+
+  function cleanup () {
+    self.upgrading = false;
+
+    clearInterval(self.checkIntervalTimer);
+    self.checkIntervalTimer = null;
+
+    clearTimeout(self.upgradeTimeoutTimer);
+    self.upgradeTimeoutTimer = null;
+
+    transport.removeListener('packet', onPacket);
+    transport.removeListener('close', onTransportClose);
+    transport.removeListener('error', onError);
+    self.removeListener('close', onClose);
+  }
+
+  function onError (err) {
+    debug('client did not complete upgrade - %s', err);
+    cleanup();
+    transport.close();
+    transport = null;
+  }
+
+  function onTransportClose () {
+    onError('transport closed');
+  }
+
+  function onClose () {
+    onError('socket closed');
+  }
+
+  transport.on('packet', onPacket);
+  transport.once('close', onTransportClose);
+  transport.once('error', onError);
+
+  self.once('close', onClose);
+};
+
+/**
+ * Clears listeners and timers associated with current transport.
+ *
+ * @api private
+ */
+
+Socket.prototype.clearTransport = function () {
+  var cleanup;
+
+  var toCleanUp = this.cleanupFn.length;
+
+  for (var i = 0; i < toCleanUp; i++) {
+    cleanup = this.cleanupFn.shift();
+    cleanup();
+  }
+
+  // silence further transport errors and prevent uncaught exceptions
+  this.transport.on('error', function () {
+    debug('error triggered by discarded transport');
+  });
+
+  // ensure transport won't stay open
+  this.transport.close();
+
+  clearTimeout(this.pingTimeoutTimer);
+};
+
+/**
+ * Called upon transport considered closed.
+ * Possible reasons: `ping timeout`, `client error`, `parse error`,
+ * `transport error`, `server close`, `transport close`
+ */
+
+Socket.prototype.onClose = function (reason, description) {
+  if ('closed' !== this.readyState) {
+    this.readyState = 'closed';
+    clearTimeout(this.pingTimeoutTimer);
+    clearInterval(this.checkIntervalTimer);
+    this.checkIntervalTimer = null;
+    clearTimeout(this.upgradeTimeoutTimer);
+    var self = this;
+    // clean writeBuffer in next tick, so developers can still
+    // grab the writeBuffer on 'close' event
+    process.nextTick(function () {
+      self.writeBuffer = [];
+    });
+    this.packetsFn = [];
+    this.sentCallbackFn = [];
+    this.clearTransport();
+    this.emit('close', reason, description);
+  }
+};
+
+/**
+ * Setup and manage send callback
+ *
+ * @api private
+ */
+
+Socket.prototype.setupSendCallback = function () {
+  var self = this;
+  this.transport.on('drain', onDrain);
+
+  this.cleanupFn.push(function () {
+    self.transport.removeListener('drain', onDrain);
+  });
+
+  // the message was sent successfully, execute the callback
+  function onDrain () {
+    if (self.sentCallbackFn.length > 0) {
+      var seqFn = self.sentCallbackFn.splice(0, 1)[0];
+      if ('function' === typeof seqFn) {
+        debug('executing send callback');
+        seqFn(self.transport);
+      } else if (Array.isArray(seqFn)) {
+        debug('executing batch send callback');
+        for (var l = seqFn.length, i = 0; i < l; i++) {
+          if ('function' === typeof seqFn[i]) {
+            seqFn[i](self.transport);
+          }
+        }
+      }
+    }
+  }
+};
+
+/**
+ * Sends a message packet.
+ *
+ * @param {String} message
+ * @param {Object} options
+ * @param {Function} callback
+ * @return {Socket} for chaining
+ * @api public
+ */
+
+Socket.prototype.send =
+Socket.prototype.write = function (data, options, callback) {
+  this.sendPacket('message', data, options, callback);
+  return this;
+};
+
+/**
+ * Sends a packet.
+ *
+ * @param {String} packet type
+ * @param {String} optional, data
+ * @param {Object} options
+ * @api private
+ */
+
+Socket.prototype.sendPacket = function (type, data, options, callback) {
+  if ('function' === typeof options) {
+    callback = options;
+    options = null;
+  }
+
+  options = options || {};
+  options.compress = false !== options.compress;
+
+  if ('closing' !== this.readyState && 'closed' !== this.readyState) {
+    debug('sending packet "%s" (%s)', type, data);
+
+    var packet = {
+      type: type,
+      options: options
+    };
+    if (data) packet.data = data;
+
+    // exports packetCreate event
+    this.emit('packetCreate', packet);
+
+    this.writeBuffer.push(packet);
+
+    // add send callback to object, if defined
+    if (callback) this.packetsFn.push(callback);
+
+    this.flush();
+  }
+};
+
+/**
+ * Attempts to flush the packets buffer.
+ *
+ * @api private
+ */
+
+Socket.prototype.flush = function () {
+  if ('closed' !== this.readyState &&
+                this.transport.writable &&
+                this.writeBuffer.length) {
+    debug('flushing buffer to transport');
+    this.emit('flush', this.writeBuffer);
+    this.server.emit('flush', this, this.writeBuffer);
+    var wbuf = this.writeBuffer;
+    this.writeBuffer = [];
+    if (!this.transport.supportsFraming) {
+      this.sentCallbackFn.push(this.packetsFn);
+    } else {
+      this.sentCallbackFn.push.apply(this.sentCallbackFn, this.packetsFn);
+    }
+    this.packetsFn = [];
+    this.transport.send(wbuf);
+    this.emit('drain');
+    this.server.emit('drain', this);
+  }
+};
+
+/**
+ * Get available upgrades for this socket.
+ *
+ * @api private
+ */
+
+Socket.prototype.getAvailableUpgrades = function () {
+  var availableUpgrades = [];
+  var allUpgrades = this.server.upgrades(this.transport.name);
+  for (var i = 0, l = allUpgrades.length; i < l; ++i) {
+    var upg = allUpgrades[i];
+    if (this.server.transports.indexOf(upg) !== -1) {
+      availableUpgrades.push(upg);
+    }
+  }
+  return availableUpgrades;
+};
+
+/**
+ * Closes the socket and underlying transport.
+ *
+ * @param {Boolean} optional, discard
+ * @return {Socket} for chaining
+ * @api public
+ */
+
+Socket.prototype.close = function (discard) {
+  if ('open' !== this.readyState) return;
+
+  this.readyState = 'closing';
+
+  if (this.writeBuffer.length) {
+    this.once('drain', this.closeTransport.bind(this, discard));
+    return;
+  }
+
+  this.closeTransport(discard);
+};
+
+/**
+ * Closes the underlying transport.
+ *
+ * @param {Boolean} discard
+ * @api private
+ */
+
+Socket.prototype.closeTransport = function (discard) {
+  if (discard) this.transport.discard();
+  this.transport.close(this.onClose.bind(this, 'forced close'));
+};
diff --git a/wrt/node_modules/engine.io/lib/transport.js b/wrt/node_modules/engine.io/lib/transport.js
new file mode 100644 (file)
index 0000000..933dad5
--- /dev/null
@@ -0,0 +1,128 @@
+
+/**
+ * Module dependencies.
+ */
+
+var EventEmitter = require('events').EventEmitter;
+var parser = require('engine.io-parser');
+var util = require('util');
+var debug = require('debug')('engine:transport');
+
+/**
+ * Expose the constructor.
+ */
+
+module.exports = Transport;
+
+/**
+ * Noop function.
+ *
+ * @api private
+ */
+
+function noop () {}
+
+/**
+ * Transport constructor.
+ *
+ * @param {http.IncomingMessage} request
+ * @api public
+ */
+
+function Transport (req) {
+  this.readyState = 'open';
+  this.discarded = false;
+}
+
+/**
+ * Inherits from EventEmitter.
+ */
+
+util.inherits(Transport, EventEmitter);
+
+/**
+ * Flags the transport as discarded.
+ *
+ * @api private
+ */
+
+Transport.prototype.discard = function () {
+  this.discarded = true;
+};
+
+/**
+ * Called with an incoming HTTP request.
+ *
+ * @param {http.IncomingMessage} request
+ * @api private
+ */
+
+Transport.prototype.onRequest = function (req) {
+  debug('setting request');
+  this.req = req;
+};
+
+/**
+ * Closes the transport.
+ *
+ * @api private
+ */
+
+Transport.prototype.close = function (fn) {
+  if ('closed' === this.readyState || 'closing' === this.readyState) return;
+
+  this.readyState = 'closing';
+  this.doClose(fn || noop);
+};
+
+/**
+ * Called with a transport error.
+ *
+ * @param {String} message error
+ * @param {Object} error description
+ * @api private
+ */
+
+Transport.prototype.onError = function (msg, desc) {
+  if (this.listeners('error').length) {
+    var err = new Error(msg);
+    err.type = 'TransportError';
+    err.description = desc;
+    this.emit('error', err);
+  } else {
+    debug('ignored transport error %s (%s)', msg, desc);
+  }
+};
+
+/**
+ * Called with parsed out a packets from the data stream.
+ *
+ * @param {Object} packet
+ * @api private
+ */
+
+Transport.prototype.onPacket = function (packet) {
+  this.emit('packet', packet);
+};
+
+/**
+ * Called with the encoded packet data.
+ *
+ * @param {String} data
+ * @api private
+ */
+
+Transport.prototype.onData = function (data) {
+  this.onPacket(parser.decodePacket(data));
+};
+
+/**
+ * Called upon transport close.
+ *
+ * @api private
+ */
+
+Transport.prototype.onClose = function () {
+  this.readyState = 'closed';
+  this.emit('close');
+};
diff --git a/wrt/node_modules/engine.io/lib/transports/index.js b/wrt/node_modules/engine.io/lib/transports/index.js
new file mode 100644 (file)
index 0000000..fcff322
--- /dev/null
@@ -0,0 +1,36 @@
+
+/**
+ * Module dependencies.
+ */
+
+var XHR = require('./polling-xhr');
+var JSONP = require('./polling-jsonp');
+
+/**
+ * Export transports.
+ */
+
+module.exports = exports = {
+  polling: polling,
+  websocket: require('./websocket')
+};
+
+/**
+ * Export upgrades map.
+ */
+
+exports.polling.upgradesTo = ['websocket'];
+
+/**
+ * Polling polymorphic constructor.
+ *
+ * @api private
+ */
+
+function polling (req) {
+  if ('string' === typeof req._query.j) {
+    return new JSONP(req);
+  } else {
+    return new XHR(req);
+  }
+}
diff --git a/wrt/node_modules/engine.io/lib/transports/polling-jsonp.js b/wrt/node_modules/engine.io/lib/transports/polling-jsonp.js
new file mode 100644 (file)
index 0000000..62e66e7
--- /dev/null
@@ -0,0 +1,75 @@
+
+/**
+ * Module dependencies.
+ */
+
+var Polling = require('./polling');
+var qs = require('querystring');
+var rDoubleSlashes = /\\\\n/g;
+var rSlashes = /(\\)?\\n/g;
+var util = require('util');
+
+/**
+ * Module exports.
+ */
+
+module.exports = JSONP;
+
+/**
+ * JSON-P polling transport.
+ *
+ * @api public
+ */
+
+function JSONP (req) {
+  Polling.call(this, req);
+
+  this.head = '___eio[' + (req._query.j || '').replace(/[^0-9]/g, '') + '](';
+  this.foot = ');';
+}
+
+/**
+ * Inherits from Polling.
+ */
+
+util.inherits(JSONP, Polling);
+
+/**
+ * Handles incoming data.
+ * Due to a bug in \n handling by browsers, we expect a escaped string.
+ *
+ * @api private
+ */
+
+JSONP.prototype.onData = function (data) {
+  // we leverage the qs module so that we get built-in DoS protection
+  // and the fast alternative to decodeURIComponent
+  data = qs.parse(data).d;
+  if ('string' === typeof data) {
+    // client will send already escaped newlines as \\\\n and newlines as \\n
+    // \\n must be replaced with \n and \\\\n with \\n
+    data = data.replace(rSlashes, function (match, slashes) {
+      return slashes ? match : '\n';
+    });
+    Polling.prototype.onData.call(this, data.replace(rDoubleSlashes, '\\n'));
+  }
+};
+
+/**
+ * Performs the write.
+ *
+ * @api private
+ */
+
+JSONP.prototype.doWrite = function (data, options, callback) {
+  // we must output valid javascript, not valid json
+  // see: http://timelessrepo.com/json-isnt-a-javascript-subset
+  var js = JSON.stringify(data)
+    .replace(/\u2028/g, '\\u2028')
+    .replace(/\u2029/g, '\\u2029');
+
+  // prepare response
+  data = this.head + js + this.foot;
+
+  Polling.prototype.doWrite.call(this, data, options, callback);
+};
diff --git a/wrt/node_modules/engine.io/lib/transports/polling-xhr.js b/wrt/node_modules/engine.io/lib/transports/polling-xhr.js
new file mode 100644 (file)
index 0000000..3562524
--- /dev/null
@@ -0,0 +1,69 @@
+
+/**
+ * Module dependencies.
+ */
+
+var Polling = require('./polling');
+var util = require('util');
+
+/**
+ * Module exports.
+ */
+
+module.exports = XHR;
+
+/**
+ * Ajax polling transport.
+ *
+ * @api public
+ */
+
+function XHR (req) {
+  Polling.call(this, req);
+}
+
+/**
+ * Inherits from Polling.
+ */
+
+util.inherits(XHR, Polling);
+
+/**
+ * Overrides `onRequest` to handle `OPTIONS`..
+ *
+ * @param {http.IncomingMessage}
+ * @api private
+ */
+
+XHR.prototype.onRequest = function (req) {
+  if ('OPTIONS' === req.method) {
+    var res = req.res;
+    var headers = this.headers(req);
+    headers['Access-Control-Allow-Headers'] = 'Content-Type';
+    res.writeHead(200, headers);
+    res.end();
+  } else {
+    Polling.prototype.onRequest.call(this, req);
+  }
+};
+
+/**
+ * Returns headers for a response.
+ *
+ * @param {http.IncomingMessage} request
+ * @param {Object} extra headers
+ * @api private
+ */
+
+XHR.prototype.headers = function (req, headers) {
+  headers = headers || {};
+
+  if (req.headers.origin) {
+    headers['Access-Control-Allow-Credentials'] = 'true';
+    headers['Access-Control-Allow-Origin'] = req.headers.origin;
+  } else {
+    headers['Access-Control-Allow-Origin'] = '*';
+  }
+
+  return Polling.prototype.headers.call(this, req, headers);
+};
diff --git a/wrt/node_modules/engine.io/lib/transports/polling.js b/wrt/node_modules/engine.io/lib/transports/polling.js
new file mode 100644 (file)
index 0000000..6c5c0cc
--- /dev/null
@@ -0,0 +1,407 @@
+
+/**
+ * Module requirements.
+ */
+
+var Transport = require('../transport');
+var parser = require('engine.io-parser');
+var zlib = require('zlib');
+var accepts = require('accepts');
+var util = require('util');
+var debug = require('debug')('engine:polling');
+
+var compressionMethods = {
+  gzip: zlib.createGzip,
+  deflate: zlib.createDeflate
+};
+
+/**
+ * Exports the constructor.
+ */
+
+module.exports = Polling;
+
+/**
+ * HTTP polling constructor.
+ *
+ * @api public.
+ */
+
+function Polling (req) {
+  Transport.call(this, req);
+
+  this.closeTimeout = 30 * 1000;
+  this.maxHttpBufferSize = null;
+  this.httpCompression = null;
+}
+
+/**
+ * Inherits from Transport.
+ *
+ * @api public.
+ */
+
+util.inherits(Polling, Transport);
+
+/**
+ * Transport name
+ *
+ * @api public
+ */
+
+Polling.prototype.name = 'polling';
+
+/**
+ * Overrides onRequest.
+ *
+ * @param {http.IncomingMessage}
+ * @api private
+ */
+
+Polling.prototype.onRequest = function (req) {
+  var res = req.res;
+
+  if ('GET' === req.method) {
+    this.onPollRequest(req, res);
+  } else if ('POST' === req.method) {
+    this.onDataRequest(req, res);
+  } else {
+    res.writeHead(500);
+    res.end();
+  }
+};
+
+/**
+ * The client sends a request awaiting for us to send data.
+ *
+ * @api private
+ */
+
+Polling.prototype.onPollRequest = function (req, res) {
+  if (this.req) {
+    debug('request overlap');
+    // assert: this.res, '.req and .res should be (un)set together'
+    this.onError('overlap from client');
+    res.writeHead(500);
+    res.end();
+    return;
+  }
+
+  debug('setting request');
+
+  this.req = req;
+  this.res = res;
+
+  var self = this;
+
+  function onClose () {
+    self.onError('poll connection closed prematurely');
+  }
+
+  function cleanup () {
+    req.removeListener('close', onClose);
+    self.req = self.res = null;
+  }
+
+  req.cleanup = cleanup;
+  req.on('close', onClose);
+
+  this.writable = true;
+  this.emit('drain');
+
+  // if we're still writable but had a pending close, trigger an empty send
+  if (this.writable && this.shouldClose) {
+    debug('triggering empty send to append close packet');
+    this.send([{ type: 'noop' }]);
+  }
+};
+
+/**
+ * The client sends a request with data.
+ *
+ * @api private
+ */
+
+Polling.prototype.onDataRequest = function (req, res) {
+  if (this.dataReq) {
+    // assert: this.dataRes, '.dataReq and .dataRes should be (un)set together'
+    this.onError('data request overlap from client');
+    res.writeHead(500);
+    res.end();
+    return;
+  }
+
+  var isBinary = 'application/octet-stream' === req.headers['content-type'];
+
+  this.dataReq = req;
+  this.dataRes = res;
+
+  var chunks = isBinary ? new Buffer(0) : ''; // eslint-disable-line node/no-deprecated-api
+  var self = this;
+
+  function cleanup () {
+    req.removeListener('data', onData);
+    req.removeListener('end', onEnd);
+    req.removeListener('close', onClose);
+    self.dataReq = self.dataRes = chunks = null;
+  }
+
+  function onClose () {
+    cleanup();
+    self.onError('data request connection closed prematurely');
+  }
+
+  function onData (data) {
+    var contentLength;
+    if (isBinary) {
+      chunks = Buffer.concat([chunks, data]);
+      contentLength = chunks.length;
+    } else {
+      chunks += data;
+      contentLength = Buffer.byteLength(chunks);
+    }
+
+    if (contentLength > self.maxHttpBufferSize) {
+      chunks = isBinary ? new Buffer(0) : ''; // eslint-disable-line node/no-deprecated-api
+      req.connection.destroy();
+    }
+  }
+
+  function onEnd () {
+    self.onData(chunks);
+
+    var headers = {
+      // text/html is required instead of text/plain to avoid an
+      // unwanted download dialog on certain user-agents (GH-43)
+      'Content-Type': 'text/html',
+      'Content-Length': 2
+    };
+
+    res.writeHead(200, self.headers(req, headers));
+    res.end('ok');
+    cleanup();
+  }
+
+  req.on('close', onClose);
+  if (!isBinary) req.setEncoding('utf8');
+  req.on('data', onData);
+  req.on('end', onEnd);
+};
+
+/**
+ * Processes the incoming data payload.
+ *
+ * @param {String} encoded payload
+ * @api private
+ */
+
+Polling.prototype.onData = function (data) {
+  debug('received "%s"', data);
+  var self = this;
+  var callback = function (packet) {
+    if ('close' === packet.type) {
+      debug('got xhr close packet');
+      self.onClose();
+      return false;
+    }
+
+    self.onPacket(packet);
+  };
+
+  parser.decodePayload(data, callback);
+};
+
+/**
+ * Overrides onClose.
+ *
+ * @api private
+ */
+
+Polling.prototype.onClose = function () {
+  if (this.writable) {
+    // close pending poll request
+    this.send([{ type: 'noop' }]);
+  }
+  Transport.prototype.onClose.call(this);
+};
+
+/**
+ * Writes a packet payload.
+ *
+ * @param {Object} packet
+ * @api private
+ */
+
+Polling.prototype.send = function (packets) {
+  this.writable = false;
+
+  if (this.shouldClose) {
+    debug('appending close packet to payload');
+    packets.push({ type: 'close' });
+    this.shouldClose();
+    this.shouldClose = null;
+  }
+
+  var self = this;
+  parser.encodePayload(packets, this.supportsBinary, function (data) {
+    var compress = packets.some(function (packet) {
+      return packet.options && packet.options.compress;
+    });
+    self.write(data, { compress: compress });
+  });
+};
+
+/**
+ * Writes data as response to poll request.
+ *
+ * @param {String} data
+ * @param {Object} options
+ * @api private
+ */
+
+Polling.prototype.write = function (data, options) {
+  debug('writing "%s"', data);
+  var self = this;
+  this.doWrite(data, options, function () {
+    self.req.cleanup();
+  });
+};
+
+/**
+ * Performs the write.
+ *
+ * @api private
+ */
+
+Polling.prototype.doWrite = function (data, options, callback) {
+  var self = this;
+
+  // explicit UTF-8 is required for pages not served under utf
+  var isString = typeof data === 'string';
+  var contentType = isString
+    ? 'text/plain; charset=UTF-8'
+    : 'application/octet-stream';
+
+  var headers = {
+    'Content-Type': contentType
+  };
+
+  if (!this.httpCompression || !options.compress) {
+    respond(data);
+    return;
+  }
+
+  var len = isString ? Buffer.byteLength(data) : data.length;
+  if (len < this.httpCompression.threshold) {
+    respond(data);
+    return;
+  }
+
+  var encoding = accepts(this.req).encodings(['gzip', 'deflate']);
+  if (!encoding) {
+    respond(data);
+    return;
+  }
+
+  this.compress(data, encoding, function (err, data) {
+    if (err) {
+      self.res.writeHead(500);
+      self.res.end();
+      callback(err);
+      return;
+    }
+
+    headers['Content-Encoding'] = encoding;
+    respond(data);
+  });
+
+  function respond (data) {
+    headers['Content-Length'] = 'string' === typeof data ? Buffer.byteLength(data) : data.length;
+    self.res.writeHead(200, self.headers(self.req, headers));
+    self.res.end(data);
+    callback();
+  }
+};
+
+/**
+ * Compresses data.
+ *
+ * @api private
+ */
+
+Polling.prototype.compress = function (data, encoding, callback) {
+  debug('compressing');
+
+  var buffers = [];
+  var nread = 0;
+
+  compressionMethods[encoding](this.httpCompression)
+    .on('error', callback)
+    .on('data', function (chunk) {
+      buffers.push(chunk);
+      nread += chunk.length;
+    })
+    .on('end', function () {
+      callback(null, Buffer.concat(buffers, nread));
+    })
+    .end(data);
+};
+
+/**
+ * Closes the transport.
+ *
+ * @api private
+ */
+
+Polling.prototype.doClose = function (fn) {
+  debug('closing');
+
+  var self = this;
+  var closeTimeoutTimer;
+
+  if (this.dataReq) {
+    debug('aborting ongoing data request');
+    this.dataReq.destroy();
+  }
+
+  if (this.writable) {
+    debug('transport writable - closing right away');
+    this.send([{ type: 'close' }]);
+    onClose();
+  } else if (this.discarded) {
+    debug('transport discarded - closing right away');
+    onClose();
+  } else {
+    debug('transport not writable - buffering orderly close');
+    this.shouldClose = onClose;
+    closeTimeoutTimer = setTimeout(onClose, this.closeTimeout);
+  }
+
+  function onClose () {
+    clearTimeout(closeTimeoutTimer);
+    fn();
+    self.onClose();
+  }
+};
+
+/**
+ * Returns headers for a response.
+ *
+ * @param {http.IncomingMessage} request
+ * @param {Object} extra headers
+ * @api private
+ */
+
+Polling.prototype.headers = function (req, headers) {
+  headers = headers || {};
+
+  // prevent XSS warnings on IE
+  // https://github.com/LearnBoost/socket.io/pull/1333
+  var ua = req.headers['user-agent'];
+  if (ua && (~ua.indexOf(';MSIE') || ~ua.indexOf('Trident/'))) {
+    headers['X-XSS-Protection'] = '0';
+  }
+
+  this.emit('headers', headers);
+  return headers;
+};
diff --git a/wrt/node_modules/engine.io/lib/transports/websocket.js b/wrt/node_modules/engine.io/lib/transports/websocket.js
new file mode 100644 (file)
index 0000000..7d5511b
--- /dev/null
@@ -0,0 +1,134 @@
+
+/**
+ * Module dependencies.
+ */
+
+var Transport = require('../transport');
+var parser = require('engine.io-parser');
+var util = require('util');
+var debug = require('debug')('engine:ws');
+
+/**
+ * Export the constructor.
+ */
+
+module.exports = WebSocket;
+
+/**
+ * WebSocket transport
+ *
+ * @param {http.IncomingMessage}
+ * @api public
+ */
+
+function WebSocket (req) {
+  Transport.call(this, req);
+  var self = this;
+  this.socket = req.websocket;
+  this.socket.on('message', this.onData.bind(this));
+  this.socket.once('close', this.onClose.bind(this));
+  this.socket.on('error', this.onError.bind(this));
+  this.socket.on('headers', onHeaders);
+  this.writable = true;
+  this.perMessageDeflate = null;
+
+  function onHeaders (headers) {
+    self.emit('headers', headers);
+  }
+}
+
+/**
+ * Inherits from Transport.
+ */
+
+util.inherits(WebSocket, Transport);
+
+/**
+ * Transport name
+ *
+ * @api public
+ */
+
+WebSocket.prototype.name = 'websocket';
+
+/**
+ * Advertise upgrade support.
+ *
+ * @api public
+ */
+
+WebSocket.prototype.handlesUpgrades = true;
+
+/**
+ * Advertise framing support.
+ *
+ * @api public
+ */
+
+WebSocket.prototype.supportsFraming = true;
+
+/**
+ * Processes the incoming data.
+ *
+ * @param {String} encoded packet
+ * @api private
+ */
+
+WebSocket.prototype.onData = function (data) {
+  debug('received "%s"', data);
+  Transport.prototype.onData.call(this, data);
+};
+
+/**
+ * Writes a packet payload.
+ *
+ * @param {Array} packets
+ * @api private
+ */
+
+WebSocket.prototype.send = function (packets) {
+  var self = this;
+
+  for (var i = 0; i < packets.length; i++) {
+    var packet = packets[i];
+    parser.encodePacket(packet, self.supportsBinary, send);
+  }
+
+  function send (data) {
+    debug('writing "%s"', data);
+
+    // always creates a new object since ws modifies it
+    var opts = {};
+    if (packet.options) {
+      opts.compress = packet.options.compress;
+    }
+
+    if (self.perMessageDeflate) {
+      var len = 'string' === typeof data ? Buffer.byteLength(data) : data.length;
+      if (len < self.perMessageDeflate.threshold) {
+        opts.compress = false;
+      }
+    }
+
+    self.writable = false;
+    self.socket.send(data, opts, onEnd);
+  }
+
+  function onEnd (err) {
+    if (err) return self.onError('write error', err.stack);
+    self.writable = true;
+    self.emit('drain');
+  }
+};
+
+/**
+ * Closes the transport.
+ *
+ * @api private
+ */
+
+WebSocket.prototype.doClose = function (fn) {
+  debug('closing');
+  this.socket.close();
+  fn && fn();
+};
diff --git a/wrt/node_modules/engine.io/node_modules/debug/.coveralls.yml b/wrt/node_modules/engine.io/node_modules/debug/.coveralls.yml
new file mode 100644 (file)
index 0000000..20a7068
--- /dev/null
@@ -0,0 +1 @@
+repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve
diff --git a/wrt/node_modules/engine.io/node_modules/debug/.eslintrc b/wrt/node_modules/engine.io/node_modules/debug/.eslintrc
new file mode 100644 (file)
index 0000000..8a37ae2
--- /dev/null
@@ -0,0 +1,11 @@
+{
+  "env": {
+    "browser": true,
+    "node": true
+  },
+  "rules": {
+    "no-console": 0,
+    "no-empty": [1, { "allowEmptyCatch": true }]
+  },
+  "extends": "eslint:recommended"
+}
diff --git a/wrt/node_modules/engine.io/node_modules/debug/.npmignore b/wrt/node_modules/engine.io/node_modules/debug/.npmignore
new file mode 100644 (file)
index 0000000..5f60eec
--- /dev/null
@@ -0,0 +1,9 @@
+support
+test
+examples
+example
+*.sock
+dist
+yarn.lock
+coverage
+bower.json
diff --git a/wrt/node_modules/engine.io/node_modules/debug/.travis.yml b/wrt/node_modules/engine.io/node_modules/debug/.travis.yml
new file mode 100644 (file)
index 0000000..6c6090c
--- /dev/null
@@ -0,0 +1,14 @@
+
+language: node_js
+node_js:
+  - "6"
+  - "5"
+  - "4"
+
+install:
+  - make node_modules
+
+script:
+  - make lint
+  - make test
+  - make coveralls
diff --git a/wrt/node_modules/engine.io/node_modules/debug/CHANGELOG.md b/wrt/node_modules/engine.io/node_modules/debug/CHANGELOG.md
new file mode 100644 (file)
index 0000000..eadaa18
--- /dev/null
@@ -0,0 +1,362 @@
+
+2.6.9 / 2017-09-22
+==================
+
+  * remove ReDoS regexp in %o formatter (#504)
+
+2.6.8 / 2017-05-18
+==================
+
+  * Fix: Check for undefined on browser globals (#462, @marbemac)
+
+2.6.7 / 2017-05-16
+==================
+
+  * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom)
+  * Fix: Inline extend function in node implementation (#452, @dougwilson)
+  * Docs: Fix typo (#455, @msasad)
+
+2.6.5 / 2017-04-27
+==================
+  
+  * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek)
+  * Misc: clean up browser reference checks (#447, @thebigredgeek)
+  * Misc: add npm-debug.log to .gitignore (@thebigredgeek)
+
+
+2.6.4 / 2017-04-20
+==================
+
+  * Fix: bug that would occure if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo)
+  * Chore: ignore bower.json in npm installations. (#437, @joaovieira)
+  * Misc: update "ms" to v0.7.3 (@tootallnate)
+
+2.6.3 / 2017-03-13
+==================
+
+  * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts)
+  * Docs: Changelog fix (@thebigredgeek)
+
+2.6.2 / 2017-03-10
+==================
+
+  * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin)
+  * Docs: Add backers and sponsors from Open Collective (#422, @piamancini)
+  * Docs: Add Slackin invite badge (@tootallnate)
+
+2.6.1 / 2017-02-10
+==================
+
+  * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error
+  * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0)
+  * Fix: IE8 "Expected identifier" error (#414, @vgoma)
+  * Fix: Namespaces would not disable once enabled (#409, @musikov)
+
+2.6.0 / 2016-12-28
+==================
+
+  * Fix: added better null pointer checks for browser useColors (@thebigredgeek)
+  * Improvement: removed explicit `window.debug` export (#404, @tootallnate)
+  * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate)
+
+2.5.2 / 2016-12-25
+==================
+
+  * Fix: reference error on window within webworkers (#393, @KlausTrainer)
+  * Docs: fixed README typo (#391, @lurch)
+  * Docs: added notice about v3 api discussion (@thebigredgeek)
+
+2.5.1 / 2016-12-20
+==================
+
+  * Fix: babel-core compatibility
+
+2.5.0 / 2016-12-20
+==================
+
+  * Fix: wrong reference in bower file (@thebigredgeek)
+  * Fix: webworker compatibility (@thebigredgeek)
+  * Fix: output formatting issue (#388, @kribblo)
+  * Fix: babel-loader compatibility (#383, @escwald)
+  * Misc: removed built asset from repo and publications (@thebigredgeek)
+  * Misc: moved source files to /src (#378, @yamikuronue)
+  * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue)
+  * Test: coveralls integration (#378, @yamikuronue)
+  * Docs: simplified language in the opening paragraph (#373, @yamikuronue)
+
+2.4.5 / 2016-12-17
+==================
+
+  * Fix: `navigator` undefined in Rhino (#376, @jochenberger)
+  * Fix: custom log function (#379, @hsiliev)
+  * Improvement: bit of cleanup + linting fixes (@thebigredgeek)
+  * Improvement: rm non-maintainted `dist/` dir (#375, @freewil)
+  * Docs: simplified language in the opening paragraph. (#373, @yamikuronue)
+
+2.4.4 / 2016-12-14
+==================
+
+  * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts)
+
+2.4.3 / 2016-12-14
+==================
+
+  * Fix: navigation.userAgent error for react native (#364, @escwald)
+
+2.4.2 / 2016-12-14
+==================
+
+  * Fix: browser colors (#367, @tootallnate)
+  * Misc: travis ci integration (@thebigredgeek)
+  * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek)
+
+2.4.1 / 2016-12-13
+==================
+
+  * Fix: typo that broke the package (#356)
+
+2.4.0 / 2016-12-13
+==================
+
+  * Fix: bower.json references unbuilt src entry point (#342, @justmatt)
+  * Fix: revert "handle regex special characters" (@tootallnate)
+  * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate)
+  * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate)
+  * Improvement: allow colors in workers (#335, @botverse)
+  * Improvement: use same color for same namespace. (#338, @lchenay)
+
+2.3.3 / 2016-11-09
+==================
+
+  * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne)
+  * Fix: Returning `localStorage` saved values (#331, Levi Thomason)
+  * Improvement: Don't create an empty object when no `process` (Nathan Rajlich)
+
+2.3.2 / 2016-11-09
+==================
+
+  * Fix: be super-safe in index.js as well (@TooTallNate)
+  * Fix: should check whether process exists (Tom Newby)
+
+2.3.1 / 2016-11-09
+==================
+
+  * Fix: Added electron compatibility (#324, @paulcbetts)
+  * Improvement: Added performance optimizations (@tootallnate)
+  * Readme: Corrected PowerShell environment variable example (#252, @gimre)
+  * Misc: Removed yarn lock file from source control (#321, @fengmk2)
+
+2.3.0 / 2016-11-07
+==================
+
+  * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic)
+  * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos)
+  * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15)
+  * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran)
+  * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom)
+  * Package: Update "ms" to 0.7.2 (#315, @DevSide)
+  * Package: removed superfluous version property from bower.json (#207 @kkirsche)
+  * Readme: fix USE_COLORS to DEBUG_COLORS
+  * Readme: Doc fixes for format string sugar (#269, @mlucool)
+  * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0)
+  * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable)
+  * Readme: better docs for browser support (#224, @matthewmueller)
+  * Tooling: Added yarn integration for development (#317, @thebigredgeek)
+  * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek)
+  * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman)
+  * Misc: Updated contributors (@thebigredgeek)
+
+2.2.0 / 2015-05-09
+==================
+
+  * package: update "ms" to v0.7.1 (#202, @dougwilson)
+  * README: add logging to file example (#193, @DanielOchoa)
+  * README: fixed a typo (#191, @amir-s)
+  * browser: expose `storage` (#190, @stephenmathieson)
+  * Makefile: add a `distclean` target (#189, @stephenmathieson)
+
+2.1.3 / 2015-03-13
+==================
+
+  * Updated stdout/stderr example (#186)
+  * Updated example/stdout.js to match debug current behaviour
+  * Renamed example/stderr.js to stdout.js
+  * Update Readme.md (#184)
+  * replace high intensity foreground color for bold (#182, #183)
+
+2.1.2 / 2015-03-01
+==================
+
+  * dist: recompile
+  * update "ms" to v0.7.0
+  * package: update "browserify" to v9.0.3
+  * component: fix "ms.js" repo location
+  * changed bower package name
+  * updated documentation about using debug in a browser
+  * fix: security error on safari (#167, #168, @yields)
+
+2.1.1 / 2014-12-29
+==================
+
+  * browser: use `typeof` to check for `console` existence
+  * browser: check for `console.log` truthiness (fix IE 8/9)
+  * browser: add support for Chrome apps
+  * Readme: added Windows usage remarks
+  * Add `bower.json` to properly support bower install
+
+2.1.0 / 2014-10-15
+==================
+
+  * node: implement `DEBUG_FD` env variable support
+  * package: update "browserify" to v6.1.0
+  * package: add "license" field to package.json (#135, @panuhorsmalahti)
+
+2.0.0 / 2014-09-01
+==================
+
+  * package: update "browserify" to v5.11.0
+  * node: use stderr rather than stdout for logging (#29, @stephenmathieson)
+
+1.0.4 / 2014-07-15
+==================
+
+  * dist: recompile
+  * example: remove `console.info()` log usage
+  * example: add "Content-Type" UTF-8 header to browser example
+  * browser: place %c marker after the space character
+  * browser: reset the "content" color via `color: inherit`
+  * browser: add colors support for Firefox >= v31
+  * debug: prefer an instance `log()` function over the global one (#119)
+  * Readme: update documentation about styled console logs for FF v31 (#116, @wryk)
+
+1.0.3 / 2014-07-09
+==================
+
+  * Add support for multiple wildcards in namespaces (#122, @seegno)
+  * browser: fix lint
+
+1.0.2 / 2014-06-10
+==================
+
+  * browser: update color palette (#113, @gscottolson)
+  * common: make console logging function configurable (#108, @timoxley)
+  * node: fix %o colors on old node <= 0.8.x
+  * Makefile: find node path using shell/which (#109, @timoxley)
+
+1.0.1 / 2014-06-06
+==================
+
+  * browser: use `removeItem()` to clear localStorage
+  * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777)
+  * package: add "contributors" section
+  * node: fix comment typo
+  * README: list authors
+
+1.0.0 / 2014-06-04
+==================
+
+  * make ms diff be global, not be scope
+  * debug: ignore empty strings in enable()
+  * node: make DEBUG_COLORS able to disable coloring
+  * *: export the `colors` array
+  * npmignore: don't publish the `dist` dir
+  * Makefile: refactor to use browserify
+  * package: add "browserify" as a dev dependency
+  * Readme: add Web Inspector Colors section
+  * node: reset terminal color for the debug content
+  * node: map "%o" to `util.inspect()`
+  * browser: map "%j" to `JSON.stringify()`
+  * debug: add custom "formatters"
+  * debug: use "ms" module for humanizing the diff
+  * Readme: add "bash" syntax highlighting
+  * browser: add Firebug color support
+  * browser: add colors for WebKit browsers
+  * node: apply log to `console`
+  * rewrite: abstract common logic for Node & browsers
+  * add .jshintrc file
+
+0.8.1 / 2014-04-14
+==================
+
+  * package: re-add the "component" section
+
+0.8.0 / 2014-03-30
+==================
+
+  * add `enable()` method for nodejs. Closes #27
+  * change from stderr to stdout
+  * remove unnecessary index.js file
+
+0.7.4 / 2013-11-13
+==================
+
+  * remove "browserify" key from package.json (fixes something in browserify)
+
+0.7.3 / 2013-10-30
+==================
+
+  * fix: catch localStorage security error when cookies are blocked (Chrome)
+  * add debug(err) support. Closes #46
+  * add .browser prop to package.json. Closes #42
+
+0.7.2 / 2013-02-06
+==================
+
+  * fix package.json
+  * fix: Mobile Safari (private mode) is broken with debug
+  * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript
+
+0.7.1 / 2013-02-05
+==================
+
+  * add repository URL to package.json
+  * add DEBUG_COLORED to force colored output
+  * add browserify support
+  * fix component. Closes #24
+
+0.7.0 / 2012-05-04
+==================
+
+  * Added .component to package.json
+  * Added debug.component.js build
+
+0.6.0 / 2012-03-16
+==================
+
+  * Added support for "-" prefix in DEBUG [Vinay Pulim]
+  * Added `.enabled` flag to the node version [TooTallNate]
+
+0.5.0 / 2012-02-02
+==================
+
+  * Added: humanize diffs. Closes #8
+  * Added `debug.disable()` to the CS variant
+  * Removed padding. Closes #10
+  * Fixed: persist client-side variant again. Closes #9
+
+0.4.0 / 2012-02-01
+==================
+
+  * Added browser variant support for older browsers [TooTallNate]
+  * Added `debug.enable('project:*')` to browser variant [TooTallNate]
+  * Added padding to diff (moved it to the right)
+
+0.3.0 / 2012-01-26
+==================
+
+  * Added millisecond diff when isatty, otherwise UTC string
+
+0.2.0 / 2012-01-22
+==================
+
+  * Added wildcard support
+
+0.1.0 / 2011-12-02
+==================
+
+  * Added: remove colors unless stderr isatty [TooTallNate]
+
+0.0.1 / 2010-01-03
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/engine.io/node_modules/debug/LICENSE b/wrt/node_modules/engine.io/node_modules/debug/LICENSE
new file mode 100644 (file)
index 0000000..658c933
--- /dev/null
@@ -0,0 +1,19 @@
+(The MIT License)
+
+Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software 
+and associated documentation files (the 'Software'), to deal in the Software without restriction, 
+including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial 
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 
+LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/wrt/node_modules/engine.io/node_modules/debug/Makefile b/wrt/node_modules/engine.io/node_modules/debug/Makefile
new file mode 100644 (file)
index 0000000..584da8b
--- /dev/null
@@ -0,0 +1,50 @@
+# get Makefile directory name: http://stackoverflow.com/a/5982798/376773
+THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
+THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)
+
+# BIN directory
+BIN := $(THIS_DIR)/node_modules/.bin
+
+# Path
+PATH := node_modules/.bin:$(PATH)
+SHELL := /bin/bash
+
+# applications
+NODE ?= $(shell which node)
+YARN ?= $(shell which yarn)
+PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm))
+BROWSERIFY ?= $(NODE) $(BIN)/browserify
+
+.FORCE:
+
+install: node_modules
+
+node_modules: package.json
+       @NODE_ENV= $(PKG) install
+       @touch node_modules
+
+lint: .FORCE
+       eslint browser.js debug.js index.js node.js
+
+test-node: .FORCE
+       istanbul cover node_modules/mocha/bin/_mocha -- test/**.js
+
+test-browser: .FORCE
+       mkdir -p dist
+
+       @$(BROWSERIFY) \
+               --standalone debug \
+               . > dist/debug.js
+
+       karma start --single-run
+       rimraf dist
+
+test: .FORCE
+       concurrently \
+               "make test-node" \
+               "make test-browser"
+
+coveralls:
+       cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
+
+.PHONY: all install clean distclean
diff --git a/wrt/node_modules/engine.io/node_modules/debug/README.md b/wrt/node_modules/engine.io/node_modules/debug/README.md
new file mode 100644 (file)
index 0000000..f67be6b
--- /dev/null
@@ -0,0 +1,312 @@
+# debug
+[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug)  [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master)  [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) 
+[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors)
+
+
+
+A tiny node.js debugging utility modelled after node core's debugging technique.
+
+**Discussion around the V3 API is under way [here](https://github.com/visionmedia/debug/issues/370)**
+
+## Installation
+
+```bash
+$ npm install debug
+```
+
+## Usage
+
+`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole.
+
+Example _app.js_:
+
+```js
+var debug = require('debug')('http')
+  , http = require('http')
+  , name = 'My App';
+
+// fake app
+
+debug('booting %s', name);
+
+http.createServer(function(req, res){
+  debug(req.method + ' ' + req.url);
+  res.end('hello\n');
+}).listen(3000, function(){
+  debug('listening');
+});
+
+// fake worker of some kind
+
+require('./worker');
+```
+
+Example _worker.js_:
+
+```js
+var debug = require('debug')('worker');
+
+setInterval(function(){
+  debug('doing some work');
+}, 1000);
+```
+
+ The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:
+
+  ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png)
+
+  ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png)
+
+#### Windows note
+
+ On Windows the environment variable is set using the `set` command.
+
+ ```cmd
+ set DEBUG=*,-not_this
+ ```
+
+ Note that PowerShell uses different syntax to set environment variables.
+
+ ```cmd
+ $env:DEBUG = "*,-not_this"
+  ```
+
+Then, run the program to be debugged as usual.
+
+## Millisecond diff
+
+  When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.
+
+  ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png)
+
+  When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:
+
+  ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png)
+
+## Conventions
+
+  If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser".
+
+## Wildcards
+
+  The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.
+
+  You can also exclude specific debuggers by prefixing them with a "-" character.  For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:".
+
+## Environment Variables
+
+  When running through Node.js, you can set a few environment variables that will
+  change the behavior of the debug logging:
+
+| Name      | Purpose                                         |
+|-----------|-------------------------------------------------|
+| `DEBUG`   | Enables/disables specific debugging namespaces. |
+| `DEBUG_COLORS`| Whether or not to use colors in the debug output. |
+| `DEBUG_DEPTH` | Object inspection depth. |
+| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. |
+
+
+  __Note:__ The environment variables beginning with `DEBUG_` end up being
+  converted into an Options object that gets used with `%o`/`%O` formatters.
+  See the Node.js documentation for
+  [`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options)
+  for the complete list.
+
+## Formatters
+
+
+  Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. Below are the officially supported formatters:
+
+| Formatter | Representation |
+|-----------|----------------|
+| `%O`      | Pretty-print an Object on multiple lines. |
+| `%o`      | Pretty-print an Object all on a single line. |
+| `%s`      | String. |
+| `%d`      | Number (both integer and float). |
+| `%j`      | JSON. Replaced with the string '[Circular]' if the argument contains circular references. |
+| `%%`      | Single percent sign ('%'). This does not consume an argument. |
+
+### Custom formatters
+
+  You can add custom formatters by extending the `debug.formatters` object. For example, if you wanted to add support for rendering a Buffer as hex with `%h`, you could do something like:
+
+```js
+const createDebug = require('debug')
+createDebug.formatters.h = (v) => {
+  return v.toString('hex')
+}
+
+// …elsewhere
+const debug = createDebug('foo')
+debug('this is hex: %h', new Buffer('hello world'))
+//   foo this is hex: 68656c6c6f20776f726c6421 +0ms
+```
+
+## Browser support
+  You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify),
+  or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest),
+  if you don't want to build it yourself.
+
+  Debug's enable state is currently persisted by `localStorage`.
+  Consider the situation shown below where you have `worker:a` and `worker:b`,
+  and wish to debug both. You can enable this using `localStorage.debug`:
+
+```js
+localStorage.debug = 'worker:*'
+```
+
+And then refresh the page.
+
+```js
+a = debug('worker:a');
+b = debug('worker:b');
+
+setInterval(function(){
+  a('doing some work');
+}, 1000);
+
+setInterval(function(){
+  b('doing some work');
+}, 1200);
+```
+
+#### Web Inspector Colors
+
+  Colors are also enabled on "Web Inspectors" that understand the `%c` formatting
+  option. These are WebKit web inspectors, Firefox ([since version
+  31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))
+  and the Firebug plugin for Firefox (any version).
+
+  Colored output looks something like:
+
+  ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png)
+
+
+## Output streams
+
+  By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method:
+
+Example _stdout.js_:
+
+```js
+var debug = require('debug');
+var error = debug('app:error');
+
+// by default stderr is used
+error('goes to stderr!');
+
+var log = debug('app:log');
+// set this namespace to log via console.log
+log.log = console.log.bind(console); // don't forget to bind to console!
+log('goes to stdout');
+error('still goes to stderr!');
+
+// set all output to go via console.info
+// overrides all per-namespace log settings
+debug.log = console.info.bind(console);
+error('now goes to stdout via console.info');
+log('still goes to stdout, but via console.info now');
+```
+
+
+## Authors
+
+ - TJ Holowaychuk
+ - Nathan Rajlich
+ - Andrew Rhyne
+## Backers
+
+Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)]
+
+<a href="https://opencollective.com/debug/backer/0/website" target="_blank"><img src="https://opencollective.com/debug/backer/0/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/1/website" target="_blank"><img src="https://opencollective.com/debug/backer/1/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/2/website" target="_blank"><img src="https://opencollective.com/debug/backer/2/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/3/website" target="_blank"><img src="https://opencollective.com/debug/backer/3/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/4/website" target="_blank"><img src="https://opencollective.com/debug/backer/4/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/5/website" target="_blank"><img src="https://opencollective.com/debug/backer/5/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/6/website" target="_blank"><img src="https://opencollective.com/debug/backer/6/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/7/website" target="_blank"><img src="https://opencollective.com/debug/backer/7/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/8/website" target="_blank"><img src="https://opencollective.com/debug/backer/8/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/9/website" target="_blank"><img src="https://opencollective.com/debug/backer/9/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/10/website" target="_blank"><img src="https://opencollective.com/debug/backer/10/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/11/website" target="_blank"><img src="https://opencollective.com/debug/backer/11/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/12/website" target="_blank"><img src="https://opencollective.com/debug/backer/12/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/13/website" target="_blank"><img src="https://opencollective.com/debug/backer/13/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/14/website" target="_blank"><img src="https://opencollective.com/debug/backer/14/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/15/website" target="_blank"><img src="https://opencollective.com/debug/backer/15/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/16/website" target="_blank"><img src="https://opencollective.com/debug/backer/16/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/17/website" target="_blank"><img src="https://opencollective.com/debug/backer/17/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/18/website" target="_blank"><img src="https://opencollective.com/debug/backer/18/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/19/website" target="_blank"><img src="https://opencollective.com/debug/backer/19/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/20/website" target="_blank"><img src="https://opencollective.com/debug/backer/20/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/21/website" target="_blank"><img src="https://opencollective.com/debug/backer/21/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/22/website" target="_blank"><img src="https://opencollective.com/debug/backer/22/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/23/website" target="_blank"><img src="https://opencollective.com/debug/backer/23/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/24/website" target="_blank"><img src="https://opencollective.com/debug/backer/24/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/25/website" target="_blank"><img src="https://opencollective.com/debug/backer/25/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/26/website" target="_blank"><img src="https://opencollective.com/debug/backer/26/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/27/website" target="_blank"><img src="https://opencollective.com/debug/backer/27/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/28/website" target="_blank"><img src="https://opencollective.com/debug/backer/28/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/29/website" target="_blank"><img src="https://opencollective.com/debug/backer/29/avatar.svg"></a>
+
+
+## Sponsors
+
+Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)]
+
+<a href="https://opencollective.com/debug/sponsor/0/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/0/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/1/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/1/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/2/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/2/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/3/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/3/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/4/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/4/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/5/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/5/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/6/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/6/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/7/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/7/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/8/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/8/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/9/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/9/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/10/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/10/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/11/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/11/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/12/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/12/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/13/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/13/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/14/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/14/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/15/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/15/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/16/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/16/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/17/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/17/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/18/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/18/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/19/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/19/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/20/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/20/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/21/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/21/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/22/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/22/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/23/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/23/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/24/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/24/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/25/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/25/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/26/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/26/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/27/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/27/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/28/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/28/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/29/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/29/avatar.svg"></a>
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2014-2016 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/engine.io/node_modules/debug/component.json b/wrt/node_modules/engine.io/node_modules/debug/component.json
new file mode 100644 (file)
index 0000000..9de2641
--- /dev/null
@@ -0,0 +1,19 @@
+{
+  "name": "debug",
+  "repo": "visionmedia/debug",
+  "description": "small debugging utility",
+  "version": "2.6.9",
+  "keywords": [
+    "debug",
+    "log",
+    "debugger"
+  ],
+  "main": "src/browser.js",
+  "scripts": [
+    "src/browser.js",
+    "src/debug.js"
+  ],
+  "dependencies": {
+    "rauchg/ms.js": "0.7.1"
+  }
+}
diff --git a/wrt/node_modules/engine.io/node_modules/debug/karma.conf.js b/wrt/node_modules/engine.io/node_modules/debug/karma.conf.js
new file mode 100644 (file)
index 0000000..103a82d
--- /dev/null
@@ -0,0 +1,70 @@
+// Karma configuration
+// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC)
+
+module.exports = function(config) {
+  config.set({
+
+    // base path that will be used to resolve all patterns (eg. files, exclude)
+    basePath: '',
+
+
+    // frameworks to use
+    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
+    frameworks: ['mocha', 'chai', 'sinon'],
+
+
+    // list of files / patterns to load in the browser
+    files: [
+      'dist/debug.js',
+      'test/*spec.js'
+    ],
+
+
+    // list of files to exclude
+    exclude: [
+      'src/node.js'
+    ],
+
+
+    // preprocess matching files before serving them to the browser
+    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
+    preprocessors: {
+    },
+
+    // test results reporter to use
+    // possible values: 'dots', 'progress'
+    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
+    reporters: ['progress'],
+
+
+    // web server port
+    port: 9876,
+
+
+    // enable / disable colors in the output (reporters and logs)
+    colors: true,
+
+
+    // level of logging
+    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
+    logLevel: config.LOG_INFO,
+
+
+    // enable / disable watching file and executing tests whenever any file changes
+    autoWatch: true,
+
+
+    // start these browsers
+    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
+    browsers: ['PhantomJS'],
+
+
+    // Continuous Integration mode
+    // if true, Karma captures browsers, runs the tests and exits
+    singleRun: false,
+
+    // Concurrency level
+    // how many browser should be started simultaneous
+    concurrency: Infinity
+  })
+}
diff --git a/wrt/node_modules/engine.io/node_modules/debug/node.js b/wrt/node_modules/engine.io/node_modules/debug/node.js
new file mode 100644 (file)
index 0000000..7fc36fe
--- /dev/null
@@ -0,0 +1 @@
+module.exports = require('./src/node');
diff --git a/wrt/node_modules/engine.io/node_modules/debug/package.json b/wrt/node_modules/engine.io/node_modules/debug/package.json
new file mode 100644 (file)
index 0000000..4c997d2
--- /dev/null
@@ -0,0 +1,148 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "debug@~2.6.6",
+        "scope": null,
+        "escapedName": "debug",
+        "name": "debug",
+        "rawSpec": "~2.6.6",
+        "spec": ">=2.6.6 <2.7.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io"
+    ],
+    [
+      {
+        "raw": "debug@~2.6.4",
+        "scope": null,
+        "escapedName": "debug",
+        "name": "debug",
+        "rawSpec": "~2.6.4",
+        "spec": ">=2.6.4 <2.7.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io"
+    ]
+  ],
+  "_from": "debug@~2.6.4",
+  "_id": "debug@2.6.9",
+  "_inCache": true,
+  "_location": "/engine.io/debug",
+  "_nodeVersion": "8.4.0",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/debug-2.6.9.tgz_1506087154503_0.5196126794908196"
+  },
+  "_npmUser": {
+    "name": "tootallnate",
+    "email": "nathan@tootallnate.net"
+  },
+  "_npmVersion": "5.3.0",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "debug@~2.6.4",
+    "scope": null,
+    "escapedName": "debug",
+    "name": "debug",
+    "rawSpec": "~2.6.4",
+    "spec": ">=2.6.4 <2.7.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/engine.io"
+  ],
+  "_resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+  "_shasum": "5d128515df134ff327e90a4c93f4e077a536341f",
+  "_shrinkwrap": null,
+  "_spec": "debug@~2.6.4",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io",
+  "author": {
+    "name": "TJ Holowaychuk",
+    "email": "tj@vision-media.ca"
+  },
+  "browser": "./src/browser.js",
+  "bugs": {
+    "url": "https://github.com/visionmedia/debug/issues"
+  },
+  "component": {
+    "scripts": {
+      "debug/index.js": "browser.js",
+      "debug/debug.js": "debug.js"
+    }
+  },
+  "contributors": [
+    {
+      "name": "Nathan Rajlich",
+      "email": "nathan@tootallnate.net",
+      "url": "http://n8.io"
+    },
+    {
+      "name": "Andrew Rhyne",
+      "email": "rhyneandrew@gmail.com"
+    }
+  ],
+  "dependencies": {
+    "ms": "2.0.0"
+  },
+  "description": "small debugging utility",
+  "devDependencies": {
+    "browserify": "9.0.3",
+    "chai": "^3.5.0",
+    "concurrently": "^3.1.0",
+    "coveralls": "^2.11.15",
+    "eslint": "^3.12.1",
+    "istanbul": "^0.4.5",
+    "karma": "^1.3.0",
+    "karma-chai": "^0.1.0",
+    "karma-mocha": "^1.3.0",
+    "karma-phantomjs-launcher": "^1.0.2",
+    "karma-sinon": "^1.0.5",
+    "mocha": "^3.2.0",
+    "mocha-lcov-reporter": "^1.2.0",
+    "rimraf": "^2.5.4",
+    "sinon": "^1.17.6",
+    "sinon-chai": "^2.8.0"
+  },
+  "directories": {},
+  "dist": {
+    "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+    "shasum": "5d128515df134ff327e90a4c93f4e077a536341f",
+    "tarball": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz"
+  },
+  "gitHead": "13abeae468fea297d0dccc50bc55590809241083",
+  "homepage": "https://github.com/visionmedia/debug#readme",
+  "keywords": [
+    "debug",
+    "log",
+    "debugger"
+  ],
+  "license": "MIT",
+  "main": "./src/index.js",
+  "maintainers": [
+    {
+      "name": "thebigredgeek",
+      "email": "rhyneandrew@gmail.com"
+    },
+    {
+      "name": "kolban",
+      "email": "kolban1@kolban.com"
+    },
+    {
+      "name": "tootallnate",
+      "email": "nathan@tootallnate.net"
+    },
+    {
+      "name": "tjholowaychuk",
+      "email": "tj@vision-media.ca"
+    }
+  ],
+  "name": "debug",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/visionmedia/debug.git"
+  },
+  "version": "2.6.9"
+}
diff --git a/wrt/node_modules/engine.io/node_modules/debug/src/browser.js b/wrt/node_modules/engine.io/node_modules/debug/src/browser.js
new file mode 100644 (file)
index 0000000..7106924
--- /dev/null
@@ -0,0 +1,185 @@
+/**
+ * This is the web browser implementation of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = require('./debug');
+exports.log = log;
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+exports.storage = 'undefined' != typeof chrome
+               && 'undefined' != typeof chrome.storage
+                  ? chrome.storage.local
+                  : localstorage();
+
+/**
+ * Colors.
+ */
+
+exports.colors = [
+  'lightseagreen',
+  'forestgreen',
+  'goldenrod',
+  'dodgerblue',
+  'darkorchid',
+  'crimson'
+];
+
+/**
+ * Currently only WebKit-based Web Inspectors, Firefox >= v31,
+ * and the Firebug extension (any Firefox version) are known
+ * to support "%c" CSS customizations.
+ *
+ * TODO: add a `localStorage` variable to explicitly enable/disable colors
+ */
+
+function useColors() {
+  // NB: In an Electron preload script, document will be defined but not fully
+  // initialized. Since we know we're in Chrome, we'll just detect this case
+  // explicitly
+  if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
+    return true;
+  }
+
+  // is webkit? http://stackoverflow.com/a/16459606/376773
+  // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
+  return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
+    // is firebug? http://stackoverflow.com/a/398120/376773
+    (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
+    // is firefox >= v31?
+    // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
+    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
+    // double check webkit in userAgent just in case we are in a worker
+    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
+}
+
+/**
+ * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
+ */
+
+exports.formatters.j = function(v) {
+  try {
+    return JSON.stringify(v);
+  } catch (err) {
+    return '[UnexpectedJSONParseError]: ' + err.message;
+  }
+};
+
+
+/**
+ * Colorize log arguments if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+  var useColors = this.useColors;
+
+  args[0] = (useColors ? '%c' : '')
+    + this.namespace
+    + (useColors ? ' %c' : ' ')
+    + args[0]
+    + (useColors ? '%c ' : ' ')
+    + '+' + exports.humanize(this.diff);
+
+  if (!useColors) return;
+
+  var c = 'color: ' + this.color;
+  args.splice(1, 0, c, 'color: inherit')
+
+  // the final "%c" is somewhat tricky, because there could be other
+  // arguments passed either before or after the %c, so we need to
+  // figure out the correct index to insert the CSS into
+  var index = 0;
+  var lastC = 0;
+  args[0].replace(/%[a-zA-Z%]/g, function(match) {
+    if ('%%' === match) return;
+    index++;
+    if ('%c' === match) {
+      // we only are interested in the *last* %c
+      // (the user may have provided their own)
+      lastC = index;
+    }
+  });
+
+  args.splice(lastC, 0, c);
+}
+
+/**
+ * Invokes `console.log()` when available.
+ * No-op when `console.log` is not a "function".
+ *
+ * @api public
+ */
+
+function log() {
+  // this hackery is required for IE8/9, where
+  // the `console.log` function doesn't have 'apply'
+  return 'object' === typeof console
+    && console.log
+    && Function.prototype.apply.call(console.log, console, arguments);
+}
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+
+function save(namespaces) {
+  try {
+    if (null == namespaces) {
+      exports.storage.removeItem('debug');
+    } else {
+      exports.storage.debug = namespaces;
+    }
+  } catch(e) {}
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+
+function load() {
+  var r;
+  try {
+    r = exports.storage.debug;
+  } catch(e) {}
+
+  // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
+  if (!r && typeof process !== 'undefined' && 'env' in process) {
+    r = process.env.DEBUG;
+  }
+
+  return r;
+}
+
+/**
+ * Enable namespaces listed in `localStorage.debug` initially.
+ */
+
+exports.enable(load());
+
+/**
+ * Localstorage attempts to return the localstorage.
+ *
+ * This is necessary because safari throws
+ * when a user disables cookies/localstorage
+ * and you attempt to access it.
+ *
+ * @return {LocalStorage}
+ * @api private
+ */
+
+function localstorage() {
+  try {
+    return window.localStorage;
+  } catch (e) {}
+}
diff --git a/wrt/node_modules/engine.io/node_modules/debug/src/debug.js b/wrt/node_modules/engine.io/node_modules/debug/src/debug.js
new file mode 100644 (file)
index 0000000..6a5e3fc
--- /dev/null
@@ -0,0 +1,202 @@
+
+/**
+ * This is the common logic for both the Node.js and web browser
+ * implementations of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
+exports.coerce = coerce;
+exports.disable = disable;
+exports.enable = enable;
+exports.enabled = enabled;
+exports.humanize = require('ms');
+
+/**
+ * The currently active debug mode names, and names to skip.
+ */
+
+exports.names = [];
+exports.skips = [];
+
+/**
+ * Map of special "%n" handling functions, for the debug "format" argument.
+ *
+ * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
+ */
+
+exports.formatters = {};
+
+/**
+ * Previous log timestamp.
+ */
+
+var prevTime;
+
+/**
+ * Select a color.
+ * @param {String} namespace
+ * @return {Number}
+ * @api private
+ */
+
+function selectColor(namespace) {
+  var hash = 0, i;
+
+  for (i in namespace) {
+    hash  = ((hash << 5) - hash) + namespace.charCodeAt(i);
+    hash |= 0; // Convert to 32bit integer
+  }
+
+  return exports.colors[Math.abs(hash) % exports.colors.length];
+}
+
+/**
+ * Create a debugger with the given `namespace`.
+ *
+ * @param {String} namespace
+ * @return {Function}
+ * @api public
+ */
+
+function createDebug(namespace) {
+
+  function debug() {
+    // disabled?
+    if (!debug.enabled) return;
+
+    var self = debug;
+
+    // set `diff` timestamp
+    var curr = +new Date();
+    var ms = curr - (prevTime || curr);
+    self.diff = ms;
+    self.prev = prevTime;
+    self.curr = curr;
+    prevTime = curr;
+
+    // turn the `arguments` into a proper Array
+    var args = new Array(arguments.length);
+    for (var i = 0; i < args.length; i++) {
+      args[i] = arguments[i];
+    }
+
+    args[0] = exports.coerce(args[0]);
+
+    if ('string' !== typeof args[0]) {
+      // anything else let's inspect with %O
+      args.unshift('%O');
+    }
+
+    // apply any `formatters` transformations
+    var index = 0;
+    args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
+      // if we encounter an escaped % then don't increase the array index
+      if (match === '%%') return match;
+      index++;
+      var formatter = exports.formatters[format];
+      if ('function' === typeof formatter) {
+        var val = args[index];
+        match = formatter.call(self, val);
+
+        // now we need to remove `args[index]` since it's inlined in the `format`
+        args.splice(index, 1);
+        index--;
+      }
+      return match;
+    });
+
+    // apply env-specific formatting (colors, etc.)
+    exports.formatArgs.call(self, args);
+
+    var logFn = debug.log || exports.log || console.log.bind(console);
+    logFn.apply(self, args);
+  }
+
+  debug.namespace = namespace;
+  debug.enabled = exports.enabled(namespace);
+  debug.useColors = exports.useColors();
+  debug.color = selectColor(namespace);
+
+  // env-specific initialization logic for debug instances
+  if ('function' === typeof exports.init) {
+    exports.init(debug);
+  }
+
+  return debug;
+}
+
+/**
+ * Enables a debug mode by namespaces. This can include modes
+ * separated by a colon and wildcards.
+ *
+ * @param {String} namespaces
+ * @api public
+ */
+
+function enable(namespaces) {
+  exports.save(namespaces);
+
+  exports.names = [];
+  exports.skips = [];
+
+  var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
+  var len = split.length;
+
+  for (var i = 0; i < len; i++) {
+    if (!split[i]) continue; // ignore empty strings
+    namespaces = split[i].replace(/\*/g, '.*?');
+    if (namespaces[0] === '-') {
+      exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
+    } else {
+      exports.names.push(new RegExp('^' + namespaces + '$'));
+    }
+  }
+}
+
+/**
+ * Disable debug output.
+ *
+ * @api public
+ */
+
+function disable() {
+  exports.enable('');
+}
+
+/**
+ * Returns true if the given mode name is enabled, false otherwise.
+ *
+ * @param {String} name
+ * @return {Boolean}
+ * @api public
+ */
+
+function enabled(name) {
+  var i, len;
+  for (i = 0, len = exports.skips.length; i < len; i++) {
+    if (exports.skips[i].test(name)) {
+      return false;
+    }
+  }
+  for (i = 0, len = exports.names.length; i < len; i++) {
+    if (exports.names[i].test(name)) {
+      return true;
+    }
+  }
+  return false;
+}
+
+/**
+ * Coerce `val`.
+ *
+ * @param {Mixed} val
+ * @return {Mixed}
+ * @api private
+ */
+
+function coerce(val) {
+  if (val instanceof Error) return val.stack || val.message;
+  return val;
+}
diff --git a/wrt/node_modules/engine.io/node_modules/debug/src/index.js b/wrt/node_modules/engine.io/node_modules/debug/src/index.js
new file mode 100644 (file)
index 0000000..e12cf4d
--- /dev/null
@@ -0,0 +1,10 @@
+/**
+ * Detect Electron renderer process, which is node, but we should
+ * treat as a browser.
+ */
+
+if (typeof process !== 'undefined' && process.type === 'renderer') {
+  module.exports = require('./browser.js');
+} else {
+  module.exports = require('./node.js');
+}
diff --git a/wrt/node_modules/engine.io/node_modules/debug/src/inspector-log.js b/wrt/node_modules/engine.io/node_modules/debug/src/inspector-log.js
new file mode 100644 (file)
index 0000000..60ea6c0
--- /dev/null
@@ -0,0 +1,15 @@
+module.exports = inspectorLog;
+
+// black hole
+const nullStream = new (require('stream').Writable)();
+nullStream._write = () => {};
+
+/**
+ * Outputs a `console.log()` to the Node.js Inspector console *only*.
+ */
+function inspectorLog() {
+  const stdout = console._stdout;
+  console._stdout = nullStream;
+  console.log.apply(console, arguments);
+  console._stdout = stdout;
+}
diff --git a/wrt/node_modules/engine.io/node_modules/debug/src/node.js b/wrt/node_modules/engine.io/node_modules/debug/src/node.js
new file mode 100644 (file)
index 0000000..b15109c
--- /dev/null
@@ -0,0 +1,248 @@
+/**
+ * Module dependencies.
+ */
+
+var tty = require('tty');
+var util = require('util');
+
+/**
+ * This is the Node.js implementation of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = require('./debug');
+exports.init = init;
+exports.log = log;
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+
+/**
+ * Colors.
+ */
+
+exports.colors = [6, 2, 3, 4, 5, 1];
+
+/**
+ * Build up the default `inspectOpts` object from the environment variables.
+ *
+ *   $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
+ */
+
+exports.inspectOpts = Object.keys(process.env).filter(function (key) {
+  return /^debug_/i.test(key);
+}).reduce(function (obj, key) {
+  // camel-case
+  var prop = key
+    .substring(6)
+    .toLowerCase()
+    .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });
+
+  // coerce string value into JS value
+  var val = process.env[key];
+  if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
+  else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
+  else if (val === 'null') val = null;
+  else val = Number(val);
+
+  obj[prop] = val;
+  return obj;
+}, {});
+
+/**
+ * The file descriptor to write the `debug()` calls to.
+ * Set the `DEBUG_FD` env variable to override with another value. i.e.:
+ *
+ *   $ DEBUG_FD=3 node script.js 3>debug.log
+ */
+
+var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
+
+if (1 !== fd && 2 !== fd) {
+  util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')()
+}
+
+var stream = 1 === fd ? process.stdout :
+             2 === fd ? process.stderr :
+             createWritableStdioStream(fd);
+
+/**
+ * Is stdout a TTY? Colored output is enabled when `true`.
+ */
+
+function useColors() {
+  return 'colors' in exports.inspectOpts
+    ? Boolean(exports.inspectOpts.colors)
+    : tty.isatty(fd);
+}
+
+/**
+ * Map %o to `util.inspect()`, all on a single line.
+ */
+
+exports.formatters.o = function(v) {
+  this.inspectOpts.colors = this.useColors;
+  return util.inspect(v, this.inspectOpts)
+    .split('\n').map(function(str) {
+      return str.trim()
+    }).join(' ');
+};
+
+/**
+ * Map %o to `util.inspect()`, allowing multiple lines if needed.
+ */
+
+exports.formatters.O = function(v) {
+  this.inspectOpts.colors = this.useColors;
+  return util.inspect(v, this.inspectOpts);
+};
+
+/**
+ * Adds ANSI color escape codes if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+  var name = this.namespace;
+  var useColors = this.useColors;
+
+  if (useColors) {
+    var c = this.color;
+    var prefix = '  \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m';
+
+    args[0] = prefix + args[0].split('\n').join('\n' + prefix);
+    args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m');
+  } else {
+    args[0] = new Date().toUTCString()
+      + ' ' + name + ' ' + args[0];
+  }
+}
+
+/**
+ * Invokes `util.format()` with the specified arguments and writes to `stream`.
+ */
+
+function log() {
+  return stream.write(util.format.apply(util, arguments) + '\n');
+}
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+
+function save(namespaces) {
+  if (null == namespaces) {
+    // If you set a process.env field to null or undefined, it gets cast to the
+    // string 'null' or 'undefined'. Just delete instead.
+    delete process.env.DEBUG;
+  } else {
+    process.env.DEBUG = namespaces;
+  }
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+
+function load() {
+  return process.env.DEBUG;
+}
+
+/**
+ * Copied from `node/src/node.js`.
+ *
+ * XXX: It's lame that node doesn't expose this API out-of-the-box. It also
+ * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.
+ */
+
+function createWritableStdioStream (fd) {
+  var stream;
+  var tty_wrap = process.binding('tty_wrap');
+
+  // Note stream._type is used for test-module-load-list.js
+
+  switch (tty_wrap.guessHandleType(fd)) {
+    case 'TTY':
+      stream = new tty.WriteStream(fd);
+      stream._type = 'tty';
+
+      // Hack to have stream not keep the event loop alive.
+      // See https://github.com/joyent/node/issues/1726
+      if (stream._handle && stream._handle.unref) {
+        stream._handle.unref();
+      }
+      break;
+
+    case 'FILE':
+      var fs = require('fs');
+      stream = new fs.SyncWriteStream(fd, { autoClose: false });
+      stream._type = 'fs';
+      break;
+
+    case 'PIPE':
+    case 'TCP':
+      var net = require('net');
+      stream = new net.Socket({
+        fd: fd,
+        readable: false,
+        writable: true
+      });
+
+      // FIXME Should probably have an option in net.Socket to create a
+      // stream from an existing fd which is writable only. But for now
+      // we'll just add this hack and set the `readable` member to false.
+      // Test: ./node test/fixtures/echo.js < /etc/passwd
+      stream.readable = false;
+      stream.read = null;
+      stream._type = 'pipe';
+
+      // FIXME Hack to have stream not keep the event loop alive.
+      // See https://github.com/joyent/node/issues/1726
+      if (stream._handle && stream._handle.unref) {
+        stream._handle.unref();
+      }
+      break;
+
+    default:
+      // Probably an error on in uv_guess_handle()
+      throw new Error('Implement me. Unknown stream file type!');
+  }
+
+  // For supporting legacy API we put the FD here.
+  stream.fd = fd;
+
+  stream._isStdio = true;
+
+  return stream;
+}
+
+/**
+ * Init logic for `debug` instances.
+ *
+ * Create a new `inspectOpts` object in case `useColors` is set
+ * differently for a particular `debug` instance.
+ */
+
+function init (debug) {
+  debug.inspectOpts = {};
+
+  var keys = Object.keys(exports.inspectOpts);
+  for (var i = 0; i < keys.length; i++) {
+    debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
+  }
+}
+
+/**
+ * Enable namespaces listed in `process.env.DEBUG` initially.
+ */
+
+exports.enable(load());
diff --git a/wrt/node_modules/engine.io/package.json b/wrt/node_modules/engine.io/package.json
new file mode 100644 (file)
index 0000000..c21caa1
--- /dev/null
@@ -0,0 +1,136 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "engine.io@~3.1.0",
+        "scope": null,
+        "escapedName": "engine.io",
+        "name": "engine.io",
+        "rawSpec": "~3.1.0",
+        "spec": ">=3.1.0 <3.2.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io"
+    ]
+  ],
+  "_from": "engine.io@>=3.1.0 <3.2.0",
+  "_id": "engine.io@3.1.1",
+  "_inCache": true,
+  "_location": "/engine.io",
+  "_nodeVersion": "6.10.3",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/engine.io-3.1.1.tgz_1504355028134_0.09010417922399938"
+  },
+  "_npmUser": {
+    "name": "darrachequesne",
+    "email": "damien.arrachequesne@gmail.com"
+  },
+  "_npmVersion": "3.10.10",
+  "_phantomChildren": {
+    "ms": "2.0.0"
+  },
+  "_requested": {
+    "raw": "engine.io@~3.1.0",
+    "scope": null,
+    "escapedName": "engine.io",
+    "name": "engine.io",
+    "rawSpec": "~3.1.0",
+    "spec": ">=3.1.0 <3.2.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/socket.io"
+  ],
+  "_resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.1.1.tgz",
+  "_shasum": "08051ffb951907a3267e72e0bcb3d0f377e4660b",
+  "_shrinkwrap": null,
+  "_spec": "engine.io@~3.1.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io",
+  "author": {
+    "name": "Guillermo Rauch",
+    "email": "guillermo@learnboost.com"
+  },
+  "bugs": {
+    "url": "https://github.com/socketio/engine.io/issues"
+  },
+  "contributors": [
+    {
+      "name": "Eugen Dueck",
+      "url": "https://github.com/EugenDueck"
+    },
+    {
+      "name": "Afshin Mehrabani",
+      "url": "https://github.com/afshinm"
+    },
+    {
+      "name": "Christoph Dorn",
+      "url": "https://github.com/cadorn"
+    },
+    {
+      "name": "Mark Mokryn",
+      "email": "mokesmokes@gmail.com"
+    }
+  ],
+  "dependencies": {
+    "accepts": "1.3.3",
+    "base64id": "1.0.0",
+    "cookie": "0.3.1",
+    "debug": "~2.6.4",
+    "engine.io-parser": "~2.1.0",
+    "uws": "~0.14.4",
+    "ws": "~2.3.1"
+  },
+  "description": "The realtime engine behind Socket.IO. Provides the foundation of a bidirectional connection between client and server",
+  "devDependencies": {
+    "babel-eslint": "^7.2.3",
+    "babel-preset-es2015": "^6.24.0",
+    "engine.io-client": "^3.1.1",
+    "eslint": "^4.5.0",
+    "eslint-config-standard": "^10.2.1",
+    "eslint-plugin-import": "^2.7.0",
+    "eslint-plugin-node": "^5.1.1",
+    "eslint-plugin-promise": "^3.5.0",
+    "eslint-plugin-standard": "^3.0.1",
+    "expect.js": "^0.3.1",
+    "mocha": "^3.2.0",
+    "s": "0.1.1",
+    "superagent": "0.15.4"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "08051ffb951907a3267e72e0bcb3d0f377e4660b",
+    "tarball": "https://registry.npmjs.org/engine.io/-/engine.io-3.1.1.tgz"
+  },
+  "files": [
+    "lib/"
+  ],
+  "gitHead": "a8ff89cd140641bd9797eb18cd79a7762dd64018",
+  "homepage": "https://github.com/socketio/engine.io",
+  "license": "MIT",
+  "main": "lib/engine.io",
+  "maintainers": [
+    {
+      "name": "darrachequesne",
+      "email": "damien.arrachequesne@gmail.com"
+    },
+    {
+      "name": "rauchg",
+      "email": "rauchg@gmail.com"
+    }
+  ],
+  "name": "engine.io",
+  "optionalDependencies": {
+    "uws": "~0.14.4"
+  },
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+ssh://git@github.com/socketio/engine.io.git"
+  },
+  "scripts": {
+    "lint": "eslint lib/ test/ *.js",
+    "test": "npm run lint && mocha && EIO_WS_ENGINE=ws mocha"
+  },
+  "version": "3.1.1"
+}
diff --git a/wrt/node_modules/escape-html/LICENSE b/wrt/node_modules/escape-html/LICENSE
new file mode 100644 (file)
index 0000000..2e70de9
--- /dev/null
@@ -0,0 +1,24 @@
+(The MIT License)
+
+Copyright (c) 2012-2013 TJ Holowaychuk
+Copyright (c) 2015 Andreas Lubbe
+Copyright (c) 2015 Tiancheng "Timothy" Gu
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/escape-html/Readme.md b/wrt/node_modules/escape-html/Readme.md
new file mode 100644 (file)
index 0000000..653d9ea
--- /dev/null
@@ -0,0 +1,43 @@
+
+# escape-html
+
+  Escape string for use in HTML
+
+## Example
+
+```js
+var escape = require('escape-html');
+var html = escape('foo & bar');
+// -> foo &amp; bar
+```
+
+## Benchmark
+
+```
+$ npm run-script bench
+
+> escape-html@1.0.3 bench nodejs-escape-html
+> node benchmark/index.js
+
+
+  http_parser@1.0
+  node@0.10.33
+  v8@3.14.5.9
+  ares@1.9.0-DEV
+  uv@0.10.29
+  zlib@1.2.3
+  modules@11
+  openssl@1.0.1j
+
+  1 test completed.
+  2 tests completed.
+  3 tests completed.
+
+  no special characters    x 19,435,271 ops/sec ±0.85% (187 runs sampled)
+  single special character x  6,132,421 ops/sec ±0.67% (194 runs sampled)
+  many special characters  x  3,175,826 ops/sec ±0.65% (193 runs sampled)
+```
+
+## License
+
+  MIT
\ No newline at end of file
diff --git a/wrt/node_modules/escape-html/index.js b/wrt/node_modules/escape-html/index.js
new file mode 100644 (file)
index 0000000..bf9e226
--- /dev/null
@@ -0,0 +1,78 @@
+/*!
+ * escape-html
+ * Copyright(c) 2012-2013 TJ Holowaychuk
+ * Copyright(c) 2015 Andreas Lubbe
+ * Copyright(c) 2015 Tiancheng "Timothy" Gu
+ * MIT Licensed
+ */
+
+'use strict';
+
+/**
+ * Module variables.
+ * @private
+ */
+
+var matchHtmlRegExp = /["'&<>]/;
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = escapeHtml;
+
+/**
+ * Escape special characters in the given string of html.
+ *
+ * @param  {string} string The string to escape for inserting into HTML
+ * @return {string}
+ * @public
+ */
+
+function escapeHtml(string) {
+  var str = '' + string;
+  var match = matchHtmlRegExp.exec(str);
+
+  if (!match) {
+    return str;
+  }
+
+  var escape;
+  var html = '';
+  var index = 0;
+  var lastIndex = 0;
+
+  for (index = match.index; index < str.length; index++) {
+    switch (str.charCodeAt(index)) {
+      case 34: // "
+        escape = '&quot;';
+        break;
+      case 38: // &
+        escape = '&amp;';
+        break;
+      case 39: // '
+        escape = '&#39;';
+        break;
+      case 60: // <
+        escape = '&lt;';
+        break;
+      case 62: // >
+        escape = '&gt;';
+        break;
+      default:
+        continue;
+    }
+
+    if (lastIndex !== index) {
+      html += str.substring(lastIndex, index);
+    }
+
+    lastIndex = index + 1;
+    html += escape;
+  }
+
+  return lastIndex !== index
+    ? html + str.substring(lastIndex, index)
+    : html;
+}
diff --git a/wrt/node_modules/escape-html/package.json b/wrt/node_modules/escape-html/package.json
new file mode 100644 (file)
index 0000000..3d6c97e
--- /dev/null
@@ -0,0 +1,94 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "escape-html@~1.0.3",
+        "scope": null,
+        "escapedName": "escape-html",
+        "name": "escape-html",
+        "rawSpec": "~1.0.3",
+        "spec": ">=1.0.3 <1.1.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express"
+    ]
+  ],
+  "_from": "escape-html@>=1.0.3 <1.1.0",
+  "_id": "escape-html@1.0.3",
+  "_inCache": true,
+  "_location": "/escape-html",
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "1.4.28",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "escape-html@~1.0.3",
+    "scope": null,
+    "escapedName": "escape-html",
+    "name": "escape-html",
+    "rawSpec": "~1.0.3",
+    "spec": ">=1.0.3 <1.1.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/express",
+    "/finalhandler",
+    "/send",
+    "/serve-static"
+  ],
+  "_resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
+  "_shasum": "0258eae4d3d0c0974de1c169188ef0051d1d1988",
+  "_shrinkwrap": null,
+  "_spec": "escape-html@~1.0.3",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express",
+  "bugs": {
+    "url": "https://github.com/component/escape-html/issues"
+  },
+  "dependencies": {},
+  "description": "Escape string for use in HTML",
+  "devDependencies": {
+    "beautify-benchmark": "0.2.4",
+    "benchmark": "1.0.0"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "0258eae4d3d0c0974de1c169188ef0051d1d1988",
+    "tarball": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz"
+  },
+  "files": [
+    "LICENSE",
+    "Readme.md",
+    "index.js"
+  ],
+  "gitHead": "7ac2ea3977fcac3d4c5be8d2a037812820c65f28",
+  "homepage": "https://github.com/component/escape-html",
+  "keywords": [
+    "escape",
+    "html",
+    "utility"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "tjholowaychuk",
+      "email": "tj@vision-media.ca"
+    },
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "name": "escape-html",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/component/escape-html.git"
+  },
+  "scripts": {
+    "bench": "node benchmark/index.js"
+  },
+  "version": "1.0.3"
+}
diff --git a/wrt/node_modules/escape-string-regexp/index.js b/wrt/node_modules/escape-string-regexp/index.js
new file mode 100644 (file)
index 0000000..7834bf9
--- /dev/null
@@ -0,0 +1,11 @@
+'use strict';
+
+var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
+
+module.exports = function (str) {
+       if (typeof str !== 'string') {
+               throw new TypeError('Expected a string');
+       }
+
+       return str.replace(matchOperatorsRe, '\\$&');
+};
diff --git a/wrt/node_modules/escape-string-regexp/license b/wrt/node_modules/escape-string-regexp/license
new file mode 100644 (file)
index 0000000..654d0bf
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/escape-string-regexp/package.json b/wrt/node_modules/escape-string-regexp/package.json
new file mode 100644 (file)
index 0000000..1762401
--- /dev/null
@@ -0,0 +1,109 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "escape-string-regexp@^1.0.5",
+        "scope": null,
+        "escapedName": "escape-string-regexp",
+        "name": "escape-string-regexp",
+        "rawSpec": "^1.0.5",
+        "spec": ">=1.0.5 <2.0.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/chalk"
+    ]
+  ],
+  "_from": "escape-string-regexp@>=1.0.5 <2.0.0",
+  "_id": "escape-string-regexp@1.0.5",
+  "_inCache": true,
+  "_location": "/escape-string-regexp",
+  "_nodeVersion": "4.2.6",
+  "_npmOperationalInternal": {
+    "host": "packages-9-west.internal.npmjs.com",
+    "tmp": "tmp/escape-string-regexp-1.0.5.tgz_1456059312074_0.7245344955008477"
+  },
+  "_npmUser": {
+    "name": "jbnicolai",
+    "email": "jappelman@xebia.com"
+  },
+  "_npmVersion": "2.14.12",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "escape-string-regexp@^1.0.5",
+    "scope": null,
+    "escapedName": "escape-string-regexp",
+    "name": "escape-string-regexp",
+    "rawSpec": "^1.0.5",
+    "spec": ">=1.0.5 <2.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/chalk"
+  ],
+  "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+  "_shasum": "1b61c0562190a8dff6ae3bb2cf0200ca130b86d4",
+  "_shrinkwrap": null,
+  "_spec": "escape-string-regexp@^1.0.5",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/chalk",
+  "author": {
+    "name": "Sindre Sorhus",
+    "email": "sindresorhus@gmail.com",
+    "url": "sindresorhus.com"
+  },
+  "bugs": {
+    "url": "https://github.com/sindresorhus/escape-string-regexp/issues"
+  },
+  "dependencies": {},
+  "description": "Escape RegExp special characters",
+  "devDependencies": {
+    "ava": "*",
+    "xo": "*"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "1b61c0562190a8dff6ae3bb2cf0200ca130b86d4",
+    "tarball": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz"
+  },
+  "engines": {
+    "node": ">=0.8.0"
+  },
+  "files": [
+    "index.js"
+  ],
+  "gitHead": "db124a3e1aae9d692c4899e42a5c6c3e329eaa20",
+  "homepage": "https://github.com/sindresorhus/escape-string-regexp",
+  "keywords": [
+    "escape",
+    "regex",
+    "regexp",
+    "re",
+    "regular",
+    "expression",
+    "string",
+    "str",
+    "special",
+    "characters"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "sindresorhus",
+      "email": "sindresorhus@gmail.com"
+    },
+    {
+      "name": "jbnicolai",
+      "email": "jappelman@xebia.com"
+    }
+  ],
+  "name": "escape-string-regexp",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/sindresorhus/escape-string-regexp.git"
+  },
+  "scripts": {
+    "test": "xo && ava"
+  },
+  "version": "1.0.5"
+}
diff --git a/wrt/node_modules/escape-string-regexp/readme.md b/wrt/node_modules/escape-string-regexp/readme.md
new file mode 100644 (file)
index 0000000..87ac82d
--- /dev/null
@@ -0,0 +1,27 @@
+# escape-string-regexp [![Build Status](https://travis-ci.org/sindresorhus/escape-string-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/escape-string-regexp)
+
+> Escape RegExp special characters
+
+
+## Install
+
+```
+$ npm install --save escape-string-regexp
+```
+
+
+## Usage
+
+```js
+const escapeStringRegexp = require('escape-string-regexp');
+
+const escapedString = escapeStringRegexp('how much $ for a unicorn?');
+//=> 'how much \$ for a unicorn\?'
+
+new RegExp(escapedString);
+```
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/wrt/node_modules/etag/HISTORY.md b/wrt/node_modules/etag/HISTORY.md
new file mode 100644 (file)
index 0000000..222b293
--- /dev/null
@@ -0,0 +1,83 @@
+1.8.1 / 2017-09-12
+==================
+
+  * perf: replace regular expression with substring
+
+1.8.0 / 2017-02-18
+==================
+
+  * Use SHA1 instead of MD5 for ETag hashing
+    - Improves performance for larger entities
+    - Works with FIPS 140-2 OpenSSL configuration
+
+1.7.0 / 2015-06-08
+==================
+
+  * Always include entity length in ETags for hash length extensions
+  * Generate non-Stats ETags using MD5 only (no longer CRC32)
+  * Improve stat performance by removing hashing
+  * Remove base64 padding in ETags to shorten
+  * Use MD5 instead of MD4 in weak ETags over 1KB
+
+1.6.0 / 2015-05-10
+==================
+
+  * Improve support for JXcore
+  * Remove requirement of `atime` in the stats object
+  * Support "fake" stats objects in environments without `fs`
+
+1.5.1 / 2014-11-19
+==================
+
+  * deps: crc@3.2.1
+    - Minor fixes
+
+1.5.0 / 2014-10-14
+==================
+
+  * Improve string performance
+  * Slightly improve speed for weak ETags over 1KB
+
+1.4.0 / 2014-09-21
+==================
+
+  * Support "fake" stats objects
+  * Support Node.js 0.6
+
+1.3.1 / 2014-09-14
+==================
+
+  * Use the (new and improved) `crc` for crc32
+
+1.3.0 / 2014-08-29
+==================
+
+  * Default strings to strong ETags
+  * Improve speed for weak ETags over 1KB
+
+1.2.1 / 2014-08-29
+==================
+
+  * Use the (much faster) `buffer-crc32` for crc32
+
+1.2.0 / 2014-08-24
+==================
+
+  * Add support for file stat objects
+
+1.1.0 / 2014-08-24
+==================
+
+  * Add fast-path for empty entity
+  * Add weak ETag generation
+  * Shrink size of generated ETags
+
+1.0.1 / 2014-08-24
+==================
+
+  * Fix behavior of string containing Unicode
+
+1.0.0 / 2014-05-18
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/etag/LICENSE b/wrt/node_modules/etag/LICENSE
new file mode 100644 (file)
index 0000000..cab251c
--- /dev/null
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2014-2016 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/etag/README.md b/wrt/node_modules/etag/README.md
new file mode 100644 (file)
index 0000000..09c2169
--- /dev/null
@@ -0,0 +1,159 @@
+# etag
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+Create simple HTTP ETags
+
+This module generates HTTP ETags (as defined in RFC 7232) for use in
+HTTP responses.
+
+## Installation
+
+This is a [Node.js](https://nodejs.org/en/) module available through the
+[npm registry](https://www.npmjs.com/). Installation is done using the
+[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
+
+```sh
+$ npm install etag
+```
+
+## API
+
+<!-- eslint-disable no-unused-vars -->
+
+```js
+var etag = require('etag')
+```
+
+### etag(entity, [options])
+
+Generate a strong ETag for the given entity. This should be the complete
+body of the entity. Strings, `Buffer`s, and `fs.Stats` are accepted. By
+default, a strong ETag is generated except for `fs.Stats`, which will
+generate a weak ETag (this can be overwritten by `options.weak`).
+
+<!-- eslint-disable no-undef -->
+
+```js
+res.setHeader('ETag', etag(body))
+```
+
+#### Options
+
+`etag` accepts these properties in the options object.
+
+##### weak
+
+Specifies if the generated ETag will include the weak validator mark (that
+is, the leading `W/`). The actual entity tag is the same. The default value
+is `false`, unless the `entity` is `fs.Stats`, in which case it is `true`.
+
+## Testing
+
+```sh
+$ npm test
+```
+
+## Benchmark
+
+```bash
+$ npm run-script bench
+
+> etag@1.8.1 bench nodejs-etag
+> node benchmark/index.js
+
+  http_parser@2.7.0
+  node@6.11.1
+  v8@5.1.281.103
+  uv@1.11.0
+  zlib@1.2.11
+  ares@1.10.1-DEV
+  icu@58.2
+  modules@48
+  openssl@1.0.2k
+
+> node benchmark/body0-100b.js
+
+  100B body
+
+  4 tests completed.
+
+  buffer - strong x 258,647 ops/sec ±1.07% (180 runs sampled)
+  buffer - weak   x 263,812 ops/sec ±0.61% (184 runs sampled)
+  string - strong x 259,955 ops/sec ±1.19% (185 runs sampled)
+  string - weak   x 264,356 ops/sec ±1.09% (184 runs sampled)
+
+> node benchmark/body1-1kb.js
+
+  1KB body
+
+  4 tests completed.
+
+  buffer - strong x 189,018 ops/sec ±1.12% (182 runs sampled)
+  buffer - weak   x 190,586 ops/sec ±0.81% (186 runs sampled)
+  string - strong x 144,272 ops/sec ±0.96% (188 runs sampled)
+  string - weak   x 145,380 ops/sec ±1.43% (187 runs sampled)
+
+> node benchmark/body2-5kb.js
+
+  5KB body
+
+  4 tests completed.
+
+  buffer - strong x 92,435 ops/sec ±0.42% (188 runs sampled)
+  buffer - weak   x 92,373 ops/sec ±0.58% (189 runs sampled)
+  string - strong x 48,850 ops/sec ±0.56% (186 runs sampled)
+  string - weak   x 49,380 ops/sec ±0.56% (190 runs sampled)
+
+> node benchmark/body3-10kb.js
+
+  10KB body
+
+  4 tests completed.
+
+  buffer - strong x 55,989 ops/sec ±0.93% (188 runs sampled)
+  buffer - weak   x 56,148 ops/sec ±0.55% (190 runs sampled)
+  string - strong x 27,345 ops/sec ±0.43% (188 runs sampled)
+  string - weak   x 27,496 ops/sec ±0.45% (190 runs sampled)
+
+> node benchmark/body4-100kb.js
+
+  100KB body
+
+  4 tests completed.
+
+  buffer - strong x 7,083 ops/sec ±0.22% (190 runs sampled)
+  buffer - weak   x 7,115 ops/sec ±0.26% (191 runs sampled)
+  string - strong x 3,068 ops/sec ±0.34% (190 runs sampled)
+  string - weak   x 3,096 ops/sec ±0.35% (190 runs sampled)
+
+> node benchmark/stats.js
+
+  stat
+
+  4 tests completed.
+
+  real - strong x 871,642 ops/sec ±0.34% (189 runs sampled)
+  real - weak   x 867,613 ops/sec ±0.39% (190 runs sampled)
+  fake - strong x 401,051 ops/sec ±0.40% (189 runs sampled)
+  fake - weak   x 400,100 ops/sec ±0.47% (188 runs sampled)
+```
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/etag.svg
+[npm-url]: https://npmjs.org/package/etag
+[node-version-image]: https://img.shields.io/node/v/etag.svg
+[node-version-url]: https://nodejs.org/en/download/
+[travis-image]: https://img.shields.io/travis/jshttp/etag/master.svg
+[travis-url]: https://travis-ci.org/jshttp/etag
+[coveralls-image]: https://img.shields.io/coveralls/jshttp/etag/master.svg
+[coveralls-url]: https://coveralls.io/r/jshttp/etag?branch=master
+[downloads-image]: https://img.shields.io/npm/dm/etag.svg
+[downloads-url]: https://npmjs.org/package/etag
diff --git a/wrt/node_modules/etag/index.js b/wrt/node_modules/etag/index.js
new file mode 100644 (file)
index 0000000..2a585c9
--- /dev/null
@@ -0,0 +1,131 @@
+/*!
+ * etag
+ * Copyright(c) 2014-2016 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = etag
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var crypto = require('crypto')
+var Stats = require('fs').Stats
+
+/**
+ * Module variables.
+ * @private
+ */
+
+var toString = Object.prototype.toString
+
+/**
+ * Generate an entity tag.
+ *
+ * @param {Buffer|string} entity
+ * @return {string}
+ * @private
+ */
+
+function entitytag (entity) {
+  if (entity.length === 0) {
+    // fast-path empty
+    return '"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk"'
+  }
+
+  // compute hash of entity
+  var hash = crypto
+    .createHash('sha1')
+    .update(entity, 'utf8')
+    .digest('base64')
+    .substring(0, 27)
+
+  // compute length of entity
+  var len = typeof entity === 'string'
+    ? Buffer.byteLength(entity, 'utf8')
+    : entity.length
+
+  return '"' + len.toString(16) + '-' + hash + '"'
+}
+
+/**
+ * Create a simple ETag.
+ *
+ * @param {string|Buffer|Stats} entity
+ * @param {object} [options]
+ * @param {boolean} [options.weak]
+ * @return {String}
+ * @public
+ */
+
+function etag (entity, options) {
+  if (entity == null) {
+    throw new TypeError('argument entity is required')
+  }
+
+  // support fs.Stats object
+  var isStats = isstats(entity)
+  var weak = options && typeof options.weak === 'boolean'
+    ? options.weak
+    : isStats
+
+  // validate argument
+  if (!isStats && typeof entity !== 'string' && !Buffer.isBuffer(entity)) {
+    throw new TypeError('argument entity must be string, Buffer, or fs.Stats')
+  }
+
+  // generate entity tag
+  var tag = isStats
+    ? stattag(entity)
+    : entitytag(entity)
+
+  return weak
+    ? 'W/' + tag
+    : tag
+}
+
+/**
+ * Determine if object is a Stats object.
+ *
+ * @param {object} obj
+ * @return {boolean}
+ * @api private
+ */
+
+function isstats (obj) {
+  // genuine fs.Stats
+  if (typeof Stats === 'function' && obj instanceof Stats) {
+    return true
+  }
+
+  // quack quack
+  return obj && typeof obj === 'object' &&
+    'ctime' in obj && toString.call(obj.ctime) === '[object Date]' &&
+    'mtime' in obj && toString.call(obj.mtime) === '[object Date]' &&
+    'ino' in obj && typeof obj.ino === 'number' &&
+    'size' in obj && typeof obj.size === 'number'
+}
+
+/**
+ * Generate a tag for a stat.
+ *
+ * @param {object} stat
+ * @return {string}
+ * @private
+ */
+
+function stattag (stat) {
+  var mtime = stat.mtime.getTime().toString(16)
+  var size = stat.size.toString(16)
+
+  return '"' + size + '-' + mtime + '"'
+}
diff --git a/wrt/node_modules/etag/package.json b/wrt/node_modules/etag/package.json
new file mode 100644 (file)
index 0000000..29b4990
--- /dev/null
@@ -0,0 +1,122 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "etag@~1.8.0",
+        "scope": null,
+        "escapedName": "etag",
+        "name": "etag",
+        "rawSpec": "~1.8.0",
+        "spec": ">=1.8.0 <1.9.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express"
+    ]
+  ],
+  "_from": "etag@>=1.8.0 <1.9.0",
+  "_id": "etag@1.8.1",
+  "_inCache": true,
+  "_location": "/etag",
+  "_nodeVersion": "6.11.1",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/etag-1.8.1.tgz_1505270623443_0.24458415526896715"
+  },
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "3.10.10",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "etag@~1.8.0",
+    "scope": null,
+    "escapedName": "etag",
+    "name": "etag",
+    "rawSpec": "~1.8.0",
+    "spec": ">=1.8.0 <1.9.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/express",
+    "/send"
+  ],
+  "_resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
+  "_shasum": "41ae2eeb65efa62268aebfea83ac7d79299b0887",
+  "_shrinkwrap": null,
+  "_spec": "etag@~1.8.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express",
+  "bugs": {
+    "url": "https://github.com/jshttp/etag/issues"
+  },
+  "contributors": [
+    {
+      "name": "Douglas Christopher Wilson",
+      "email": "doug@somethingdoug.com"
+    },
+    {
+      "name": "David Björklund",
+      "email": "david.bjorklund@gmail.com"
+    }
+  ],
+  "dependencies": {},
+  "description": "Create simple HTTP ETags",
+  "devDependencies": {
+    "beautify-benchmark": "0.2.4",
+    "benchmark": "2.1.4",
+    "eslint": "3.19.0",
+    "eslint-config-standard": "10.2.1",
+    "eslint-plugin-import": "2.7.0",
+    "eslint-plugin-markdown": "1.0.0-beta.6",
+    "eslint-plugin-node": "5.1.1",
+    "eslint-plugin-promise": "3.5.0",
+    "eslint-plugin-standard": "3.0.1",
+    "istanbul": "0.4.5",
+    "mocha": "1.21.5",
+    "safe-buffer": "5.1.1",
+    "seedrandom": "2.4.3"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "41ae2eeb65efa62268aebfea83ac7d79299b0887",
+    "tarball": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz"
+  },
+  "engines": {
+    "node": ">= 0.6"
+  },
+  "files": [
+    "LICENSE",
+    "HISTORY.md",
+    "README.md",
+    "index.js"
+  ],
+  "gitHead": "9b1e3e41df31cda4080833c187120b91a7ce8327",
+  "homepage": "https://github.com/jshttp/etag#readme",
+  "keywords": [
+    "etag",
+    "http",
+    "res"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "name": "etag",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/jshttp/etag.git"
+  },
+  "scripts": {
+    "bench": "node benchmark/index.js",
+    "lint": "eslint --plugin markdown --ext js,md .",
+    "test": "mocha --reporter spec --bail --check-leaks test/",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
+    "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
+  },
+  "version": "1.8.1"
+}
diff --git a/wrt/node_modules/express/History.md b/wrt/node_modules/express/History.md
new file mode 100644 (file)
index 0000000..f297e3b
--- /dev/null
@@ -0,0 +1,3289 @@
+4.15.4 / 2017-08-06
+===================
+
+  * deps: debug@2.6.8
+  * deps: depd@~1.1.1
+    - Remove unnecessary `Buffer` loading
+  * deps: finalhandler@~1.0.4
+    - deps: debug@2.6.8
+  * deps: proxy-addr@~1.1.5
+    - Fix array argument being altered
+    - deps: ipaddr.js@1.4.0
+  * deps: qs@6.5.0
+  * deps: send@0.15.4
+    - deps: debug@2.6.8
+    - deps: depd@~1.1.1
+    - deps: http-errors@~1.6.2
+  * deps: serve-static@1.12.4
+    - deps: send@0.15.4
+
+4.15.3 / 2017-05-16
+===================
+
+  * Fix error when `res.set` cannot add charset to `Content-Type`
+  * deps: debug@2.6.7
+    - Fix `DEBUG_MAX_ARRAY_LENGTH`
+    - deps: ms@2.0.0
+  * deps: finalhandler@~1.0.3
+    - Fix missing `</html>` in HTML document
+    - deps: debug@2.6.7
+  * deps: proxy-addr@~1.1.4
+    - deps: ipaddr.js@1.3.0
+  * deps: send@0.15.3
+    - deps: debug@2.6.7
+    - deps: ms@2.0.0
+  * deps: serve-static@1.12.3
+    - deps: send@0.15.3
+  * deps: type-is@~1.6.15
+    - deps: mime-types@~2.1.15
+  * deps: vary@~1.1.1
+    - perf: hoist regular expression
+
+4.15.2 / 2017-03-06
+===================
+
+  * deps: qs@6.4.0
+    - Fix regression parsing keys starting with `[`
+
+4.15.1 / 2017-03-05
+===================
+
+  * deps: send@0.15.1
+    - Fix issue when `Date.parse` does not return `NaN` on invalid date
+    - Fix strict violation in broken environments
+  * deps: serve-static@1.12.1
+    - Fix issue when `Date.parse` does not return `NaN` on invalid date
+    - deps: send@0.15.1
+
+4.15.0 / 2017-03-01
+===================
+
+  * Add debug message when loading view engine
+  * Add `next("router")` to exit from router
+  * Fix case where `router.use` skipped requests routes did not
+  * Remove usage of `res._headers` private field
+    - Improves compatibility with Node.js 8 nightly
+  * Skip routing when `req.url` is not set
+  * Use `%o` in path debug to tell types apart
+  * Use `Object.create` to setup request & response prototypes
+  * Use `setprototypeof` module to replace `__proto__` setting
+  * Use `statuses` instead of `http` module for status messages
+  * deps: debug@2.6.1
+    - Allow colors in workers
+    - Deprecated `DEBUG_FD` environment variable set to `3` or higher
+    - Fix error when running under React Native
+    - Use same color for same namespace
+    - deps: ms@0.7.2
+  * deps: etag@~1.8.0
+    - Use SHA1 instead of MD5 for ETag hashing
+    - Works with FIPS 140-2 OpenSSL configuration
+  * deps: finalhandler@~1.0.0
+    - Fix exception when `err` cannot be converted to a string
+    - Fully URL-encode the pathname in the 404
+    - Only include the pathname in the 404 message
+    - Send complete HTML document
+    - Set `Content-Security-Policy: default-src 'self'` header
+    - deps: debug@2.6.1
+  * deps: fresh@0.5.0
+    - Fix false detection of `no-cache` request directive
+    - Fix incorrect result when `If-None-Match` has both `*` and ETags
+    - Fix weak `ETag` matching to match spec
+    - perf: delay reading header values until needed
+    - perf: enable strict mode
+    - perf: hoist regular expressions
+    - perf: remove duplicate conditional
+    - perf: remove unnecessary boolean coercions
+    - perf: skip checking modified time if ETag check failed
+    - perf: skip parsing `If-None-Match` when no `ETag` header
+    - perf: use `Date.parse` instead of `new Date`
+  * deps: qs@6.3.1
+    - Fix array parsing from skipping empty values
+    - Fix compacting nested arrays
+  * deps: send@0.15.0
+    - Fix false detection of `no-cache` request directive
+    - Fix incorrect result when `If-None-Match` has both `*` and ETags
+    - Fix weak `ETag` matching to match spec
+    - Remove usage of `res._headers` private field
+    - Support `If-Match` and `If-Unmodified-Since` headers
+    - Use `res.getHeaderNames()` when available
+    - Use `res.headersSent` when available
+    - deps: debug@2.6.1
+    - deps: etag@~1.8.0
+    - deps: fresh@0.5.0
+    - deps: http-errors@~1.6.1
+  * deps: serve-static@1.12.0
+    - Fix false detection of `no-cache` request directive
+    - Fix incorrect result when `If-None-Match` has both `*` and ETags
+    - Fix weak `ETag` matching to match spec
+    - Remove usage of `res._headers` private field
+    - Send complete HTML document in redirect response
+    - Set default CSP header in redirect response
+    - Support `If-Match` and `If-Unmodified-Since` headers
+    - Use `res.getHeaderNames()` when available
+    - Use `res.headersSent` when available
+    - deps: send@0.15.0
+  * perf: add fast match path for `*` route
+  * perf: improve `req.ips` performance
+
+4.14.1 / 2017-01-28
+===================
+
+  * deps: content-disposition@0.5.2
+  * deps: finalhandler@0.5.1
+    - Fix exception when `err.headers` is not an object
+    - deps: statuses@~1.3.1
+    - perf: hoist regular expressions
+    - perf: remove duplicate validation path
+  * deps: proxy-addr@~1.1.3
+    - deps: ipaddr.js@1.2.0
+  * deps: send@0.14.2
+    - deps: http-errors@~1.5.1
+    - deps: ms@0.7.2
+    - deps: statuses@~1.3.1
+  * deps: serve-static@~1.11.2
+    - deps: send@0.14.2
+  * deps: type-is@~1.6.14
+    - deps: mime-types@~2.1.13
+
+4.14.0 / 2016-06-16
+===================
+
+  * Add `acceptRanges` option to `res.sendFile`/`res.sendfile`
+  * Add `cacheControl` option to `res.sendFile`/`res.sendfile`
+  * Add `options` argument to `req.range`
+    - Includes the `combine` option
+  * Encode URL in `res.location`/`res.redirect` if not already encoded
+  * Fix some redirect handling in `res.sendFile`/`res.sendfile`
+  * Fix Windows absolute path check using forward slashes
+  * Improve error with invalid arguments to `req.get()`
+  * Improve performance for `res.json`/`res.jsonp` in most cases
+  * Improve `Range` header handling in `res.sendFile`/`res.sendfile`
+  * deps: accepts@~1.3.3
+    - Fix including type extensions in parameters in `Accept` parsing
+    - Fix parsing `Accept` parameters with quoted equals
+    - Fix parsing `Accept` parameters with quoted semicolons
+    - Many performance improvments
+    - deps: mime-types@~2.1.11
+    - deps: negotiator@0.6.1
+  * deps: content-type@~1.0.2
+    - perf: enable strict mode
+  * deps: cookie@0.3.1
+    - Add `sameSite` option
+    - Fix cookie `Max-Age` to never be a floating point number
+    - Improve error message when `encode` is not a function
+    - Improve error message when `expires` is not a `Date`
+    - Throw better error for invalid argument to parse
+    - Throw on invalid values provided to `serialize`
+    - perf: enable strict mode
+    - perf: hoist regular expression
+    - perf: use for loop in parse
+    - perf: use string concatination for serialization
+  * deps: finalhandler@0.5.0
+    - Change invalid or non-numeric status code to 500
+    - Overwrite status message to match set status code
+    - Prefer `err.statusCode` if `err.status` is invalid
+    - Set response headers from `err.headers` object
+    - Use `statuses` instead of `http` module for status messages
+  * deps: proxy-addr@~1.1.2
+    - Fix accepting various invalid netmasks
+    - Fix IPv6-mapped IPv4 validation edge cases
+    - IPv4 netmasks must be contingous
+    - IPv6 addresses cannot be used as a netmask
+    - deps: ipaddr.js@1.1.1
+  * deps: qs@6.2.0
+    - Add `decoder` option in `parse` function
+  * deps: range-parser@~1.2.0
+    - Add `combine` option to combine overlapping ranges
+    - Fix incorrectly returning -1 when there is at least one valid range
+    - perf: remove internal function
+  * deps: send@0.14.1
+    - Add `acceptRanges` option
+    - Add `cacheControl` option
+    - Attempt to combine multiple ranges into single range
+    - Correctly inherit from `Stream` class
+    - Fix `Content-Range` header in 416 responses when using `start`/`end` options
+    - Fix `Content-Range` header missing from default 416 responses
+    - Fix redirect error when `path` contains raw non-URL characters
+    - Fix redirect when `path` starts with multiple forward slashes
+    - Ignore non-byte `Range` headers
+    - deps: http-errors@~1.5.0
+    - deps: range-parser@~1.2.0
+    - deps: statuses@~1.3.0
+    - perf: remove argument reassignment
+  * deps: serve-static@~1.11.1
+    - Add `acceptRanges` option
+    - Add `cacheControl` option
+    - Attempt to combine multiple ranges into single range
+    - Fix redirect error when `req.url` contains raw non-URL characters
+    - Ignore non-byte `Range` headers
+    - Use status code 301 for redirects
+    - deps: send@0.14.1
+  * deps: type-is@~1.6.13
+    - Fix type error when given invalid type to match against
+    - deps: mime-types@~2.1.11
+  * deps: vary@~1.1.0
+    - Only accept valid field names in the `field` argument
+  * perf: use strict equality when possible
+
+4.13.4 / 2016-01-21
+===================
+
+  * deps: content-disposition@0.5.1
+    - perf: enable strict mode
+  * deps: cookie@0.1.5
+    - Throw on invalid values provided to `serialize`
+  * deps: depd@~1.1.0
+    - Support web browser loading
+    - perf: enable strict mode
+  * deps: escape-html@~1.0.3
+    - perf: enable strict mode
+    - perf: optimize string replacement
+    - perf: use faster string coercion
+  * deps: finalhandler@0.4.1
+    - deps: escape-html@~1.0.3
+  * deps: merge-descriptors@1.0.1
+    - perf: enable strict mode
+  * deps: methods@~1.1.2
+    - perf: enable strict mode
+  * deps: parseurl@~1.3.1
+    - perf: enable strict mode
+  * deps: proxy-addr@~1.0.10
+    - deps: ipaddr.js@1.0.5
+    - perf: enable strict mode
+  * deps: range-parser@~1.0.3
+    - perf: enable strict mode
+  * deps: send@0.13.1
+    - deps: depd@~1.1.0
+    - deps: destroy@~1.0.4
+    - deps: escape-html@~1.0.3
+    - deps: range-parser@~1.0.3
+  * deps: serve-static@~1.10.2
+    - deps: escape-html@~1.0.3
+    - deps: parseurl@~1.3.0
+    - deps: send@0.13.1
+
+4.13.3 / 2015-08-02
+===================
+
+  * Fix infinite loop condition using `mergeParams: true`
+  * Fix inner numeric indices incorrectly altering parent `req.params`
+
+4.13.2 / 2015-07-31
+===================
+
+  * deps: accepts@~1.2.12
+    - deps: mime-types@~2.1.4
+  * deps: array-flatten@1.1.1
+    - perf: enable strict mode
+  * deps: path-to-regexp@0.1.7
+    - Fix regression with escaped round brackets and matching groups
+  * deps: type-is@~1.6.6
+    - deps: mime-types@~2.1.4
+
+4.13.1 / 2015-07-05
+===================
+
+  * deps: accepts@~1.2.10
+    - deps: mime-types@~2.1.2
+  * deps: qs@4.0.0
+    - Fix dropping parameters like `hasOwnProperty`
+    - Fix various parsing edge cases
+  * deps: type-is@~1.6.4
+    - deps: mime-types@~2.1.2
+    - perf: enable strict mode
+    - perf: remove argument reassignment
+
+4.13.0 / 2015-06-20
+===================
+
+  * Add settings to debug output
+  * Fix `res.format` error when only `default` provided
+  * Fix issue where `next('route')` in `app.param` would incorrectly skip values
+  * Fix hiding platform issues with `decodeURIComponent`
+    - Only `URIError`s are a 400
+  * Fix using `*` before params in routes
+  * Fix using capture groups before params in routes
+  * Simplify `res.cookie` to call `res.append`
+  * Use `array-flatten` module for flattening arrays
+  * deps: accepts@~1.2.9
+    - deps: mime-types@~2.1.1
+    - perf: avoid argument reassignment & argument slice
+    - perf: avoid negotiator recursive construction
+    - perf: enable strict mode
+    - perf: remove unnecessary bitwise operator
+  * deps: cookie@0.1.3
+    - perf: deduce the scope of try-catch deopt
+    - perf: remove argument reassignments
+  * deps: escape-html@1.0.2
+  * deps: etag@~1.7.0
+    - Always include entity length in ETags for hash length extensions
+    - Generate non-Stats ETags using MD5 only (no longer CRC32)
+    - Improve stat performance by removing hashing
+    - Improve support for JXcore
+    - Remove base64 padding in ETags to shorten
+    - Support "fake" stats objects in environments without fs
+    - Use MD5 instead of MD4 in weak ETags over 1KB
+  * deps: finalhandler@0.4.0
+    - Fix a false-positive when unpiping in Node.js 0.8
+    - Support `statusCode` property on `Error` objects
+    - Use `unpipe` module for unpiping requests
+    - deps: escape-html@1.0.2
+    - deps: on-finished@~2.3.0
+    - perf: enable strict mode
+    - perf: remove argument reassignment
+  * deps: fresh@0.3.0
+    - Add weak `ETag` matching support
+  * deps: on-finished@~2.3.0
+    - Add defined behavior for HTTP `CONNECT` requests
+    - Add defined behavior for HTTP `Upgrade` requests
+    - deps: ee-first@1.1.1
+  * deps: path-to-regexp@0.1.6
+  * deps: send@0.13.0
+    - Allow Node.js HTTP server to set `Date` response header
+    - Fix incorrectly removing `Content-Location` on 304 response
+    - Improve the default redirect response headers
+    - Send appropriate headers on default error response
+    - Use `http-errors` for standard emitted errors
+    - Use `statuses` instead of `http` module for status messages
+    - deps: escape-html@1.0.2
+    - deps: etag@~1.7.0
+    - deps: fresh@0.3.0
+    - deps: on-finished@~2.3.0
+    - perf: enable strict mode
+    - perf: remove unnecessary array allocations
+  * deps: serve-static@~1.10.0
+    - Add `fallthrough` option
+    - Fix reading options from options prototype
+    - Improve the default redirect response headers
+    - Malformed URLs now `next()` instead of 400
+    - deps: escape-html@1.0.2
+    - deps: send@0.13.0
+    - perf: enable strict mode
+    - perf: remove argument reassignment
+  * deps: type-is@~1.6.3
+    - deps: mime-types@~2.1.1
+    - perf: reduce try block size
+    - perf: remove bitwise operations
+  * perf: enable strict mode
+  * perf: isolate `app.render` try block
+  * perf: remove argument reassignments in application
+  * perf: remove argument reassignments in request prototype
+  * perf: remove argument reassignments in response prototype
+  * perf: remove argument reassignments in routing
+  * perf: remove argument reassignments in `View`
+  * perf: skip attempting to decode zero length string
+  * perf: use saved reference to `http.STATUS_CODES`
+
+4.12.4 / 2015-05-17
+===================
+
+  * deps: accepts@~1.2.7
+    - deps: mime-types@~2.0.11
+    - deps: negotiator@0.5.3
+  * deps: debug@~2.2.0
+    - deps: ms@0.7.1
+  * deps: depd@~1.0.1
+  * deps: etag@~1.6.0
+    - Improve support for JXcore
+    - Support "fake" stats objects in environments without `fs`
+  * deps: finalhandler@0.3.6
+    - deps: debug@~2.2.0
+    - deps: on-finished@~2.2.1
+  * deps: on-finished@~2.2.1
+    - Fix `isFinished(req)` when data buffered
+  * deps: proxy-addr@~1.0.8
+    - deps: ipaddr.js@1.0.1
+  * deps: qs@2.4.2
+   - Fix allowing parameters like `constructor`
+  * deps: send@0.12.3
+    - deps: debug@~2.2.0
+    - deps: depd@~1.0.1
+    - deps: etag@~1.6.0
+    - deps: ms@0.7.1
+    - deps: on-finished@~2.2.1
+  * deps: serve-static@~1.9.3
+    - deps: send@0.12.3
+  * deps: type-is@~1.6.2
+    - deps: mime-types@~2.0.11
+
+4.12.3 / 2015-03-17
+===================
+
+  * deps: accepts@~1.2.5
+    - deps: mime-types@~2.0.10
+  * deps: debug@~2.1.3
+    - Fix high intensity foreground color for bold
+    - deps: ms@0.7.0
+  * deps: finalhandler@0.3.4
+    - deps: debug@~2.1.3
+  * deps: proxy-addr@~1.0.7
+    - deps: ipaddr.js@0.1.9
+  * deps: qs@2.4.1
+    - Fix error when parameter `hasOwnProperty` is present
+  * deps: send@0.12.2
+    - Throw errors early for invalid `extensions` or `index` options
+    - deps: debug@~2.1.3
+  * deps: serve-static@~1.9.2
+    - deps: send@0.12.2
+  * deps: type-is@~1.6.1
+    - deps: mime-types@~2.0.10
+
+4.12.2 / 2015-03-02
+===================
+
+  * Fix regression where `"Request aborted"` is logged using `res.sendFile`
+
+4.12.1 / 2015-03-01
+===================
+
+  * Fix constructing application with non-configurable prototype properties
+  * Fix `ECONNRESET` errors from `res.sendFile` usage
+  * Fix `req.host` when using "trust proxy" hops count
+  * Fix `req.protocol`/`req.secure` when using "trust proxy" hops count
+  * Fix wrong `code` on aborted connections from `res.sendFile`
+  * deps: merge-descriptors@1.0.0
+
+4.12.0 / 2015-02-23
+===================
+
+  * Fix `"trust proxy"` setting to inherit when app is mounted
+  * Generate `ETag`s for all request responses
+    - No longer restricted to only responses for `GET` and `HEAD` requests
+  * Use `content-type` to parse `Content-Type` headers
+  * deps: accepts@~1.2.4
+    - Fix preference sorting to be stable for long acceptable lists
+    - deps: mime-types@~2.0.9
+    - deps: negotiator@0.5.1
+  * deps: cookie-signature@1.0.6
+  * deps: send@0.12.1
+    - Always read the stat size from the file
+    - Fix mutating passed-in `options`
+    - deps: mime@1.3.4
+  * deps: serve-static@~1.9.1
+    - deps: send@0.12.1
+  * deps: type-is@~1.6.0
+    - fix argument reassignment
+    - fix false-positives in `hasBody` `Transfer-Encoding` check
+    - support wildcard for both type and subtype (`*/*`)
+    - deps: mime-types@~2.0.9
+
+4.11.2 / 2015-02-01
+===================
+
+  * Fix `res.redirect` double-calling `res.end` for `HEAD` requests
+  * deps: accepts@~1.2.3
+    - deps: mime-types@~2.0.8
+  * deps: proxy-addr@~1.0.6
+    - deps: ipaddr.js@0.1.8
+  * deps: type-is@~1.5.6
+    - deps: mime-types@~2.0.8
+
+4.11.1 / 2015-01-20
+===================
+
+  * deps: send@0.11.1
+    - Fix root path disclosure
+  * deps: serve-static@~1.8.1
+    - Fix redirect loop in Node.js 0.11.14
+    - Fix root path disclosure
+    - deps: send@0.11.1
+
+4.11.0 / 2015-01-13
+===================
+
+  * Add `res.append(field, val)` to append headers
+  * Deprecate leading `:` in `name` for `app.param(name, fn)`
+  * Deprecate `req.param()` -- use `req.params`, `req.body`, or `req.query` instead
+  * Deprecate `app.param(fn)`
+  * Fix `OPTIONS` responses to include the `HEAD` method properly
+  * Fix `res.sendFile` not always detecting aborted connection
+  * Match routes iteratively to prevent stack overflows
+  * deps: accepts@~1.2.2
+    - deps: mime-types@~2.0.7
+    - deps: negotiator@0.5.0
+  * deps: send@0.11.0
+    - deps: debug@~2.1.1
+    - deps: etag@~1.5.1
+    - deps: ms@0.7.0
+    - deps: on-finished@~2.2.0
+  * deps: serve-static@~1.8.0
+    - deps: send@0.11.0
+
+4.10.8 / 2015-01-13
+===================
+
+  * Fix crash from error within `OPTIONS` response handler
+  * deps: proxy-addr@~1.0.5
+    - deps: ipaddr.js@0.1.6
+
+4.10.7 / 2015-01-04
+===================
+
+  * Fix `Allow` header for `OPTIONS` to not contain duplicate methods
+  * Fix incorrect "Request aborted" for `res.sendFile` when `HEAD` or 304
+  * deps: debug@~2.1.1
+  * deps: finalhandler@0.3.3
+    - deps: debug@~2.1.1
+    - deps: on-finished@~2.2.0
+  * deps: methods@~1.1.1
+  * deps: on-finished@~2.2.0
+  * deps: serve-static@~1.7.2
+    - Fix potential open redirect when mounted at root
+  * deps: type-is@~1.5.5
+    - deps: mime-types@~2.0.7
+
+4.10.6 / 2014-12-12
+===================
+
+  * Fix exception in `req.fresh`/`req.stale` without response headers
+
+4.10.5 / 2014-12-10
+===================
+
+  * Fix `res.send` double-calling `res.end` for `HEAD` requests
+  * deps: accepts@~1.1.4
+    - deps: mime-types@~2.0.4
+  * deps: type-is@~1.5.4
+    - deps: mime-types@~2.0.4
+
+4.10.4 / 2014-11-24
+===================
+
+  * Fix `res.sendfile` logging standard write errors
+
+4.10.3 / 2014-11-23
+===================
+
+  * Fix `res.sendFile` logging standard write errors
+  * deps: etag@~1.5.1
+  * deps: proxy-addr@~1.0.4
+    - deps: ipaddr.js@0.1.5
+  * deps: qs@2.3.3
+    - Fix `arrayLimit` behavior
+
+4.10.2 / 2014-11-09
+===================
+
+  * Correctly invoke async router callback asynchronously
+  * deps: accepts@~1.1.3
+    - deps: mime-types@~2.0.3
+  * deps: type-is@~1.5.3
+    - deps: mime-types@~2.0.3
+
+4.10.1 / 2014-10-28
+===================
+
+  * Fix handling of URLs containing `://` in the path
+  * deps: qs@2.3.2
+    - Fix parsing of mixed objects and values
+
+4.10.0 / 2014-10-23
+===================
+
+  * Add support for `app.set('views', array)`
+    - Views are looked up in sequence in array of directories
+  * Fix `res.send(status)` to mention `res.sendStatus(status)`
+  * Fix handling of invalid empty URLs
+  * Use `content-disposition` module for `res.attachment`/`res.download`
+    - Sends standards-compliant `Content-Disposition` header
+    - Full Unicode support
+  * Use `path.resolve` in view lookup
+  * deps: debug@~2.1.0
+    - Implement `DEBUG_FD` env variable support
+  * deps: depd@~1.0.0
+  * deps: etag@~1.5.0
+    - Improve string performance
+    - Slightly improve speed for weak ETags over 1KB
+  * deps: finalhandler@0.3.2
+    - Terminate in progress response only on error
+    - Use `on-finished` to determine request status
+    - deps: debug@~2.1.0
+    - deps: on-finished@~2.1.1
+  * deps: on-finished@~2.1.1
+    - Fix handling of pipelined requests
+  * deps: qs@2.3.0
+    - Fix parsing of mixed implicit and explicit arrays
+  * deps: send@0.10.1
+    - deps: debug@~2.1.0
+    - deps: depd@~1.0.0
+    - deps: etag@~1.5.0
+    - deps: on-finished@~2.1.1
+  * deps: serve-static@~1.7.1
+    - deps: send@0.10.1
+
+4.9.8 / 2014-10-17
+==================
+
+  * Fix `res.redirect` body when redirect status specified
+  * deps: accepts@~1.1.2
+    - Fix error when media type has invalid parameter
+    - deps: negotiator@0.4.9
+
+4.9.7 / 2014-10-10
+==================
+
+  * Fix using same param name in array of paths
+
+4.9.6 / 2014-10-08
+==================
+
+  * deps: accepts@~1.1.1
+    - deps: mime-types@~2.0.2
+    - deps: negotiator@0.4.8
+  * deps: serve-static@~1.6.4
+    - Fix redirect loop when index file serving disabled
+  * deps: type-is@~1.5.2
+    - deps: mime-types@~2.0.2
+
+4.9.5 / 2014-09-24
+==================
+
+  * deps: etag@~1.4.0
+  * deps: proxy-addr@~1.0.3
+    - Use `forwarded` npm module
+  * deps: send@0.9.3
+    - deps: etag@~1.4.0
+  * deps: serve-static@~1.6.3
+    - deps: send@0.9.3
+
+4.9.4 / 2014-09-19
+==================
+
+  * deps: qs@2.2.4
+    - Fix issue with object keys starting with numbers truncated
+
+4.9.3 / 2014-09-18
+==================
+
+  * deps: proxy-addr@~1.0.2
+    - Fix a global leak when multiple subnets are trusted
+    - deps: ipaddr.js@0.1.3
+
+4.9.2 / 2014-09-17
+==================
+
+  * Fix regression for empty string `path` in `app.use`
+  * Fix `router.use` to accept array of middleware without path
+  * Improve error message for bad `app.use` arguments
+
+4.9.1 / 2014-09-16
+==================
+
+  * Fix `app.use` to accept array of middleware without path
+  * deps: depd@0.4.5
+  * deps: etag@~1.3.1
+  * deps: send@0.9.2
+    - deps: depd@0.4.5
+    - deps: etag@~1.3.1
+    - deps: range-parser@~1.0.2
+  * deps: serve-static@~1.6.2
+    - deps: send@0.9.2
+
+4.9.0 / 2014-09-08
+==================
+
+  * Add `res.sendStatus`
+  * Invoke callback for sendfile when client aborts
+    - Applies to `res.sendFile`, `res.sendfile`, and `res.download`
+    - `err` will be populated with request aborted error
+  * Support IP address host in `req.subdomains`
+  * Use `etag` to generate `ETag` headers
+  * deps: accepts@~1.1.0
+    - update `mime-types`
+  * deps: cookie-signature@1.0.5
+  * deps: debug@~2.0.0
+  * deps: finalhandler@0.2.0
+    - Set `X-Content-Type-Options: nosniff` header
+    - deps: debug@~2.0.0
+  * deps: fresh@0.2.4
+  * deps: media-typer@0.3.0
+    - Throw error when parameter format invalid on parse
+  * deps: qs@2.2.3
+    - Fix issue where first empty value in array is discarded
+  * deps: range-parser@~1.0.2
+  * deps: send@0.9.1
+    - Add `lastModified` option
+    - Use `etag` to generate `ETag` header
+    - deps: debug@~2.0.0
+    - deps: fresh@0.2.4
+  * deps: serve-static@~1.6.1
+    - Add `lastModified` option
+    - deps: send@0.9.1
+  * deps: type-is@~1.5.1
+    - fix `hasbody` to be true for `content-length: 0`
+    - deps: media-typer@0.3.0
+    - deps: mime-types@~2.0.1
+  * deps: vary@~1.0.0
+    - Accept valid `Vary` header string as `field`
+
+4.8.8 / 2014-09-04
+==================
+
+  * deps: send@0.8.5
+    - Fix a path traversal issue when using `root`
+    - Fix malicious path detection for empty string path
+  * deps: serve-static@~1.5.4
+    - deps: send@0.8.5
+
+4.8.7 / 2014-08-29
+==================
+
+  * deps: qs@2.2.2
+    - Remove unnecessary cloning
+
+4.8.6 / 2014-08-27
+==================
+
+  * deps: qs@2.2.0
+    - Array parsing fix
+    - Performance improvements
+
+4.8.5 / 2014-08-18
+==================
+
+  * deps: send@0.8.3
+    - deps: destroy@1.0.3
+    - deps: on-finished@2.1.0
+  * deps: serve-static@~1.5.3
+    - deps: send@0.8.3
+
+4.8.4 / 2014-08-14
+==================
+
+  * deps: qs@1.2.2
+  * deps: send@0.8.2
+    - Work around `fd` leak in Node.js 0.10 for `fs.ReadStream`
+  * deps: serve-static@~1.5.2
+    - deps: send@0.8.2
+
+4.8.3 / 2014-08-10
+==================
+
+  * deps: parseurl@~1.3.0
+  * deps: qs@1.2.1
+  * deps: serve-static@~1.5.1
+    - Fix parsing of weird `req.originalUrl` values
+    - deps: parseurl@~1.3.0
+    - deps: utils-merge@1.0.0
+
+4.8.2 / 2014-08-07
+==================
+
+  * deps: qs@1.2.0
+    - Fix parsing array of objects
+
+4.8.1 / 2014-08-06
+==================
+
+  * fix incorrect deprecation warnings on `res.download`
+  * deps: qs@1.1.0
+    - Accept urlencoded square brackets
+    - Accept empty values in implicit array notation
+
+4.8.0 / 2014-08-05
+==================
+
+  * add `res.sendFile`
+    - accepts a file system path instead of a URL
+    - requires an absolute path or `root` option specified
+  * deprecate `res.sendfile` -- use `res.sendFile` instead
+  * support mounted app as any argument to `app.use()`
+  * deps: qs@1.0.2
+    - Complete rewrite
+    - Limits array length to 20
+    - Limits object depth to 5
+    - Limits parameters to 1,000
+  * deps: send@0.8.1
+    - Add `extensions` option
+  * deps: serve-static@~1.5.0
+    - Add `extensions` option
+    - deps: send@0.8.1
+
+4.7.4 / 2014-08-04
+==================
+
+  * fix `res.sendfile` regression for serving directory index files
+  * deps: send@0.7.4
+    - Fix incorrect 403 on Windows and Node.js 0.11
+    - Fix serving index files without root dir
+  * deps: serve-static@~1.4.4
+    - deps: send@0.7.4
+
+4.7.3 / 2014-08-04
+==================
+
+  * deps: send@0.7.3
+    - Fix incorrect 403 on Windows and Node.js 0.11
+  * deps: serve-static@~1.4.3
+    - Fix incorrect 403 on Windows and Node.js 0.11
+    - deps: send@0.7.3
+
+4.7.2 / 2014-07-27
+==================
+
+  * deps: depd@0.4.4
+    - Work-around v8 generating empty stack traces
+  * deps: send@0.7.2
+    - deps: depd@0.4.4
+  * deps: serve-static@~1.4.2
+
+4.7.1 / 2014-07-26
+==================
+
+  * deps: depd@0.4.3
+    - Fix exception when global `Error.stackTraceLimit` is too low
+  * deps: send@0.7.1
+    - deps: depd@0.4.3
+  * deps: serve-static@~1.4.1
+
+4.7.0 / 2014-07-25
+==================
+
+  * fix `req.protocol` for proxy-direct connections
+  * configurable query parser with `app.set('query parser', parser)`
+    - `app.set('query parser', 'extended')` parse with "qs" module
+    - `app.set('query parser', 'simple')` parse with "querystring" core module
+    - `app.set('query parser', false)` disable query string parsing
+    - `app.set('query parser', true)` enable simple parsing
+  * deprecate `res.json(status, obj)` -- use `res.status(status).json(obj)` instead
+  * deprecate `res.jsonp(status, obj)` -- use `res.status(status).jsonp(obj)` instead
+  * deprecate `res.send(status, body)` -- use `res.status(status).send(body)` instead
+  * deps: debug@1.0.4
+  * deps: depd@0.4.2
+    - Add `TRACE_DEPRECATION` environment variable
+    - Remove non-standard grey color from color output
+    - Support `--no-deprecation` argument
+    - Support `--trace-deprecation` argument
+  * deps: finalhandler@0.1.0
+    - Respond after request fully read
+    - deps: debug@1.0.4
+  * deps: parseurl@~1.2.0
+    - Cache URLs based on original value
+    - Remove no-longer-needed URL mis-parse work-around
+    - Simplify the "fast-path" `RegExp`
+  * deps: send@0.7.0
+    - Add `dotfiles` option
+    - Cap `maxAge` value to 1 year
+    - deps: debug@1.0.4
+    - deps: depd@0.4.2
+  * deps: serve-static@~1.4.0
+    - deps: parseurl@~1.2.0
+    - deps: send@0.7.0
+  * perf: prevent multiple `Buffer` creation in `res.send`
+
+4.6.1 / 2014-07-12
+==================
+
+  * fix `subapp.mountpath` regression for `app.use(subapp)`
+
+4.6.0 / 2014-07-11
+==================
+
+  * accept multiple callbacks to `app.use()`
+  * add explicit "Rosetta Flash JSONP abuse" protection
+    - previous versions are not vulnerable; this is just explicit protection
+  * catch errors in multiple `req.param(name, fn)` handlers
+  * deprecate `res.redirect(url, status)` -- use `res.redirect(status, url)` instead
+  * fix `res.send(status, num)` to send `num` as json (not error)
+  * remove unnecessary escaping when `res.jsonp` returns JSON response
+  * support non-string `path` in `app.use(path, fn)`
+    - supports array of paths
+    - supports `RegExp`
+  * router: fix optimization on router exit
+  * router: refactor location of `try` blocks
+  * router: speed up standard `app.use(fn)`
+  * deps: debug@1.0.3
+    - Add support for multiple wildcards in namespaces
+  * deps: finalhandler@0.0.3
+    - deps: debug@1.0.3
+  * deps: methods@1.1.0
+    - add `CONNECT`
+  * deps: parseurl@~1.1.3
+    - faster parsing of href-only URLs
+  * deps: path-to-regexp@0.1.3
+  * deps: send@0.6.0
+    - deps: debug@1.0.3
+  * deps: serve-static@~1.3.2
+    - deps: parseurl@~1.1.3
+    - deps: send@0.6.0
+  * perf: fix arguments reassign deopt in some `res` methods
+
+4.5.1 / 2014-07-06
+==================
+
+ * fix routing regression when altering `req.method`
+
+4.5.0 / 2014-07-04
+==================
+
+ * add deprecation message to non-plural `req.accepts*`
+ * add deprecation message to `res.send(body, status)`
+ * add deprecation message to `res.vary()`
+ * add `headers` option to `res.sendfile`
+   - use to set headers on successful file transfer
+ * add `mergeParams` option to `Router`
+   - merges `req.params` from parent routes
+ * add `req.hostname` -- correct name for what `req.host` returns
+ * deprecate things with `depd` module
+ * deprecate `req.host` -- use `req.hostname` instead
+ * fix behavior when handling request without routes
+ * fix handling when `route.all` is only route
+ * invoke `router.param()` only when route matches
+ * restore `req.params` after invoking router
+ * use `finalhandler` for final response handling
+ * use `media-typer` to alter content-type charset
+ * deps: accepts@~1.0.7
+ * deps: send@0.5.0
+   - Accept string for `maxage` (converted by `ms`)
+   - Include link in default redirect response
+ * deps: serve-static@~1.3.0
+   - Accept string for `maxAge` (converted by `ms`)
+   - Add `setHeaders` option
+   - Include HTML link in redirect response
+   - deps: send@0.5.0
+ * deps: type-is@~1.3.2
+
+4.4.5 / 2014-06-26
+==================
+
+ * deps: cookie-signature@1.0.4
+   - fix for timing attacks
+
+4.4.4 / 2014-06-20
+==================
+
+ * fix `res.attachment` Unicode filenames in Safari
+ * fix "trim prefix" debug message in `express:router`
+ * deps: accepts@~1.0.5
+ * deps: buffer-crc32@0.2.3
+
+4.4.3 / 2014-06-11
+==================
+
+ * fix persistence of modified `req.params[name]` from `app.param()`
+ * deps: accepts@1.0.3
+   - deps: negotiator@0.4.6
+ * deps: debug@1.0.2
+ * deps: send@0.4.3
+   - Do not throw un-catchable error on file open race condition
+   - Use `escape-html` for HTML escaping
+   - deps: debug@1.0.2
+   - deps: finished@1.2.2
+   - deps: fresh@0.2.2
+ * deps: serve-static@1.2.3
+   - Do not throw un-catchable error on file open race condition
+   - deps: send@0.4.3
+
+4.4.2 / 2014-06-09
+==================
+
+ * fix catching errors from top-level handlers
+ * use `vary` module for `res.vary`
+ * deps: debug@1.0.1
+ * deps: proxy-addr@1.0.1
+ * deps: send@0.4.2
+   - fix "event emitter leak" warnings
+   - deps: debug@1.0.1
+   - deps: finished@1.2.1
+ * deps: serve-static@1.2.2
+   - fix "event emitter leak" warnings
+   - deps: send@0.4.2
+ * deps: type-is@1.2.1
+
+4.4.1 / 2014-06-02
+==================
+
+ * deps: methods@1.0.1
+ * deps: send@0.4.1
+   - Send `max-age` in `Cache-Control` in correct format
+ * deps: serve-static@1.2.1
+   - use `escape-html` for escaping
+   - deps: send@0.4.1
+
+4.4.0 / 2014-05-30
+==================
+
+ * custom etag control with `app.set('etag', val)`
+   - `app.set('etag', function(body, encoding){ return '"etag"' })` custom etag generation
+   - `app.set('etag', 'weak')` weak tag
+   - `app.set('etag', 'strong')` strong etag
+   - `app.set('etag', false)` turn off
+   - `app.set('etag', true)` standard etag
+ * mark `res.send` ETag as weak and reduce collisions
+ * update accepts to 1.0.2
+   - Fix interpretation when header not in request
+ * update send to 0.4.0
+   - Calculate ETag with md5 for reduced collisions
+   - Ignore stream errors after request ends
+   - deps: debug@0.8.1
+ * update serve-static to 1.2.0
+   - Calculate ETag with md5 for reduced collisions
+   - Ignore stream errors after request ends
+   - deps: send@0.4.0
+
+4.3.2 / 2014-05-28
+==================
+
+ * fix handling of errors from `router.param()` callbacks
+
+4.3.1 / 2014-05-23
+==================
+
+ * revert "fix behavior of multiple `app.VERB` for the same path"
+   - this caused a regression in the order of route execution
+
+4.3.0 / 2014-05-21
+==================
+
+ * add `req.baseUrl` to access the path stripped from `req.url` in routes
+ * fix behavior of multiple `app.VERB` for the same path
+ * fix issue routing requests among sub routers
+ * invoke `router.param()` only when necessary instead of every match
+ * proper proxy trust with `app.set('trust proxy', trust)`
+   - `app.set('trust proxy', 1)` trust first hop
+   - `app.set('trust proxy', 'loopback')` trust loopback addresses
+   - `app.set('trust proxy', '10.0.0.1')` trust single IP
+   - `app.set('trust proxy', '10.0.0.1/16')` trust subnet
+   - `app.set('trust proxy', '10.0.0.1, 10.0.0.2')` trust list
+   - `app.set('trust proxy', false)` turn off
+   - `app.set('trust proxy', true)` trust everything
+ * set proper `charset` in `Content-Type` for `res.send`
+ * update type-is to 1.2.0
+   - support suffix matching
+
+4.2.0 / 2014-05-11
+==================
+
+ * deprecate `app.del()` -- use `app.delete()` instead
+ * deprecate `res.json(obj, status)` -- use `res.json(status, obj)` instead
+   - the edge-case `res.json(status, num)` requires `res.status(status).json(num)`
+ * deprecate `res.jsonp(obj, status)` -- use `res.jsonp(status, obj)` instead
+   - the edge-case `res.jsonp(status, num)` requires `res.status(status).jsonp(num)`
+ * fix `req.next` when inside router instance
+ * include `ETag` header in `HEAD` requests
+ * keep previous `Content-Type` for `res.jsonp`
+ * support PURGE method
+   - add `app.purge`
+   - add `router.purge`
+   - include PURGE in `app.all`
+ * update debug to 0.8.0
+   - add `enable()` method
+   - change from stderr to stdout
+ * update methods to 1.0.0
+   - add PURGE
+
+4.1.2 / 2014-05-08
+==================
+
+ * fix `req.host` for IPv6 literals
+ * fix `res.jsonp` error if callback param is object
+
+4.1.1 / 2014-04-27
+==================
+
+ * fix package.json to reflect supported node version
+
+4.1.0 / 2014-04-24
+==================
+
+ * pass options from `res.sendfile` to `send`
+ * preserve casing of headers in `res.header` and `res.set`
+ * support unicode file names in `res.attachment` and `res.download`
+ * update accepts to 1.0.1
+   - deps: negotiator@0.4.0
+ * update cookie to 0.1.2
+   - Fix for maxAge == 0
+   - made compat with expires field
+ * update send to 0.3.0
+   - Accept API options in options object
+   - Coerce option types
+   - Control whether to generate etags
+   - Default directory access to 403 when index disabled
+   - Fix sending files with dots without root set
+   - Include file path in etag
+   - Make "Can't set headers after they are sent." catchable
+   - Send full entity-body for multi range requests
+   - Set etags to "weak"
+   - Support "If-Range" header
+   - Support multiple index paths
+   - deps: mime@1.2.11
+ * update serve-static to 1.1.0
+   - Accept options directly to `send` module
+   - Resolve relative paths at middleware setup
+   - Use parseurl to parse the URL from request
+   - deps: send@0.3.0
+ * update type-is to 1.1.0
+   - add non-array values support
+   - add `multipart` as a shorthand
+
+4.0.0 / 2014-04-09
+==================
+
+ * remove:
+   - node 0.8 support
+   - connect and connect's patches except for charset handling
+   - express(1) - moved to [express-generator](https://github.com/expressjs/generator)
+   - `express.createServer()` - it has been deprecated for a long time. Use `express()`
+   - `app.configure` - use logic in your own app code
+   - `app.router` - is removed
+   - `req.auth` - use `basic-auth` instead
+   - `req.accepted*` - use `req.accepts*()` instead
+   - `res.location` - relative URL resolution is removed
+   - `res.charset` - include the charset in the content type when using `res.set()`
+   - all bundled middleware except `static`
+ * change:
+   - `app.route` -> `app.mountpath` when mounting an express app in another express app
+   - `json spaces` no longer enabled by default in development
+   - `req.accepts*` -> `req.accepts*s` - i.e. `req.acceptsEncoding` -> `req.acceptsEncodings`
+   - `req.params` is now an object instead of an array
+   - `res.locals` is no longer a function. It is a plain js object. Treat it as such.
+   - `res.headerSent` -> `res.headersSent` to match node.js ServerResponse object
+ * refactor:
+   - `req.accepts*` with [accepts](https://github.com/expressjs/accepts)
+   - `req.is` with [type-is](https://github.com/expressjs/type-is)
+   - [path-to-regexp](https://github.com/component/path-to-regexp)
+ * add:
+   - `app.router()` - returns the app Router instance
+   - `app.route()` - Proxy to the app's `Router#route()` method to create a new route
+   - Router & Route - public API
+
+3.21.2 / 2015-07-31
+===================
+
+  * deps: connect@2.30.2
+    - deps: body-parser@~1.13.3
+    - deps: compression@~1.5.2
+    - deps: errorhandler@~1.4.2
+    - deps: method-override@~2.3.5
+    - deps: serve-index@~1.7.2
+    - deps: type-is@~1.6.6
+    - deps: vhost@~3.0.1
+  * deps: vary@~1.0.1
+    - Fix setting empty header from empty `field`
+    - perf: enable strict mode
+    - perf: remove argument reassignments
+
+3.21.1 / 2015-07-05
+===================
+
+  * deps: basic-auth@~1.0.3
+  * deps: connect@2.30.1
+    - deps: body-parser@~1.13.2
+    - deps: compression@~1.5.1
+    - deps: errorhandler@~1.4.1
+    - deps: morgan@~1.6.1
+    - deps: pause@0.1.0
+    - deps: qs@4.0.0
+    - deps: serve-index@~1.7.1
+    - deps: type-is@~1.6.4
+
+3.21.0 / 2015-06-18
+===================
+
+  * deps: basic-auth@1.0.2
+    - perf: enable strict mode
+    - perf: hoist regular expression
+    - perf: parse with regular expressions
+    - perf: remove argument reassignment
+  * deps: connect@2.30.0
+    - deps: body-parser@~1.13.1
+    - deps: bytes@2.1.0
+    - deps: compression@~1.5.0
+    - deps: cookie@0.1.3
+    - deps: cookie-parser@~1.3.5
+    - deps: csurf@~1.8.3
+    - deps: errorhandler@~1.4.0
+    - deps: express-session@~1.11.3
+    - deps: finalhandler@0.4.0
+    - deps: fresh@0.3.0
+    - deps: morgan@~1.6.0
+    - deps: serve-favicon@~2.3.0
+    - deps: serve-index@~1.7.0
+    - deps: serve-static@~1.10.0
+    - deps: type-is@~1.6.3
+  * deps: cookie@0.1.3
+    - perf: deduce the scope of try-catch deopt
+    - perf: remove argument reassignments
+  * deps: escape-html@1.0.2
+  * deps: etag@~1.7.0
+    - Always include entity length in ETags for hash length extensions
+    - Generate non-Stats ETags using MD5 only (no longer CRC32)
+    - Improve stat performance by removing hashing
+    - Improve support for JXcore
+    - Remove base64 padding in ETags to shorten
+    - Support "fake" stats objects in environments without fs
+    - Use MD5 instead of MD4 in weak ETags over 1KB
+  * deps: fresh@0.3.0
+    - Add weak `ETag` matching support
+  * deps: mkdirp@0.5.1
+    - Work in global strict mode
+  * deps: send@0.13.0
+    - Allow Node.js HTTP server to set `Date` response header
+    - Fix incorrectly removing `Content-Location` on 304 response
+    - Improve the default redirect response headers
+    - Send appropriate headers on default error response
+    - Use `http-errors` for standard emitted errors
+    - Use `statuses` instead of `http` module for status messages
+    - deps: escape-html@1.0.2
+    - deps: etag@~1.7.0
+    - deps: fresh@0.3.0
+    - deps: on-finished@~2.3.0
+    - perf: enable strict mode
+    - perf: remove unnecessary array allocations
+
+3.20.3 / 2015-05-17
+===================
+
+  * deps: connect@2.29.2
+    - deps: body-parser@~1.12.4
+    - deps: compression@~1.4.4
+    - deps: connect-timeout@~1.6.2
+    - deps: debug@~2.2.0
+    - deps: depd@~1.0.1
+    - deps: errorhandler@~1.3.6
+    - deps: finalhandler@0.3.6
+    - deps: method-override@~2.3.3
+    - deps: morgan@~1.5.3
+    - deps: qs@2.4.2
+    - deps: response-time@~2.3.1
+    - deps: serve-favicon@~2.2.1
+    - deps: serve-index@~1.6.4
+    - deps: serve-static@~1.9.3
+    - deps: type-is@~1.6.2
+  * deps: debug@~2.2.0
+    - deps: ms@0.7.1
+  * deps: depd@~1.0.1
+  * deps: proxy-addr@~1.0.8
+    - deps: ipaddr.js@1.0.1
+  * deps: send@0.12.3
+    - deps: debug@~2.2.0
+    - deps: depd@~1.0.1
+    - deps: etag@~1.6.0
+    - deps: ms@0.7.1
+    - deps: on-finished@~2.2.1
+
+3.20.2 / 2015-03-16
+===================
+
+  * deps: connect@2.29.1
+    - deps: body-parser@~1.12.2
+    - deps: compression@~1.4.3
+    - deps: connect-timeout@~1.6.1
+    - deps: debug@~2.1.3
+    - deps: errorhandler@~1.3.5
+    - deps: express-session@~1.10.4
+    - deps: finalhandler@0.3.4
+    - deps: method-override@~2.3.2
+    - deps: morgan@~1.5.2
+    - deps: qs@2.4.1
+    - deps: serve-index@~1.6.3
+    - deps: serve-static@~1.9.2
+    - deps: type-is@~1.6.1
+  * deps: debug@~2.1.3
+    - Fix high intensity foreground color for bold
+    - deps: ms@0.7.0
+  * deps: merge-descriptors@1.0.0
+  * deps: proxy-addr@~1.0.7
+    - deps: ipaddr.js@0.1.9
+  * deps: send@0.12.2
+    - Throw errors early for invalid `extensions` or `index` options
+    - deps: debug@~2.1.3
+
+3.20.1 / 2015-02-28
+===================
+
+  * Fix `req.host` when using "trust proxy" hops count
+  * Fix `req.protocol`/`req.secure` when using "trust proxy" hops count
+
+3.20.0 / 2015-02-18
+===================
+
+  * Fix `"trust proxy"` setting to inherit when app is mounted
+  * Generate `ETag`s for all request responses
+    - No longer restricted to only responses for `GET` and `HEAD` requests
+  * Use `content-type` to parse `Content-Type` headers
+  * deps: connect@2.29.0
+    - Use `content-type` to parse `Content-Type` headers
+    - deps: body-parser@~1.12.0
+    - deps: compression@~1.4.1
+    - deps: connect-timeout@~1.6.0
+    - deps: cookie-parser@~1.3.4
+    - deps: cookie-signature@1.0.6
+    - deps: csurf@~1.7.0
+    - deps: errorhandler@~1.3.4
+    - deps: express-session@~1.10.3
+    - deps: http-errors@~1.3.1
+    - deps: response-time@~2.3.0
+    - deps: serve-index@~1.6.2
+    - deps: serve-static@~1.9.1
+    - deps: type-is@~1.6.0
+  * deps: cookie-signature@1.0.6
+  * deps: send@0.12.1
+    - Always read the stat size from the file
+    - Fix mutating passed-in `options`
+    - deps: mime@1.3.4
+
+3.19.2 / 2015-02-01
+===================
+
+  * deps: connect@2.28.3
+    - deps: compression@~1.3.1
+    - deps: csurf@~1.6.6
+    - deps: errorhandler@~1.3.3
+    - deps: express-session@~1.10.2
+    - deps: serve-index@~1.6.1
+    - deps: type-is@~1.5.6
+  * deps: proxy-addr@~1.0.6
+    - deps: ipaddr.js@0.1.8
+
+3.19.1 / 2015-01-20
+===================
+
+  * deps: connect@2.28.2
+    - deps: body-parser@~1.10.2
+    - deps: serve-static@~1.8.1
+  * deps: send@0.11.1
+    - Fix root path disclosure
+
+3.19.0 / 2015-01-09
+===================
+
+  * Fix `OPTIONS` responses to include the `HEAD` method property
+  * Use `readline` for prompt in `express(1)`
+  * deps: commander@2.6.0
+  * deps: connect@2.28.1
+    - deps: body-parser@~1.10.1
+    - deps: compression@~1.3.0
+    - deps: connect-timeout@~1.5.0
+    - deps: csurf@~1.6.4
+    - deps: debug@~2.1.1
+    - deps: errorhandler@~1.3.2
+    - deps: express-session@~1.10.1
+    - deps: finalhandler@0.3.3
+    - deps: method-override@~2.3.1
+    - deps: morgan@~1.5.1
+    - deps: serve-favicon@~2.2.0
+    - deps: serve-index@~1.6.0
+    - deps: serve-static@~1.8.0
+    - deps: type-is@~1.5.5
+  * deps: debug@~2.1.1
+  * deps: methods@~1.1.1
+  * deps: proxy-addr@~1.0.5
+    - deps: ipaddr.js@0.1.6
+  * deps: send@0.11.0
+    - deps: debug@~2.1.1
+    - deps: etag@~1.5.1
+    - deps: ms@0.7.0
+    - deps: on-finished@~2.2.0
+
+3.18.6 / 2014-12-12
+===================
+
+  * Fix exception in `req.fresh`/`req.stale` without response headers
+
+3.18.5 / 2014-12-11
+===================
+
+  * deps: connect@2.27.6
+    - deps: compression@~1.2.2
+    - deps: express-session@~1.9.3
+    - deps: http-errors@~1.2.8
+    - deps: serve-index@~1.5.3
+    - deps: type-is@~1.5.4
+
+3.18.4 / 2014-11-23
+===================
+
+  * deps: connect@2.27.4
+    - deps: body-parser@~1.9.3
+    - deps: compression@~1.2.1
+    - deps: errorhandler@~1.2.3
+    - deps: express-session@~1.9.2
+    - deps: qs@2.3.3
+    - deps: serve-favicon@~2.1.7
+    - deps: serve-static@~1.5.1
+    - deps: type-is@~1.5.3
+  * deps: etag@~1.5.1
+  * deps: proxy-addr@~1.0.4
+    - deps: ipaddr.js@0.1.5
+
+3.18.3 / 2014-11-09
+===================
+
+  * deps: connect@2.27.3
+    - Correctly invoke async callback asynchronously
+    - deps: csurf@~1.6.3
+
+3.18.2 / 2014-10-28
+===================
+
+  * deps: connect@2.27.2
+    - Fix handling of URLs containing `://` in the path
+    - deps: body-parser@~1.9.2
+    - deps: qs@2.3.2
+
+3.18.1 / 2014-10-22
+===================
+
+  * Fix internal `utils.merge` deprecation warnings
+  * deps: connect@2.27.1
+    - deps: body-parser@~1.9.1
+    - deps: express-session@~1.9.1
+    - deps: finalhandler@0.3.2
+    - deps: morgan@~1.4.1
+    - deps: qs@2.3.0
+    - deps: serve-static@~1.7.1
+  * deps: send@0.10.1
+    - deps: on-finished@~2.1.1
+
+3.18.0 / 2014-10-17
+===================
+
+  * Use `content-disposition` module for `res.attachment`/`res.download`
+    - Sends standards-compliant `Content-Disposition` header
+    - Full Unicode support
+  * Use `etag` module to generate `ETag` headers
+  * deps: connect@2.27.0
+    - Use `http-errors` module for creating errors
+    - Use `utils-merge` module for merging objects
+    - deps: body-parser@~1.9.0
+    - deps: compression@~1.2.0
+    - deps: connect-timeout@~1.4.0
+    - deps: debug@~2.1.0
+    - deps: depd@~1.0.0
+    - deps: express-session@~1.9.0
+    - deps: finalhandler@0.3.1
+    - deps: method-override@~2.3.0
+    - deps: morgan@~1.4.0
+    - deps: response-time@~2.2.0
+    - deps: serve-favicon@~2.1.6
+    - deps: serve-index@~1.5.0
+    - deps: serve-static@~1.7.0
+  * deps: debug@~2.1.0
+    - Implement `DEBUG_FD` env variable support
+  * deps: depd@~1.0.0
+  * deps: send@0.10.0
+    - deps: debug@~2.1.0
+    - deps: depd@~1.0.0
+    - deps: etag@~1.5.0
+
+3.17.8 / 2014-10-15
+===================
+
+  * deps: connect@2.26.6
+    - deps: compression@~1.1.2
+    - deps: csurf@~1.6.2
+    - deps: errorhandler@~1.2.2
+
+3.17.7 / 2014-10-08
+===================
+
+  * deps: connect@2.26.5
+    - Fix accepting non-object arguments to `logger`
+    - deps: serve-static@~1.6.4
+
+3.17.6 / 2014-10-02
+===================
+
+  * deps: connect@2.26.4
+    - deps: morgan@~1.3.2
+    - deps: type-is@~1.5.2
+
+3.17.5 / 2014-09-24
+===================
+
+  * deps: connect@2.26.3
+    - deps: body-parser@~1.8.4
+    - deps: serve-favicon@~2.1.5
+    - deps: serve-static@~1.6.3
+  * deps: proxy-addr@~1.0.3
+    - Use `forwarded` npm module
+  * deps: send@0.9.3
+    - deps: etag@~1.4.0
+
+3.17.4 / 2014-09-19
+===================
+
+  * deps: connect@2.26.2
+    - deps: body-parser@~1.8.3
+    - deps: qs@2.2.4
+
+3.17.3 / 2014-09-18
+===================
+
+  * deps: proxy-addr@~1.0.2
+    - Fix a global leak when multiple subnets are trusted
+    - deps: ipaddr.js@0.1.3
+
+3.17.2 / 2014-09-15
+===================
+
+  * Use `crc` instead of `buffer-crc32` for speed
+  * deps: connect@2.26.1
+    - deps: body-parser@~1.8.2
+    - deps: depd@0.4.5
+    - deps: express-session@~1.8.2
+    - deps: morgan@~1.3.1
+    - deps: serve-favicon@~2.1.3
+    - deps: serve-static@~1.6.2
+  * deps: depd@0.4.5
+  * deps: send@0.9.2
+    - deps: depd@0.4.5
+    - deps: etag@~1.3.1
+    - deps: range-parser@~1.0.2
+
+3.17.1 / 2014-09-08
+===================
+
+  * Fix error in `req.subdomains` on empty host
+
+3.17.0 / 2014-09-08
+===================
+
+  * Support `X-Forwarded-Host` in `req.subdomains`
+  * Support IP address host in `req.subdomains`
+  * deps: connect@2.26.0
+    - deps: body-parser@~1.8.1
+    - deps: compression@~1.1.0
+    - deps: connect-timeout@~1.3.0
+    - deps: cookie-parser@~1.3.3
+    - deps: cookie-signature@1.0.5
+    - deps: csurf@~1.6.1
+    - deps: debug@~2.0.0
+    - deps: errorhandler@~1.2.0
+    - deps: express-session@~1.8.1
+    - deps: finalhandler@0.2.0
+    - deps: fresh@0.2.4
+    - deps: media-typer@0.3.0
+    - deps: method-override@~2.2.0
+    - deps: morgan@~1.3.0
+    - deps: qs@2.2.3
+    - deps: serve-favicon@~2.1.3
+    - deps: serve-index@~1.2.1
+    - deps: serve-static@~1.6.1
+    - deps: type-is@~1.5.1
+    - deps: vhost@~3.0.0
+  * deps: cookie-signature@1.0.5
+  * deps: debug@~2.0.0
+  * deps: fresh@0.2.4
+  * deps: media-typer@0.3.0
+    - Throw error when parameter format invalid on parse
+  * deps: range-parser@~1.0.2
+  * deps: send@0.9.1
+    - Add `lastModified` option
+    - Use `etag` to generate `ETag` header
+    - deps: debug@~2.0.0
+    - deps: fresh@0.2.4
+  * deps: vary@~1.0.0
+    - Accept valid `Vary` header string as `field`
+
+3.16.10 / 2014-09-04
+====================
+
+  * deps: connect@2.25.10
+    - deps: serve-static@~1.5.4
+  * deps: send@0.8.5
+    - Fix a path traversal issue when using `root`
+    - Fix malicious path detection for empty string path
+
+3.16.9 / 2014-08-29
+===================
+
+  * deps: connect@2.25.9
+    - deps: body-parser@~1.6.7
+    - deps: qs@2.2.2
+
+3.16.8 / 2014-08-27
+===================
+
+  * deps: connect@2.25.8
+    - deps: body-parser@~1.6.6
+    - deps: csurf@~1.4.1
+    - deps: qs@2.2.0
+
+3.16.7 / 2014-08-18
+===================
+
+  * deps: connect@2.25.7
+    - deps: body-parser@~1.6.5
+    - deps: express-session@~1.7.6
+    - deps: morgan@~1.2.3
+    - deps: serve-static@~1.5.3
+  * deps: send@0.8.3
+    - deps: destroy@1.0.3
+    - deps: on-finished@2.1.0
+
+3.16.6 / 2014-08-14
+===================
+
+  * deps: connect@2.25.6
+    - deps: body-parser@~1.6.4
+    - deps: qs@1.2.2
+    - deps: serve-static@~1.5.2
+  * deps: send@0.8.2
+    - Work around `fd` leak in Node.js 0.10 for `fs.ReadStream`
+
+3.16.5 / 2014-08-11
+===================
+
+  * deps: connect@2.25.5
+    - Fix backwards compatibility in `logger`
+
+3.16.4 / 2014-08-10
+===================
+
+  * Fix original URL parsing in `res.location`
+  * deps: connect@2.25.4
+    - Fix `query` middleware breaking with argument
+    - deps: body-parser@~1.6.3
+    - deps: compression@~1.0.11
+    - deps: connect-timeout@~1.2.2
+    - deps: express-session@~1.7.5
+    - deps: method-override@~2.1.3
+    - deps: on-headers@~1.0.0
+    - deps: parseurl@~1.3.0
+    - deps: qs@1.2.1
+    - deps: response-time@~2.0.1
+    - deps: serve-index@~1.1.6
+    - deps: serve-static@~1.5.1
+  * deps: parseurl@~1.3.0
+
+3.16.3 / 2014-08-07
+===================
+
+  * deps: connect@2.25.3
+    - deps: multiparty@3.3.2
+
+3.16.2 / 2014-08-07
+===================
+
+  * deps: connect@2.25.2
+    - deps: body-parser@~1.6.2
+    - deps: qs@1.2.0
+
+3.16.1 / 2014-08-06
+===================
+
+  * deps: connect@2.25.1
+    - deps: body-parser@~1.6.1
+    - deps: qs@1.1.0
+
+3.16.0 / 2014-08-05
+===================
+
+  * deps: connect@2.25.0
+    - deps: body-parser@~1.6.0
+    - deps: compression@~1.0.10
+    - deps: csurf@~1.4.0
+    - deps: express-session@~1.7.4
+    - deps: qs@1.0.2
+    - deps: serve-static@~1.5.0
+  * deps: send@0.8.1
+    - Add `extensions` option
+
+3.15.3 / 2014-08-04
+===================
+
+  * fix `res.sendfile` regression for serving directory index files
+  * deps: connect@2.24.3
+    - deps: serve-index@~1.1.5
+    - deps: serve-static@~1.4.4
+  * deps: send@0.7.4
+    - Fix incorrect 403 on Windows and Node.js 0.11
+    - Fix serving index files without root dir
+
+3.15.2 / 2014-07-27
+===================
+
+  * deps: connect@2.24.2
+    - deps: body-parser@~1.5.2
+    - deps: depd@0.4.4
+    - deps: express-session@~1.7.2
+    - deps: morgan@~1.2.2
+    - deps: serve-static@~1.4.2
+  * deps: depd@0.4.4
+    - Work-around v8 generating empty stack traces
+  * deps: send@0.7.2
+    - deps: depd@0.4.4
+
+3.15.1 / 2014-07-26
+===================
+
+  * deps: connect@2.24.1
+    - deps: body-parser@~1.5.1
+    - deps: depd@0.4.3
+    - deps: express-session@~1.7.1
+    - deps: morgan@~1.2.1
+    - deps: serve-index@~1.1.4
+    - deps: serve-static@~1.4.1
+  * deps: depd@0.4.3
+    - Fix exception when global `Error.stackTraceLimit` is too low
+  * deps: send@0.7.1
+    - deps: depd@0.4.3
+
+3.15.0 / 2014-07-22
+===================
+
+  * Fix `req.protocol` for proxy-direct connections
+  * Pass options from `res.sendfile` to `send`
+  * deps: connect@2.24.0
+    - deps: body-parser@~1.5.0
+    - deps: compression@~1.0.9
+    - deps: connect-timeout@~1.2.1
+    - deps: debug@1.0.4
+    - deps: depd@0.4.2
+    - deps: express-session@~1.7.0
+    - deps: finalhandler@0.1.0
+    - deps: method-override@~2.1.2
+    - deps: morgan@~1.2.0
+    - deps: multiparty@3.3.1
+    - deps: parseurl@~1.2.0
+    - deps: serve-static@~1.4.0
+  * deps: debug@1.0.4
+  * deps: depd@0.4.2
+    - Add `TRACE_DEPRECATION` environment variable
+    - Remove non-standard grey color from color output
+    - Support `--no-deprecation` argument
+    - Support `--trace-deprecation` argument
+  * deps: parseurl@~1.2.0
+    - Cache URLs based on original value
+    - Remove no-longer-needed URL mis-parse work-around
+    - Simplify the "fast-path" `RegExp`
+  * deps: send@0.7.0
+    - Add `dotfiles` option
+    - Cap `maxAge` value to 1 year
+    - deps: debug@1.0.4
+    - deps: depd@0.4.2
+
+3.14.0 / 2014-07-11
+===================
+
+ * add explicit "Rosetta Flash JSONP abuse" protection
+   - previous versions are not vulnerable; this is just explicit protection
+ * deprecate `res.redirect(url, status)` -- use `res.redirect(status, url)` instead
+ * fix `res.send(status, num)` to send `num` as json (not error)
+ * remove unnecessary escaping when `res.jsonp` returns JSON response
+ * deps: basic-auth@1.0.0
+   - support empty password
+   - support empty username
+ * deps: connect@2.23.0
+   - deps: debug@1.0.3
+   - deps: express-session@~1.6.4
+   - deps: method-override@~2.1.0
+   - deps: parseurl@~1.1.3
+   - deps: serve-static@~1.3.1
+  * deps: debug@1.0.3
+    - Add support for multiple wildcards in namespaces
+  * deps: methods@1.1.0
+    - add `CONNECT`
+  * deps: parseurl@~1.1.3
+    - faster parsing of href-only URLs
+
+3.13.0 / 2014-07-03
+===================
+
+ * add deprecation message to `app.configure`
+ * add deprecation message to `req.auth`
+ * use `basic-auth` to parse `Authorization` header
+ * deps: connect@2.22.0
+   - deps: csurf@~1.3.0
+   - deps: express-session@~1.6.1
+   - deps: multiparty@3.3.0
+   - deps: serve-static@~1.3.0
+ * deps: send@0.5.0
+   - Accept string for `maxage` (converted by `ms`)
+   - Include link in default redirect response
+
+3.12.1 / 2014-06-26
+===================
+
+ * deps: connect@2.21.1
+   - deps: cookie-parser@1.3.2
+   - deps: cookie-signature@1.0.4
+   - deps: express-session@~1.5.2
+   - deps: type-is@~1.3.2
+ * deps: cookie-signature@1.0.4
+   - fix for timing attacks
+
+3.12.0 / 2014-06-21
+===================
+
+ * use `media-typer` to alter content-type charset
+ * deps: connect@2.21.0
+   - deprecate `connect(middleware)` -- use `app.use(middleware)` instead
+   - deprecate `connect.createServer()` -- use `connect()` instead
+   - fix `res.setHeader()` patch to work with with get -> append -> set pattern
+   - deps: compression@~1.0.8
+   - deps: errorhandler@~1.1.1
+   - deps: express-session@~1.5.0
+   - deps: serve-index@~1.1.3
+
+3.11.0 / 2014-06-19
+===================
+
+ * deprecate things with `depd` module
+ * deps: buffer-crc32@0.2.3
+ * deps: connect@2.20.2
+   - deprecate `verify` option to `json` -- use `body-parser` npm module instead
+   - deprecate `verify` option to `urlencoded` -- use `body-parser` npm module instead
+   - deprecate things with `depd` module
+   - use `finalhandler` for final response handling
+   - use `media-typer` to parse `content-type` for charset
+   - deps: body-parser@1.4.3
+   - deps: connect-timeout@1.1.1
+   - deps: cookie-parser@1.3.1
+   - deps: csurf@1.2.2
+   - deps: errorhandler@1.1.0
+   - deps: express-session@1.4.0
+   - deps: multiparty@3.2.9
+   - deps: serve-index@1.1.2
+   - deps: type-is@1.3.1
+   - deps: vhost@2.0.0
+
+3.10.5 / 2014-06-11
+===================
+
+ * deps: connect@2.19.6
+   - deps: body-parser@1.3.1
+   - deps: compression@1.0.7
+   - deps: debug@1.0.2
+   - deps: serve-index@1.1.1
+   - deps: serve-static@1.2.3
+ * deps: debug@1.0.2
+ * deps: send@0.4.3
+   - Do not throw un-catchable error on file open race condition
+   - Use `escape-html` for HTML escaping
+   - deps: debug@1.0.2
+   - deps: finished@1.2.2
+   - deps: fresh@0.2.2
+
+3.10.4 / 2014-06-09
+===================
+
+ * deps: connect@2.19.5
+   - fix "event emitter leak" warnings
+   - deps: csurf@1.2.1
+   - deps: debug@1.0.1
+   - deps: serve-static@1.2.2
+   - deps: type-is@1.2.1
+ * deps: debug@1.0.1
+ * deps: send@0.4.2
+   - fix "event emitter leak" warnings
+   - deps: finished@1.2.1
+   - deps: debug@1.0.1
+
+3.10.3 / 2014-06-05
+===================
+
+ * use `vary` module for `res.vary`
+ * deps: connect@2.19.4
+   - deps: errorhandler@1.0.2
+   - deps: method-override@2.0.2
+   - deps: serve-favicon@2.0.1
+ * deps: debug@1.0.0
+
+3.10.2 / 2014-06-03
+===================
+
+ * deps: connect@2.19.3
+   - deps: compression@1.0.6
+
+3.10.1 / 2014-06-03
+===================
+
+ * deps: connect@2.19.2
+   - deps: compression@1.0.4
+ * deps: proxy-addr@1.0.1
+
+3.10.0 / 2014-06-02
+===================
+
+ * deps: connect@2.19.1
+   - deprecate `methodOverride()` -- use `method-override` npm module instead
+   - deps: body-parser@1.3.0
+   - deps: method-override@2.0.1
+   - deps: multiparty@3.2.8
+   - deps: response-time@2.0.0
+   - deps: serve-static@1.2.1
+ * deps: methods@1.0.1
+ * deps: send@0.4.1
+   - Send `max-age` in `Cache-Control` in correct format
+
+3.9.0 / 2014-05-30
+==================
+
+ * custom etag control with `app.set('etag', val)`
+   - `app.set('etag', function(body, encoding){ return '"etag"' })` custom etag generation
+   - `app.set('etag', 'weak')` weak tag
+   - `app.set('etag', 'strong')` strong etag
+   - `app.set('etag', false)` turn off
+   - `app.set('etag', true)` standard etag
+ * Include ETag in HEAD requests
+ * mark `res.send` ETag as weak and reduce collisions
+ * update connect to 2.18.0
+   - deps: compression@1.0.3
+   - deps: serve-index@1.1.0
+   - deps: serve-static@1.2.0
+ * update send to 0.4.0
+   - Calculate ETag with md5 for reduced collisions
+   - Ignore stream errors after request ends
+   - deps: debug@0.8.1
+
+3.8.1 / 2014-05-27
+==================
+
+ * update connect to 2.17.3
+   - deps: body-parser@1.2.2
+   - deps: express-session@1.2.1
+   - deps: method-override@1.0.2
+
+3.8.0 / 2014-05-21
+==================
+
+ * keep previous `Content-Type` for `res.jsonp`
+ * set proper `charset` in `Content-Type` for `res.send`
+ * update connect to 2.17.1
+   - fix `res.charset` appending charset when `content-type` has one
+   - deps: express-session@1.2.0
+   - deps: morgan@1.1.1
+   - deps: serve-index@1.0.3
+
+3.7.0 / 2014-05-18
+==================
+
+ * proper proxy trust with `app.set('trust proxy', trust)`
+   - `app.set('trust proxy', 1)` trust first hop
+   - `app.set('trust proxy', 'loopback')` trust loopback addresses
+   - `app.set('trust proxy', '10.0.0.1')` trust single IP
+   - `app.set('trust proxy', '10.0.0.1/16')` trust subnet
+   - `app.set('trust proxy', '10.0.0.1, 10.0.0.2')` trust list
+   - `app.set('trust proxy', false)` turn off
+   - `app.set('trust proxy', true)` trust everything
+ * update connect to 2.16.2
+   - deprecate `res.headerSent` -- use `res.headersSent`
+   - deprecate `res.on("header")` -- use on-headers module instead
+   - fix edge-case in `res.appendHeader` that would append in wrong order
+   - json: use body-parser
+   - urlencoded: use body-parser
+   - dep: bytes@1.0.0
+   - dep: cookie-parser@1.1.0
+   - dep: csurf@1.2.0
+   - dep: express-session@1.1.0
+   - dep: method-override@1.0.1
+
+3.6.0 / 2014-05-09
+==================
+
+ * deprecate `app.del()` -- use `app.delete()` instead
+ * deprecate `res.json(obj, status)` -- use `res.json(status, obj)` instead
+   - the edge-case `res.json(status, num)` requires `res.status(status).json(num)`
+ * deprecate `res.jsonp(obj, status)` -- use `res.jsonp(status, obj)` instead
+   - the edge-case `res.jsonp(status, num)` requires `res.status(status).jsonp(num)`
+ * support PURGE method
+   - add `app.purge`
+   - add `router.purge`
+   - include PURGE in `app.all`
+ * update connect to 2.15.0
+   * Add `res.appendHeader`
+   * Call error stack even when response has been sent
+   * Patch `res.headerSent` to return Boolean
+   * Patch `res.headersSent` for node.js 0.8
+   * Prevent default 404 handler after response sent
+   * dep: compression@1.0.2
+   * dep: connect-timeout@1.1.0
+   * dep: debug@^0.8.0
+   * dep: errorhandler@1.0.1
+   * dep: express-session@1.0.4
+   * dep: morgan@1.0.1
+   * dep: serve-favicon@2.0.0
+   * dep: serve-index@1.0.2
+ * update debug to 0.8.0
+   * add `enable()` method
+   * change from stderr to stdout
+ * update methods to 1.0.0
+   - add PURGE
+ * update mkdirp to 0.5.0
+
+3.5.3 / 2014-05-08
+==================
+
+ * fix `req.host` for IPv6 literals
+ * fix `res.jsonp` error if callback param is object
+
+3.5.2 / 2014-04-24
+==================
+
+ * update connect to 2.14.5
+ * update cookie to 0.1.2
+ * update mkdirp to 0.4.0
+ * update send to 0.3.0
+
+3.5.1 / 2014-03-25
+==================
+
+ * pin less-middleware in generated app
+
+3.5.0 / 2014-03-06
+==================
+
+ * bump deps
+
+3.4.8 / 2014-01-13
+==================
+
+ * prevent incorrect automatic OPTIONS responses #1868 @dpatti
+ * update binary and examples for jade 1.0 #1876 @yossi, #1877 @reqshark, #1892 @matheusazzi
+ * throw 400 in case of malformed paths @rlidwka
+
+3.4.7 / 2013-12-10
+==================
+
+ * update connect
+
+3.4.6 / 2013-12-01
+==================
+
+ * update connect (raw-body)
+
+3.4.5 / 2013-11-27
+==================
+
+ * update connect
+ * res.location: remove leading ./ #1802 @kapouer
+ * res.redirect: fix `res.redirect('toString') #1829 @michaelficarra
+ * res.send: always send ETag when content-length > 0
+ * router: add Router.all() method
+
+3.4.4 / 2013-10-29
+==================
+
+ * update connect
+ * update supertest
+ * update methods
+ * express(1): replace bodyParser() with urlencoded() and json() #1795 @chirag04
+
+3.4.3 / 2013-10-23
+==================
+
+ * update connect
+
+3.4.2 / 2013-10-18
+==================
+
+ * update connect
+ * downgrade commander
+
+3.4.1 / 2013-10-15
+==================
+
+ * update connect
+ * update commander
+ * jsonp: check if callback is a function
+ * router: wrap encodeURIComponent in a try/catch #1735 (@lxe)
+ * res.format: now includes charset @1747 (@sorribas)
+ * res.links: allow multiple calls @1746 (@sorribas)
+
+3.4.0 / 2013-09-07
+==================
+
+ * add res.vary(). Closes #1682
+ * update connect
+
+3.3.8 / 2013-09-02
+==================
+
+ * update connect
+
+3.3.7 / 2013-08-28
+==================
+
+ * update connect
+
+3.3.6 / 2013-08-27
+==================
+
+ * Revert "remove charset from json responses. Closes #1631" (causes issues in some clients)
+ * add: req.accepts take an argument list
+
+3.3.4 / 2013-07-08
+==================
+
+ * update send and connect
+
+3.3.3 / 2013-07-04
+==================
+
+ * update connect
+
+3.3.2 / 2013-07-03
+==================
+
+ * update connect
+ * update send
+ * remove .version export
+
+3.3.1 / 2013-06-27
+==================
+
+ * update connect
+
+3.3.0 / 2013-06-26
+==================
+
+ * update connect
+ * add support for multiple X-Forwarded-Proto values. Closes #1646
+ * change: remove charset from json responses. Closes #1631
+ * change: return actual booleans from req.accept* functions
+ * fix jsonp callback array throw
+
+3.2.6 / 2013-06-02
+==================
+
+ * update connect
+
+3.2.5 / 2013-05-21
+==================
+
+ * update connect
+ * update node-cookie
+ * add: throw a meaningful error when there is no default engine
+ * change generation of ETags with res.send() to GET requests only. Closes #1619
+
+3.2.4 / 2013-05-09
+==================
+
+  * fix `req.subdomains` when no Host is present
+  * fix `req.host` when no Host is present, return undefined
+
+3.2.3 / 2013-05-07
+==================
+
+  * update connect / qs
+
+3.2.2 / 2013-05-03
+==================
+
+  * update qs
+
+3.2.1 / 2013-04-29
+==================
+
+  * add app.VERB() paths array deprecation warning
+  * update connect
+  * update qs and remove all ~ semver crap
+  * fix: accept number as value of Signed Cookie
+
+3.2.0 / 2013-04-15
+==================
+
+  * add "view" constructor setting to override view behaviour
+  * add req.acceptsEncoding(name)
+  * add req.acceptedEncodings
+  * revert cookie signature change causing session race conditions
+  * fix sorting of Accept values of the same quality
+
+3.1.2 / 2013-04-12
+==================
+
+  * add support for custom Accept parameters
+  * update cookie-signature
+
+3.1.1 / 2013-04-01
+==================
+
+  * add X-Forwarded-Host support to `req.host`
+  * fix relative redirects
+  * update mkdirp
+  * update buffer-crc32
+  * remove legacy app.configure() method from app template.
+
+3.1.0 / 2013-01-25
+==================
+
+  * add support for leading "." in "view engine" setting
+  * add array support to `res.set()`
+  * add node 0.8.x to travis.yml
+  * add "subdomain offset" setting for tweaking `req.subdomains`
+  * add `res.location(url)` implementing `res.redirect()`-like setting of Location
+  * use app.get() for x-powered-by setting for inheritance
+  * fix colons in passwords for `req.auth`
+
+3.0.6 / 2013-01-04
+==================
+
+  * add http verb methods to Router
+  * update connect
+  * fix mangling of the `res.cookie()` options object
+  * fix jsonp whitespace escape. Closes #1132
+
+3.0.5 / 2012-12-19
+==================
+
+  * add throwing when a non-function is passed to a route
+  * fix: explicitly remove Transfer-Encoding header from 204 and 304 responses
+  * revert "add 'etag' option"
+
+3.0.4 / 2012-12-05
+==================
+
+  * add 'etag' option to disable `res.send()` Etags
+  * add escaping of urls in text/plain in `res.redirect()`
+    for old browsers interpreting as html
+  * change crc32 module for a more liberal license
+  * update connect
+
+3.0.3 / 2012-11-13
+==================
+
+  * update connect
+  * update cookie module
+  * fix cookie max-age
+
+3.0.2 / 2012-11-08
+==================
+
+  * add OPTIONS to cors example. Closes #1398
+  * fix route chaining regression. Closes #1397
+
+3.0.1 / 2012-11-01
+==================
+
+  * update connect
+
+3.0.0 / 2012-10-23
+==================
+
+  * add `make clean`
+  * add "Basic" check to req.auth
+  * add `req.auth` test coverage
+  * add cb && cb(payload) to `res.jsonp()`. Closes #1374
+  * add backwards compat for `res.redirect()` status. Closes #1336
+  * add support for `res.json()` to retain previously defined Content-Types. Closes #1349
+  * update connect
+  * change `res.redirect()` to utilize a pathname-relative Location again. Closes #1382
+  * remove non-primitive string support for `res.send()`
+  * fix view-locals example. Closes #1370
+  * fix route-separation example
+
+3.0.0rc5 / 2012-09-18
+==================
+
+  * update connect
+  * add redis search example
+  * add static-files example
+  * add "x-powered-by" setting (`app.disable('x-powered-by')`)
+  * add "application/octet-stream" redirect Accept test case. Closes #1317
+
+3.0.0rc4 / 2012-08-30
+==================
+
+  * add `res.jsonp()`. Closes #1307
+  * add "verbose errors" option to error-pages example
+  * add another route example to express(1) so people are not so confused
+  * add redis online user activity tracking example
+  * update connect dep
+  * fix etag quoting. Closes #1310
+  * fix error-pages 404 status
+  * fix jsonp callback char restrictions
+  * remove old OPTIONS default response
+
+3.0.0rc3 / 2012-08-13
+==================
+
+  * update connect dep
+  * fix signed cookies to work with `connect.cookieParser()` ("s:" prefix was missing) [tnydwrds]
+  * fix `res.render()` clobbering of "locals"
+
+3.0.0rc2 / 2012-08-03
+==================
+
+  * add CORS example
+  * update connect dep
+  * deprecate `.createServer()` & remove old stale examples
+  * fix: escape `res.redirect()` link
+  * fix vhost example
+
+3.0.0rc1 / 2012-07-24
+==================
+
+  * add more examples to view-locals
+  * add scheme-relative redirects (`res.redirect("//foo.com")`) support
+  * update cookie dep
+  * update connect dep
+  * update send dep
+  * fix `express(1)` -h flag, use -H for hogan. Closes #1245
+  * fix `res.sendfile()` socket error handling regression
+
+3.0.0beta7 / 2012-07-16
+==================
+
+  * update connect dep for `send()` root normalization regression
+
+3.0.0beta6 / 2012-07-13
+==================
+
+  * add `err.view` property for view errors. Closes #1226
+  * add "jsonp callback name" setting
+  * add support for "/foo/:bar*" non-greedy matches
+  * change `res.sendfile()` to use `send()` module
+  * change `res.send` to use "response-send" module
+  * remove `app.locals.use` and `res.locals.use`, use regular middleware
+
+3.0.0beta5 / 2012-07-03
+==================
+
+  * add "make check" support
+  * add route-map example
+  * add `res.json(obj, status)` support back for BC
+  * add "methods" dep, remove internal methods module
+  * update connect dep
+  * update auth example to utilize cores pbkdf2
+  * updated tests to use "supertest"
+
+3.0.0beta4 / 2012-06-25
+==================
+
+  * Added `req.auth`
+  * Added `req.range(size)`
+  * Added `res.links(obj)`
+  * Added `res.send(body, status)` support back for backwards compat
+  * Added `.default()` support to `res.format()`
+  * Added 2xx / 304 check to `req.fresh`
+  * Revert "Added + support to the router"
+  * Fixed `res.send()` freshness check, respect res.statusCode
+
+3.0.0beta3 / 2012-06-15
+==================
+
+  * Added hogan `--hjs` to express(1) [nullfirm]
+  * Added another example to content-negotiation
+  * Added `fresh` dep
+  * Changed: `res.send()` always checks freshness
+  * Fixed: expose connects mime module. Closes #1165
+
+3.0.0beta2 / 2012-06-06
+==================
+
+  * Added `+` support to the router
+  * Added `req.host`
+  * Changed `req.param()` to check route first
+  * Update connect dep
+
+3.0.0beta1 / 2012-06-01
+==================
+
+  * Added `res.format()` callback to override default 406 behaviour
+  * Fixed `res.redirect()` 406. Closes #1154
+
+3.0.0alpha5 / 2012-05-30
+==================
+
+  * Added `req.ip`
+  * Added `{ signed: true }` option to `res.cookie()`
+  * Removed `res.signedCookie()`
+  * Changed: dont reverse `req.ips`
+  * Fixed "trust proxy" setting check for `req.ips`
+
+3.0.0alpha4 / 2012-05-09
+==================
+
+  * Added: allow `[]` in jsonp callback. Closes #1128
+  * Added `PORT` env var support in generated template. Closes #1118 [benatkin]
+  * Updated: connect 2.2.2
+
+3.0.0alpha3 / 2012-05-04
+==================
+
+  * Added public `app.routes`. Closes #887
+  * Added _view-locals_ example
+  * Added _mvc_ example
+  * Added `res.locals.use()`. Closes #1120
+  * Added conditional-GET support to `res.send()`
+  * Added: coerce `res.set()` values to strings
+  * Changed: moved `static()` in generated apps below router
+  * Changed: `res.send()` only set ETag when not previously set
+  * Changed connect 2.2.1 dep
+  * Changed: `make test` now runs unit / acceptance tests
+  * Fixed req/res proto inheritance
+
+3.0.0alpha2 / 2012-04-26
+==================
+
+  * Added `make benchmark` back
+  * Added `res.send()` support for `String` objects
+  * Added client-side data exposing example
+  * Added `res.header()` and `req.header()` aliases for BC
+  * Added `express.createServer()` for BC
+  * Perf: memoize parsed urls
+  * Perf: connect 2.2.0 dep
+  * Changed: make `expressInit()` middleware self-aware
+  * Fixed: use app.get() for all core settings
+  * Fixed redis session example
+  * Fixed session example. Closes #1105
+  * Fixed generated express dep. Closes #1078
+
+3.0.0alpha1 / 2012-04-15
+==================
+
+  * Added `app.locals.use(callback)`
+  * Added `app.locals` object
+  * Added `app.locals(obj)`
+  * Added `res.locals` object
+  * Added `res.locals(obj)`
+  * Added `res.format()` for content-negotiation
+  * Added `app.engine()`
+  * Added `res.cookie()` JSON cookie support
+  * Added "trust proxy" setting
+  * Added `req.subdomains`
+  * Added `req.protocol`
+  * Added `req.secure`
+  * Added `req.path`
+  * Added `req.ips`
+  * Added `req.fresh`
+  * Added `req.stale`
+  * Added comma-delimited / array support for `req.accepts()`
+  * Added debug instrumentation
+  * Added `res.set(obj)`
+  * Added `res.set(field, value)`
+  * Added `res.get(field)`
+  * Added `app.get(setting)`. Closes #842
+  * Added `req.acceptsLanguage()`
+  * Added `req.acceptsCharset()`
+  * Added `req.accepted`
+  * Added `req.acceptedLanguages`
+  * Added `req.acceptedCharsets`
+  * Added "json replacer" setting
+  * Added "json spaces" setting
+  * Added X-Forwarded-Proto support to `res.redirect()`. Closes #92
+  * Added `--less` support to express(1)
+  * Added `express.response` prototype
+  * Added `express.request` prototype
+  * Added `express.application` prototype
+  * Added `app.path()`
+  * Added `app.render()`
+  * Added `res.type()` to replace `res.contentType()`
+  * Changed: `res.redirect()` to add relative support
+  * Changed: enable "jsonp callback" by default
+  * Changed: renamed "case sensitive routes" to "case sensitive routing"
+  * Rewrite of all tests with mocha
+  * Removed "root" setting
+  * Removed `res.redirect('home')` support
+  * Removed `req.notify()`
+  * Removed `app.register()`
+  * Removed `app.redirect()`
+  * Removed `app.is()`
+  * Removed `app.helpers()`
+  * Removed `app.dynamicHelpers()`
+  * Fixed `res.sendfile()` with non-GET. Closes #723
+  * Fixed express(1) public dir for windows. Closes #866
+
+2.5.9/ 2012-04-02
+==================
+
+  * Added support for PURGE request method [pbuyle]
+  * Fixed `express(1)` generated app `app.address()` before `listening` [mmalecki]
+
+2.5.8 / 2012-02-08
+==================
+
+  * Update mkdirp dep. Closes #991
+
+2.5.7 / 2012-02-06
+==================
+
+  * Fixed `app.all` duplicate DELETE requests [mscdex]
+
+2.5.6 / 2012-01-13
+==================
+
+  * Updated hamljs dev dep. Closes #953
+
+2.5.5 / 2012-01-08
+==================
+
+  * Fixed: set `filename` on cached templates [matthewleon]
+
+2.5.4 / 2012-01-02
+==================
+
+  * Fixed `express(1)` eol on 0.4.x. Closes #947
+
+2.5.3 / 2011-12-30
+==================
+
+  * Fixed `req.is()` when a charset is present
+
+2.5.2 / 2011-12-10
+==================
+
+  * Fixed: express(1) LF -> CRLF for windows
+
+2.5.1 / 2011-11-17
+==================
+
+  * Changed: updated connect to 1.8.x
+  * Removed sass.js support from express(1)
+
+2.5.0 / 2011-10-24
+==================
+
+  * Added ./routes dir for generated app by default
+  * Added npm install reminder to express(1) app gen
+  * Added 0.5.x support
+  * Removed `make test-cov` since it wont work with node 0.5.x
+  * Fixed express(1) public dir for windows. Closes #866
+
+2.4.7 / 2011-10-05
+==================
+
+  * Added mkdirp to express(1). Closes #795
+  * Added simple _json-config_ example
+  * Added  shorthand for the parsed request's pathname via `req.path`
+  * Changed connect dep to 1.7.x to fix npm issue...
+  * Fixed `res.redirect()` __HEAD__ support. [reported by xerox]
+  * Fixed `req.flash()`, only escape args
+  * Fixed absolute path checking on windows. Closes #829 [reported by andrewpmckenzie]
+
+2.4.6 / 2011-08-22
+==================
+
+  * Fixed multiple param callback regression. Closes #824 [reported by TroyGoode]
+
+2.4.5 / 2011-08-19
+==================
+
+  * Added support for routes to handle errors. Closes #809
+  * Added `app.routes.all()`. Closes #803
+  * Added "basepath" setting to work in conjunction with reverse proxies etc.
+  * Refactored `Route` to use a single array of callbacks
+  * Added support for multiple callbacks for `app.param()`. Closes #801
+Closes #805
+  * Changed: removed .call(self) for route callbacks
+  * Dependency: `qs >= 0.3.1`
+  * Fixed `res.redirect()` on windows due to `join()` usage. Closes #808
+
+2.4.4 / 2011-08-05
+==================
+
+  * Fixed `res.header()` intention of a set, even when `undefined`
+  * Fixed `*`, value no longer required
+  * Fixed `res.send(204)` support. Closes #771
+
+2.4.3 / 2011-07-14
+==================
+
+  * Added docs for `status` option special-case. Closes #739
+  * Fixed `options.filename`, exposing the view path to template engines
+
+2.4.2. / 2011-07-06
+==================
+
+  * Revert "removed jsonp stripping" for XSS
+
+2.4.1 / 2011-07-06
+==================
+
+  * Added `res.json()` JSONP support. Closes #737
+  * Added _extending-templates_ example. Closes #730
+  * Added "strict routing" setting for trailing slashes
+  * Added support for multiple envs in `app.configure()` calls. Closes #735
+  * Changed: `res.send()` using `res.json()`
+  * Changed: when cookie `path === null` don't default it
+  * Changed; default cookie path to "home" setting. Closes #731
+  * Removed _pids/logs_ creation from express(1)
+
+2.4.0 / 2011-06-28
+==================
+
+  * Added chainable `res.status(code)`
+  * Added `res.json()`, an explicit version of `res.send(obj)`
+  * Added simple web-service example
+
+2.3.12 / 2011-06-22
+==================
+
+  * \#express is now on freenode! come join!
+  * Added `req.get(field, param)`
+  * Added links to Japanese documentation, thanks @hideyukisaito!
+  * Added; the `express(1)` generated app outputs the env
+  * Added `content-negotiation` example
+  * Dependency: connect >= 1.5.1 < 2.0.0
+  * Fixed view layout bug. Closes #720
+  * Fixed; ignore body on 304. Closes #701
+
+2.3.11 / 2011-06-04
+==================
+
+  * Added `npm test`
+  * Removed generation of dummy test file from `express(1)`
+  * Fixed; `express(1)` adds express as a dep
+  * Fixed; prune on `prepublish`
+
+2.3.10 / 2011-05-27
+==================
+
+  * Added `req.route`, exposing the current route
+  * Added _package.json_ generation support to `express(1)`
+  * Fixed call to `app.param()` function for optional params. Closes #682
+
+2.3.9 / 2011-05-25
+==================
+
+  * Fixed bug-ish with `../' in `res.partial()` calls
+
+2.3.8 / 2011-05-24
+==================
+
+  * Fixed `app.options()`
+
+2.3.7 / 2011-05-23
+==================
+
+  * Added route `Collection`, ex: `app.get('/user/:id').remove();`
+  * Added support for `app.param(fn)` to define param logic
+  * Removed `app.param()` support for callback with return value
+  * Removed module.parent check from express(1) generated app. Closes #670
+  * Refactored router. Closes #639
+
+2.3.6 / 2011-05-20
+==================
+
+  * Changed; using devDependencies instead of git submodules
+  * Fixed redis session example
+  * Fixed markdown example
+  * Fixed view caching, should not be enabled in development
+
+2.3.5 / 2011-05-20
+==================
+
+  * Added export `.view` as alias for `.View`
+
+2.3.4 / 2011-05-08
+==================
+
+  * Added `./examples/say`
+  * Fixed `res.sendfile()` bug preventing the transfer of files with spaces
+
+2.3.3 / 2011-05-03
+==================
+
+  * Added "case sensitive routes" option.
+  * Changed; split methods supported per rfc [slaskis]
+  * Fixed route-specific middleware when using the same callback function several times
+
+2.3.2 / 2011-04-27
+==================
+
+  * Fixed view hints
+
+2.3.1 / 2011-04-26
+==================
+
+  * Added `app.match()` as `app.match.all()`
+  * Added `app.lookup()` as `app.lookup.all()`
+  * Added `app.remove()` for `app.remove.all()`
+  * Added `app.remove.VERB()`
+  * Fixed template caching collision issue. Closes #644
+  * Moved router over from connect and started refactor
+
+2.3.0 / 2011-04-25
+==================
+
+  * Added options support to `res.clearCookie()`
+  * Added `res.helpers()` as alias of `res.locals()`
+  * Added; json defaults to UTF-8 with `res.send()`. Closes #632. [Daniel   * Dependency `connect >= 1.4.0`
+  * Changed; auto set Content-Type in res.attachement [Aaron Heckmann]
+  * Renamed "cache views" to "view cache". Closes #628
+  * Fixed caching of views when using several apps. Closes #637
+  * Fixed gotcha invoking `app.param()` callbacks once per route middleware.
+Closes #638
+  * Fixed partial lookup precedence. Closes #631
+Shaw]
+
+2.2.2 / 2011-04-12
+==================
+
+  * Added second callback support for `res.download()` connection errors
+  * Fixed `filename` option passing to template engine
+
+2.2.1 / 2011-04-04
+==================
+
+  * Added `layout(path)` helper to change the layout within a view. Closes #610
+  * Fixed `partial()` collection object support.
+    Previously only anything with `.length` would work.
+    When `.length` is present one must still be aware of holes,
+    however now `{ collection: {foo: 'bar'}}` is valid, exposes
+    `keyInCollection` and `keysInCollection`.
+
+  * Performance improved with better view caching
+  * Removed `request` and `response` locals
+  * Changed; errorHandler page title is now `Express` instead of `Connect`
+
+2.2.0 / 2011-03-30
+==================
+
+  * Added `app.lookup.VERB()`, ex `app.lookup.put('/user/:id')`. Closes #606
+  * Added `app.match.VERB()`, ex `app.match.put('/user/12')`. Closes #606
+  * Added `app.VERB(path)` as alias of `app.lookup.VERB()`.
+  * Dependency `connect >= 1.2.0`
+
+2.1.1 / 2011-03-29
+==================
+
+  * Added; expose `err.view` object when failing to locate a view
+  * Fixed `res.partial()` call `next(err)` when no callback is given [reported by aheckmann]
+  * Fixed; `res.send(undefined)` responds with 204 [aheckmann]
+
+2.1.0 / 2011-03-24
+==================
+
+  * Added `<root>/_?<name>` partial lookup support. Closes #447
+  * Added `request`, `response`, and `app` local variables
+  * Added `settings` local variable, containing the app's settings
+  * Added `req.flash()` exception if `req.session` is not available
+  * Added `res.send(bool)` support (json response)
+  * Fixed stylus example for latest version
+  * Fixed; wrap try/catch around `res.render()`
+
+2.0.0 / 2011-03-17
+==================
+
+  * Fixed up index view path alternative.
+  * Changed; `res.locals()` without object returns the locals
+
+2.0.0rc3 / 2011-03-17
+==================
+
+  * Added `res.locals(obj)` to compliment `res.local(key, val)`
+  * Added `res.partial()` callback support
+  * Fixed recursive error reporting issue in `res.render()`
+
+2.0.0rc2 / 2011-03-17
+==================
+
+  * Changed; `partial()` "locals" are now optional
+  * Fixed `SlowBuffer` support. Closes #584 [reported by tyrda01]
+  * Fixed .filename view engine option [reported by drudge]
+  * Fixed blog example
+  * Fixed `{req,res}.app` reference when mounting [Ben Weaver]
+
+2.0.0rc / 2011-03-14
+==================
+
+  * Fixed; expose `HTTPSServer` constructor
+  * Fixed express(1) default test charset. Closes #579 [reported by secoif]
+  * Fixed; default charset to utf-8 instead of utf8 for lame IE [reported by NickP]
+
+2.0.0beta3 / 2011-03-09
+==================
+
+  * Added support for `res.contentType()` literal
+    The original `res.contentType('.json')`,
+    `res.contentType('application/json')`, and `res.contentType('json')`
+    will work now.
+  * Added `res.render()` status option support back
+  * Added charset option for `res.render()`
+  * Added `.charset` support (via connect 1.0.4)
+  * Added view resolution hints when in development and a lookup fails
+  * Added layout lookup support relative to the page view.
+    For example while rendering `./views/user/index.jade` if you create
+    `./views/user/layout.jade` it will be used in favour of the root layout.
+  * Fixed `res.redirect()`. RFC states absolute url [reported by unlink]
+  * Fixed; default `res.send()` string charset to utf8
+  * Removed `Partial` constructor (not currently used)
+
+2.0.0beta2 / 2011-03-07
+==================
+
+  * Added res.render() `.locals` support back to aid in migration process
+  * Fixed flash example
+
+2.0.0beta / 2011-03-03
+==================
+
+  * Added HTTPS support
+  * Added `res.cookie()` maxAge support
+  * Added `req.header()` _Referrer_ / _Referer_ special-case, either works
+  * Added mount support for `res.redirect()`, now respects the mount-point
+  * Added `union()` util, taking place of `merge(clone())` combo
+  * Added stylus support to express(1) generated app
+  * Added secret to session middleware used in examples and generated app
+  * Added `res.local(name, val)` for progressive view locals
+  * Added default param support to `req.param(name, default)`
+  * Added `app.disabled()` and `app.enabled()`
+  * Added `app.register()` support for omitting leading ".", either works
+  * Added `res.partial()`, using the same interface as `partial()` within a view. Closes #539
+  * Added `app.param()` to map route params to async/sync logic
+  * Added; aliased `app.helpers()` as `app.locals()`. Closes #481
+  * Added extname with no leading "." support to `res.contentType()`
+  * Added `cache views` setting, defaulting to enabled in "production" env
+  * Added index file partial resolution, eg: partial('user') may try _views/user/index.jade_.
+  * Added `req.accepts()` support for extensions
+  * Changed; `res.download()` and `res.sendfile()` now utilize Connect's
+    static file server `connect.static.send()`.
+  * Changed; replaced `connect.utils.mime()` with npm _mime_ module
+  * Changed; allow `req.query` to be pre-defined (via middleware or other parent
+  * Changed view partial resolution, now relative to parent view
+  * Changed view engine signature. no longer `engine.render(str, options, callback)`, now `engine.compile(str, options) -> Function`, the returned function accepts `fn(locals)`.
+  * Fixed `req.param()` bug returning Array.prototype methods. Closes #552
+  * Fixed; using `Stream#pipe()` instead of `sys.pump()` in `res.sendfile()`
+  * Fixed; using _qs_ module instead of _querystring_
+  * Fixed; strip unsafe chars from jsonp callbacks
+  * Removed "stream threshold" setting
+
+1.0.8 / 2011-03-01
+==================
+
+  * Allow `req.query` to be pre-defined (via middleware or other parent app)
+  * "connect": ">= 0.5.0 < 1.0.0". Closes #547
+  * Removed the long deprecated __EXPRESS_ENV__ support
+
+1.0.7 / 2011-02-07
+==================
+
+  * Fixed `render()` setting inheritance.
+    Mounted apps would not inherit "view engine"
+
+1.0.6 / 2011-02-07
+==================
+
+  * Fixed `view engine` setting bug when period is in dirname
+
+1.0.5 / 2011-02-05
+==================
+
+  * Added secret to generated app `session()` call
+
+1.0.4 / 2011-02-05
+==================
+
+  * Added `qs` dependency to _package.json_
+  * Fixed namespaced `require()`s for latest connect support
+
+1.0.3 / 2011-01-13
+==================
+
+  * Remove unsafe characters from JSONP callback names [Ryan Grove]
+
+1.0.2 / 2011-01-10
+==================
+
+  * Removed nested require, using `connect.router`
+
+1.0.1 / 2010-12-29
+==================
+
+  * Fixed for middleware stacked via `createServer()`
+    previously the `foo` middleware passed to `createServer(foo)`
+    would not have access to Express methods such as `res.send()`
+    or props like `req.query` etc.
+
+1.0.0 / 2010-11-16
+==================
+
+  * Added; deduce partial object names from the last segment.
+    For example by default `partial('forum/post', postObject)` will
+    give you the _post_ object, providing a meaningful default.
+  * Added http status code string representation to `res.redirect()` body
+  * Added; `res.redirect()` supporting _text/plain_ and _text/html_ via __Accept__.
+  * Added `req.is()` to aid in content negotiation
+  * Added partial local inheritance [suggested by masylum]. Closes #102
+    providing access to parent template locals.
+  * Added _-s, --session[s]_ flag to express(1) to add session related middleware
+  * Added _--template_ flag to express(1) to specify the
+    template engine to use.
+  * Added _--css_ flag to express(1) to specify the
+    stylesheet engine to use (or just plain css by default).
+  * Added `app.all()` support [thanks aheckmann]
+  * Added partial direct object support.
+    You may now `partial('user', user)` providing the "user" local,
+    vs previously `partial('user', { object: user })`.
+  * Added _route-separation_ example since many people question ways
+    to do this with CommonJS modules. Also view the _blog_ example for
+    an alternative.
+  * Performance; caching view path derived partial object names
+  * Fixed partial local inheritance precedence. [reported by Nick Poulden] Closes #454
+  * Fixed jsonp support; _text/javascript_ as per mailinglist discussion
+
+1.0.0rc4 / 2010-10-14
+==================
+
+  * Added _NODE_ENV_ support, _EXPRESS_ENV_ is deprecated and will be removed in 1.0.0
+  * Added route-middleware support (very helpful, see the [docs](http://expressjs.com/guide.html#Route-Middleware))
+  * Added _jsonp callback_ setting to enable/disable jsonp autowrapping [Dav Glass]
+  * Added callback query check on response.send to autowrap JSON objects for simple webservice implementations [Dav Glass]
+  * Added `partial()` support for array-like collections. Closes #434
+  * Added support for swappable querystring parsers
+  * Added session usage docs. Closes #443
+  * Added dynamic helper caching. Closes #439 [suggested by maritz]
+  * Added authentication example
+  * Added basic Range support to `res.sendfile()` (and `res.download()` etc)
+  * Changed; `express(1)` generated app using 2 spaces instead of 4
+  * Default env to "development" again [aheckmann]
+  * Removed _context_ option is no more, use "scope"
+  * Fixed; exposing _./support_ libs to examples so they can run without installs
+  * Fixed mvc example
+
+1.0.0rc3 / 2010-09-20
+==================
+
+  * Added confirmation for `express(1)` app generation. Closes #391
+  * Added extending of flash formatters via `app.flashFormatters`
+  * Added flash formatter support. Closes #411
+  * Added streaming support to `res.sendfile()` using `sys.pump()` when >= "stream threshold"
+  * Added _stream threshold_ setting for `res.sendfile()`
+  * Added `res.send()` __HEAD__ support
+  * Added `res.clearCookie()`
+  * Added `res.cookie()`
+  * Added `res.render()` headers option
+  * Added `res.redirect()` response bodies
+  * Added `res.render()` status option support. Closes #425 [thanks aheckmann]
+  * Fixed `res.sendfile()` responding with 403 on malicious path
+  * Fixed `res.download()` bug; when an error occurs remove _Content-Disposition_
+  * Fixed; mounted apps settings now inherit from parent app [aheckmann]
+  * Fixed; stripping Content-Length / Content-Type when 204
+  * Fixed `res.send()` 204. Closes #419
+  * Fixed multiple _Set-Cookie_ headers via `res.header()`. Closes #402
+  * Fixed bug messing with error handlers when `listenFD()` is called instead of `listen()`. [thanks guillermo]
+
+
+1.0.0rc2 / 2010-08-17
+==================
+
+  * Added `app.register()` for template engine mapping. Closes #390
+  * Added `res.render()` callback support as second argument (no options)
+  * Added callback support to `res.download()`
+  * Added callback support for `res.sendfile()`
+  * Added support for middleware access via `express.middlewareName()` vs `connect.middlewareName()`
+  * Added "partials" setting to docs
+  * Added default expresso tests to `express(1)` generated app. Closes #384
+  * Fixed `res.sendfile()` error handling, defer via `next()`
+  * Fixed `res.render()` callback when a layout is used [thanks guillermo]
+  * Fixed; `make install` creating ~/.node_libraries when not present
+  * Fixed issue preventing error handlers from being defined anywhere. Closes #387
+
+1.0.0rc / 2010-07-28
+==================
+
+  * Added mounted hook. Closes #369
+  * Added connect dependency to _package.json_
+
+  * Removed "reload views" setting and support code
+    development env never caches, production always caches.
+
+  * Removed _param_ in route callbacks, signature is now
+    simply (req, res, next), previously (req, res, params, next).
+    Use _req.params_ for path captures, _req.query_ for GET params.
+
+  * Fixed "home" setting
+  * Fixed middleware/router precedence issue. Closes #366
+  * Fixed; _configure()_ callbacks called immediately. Closes #368
+
+1.0.0beta2 / 2010-07-23
+==================
+
+  * Added more examples
+  * Added; exporting `Server` constructor
+  * Added `Server#helpers()` for view locals
+  * Added `Server#dynamicHelpers()` for dynamic view locals. Closes #349
+  * Added support for absolute view paths
+  * Added; _home_ setting defaults to `Server#route` for mounted apps. Closes #363
+  * Added Guillermo Rauch to the contributor list
+  * Added support for "as" for non-collection partials. Closes #341
+  * Fixed _install.sh_, ensuring _~/.node_libraries_ exists. Closes #362 [thanks jf]
+  * Fixed `res.render()` exceptions, now passed to `next()` when no callback is given [thanks guillermo]
+  * Fixed instanceof `Array` checks, now `Array.isArray()`
+  * Fixed express(1) expansion of public dirs. Closes #348
+  * Fixed middleware precedence. Closes #345
+  * Fixed view watcher, now async [thanks aheckmann]
+
+1.0.0beta / 2010-07-15
+==================
+
+  * Re-write
+    - much faster
+    - much lighter
+    - Check [ExpressJS.com](http://expressjs.com) for migration guide and updated docs
+
+0.14.0 / 2010-06-15
+==================
+
+  * Utilize relative requires
+  * Added Static bufferSize option [aheckmann]
+  * Fixed caching of view and partial subdirectories [aheckmann]
+  * Fixed mime.type() comments now that ".ext" is not supported
+  * Updated haml submodule
+  * Updated class submodule
+  * Removed bin/express
+
+0.13.0 / 2010-06-01
+==================
+
+  * Added node v0.1.97 compatibility
+  * Added support for deleting cookies via Request#cookie('key', null)
+  * Updated haml submodule
+  * Fixed not-found page, now using using charset utf-8
+  * Fixed show-exceptions page, now using using charset utf-8
+  * Fixed view support due to fs.readFile Buffers
+  * Changed; mime.type() no longer accepts ".type" due to node extname() changes
+
+0.12.0 / 2010-05-22
+==================
+
+  * Added node v0.1.96 compatibility
+  * Added view `helpers` export which act as additional local variables
+  * Updated haml submodule
+  * Changed ETag; removed inode, modified time only
+  * Fixed LF to CRLF for setting multiple cookies
+  * Fixed cookie complation; values are now urlencoded
+  * Fixed cookies parsing; accepts quoted values and url escaped cookies
+
+0.11.0 / 2010-05-06
+==================
+
+  * Added support for layouts using different engines
+    - this.render('page.html.haml', { layout: 'super-cool-layout.html.ejs' })
+    - this.render('page.html.haml', { layout: 'foo' }) // assumes 'foo.html.haml'
+    - this.render('page.html.haml', { layout: false }) // no layout
+  * Updated ext submodule
+  * Updated haml submodule
+  * Fixed EJS partial support by passing along the context. Issue #307
+
+0.10.1 / 2010-05-03
+==================
+
+  * Fixed binary uploads.
+
+0.10.0 / 2010-04-30
+==================
+
+  * Added charset support via Request#charset (automatically assigned to 'UTF-8' when respond()'s
+    encoding is set to 'utf8' or 'utf-8'.
+  * Added "encoding" option to Request#render(). Closes #299
+  * Added "dump exceptions" setting, which is enabled by default.
+  * Added simple ejs template engine support
+  * Added error response support for text/plain, application/json. Closes #297
+  * Added callback function param to Request#error()
+  * Added Request#sendHead()
+  * Added Request#stream()
+  * Added support for Request#respond(304, null) for empty response bodies
+  * Added ETag support to Request#sendfile()
+  * Added options to Request#sendfile(), passed to fs.createReadStream()
+  * Added filename arg to Request#download()
+  * Performance enhanced due to pre-reversing plugins so that plugins.reverse() is not called on each request
+  * Performance enhanced by preventing several calls to toLowerCase() in Router#match()
+  * Changed; Request#sendfile() now streams
+  * Changed; Renamed Request#halt() to Request#respond(). Closes #289
+  * Changed; Using sys.inspect() instead of JSON.encode() for error output
+  * Changed; run() returns the http.Server instance. Closes #298
+  * Changed; Defaulting Server#host to null (INADDR_ANY)
+  * Changed; Logger "common" format scale of 0.4f
+  * Removed Logger "request" format
+  * Fixed; Catching ENOENT in view caching, preventing error when "views/partials" is not found
+  * Fixed several issues with http client
+  * Fixed Logger Content-Length output
+  * Fixed bug preventing Opera from retaining the generated session id. Closes #292
+
+0.9.0 / 2010-04-14
+==================
+
+  * Added DSL level error() route support
+  * Added DSL level notFound() route support
+  * Added Request#error()
+  * Added Request#notFound()
+  * Added Request#render() callback function. Closes #258
+  * Added "max upload size" setting
+  * Added "magic" variables to collection partials (\_\_index\_\_, \_\_length\_\_, \_\_isFirst\_\_, \_\_isLast\_\_). Closes #254
+  * Added [haml.js](http://github.com/visionmedia/haml.js) submodule; removed haml-js
+  * Added callback function support to Request#halt() as 3rd/4th arg
+  * Added preprocessing of route param wildcards using param(). Closes #251
+  * Added view partial support (with collections etc)
+  * Fixed bug preventing falsey params (such as ?page=0). Closes #286
+  * Fixed setting of multiple cookies. Closes #199
+  * Changed; view naming convention is now NAME.TYPE.ENGINE (for example page.html.haml)
+  * Changed; session cookie is now httpOnly
+  * Changed; Request is no longer global
+  * Changed; Event is no longer global
+  * Changed; "sys" module is no longer global
+  * Changed; moved Request#download to Static plugin where it belongs
+  * Changed; Request instance created before body parsing. Closes #262
+  * Changed; Pre-caching views in memory when "cache view contents" is enabled. Closes #253
+  * Changed; Pre-caching view partials in memory when "cache view partials" is enabled
+  * Updated support to node --version 0.1.90
+  * Updated dependencies
+  * Removed set("session cookie") in favour of use(Session, { cookie: { ... }})
+  * Removed utils.mixin(); use Object#mergeDeep()
+
+0.8.0 / 2010-03-19
+==================
+
+  * Added coffeescript example app. Closes #242
+  * Changed; cache api now async friendly. Closes #240
+  * Removed deprecated 'express/static' support. Use 'express/plugins/static'
+
+0.7.6 / 2010-03-19
+==================
+
+  * Added Request#isXHR. Closes #229
+  * Added `make install` (for the executable)
+  * Added `express` executable for setting up simple app templates
+  * Added "GET /public/*" to Static plugin, defaulting to <root>/public
+  * Added Static plugin
+  * Fixed; Request#render() only calls cache.get() once
+  * Fixed; Namespacing View caches with "view:"
+  * Fixed; Namespacing Static caches with "static:"
+  * Fixed; Both example apps now use the Static plugin
+  * Fixed set("views"). Closes #239
+  * Fixed missing space for combined log format
+  * Deprecated Request#sendfile() and 'express/static'
+  * Removed Server#running
+
+0.7.5 / 2010-03-16
+==================
+
+  * Added Request#flash() support without args, now returns all flashes
+  * Updated ext submodule
+
+0.7.4 / 2010-03-16
+==================
+
+  * Fixed session reaper
+  * Changed; class.js replacing js-oo Class implementation (quite a bit faster, no browser cruft)
+
+0.7.3 / 2010-03-16
+==================
+
+  * Added package.json
+  * Fixed requiring of haml / sass due to kiwi removal
+
+0.7.2 / 2010-03-16
+==================
+
+  * Fixed GIT submodules (HAH!)
+
+0.7.1 / 2010-03-16
+==================
+
+  * Changed; Express now using submodules again until a PM is adopted
+  * Changed; chat example using millisecond conversions from ext
+
+0.7.0 / 2010-03-15
+==================
+
+  * Added Request#pass() support (finds the next matching route, or the given path)
+  * Added Logger plugin (default "common" format replaces CommonLogger)
+  * Removed Profiler plugin
+  * Removed CommonLogger plugin
+
+0.6.0 / 2010-03-11
+==================
+
+  * Added seed.yml for kiwi package management support
+  * Added HTTP client query string support when method is GET. Closes #205
+
+  * Added support for arbitrary view engines.
+    For example "foo.engine.html" will now require('engine'),
+    the exports from this module are cached after the first require().
+
+  * Added async plugin support
+
+  * Removed usage of RESTful route funcs as http client
+    get() etc, use http.get() and friends
+
+  * Removed custom exceptions
+
+0.5.0 / 2010-03-10
+==================
+
+  * Added ext dependency (library of js extensions)
+  * Removed extname() / basename() utils. Use path module
+  * Removed toArray() util. Use arguments.values
+  * Removed escapeRegexp() util. Use RegExp.escape()
+  * Removed process.mixin() dependency. Use utils.mixin()
+  * Removed Collection
+  * Removed ElementCollection
+  * Shameless self promotion of ebook "Advanced JavaScript" (http://dev-mag.com)  ;)
+
+0.4.0 / 2010-02-11
+==================
+
+  * Added flash() example to sample upload app
+  * Added high level restful http client module (express/http)
+  * Changed; RESTful route functions double as HTTP clients. Closes #69
+  * Changed; throwing error when routes are added at runtime
+  * Changed; defaulting render() context to the current Request. Closes #197
+  * Updated haml submodule
+
+0.3.0 / 2010-02-11
+==================
+
+  * Updated haml / sass submodules. Closes #200
+  * Added flash message support. Closes #64
+  * Added accepts() now allows multiple args. fixes #117
+  * Added support for plugins to halt. Closes #189
+  * Added alternate layout support. Closes #119
+  * Removed Route#run(). Closes #188
+  * Fixed broken specs due to use(Cookie) missing
+
+0.2.1 / 2010-02-05
+==================
+
+  * Added "plot" format option for Profiler (for gnuplot processing)
+  * Added request number to Profiler plugin
+  * Fixed binary encoding for multi-part file uploads, was previously defaulting to UTF8
+  * Fixed issue with routes not firing when not files are present. Closes #184
+  * Fixed process.Promise -> events.Promise
+
+0.2.0 / 2010-02-03
+==================
+
+  * Added parseParam() support for name[] etc. (allows for file inputs with "multiple" attr) Closes #180
+  * Added Both Cache and Session option "reapInterval" may be "reapEvery". Closes #174
+  * Added expiration support to cache api with reaper. Closes #133
+  * Added cache Store.Memory#reap()
+  * Added Cache; cache api now uses first class Cache instances
+  * Added abstract session Store. Closes #172
+  * Changed; cache Memory.Store#get() utilizing Collection
+  * Renamed MemoryStore -> Store.Memory
+  * Fixed use() of the same plugin several time will always use latest options. Closes #176
+
+0.1.0 / 2010-02-03
+==================
+
+  * Changed; Hooks (before / after) pass request as arg as well as evaluated in their context
+  * Updated node support to 0.1.27 Closes #169
+  * Updated dirname(__filename) -> __dirname
+  * Updated libxmljs support to v0.2.0
+  * Added session support with memory store / reaping
+  * Added quick uid() helper
+  * Added multi-part upload support
+  * Added Sass.js support / submodule
+  * Added production env caching view contents and static files
+  * Added static file caching. Closes #136
+  * Added cache plugin with memory stores
+  * Added support to StaticFile so that it works with non-textual files.
+  * Removed dirname() helper
+  * Removed several globals (now their modules must be required)
+
+0.0.2 / 2010-01-10
+==================
+
+  * Added view benchmarks; currently haml vs ejs
+  * Added Request#attachment() specs. Closes #116
+  * Added use of node's parseQuery() util. Closes #123
+  * Added `make init` for submodules
+  * Updated Haml
+  * Updated sample chat app to show messages on load
+  * Updated libxmljs parseString -> parseHtmlString
+  * Fixed `make init` to work with older versions of git
+  * Fixed specs can now run independent specs for those who cant build deps. Closes #127
+  * Fixed issues introduced by the node url module changes. Closes 126.
+  * Fixed two assertions failing due to Collection#keys() returning strings
+  * Fixed faulty Collection#toArray() spec due to keys() returning strings
+  * Fixed `make test` now builds libxmljs.node before testing
+
+0.0.1 / 2010-01-03
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/express/LICENSE b/wrt/node_modules/express/LICENSE
new file mode 100644 (file)
index 0000000..aa927e4
--- /dev/null
@@ -0,0 +1,24 @@
+(The MIT License)
+
+Copyright (c) 2009-2014 TJ Holowaychuk <tj@vision-media.ca>
+Copyright (c) 2013-2014 Roman Shtylman <shtylman+expressjs@gmail.com>
+Copyright (c) 2014-2015 Douglas Christopher Wilson <doug@somethingdoug.com>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/express/Readme.md b/wrt/node_modules/express/Readme.md
new file mode 100644 (file)
index 0000000..1732661
--- /dev/null
@@ -0,0 +1,141 @@
+[![Express Logo](https://i.cloudup.com/zfY6lL7eFa-3000x3000.png)](http://expressjs.com/)
+
+  Fast, unopinionated, minimalist web framework for [node](http://nodejs.org).
+
+  [![NPM Version][npm-image]][npm-url]
+  [![NPM Downloads][downloads-image]][downloads-url]
+  [![Linux Build][travis-image]][travis-url]
+  [![Windows Build][appveyor-image]][appveyor-url]
+  [![Test Coverage][coveralls-image]][coveralls-url]
+
+```js
+var express = require('express')
+var app = express()
+
+app.get('/', function (req, res) {
+  res.send('Hello World')
+})
+
+app.listen(3000)
+```
+
+## Installation
+
+```bash
+$ npm install express
+```
+
+## Features
+
+  * Robust routing
+  * Focus on high performance
+  * Super-high test coverage
+  * HTTP helpers (redirection, caching, etc)
+  * View system supporting 14+ template engines
+  * Content negotiation
+  * Executable for generating applications quickly
+
+## Docs & Community
+
+  * [Website and Documentation](http://expressjs.com/) - [[website repo](https://github.com/expressjs/expressjs.com)]
+  * [#express](https://webchat.freenode.net/?channels=express) on freenode IRC
+  * [GitHub Organization](https://github.com/expressjs) for Official Middleware & Modules
+  * Visit the [Wiki](https://github.com/expressjs/express/wiki)
+  * [Google Group](https://groups.google.com/group/express-js) for discussion
+  * [Gitter](https://gitter.im/expressjs/express) for support and discussion
+
+**PROTIP** Be sure to read [Migrating from 3.x to 4.x](https://github.com/expressjs/express/wiki/Migrating-from-3.x-to-4.x) as well as [New features in 4.x](https://github.com/expressjs/express/wiki/New-features-in-4.x).
+
+### Security Issues
+
+If you discover a security vulnerability in Express, please see [Security Policies and Procedures](Security.md).
+
+## Quick Start
+
+  The quickest way to get started with express is to utilize the executable [`express(1)`](https://github.com/expressjs/generator) to generate an application as shown below:
+
+  Install the executable. The executable's major version will match Express's:
+
+```bash
+$ npm install -g express-generator@4
+```
+
+  Create the app:
+
+```bash
+$ express /tmp/foo && cd /tmp/foo
+```
+
+  Install dependencies:
+
+```bash
+$ npm install
+```
+
+  Start the server:
+
+```bash
+$ npm start
+```
+
+## Philosophy
+
+  The Express philosophy is to provide small, robust tooling for HTTP servers, making
+  it a great solution for single page applications, web sites, hybrids, or public
+  HTTP APIs.
+
+  Express does not force you to use any specific ORM or template engine. With support for over
+  14 template engines via [Consolidate.js](https://github.com/tj/consolidate.js),
+  you can quickly craft your perfect framework.
+
+## Examples
+
+  To view the examples, clone the Express repo and install the dependencies:
+
+```bash
+$ git clone git://github.com/expressjs/express.git --depth 1
+$ cd express
+$ npm install
+```
+
+  Then run whichever example you want:
+
+```bash
+$ node examples/content-negotiation
+```
+
+## Tests
+
+  To run the test suite, first install the dependencies, then run `npm test`:
+
+```bash
+$ npm install
+$ npm test
+```
+
+## People
+
+The original author of Express is [TJ Holowaychuk](https://github.com/tj) [![TJ's Gratipay][gratipay-image-visionmedia]][gratipay-url-visionmedia]
+
+The current lead maintainer is [Douglas Christopher Wilson](https://github.com/dougwilson) [![Doug's Gratipay][gratipay-image-dougwilson]][gratipay-url-dougwilson]
+
+[List of all contributors](https://github.com/expressjs/express/graphs/contributors)
+
+## License
+
+  [MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/express.svg
+[npm-url]: https://npmjs.org/package/express
+[downloads-image]: https://img.shields.io/npm/dm/express.svg
+[downloads-url]: https://npmjs.org/package/express
+[travis-image]: https://img.shields.io/travis/expressjs/express/master.svg?label=linux
+[travis-url]: https://travis-ci.org/expressjs/express
+[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/express/master.svg?label=windows
+[appveyor-url]: https://ci.appveyor.com/project/dougwilson/express
+[coveralls-image]: https://img.shields.io/coveralls/expressjs/express/master.svg
+[coveralls-url]: https://coveralls.io/r/expressjs/express?branch=master
+[gratipay-image-visionmedia]: https://img.shields.io/gratipay/visionmedia.svg
+[gratipay-url-visionmedia]: https://gratipay.com/visionmedia/
+[gratipay-image-dougwilson]: https://img.shields.io/gratipay/dougwilson.svg
+[gratipay-url-dougwilson]: https://gratipay.com/dougwilson/
diff --git a/wrt/node_modules/express/index.js b/wrt/node_modules/express/index.js
new file mode 100644 (file)
index 0000000..d219b0c
--- /dev/null
@@ -0,0 +1,11 @@
+/*!
+ * express
+ * Copyright(c) 2009-2013 TJ Holowaychuk
+ * Copyright(c) 2013 Roman Shtylman
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict';
+
+module.exports = require('./lib/express');
diff --git a/wrt/node_modules/express/lib/application.js b/wrt/node_modules/express/lib/application.js
new file mode 100644 (file)
index 0000000..1abe8d0
--- /dev/null
@@ -0,0 +1,644 @@
+/*!
+ * express
+ * Copyright(c) 2009-2013 TJ Holowaychuk
+ * Copyright(c) 2013 Roman Shtylman
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict';
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var finalhandler = require('finalhandler');
+var Router = require('./router');
+var methods = require('methods');
+var middleware = require('./middleware/init');
+var query = require('./middleware/query');
+var debug = require('debug')('express:application');
+var View = require('./view');
+var http = require('http');
+var compileETag = require('./utils').compileETag;
+var compileQueryParser = require('./utils').compileQueryParser;
+var compileTrust = require('./utils').compileTrust;
+var deprecate = require('depd')('express');
+var flatten = require('array-flatten');
+var merge = require('utils-merge');
+var resolve = require('path').resolve;
+var setPrototypeOf = require('setprototypeof')
+var slice = Array.prototype.slice;
+
+/**
+ * Application prototype.
+ */
+
+var app = exports = module.exports = {};
+
+/**
+ * Variable for trust proxy inheritance back-compat
+ * @private
+ */
+
+var trustProxyDefaultSymbol = '@@symbol:trust_proxy_default';
+
+/**
+ * Initialize the server.
+ *
+ *   - setup default configuration
+ *   - setup default middleware
+ *   - setup route reflection methods
+ *
+ * @private
+ */
+
+app.init = function init() {
+  this.cache = {};
+  this.engines = {};
+  this.settings = {};
+
+  this.defaultConfiguration();
+};
+
+/**
+ * Initialize application configuration.
+ * @private
+ */
+
+app.defaultConfiguration = function defaultConfiguration() {
+  var env = process.env.NODE_ENV || 'development';
+
+  // default settings
+  this.enable('x-powered-by');
+  this.set('etag', 'weak');
+  this.set('env', env);
+  this.set('query parser', 'extended');
+  this.set('subdomain offset', 2);
+  this.set('trust proxy', false);
+
+  // trust proxy inherit back-compat
+  Object.defineProperty(this.settings, trustProxyDefaultSymbol, {
+    configurable: true,
+    value: true
+  });
+
+  debug('booting in %s mode', env);
+
+  this.on('mount', function onmount(parent) {
+    // inherit trust proxy
+    if (this.settings[trustProxyDefaultSymbol] === true
+      && typeof parent.settings['trust proxy fn'] === 'function') {
+      delete this.settings['trust proxy'];
+      delete this.settings['trust proxy fn'];
+    }
+
+    // inherit protos
+    setPrototypeOf(this.request, parent.request)
+    setPrototypeOf(this.response, parent.response)
+    setPrototypeOf(this.engines, parent.engines)
+    setPrototypeOf(this.settings, parent.settings)
+  });
+
+  // setup locals
+  this.locals = Object.create(null);
+
+  // top-most app is mounted at /
+  this.mountpath = '/';
+
+  // default locals
+  this.locals.settings = this.settings;
+
+  // default configuration
+  this.set('view', View);
+  this.set('views', resolve('views'));
+  this.set('jsonp callback name', 'callback');
+
+  if (env === 'production') {
+    this.enable('view cache');
+  }
+
+  Object.defineProperty(this, 'router', {
+    get: function() {
+      throw new Error('\'app.router\' is deprecated!\nPlease see the 3.x to 4.x migration guide for details on how to update your app.');
+    }
+  });
+};
+
+/**
+ * lazily adds the base router if it has not yet been added.
+ *
+ * We cannot add the base router in the defaultConfiguration because
+ * it reads app settings which might be set after that has run.
+ *
+ * @private
+ */
+app.lazyrouter = function lazyrouter() {
+  if (!this._router) {
+    this._router = new Router({
+      caseSensitive: this.enabled('case sensitive routing'),
+      strict: this.enabled('strict routing')
+    });
+
+    this._router.use(query(this.get('query parser fn')));
+    this._router.use(middleware.init(this));
+  }
+};
+
+/**
+ * Dispatch a req, res pair into the application. Starts pipeline processing.
+ *
+ * If no callback is provided, then default error handlers will respond
+ * in the event of an error bubbling through the stack.
+ *
+ * @private
+ */
+
+app.handle = function handle(req, res, callback) {
+  var router = this._router;
+
+  // final handler
+  var done = callback || finalhandler(req, res, {
+    env: this.get('env'),
+    onerror: logerror.bind(this)
+  });
+
+  // no routes
+  if (!router) {
+    debug('no routes defined on app');
+    done();
+    return;
+  }
+
+  router.handle(req, res, done);
+};
+
+/**
+ * Proxy `Router#use()` to add middleware to the app router.
+ * See Router#use() documentation for details.
+ *
+ * If the _fn_ parameter is an express app, then it will be
+ * mounted at the _route_ specified.
+ *
+ * @public
+ */
+
+app.use = function use(fn) {
+  var offset = 0;
+  var path = '/';
+
+  // default path to '/'
+  // disambiguate app.use([fn])
+  if (typeof fn !== 'function') {
+    var arg = fn;
+
+    while (Array.isArray(arg) && arg.length !== 0) {
+      arg = arg[0];
+    }
+
+    // first arg is the path
+    if (typeof arg !== 'function') {
+      offset = 1;
+      path = fn;
+    }
+  }
+
+  var fns = flatten(slice.call(arguments, offset));
+
+  if (fns.length === 0) {
+    throw new TypeError('app.use() requires middleware functions');
+  }
+
+  // setup router
+  this.lazyrouter();
+  var router = this._router;
+
+  fns.forEach(function (fn) {
+    // non-express app
+    if (!fn || !fn.handle || !fn.set) {
+      return router.use(path, fn);
+    }
+
+    debug('.use app under %s', path);
+    fn.mountpath = path;
+    fn.parent = this;
+
+    // restore .app property on req and res
+    router.use(path, function mounted_app(req, res, next) {
+      var orig = req.app;
+      fn.handle(req, res, function (err) {
+        setPrototypeOf(req, orig.request)
+        setPrototypeOf(res, orig.response)
+        next(err);
+      });
+    });
+
+    // mounted an app
+    fn.emit('mount', this);
+  }, this);
+
+  return this;
+};
+
+/**
+ * Proxy to the app `Router#route()`
+ * Returns a new `Route` instance for the _path_.
+ *
+ * Routes are isolated middleware stacks for specific paths.
+ * See the Route api docs for details.
+ *
+ * @public
+ */
+
+app.route = function route(path) {
+  this.lazyrouter();
+  return this._router.route(path);
+};
+
+/**
+ * Register the given template engine callback `fn`
+ * as `ext`.
+ *
+ * By default will `require()` the engine based on the
+ * file extension. For example if you try to render
+ * a "foo.ejs" file Express will invoke the following internally:
+ *
+ *     app.engine('ejs', require('ejs').__express);
+ *
+ * For engines that do not provide `.__express` out of the box,
+ * or if you wish to "map" a different extension to the template engine
+ * you may use this method. For example mapping the EJS template engine to
+ * ".html" files:
+ *
+ *     app.engine('html', require('ejs').renderFile);
+ *
+ * In this case EJS provides a `.renderFile()` method with
+ * the same signature that Express expects: `(path, options, callback)`,
+ * though note that it aliases this method as `ejs.__express` internally
+ * so if you're using ".ejs" extensions you dont need to do anything.
+ *
+ * Some template engines do not follow this convention, the
+ * [Consolidate.js](https://github.com/tj/consolidate.js)
+ * library was created to map all of node's popular template
+ * engines to follow this convention, thus allowing them to
+ * work seamlessly within Express.
+ *
+ * @param {String} ext
+ * @param {Function} fn
+ * @return {app} for chaining
+ * @public
+ */
+
+app.engine = function engine(ext, fn) {
+  if (typeof fn !== 'function') {
+    throw new Error('callback function required');
+  }
+
+  // get file extension
+  var extension = ext[0] !== '.'
+    ? '.' + ext
+    : ext;
+
+  // store engine
+  this.engines[extension] = fn;
+
+  return this;
+};
+
+/**
+ * Proxy to `Router#param()` with one added api feature. The _name_ parameter
+ * can be an array of names.
+ *
+ * See the Router#param() docs for more details.
+ *
+ * @param {String|Array} name
+ * @param {Function} fn
+ * @return {app} for chaining
+ * @public
+ */
+
+app.param = function param(name, fn) {
+  this.lazyrouter();
+
+  if (Array.isArray(name)) {
+    for (var i = 0; i < name.length; i++) {
+      this.param(name[i], fn);
+    }
+
+    return this;
+  }
+
+  this._router.param(name, fn);
+
+  return this;
+};
+
+/**
+ * Assign `setting` to `val`, or return `setting`'s value.
+ *
+ *    app.set('foo', 'bar');
+ *    app.get('foo');
+ *    // => "bar"
+ *
+ * Mounted servers inherit their parent server's settings.
+ *
+ * @param {String} setting
+ * @param {*} [val]
+ * @return {Server} for chaining
+ * @public
+ */
+
+app.set = function set(setting, val) {
+  if (arguments.length === 1) {
+    // app.get(setting)
+    return this.settings[setting];
+  }
+
+  debug('set "%s" to %o', setting, val);
+
+  // set value
+  this.settings[setting] = val;
+
+  // trigger matched settings
+  switch (setting) {
+    case 'etag':
+      this.set('etag fn', compileETag(val));
+      break;
+    case 'query parser':
+      this.set('query parser fn', compileQueryParser(val));
+      break;
+    case 'trust proxy':
+      this.set('trust proxy fn', compileTrust(val));
+
+      // trust proxy inherit back-compat
+      Object.defineProperty(this.settings, trustProxyDefaultSymbol, {
+        configurable: true,
+        value: false
+      });
+
+      break;
+  }
+
+  return this;
+};
+
+/**
+ * Return the app's absolute pathname
+ * based on the parent(s) that have
+ * mounted it.
+ *
+ * For example if the application was
+ * mounted as "/admin", which itself
+ * was mounted as "/blog" then the
+ * return value would be "/blog/admin".
+ *
+ * @return {String}
+ * @private
+ */
+
+app.path = function path() {
+  return this.parent
+    ? this.parent.path() + this.mountpath
+    : '';
+};
+
+/**
+ * Check if `setting` is enabled (truthy).
+ *
+ *    app.enabled('foo')
+ *    // => false
+ *
+ *    app.enable('foo')
+ *    app.enabled('foo')
+ *    // => true
+ *
+ * @param {String} setting
+ * @return {Boolean}
+ * @public
+ */
+
+app.enabled = function enabled(setting) {
+  return Boolean(this.set(setting));
+};
+
+/**
+ * Check if `setting` is disabled.
+ *
+ *    app.disabled('foo')
+ *    // => true
+ *
+ *    app.enable('foo')
+ *    app.disabled('foo')
+ *    // => false
+ *
+ * @param {String} setting
+ * @return {Boolean}
+ * @public
+ */
+
+app.disabled = function disabled(setting) {
+  return !this.set(setting);
+};
+
+/**
+ * Enable `setting`.
+ *
+ * @param {String} setting
+ * @return {app} for chaining
+ * @public
+ */
+
+app.enable = function enable(setting) {
+  return this.set(setting, true);
+};
+
+/**
+ * Disable `setting`.
+ *
+ * @param {String} setting
+ * @return {app} for chaining
+ * @public
+ */
+
+app.disable = function disable(setting) {
+  return this.set(setting, false);
+};
+
+/**
+ * Delegate `.VERB(...)` calls to `router.VERB(...)`.
+ */
+
+methods.forEach(function(method){
+  app[method] = function(path){
+    if (method === 'get' && arguments.length === 1) {
+      // app.get(setting)
+      return this.set(path);
+    }
+
+    this.lazyrouter();
+
+    var route = this._router.route(path);
+    route[method].apply(route, slice.call(arguments, 1));
+    return this;
+  };
+});
+
+/**
+ * Special-cased "all" method, applying the given route `path`,
+ * middleware, and callback to _every_ HTTP method.
+ *
+ * @param {String} path
+ * @param {Function} ...
+ * @return {app} for chaining
+ * @public
+ */
+
+app.all = function all(path) {
+  this.lazyrouter();
+
+  var route = this._router.route(path);
+  var args = slice.call(arguments, 1);
+
+  for (var i = 0; i < methods.length; i++) {
+    route[methods[i]].apply(route, args);
+  }
+
+  return this;
+};
+
+// del -> delete alias
+
+app.del = deprecate.function(app.delete, 'app.del: Use app.delete instead');
+
+/**
+ * Render the given view `name` name with `options`
+ * and a callback accepting an error and the
+ * rendered template string.
+ *
+ * Example:
+ *
+ *    app.render('email', { name: 'Tobi' }, function(err, html){
+ *      // ...
+ *    })
+ *
+ * @param {String} name
+ * @param {Object|Function} options or fn
+ * @param {Function} callback
+ * @public
+ */
+
+app.render = function render(name, options, callback) {
+  var cache = this.cache;
+  var done = callback;
+  var engines = this.engines;
+  var opts = options;
+  var renderOptions = {};
+  var view;
+
+  // support callback function as second arg
+  if (typeof options === 'function') {
+    done = options;
+    opts = {};
+  }
+
+  // merge app.locals
+  merge(renderOptions, this.locals);
+
+  // merge options._locals
+  if (opts._locals) {
+    merge(renderOptions, opts._locals);
+  }
+
+  // merge options
+  merge(renderOptions, opts);
+
+  // set .cache unless explicitly provided
+  if (renderOptions.cache == null) {
+    renderOptions.cache = this.enabled('view cache');
+  }
+
+  // primed cache
+  if (renderOptions.cache) {
+    view = cache[name];
+  }
+
+  // view
+  if (!view) {
+    var View = this.get('view');
+
+    view = new View(name, {
+      defaultEngine: this.get('view engine'),
+      root: this.get('views'),
+      engines: engines
+    });
+
+    if (!view.path) {
+      var dirs = Array.isArray(view.root) && view.root.length > 1
+        ? 'directories "' + view.root.slice(0, -1).join('", "') + '" or "' + view.root[view.root.length - 1] + '"'
+        : 'directory "' + view.root + '"'
+      var err = new Error('Failed to lookup view "' + name + '" in views ' + dirs);
+      err.view = view;
+      return done(err);
+    }
+
+    // prime the cache
+    if (renderOptions.cache) {
+      cache[name] = view;
+    }
+  }
+
+  // render
+  tryRender(view, renderOptions, done);
+};
+
+/**
+ * Listen for connections.
+ *
+ * A node `http.Server` is returned, with this
+ * application (which is a `Function`) as its
+ * callback. If you wish to create both an HTTP
+ * and HTTPS server you may do so with the "http"
+ * and "https" modules as shown here:
+ *
+ *    var http = require('http')
+ *      , https = require('https')
+ *      , express = require('express')
+ *      , app = express();
+ *
+ *    http.createServer(app).listen(80);
+ *    https.createServer({ ... }, app).listen(443);
+ *
+ * @return {http.Server}
+ * @public
+ */
+
+app.listen = function listen() {
+  var server = http.createServer(this);
+  return server.listen.apply(server, arguments);
+};
+
+/**
+ * Log error using console.error.
+ *
+ * @param {Error} err
+ * @private
+ */
+
+function logerror(err) {
+  /* istanbul ignore next */
+  if (this.get('env') !== 'test') console.error(err.stack || err.toString());
+}
+
+/**
+ * Try rendering a view.
+ * @private
+ */
+
+function tryRender(view, options, callback) {
+  try {
+    view.render(options, callback);
+  } catch (err) {
+    callback(err);
+  }
+}
diff --git a/wrt/node_modules/express/lib/express.js b/wrt/node_modules/express/lib/express.js
new file mode 100644 (file)
index 0000000..187e4e2
--- /dev/null
@@ -0,0 +1,111 @@
+/*!
+ * express
+ * Copyright(c) 2009-2013 TJ Holowaychuk
+ * Copyright(c) 2013 Roman Shtylman
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict';
+
+/**
+ * Module dependencies.
+ */
+
+var EventEmitter = require('events').EventEmitter;
+var mixin = require('merge-descriptors');
+var proto = require('./application');
+var Route = require('./router/route');
+var Router = require('./router');
+var req = require('./request');
+var res = require('./response');
+
+/**
+ * Expose `createApplication()`.
+ */
+
+exports = module.exports = createApplication;
+
+/**
+ * Create an express application.
+ *
+ * @return {Function}
+ * @api public
+ */
+
+function createApplication() {
+  var app = function(req, res, next) {
+    app.handle(req, res, next);
+  };
+
+  mixin(app, EventEmitter.prototype, false);
+  mixin(app, proto, false);
+
+  // expose the prototype that will get set on requests
+  app.request = Object.create(req, {
+    app: { configurable: true, enumerable: true, writable: true, value: app }
+  })
+
+  // expose the prototype that will get set on responses
+  app.response = Object.create(res, {
+    app: { configurable: true, enumerable: true, writable: true, value: app }
+  })
+
+  app.init();
+  return app;
+}
+
+/**
+ * Expose the prototypes.
+ */
+
+exports.application = proto;
+exports.request = req;
+exports.response = res;
+
+/**
+ * Expose constructors.
+ */
+
+exports.Route = Route;
+exports.Router = Router;
+
+/**
+ * Expose middleware
+ */
+
+exports.query = require('./middleware/query');
+exports.static = require('serve-static');
+
+/**
+ * Replace removed middleware with an appropriate error message.
+ */
+
+[
+  'json',
+  'urlencoded',
+  'bodyParser',
+  'compress',
+  'cookieSession',
+  'session',
+  'logger',
+  'cookieParser',
+  'favicon',
+  'responseTime',
+  'errorHandler',
+  'timeout',
+  'methodOverride',
+  'vhost',
+  'csrf',
+  'directory',
+  'limit',
+  'multipart',
+  'staticCache',
+].forEach(function (name) {
+  Object.defineProperty(exports, name, {
+    get: function () {
+      throw new Error('Most middleware (like ' + name + ') is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.');
+    },
+    configurable: true
+  });
+});
diff --git a/wrt/node_modules/express/lib/middleware/init.js b/wrt/node_modules/express/lib/middleware/init.js
new file mode 100644 (file)
index 0000000..dfd0427
--- /dev/null
@@ -0,0 +1,43 @@
+/*!
+ * express
+ * Copyright(c) 2009-2013 TJ Holowaychuk
+ * Copyright(c) 2013 Roman Shtylman
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict';
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var setPrototypeOf = require('setprototypeof')
+
+/**
+ * Initialization middleware, exposing the
+ * request and response to each other, as well
+ * as defaulting the X-Powered-By header field.
+ *
+ * @param {Function} app
+ * @return {Function}
+ * @api private
+ */
+
+exports.init = function(app){
+  return function expressInit(req, res, next){
+    if (app.enabled('x-powered-by')) res.setHeader('X-Powered-By', 'Express');
+    req.res = res;
+    res.req = req;
+    req.next = next;
+
+    setPrototypeOf(req, app.request)
+    setPrototypeOf(res, app.response)
+
+    res.locals = res.locals || Object.create(null);
+
+    next();
+  };
+};
+
diff --git a/wrt/node_modules/express/lib/middleware/query.js b/wrt/node_modules/express/lib/middleware/query.js
new file mode 100644 (file)
index 0000000..7e91669
--- /dev/null
@@ -0,0 +1,47 @@
+/*!
+ * express
+ * Copyright(c) 2009-2013 TJ Holowaychuk
+ * Copyright(c) 2013 Roman Shtylman
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict';
+
+/**
+ * Module dependencies.
+ */
+
+var merge = require('utils-merge')
+var parseUrl = require('parseurl');
+var qs = require('qs');
+
+/**
+ * @param {Object} options
+ * @return {Function}
+ * @api public
+ */
+
+module.exports = function query(options) {
+  var opts = merge({}, options)
+  var queryparse = qs.parse;
+
+  if (typeof options === 'function') {
+    queryparse = options;
+    opts = undefined;
+  }
+
+  if (opts !== undefined && opts.allowPrototypes === undefined) {
+    // back-compat for qs module
+    opts.allowPrototypes = true;
+  }
+
+  return function query(req, res, next){
+    if (!req.query) {
+      var val = parseUrl(req).query;
+      req.query = queryparse(val, opts);
+    }
+
+    next();
+  };
+};
diff --git a/wrt/node_modules/express/lib/request.js b/wrt/node_modules/express/lib/request.js
new file mode 100644 (file)
index 0000000..3432e67
--- /dev/null
@@ -0,0 +1,517 @@
+/*!
+ * express
+ * Copyright(c) 2009-2013 TJ Holowaychuk
+ * Copyright(c) 2013 Roman Shtylman
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict';
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var accepts = require('accepts');
+var deprecate = require('depd')('express');
+var isIP = require('net').isIP;
+var typeis = require('type-is');
+var http = require('http');
+var fresh = require('fresh');
+var parseRange = require('range-parser');
+var parse = require('parseurl');
+var proxyaddr = require('proxy-addr');
+
+/**
+ * Request prototype.
+ * @public
+ */
+
+var req = Object.create(http.IncomingMessage.prototype)
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = req
+
+/**
+ * Return request header.
+ *
+ * The `Referrer` header field is special-cased,
+ * both `Referrer` and `Referer` are interchangeable.
+ *
+ * Examples:
+ *
+ *     req.get('Content-Type');
+ *     // => "text/plain"
+ *
+ *     req.get('content-type');
+ *     // => "text/plain"
+ *
+ *     req.get('Something');
+ *     // => undefined
+ *
+ * Aliased as `req.header()`.
+ *
+ * @param {String} name
+ * @return {String}
+ * @public
+ */
+
+req.get =
+req.header = function header(name) {
+  if (!name) {
+    throw new TypeError('name argument is required to req.get');
+  }
+
+  if (typeof name !== 'string') {
+    throw new TypeError('name must be a string to req.get');
+  }
+
+  var lc = name.toLowerCase();
+
+  switch (lc) {
+    case 'referer':
+    case 'referrer':
+      return this.headers.referrer
+        || this.headers.referer;
+    default:
+      return this.headers[lc];
+  }
+};
+
+/**
+ * To do: update docs.
+ *
+ * Check if the given `type(s)` is acceptable, returning
+ * the best match when true, otherwise `undefined`, in which
+ * case you should respond with 406 "Not Acceptable".
+ *
+ * The `type` value may be a single MIME type string
+ * such as "application/json", an extension name
+ * such as "json", a comma-delimited list such as "json, html, text/plain",
+ * an argument list such as `"json", "html", "text/plain"`,
+ * or an array `["json", "html", "text/plain"]`. When a list
+ * or array is given, the _best_ match, if any is returned.
+ *
+ * Examples:
+ *
+ *     // Accept: text/html
+ *     req.accepts('html');
+ *     // => "html"
+ *
+ *     // Accept: text/*, application/json
+ *     req.accepts('html');
+ *     // => "html"
+ *     req.accepts('text/html');
+ *     // => "text/html"
+ *     req.accepts('json, text');
+ *     // => "json"
+ *     req.accepts('application/json');
+ *     // => "application/json"
+ *
+ *     // Accept: text/*, application/json
+ *     req.accepts('image/png');
+ *     req.accepts('png');
+ *     // => undefined
+ *
+ *     // Accept: text/*;q=.5, application/json
+ *     req.accepts(['html', 'json']);
+ *     req.accepts('html', 'json');
+ *     req.accepts('html, json');
+ *     // => "json"
+ *
+ * @param {String|Array} type(s)
+ * @return {String|Array|Boolean}
+ * @public
+ */
+
+req.accepts = function(){
+  var accept = accepts(this);
+  return accept.types.apply(accept, arguments);
+};
+
+/**
+ * Check if the given `encoding`s are accepted.
+ *
+ * @param {String} ...encoding
+ * @return {String|Array}
+ * @public
+ */
+
+req.acceptsEncodings = function(){
+  var accept = accepts(this);
+  return accept.encodings.apply(accept, arguments);
+};
+
+req.acceptsEncoding = deprecate.function(req.acceptsEncodings,
+  'req.acceptsEncoding: Use acceptsEncodings instead');
+
+/**
+ * Check if the given `charset`s are acceptable,
+ * otherwise you should respond with 406 "Not Acceptable".
+ *
+ * @param {String} ...charset
+ * @return {String|Array}
+ * @public
+ */
+
+req.acceptsCharsets = function(){
+  var accept = accepts(this);
+  return accept.charsets.apply(accept, arguments);
+};
+
+req.acceptsCharset = deprecate.function(req.acceptsCharsets,
+  'req.acceptsCharset: Use acceptsCharsets instead');
+
+/**
+ * Check if the given `lang`s are acceptable,
+ * otherwise you should respond with 406 "Not Acceptable".
+ *
+ * @param {String} ...lang
+ * @return {String|Array}
+ * @public
+ */
+
+req.acceptsLanguages = function(){
+  var accept = accepts(this);
+  return accept.languages.apply(accept, arguments);
+};
+
+req.acceptsLanguage = deprecate.function(req.acceptsLanguages,
+  'req.acceptsLanguage: Use acceptsLanguages instead');
+
+/**
+ * Parse Range header field, capping to the given `size`.
+ *
+ * Unspecified ranges such as "0-" require knowledge of your resource length. In
+ * the case of a byte range this is of course the total number of bytes. If the
+ * Range header field is not given `undefined` is returned, `-1` when unsatisfiable,
+ * and `-2` when syntactically invalid.
+ *
+ * When ranges are returned, the array has a "type" property which is the type of
+ * range that is required (most commonly, "bytes"). Each array element is an object
+ * with a "start" and "end" property for the portion of the range.
+ *
+ * The "combine" option can be set to `true` and overlapping & adjacent ranges
+ * will be combined into a single range.
+ *
+ * NOTE: remember that ranges are inclusive, so for example "Range: users=0-3"
+ * should respond with 4 users when available, not 3.
+ *
+ * @param {number} size
+ * @param {object} [options]
+ * @param {boolean} [options.combine=false]
+ * @return {number|array}
+ * @public
+ */
+
+req.range = function range(size, options) {
+  var range = this.get('Range');
+  if (!range) return;
+  return parseRange(size, range, options);
+};
+
+/**
+ * Return the value of param `name` when present or `defaultValue`.
+ *
+ *  - Checks route placeholders, ex: _/user/:id_
+ *  - Checks body params, ex: id=12, {"id":12}
+ *  - Checks query string params, ex: ?id=12
+ *
+ * To utilize request bodies, `req.body`
+ * should be an object. This can be done by using
+ * the `bodyParser()` middleware.
+ *
+ * @param {String} name
+ * @param {Mixed} [defaultValue]
+ * @return {String}
+ * @public
+ */
+
+req.param = function param(name, defaultValue) {
+  var params = this.params || {};
+  var body = this.body || {};
+  var query = this.query || {};
+
+  var args = arguments.length === 1
+    ? 'name'
+    : 'name, default';
+  deprecate('req.param(' + args + '): Use req.params, req.body, or req.query instead');
+
+  if (null != params[name] && params.hasOwnProperty(name)) return params[name];
+  if (null != body[name]) return body[name];
+  if (null != query[name]) return query[name];
+
+  return defaultValue;
+};
+
+/**
+ * Check if the incoming request contains the "Content-Type"
+ * header field, and it contains the give mime `type`.
+ *
+ * Examples:
+ *
+ *      // With Content-Type: text/html; charset=utf-8
+ *      req.is('html');
+ *      req.is('text/html');
+ *      req.is('text/*');
+ *      // => true
+ *
+ *      // When Content-Type is application/json
+ *      req.is('json');
+ *      req.is('application/json');
+ *      req.is('application/*');
+ *      // => true
+ *
+ *      req.is('html');
+ *      // => false
+ *
+ * @param {String|Array} types...
+ * @return {String|false|null}
+ * @public
+ */
+
+req.is = function is(types) {
+  var arr = types;
+
+  // support flattened arguments
+  if (!Array.isArray(types)) {
+    arr = new Array(arguments.length);
+    for (var i = 0; i < arr.length; i++) {
+      arr[i] = arguments[i];
+    }
+  }
+
+  return typeis(this, arr);
+};
+
+/**
+ * Return the protocol string "http" or "https"
+ * when requested with TLS. When the "trust proxy"
+ * setting trusts the socket address, the
+ * "X-Forwarded-Proto" header field will be trusted
+ * and used if present.
+ *
+ * If you're running behind a reverse proxy that
+ * supplies https for you this may be enabled.
+ *
+ * @return {String}
+ * @public
+ */
+
+defineGetter(req, 'protocol', function protocol(){
+  var proto = this.connection.encrypted
+    ? 'https'
+    : 'http';
+  var trust = this.app.get('trust proxy fn');
+
+  if (!trust(this.connection.remoteAddress, 0)) {
+    return proto;
+  }
+
+  // Note: X-Forwarded-Proto is normally only ever a
+  //       single value, but this is to be safe.
+  proto = this.get('X-Forwarded-Proto') || proto;
+  return proto.split(/\s*,\s*/)[0];
+});
+
+/**
+ * Short-hand for:
+ *
+ *    req.protocol === 'https'
+ *
+ * @return {Boolean}
+ * @public
+ */
+
+defineGetter(req, 'secure', function secure(){
+  return this.protocol === 'https';
+});
+
+/**
+ * Return the remote address from the trusted proxy.
+ *
+ * The is the remote address on the socket unless
+ * "trust proxy" is set.
+ *
+ * @return {String}
+ * @public
+ */
+
+defineGetter(req, 'ip', function ip(){
+  var trust = this.app.get('trust proxy fn');
+  return proxyaddr(this, trust);
+});
+
+/**
+ * When "trust proxy" is set, trusted proxy addresses + client.
+ *
+ * For example if the value were "client, proxy1, proxy2"
+ * you would receive the array `["client", "proxy1", "proxy2"]`
+ * where "proxy2" is the furthest down-stream and "proxy1" and
+ * "proxy2" were trusted.
+ *
+ * @return {Array}
+ * @public
+ */
+
+defineGetter(req, 'ips', function ips() {
+  var trust = this.app.get('trust proxy fn');
+  var addrs = proxyaddr.all(this, trust);
+
+  // reverse the order (to farthest -> closest)
+  // and remove socket address
+  addrs.reverse().pop()
+
+  return addrs
+});
+
+/**
+ * Return subdomains as an array.
+ *
+ * Subdomains are the dot-separated parts of the host before the main domain of
+ * the app. By default, the domain of the app is assumed to be the last two
+ * parts of the host. This can be changed by setting "subdomain offset".
+ *
+ * For example, if the domain is "tobi.ferrets.example.com":
+ * If "subdomain offset" is not set, req.subdomains is `["ferrets", "tobi"]`.
+ * If "subdomain offset" is 3, req.subdomains is `["tobi"]`.
+ *
+ * @return {Array}
+ * @public
+ */
+
+defineGetter(req, 'subdomains', function subdomains() {
+  var hostname = this.hostname;
+
+  if (!hostname) return [];
+
+  var offset = this.app.get('subdomain offset');
+  var subdomains = !isIP(hostname)
+    ? hostname.split('.').reverse()
+    : [hostname];
+
+  return subdomains.slice(offset);
+});
+
+/**
+ * Short-hand for `url.parse(req.url).pathname`.
+ *
+ * @return {String}
+ * @public
+ */
+
+defineGetter(req, 'path', function path() {
+  return parse(this).pathname;
+});
+
+/**
+ * Parse the "Host" header field to a hostname.
+ *
+ * When the "trust proxy" setting trusts the socket
+ * address, the "X-Forwarded-Host" header field will
+ * be trusted.
+ *
+ * @return {String}
+ * @public
+ */
+
+defineGetter(req, 'hostname', function hostname(){
+  var trust = this.app.get('trust proxy fn');
+  var host = this.get('X-Forwarded-Host');
+
+  if (!host || !trust(this.connection.remoteAddress, 0)) {
+    host = this.get('Host');
+  }
+
+  if (!host) return;
+
+  // IPv6 literal support
+  var offset = host[0] === '['
+    ? host.indexOf(']') + 1
+    : 0;
+  var index = host.indexOf(':', offset);
+
+  return index !== -1
+    ? host.substring(0, index)
+    : host;
+});
+
+// TODO: change req.host to return host in next major
+
+defineGetter(req, 'host', deprecate.function(function host(){
+  return this.hostname;
+}, 'req.host: Use req.hostname instead'));
+
+/**
+ * Check if the request is fresh, aka
+ * Last-Modified and/or the ETag
+ * still match.
+ *
+ * @return {Boolean}
+ * @public
+ */
+
+defineGetter(req, 'fresh', function(){
+  var method = this.method;
+  var res = this.res
+  var status = res.statusCode
+
+  // GET or HEAD for weak freshness validation only
+  if ('GET' !== method && 'HEAD' !== method) return false;
+
+  // 2xx or 304 as per rfc2616 14.26
+  if ((status >= 200 && status < 300) || 304 === status) {
+    return fresh(this.headers, {
+      'etag': res.get('ETag'),
+      'last-modified': res.get('Last-Modified')
+    })
+  }
+
+  return false;
+});
+
+/**
+ * Check if the request is stale, aka
+ * "Last-Modified" and / or the "ETag" for the
+ * resource has changed.
+ *
+ * @return {Boolean}
+ * @public
+ */
+
+defineGetter(req, 'stale', function stale(){
+  return !this.fresh;
+});
+
+/**
+ * Check if the request was an _XMLHttpRequest_.
+ *
+ * @return {Boolean}
+ * @public
+ */
+
+defineGetter(req, 'xhr', function xhr(){
+  var val = this.get('X-Requested-With') || '';
+  return val.toLowerCase() === 'xmlhttprequest';
+});
+
+/**
+ * Helper function for creating a getter on an object.
+ *
+ * @param {Object} obj
+ * @param {String} name
+ * @param {Function} getter
+ * @private
+ */
+function defineGetter(obj, name, getter) {
+  Object.defineProperty(obj, name, {
+    configurable: true,
+    enumerable: true,
+    get: getter
+  });
+}
diff --git a/wrt/node_modules/express/lib/response.js b/wrt/node_modules/express/lib/response.js
new file mode 100644 (file)
index 0000000..b852a60
--- /dev/null
@@ -0,0 +1,1076 @@
+/*!
+ * express
+ * Copyright(c) 2009-2013 TJ Holowaychuk
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict';
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var contentDisposition = require('content-disposition');
+var deprecate = require('depd')('express');
+var encodeUrl = require('encodeurl');
+var escapeHtml = require('escape-html');
+var http = require('http');
+var isAbsolute = require('./utils').isAbsolute;
+var onFinished = require('on-finished');
+var path = require('path');
+var statuses = require('statuses')
+var merge = require('utils-merge');
+var sign = require('cookie-signature').sign;
+var normalizeType = require('./utils').normalizeType;
+var normalizeTypes = require('./utils').normalizeTypes;
+var setCharset = require('./utils').setCharset;
+var cookie = require('cookie');
+var send = require('send');
+var extname = path.extname;
+var mime = send.mime;
+var resolve = path.resolve;
+var vary = require('vary');
+
+/**
+ * Response prototype.
+ * @public
+ */
+
+var res = Object.create(http.ServerResponse.prototype)
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = res
+
+/**
+ * Module variables.
+ * @private
+ */
+
+var charsetRegExp = /;\s*charset\s*=/;
+
+/**
+ * Set status `code`.
+ *
+ * @param {Number} code
+ * @return {ServerResponse}
+ * @public
+ */
+
+res.status = function status(code) {
+  this.statusCode = code;
+  return this;
+};
+
+/**
+ * Set Link header field with the given `links`.
+ *
+ * Examples:
+ *
+ *    res.links({
+ *      next: 'http://api.example.com/users?page=2',
+ *      last: 'http://api.example.com/users?page=5'
+ *    });
+ *
+ * @param {Object} links
+ * @return {ServerResponse}
+ * @public
+ */
+
+res.links = function(links){
+  var link = this.get('Link') || '';
+  if (link) link += ', ';
+  return this.set('Link', link + Object.keys(links).map(function(rel){
+    return '<' + links[rel] + '>; rel="' + rel + '"';
+  }).join(', '));
+};
+
+/**
+ * Send a response.
+ *
+ * Examples:
+ *
+ *     res.send(new Buffer('wahoo'));
+ *     res.send({ some: 'json' });
+ *     res.send('<p>some html</p>');
+ *
+ * @param {string|number|boolean|object|Buffer} body
+ * @public
+ */
+
+res.send = function send(body) {
+  var chunk = body;
+  var encoding;
+  var len;
+  var req = this.req;
+  var type;
+
+  // settings
+  var app = this.app;
+
+  // allow status / body
+  if (arguments.length === 2) {
+    // res.send(body, status) backwards compat
+    if (typeof arguments[0] !== 'number' && typeof arguments[1] === 'number') {
+      deprecate('res.send(body, status): Use res.status(status).send(body) instead');
+      this.statusCode = arguments[1];
+    } else {
+      deprecate('res.send(status, body): Use res.status(status).send(body) instead');
+      this.statusCode = arguments[0];
+      chunk = arguments[1];
+    }
+  }
+
+  // disambiguate res.send(status) and res.send(status, num)
+  if (typeof chunk === 'number' && arguments.length === 1) {
+    // res.send(status) will set status message as text string
+    if (!this.get('Content-Type')) {
+      this.type('txt');
+    }
+
+    deprecate('res.send(status): Use res.sendStatus(status) instead');
+    this.statusCode = chunk;
+    chunk = statuses[chunk]
+  }
+
+  switch (typeof chunk) {
+    // string defaulting to html
+    case 'string':
+      if (!this.get('Content-Type')) {
+        this.type('html');
+      }
+      break;
+    case 'boolean':
+    case 'number':
+    case 'object':
+      if (chunk === null) {
+        chunk = '';
+      } else if (Buffer.isBuffer(chunk)) {
+        if (!this.get('Content-Type')) {
+          this.type('bin');
+        }
+      } else {
+        return this.json(chunk);
+      }
+      break;
+  }
+
+  // write strings in utf-8
+  if (typeof chunk === 'string') {
+    encoding = 'utf8';
+    type = this.get('Content-Type');
+
+    // reflect this in content-type
+    if (typeof type === 'string') {
+      this.set('Content-Type', setCharset(type, 'utf-8'));
+    }
+  }
+
+  // populate Content-Length
+  if (chunk !== undefined) {
+    if (!Buffer.isBuffer(chunk)) {
+      // convert chunk to Buffer; saves later double conversions
+      chunk = new Buffer(chunk, encoding);
+      encoding = undefined;
+    }
+
+    len = chunk.length;
+    this.set('Content-Length', len);
+  }
+
+  // populate ETag
+  var etag;
+  var generateETag = len !== undefined && app.get('etag fn');
+  if (typeof generateETag === 'function' && !this.get('ETag')) {
+    if ((etag = generateETag(chunk, encoding))) {
+      this.set('ETag', etag);
+    }
+  }
+
+  // freshness
+  if (req.fresh) this.statusCode = 304;
+
+  // strip irrelevant headers
+  if (204 === this.statusCode || 304 === this.statusCode) {
+    this.removeHeader('Content-Type');
+    this.removeHeader('Content-Length');
+    this.removeHeader('Transfer-Encoding');
+    chunk = '';
+  }
+
+  if (req.method === 'HEAD') {
+    // skip body for HEAD
+    this.end();
+  } else {
+    // respond
+    this.end(chunk, encoding);
+  }
+
+  return this;
+};
+
+/**
+ * Send JSON response.
+ *
+ * Examples:
+ *
+ *     res.json(null);
+ *     res.json({ user: 'tj' });
+ *
+ * @param {string|number|boolean|object} obj
+ * @public
+ */
+
+res.json = function json(obj) {
+  var val = obj;
+
+  // allow status / body
+  if (arguments.length === 2) {
+    // res.json(body, status) backwards compat
+    if (typeof arguments[1] === 'number') {
+      deprecate('res.json(obj, status): Use res.status(status).json(obj) instead');
+      this.statusCode = arguments[1];
+    } else {
+      deprecate('res.json(status, obj): Use res.status(status).json(obj) instead');
+      this.statusCode = arguments[0];
+      val = arguments[1];
+    }
+  }
+
+  // settings
+  var app = this.app;
+  var replacer = app.get('json replacer');
+  var spaces = app.get('json spaces');
+  var body = stringify(val, replacer, spaces);
+
+  // content-type
+  if (!this.get('Content-Type')) {
+    this.set('Content-Type', 'application/json');
+  }
+
+  return this.send(body);
+};
+
+/**
+ * Send JSON response with JSONP callback support.
+ *
+ * Examples:
+ *
+ *     res.jsonp(null);
+ *     res.jsonp({ user: 'tj' });
+ *
+ * @param {string|number|boolean|object} obj
+ * @public
+ */
+
+res.jsonp = function jsonp(obj) {
+  var val = obj;
+
+  // allow status / body
+  if (arguments.length === 2) {
+    // res.json(body, status) backwards compat
+    if (typeof arguments[1] === 'number') {
+      deprecate('res.jsonp(obj, status): Use res.status(status).json(obj) instead');
+      this.statusCode = arguments[1];
+    } else {
+      deprecate('res.jsonp(status, obj): Use res.status(status).jsonp(obj) instead');
+      this.statusCode = arguments[0];
+      val = arguments[1];
+    }
+  }
+
+  // settings
+  var app = this.app;
+  var replacer = app.get('json replacer');
+  var spaces = app.get('json spaces');
+  var body = stringify(val, replacer, spaces);
+  var callback = this.req.query[app.get('jsonp callback name')];
+
+  // content-type
+  if (!this.get('Content-Type')) {
+    this.set('X-Content-Type-Options', 'nosniff');
+    this.set('Content-Type', 'application/json');
+  }
+
+  // fixup callback
+  if (Array.isArray(callback)) {
+    callback = callback[0];
+  }
+
+  // jsonp
+  if (typeof callback === 'string' && callback.length !== 0) {
+    this.charset = 'utf-8';
+    this.set('X-Content-Type-Options', 'nosniff');
+    this.set('Content-Type', 'text/javascript');
+
+    // restrict callback charset
+    callback = callback.replace(/[^\[\]\w$.]/g, '');
+
+    // replace chars not allowed in JavaScript that are in JSON
+    body = body
+      .replace(/\u2028/g, '\\u2028')
+      .replace(/\u2029/g, '\\u2029');
+
+    // the /**/ is a specific security mitigation for "Rosetta Flash JSONP abuse"
+    // the typeof check is just to reduce client error noise
+    body = '/**/ typeof ' + callback + ' === \'function\' && ' + callback + '(' + body + ');';
+  }
+
+  return this.send(body);
+};
+
+/**
+ * Send given HTTP status code.
+ *
+ * Sets the response status to `statusCode` and the body of the
+ * response to the standard description from node's http.STATUS_CODES
+ * or the statusCode number if no description.
+ *
+ * Examples:
+ *
+ *     res.sendStatus(200);
+ *
+ * @param {number} statusCode
+ * @public
+ */
+
+res.sendStatus = function sendStatus(statusCode) {
+  var body = statuses[statusCode] || String(statusCode)
+
+  this.statusCode = statusCode;
+  this.type('txt');
+
+  return this.send(body);
+};
+
+/**
+ * Transfer the file at the given `path`.
+ *
+ * Automatically sets the _Content-Type_ response header field.
+ * The callback `callback(err)` is invoked when the transfer is complete
+ * or when an error occurs. Be sure to check `res.sentHeader`
+ * if you wish to attempt responding, as the header and some data
+ * may have already been transferred.
+ *
+ * Options:
+ *
+ *   - `maxAge`   defaulting to 0 (can be string converted by `ms`)
+ *   - `root`     root directory for relative filenames
+ *   - `headers`  object of headers to serve with file
+ *   - `dotfiles` serve dotfiles, defaulting to false; can be `"allow"` to send them
+ *
+ * Other options are passed along to `send`.
+ *
+ * Examples:
+ *
+ *  The following example illustrates how `res.sendFile()` may
+ *  be used as an alternative for the `static()` middleware for
+ *  dynamic situations. The code backing `res.sendFile()` is actually
+ *  the same code, so HTTP cache support etc is identical.
+ *
+ *     app.get('/user/:uid/photos/:file', function(req, res){
+ *       var uid = req.params.uid
+ *         , file = req.params.file;
+ *
+ *       req.user.mayViewFilesFrom(uid, function(yes){
+ *         if (yes) {
+ *           res.sendFile('/uploads/' + uid + '/' + file);
+ *         } else {
+ *           res.send(403, 'Sorry! you cant see that.');
+ *         }
+ *       });
+ *     });
+ *
+ * @public
+ */
+
+res.sendFile = function sendFile(path, options, callback) {
+  var done = callback;
+  var req = this.req;
+  var res = this;
+  var next = req.next;
+  var opts = options || {};
+
+  if (!path) {
+    throw new TypeError('path argument is required to res.sendFile');
+  }
+
+  // support function as second arg
+  if (typeof options === 'function') {
+    done = options;
+    opts = {};
+  }
+
+  if (!opts.root && !isAbsolute(path)) {
+    throw new TypeError('path must be absolute or specify root to res.sendFile');
+  }
+
+  // create file stream
+  var pathname = encodeURI(path);
+  var file = send(req, pathname, opts);
+
+  // transfer
+  sendfile(res, file, opts, function (err) {
+    if (done) return done(err);
+    if (err && err.code === 'EISDIR') return next();
+
+    // next() all but write errors
+    if (err && err.code !== 'ECONNABORTED' && err.syscall !== 'write') {
+      next(err);
+    }
+  });
+};
+
+/**
+ * Transfer the file at the given `path`.
+ *
+ * Automatically sets the _Content-Type_ response header field.
+ * The callback `callback(err)` is invoked when the transfer is complete
+ * or when an error occurs. Be sure to check `res.sentHeader`
+ * if you wish to attempt responding, as the header and some data
+ * may have already been transferred.
+ *
+ * Options:
+ *
+ *   - `maxAge`   defaulting to 0 (can be string converted by `ms`)
+ *   - `root`     root directory for relative filenames
+ *   - `headers`  object of headers to serve with file
+ *   - `dotfiles` serve dotfiles, defaulting to false; can be `"allow"` to send them
+ *
+ * Other options are passed along to `send`.
+ *
+ * Examples:
+ *
+ *  The following example illustrates how `res.sendfile()` may
+ *  be used as an alternative for the `static()` middleware for
+ *  dynamic situations. The code backing `res.sendfile()` is actually
+ *  the same code, so HTTP cache support etc is identical.
+ *
+ *     app.get('/user/:uid/photos/:file', function(req, res){
+ *       var uid = req.params.uid
+ *         , file = req.params.file;
+ *
+ *       req.user.mayViewFilesFrom(uid, function(yes){
+ *         if (yes) {
+ *           res.sendfile('/uploads/' + uid + '/' + file);
+ *         } else {
+ *           res.send(403, 'Sorry! you cant see that.');
+ *         }
+ *       });
+ *     });
+ *
+ * @public
+ */
+
+res.sendfile = function (path, options, callback) {
+  var done = callback;
+  var req = this.req;
+  var res = this;
+  var next = req.next;
+  var opts = options || {};
+
+  // support function as second arg
+  if (typeof options === 'function') {
+    done = options;
+    opts = {};
+  }
+
+  // create file stream
+  var file = send(req, path, opts);
+
+  // transfer
+  sendfile(res, file, opts, function (err) {
+    if (done) return done(err);
+    if (err && err.code === 'EISDIR') return next();
+
+    // next() all but write errors
+    if (err && err.code !== 'ECONNABORT' && err.syscall !== 'write') {
+      next(err);
+    }
+  });
+};
+
+res.sendfile = deprecate.function(res.sendfile,
+  'res.sendfile: Use res.sendFile instead');
+
+/**
+ * Transfer the file at the given `path` as an attachment.
+ *
+ * Optionally providing an alternate attachment `filename`,
+ * and optional callback `callback(err)`. The callback is invoked
+ * when the data transfer is complete, or when an error has
+ * ocurred. Be sure to check `res.headersSent` if you plan to respond.
+ *
+ * This method uses `res.sendfile()`.
+ *
+ * @public
+ */
+
+res.download = function download(path, filename, callback) {
+  var done = callback;
+  var name = filename;
+
+  // support function as second arg
+  if (typeof filename === 'function') {
+    done = filename;
+    name = null;
+  }
+
+  // set Content-Disposition when file is sent
+  var headers = {
+    'Content-Disposition': contentDisposition(name || path)
+  };
+
+  // Resolve the full path for sendFile
+  var fullPath = resolve(path);
+
+  return this.sendFile(fullPath, { headers: headers }, done);
+};
+
+/**
+ * Set _Content-Type_ response header with `type` through `mime.lookup()`
+ * when it does not contain "/", or set the Content-Type to `type` otherwise.
+ *
+ * Examples:
+ *
+ *     res.type('.html');
+ *     res.type('html');
+ *     res.type('json');
+ *     res.type('application/json');
+ *     res.type('png');
+ *
+ * @param {String} type
+ * @return {ServerResponse} for chaining
+ * @public
+ */
+
+res.contentType =
+res.type = function contentType(type) {
+  var ct = type.indexOf('/') === -1
+    ? mime.lookup(type)
+    : type;
+
+  return this.set('Content-Type', ct);
+};
+
+/**
+ * Respond to the Acceptable formats using an `obj`
+ * of mime-type callbacks.
+ *
+ * This method uses `req.accepted`, an array of
+ * acceptable types ordered by their quality values.
+ * When "Accept" is not present the _first_ callback
+ * is invoked, otherwise the first match is used. When
+ * no match is performed the server responds with
+ * 406 "Not Acceptable".
+ *
+ * Content-Type is set for you, however if you choose
+ * you may alter this within the callback using `res.type()`
+ * or `res.set('Content-Type', ...)`.
+ *
+ *    res.format({
+ *      'text/plain': function(){
+ *        res.send('hey');
+ *      },
+ *
+ *      'text/html': function(){
+ *        res.send('<p>hey</p>');
+ *      },
+ *
+ *      'appliation/json': function(){
+ *        res.send({ message: 'hey' });
+ *      }
+ *    });
+ *
+ * In addition to canonicalized MIME types you may
+ * also use extnames mapped to these types:
+ *
+ *    res.format({
+ *      text: function(){
+ *        res.send('hey');
+ *      },
+ *
+ *      html: function(){
+ *        res.send('<p>hey</p>');
+ *      },
+ *
+ *      json: function(){
+ *        res.send({ message: 'hey' });
+ *      }
+ *    });
+ *
+ * By default Express passes an `Error`
+ * with a `.status` of 406 to `next(err)`
+ * if a match is not made. If you provide
+ * a `.default` callback it will be invoked
+ * instead.
+ *
+ * @param {Object} obj
+ * @return {ServerResponse} for chaining
+ * @public
+ */
+
+res.format = function(obj){
+  var req = this.req;
+  var next = req.next;
+
+  var fn = obj.default;
+  if (fn) delete obj.default;
+  var keys = Object.keys(obj);
+
+  var key = keys.length > 0
+    ? req.accepts(keys)
+    : false;
+
+  this.vary("Accept");
+
+  if (key) {
+    this.set('Content-Type', normalizeType(key).value);
+    obj[key](req, this, next);
+  } else if (fn) {
+    fn();
+  } else {
+    var err = new Error('Not Acceptable');
+    err.status = err.statusCode = 406;
+    err.types = normalizeTypes(keys).map(function(o){ return o.value });
+    next(err);
+  }
+
+  return this;
+};
+
+/**
+ * Set _Content-Disposition_ header to _attachment_ with optional `filename`.
+ *
+ * @param {String} filename
+ * @return {ServerResponse}
+ * @public
+ */
+
+res.attachment = function attachment(filename) {
+  if (filename) {
+    this.type(extname(filename));
+  }
+
+  this.set('Content-Disposition', contentDisposition(filename));
+
+  return this;
+};
+
+/**
+ * Append additional header `field` with value `val`.
+ *
+ * Example:
+ *
+ *    res.append('Link', ['<http://localhost/>', '<http://localhost:3000/>']);
+ *    res.append('Set-Cookie', 'foo=bar; Path=/; HttpOnly');
+ *    res.append('Warning', '199 Miscellaneous warning');
+ *
+ * @param {String} field
+ * @param {String|Array} val
+ * @return {ServerResponse} for chaining
+ * @public
+ */
+
+res.append = function append(field, val) {
+  var prev = this.get(field);
+  var value = val;
+
+  if (prev) {
+    // concat the new and prev vals
+    value = Array.isArray(prev) ? prev.concat(val)
+      : Array.isArray(val) ? [prev].concat(val)
+      : [prev, val];
+  }
+
+  return this.set(field, value);
+};
+
+/**
+ * Set header `field` to `val`, or pass
+ * an object of header fields.
+ *
+ * Examples:
+ *
+ *    res.set('Foo', ['bar', 'baz']);
+ *    res.set('Accept', 'application/json');
+ *    res.set({ Accept: 'text/plain', 'X-API-Key': 'tobi' });
+ *
+ * Aliased as `res.header()`.
+ *
+ * @param {String|Object} field
+ * @param {String|Array} val
+ * @return {ServerResponse} for chaining
+ * @public
+ */
+
+res.set =
+res.header = function header(field, val) {
+  if (arguments.length === 2) {
+    var value = Array.isArray(val)
+      ? val.map(String)
+      : String(val);
+
+    // add charset to content-type
+    if (field.toLowerCase() === 'content-type') {
+      if (Array.isArray(value)) {
+        throw new TypeError('Content-Type cannot be set to an Array');
+      }
+      if (!charsetRegExp.test(value)) {
+        var charset = mime.charsets.lookup(value.split(';')[0]);
+        if (charset) value += '; charset=' + charset.toLowerCase();
+      }
+    }
+
+    this.setHeader(field, value);
+  } else {
+    for (var key in field) {
+      this.set(key, field[key]);
+    }
+  }
+  return this;
+};
+
+/**
+ * Get value for header `field`.
+ *
+ * @param {String} field
+ * @return {String}
+ * @public
+ */
+
+res.get = function(field){
+  return this.getHeader(field);
+};
+
+/**
+ * Clear cookie `name`.
+ *
+ * @param {String} name
+ * @param {Object} [options]
+ * @return {ServerResponse} for chaining
+ * @public
+ */
+
+res.clearCookie = function clearCookie(name, options) {
+  var opts = merge({ expires: new Date(1), path: '/' }, options);
+
+  return this.cookie(name, '', opts);
+};
+
+/**
+ * Set cookie `name` to `value`, with the given `options`.
+ *
+ * Options:
+ *
+ *    - `maxAge`   max-age in milliseconds, converted to `expires`
+ *    - `signed`   sign the cookie
+ *    - `path`     defaults to "/"
+ *
+ * Examples:
+ *
+ *    // "Remember Me" for 15 minutes
+ *    res.cookie('rememberme', '1', { expires: new Date(Date.now() + 900000), httpOnly: true });
+ *
+ *    // save as above
+ *    res.cookie('rememberme', '1', { maxAge: 900000, httpOnly: true })
+ *
+ * @param {String} name
+ * @param {String|Object} value
+ * @param {Object} [options]
+ * @return {ServerResponse} for chaining
+ * @public
+ */
+
+res.cookie = function (name, value, options) {
+  var opts = merge({}, options);
+  var secret = this.req.secret;
+  var signed = opts.signed;
+
+  if (signed && !secret) {
+    throw new Error('cookieParser("secret") required for signed cookies');
+  }
+
+  var val = typeof value === 'object'
+    ? 'j:' + JSON.stringify(value)
+    : String(value);
+
+  if (signed) {
+    val = 's:' + sign(val, secret);
+  }
+
+  if ('maxAge' in opts) {
+    opts.expires = new Date(Date.now() + opts.maxAge);
+    opts.maxAge /= 1000;
+  }
+
+  if (opts.path == null) {
+    opts.path = '/';
+  }
+
+  this.append('Set-Cookie', cookie.serialize(name, String(val), opts));
+
+  return this;
+};
+
+/**
+ * Set the location header to `url`.
+ *
+ * The given `url` can also be "back", which redirects
+ * to the _Referrer_ or _Referer_ headers or "/".
+ *
+ * Examples:
+ *
+ *    res.location('/foo/bar').;
+ *    res.location('http://example.com');
+ *    res.location('../login');
+ *
+ * @param {String} url
+ * @return {ServerResponse} for chaining
+ * @public
+ */
+
+res.location = function location(url) {
+  var loc = url;
+
+  // "back" is an alias for the referrer
+  if (url === 'back') {
+    loc = this.req.get('Referrer') || '/';
+  }
+
+  // set location
+  return this.set('Location', encodeUrl(loc));
+};
+
+/**
+ * Redirect to the given `url` with optional response `status`
+ * defaulting to 302.
+ *
+ * The resulting `url` is determined by `res.location()`, so
+ * it will play nicely with mounted apps, relative paths,
+ * `"back"` etc.
+ *
+ * Examples:
+ *
+ *    res.redirect('/foo/bar');
+ *    res.redirect('http://example.com');
+ *    res.redirect(301, 'http://example.com');
+ *    res.redirect('../login'); // /blog/post/1 -> /blog/login
+ *
+ * @public
+ */
+
+res.redirect = function redirect(url) {
+  var address = url;
+  var body;
+  var status = 302;
+
+  // allow status / url
+  if (arguments.length === 2) {
+    if (typeof arguments[0] === 'number') {
+      status = arguments[0];
+      address = arguments[1];
+    } else {
+      deprecate('res.redirect(url, status): Use res.redirect(status, url) instead');
+      status = arguments[1];
+    }
+  }
+
+  // Set location header
+  address = this.location(address).get('Location');
+
+  // Support text/{plain,html} by default
+  this.format({
+    text: function(){
+      body = statuses[status] + '. Redirecting to ' + address
+    },
+
+    html: function(){
+      var u = escapeHtml(address);
+      body = '<p>' + statuses[status] + '. Redirecting to <a href="' + u + '">' + u + '</a></p>'
+    },
+
+    default: function(){
+      body = '';
+    }
+  });
+
+  // Respond
+  this.statusCode = status;
+  this.set('Content-Length', Buffer.byteLength(body));
+
+  if (this.req.method === 'HEAD') {
+    this.end();
+  } else {
+    this.end(body);
+  }
+};
+
+/**
+ * Add `field` to Vary. If already present in the Vary set, then
+ * this call is simply ignored.
+ *
+ * @param {Array|String} field
+ * @return {ServerResponse} for chaining
+ * @public
+ */
+
+res.vary = function(field){
+  // checks for back-compat
+  if (!field || (Array.isArray(field) && !field.length)) {
+    deprecate('res.vary(): Provide a field name');
+    return this;
+  }
+
+  vary(this, field);
+
+  return this;
+};
+
+/**
+ * Render `view` with the given `options` and optional callback `fn`.
+ * When a callback function is given a response will _not_ be made
+ * automatically, otherwise a response of _200_ and _text/html_ is given.
+ *
+ * Options:
+ *
+ *  - `cache`     boolean hinting to the engine it should cache
+ *  - `filename`  filename of the view being rendered
+ *
+ * @public
+ */
+
+res.render = function render(view, options, callback) {
+  var app = this.req.app;
+  var done = callback;
+  var opts = options || {};
+  var req = this.req;
+  var self = this;
+
+  // support callback function as second arg
+  if (typeof options === 'function') {
+    done = options;
+    opts = {};
+  }
+
+  // merge res.locals
+  opts._locals = self.locals;
+
+  // default callback to respond
+  done = done || function (err, str) {
+    if (err) return req.next(err);
+    self.send(str);
+  };
+
+  // render
+  app.render(view, opts, done);
+};
+
+// pipe the send file stream
+function sendfile(res, file, options, callback) {
+  var done = false;
+  var streaming;
+
+  // request aborted
+  function onaborted() {
+    if (done) return;
+    done = true;
+
+    var err = new Error('Request aborted');
+    err.code = 'ECONNABORTED';
+    callback(err);
+  }
+
+  // directory
+  function ondirectory() {
+    if (done) return;
+    done = true;
+
+    var err = new Error('EISDIR, read');
+    err.code = 'EISDIR';
+    callback(err);
+  }
+
+  // errors
+  function onerror(err) {
+    if (done) return;
+    done = true;
+    callback(err);
+  }
+
+  // ended
+  function onend() {
+    if (done) return;
+    done = true;
+    callback();
+  }
+
+  // file
+  function onfile() {
+    streaming = false;
+  }
+
+  // finished
+  function onfinish(err) {
+    if (err && err.code === 'ECONNRESET') return onaborted();
+    if (err) return onerror(err);
+    if (done) return;
+
+    setImmediate(function () {
+      if (streaming !== false && !done) {
+        onaborted();
+        return;
+      }
+
+      if (done) return;
+      done = true;
+      callback();
+    });
+  }
+
+  // streaming
+  function onstream() {
+    streaming = true;
+  }
+
+  file.on('directory', ondirectory);
+  file.on('end', onend);
+  file.on('error', onerror);
+  file.on('file', onfile);
+  file.on('stream', onstream);
+  onFinished(res, onfinish);
+
+  if (options.headers) {
+    // set headers on successful transfer
+    file.on('headers', function headers(res) {
+      var obj = options.headers;
+      var keys = Object.keys(obj);
+
+      for (var i = 0; i < keys.length; i++) {
+        var k = keys[i];
+        res.setHeader(k, obj[k]);
+      }
+    });
+  }
+
+  // pipe
+  file.pipe(res);
+}
+
+/**
+ * Stringify JSON, like JSON.stringify, but v8 optimized.
+ * @private
+ */
+
+function stringify(value, replacer, spaces) {
+  // v8 checks arguments.length for optimizing simple call
+  // https://bugs.chromium.org/p/v8/issues/detail?id=4730
+  return replacer || spaces
+    ? JSON.stringify(value, replacer, spaces)
+    : JSON.stringify(value);
+}
diff --git a/wrt/node_modules/express/lib/router/index.js b/wrt/node_modules/express/lib/router/index.js
new file mode 100644 (file)
index 0000000..51db4c2
--- /dev/null
@@ -0,0 +1,662 @@
+/*!
+ * express
+ * Copyright(c) 2009-2013 TJ Holowaychuk
+ * Copyright(c) 2013 Roman Shtylman
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict';
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var Route = require('./route');
+var Layer = require('./layer');
+var methods = require('methods');
+var mixin = require('utils-merge');
+var debug = require('debug')('express:router');
+var deprecate = require('depd')('express');
+var flatten = require('array-flatten');
+var parseUrl = require('parseurl');
+var setPrototypeOf = require('setprototypeof')
+
+/**
+ * Module variables.
+ * @private
+ */
+
+var objectRegExp = /^\[object (\S+)\]$/;
+var slice = Array.prototype.slice;
+var toString = Object.prototype.toString;
+
+/**
+ * Initialize a new `Router` with the given `options`.
+ *
+ * @param {Object} options
+ * @return {Router} which is an callable function
+ * @public
+ */
+
+var proto = module.exports = function(options) {
+  var opts = options || {};
+
+  function router(req, res, next) {
+    router.handle(req, res, next);
+  }
+
+  // mixin Router class functions
+  setPrototypeOf(router, proto)
+
+  router.params = {};
+  router._params = [];
+  router.caseSensitive = opts.caseSensitive;
+  router.mergeParams = opts.mergeParams;
+  router.strict = opts.strict;
+  router.stack = [];
+
+  return router;
+};
+
+/**
+ * Map the given param placeholder `name`(s) to the given callback.
+ *
+ * Parameter mapping is used to provide pre-conditions to routes
+ * which use normalized placeholders. For example a _:user_id_ parameter
+ * could automatically load a user's information from the database without
+ * any additional code,
+ *
+ * The callback uses the same signature as middleware, the only difference
+ * being that the value of the placeholder is passed, in this case the _id_
+ * of the user. Once the `next()` function is invoked, just like middleware
+ * it will continue on to execute the route, or subsequent parameter functions.
+ *
+ * Just like in middleware, you must either respond to the request or call next
+ * to avoid stalling the request.
+ *
+ *  app.param('user_id', function(req, res, next, id){
+ *    User.find(id, function(err, user){
+ *      if (err) {
+ *        return next(err);
+ *      } else if (!user) {
+ *        return next(new Error('failed to load user'));
+ *      }
+ *      req.user = user;
+ *      next();
+ *    });
+ *  });
+ *
+ * @param {String} name
+ * @param {Function} fn
+ * @return {app} for chaining
+ * @public
+ */
+
+proto.param = function param(name, fn) {
+  // param logic
+  if (typeof name === 'function') {
+    deprecate('router.param(fn): Refactor to use path params');
+    this._params.push(name);
+    return;
+  }
+
+  // apply param functions
+  var params = this._params;
+  var len = params.length;
+  var ret;
+
+  if (name[0] === ':') {
+    deprecate('router.param(' + JSON.stringify(name) + ', fn): Use router.param(' + JSON.stringify(name.substr(1)) + ', fn) instead');
+    name = name.substr(1);
+  }
+
+  for (var i = 0; i < len; ++i) {
+    if (ret = params[i](name, fn)) {
+      fn = ret;
+    }
+  }
+
+  // ensure we end up with a
+  // middleware function
+  if ('function' !== typeof fn) {
+    throw new Error('invalid param() call for ' + name + ', got ' + fn);
+  }
+
+  (this.params[name] = this.params[name] || []).push(fn);
+  return this;
+};
+
+/**
+ * Dispatch a req, res into the router.
+ * @private
+ */
+
+proto.handle = function handle(req, res, out) {
+  var self = this;
+
+  debug('dispatching %s %s', req.method, req.url);
+
+  var idx = 0;
+  var protohost = getProtohost(req.url) || ''
+  var removed = '';
+  var slashAdded = false;
+  var paramcalled = {};
+
+  // store options for OPTIONS request
+  // only used if OPTIONS request
+  var options = [];
+
+  // middleware and routes
+  var stack = self.stack;
+
+  // manage inter-router variables
+  var parentParams = req.params;
+  var parentUrl = req.baseUrl || '';
+  var done = restore(out, req, 'baseUrl', 'next', 'params');
+
+  // setup next layer
+  req.next = next;
+
+  // for options requests, respond with a default if nothing else responds
+  if (req.method === 'OPTIONS') {
+    done = wrap(done, function(old, err) {
+      if (err || options.length === 0) return old(err);
+      sendOptionsResponse(res, options, old);
+    });
+  }
+
+  // setup basic req values
+  req.baseUrl = parentUrl;
+  req.originalUrl = req.originalUrl || req.url;
+
+  next();
+
+  function next(err) {
+    var layerError = err === 'route'
+      ? null
+      : err;
+
+    // remove added slash
+    if (slashAdded) {
+      req.url = req.url.substr(1);
+      slashAdded = false;
+    }
+
+    // restore altered req.url
+    if (removed.length !== 0) {
+      req.baseUrl = parentUrl;
+      req.url = protohost + removed + req.url.substr(protohost.length);
+      removed = '';
+    }
+
+    // signal to exit router
+    if (layerError === 'router') {
+      setImmediate(done, null)
+      return
+    }
+
+    // no more matching layers
+    if (idx >= stack.length) {
+      setImmediate(done, layerError);
+      return;
+    }
+
+    // get pathname of request
+    var path = getPathname(req);
+
+    if (path == null) {
+      return done(layerError);
+    }
+
+    // find next matching layer
+    var layer;
+    var match;
+    var route;
+
+    while (match !== true && idx < stack.length) {
+      layer = stack[idx++];
+      match = matchLayer(layer, path);
+      route = layer.route;
+
+      if (typeof match !== 'boolean') {
+        // hold on to layerError
+        layerError = layerError || match;
+      }
+
+      if (match !== true) {
+        continue;
+      }
+
+      if (!route) {
+        // process non-route handlers normally
+        continue;
+      }
+
+      if (layerError) {
+        // routes do not match with a pending error
+        match = false;
+        continue;
+      }
+
+      var method = req.method;
+      var has_method = route._handles_method(method);
+
+      // build up automatic options response
+      if (!has_method && method === 'OPTIONS') {
+        appendMethods(options, route._options());
+      }
+
+      // don't even bother matching route
+      if (!has_method && method !== 'HEAD') {
+        match = false;
+        continue;
+      }
+    }
+
+    // no match
+    if (match !== true) {
+      return done(layerError);
+    }
+
+    // store route for dispatch on change
+    if (route) {
+      req.route = route;
+    }
+
+    // Capture one-time layer values
+    req.params = self.mergeParams
+      ? mergeParams(layer.params, parentParams)
+      : layer.params;
+    var layerPath = layer.path;
+
+    // this should be done for the layer
+    self.process_params(layer, paramcalled, req, res, function (err) {
+      if (err) {
+        return next(layerError || err);
+      }
+
+      if (route) {
+        return layer.handle_request(req, res, next);
+      }
+
+      trim_prefix(layer, layerError, layerPath, path);
+    });
+  }
+
+  function trim_prefix(layer, layerError, layerPath, path) {
+    if (layerPath.length !== 0) {
+      // Validate path breaks on a path separator
+      var c = path[layerPath.length]
+      if (c && c !== '/' && c !== '.') return next(layerError)
+
+      // Trim off the part of the url that matches the route
+      // middleware (.use stuff) needs to have the path stripped
+      debug('trim prefix (%s) from url %s', layerPath, req.url);
+      removed = layerPath;
+      req.url = protohost + req.url.substr(protohost.length + removed.length);
+
+      // Ensure leading slash
+      if (!protohost && req.url[0] !== '/') {
+        req.url = '/' + req.url;
+        slashAdded = true;
+      }
+
+      // Setup base URL (no trailing slash)
+      req.baseUrl = parentUrl + (removed[removed.length - 1] === '/'
+        ? removed.substring(0, removed.length - 1)
+        : removed);
+    }
+
+    debug('%s %s : %s', layer.name, layerPath, req.originalUrl);
+
+    if (layerError) {
+      layer.handle_error(layerError, req, res, next);
+    } else {
+      layer.handle_request(req, res, next);
+    }
+  }
+};
+
+/**
+ * Process any parameters for the layer.
+ * @private
+ */
+
+proto.process_params = function process_params(layer, called, req, res, done) {
+  var params = this.params;
+
+  // captured parameters from the layer, keys and values
+  var keys = layer.keys;
+
+  // fast track
+  if (!keys || keys.length === 0) {
+    return done();
+  }
+
+  var i = 0;
+  var name;
+  var paramIndex = 0;
+  var key;
+  var paramVal;
+  var paramCallbacks;
+  var paramCalled;
+
+  // process params in order
+  // param callbacks can be async
+  function param(err) {
+    if (err) {
+      return done(err);
+    }
+
+    if (i >= keys.length ) {
+      return done();
+    }
+
+    paramIndex = 0;
+    key = keys[i++];
+    name = key.name;
+    paramVal = req.params[name];
+    paramCallbacks = params[name];
+    paramCalled = called[name];
+
+    if (paramVal === undefined || !paramCallbacks) {
+      return param();
+    }
+
+    // param previously called with same value or error occurred
+    if (paramCalled && (paramCalled.match === paramVal
+      || (paramCalled.error && paramCalled.error !== 'route'))) {
+      // restore value
+      req.params[name] = paramCalled.value;
+
+      // next param
+      return param(paramCalled.error);
+    }
+
+    called[name] = paramCalled = {
+      error: null,
+      match: paramVal,
+      value: paramVal
+    };
+
+    paramCallback();
+  }
+
+  // single param callbacks
+  function paramCallback(err) {
+    var fn = paramCallbacks[paramIndex++];
+
+    // store updated value
+    paramCalled.value = req.params[key.name];
+
+    if (err) {
+      // store error
+      paramCalled.error = err;
+      param(err);
+      return;
+    }
+
+    if (!fn) return param();
+
+    try {
+      fn(req, res, paramCallback, paramVal, key.name);
+    } catch (e) {
+      paramCallback(e);
+    }
+  }
+
+  param();
+};
+
+/**
+ * Use the given middleware function, with optional path, defaulting to "/".
+ *
+ * Use (like `.all`) will run for any http METHOD, but it will not add
+ * handlers for those methods so OPTIONS requests will not consider `.use`
+ * functions even if they could respond.
+ *
+ * The other difference is that _route_ path is stripped and not visible
+ * to the handler function. The main effect of this feature is that mounted
+ * handlers can operate without any code changes regardless of the "prefix"
+ * pathname.
+ *
+ * @public
+ */
+
+proto.use = function use(fn) {
+  var offset = 0;
+  var path = '/';
+
+  // default path to '/'
+  // disambiguate router.use([fn])
+  if (typeof fn !== 'function') {
+    var arg = fn;
+
+    while (Array.isArray(arg) && arg.length !== 0) {
+      arg = arg[0];
+    }
+
+    // first arg is the path
+    if (typeof arg !== 'function') {
+      offset = 1;
+      path = fn;
+    }
+  }
+
+  var callbacks = flatten(slice.call(arguments, offset));
+
+  if (callbacks.length === 0) {
+    throw new TypeError('Router.use() requires middleware functions');
+  }
+
+  for (var i = 0; i < callbacks.length; i++) {
+    var fn = callbacks[i];
+
+    if (typeof fn !== 'function') {
+      throw new TypeError('Router.use() requires middleware function but got a ' + gettype(fn));
+    }
+
+    // add the middleware
+    debug('use %o %s', path, fn.name || '<anonymous>')
+
+    var layer = new Layer(path, {
+      sensitive: this.caseSensitive,
+      strict: false,
+      end: false
+    }, fn);
+
+    layer.route = undefined;
+
+    this.stack.push(layer);
+  }
+
+  return this;
+};
+
+/**
+ * Create a new Route for the given path.
+ *
+ * Each route contains a separate middleware stack and VERB handlers.
+ *
+ * See the Route api documentation for details on adding handlers
+ * and middleware to routes.
+ *
+ * @param {String} path
+ * @return {Route}
+ * @public
+ */
+
+proto.route = function route(path) {
+  var route = new Route(path);
+
+  var layer = new Layer(path, {
+    sensitive: this.caseSensitive,
+    strict: this.strict,
+    end: true
+  }, route.dispatch.bind(route));
+
+  layer.route = route;
+
+  this.stack.push(layer);
+  return route;
+};
+
+// create Router#VERB functions
+methods.concat('all').forEach(function(method){
+  proto[method] = function(path){
+    var route = this.route(path)
+    route[method].apply(route, slice.call(arguments, 1));
+    return this;
+  };
+});
+
+// append methods to a list of methods
+function appendMethods(list, addition) {
+  for (var i = 0; i < addition.length; i++) {
+    var method = addition[i];
+    if (list.indexOf(method) === -1) {
+      list.push(method);
+    }
+  }
+}
+
+// get pathname of request
+function getPathname(req) {
+  try {
+    return parseUrl(req).pathname;
+  } catch (err) {
+    return undefined;
+  }
+}
+
+// Get get protocol + host for a URL
+function getProtohost(url) {
+  if (typeof url !== 'string' || url.length === 0 || url[0] === '/') {
+    return undefined
+  }
+
+  var searchIndex = url.indexOf('?')
+  var pathLength = searchIndex !== -1
+    ? searchIndex
+    : url.length
+  var fqdnIndex = url.substr(0, pathLength).indexOf('://')
+
+  return fqdnIndex !== -1
+    ? url.substr(0, url.indexOf('/', 3 + fqdnIndex))
+    : undefined
+}
+
+// get type for error message
+function gettype(obj) {
+  var type = typeof obj;
+
+  if (type !== 'object') {
+    return type;
+  }
+
+  // inspect [[Class]] for objects
+  return toString.call(obj)
+    .replace(objectRegExp, '$1');
+}
+
+/**
+ * Match path to a layer.
+ *
+ * @param {Layer} layer
+ * @param {string} path
+ * @private
+ */
+
+function matchLayer(layer, path) {
+  try {
+    return layer.match(path);
+  } catch (err) {
+    return err;
+  }
+}
+
+// merge params with parent params
+function mergeParams(params, parent) {
+  if (typeof parent !== 'object' || !parent) {
+    return params;
+  }
+
+  // make copy of parent for base
+  var obj = mixin({}, parent);
+
+  // simple non-numeric merging
+  if (!(0 in params) || !(0 in parent)) {
+    return mixin(obj, params);
+  }
+
+  var i = 0;
+  var o = 0;
+
+  // determine numeric gaps
+  while (i in params) {
+    i++;
+  }
+
+  while (o in parent) {
+    o++;
+  }
+
+  // offset numeric indices in params before merge
+  for (i--; i >= 0; i--) {
+    params[i + o] = params[i];
+
+    // create holes for the merge when necessary
+    if (i < o) {
+      delete params[i];
+    }
+  }
+
+  return mixin(obj, params);
+}
+
+// restore obj props after function
+function restore(fn, obj) {
+  var props = new Array(arguments.length - 2);
+  var vals = new Array(arguments.length - 2);
+
+  for (var i = 0; i < props.length; i++) {
+    props[i] = arguments[i + 2];
+    vals[i] = obj[props[i]];
+  }
+
+  return function () {
+    // restore vals
+    for (var i = 0; i < props.length; i++) {
+      obj[props[i]] = vals[i];
+    }
+
+    return fn.apply(this, arguments);
+  };
+}
+
+// send an OPTIONS response
+function sendOptionsResponse(res, options, next) {
+  try {
+    var body = options.join(',');
+    res.set('Allow', body);
+    res.send(body);
+  } catch (err) {
+    next(err);
+  }
+}
+
+// wrap a function
+function wrap(old, fn) {
+  return function proxy() {
+    var args = new Array(arguments.length + 1);
+
+    args[0] = old;
+    for (var i = 0, len = arguments.length; i < len; i++) {
+      args[i + 1] = arguments[i];
+    }
+
+    fn.apply(this, args);
+  };
+}
diff --git a/wrt/node_modules/express/lib/router/layer.js b/wrt/node_modules/express/lib/router/layer.js
new file mode 100644 (file)
index 0000000..4dc8e86
--- /dev/null
@@ -0,0 +1,181 @@
+/*!
+ * express
+ * Copyright(c) 2009-2013 TJ Holowaychuk
+ * Copyright(c) 2013 Roman Shtylman
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict';
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var pathRegexp = require('path-to-regexp');
+var debug = require('debug')('express:router:layer');
+
+/**
+ * Module variables.
+ * @private
+ */
+
+var hasOwnProperty = Object.prototype.hasOwnProperty;
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = Layer;
+
+function Layer(path, options, fn) {
+  if (!(this instanceof Layer)) {
+    return new Layer(path, options, fn);
+  }
+
+  debug('new %o', path)
+  var opts = options || {};
+
+  this.handle = fn;
+  this.name = fn.name || '<anonymous>';
+  this.params = undefined;
+  this.path = undefined;
+  this.regexp = pathRegexp(path, this.keys = [], opts);
+
+  // set fast path flags
+  this.regexp.fast_star = path === '*'
+  this.regexp.fast_slash = path === '/' && opts.end === false
+}
+
+/**
+ * Handle the error for the layer.
+ *
+ * @param {Error} error
+ * @param {Request} req
+ * @param {Response} res
+ * @param {function} next
+ * @api private
+ */
+
+Layer.prototype.handle_error = function handle_error(error, req, res, next) {
+  var fn = this.handle;
+
+  if (fn.length !== 4) {
+    // not a standard error handler
+    return next(error);
+  }
+
+  try {
+    fn(error, req, res, next);
+  } catch (err) {
+    next(err);
+  }
+};
+
+/**
+ * Handle the request for the layer.
+ *
+ * @param {Request} req
+ * @param {Response} res
+ * @param {function} next
+ * @api private
+ */
+
+Layer.prototype.handle_request = function handle(req, res, next) {
+  var fn = this.handle;
+
+  if (fn.length > 3) {
+    // not a standard request handler
+    return next();
+  }
+
+  try {
+    fn(req, res, next);
+  } catch (err) {
+    next(err);
+  }
+};
+
+/**
+ * Check if this route matches `path`, if so
+ * populate `.params`.
+ *
+ * @param {String} path
+ * @return {Boolean}
+ * @api private
+ */
+
+Layer.prototype.match = function match(path) {
+  var match
+
+  if (path != null) {
+    // fast path non-ending match for / (any path matches)
+    if (this.regexp.fast_slash) {
+      this.params = {}
+      this.path = ''
+      return true
+    }
+
+    // fast path for * (everything matched in a param)
+    if (this.regexp.fast_star) {
+      this.params = {'0': decode_param(path)}
+      this.path = path
+      return true
+    }
+
+    // match the path
+    match = this.regexp.exec(path)
+  }
+
+  if (!match) {
+    this.params = undefined;
+    this.path = undefined;
+    return false;
+  }
+
+  // store values
+  this.params = {};
+  this.path = match[0]
+
+  var keys = this.keys;
+  var params = this.params;
+
+  for (var i = 1; i < match.length; i++) {
+    var key = keys[i - 1];
+    var prop = key.name;
+    var val = decode_param(match[i])
+
+    if (val !== undefined || !(hasOwnProperty.call(params, prop))) {
+      params[prop] = val;
+    }
+  }
+
+  return true;
+};
+
+/**
+ * Decode param value.
+ *
+ * @param {string} val
+ * @return {string}
+ * @private
+ */
+
+function decode_param(val) {
+  if (typeof val !== 'string' || val.length === 0) {
+    return val;
+  }
+
+  try {
+    return decodeURIComponent(val);
+  } catch (err) {
+    if (err instanceof URIError) {
+      err.message = 'Failed to decode param \'' + val + '\'';
+      err.status = err.statusCode = 400;
+    }
+
+    throw err;
+  }
+}
diff --git a/wrt/node_modules/express/lib/router/route.js b/wrt/node_modules/express/lib/router/route.js
new file mode 100644 (file)
index 0000000..ea82ed2
--- /dev/null
@@ -0,0 +1,216 @@
+/*!
+ * express
+ * Copyright(c) 2009-2013 TJ Holowaychuk
+ * Copyright(c) 2013 Roman Shtylman
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict';
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var debug = require('debug')('express:router:route');
+var flatten = require('array-flatten');
+var Layer = require('./layer');
+var methods = require('methods');
+
+/**
+ * Module variables.
+ * @private
+ */
+
+var slice = Array.prototype.slice;
+var toString = Object.prototype.toString;
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = Route;
+
+/**
+ * Initialize `Route` with the given `path`,
+ *
+ * @param {String} path
+ * @public
+ */
+
+function Route(path) {
+  this.path = path;
+  this.stack = [];
+
+  debug('new %o', path)
+
+  // route handlers for various http methods
+  this.methods = {};
+}
+
+/**
+ * Determine if the route handles a given method.
+ * @private
+ */
+
+Route.prototype._handles_method = function _handles_method(method) {
+  if (this.methods._all) {
+    return true;
+  }
+
+  var name = method.toLowerCase();
+
+  if (name === 'head' && !this.methods['head']) {
+    name = 'get';
+  }
+
+  return Boolean(this.methods[name]);
+};
+
+/**
+ * @return {Array} supported HTTP methods
+ * @private
+ */
+
+Route.prototype._options = function _options() {
+  var methods = Object.keys(this.methods);
+
+  // append automatic head
+  if (this.methods.get && !this.methods.head) {
+    methods.push('head');
+  }
+
+  for (var i = 0; i < methods.length; i++) {
+    // make upper case
+    methods[i] = methods[i].toUpperCase();
+  }
+
+  return methods;
+};
+
+/**
+ * dispatch req, res into this route
+ * @private
+ */
+
+Route.prototype.dispatch = function dispatch(req, res, done) {
+  var idx = 0;
+  var stack = this.stack;
+  if (stack.length === 0) {
+    return done();
+  }
+
+  var method = req.method.toLowerCase();
+  if (method === 'head' && !this.methods['head']) {
+    method = 'get';
+  }
+
+  req.route = this;
+
+  next();
+
+  function next(err) {
+    // signal to exit route
+    if (err && err === 'route') {
+      return done();
+    }
+
+    // signal to exit router
+    if (err && err === 'router') {
+      return done(err)
+    }
+
+    var layer = stack[idx++];
+    if (!layer) {
+      return done(err);
+    }
+
+    if (layer.method && layer.method !== method) {
+      return next(err);
+    }
+
+    if (err) {
+      layer.handle_error(err, req, res, next);
+    } else {
+      layer.handle_request(req, res, next);
+    }
+  }
+};
+
+/**
+ * Add a handler for all HTTP verbs to this route.
+ *
+ * Behaves just like middleware and can respond or call `next`
+ * to continue processing.
+ *
+ * You can use multiple `.all` call to add multiple handlers.
+ *
+ *   function check_something(req, res, next){
+ *     next();
+ *   };
+ *
+ *   function validate_user(req, res, next){
+ *     next();
+ *   };
+ *
+ *   route
+ *   .all(validate_user)
+ *   .all(check_something)
+ *   .get(function(req, res, next){
+ *     res.send('hello world');
+ *   });
+ *
+ * @param {function} handler
+ * @return {Route} for chaining
+ * @api public
+ */
+
+Route.prototype.all = function all() {
+  var handles = flatten(slice.call(arguments));
+
+  for (var i = 0; i < handles.length; i++) {
+    var handle = handles[i];
+
+    if (typeof handle !== 'function') {
+      var type = toString.call(handle);
+      var msg = 'Route.all() requires callback functions but got a ' + type;
+      throw new TypeError(msg);
+    }
+
+    var layer = Layer('/', {}, handle);
+    layer.method = undefined;
+
+    this.methods._all = true;
+    this.stack.push(layer);
+  }
+
+  return this;
+};
+
+methods.forEach(function(method){
+  Route.prototype[method] = function(){
+    var handles = flatten(slice.call(arguments));
+
+    for (var i = 0; i < handles.length; i++) {
+      var handle = handles[i];
+
+      if (typeof handle !== 'function') {
+        var type = toString.call(handle);
+        var msg = 'Route.' + method + '() requires callback functions but got a ' + type;
+        throw new Error(msg);
+      }
+
+      debug('%s %o', method, this.path)
+
+      var layer = Layer('/', {}, handle);
+      layer.method = method;
+
+      this.methods[method] = true;
+      this.stack.push(layer);
+    }
+
+    return this;
+  };
+});
diff --git a/wrt/node_modules/express/lib/utils.js b/wrt/node_modules/express/lib/utils.js
new file mode 100644 (file)
index 0000000..ae2a7f8
--- /dev/null
@@ -0,0 +1,298 @@
+/*!
+ * express
+ * Copyright(c) 2009-2013 TJ Holowaychuk
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict';
+
+/**
+ * Module dependencies.
+ * @api private
+ */
+
+var contentDisposition = require('content-disposition');
+var contentType = require('content-type');
+var deprecate = require('depd')('express');
+var flatten = require('array-flatten');
+var mime = require('send').mime;
+var etag = require('etag');
+var proxyaddr = require('proxy-addr');
+var qs = require('qs');
+var querystring = require('querystring');
+
+/**
+ * Return strong ETag for `body`.
+ *
+ * @param {String|Buffer} body
+ * @param {String} [encoding]
+ * @return {String}
+ * @api private
+ */
+
+exports.etag = function (body, encoding) {
+  var buf = !Buffer.isBuffer(body)
+    ? new Buffer(body, encoding)
+    : body;
+
+  return etag(buf, {weak: false});
+};
+
+/**
+ * Return weak ETag for `body`.
+ *
+ * @param {String|Buffer} body
+ * @param {String} [encoding]
+ * @return {String}
+ * @api private
+ */
+
+exports.wetag = function wetag(body, encoding){
+  var buf = !Buffer.isBuffer(body)
+    ? new Buffer(body, encoding)
+    : body;
+
+  return etag(buf, {weak: true});
+};
+
+/**
+ * Check if `path` looks absolute.
+ *
+ * @param {String} path
+ * @return {Boolean}
+ * @api private
+ */
+
+exports.isAbsolute = function(path){
+  if ('/' === path[0]) return true;
+  if (':' === path[1] && ('\\' === path[2] || '/' === path[2])) return true; // Windows device path
+  if ('\\\\' === path.substring(0, 2)) return true; // Microsoft Azure absolute path
+};
+
+/**
+ * Flatten the given `arr`.
+ *
+ * @param {Array} arr
+ * @return {Array}
+ * @api private
+ */
+
+exports.flatten = deprecate.function(flatten,
+  'utils.flatten: use array-flatten npm module instead');
+
+/**
+ * Normalize the given `type`, for example "html" becomes "text/html".
+ *
+ * @param {String} type
+ * @return {Object}
+ * @api private
+ */
+
+exports.normalizeType = function(type){
+  return ~type.indexOf('/')
+    ? acceptParams(type)
+    : { value: mime.lookup(type), params: {} };
+};
+
+/**
+ * Normalize `types`, for example "html" becomes "text/html".
+ *
+ * @param {Array} types
+ * @return {Array}
+ * @api private
+ */
+
+exports.normalizeTypes = function(types){
+  var ret = [];
+
+  for (var i = 0; i < types.length; ++i) {
+    ret.push(exports.normalizeType(types[i]));
+  }
+
+  return ret;
+};
+
+/**
+ * Generate Content-Disposition header appropriate for the filename.
+ * non-ascii filenames are urlencoded and a filename* parameter is added
+ *
+ * @param {String} filename
+ * @return {String}
+ * @api private
+ */
+
+exports.contentDisposition = deprecate.function(contentDisposition,
+  'utils.contentDisposition: use content-disposition npm module instead');
+
+/**
+ * Parse accept params `str` returning an
+ * object with `.value`, `.quality` and `.params`.
+ * also includes `.originalIndex` for stable sorting
+ *
+ * @param {String} str
+ * @return {Object}
+ * @api private
+ */
+
+function acceptParams(str, index) {
+  var parts = str.split(/ *; */);
+  var ret = { value: parts[0], quality: 1, params: {}, originalIndex: index };
+
+  for (var i = 1; i < parts.length; ++i) {
+    var pms = parts[i].split(/ *= */);
+    if ('q' === pms[0]) {
+      ret.quality = parseFloat(pms[1]);
+    } else {
+      ret.params[pms[0]] = pms[1];
+    }
+  }
+
+  return ret;
+}
+
+/**
+ * Compile "etag" value to function.
+ *
+ * @param  {Boolean|String|Function} val
+ * @return {Function}
+ * @api private
+ */
+
+exports.compileETag = function(val) {
+  var fn;
+
+  if (typeof val === 'function') {
+    return val;
+  }
+
+  switch (val) {
+    case true:
+      fn = exports.wetag;
+      break;
+    case false:
+      break;
+    case 'strong':
+      fn = exports.etag;
+      break;
+    case 'weak':
+      fn = exports.wetag;
+      break;
+    default:
+      throw new TypeError('unknown value for etag function: ' + val);
+  }
+
+  return fn;
+}
+
+/**
+ * Compile "query parser" value to function.
+ *
+ * @param  {String|Function} val
+ * @return {Function}
+ * @api private
+ */
+
+exports.compileQueryParser = function compileQueryParser(val) {
+  var fn;
+
+  if (typeof val === 'function') {
+    return val;
+  }
+
+  switch (val) {
+    case true:
+      fn = querystring.parse;
+      break;
+    case false:
+      fn = newObject;
+      break;
+    case 'extended':
+      fn = parseExtendedQueryString;
+      break;
+    case 'simple':
+      fn = querystring.parse;
+      break;
+    default:
+      throw new TypeError('unknown value for query parser function: ' + val);
+  }
+
+  return fn;
+}
+
+/**
+ * Compile "proxy trust" value to function.
+ *
+ * @param  {Boolean|String|Number|Array|Function} val
+ * @return {Function}
+ * @api private
+ */
+
+exports.compileTrust = function(val) {
+  if (typeof val === 'function') return val;
+
+  if (val === true) {
+    // Support plain true/false
+    return function(){ return true };
+  }
+
+  if (typeof val === 'number') {
+    // Support trusting hop count
+    return function(a, i){ return i < val };
+  }
+
+  if (typeof val === 'string') {
+    // Support comma-separated values
+    val = val.split(/ *, */);
+  }
+
+  return proxyaddr.compile(val || []);
+}
+
+/**
+ * Set the charset in a given Content-Type string.
+ *
+ * @param {String} type
+ * @param {String} charset
+ * @return {String}
+ * @api private
+ */
+
+exports.setCharset = function setCharset(type, charset) {
+  if (!type || !charset) {
+    return type;
+  }
+
+  // parse type
+  var parsed = contentType.parse(type);
+
+  // set charset
+  parsed.parameters.charset = charset;
+
+  // format type
+  return contentType.format(parsed);
+};
+
+/**
+ * Parse an extended query string with qs.
+ *
+ * @return {Object}
+ * @private
+ */
+
+function parseExtendedQueryString(str) {
+  return qs.parse(str, {
+    allowPrototypes: true
+  });
+}
+
+/**
+ * Return new empty object.
+ *
+ * @return {Object}
+ * @api private
+ */
+
+function newObject() {
+  return {};
+}
diff --git a/wrt/node_modules/express/lib/view.js b/wrt/node_modules/express/lib/view.js
new file mode 100644 (file)
index 0000000..99d5aed
--- /dev/null
@@ -0,0 +1,174 @@
+/*!
+ * express
+ * Copyright(c) 2009-2013 TJ Holowaychuk
+ * Copyright(c) 2013 Roman Shtylman
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict';
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var debug = require('debug')('express:view');
+var path = require('path');
+var fs = require('fs');
+
+/**
+ * Module variables.
+ * @private
+ */
+
+var dirname = path.dirname;
+var basename = path.basename;
+var extname = path.extname;
+var join = path.join;
+var resolve = path.resolve;
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = View;
+
+/**
+ * Initialize a new `View` with the given `name`.
+ *
+ * Options:
+ *
+ *   - `defaultEngine` the default template engine name
+ *   - `engines` template engine require() cache
+ *   - `root` root path for view lookup
+ *
+ * @param {string} name
+ * @param {object} options
+ * @public
+ */
+
+function View(name, options) {
+  var opts = options || {};
+
+  this.defaultEngine = opts.defaultEngine;
+  this.ext = extname(name);
+  this.name = name;
+  this.root = opts.root;
+
+  if (!this.ext && !this.defaultEngine) {
+    throw new Error('No default engine was specified and no extension was provided.');
+  }
+
+  var fileName = name;
+
+  if (!this.ext) {
+    // get extension from default engine name
+    this.ext = this.defaultEngine[0] !== '.'
+      ? '.' + this.defaultEngine
+      : this.defaultEngine;
+
+    fileName += this.ext;
+  }
+
+  if (!opts.engines[this.ext]) {
+    // load engine
+    var mod = this.ext.substr(1)
+    debug('require "%s"', mod)
+    opts.engines[this.ext] = require(mod).__express
+  }
+
+  // store loaded engine
+  this.engine = opts.engines[this.ext];
+
+  // lookup path
+  this.path = this.lookup(fileName);
+}
+
+/**
+ * Lookup view by the given `name`
+ *
+ * @param {string} name
+ * @private
+ */
+
+View.prototype.lookup = function lookup(name) {
+  var path;
+  var roots = [].concat(this.root);
+
+  debug('lookup "%s"', name);
+
+  for (var i = 0; i < roots.length && !path; i++) {
+    var root = roots[i];
+
+    // resolve the path
+    var loc = resolve(root, name);
+    var dir = dirname(loc);
+    var file = basename(loc);
+
+    // resolve the file
+    path = this.resolve(dir, file);
+  }
+
+  return path;
+};
+
+/**
+ * Render with the given options.
+ *
+ * @param {object} options
+ * @param {function} callback
+ * @private
+ */
+
+View.prototype.render = function render(options, callback) {
+  debug('render "%s"', this.path);
+  this.engine(this.path, options, callback);
+};
+
+/**
+ * Resolve the file within the given directory.
+ *
+ * @param {string} dir
+ * @param {string} file
+ * @private
+ */
+
+View.prototype.resolve = function resolve(dir, file) {
+  var ext = this.ext;
+
+  // <path>.<ext>
+  var path = join(dir, file);
+  var stat = tryStat(path);
+
+  if (stat && stat.isFile()) {
+    return path;
+  }
+
+  // <path>/index.<ext>
+  path = join(dir, basename(file, ext), 'index' + ext);
+  stat = tryStat(path);
+
+  if (stat && stat.isFile()) {
+    return path;
+  }
+};
+
+/**
+ * Return a stat, maybe.
+ *
+ * @param {string} path
+ * @return {fs.Stats}
+ * @private
+ */
+
+function tryStat(path) {
+  debug('stat "%s"', path);
+
+  try {
+    return fs.statSync(path);
+  } catch (e) {
+    return undefined;
+  }
+}
diff --git a/wrt/node_modules/express/node_modules/debug/.coveralls.yml b/wrt/node_modules/express/node_modules/debug/.coveralls.yml
new file mode 100644 (file)
index 0000000..20a7068
--- /dev/null
@@ -0,0 +1 @@
+repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve
diff --git a/wrt/node_modules/express/node_modules/debug/.eslintrc b/wrt/node_modules/express/node_modules/debug/.eslintrc
new file mode 100644 (file)
index 0000000..8a37ae2
--- /dev/null
@@ -0,0 +1,11 @@
+{
+  "env": {
+    "browser": true,
+    "node": true
+  },
+  "rules": {
+    "no-console": 0,
+    "no-empty": [1, { "allowEmptyCatch": true }]
+  },
+  "extends": "eslint:recommended"
+}
diff --git a/wrt/node_modules/express/node_modules/debug/.npmignore b/wrt/node_modules/express/node_modules/debug/.npmignore
new file mode 100644 (file)
index 0000000..5f60eec
--- /dev/null
@@ -0,0 +1,9 @@
+support
+test
+examples
+example
+*.sock
+dist
+yarn.lock
+coverage
+bower.json
diff --git a/wrt/node_modules/express/node_modules/debug/.travis.yml b/wrt/node_modules/express/node_modules/debug/.travis.yml
new file mode 100644 (file)
index 0000000..6c6090c
--- /dev/null
@@ -0,0 +1,14 @@
+
+language: node_js
+node_js:
+  - "6"
+  - "5"
+  - "4"
+
+install:
+  - make node_modules
+
+script:
+  - make lint
+  - make test
+  - make coveralls
diff --git a/wrt/node_modules/express/node_modules/debug/CHANGELOG.md b/wrt/node_modules/express/node_modules/debug/CHANGELOG.md
new file mode 100644 (file)
index 0000000..a1a270c
--- /dev/null
@@ -0,0 +1,357 @@
+
+2.6.8 / 2017-05-18
+==================
+
+  * Fix: Check for undefined on browser globals (#462, @marbemac)
+
+2.6.7 / 2017-05-16
+==================
+
+  * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom)
+  * Fix: Inline extend function in node implementation (#452, @dougwilson)
+  * Docs: Fix typo (#455, @msasad)
+
+2.6.5 / 2017-04-27
+==================
+  
+  * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek)
+  * Misc: clean up browser reference checks (#447, @thebigredgeek)
+  * Misc: add npm-debug.log to .gitignore (@thebigredgeek)
+
+
+2.6.4 / 2017-04-20
+==================
+
+  * Fix: bug that would occure if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo)
+  * Chore: ignore bower.json in npm installations. (#437, @joaovieira)
+  * Misc: update "ms" to v0.7.3 (@tootallnate)
+
+2.6.3 / 2017-03-13
+==================
+
+  * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts)
+  * Docs: Changelog fix (@thebigredgeek)
+
+2.6.2 / 2017-03-10
+==================
+
+  * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin)
+  * Docs: Add backers and sponsors from Open Collective (#422, @piamancini)
+  * Docs: Add Slackin invite badge (@tootallnate)
+
+2.6.1 / 2017-02-10
+==================
+
+  * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error
+  * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0)
+  * Fix: IE8 "Expected identifier" error (#414, @vgoma)
+  * Fix: Namespaces would not disable once enabled (#409, @musikov)
+
+2.6.0 / 2016-12-28
+==================
+
+  * Fix: added better null pointer checks for browser useColors (@thebigredgeek)
+  * Improvement: removed explicit `window.debug` export (#404, @tootallnate)
+  * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate)
+
+2.5.2 / 2016-12-25
+==================
+
+  * Fix: reference error on window within webworkers (#393, @KlausTrainer)
+  * Docs: fixed README typo (#391, @lurch)
+  * Docs: added notice about v3 api discussion (@thebigredgeek)
+
+2.5.1 / 2016-12-20
+==================
+
+  * Fix: babel-core compatibility
+
+2.5.0 / 2016-12-20
+==================
+
+  * Fix: wrong reference in bower file (@thebigredgeek)
+  * Fix: webworker compatibility (@thebigredgeek)
+  * Fix: output formatting issue (#388, @kribblo)
+  * Fix: babel-loader compatibility (#383, @escwald)
+  * Misc: removed built asset from repo and publications (@thebigredgeek)
+  * Misc: moved source files to /src (#378, @yamikuronue)
+  * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue)
+  * Test: coveralls integration (#378, @yamikuronue)
+  * Docs: simplified language in the opening paragraph (#373, @yamikuronue)
+
+2.4.5 / 2016-12-17
+==================
+
+  * Fix: `navigator` undefined in Rhino (#376, @jochenberger)
+  * Fix: custom log function (#379, @hsiliev)
+  * Improvement: bit of cleanup + linting fixes (@thebigredgeek)
+  * Improvement: rm non-maintainted `dist/` dir (#375, @freewil)
+  * Docs: simplified language in the opening paragraph. (#373, @yamikuronue)
+
+2.4.4 / 2016-12-14
+==================
+
+  * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts)
+
+2.4.3 / 2016-12-14
+==================
+
+  * Fix: navigation.userAgent error for react native (#364, @escwald)
+
+2.4.2 / 2016-12-14
+==================
+
+  * Fix: browser colors (#367, @tootallnate)
+  * Misc: travis ci integration (@thebigredgeek)
+  * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek)
+
+2.4.1 / 2016-12-13
+==================
+
+  * Fix: typo that broke the package (#356)
+
+2.4.0 / 2016-12-13
+==================
+
+  * Fix: bower.json references unbuilt src entry point (#342, @justmatt)
+  * Fix: revert "handle regex special characters" (@tootallnate)
+  * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate)
+  * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate)
+  * Improvement: allow colors in workers (#335, @botverse)
+  * Improvement: use same color for same namespace. (#338, @lchenay)
+
+2.3.3 / 2016-11-09
+==================
+
+  * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne)
+  * Fix: Returning `localStorage` saved values (#331, Levi Thomason)
+  * Improvement: Don't create an empty object when no `process` (Nathan Rajlich)
+
+2.3.2 / 2016-11-09
+==================
+
+  * Fix: be super-safe in index.js as well (@TooTallNate)
+  * Fix: should check whether process exists (Tom Newby)
+
+2.3.1 / 2016-11-09
+==================
+
+  * Fix: Added electron compatibility (#324, @paulcbetts)
+  * Improvement: Added performance optimizations (@tootallnate)
+  * Readme: Corrected PowerShell environment variable example (#252, @gimre)
+  * Misc: Removed yarn lock file from source control (#321, @fengmk2)
+
+2.3.0 / 2016-11-07
+==================
+
+  * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic)
+  * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos)
+  * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15)
+  * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran)
+  * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom)
+  * Package: Update "ms" to 0.7.2 (#315, @DevSide)
+  * Package: removed superfluous version property from bower.json (#207 @kkirsche)
+  * Readme: fix USE_COLORS to DEBUG_COLORS
+  * Readme: Doc fixes for format string sugar (#269, @mlucool)
+  * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0)
+  * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable)
+  * Readme: better docs for browser support (#224, @matthewmueller)
+  * Tooling: Added yarn integration for development (#317, @thebigredgeek)
+  * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek)
+  * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman)
+  * Misc: Updated contributors (@thebigredgeek)
+
+2.2.0 / 2015-05-09
+==================
+
+  * package: update "ms" to v0.7.1 (#202, @dougwilson)
+  * README: add logging to file example (#193, @DanielOchoa)
+  * README: fixed a typo (#191, @amir-s)
+  * browser: expose `storage` (#190, @stephenmathieson)
+  * Makefile: add a `distclean` target (#189, @stephenmathieson)
+
+2.1.3 / 2015-03-13
+==================
+
+  * Updated stdout/stderr example (#186)
+  * Updated example/stdout.js to match debug current behaviour
+  * Renamed example/stderr.js to stdout.js
+  * Update Readme.md (#184)
+  * replace high intensity foreground color for bold (#182, #183)
+
+2.1.2 / 2015-03-01
+==================
+
+  * dist: recompile
+  * update "ms" to v0.7.0
+  * package: update "browserify" to v9.0.3
+  * component: fix "ms.js" repo location
+  * changed bower package name
+  * updated documentation about using debug in a browser
+  * fix: security error on safari (#167, #168, @yields)
+
+2.1.1 / 2014-12-29
+==================
+
+  * browser: use `typeof` to check for `console` existence
+  * browser: check for `console.log` truthiness (fix IE 8/9)
+  * browser: add support for Chrome apps
+  * Readme: added Windows usage remarks
+  * Add `bower.json` to properly support bower install
+
+2.1.0 / 2014-10-15
+==================
+
+  * node: implement `DEBUG_FD` env variable support
+  * package: update "browserify" to v6.1.0
+  * package: add "license" field to package.json (#135, @panuhorsmalahti)
+
+2.0.0 / 2014-09-01
+==================
+
+  * package: update "browserify" to v5.11.0
+  * node: use stderr rather than stdout for logging (#29, @stephenmathieson)
+
+1.0.4 / 2014-07-15
+==================
+
+  * dist: recompile
+  * example: remove `console.info()` log usage
+  * example: add "Content-Type" UTF-8 header to browser example
+  * browser: place %c marker after the space character
+  * browser: reset the "content" color via `color: inherit`
+  * browser: add colors support for Firefox >= v31
+  * debug: prefer an instance `log()` function over the global one (#119)
+  * Readme: update documentation about styled console logs for FF v31 (#116, @wryk)
+
+1.0.3 / 2014-07-09
+==================
+
+  * Add support for multiple wildcards in namespaces (#122, @seegno)
+  * browser: fix lint
+
+1.0.2 / 2014-06-10
+==================
+
+  * browser: update color palette (#113, @gscottolson)
+  * common: make console logging function configurable (#108, @timoxley)
+  * node: fix %o colors on old node <= 0.8.x
+  * Makefile: find node path using shell/which (#109, @timoxley)
+
+1.0.1 / 2014-06-06
+==================
+
+  * browser: use `removeItem()` to clear localStorage
+  * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777)
+  * package: add "contributors" section
+  * node: fix comment typo
+  * README: list authors
+
+1.0.0 / 2014-06-04
+==================
+
+  * make ms diff be global, not be scope
+  * debug: ignore empty strings in enable()
+  * node: make DEBUG_COLORS able to disable coloring
+  * *: export the `colors` array
+  * npmignore: don't publish the `dist` dir
+  * Makefile: refactor to use browserify
+  * package: add "browserify" as a dev dependency
+  * Readme: add Web Inspector Colors section
+  * node: reset terminal color for the debug content
+  * node: map "%o" to `util.inspect()`
+  * browser: map "%j" to `JSON.stringify()`
+  * debug: add custom "formatters"
+  * debug: use "ms" module for humanizing the diff
+  * Readme: add "bash" syntax highlighting
+  * browser: add Firebug color support
+  * browser: add colors for WebKit browsers
+  * node: apply log to `console`
+  * rewrite: abstract common logic for Node & browsers
+  * add .jshintrc file
+
+0.8.1 / 2014-04-14
+==================
+
+  * package: re-add the "component" section
+
+0.8.0 / 2014-03-30
+==================
+
+  * add `enable()` method for nodejs. Closes #27
+  * change from stderr to stdout
+  * remove unnecessary index.js file
+
+0.7.4 / 2013-11-13
+==================
+
+  * remove "browserify" key from package.json (fixes something in browserify)
+
+0.7.3 / 2013-10-30
+==================
+
+  * fix: catch localStorage security error when cookies are blocked (Chrome)
+  * add debug(err) support. Closes #46
+  * add .browser prop to package.json. Closes #42
+
+0.7.2 / 2013-02-06
+==================
+
+  * fix package.json
+  * fix: Mobile Safari (private mode) is broken with debug
+  * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript
+
+0.7.1 / 2013-02-05
+==================
+
+  * add repository URL to package.json
+  * add DEBUG_COLORED to force colored output
+  * add browserify support
+  * fix component. Closes #24
+
+0.7.0 / 2012-05-04
+==================
+
+  * Added .component to package.json
+  * Added debug.component.js build
+
+0.6.0 / 2012-03-16
+==================
+
+  * Added support for "-" prefix in DEBUG [Vinay Pulim]
+  * Added `.enabled` flag to the node version [TooTallNate]
+
+0.5.0 / 2012-02-02
+==================
+
+  * Added: humanize diffs. Closes #8
+  * Added `debug.disable()` to the CS variant
+  * Removed padding. Closes #10
+  * Fixed: persist client-side variant again. Closes #9
+
+0.4.0 / 2012-02-01
+==================
+
+  * Added browser variant support for older browsers [TooTallNate]
+  * Added `debug.enable('project:*')` to browser variant [TooTallNate]
+  * Added padding to diff (moved it to the right)
+
+0.3.0 / 2012-01-26
+==================
+
+  * Added millisecond diff when isatty, otherwise UTC string
+
+0.2.0 / 2012-01-22
+==================
+
+  * Added wildcard support
+
+0.1.0 / 2011-12-02
+==================
+
+  * Added: remove colors unless stderr isatty [TooTallNate]
+
+0.0.1 / 2010-01-03
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/express/node_modules/debug/LICENSE b/wrt/node_modules/express/node_modules/debug/LICENSE
new file mode 100644 (file)
index 0000000..658c933
--- /dev/null
@@ -0,0 +1,19 @@
+(The MIT License)
+
+Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software 
+and associated documentation files (the 'Software'), to deal in the Software without restriction, 
+including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial 
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 
+LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/wrt/node_modules/express/node_modules/debug/Makefile b/wrt/node_modules/express/node_modules/debug/Makefile
new file mode 100644 (file)
index 0000000..584da8b
--- /dev/null
@@ -0,0 +1,50 @@
+# get Makefile directory name: http://stackoverflow.com/a/5982798/376773
+THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
+THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)
+
+# BIN directory
+BIN := $(THIS_DIR)/node_modules/.bin
+
+# Path
+PATH := node_modules/.bin:$(PATH)
+SHELL := /bin/bash
+
+# applications
+NODE ?= $(shell which node)
+YARN ?= $(shell which yarn)
+PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm))
+BROWSERIFY ?= $(NODE) $(BIN)/browserify
+
+.FORCE:
+
+install: node_modules
+
+node_modules: package.json
+       @NODE_ENV= $(PKG) install
+       @touch node_modules
+
+lint: .FORCE
+       eslint browser.js debug.js index.js node.js
+
+test-node: .FORCE
+       istanbul cover node_modules/mocha/bin/_mocha -- test/**.js
+
+test-browser: .FORCE
+       mkdir -p dist
+
+       @$(BROWSERIFY) \
+               --standalone debug \
+               . > dist/debug.js
+
+       karma start --single-run
+       rimraf dist
+
+test: .FORCE
+       concurrently \
+               "make test-node" \
+               "make test-browser"
+
+coveralls:
+       cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
+
+.PHONY: all install clean distclean
diff --git a/wrt/node_modules/express/node_modules/debug/README.md b/wrt/node_modules/express/node_modules/debug/README.md
new file mode 100644 (file)
index 0000000..f67be6b
--- /dev/null
@@ -0,0 +1,312 @@
+# debug
+[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug)  [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master)  [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) 
+[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors)
+
+
+
+A tiny node.js debugging utility modelled after node core's debugging technique.
+
+**Discussion around the V3 API is under way [here](https://github.com/visionmedia/debug/issues/370)**
+
+## Installation
+
+```bash
+$ npm install debug
+```
+
+## Usage
+
+`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole.
+
+Example _app.js_:
+
+```js
+var debug = require('debug')('http')
+  , http = require('http')
+  , name = 'My App';
+
+// fake app
+
+debug('booting %s', name);
+
+http.createServer(function(req, res){
+  debug(req.method + ' ' + req.url);
+  res.end('hello\n');
+}).listen(3000, function(){
+  debug('listening');
+});
+
+// fake worker of some kind
+
+require('./worker');
+```
+
+Example _worker.js_:
+
+```js
+var debug = require('debug')('worker');
+
+setInterval(function(){
+  debug('doing some work');
+}, 1000);
+```
+
+ The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:
+
+  ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png)
+
+  ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png)
+
+#### Windows note
+
+ On Windows the environment variable is set using the `set` command.
+
+ ```cmd
+ set DEBUG=*,-not_this
+ ```
+
+ Note that PowerShell uses different syntax to set environment variables.
+
+ ```cmd
+ $env:DEBUG = "*,-not_this"
+  ```
+
+Then, run the program to be debugged as usual.
+
+## Millisecond diff
+
+  When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.
+
+  ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png)
+
+  When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:
+
+  ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png)
+
+## Conventions
+
+  If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser".
+
+## Wildcards
+
+  The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.
+
+  You can also exclude specific debuggers by prefixing them with a "-" character.  For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:".
+
+## Environment Variables
+
+  When running through Node.js, you can set a few environment variables that will
+  change the behavior of the debug logging:
+
+| Name      | Purpose                                         |
+|-----------|-------------------------------------------------|
+| `DEBUG`   | Enables/disables specific debugging namespaces. |
+| `DEBUG_COLORS`| Whether or not to use colors in the debug output. |
+| `DEBUG_DEPTH` | Object inspection depth. |
+| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. |
+
+
+  __Note:__ The environment variables beginning with `DEBUG_` end up being
+  converted into an Options object that gets used with `%o`/`%O` formatters.
+  See the Node.js documentation for
+  [`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options)
+  for the complete list.
+
+## Formatters
+
+
+  Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. Below are the officially supported formatters:
+
+| Formatter | Representation |
+|-----------|----------------|
+| `%O`      | Pretty-print an Object on multiple lines. |
+| `%o`      | Pretty-print an Object all on a single line. |
+| `%s`      | String. |
+| `%d`      | Number (both integer and float). |
+| `%j`      | JSON. Replaced with the string '[Circular]' if the argument contains circular references. |
+| `%%`      | Single percent sign ('%'). This does not consume an argument. |
+
+### Custom formatters
+
+  You can add custom formatters by extending the `debug.formatters` object. For example, if you wanted to add support for rendering a Buffer as hex with `%h`, you could do something like:
+
+```js
+const createDebug = require('debug')
+createDebug.formatters.h = (v) => {
+  return v.toString('hex')
+}
+
+// …elsewhere
+const debug = createDebug('foo')
+debug('this is hex: %h', new Buffer('hello world'))
+//   foo this is hex: 68656c6c6f20776f726c6421 +0ms
+```
+
+## Browser support
+  You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify),
+  or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest),
+  if you don't want to build it yourself.
+
+  Debug's enable state is currently persisted by `localStorage`.
+  Consider the situation shown below where you have `worker:a` and `worker:b`,
+  and wish to debug both. You can enable this using `localStorage.debug`:
+
+```js
+localStorage.debug = 'worker:*'
+```
+
+And then refresh the page.
+
+```js
+a = debug('worker:a');
+b = debug('worker:b');
+
+setInterval(function(){
+  a('doing some work');
+}, 1000);
+
+setInterval(function(){
+  b('doing some work');
+}, 1200);
+```
+
+#### Web Inspector Colors
+
+  Colors are also enabled on "Web Inspectors" that understand the `%c` formatting
+  option. These are WebKit web inspectors, Firefox ([since version
+  31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))
+  and the Firebug plugin for Firefox (any version).
+
+  Colored output looks something like:
+
+  ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png)
+
+
+## Output streams
+
+  By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method:
+
+Example _stdout.js_:
+
+```js
+var debug = require('debug');
+var error = debug('app:error');
+
+// by default stderr is used
+error('goes to stderr!');
+
+var log = debug('app:log');
+// set this namespace to log via console.log
+log.log = console.log.bind(console); // don't forget to bind to console!
+log('goes to stdout');
+error('still goes to stderr!');
+
+// set all output to go via console.info
+// overrides all per-namespace log settings
+debug.log = console.info.bind(console);
+error('now goes to stdout via console.info');
+log('still goes to stdout, but via console.info now');
+```
+
+
+## Authors
+
+ - TJ Holowaychuk
+ - Nathan Rajlich
+ - Andrew Rhyne
+## Backers
+
+Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)]
+
+<a href="https://opencollective.com/debug/backer/0/website" target="_blank"><img src="https://opencollective.com/debug/backer/0/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/1/website" target="_blank"><img src="https://opencollective.com/debug/backer/1/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/2/website" target="_blank"><img src="https://opencollective.com/debug/backer/2/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/3/website" target="_blank"><img src="https://opencollective.com/debug/backer/3/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/4/website" target="_blank"><img src="https://opencollective.com/debug/backer/4/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/5/website" target="_blank"><img src="https://opencollective.com/debug/backer/5/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/6/website" target="_blank"><img src="https://opencollective.com/debug/backer/6/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/7/website" target="_blank"><img src="https://opencollective.com/debug/backer/7/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/8/website" target="_blank"><img src="https://opencollective.com/debug/backer/8/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/9/website" target="_blank"><img src="https://opencollective.com/debug/backer/9/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/10/website" target="_blank"><img src="https://opencollective.com/debug/backer/10/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/11/website" target="_blank"><img src="https://opencollective.com/debug/backer/11/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/12/website" target="_blank"><img src="https://opencollective.com/debug/backer/12/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/13/website" target="_blank"><img src="https://opencollective.com/debug/backer/13/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/14/website" target="_blank"><img src="https://opencollective.com/debug/backer/14/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/15/website" target="_blank"><img src="https://opencollective.com/debug/backer/15/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/16/website" target="_blank"><img src="https://opencollective.com/debug/backer/16/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/17/website" target="_blank"><img src="https://opencollective.com/debug/backer/17/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/18/website" target="_blank"><img src="https://opencollective.com/debug/backer/18/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/19/website" target="_blank"><img src="https://opencollective.com/debug/backer/19/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/20/website" target="_blank"><img src="https://opencollective.com/debug/backer/20/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/21/website" target="_blank"><img src="https://opencollective.com/debug/backer/21/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/22/website" target="_blank"><img src="https://opencollective.com/debug/backer/22/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/23/website" target="_blank"><img src="https://opencollective.com/debug/backer/23/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/24/website" target="_blank"><img src="https://opencollective.com/debug/backer/24/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/25/website" target="_blank"><img src="https://opencollective.com/debug/backer/25/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/26/website" target="_blank"><img src="https://opencollective.com/debug/backer/26/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/27/website" target="_blank"><img src="https://opencollective.com/debug/backer/27/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/28/website" target="_blank"><img src="https://opencollective.com/debug/backer/28/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/29/website" target="_blank"><img src="https://opencollective.com/debug/backer/29/avatar.svg"></a>
+
+
+## Sponsors
+
+Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)]
+
+<a href="https://opencollective.com/debug/sponsor/0/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/0/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/1/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/1/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/2/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/2/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/3/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/3/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/4/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/4/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/5/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/5/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/6/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/6/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/7/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/7/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/8/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/8/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/9/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/9/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/10/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/10/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/11/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/11/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/12/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/12/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/13/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/13/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/14/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/14/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/15/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/15/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/16/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/16/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/17/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/17/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/18/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/18/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/19/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/19/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/20/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/20/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/21/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/21/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/22/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/22/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/23/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/23/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/24/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/24/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/25/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/25/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/26/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/26/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/27/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/27/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/28/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/28/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/29/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/29/avatar.svg"></a>
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2014-2016 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/express/node_modules/debug/component.json b/wrt/node_modules/express/node_modules/debug/component.json
new file mode 100644 (file)
index 0000000..94cd36d
--- /dev/null
@@ -0,0 +1,19 @@
+{
+  "name": "debug",
+  "repo": "visionmedia/debug",
+  "description": "small debugging utility",
+  "version": "2.6.8",
+  "keywords": [
+    "debug",
+    "log",
+    "debugger"
+  ],
+  "main": "src/browser.js",
+  "scripts": [
+    "src/browser.js",
+    "src/debug.js"
+  ],
+  "dependencies": {
+    "rauchg/ms.js": "0.7.1"
+  }
+}
diff --git a/wrt/node_modules/express/node_modules/debug/karma.conf.js b/wrt/node_modules/express/node_modules/debug/karma.conf.js
new file mode 100644 (file)
index 0000000..103a82d
--- /dev/null
@@ -0,0 +1,70 @@
+// Karma configuration
+// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC)
+
+module.exports = function(config) {
+  config.set({
+
+    // base path that will be used to resolve all patterns (eg. files, exclude)
+    basePath: '',
+
+
+    // frameworks to use
+    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
+    frameworks: ['mocha', 'chai', 'sinon'],
+
+
+    // list of files / patterns to load in the browser
+    files: [
+      'dist/debug.js',
+      'test/*spec.js'
+    ],
+
+
+    // list of files to exclude
+    exclude: [
+      'src/node.js'
+    ],
+
+
+    // preprocess matching files before serving them to the browser
+    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
+    preprocessors: {
+    },
+
+    // test results reporter to use
+    // possible values: 'dots', 'progress'
+    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
+    reporters: ['progress'],
+
+
+    // web server port
+    port: 9876,
+
+
+    // enable / disable colors in the output (reporters and logs)
+    colors: true,
+
+
+    // level of logging
+    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
+    logLevel: config.LOG_INFO,
+
+
+    // enable / disable watching file and executing tests whenever any file changes
+    autoWatch: true,
+
+
+    // start these browsers
+    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
+    browsers: ['PhantomJS'],
+
+
+    // Continuous Integration mode
+    // if true, Karma captures browsers, runs the tests and exits
+    singleRun: false,
+
+    // Concurrency level
+    // how many browser should be started simultaneous
+    concurrency: Infinity
+  })
+}
diff --git a/wrt/node_modules/express/node_modules/debug/node.js b/wrt/node_modules/express/node_modules/debug/node.js
new file mode 100644 (file)
index 0000000..7fc36fe
--- /dev/null
@@ -0,0 +1 @@
+module.exports = require('./src/node');
diff --git a/wrt/node_modules/express/node_modules/debug/package.json b/wrt/node_modules/express/node_modules/debug/package.json
new file mode 100644 (file)
index 0000000..8e4485b
--- /dev/null
@@ -0,0 +1,124 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "debug@2.6.8",
+        "scope": null,
+        "escapedName": "debug",
+        "name": "debug",
+        "rawSpec": "2.6.8",
+        "spec": "2.6.8",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express"
+    ]
+  ],
+  "_from": "debug@2.6.8",
+  "_id": "debug@2.6.8",
+  "_inCache": true,
+  "_location": "/express/debug",
+  "_nodeVersion": "7.10.0",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/debug-2.6.8.tgz_1495138020906_0.5965513256378472"
+  },
+  "_npmUser": {
+    "name": "tootallnate",
+    "email": "nathan@tootallnate.net"
+  },
+  "_npmVersion": "4.2.0",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "debug@2.6.8",
+    "scope": null,
+    "escapedName": "debug",
+    "name": "debug",
+    "rawSpec": "2.6.8",
+    "spec": "2.6.8",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/express"
+  ],
+  "_resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz",
+  "_shasum": "e731531ca2ede27d188222427da17821d68ff4fc",
+  "_shrinkwrap": null,
+  "_spec": "debug@2.6.8",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express",
+  "author": {
+    "name": "TJ Holowaychuk",
+    "email": "tj@vision-media.ca"
+  },
+  "browser": "./src/browser.js",
+  "bugs": {
+    "url": "https://github.com/visionmedia/debug/issues"
+  },
+  "component": {
+    "scripts": {
+      "debug/index.js": "browser.js",
+      "debug/debug.js": "debug.js"
+    }
+  },
+  "contributors": [
+    {
+      "name": "Nathan Rajlich",
+      "email": "nathan@tootallnate.net",
+      "url": "http://n8.io"
+    },
+    {
+      "name": "Andrew Rhyne",
+      "email": "rhyneandrew@gmail.com"
+    }
+  ],
+  "dependencies": {
+    "ms": "2.0.0"
+  },
+  "description": "small debugging utility",
+  "devDependencies": {
+    "browserify": "9.0.3",
+    "chai": "^3.5.0",
+    "concurrently": "^3.1.0",
+    "coveralls": "^2.11.15",
+    "eslint": "^3.12.1",
+    "istanbul": "^0.4.5",
+    "karma": "^1.3.0",
+    "karma-chai": "^0.1.0",
+    "karma-mocha": "^1.3.0",
+    "karma-phantomjs-launcher": "^1.0.2",
+    "karma-sinon": "^1.0.5",
+    "mocha": "^3.2.0",
+    "mocha-lcov-reporter": "^1.2.0",
+    "rimraf": "^2.5.4",
+    "sinon": "^1.17.6",
+    "sinon-chai": "^2.8.0"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "e731531ca2ede27d188222427da17821d68ff4fc",
+    "tarball": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz"
+  },
+  "gitHead": "52e1f21284322f167839e5d3a60f635c8b2dc842",
+  "homepage": "https://github.com/visionmedia/debug#readme",
+  "keywords": [
+    "debug",
+    "log",
+    "debugger"
+  ],
+  "license": "MIT",
+  "main": "./src/index.js",
+  "maintainers": [
+    {
+      "name": "thebigredgeek",
+      "email": "rhyneandrew@gmail.com"
+    }
+  ],
+  "name": "debug",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/visionmedia/debug.git"
+  },
+  "scripts": {},
+  "version": "2.6.8"
+}
diff --git a/wrt/node_modules/express/node_modules/debug/src/browser.js b/wrt/node_modules/express/node_modules/debug/src/browser.js
new file mode 100644 (file)
index 0000000..7106924
--- /dev/null
@@ -0,0 +1,185 @@
+/**
+ * This is the web browser implementation of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = require('./debug');
+exports.log = log;
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+exports.storage = 'undefined' != typeof chrome
+               && 'undefined' != typeof chrome.storage
+                  ? chrome.storage.local
+                  : localstorage();
+
+/**
+ * Colors.
+ */
+
+exports.colors = [
+  'lightseagreen',
+  'forestgreen',
+  'goldenrod',
+  'dodgerblue',
+  'darkorchid',
+  'crimson'
+];
+
+/**
+ * Currently only WebKit-based Web Inspectors, Firefox >= v31,
+ * and the Firebug extension (any Firefox version) are known
+ * to support "%c" CSS customizations.
+ *
+ * TODO: add a `localStorage` variable to explicitly enable/disable colors
+ */
+
+function useColors() {
+  // NB: In an Electron preload script, document will be defined but not fully
+  // initialized. Since we know we're in Chrome, we'll just detect this case
+  // explicitly
+  if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
+    return true;
+  }
+
+  // is webkit? http://stackoverflow.com/a/16459606/376773
+  // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
+  return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
+    // is firebug? http://stackoverflow.com/a/398120/376773
+    (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
+    // is firefox >= v31?
+    // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
+    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
+    // double check webkit in userAgent just in case we are in a worker
+    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
+}
+
+/**
+ * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
+ */
+
+exports.formatters.j = function(v) {
+  try {
+    return JSON.stringify(v);
+  } catch (err) {
+    return '[UnexpectedJSONParseError]: ' + err.message;
+  }
+};
+
+
+/**
+ * Colorize log arguments if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+  var useColors = this.useColors;
+
+  args[0] = (useColors ? '%c' : '')
+    + this.namespace
+    + (useColors ? ' %c' : ' ')
+    + args[0]
+    + (useColors ? '%c ' : ' ')
+    + '+' + exports.humanize(this.diff);
+
+  if (!useColors) return;
+
+  var c = 'color: ' + this.color;
+  args.splice(1, 0, c, 'color: inherit')
+
+  // the final "%c" is somewhat tricky, because there could be other
+  // arguments passed either before or after the %c, so we need to
+  // figure out the correct index to insert the CSS into
+  var index = 0;
+  var lastC = 0;
+  args[0].replace(/%[a-zA-Z%]/g, function(match) {
+    if ('%%' === match) return;
+    index++;
+    if ('%c' === match) {
+      // we only are interested in the *last* %c
+      // (the user may have provided their own)
+      lastC = index;
+    }
+  });
+
+  args.splice(lastC, 0, c);
+}
+
+/**
+ * Invokes `console.log()` when available.
+ * No-op when `console.log` is not a "function".
+ *
+ * @api public
+ */
+
+function log() {
+  // this hackery is required for IE8/9, where
+  // the `console.log` function doesn't have 'apply'
+  return 'object' === typeof console
+    && console.log
+    && Function.prototype.apply.call(console.log, console, arguments);
+}
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+
+function save(namespaces) {
+  try {
+    if (null == namespaces) {
+      exports.storage.removeItem('debug');
+    } else {
+      exports.storage.debug = namespaces;
+    }
+  } catch(e) {}
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+
+function load() {
+  var r;
+  try {
+    r = exports.storage.debug;
+  } catch(e) {}
+
+  // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
+  if (!r && typeof process !== 'undefined' && 'env' in process) {
+    r = process.env.DEBUG;
+  }
+
+  return r;
+}
+
+/**
+ * Enable namespaces listed in `localStorage.debug` initially.
+ */
+
+exports.enable(load());
+
+/**
+ * Localstorage attempts to return the localstorage.
+ *
+ * This is necessary because safari throws
+ * when a user disables cookies/localstorage
+ * and you attempt to access it.
+ *
+ * @return {LocalStorage}
+ * @api private
+ */
+
+function localstorage() {
+  try {
+    return window.localStorage;
+  } catch (e) {}
+}
diff --git a/wrt/node_modules/express/node_modules/debug/src/debug.js b/wrt/node_modules/express/node_modules/debug/src/debug.js
new file mode 100644 (file)
index 0000000..6a5e3fc
--- /dev/null
@@ -0,0 +1,202 @@
+
+/**
+ * This is the common logic for both the Node.js and web browser
+ * implementations of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
+exports.coerce = coerce;
+exports.disable = disable;
+exports.enable = enable;
+exports.enabled = enabled;
+exports.humanize = require('ms');
+
+/**
+ * The currently active debug mode names, and names to skip.
+ */
+
+exports.names = [];
+exports.skips = [];
+
+/**
+ * Map of special "%n" handling functions, for the debug "format" argument.
+ *
+ * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
+ */
+
+exports.formatters = {};
+
+/**
+ * Previous log timestamp.
+ */
+
+var prevTime;
+
+/**
+ * Select a color.
+ * @param {String} namespace
+ * @return {Number}
+ * @api private
+ */
+
+function selectColor(namespace) {
+  var hash = 0, i;
+
+  for (i in namespace) {
+    hash  = ((hash << 5) - hash) + namespace.charCodeAt(i);
+    hash |= 0; // Convert to 32bit integer
+  }
+
+  return exports.colors[Math.abs(hash) % exports.colors.length];
+}
+
+/**
+ * Create a debugger with the given `namespace`.
+ *
+ * @param {String} namespace
+ * @return {Function}
+ * @api public
+ */
+
+function createDebug(namespace) {
+
+  function debug() {
+    // disabled?
+    if (!debug.enabled) return;
+
+    var self = debug;
+
+    // set `diff` timestamp
+    var curr = +new Date();
+    var ms = curr - (prevTime || curr);
+    self.diff = ms;
+    self.prev = prevTime;
+    self.curr = curr;
+    prevTime = curr;
+
+    // turn the `arguments` into a proper Array
+    var args = new Array(arguments.length);
+    for (var i = 0; i < args.length; i++) {
+      args[i] = arguments[i];
+    }
+
+    args[0] = exports.coerce(args[0]);
+
+    if ('string' !== typeof args[0]) {
+      // anything else let's inspect with %O
+      args.unshift('%O');
+    }
+
+    // apply any `formatters` transformations
+    var index = 0;
+    args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
+      // if we encounter an escaped % then don't increase the array index
+      if (match === '%%') return match;
+      index++;
+      var formatter = exports.formatters[format];
+      if ('function' === typeof formatter) {
+        var val = args[index];
+        match = formatter.call(self, val);
+
+        // now we need to remove `args[index]` since it's inlined in the `format`
+        args.splice(index, 1);
+        index--;
+      }
+      return match;
+    });
+
+    // apply env-specific formatting (colors, etc.)
+    exports.formatArgs.call(self, args);
+
+    var logFn = debug.log || exports.log || console.log.bind(console);
+    logFn.apply(self, args);
+  }
+
+  debug.namespace = namespace;
+  debug.enabled = exports.enabled(namespace);
+  debug.useColors = exports.useColors();
+  debug.color = selectColor(namespace);
+
+  // env-specific initialization logic for debug instances
+  if ('function' === typeof exports.init) {
+    exports.init(debug);
+  }
+
+  return debug;
+}
+
+/**
+ * Enables a debug mode by namespaces. This can include modes
+ * separated by a colon and wildcards.
+ *
+ * @param {String} namespaces
+ * @api public
+ */
+
+function enable(namespaces) {
+  exports.save(namespaces);
+
+  exports.names = [];
+  exports.skips = [];
+
+  var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
+  var len = split.length;
+
+  for (var i = 0; i < len; i++) {
+    if (!split[i]) continue; // ignore empty strings
+    namespaces = split[i].replace(/\*/g, '.*?');
+    if (namespaces[0] === '-') {
+      exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
+    } else {
+      exports.names.push(new RegExp('^' + namespaces + '$'));
+    }
+  }
+}
+
+/**
+ * Disable debug output.
+ *
+ * @api public
+ */
+
+function disable() {
+  exports.enable('');
+}
+
+/**
+ * Returns true if the given mode name is enabled, false otherwise.
+ *
+ * @param {String} name
+ * @return {Boolean}
+ * @api public
+ */
+
+function enabled(name) {
+  var i, len;
+  for (i = 0, len = exports.skips.length; i < len; i++) {
+    if (exports.skips[i].test(name)) {
+      return false;
+    }
+  }
+  for (i = 0, len = exports.names.length; i < len; i++) {
+    if (exports.names[i].test(name)) {
+      return true;
+    }
+  }
+  return false;
+}
+
+/**
+ * Coerce `val`.
+ *
+ * @param {Mixed} val
+ * @return {Mixed}
+ * @api private
+ */
+
+function coerce(val) {
+  if (val instanceof Error) return val.stack || val.message;
+  return val;
+}
diff --git a/wrt/node_modules/express/node_modules/debug/src/index.js b/wrt/node_modules/express/node_modules/debug/src/index.js
new file mode 100644 (file)
index 0000000..e12cf4d
--- /dev/null
@@ -0,0 +1,10 @@
+/**
+ * Detect Electron renderer process, which is node, but we should
+ * treat as a browser.
+ */
+
+if (typeof process !== 'undefined' && process.type === 'renderer') {
+  module.exports = require('./browser.js');
+} else {
+  module.exports = require('./node.js');
+}
diff --git a/wrt/node_modules/express/node_modules/debug/src/node.js b/wrt/node_modules/express/node_modules/debug/src/node.js
new file mode 100644 (file)
index 0000000..af61297
--- /dev/null
@@ -0,0 +1,246 @@
+/**
+ * Module dependencies.
+ */
+
+var tty = require('tty');
+var util = require('util');
+
+/**
+ * This is the Node.js implementation of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = require('./debug');
+exports.init = init;
+exports.log = log;
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+
+/**
+ * Colors.
+ */
+
+exports.colors = [6, 2, 3, 4, 5, 1];
+
+/**
+ * Build up the default `inspectOpts` object from the environment variables.
+ *
+ *   $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
+ */
+
+exports.inspectOpts = Object.keys(process.env).filter(function (key) {
+  return /^debug_/i.test(key);
+}).reduce(function (obj, key) {
+  // camel-case
+  var prop = key
+    .substring(6)
+    .toLowerCase()
+    .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });
+
+  // coerce string value into JS value
+  var val = process.env[key];
+  if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
+  else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
+  else if (val === 'null') val = null;
+  else val = Number(val);
+
+  obj[prop] = val;
+  return obj;
+}, {});
+
+/**
+ * The file descriptor to write the `debug()` calls to.
+ * Set the `DEBUG_FD` env variable to override with another value. i.e.:
+ *
+ *   $ DEBUG_FD=3 node script.js 3>debug.log
+ */
+
+var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
+
+if (1 !== fd && 2 !== fd) {
+  util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')()
+}
+
+var stream = 1 === fd ? process.stdout :
+             2 === fd ? process.stderr :
+             createWritableStdioStream(fd);
+
+/**
+ * Is stdout a TTY? Colored output is enabled when `true`.
+ */
+
+function useColors() {
+  return 'colors' in exports.inspectOpts
+    ? Boolean(exports.inspectOpts.colors)
+    : tty.isatty(fd);
+}
+
+/**
+ * Map %o to `util.inspect()`, all on a single line.
+ */
+
+exports.formatters.o = function(v) {
+  this.inspectOpts.colors = this.useColors;
+  return util.inspect(v, this.inspectOpts)
+    .replace(/\s*\n\s*/g, ' ');
+};
+
+/**
+ * Map %o to `util.inspect()`, allowing multiple lines if needed.
+ */
+
+exports.formatters.O = function(v) {
+  this.inspectOpts.colors = this.useColors;
+  return util.inspect(v, this.inspectOpts);
+};
+
+/**
+ * Adds ANSI color escape codes if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+  var name = this.namespace;
+  var useColors = this.useColors;
+
+  if (useColors) {
+    var c = this.color;
+    var prefix = '  \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m';
+
+    args[0] = prefix + args[0].split('\n').join('\n' + prefix);
+    args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m');
+  } else {
+    args[0] = new Date().toUTCString()
+      + ' ' + name + ' ' + args[0];
+  }
+}
+
+/**
+ * Invokes `util.format()` with the specified arguments and writes to `stream`.
+ */
+
+function log() {
+  return stream.write(util.format.apply(util, arguments) + '\n');
+}
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+
+function save(namespaces) {
+  if (null == namespaces) {
+    // If you set a process.env field to null or undefined, it gets cast to the
+    // string 'null' or 'undefined'. Just delete instead.
+    delete process.env.DEBUG;
+  } else {
+    process.env.DEBUG = namespaces;
+  }
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+
+function load() {
+  return process.env.DEBUG;
+}
+
+/**
+ * Copied from `node/src/node.js`.
+ *
+ * XXX: It's lame that node doesn't expose this API out-of-the-box. It also
+ * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.
+ */
+
+function createWritableStdioStream (fd) {
+  var stream;
+  var tty_wrap = process.binding('tty_wrap');
+
+  // Note stream._type is used for test-module-load-list.js
+
+  switch (tty_wrap.guessHandleType(fd)) {
+    case 'TTY':
+      stream = new tty.WriteStream(fd);
+      stream._type = 'tty';
+
+      // Hack to have stream not keep the event loop alive.
+      // See https://github.com/joyent/node/issues/1726
+      if (stream._handle && stream._handle.unref) {
+        stream._handle.unref();
+      }
+      break;
+
+    case 'FILE':
+      var fs = require('fs');
+      stream = new fs.SyncWriteStream(fd, { autoClose: false });
+      stream._type = 'fs';
+      break;
+
+    case 'PIPE':
+    case 'TCP':
+      var net = require('net');
+      stream = new net.Socket({
+        fd: fd,
+        readable: false,
+        writable: true
+      });
+
+      // FIXME Should probably have an option in net.Socket to create a
+      // stream from an existing fd which is writable only. But for now
+      // we'll just add this hack and set the `readable` member to false.
+      // Test: ./node test/fixtures/echo.js < /etc/passwd
+      stream.readable = false;
+      stream.read = null;
+      stream._type = 'pipe';
+
+      // FIXME Hack to have stream not keep the event loop alive.
+      // See https://github.com/joyent/node/issues/1726
+      if (stream._handle && stream._handle.unref) {
+        stream._handle.unref();
+      }
+      break;
+
+    default:
+      // Probably an error on in uv_guess_handle()
+      throw new Error('Implement me. Unknown stream file type!');
+  }
+
+  // For supporting legacy API we put the FD here.
+  stream.fd = fd;
+
+  stream._isStdio = true;
+
+  return stream;
+}
+
+/**
+ * Init logic for `debug` instances.
+ *
+ * Create a new `inspectOpts` object in case `useColors` is set
+ * differently for a particular `debug` instance.
+ */
+
+function init (debug) {
+  debug.inspectOpts = {};
+
+  var keys = Object.keys(exports.inspectOpts);
+  for (var i = 0; i < keys.length; i++) {
+    debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
+  }
+}
+
+/**
+ * Enable namespaces listed in `process.env.DEBUG` initially.
+ */
+
+exports.enable(load());
diff --git a/wrt/node_modules/express/package.json b/wrt/node_modules/express/package.json
new file mode 100644 (file)
index 0000000..0292678
--- /dev/null
@@ -0,0 +1,201 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "express",
+        "scope": null,
+        "escapedName": "express",
+        "name": "express",
+        "rawSpec": "",
+        "spec": "latest",
+        "type": "tag"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt"
+    ]
+  ],
+  "_from": "express@latest",
+  "_id": "express@4.15.4",
+  "_inCache": true,
+  "_location": "/express",
+  "_nodeVersion": "6.11.1",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/express-4.15.4.tgz_1502071931644_0.23451056680642068"
+  },
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "3.10.10",
+  "_phantomChildren": {
+    "ms": "2.0.0"
+  },
+  "_requested": {
+    "raw": "express",
+    "scope": null,
+    "escapedName": "express",
+    "name": "express",
+    "rawSpec": "",
+    "spec": "latest",
+    "type": "tag"
+  },
+  "_requiredBy": [
+    "#USER"
+  ],
+  "_resolved": "https://registry.npmjs.org/express/-/express-4.15.4.tgz",
+  "_shasum": "032e2253489cf8fce02666beca3d11ed7a2daed1",
+  "_shrinkwrap": null,
+  "_spec": "express",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt",
+  "author": {
+    "name": "TJ Holowaychuk",
+    "email": "tj@vision-media.ca"
+  },
+  "bugs": {
+    "url": "https://github.com/expressjs/express/issues"
+  },
+  "contributors": [
+    {
+      "name": "Aaron Heckmann",
+      "email": "aaron.heckmann+github@gmail.com"
+    },
+    {
+      "name": "Ciaran Jessup",
+      "email": "ciaranj@gmail.com"
+    },
+    {
+      "name": "Douglas Christopher Wilson",
+      "email": "doug@somethingdoug.com"
+    },
+    {
+      "name": "Guillermo Rauch",
+      "email": "rauchg@gmail.com"
+    },
+    {
+      "name": "Jonathan Ong",
+      "email": "me@jongleberry.com"
+    },
+    {
+      "name": "Roman Shtylman",
+      "email": "shtylman+expressjs@gmail.com"
+    },
+    {
+      "name": "Young Jae Sim",
+      "email": "hanul@hanul.me"
+    }
+  ],
+  "dependencies": {
+    "accepts": "~1.3.3",
+    "array-flatten": "1.1.1",
+    "content-disposition": "0.5.2",
+    "content-type": "~1.0.2",
+    "cookie": "0.3.1",
+    "cookie-signature": "1.0.6",
+    "debug": "2.6.8",
+    "depd": "~1.1.1",
+    "encodeurl": "~1.0.1",
+    "escape-html": "~1.0.3",
+    "etag": "~1.8.0",
+    "finalhandler": "~1.0.4",
+    "fresh": "0.5.0",
+    "merge-descriptors": "1.0.1",
+    "methods": "~1.1.2",
+    "on-finished": "~2.3.0",
+    "parseurl": "~1.3.1",
+    "path-to-regexp": "0.1.7",
+    "proxy-addr": "~1.1.5",
+    "qs": "6.5.0",
+    "range-parser": "~1.2.0",
+    "send": "0.15.4",
+    "serve-static": "1.12.4",
+    "setprototypeof": "1.0.3",
+    "statuses": "~1.3.1",
+    "type-is": "~1.6.15",
+    "utils-merge": "1.0.0",
+    "vary": "~1.1.1"
+  },
+  "description": "Fast, unopinionated, minimalist web framework",
+  "devDependencies": {
+    "after": "0.8.2",
+    "body-parser": "1.17.2",
+    "connect-redis": "~2.4.1",
+    "cookie-parser": "~1.4.3",
+    "cookie-session": "1.3.0",
+    "ejs": "2.5.7",
+    "eslint": "2.13.1",
+    "express-session": "1.15.5",
+    "hbs": "4.0.1",
+    "istanbul": "0.4.5",
+    "marked": "0.3.6",
+    "method-override": "2.3.9",
+    "mocha": "3.5.0",
+    "morgan": "1.8.2",
+    "multiparty": "4.1.3",
+    "pbkdf2-password": "1.2.1",
+    "should": "11.2.1",
+    "supertest": "1.2.0",
+    "vhost": "~3.0.2"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "032e2253489cf8fce02666beca3d11ed7a2daed1",
+    "tarball": "https://registry.npmjs.org/express/-/express-4.15.4.tgz"
+  },
+  "engines": {
+    "node": ">= 0.10.0"
+  },
+  "files": [
+    "LICENSE",
+    "History.md",
+    "Readme.md",
+    "index.js",
+    "lib/"
+  ],
+  "gitHead": "a4bd4373b2c3b2521ee4c499cb8e90e98f78bfa5",
+  "homepage": "http://expressjs.com/",
+  "keywords": [
+    "express",
+    "framework",
+    "sinatra",
+    "web",
+    "rest",
+    "restful",
+    "router",
+    "app",
+    "api"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "hacksparrow",
+      "email": "captain@hacksparrow.com"
+    },
+    {
+      "name": "mikeal",
+      "email": "mikeal.rogers@gmail.com"
+    },
+    {
+      "name": "jasnell",
+      "email": "jasnell@gmail.com"
+    },
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "name": "express",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/expressjs/express.git"
+  },
+  "scripts": {
+    "lint": "eslint .",
+    "test": "mocha --require test/support/env --reporter spec --bail --check-leaks test/ test/acceptance/",
+    "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require test/support/env --reporter spec --check-leaks test/ test/acceptance/",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require test/support/env --reporter dot --check-leaks test/ test/acceptance/",
+    "test-tap": "mocha --require test/support/env --reporter tap --check-leaks test/ test/acceptance/"
+  },
+  "version": "4.15.4"
+}
diff --git a/wrt/node_modules/finalhandler/HISTORY.md b/wrt/node_modules/finalhandler/HISTORY.md
new file mode 100644 (file)
index 0000000..18386ea
--- /dev/null
@@ -0,0 +1,167 @@
+1.0.6 / 2017-09-22
+==================
+
+  * deps: debug@2.6.9
+
+1.0.5 / 2017-09-15
+==================
+
+  * deps: parseurl@~1.3.2
+    - perf: reduce overhead for full URLs
+    - perf: unroll the "fast-path" `RegExp`
+
+1.0.4 / 2017-08-03
+==================
+
+  * deps: debug@2.6.8
+
+1.0.3 / 2017-05-16
+==================
+
+  * deps: debug@2.6.7
+    - deps: ms@2.0.0
+
+1.0.2 / 2017-04-22
+==================
+
+  * deps: debug@2.6.4
+    - deps: ms@0.7.3
+
+1.0.1 / 2017-03-21
+==================
+
+  * Fix missing `</html>` in HTML document
+  * deps: debug@2.6.3
+    - Fix: `DEBUG_MAX_ARRAY_LENGTH`
+
+1.0.0 / 2017-02-15
+==================
+
+  * Fix exception when `err` cannot be converted to a string
+  * Fully URL-encode the pathname in the 404 message
+  * Only include the pathname in the 404 message
+  * Send complete HTML document
+  * Set `Content-Security-Policy: default-src 'self'` header
+  * deps: debug@2.6.1
+    - Allow colors in workers
+    - Deprecated `DEBUG_FD` environment variable set to `3` or higher
+    - Fix error when running under React Native
+    - Use same color for same namespace
+    - deps: ms@0.7.2
+
+0.5.1 / 2016-11-12
+==================
+
+  * Fix exception when `err.headers` is not an object
+  * deps: statuses@~1.3.1
+  * perf: hoist regular expressions
+  * perf: remove duplicate validation path
+
+0.5.0 / 2016-06-15
+==================
+
+  * Change invalid or non-numeric status code to 500
+  * Overwrite status message to match set status code
+  * Prefer `err.statusCode` if `err.status` is invalid
+  * Set response headers from `err.headers` object
+  * Use `statuses` instead of `http` module for status messages
+    - Includes all defined status messages
+
+0.4.1 / 2015-12-02
+==================
+
+  * deps: escape-html@~1.0.3
+    - perf: enable strict mode
+    - perf: optimize string replacement
+    - perf: use faster string coercion
+
+0.4.0 / 2015-06-14
+==================
+
+  * Fix a false-positive when unpiping in Node.js 0.8
+  * Support `statusCode` property on `Error` objects
+  * Use `unpipe` module for unpiping requests
+  * deps: escape-html@1.0.2
+  * deps: on-finished@~2.3.0
+    - Add defined behavior for HTTP `CONNECT` requests
+    - Add defined behavior for HTTP `Upgrade` requests
+    - deps: ee-first@1.1.1
+  * perf: enable strict mode
+  * perf: remove argument reassignment
+
+0.3.6 / 2015-05-11
+==================
+
+  * deps: debug@~2.2.0
+    - deps: ms@0.7.1
+
+0.3.5 / 2015-04-22
+==================
+
+  * deps: on-finished@~2.2.1
+    - Fix `isFinished(req)` when data buffered
+
+0.3.4 / 2015-03-15
+==================
+
+  * deps: debug@~2.1.3
+    - Fix high intensity foreground color for bold
+    - deps: ms@0.7.0
+
+0.3.3 / 2015-01-01
+==================
+
+  * deps: debug@~2.1.1
+  * deps: on-finished@~2.2.0
+
+0.3.2 / 2014-10-22
+==================
+
+  * deps: on-finished@~2.1.1
+    - Fix handling of pipelined requests
+
+0.3.1 / 2014-10-16
+==================
+
+  * deps: debug@~2.1.0
+    - Implement `DEBUG_FD` env variable support
+
+0.3.0 / 2014-09-17
+==================
+
+  * Terminate in progress response only on error
+  * Use `on-finished` to determine request status
+
+0.2.0 / 2014-09-03
+==================
+
+  * Set `X-Content-Type-Options: nosniff` header
+  * deps: debug@~2.0.0
+
+0.1.0 / 2014-07-16
+==================
+
+  * Respond after request fully read
+    - prevents hung responses and socket hang ups
+  * deps: debug@1.0.4
+
+0.0.3 / 2014-07-11
+==================
+
+  * deps: debug@1.0.3
+    - Add support for multiple wildcards in namespaces
+
+0.0.2 / 2014-06-19
+==================
+
+  * Handle invalid status codes
+
+0.0.1 / 2014-06-05
+==================
+
+  * deps: debug@1.0.2
+
+0.0.0 / 2014-06-05
+==================
+
+  * Extracted from connect/express
diff --git a/wrt/node_modules/finalhandler/LICENSE b/wrt/node_modules/finalhandler/LICENSE
new file mode 100644 (file)
index 0000000..fb30982
--- /dev/null
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2014-2017 Douglas Christopher Wilson <doug@somethingdoug.com>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/finalhandler/README.md b/wrt/node_modules/finalhandler/README.md
new file mode 100644 (file)
index 0000000..6756f0c
--- /dev/null
@@ -0,0 +1,148 @@
+# finalhandler
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-image]][node-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+Node.js function to invoke as the final step to respond to HTTP request.
+
+## Installation
+
+This is a [Node.js](https://nodejs.org/en/) module available through the
+[npm registry](https://www.npmjs.com/). Installation is done using the
+[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
+
+```sh
+$ npm install finalhandler
+```
+
+## API
+
+<!-- eslint-disable no-unused-vars -->
+
+```js
+var finalhandler = require('finalhandler')
+```
+
+### finalhandler(req, res, [options])
+
+Returns function to be invoked as the final step for the given `req` and `res`.
+This function is to be invoked as `fn(err)`. If `err` is falsy, the handler will
+write out a 404 response to the `res`. If it is truthy, an error response will
+be written out to the `res`.
+
+When an error is written, the following information is added to the response:
+
+  * The `res.statusCode` is set from `err.status` (or `err.statusCode`). If
+    this value is outside the 4xx or 5xx range, it will be set to 500.
+  * The `res.statusMessage` is set according to the status code.
+  * The body will be the HTML of the status code message if `env` is
+    `'production'`, otherwise will be `err.stack`.
+  * Any headers specified in an `err.headers` object.
+
+The final handler will also unpipe anything from `req` when it is invoked.
+
+#### options.env
+
+By default, the environment is determined by `NODE_ENV` variable, but it can be
+overridden by this option.
+
+#### options.onerror
+
+Provide a function to be called with the `err` when it exists. Can be used for
+writing errors to a central location without excessive function generation. Called
+as `onerror(err, req, res)`.
+
+## Examples
+
+### always 404
+
+```js
+var finalhandler = require('finalhandler')
+var http = require('http')
+
+var server = http.createServer(function (req, res) {
+  var done = finalhandler(req, res)
+  done()
+})
+
+server.listen(3000)
+```
+
+### perform simple action
+
+```js
+var finalhandler = require('finalhandler')
+var fs = require('fs')
+var http = require('http')
+
+var server = http.createServer(function (req, res) {
+  var done = finalhandler(req, res)
+
+  fs.readFile('index.html', function (err, buf) {
+    if (err) return done(err)
+    res.setHeader('Content-Type', 'text/html')
+    res.end(buf)
+  })
+})
+
+server.listen(3000)
+```
+
+### use with middleware-style functions
+
+```js
+var finalhandler = require('finalhandler')
+var http = require('http')
+var serveStatic = require('serve-static')
+
+var serve = serveStatic('public')
+
+var server = http.createServer(function (req, res) {
+  var done = finalhandler(req, res)
+  serve(req, res, done)
+})
+
+server.listen(3000)
+```
+
+### keep log of all errors
+
+```js
+var finalhandler = require('finalhandler')
+var fs = require('fs')
+var http = require('http')
+
+var server = http.createServer(function (req, res) {
+  var done = finalhandler(req, res, {onerror: logerror})
+
+  fs.readFile('index.html', function (err, buf) {
+    if (err) return done(err)
+    res.setHeader('Content-Type', 'text/html')
+    res.end(buf)
+  })
+})
+
+server.listen(3000)
+
+function logerror (err) {
+  console.error(err.stack || err.toString())
+}
+```
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/finalhandler.svg
+[npm-url]: https://npmjs.org/package/finalhandler
+[node-image]: https://img.shields.io/node/v/finalhandler.svg
+[node-url]: https://nodejs.org/en/download
+[travis-image]: https://img.shields.io/travis/pillarjs/finalhandler.svg
+[travis-url]: https://travis-ci.org/pillarjs/finalhandler
+[coveralls-image]: https://img.shields.io/coveralls/pillarjs/finalhandler.svg
+[coveralls-url]: https://coveralls.io/r/pillarjs/finalhandler?branch=master
+[downloads-image]: https://img.shields.io/npm/dm/finalhandler.svg
+[downloads-url]: https://npmjs.org/package/finalhandler
diff --git a/wrt/node_modules/finalhandler/index.js b/wrt/node_modules/finalhandler/index.js
new file mode 100644 (file)
index 0000000..87974ca
--- /dev/null
@@ -0,0 +1,300 @@
+/*!
+ * finalhandler
+ * Copyright(c) 2014-2017 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var debug = require('debug')('finalhandler')
+var encodeUrl = require('encodeurl')
+var escapeHtml = require('escape-html')
+var onFinished = require('on-finished')
+var parseUrl = require('parseurl')
+var statuses = require('statuses')
+var unpipe = require('unpipe')
+
+/**
+ * Module variables.
+ * @private
+ */
+
+var DOUBLE_SPACE_REGEXP = /\x20{2}/g
+var NEWLINE_REGEXP = /\n/g
+
+/* istanbul ignore next */
+var defer = typeof setImmediate === 'function'
+  ? setImmediate
+  : function (fn) { process.nextTick(fn.bind.apply(fn, arguments)) }
+var isFinished = onFinished.isFinished
+
+/**
+ * Create a minimal HTML document.
+ *
+ * @param {string} message
+ * @private
+ */
+
+function createHtmlDocument (message) {
+  var body = escapeHtml(message)
+    .replace(NEWLINE_REGEXP, '<br>')
+    .replace(DOUBLE_SPACE_REGEXP, ' &nbsp;')
+
+  return '<!DOCTYPE html>\n' +
+    '<html lang="en">\n' +
+    '<head>\n' +
+    '<meta charset="utf-8">\n' +
+    '<title>Error</title>\n' +
+    '</head>\n' +
+    '<body>\n' +
+    '<pre>' + body + '</pre>\n' +
+    '</body>\n' +
+    '</html>\n'
+}
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = finalhandler
+
+/**
+ * Create a function to handle the final response.
+ *
+ * @param {Request} req
+ * @param {Response} res
+ * @param {Object} [options]
+ * @return {Function}
+ * @public
+ */
+
+function finalhandler (req, res, options) {
+  var opts = options || {}
+
+  // get environment
+  var env = opts.env || process.env.NODE_ENV || 'development'
+
+  // get error callback
+  var onerror = opts.onerror
+
+  return function (err) {
+    var headers
+    var msg
+    var status
+
+    // ignore 404 on in-flight response
+    if (!err && res._header) {
+      debug('cannot 404 after headers sent')
+      return
+    }
+
+    // unhandled error
+    if (err) {
+      // respect status code from error
+      status = getErrorStatusCode(err)
+
+      // respect headers from error
+      if (status !== undefined) {
+        headers = getErrorHeaders(err)
+      }
+
+      // fallback to status code on response
+      if (status === undefined) {
+        status = getResponseStatusCode(res)
+      }
+
+      // get error message
+      msg = getErrorMessage(err, status, env)
+    } else {
+      // not found
+      status = 404
+      msg = 'Cannot ' + req.method + ' ' + encodeUrl(parseUrl.original(req).pathname)
+    }
+
+    debug('default %s', status)
+
+    // schedule onerror callback
+    if (err && onerror) {
+      defer(onerror, err, req, res)
+    }
+
+    // cannot actually respond
+    if (res._header) {
+      debug('cannot %d after headers sent', status)
+      req.socket.destroy()
+      return
+    }
+
+    // send response
+    send(req, res, status, headers, msg)
+  }
+}
+
+/**
+ * Get headers from Error object.
+ *
+ * @param {Error} err
+ * @return {object}
+ * @private
+ */
+
+function getErrorHeaders (err) {
+  if (!err.headers || typeof err.headers !== 'object') {
+    return undefined
+  }
+
+  var headers = Object.create(null)
+  var keys = Object.keys(err.headers)
+
+  for (var i = 0; i < keys.length; i++) {
+    var key = keys[i]
+    headers[key] = err.headers[key]
+  }
+
+  return headers
+}
+
+/**
+ * Get message from Error object, fallback to status message.
+ *
+ * @param {Error} err
+ * @param {number} status
+ * @param {string} env
+ * @return {string}
+ * @private
+ */
+
+function getErrorMessage (err, status, env) {
+  var msg
+
+  if (env !== 'production') {
+    // use err.stack, which typically includes err.message
+    msg = err.stack
+
+    // fallback to err.toString() when possible
+    if (!msg && typeof err.toString === 'function') {
+      msg = err.toString()
+    }
+  }
+
+  return msg || statuses[status]
+}
+
+/**
+ * Get status code from Error object.
+ *
+ * @param {Error} err
+ * @return {number}
+ * @private
+ */
+
+function getErrorStatusCode (err) {
+  // check err.status
+  if (typeof err.status === 'number' && err.status >= 400 && err.status < 600) {
+    return err.status
+  }
+
+  // check err.statusCode
+  if (typeof err.statusCode === 'number' && err.statusCode >= 400 && err.statusCode < 600) {
+    return err.statusCode
+  }
+
+  return undefined
+}
+
+/**
+ * Get status code from response.
+ *
+ * @param {OutgoingMessage} res
+ * @return {number}
+ * @private
+ */
+
+function getResponseStatusCode (res) {
+  var status = res.statusCode
+
+  // default status code to 500 if outside valid range
+  if (typeof status !== 'number' || status < 400 || status > 599) {
+    status = 500
+  }
+
+  return status
+}
+
+/**
+ * Send response.
+ *
+ * @param {IncomingMessage} req
+ * @param {OutgoingMessage} res
+ * @param {number} status
+ * @param {object} headers
+ * @param {string} message
+ * @private
+ */
+
+function send (req, res, status, headers, message) {
+  function write () {
+    // response body
+    var body = createHtmlDocument(message)
+
+    // response status
+    res.statusCode = status
+    res.statusMessage = statuses[status]
+
+    // response headers
+    setHeaders(res, headers)
+
+    // security headers
+    res.setHeader('Content-Security-Policy', "default-src 'self'")
+    res.setHeader('X-Content-Type-Options', 'nosniff')
+
+    // standard headers
+    res.setHeader('Content-Type', 'text/html; charset=utf-8')
+    res.setHeader('Content-Length', Buffer.byteLength(body, 'utf8'))
+
+    if (req.method === 'HEAD') {
+      res.end()
+      return
+    }
+
+    res.end(body, 'utf8')
+  }
+
+  if (isFinished(req)) {
+    write()
+    return
+  }
+
+  // unpipe everything from the request
+  unpipe(req)
+
+  // flush the request
+  onFinished(req, write)
+  req.resume()
+}
+
+/**
+ * Set response headers from an object.
+ *
+ * @param {OutgoingMessage} res
+ * @param {object} headers
+ * @private
+ */
+
+function setHeaders (res, headers) {
+  if (!headers) {
+    return
+  }
+
+  var keys = Object.keys(headers)
+  for (var i = 0; i < keys.length; i++) {
+    var key = keys[i]
+    res.setHeader(key, headers[key])
+  }
+}
diff --git a/wrt/node_modules/finalhandler/node_modules/debug/.coveralls.yml b/wrt/node_modules/finalhandler/node_modules/debug/.coveralls.yml
new file mode 100644 (file)
index 0000000..20a7068
--- /dev/null
@@ -0,0 +1 @@
+repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve
diff --git a/wrt/node_modules/finalhandler/node_modules/debug/.eslintrc b/wrt/node_modules/finalhandler/node_modules/debug/.eslintrc
new file mode 100644 (file)
index 0000000..8a37ae2
--- /dev/null
@@ -0,0 +1,11 @@
+{
+  "env": {
+    "browser": true,
+    "node": true
+  },
+  "rules": {
+    "no-console": 0,
+    "no-empty": [1, { "allowEmptyCatch": true }]
+  },
+  "extends": "eslint:recommended"
+}
diff --git a/wrt/node_modules/finalhandler/node_modules/debug/.npmignore b/wrt/node_modules/finalhandler/node_modules/debug/.npmignore
new file mode 100644 (file)
index 0000000..5f60eec
--- /dev/null
@@ -0,0 +1,9 @@
+support
+test
+examples
+example
+*.sock
+dist
+yarn.lock
+coverage
+bower.json
diff --git a/wrt/node_modules/finalhandler/node_modules/debug/.travis.yml b/wrt/node_modules/finalhandler/node_modules/debug/.travis.yml
new file mode 100644 (file)
index 0000000..6c6090c
--- /dev/null
@@ -0,0 +1,14 @@
+
+language: node_js
+node_js:
+  - "6"
+  - "5"
+  - "4"
+
+install:
+  - make node_modules
+
+script:
+  - make lint
+  - make test
+  - make coveralls
diff --git a/wrt/node_modules/finalhandler/node_modules/debug/CHANGELOG.md b/wrt/node_modules/finalhandler/node_modules/debug/CHANGELOG.md
new file mode 100644 (file)
index 0000000..eadaa18
--- /dev/null
@@ -0,0 +1,362 @@
+
+2.6.9 / 2017-09-22
+==================
+
+  * remove ReDoS regexp in %o formatter (#504)
+
+2.6.8 / 2017-05-18
+==================
+
+  * Fix: Check for undefined on browser globals (#462, @marbemac)
+
+2.6.7 / 2017-05-16
+==================
+
+  * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom)
+  * Fix: Inline extend function in node implementation (#452, @dougwilson)
+  * Docs: Fix typo (#455, @msasad)
+
+2.6.5 / 2017-04-27
+==================
+  
+  * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek)
+  * Misc: clean up browser reference checks (#447, @thebigredgeek)
+  * Misc: add npm-debug.log to .gitignore (@thebigredgeek)
+
+
+2.6.4 / 2017-04-20
+==================
+
+  * Fix: bug that would occure if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo)
+  * Chore: ignore bower.json in npm installations. (#437, @joaovieira)
+  * Misc: update "ms" to v0.7.3 (@tootallnate)
+
+2.6.3 / 2017-03-13
+==================
+
+  * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts)
+  * Docs: Changelog fix (@thebigredgeek)
+
+2.6.2 / 2017-03-10
+==================
+
+  * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin)
+  * Docs: Add backers and sponsors from Open Collective (#422, @piamancini)
+  * Docs: Add Slackin invite badge (@tootallnate)
+
+2.6.1 / 2017-02-10
+==================
+
+  * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error
+  * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0)
+  * Fix: IE8 "Expected identifier" error (#414, @vgoma)
+  * Fix: Namespaces would not disable once enabled (#409, @musikov)
+
+2.6.0 / 2016-12-28
+==================
+
+  * Fix: added better null pointer checks for browser useColors (@thebigredgeek)
+  * Improvement: removed explicit `window.debug` export (#404, @tootallnate)
+  * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate)
+
+2.5.2 / 2016-12-25
+==================
+
+  * Fix: reference error on window within webworkers (#393, @KlausTrainer)
+  * Docs: fixed README typo (#391, @lurch)
+  * Docs: added notice about v3 api discussion (@thebigredgeek)
+
+2.5.1 / 2016-12-20
+==================
+
+  * Fix: babel-core compatibility
+
+2.5.0 / 2016-12-20
+==================
+
+  * Fix: wrong reference in bower file (@thebigredgeek)
+  * Fix: webworker compatibility (@thebigredgeek)
+  * Fix: output formatting issue (#388, @kribblo)
+  * Fix: babel-loader compatibility (#383, @escwald)
+  * Misc: removed built asset from repo and publications (@thebigredgeek)
+  * Misc: moved source files to /src (#378, @yamikuronue)
+  * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue)
+  * Test: coveralls integration (#378, @yamikuronue)
+  * Docs: simplified language in the opening paragraph (#373, @yamikuronue)
+
+2.4.5 / 2016-12-17
+==================
+
+  * Fix: `navigator` undefined in Rhino (#376, @jochenberger)
+  * Fix: custom log function (#379, @hsiliev)
+  * Improvement: bit of cleanup + linting fixes (@thebigredgeek)
+  * Improvement: rm non-maintainted `dist/` dir (#375, @freewil)
+  * Docs: simplified language in the opening paragraph. (#373, @yamikuronue)
+
+2.4.4 / 2016-12-14
+==================
+
+  * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts)
+
+2.4.3 / 2016-12-14
+==================
+
+  * Fix: navigation.userAgent error for react native (#364, @escwald)
+
+2.4.2 / 2016-12-14
+==================
+
+  * Fix: browser colors (#367, @tootallnate)
+  * Misc: travis ci integration (@thebigredgeek)
+  * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek)
+
+2.4.1 / 2016-12-13
+==================
+
+  * Fix: typo that broke the package (#356)
+
+2.4.0 / 2016-12-13
+==================
+
+  * Fix: bower.json references unbuilt src entry point (#342, @justmatt)
+  * Fix: revert "handle regex special characters" (@tootallnate)
+  * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate)
+  * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate)
+  * Improvement: allow colors in workers (#335, @botverse)
+  * Improvement: use same color for same namespace. (#338, @lchenay)
+
+2.3.3 / 2016-11-09
+==================
+
+  * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne)
+  * Fix: Returning `localStorage` saved values (#331, Levi Thomason)
+  * Improvement: Don't create an empty object when no `process` (Nathan Rajlich)
+
+2.3.2 / 2016-11-09
+==================
+
+  * Fix: be super-safe in index.js as well (@TooTallNate)
+  * Fix: should check whether process exists (Tom Newby)
+
+2.3.1 / 2016-11-09
+==================
+
+  * Fix: Added electron compatibility (#324, @paulcbetts)
+  * Improvement: Added performance optimizations (@tootallnate)
+  * Readme: Corrected PowerShell environment variable example (#252, @gimre)
+  * Misc: Removed yarn lock file from source control (#321, @fengmk2)
+
+2.3.0 / 2016-11-07
+==================
+
+  * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic)
+  * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos)
+  * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15)
+  * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran)
+  * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom)
+  * Package: Update "ms" to 0.7.2 (#315, @DevSide)
+  * Package: removed superfluous version property from bower.json (#207 @kkirsche)
+  * Readme: fix USE_COLORS to DEBUG_COLORS
+  * Readme: Doc fixes for format string sugar (#269, @mlucool)
+  * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0)
+  * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable)
+  * Readme: better docs for browser support (#224, @matthewmueller)
+  * Tooling: Added yarn integration for development (#317, @thebigredgeek)
+  * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek)
+  * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman)
+  * Misc: Updated contributors (@thebigredgeek)
+
+2.2.0 / 2015-05-09
+==================
+
+  * package: update "ms" to v0.7.1 (#202, @dougwilson)
+  * README: add logging to file example (#193, @DanielOchoa)
+  * README: fixed a typo (#191, @amir-s)
+  * browser: expose `storage` (#190, @stephenmathieson)
+  * Makefile: add a `distclean` target (#189, @stephenmathieson)
+
+2.1.3 / 2015-03-13
+==================
+
+  * Updated stdout/stderr example (#186)
+  * Updated example/stdout.js to match debug current behaviour
+  * Renamed example/stderr.js to stdout.js
+  * Update Readme.md (#184)
+  * replace high intensity foreground color for bold (#182, #183)
+
+2.1.2 / 2015-03-01
+==================
+
+  * dist: recompile
+  * update "ms" to v0.7.0
+  * package: update "browserify" to v9.0.3
+  * component: fix "ms.js" repo location
+  * changed bower package name
+  * updated documentation about using debug in a browser
+  * fix: security error on safari (#167, #168, @yields)
+
+2.1.1 / 2014-12-29
+==================
+
+  * browser: use `typeof` to check for `console` existence
+  * browser: check for `console.log` truthiness (fix IE 8/9)
+  * browser: add support for Chrome apps
+  * Readme: added Windows usage remarks
+  * Add `bower.json` to properly support bower install
+
+2.1.0 / 2014-10-15
+==================
+
+  * node: implement `DEBUG_FD` env variable support
+  * package: update "browserify" to v6.1.0
+  * package: add "license" field to package.json (#135, @panuhorsmalahti)
+
+2.0.0 / 2014-09-01
+==================
+
+  * package: update "browserify" to v5.11.0
+  * node: use stderr rather than stdout for logging (#29, @stephenmathieson)
+
+1.0.4 / 2014-07-15
+==================
+
+  * dist: recompile
+  * example: remove `console.info()` log usage
+  * example: add "Content-Type" UTF-8 header to browser example
+  * browser: place %c marker after the space character
+  * browser: reset the "content" color via `color: inherit`
+  * browser: add colors support for Firefox >= v31
+  * debug: prefer an instance `log()` function over the global one (#119)
+  * Readme: update documentation about styled console logs for FF v31 (#116, @wryk)
+
+1.0.3 / 2014-07-09
+==================
+
+  * Add support for multiple wildcards in namespaces (#122, @seegno)
+  * browser: fix lint
+
+1.0.2 / 2014-06-10
+==================
+
+  * browser: update color palette (#113, @gscottolson)
+  * common: make console logging function configurable (#108, @timoxley)
+  * node: fix %o colors on old node <= 0.8.x
+  * Makefile: find node path using shell/which (#109, @timoxley)
+
+1.0.1 / 2014-06-06
+==================
+
+  * browser: use `removeItem()` to clear localStorage
+  * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777)
+  * package: add "contributors" section
+  * node: fix comment typo
+  * README: list authors
+
+1.0.0 / 2014-06-04
+==================
+
+  * make ms diff be global, not be scope
+  * debug: ignore empty strings in enable()
+  * node: make DEBUG_COLORS able to disable coloring
+  * *: export the `colors` array
+  * npmignore: don't publish the `dist` dir
+  * Makefile: refactor to use browserify
+  * package: add "browserify" as a dev dependency
+  * Readme: add Web Inspector Colors section
+  * node: reset terminal color for the debug content
+  * node: map "%o" to `util.inspect()`
+  * browser: map "%j" to `JSON.stringify()`
+  * debug: add custom "formatters"
+  * debug: use "ms" module for humanizing the diff
+  * Readme: add "bash" syntax highlighting
+  * browser: add Firebug color support
+  * browser: add colors for WebKit browsers
+  * node: apply log to `console`
+  * rewrite: abstract common logic for Node & browsers
+  * add .jshintrc file
+
+0.8.1 / 2014-04-14
+==================
+
+  * package: re-add the "component" section
+
+0.8.0 / 2014-03-30
+==================
+
+  * add `enable()` method for nodejs. Closes #27
+  * change from stderr to stdout
+  * remove unnecessary index.js file
+
+0.7.4 / 2013-11-13
+==================
+
+  * remove "browserify" key from package.json (fixes something in browserify)
+
+0.7.3 / 2013-10-30
+==================
+
+  * fix: catch localStorage security error when cookies are blocked (Chrome)
+  * add debug(err) support. Closes #46
+  * add .browser prop to package.json. Closes #42
+
+0.7.2 / 2013-02-06
+==================
+
+  * fix package.json
+  * fix: Mobile Safari (private mode) is broken with debug
+  * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript
+
+0.7.1 / 2013-02-05
+==================
+
+  * add repository URL to package.json
+  * add DEBUG_COLORED to force colored output
+  * add browserify support
+  * fix component. Closes #24
+
+0.7.0 / 2012-05-04
+==================
+
+  * Added .component to package.json
+  * Added debug.component.js build
+
+0.6.0 / 2012-03-16
+==================
+
+  * Added support for "-" prefix in DEBUG [Vinay Pulim]
+  * Added `.enabled` flag to the node version [TooTallNate]
+
+0.5.0 / 2012-02-02
+==================
+
+  * Added: humanize diffs. Closes #8
+  * Added `debug.disable()` to the CS variant
+  * Removed padding. Closes #10
+  * Fixed: persist client-side variant again. Closes #9
+
+0.4.0 / 2012-02-01
+==================
+
+  * Added browser variant support for older browsers [TooTallNate]
+  * Added `debug.enable('project:*')` to browser variant [TooTallNate]
+  * Added padding to diff (moved it to the right)
+
+0.3.0 / 2012-01-26
+==================
+
+  * Added millisecond diff when isatty, otherwise UTC string
+
+0.2.0 / 2012-01-22
+==================
+
+  * Added wildcard support
+
+0.1.0 / 2011-12-02
+==================
+
+  * Added: remove colors unless stderr isatty [TooTallNate]
+
+0.0.1 / 2010-01-03
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/finalhandler/node_modules/debug/LICENSE b/wrt/node_modules/finalhandler/node_modules/debug/LICENSE
new file mode 100644 (file)
index 0000000..658c933
--- /dev/null
@@ -0,0 +1,19 @@
+(The MIT License)
+
+Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software 
+and associated documentation files (the 'Software'), to deal in the Software without restriction, 
+including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial 
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 
+LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/wrt/node_modules/finalhandler/node_modules/debug/Makefile b/wrt/node_modules/finalhandler/node_modules/debug/Makefile
new file mode 100644 (file)
index 0000000..584da8b
--- /dev/null
@@ -0,0 +1,50 @@
+# get Makefile directory name: http://stackoverflow.com/a/5982798/376773
+THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
+THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)
+
+# BIN directory
+BIN := $(THIS_DIR)/node_modules/.bin
+
+# Path
+PATH := node_modules/.bin:$(PATH)
+SHELL := /bin/bash
+
+# applications
+NODE ?= $(shell which node)
+YARN ?= $(shell which yarn)
+PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm))
+BROWSERIFY ?= $(NODE) $(BIN)/browserify
+
+.FORCE:
+
+install: node_modules
+
+node_modules: package.json
+       @NODE_ENV= $(PKG) install
+       @touch node_modules
+
+lint: .FORCE
+       eslint browser.js debug.js index.js node.js
+
+test-node: .FORCE
+       istanbul cover node_modules/mocha/bin/_mocha -- test/**.js
+
+test-browser: .FORCE
+       mkdir -p dist
+
+       @$(BROWSERIFY) \
+               --standalone debug \
+               . > dist/debug.js
+
+       karma start --single-run
+       rimraf dist
+
+test: .FORCE
+       concurrently \
+               "make test-node" \
+               "make test-browser"
+
+coveralls:
+       cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
+
+.PHONY: all install clean distclean
diff --git a/wrt/node_modules/finalhandler/node_modules/debug/README.md b/wrt/node_modules/finalhandler/node_modules/debug/README.md
new file mode 100644 (file)
index 0000000..f67be6b
--- /dev/null
@@ -0,0 +1,312 @@
+# debug
+[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug)  [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master)  [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) 
+[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors)
+
+
+
+A tiny node.js debugging utility modelled after node core's debugging technique.
+
+**Discussion around the V3 API is under way [here](https://github.com/visionmedia/debug/issues/370)**
+
+## Installation
+
+```bash
+$ npm install debug
+```
+
+## Usage
+
+`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole.
+
+Example _app.js_:
+
+```js
+var debug = require('debug')('http')
+  , http = require('http')
+  , name = 'My App';
+
+// fake app
+
+debug('booting %s', name);
+
+http.createServer(function(req, res){
+  debug(req.method + ' ' + req.url);
+  res.end('hello\n');
+}).listen(3000, function(){
+  debug('listening');
+});
+
+// fake worker of some kind
+
+require('./worker');
+```
+
+Example _worker.js_:
+
+```js
+var debug = require('debug')('worker');
+
+setInterval(function(){
+  debug('doing some work');
+}, 1000);
+```
+
+ The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:
+
+  ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png)
+
+  ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png)
+
+#### Windows note
+
+ On Windows the environment variable is set using the `set` command.
+
+ ```cmd
+ set DEBUG=*,-not_this
+ ```
+
+ Note that PowerShell uses different syntax to set environment variables.
+
+ ```cmd
+ $env:DEBUG = "*,-not_this"
+  ```
+
+Then, run the program to be debugged as usual.
+
+## Millisecond diff
+
+  When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.
+
+  ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png)
+
+  When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:
+
+  ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png)
+
+## Conventions
+
+  If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser".
+
+## Wildcards
+
+  The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.
+
+  You can also exclude specific debuggers by prefixing them with a "-" character.  For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:".
+
+## Environment Variables
+
+  When running through Node.js, you can set a few environment variables that will
+  change the behavior of the debug logging:
+
+| Name      | Purpose                                         |
+|-----------|-------------------------------------------------|
+| `DEBUG`   | Enables/disables specific debugging namespaces. |
+| `DEBUG_COLORS`| Whether or not to use colors in the debug output. |
+| `DEBUG_DEPTH` | Object inspection depth. |
+| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. |
+
+
+  __Note:__ The environment variables beginning with `DEBUG_` end up being
+  converted into an Options object that gets used with `%o`/`%O` formatters.
+  See the Node.js documentation for
+  [`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options)
+  for the complete list.
+
+## Formatters
+
+
+  Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. Below are the officially supported formatters:
+
+| Formatter | Representation |
+|-----------|----------------|
+| `%O`      | Pretty-print an Object on multiple lines. |
+| `%o`      | Pretty-print an Object all on a single line. |
+| `%s`      | String. |
+| `%d`      | Number (both integer and float). |
+| `%j`      | JSON. Replaced with the string '[Circular]' if the argument contains circular references. |
+| `%%`      | Single percent sign ('%'). This does not consume an argument. |
+
+### Custom formatters
+
+  You can add custom formatters by extending the `debug.formatters` object. For example, if you wanted to add support for rendering a Buffer as hex with `%h`, you could do something like:
+
+```js
+const createDebug = require('debug')
+createDebug.formatters.h = (v) => {
+  return v.toString('hex')
+}
+
+// …elsewhere
+const debug = createDebug('foo')
+debug('this is hex: %h', new Buffer('hello world'))
+//   foo this is hex: 68656c6c6f20776f726c6421 +0ms
+```
+
+## Browser support
+  You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify),
+  or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest),
+  if you don't want to build it yourself.
+
+  Debug's enable state is currently persisted by `localStorage`.
+  Consider the situation shown below where you have `worker:a` and `worker:b`,
+  and wish to debug both. You can enable this using `localStorage.debug`:
+
+```js
+localStorage.debug = 'worker:*'
+```
+
+And then refresh the page.
+
+```js
+a = debug('worker:a');
+b = debug('worker:b');
+
+setInterval(function(){
+  a('doing some work');
+}, 1000);
+
+setInterval(function(){
+  b('doing some work');
+}, 1200);
+```
+
+#### Web Inspector Colors
+
+  Colors are also enabled on "Web Inspectors" that understand the `%c` formatting
+  option. These are WebKit web inspectors, Firefox ([since version
+  31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))
+  and the Firebug plugin for Firefox (any version).
+
+  Colored output looks something like:
+
+  ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png)
+
+
+## Output streams
+
+  By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method:
+
+Example _stdout.js_:
+
+```js
+var debug = require('debug');
+var error = debug('app:error');
+
+// by default stderr is used
+error('goes to stderr!');
+
+var log = debug('app:log');
+// set this namespace to log via console.log
+log.log = console.log.bind(console); // don't forget to bind to console!
+log('goes to stdout');
+error('still goes to stderr!');
+
+// set all output to go via console.info
+// overrides all per-namespace log settings
+debug.log = console.info.bind(console);
+error('now goes to stdout via console.info');
+log('still goes to stdout, but via console.info now');
+```
+
+
+## Authors
+
+ - TJ Holowaychuk
+ - Nathan Rajlich
+ - Andrew Rhyne
+## Backers
+
+Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)]
+
+<a href="https://opencollective.com/debug/backer/0/website" target="_blank"><img src="https://opencollective.com/debug/backer/0/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/1/website" target="_blank"><img src="https://opencollective.com/debug/backer/1/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/2/website" target="_blank"><img src="https://opencollective.com/debug/backer/2/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/3/website" target="_blank"><img src="https://opencollective.com/debug/backer/3/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/4/website" target="_blank"><img src="https://opencollective.com/debug/backer/4/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/5/website" target="_blank"><img src="https://opencollective.com/debug/backer/5/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/6/website" target="_blank"><img src="https://opencollective.com/debug/backer/6/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/7/website" target="_blank"><img src="https://opencollective.com/debug/backer/7/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/8/website" target="_blank"><img src="https://opencollective.com/debug/backer/8/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/9/website" target="_blank"><img src="https://opencollective.com/debug/backer/9/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/10/website" target="_blank"><img src="https://opencollective.com/debug/backer/10/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/11/website" target="_blank"><img src="https://opencollective.com/debug/backer/11/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/12/website" target="_blank"><img src="https://opencollective.com/debug/backer/12/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/13/website" target="_blank"><img src="https://opencollective.com/debug/backer/13/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/14/website" target="_blank"><img src="https://opencollective.com/debug/backer/14/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/15/website" target="_blank"><img src="https://opencollective.com/debug/backer/15/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/16/website" target="_blank"><img src="https://opencollective.com/debug/backer/16/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/17/website" target="_blank"><img src="https://opencollective.com/debug/backer/17/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/18/website" target="_blank"><img src="https://opencollective.com/debug/backer/18/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/19/website" target="_blank"><img src="https://opencollective.com/debug/backer/19/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/20/website" target="_blank"><img src="https://opencollective.com/debug/backer/20/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/21/website" target="_blank"><img src="https://opencollective.com/debug/backer/21/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/22/website" target="_blank"><img src="https://opencollective.com/debug/backer/22/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/23/website" target="_blank"><img src="https://opencollective.com/debug/backer/23/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/24/website" target="_blank"><img src="https://opencollective.com/debug/backer/24/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/25/website" target="_blank"><img src="https://opencollective.com/debug/backer/25/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/26/website" target="_blank"><img src="https://opencollective.com/debug/backer/26/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/27/website" target="_blank"><img src="https://opencollective.com/debug/backer/27/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/28/website" target="_blank"><img src="https://opencollective.com/debug/backer/28/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/29/website" target="_blank"><img src="https://opencollective.com/debug/backer/29/avatar.svg"></a>
+
+
+## Sponsors
+
+Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)]
+
+<a href="https://opencollective.com/debug/sponsor/0/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/0/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/1/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/1/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/2/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/2/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/3/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/3/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/4/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/4/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/5/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/5/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/6/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/6/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/7/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/7/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/8/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/8/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/9/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/9/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/10/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/10/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/11/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/11/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/12/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/12/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/13/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/13/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/14/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/14/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/15/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/15/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/16/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/16/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/17/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/17/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/18/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/18/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/19/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/19/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/20/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/20/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/21/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/21/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/22/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/22/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/23/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/23/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/24/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/24/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/25/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/25/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/26/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/26/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/27/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/27/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/28/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/28/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/29/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/29/avatar.svg"></a>
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2014-2016 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/finalhandler/node_modules/debug/component.json b/wrt/node_modules/finalhandler/node_modules/debug/component.json
new file mode 100644 (file)
index 0000000..9de2641
--- /dev/null
@@ -0,0 +1,19 @@
+{
+  "name": "debug",
+  "repo": "visionmedia/debug",
+  "description": "small debugging utility",
+  "version": "2.6.9",
+  "keywords": [
+    "debug",
+    "log",
+    "debugger"
+  ],
+  "main": "src/browser.js",
+  "scripts": [
+    "src/browser.js",
+    "src/debug.js"
+  ],
+  "dependencies": {
+    "rauchg/ms.js": "0.7.1"
+  }
+}
diff --git a/wrt/node_modules/finalhandler/node_modules/debug/karma.conf.js b/wrt/node_modules/finalhandler/node_modules/debug/karma.conf.js
new file mode 100644 (file)
index 0000000..103a82d
--- /dev/null
@@ -0,0 +1,70 @@
+// Karma configuration
+// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC)
+
+module.exports = function(config) {
+  config.set({
+
+    // base path that will be used to resolve all patterns (eg. files, exclude)
+    basePath: '',
+
+
+    // frameworks to use
+    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
+    frameworks: ['mocha', 'chai', 'sinon'],
+
+
+    // list of files / patterns to load in the browser
+    files: [
+      'dist/debug.js',
+      'test/*spec.js'
+    ],
+
+
+    // list of files to exclude
+    exclude: [
+      'src/node.js'
+    ],
+
+
+    // preprocess matching files before serving them to the browser
+    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
+    preprocessors: {
+    },
+
+    // test results reporter to use
+    // possible values: 'dots', 'progress'
+    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
+    reporters: ['progress'],
+
+
+    // web server port
+    port: 9876,
+
+
+    // enable / disable colors in the output (reporters and logs)
+    colors: true,
+
+
+    // level of logging
+    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
+    logLevel: config.LOG_INFO,
+
+
+    // enable / disable watching file and executing tests whenever any file changes
+    autoWatch: true,
+
+
+    // start these browsers
+    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
+    browsers: ['PhantomJS'],
+
+
+    // Continuous Integration mode
+    // if true, Karma captures browsers, runs the tests and exits
+    singleRun: false,
+
+    // Concurrency level
+    // how many browser should be started simultaneous
+    concurrency: Infinity
+  })
+}
diff --git a/wrt/node_modules/finalhandler/node_modules/debug/node.js b/wrt/node_modules/finalhandler/node_modules/debug/node.js
new file mode 100644 (file)
index 0000000..7fc36fe
--- /dev/null
@@ -0,0 +1 @@
+module.exports = require('./src/node');
diff --git a/wrt/node_modules/finalhandler/node_modules/debug/package.json b/wrt/node_modules/finalhandler/node_modules/debug/package.json
new file mode 100644 (file)
index 0000000..4f6e753
--- /dev/null
@@ -0,0 +1,136 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "debug@2.6.9",
+        "scope": null,
+        "escapedName": "debug",
+        "name": "debug",
+        "rawSpec": "2.6.9",
+        "spec": "2.6.9",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/finalhandler"
+    ]
+  ],
+  "_from": "debug@2.6.9",
+  "_id": "debug@2.6.9",
+  "_inCache": true,
+  "_location": "/finalhandler/debug",
+  "_nodeVersion": "8.4.0",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/debug-2.6.9.tgz_1506087154503_0.5196126794908196"
+  },
+  "_npmUser": {
+    "name": "tootallnate",
+    "email": "nathan@tootallnate.net"
+  },
+  "_npmVersion": "5.3.0",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "debug@2.6.9",
+    "scope": null,
+    "escapedName": "debug",
+    "name": "debug",
+    "rawSpec": "2.6.9",
+    "spec": "2.6.9",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/finalhandler"
+  ],
+  "_resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+  "_shasum": "5d128515df134ff327e90a4c93f4e077a536341f",
+  "_shrinkwrap": null,
+  "_spec": "debug@2.6.9",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/finalhandler",
+  "author": {
+    "name": "TJ Holowaychuk",
+    "email": "tj@vision-media.ca"
+  },
+  "browser": "./src/browser.js",
+  "bugs": {
+    "url": "https://github.com/visionmedia/debug/issues"
+  },
+  "component": {
+    "scripts": {
+      "debug/index.js": "browser.js",
+      "debug/debug.js": "debug.js"
+    }
+  },
+  "contributors": [
+    {
+      "name": "Nathan Rajlich",
+      "email": "nathan@tootallnate.net",
+      "url": "http://n8.io"
+    },
+    {
+      "name": "Andrew Rhyne",
+      "email": "rhyneandrew@gmail.com"
+    }
+  ],
+  "dependencies": {
+    "ms": "2.0.0"
+  },
+  "description": "small debugging utility",
+  "devDependencies": {
+    "browserify": "9.0.3",
+    "chai": "^3.5.0",
+    "concurrently": "^3.1.0",
+    "coveralls": "^2.11.15",
+    "eslint": "^3.12.1",
+    "istanbul": "^0.4.5",
+    "karma": "^1.3.0",
+    "karma-chai": "^0.1.0",
+    "karma-mocha": "^1.3.0",
+    "karma-phantomjs-launcher": "^1.0.2",
+    "karma-sinon": "^1.0.5",
+    "mocha": "^3.2.0",
+    "mocha-lcov-reporter": "^1.2.0",
+    "rimraf": "^2.5.4",
+    "sinon": "^1.17.6",
+    "sinon-chai": "^2.8.0"
+  },
+  "directories": {},
+  "dist": {
+    "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+    "shasum": "5d128515df134ff327e90a4c93f4e077a536341f",
+    "tarball": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz"
+  },
+  "gitHead": "13abeae468fea297d0dccc50bc55590809241083",
+  "homepage": "https://github.com/visionmedia/debug#readme",
+  "keywords": [
+    "debug",
+    "log",
+    "debugger"
+  ],
+  "license": "MIT",
+  "main": "./src/index.js",
+  "maintainers": [
+    {
+      "name": "thebigredgeek",
+      "email": "rhyneandrew@gmail.com"
+    },
+    {
+      "name": "kolban",
+      "email": "kolban1@kolban.com"
+    },
+    {
+      "name": "tootallnate",
+      "email": "nathan@tootallnate.net"
+    },
+    {
+      "name": "tjholowaychuk",
+      "email": "tj@vision-media.ca"
+    }
+  ],
+  "name": "debug",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/visionmedia/debug.git"
+  },
+  "version": "2.6.9"
+}
diff --git a/wrt/node_modules/finalhandler/node_modules/debug/src/browser.js b/wrt/node_modules/finalhandler/node_modules/debug/src/browser.js
new file mode 100644 (file)
index 0000000..7106924
--- /dev/null
@@ -0,0 +1,185 @@
+/**
+ * This is the web browser implementation of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = require('./debug');
+exports.log = log;
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+exports.storage = 'undefined' != typeof chrome
+               && 'undefined' != typeof chrome.storage
+                  ? chrome.storage.local
+                  : localstorage();
+
+/**
+ * Colors.
+ */
+
+exports.colors = [
+  'lightseagreen',
+  'forestgreen',
+  'goldenrod',
+  'dodgerblue',
+  'darkorchid',
+  'crimson'
+];
+
+/**
+ * Currently only WebKit-based Web Inspectors, Firefox >= v31,
+ * and the Firebug extension (any Firefox version) are known
+ * to support "%c" CSS customizations.
+ *
+ * TODO: add a `localStorage` variable to explicitly enable/disable colors
+ */
+
+function useColors() {
+  // NB: In an Electron preload script, document will be defined but not fully
+  // initialized. Since we know we're in Chrome, we'll just detect this case
+  // explicitly
+  if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
+    return true;
+  }
+
+  // is webkit? http://stackoverflow.com/a/16459606/376773
+  // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
+  return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
+    // is firebug? http://stackoverflow.com/a/398120/376773
+    (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
+    // is firefox >= v31?
+    // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
+    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
+    // double check webkit in userAgent just in case we are in a worker
+    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
+}
+
+/**
+ * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
+ */
+
+exports.formatters.j = function(v) {
+  try {
+    return JSON.stringify(v);
+  } catch (err) {
+    return '[UnexpectedJSONParseError]: ' + err.message;
+  }
+};
+
+
+/**
+ * Colorize log arguments if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+  var useColors = this.useColors;
+
+  args[0] = (useColors ? '%c' : '')
+    + this.namespace
+    + (useColors ? ' %c' : ' ')
+    + args[0]
+    + (useColors ? '%c ' : ' ')
+    + '+' + exports.humanize(this.diff);
+
+  if (!useColors) return;
+
+  var c = 'color: ' + this.color;
+  args.splice(1, 0, c, 'color: inherit')
+
+  // the final "%c" is somewhat tricky, because there could be other
+  // arguments passed either before or after the %c, so we need to
+  // figure out the correct index to insert the CSS into
+  var index = 0;
+  var lastC = 0;
+  args[0].replace(/%[a-zA-Z%]/g, function(match) {
+    if ('%%' === match) return;
+    index++;
+    if ('%c' === match) {
+      // we only are interested in the *last* %c
+      // (the user may have provided their own)
+      lastC = index;
+    }
+  });
+
+  args.splice(lastC, 0, c);
+}
+
+/**
+ * Invokes `console.log()` when available.
+ * No-op when `console.log` is not a "function".
+ *
+ * @api public
+ */
+
+function log() {
+  // this hackery is required for IE8/9, where
+  // the `console.log` function doesn't have 'apply'
+  return 'object' === typeof console
+    && console.log
+    && Function.prototype.apply.call(console.log, console, arguments);
+}
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+
+function save(namespaces) {
+  try {
+    if (null == namespaces) {
+      exports.storage.removeItem('debug');
+    } else {
+      exports.storage.debug = namespaces;
+    }
+  } catch(e) {}
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+
+function load() {
+  var r;
+  try {
+    r = exports.storage.debug;
+  } catch(e) {}
+
+  // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
+  if (!r && typeof process !== 'undefined' && 'env' in process) {
+    r = process.env.DEBUG;
+  }
+
+  return r;
+}
+
+/**
+ * Enable namespaces listed in `localStorage.debug` initially.
+ */
+
+exports.enable(load());
+
+/**
+ * Localstorage attempts to return the localstorage.
+ *
+ * This is necessary because safari throws
+ * when a user disables cookies/localstorage
+ * and you attempt to access it.
+ *
+ * @return {LocalStorage}
+ * @api private
+ */
+
+function localstorage() {
+  try {
+    return window.localStorage;
+  } catch (e) {}
+}
diff --git a/wrt/node_modules/finalhandler/node_modules/debug/src/debug.js b/wrt/node_modules/finalhandler/node_modules/debug/src/debug.js
new file mode 100644 (file)
index 0000000..6a5e3fc
--- /dev/null
@@ -0,0 +1,202 @@
+
+/**
+ * This is the common logic for both the Node.js and web browser
+ * implementations of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
+exports.coerce = coerce;
+exports.disable = disable;
+exports.enable = enable;
+exports.enabled = enabled;
+exports.humanize = require('ms');
+
+/**
+ * The currently active debug mode names, and names to skip.
+ */
+
+exports.names = [];
+exports.skips = [];
+
+/**
+ * Map of special "%n" handling functions, for the debug "format" argument.
+ *
+ * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
+ */
+
+exports.formatters = {};
+
+/**
+ * Previous log timestamp.
+ */
+
+var prevTime;
+
+/**
+ * Select a color.
+ * @param {String} namespace
+ * @return {Number}
+ * @api private
+ */
+
+function selectColor(namespace) {
+  var hash = 0, i;
+
+  for (i in namespace) {
+    hash  = ((hash << 5) - hash) + namespace.charCodeAt(i);
+    hash |= 0; // Convert to 32bit integer
+  }
+
+  return exports.colors[Math.abs(hash) % exports.colors.length];
+}
+
+/**
+ * Create a debugger with the given `namespace`.
+ *
+ * @param {String} namespace
+ * @return {Function}
+ * @api public
+ */
+
+function createDebug(namespace) {
+
+  function debug() {
+    // disabled?
+    if (!debug.enabled) return;
+
+    var self = debug;
+
+    // set `diff` timestamp
+    var curr = +new Date();
+    var ms = curr - (prevTime || curr);
+    self.diff = ms;
+    self.prev = prevTime;
+    self.curr = curr;
+    prevTime = curr;
+
+    // turn the `arguments` into a proper Array
+    var args = new Array(arguments.length);
+    for (var i = 0; i < args.length; i++) {
+      args[i] = arguments[i];
+    }
+
+    args[0] = exports.coerce(args[0]);
+
+    if ('string' !== typeof args[0]) {
+      // anything else let's inspect with %O
+      args.unshift('%O');
+    }
+
+    // apply any `formatters` transformations
+    var index = 0;
+    args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
+      // if we encounter an escaped % then don't increase the array index
+      if (match === '%%') return match;
+      index++;
+      var formatter = exports.formatters[format];
+      if ('function' === typeof formatter) {
+        var val = args[index];
+        match = formatter.call(self, val);
+
+        // now we need to remove `args[index]` since it's inlined in the `format`
+        args.splice(index, 1);
+        index--;
+      }
+      return match;
+    });
+
+    // apply env-specific formatting (colors, etc.)
+    exports.formatArgs.call(self, args);
+
+    var logFn = debug.log || exports.log || console.log.bind(console);
+    logFn.apply(self, args);
+  }
+
+  debug.namespace = namespace;
+  debug.enabled = exports.enabled(namespace);
+  debug.useColors = exports.useColors();
+  debug.color = selectColor(namespace);
+
+  // env-specific initialization logic for debug instances
+  if ('function' === typeof exports.init) {
+    exports.init(debug);
+  }
+
+  return debug;
+}
+
+/**
+ * Enables a debug mode by namespaces. This can include modes
+ * separated by a colon and wildcards.
+ *
+ * @param {String} namespaces
+ * @api public
+ */
+
+function enable(namespaces) {
+  exports.save(namespaces);
+
+  exports.names = [];
+  exports.skips = [];
+
+  var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
+  var len = split.length;
+
+  for (var i = 0; i < len; i++) {
+    if (!split[i]) continue; // ignore empty strings
+    namespaces = split[i].replace(/\*/g, '.*?');
+    if (namespaces[0] === '-') {
+      exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
+    } else {
+      exports.names.push(new RegExp('^' + namespaces + '$'));
+    }
+  }
+}
+
+/**
+ * Disable debug output.
+ *
+ * @api public
+ */
+
+function disable() {
+  exports.enable('');
+}
+
+/**
+ * Returns true if the given mode name is enabled, false otherwise.
+ *
+ * @param {String} name
+ * @return {Boolean}
+ * @api public
+ */
+
+function enabled(name) {
+  var i, len;
+  for (i = 0, len = exports.skips.length; i < len; i++) {
+    if (exports.skips[i].test(name)) {
+      return false;
+    }
+  }
+  for (i = 0, len = exports.names.length; i < len; i++) {
+    if (exports.names[i].test(name)) {
+      return true;
+    }
+  }
+  return false;
+}
+
+/**
+ * Coerce `val`.
+ *
+ * @param {Mixed} val
+ * @return {Mixed}
+ * @api private
+ */
+
+function coerce(val) {
+  if (val instanceof Error) return val.stack || val.message;
+  return val;
+}
diff --git a/wrt/node_modules/finalhandler/node_modules/debug/src/index.js b/wrt/node_modules/finalhandler/node_modules/debug/src/index.js
new file mode 100644 (file)
index 0000000..e12cf4d
--- /dev/null
@@ -0,0 +1,10 @@
+/**
+ * Detect Electron renderer process, which is node, but we should
+ * treat as a browser.
+ */
+
+if (typeof process !== 'undefined' && process.type === 'renderer') {
+  module.exports = require('./browser.js');
+} else {
+  module.exports = require('./node.js');
+}
diff --git a/wrt/node_modules/finalhandler/node_modules/debug/src/inspector-log.js b/wrt/node_modules/finalhandler/node_modules/debug/src/inspector-log.js
new file mode 100644 (file)
index 0000000..60ea6c0
--- /dev/null
@@ -0,0 +1,15 @@
+module.exports = inspectorLog;
+
+// black hole
+const nullStream = new (require('stream').Writable)();
+nullStream._write = () => {};
+
+/**
+ * Outputs a `console.log()` to the Node.js Inspector console *only*.
+ */
+function inspectorLog() {
+  const stdout = console._stdout;
+  console._stdout = nullStream;
+  console.log.apply(console, arguments);
+  console._stdout = stdout;
+}
diff --git a/wrt/node_modules/finalhandler/node_modules/debug/src/node.js b/wrt/node_modules/finalhandler/node_modules/debug/src/node.js
new file mode 100644 (file)
index 0000000..b15109c
--- /dev/null
@@ -0,0 +1,248 @@
+/**
+ * Module dependencies.
+ */
+
+var tty = require('tty');
+var util = require('util');
+
+/**
+ * This is the Node.js implementation of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = require('./debug');
+exports.init = init;
+exports.log = log;
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+
+/**
+ * Colors.
+ */
+
+exports.colors = [6, 2, 3, 4, 5, 1];
+
+/**
+ * Build up the default `inspectOpts` object from the environment variables.
+ *
+ *   $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
+ */
+
+exports.inspectOpts = Object.keys(process.env).filter(function (key) {
+  return /^debug_/i.test(key);
+}).reduce(function (obj, key) {
+  // camel-case
+  var prop = key
+    .substring(6)
+    .toLowerCase()
+    .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });
+
+  // coerce string value into JS value
+  var val = process.env[key];
+  if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
+  else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
+  else if (val === 'null') val = null;
+  else val = Number(val);
+
+  obj[prop] = val;
+  return obj;
+}, {});
+
+/**
+ * The file descriptor to write the `debug()` calls to.
+ * Set the `DEBUG_FD` env variable to override with another value. i.e.:
+ *
+ *   $ DEBUG_FD=3 node script.js 3>debug.log
+ */
+
+var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
+
+if (1 !== fd && 2 !== fd) {
+  util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')()
+}
+
+var stream = 1 === fd ? process.stdout :
+             2 === fd ? process.stderr :
+             createWritableStdioStream(fd);
+
+/**
+ * Is stdout a TTY? Colored output is enabled when `true`.
+ */
+
+function useColors() {
+  return 'colors' in exports.inspectOpts
+    ? Boolean(exports.inspectOpts.colors)
+    : tty.isatty(fd);
+}
+
+/**
+ * Map %o to `util.inspect()`, all on a single line.
+ */
+
+exports.formatters.o = function(v) {
+  this.inspectOpts.colors = this.useColors;
+  return util.inspect(v, this.inspectOpts)
+    .split('\n').map(function(str) {
+      return str.trim()
+    }).join(' ');
+};
+
+/**
+ * Map %o to `util.inspect()`, allowing multiple lines if needed.
+ */
+
+exports.formatters.O = function(v) {
+  this.inspectOpts.colors = this.useColors;
+  return util.inspect(v, this.inspectOpts);
+};
+
+/**
+ * Adds ANSI color escape codes if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+  var name = this.namespace;
+  var useColors = this.useColors;
+
+  if (useColors) {
+    var c = this.color;
+    var prefix = '  \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m';
+
+    args[0] = prefix + args[0].split('\n').join('\n' + prefix);
+    args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m');
+  } else {
+    args[0] = new Date().toUTCString()
+      + ' ' + name + ' ' + args[0];
+  }
+}
+
+/**
+ * Invokes `util.format()` with the specified arguments and writes to `stream`.
+ */
+
+function log() {
+  return stream.write(util.format.apply(util, arguments) + '\n');
+}
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+
+function save(namespaces) {
+  if (null == namespaces) {
+    // If you set a process.env field to null or undefined, it gets cast to the
+    // string 'null' or 'undefined'. Just delete instead.
+    delete process.env.DEBUG;
+  } else {
+    process.env.DEBUG = namespaces;
+  }
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+
+function load() {
+  return process.env.DEBUG;
+}
+
+/**
+ * Copied from `node/src/node.js`.
+ *
+ * XXX: It's lame that node doesn't expose this API out-of-the-box. It also
+ * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.
+ */
+
+function createWritableStdioStream (fd) {
+  var stream;
+  var tty_wrap = process.binding('tty_wrap');
+
+  // Note stream._type is used for test-module-load-list.js
+
+  switch (tty_wrap.guessHandleType(fd)) {
+    case 'TTY':
+      stream = new tty.WriteStream(fd);
+      stream._type = 'tty';
+
+      // Hack to have stream not keep the event loop alive.
+      // See https://github.com/joyent/node/issues/1726
+      if (stream._handle && stream._handle.unref) {
+        stream._handle.unref();
+      }
+      break;
+
+    case 'FILE':
+      var fs = require('fs');
+      stream = new fs.SyncWriteStream(fd, { autoClose: false });
+      stream._type = 'fs';
+      break;
+
+    case 'PIPE':
+    case 'TCP':
+      var net = require('net');
+      stream = new net.Socket({
+        fd: fd,
+        readable: false,
+        writable: true
+      });
+
+      // FIXME Should probably have an option in net.Socket to create a
+      // stream from an existing fd which is writable only. But for now
+      // we'll just add this hack and set the `readable` member to false.
+      // Test: ./node test/fixtures/echo.js < /etc/passwd
+      stream.readable = false;
+      stream.read = null;
+      stream._type = 'pipe';
+
+      // FIXME Hack to have stream not keep the event loop alive.
+      // See https://github.com/joyent/node/issues/1726
+      if (stream._handle && stream._handle.unref) {
+        stream._handle.unref();
+      }
+      break;
+
+    default:
+      // Probably an error on in uv_guess_handle()
+      throw new Error('Implement me. Unknown stream file type!');
+  }
+
+  // For supporting legacy API we put the FD here.
+  stream.fd = fd;
+
+  stream._isStdio = true;
+
+  return stream;
+}
+
+/**
+ * Init logic for `debug` instances.
+ *
+ * Create a new `inspectOpts` object in case `useColors` is set
+ * differently for a particular `debug` instance.
+ */
+
+function init (debug) {
+  debug.inspectOpts = {};
+
+  var keys = Object.keys(exports.inspectOpts);
+  for (var i = 0; i < keys.length; i++) {
+    debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
+  }
+}
+
+/**
+ * Enable namespaces listed in `process.env.DEBUG` initially.
+ */
+
+exports.enable(load());
diff --git a/wrt/node_modules/finalhandler/package.json b/wrt/node_modules/finalhandler/package.json
new file mode 100644 (file)
index 0000000..318a6fa
--- /dev/null
@@ -0,0 +1,117 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "finalhandler@~1.0.4",
+        "scope": null,
+        "escapedName": "finalhandler",
+        "name": "finalhandler",
+        "rawSpec": "~1.0.4",
+        "spec": ">=1.0.4 <1.1.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express"
+    ]
+  ],
+  "_from": "finalhandler@>=1.0.4 <1.1.0",
+  "_id": "finalhandler@1.0.6",
+  "_inCache": true,
+  "_location": "/finalhandler",
+  "_nodeVersion": "6.11.1",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/finalhandler-1.0.6.tgz_1506104827410_0.847819667076692"
+  },
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "3.10.10",
+  "_phantomChildren": {
+    "ms": "2.0.0"
+  },
+  "_requested": {
+    "raw": "finalhandler@~1.0.4",
+    "scope": null,
+    "escapedName": "finalhandler",
+    "name": "finalhandler",
+    "rawSpec": "~1.0.4",
+    "spec": ">=1.0.4 <1.1.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/express"
+  ],
+  "_resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.0.6.tgz",
+  "_shasum": "007aea33d1a4d3e42017f624848ad58d212f814f",
+  "_shrinkwrap": null,
+  "_spec": "finalhandler@~1.0.4",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express",
+  "author": {
+    "name": "Douglas Christopher Wilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "bugs": {
+    "url": "https://github.com/pillarjs/finalhandler/issues"
+  },
+  "dependencies": {
+    "debug": "2.6.9",
+    "encodeurl": "~1.0.1",
+    "escape-html": "~1.0.3",
+    "on-finished": "~2.3.0",
+    "parseurl": "~1.3.2",
+    "statuses": "~1.3.1",
+    "unpipe": "~1.0.0"
+  },
+  "description": "Node.js final http responder",
+  "devDependencies": {
+    "eslint": "3.19.0",
+    "eslint-config-standard": "10.2.1",
+    "eslint-plugin-import": "2.7.0",
+    "eslint-plugin-markdown": "1.0.0-beta.6",
+    "eslint-plugin-node": "5.1.1",
+    "eslint-plugin-promise": "3.5.0",
+    "eslint-plugin-standard": "3.0.1",
+    "istanbul": "0.4.5",
+    "mocha": "2.5.3",
+    "readable-stream": "2.3.3",
+    "safe-buffer": "5.1.1",
+    "supertest": "1.1.0"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "007aea33d1a4d3e42017f624848ad58d212f814f",
+    "tarball": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.0.6.tgz"
+  },
+  "engines": {
+    "node": ">= 0.8"
+  },
+  "files": [
+    "LICENSE",
+    "HISTORY.md",
+    "index.js"
+  ],
+  "gitHead": "ed4c24d4d7f78b3136ca7d0e7215541cb921a980",
+  "homepage": "https://github.com/pillarjs/finalhandler#readme",
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "name": "finalhandler",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/pillarjs/finalhandler.git"
+  },
+  "scripts": {
+    "lint": "eslint --plugin markdown --ext js,md .",
+    "test": "mocha --reporter spec --bail --check-leaks test/",
+    "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/"
+  },
+  "version": "1.0.6"
+}
diff --git a/wrt/node_modules/forwarded/HISTORY.md b/wrt/node_modules/forwarded/HISTORY.md
new file mode 100644 (file)
index 0000000..2599a55
--- /dev/null
@@ -0,0 +1,16 @@
+0.1.2 / 2017-09-14
+==================
+
+  * perf: improve header parsing
+  * perf: reduce overhead when no `X-Forwarded-For` header
+
+0.1.1 / 2017-09-10
+==================
+
+  * Fix trimming leading / trailing OWS
+  * perf: hoist regular expression
+
+0.1.0 / 2014-09-21
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/forwarded/LICENSE b/wrt/node_modules/forwarded/LICENSE
new file mode 100644 (file)
index 0000000..84441fb
--- /dev/null
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2014-2017 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/forwarded/README.md b/wrt/node_modules/forwarded/README.md
new file mode 100644 (file)
index 0000000..c776ee5
--- /dev/null
@@ -0,0 +1,57 @@
+# forwarded
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+Parse HTTP X-Forwarded-For header
+
+## Installation
+
+This is a [Node.js](https://nodejs.org/en/) module available through the
+[npm registry](https://www.npmjs.com/). Installation is done using the
+[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
+
+```sh
+$ npm install forwarded
+```
+
+## API
+
+```js
+var forwarded = require('forwarded')
+```
+
+### forwarded(req)
+
+```js
+var addresses = forwarded(req)
+```
+
+Parse the `X-Forwarded-For` header from the request. Returns an array
+of the addresses, including the socket address for the `req`, in reverse
+order (i.e. index `0` is the socket address and the last index is the
+furthest address, typically the end-user).
+
+## Testing
+
+```sh
+$ npm test
+```
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/forwarded.svg
+[npm-url]: https://npmjs.org/package/forwarded
+[node-version-image]: https://img.shields.io/node/v/forwarded.svg
+[node-version-url]: https://nodejs.org/en/download/
+[travis-image]: https://img.shields.io/travis/jshttp/forwarded/master.svg
+[travis-url]: https://travis-ci.org/jshttp/forwarded
+[coveralls-image]: https://img.shields.io/coveralls/jshttp/forwarded/master.svg
+[coveralls-url]: https://coveralls.io/r/jshttp/forwarded?branch=master
+[downloads-image]: https://img.shields.io/npm/dm/forwarded.svg
+[downloads-url]: https://npmjs.org/package/forwarded
diff --git a/wrt/node_modules/forwarded/index.js b/wrt/node_modules/forwarded/index.js
new file mode 100644 (file)
index 0000000..7833b3d
--- /dev/null
@@ -0,0 +1,76 @@
+/*!
+ * forwarded
+ * Copyright(c) 2014-2017 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = forwarded
+
+/**
+ * Get all addresses in the request, using the `X-Forwarded-For` header.
+ *
+ * @param {object} req
+ * @return {array}
+ * @public
+ */
+
+function forwarded (req) {
+  if (!req) {
+    throw new TypeError('argument req is required')
+  }
+
+  // simple header parsing
+  var proxyAddrs = parse(req.headers['x-forwarded-for'] || '')
+  var socketAddr = req.connection.remoteAddress
+  var addrs = [socketAddr].concat(proxyAddrs)
+
+  // return all addresses
+  return addrs
+}
+
+/**
+ * Parse the X-Forwarded-For header.
+ *
+ * @param {string} header
+ * @private
+ */
+
+function parse (header) {
+  var end = header.length
+  var list = []
+  var start = header.length
+
+  // gather addresses, backwards
+  for (var i = header.length - 1; i >= 0; i--) {
+    switch (header.charCodeAt(i)) {
+      case 0x20: /*   */
+        if (start === end) {
+          start = end = i
+        }
+        break
+      case 0x2c: /* , */
+        if (start !== end) {
+          list.push(header.substring(start, end))
+        }
+        start = end = i
+        break
+      default:
+        start = i
+        break
+    }
+  }
+
+  // final address
+  if (start !== end) {
+    list.push(header.substring(start, end))
+  }
+
+  return list
+}
diff --git a/wrt/node_modules/forwarded/package.json b/wrt/node_modules/forwarded/package.json
new file mode 100644 (file)
index 0000000..6946dcb
--- /dev/null
@@ -0,0 +1,114 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "forwarded@~0.1.0",
+        "scope": null,
+        "escapedName": "forwarded",
+        "name": "forwarded",
+        "rawSpec": "~0.1.0",
+        "spec": ">=0.1.0 <0.2.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/proxy-addr"
+    ]
+  ],
+  "_from": "forwarded@>=0.1.0 <0.2.0",
+  "_id": "forwarded@0.1.2",
+  "_inCache": true,
+  "_location": "/forwarded",
+  "_nodeVersion": "6.11.1",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/forwarded-0.1.2.tgz_1505441873168_0.0936233215034008"
+  },
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "3.10.10",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "forwarded@~0.1.0",
+    "scope": null,
+    "escapedName": "forwarded",
+    "name": "forwarded",
+    "rawSpec": "~0.1.0",
+    "spec": ">=0.1.0 <0.2.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/proxy-addr"
+  ],
+  "_resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz",
+  "_shasum": "98c23dab1175657b8c0573e8ceccd91b0ff18c84",
+  "_shrinkwrap": null,
+  "_spec": "forwarded@~0.1.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/proxy-addr",
+  "bugs": {
+    "url": "https://github.com/jshttp/forwarded/issues"
+  },
+  "contributors": [
+    {
+      "name": "Douglas Christopher Wilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "dependencies": {},
+  "description": "Parse HTTP X-Forwarded-For header",
+  "devDependencies": {
+    "beautify-benchmark": "0.2.4",
+    "benchmark": "2.1.4",
+    "eslint": "3.19.0",
+    "eslint-config-standard": "10.2.1",
+    "eslint-plugin-import": "2.7.0",
+    "eslint-plugin-node": "5.1.1",
+    "eslint-plugin-promise": "3.5.0",
+    "eslint-plugin-standard": "3.0.1",
+    "istanbul": "0.4.5",
+    "mocha": "1.21.5"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "98c23dab1175657b8c0573e8ceccd91b0ff18c84",
+    "tarball": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz"
+  },
+  "engines": {
+    "node": ">= 0.6"
+  },
+  "files": [
+    "LICENSE",
+    "HISTORY.md",
+    "README.md",
+    "index.js"
+  ],
+  "gitHead": "2fc094b49781b62acb0e2b00f83abd641d604a7c",
+  "homepage": "https://github.com/jshttp/forwarded#readme",
+  "keywords": [
+    "x-forwarded-for",
+    "http",
+    "req"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "name": "forwarded",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/jshttp/forwarded.git"
+  },
+  "scripts": {
+    "bench": "node benchmark/index.js",
+    "lint": "eslint .",
+    "test": "mocha --reporter spec --bail --check-leaks test/",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
+    "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
+  },
+  "version": "0.1.2"
+}
diff --git a/wrt/node_modules/fresh/HISTORY.md b/wrt/node_modules/fresh/HISTORY.md
new file mode 100644 (file)
index 0000000..edd6c05
--- /dev/null
@@ -0,0 +1,58 @@
+0.5.0 / 2017-02-21
+==================
+
+  * Fix incorrect result when `If-None-Match` has both `*` and ETags
+  * Fix weak `ETag` matching to match spec
+  * perf: delay reading header values until needed
+  * perf: skip checking modified time if ETag check failed
+  * perf: skip parsing `If-None-Match` when no `ETag` header
+  * perf: use `Date.parse` instead of `new Date`
+
+0.4.0 / 2017-02-05
+==================
+
+  * Fix false detection of `no-cache` request directive
+  * perf: enable strict mode
+  * perf: hoist regular expressions
+  * perf: remove duplicate conditional
+  * perf: remove unnecessary boolean coercions
+
+0.3.0 / 2015-05-12
+==================
+
+  * Add weak `ETag` matching support
+
+0.2.4 / 2014-09-07
+==================
+
+  * Support Node.js 0.6
+
+0.2.3 / 2014-09-07
+==================
+
+  * Move repository to jshttp
+
+0.2.2 / 2014-02-19
+==================
+
+  * Revert "Fix for blank page on Safari reload"
+
+0.2.1 / 2014-01-29
+==================
+
+  * Fix for blank page on Safari reload
+
+0.2.0 / 2013-08-11
+==================
+
+  * Return stale for `Cache-Control: no-cache`
+
+0.1.0 / 2012-06-15
+==================
+
+  * Add `If-None-Match: *` support
+
+0.0.1 / 2012-06-10
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/fresh/LICENSE b/wrt/node_modules/fresh/LICENSE
new file mode 100644 (file)
index 0000000..1434ade
--- /dev/null
@@ -0,0 +1,23 @@
+(The MIT License)
+
+Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca>
+Copyright (c) 2016-2017 Douglas Christopher Wilson <doug@somethingdoug.com>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/fresh/README.md b/wrt/node_modules/fresh/README.md
new file mode 100644 (file)
index 0000000..d2b63e5
--- /dev/null
@@ -0,0 +1,113 @@
+# fresh
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+HTTP response freshness testing
+
+## Installation
+
+This is a [Node.js](https://nodejs.org/en/) module available through the
+[npm registry](https://www.npmjs.com/). Installation is done using the
+[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
+
+```
+$ npm install fresh
+```
+
+## API
+
+```js
+var fresh = require('fresh')
+```
+
+### fresh(reqHeaders, resHeaders)
+
+Check freshness of the response using request and response headers.
+
+When the response is still "fresh" in the client's cache `true` is
+returned, otherwise `false` is returned to indicate that the client
+cache is now stale and the full response should be sent.
+
+When a client sends the `Cache-Control: no-cache` request header to
+indicate an end-to-end reload request, this module will return `false`
+to make handling these requests transparent.
+
+## Known Issues
+
+This module is designed to only follow the HTTP specifications, not
+to work-around all kinda of client bugs (especially since this module
+typically does not recieve enough information to understand what the
+client actually is).
+
+There is a known issue that in certain versions of Safari, Safari
+will incorrectly make a request that allows this module to validate
+freshness of the resource even when Safari does not have a
+representation of the resource in the cache. The module
+[jumanji](https://www.npmjs.com/package/jumanji) can be used in
+an Express application to work-around this issue and also provides
+links to further reading on this Safari bug.
+
+## Example
+
+### API usage
+
+```js
+var reqHeaders = { 'if-none-match': '"foo"' }
+var resHeaders = { 'etag': '"bar"' }
+fresh(reqHeaders, resHeaders)
+// => false
+
+var reqHeaders = { 'if-none-match': '"foo"' }
+var resHeaders = { 'etag': '"foo"' }
+fresh(reqHeaders, resHeaders)
+// => true
+```
+
+### Using with Node.js http server
+
+```js
+var fresh = require('fresh')
+var http = require('http')
+
+var server = http.createServer(function (req, res) {
+  // perform server logic
+  // ... including adding ETag / Last-Modified response headers
+
+  if (isFresh(req, res)) {
+    // client has a fresh copy of resource
+    res.statusCode = 304
+    res.end()
+    return
+  }
+
+  // send the resource
+})
+
+function isFresh (req, res) {
+  return fresh(req.headers, {
+    'etag': res.getHeader('ETag'),
+    'last-modified': res.getHeader('Last-Modified')
+  })
+}
+
+server.listen(3000)
+```
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/fresh.svg
+[npm-url]: https://npmjs.org/package/fresh
+[node-version-image]: https://img.shields.io/node/v/fresh.svg
+[node-version-url]: https://nodejs.org/en/
+[travis-image]: https://img.shields.io/travis/jshttp/fresh/master.svg
+[travis-url]: https://travis-ci.org/jshttp/fresh
+[coveralls-image]: https://img.shields.io/coveralls/jshttp/fresh/master.svg
+[coveralls-url]: https://coveralls.io/r/jshttp/fresh?branch=master
+[downloads-image]: https://img.shields.io/npm/dm/fresh.svg
+[downloads-url]: https://npmjs.org/package/fresh
diff --git a/wrt/node_modules/fresh/index.js b/wrt/node_modules/fresh/index.js
new file mode 100644 (file)
index 0000000..bd9812e
--- /dev/null
@@ -0,0 +1,81 @@
+/*!
+ * fresh
+ * Copyright(c) 2012 TJ Holowaychuk
+ * Copyright(c) 2016-2017 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * RegExp to check for no-cache token in Cache-Control.
+ * @private
+ */
+
+var CACHE_CONTROL_NO_CACHE_REGEXP = /(?:^|,)\s*?no-cache\s*?(?:,|$)/
+
+/**
+ * Simple expression to split token list.
+ * @private
+ */
+
+var TOKEN_LIST_REGEXP = / *, */
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = fresh
+
+/**
+ * Check freshness of the response using request and response headers.
+ *
+ * @param {Object} reqHeaders
+ * @param {Object} resHeaders
+ * @return {Boolean}
+ * @public
+ */
+
+function fresh (reqHeaders, resHeaders) {
+  // fields
+  var modifiedSince = reqHeaders['if-modified-since']
+  var noneMatch = reqHeaders['if-none-match']
+
+  // unconditional request
+  if (!modifiedSince && !noneMatch) {
+    return false
+  }
+
+  // Always return stale when Cache-Control: no-cache
+  // to support end-to-end reload requests
+  // https://tools.ietf.org/html/rfc2616#section-14.9.4
+  var cacheControl = reqHeaders['cache-control']
+  if (cacheControl && CACHE_CONTROL_NO_CACHE_REGEXP.test(cacheControl)) {
+    return false
+  }
+
+  // if-none-match
+  if (noneMatch && noneMatch !== '*') {
+    var etag = resHeaders['etag']
+    var etagStale = !etag || noneMatch.split(TOKEN_LIST_REGEXP).every(function (match) {
+      return match !== etag && match !== 'W/' + etag && 'W/' + match !== etag
+    })
+
+    if (etagStale) {
+      return false
+    }
+  }
+
+  // if-modified-since
+  if (modifiedSince) {
+    var lastModified = resHeaders['last-modified']
+    var modifiedStale = !lastModified || Date.parse(lastModified) > Date.parse(modifiedSince)
+
+    if (modifiedStale) {
+      return false
+    }
+  }
+
+  return true
+}
diff --git a/wrt/node_modules/fresh/package.json b/wrt/node_modules/fresh/package.json
new file mode 100644 (file)
index 0000000..1b8ae04
--- /dev/null
@@ -0,0 +1,120 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "fresh@0.5.0",
+        "scope": null,
+        "escapedName": "fresh",
+        "name": "fresh",
+        "rawSpec": "0.5.0",
+        "spec": "0.5.0",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express"
+    ]
+  ],
+  "_from": "fresh@0.5.0",
+  "_id": "fresh@0.5.0",
+  "_inCache": true,
+  "_location": "/fresh",
+  "_nodeVersion": "4.7.3",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/fresh-0.5.0.tgz_1487738798128_0.4817247486207634"
+  },
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "2.15.11",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "fresh@0.5.0",
+    "scope": null,
+    "escapedName": "fresh",
+    "name": "fresh",
+    "rawSpec": "0.5.0",
+    "spec": "0.5.0",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/express",
+    "/send"
+  ],
+  "_resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.0.tgz",
+  "_shasum": "f474ca5e6a9246d6fd8e0953cfa9b9c805afa78e",
+  "_shrinkwrap": null,
+  "_spec": "fresh@0.5.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express",
+  "author": {
+    "name": "TJ Holowaychuk",
+    "email": "tj@vision-media.ca",
+    "url": "http://tjholowaychuk.com"
+  },
+  "bugs": {
+    "url": "https://github.com/jshttp/fresh/issues"
+  },
+  "contributors": [
+    {
+      "name": "Douglas Christopher Wilson",
+      "email": "doug@somethingdoug.com"
+    },
+    {
+      "name": "Jonathan Ong",
+      "email": "me@jongleberry.com",
+      "url": "http://jongleberry.com"
+    }
+  ],
+  "dependencies": {},
+  "description": "HTTP response freshness testing",
+  "devDependencies": {
+    "eslint": "3.16.0",
+    "eslint-config-standard": "6.2.1",
+    "eslint-plugin-promise": "3.4.2",
+    "eslint-plugin-standard": "2.0.1",
+    "istanbul": "0.4.5",
+    "mocha": "1.21.5"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "f474ca5e6a9246d6fd8e0953cfa9b9c805afa78e",
+    "tarball": "https://registry.npmjs.org/fresh/-/fresh-0.5.0.tgz"
+  },
+  "engines": {
+    "node": ">= 0.6"
+  },
+  "files": [
+    "HISTORY.md",
+    "LICENSE",
+    "index.js"
+  ],
+  "gitHead": "b1d26abb390d5dd1d9b82f0a5b890ab0ef1fee5c",
+  "homepage": "https://github.com/jshttp/fresh#readme",
+  "keywords": [
+    "fresh",
+    "http",
+    "conditional",
+    "cache"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "name": "fresh",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/jshttp/fresh.git"
+  },
+  "scripts": {
+    "lint": "eslint .",
+    "test": "mocha --reporter spec --bail --check-leaks test/",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
+    "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
+  },
+  "version": "0.5.0"
+}
diff --git a/wrt/node_modules/fs-plus/LICENSE.md b/wrt/node_modules/fs-plus/LICENSE.md
new file mode 100644 (file)
index 0000000..493db50
--- /dev/null
@@ -0,0 +1,20 @@
+Copyright (c) 2013 GitHub Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/fs-plus/README.md b/wrt/node_modules/fs-plus/README.md
new file mode 100644 (file)
index 0000000..c9d439f
--- /dev/null
@@ -0,0 +1,235 @@
+# fs plus
+[![macOS Build Status](https://travis-ci.org/atom/fs-plus.svg?branch=master)](https://travis-ci.org/atom/fs-plus)
+[![Windows Build Status](https://ci.appveyor.com/api/projects/status/gf2tleqp0hdek3o3/branch/master?svg=true)](https://ci.appveyor.com/project/Atom/fs-plus/branch/master)
+[![Dependency Status](https://david-dm.org/atom/fs-plus.svg)](https://david-dm.org/atom/fs-plus)
+
+Yet another filesystem helper based on node's [fs](http://nodejs.org/api/fs.html)
+module.  This library exports everything from node's fs module but with some
+extra helpers.
+
+## Using
+
+```sh
+npm install fs-plus
+```
+
+```coffee
+fs = require 'fs-plus'
+```
+
+## Documentation
+
+### `getHomeDirectory()`
+Returns the absolute path to the home directory.
+
+### `absolute(relativePath)`
+Make the given path absolute by resolving it against the current
+working directory.
+
+### Params
+
+ - **String** `relativePath`: The string representing the relative path. If the
+   path is prefixed with '~', it will be expanded to the current user's home
+   directory.
+
+### Return
+
+ - **String**: The absolute path or the relative path if it's unable to
+   determine its real path.
+
+### `normalize(pathToNormalize)`
+Normalize the given path treating a leading `~` segment as referring to the
+home directory. This method does not query the filesystem.
+
+#### Params
+
+ - **String** `pathToNormalize`: The string containing the abnormal path. If the
+   path is prefixed with '~', it will be expanded to the current user's home
+   directory.
+
+#### Return
+ - **String** Returns a normalized path.
+
+### `tildify(pathToTildify)`
+Convert an absolute path to tilde path for linux and mac:
+/Users/username/dev => ~/dev
+
+#### Params
+
+ - **String** `pathToTildify`: The string containing the full path.
+
+#### Return
+ - **String** Returns a tildified path.
+
+### `getAppDataDirectory()`
+Get path to store application specific data.
+
+#### Return
+ - **String** Returns the absolute path or null if platform isn't supported
+
+    - Mac: `~/Library/Application Support/`
+    - Win: `%AppData%`
+    - Linux: `/var/lib`
+
+### `isAbsolute(pathToCheck)`
+Is the given path absolute?
+
+#### Params
+ - **String** `pathToCheck`: The relative or absolute path to check.
+
+#### Return
+ - **Bolean** Returns `true` if the path is absolute, `false` otherwise.
+
+### `existsSync(pathToCheck)`
+Returns `true` if a file or folder at the specified path exists.
+
+### `isDirectorySync(directoryPath)`
+Returns `true` if the given path exists and is a directory.
+
+### `isDirectory(directoryPath)`
+Asynchronously checks that the given path exists and is a directory.
+
+### `isFileSync(filePath)`
+Returns true if the specified path exists and is a file.
+
+### `isSymbolicLinkSync(symlinkPath)`
+Returns `true` if the specified path is a symbolic link.
+
+### `isSymbolicLink(symlinkPath, callback)`
+Calls back with `true` if the specified path is a symbolic link.
+
+### `isExecutableSync(pathToCheck)`
+Returns `true` if the specified path is executable.
+
+### `getSizeSync(pathToCheck)`
+Returns the size of the specified path.
+
+### `listSync(rootPath, extensions)`
+Returns an Array with the paths of the files and directories
+contained within the directory path. It is not recursive.
+
+## Params
+ - **String** `rootPath`: The absolute path to the directory to list.
+ - **Array** `extensions`: An array of extensions to filter the results by. If none are
+   given, none are filtered (optional).
+
+### `list(rootPath, extensions)`
+Asynchronously lists the files and directories in the given path. The listing is not recursive.
+
+### `listTreeSync(rootPath)`
+Get all paths under the given path.
+
+#### Params
+ - **String** `rootPath` The {String} path to start at.
+
+#### Return
+ - **Array** Returns an array of strings under the given path.
+
+### `moveSync(source, target)`
+Moves the file or directory to the target synchronously.
+
+### `removeSync(pathToRemove)`
+Removes the file or directory at the given path synchronously.
+
+### `writeFileSync(filePath, content, options)`
+Open, write, flush, and close a file, writing the given content synchronously.
+It also creates the necessary parent directories.
+
+### `writeFile(filePath, content, options, callback)`
+Open, write, flush, and close a file, writing the given content
+asynchronously.
+It also creates the necessary parent directories.
+
+### `copySync(sourcePath, destinationPath)`
+Copies the given path recursively and synchronously.
+
+### `makeTreeSync(directoryPath)`
+Create a directory at the specified path including any missing
+parent directories synchronously.
+
+### `makeTree(directoryPath, callback)`
+Create a directory at the specified path including any missing
+parent directories asynchronously.
+
+### `traverseTreeSync(rootPath, onFile, onDirectory)`
+Recursively walk the given path and execute the given functions
+synchronously.
+
+#### Params
+ - **String** `rootPath`: The string containing the directory to recurse into.
+ - **Function** `onFile`: The function to execute on each file, receives a single argument
+   the absolute path.
+ - **Function** `onDirectory`: The function to execute on each directory, receives a single
+   argument the absolute path (defaults to onFile). If this
+   function returns a falsy value then the directory is not
+   entered.
+
+### `traverseTree(rootPath, onFile, onDirectory, onDone)`
+Public: Recursively walk the given path and execute the given functions
+asynchronously.
+
+### `md5ForPath(pathToDigest)`
+Hashes the contents of the given file.
+
+#### Params
+ - **String** `pathToDigest`: The string containing the absolute path.
+
+#### Return
+ - **String** Returns a string containing the MD5 hexadecimal hash.
+
+### `resolve(loadPaths, pathToResolve, extensions)`
+Finds a relative path among the given array of paths.
+
+#### Params
+ - **Array** `loadPaths`: An array of absolute and relative paths to search.
+ - **String** `pathToResolve` The string containing the path to resolve.
+ - **Array** `extensions` An array of extensions to pass to {resolveExtensions} in
+   which case pathToResolve should not contain an extension
+   (optional).
+
+#### Return
+Returns the absolute path of the file to be resolved if it's found and
+undefined otherwise.
+
+### `resolveOnLoadPath()`
+Like `.resolve` but uses node's modules paths as the load paths to
+search.
+
+### `resolveExtension(pathToResolve, extensions)`
+Finds the first file in the given path which matches the extension
+in the order given.
+
+#### Params
+ - **String** `pathToResolve`: the string containing relative or absolute path of the
+   file in question without the extension or '.'.
+ - **Array** `extensions`: the ordered array of extensions to try.
+
+#### Return
+Returns the absolute path of the file if it exists with any of the given
+extensions, otherwise it's undefined.
+
+### `isCompressedExtension(ext)`
+Returns true for extensions associated with compressed files.
+
+### `isImageExtension(ext)`
+Returns true for extensions associated with image files.
+
+### `isPdfExtension(ext)`
+Returns true for extensions associated with pdf files.
+
+### `isBinaryExtension(ext)`
+Returns true for extensions associated with binary files.
+
+### `isReadmePath(readmePath)`
+Returns true for files named similarily to 'README'
+
+### `isMarkdownExtension(ext)`
+Returns true for extensions associated with Markdown files.
+
+### `isCaseInsensitive()`
+Is the filesystem case insensitive?
+Returns `true` if case insensitive, `false` otherwise.
+
+### `isCaseSensitive()`
+Is the filesystem case sensitive?
+Returns `true` if case sensitive, `false` otherwise.
diff --git a/wrt/node_modules/fs-plus/appveyor.yml b/wrt/node_modules/fs-plus/appveyor.yml
new file mode 100644 (file)
index 0000000..9b76f4f
--- /dev/null
@@ -0,0 +1,17 @@
+environment:
+  nodejs_version: "6"
+
+platform:
+  - x64
+  - x86
+
+install:
+  - ps: Install-Product node $env:nodejs_version
+  - npm install
+
+test_script:
+  - node -e "console.log(`${process.version} ${process.arch} ${process.platform}`)"
+  - npm --version
+  - npm test
+
+build: off
diff --git a/wrt/node_modules/fs-plus/lib/fs-plus.js b/wrt/node_modules/fs-plus/lib/fs-plus.js
new file mode 100644 (file)
index 0000000..f6a26cf
--- /dev/null
@@ -0,0 +1,699 @@
+(function() {
+  var BINARY_EXTENSIONS, COMPRESSED_EXTENSIONS, IMAGE_EXTENSIONS, MARKDOWN_EXTENSIONS, Module, async, fs, fsPlus, isMoveTargetValid, isMoveTargetValidSync, isPathValid, lstatSyncNoException, mkdirp, path, rimraf, statSyncNoException, _,
+    __slice = [].slice;
+
+  fs = require('fs');
+
+  Module = require('module');
+
+  path = require('path');
+
+  _ = require('underscore-plus');
+
+  async = require('async');
+
+  mkdirp = require('mkdirp');
+
+  rimraf = require('rimraf');
+
+  fsPlus = {
+    getHomeDirectory: function() {
+      if (process.platform === 'win32') {
+        return process.env.USERPROFILE;
+      } else {
+        return process.env.HOME;
+      }
+    },
+    absolute: function(relativePath) {
+      var e;
+      if (relativePath == null) {
+        return null;
+      }
+      relativePath = fsPlus.resolveHome(relativePath);
+      try {
+        return fs.realpathSync(relativePath);
+      } catch (_error) {
+        e = _error;
+        return relativePath;
+      }
+    },
+    normalize: function(pathToNormalize) {
+      if (pathToNormalize == null) {
+        return null;
+      }
+      return fsPlus.resolveHome(path.normalize(pathToNormalize.toString()));
+    },
+    resolveHome: function(relativePath) {
+      if (relativePath === '~') {
+        return fsPlus.getHomeDirectory();
+      } else if (relativePath.indexOf("~" + path.sep) === 0) {
+        return "" + (fsPlus.getHomeDirectory()) + (relativePath.substring(1));
+      }
+      return relativePath;
+    },
+    tildify: function(pathToTildify) {
+      var homeDir, normalized;
+      if (process.platform === 'win32') {
+        return pathToTildify;
+      }
+      normalized = fsPlus.normalize(pathToTildify);
+      homeDir = fsPlus.getHomeDirectory();
+      if (normalized === homeDir) {
+        return '~';
+      }
+      if (!normalized.startsWith(path.join(homeDir, path.sep))) {
+        return pathToTildify;
+      }
+      return path.join('~', path.sep, normalized.substring(homeDir.length + 1));
+    },
+    getAppDataDirectory: function() {
+      switch (process.platform) {
+        case 'darwin':
+          return fsPlus.absolute(path.join('~', 'Library', 'Application Support'));
+        case 'linux':
+          return '/var/lib';
+        case 'win32':
+          return process.env.APPDATA;
+        default:
+          return null;
+      }
+    },
+    isAbsolute: function(pathToCheck) {
+      if (pathToCheck == null) {
+        pathToCheck = '';
+      }
+      if (process.platform === 'win32') {
+        if (pathToCheck[1] === ':') {
+          return true;
+        }
+        if (pathToCheck[0] === '\\' && pathToCheck[1] === '\\') {
+          return true;
+        }
+      } else {
+        return pathToCheck[0] === '/';
+      }
+      return false;
+    },
+    existsSync: function(pathToCheck) {
+      return isPathValid(pathToCheck) && (statSyncNoException(pathToCheck) !== false);
+    },
+    isDirectorySync: function(directoryPath) {
+      var stat;
+      if (!isPathValid(directoryPath)) {
+        return false;
+      }
+      if (stat = statSyncNoException(directoryPath)) {
+        return stat.isDirectory();
+      } else {
+        return false;
+      }
+    },
+    isDirectory: function(directoryPath, done) {
+      if (!isPathValid(directoryPath)) {
+        return done(false);
+      }
+      return fs.stat(directoryPath, function(error, stat) {
+        if (error != null) {
+          return done(false);
+        } else {
+          return done(stat.isDirectory());
+        }
+      });
+    },
+    isFileSync: function(filePath) {
+      var stat;
+      if (!isPathValid(filePath)) {
+        return false;
+      }
+      if (stat = statSyncNoException(filePath)) {
+        return stat.isFile();
+      } else {
+        return false;
+      }
+    },
+    isSymbolicLinkSync: function(symlinkPath) {
+      var stat;
+      if (!isPathValid(symlinkPath)) {
+        return false;
+      }
+      if (stat = lstatSyncNoException(symlinkPath)) {
+        return stat.isSymbolicLink();
+      } else {
+        return false;
+      }
+    },
+    isSymbolicLink: function(symlinkPath, callback) {
+      if (isPathValid(symlinkPath)) {
+        return fs.lstat(symlinkPath, function(error, stat) {
+          return typeof callback === "function" ? callback((stat != null) && stat.isSymbolicLink()) : void 0;
+        });
+      } else {
+        return process.nextTick(function() {
+          return typeof callback === "function" ? callback(false) : void 0;
+        });
+      }
+    },
+    isExecutableSync: function(pathToCheck) {
+      var stat;
+      if (!isPathValid(pathToCheck)) {
+        return false;
+      }
+      if (stat = statSyncNoException(pathToCheck)) {
+        return (stat.mode & 0x1ff & 1) !== 0;
+      } else {
+        return false;
+      }
+    },
+    getSizeSync: function(pathToCheck) {
+      var _ref;
+      if (isPathValid(pathToCheck)) {
+        return (_ref = statSyncNoException(pathToCheck).size) != null ? _ref : -1;
+      } else {
+        return -1;
+      }
+    },
+    listSync: function(rootPath, extensions) {
+      var paths;
+      if (!fsPlus.isDirectorySync(rootPath)) {
+        return [];
+      }
+      paths = fs.readdirSync(rootPath);
+      if (extensions) {
+        paths = fsPlus.filterExtensions(paths, extensions);
+      }
+      paths = paths.sort(function(a, b) {
+        return a.toLowerCase().localeCompare(b.toLowerCase());
+      });
+      paths = paths.map(function(childPath) {
+        return path.join(rootPath, childPath);
+      });
+      return paths;
+    },
+    list: function() {
+      var done, extensions, rest, rootPath;
+      rootPath = arguments[0], rest = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
+      if (rest.length > 1) {
+        extensions = rest.shift();
+      }
+      done = rest.shift();
+      return fs.readdir(rootPath, function(error, paths) {
+        if (error != null) {
+          return done(error);
+        } else {
+          if (extensions) {
+            paths = fsPlus.filterExtensions(paths, extensions);
+          }
+          paths = paths.sort(function(a, b) {
+            return a.toLowerCase().localeCompare(b.toLowerCase());
+          });
+          paths = paths.map(function(childPath) {
+            return path.join(rootPath, childPath);
+          });
+          return done(null, paths);
+        }
+      });
+    },
+    filterExtensions: function(paths, extensions) {
+      extensions = extensions.map(function(ext) {
+        if (ext === '') {
+          return ext;
+        } else {
+          return '.' + ext.replace(/^\./, '');
+        }
+      });
+      return paths.filter(function(pathToCheck) {
+        return _.include(extensions, path.extname(pathToCheck));
+      });
+    },
+    listTreeSync: function(rootPath) {
+      var onPath, paths;
+      paths = [];
+      onPath = function(childPath) {
+        paths.push(childPath);
+        return true;
+      };
+      fsPlus.traverseTreeSync(rootPath, onPath, onPath);
+      return paths;
+    },
+    move: function(source, target, callback) {
+      return isMoveTargetValid(source, target, function(isMoveTargetValidErr, isTargetValid) {
+        var error, targetParentPath;
+        if (isMoveTargetValidErr) {
+          callback(isMoveTargetValidErr);
+          return;
+        }
+        if (!isTargetValid) {
+          error = new Error("'" + target + "' already exists.");
+          error.code = 'EEXIST';
+          callback(error);
+          return;
+        }
+        targetParentPath = path.dirname(target);
+        return fs.exists(targetParentPath, function(targetParentExists) {
+          if (targetParentExists) {
+            fs.rename(source, target, callback);
+            return;
+          }
+          return fsPlus.makeTree(targetParentPath, function(makeTreeErr) {
+            if (makeTreeErr) {
+              callback(makeTreeErr);
+              return;
+            }
+            return fs.rename(source, target, callback);
+          });
+        });
+      });
+    },
+    moveSync: function(source, target) {
+      var error, targetParentPath;
+      if (!isMoveTargetValidSync(source, target)) {
+        error = new Error("'" + target + "' already exists.");
+        error.code = 'EEXIST';
+        throw error;
+      }
+      targetParentPath = path.dirname(target);
+      if (!fs.existsSync(targetParentPath)) {
+        fsPlus.makeTreeSync(targetParentPath);
+      }
+      return fs.renameSync(source, target);
+    },
+    removeSync: function(pathToRemove) {
+      return rimraf.sync(pathToRemove);
+    },
+    remove: function(pathToRemove, callback) {
+      return rimraf(pathToRemove, callback);
+    },
+    writeFileSync: function(filePath, content, options) {
+      mkdirp.sync(path.dirname(filePath));
+      return fs.writeFileSync(filePath, content, options);
+    },
+    writeFile: function(filePath, content, options, callback) {
+      callback = _.last(arguments);
+      return mkdirp(path.dirname(filePath), function(error) {
+        if (error != null) {
+          return typeof callback === "function" ? callback(error) : void 0;
+        } else {
+          return fs.writeFile(filePath, content, options, callback);
+        }
+      });
+    },
+    copy: function(sourcePath, destinationPath, done) {
+      return mkdirp(path.dirname(destinationPath), function(error) {
+        var destinationStream, sourceStream;
+        if (error != null) {
+          if (typeof done === "function") {
+            done(error);
+          }
+          return;
+        }
+        sourceStream = fs.createReadStream(sourcePath);
+        sourceStream.on('error', function(error) {
+          if (typeof done === "function") {
+            done(error);
+          }
+          return done = null;
+        });
+        destinationStream = fs.createWriteStream(destinationPath);
+        destinationStream.on('error', function(error) {
+          if (typeof done === "function") {
+            done(error);
+          }
+          return done = null;
+        });
+        destinationStream.on('close', function() {
+          if (typeof done === "function") {
+            done();
+          }
+          return done = null;
+        });
+        return sourceStream.pipe(destinationStream);
+      });
+    },
+    copySync: function(sourcePath, destinationPath) {
+      var destinationFilePath, source, sourceFilePath, sources, _i, _len, _results;
+      sources = fs.readdirSync(sourcePath);
+      mkdirp.sync(destinationPath);
+      _results = [];
+      for (_i = 0, _len = sources.length; _i < _len; _i++) {
+        source = sources[_i];
+        sourceFilePath = path.join(sourcePath, source);
+        destinationFilePath = path.join(destinationPath, source);
+        if (fsPlus.isDirectorySync(sourceFilePath)) {
+          _results.push(fsPlus.copySync(sourceFilePath, destinationFilePath));
+        } else {
+          _results.push(fsPlus.copyFileSync(sourceFilePath, destinationFilePath));
+        }
+      }
+      return _results;
+    },
+    copyFileSync: function(sourceFilePath, destinationFilePath, bufferSize) {
+      var buffer, bytesRead, position, readFd, writeFd, _results;
+      if (bufferSize == null) {
+        bufferSize = 16 * 1024;
+      }
+      mkdirp.sync(path.dirname(destinationFilePath));
+      readFd = null;
+      writeFd = null;
+      try {
+        readFd = fs.openSync(sourceFilePath, 'r');
+        writeFd = fs.openSync(destinationFilePath, 'w');
+        bytesRead = 1;
+        position = 0;
+        _results = [];
+        while (bytesRead > 0) {
+          buffer = new Buffer(bufferSize);
+          bytesRead = fs.readSync(readFd, buffer, 0, buffer.length, position);
+          fs.writeSync(writeFd, buffer, 0, bytesRead, position);
+          _results.push(position += bytesRead);
+        }
+        return _results;
+      } finally {
+        if (readFd != null) {
+          fs.closeSync(readFd);
+        }
+        if (writeFd != null) {
+          fs.closeSync(writeFd);
+        }
+      }
+    },
+    makeTreeSync: function(directoryPath) {
+      if (!fsPlus.isDirectorySync(directoryPath)) {
+        return mkdirp.sync(directoryPath);
+      }
+    },
+    makeTree: function(directoryPath, callback) {
+      return fsPlus.isDirectory(directoryPath, function(exists) {
+        if (exists) {
+          return typeof callback === "function" ? callback() : void 0;
+        }
+        return mkdirp(directoryPath, function(error) {
+          return typeof callback === "function" ? callback(error) : void 0;
+        });
+      });
+    },
+    traverseTreeSync: function(rootPath, onFile, onDirectory) {
+      var traverse;
+      if (onDirectory == null) {
+        onDirectory = onFile;
+      }
+      if (!fsPlus.isDirectorySync(rootPath)) {
+        return;
+      }
+      traverse = function(directoryPath, onFile, onDirectory) {
+        var childPath, file, linkStats, stats, _i, _len, _ref;
+        _ref = fs.readdirSync(directoryPath);
+        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+          file = _ref[_i];
+          childPath = path.join(directoryPath, file);
+          stats = fs.lstatSync(childPath);
+          if (stats.isSymbolicLink()) {
+            if (linkStats = statSyncNoException(childPath)) {
+              stats = linkStats;
+            }
+          }
+          if (stats.isDirectory()) {
+            if (onDirectory(childPath)) {
+              traverse(childPath, onFile, onDirectory);
+            }
+          } else if (stats.isFile()) {
+            onFile(childPath);
+          }
+        }
+        return void 0;
+      };
+      return traverse(rootPath, onFile, onDirectory);
+    },
+    traverseTree: function(rootPath, onFile, onDirectory, onDone) {
+      return fs.readdir(rootPath, function(error, files) {
+        var file, queue, _i, _len, _results;
+        if (error) {
+          return typeof onDone === "function" ? onDone() : void 0;
+        } else {
+          queue = async.queue(function(childPath, callback) {
+            return fs.stat(childPath, function(error, stats) {
+              if (error) {
+                return callback(error);
+              } else if (stats.isFile()) {
+                onFile(childPath);
+                return callback();
+              } else if (stats.isDirectory()) {
+                if (onDirectory(childPath)) {
+                  return fs.readdir(childPath, function(error, files) {
+                    var file, _i, _len;
+                    if (error) {
+                      return callback(error);
+                    } else {
+                      for (_i = 0, _len = files.length; _i < _len; _i++) {
+                        file = files[_i];
+                        queue.unshift(path.join(childPath, file));
+                      }
+                      return callback();
+                    }
+                  });
+                } else {
+                  return callback();
+                }
+              } else {
+                return callback();
+              }
+            });
+          });
+          queue.concurrency = 1;
+          queue.drain = onDone;
+          _results = [];
+          for (_i = 0, _len = files.length; _i < _len; _i++) {
+            file = files[_i];
+            _results.push(queue.push(path.join(rootPath, file)));
+          }
+          return _results;
+        }
+      });
+    },
+    md5ForPath: function(pathToDigest) {
+      var contents;
+      contents = fs.readFileSync(pathToDigest);
+      return require('crypto').createHash('md5').update(contents).digest('hex');
+    },
+    resolve: function() {
+      var args, candidatePath, extensions, loadPath, loadPaths, pathToResolve, resolvedPath, _i, _len, _ref;
+      args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+      if (_.isArray(_.last(args))) {
+        extensions = args.pop();
+      }
+      pathToResolve = (_ref = args.pop()) != null ? _ref.toString() : void 0;
+      loadPaths = args;
+      if (!pathToResolve) {
+        return void 0;
+      }
+      if (fsPlus.isAbsolute(pathToResolve)) {
+        if (extensions && (resolvedPath = fsPlus.resolveExtension(pathToResolve, extensions))) {
+          return resolvedPath;
+        } else {
+          if (fsPlus.existsSync(pathToResolve)) {
+            return pathToResolve;
+          }
+        }
+      }
+      for (_i = 0, _len = loadPaths.length; _i < _len; _i++) {
+        loadPath = loadPaths[_i];
+        candidatePath = path.join(loadPath, pathToResolve);
+        if (extensions) {
+          if (resolvedPath = fsPlus.resolveExtension(candidatePath, extensions)) {
+            return resolvedPath;
+          }
+        } else {
+          if (fsPlus.existsSync(candidatePath)) {
+            return fsPlus.absolute(candidatePath);
+          }
+        }
+      }
+      return void 0;
+    },
+    resolveOnLoadPath: function() {
+      var args, loadPaths;
+      args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+      loadPaths = Module.globalPaths.concat(module.paths);
+      return fsPlus.resolve.apply(fsPlus, __slice.call(loadPaths).concat(__slice.call(args)));
+    },
+    resolveExtension: function(pathToResolve, extensions) {
+      var extension, pathWithExtension, _i, _len;
+      for (_i = 0, _len = extensions.length; _i < _len; _i++) {
+        extension = extensions[_i];
+        if (extension === "") {
+          if (fsPlus.existsSync(pathToResolve)) {
+            return fsPlus.absolute(pathToResolve);
+          }
+        } else {
+          pathWithExtension = pathToResolve + "." + extension.replace(/^\./, "");
+          if (fsPlus.existsSync(pathWithExtension)) {
+            return fsPlus.absolute(pathWithExtension);
+          }
+        }
+      }
+      return void 0;
+    },
+    isCompressedExtension: function(ext) {
+      if (ext == null) {
+        return false;
+      }
+      return COMPRESSED_EXTENSIONS.hasOwnProperty(ext.toLowerCase());
+    },
+    isImageExtension: function(ext) {
+      if (ext == null) {
+        return false;
+      }
+      return IMAGE_EXTENSIONS.hasOwnProperty(ext.toLowerCase());
+    },
+    isPdfExtension: function(ext) {
+      return (ext != null ? ext.toLowerCase() : void 0) === '.pdf';
+    },
+    isBinaryExtension: function(ext) {
+      if (ext == null) {
+        return false;
+      }
+      return BINARY_EXTENSIONS.hasOwnProperty(ext.toLowerCase());
+    },
+    isReadmePath: function(readmePath) {
+      var base, extension;
+      extension = path.extname(readmePath);
+      base = path.basename(readmePath, extension).toLowerCase();
+      return base === 'readme' && (extension === '' || fsPlus.isMarkdownExtension(extension));
+    },
+    isMarkdownExtension: function(ext) {
+      if (ext == null) {
+        return false;
+      }
+      return MARKDOWN_EXTENSIONS.hasOwnProperty(ext.toLowerCase());
+    },
+    isCaseInsensitive: function() {
+      var lowerCaseStat, upperCaseStat;
+      if (fsPlus.caseInsensitiveFs == null) {
+        lowerCaseStat = statSyncNoException(process.execPath.toLowerCase());
+        upperCaseStat = statSyncNoException(process.execPath.toUpperCase());
+        if (lowerCaseStat && upperCaseStat) {
+          fsPlus.caseInsensitiveFs = lowerCaseStat.dev === upperCaseStat.dev && lowerCaseStat.ino === upperCaseStat.ino;
+        } else {
+          fsPlus.caseInsensitiveFs = false;
+        }
+      }
+      return fsPlus.caseInsensitiveFs;
+    },
+    isCaseSensitive: function() {
+      return !fsPlus.isCaseInsensitive();
+    }
+  };
+
+  statSyncNoException = fs.statSyncNoException, lstatSyncNoException = fs.lstatSyncNoException;
+
+  if (statSyncNoException == null) {
+    statSyncNoException = function() {
+      var args, error;
+      args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+      try {
+        return fs.statSync.apply(fs, args);
+      } catch (_error) {
+        error = _error;
+        return false;
+      }
+    };
+  }
+
+  if (lstatSyncNoException == null) {
+    lstatSyncNoException = function() {
+      var args, error;
+      args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+      try {
+        return fs.lstatSync.apply(fs, args);
+      } catch (_error) {
+        error = _error;
+        return false;
+      }
+    };
+  }
+
+  BINARY_EXTENSIONS = {
+    '.ds_store': true,
+    '.a': true,
+    '.exe': true,
+    '.o': true,
+    '.pyc': true,
+    '.pyo': true,
+    '.so': true,
+    '.woff': true
+  };
+
+  COMPRESSED_EXTENSIONS = {
+    '.bz2': true,
+    '.egg': true,
+    '.epub': true,
+    '.gem': true,
+    '.gz': true,
+    '.jar': true,
+    '.lz': true,
+    '.lzma': true,
+    '.lzo': true,
+    '.rar': true,
+    '.tar': true,
+    '.tgz': true,
+    '.war': true,
+    '.whl': true,
+    '.xpi': true,
+    '.xz': true,
+    '.z': true,
+    '.zip': true
+  };
+
+  IMAGE_EXTENSIONS = {
+    '.gif': true,
+    '.ico': true,
+    '.jpeg': true,
+    '.jpg': true,
+    '.png': true,
+    '.tif': true,
+    '.tiff': true,
+    '.webp': true
+  };
+
+  MARKDOWN_EXTENSIONS = {
+    '.markdown': true,
+    '.md': true,
+    '.mdown': true,
+    '.mkd': true,
+    '.mkdown': true,
+    '.rmd': true,
+    '.ron': true
+  };
+
+  isPathValid = function(pathToCheck) {
+    return (pathToCheck != null) && typeof pathToCheck === 'string' && pathToCheck.length > 0;
+  };
+
+  isMoveTargetValid = function(source, target, callback) {
+    return fs.stat(source, function(oldErr, oldStat) {
+      if (oldErr) {
+        callback(oldErr);
+        return;
+      }
+      return fs.stat(target, function(newErr, newStat) {
+        if (newErr && newErr.code === 'ENOENT') {
+          callback(void 0, true);
+          return;
+        }
+        return callback(void 0, source.toLowerCase() === target.toLowerCase() && oldStat.dev === newStat.dev && oldStat.ino === newStat.ino);
+      });
+    });
+  };
+
+  isMoveTargetValidSync = function(source, target) {
+    var newStat, oldStat;
+    oldStat = statSyncNoException(source);
+    newStat = statSyncNoException(target);
+    if (!(oldStat && newStat)) {
+      return true;
+    }
+    return source.toLowerCase() === target.toLowerCase() && oldStat.dev === newStat.dev && oldStat.ino === newStat.ino;
+  };
+
+  module.exports = _.extend({}, fs, fsPlus);
+
+}).call(this);
diff --git a/wrt/node_modules/fs-plus/package.json b/wrt/node_modules/fs-plus/package.json
new file mode 100644 (file)
index 0000000..3470733
--- /dev/null
@@ -0,0 +1,63 @@
+{
+  "_from": "fs-plus@^2.8.1",
+  "_id": "fs-plus@2.10.1",
+  "_inBundle": false,
+  "_integrity": "sha1-MgR4HXhAYR5jZOe2+wWMljJ8WqU=",
+  "_location": "/fs-plus",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "fs-plus@^2.8.1",
+    "name": "fs-plus",
+    "escapedName": "fs-plus",
+    "rawSpec": "^2.8.1",
+    "saveSpec": null,
+    "fetchSpec": "^2.8.1"
+  },
+  "_requiredBy": [
+    "#DEV:/"
+  ],
+  "_resolved": "https://registry.npmjs.org/fs-plus/-/fs-plus-2.10.1.tgz",
+  "_shasum": "3204781d7840611e6364e7b6fb058c96327c5aa5",
+  "_spec": "fs-plus@^2.8.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was",
+  "bugs": {
+    "url": "https://github.com/atom/fs-plus/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {
+    "async": "^1.5.2",
+    "mkdirp": "^0.5.1",
+    "rimraf": "^2.5.2",
+    "underscore-plus": "1.x"
+  },
+  "deprecated": false,
+  "description": "node's fs with more helpers",
+  "devDependencies": {
+    "grunt": "~0.4.1",
+    "grunt-cli": "~0.1.8",
+    "grunt-coffeelint": "0.0.6",
+    "grunt-contrib-coffee": "~0.9.0",
+    "grunt-shell": "~0.2.2",
+    "jasmine-focused": "1.x",
+    "temp": "~0.8.1"
+  },
+  "homepage": "http://atom.github.io/fs-plus",
+  "keywords": [
+    "fs",
+    "filesystem"
+  ],
+  "license": "MIT",
+  "main": "./lib/fs-plus.js",
+  "name": "fs-plus",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/atom/fs-plus.git"
+  },
+  "scripts": {
+    "prepublish": "grunt prepublish",
+    "test": "grunt test"
+  },
+  "version": "2.10.1"
+}
diff --git a/wrt/node_modules/fs.realpath/LICENSE b/wrt/node_modules/fs.realpath/LICENSE
new file mode 100644 (file)
index 0000000..5bd884c
--- /dev/null
@@ -0,0 +1,43 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+----
+
+This library bundles a version of the `fs.realpath` and `fs.realpathSync`
+methods from Node.js v0.10 under the terms of the Node.js MIT license.
+
+Node's license follows, also included at the header of `old.js` which contains
+the licensed code:
+
+  Copyright Joyent, Inc. and other Node contributors.
+
+  Permission is hereby granted, free of charge, to any person obtaining a
+  copy of this software and associated documentation files (the "Software"),
+  to deal in the Software without restriction, including without limitation
+  the rights to use, copy, modify, merge, publish, distribute, sublicense,
+  and/or sell copies of the Software, and to permit persons to whom the
+  Software is furnished to do so, subject to the following conditions:
+
+  The above copyright notice and this permission notice shall be included in
+  all copies or substantial portions of the Software.
+
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+  DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/fs.realpath/README.md b/wrt/node_modules/fs.realpath/README.md
new file mode 100644 (file)
index 0000000..a42ceac
--- /dev/null
@@ -0,0 +1,33 @@
+# fs.realpath
+
+A backwards-compatible fs.realpath for Node v6 and above
+
+In Node v6, the JavaScript implementation of fs.realpath was replaced
+with a faster (but less resilient) native implementation.  That raises
+new and platform-specific errors and cannot handle long or excessively
+symlink-looping paths.
+
+This module handles those cases by detecting the new errors and
+falling back to the JavaScript implementation.  On versions of Node
+prior to v6, it has no effect.
+
+## USAGE
+
+```js
+var rp = require('fs.realpath')
+
+// async version
+rp.realpath(someLongAndLoopingPath, function (er, real) {
+  // the ELOOP was handled, but it was a bit slower
+})
+
+// sync version
+var real = rp.realpathSync(someLongAndLoopingPath)
+
+// monkeypatch at your own risk!
+// This replaces the fs.realpath/fs.realpathSync builtins
+rp.monkeypatch()
+
+// un-do the monkeypatching
+rp.unmonkeypatch()
+```
diff --git a/wrt/node_modules/fs.realpath/index.js b/wrt/node_modules/fs.realpath/index.js
new file mode 100644 (file)
index 0000000..b09c7c7
--- /dev/null
@@ -0,0 +1,66 @@
+module.exports = realpath
+realpath.realpath = realpath
+realpath.sync = realpathSync
+realpath.realpathSync = realpathSync
+realpath.monkeypatch = monkeypatch
+realpath.unmonkeypatch = unmonkeypatch
+
+var fs = require('fs')
+var origRealpath = fs.realpath
+var origRealpathSync = fs.realpathSync
+
+var version = process.version
+var ok = /^v[0-5]\./.test(version)
+var old = require('./old.js')
+
+function newError (er) {
+  return er && er.syscall === 'realpath' && (
+    er.code === 'ELOOP' ||
+    er.code === 'ENOMEM' ||
+    er.code === 'ENAMETOOLONG'
+  )
+}
+
+function realpath (p, cache, cb) {
+  if (ok) {
+    return origRealpath(p, cache, cb)
+  }
+
+  if (typeof cache === 'function') {
+    cb = cache
+    cache = null
+  }
+  origRealpath(p, cache, function (er, result) {
+    if (newError(er)) {
+      old.realpath(p, cache, cb)
+    } else {
+      cb(er, result)
+    }
+  })
+}
+
+function realpathSync (p, cache) {
+  if (ok) {
+    return origRealpathSync(p, cache)
+  }
+
+  try {
+    return origRealpathSync(p, cache)
+  } catch (er) {
+    if (newError(er)) {
+      return old.realpathSync(p, cache)
+    } else {
+      throw er
+    }
+  }
+}
+
+function monkeypatch () {
+  fs.realpath = realpath
+  fs.realpathSync = realpathSync
+}
+
+function unmonkeypatch () {
+  fs.realpath = origRealpath
+  fs.realpathSync = origRealpathSync
+}
diff --git a/wrt/node_modules/fs.realpath/old.js b/wrt/node_modules/fs.realpath/old.js
new file mode 100644 (file)
index 0000000..b40305e
--- /dev/null
@@ -0,0 +1,303 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+var pathModule = require('path');
+var isWindows = process.platform === 'win32';
+var fs = require('fs');
+
+// JavaScript implementation of realpath, ported from node pre-v6
+
+var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
+
+function rethrow() {
+  // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and
+  // is fairly slow to generate.
+  var callback;
+  if (DEBUG) {
+    var backtrace = new Error;
+    callback = debugCallback;
+  } else
+    callback = missingCallback;
+
+  return callback;
+
+  function debugCallback(err) {
+    if (err) {
+      backtrace.message = err.message;
+      err = backtrace;
+      missingCallback(err);
+    }
+  }
+
+  function missingCallback(err) {
+    if (err) {
+      if (process.throwDeprecation)
+        throw err;  // Forgot a callback but don't know where? Use NODE_DEBUG=fs
+      else if (!process.noDeprecation) {
+        var msg = 'fs: missing callback ' + (err.stack || err.message);
+        if (process.traceDeprecation)
+          console.trace(msg);
+        else
+          console.error(msg);
+      }
+    }
+  }
+}
+
+function maybeCallback(cb) {
+  return typeof cb === 'function' ? cb : rethrow();
+}
+
+var normalize = pathModule.normalize;
+
+// Regexp that finds the next partion of a (partial) path
+// result is [base_with_slash, base], e.g. ['somedir/', 'somedir']
+if (isWindows) {
+  var nextPartRe = /(.*?)(?:[\/\\]+|$)/g;
+} else {
+  var nextPartRe = /(.*?)(?:[\/]+|$)/g;
+}
+
+// Regex to find the device root, including trailing slash. E.g. 'c:\\'.
+if (isWindows) {
+  var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;
+} else {
+  var splitRootRe = /^[\/]*/;
+}
+
+exports.realpathSync = function realpathSync(p, cache) {
+  // make p is absolute
+  p = pathModule.resolve(p);
+
+  if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
+    return cache[p];
+  }
+
+  var original = p,
+      seenLinks = {},
+      knownHard = {};
+
+  // current character position in p
+  var pos;
+  // the partial path so far, including a trailing slash if any
+  var current;
+  // the partial path without a trailing slash (except when pointing at a root)
+  var base;
+  // the partial path scanned in the previous round, with slash
+  var previous;
+
+  start();
+
+  function start() {
+    // Skip over roots
+    var m = splitRootRe.exec(p);
+    pos = m[0].length;
+    current = m[0];
+    base = m[0];
+    previous = '';
+
+    // On windows, check that the root exists. On unix there is no need.
+    if (isWindows && !knownHard[base]) {
+      fs.lstatSync(base);
+      knownHard[base] = true;
+    }
+  }
+
+  // walk down the path, swapping out linked pathparts for their real
+  // values
+  // NB: p.length changes.
+  while (pos < p.length) {
+    // find the next part
+    nextPartRe.lastIndex = pos;
+    var result = nextPartRe.exec(p);
+    previous = current;
+    current += result[0];
+    base = previous + result[1];
+    pos = nextPartRe.lastIndex;
+
+    // continue if not a symlink
+    if (knownHard[base] || (cache && cache[base] === base)) {
+      continue;
+    }
+
+    var resolvedLink;
+    if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
+      // some known symbolic link.  no need to stat again.
+      resolvedLink = cache[base];
+    } else {
+      var stat = fs.lstatSync(base);
+      if (!stat.isSymbolicLink()) {
+        knownHard[base] = true;
+        if (cache) cache[base] = base;
+        continue;
+      }
+
+      // read the link if it wasn't read before
+      // dev/ino always return 0 on windows, so skip the check.
+      var linkTarget = null;
+      if (!isWindows) {
+        var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);
+        if (seenLinks.hasOwnProperty(id)) {
+          linkTarget = seenLinks[id];
+        }
+      }
+      if (linkTarget === null) {
+        fs.statSync(base);
+        linkTarget = fs.readlinkSync(base);
+      }
+      resolvedLink = pathModule.resolve(previous, linkTarget);
+      // track this, if given a cache.
+      if (cache) cache[base] = resolvedLink;
+      if (!isWindows) seenLinks[id] = linkTarget;
+    }
+
+    // resolve the link, then start over
+    p = pathModule.resolve(resolvedLink, p.slice(pos));
+    start();
+  }
+
+  if (cache) cache[original] = p;
+
+  return p;
+};
+
+
+exports.realpath = function realpath(p, cache, cb) {
+  if (typeof cb !== 'function') {
+    cb = maybeCallback(cache);
+    cache = null;
+  }
+
+  // make p is absolute
+  p = pathModule.resolve(p);
+
+  if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
+    return process.nextTick(cb.bind(null, null, cache[p]));
+  }
+
+  var original = p,
+      seenLinks = {},
+      knownHard = {};
+
+  // current character position in p
+  var pos;
+  // the partial path so far, including a trailing slash if any
+  var current;
+  // the partial path without a trailing slash (except when pointing at a root)
+  var base;
+  // the partial path scanned in the previous round, with slash
+  var previous;
+
+  start();
+
+  function start() {
+    // Skip over roots
+    var m = splitRootRe.exec(p);
+    pos = m[0].length;
+    current = m[0];
+    base = m[0];
+    previous = '';
+
+    // On windows, check that the root exists. On unix there is no need.
+    if (isWindows && !knownHard[base]) {
+      fs.lstat(base, function(err) {
+        if (err) return cb(err);
+        knownHard[base] = true;
+        LOOP();
+      });
+    } else {
+      process.nextTick(LOOP);
+    }
+  }
+
+  // walk down the path, swapping out linked pathparts for their real
+  // values
+  function LOOP() {
+    // stop if scanned past end of path
+    if (pos >= p.length) {
+      if (cache) cache[original] = p;
+      return cb(null, p);
+    }
+
+    // find the next part
+    nextPartRe.lastIndex = pos;
+    var result = nextPartRe.exec(p);
+    previous = current;
+    current += result[0];
+    base = previous + result[1];
+    pos = nextPartRe.lastIndex;
+
+    // continue if not a symlink
+    if (knownHard[base] || (cache && cache[base] === base)) {
+      return process.nextTick(LOOP);
+    }
+
+    if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
+      // known symbolic link.  no need to stat again.
+      return gotResolvedLink(cache[base]);
+    }
+
+    return fs.lstat(base, gotStat);
+  }
+
+  function gotStat(err, stat) {
+    if (err) return cb(err);
+
+    // if not a symlink, skip to the next path part
+    if (!stat.isSymbolicLink()) {
+      knownHard[base] = true;
+      if (cache) cache[base] = base;
+      return process.nextTick(LOOP);
+    }
+
+    // stat & read the link if not read before
+    // call gotTarget as soon as the link target is known
+    // dev/ino always return 0 on windows, so skip the check.
+    if (!isWindows) {
+      var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);
+      if (seenLinks.hasOwnProperty(id)) {
+        return gotTarget(null, seenLinks[id], base);
+      }
+    }
+    fs.stat(base, function(err) {
+      if (err) return cb(err);
+
+      fs.readlink(base, function(err, target) {
+        if (!isWindows) seenLinks[id] = target;
+        gotTarget(err, target);
+      });
+    });
+  }
+
+  function gotTarget(err, target, base) {
+    if (err) return cb(err);
+
+    var resolvedLink = pathModule.resolve(previous, target);
+    if (cache) cache[base] = resolvedLink;
+    gotResolvedLink(resolvedLink);
+  }
+
+  function gotResolvedLink(resolvedLink) {
+    // resolve the link, then start over
+    p = pathModule.resolve(resolvedLink, p.slice(pos));
+    start();
+  }
+};
diff --git a/wrt/node_modules/fs.realpath/package.json b/wrt/node_modules/fs.realpath/package.json
new file mode 100644 (file)
index 0000000..47735f4
--- /dev/null
@@ -0,0 +1,61 @@
+{
+  "_from": "fs.realpath@^1.0.0",
+  "_id": "fs.realpath@1.0.0",
+  "_inBundle": false,
+  "_integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
+  "_location": "/fs.realpath",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "fs.realpath@^1.0.0",
+    "name": "fs.realpath",
+    "escapedName": "fs.realpath",
+    "rawSpec": "^1.0.0",
+    "saveSpec": null,
+    "fetchSpec": "^1.0.0"
+  },
+  "_requiredBy": [
+    "/coffeelint/glob",
+    "/node-gyp/glob",
+    "/rimraf/glob"
+  ],
+  "_resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
+  "_shasum": "1504ad2523158caa40db4a2787cb01411994ea4f",
+  "_spec": "fs.realpath@^1.0.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was/node_modules/rimraf/node_modules/glob",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bugs": {
+    "url": "https://github.com/isaacs/fs.realpath/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {},
+  "deprecated": false,
+  "description": "Use node's fs.realpath, but fall back to the JS implementation if the native one fails",
+  "devDependencies": {},
+  "files": [
+    "old.js",
+    "index.js"
+  ],
+  "homepage": "https://github.com/isaacs/fs.realpath#readme",
+  "keywords": [
+    "realpath",
+    "fs",
+    "polyfill"
+  ],
+  "license": "ISC",
+  "main": "index.js",
+  "name": "fs.realpath",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/isaacs/fs.realpath.git"
+  },
+  "scripts": {
+    "test": "tap test/*.js --cov"
+  },
+  "version": "1.0.0"
+}
diff --git a/wrt/node_modules/fstream/.npmignore b/wrt/node_modules/fstream/.npmignore
new file mode 100644 (file)
index 0000000..494272a
--- /dev/null
@@ -0,0 +1,5 @@
+.*.swp
+node_modules/
+examples/deep-copy/
+examples/path/
+examples/filter-copy/
diff --git a/wrt/node_modules/fstream/.travis.yml b/wrt/node_modules/fstream/.travis.yml
new file mode 100644 (file)
index 0000000..2d26206
--- /dev/null
@@ -0,0 +1,3 @@
+language: node_js
+node_js:
+  - 0.6
diff --git a/wrt/node_modules/fstream/LICENSE b/wrt/node_modules/fstream/LICENSE
new file mode 100644 (file)
index 0000000..0c44ae7
--- /dev/null
@@ -0,0 +1,27 @@
+Copyright (c) Isaac Z. Schlueter ("Author")
+All rights reserved.
+
+The BSD License
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/wrt/node_modules/fstream/README.md b/wrt/node_modules/fstream/README.md
new file mode 100644 (file)
index 0000000..9d8cb77
--- /dev/null
@@ -0,0 +1,76 @@
+Like FS streams, but with stat on them, and supporting directories and
+symbolic links, as well as normal files.  Also, you can use this to set
+the stats on a file, even if you don't change its contents, or to create
+a symlink, etc.
+
+So, for example, you can "write" a directory, and it'll call `mkdir`.  You
+can specify a uid and gid, and it'll call `chown`.  You can specify a
+`mtime` and `atime`, and it'll call `utimes`.  You can call it a symlink
+and provide a `linkpath` and it'll call `symlink`.
+
+Note that it won't automatically resolve symbolic links.  So, if you
+call `fstream.Reader('/some/symlink')` then you'll get an object
+that stats and then ends immediately (since it has no data).  To follow
+symbolic links, do this: `fstream.Reader({path:'/some/symlink', follow:
+true })`.
+
+There are various checks to make sure that the bytes emitted are the
+same as the intended size, if the size is set.
+
+## Examples
+
+```javascript
+fstream
+  .Writer({ path: "path/to/file"
+          , mode: 0755
+          , size: 6
+          })
+  .write("hello\n")
+  .end()
+```
+
+This will create the directories if they're missing, and then write
+`hello\n` into the file, chmod it to 0755, and assert that 6 bytes have
+been written when it's done.
+
+```javascript
+fstream
+  .Writer({ path: "path/to/file"
+          , mode: 0755
+          , size: 6
+          , flags: "a"
+          })
+  .write("hello\n")
+  .end()
+```
+
+You can pass flags in, if you want to append to a file.
+
+```javascript
+fstream
+  .Writer({ path: "path/to/symlink"
+          , linkpath: "./file"
+          , SymbolicLink: true
+          , mode: "0755" // octal strings supported
+          })
+  .end()
+```
+
+If isSymbolicLink is a function, it'll be called, and if it returns
+true, then it'll treat it as a symlink.  If it's not a function, then
+any truish value will make a symlink, or you can set `type:
+'SymbolicLink'`, which does the same thing.
+
+Note that the linkpath is relative to the symbolic link location, not
+the parent dir or cwd.
+
+```javascript
+fstream
+  .Reader("path/to/dir")
+  .pipe(fstream.Writer("path/to/other/dir"))
+```
+
+This will do like `cp -Rp path/to/dir path/to/other/dir`.  If the other
+dir exists and isn't a directory, then it'll emit an error.  It'll also
+set the uid, gid, mode, etc. to be identical.  In this way, it's more
+like `rsync -a` than simply a copy.
diff --git a/wrt/node_modules/fstream/examples/filter-pipe.js b/wrt/node_modules/fstream/examples/filter-pipe.js
new file mode 100644 (file)
index 0000000..c6b55b3
--- /dev/null
@@ -0,0 +1,131 @@
+var fstream = require("../fstream.js")
+var path = require("path")
+
+var r = fstream.Reader({ path: path.dirname(__dirname)
+                       , filter: function () {
+                           return !this.basename.match(/^\./) &&
+                                  !this.basename.match(/^node_modules$/)
+                                  !this.basename.match(/^deep-copy$/)
+                                  !this.basename.match(/^filter-copy$/)
+                         }
+                       })
+
+// this writer will only write directories
+var w = fstream.Writer({ path: path.resolve(__dirname, "filter-copy")
+                       , type: "Directory"
+                       , filter: function () {
+                           return this.type === "Directory"
+                         }
+                       })
+
+var indent = ""
+var escape = {}
+
+r.on("entry", appears)
+r.on("ready", function () {
+  console.error("ready to begin!", r.path)
+})
+
+function appears (entry) {
+  console.error(indent + "a %s appears!", entry.type, entry.basename, typeof entry.basename)
+  if (foggy) {
+    console.error("FOGGY!")
+    var p = entry
+    do {
+      console.error(p.depth, p.path, p._paused)
+    } while (p = p.parent)
+
+    throw new Error("\033[mshould not have entries while foggy")
+  }
+  indent += "\t"
+  entry.on("data", missile(entry))
+  entry.on("end", runaway(entry))
+  entry.on("entry", appears)
+}
+
+var foggy
+function missile (entry) {
+  if (entry.type === "Directory") {
+    var ended = false
+    entry.once("end", function () { ended = true })
+    return function (c) {
+      // throw in some pathological pause()/resume() behavior
+      // just for extra fun.
+      process.nextTick(function () {
+        if (!foggy && !ended) { // && Math.random() < 0.3) {
+          console.error(indent +"%s casts a spell", entry.basename)
+          console.error("\na slowing fog comes over the battlefield...\n\033[32m")
+          entry.pause()
+          entry.once("resume", liftFog)
+          foggy = setTimeout(liftFog, 1000)
+
+          function liftFog (who) {
+            if (!foggy) return
+            if (who) {
+              console.error("%s breaks the spell!", who && who.path)
+            } else {
+              console.error("the spell expires!")
+            }
+            console.error("\033[mthe fog lifts!\n")
+            clearTimeout(foggy)
+            foggy = null
+            if (entry._paused) entry.resume()
+          }
+
+        }
+      })
+    }
+  }
+
+  return function (c) {
+    var e = Math.random() < 0.5
+    console.error(indent + "%s %s for %d damage!",
+                entry.basename,
+                e ? "is struck" : "fires a chunk",
+                c.length)
+  }
+}
+
+function runaway (entry) { return function () {
+  var e = Math.random() < 0.5
+  console.error(indent + "%s %s",
+                entry.basename,
+                e ? "turns to flee" : "is vanquished!")
+  indent = indent.slice(0, -1)
+}}
+
+
+w.on("entry", attacks)
+//w.on("ready", function () { attacks(w) })
+function attacks (entry) {
+  console.error(indent + "%s %s!", entry.basename,
+              entry.type === "Directory" ? "calls for backup" : "attacks")
+  entry.on("entry", attacks)
+}
+
+ended = false
+var i = 1
+r.on("end", function () {
+  if (foggy) clearTimeout(foggy)
+  console.error("\033[mIT'S OVER!!")
+  console.error("A WINNAR IS YOU!")
+
+  console.log("ok " + (i ++) + " A WINNAR IS YOU")
+  ended = true
+  // now go through and verify that everything in there is a dir.
+  var p = path.resolve(__dirname, "filter-copy")
+  var checker = fstream.Reader({ path: p })
+  checker.checker = true
+  checker.on("child", function (e) {
+    var ok = e.type === "Directory"
+    console.log((ok ? "" : "not ") + "ok " + (i ++) +
+                " should be a dir: " +
+                e.path.substr(checker.path.length + 1))
+  })
+})
+
+process.on("exit", function () {
+  console.log((ended ? "" : "not ") + "ok " + (i ++) + " ended")
+})
+
+r.pipe(w)
diff --git a/wrt/node_modules/fstream/examples/pipe.js b/wrt/node_modules/fstream/examples/pipe.js
new file mode 100644 (file)
index 0000000..648ec84
--- /dev/null
@@ -0,0 +1,115 @@
+var fstream = require("../fstream.js")
+var path = require("path")
+
+var r = fstream.Reader({ path: path.dirname(__dirname)
+                       , filter: function () {
+                           return !this.basename.match(/^\./) &&
+                                  !this.basename.match(/^node_modules$/)
+                                  !this.basename.match(/^deep-copy$/)
+                         }
+                       })
+
+var w = fstream.Writer({ path: path.resolve(__dirname, "deep-copy")
+                       , type: "Directory"
+                       })
+
+var indent = ""
+var escape = {}
+
+r.on("entry", appears)
+r.on("ready", function () {
+  console.error("ready to begin!", r.path)
+})
+
+function appears (entry) {
+  console.error(indent + "a %s appears!", entry.type, entry.basename, typeof entry.basename, entry)
+  if (foggy) {
+    console.error("FOGGY!")
+    var p = entry
+    do {
+      console.error(p.depth, p.path, p._paused)
+    } while (p = p.parent)
+
+    throw new Error("\033[mshould not have entries while foggy")
+  }
+  indent += "\t"
+  entry.on("data", missile(entry))
+  entry.on("end", runaway(entry))
+  entry.on("entry", appears)
+}
+
+var foggy
+function missile (entry) {
+  if (entry.type === "Directory") {
+    var ended = false
+    entry.once("end", function () { ended = true })
+    return function (c) {
+      // throw in some pathological pause()/resume() behavior
+      // just for extra fun.
+      process.nextTick(function () {
+        if (!foggy && !ended) { // && Math.random() < 0.3) {
+          console.error(indent +"%s casts a spell", entry.basename)
+          console.error("\na slowing fog comes over the battlefield...\n\033[32m")
+          entry.pause()
+          entry.once("resume", liftFog)
+          foggy = setTimeout(liftFog, 10)
+
+          function liftFog (who) {
+            if (!foggy) return
+            if (who) {
+              console.error("%s breaks the spell!", who && who.path)
+            } else {
+              console.error("the spell expires!")
+            }
+            console.error("\033[mthe fog lifts!\n")
+            clearTimeout(foggy)
+            foggy = null
+            if (entry._paused) entry.resume()
+          }
+
+        }
+      })
+    }
+  }
+
+  return function (c) {
+    var e = Math.random() < 0.5
+    console.error(indent + "%s %s for %d damage!",
+                entry.basename,
+                e ? "is struck" : "fires a chunk",
+                c.length)
+  }
+}
+
+function runaway (entry) { return function () {
+  var e = Math.random() < 0.5
+  console.error(indent + "%s %s",
+                entry.basename,
+                e ? "turns to flee" : "is vanquished!")
+  indent = indent.slice(0, -1)
+}}
+
+
+w.on("entry", attacks)
+//w.on("ready", function () { attacks(w) })
+function attacks (entry) {
+  console.error(indent + "%s %s!", entry.basename,
+              entry.type === "Directory" ? "calls for backup" : "attacks")
+  entry.on("entry", attacks)
+}
+
+ended = false
+r.on("end", function () {
+  if (foggy) clearTimeout(foggy)
+  console.error("\033[mIT'S OVER!!")
+  console.error("A WINNAR IS YOU!")
+
+  console.log("ok 1 A WINNAR IS YOU")
+  ended = true
+})
+
+process.on("exit", function () {
+  console.log((ended ? "" : "not ") + "ok 2 ended")
+})
+
+r.pipe(w)
diff --git a/wrt/node_modules/fstream/examples/reader.js b/wrt/node_modules/fstream/examples/reader.js
new file mode 100644 (file)
index 0000000..9aa1a95
--- /dev/null
@@ -0,0 +1,54 @@
+var fstream = require("../fstream.js")
+var tap = require("tap")
+var fs = require("fs")
+var path = require("path")
+var children = -1
+var dir = path.dirname(__dirname)
+
+var gotReady = false
+var ended = false
+
+tap.test("reader test", function (t) {
+
+  var r = fstream.Reader({ path: dir
+                         , filter: function () {
+                             // return this.parent === r
+                             return this.parent === r || this === r
+                           }
+                         })
+
+  r.on("ready", function () {
+    gotReady = true
+    children = fs.readdirSync(dir).length
+    console.error("Setting expected children to "+children)
+    t.equal(r.type, "Directory", "should be a directory")
+  })
+
+  r.on("entry", function (entry) {
+    children --
+    if (!gotReady) {
+      t.fail("children before ready!")
+    }
+    t.equal(entry.dirname, r.path, "basename is parent dir")
+  })
+
+  r.on("error", function (er) {
+    t.fail(er)
+    t.end()
+    process.exit(1)
+  })
+
+  r.on("end", function () {
+    t.equal(children, 0, "should have seen all children")
+    ended = true
+  })
+
+  var closed = false
+  r.on("close", function () {
+    t.ok(ended, "saw end before close")
+    t.notOk(closed, "close should only happen once")
+    closed = true
+    t.end()
+  })
+
+})
diff --git a/wrt/node_modules/fstream/examples/symlink-write.js b/wrt/node_modules/fstream/examples/symlink-write.js
new file mode 100644 (file)
index 0000000..d7816d2
--- /dev/null
@@ -0,0 +1,24 @@
+var fstream = require("../fstream.js")
+  , closed = false
+
+fstream
+  .Writer({ path: "path/to/symlink"
+          , linkpath: "./file"
+          , isSymbolicLink: true
+          , mode: "0755" // octal strings supported
+          })
+  .on("close", function () {
+    closed = true
+    var fs = require("fs")
+    var s = fs.lstatSync("path/to/symlink")
+    var isSym = s.isSymbolicLink()
+    console.log((isSym?"":"not ") +"ok 1 should be symlink")
+    var t = fs.readlinkSync("path/to/symlink")
+    var isTarget = t === "./file"
+    console.log((isTarget?"":"not ") +"ok 2 should link to ./file")
+  })
+  .end()
+
+process.on("exit", function () {
+  console.log((closed?"":"not ")+"ok 3 should be closed")
+})
diff --git a/wrt/node_modules/fstream/fstream.js b/wrt/node_modules/fstream/fstream.js
new file mode 100644 (file)
index 0000000..c66d26f
--- /dev/null
@@ -0,0 +1,31 @@
+exports.Abstract = require("./lib/abstract.js")
+exports.Reader = require("./lib/reader.js")
+exports.Writer = require("./lib/writer.js")
+
+exports.File =
+  { Reader: require("./lib/file-reader.js")
+  , Writer: require("./lib/file-writer.js") }
+
+exports.Dir = 
+  { Reader : require("./lib/dir-reader.js")
+  , Writer : require("./lib/dir-writer.js") }
+
+exports.Link =
+  { Reader : require("./lib/link-reader.js")
+  , Writer : require("./lib/link-writer.js") }
+
+exports.Proxy =
+  { Reader : require("./lib/proxy-reader.js")
+  , Writer : require("./lib/proxy-writer.js") }
+
+exports.Reader.Dir = exports.DirReader = exports.Dir.Reader
+exports.Reader.File = exports.FileReader = exports.File.Reader
+exports.Reader.Link = exports.LinkReader = exports.Link.Reader
+exports.Reader.Proxy = exports.ProxyReader = exports.Proxy.Reader
+
+exports.Writer.Dir = exports.DirWriter = exports.Dir.Writer
+exports.Writer.File = exports.FileWriter = exports.File.Writer
+exports.Writer.Link = exports.LinkWriter = exports.Link.Writer
+exports.Writer.Proxy = exports.ProxyWriter = exports.Proxy.Writer
+
+exports.collect = require("./lib/collect.js")
diff --git a/wrt/node_modules/fstream/lib/abstract.js b/wrt/node_modules/fstream/lib/abstract.js
new file mode 100644 (file)
index 0000000..11ef0e2
--- /dev/null
@@ -0,0 +1,85 @@
+// the parent class for all fstreams.
+
+module.exports = Abstract
+
+var Stream = require("stream").Stream
+  , inherits = require("inherits")
+
+function Abstract () {
+  Stream.call(this)
+}
+
+inherits(Abstract, Stream)
+
+Abstract.prototype.on = function (ev, fn) {
+  if (ev === "ready" && this.ready) {
+    process.nextTick(fn.bind(this))
+  } else {
+    Stream.prototype.on.call(this, ev, fn)
+  }
+  return this
+}
+
+Abstract.prototype.abort = function () {
+  this._aborted = true
+  this.emit("abort")
+}
+
+Abstract.prototype.destroy = function () {}
+
+Abstract.prototype.warn = function (msg, code) {
+  var me = this
+    , er = decorate(msg, code, me)
+  if (!me.listeners("warn")) {
+    console.error("%s %s\n" +
+                  "path = %s\n" +
+                  "syscall = %s\n" +
+                  "fstream_type = %s\n" +
+                  "fstream_path = %s\n" +
+                  "fstream_unc_path = %s\n" +
+                  "fstream_class = %s\n" +
+                  "fstream_stack =\n%s\n",
+                  code || "UNKNOWN",
+                  er.stack,
+                  er.path,
+                  er.syscall,
+                  er.fstream_type,
+                  er.fstream_path,
+                  er.fstream_unc_path,
+                  er.fstream_class,
+                  er.fstream_stack.join("\n"))
+  } else {
+    me.emit("warn", er)
+  }
+}
+
+Abstract.prototype.info = function (msg, code) {
+  this.emit("info", msg, code)
+}
+
+Abstract.prototype.error = function (msg, code, th) {
+  var er = decorate(msg, code, this)
+  if (th) throw er
+  else this.emit("error", er)
+}
+
+function decorate (er, code, me) {
+  if (!(er instanceof Error)) er = new Error(er)
+  er.code = er.code || code
+  er.path = er.path || me.path
+  er.fstream_type = er.fstream_type || me.type
+  er.fstream_path = er.fstream_path || me.path
+  if (me._path !== me.path) {
+    er.fstream_unc_path = er.fstream_unc_path || me._path
+  }
+  if (me.linkpath) {
+    er.fstream_linkpath = er.fstream_linkpath || me.linkpath
+  }
+  er.fstream_class = er.fstream_class || me.constructor.name
+  er.fstream_stack = er.fstream_stack ||
+    new Error().stack.split(/\n/).slice(3).map(function (s) {
+      return s.replace(/^    at /, "")
+    })
+
+  return er
+}
diff --git a/wrt/node_modules/fstream/lib/collect.js b/wrt/node_modules/fstream/lib/collect.js
new file mode 100644 (file)
index 0000000..a36f780
--- /dev/null
@@ -0,0 +1,67 @@
+module.exports = collect
+
+function collect (stream) {
+  if (stream._collected) return
+
+  stream._collected = true
+  stream.pause()
+
+  stream.on("data", save)
+  stream.on("end", save)
+  var buf = []
+  function save (b) {
+    if (typeof b === "string") b = new Buffer(b)
+    if (Buffer.isBuffer(b) && !b.length) return
+    buf.push(b)
+  }
+
+  stream.on("entry", saveEntry)
+  var entryBuffer = []
+  function saveEntry (e) {
+    collect(e)
+    entryBuffer.push(e)
+  }
+
+  stream.on("proxy", proxyPause)
+  function proxyPause (p) {
+    p.pause()
+  }
+
+
+  // replace the pipe method with a new version that will
+  // unlock the buffered stuff.  if you just call .pipe()
+  // without a destination, then it'll re-play the events.
+  stream.pipe = (function (orig) { return function (dest) {
+    // console.error(" === open the pipes", dest && dest.path)
+
+    // let the entries flow through one at a time.
+    // Once they're all done, then we can resume completely.
+    var e = 0
+    ;(function unblockEntry () {
+      var entry = entryBuffer[e++]
+      // console.error(" ==== unblock entry", entry && entry.path)
+      if (!entry) return resume()
+      entry.on("end", unblockEntry)
+      if (dest) dest.add(entry)
+      else stream.emit("entry", entry)
+    })()
+
+    function resume () {
+      stream.removeListener("entry", saveEntry)
+      stream.removeListener("data", save)
+      stream.removeListener("end", save)
+
+      stream.pipe = orig
+      if (dest) stream.pipe(dest)
+
+      buf.forEach(function (b) {
+        if (b) stream.emit("data", b)
+        else stream.emit("end")
+      })
+
+      stream.resume()
+    }
+
+    return dest
+  }})(stream.pipe)
+}
diff --git a/wrt/node_modules/fstream/lib/dir-reader.js b/wrt/node_modules/fstream/lib/dir-reader.js
new file mode 100644 (file)
index 0000000..346ac2b
--- /dev/null
@@ -0,0 +1,251 @@
+// A thing that emits "entry" events with Reader objects
+// Pausing it causes it to stop emitting entry events, and also
+// pauses the current entry if there is one.
+
+module.exports = DirReader
+
+var fs = require("graceful-fs")
+  , fstream = require("../fstream.js")
+  , Reader = fstream.Reader
+  , inherits = require("inherits")
+  , mkdir = require("mkdirp")
+  , path = require("path")
+  , Reader = require("./reader.js")
+  , assert = require("assert").ok
+
+inherits(DirReader, Reader)
+
+function DirReader (props) {
+  var me = this
+  if (!(me instanceof DirReader)) throw new Error(
+    "DirReader must be called as constructor.")
+
+  // should already be established as a Directory type
+  if (props.type !== "Directory" || !props.Directory) {
+    throw new Error("Non-directory type "+ props.type)
+  }
+
+  me.entries = null
+  me._index = -1
+  me._paused = false
+  me._length = -1
+
+  if (props.sort) {
+    this.sort = props.sort
+  }
+
+  Reader.call(this, props)
+}
+
+DirReader.prototype._getEntries = function () {
+  var me = this
+
+  // race condition.  might pause() before calling _getEntries,
+  // and then resume, and try to get them a second time.
+  if (me._gotEntries) return
+  me._gotEntries = true
+
+  fs.readdir(me._path, function (er, entries) {
+    if (er) return me.error(er)
+
+    me.entries = entries
+
+    me.emit("entries", entries)
+    if (me._paused) me.once("resume", processEntries)
+    else processEntries()
+
+    function processEntries () {
+      me._length = me.entries.length
+      if (typeof me.sort === "function") {
+        me.entries = me.entries.sort(me.sort.bind(me))
+      }
+      me._read()
+    }
+  })
+}
+
+// start walking the dir, and emit an "entry" event for each one.
+DirReader.prototype._read = function () {
+  var me = this
+
+  if (!me.entries) return me._getEntries()
+
+  if (me._paused || me._currentEntry || me._aborted) {
+    // console.error("DR paused=%j, current=%j, aborted=%j", me._paused, !!me._currentEntry, me._aborted)
+    return
+  }
+
+  me._index ++
+  if (me._index >= me.entries.length) {
+    if (!me._ended) {
+      me._ended = true
+      me.emit("end")
+      me.emit("close")
+    }
+    return
+  }
+
+  // ok, handle this one, then.
+
+  // save creating a proxy, by stat'ing the thing now.
+  var p = path.resolve(me._path, me.entries[me._index])
+  assert(p !== me._path)
+  assert(me.entries[me._index])
+
+  // set this to prevent trying to _read() again in the stat time.
+  me._currentEntry = p
+  fs[ me.props.follow ? "stat" : "lstat" ](p, function (er, stat) {
+    if (er) return me.error(er)
+
+    var who = me._proxy || me
+
+    stat.path = p
+    stat.basename = path.basename(p)
+    stat.dirname = path.dirname(p)
+    var childProps = me.getChildProps.call(who, stat)
+    childProps.path = p
+    childProps.basename = path.basename(p)
+    childProps.dirname = path.dirname(p)
+
+    var entry = Reader(childProps, stat)
+
+    // console.error("DR Entry", p, stat.size)
+
+    me._currentEntry = entry
+
+    // "entry" events are for direct entries in a specific dir.
+    // "child" events are for any and all children at all levels.
+    // This nomenclature is not completely final.
+
+    entry.on("pause", function (who) {
+      if (!me._paused && !entry._disowned) {
+        me.pause(who)
+      }
+    })
+
+    entry.on("resume", function (who) {
+      if (me._paused && !entry._disowned) {
+        me.resume(who)
+      }
+    })
+
+    entry.on("stat", function (props) {
+      me.emit("_entryStat", entry, props)
+      if (entry._aborted) return
+      if (entry._paused) entry.once("resume", function () {
+        me.emit("entryStat", entry, props)
+      })
+      else me.emit("entryStat", entry, props)
+    })
+
+    entry.on("ready", function EMITCHILD () {
+      // console.error("DR emit child", entry._path)
+      if (me._paused) {
+        // console.error("  DR emit child - try again later")
+        // pause the child, and emit the "entry" event once we drain.
+        // console.error("DR pausing child entry")
+        entry.pause(me)
+        return me.once("resume", EMITCHILD)
+      }
+
+      // skip over sockets.  they can't be piped around properly,
+      // so there's really no sense even acknowledging them.
+      // if someone really wants to see them, they can listen to
+      // the "socket" events.
+      if (entry.type === "Socket") {
+        me.emit("socket", entry)
+      } else {
+        me.emitEntry(entry)
+      }
+    })
+
+    var ended = false
+    entry.on("close", onend)
+    entry.on("disown", onend)
+    function onend () {
+      if (ended) return
+      ended = true
+      me.emit("childEnd", entry)
+      me.emit("entryEnd", entry)
+      me._currentEntry = null
+      if (!me._paused) {
+        me._read()
+      }
+    }
+
+    // XXX Remove this.  Works in node as of 0.6.2 or so.
+    // Long filenames should not break stuff.
+    entry.on("error", function (er) {
+      if (entry._swallowErrors) {
+        me.warn(er)
+        entry.emit("end")
+        entry.emit("close")
+      } else {
+        me.emit("error", er)
+      }
+    })
+
+    // proxy up some events.
+    ; [ "child"
+      , "childEnd"
+      , "warn"
+      ].forEach(function (ev) {
+        entry.on(ev, me.emit.bind(me, ev))
+      })
+  })
+}
+
+DirReader.prototype.disown = function (entry) {
+  entry.emit("beforeDisown")
+  entry._disowned = true
+  entry.parent = entry.root = null
+  if (entry === this._currentEntry) {
+    this._currentEntry = null
+  }
+  entry.emit("disown")
+}
+
+DirReader.prototype.getChildProps = function (stat) {
+  return { depth: this.depth + 1
+         , root: this.root || this
+         , parent: this
+         , follow: this.follow
+         , filter: this.filter
+         , sort: this.props.sort
+         , hardlinks: this.props.hardlinks
+         }
+}
+
+DirReader.prototype.pause = function (who) {
+  var me = this
+  if (me._paused) return
+  who = who || me
+  me._paused = true
+  if (me._currentEntry && me._currentEntry.pause) {
+    me._currentEntry.pause(who)
+  }
+  me.emit("pause", who)
+}
+
+DirReader.prototype.resume = function (who) {
+  var me = this
+  if (!me._paused) return
+  who = who || me
+
+  me._paused = false
+  // console.error("DR Emit Resume", me._path)
+  me.emit("resume", who)
+  if (me._paused) {
+    // console.error("DR Re-paused", me._path)
+    return
+  }
+
+  if (me._currentEntry) {
+    if (me._currentEntry.resume) me._currentEntry.resume(who)
+  } else me._read()
+}
+
+DirReader.prototype.emitEntry = function (entry) {
+  this.emit("entry", entry)
+  this.emit("child", entry)
+}
diff --git a/wrt/node_modules/fstream/lib/dir-writer.js b/wrt/node_modules/fstream/lib/dir-writer.js
new file mode 100644 (file)
index 0000000..7073b88
--- /dev/null
@@ -0,0 +1,171 @@
+// It is expected that, when .add() returns false, the consumer
+// of the DirWriter will pause until a "drain" event occurs. Note
+// that this is *almost always going to be the case*, unless the
+// thing being written is some sort of unsupported type, and thus
+// skipped over.
+
+module.exports = DirWriter
+
+var fs = require("graceful-fs")
+  , fstream = require("../fstream.js")
+  , Writer = require("./writer.js")
+  , inherits = require("inherits")
+  , mkdir = require("mkdirp")
+  , path = require("path")
+  , collect = require("./collect.js")
+
+inherits(DirWriter, Writer)
+
+function DirWriter (props) {
+  var me = this
+  if (!(me instanceof DirWriter)) me.error(
+    "DirWriter must be called as constructor.", null, true)
+
+  // should already be established as a Directory type
+  if (props.type !== "Directory" || !props.Directory) {
+    me.error("Non-directory type "+ props.type + " " +
+                    JSON.stringify(props), null, true)
+  }
+
+  Writer.call(this, props)
+}
+
+DirWriter.prototype._create = function () {
+  var me = this
+  mkdir(me._path, Writer.dirmode, function (er) {
+    if (er) return me.error(er)
+    // ready to start getting entries!
+    me.ready = true
+    me.emit("ready")
+    me._process()
+  })
+}
+
+// a DirWriter has an add(entry) method, but its .write() doesn't
+// do anything.  Why a no-op rather than a throw?  Because this
+// leaves open the door for writing directory metadata for
+// gnu/solaris style dumpdirs.
+DirWriter.prototype.write = function () {
+  return true
+}
+
+DirWriter.prototype.end = function () {
+  this._ended = true
+  this._process()
+}
+
+DirWriter.prototype.add = function (entry) {
+  var me = this
+
+  // console.error("\tadd", entry._path, "->", me._path)
+  collect(entry)
+  if (!me.ready || me._currentEntry) {
+    me._buffer.push(entry)
+    return false
+  }
+
+  // create a new writer, and pipe the incoming entry into it.
+  if (me._ended) {
+    return me.error("add after end")
+  }
+
+  me._buffer.push(entry)
+  me._process()
+
+  return 0 === this._buffer.length
+}
+
+DirWriter.prototype._process = function () {
+  var me = this
+
+  // console.error("DW Process p=%j", me._processing, me.basename)
+
+  if (me._processing) return
+
+  var entry = me._buffer.shift()
+  if (!entry) {
+    // console.error("DW Drain")
+    me.emit("drain")
+    if (me._ended) me._finish()
+    return
+  }
+
+  me._processing = true
+  // console.error("DW Entry", entry._path)
+
+  me.emit("entry", entry)
+
+  // ok, add this entry
+  //
+  // don't allow recursive copying
+  var p = entry
+  do {
+    var pp = p._path || p.path
+    if (pp === me.root._path || pp === me._path ||
+        (pp && pp.indexOf(me._path) === 0)) {
+      // console.error("DW Exit (recursive)", entry.basename, me._path)
+      me._processing = false
+      if (entry._collected) entry.pipe()
+      return me._process()
+    }
+  } while (p = p.parent)
+
+  // console.error("DW not recursive")
+
+  // chop off the entry's root dir, replace with ours
+  var props = { parent: me
+              , root: me.root || me
+              , type: entry.type
+              , depth: me.depth + 1 }
+
+  var p = entry._path || entry.path || entry.props.path
+  if (entry.parent) {
+    p = p.substr(entry.parent._path.length + 1)
+  }
+  // get rid of any ../../ shenanigans
+  props.path = path.join(me.path, path.join("/", p))
+
+  // if i have a filter, the child should inherit it.
+  props.filter = me.filter
+
+  // all the rest of the stuff, copy over from the source.
+  Object.keys(entry.props).forEach(function (k) {
+    if (!props.hasOwnProperty(k)) {
+      props[k] = entry.props[k]
+    }
+  })
+
+  // not sure at this point what kind of writer this is.
+  var child = me._currentChild = new Writer(props)
+  child.on("ready", function () {
+    // console.error("DW Child Ready", child.type, child._path)
+    // console.error("  resuming", entry._path)
+    entry.pipe(child)
+    entry.resume()
+  })
+
+  // XXX Make this work in node.
+  // Long filenames should not break stuff.
+  child.on("error", function (er) {
+    if (child._swallowErrors) {
+      me.warn(er)
+      child.emit("end")
+      child.emit("close")
+    } else {
+      me.emit("error", er)
+    }
+  })
+
+  // we fire _end internally *after* end, so that we don't move on
+  // until any "end" listeners have had their chance to do stuff.
+  child.on("close", onend)
+  var ended = false
+  function onend () {
+    if (ended) return
+    ended = true
+    // console.error("* DW Child end", child.basename)
+    me._currentChild = null
+    me._processing = false
+    me._process()
+  }
+}
diff --git a/wrt/node_modules/fstream/lib/file-reader.js b/wrt/node_modules/fstream/lib/file-reader.js
new file mode 100644 (file)
index 0000000..b1f9861
--- /dev/null
@@ -0,0 +1,147 @@
+// Basically just a wrapper around an fs.ReadStream
+
+module.exports = FileReader
+
+var fs = require("graceful-fs")
+  , fstream = require("../fstream.js")
+  , Reader = fstream.Reader
+  , inherits = require("inherits")
+  , mkdir = require("mkdirp")
+  , Reader = require("./reader.js")
+  , EOF = {EOF: true}
+  , CLOSE = {CLOSE: true}
+
+inherits(FileReader, Reader)
+
+function FileReader (props) {
+  // console.error("    FR create", props.path, props.size, new Error().stack)
+  var me = this
+  if (!(me instanceof FileReader)) throw new Error(
+    "FileReader must be called as constructor.")
+
+  // should already be established as a File type
+  // XXX Todo: preserve hardlinks by tracking dev+inode+nlink,
+  // with a HardLinkReader class.
+  if (!((props.type === "Link" && props.Link) ||
+        (props.type === "File" && props.File))) {
+    throw new Error("Non-file type "+ props.type)
+  }
+
+  me._buffer = []
+  me._bytesEmitted = 0
+  Reader.call(me, props)
+}
+
+FileReader.prototype._getStream = function () {
+  var me = this
+    , stream = me._stream = fs.createReadStream(me._path, me.props)
+
+  if (me.props.blksize) {
+    stream.bufferSize = me.props.blksize
+  }
+
+  stream.on("open", me.emit.bind(me, "open"))
+
+  stream.on("data", function (c) {
+    // console.error("\t\t%d %s", c.length, me.basename)
+    me._bytesEmitted += c.length
+    // no point saving empty chunks
+    if (!c.length) return
+    else if (me._paused || me._buffer.length) {
+      me._buffer.push(c)
+      me._read()
+    } else me.emit("data", c)
+  })
+
+  stream.on("end", function () {
+    if (me._paused || me._buffer.length) {
+      // console.error("FR Buffering End", me._path)
+      me._buffer.push(EOF)
+      me._read()
+    } else {
+      me.emit("end")
+    }
+
+    if (me._bytesEmitted !== me.props.size) {
+      me.error("Didn't get expected byte count\n"+
+               "expect: "+me.props.size + "\n" +
+               "actual: "+me._bytesEmitted)
+    }
+  })
+
+  stream.on("close", function () {
+    if (me._paused || me._buffer.length) {
+      // console.error("FR Buffering Close", me._path)
+      me._buffer.push(CLOSE)
+      me._read()
+    } else {
+      // console.error("FR close 1", me._path)
+      me.emit("close")
+    }
+  })
+
+  me._read()
+}
+
+FileReader.prototype._read = function () {
+  var me = this
+  // console.error("FR _read", me._path)
+  if (me._paused) {
+    // console.error("FR _read paused", me._path)
+    return
+  }
+
+  if (!me._stream) {
+    // console.error("FR _getStream calling", me._path)
+    return me._getStream()
+  }
+
+  // clear out the buffer, if there is one.
+  if (me._buffer.length) {
+    // console.error("FR _read has buffer", me._buffer.length, me._path)
+    var buf = me._buffer
+    for (var i = 0, l = buf.length; i < l; i ++) {
+      var c = buf[i]
+      if (c === EOF) {
+        // console.error("FR Read emitting buffered end", me._path)
+        me.emit("end")
+      } else if (c === CLOSE) {
+        // console.error("FR Read emitting buffered close", me._path)
+        me.emit("close")
+      } else {
+        // console.error("FR Read emitting buffered data", me._path)
+        me.emit("data", c)
+      }
+
+      if (me._paused) {
+        // console.error("FR Read Re-pausing at "+i, me._path)
+        me._buffer = buf.slice(i)
+        return
+      }
+    }
+    me._buffer.length = 0
+  }
+  // console.error("FR _read done")
+  // that's about all there is to it.
+}
+
+FileReader.prototype.pause = function (who) {
+  var me = this
+  // console.error("FR Pause", me._path)
+  if (me._paused) return
+  who = who || me
+  me._paused = true
+  if (me._stream) me._stream.pause()
+  me.emit("pause", who)
+}
+
+FileReader.prototype.resume = function (who) {
+  var me = this
+  // console.error("FR Resume", me._path)
+  if (!me._paused) return
+  who = who || me
+  me.emit("resume", who)
+  me._paused = false
+  if (me._stream) me._stream.resume()
+  me._read()
+}
diff --git a/wrt/node_modules/fstream/lib/file-writer.js b/wrt/node_modules/fstream/lib/file-writer.js
new file mode 100644 (file)
index 0000000..5e9902a
--- /dev/null
@@ -0,0 +1,104 @@
+module.exports = FileWriter
+
+var fs = require("graceful-fs")
+  , mkdir = require("mkdirp")
+  , Writer = require("./writer.js")
+  , inherits = require("inherits")
+  , EOF = {}
+
+inherits(FileWriter, Writer)
+
+function FileWriter (props) {
+  var me = this
+  if (!(me instanceof FileWriter)) throw new Error(
+    "FileWriter must be called as constructor.")
+
+  // should already be established as a File type
+  if (props.type !== "File" || !props.File) {
+    throw new Error("Non-file type "+ props.type)
+  }
+
+  me._buffer = []
+  me._bytesWritten = 0
+
+  Writer.call(this, props)
+}
+
+FileWriter.prototype._create = function () {
+  var me = this
+  if (me._stream) return
+
+  var so = {}
+  if (me.props.flags) so.flags = me.props.flags
+  so.mode = Writer.filemode
+  if (me._old && me._old.blksize) so.bufferSize = me._old.blksize
+
+  me._stream = fs.createWriteStream(me._path, so)
+
+  me._stream.on("open", function (fd) {
+    // console.error("FW open", me._buffer, me._path)
+    me.ready = true
+    me._buffer.forEach(function (c) {
+      if (c === EOF) me._stream.end()
+      else me._stream.write(c)
+    })
+    me.emit("ready")
+    // give this a kick just in case it needs it.
+    me.emit("drain")
+  })
+
+  me._stream.on("drain", function () { me.emit("drain") })
+
+  me._stream.on("close", function () {
+    // console.error("\n\nFW Stream Close", me._path, me.size)
+    me._finish()
+  })
+}
+
+FileWriter.prototype.write = function (c) {
+  var me = this
+
+  me._bytesWritten += c.length
+
+  if (!me.ready) {
+    if (!Buffer.isBuffer(c) && typeof c !== 'string')
+      throw new Error('invalid write data')
+    me._buffer.push(c)
+    return false
+  }
+
+  var ret = me._stream.write(c)
+  // console.error("\t-- fw wrote, _stream says", ret, me._stream._queue.length)
+
+  // allow 2 buffered writes, because otherwise there's just too
+  // much stop and go bs.
+  if (ret === false && me._stream._queue) {
+    return me._stream._queue.length <= 2;
+  } else {
+    return ret;
+  }
+}
+
+FileWriter.prototype.end = function (c) {
+  var me = this
+
+  if (c) me.write(c)
+
+  if (!me.ready) {
+    me._buffer.push(EOF)
+    return false
+  }
+
+  return me._stream.end()
+}
+
+FileWriter.prototype._finish = function () {
+  var me = this
+  if (typeof me.size === "number" && me._bytesWritten != me.size) {
+    me.error(
+      "Did not get expected byte count.\n" +
+      "expect: " + me.size + "\n" +
+      "actual: " + me._bytesWritten)
+  }
+  Writer.prototype._finish.call(me)
+}
diff --git a/wrt/node_modules/fstream/lib/get-type.js b/wrt/node_modules/fstream/lib/get-type.js
new file mode 100644 (file)
index 0000000..cd65c41
--- /dev/null
@@ -0,0 +1,32 @@
+module.exports = getType
+
+function getType (st) {
+  var types =
+      [ "Directory"
+      , "File"
+      , "SymbolicLink"
+      , "Link" // special for hardlinks from tarballs
+      , "BlockDevice"
+      , "CharacterDevice"
+      , "FIFO"
+      , "Socket" ]
+    , type
+
+  if (st.type && -1 !== types.indexOf(st.type)) {
+    st[st.type] = true
+    return st.type
+  }
+
+  for (var i = 0, l = types.length; i < l; i ++) {
+    type = types[i]
+    var is = st[type] || st["is" + type]
+    if (typeof is === "function") is = is.call(st)
+    if (is) {
+      st[type] = true
+      st.type = type
+      return type
+    }
+  }
+
+  return null
+}
diff --git a/wrt/node_modules/fstream/lib/link-reader.js b/wrt/node_modules/fstream/lib/link-reader.js
new file mode 100644 (file)
index 0000000..7e7ab6c
--- /dev/null
@@ -0,0 +1,54 @@
+// Basically just a wrapper around an fs.readlink
+//
+// XXX: Enhance this to support the Link type, by keeping
+// a lookup table of {<dev+inode>:<path>}, so that hardlinks
+// can be preserved in tarballs.
+
+module.exports = LinkReader
+
+var fs = require("graceful-fs")
+  , fstream = require("../fstream.js")
+  , inherits = require("inherits")
+  , mkdir = require("mkdirp")
+  , Reader = require("./reader.js")
+
+inherits(LinkReader, Reader)
+
+function LinkReader (props) {
+  var me = this
+  if (!(me instanceof LinkReader)) throw new Error(
+    "LinkReader must be called as constructor.")
+
+  if (!((props.type === "Link" && props.Link) ||
+        (props.type === "SymbolicLink" && props.SymbolicLink))) {
+    throw new Error("Non-link type "+ props.type)
+  }
+
+  Reader.call(me, props)
+}
+
+// When piping a LinkReader into a LinkWriter, we have to
+// already have the linkpath property set, so that has to
+// happen *before* the "ready" event, which means we need to
+// override the _stat method.
+LinkReader.prototype._stat = function (currentStat) {
+  var me = this
+  fs.readlink(me._path, function (er, linkpath) {
+    if (er) return me.error(er)
+    me.linkpath = me.props.linkpath = linkpath
+    me.emit("linkpath", linkpath)
+    Reader.prototype._stat.call(me, currentStat)
+  })
+}
+
+LinkReader.prototype._read = function () {
+  var me = this
+  if (me._paused) return
+  // basically just a no-op, since we got all the info we need
+  // from the _stat method
+  if (!me._ended) {
+    me.emit("end")
+    me.emit("close")
+    me._ended = true
+  }
+}
diff --git a/wrt/node_modules/fstream/lib/link-writer.js b/wrt/node_modules/fstream/lib/link-writer.js
new file mode 100644 (file)
index 0000000..5c8f1e7
--- /dev/null
@@ -0,0 +1,95 @@
+
+module.exports = LinkWriter
+
+var fs = require("graceful-fs")
+  , Writer = require("./writer.js")
+  , inherits = require("inherits")
+  , path = require("path")
+  , rimraf = require("rimraf")
+
+inherits(LinkWriter, Writer)
+
+function LinkWriter (props) {
+  var me = this
+  if (!(me instanceof LinkWriter)) throw new Error(
+    "LinkWriter must be called as constructor.")
+
+  // should already be established as a Link type
+  if (!((props.type === "Link" && props.Link) ||
+        (props.type === "SymbolicLink" && props.SymbolicLink))) {
+    throw new Error("Non-link type "+ props.type)
+  }
+
+  if (props.linkpath === "") props.linkpath = "."
+  if (!props.linkpath) {
+    me.error("Need linkpath property to create " + props.type)
+  }
+
+  Writer.call(this, props)
+}
+
+LinkWriter.prototype._create = function () {
+  // console.error(" LW _create")
+  var me = this
+    , hard = me.type === "Link" || process.platform === "win32"
+    , link = hard ? "link" : "symlink"
+    , lp = hard ? path.resolve(me.dirname, me.linkpath) : me.linkpath
+
+  // can only change the link path by clobbering
+  // For hard links, let's just assume that's always the case, since
+  // there's no good way to read them if we don't already know.
+  if (hard) return clobber(me, lp, link)
+
+  fs.readlink(me._path, function (er, p) {
+    // only skip creation if it's exactly the same link
+    if (p && p === lp) return finish(me)
+    clobber(me, lp, link)
+  })
+}
+
+function clobber (me, lp, link) {
+  rimraf(me._path, function (er) {
+    if (er) return me.error(er)
+    create(me, lp, link)
+  })
+}
+
+function create (me, lp, link) {
+  fs[link](lp, me._path, function (er) {
+    // if this is a hard link, and we're in the process of writing out a
+    // directory, it's very possible that the thing we're linking to
+    // doesn't exist yet (especially if it was intended as a symlink),
+    // so swallow ENOENT errors here and just soldier in.
+    // Additionally, an EPERM or EACCES can happen on win32 if it's trying
+    // to make a link to a directory.  Again, just skip it.
+    // A better solution would be to have fs.symlink be supported on
+    // windows in some nice fashion.
+    if (er) {
+      if ((er.code === "ENOENT" ||
+           er.code === "EACCES" ||
+           er.code === "EPERM" ) && process.platform === "win32") {
+        me.ready = true
+        me.emit("ready")
+        me.emit("end")
+        me.emit("close")
+        me.end = me._finish = function () {}
+      } else return me.error(er)
+    }
+    finish(me)
+  })
+}
+
+function finish (me) {
+  me.ready = true
+  me.emit("ready")
+  if (me._ended && !me._finished) me._finish()
+}
+
+LinkWriter.prototype.end = function () {
+  // console.error("LW finish in end")
+  this._ended = true
+  if (this.ready) {
+    this._finished = true
+    this._finish()
+  }
+}
diff --git a/wrt/node_modules/fstream/lib/proxy-reader.js b/wrt/node_modules/fstream/lib/proxy-reader.js
new file mode 100644 (file)
index 0000000..a0ece34
--- /dev/null
@@ -0,0 +1,93 @@
+// A reader for when we don't yet know what kind of thing
+// the thing is.
+
+module.exports = ProxyReader
+
+var Reader = require("./reader.js")
+  , getType = require("./get-type.js")
+  , inherits = require("inherits")
+  , fs = require("graceful-fs")
+
+inherits(ProxyReader, Reader)
+
+function ProxyReader (props) {
+  var me = this
+  if (!(me instanceof ProxyReader)) throw new Error(
+    "ProxyReader must be called as constructor.")
+
+  me.props = props
+  me._buffer = []
+  me.ready = false
+
+  Reader.call(me, props)
+}
+
+ProxyReader.prototype._stat = function () {
+  var me = this
+    , props = me.props
+    // stat the thing to see what the proxy should be.
+    , stat = props.follow ? "stat" : "lstat"
+
+  fs[stat](props.path, function (er, current) {
+    var type
+    if (er || !current) {
+      type = "File"
+    } else {
+      type = getType(current)
+    }
+
+    props[type] = true
+    props.type = me.type = type
+
+    me._old = current
+    me._addProxy(Reader(props, current))
+  })
+}
+
+ProxyReader.prototype._addProxy = function (proxy) {
+  var me = this
+  if (me._proxyTarget) {
+    return me.error("proxy already set")
+  }
+
+  me._proxyTarget = proxy
+  proxy._proxy = me
+
+  ; [ "error"
+    , "data"
+    , "end"
+    , "close"
+    , "linkpath"
+    , "entry"
+    , "entryEnd"
+    , "child"
+    , "childEnd"
+    , "warn"
+    , "stat"
+    ].forEach(function (ev) {
+      // console.error("~~ proxy event", ev, me.path)
+      proxy.on(ev, me.emit.bind(me, ev))
+    })
+
+  me.emit("proxy", proxy)
+
+  proxy.on("ready", function () {
+    // console.error("~~ proxy is ready!", me.path)
+    me.ready = true
+    me.emit("ready")
+  })
+
+  var calls = me._buffer
+  me._buffer.length = 0
+  calls.forEach(function (c) {
+    proxy[c[0]].apply(proxy, c[1])
+  })
+}
+
+ProxyReader.prototype.pause = function () {
+  return this._proxyTarget ? this._proxyTarget.pause() : false
+}
+
+ProxyReader.prototype.resume = function () {
+  return this._proxyTarget ? this._proxyTarget.resume() : false
+}
diff --git a/wrt/node_modules/fstream/lib/proxy-writer.js b/wrt/node_modules/fstream/lib/proxy-writer.js
new file mode 100644 (file)
index 0000000..b047663
--- /dev/null
@@ -0,0 +1,109 @@
+// A writer for when we don't know what kind of thing
+// the thing is.  That is, it's not explicitly set,
+// so we're going to make it whatever the thing already
+// is, or "File"
+//
+// Until then, collect all events.
+
+module.exports = ProxyWriter
+
+var Writer = require("./writer.js")
+  , getType = require("./get-type.js")
+  , inherits = require("inherits")
+  , collect = require("./collect.js")
+  , fs = require("fs")
+
+inherits(ProxyWriter, Writer)
+
+function ProxyWriter (props) {
+  var me = this
+  if (!(me instanceof ProxyWriter)) throw new Error(
+    "ProxyWriter must be called as constructor.")
+
+  me.props = props
+  me._needDrain = false
+
+  Writer.call(me, props)
+}
+
+ProxyWriter.prototype._stat = function () {
+  var me = this
+    , props = me.props
+    // stat the thing to see what the proxy should be.
+    , stat = props.follow ? "stat" : "lstat"
+
+  fs[stat](props.path, function (er, current) {
+    var type
+    if (er || !current) {
+      type = "File"
+    } else {
+      type = getType(current)
+    }
+
+    props[type] = true
+    props.type = me.type = type
+
+    me._old = current
+    me._addProxy(Writer(props, current))
+  })
+}
+
+ProxyWriter.prototype._addProxy = function (proxy) {
+  // console.error("~~ set proxy", this.path)
+  var me = this
+  if (me._proxy) {
+    return me.error("proxy already set")
+  }
+
+  me._proxy = proxy
+  ; [ "ready"
+    , "error"
+    , "close"
+    , "pipe"
+    , "drain"
+    , "warn"
+    ].forEach(function (ev) {
+      proxy.on(ev, me.emit.bind(me, ev))
+    })
+
+  me.emit("proxy", proxy)
+
+  var calls = me._buffer
+  calls.forEach(function (c) {
+    // console.error("~~ ~~ proxy buffered call", c[0], c[1])
+    proxy[c[0]].apply(proxy, c[1])
+  })
+  me._buffer.length = 0
+  if (me._needsDrain) me.emit("drain")
+}
+
+ProxyWriter.prototype.add = function (entry) {
+  // console.error("~~ proxy add")
+  collect(entry)
+
+  if (!this._proxy) {
+    this._buffer.push(["add", [entry]])
+    this._needDrain = true
+    return false
+  }
+  return this._proxy.add(entry)
+}
+
+ProxyWriter.prototype.write = function (c) {
+  // console.error("~~ proxy write")
+  if (!this._proxy) {
+    this._buffer.push(["write", [c]])
+    this._needDrain = true
+    return false
+  }
+  return this._proxy.write(c)
+}
+
+ProxyWriter.prototype.end = function (c) {
+  // console.error("~~ proxy end")
+  if (!this._proxy) {
+    this._buffer.push(["end", [c]])
+    return false
+  }
+  return this._proxy.end(c)
+}
diff --git a/wrt/node_modules/fstream/lib/reader.js b/wrt/node_modules/fstream/lib/reader.js
new file mode 100644 (file)
index 0000000..0edb794
--- /dev/null
@@ -0,0 +1,262 @@
+
+module.exports = Reader
+
+var fs = require("graceful-fs")
+  , Stream = require("stream").Stream
+  , inherits = require("inherits")
+  , path = require("path")
+  , getType = require("./get-type.js")
+  , hardLinks = Reader.hardLinks = {}
+  , Abstract = require("./abstract.js")
+
+// Must do this *before* loading the child classes
+inherits(Reader, Abstract)
+
+var DirReader = require("./dir-reader.js")
+  , FileReader = require("./file-reader.js")
+  , LinkReader = require("./link-reader.js")
+  , SocketReader = require("./socket-reader.js")
+  , ProxyReader = require("./proxy-reader.js")
+
+function Reader (props, currentStat) {
+  var me = this
+  if (!(me instanceof Reader)) return new Reader(props, currentStat)
+
+  if (typeof props === "string") {
+    props = { path: props }
+  }
+
+  if (!props.path) {
+    me.error("Must provide a path", null, true)
+  }
+
+  // polymorphism.
+  // call fstream.Reader(dir) to get a DirReader object, etc.
+  // Note that, unlike in the Writer case, ProxyReader is going
+  // to be the *normal* state of affairs, since we rarely know
+  // the type of a file prior to reading it.
+
+
+  var type
+    , ClassType
+
+  if (props.type && typeof props.type === "function") {
+    type = props.type
+    ClassType = type
+  } else {
+    type = getType(props)
+    ClassType = Reader
+  }
+
+  if (currentStat && !type) {
+    type = getType(currentStat)
+    props[type] = true
+    props.type = type
+  }
+
+  switch (type) {
+    case "Directory":
+      ClassType = DirReader
+      break
+
+    case "Link":
+      // XXX hard links are just files.
+      // However, it would be good to keep track of files' dev+inode
+      // and nlink values, and create a HardLinkReader that emits
+      // a linkpath value of the original copy, so that the tar
+      // writer can preserve them.
+      // ClassType = HardLinkReader
+      // break
+
+    case "File":
+      ClassType = FileReader
+      break
+
+    case "SymbolicLink":
+      ClassType = LinkReader
+      break
+
+    case "Socket":
+      ClassType = SocketReader
+      break
+
+    case null:
+      ClassType = ProxyReader
+      break
+  }
+
+  if (!(me instanceof ClassType)) {
+    return new ClassType(props)
+  }
+
+  Abstract.call(me)
+
+  me.readable = true
+  me.writable = false
+
+  me.type = type
+  me.props = props
+  me.depth = props.depth = props.depth || 0
+  me.parent = props.parent || null
+  me.root = props.root || (props.parent && props.parent.root) || me
+
+  me._path = me.path = path.resolve(props.path)
+  if (process.platform === "win32") {
+    me.path = me._path = me.path.replace(/\?/g, "_")
+    if (me._path.length >= 260) {
+      // how DOES one create files on the moon?
+      // if the path has spaces in it, then UNC will fail.
+      me._swallowErrors = true
+      //if (me._path.indexOf(" ") === -1) {
+        me._path = "\\\\?\\" + me.path.replace(/\//g, "\\")
+      //}
+    }
+  }
+  me.basename = props.basename = path.basename(me.path)
+  me.dirname = props.dirname = path.dirname(me.path)
+
+  // these have served their purpose, and are now just noisy clutter
+  props.parent = props.root = null
+
+  // console.error("\n\n\n%s setting size to", props.path, props.size)
+  me.size = props.size
+  me.filter = typeof props.filter === "function" ? props.filter : null
+  if (props.sort === "alpha") props.sort = alphasort
+
+  // start the ball rolling.
+  // this will stat the thing, and then call me._read()
+  // to start reading whatever it is.
+  // console.error("calling stat", props.path, currentStat)
+  me._stat(currentStat)
+}
+
+function alphasort (a, b) {
+  return a === b ? 0
+       : a.toLowerCase() > b.toLowerCase() ? 1
+       : a.toLowerCase() < b.toLowerCase() ? -1
+       : a > b ? 1
+       : -1
+}
+
+Reader.prototype._stat = function (currentStat) {
+  var me = this
+    , props = me.props
+    , stat = props.follow ? "stat" : "lstat"
+  // console.error("Reader._stat", me._path, currentStat)
+  if (currentStat) process.nextTick(statCb.bind(null, null, currentStat))
+  else fs[stat](me._path, statCb)
+
+
+  function statCb (er, props_) {
+    // console.error("Reader._stat, statCb", me._path, props_, props_.nlink)
+    if (er) return me.error(er)
+
+    Object.keys(props_).forEach(function (k) {
+      props[k] = props_[k]
+    })
+
+    // if it's not the expected size, then abort here.
+    if (undefined !== me.size && props.size !== me.size) {
+      return me.error("incorrect size")
+    }
+    me.size = props.size
+
+    var type = getType(props)
+    var handleHardlinks = props.hardlinks !== false
+    
+    // special little thing for handling hardlinks.
+    if (handleHardlinks && type !== "Directory" && props.nlink && props.nlink > 1) {
+      var k = props.dev + ":" + props.ino
+      // console.error("Reader has nlink", me._path, k)
+      if (hardLinks[k] === me._path || !hardLinks[k]) hardLinks[k] = me._path
+      else {
+        // switch into hardlink mode.
+        type = me.type = me.props.type = "Link"
+        me.Link = me.props.Link = true
+        me.linkpath = me.props.linkpath = hardLinks[k]
+        // console.error("Hardlink detected, switching mode", me._path, me.linkpath)
+        // Setting __proto__ would arguably be the "correct"
+        // approach here, but that just seems too wrong.
+        me._stat = me._read = LinkReader.prototype._read
+      }
+    }
+
+    if (me.type && me.type !== type) {
+      me.error("Unexpected type: " + type)
+    }
+
+    // if the filter doesn't pass, then just skip over this one.
+    // still have to emit end so that dir-walking can move on.
+    if (me.filter) {
+      var who = me._proxy || me
+      // special handling for ProxyReaders
+      if (!me.filter.call(who, who, props)) {
+        if (!me._disowned) {
+          me.abort()
+          me.emit("end")
+          me.emit("close")
+        }
+        return
+      }
+    }
+
+    // last chance to abort or disown before the flow starts!
+    var events = ["_stat", "stat", "ready"]
+    var e = 0
+    ;(function go () {
+      if (me._aborted) {
+        me.emit("end")
+        me.emit("close")
+        return
+      }
+
+      if (me._paused && me.type !== "Directory") {
+        me.once("resume", go)
+        return
+      }
+
+      var ev = events[e ++]
+      if (!ev) {
+        return me._read()
+      }
+      me.emit(ev, props)
+      go()
+    })()
+  }
+}
+
+Reader.prototype.pipe = function (dest, opts) {
+  var me = this
+  if (typeof dest.add === "function") {
+    // piping to a multi-compatible, and we've got directory entries.
+    me.on("entry", function (entry) {
+      var ret = dest.add(entry)
+      if (false === ret) {
+        me.pause()
+      }
+    })
+  }
+
+  // console.error("R Pipe apply Stream Pipe")
+  return Stream.prototype.pipe.apply(this, arguments)
+}
+
+Reader.prototype.pause = function (who) {
+  this._paused = true
+  who = who || this
+  this.emit("pause", who)
+  if (this._stream) this._stream.pause(who)
+}
+
+Reader.prototype.resume = function (who) {
+  this._paused = false
+  who = who || this
+  this.emit("resume", who)
+  if (this._stream) this._stream.resume(who)
+  this._read()
+}
+
+Reader.prototype._read = function () {
+  this.error("Cannot read unknown type: "+this.type)
+}
+
diff --git a/wrt/node_modules/fstream/lib/socket-reader.js b/wrt/node_modules/fstream/lib/socket-reader.js
new file mode 100644 (file)
index 0000000..e89c173
--- /dev/null
@@ -0,0 +1,38 @@
+// Just get the stats, and then don't do anything.
+// You can't really "read" from a socket.  You "connect" to it.
+// Mostly, this is here so that reading a dir with a socket in it
+// doesn't blow up.
+
+module.exports = SocketReader
+
+var fs = require("graceful-fs")
+  , fstream = require("../fstream.js")
+  , inherits = require("inherits")
+  , mkdir = require("mkdirp")
+  , Reader = require("./reader.js")
+
+inherits(SocketReader, Reader)
+
+function SocketReader (props) {
+  var me = this
+  if (!(me instanceof SocketReader)) throw new Error(
+    "SocketReader must be called as constructor.")
+
+  if (!(props.type === "Socket" && props.Socket)) {
+    throw new Error("Non-socket type "+ props.type)
+  }
+
+  Reader.call(me, props)
+}
+
+SocketReader.prototype._read = function () {
+  var me = this
+  if (me._paused) return
+  // basically just a no-op, since we got all the info we have
+  // from the _stat method
+  if (!me._ended) {
+    me.emit("end")
+    me.emit("close")
+    me._ended = true
+  }
+}
diff --git a/wrt/node_modules/fstream/lib/writer.js b/wrt/node_modules/fstream/lib/writer.js
new file mode 100644 (file)
index 0000000..5599fb2
--- /dev/null
@@ -0,0 +1,389 @@
+
+module.exports = Writer
+
+var fs = require("graceful-fs")
+  , inherits = require("inherits")
+  , rimraf = require("rimraf")
+  , mkdir = require("mkdirp")
+  , path = require("path")
+  , umask = process.platform === "win32" ? 0 : process.umask()
+  , getType = require("./get-type.js")
+  , Abstract = require("./abstract.js")
+
+// Must do this *before* loading the child classes
+inherits(Writer, Abstract)
+
+Writer.dirmode = 0777 & (~umask)
+Writer.filemode = 0666 & (~umask)
+
+var DirWriter = require("./dir-writer.js")
+  , LinkWriter = require("./link-writer.js")
+  , FileWriter = require("./file-writer.js")
+  , ProxyWriter = require("./proxy-writer.js")
+
+// props is the desired state.  current is optionally the current stat,
+// provided here so that subclasses can avoid statting the target
+// more than necessary.
+function Writer (props, current) {
+  var me = this
+
+  if (typeof props === "string") {
+    props = { path: props }
+  }
+
+  if (!props.path) me.error("Must provide a path", null, true)
+
+  // polymorphism.
+  // call fstream.Writer(dir) to get a DirWriter object, etc.
+  var type = getType(props)
+    , ClassType = Writer
+
+  switch (type) {
+    case "Directory":
+      ClassType = DirWriter
+      break
+    case "File":
+      ClassType = FileWriter
+      break
+    case "Link":
+    case "SymbolicLink":
+      ClassType = LinkWriter
+      break
+    case null:
+      // Don't know yet what type to create, so we wrap in a proxy.
+      ClassType = ProxyWriter
+      break
+  }
+
+  if (!(me instanceof ClassType)) return new ClassType(props)
+
+  // now get down to business.
+
+  Abstract.call(me)
+
+  // props is what we want to set.
+  // set some convenience properties as well.
+  me.type = props.type
+  me.props = props
+  me.depth = props.depth || 0
+  me.clobber = false === props.clobber ? props.clobber : true
+  me.parent = props.parent || null
+  me.root = props.root || (props.parent && props.parent.root) || me
+
+  me._path = me.path = path.resolve(props.path)
+  if (process.platform === "win32") {
+    me.path = me._path = me.path.replace(/\?/g, "_")
+    if (me._path.length >= 260) {
+      me._swallowErrors = true
+      me._path = "\\\\?\\" + me.path.replace(/\//g, "\\")
+    }
+  }
+  me.basename = path.basename(props.path)
+  me.dirname = path.dirname(props.path)
+  me.linkpath = props.linkpath || null
+
+  props.parent = props.root = null
+
+  // console.error("\n\n\n%s setting size to", props.path, props.size)
+  me.size = props.size
+
+  if (typeof props.mode === "string") {
+    props.mode = parseInt(props.mode, 8)
+  }
+
+  me.readable = false
+  me.writable = true
+
+  // buffer until ready, or while handling another entry
+  me._buffer = []
+  me.ready = false
+
+  me.filter = typeof props.filter === "function" ? props.filter: null
+
+  // start the ball rolling.
+  // this checks what's there already, and then calls
+  // me._create() to call the impl-specific creation stuff.
+  me._stat(current)
+}
+
+// Calling this means that it's something we can't create.
+// Just assert that it's already there, otherwise raise a warning.
+Writer.prototype._create = function () {
+  var me = this
+  fs[me.props.follow ? "stat" : "lstat"](me._path, function (er, current) {
+    if (er) {
+      return me.warn("Cannot create " + me._path + "\n" +
+                     "Unsupported type: "+me.type, "ENOTSUP")
+    }
+    me._finish()
+  })
+}
+
+Writer.prototype._stat = function (current) {
+  var me = this
+    , props = me.props
+    , stat = props.follow ? "stat" : "lstat"
+    , who = me._proxy || me
+
+  if (current) statCb(null, current)
+  else fs[stat](me._path, statCb)
+
+  function statCb (er, current) {
+    if (me.filter && !me.filter.call(who, who, current)) {
+      me._aborted = true
+      me.emit("end")
+      me.emit("close")
+      return
+    }
+
+    // if it's not there, great.  We'll just create it.
+    // if it is there, then we'll need to change whatever differs
+    if (er || !current) {
+      return create(me)
+    }
+
+    me._old = current
+    var currentType = getType(current)
+
+    // if it's a type change, then we need to clobber or error.
+    // if it's not a type change, then let the impl take care of it.
+    if (currentType !== me.type) {
+      return rimraf(me._path, function (er) {
+        if (er) return me.error(er)
+        me._old = null
+        create(me)
+      })
+    }
+
+    // otherwise, just handle in the app-specific way
+    // this creates a fs.WriteStream, or mkdir's, or whatever
+    create(me)
+  }
+}
+
+function create (me) {
+  // console.error("W create", me._path, Writer.dirmode)
+
+  // XXX Need to clobber non-dirs that are in the way,
+  // unless { clobber: false } in the props.
+  mkdir(path.dirname(me._path), Writer.dirmode, function (er, made) {
+    // console.error("W created", path.dirname(me._path), er)
+    if (er) return me.error(er)
+
+    // later on, we have to set the mode and owner for these
+    me._madeDir = made
+    return me._create()
+  })
+}
+
+function endChmod (me, want, current, path, cb) {
+    var wantMode = want.mode
+      , chmod = want.follow || me.type !== "SymbolicLink"
+              ? "chmod" : "lchmod"
+
+  if (!fs[chmod]) return cb()
+  if (typeof wantMode !== "number") return cb()
+
+  var curMode = current.mode & 0777
+  wantMode = wantMode & 0777
+  if (wantMode === curMode) return cb()
+
+  fs[chmod](path, wantMode, cb)
+}
+
+
+function endChown (me, want, current, path, cb) {
+  // Don't even try it unless root.  Too easy to EPERM.
+  if (process.platform === "win32") return cb()
+  if (!process.getuid || !process.getuid() === 0) return cb()
+  if (typeof want.uid !== "number" &&
+      typeof want.gid !== "number" ) return cb()
+
+  if (current.uid === want.uid &&
+      current.gid === want.gid) return cb()
+
+  var chown = (me.props.follow || me.type !== "SymbolicLink")
+            ? "chown" : "lchown"
+  if (!fs[chown]) return cb()
+
+  if (typeof want.uid !== "number") want.uid = current.uid
+  if (typeof want.gid !== "number") want.gid = current.gid
+
+  fs[chown](path, want.uid, want.gid, cb)
+}
+
+function endUtimes (me, want, current, path, cb) {
+  if (!fs.utimes || process.platform === "win32") return cb()
+
+  var utimes = (want.follow || me.type !== "SymbolicLink")
+             ? "utimes" : "lutimes"
+
+  if (utimes === "lutimes" && !fs[utimes]) {
+    utimes = "utimes"
+  }
+
+  if (!fs[utimes]) return cb()
+
+  var curA = current.atime
+    , curM = current.mtime
+    , meA = want.atime
+    , meM = want.mtime
+
+  if (meA === undefined) meA = curA
+  if (meM === undefined) meM = curM
+
+  if (!isDate(meA)) meA = new Date(meA)
+  if (!isDate(meM)) meA = new Date(meM)
+
+  if (meA.getTime() === curA.getTime() &&
+      meM.getTime() === curM.getTime()) return cb()
+
+  fs[utimes](path, meA, meM, cb)
+}
+
+
+// XXX This function is beastly.  Break it up!
+Writer.prototype._finish = function () {
+  var me = this
+
+  // console.error(" W Finish", me._path, me.size)
+
+  // set up all the things.
+  // At this point, we're already done writing whatever we've gotta write,
+  // adding files to the dir, etc.
+  var todo = 0
+  var errState = null
+  var done = false
+
+  if (me._old) {
+    // the times will almost *certainly* have changed.
+    // adds the utimes syscall, but remove another stat.
+    me._old.atime = new Date(0)
+    me._old.mtime = new Date(0)
+    // console.error(" W Finish Stale Stat", me._path, me.size)
+    setProps(me._old)
+  } else {
+    var stat = me.props.follow ? "stat" : "lstat"
+    // console.error(" W Finish Stating", me._path, me.size)
+    fs[stat](me._path, function (er, current) {
+      // console.error(" W Finish Stated", me._path, me.size, current)
+      if (er) {
+        // if we're in the process of writing out a
+        // directory, it's very possible that the thing we're linking to
+        // doesn't exist yet (especially if it was intended as a symlink),
+        // so swallow ENOENT errors here and just soldier on.
+        if (er.code === "ENOENT" &&
+            (me.type === "Link" || me.type === "SymbolicLink") &&
+            process.platform === "win32") {
+          me.ready = true
+          me.emit("ready")
+          me.emit("end")
+          me.emit("close")
+          me.end = me._finish = function () {}
+          return
+        } else return me.error(er)
+      }
+      setProps(me._old = current)
+    })
+  }
+
+  return
+
+  function setProps (current) {
+    todo += 3
+    endChmod(me, me.props, current, me._path, next("chmod"))
+    endChown(me, me.props, current, me._path, next("chown"))
+    endUtimes(me, me.props, current, me._path, next("utimes"))
+  }
+
+  function next (what) {
+    return function (er) {
+      // console.error("   W Finish", what, todo)
+      if (errState) return
+      if (er) {
+        er.fstream_finish_call = what
+        return me.error(errState = er)
+      }
+      if (--todo > 0) return
+      if (done) return
+      done = true
+
+      // we may still need to set the mode/etc. on some parent dirs
+      // that were created previously.  delay end/close until then.
+      if (!me._madeDir) return end()
+      else endMadeDir(me, me._path, end)
+
+      function end (er) {
+        if (er) {
+          er.fstream_finish_call = "setupMadeDir"
+          return me.error(er)
+        }
+        // all the props have been set, so we're completely done.
+        me.emit("end")
+        me.emit("close")
+      }
+    }
+  }
+}
+
+function endMadeDir (me, p, cb) {
+  var made = me._madeDir
+  // everything *between* made and path.dirname(me._path)
+  // needs to be set up.  Note that this may just be one dir.
+  var d = path.dirname(p)
+
+  endMadeDir_(me, d, function (er) {
+    if (er) return cb(er)
+    if (d === made) {
+      return cb()
+    }
+    endMadeDir(me, d, cb)
+  })
+}
+
+function endMadeDir_ (me, p, cb) {
+  var dirProps = {}
+  Object.keys(me.props).forEach(function (k) {
+    dirProps[k] = me.props[k]
+
+    // only make non-readable dirs if explicitly requested.
+    if (k === "mode" && me.type !== "Directory") {
+      dirProps[k] = dirProps[k] | 0111
+    }
+  })
+
+  var todo = 3
+  , errState = null
+  fs.stat(p, function (er, current) {
+    if (er) return cb(errState = er)
+    endChmod(me, dirProps, current, p, next)
+    endChown(me, dirProps, current, p, next)
+    endUtimes(me, dirProps, current, p, next)
+  })
+
+  function next (er) {
+    if (errState) return
+    if (er) return cb(errState = er)
+    if (-- todo === 0) return cb()
+  }
+}
+
+Writer.prototype.pipe = function () {
+  this.error("Can't pipe from writable stream")
+}
+
+Writer.prototype.add = function () {
+  this.error("Cannot add to non-Directory type")
+}
+
+Writer.prototype.write = function () {
+  return true
+}
+
+function objectToString (d) {
+  return Object.prototype.toString.call(d)
+}
+
+function isDate(d) {
+  return typeof d === 'object' && objectToString(d) === '[object Date]';
+}
diff --git a/wrt/node_modules/fstream/package.json b/wrt/node_modules/fstream/package.json
new file mode 100644 (file)
index 0000000..126c48d
--- /dev/null
@@ -0,0 +1,90 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "fstream@>= 0.1.30 < 1",
+        "scope": null,
+        "escapedName": "fstream",
+        "name": "fstream",
+        "rawSpec": ">= 0.1.30 < 1",
+        "spec": ">=0.1.30 <1.0.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/unzip"
+    ]
+  ],
+  "_from": "fstream@>=0.1.30 <1.0.0",
+  "_id": "fstream@0.1.31",
+  "_inCache": true,
+  "_location": "/fstream",
+  "_npmUser": {
+    "name": "isaacs",
+    "email": "i@izs.me"
+  },
+  "_npmVersion": "2.0.0-alpha-5",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "fstream@>= 0.1.30 < 1",
+    "scope": null,
+    "escapedName": "fstream",
+    "name": "fstream",
+    "rawSpec": ">= 0.1.30 < 1",
+    "spec": ">=0.1.30 <1.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/unzip"
+  ],
+  "_resolved": "https://registry.npmjs.org/fstream/-/fstream-0.1.31.tgz",
+  "_shasum": "7337f058fbbbbefa8c9f561a28cab0849202c988",
+  "_shrinkwrap": null,
+  "_spec": "fstream@>= 0.1.30 < 1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/unzip",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bugs": {
+    "url": "https://github.com/isaacs/fstream/issues"
+  },
+  "dependencies": {
+    "graceful-fs": "~3.0.2",
+    "inherits": "~2.0.0",
+    "mkdirp": "0.5",
+    "rimraf": "2"
+  },
+  "description": "Advanced file system stream things",
+  "devDependencies": {
+    "tap": ""
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "7337f058fbbbbefa8c9f561a28cab0849202c988",
+    "tarball": "https://registry.npmjs.org/fstream/-/fstream-0.1.31.tgz"
+  },
+  "engines": {
+    "node": ">=0.6"
+  },
+  "gitHead": "3512b3d41b4c9b3ef15cf32a04e06b297f3dd6a4",
+  "homepage": "https://github.com/isaacs/fstream",
+  "license": "BSD",
+  "main": "fstream.js",
+  "maintainers": [
+    {
+      "name": "isaacs",
+      "email": "i@izs.me"
+    }
+  ],
+  "name": "fstream",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/fstream.git"
+  },
+  "scripts": {
+    "test": "tap examples/*.js"
+  },
+  "version": "0.1.31"
+}
diff --git a/wrt/node_modules/glob/LICENSE b/wrt/node_modules/glob/LICENSE
new file mode 100644 (file)
index 0000000..19129e3
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/wrt/node_modules/glob/README.md b/wrt/node_modules/glob/README.md
new file mode 100644 (file)
index 0000000..6960483
--- /dev/null
@@ -0,0 +1,359 @@
+# Glob
+
+Match files using the patterns the shell uses, like stars and stuff.
+
+[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master)
+
+This is a glob implementation in JavaScript.  It uses the `minimatch`
+library to do its matching.
+
+![](oh-my-glob.gif)
+
+## Usage
+
+```javascript
+var glob = require("glob")
+
+// options is optional
+glob("**/*.js", options, function (er, files) {
+  // files is an array of filenames.
+  // If the `nonull` option is set, and nothing
+  // was found, then files is ["**/*.js"]
+  // er is an error object or null.
+})
+```
+
+## Glob Primer
+
+"Globs" are the patterns you type when you do stuff like `ls *.js` on
+the command line, or put `build/*` in a `.gitignore` file.
+
+Before parsing the path part patterns, braced sections are expanded
+into a set.  Braced sections start with `{` and end with `}`, with any
+number of comma-delimited sections within.  Braced sections may contain
+slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`.
+
+The following characters have special magic meaning when used in a
+path portion:
+
+* `*` Matches 0 or more characters in a single path portion
+* `?` Matches 1 character
+* `[...]` Matches a range of characters, similar to a RegExp range.
+  If the first character of the range is `!` or `^` then it matches
+  any character not in the range.
+* `!(pattern|pattern|pattern)` Matches anything that does not match
+  any of the patterns provided.
+* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the
+  patterns provided.
+* `+(pattern|pattern|pattern)` Matches one or more occurrences of the
+  patterns provided.
+* `*(a|b|c)` Matches zero or more occurrences of the patterns provided
+* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns
+  provided
+* `**` If a "globstar" is alone in a path portion, then it matches
+  zero or more directories and subdirectories searching for matches.
+  It does not crawl symlinked directories.
+
+### Dots
+
+If a file or directory path portion has a `.` as the first character,
+then it will not match any glob pattern unless that pattern's
+corresponding path part also has a `.` as its first character.
+
+For example, the pattern `a/.*/c` would match the file at `a/.b/c`.
+However the pattern `a/*/c` would not, because `*` does not start with
+a dot character.
+
+You can make glob treat dots as normal characters by setting
+`dot:true` in the options.
+
+### Basename Matching
+
+If you set `matchBase:true` in the options, and the pattern has no
+slashes in it, then it will seek for any file anywhere in the tree
+with a matching basename.  For example, `*.js` would match
+`test/simple/basic.js`.
+
+### Empty Sets
+
+If no matching files are found, then an empty array is returned.  This
+differs from the shell, where the pattern itself is returned.  For
+example:
+
+    $ echo a*s*d*f
+    a*s*d*f
+
+To get the bash-style behavior, set the `nonull:true` in the options.
+
+### See Also:
+
+* `man sh`
+* `man bash` (Search for "Pattern Matching")
+* `man 3 fnmatch`
+* `man 5 gitignore`
+* [minimatch documentation](https://github.com/isaacs/minimatch)
+
+## glob.hasMagic(pattern, [options])
+
+Returns `true` if there are any special characters in the pattern, and
+`false` otherwise.
+
+Note that the options affect the results.  If `noext:true` is set in
+the options object, then `+(a|b)` will not be considered a magic
+pattern.  If the pattern has a brace expansion, like `a/{b/c,x/y}`
+then that is considered magical, unless `nobrace:true` is set in the
+options.
+
+## glob(pattern, [options], cb)
+
+* `pattern` `{String}` Pattern to be matched
+* `options` `{Object}`
+* `cb` `{Function}`
+  * `err` `{Error | null}`
+  * `matches` `{Array<String>}` filenames found matching the pattern
+
+Perform an asynchronous glob search.
+
+## glob.sync(pattern, [options])
+
+* `pattern` `{String}` Pattern to be matched
+* `options` `{Object}`
+* return: `{Array<String>}` filenames found matching the pattern
+
+Perform a synchronous glob search.
+
+## Class: glob.Glob
+
+Create a Glob object by instantiating the `glob.Glob` class.
+
+```javascript
+var Glob = require("glob").Glob
+var mg = new Glob(pattern, options, cb)
+```
+
+It's an EventEmitter, and starts walking the filesystem to find matches
+immediately.
+
+### new glob.Glob(pattern, [options], [cb])
+
+* `pattern` `{String}` pattern to search for
+* `options` `{Object}`
+* `cb` `{Function}` Called when an error occurs, or matches are found
+  * `err` `{Error | null}`
+  * `matches` `{Array<String>}` filenames found matching the pattern
+
+Note that if the `sync` flag is set in the options, then matches will
+be immediately available on the `g.found` member.
+
+### Properties
+
+* `minimatch` The minimatch object that the glob uses.
+* `options` The options object passed in.
+* `aborted` Boolean which is set to true when calling `abort()`.  There
+  is no way at this time to continue a glob search after aborting, but
+  you can re-use the statCache to avoid having to duplicate syscalls.
+* `cache` Convenience object.  Each field has the following possible
+  values:
+  * `false` - Path does not exist
+  * `true` - Path exists
+  * `'FILE'` - Path exists, and is not a directory
+  * `'DIR'` - Path exists, and is a directory
+  * `[file, entries, ...]` - Path exists, is a directory, and the
+    array value is the results of `fs.readdir`
+* `statCache` Cache of `fs.stat` results, to prevent statting the same
+  path multiple times.
+* `symlinks` A record of which paths are symbolic links, which is
+  relevant in resolving `**` patterns.
+* `realpathCache` An optional object which is passed to `fs.realpath`
+  to minimize unnecessary syscalls.  It is stored on the instantiated
+  Glob object, and may be re-used.
+
+### Events
+
+* `end` When the matching is finished, this is emitted with all the
+  matches found.  If the `nonull` option is set, and no match was found,
+  then the `matches` list contains the original pattern.  The matches
+  are sorted, unless the `nosort` flag is set.
+* `match` Every time a match is found, this is emitted with the specific
+  thing that matched. It is not deduplicated or resolved to a realpath.
+* `error` Emitted when an unexpected error is encountered, or whenever
+  any fs error occurs if `options.strict` is set.
+* `abort` When `abort()` is called, this event is raised.
+
+### Methods
+
+* `pause` Temporarily stop the search
+* `resume` Resume the search
+* `abort` Stop the search forever
+
+### Options
+
+All the options that can be passed to Minimatch can also be passed to
+Glob to change pattern matching behavior.  Also, some have been added,
+or have glob-specific ramifications.
+
+All options are false by default, unless otherwise noted.
+
+All options are added to the Glob object, as well.
+
+If you are running many `glob` operations, you can pass a Glob object
+as the `options` argument to a subsequent operation to shortcut some
+`stat` and `readdir` calls.  At the very least, you may pass in shared
+`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that
+parallel glob operations will be sped up by sharing information about
+the filesystem.
+
+* `cwd` The current working directory in which to search.  Defaults
+  to `process.cwd()`.
+* `root` The place where patterns starting with `/` will be mounted
+  onto.  Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix
+  systems, and `C:\` or some such on Windows.)
+* `dot` Include `.dot` files in normal matches and `globstar` matches.
+  Note that an explicit dot in a portion of the pattern will always
+  match dot files.
+* `nomount` By default, a pattern starting with a forward-slash will be
+  "mounted" onto the root setting, so that a valid filesystem path is
+  returned.  Set this flag to disable that behavior.
+* `mark` Add a `/` character to directory matches.  Note that this
+  requires additional stat calls.
+* `nosort` Don't sort the results.
+* `stat` Set to true to stat *all* results.  This reduces performance
+  somewhat, and is completely unnecessary, unless `readdir` is presumed
+  to be an untrustworthy indicator of file existence.
+* `silent` When an unusual error is encountered when attempting to
+  read a directory, a warning will be printed to stderr.  Set the
+  `silent` option to true to suppress these warnings.
+* `strict` When an unusual error is encountered when attempting to
+  read a directory, the process will just continue on in search of
+  other matches.  Set the `strict` option to raise an error in these
+  cases.
+* `cache` See `cache` property above.  Pass in a previously generated
+  cache object to save some fs calls.
+* `statCache` A cache of results of filesystem information, to prevent
+  unnecessary stat calls.  While it should not normally be necessary
+  to set this, you may pass the statCache from one glob() call to the
+  options object of another, if you know that the filesystem will not
+  change between calls.  (See "Race Conditions" below.)
+* `symlinks` A cache of known symbolic links.  You may pass in a
+  previously generated `symlinks` object to save `lstat` calls when
+  resolving `**` matches.
+* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead.
+* `nounique` In some cases, brace-expanded patterns can result in the
+  same file showing up multiple times in the result set.  By default,
+  this implementation prevents duplicates in the result set.  Set this
+  flag to disable that behavior.
+* `nonull` Set to never return an empty set, instead returning a set
+  containing the pattern itself.  This is the default in glob(3).
+* `debug` Set to enable debug logging in minimatch and glob.
+* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets.
+* `noglobstar` Do not match `**` against multiple filenames.  (Ie,
+  treat it as a normal `*` instead.)
+* `noext` Do not match `+(a|b)` "extglob" patterns.
+* `nocase` Perform a case-insensitive match.  Note: on
+  case-insensitive filesystems, non-magic patterns will match by
+  default, since `stat` and `readdir` will not raise errors.
+* `matchBase` Perform a basename-only match if the pattern does not
+  contain any slash characters.  That is, `*.js` would be treated as
+  equivalent to `**/*.js`, matching all js files in all directories.
+* `nodir` Do not match directories, only files.  (Note: to match
+  *only* directories, simply put a `/` at the end of the pattern.)
+* `ignore` Add a pattern or an array of glob patterns to exclude matches.
+  Note: `ignore` patterns are *always* in `dot:true` mode, regardless
+  of any other settings.
+* `follow` Follow symlinked directories when expanding `**` patterns.
+  Note that this can result in a lot of duplicate references in the
+  presence of cyclic links.
+* `realpath` Set to true to call `fs.realpath` on all of the results.
+  In the case of a symlink that cannot be resolved, the full absolute
+  path to the matched entry is returned (though it will usually be a
+  broken symlink)
+
+## Comparisons to other fnmatch/glob implementations
+
+While strict compliance with the existing standards is a worthwhile
+goal, some discrepancies exist between node-glob and other
+implementations, and are intentional.
+
+The double-star character `**` is supported by default, unless the
+`noglobstar` flag is set.  This is supported in the manner of bsdglob
+and bash 4.3, where `**` only has special significance if it is the only
+thing in a path part.  That is, `a/**/b` will match `a/x/y/b`, but
+`a/**b` will not.
+
+Note that symlinked directories are not crawled as part of a `**`,
+though their contents may match against subsequent portions of the
+pattern.  This prevents infinite loops and duplicates and the like.
+
+If an escaped pattern has no matches, and the `nonull` flag is set,
+then glob returns the pattern as-provided, rather than
+interpreting the character escapes.  For example,
+`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than
+`"*a?"`.  This is akin to setting the `nullglob` option in bash, except
+that it does not resolve escaped pattern characters.
+
+If brace expansion is not disabled, then it is performed before any
+other interpretation of the glob pattern.  Thus, a pattern like
+`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded
+**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are
+checked for validity.  Since those two are valid, matching proceeds.
+
+### Comments and Negation
+
+Previously, this module let you mark a pattern as a "comment" if it
+started with a `#` character, or a "negated" pattern if it started
+with a `!` character.
+
+These options were deprecated in version 5, and removed in version 6.
+
+To specify things that should not match, use the `ignore` option.
+
+## Windows
+
+**Please only use forward-slashes in glob expressions.**
+
+Though windows uses either `/` or `\` as its path separator, only `/`
+characters are used by this glob implementation.  You must use
+forward-slashes **only** in glob expressions.  Back-slashes will always
+be interpreted as escape characters, not path separators.
+
+Results from absolute patterns such as `/foo/*` are mounted onto the
+root setting using `path.join`.  On windows, this will by default result
+in `/foo/*` matching `C:\foo\bar.txt`.
+
+## Race Conditions
+
+Glob searching, by its very nature, is susceptible to race conditions,
+since it relies on directory walking and such.
+
+As a result, it is possible that a file that exists when glob looks for
+it may have been deleted or modified by the time it returns the result.
+
+As part of its internal implementation, this program caches all stat
+and readdir calls that it makes, in order to cut down on system
+overhead.  However, this also makes it even more susceptible to races,
+especially if the cache or statCache objects are reused between glob
+calls.
+
+Users are thus advised not to use a glob result as a guarantee of
+filesystem state in the face of rapid changes.  For the vast majority
+of operations, this is never a problem.
+
+## Contributing
+
+Any change to behavior (including bugfixes) must come with a test.
+
+Patches that fail tests or reduce performance will be rejected.
+
+```
+# to run tests
+npm test
+
+# to re-generate test fixtures
+npm run test-regen
+
+# to benchmark against bash/zsh
+npm run bench
+
+# to profile javascript
+npm run prof
+```
diff --git a/wrt/node_modules/glob/common.js b/wrt/node_modules/glob/common.js
new file mode 100644 (file)
index 0000000..c9127eb
--- /dev/null
@@ -0,0 +1,226 @@
+exports.alphasort = alphasort
+exports.alphasorti = alphasorti
+exports.setopts = setopts
+exports.ownProp = ownProp
+exports.makeAbs = makeAbs
+exports.finish = finish
+exports.mark = mark
+exports.isIgnored = isIgnored
+exports.childrenIgnored = childrenIgnored
+
+function ownProp (obj, field) {
+  return Object.prototype.hasOwnProperty.call(obj, field)
+}
+
+var path = require("path")
+var minimatch = require("minimatch")
+var isAbsolute = require("path-is-absolute")
+var Minimatch = minimatch.Minimatch
+
+function alphasorti (a, b) {
+  return a.toLowerCase().localeCompare(b.toLowerCase())
+}
+
+function alphasort (a, b) {
+  return a.localeCompare(b)
+}
+
+function setupIgnores (self, options) {
+  self.ignore = options.ignore || []
+
+  if (!Array.isArray(self.ignore))
+    self.ignore = [self.ignore]
+
+  if (self.ignore.length) {
+    self.ignore = self.ignore.map(ignoreMap)
+  }
+}
+
+// ignore patterns are always in dot:true mode.
+function ignoreMap (pattern) {
+  var gmatcher = null
+  if (pattern.slice(-3) === '/**') {
+    var gpattern = pattern.replace(/(\/\*\*)+$/, '')
+    gmatcher = new Minimatch(gpattern, { dot: true })
+  }
+
+  return {
+    matcher: new Minimatch(pattern, { dot: true }),
+    gmatcher: gmatcher
+  }
+}
+
+function setopts (self, pattern, options) {
+  if (!options)
+    options = {}
+
+  // base-matching: just use globstar for that.
+  if (options.matchBase && -1 === pattern.indexOf("/")) {
+    if (options.noglobstar) {
+      throw new Error("base matching requires globstar")
+    }
+    pattern = "**/" + pattern
+  }
+
+  self.silent = !!options.silent
+  self.pattern = pattern
+  self.strict = options.strict !== false
+  self.realpath = !!options.realpath
+  self.realpathCache = options.realpathCache || Object.create(null)
+  self.follow = !!options.follow
+  self.dot = !!options.dot
+  self.mark = !!options.mark
+  self.nodir = !!options.nodir
+  if (self.nodir)
+    self.mark = true
+  self.sync = !!options.sync
+  self.nounique = !!options.nounique
+  self.nonull = !!options.nonull
+  self.nosort = !!options.nosort
+  self.nocase = !!options.nocase
+  self.stat = !!options.stat
+  self.noprocess = !!options.noprocess
+
+  self.maxLength = options.maxLength || Infinity
+  self.cache = options.cache || Object.create(null)
+  self.statCache = options.statCache || Object.create(null)
+  self.symlinks = options.symlinks || Object.create(null)
+
+  setupIgnores(self, options)
+
+  self.changedCwd = false
+  var cwd = process.cwd()
+  if (!ownProp(options, "cwd"))
+    self.cwd = cwd
+  else {
+    self.cwd = options.cwd
+    self.changedCwd = path.resolve(options.cwd) !== cwd
+  }
+
+  self.root = options.root || path.resolve(self.cwd, "/")
+  self.root = path.resolve(self.root)
+  if (process.platform === "win32")
+    self.root = self.root.replace(/\\/g, "/")
+
+  self.nomount = !!options.nomount
+
+  // disable comments and negation in Minimatch.
+  // Note that they are not supported in Glob itself anyway.
+  options.nonegate = true
+  options.nocomment = true
+
+  self.minimatch = new Minimatch(pattern, options)
+  self.options = self.minimatch.options
+}
+
+function finish (self) {
+  var nou = self.nounique
+  var all = nou ? [] : Object.create(null)
+
+  for (var i = 0, l = self.matches.length; i < l; i ++) {
+    var matches = self.matches[i]
+    if (!matches || Object.keys(matches).length === 0) {
+      if (self.nonull) {
+        // do like the shell, and spit out the literal glob
+        var literal = self.minimatch.globSet[i]
+        if (nou)
+          all.push(literal)
+        else
+          all[literal] = true
+      }
+    } else {
+      // had matches
+      var m = Object.keys(matches)
+      if (nou)
+        all.push.apply(all, m)
+      else
+        m.forEach(function (m) {
+          all[m] = true
+        })
+    }
+  }
+
+  if (!nou)
+    all = Object.keys(all)
+
+  if (!self.nosort)
+    all = all.sort(self.nocase ? alphasorti : alphasort)
+
+  // at *some* point we statted all of these
+  if (self.mark) {
+    for (var i = 0; i < all.length; i++) {
+      all[i] = self._mark(all[i])
+    }
+    if (self.nodir) {
+      all = all.filter(function (e) {
+        return !(/\/$/.test(e))
+      })
+    }
+  }
+
+  if (self.ignore.length)
+    all = all.filter(function(m) {
+      return !isIgnored(self, m)
+    })
+
+  self.found = all
+}
+
+function mark (self, p) {
+  var abs = makeAbs(self, p)
+  var c = self.cache[abs]
+  var m = p
+  if (c) {
+    var isDir = c === 'DIR' || Array.isArray(c)
+    var slash = p.slice(-1) === '/'
+
+    if (isDir && !slash)
+      m += '/'
+    else if (!isDir && slash)
+      m = m.slice(0, -1)
+
+    if (m !== p) {
+      var mabs = makeAbs(self, m)
+      self.statCache[mabs] = self.statCache[abs]
+      self.cache[mabs] = self.cache[abs]
+    }
+  }
+
+  return m
+}
+
+// lotta situps...
+function makeAbs (self, f) {
+  var abs = f
+  if (f.charAt(0) === '/') {
+    abs = path.join(self.root, f)
+  } else if (isAbsolute(f) || f === '') {
+    abs = f
+  } else if (self.changedCwd) {
+    abs = path.resolve(self.cwd, f)
+  } else {
+    abs = path.resolve(f)
+  }
+  return abs
+}
+
+
+// Return true, if pattern ends with globstar '**', for the accompanying parent directory.
+// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents
+function isIgnored (self, path) {
+  if (!self.ignore.length)
+    return false
+
+  return self.ignore.some(function(item) {
+    return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))
+  })
+}
+
+function childrenIgnored (self, path) {
+  if (!self.ignore.length)
+    return false
+
+  return self.ignore.some(function(item) {
+    return !!(item.gmatcher && item.gmatcher.match(path))
+  })
+}
diff --git a/wrt/node_modules/glob/glob.js b/wrt/node_modules/glob/glob.js
new file mode 100644 (file)
index 0000000..a62da27
--- /dev/null
@@ -0,0 +1,765 @@
+// Approach:
+//
+// 1. Get the minimatch set
+// 2. For each pattern in the set, PROCESS(pattern, false)
+// 3. Store matches per-set, then uniq them
+//
+// PROCESS(pattern, inGlobStar)
+// Get the first [n] items from pattern that are all strings
+// Join these together.  This is PREFIX.
+//   If there is no more remaining, then stat(PREFIX) and
+//   add to matches if it succeeds.  END.
+//
+// If inGlobStar and PREFIX is symlink and points to dir
+//   set ENTRIES = []
+// else readdir(PREFIX) as ENTRIES
+//   If fail, END
+//
+// with ENTRIES
+//   If pattern[n] is GLOBSTAR
+//     // handle the case where the globstar match is empty
+//     // by pruning it out, and testing the resulting pattern
+//     PROCESS(pattern[0..n] + pattern[n+1 .. $], false)
+//     // handle other cases.
+//     for ENTRY in ENTRIES (not dotfiles)
+//       // attach globstar + tail onto the entry
+//       // Mark that this entry is a globstar match
+//       PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true)
+//
+//   else // not globstar
+//     for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot)
+//       Test ENTRY against pattern[n]
+//       If fails, continue
+//       If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $])
+//
+// Caveat:
+//   Cache all stats and readdirs results to minimize syscall.  Since all
+//   we ever care about is existence and directory-ness, we can just keep
+//   `true` for files, and [children,...] for directories, or `false` for
+//   things that don't exist.
+
+module.exports = glob
+
+var fs = require('fs')
+var minimatch = require('minimatch')
+var Minimatch = minimatch.Minimatch
+var inherits = require('inherits')
+var EE = require('events').EventEmitter
+var path = require('path')
+var assert = require('assert')
+var isAbsolute = require('path-is-absolute')
+var globSync = require('./sync.js')
+var common = require('./common.js')
+var alphasort = common.alphasort
+var alphasorti = common.alphasorti
+var setopts = common.setopts
+var ownProp = common.ownProp
+var inflight = require('inflight')
+var util = require('util')
+var childrenIgnored = common.childrenIgnored
+var isIgnored = common.isIgnored
+
+var once = require('once')
+
+function glob (pattern, options, cb) {
+  if (typeof options === 'function') cb = options, options = {}
+  if (!options) options = {}
+
+  if (options.sync) {
+    if (cb)
+      throw new TypeError('callback provided to sync glob')
+    return globSync(pattern, options)
+  }
+
+  return new Glob(pattern, options, cb)
+}
+
+glob.sync = globSync
+var GlobSync = glob.GlobSync = globSync.GlobSync
+
+// old api surface
+glob.glob = glob
+
+function extend (origin, add) {
+  if (add === null || typeof add !== 'object') {
+    return origin
+  }
+
+  var keys = Object.keys(add)
+  var i = keys.length
+  while (i--) {
+    origin[keys[i]] = add[keys[i]]
+  }
+  return origin
+}
+
+glob.hasMagic = function (pattern, options_) {
+  var options = extend({}, options_)
+  options.noprocess = true
+
+  var g = new Glob(pattern, options)
+  var set = g.minimatch.set
+  if (set.length > 1)
+    return true
+
+  for (var j = 0; j < set[0].length; j++) {
+    if (typeof set[0][j] !== 'string')
+      return true
+  }
+
+  return false
+}
+
+glob.Glob = Glob
+inherits(Glob, EE)
+function Glob (pattern, options, cb) {
+  if (typeof options === 'function') {
+    cb = options
+    options = null
+  }
+
+  if (options && options.sync) {
+    if (cb)
+      throw new TypeError('callback provided to sync glob')
+    return new GlobSync(pattern, options)
+  }
+
+  if (!(this instanceof Glob))
+    return new Glob(pattern, options, cb)
+
+  setopts(this, pattern, options)
+  this._didRealPath = false
+
+  // process each pattern in the minimatch set
+  var n = this.minimatch.set.length
+
+  // The matches are stored as {<filename>: true,...} so that
+  // duplicates are automagically pruned.
+  // Later, we do an Object.keys() on these.
+  // Keep them as a list so we can fill in when nonull is set.
+  this.matches = new Array(n)
+
+  if (typeof cb === 'function') {
+    cb = once(cb)
+    this.on('error', cb)
+    this.on('end', function (matches) {
+      cb(null, matches)
+    })
+  }
+
+  var self = this
+  var n = this.minimatch.set.length
+  this._processing = 0
+  this.matches = new Array(n)
+
+  this._emitQueue = []
+  this._processQueue = []
+  this.paused = false
+
+  if (this.noprocess)
+    return this
+
+  if (n === 0)
+    return done()
+
+  for (var i = 0; i < n; i ++) {
+    this._process(this.minimatch.set[i], i, false, done)
+  }
+
+  function done () {
+    --self._processing
+    if (self._processing <= 0)
+      self._finish()
+  }
+}
+
+Glob.prototype._finish = function () {
+  assert(this instanceof Glob)
+  if (this.aborted)
+    return
+
+  if (this.realpath && !this._didRealpath)
+    return this._realpath()
+
+  common.finish(this)
+  this.emit('end', this.found)
+}
+
+Glob.prototype._realpath = function () {
+  if (this._didRealpath)
+    return
+
+  this._didRealpath = true
+
+  var n = this.matches.length
+  if (n === 0)
+    return this._finish()
+
+  var self = this
+  for (var i = 0; i < this.matches.length; i++)
+    this._realpathSet(i, next)
+
+  function next () {
+    if (--n === 0)
+      self._finish()
+  }
+}
+
+Glob.prototype._realpathSet = function (index, cb) {
+  var matchset = this.matches[index]
+  if (!matchset)
+    return cb()
+
+  var found = Object.keys(matchset)
+  var self = this
+  var n = found.length
+
+  if (n === 0)
+    return cb()
+
+  var set = this.matches[index] = Object.create(null)
+  found.forEach(function (p, i) {
+    // If there's a problem with the stat, then it means that
+    // one or more of the links in the realpath couldn't be
+    // resolved.  just return the abs value in that case.
+    p = self._makeAbs(p)
+    fs.realpath(p, self.realpathCache, function (er, real) {
+      if (!er)
+        set[real] = true
+      else if (er.syscall === 'stat')
+        set[p] = true
+      else
+        self.emit('error', er) // srsly wtf right here
+
+      if (--n === 0) {
+        self.matches[index] = set
+        cb()
+      }
+    })
+  })
+}
+
+Glob.prototype._mark = function (p) {
+  return common.mark(this, p)
+}
+
+Glob.prototype._makeAbs = function (f) {
+  return common.makeAbs(this, f)
+}
+
+Glob.prototype.abort = function () {
+  this.aborted = true
+  this.emit('abort')
+}
+
+Glob.prototype.pause = function () {
+  if (!this.paused) {
+    this.paused = true
+    this.emit('pause')
+  }
+}
+
+Glob.prototype.resume = function () {
+  if (this.paused) {
+    this.emit('resume')
+    this.paused = false
+    if (this._emitQueue.length) {
+      var eq = this._emitQueue.slice(0)
+      this._emitQueue.length = 0
+      for (var i = 0; i < eq.length; i ++) {
+        var e = eq[i]
+        this._emitMatch(e[0], e[1])
+      }
+    }
+    if (this._processQueue.length) {
+      var pq = this._processQueue.slice(0)
+      this._processQueue.length = 0
+      for (var i = 0; i < pq.length; i ++) {
+        var p = pq[i]
+        this._processing--
+        this._process(p[0], p[1], p[2], p[3])
+      }
+    }
+  }
+}
+
+Glob.prototype._process = function (pattern, index, inGlobStar, cb) {
+  assert(this instanceof Glob)
+  assert(typeof cb === 'function')
+
+  if (this.aborted)
+    return
+
+  this._processing++
+  if (this.paused) {
+    this._processQueue.push([pattern, index, inGlobStar, cb])
+    return
+  }
+
+  //console.error('PROCESS %d', this._processing, pattern)
+
+  // Get the first [n] parts of pattern that are all strings.
+  var n = 0
+  while (typeof pattern[n] === 'string') {
+    n ++
+  }
+  // now n is the index of the first one that is *not* a string.
+
+  // see if there's anything else
+  var prefix
+  switch (n) {
+    // if not, then this is rather simple
+    case pattern.length:
+      this._processSimple(pattern.join('/'), index, cb)
+      return
+
+    case 0:
+      // pattern *starts* with some non-trivial item.
+      // going to readdir(cwd), but not include the prefix in matches.
+      prefix = null
+      break
+
+    default:
+      // pattern has some string bits in the front.
+      // whatever it starts with, whether that's 'absolute' like /foo/bar,
+      // or 'relative' like '../baz'
+      prefix = pattern.slice(0, n).join('/')
+      break
+  }
+
+  var remain = pattern.slice(n)
+
+  // get the list of entries.
+  var read
+  if (prefix === null)
+    read = '.'
+  else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
+    if (!prefix || !isAbsolute(prefix))
+      prefix = '/' + prefix
+    read = prefix
+  } else
+    read = prefix
+
+  var abs = this._makeAbs(read)
+
+  //if ignored, skip _processing
+  if (childrenIgnored(this, read))
+    return cb()
+
+  var isGlobStar = remain[0] === minimatch.GLOBSTAR
+  if (isGlobStar)
+    this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb)
+  else
+    this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb)
+}
+
+Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) {
+  var self = this
+  this._readdir(abs, inGlobStar, function (er, entries) {
+    return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
+  })
+}
+
+Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
+
+  // if the abs isn't a dir, then nothing can match!
+  if (!entries)
+    return cb()
+
+  // It will only match dot entries if it starts with a dot, or if
+  // dot is set.  Stuff like @(.foo|.bar) isn't allowed.
+  var pn = remain[0]
+  var negate = !!this.minimatch.negate
+  var rawGlob = pn._glob
+  var dotOk = this.dot || rawGlob.charAt(0) === '.'
+
+  var matchedEntries = []
+  for (var i = 0; i < entries.length; i++) {
+    var e = entries[i]
+    if (e.charAt(0) !== '.' || dotOk) {
+      var m
+      if (negate && !prefix) {
+        m = !e.match(pn)
+      } else {
+        m = e.match(pn)
+      }
+      if (m)
+        matchedEntries.push(e)
+    }
+  }
+
+  //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries)
+
+  var len = matchedEntries.length
+  // If there are no matched entries, then nothing matches.
+  if (len === 0)
+    return cb()
+
+  // if this is the last remaining pattern bit, then no need for
+  // an additional stat *unless* the user has specified mark or
+  // stat explicitly.  We know they exist, since readdir returned
+  // them.
+
+  if (remain.length === 1 && !this.mark && !this.stat) {
+    if (!this.matches[index])
+      this.matches[index] = Object.create(null)
+
+    for (var i = 0; i < len; i ++) {
+      var e = matchedEntries[i]
+      if (prefix) {
+        if (prefix !== '/')
+          e = prefix + '/' + e
+        else
+          e = prefix + e
+      }
+
+      if (e.charAt(0) === '/' && !this.nomount) {
+        e = path.join(this.root, e)
+      }
+      this._emitMatch(index, e)
+    }
+    // This was the last one, and no stats were needed
+    return cb()
+  }
+
+  // now test all matched entries as stand-ins for that part
+  // of the pattern.
+  remain.shift()
+  for (var i = 0; i < len; i ++) {
+    var e = matchedEntries[i]
+    var newPattern
+    if (prefix) {
+      if (prefix !== '/')
+        e = prefix + '/' + e
+      else
+        e = prefix + e
+    }
+    this._process([e].concat(remain), index, inGlobStar, cb)
+  }
+  cb()
+}
+
+Glob.prototype._emitMatch = function (index, e) {
+  if (this.aborted)
+    return
+
+  if (this.matches[index][e])
+    return
+
+  if (isIgnored(this, e))
+    return
+
+  if (this.paused) {
+    this._emitQueue.push([index, e])
+    return
+  }
+
+  var abs = this._makeAbs(e)
+
+  if (this.nodir) {
+    var c = this.cache[abs]
+    if (c === 'DIR' || Array.isArray(c))
+      return
+  }
+
+  if (this.mark)
+    e = this._mark(e)
+
+  this.matches[index][e] = true
+
+  var st = this.statCache[abs]
+  if (st)
+    this.emit('stat', e, st)
+
+  this.emit('match', e)
+}
+
+Glob.prototype._readdirInGlobStar = function (abs, cb) {
+  if (this.aborted)
+    return
+
+  // follow all symlinked directories forever
+  // just proceed as if this is a non-globstar situation
+  if (this.follow)
+    return this._readdir(abs, false, cb)
+
+  var lstatkey = 'lstat\0' + abs
+  var self = this
+  var lstatcb = inflight(lstatkey, lstatcb_)
+
+  if (lstatcb)
+    fs.lstat(abs, lstatcb)
+
+  function lstatcb_ (er, lstat) {
+    if (er)
+      return cb()
+
+    var isSym = lstat.isSymbolicLink()
+    self.symlinks[abs] = isSym
+
+    // If it's not a symlink or a dir, then it's definitely a regular file.
+    // don't bother doing a readdir in that case.
+    if (!isSym && !lstat.isDirectory()) {
+      self.cache[abs] = 'FILE'
+      cb()
+    } else
+      self._readdir(abs, false, cb)
+  }
+}
+
+Glob.prototype._readdir = function (abs, inGlobStar, cb) {
+  if (this.aborted)
+    return
+
+  cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb)
+  if (!cb)
+    return
+
+  //console.error('RD %j %j', +inGlobStar, abs)
+  if (inGlobStar && !ownProp(this.symlinks, abs))
+    return this._readdirInGlobStar(abs, cb)
+
+  if (ownProp(this.cache, abs)) {
+    var c = this.cache[abs]
+    if (!c || c === 'FILE')
+      return cb()
+
+    if (Array.isArray(c))
+      return cb(null, c)
+  }
+
+  var self = this
+  fs.readdir(abs, readdirCb(this, abs, cb))
+}
+
+function readdirCb (self, abs, cb) {
+  return function (er, entries) {
+    if (er)
+      self._readdirError(abs, er, cb)
+    else
+      self._readdirEntries(abs, entries, cb)
+  }
+}
+
+Glob.prototype._readdirEntries = function (abs, entries, cb) {
+  if (this.aborted)
+    return
+
+  // if we haven't asked to stat everything, then just
+  // assume that everything in there exists, so we can avoid
+  // having to stat it a second time.
+  if (!this.mark && !this.stat) {
+    for (var i = 0; i < entries.length; i ++) {
+      var e = entries[i]
+      if (abs === '/')
+        e = abs + e
+      else
+        e = abs + '/' + e
+      this.cache[e] = true
+    }
+  }
+
+  this.cache[abs] = entries
+  return cb(null, entries)
+}
+
+Glob.prototype._readdirError = function (f, er, cb) {
+  if (this.aborted)
+    return
+
+  // handle errors, and cache the information
+  switch (er.code) {
+    case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
+    case 'ENOTDIR': // totally normal. means it *does* exist.
+      this.cache[this._makeAbs(f)] = 'FILE'
+      break
+
+    case 'ENOENT': // not terribly unusual
+    case 'ELOOP':
+    case 'ENAMETOOLONG':
+    case 'UNKNOWN':
+      this.cache[this._makeAbs(f)] = false
+      break
+
+    default: // some unusual error.  Treat as failure.
+      this.cache[this._makeAbs(f)] = false
+      if (this.strict) {
+        this.emit('error', er)
+        // If the error is handled, then we abort
+        // if not, we threw out of here
+        this.abort()
+      }
+      if (!this.silent)
+        console.error('glob error', er)
+      break
+  }
+
+  return cb()
+}
+
+Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) {
+  var self = this
+  this._readdir(abs, inGlobStar, function (er, entries) {
+    self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
+  })
+}
+
+
+Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
+  //console.error('pgs2', prefix, remain[0], entries)
+
+  // no entries means not a dir, so it can never have matches
+  // foo.txt/** doesn't match foo.txt
+  if (!entries)
+    return cb()
+
+  // test without the globstar, and with every child both below
+  // and replacing the globstar.
+  var remainWithoutGlobStar = remain.slice(1)
+  var gspref = prefix ? [ prefix ] : []
+  var noGlobStar = gspref.concat(remainWithoutGlobStar)
+
+  // the noGlobStar pattern exits the inGlobStar state
+  this._process(noGlobStar, index, false, cb)
+
+  var isSym = this.symlinks[abs]
+  var len = entries.length
+
+  // If it's a symlink, and we're in a globstar, then stop
+  if (isSym && inGlobStar)
+    return cb()
+
+  for (var i = 0; i < len; i++) {
+    var e = entries[i]
+    if (e.charAt(0) === '.' && !this.dot)
+      continue
+
+    // these two cases enter the inGlobStar state
+    var instead = gspref.concat(entries[i], remainWithoutGlobStar)
+    this._process(instead, index, true, cb)
+
+    var below = gspref.concat(entries[i], remain)
+    this._process(below, index, true, cb)
+  }
+
+  cb()
+}
+
+Glob.prototype._processSimple = function (prefix, index, cb) {
+  // XXX review this.  Shouldn't it be doing the mounting etc
+  // before doing stat?  kinda weird?
+  var self = this
+  this._stat(prefix, function (er, exists) {
+    self._processSimple2(prefix, index, er, exists, cb)
+  })
+}
+Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) {
+
+  //console.error('ps2', prefix, exists)
+
+  if (!this.matches[index])
+    this.matches[index] = Object.create(null)
+
+  // If it doesn't exist, then just mark the lack of results
+  if (!exists)
+    return cb()
+
+  if (prefix && isAbsolute(prefix) && !this.nomount) {
+    var trail = /[\/\\]$/.test(prefix)
+    if (prefix.charAt(0) === '/') {
+      prefix = path.join(this.root, prefix)
+    } else {
+      prefix = path.resolve(this.root, prefix)
+      if (trail)
+        prefix += '/'
+    }
+  }
+
+  if (process.platform === 'win32')
+    prefix = prefix.replace(/\\/g, '/')
+
+  // Mark this as a match
+  this._emitMatch(index, prefix)
+  cb()
+}
+
+// Returns either 'DIR', 'FILE', or false
+Glob.prototype._stat = function (f, cb) {
+  var abs = this._makeAbs(f)
+  var needDir = f.slice(-1) === '/'
+
+  if (f.length > this.maxLength)
+    return cb()
+
+  if (!this.stat && ownProp(this.cache, abs)) {
+    var c = this.cache[abs]
+
+    if (Array.isArray(c))
+      c = 'DIR'
+
+    // It exists, but maybe not how we need it
+    if (!needDir || c === 'DIR')
+      return cb(null, c)
+
+    if (needDir && c === 'FILE')
+      return cb()
+
+    // otherwise we have to stat, because maybe c=true
+    // if we know it exists, but not what it is.
+  }
+
+  var exists
+  var stat = this.statCache[abs]
+  if (stat !== undefined) {
+    if (stat === false)
+      return cb(null, stat)
+    else {
+      var type = stat.isDirectory() ? 'DIR' : 'FILE'
+      if (needDir && type === 'FILE')
+        return cb()
+      else
+        return cb(null, type, stat)
+    }
+  }
+
+  var self = this
+  var statcb = inflight('stat\0' + abs, lstatcb_)
+  if (statcb)
+    fs.lstat(abs, statcb)
+
+  function lstatcb_ (er, lstat) {
+    if (lstat && lstat.isSymbolicLink()) {
+      // If it's a symlink, then treat it as the target, unless
+      // the target does not exist, then treat it as a file.
+      return fs.stat(abs, function (er, stat) {
+        if (er)
+          self._stat2(f, abs, null, lstat, cb)
+        else
+          self._stat2(f, abs, er, stat, cb)
+      })
+    } else {
+      self._stat2(f, abs, er, lstat, cb)
+    }
+  }
+}
+
+Glob.prototype._stat2 = function (f, abs, er, stat, cb) {
+  if (er) {
+    this.statCache[abs] = false
+    return cb()
+  }
+
+  var needDir = f.slice(-1) === '/'
+  this.statCache[abs] = stat
+
+  if (abs.slice(-1) === '/' && !stat.isDirectory())
+    return cb(null, false, stat)
+
+  var c = stat.isDirectory() ? 'DIR' : 'FILE'
+  this.cache[abs] = this.cache[abs] || c
+
+  if (needDir && c !== 'DIR')
+    return cb()
+
+  return cb(null, c, stat)
+}
diff --git a/wrt/node_modules/glob/package.json b/wrt/node_modules/glob/package.json
new file mode 100644 (file)
index 0000000..8b878ff
--- /dev/null
@@ -0,0 +1,106 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "glob@^6.0.1",
+        "scope": null,
+        "escapedName": "glob",
+        "name": "glob",
+        "rawSpec": "^6.0.1",
+        "spec": ">=6.0.1 <7.0.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/mv/node_modules/rimraf"
+    ]
+  ],
+  "_from": "glob@>=6.0.1 <7.0.0",
+  "_id": "glob@6.0.4",
+  "_inCache": true,
+  "_location": "/glob",
+  "_nodeVersion": "4.0.0",
+  "_npmUser": {
+    "name": "isaacs",
+    "email": "i@izs.me"
+  },
+  "_npmVersion": "2.14.15",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "glob@^6.0.1",
+    "scope": null,
+    "escapedName": "glob",
+    "name": "glob",
+    "rawSpec": "^6.0.1",
+    "spec": ">=6.0.1 <7.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/mv/rimraf"
+  ],
+  "_resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz",
+  "_shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22",
+  "_shrinkwrap": null,
+  "_spec": "glob@^6.0.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/mv/node_modules/rimraf",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bugs": {
+    "url": "https://github.com/isaacs/node-glob/issues"
+  },
+  "dependencies": {
+    "inflight": "^1.0.4",
+    "inherits": "2",
+    "minimatch": "2 || 3",
+    "once": "^1.3.0",
+    "path-is-absolute": "^1.0.0"
+  },
+  "description": "a little globber",
+  "devDependencies": {
+    "mkdirp": "0",
+    "rimraf": "^2.2.8",
+    "tap": "^5.0.0",
+    "tick": "0.0.6"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22",
+    "tarball": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz"
+  },
+  "engines": {
+    "node": "*"
+  },
+  "files": [
+    "glob.js",
+    "sync.js",
+    "common.js"
+  ],
+  "gitHead": "3bd419c538737e56fda7e21c21ff52ca0c198df6",
+  "homepage": "https://github.com/isaacs/node-glob#readme",
+  "license": "ISC",
+  "main": "glob.js",
+  "maintainers": [
+    {
+      "name": "isaacs",
+      "email": "i@izs.me"
+    }
+  ],
+  "name": "glob",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/node-glob.git"
+  },
+  "scripts": {
+    "bench": "bash benchmark.sh",
+    "benchclean": "node benchclean.js",
+    "prepublish": "npm run benchclean",
+    "prof": "bash prof.sh && cat profile.txt",
+    "profclean": "rm -f v8.log profile.txt",
+    "test": "tap test/*.js --cov",
+    "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js"
+  },
+  "version": "6.0.4"
+}
diff --git a/wrt/node_modules/glob/sync.js b/wrt/node_modules/glob/sync.js
new file mode 100644 (file)
index 0000000..09883d2
--- /dev/null
@@ -0,0 +1,460 @@
+module.exports = globSync
+globSync.GlobSync = GlobSync
+
+var fs = require('fs')
+var minimatch = require('minimatch')
+var Minimatch = minimatch.Minimatch
+var Glob = require('./glob.js').Glob
+var util = require('util')
+var path = require('path')
+var assert = require('assert')
+var isAbsolute = require('path-is-absolute')
+var common = require('./common.js')
+var alphasort = common.alphasort
+var alphasorti = common.alphasorti
+var setopts = common.setopts
+var ownProp = common.ownProp
+var childrenIgnored = common.childrenIgnored
+
+function globSync (pattern, options) {
+  if (typeof options === 'function' || arguments.length === 3)
+    throw new TypeError('callback provided to sync glob\n'+
+                        'See: https://github.com/isaacs/node-glob/issues/167')
+
+  return new GlobSync(pattern, options).found
+}
+
+function GlobSync (pattern, options) {
+  if (!pattern)
+    throw new Error('must provide pattern')
+
+  if (typeof options === 'function' || arguments.length === 3)
+    throw new TypeError('callback provided to sync glob\n'+
+                        'See: https://github.com/isaacs/node-glob/issues/167')
+
+  if (!(this instanceof GlobSync))
+    return new GlobSync(pattern, options)
+
+  setopts(this, pattern, options)
+
+  if (this.noprocess)
+    return this
+
+  var n = this.minimatch.set.length
+  this.matches = new Array(n)
+  for (var i = 0; i < n; i ++) {
+    this._process(this.minimatch.set[i], i, false)
+  }
+  this._finish()
+}
+
+GlobSync.prototype._finish = function () {
+  assert(this instanceof GlobSync)
+  if (this.realpath) {
+    var self = this
+    this.matches.forEach(function (matchset, index) {
+      var set = self.matches[index] = Object.create(null)
+      for (var p in matchset) {
+        try {
+          p = self._makeAbs(p)
+          var real = fs.realpathSync(p, self.realpathCache)
+          set[real] = true
+        } catch (er) {
+          if (er.syscall === 'stat')
+            set[self._makeAbs(p)] = true
+          else
+            throw er
+        }
+      }
+    })
+  }
+  common.finish(this)
+}
+
+
+GlobSync.prototype._process = function (pattern, index, inGlobStar) {
+  assert(this instanceof GlobSync)
+
+  // Get the first [n] parts of pattern that are all strings.
+  var n = 0
+  while (typeof pattern[n] === 'string') {
+    n ++
+  }
+  // now n is the index of the first one that is *not* a string.
+
+  // See if there's anything else
+  var prefix
+  switch (n) {
+    // if not, then this is rather simple
+    case pattern.length:
+      this._processSimple(pattern.join('/'), index)
+      return
+
+    case 0:
+      // pattern *starts* with some non-trivial item.
+      // going to readdir(cwd), but not include the prefix in matches.
+      prefix = null
+      break
+
+    default:
+      // pattern has some string bits in the front.
+      // whatever it starts with, whether that's 'absolute' like /foo/bar,
+      // or 'relative' like '../baz'
+      prefix = pattern.slice(0, n).join('/')
+      break
+  }
+
+  var remain = pattern.slice(n)
+
+  // get the list of entries.
+  var read
+  if (prefix === null)
+    read = '.'
+  else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
+    if (!prefix || !isAbsolute(prefix))
+      prefix = '/' + prefix
+    read = prefix
+  } else
+    read = prefix
+
+  var abs = this._makeAbs(read)
+
+  //if ignored, skip processing
+  if (childrenIgnored(this, read))
+    return
+
+  var isGlobStar = remain[0] === minimatch.GLOBSTAR
+  if (isGlobStar)
+    this._processGlobStar(prefix, read, abs, remain, index, inGlobStar)
+  else
+    this._processReaddir(prefix, read, abs, remain, index, inGlobStar)
+}
+
+
+GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) {
+  var entries = this._readdir(abs, inGlobStar)
+
+  // if the abs isn't a dir, then nothing can match!
+  if (!entries)
+    return
+
+  // It will only match dot entries if it starts with a dot, or if
+  // dot is set.  Stuff like @(.foo|.bar) isn't allowed.
+  var pn = remain[0]
+  var negate = !!this.minimatch.negate
+  var rawGlob = pn._glob
+  var dotOk = this.dot || rawGlob.charAt(0) === '.'
+
+  var matchedEntries = []
+  for (var i = 0; i < entries.length; i++) {
+    var e = entries[i]
+    if (e.charAt(0) !== '.' || dotOk) {
+      var m
+      if (negate && !prefix) {
+        m = !e.match(pn)
+      } else {
+        m = e.match(pn)
+      }
+      if (m)
+        matchedEntries.push(e)
+    }
+  }
+
+  var len = matchedEntries.length
+  // If there are no matched entries, then nothing matches.
+  if (len === 0)
+    return
+
+  // if this is the last remaining pattern bit, then no need for
+  // an additional stat *unless* the user has specified mark or
+  // stat explicitly.  We know they exist, since readdir returned
+  // them.
+
+  if (remain.length === 1 && !this.mark && !this.stat) {
+    if (!this.matches[index])
+      this.matches[index] = Object.create(null)
+
+    for (var i = 0; i < len; i ++) {
+      var e = matchedEntries[i]
+      if (prefix) {
+        if (prefix.slice(-1) !== '/')
+          e = prefix + '/' + e
+        else
+          e = prefix + e
+      }
+
+      if (e.charAt(0) === '/' && !this.nomount) {
+        e = path.join(this.root, e)
+      }
+      this.matches[index][e] = true
+    }
+    // This was the last one, and no stats were needed
+    return
+  }
+
+  // now test all matched entries as stand-ins for that part
+  // of the pattern.
+  remain.shift()
+  for (var i = 0; i < len; i ++) {
+    var e = matchedEntries[i]
+    var newPattern
+    if (prefix)
+      newPattern = [prefix, e]
+    else
+      newPattern = [e]
+    this._process(newPattern.concat(remain), index, inGlobStar)
+  }
+}
+
+
+GlobSync.prototype._emitMatch = function (index, e) {
+  var abs = this._makeAbs(e)
+  if (this.mark)
+    e = this._mark(e)
+
+  if (this.matches[index][e])
+    return
+
+  if (this.nodir) {
+    var c = this.cache[this._makeAbs(e)]
+    if (c === 'DIR' || Array.isArray(c))
+      return
+  }
+
+  this.matches[index][e] = true
+  if (this.stat)
+    this._stat(e)
+}
+
+
+GlobSync.prototype._readdirInGlobStar = function (abs) {
+  // follow all symlinked directories forever
+  // just proceed as if this is a non-globstar situation
+  if (this.follow)
+    return this._readdir(abs, false)
+
+  var entries
+  var lstat
+  var stat
+  try {
+    lstat = fs.lstatSync(abs)
+  } catch (er) {
+    // lstat failed, doesn't exist
+    return null
+  }
+
+  var isSym = lstat.isSymbolicLink()
+  this.symlinks[abs] = isSym
+
+  // If it's not a symlink or a dir, then it's definitely a regular file.
+  // don't bother doing a readdir in that case.
+  if (!isSym && !lstat.isDirectory())
+    this.cache[abs] = 'FILE'
+  else
+    entries = this._readdir(abs, false)
+
+  return entries
+}
+
+GlobSync.prototype._readdir = function (abs, inGlobStar) {
+  var entries
+
+  if (inGlobStar && !ownProp(this.symlinks, abs))
+    return this._readdirInGlobStar(abs)
+
+  if (ownProp(this.cache, abs)) {
+    var c = this.cache[abs]
+    if (!c || c === 'FILE')
+      return null
+
+    if (Array.isArray(c))
+      return c
+  }
+
+  try {
+    return this._readdirEntries(abs, fs.readdirSync(abs))
+  } catch (er) {
+    this._readdirError(abs, er)
+    return null
+  }
+}
+
+GlobSync.prototype._readdirEntries = function (abs, entries) {
+  // if we haven't asked to stat everything, then just
+  // assume that everything in there exists, so we can avoid
+  // having to stat it a second time.
+  if (!this.mark && !this.stat) {
+    for (var i = 0; i < entries.length; i ++) {
+      var e = entries[i]
+      if (abs === '/')
+        e = abs + e
+      else
+        e = abs + '/' + e
+      this.cache[e] = true
+    }
+  }
+
+  this.cache[abs] = entries
+
+  // mark and cache dir-ness
+  return entries
+}
+
+GlobSync.prototype._readdirError = function (f, er) {
+  // handle errors, and cache the information
+  switch (er.code) {
+    case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
+    case 'ENOTDIR': // totally normal. means it *does* exist.
+      this.cache[this._makeAbs(f)] = 'FILE'
+      break
+
+    case 'ENOENT': // not terribly unusual
+    case 'ELOOP':
+    case 'ENAMETOOLONG':
+    case 'UNKNOWN':
+      this.cache[this._makeAbs(f)] = false
+      break
+
+    default: // some unusual error.  Treat as failure.
+      this.cache[this._makeAbs(f)] = false
+      if (this.strict)
+        throw er
+      if (!this.silent)
+        console.error('glob error', er)
+      break
+  }
+}
+
+GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) {
+
+  var entries = this._readdir(abs, inGlobStar)
+
+  // no entries means not a dir, so it can never have matches
+  // foo.txt/** doesn't match foo.txt
+  if (!entries)
+    return
+
+  // test without the globstar, and with every child both below
+  // and replacing the globstar.
+  var remainWithoutGlobStar = remain.slice(1)
+  var gspref = prefix ? [ prefix ] : []
+  var noGlobStar = gspref.concat(remainWithoutGlobStar)
+
+  // the noGlobStar pattern exits the inGlobStar state
+  this._process(noGlobStar, index, false)
+
+  var len = entries.length
+  var isSym = this.symlinks[abs]
+
+  // If it's a symlink, and we're in a globstar, then stop
+  if (isSym && inGlobStar)
+    return
+
+  for (var i = 0; i < len; i++) {
+    var e = entries[i]
+    if (e.charAt(0) === '.' && !this.dot)
+      continue
+
+    // these two cases enter the inGlobStar state
+    var instead = gspref.concat(entries[i], remainWithoutGlobStar)
+    this._process(instead, index, true)
+
+    var below = gspref.concat(entries[i], remain)
+    this._process(below, index, true)
+  }
+}
+
+GlobSync.prototype._processSimple = function (prefix, index) {
+  // XXX review this.  Shouldn't it be doing the mounting etc
+  // before doing stat?  kinda weird?
+  var exists = this._stat(prefix)
+
+  if (!this.matches[index])
+    this.matches[index] = Object.create(null)
+
+  // If it doesn't exist, then just mark the lack of results
+  if (!exists)
+    return
+
+  if (prefix && isAbsolute(prefix) && !this.nomount) {
+    var trail = /[\/\\]$/.test(prefix)
+    if (prefix.charAt(0) === '/') {
+      prefix = path.join(this.root, prefix)
+    } else {
+      prefix = path.resolve(this.root, prefix)
+      if (trail)
+        prefix += '/'
+    }
+  }
+
+  if (process.platform === 'win32')
+    prefix = prefix.replace(/\\/g, '/')
+
+  // Mark this as a match
+  this.matches[index][prefix] = true
+}
+
+// Returns either 'DIR', 'FILE', or false
+GlobSync.prototype._stat = function (f) {
+  var abs = this._makeAbs(f)
+  var needDir = f.slice(-1) === '/'
+
+  if (f.length > this.maxLength)
+    return false
+
+  if (!this.stat && ownProp(this.cache, abs)) {
+    var c = this.cache[abs]
+
+    if (Array.isArray(c))
+      c = 'DIR'
+
+    // It exists, but maybe not how we need it
+    if (!needDir || c === 'DIR')
+      return c
+
+    if (needDir && c === 'FILE')
+      return false
+
+    // otherwise we have to stat, because maybe c=true
+    // if we know it exists, but not what it is.
+  }
+
+  var exists
+  var stat = this.statCache[abs]
+  if (!stat) {
+    var lstat
+    try {
+      lstat = fs.lstatSync(abs)
+    } catch (er) {
+      return false
+    }
+
+    if (lstat.isSymbolicLink()) {
+      try {
+        stat = fs.statSync(abs)
+      } catch (er) {
+        stat = lstat
+      }
+    } else {
+      stat = lstat
+    }
+  }
+
+  this.statCache[abs] = stat
+
+  var c = stat.isDirectory() ? 'DIR' : 'FILE'
+  this.cache[abs] = this.cache[abs] || c
+
+  if (needDir && c !== 'DIR')
+    return false
+
+  return c
+}
+
+GlobSync.prototype._mark = function (p) {
+  return common.mark(this, p)
+}
+
+GlobSync.prototype._makeAbs = function (f) {
+  return common.makeAbs(this, f)
+}
diff --git a/wrt/node_modules/graceful-fs/.npmignore b/wrt/node_modules/graceful-fs/.npmignore
new file mode 100644 (file)
index 0000000..2f24c57
--- /dev/null
@@ -0,0 +1,3 @@
+node_modules/
+coverage/
+.nyc_output/
diff --git a/wrt/node_modules/graceful-fs/.travis.yml b/wrt/node_modules/graceful-fs/.travis.yml
new file mode 100644 (file)
index 0000000..b535ef4
--- /dev/null
@@ -0,0 +1,7 @@
+sudo: false
+language: node_js
+node_js:
+  - '0.10'
+  - '0.12'
+  - '4'
+  - '6'
diff --git a/wrt/node_modules/graceful-fs/LICENSE b/wrt/node_modules/graceful-fs/LICENSE
new file mode 100644 (file)
index 0000000..19129e3
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/wrt/node_modules/graceful-fs/README.md b/wrt/node_modules/graceful-fs/README.md
new file mode 100644 (file)
index 0000000..13a2e86
--- /dev/null
@@ -0,0 +1,36 @@
+# graceful-fs
+
+graceful-fs functions as a drop-in replacement for the fs module,
+making various improvements.
+
+The improvements are meant to normalize behavior across different
+platforms and environments, and to make filesystem access more
+resilient to errors.
+
+## Improvements over [fs module](http://api.nodejs.org/fs.html)
+
+graceful-fs:
+
+* Queues up `open` and `readdir` calls, and retries them once
+  something closes if there is an EMFILE error from too many file
+  descriptors.
+* fixes `lchmod` for Node versions prior to 0.6.2.
+* implements `fs.lutimes` if possible. Otherwise it becomes a noop.
+* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or
+  `lchown` if the user isn't root.
+* makes `lchmod` and `lchown` become noops, if not available.
+* retries reading a file if `read` results in EAGAIN error.
+
+On Windows, it retries renaming a file for up to one second if `EACCESS`
+or `EPERM` error occurs, likely because antivirus software has locked
+the directory.
+
+## USAGE
+
+```javascript
+// use just like fs
+var fs = require('graceful-fs')
+
+// now go and do stuff with it...
+fs.readFileSync('some-file-or-whatever')
+```
diff --git a/wrt/node_modules/graceful-fs/fs.js b/wrt/node_modules/graceful-fs/fs.js
new file mode 100644 (file)
index 0000000..7a37bb1
--- /dev/null
@@ -0,0 +1 @@
+module.exports = require('natives').require('fs', ['stream'])
diff --git a/wrt/node_modules/graceful-fs/graceful-fs.js b/wrt/node_modules/graceful-fs/graceful-fs.js
new file mode 100644 (file)
index 0000000..fb206b8
--- /dev/null
@@ -0,0 +1,158 @@
+// Monkey-patching the fs module.
+// It's ugly, but there is simply no other way to do this.
+var fs = module.exports = require('./fs.js')
+
+var assert = require('assert')
+
+// fix up some busted stuff, mostly on windows and old nodes
+require('./polyfills.js')
+
+var util = require('util')
+
+function noop () {}
+
+var debug = noop
+if (util.debuglog)
+  debug = util.debuglog('gfs')
+else if (/\bgfs\b/i.test(process.env.NODE_DEBUG || ''))
+  debug = function() {
+    var m = util.format.apply(util, arguments)
+    m = 'GFS: ' + m.split(/\n/).join('\nGFS: ')
+    console.error(m)
+  }
+
+if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) {
+  process.on('exit', function() {
+    debug('fds', fds)
+    debug(queue)
+    assert.equal(queue.length, 0)
+  })
+}
+
+
+var originalOpen = fs.open
+fs.open = open
+
+function open(path, flags, mode, cb) {
+  if (typeof mode === "function") cb = mode, mode = null
+  if (typeof cb !== "function") cb = noop
+  new OpenReq(path, flags, mode, cb)
+}
+
+function OpenReq(path, flags, mode, cb) {
+  this.path = path
+  this.flags = flags
+  this.mode = mode
+  this.cb = cb
+  Req.call(this)
+}
+
+util.inherits(OpenReq, Req)
+
+OpenReq.prototype.process = function() {
+  originalOpen.call(fs, this.path, this.flags, this.mode, this.done)
+}
+
+var fds = {}
+OpenReq.prototype.done = function(er, fd) {
+  debug('open done', er, fd)
+  if (fd)
+    fds['fd' + fd] = this.path
+  Req.prototype.done.call(this, er, fd)
+}
+
+
+var originalReaddir = fs.readdir
+fs.readdir = readdir
+
+function readdir(path, cb) {
+  if (typeof cb !== "function") cb = noop
+  new ReaddirReq(path, cb)
+}
+
+function ReaddirReq(path, cb) {
+  this.path = path
+  this.cb = cb
+  Req.call(this)
+}
+
+util.inherits(ReaddirReq, Req)
+
+ReaddirReq.prototype.process = function() {
+  originalReaddir.call(fs, this.path, this.done)
+}
+
+ReaddirReq.prototype.done = function(er, files) {
+  if (files && files.sort)
+    files = files.sort()
+  Req.prototype.done.call(this, er, files)
+  onclose()
+}
+
+
+var originalClose = fs.close
+fs.close = close
+
+function close (fd, cb) {
+  debug('close', fd)
+  if (typeof cb !== "function") cb = noop
+  delete fds['fd' + fd]
+  originalClose.call(fs, fd, function(er) {
+    onclose()
+    cb(er)
+  })
+}
+
+
+var originalCloseSync = fs.closeSync
+fs.closeSync = closeSync
+
+function closeSync (fd) {
+  try {
+    return originalCloseSync(fd)
+  } finally {
+    onclose()
+  }
+}
+
+
+// Req class
+function Req () {
+  // start processing
+  this.done = this.done.bind(this)
+  this.failures = 0
+  this.process()
+}
+
+Req.prototype.done = function (er, result) {
+  var tryAgain = false
+  if (er) {
+    var code = er.code
+    var tryAgain = code === "EMFILE" || code === "ENFILE"
+    if (process.platform === "win32")
+      tryAgain = tryAgain || code === "OK"
+  }
+
+  if (tryAgain) {
+    this.failures ++
+    enqueue(this)
+  } else {
+    var cb = this.cb
+    cb(er, result)
+  }
+}
+
+var queue = []
+
+function enqueue(req) {
+  queue.push(req)
+  debug('enqueue %d %s', queue.length, req.constructor.name, req)
+}
+
+function onclose() {
+  var req = queue.shift()
+  if (req) {
+    debug('process', req.constructor.name, req)
+    req.process()
+  }
+}
diff --git a/wrt/node_modules/graceful-fs/package.json b/wrt/node_modules/graceful-fs/package.json
new file mode 100644 (file)
index 0000000..d37e0bc
--- /dev/null
@@ -0,0 +1,112 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "graceful-fs@~3.0.2",
+        "scope": null,
+        "escapedName": "graceful-fs",
+        "name": "graceful-fs",
+        "rawSpec": "~3.0.2",
+        "spec": ">=3.0.2 <3.1.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/fstream"
+    ]
+  ],
+  "_from": "graceful-fs@>=3.0.2 <3.1.0",
+  "_id": "graceful-fs@3.0.11",
+  "_inCache": true,
+  "_location": "/graceful-fs",
+  "_nodeVersion": "6.5.0",
+  "_npmOperationalInternal": {
+    "host": "packages-16-east.internal.npmjs.com",
+    "tmp": "tmp/graceful-fs-3.0.11.tgz_1472583712827_0.6562602713238448"
+  },
+  "_npmUser": {
+    "name": "isaacs",
+    "email": "i@izs.me"
+  },
+  "_npmVersion": "3.10.7",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "graceful-fs@~3.0.2",
+    "scope": null,
+    "escapedName": "graceful-fs",
+    "name": "graceful-fs",
+    "rawSpec": "~3.0.2",
+    "spec": ">=3.0.2 <3.1.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/fstream"
+  ],
+  "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.11.tgz",
+  "_shasum": "7613c778a1afea62f25c630a086d7f3acbbdd818",
+  "_shrinkwrap": null,
+  "_spec": "graceful-fs@~3.0.2",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/fstream",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me"
+  },
+  "bugs": {
+    "url": "https://github.com/isaacs/node-graceful-fs/issues"
+  },
+  "dependencies": {
+    "natives": "^1.1.0"
+  },
+  "description": "A drop-in replacement for fs, making various improvements.",
+  "devDependencies": {
+    "mkdirp": "^0.5.0",
+    "rimraf": "^2.2.8",
+    "tap": "^1.2.0"
+  },
+  "directories": {
+    "test": "test"
+  },
+  "dist": {
+    "shasum": "7613c778a1afea62f25c630a086d7f3acbbdd818",
+    "tarball": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.11.tgz"
+  },
+  "engines": {
+    "node": ">=0.4.0"
+  },
+  "gitHead": "03d3cc6dbd4a499b1e13834eedbc469094a27582",
+  "homepage": "https://github.com/isaacs/node-graceful-fs#readme",
+  "keywords": [
+    "fs",
+    "module",
+    "reading",
+    "retry",
+    "retries",
+    "queue",
+    "error",
+    "errors",
+    "handling",
+    "EMFILE",
+    "EAGAIN",
+    "EINVAL",
+    "EPERM",
+    "EACCESS"
+  ],
+  "license": "ISC",
+  "main": "graceful-fs.js",
+  "maintainers": [
+    {
+      "name": "isaacs",
+      "email": "i@izs.me"
+    }
+  ],
+  "name": "graceful-fs",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/node-graceful-fs.git"
+  },
+  "scripts": {
+    "test": "tap test/*.js"
+  },
+  "version": "3.0.11"
+}
diff --git a/wrt/node_modules/graceful-fs/polyfills.js b/wrt/node_modules/graceful-fs/polyfills.js
new file mode 100644 (file)
index 0000000..4270539
--- /dev/null
@@ -0,0 +1,255 @@
+var fs = require('./fs.js')
+var constants = require('constants')
+
+var origCwd = process.cwd
+var cwd = null
+process.cwd = function() {
+  if (!cwd)
+    cwd = origCwd.call(process)
+  return cwd
+}
+var chdir = process.chdir
+process.chdir = function(d) {
+  cwd = null
+  chdir.call(process, d)
+}
+
+// (re-)implement some things that are known busted or missing.
+
+// lchmod, broken prior to 0.6.2
+// back-port the fix here.
+if (constants.hasOwnProperty('O_SYMLINK') &&
+    process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
+  fs.lchmod = function (path, mode, callback) {
+    callback = callback || noop
+    fs.open( path
+           , constants.O_WRONLY | constants.O_SYMLINK
+           , mode
+           , function (err, fd) {
+      if (err) {
+        callback(err)
+        return
+      }
+      // prefer to return the chmod error, if one occurs,
+      // but still try to close, and report closing errors if they occur.
+      fs.fchmod(fd, mode, function (err) {
+        fs.close(fd, function(err2) {
+          callback(err || err2)
+        })
+      })
+    })
+  }
+
+  fs.lchmodSync = function (path, mode) {
+    var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)
+
+    // prefer to return the chmod error, if one occurs,
+    // but still try to close, and report closing errors if they occur.
+    var err, err2
+    try {
+      var ret = fs.fchmodSync(fd, mode)
+    } catch (er) {
+      err = er
+    }
+    try {
+      fs.closeSync(fd)
+    } catch (er) {
+      err2 = er
+    }
+    if (err || err2) throw (err || err2)
+    return ret
+  }
+}
+
+
+// lutimes implementation, or no-op
+if (!fs.lutimes) {
+  if (constants.hasOwnProperty("O_SYMLINK")) {
+    fs.lutimes = function (path, at, mt, cb) {
+      fs.open(path, constants.O_SYMLINK, function (er, fd) {
+        cb = cb || noop
+        if (er) return cb(er)
+        fs.futimes(fd, at, mt, function (er) {
+          fs.close(fd, function (er2) {
+            return cb(er || er2)
+          })
+        })
+      })
+    }
+
+    fs.lutimesSync = function (path, at, mt) {
+      var fd = fs.openSync(path, constants.O_SYMLINK)
+        , err
+        , err2
+        , ret
+
+      try {
+        var ret = fs.futimesSync(fd, at, mt)
+      } catch (er) {
+        err = er
+      }
+      try {
+        fs.closeSync(fd)
+      } catch (er) {
+        err2 = er
+      }
+      if (err || err2) throw (err || err2)
+      return ret
+    }
+
+  } else if (fs.utimensat && constants.hasOwnProperty("AT_SYMLINK_NOFOLLOW")) {
+    // maybe utimensat will be bound soonish?
+    fs.lutimes = function (path, at, mt, cb) {
+      fs.utimensat(path, at, mt, constants.AT_SYMLINK_NOFOLLOW, cb)
+    }
+
+    fs.lutimesSync = function (path, at, mt) {
+      return fs.utimensatSync(path, at, mt, constants.AT_SYMLINK_NOFOLLOW)
+    }
+
+  } else {
+    fs.lutimes = function (_a, _b, _c, cb) { process.nextTick(cb) }
+    fs.lutimesSync = function () {}
+  }
+}
+
+
+// https://github.com/isaacs/node-graceful-fs/issues/4
+// Chown should not fail on einval or eperm if non-root.
+// It should not fail on enosys ever, as this just indicates
+// that a fs doesn't support the intended operation.
+
+fs.chown = chownFix(fs.chown)
+fs.fchown = chownFix(fs.fchown)
+fs.lchown = chownFix(fs.lchown)
+
+fs.chmod = chownFix(fs.chmod)
+fs.fchmod = chownFix(fs.fchmod)
+fs.lchmod = chownFix(fs.lchmod)
+
+fs.chownSync = chownFixSync(fs.chownSync)
+fs.fchownSync = chownFixSync(fs.fchownSync)
+fs.lchownSync = chownFixSync(fs.lchownSync)
+
+fs.chmodSync = chownFix(fs.chmodSync)
+fs.fchmodSync = chownFix(fs.fchmodSync)
+fs.lchmodSync = chownFix(fs.lchmodSync)
+
+function chownFix (orig) {
+  if (!orig) return orig
+  return function (target, uid, gid, cb) {
+    return orig.call(fs, target, uid, gid, function (er, res) {
+      if (chownErOk(er)) er = null
+      cb(er, res)
+    })
+  }
+}
+
+function chownFixSync (orig) {
+  if (!orig) return orig
+  return function (target, uid, gid) {
+    try {
+      return orig.call(fs, target, uid, gid)
+    } catch (er) {
+      if (!chownErOk(er)) throw er
+    }
+  }
+}
+
+// ENOSYS means that the fs doesn't support the op. Just ignore
+// that, because it doesn't matter.
+//
+// if there's no getuid, or if getuid() is something other
+// than 0, and the error is EINVAL or EPERM, then just ignore
+// it.
+//
+// This specific case is a silent failure in cp, install, tar,
+// and most other unix tools that manage permissions.
+//
+// When running as root, or if other types of errors are
+// encountered, then it's strict.
+function chownErOk (er) {
+  if (!er)
+    return true
+
+  if (er.code === "ENOSYS")
+    return true
+
+  var nonroot = !process.getuid || process.getuid() !== 0
+  if (nonroot) {
+    if (er.code === "EINVAL" || er.code === "EPERM")
+      return true
+  }
+
+  return false
+}
+
+
+// if lchmod/lchown do not exist, then make them no-ops
+if (!fs.lchmod) {
+  fs.lchmod = function (path, mode, cb) {
+    process.nextTick(cb)
+  }
+  fs.lchmodSync = function () {}
+}
+if (!fs.lchown) {
+  fs.lchown = function (path, uid, gid, cb) {
+    process.nextTick(cb)
+  }
+  fs.lchownSync = function () {}
+}
+
+
+
+// on Windows, A/V software can lock the directory, causing this
+// to fail with an EACCES or EPERM if the directory contains newly
+// created files.  Try again on failure, for up to 1 second.
+if (process.platform === "win32") {
+  var rename_ = fs.rename
+  fs.rename = function rename (from, to, cb) {
+    var start = Date.now()
+    rename_(from, to, function CB (er) {
+      if (er
+          && (er.code === "EACCES" || er.code === "EPERM")
+          && Date.now() - start < 1000) {
+        return rename_(from, to, CB)
+      }
+      if(cb) cb(er)
+    })
+  }
+}
+
+
+// if read() returns EAGAIN, then just try it again.
+var read = fs.read
+fs.read = function (fd, buffer, offset, length, position, callback_) {
+  var callback
+  if (callback_ && typeof callback_ === 'function') {
+    var eagCounter = 0
+    callback = function (er, _, __) {
+      if (er && er.code === 'EAGAIN' && eagCounter < 10) {
+        eagCounter ++
+        return read.call(fs, fd, buffer, offset, length, position, callback)
+      }
+      callback_.apply(this, arguments)
+    }
+  }
+  return read.call(fs, fd, buffer, offset, length, position, callback)
+}
+
+var readSync = fs.readSync
+fs.readSync = function (fd, buffer, offset, length, position) {
+  var eagCounter = 0
+  while (true) {
+    try {
+      return readSync.call(fs, fd, buffer, offset, length, position)
+    } catch (er) {
+      if (er.code === 'EAGAIN' && eagCounter < 10) {
+        eagCounter ++
+        continue
+      }
+      throw er
+    }
+  }
+}
+
diff --git a/wrt/node_modules/graceful-fs/test/max-open.js b/wrt/node_modules/graceful-fs/test/max-open.js
new file mode 100644 (file)
index 0000000..a6b9ba4
--- /dev/null
@@ -0,0 +1,69 @@
+var test = require('tap').test
+var fs = require('../')
+
+test('open lots of stuff', function (t) {
+  // Get around EBADF from libuv by making sure that stderr is opened
+  // Otherwise Darwin will refuse to give us a FD for stderr!
+  process.stderr.write('')
+
+  // How many parallel open()'s to do
+  var n = 1024
+  var opens = 0
+  var fds = []
+  var going = true
+  var closing = false
+  var doneCalled = 0
+
+  for (var i = 0; i < n; i++) {
+    go()
+  }
+
+  function go() {
+    opens++
+    fs.open(__filename, 'r', function (er, fd) {
+      if (er) throw er
+      fds.push(fd)
+      if (going) go()
+    })
+  }
+
+  // should hit ulimit pretty fast
+  setTimeout(function () {
+    going = false
+    t.equal(opens - fds.length, n)
+    done()
+  }, 100)
+
+
+  function done () {
+    if (closing) return
+    doneCalled++
+
+    if (fds.length === 0) {
+      console.error('done called %d times', doneCalled)
+      // First because of the timeout
+      // Then to close the fd's opened afterwards
+      // Then this time, to complete.
+      // Might take multiple passes, depending on CPU speed
+      // and ulimit, but at least 3 in every case.
+      t.ok(doneCalled >= 2)
+      return t.end()
+    }
+
+    closing = true
+    setTimeout(function () {
+      // console.error('do closing again')
+      closing = false
+      done()
+    }, 100)
+
+    // console.error('closing time')
+    var closes = fds.slice(0)
+    fds.length = 0
+    closes.forEach(function (fd) {
+      fs.close(fd, function (er) {
+        if (er) throw er
+      })
+    })
+  }
+})
diff --git a/wrt/node_modules/graceful-fs/test/open.js b/wrt/node_modules/graceful-fs/test/open.js
new file mode 100644 (file)
index 0000000..85732f2
--- /dev/null
@@ -0,0 +1,39 @@
+var test = require('tap').test
+var fs = require('../graceful-fs.js')
+
+test('graceful fs is monkeypatched fs', function (t) {
+  t.equal(fs, require('../fs.js'))
+  t.end()
+})
+
+test('open an existing file works', function (t) {
+  var fd = fs.openSync(__filename, 'r')
+  fs.closeSync(fd)
+  fs.open(__filename, 'r', function (er, fd) {
+    if (er) throw er
+    fs.close(fd, function (er) {
+      if (er) throw er
+      t.pass('works')
+      t.end()
+    })
+  })
+})
+
+test('open a non-existing file throws', function (t) {
+  var er
+  try {
+    var fd = fs.openSync('this file does not exist', 'r')
+  } catch (x) {
+    er = x
+  }
+  t.ok(er, 'should throw')
+  t.notOk(fd, 'should not get an fd')
+  t.equal(er.code, 'ENOENT')
+
+  fs.open('neither does this file', 'r', function (er, fd) {
+    t.ok(er, 'should throw')
+    t.notOk(fd, 'should not get an fd')
+    t.equal(er.code, 'ENOENT')
+    t.end()
+  })
+})
diff --git a/wrt/node_modules/graceful-fs/test/readdir-sort.js b/wrt/node_modules/graceful-fs/test/readdir-sort.js
new file mode 100644 (file)
index 0000000..cb63a68
--- /dev/null
@@ -0,0 +1,20 @@
+var test = require("tap").test
+var fs = require("../fs.js")
+
+var readdir = fs.readdir
+fs.readdir = function(path, cb) {
+  process.nextTick(function() {
+    cb(null, ["b", "z", "a"])
+  })
+}
+
+var g = require("../")
+
+test("readdir reorder", function (t) {
+  g.readdir("whatevers", function (er, files) {
+    if (er)
+      throw er
+    t.same(files, [ "a", "b", "z" ])
+    t.end()
+  })
+})
diff --git a/wrt/node_modules/graceful-fs/test/write-then-read.js b/wrt/node_modules/graceful-fs/test/write-then-read.js
new file mode 100644 (file)
index 0000000..21e4c26
--- /dev/null
@@ -0,0 +1,47 @@
+var fs = require('../');
+var rimraf = require('rimraf');
+var mkdirp = require('mkdirp');
+var test = require('tap').test;
+var p = require('path').resolve(__dirname, 'files');
+
+process.chdir(__dirname)
+
+// Make sure to reserve the stderr fd
+process.stderr.write('');
+
+var num = 4097;
+var paths = new Array(num);
+
+test('make files', function (t) {
+  rimraf.sync(p);
+  mkdirp.sync(p);
+
+  for (var i = 0; i < num; ++i) {
+    paths[i] = 'files/file-' + i;
+    fs.writeFileSync(paths[i], 'content');
+  }
+
+  t.end();
+})
+
+test('read files', function (t) {
+  // now read them
+  var done = 0;
+  for (var i = 0; i < num; ++i) {
+    fs.readFile(paths[i], function(err, data) {
+      if (err)
+        throw err;
+
+      ++done;
+      if (done === num) {
+        t.pass('success');
+        t.end()
+      }
+    });
+  }
+});
+
+test('cleanup', function (t) {
+  rimraf.sync(p);
+  t.end();
+});
diff --git a/wrt/node_modules/has-binary2/History.md b/wrt/node_modules/has-binary2/History.md
new file mode 100644 (file)
index 0000000..c5079b3
--- /dev/null
@@ -0,0 +1,39 @@
+
+1.0.2 / 2017-04-27
+==================
+
+  * fix(*): Fix Blob detection for iOS 8/9
+
+1.0.1 / 2017-04-05
+==================
+
+  * chore(*): restrict files included in npm package
+
+1.0.0 / 2017-04-05
+==================
+
+  * chore(*): update package name
+  * fix(*): do not call toJSON more than once (#7)
+  * fix(*): Ensure globals are functions before running `instanceof` checks against them. (#4)
+  * fix(*): fix the case when toJSON() returns a Buffer  (#6)
+  * chore(*): Bump dependencies, add semistandard checkstyle and travis configuration (#5)
+  * perf(*): Performance improvements (#3)
+
+0.1.7 / 2015-11-18
+==================
+
+  * fix toJSON [@jderuere]
+  * fix `global.isBuffer` usage [@tonetheman]
+  * fix tests on modern versions of node
+  * bump mocha
+
+0.1.6 / 2015-01-24
+==================
+
+ * fix "undefined function" bug when iterating
+   an object created with Object.create(null) [gunta]
+
+0.1.5 / 2014-09-04
+==================
+
+ * prevent browserify from bundling `Buffer`
diff --git a/wrt/node_modules/has-binary2/LICENSE b/wrt/node_modules/has-binary2/LICENSE
new file mode 100644 (file)
index 0000000..e6603cd
--- /dev/null
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Kevin Roark
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/has-binary2/README.md b/wrt/node_modules/has-binary2/README.md
new file mode 100644 (file)
index 0000000..76a0035
--- /dev/null
@@ -0,0 +1,4 @@
+has-binarydata.js
+=================
+
+Simple module to test if an object contains binary data
diff --git a/wrt/node_modules/has-binary2/index.js b/wrt/node_modules/has-binary2/index.js
new file mode 100644 (file)
index 0000000..c543498
--- /dev/null
@@ -0,0 +1,62 @@
+/* global Blob File */
+
+/*
+ * Module requirements.
+ */
+
+var isArray = require('isarray');
+
+var toString = Object.prototype.toString;
+var withNativeBlob = typeof global.Blob === 'function' || toString.call(global.Blob) === '[object BlobConstructor]';
+var withNativeFile = typeof global.File === 'function' || toString.call(global.File) === '[object FileConstructor]';
+
+/**
+ * Module exports.
+ */
+
+module.exports = hasBinary;
+
+/**
+ * Checks for binary data.
+ *
+ * Supports Buffer, ArrayBuffer, Blob and File.
+ *
+ * @param {Object} anything
+ * @api public
+ */
+
+function hasBinary (obj) {
+  if (!obj || typeof obj !== 'object') {
+    return false;
+  }
+
+  if (isArray(obj)) {
+    for (var i = 0, l = obj.length; i < l; i++) {
+      if (hasBinary(obj[i])) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  if ((typeof global.Buffer === 'function' && global.Buffer.isBuffer && global.Buffer.isBuffer(obj)) ||
+     (typeof global.ArrayBuffer === 'function' && obj instanceof ArrayBuffer) ||
+     (withNativeBlob && obj instanceof Blob) ||
+     (withNativeFile && obj instanceof File)
+    ) {
+    return true;
+  }
+
+  // see: https://github.com/Automattic/has-binary/pull/4
+  if (obj.toJSON && typeof obj.toJSON === 'function' && arguments.length === 1) {
+    return hasBinary(obj.toJSON(), true);
+  }
+
+  for (var key in obj) {
+    if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) {
+      return true;
+    }
+  }
+
+  return false;
+}
diff --git a/wrt/node_modules/has-binary2/node_modules/isarray/README.md b/wrt/node_modules/has-binary2/node_modules/isarray/README.md
new file mode 100644 (file)
index 0000000..38a91f6
--- /dev/null
@@ -0,0 +1,54 @@
+
+# isarray
+
+`Array#isArray` for older browsers.
+
+[![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray)
+[![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray)
+
+[![browser support](https://ci.testling.com/juliangruber/isarray.png)
+](https://ci.testling.com/juliangruber/isarray)
+
+## Usage
+
+```js
+var isArray = require('isarray');
+
+console.log(isArray([])); // => true
+console.log(isArray({})); // => false
+```
+
+## Installation
+
+With [npm](https://npmjs.org) do
+
+```bash
+$ npm install isarray
+```
+
+Then bundle for the browser with
+[browserify](https://github.com/substack/node-browserify).
+
+## License
+
+(MIT)
+
+Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/wrt/node_modules/has-binary2/node_modules/isarray/index.js b/wrt/node_modules/has-binary2/node_modules/isarray/index.js
new file mode 100644 (file)
index 0000000..a57f634
--- /dev/null
@@ -0,0 +1,5 @@
+var toString = {}.toString;
+
+module.exports = Array.isArray || function (arr) {
+  return toString.call(arr) == '[object Array]';
+};
diff --git a/wrt/node_modules/has-binary2/node_modules/isarray/package.json b/wrt/node_modules/has-binary2/node_modules/isarray/package.json
new file mode 100644 (file)
index 0000000..14caff8
--- /dev/null
@@ -0,0 +1,111 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "isarray@2.0.1",
+        "scope": null,
+        "escapedName": "isarray",
+        "name": "isarray",
+        "rawSpec": "2.0.1",
+        "spec": "2.0.1",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/has-binary2"
+    ]
+  ],
+  "_from": "isarray@2.0.1",
+  "_id": "isarray@2.0.1",
+  "_inCache": true,
+  "_location": "/has-binary2/isarray",
+  "_nodeVersion": "4.4.7",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/isarray-2.0.1.tgz_1475080038422_0.2867460672277957"
+  },
+  "_npmUser": {
+    "name": "juliangruber",
+    "email": "julian@juliangruber.com"
+  },
+  "_npmVersion": "2.15.8",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "isarray@2.0.1",
+    "scope": null,
+    "escapedName": "isarray",
+    "name": "isarray",
+    "rawSpec": "2.0.1",
+    "spec": "2.0.1",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/has-binary2"
+  ],
+  "_resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz",
+  "_shasum": "a37d94ed9cda2d59865c9f76fe596ee1f338741e",
+  "_shrinkwrap": null,
+  "_spec": "isarray@2.0.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/has-binary2",
+  "author": {
+    "name": "Julian Gruber",
+    "email": "mail@juliangruber.com",
+    "url": "http://juliangruber.com"
+  },
+  "bugs": {
+    "url": "https://github.com/juliangruber/isarray/issues"
+  },
+  "dependencies": {},
+  "description": "Array#isArray for older browsers",
+  "devDependencies": {
+    "tape": "~2.13.4"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "a37d94ed9cda2d59865c9f76fe596ee1f338741e",
+    "tarball": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz"
+  },
+  "files": [
+    "index.js"
+  ],
+  "gitHead": "d7f00583d8f58215cea94a81de85c6b4d33bead2",
+  "homepage": "https://github.com/juliangruber/isarray",
+  "keywords": [
+    "browser",
+    "isarray",
+    "array"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "juliangruber",
+      "email": "julian@juliangruber.com"
+    }
+  ],
+  "name": "isarray",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/juliangruber/isarray.git"
+  },
+  "scripts": {
+    "test": "tape test.js"
+  },
+  "testling": {
+    "files": "test.js",
+    "browsers": [
+      "ie/8..latest",
+      "firefox/17..latest",
+      "firefox/nightly",
+      "chrome/22..latest",
+      "chrome/canary",
+      "opera/12..latest",
+      "opera/next",
+      "safari/5.1..latest",
+      "ipad/6.0..latest",
+      "iphone/6.0..latest",
+      "android-browser/4.2..latest"
+    ]
+  },
+  "version": "2.0.1"
+}
diff --git a/wrt/node_modules/has-binary2/package.json b/wrt/node_modules/has-binary2/package.json
new file mode 100644 (file)
index 0000000..67658a1
--- /dev/null
@@ -0,0 +1,85 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "has-binary2@~1.0.2",
+        "scope": null,
+        "escapedName": "has-binary2",
+        "name": "has-binary2",
+        "rawSpec": "~1.0.2",
+        "spec": ">=1.0.2 <1.1.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io-parser"
+    ]
+  ],
+  "_from": "has-binary2@>=1.0.2 <1.1.0",
+  "_id": "has-binary2@1.0.2",
+  "_inCache": true,
+  "_location": "/has-binary2",
+  "_nodeVersion": "6.9.4",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/has-binary2-1.0.2.tgz_1493325765063_0.2403412840794772"
+  },
+  "_npmUser": {
+    "name": "darrachequesne",
+    "email": "damien.arrachequesne@gmail.com"
+  },
+  "_npmVersion": "3.10.10",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "has-binary2@~1.0.2",
+    "scope": null,
+    "escapedName": "has-binary2",
+    "name": "has-binary2",
+    "rawSpec": "~1.0.2",
+    "spec": ">=1.0.2 <1.1.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/engine.io-parser",
+    "/socket.io-parser"
+  ],
+  "_resolved": "https://registry.npmjs.org/has-binary2/-/has-binary2-1.0.2.tgz",
+  "_shasum": "e83dba49f0b9be4d026d27365350d9f03f54be98",
+  "_shrinkwrap": null,
+  "_spec": "has-binary2@~1.0.2",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io-parser",
+  "author": {
+    "name": "Kevin Roark"
+  },
+  "dependencies": {
+    "isarray": "2.0.1"
+  },
+  "description": "A function that takes anything in javascript and returns true if its argument contains binary data.",
+  "devDependencies": {
+    "better-assert": "^1.0.2",
+    "mocha": "^3.2.0",
+    "semistandard": "^9.2.1"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "e83dba49f0b9be4d026d27365350d9f03f54be98",
+    "tarball": "https://registry.npmjs.org/has-binary2/-/has-binary2-1.0.2.tgz"
+  },
+  "files": [
+    "index.js"
+  ],
+  "gitHead": "02266c05a7b3edecf945343c26c1bc562f78bbd9",
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "darrachequesne",
+      "email": "damien.arrachequesne@gmail.com"
+    }
+  ],
+  "name": "has-binary2",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "scripts": {
+    "checkstyle": "semistandard",
+    "test": "npm run checkstyle && mocha --bail"
+  },
+  "version": "1.0.2"
+}
diff --git a/wrt/node_modules/has-color/index.js b/wrt/node_modules/has-color/index.js
new file mode 100644 (file)
index 0000000..092d0ba
--- /dev/null
@@ -0,0 +1,32 @@
+'use strict';
+module.exports = (function () {
+       if (process.argv.indexOf('--no-color') !== -1) {
+               return false;
+       }
+
+       if (process.argv.indexOf('--color') !== -1) {
+               return true;
+       }
+
+       if (process.stdout && !process.stdout.isTTY) {
+               return false;
+       }
+
+       if (process.platform === 'win32') {
+               return true;
+       }
+
+       if ('COLORTERM' in process.env) {
+               return true;
+       }
+
+       if (process.env.TERM === 'dumb') {
+               return false;
+       }
+
+       if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) {
+               return true;
+       }
+
+       return false;
+})();
diff --git a/wrt/node_modules/has-color/package.json b/wrt/node_modules/has-color/package.json
new file mode 100644 (file)
index 0000000..7d4729f
--- /dev/null
@@ -0,0 +1,105 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "has-color@~0.1.0",
+        "scope": null,
+        "escapedName": "has-color",
+        "name": "has-color",
+        "rawSpec": "~0.1.0",
+        "spec": ">=0.1.0 <0.2.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/diskdb/node_modules/chalk"
+    ]
+  ],
+  "_from": "has-color@>=0.1.0 <0.2.0",
+  "_id": "has-color@0.1.7",
+  "_inCache": true,
+  "_location": "/has-color",
+  "_npmUser": {
+    "name": "sindresorhus",
+    "email": "sindresorhus@gmail.com"
+  },
+  "_npmVersion": "1.4.6",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "has-color@~0.1.0",
+    "scope": null,
+    "escapedName": "has-color",
+    "name": "has-color",
+    "rawSpec": "~0.1.0",
+    "spec": ">=0.1.0 <0.2.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/diskdb/chalk"
+  ],
+  "_resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz",
+  "_shasum": "67144a5260c34fc3cca677d041daf52fe7b78b2f",
+  "_shrinkwrap": null,
+  "_spec": "has-color@~0.1.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/diskdb/node_modules/chalk",
+  "author": {
+    "name": "Sindre Sorhus",
+    "email": "sindresorhus@gmail.com",
+    "url": "http://sindresorhus.com"
+  },
+  "bugs": {
+    "url": "https://github.com/sindresorhus/has-color/issues"
+  },
+  "dependencies": {},
+  "description": "Detect whether a terminal supports color",
+  "devDependencies": {
+    "mocha": "*"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "67144a5260c34fc3cca677d041daf52fe7b78b2f",
+    "tarball": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/sindresorhus/has-color",
+  "keywords": [
+    "color",
+    "colour",
+    "colors",
+    "terminal",
+    "console",
+    "cli",
+    "ansi",
+    "styles",
+    "tty",
+    "rgb",
+    "256",
+    "shell",
+    "xterm",
+    "command-line",
+    "support",
+    "capability",
+    "detect"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "sindresorhus",
+      "email": "sindresorhus@gmail.com"
+    }
+  ],
+  "name": "has-color",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/sindresorhus/has-color.git"
+  },
+  "scripts": {
+    "test": "mocha"
+  },
+  "version": "0.1.7"
+}
diff --git a/wrt/node_modules/has-color/readme.md b/wrt/node_modules/has-color/readme.md
new file mode 100644 (file)
index 0000000..37bbd89
--- /dev/null
@@ -0,0 +1,30 @@
+# has-color [![Build Status](https://travis-ci.org/sindresorhus/has-color.svg?branch=master)](https://travis-ci.org/sindresorhus/has-color)
+
+> Detect whether a terminal supports color.
+
+Used in the terminal color module [chalk](https://github.com/sindresorhus/chalk).
+
+
+## Install
+
+```bash
+$ npm install --save has-color
+```
+
+
+## Usage
+
+```js
+var hasColor = require('has-color');
+
+if (hasColor) {
+       console.log('Terminal supports color.');
+}
+```
+
+It obeys the `--color` and `--no-color` CLI flags.
+
+
+## License
+
+[MIT](http://opensource.org/licenses/MIT) © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/wrt/node_modules/has-cors/.npmignore b/wrt/node_modules/has-cors/.npmignore
new file mode 100644 (file)
index 0000000..665aa21
--- /dev/null
@@ -0,0 +1,3 @@
+components
+build
+node_modules
diff --git a/wrt/node_modules/has-cors/History.md b/wrt/node_modules/has-cors/History.md
new file mode 100644 (file)
index 0000000..4308161
--- /dev/null
@@ -0,0 +1,21 @@
+
+1.1.0 / 2014-11-12
+==================
+
+  * remove "global" module dependency (#2, @achingbrain)
+
+1.0.2 / 2013-08-27
+==================
+
+  * explicitly use `global` instead of being implicit
+  * pin "component/global" to v2.0.1
+
+1.0.1 / 2013-08-23
+==================
+
+  * package: add "component" section
+
+1.0.0 / 2013-08-22
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/has-cors/Makefile b/wrt/node_modules/has-cors/Makefile
new file mode 100644 (file)
index 0000000..0f14dac
--- /dev/null
@@ -0,0 +1,11 @@
+
+build: components index.js
+       @component build --dev
+
+components: component.json
+       @component install --dev
+
+clean:
+       rm -fr build components template.js
+
+.PHONY: clean
diff --git a/wrt/node_modules/has-cors/Readme.md b/wrt/node_modules/has-cors/Readme.md
new file mode 100644 (file)
index 0000000..8954646
--- /dev/null
@@ -0,0 +1,24 @@
+
+# has-cors
+
+  Detects support for Cross-Origin Resource Sharing
+
+## Installation
+
+  Install with [component(1)](http://component.io):
+
+    $ component install component/has-cors
+
+## API
+
+Exports `true` if the user-agent supports CORS, or `false` otherwise.
+
+``` js
+var hasCORS = require('has-cors');
+console.log(hasCORS);
+// true
+```
+
+## License
+
+  MIT
diff --git a/wrt/node_modules/has-cors/component.json b/wrt/node_modules/has-cors/component.json
new file mode 100644 (file)
index 0000000..b95e04d
--- /dev/null
@@ -0,0 +1,13 @@
+{
+  "name": "has-cors",
+  "repo": "component/has-cors",
+  "description": "Detects support for Cross-Origin Resource Sharing",
+  "version": "1.1.0",
+  "keywords": [],
+  "development": {},
+  "license": "MIT",
+  "main": "index.js",
+  "scripts": [
+    "index.js"
+  ]
+}
diff --git a/wrt/node_modules/has-cors/index.js b/wrt/node_modules/has-cors/index.js
new file mode 100644 (file)
index 0000000..952a7c8
--- /dev/null
@@ -0,0 +1,17 @@
+
+/**
+ * Module exports.
+ *
+ * Logic borrowed from Modernizr:
+ *
+ *   - https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cors.js
+ */
+
+try {
+  module.exports = typeof XMLHttpRequest !== 'undefined' &&
+    'withCredentials' in new XMLHttpRequest();
+} catch (err) {
+  // if XMLHttp support is disabled in IE then it will throw
+  // when trying to create
+  module.exports = false;
+}
diff --git a/wrt/node_modules/has-cors/package.json b/wrt/node_modules/has-cors/package.json
new file mode 100644 (file)
index 0000000..51b5ce7
--- /dev/null
@@ -0,0 +1,97 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "has-cors@1.1.0",
+        "scope": null,
+        "escapedName": "has-cors",
+        "name": "has-cors",
+        "rawSpec": "1.1.0",
+        "spec": "1.1.0",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io-client"
+    ]
+  ],
+  "_from": "has-cors@1.1.0",
+  "_id": "has-cors@1.1.0",
+  "_inCache": true,
+  "_location": "/has-cors",
+  "_npmUser": {
+    "name": "shtylman",
+    "email": "shtylman@gmail.com"
+  },
+  "_npmVersion": "1.4.23",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "has-cors@1.1.0",
+    "scope": null,
+    "escapedName": "has-cors",
+    "name": "has-cors",
+    "rawSpec": "1.1.0",
+    "spec": "1.1.0",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/engine.io-client",
+    "/socket.io-client"
+  ],
+  "_resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz",
+  "_shasum": "5e474793f7ea9843d1bb99c23eef49ff126fff39",
+  "_shrinkwrap": null,
+  "_spec": "has-cors@1.1.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io-client",
+  "author": {
+    "name": "Nathan Rajlich",
+    "email": "nathan@tootallnate.net",
+    "url": "http://n8.io/"
+  },
+  "bugs": {
+    "url": "https://github.com/component/has-cors/issues"
+  },
+  "component": {
+    "scripts": {
+      "has-cors/index.js": "index.js"
+    }
+  },
+  "dependencies": {},
+  "description": "Detects support for Cross-Origin Resource Sharing",
+  "devDependencies": {
+    "chai": "^1.10",
+    "mocha": "^2.0"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "5e474793f7ea9843d1bb99c23eef49ff126fff39",
+    "tarball": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz"
+  },
+  "gitHead": "27e9b96726b669e9594350585cc1e97474d3f995",
+  "homepage": "https://github.com/component/has-cors",
+  "keywords": [
+    "cors",
+    "cross",
+    "origin",
+    "resource",
+    "sharing",
+    "domain"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "shtylman",
+      "email": "shtylman@gmail.com"
+    }
+  ],
+  "name": "has-cors",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/component/has-cors.git"
+  },
+  "scripts": {
+    "test": "mocha"
+  },
+  "version": "1.1.0"
+}
diff --git a/wrt/node_modules/has-cors/test.js b/wrt/node_modules/has-cors/test.js
new file mode 100644 (file)
index 0000000..d2dfb84
--- /dev/null
@@ -0,0 +1,24 @@
+var expect = require('chai').expect;
+
+describe('has-cors', function() {
+  beforeEach(function() {
+    // make sure result is not cached
+    delete require.cache[require.resolve('./')];
+  });
+  
+  it('should not have cors', function() {
+    var hasCors = require('./');
+
+    expect(hasCors).to.be.false;
+  });
+  
+  it('should have cors', function() {
+    global.XMLHttpRequest = function() {
+      this.withCredentials = true;
+    };
+
+    var hasCors = require('./');
+
+    expect(hasCors).to.be.true;
+  });
+});
diff --git a/wrt/node_modules/has-flag/index.js b/wrt/node_modules/has-flag/index.js
new file mode 100644 (file)
index 0000000..6882030
--- /dev/null
@@ -0,0 +1,10 @@
+'use strict';
+module.exports = function (flag, argv) {
+       argv = argv || process.argv;
+
+       var terminatorPos = argv.indexOf('--');
+       var prefix = /^-{1,2}/.test(flag) ? '' : '--';
+       var pos = argv.indexOf(prefix + flag);
+
+       return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
+};
diff --git a/wrt/node_modules/has-flag/license b/wrt/node_modules/has-flag/license
new file mode 100644 (file)
index 0000000..654d0bf
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/has-flag/package.json b/wrt/node_modules/has-flag/package.json
new file mode 100644 (file)
index 0000000..e5209ff
--- /dev/null
@@ -0,0 +1,116 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "has-flag@^2.0.0",
+        "scope": null,
+        "escapedName": "has-flag",
+        "name": "has-flag",
+        "rawSpec": "^2.0.0",
+        "spec": ">=2.0.0 <3.0.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/supports-color"
+    ]
+  ],
+  "_from": "has-flag@>=2.0.0 <3.0.0",
+  "_id": "has-flag@2.0.0",
+  "_inCache": true,
+  "_location": "/has-flag",
+  "_nodeVersion": "4.4.2",
+  "_npmOperationalInternal": {
+    "host": "packages-16-east.internal.npmjs.com",
+    "tmp": "tmp/has-flag-2.0.0.tgz_1460389675597_0.3113734829239547"
+  },
+  "_npmUser": {
+    "name": "sindresorhus",
+    "email": "sindresorhus@gmail.com"
+  },
+  "_npmVersion": "3.8.6",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "has-flag@^2.0.0",
+    "scope": null,
+    "escapedName": "has-flag",
+    "name": "has-flag",
+    "rawSpec": "^2.0.0",
+    "spec": ">=2.0.0 <3.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/supports-color"
+  ],
+  "_resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz",
+  "_shasum": "e8207af1cc7b30d446cc70b734b5e8be18f88d51",
+  "_shrinkwrap": null,
+  "_spec": "has-flag@^2.0.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/supports-color",
+  "author": {
+    "name": "Sindre Sorhus",
+    "email": "sindresorhus@gmail.com",
+    "url": "sindresorhus.com"
+  },
+  "bugs": {
+    "url": "https://github.com/sindresorhus/has-flag/issues"
+  },
+  "dependencies": {},
+  "description": "Check if argv has a specific flag",
+  "devDependencies": {
+    "ava": "*",
+    "xo": "*"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "e8207af1cc7b30d446cc70b734b5e8be18f88d51",
+    "tarball": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "files": [
+    "index.js"
+  ],
+  "gitHead": "601137409f2617c75838d8f3febed5c6e6e8ee2c",
+  "homepage": "https://github.com/sindresorhus/has-flag#readme",
+  "keywords": [
+    "has",
+    "check",
+    "detect",
+    "contains",
+    "find",
+    "flag",
+    "cli",
+    "command-line",
+    "argv",
+    "process",
+    "arg",
+    "args",
+    "argument",
+    "arguments",
+    "getopt",
+    "minimist",
+    "optimist"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "sindresorhus",
+      "email": "sindresorhus@gmail.com"
+    },
+    {
+      "name": "jbnicolai",
+      "email": "jappelman@xebia.com"
+    }
+  ],
+  "name": "has-flag",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/sindresorhus/has-flag.git"
+  },
+  "scripts": {
+    "test": "xo && ava"
+  },
+  "version": "2.0.0"
+}
diff --git a/wrt/node_modules/has-flag/readme.md b/wrt/node_modules/has-flag/readme.md
new file mode 100644 (file)
index 0000000..0caca6c
--- /dev/null
@@ -0,0 +1,67 @@
+# has-flag [![Build Status](https://travis-ci.org/sindresorhus/has-flag.svg?branch=master)](https://travis-ci.org/sindresorhus/has-flag)
+
+> Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag
+
+Correctly stops looking after an `--` argument terminator.
+
+
+## Install
+
+```
+$ npm install --save has-flag
+```
+
+
+## Usage
+
+```js
+// foo.js
+const hasFlag = require('has-flag');
+
+hasFlag('unicorn');
+//=> true
+
+hasFlag('--unicorn');
+//=> true
+
+hasFlag('-f');
+//=> true
+
+hasFlag('foo=bar');
+//=> true
+
+hasFlag('foo');
+//=> false
+
+hasFlag('rainbow');
+//=> false
+```
+
+```
+$ node foo.js -f --unicorn --foo=bar -- --rainbow
+```
+
+
+## API
+
+### hasFlag(flag, [argv])
+
+Returns a boolean whether the flag exists.
+
+#### flag
+
+Type: `string`
+
+CLI flag to look for. The `--` prefix is optional.
+
+#### argv
+
+Type: `array`<br>
+Default: `process.argv`
+
+CLI arguments.
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/wrt/node_modules/http-errors/HISTORY.md b/wrt/node_modules/http-errors/HISTORY.md
new file mode 100644 (file)
index 0000000..b6ee4a0
--- /dev/null
@@ -0,0 +1,124 @@
+2017-08-04 / 1.6.2
+==================
+
+  * deps: depd@1.1.1
+    - Remove unnecessary `Buffer` loading
+
+2017-02-20 / 1.6.1
+==================
+
+  * deps: setprototypeof@1.0.3
+    - Fix shim for old browsers
+
+2017-02-14 / 1.6.0
+==================
+
+  * Accept custom 4xx and 5xx status codes in factory
+  * Add deprecation message to `"I'mateapot"` export
+  * Deprecate passing status code as anything except first argument in factory
+  * Deprecate using non-error status codes
+  * Make `message` property enumerable for `HttpError`s
+
+2016-11-16 / 1.5.1
+==================
+
+  * deps: inherits@2.0.3
+    - Fix issue loading in browser
+  * deps: setprototypeof@1.0.2
+  * deps: statuses@'>= 1.3.1 < 2'
+
+2016-05-18 / 1.5.0
+==================
+
+  * Support new code `421 Misdirected Request`
+  * Use `setprototypeof` module to replace `__proto__` setting
+  * deps: statuses@'>= 1.3.0 < 2'
+    - Add `421 Misdirected Request`
+    - perf: enable strict mode
+  * perf: enable strict mode
+
+2016-01-28 / 1.4.0
+==================
+
+  * Add `HttpError` export, for `err instanceof createError.HttpError`
+  * deps: inherits@2.0.1
+  * deps: statuses@'>= 1.2.1 < 2'
+    - Fix message for status 451
+    - Remove incorrect nginx status code
+
+2015-02-02 / 1.3.1
+==================
+
+  * Fix regression where status can be overwritten in `createError` `props`
+
+2015-02-01 / 1.3.0
+==================
+
+  * Construct errors using defined constructors from `createError`
+  * Fix error names that are not identifiers
+    - `createError["I'mateapot"]` is now `createError.ImATeapot`
+  * Set a meaningful `name` property on constructed errors
+
+2014-12-09 / 1.2.8
+==================
+
+  * Fix stack trace from exported function
+  * Remove `arguments.callee` usage
+
+2014-10-14 / 1.2.7
+==================
+
+  * Remove duplicate line
+
+2014-10-02 / 1.2.6
+==================
+
+  * Fix `expose` to be `true` for `ClientError` constructor
+
+2014-09-28 / 1.2.5
+==================
+
+  * deps: statuses@1
+
+2014-09-21 / 1.2.4
+==================
+
+  * Fix dependency version to work with old `npm`s
+
+2014-09-21 / 1.2.3
+==================
+
+  * deps: statuses@~1.1.0
+
+2014-09-21 / 1.2.2
+==================
+
+  * Fix publish error
+
+2014-09-21 / 1.2.1
+==================
+
+  * Support Node.js 0.6
+  * Use `inherits` instead of `util`
+
+2014-09-09 / 1.2.0
+==================
+
+  * Fix the way inheriting functions
+  * Support `expose` being provided in properties argument
+
+2014-09-08 / 1.1.0
+==================
+
+  * Default status to 500
+  * Support provided `error` to extend
+
+2014-09-08 / 1.0.1
+==================
+
+  * Fix accepting string message
+
+2014-09-08 / 1.0.0
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/http-errors/LICENSE b/wrt/node_modules/http-errors/LICENSE
new file mode 100644 (file)
index 0000000..82af4df
--- /dev/null
@@ -0,0 +1,23 @@
+
+The MIT License (MIT)
+
+Copyright (c) 2014 Jonathan Ong me@jongleberry.com
+Copyright (c) 2016 Douglas Christopher Wilson doug@somethingdoug.com
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/http-errors/README.md b/wrt/node_modules/http-errors/README.md
new file mode 100644 (file)
index 0000000..79663d8
--- /dev/null
@@ -0,0 +1,135 @@
+# http-errors
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+Create HTTP errors for Express, Koa, Connect, etc. with ease.
+
+## Install
+
+This is a [Node.js](https://nodejs.org/en/) module available through the
+[npm registry](https://www.npmjs.com/). Installation is done using the
+[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
+
+```bash
+$ npm install http-errors
+```
+
+## Example
+
+```js
+var createError = require('http-errors')
+var express = require('express')
+var app = express()
+
+app.use(function (req, res, next) {
+  if (!req.user) return next(createError(401, 'Please login to view this page.'))
+  next()
+})
+```
+
+## API
+
+This is the current API, currently extracted from Koa and subject to change.
+
+All errors inherit from JavaScript `Error` and the exported `createError.HttpError`.
+
+### Error Properties
+
+- `expose` - can be used to signal if `message` should be sent to the client,
+  defaulting to `false` when `status` >= 500
+- `headers` - can be an object of header names to values to be sent to the
+  client, defaulting to `undefined`. When defined, the key names should all
+  be lower-cased
+- `message` - the traditional error message, which should be kept short and all
+  single line
+- `status` - the status code of the error, mirroring `statusCode` for general
+  compatibility
+- `statusCode` - the status code of the error, defaulting to `500`
+
+### createError([status], [message], [properties])
+
+<!-- eslint-disable no-undef, no-unused-vars -->
+
+```js
+var err = createError(404, 'This video does not exist!')
+```
+
+- `status: 500` - the status code as a number
+- `message` - the message of the error, defaulting to node's text for that status code.
+- `properties` - custom properties to attach to the object
+
+### new createError\[code || name\](\[msg]\))
+
+<!-- eslint-disable no-undef, no-unused-vars -->
+
+```js
+var err = new createError.NotFound()
+```
+
+- `code` - the status code as a number
+- `name` - the name of the error as a "bumpy case", i.e. `NotFound` or `InternalServerError`.
+
+#### List of all constructors
+
+|Status Code|Constructor Name             |
+|-----------|-----------------------------|
+|400        |BadRequest                   |
+|401        |Unauthorized                 |
+|402        |PaymentRequired              |
+|403        |Forbidden                    |
+|404        |NotFound                     |
+|405        |MethodNotAllowed             |
+|406        |NotAcceptable                |
+|407        |ProxyAuthenticationRequired  |
+|408        |RequestTimeout               |
+|409        |Conflict                     |
+|410        |Gone                         |
+|411        |LengthRequired               |
+|412        |PreconditionFailed           |
+|413        |PayloadTooLarge              |
+|414        |URITooLong                   |
+|415        |UnsupportedMediaType         |
+|416        |RangeNotSatisfiable          |
+|417        |ExpectationFailed            |
+|418        |ImATeapot                    |
+|421        |MisdirectedRequest           |
+|422        |UnprocessableEntity          |
+|423        |Locked                       |
+|424        |FailedDependency             |
+|425        |UnorderedCollection          |
+|426        |UpgradeRequired              |
+|428        |PreconditionRequired         |
+|429        |TooManyRequests              |
+|431        |RequestHeaderFieldsTooLarge  |
+|451        |UnavailableForLegalReasons   |
+|500        |InternalServerError          |
+|501        |NotImplemented               |
+|502        |BadGateway                   |
+|503        |ServiceUnavailable           |
+|504        |GatewayTimeout               |
+|505        |HTTPVersionNotSupported      |
+|506        |VariantAlsoNegotiates        |
+|507        |InsufficientStorage          |
+|508        |LoopDetected                 |
+|509        |BandwidthLimitExceeded       |
+|510        |NotExtended                  |
+|511        |NetworkAuthenticationRequired|
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/http-errors.svg
+[npm-url]: https://npmjs.org/package/http-errors
+[node-version-image]: https://img.shields.io/node/v/http-errors.svg
+[node-version-url]: https://nodejs.org/en/download/
+[travis-image]: https://img.shields.io/travis/jshttp/http-errors.svg
+[travis-url]: https://travis-ci.org/jshttp/http-errors
+[coveralls-image]: https://img.shields.io/coveralls/jshttp/http-errors.svg
+[coveralls-url]: https://coveralls.io/r/jshttp/http-errors
+[downloads-image]: https://img.shields.io/npm/dm/http-errors.svg
+[downloads-url]: https://npmjs.org/package/http-errors
diff --git a/wrt/node_modules/http-errors/index.js b/wrt/node_modules/http-errors/index.js
new file mode 100644 (file)
index 0000000..9509303
--- /dev/null
@@ -0,0 +1,260 @@
+/*!
+ * http-errors
+ * Copyright(c) 2014 Jonathan Ong
+ * Copyright(c) 2016 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var deprecate = require('depd')('http-errors')
+var setPrototypeOf = require('setprototypeof')
+var statuses = require('statuses')
+var inherits = require('inherits')
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = createError
+module.exports.HttpError = createHttpErrorConstructor()
+
+// Populate exports for all constructors
+populateConstructorExports(module.exports, statuses.codes, module.exports.HttpError)
+
+/**
+ * Get the code class of a status code.
+ * @private
+ */
+
+function codeClass (status) {
+  return Number(String(status).charAt(0) + '00')
+}
+
+/**
+ * Create a new HTTP Error.
+ *
+ * @returns {Error}
+ * @public
+ */
+
+function createError () {
+  // so much arity going on ~_~
+  var err
+  var msg
+  var status = 500
+  var props = {}
+  for (var i = 0; i < arguments.length; i++) {
+    var arg = arguments[i]
+    if (arg instanceof Error) {
+      err = arg
+      status = err.status || err.statusCode || status
+      continue
+    }
+    switch (typeof arg) {
+      case 'string':
+        msg = arg
+        break
+      case 'number':
+        status = arg
+        if (i !== 0) {
+          deprecate('non-first-argument status code; replace with createError(' + arg + ', ...)')
+        }
+        break
+      case 'object':
+        props = arg
+        break
+    }
+  }
+
+  if (typeof status === 'number' && (status < 400 || status >= 600)) {
+    deprecate('non-error status code; use only 4xx or 5xx status codes')
+  }
+
+  if (typeof status !== 'number' ||
+    (!statuses[status] && (status < 400 || status >= 600))) {
+    status = 500
+  }
+
+  // constructor
+  var HttpError = createError[status] || createError[codeClass(status)]
+
+  if (!err) {
+    // create error
+    err = HttpError
+      ? new HttpError(msg)
+      : new Error(msg || statuses[status])
+    Error.captureStackTrace(err, createError)
+  }
+
+  if (!HttpError || !(err instanceof HttpError) || err.status !== status) {
+    // add properties to generic error
+    err.expose = status < 500
+    err.status = err.statusCode = status
+  }
+
+  for (var key in props) {
+    if (key !== 'status' && key !== 'statusCode') {
+      err[key] = props[key]
+    }
+  }
+
+  return err
+}
+
+/**
+ * Create HTTP error abstract base class.
+ * @private
+ */
+
+function createHttpErrorConstructor () {
+  function HttpError () {
+    throw new TypeError('cannot construct abstract class')
+  }
+
+  inherits(HttpError, Error)
+
+  return HttpError
+}
+
+/**
+ * Create a constructor for a client error.
+ * @private
+ */
+
+function createClientErrorConstructor (HttpError, name, code) {
+  var className = name.match(/Error$/) ? name : name + 'Error'
+
+  function ClientError (message) {
+    // create the error object
+    var msg = message != null ? message : statuses[code]
+    var err = new Error(msg)
+
+    // capture a stack trace to the construction point
+    Error.captureStackTrace(err, ClientError)
+
+    // adjust the [[Prototype]]
+    setPrototypeOf(err, ClientError.prototype)
+
+    // redefine the error message
+    Object.defineProperty(err, 'message', {
+      enumerable: true,
+      configurable: true,
+      value: msg,
+      writable: true
+    })
+
+    // redefine the error name
+    Object.defineProperty(err, 'name', {
+      enumerable: false,
+      configurable: true,
+      value: className,
+      writable: true
+    })
+
+    return err
+  }
+
+  inherits(ClientError, HttpError)
+
+  ClientError.prototype.status = code
+  ClientError.prototype.statusCode = code
+  ClientError.prototype.expose = true
+
+  return ClientError
+}
+
+/**
+ * Create a constructor for a server error.
+ * @private
+ */
+
+function createServerErrorConstructor (HttpError, name, code) {
+  var className = name.match(/Error$/) ? name : name + 'Error'
+
+  function ServerError (message) {
+    // create the error object
+    var msg = message != null ? message : statuses[code]
+    var err = new Error(msg)
+
+    // capture a stack trace to the construction point
+    Error.captureStackTrace(err, ServerError)
+
+    // adjust the [[Prototype]]
+    setPrototypeOf(err, ServerError.prototype)
+
+    // redefine the error message
+    Object.defineProperty(err, 'message', {
+      enumerable: true,
+      configurable: true,
+      value: msg,
+      writable: true
+    })
+
+    // redefine the error name
+    Object.defineProperty(err, 'name', {
+      enumerable: false,
+      configurable: true,
+      value: className,
+      writable: true
+    })
+
+    return err
+  }
+
+  inherits(ServerError, HttpError)
+
+  ServerError.prototype.status = code
+  ServerError.prototype.statusCode = code
+  ServerError.prototype.expose = false
+
+  return ServerError
+}
+
+/**
+ * Populate the exports object with constructors for every error class.
+ * @private
+ */
+
+function populateConstructorExports (exports, codes, HttpError) {
+  codes.forEach(function forEachCode (code) {
+    var CodeError
+    var name = toIdentifier(statuses[code])
+
+    switch (codeClass(code)) {
+      case 400:
+        CodeError = createClientErrorConstructor(HttpError, name, code)
+        break
+      case 500:
+        CodeError = createServerErrorConstructor(HttpError, name, code)
+        break
+    }
+
+    if (CodeError) {
+      // export the constructor
+      exports[code] = CodeError
+      exports[name] = CodeError
+    }
+  })
+
+  // backwards-compatibility
+  exports["I'mateapot"] = deprecate.function(exports.ImATeapot,
+    '"I\'mateapot"; use "ImATeapot" instead')
+}
+
+/**
+ * Convert a string of words to a JavaScript identifier.
+ * @private
+ */
+
+function toIdentifier (str) {
+  return str.split(' ').map(function (token) {
+    return token.slice(0, 1).toUpperCase() + token.slice(1)
+  }).join('').replace(/[^ _0-9a-z]/gi, '')
+}
diff --git a/wrt/node_modules/http-errors/package.json b/wrt/node_modules/http-errors/package.json
new file mode 100644 (file)
index 0000000..826f168
--- /dev/null
@@ -0,0 +1,133 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "http-errors@~1.6.2",
+        "scope": null,
+        "escapedName": "http-errors",
+        "name": "http-errors",
+        "rawSpec": "~1.6.2",
+        "spec": ">=1.6.2 <1.7.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/send"
+    ]
+  ],
+  "_from": "http-errors@>=1.6.2 <1.7.0",
+  "_id": "http-errors@1.6.2",
+  "_inCache": true,
+  "_location": "/http-errors",
+  "_nodeVersion": "6.11.1",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/http-errors-1.6.2.tgz_1501906124983_0.24086778541095555"
+  },
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "3.10.10",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "http-errors@~1.6.2",
+    "scope": null,
+    "escapedName": "http-errors",
+    "name": "http-errors",
+    "rawSpec": "~1.6.2",
+    "spec": ">=1.6.2 <1.7.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/send"
+  ],
+  "_resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz",
+  "_shasum": "0a002cc85707192a7e7946ceedc11155f60ec736",
+  "_shrinkwrap": null,
+  "_spec": "http-errors@~1.6.2",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/send",
+  "author": {
+    "name": "Jonathan Ong",
+    "email": "me@jongleberry.com",
+    "url": "http://jongleberry.com"
+  },
+  "bugs": {
+    "url": "https://github.com/jshttp/http-errors/issues"
+  },
+  "contributors": [
+    {
+      "name": "Alan Plum",
+      "email": "me@pluma.io"
+    },
+    {
+      "name": "Douglas Christopher Wilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "dependencies": {
+    "depd": "1.1.1",
+    "inherits": "2.0.3",
+    "setprototypeof": "1.0.3",
+    "statuses": ">= 1.3.1 < 2"
+  },
+  "description": "Create HTTP error objects",
+  "devDependencies": {
+    "eslint": "3.19.0",
+    "eslint-config-standard": "10.2.1",
+    "eslint-plugin-import": "2.7.0",
+    "eslint-plugin-markdown": "1.0.0-beta.6",
+    "eslint-plugin-node": "5.1.1",
+    "eslint-plugin-promise": "3.5.0",
+    "eslint-plugin-standard": "3.0.1",
+    "istanbul": "0.4.5",
+    "mocha": "1.21.5"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "0a002cc85707192a7e7946ceedc11155f60ec736",
+    "tarball": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz"
+  },
+  "engines": {
+    "node": ">= 0.6"
+  },
+  "files": [
+    "index.js",
+    "HISTORY.md",
+    "LICENSE",
+    "README.md"
+  ],
+  "gitHead": "7e534cb45fc06e8c3ad782cde89a7462851b27d1",
+  "homepage": "https://github.com/jshttp/http-errors#readme",
+  "keywords": [
+    "http",
+    "error"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "jongleberry",
+      "email": "jonathanrichardong@gmail.com"
+    },
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    },
+    {
+      "name": "egeste",
+      "email": "npm@egeste.net"
+    }
+  ],
+  "name": "http-errors",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/jshttp/http-errors.git"
+  },
+  "scripts": {
+    "lint": "eslint --plugin markdown --ext js,md .",
+    "test": "mocha --reporter spec --bail",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot",
+    "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"
+  },
+  "version": "1.6.2"
+}
diff --git a/wrt/node_modules/indexof/.npmignore b/wrt/node_modules/indexof/.npmignore
new file mode 100644 (file)
index 0000000..48a2e24
--- /dev/null
@@ -0,0 +1,2 @@
+components
+build
diff --git a/wrt/node_modules/indexof/Makefile b/wrt/node_modules/indexof/Makefile
new file mode 100644 (file)
index 0000000..3f6119d
--- /dev/null
@@ -0,0 +1,11 @@
+
+build: components index.js
+       @component build
+
+components:
+       @Component install
+
+clean:
+       rm -fr build components template.js
+
+.PHONY: clean
diff --git a/wrt/node_modules/indexof/Readme.md b/wrt/node_modules/indexof/Readme.md
new file mode 100644 (file)
index 0000000..99c8dfc
--- /dev/null
@@ -0,0 +1,15 @@
+
+# indexOf
+
+  Lame indexOf thing, thanks microsoft
+
+## Example
+
+```js
+var index = require('indexof');
+index(arr, obj);
+```
+
+## License
+
+  MIT
\ No newline at end of file
diff --git a/wrt/node_modules/indexof/component.json b/wrt/node_modules/indexof/component.json
new file mode 100644 (file)
index 0000000..e3430d7
--- /dev/null
@@ -0,0 +1,10 @@
+{
+  "name": "indexof",
+  "description": "Microsoft sucks",
+  "version": "0.0.1",
+  "keywords": ["index", "array", "indexOf"],
+  "dependencies": {},
+  "scripts": [
+    "index.js"
+  ]
+}
\ No newline at end of file
diff --git a/wrt/node_modules/indexof/index.js b/wrt/node_modules/indexof/index.js
new file mode 100644 (file)
index 0000000..9d9667b
--- /dev/null
@@ -0,0 +1,10 @@
+
+var indexOf = [].indexOf;
+
+module.exports = function(arr, obj){
+  if (indexOf) return arr.indexOf(obj);
+  for (var i = 0; i < arr.length; ++i) {
+    if (arr[i] === obj) return i;
+  }
+  return -1;
+};
\ No newline at end of file
diff --git a/wrt/node_modules/indexof/package.json b/wrt/node_modules/indexof/package.json
new file mode 100644 (file)
index 0000000..a225af8
--- /dev/null
@@ -0,0 +1,67 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "indexof@0.0.1",
+        "scope": null,
+        "escapedName": "indexof",
+        "name": "indexof",
+        "rawSpec": "0.0.1",
+        "spec": "0.0.1",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io-client"
+    ]
+  ],
+  "_from": "indexof@0.0.1",
+  "_id": "indexof@0.0.1",
+  "_inCache": true,
+  "_location": "/indexof",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "indexof@0.0.1",
+    "scope": null,
+    "escapedName": "indexof",
+    "name": "indexof",
+    "rawSpec": "0.0.1",
+    "spec": "0.0.1",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/engine.io-client",
+    "/socket.io-client"
+  ],
+  "_resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz",
+  "_shasum": "82dc336d232b9062179d05ab3293a66059fd435d",
+  "_shrinkwrap": null,
+  "_spec": "indexof@0.0.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io-client",
+  "component": {
+    "scripts": {
+      "indexof/index.js": "index.js"
+    }
+  },
+  "dependencies": {},
+  "description": "Microsoft sucks",
+  "devDependencies": {},
+  "directories": {},
+  "dist": {
+    "shasum": "82dc336d232b9062179d05ab3293a66059fd435d",
+    "tarball": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz"
+  },
+  "keywords": [
+    "index",
+    "array",
+    "indexOf"
+  ],
+  "maintainers": [
+    {
+      "name": "tjholowaychuk",
+      "email": "tj@vision-media.ca"
+    }
+  ],
+  "name": "indexof",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "version": "0.0.1"
+}
diff --git a/wrt/node_modules/inflight/LICENSE b/wrt/node_modules/inflight/LICENSE
new file mode 100644 (file)
index 0000000..05eeeb8
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/wrt/node_modules/inflight/README.md b/wrt/node_modules/inflight/README.md
new file mode 100644 (file)
index 0000000..6dc8929
--- /dev/null
@@ -0,0 +1,37 @@
+# inflight
+
+Add callbacks to requests in flight to avoid async duplication
+
+## USAGE
+
+```javascript
+var inflight = require('inflight')
+
+// some request that does some stuff
+function req(key, callback) {
+  // key is any random string.  like a url or filename or whatever.
+  //
+  // will return either a falsey value, indicating that the
+  // request for this key is already in flight, or a new callback
+  // which when called will call all callbacks passed to inflightk
+  // with the same key
+  callback = inflight(key, callback)
+
+  // If we got a falsey value back, then there's already a req going
+  if (!callback) return
+
+  // this is where you'd fetch the url or whatever
+  // callback is also once()-ified, so it can safely be assigned
+  // to multiple events etc.  First call wins.
+  setTimeout(function() {
+    callback(null, key)
+  }, 100)
+}
+
+// only assigns a single setTimeout
+// when it dings, all cbs get called
+req('foo', cb1)
+req('foo', cb2)
+req('foo', cb3)
+req('foo', cb4)
+```
diff --git a/wrt/node_modules/inflight/inflight.js b/wrt/node_modules/inflight/inflight.js
new file mode 100644 (file)
index 0000000..48202b3
--- /dev/null
@@ -0,0 +1,54 @@
+var wrappy = require('wrappy')
+var reqs = Object.create(null)
+var once = require('once')
+
+module.exports = wrappy(inflight)
+
+function inflight (key, cb) {
+  if (reqs[key]) {
+    reqs[key].push(cb)
+    return null
+  } else {
+    reqs[key] = [cb]
+    return makeres(key)
+  }
+}
+
+function makeres (key) {
+  return once(function RES () {
+    var cbs = reqs[key]
+    var len = cbs.length
+    var args = slice(arguments)
+
+    // XXX It's somewhat ambiguous whether a new callback added in this
+    // pass should be queued for later execution if something in the
+    // list of callbacks throws, or if it should just be discarded.
+    // However, it's such an edge case that it hardly matters, and either
+    // choice is likely as surprising as the other.
+    // As it happens, we do go ahead and schedule it for later execution.
+    try {
+      for (var i = 0; i < len; i++) {
+        cbs[i].apply(null, args)
+      }
+    } finally {
+      if (cbs.length > len) {
+        // added more in the interim.
+        // de-zalgo, just in case, but don't call again.
+        cbs.splice(0, len)
+        process.nextTick(function () {
+          RES.apply(null, args)
+        })
+      } else {
+        delete reqs[key]
+      }
+    }
+  })
+}
+
+function slice (args) {
+  var length = args.length
+  var array = []
+
+  for (var i = 0; i < length; i++) array[i] = args[i]
+  return array
+}
diff --git a/wrt/node_modules/inflight/package.json b/wrt/node_modules/inflight/package.json
new file mode 100644 (file)
index 0000000..367dbed
--- /dev/null
@@ -0,0 +1,62 @@
+{
+  "_from": "inflight@^1.0.4",
+  "_id": "inflight@1.0.6",
+  "_inBundle": false,
+  "_integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
+  "_location": "/inflight",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "inflight@^1.0.4",
+    "name": "inflight",
+    "escapedName": "inflight",
+    "rawSpec": "^1.0.4",
+    "saveSpec": null,
+    "fetchSpec": "^1.0.4"
+  },
+  "_requiredBy": [
+    "/asar/glob",
+    "/coffeelint/glob",
+    "/glob",
+    "/node-gyp/glob",
+    "/rimraf/glob"
+  ],
+  "_resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
+  "_shasum": "49bd6331d7d02d0c09bc910a1075ba8165b56df9",
+  "_spec": "inflight@^1.0.4",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was/node_modules/glob",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bugs": {
+    "url": "https://github.com/isaacs/inflight/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {
+    "once": "^1.3.0",
+    "wrappy": "1"
+  },
+  "deprecated": false,
+  "description": "Add callbacks to requests in flight to avoid async duplication",
+  "devDependencies": {
+    "tap": "^7.1.2"
+  },
+  "files": [
+    "inflight.js"
+  ],
+  "homepage": "https://github.com/isaacs/inflight",
+  "license": "ISC",
+  "main": "inflight.js",
+  "name": "inflight",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/npm/inflight.git"
+  },
+  "scripts": {
+    "test": "tap test.js --100"
+  },
+  "version": "1.0.6"
+}
diff --git a/wrt/node_modules/inherits/LICENSE b/wrt/node_modules/inherits/LICENSE
new file mode 100644 (file)
index 0000000..dea3013
--- /dev/null
@@ -0,0 +1,16 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+
diff --git a/wrt/node_modules/inherits/README.md b/wrt/node_modules/inherits/README.md
new file mode 100644 (file)
index 0000000..b1c5665
--- /dev/null
@@ -0,0 +1,42 @@
+Browser-friendly inheritance fully compatible with standard node.js
+[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).
+
+This package exports standard `inherits` from node.js `util` module in
+node environment, but also provides alternative browser-friendly
+implementation through [browser
+field](https://gist.github.com/shtylman/4339901). Alternative
+implementation is a literal copy of standard one located in standalone
+module to avoid requiring of `util`. It also has a shim for old
+browsers with no `Object.create` support.
+
+While keeping you sure you are using standard `inherits`
+implementation in node.js environment, it allows bundlers such as
+[browserify](https://github.com/substack/node-browserify) to not
+include full `util` package to your client code if all you need is
+just `inherits` function. It worth, because browser shim for `util`
+package is large and `inherits` is often the single function you need
+from it.
+
+It's recommended to use this package instead of
+`require('util').inherits` for any code that has chances to be used
+not only in node.js but in browser too.
+
+## usage
+
+```js
+var inherits = require('inherits');
+// then use exactly as the standard one
+```
+
+## note on version ~1.0
+
+Version ~1.0 had completely different motivation and is not compatible
+neither with 2.0 nor with standard node.js `inherits`.
+
+If you are using version ~1.0 and planning to switch to ~2.0, be
+careful:
+
+* new version uses `super_` instead of `super` for referencing
+  superclass
+* new version overwrites current prototype while old one preserves any
+  existing fields on it
diff --git a/wrt/node_modules/inherits/inherits.js b/wrt/node_modules/inherits/inherits.js
new file mode 100644 (file)
index 0000000..3b94763
--- /dev/null
@@ -0,0 +1,7 @@
+try {
+  var util = require('util');
+  if (typeof util.inherits !== 'function') throw '';
+  module.exports = util.inherits;
+} catch (e) {
+  module.exports = require('./inherits_browser.js');
+}
diff --git a/wrt/node_modules/inherits/inherits_browser.js b/wrt/node_modules/inherits/inherits_browser.js
new file mode 100644 (file)
index 0000000..c1e78a7
--- /dev/null
@@ -0,0 +1,23 @@
+if (typeof Object.create === 'function') {
+  // implementation from standard node.js 'util' module
+  module.exports = function inherits(ctor, superCtor) {
+    ctor.super_ = superCtor
+    ctor.prototype = Object.create(superCtor.prototype, {
+      constructor: {
+        value: ctor,
+        enumerable: false,
+        writable: true,
+        configurable: true
+      }
+    });
+  };
+} else {
+  // old school shim for old browsers
+  module.exports = function inherits(ctor, superCtor) {
+    ctor.super_ = superCtor
+    var TempCtor = function () {}
+    TempCtor.prototype = superCtor.prototype
+    ctor.prototype = new TempCtor()
+    ctor.prototype.constructor = ctor
+  }
+}
diff --git a/wrt/node_modules/inherits/package.json b/wrt/node_modules/inherits/package.json
new file mode 100644 (file)
index 0000000..79e3fbe
--- /dev/null
@@ -0,0 +1,72 @@
+{
+  "_from": "inherits@2",
+  "_id": "inherits@2.0.3",
+  "_inBundle": false,
+  "_integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
+  "_location": "/inherits",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "inherits@2",
+    "name": "inherits",
+    "escapedName": "inherits",
+    "rawSpec": "2",
+    "saveSpec": null,
+    "fetchSpec": "2"
+  },
+  "_requiredBy": [
+    "/are-we-there-yet/readable-stream",
+    "/asar/glob",
+    "/block-stream",
+    "/coffeelint/glob",
+    "/decompress-zip/readable-stream",
+    "/fstream",
+    "/glob",
+    "/node-gyp/glob",
+    "/readable-stream",
+    "/rimraf/glob",
+    "/tar",
+    "/unzip/fstream"
+  ],
+  "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
+  "_shasum": "633c2c83e3da42a502f52466022480f4208261de",
+  "_spec": "inherits@2",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was/node_modules/glob",
+  "browser": "./inherits_browser.js",
+  "bugs": {
+    "url": "https://github.com/isaacs/inherits/issues"
+  },
+  "bundleDependencies": false,
+  "deprecated": false,
+  "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()",
+  "devDependencies": {
+    "tap": "^7.1.0"
+  },
+  "files": [
+    "inherits.js",
+    "inherits_browser.js"
+  ],
+  "homepage": "https://github.com/isaacs/inherits#readme",
+  "keywords": [
+    "inheritance",
+    "class",
+    "klass",
+    "oop",
+    "object-oriented",
+    "inherits",
+    "browser",
+    "browserify"
+  ],
+  "license": "ISC",
+  "main": "./inherits.js",
+  "name": "inherits",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/inherits.git"
+  },
+  "scripts": {
+    "test": "node test"
+  },
+  "version": "2.0.3"
+}
diff --git a/wrt/node_modules/ipaddr.js/.npmignore b/wrt/node_modules/ipaddr.js/.npmignore
new file mode 100644 (file)
index 0000000..7a1537b
--- /dev/null
@@ -0,0 +1,2 @@
+.idea
+node_modules
diff --git a/wrt/node_modules/ipaddr.js/.travis.yml b/wrt/node_modules/ipaddr.js/.travis.yml
new file mode 100644 (file)
index 0000000..aa3d14a
--- /dev/null
@@ -0,0 +1,10 @@
+language: node_js
+
+node_js:
+  - "0.10"
+  - "0.11"
+  - "0.12"
+  - "4.0"
+  - "4.1"
+  - "4.2"
+  - "5"
diff --git a/wrt/node_modules/ipaddr.js/Cakefile b/wrt/node_modules/ipaddr.js/Cakefile
new file mode 100644 (file)
index 0000000..a6de48f
--- /dev/null
@@ -0,0 +1,18 @@
+fs           = require 'fs'
+CoffeeScript = require 'coffee-script'
+nodeunit     = require 'nodeunit'
+UglifyJS     = require 'uglify-js'
+
+task 'build', 'build the JavaScript files from CoffeeScript source', build = (cb) ->
+  source = fs.readFileSync 'src/ipaddr.coffee', 'utf-8'
+  fs.writeFileSync 'lib/ipaddr.js', CoffeeScript.compile source.toString()
+
+  invoke 'test'
+  invoke 'compress'
+
+task 'test', 'run the bundled tests', (cb) ->
+  nodeunit.reporters.default.run ['test']
+
+task 'compress', 'uglify the resulting javascript', (cb) ->
+  source = fs.readFileSync 'lib/ipaddr.js', 'utf-8'
+  fs.writeFileSync('ipaddr.min.js', UglifyJS.minify(source).code)
diff --git a/wrt/node_modules/ipaddr.js/LICENSE b/wrt/node_modules/ipaddr.js/LICENSE
new file mode 100644 (file)
index 0000000..3493f0d
--- /dev/null
@@ -0,0 +1,19 @@
+Copyright (C) 2011 Peter Zotov <whitequark@whitequark.org>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
\ No newline at end of file
diff --git a/wrt/node_modules/ipaddr.js/README.md b/wrt/node_modules/ipaddr.js/README.md
new file mode 100644 (file)
index 0000000..3e0c272
--- /dev/null
@@ -0,0 +1,227 @@
+# ipaddr.js — an IPv6 and IPv4 address manipulation library [![Build Status](https://travis-ci.org/whitequark/ipaddr.js.svg)](https://travis-ci.org/whitequark/ipaddr.js)
+
+ipaddr.js is a small (1.9K minified and gzipped) library for manipulating
+IP addresses in JavaScript environments. It runs on both CommonJS runtimes
+(e.g. [nodejs]) and in a web browser.
+
+ipaddr.js allows you to verify and parse string representation of an IP
+address, match it against a CIDR range or range list, determine if it falls
+into some reserved ranges (examples include loopback and private ranges),
+and convert between IPv4 and IPv4-mapped IPv6 addresses.
+
+[nodejs]: http://nodejs.org
+
+## Installation
+
+`npm install ipaddr.js`
+
+or
+
+`bower install ipaddr.js`
+
+## API
+
+ipaddr.js defines one object in the global scope: `ipaddr`. In CommonJS,
+it is exported from the module:
+
+```js
+var ipaddr = require('ipaddr.js');
+```
+
+The API consists of several global methods and two classes: ipaddr.IPv6 and ipaddr.IPv4.
+
+### Global methods
+
+There are three global methods defined: `ipaddr.isValid`, `ipaddr.parse` and
+`ipaddr.process`. All of them receive a string as a single parameter.
+
+The `ipaddr.isValid` method returns `true` if the address is a valid IPv4 or
+IPv6 address, and `false` otherwise. It does not throw any exceptions.
+
+The `ipaddr.parse` method returns an object representing the IP address,
+or throws an `Error` if the passed string is not a valid representation of an
+IP address.
+
+The `ipaddr.process` method works just like the `ipaddr.parse` one, but it
+automatically converts IPv4-mapped IPv6 addresses to their IPv4 couterparts
+before returning. It is useful when you have a Node.js instance listening
+on an IPv6 socket, and the `net.ivp6.bindv6only` sysctl parameter (or its
+equivalent on non-Linux OS) is set to 0. In this case, you can accept IPv4
+connections on your IPv6-only socket, but the remote address will be mangled.
+Use `ipaddr.process` method to automatically demangle it.
+
+### Object representation
+
+Parsing methods return an object which descends from `ipaddr.IPv6` or
+`ipaddr.IPv4`. These objects share some properties, but most of them differ.
+
+#### Shared properties
+
+One can determine the type of address by calling `addr.kind()`. It will return
+either `"ipv6"` or `"ipv4"`.
+
+An address can be converted back to its string representation with `addr.toString()`.
+Note that this method:
+ * does not return the original string used to create the object (in fact, there is
+   no way of getting that string)
+ * returns a compact representation (when it is applicable)
+
+A `match(range, bits)` method can be used to check if the address falls into a
+certain CIDR range.
+Note that an address can be (obviously) matched only against an address of the same type.
+
+For example:
+
+```js
+var addr = ipaddr.parse("2001:db8:1234::1");
+var range = ipaddr.parse("2001:db8::");
+
+addr.match(range, 32); // => true
+```
+
+Alternatively, `match` can also be called as `match([range, bits])`. In this way,
+it can be used together with the `parseCIDR(string)` method, which parses an IP
+address together with a CIDR range.
+
+For example:
+
+```js
+var addr = ipaddr.parse("2001:db8:1234::1");
+
+addr.match(ipaddr.parseCIDR("2001:db8::/32")); // => true
+```
+
+A `range()` method returns one of predefined names for several special ranges defined
+by IP protocols. The exact names (and their respective CIDR ranges) can be looked up
+in the source: [IPv6 ranges] and [IPv4 ranges]. Some common ones include `"unicast"`
+(the default one) and `"reserved"`.
+
+You can match against your own range list by using
+`ipaddr.subnetMatch(address, rangeList, defaultName)` method. It can work with both
+IPv6 and IPv4 addresses, and accepts a name-to-subnet map as the range list. For example:
+
+```js
+var rangeList = {
+  documentationOnly: [ ipaddr.parse('2001:db8::'), 32 ],
+  tunnelProviders: [
+    [ ipaddr.parse('2001:470::'), 32 ], // he.net
+    [ ipaddr.parse('2001:5c0::'), 32 ]  // freenet6
+  ]
+};
+ipaddr.subnetMatch(ipaddr.parse('2001:470:8:66::1'), rangeList, 'unknown'); // => "he.net"
+```
+
+The addresses can be converted to their byte representation with `toByteArray()`.
+(Actually, JavaScript mostly does not know about byte buffers. They are emulated with
+arrays of numbers, each in range of 0..255.)
+
+```js
+var bytes = ipaddr.parse('2a00:1450:8007::68').toByteArray(); // ipv6.google.com
+bytes // => [42, 0x00, 0x14, 0x50, 0x80, 0x07, 0x00, <zeroes...>, 0x00, 0x68 ]
+```
+
+The `ipaddr.IPv4` and `ipaddr.IPv6` objects have some methods defined, too. All of them
+have the same interface for both protocols, and are similar to global methods.
+
+`ipaddr.IPvX.isValid(string)` can be used to check if the string is a valid address
+for particular protocol, and `ipaddr.IPvX.parse(string)` is the error-throwing parser.
+
+`ipaddr.IPvX.isValid(string)` uses the same format for parsing as the POSIX `inet_ntoa` function, which accepts unusual formats like `0xc0.168.1.1` or `0x10000000`. The function `ipaddr.IPv4.isValidFourPartDecimal(string)` validates the IPv4 address and also ensures that it is written in four-part decimal format.
+
+[IPv6 ranges]: https://github.com/whitequark/ipaddr.js/blob/master/src/ipaddr.coffee#L186
+[IPv4 ranges]: https://github.com/whitequark/ipaddr.js/blob/master/src/ipaddr.coffee#L71
+
+#### IPv6 properties
+
+Sometimes you will want to convert IPv6 not to a compact string representation (with
+the `::` substitution); the `toNormalizedString()` method will return an address where
+all zeroes are explicit.
+
+For example:
+
+```js
+var addr = ipaddr.parse("2001:0db8::0001");
+addr.toString(); // => "2001:db8::1"
+addr.toNormalizedString(); // => "2001:db8:0:0:0:0:0:1"
+```
+
+The `isIPv4MappedAddress()` method will return `true` if this address is an IPv4-mapped
+one, and `toIPv4Address()` will return an IPv4 object address.
+
+To access the underlying binary representation of the address, use `addr.parts`.
+
+```js
+var addr = ipaddr.parse("2001:db8:10::1234:DEAD");
+addr.parts // => [0x2001, 0xdb8, 0x10, 0, 0, 0, 0x1234, 0xdead]
+```
+
+#### IPv4 properties
+
+`toIPv4MappedAddress()` will return a corresponding IPv4-mapped IPv6 address.
+
+To access the underlying representation of the address, use `addr.octets`.
+
+```js
+var addr = ipaddr.parse("192.168.1.1");
+addr.octets // => [192, 168, 1, 1]
+```
+
+`prefixLengthFromSubnetMask()` will return a CIDR prefix length for a valid IPv4 netmask or
+false if the netmask is not valid.
+
+```js
+ipaddr.IPv4.parse('255.255.255.240').prefixLengthFromSubnetMask() == 28
+ipaddr.IPv4.parse('255.192.164.0').prefixLengthFromSubnetMask()  == null
+```
+
+`subnetMaskFromPrefixLength()` will return an IPv4 netmask for a valid CIDR prefix length.
+
+```js
+ipaddr.IPv4.subnetMaskFromPrefixLength("24") == "255.255.255.0"
+ipaddr.IPv4.subnetMaskFromPrefixLength("29") == "255.255.255.248"
+```
+
+`broadcastAddressFromCIDR()` will return the broadcast address for a given IPv4 interface and netmask in CIDR notation. 
+```js
+ipaddr.IPv4.broadcastAddressFromCIDR("172.0.0.1/24") == "172.0.0.255"
+```
+`networkAddressFromCIDR()` will return the network address for a given IPv4 interface and netmask in CIDR notation.
+```js
+ipaddr.IPv4.networkAddressFromCIDR("172.0.0.1/24") == "172.0.0.0"
+```
+
+#### Conversion
+
+IPv4 and IPv6 can be converted bidirectionally to and from network byte order (MSB) byte arrays.
+
+The `fromByteArray()` method will take an array and create an appropriate IPv4 or IPv6 object
+if the input satisfies the requirements. For IPv4 it has to be an array of four 8-bit values,
+while for IPv6 it has to be an array of sixteen 8-bit values.
+
+For example:
+```js
+var addr = ipaddr.fromByteArray([0x7f, 0, 0, 1]);
+addr.toString(); // => "127.0.0.1"
+```
+
+or
+
+```js
+var addr = ipaddr.fromByteArray([0x20, 1, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1])
+addr.toString(); // => "2001:db8::1"
+```
+
+Both objects also offer a `toByteArray()` method, which returns an array in network byte order (MSB).
+
+For example:
+```js
+var addr = ipaddr.parse("127.0.0.1");
+addr.toByteArray(); // => [0x7f, 0, 0, 1]
+```
+
+or
+
+```js
+var addr = ipaddr.parse("2001:db8::1");
+addr.toByteArray(); // => [0x20, 1, 0xd, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]
+```
diff --git a/wrt/node_modules/ipaddr.js/bower.json b/wrt/node_modules/ipaddr.js/bower.json
new file mode 100644 (file)
index 0000000..6ec6745
--- /dev/null
@@ -0,0 +1,29 @@
+{
+  "name": "ipaddr.js",
+  "version": "1.4.0",
+  "homepage": "https://github.com/whitequark/ipaddr.js",
+  "authors": [
+    "whitequark <whitequark@whitequark.org>"
+  ],
+  "description": "IP address manipulation library in JavaScript (CoffeeScript, actually)",
+  "main": "lib/ipaddr.js",
+  "moduleType": [
+    "globals",
+    "node"
+  ],
+  "keywords": [
+    "javscript",
+    "ip",
+    "address",
+    "ipv4",
+    "ipv6"
+  ],
+  "license": "MIT",
+  "ignore": [
+    "**/.*",
+    "node_modules",
+    "bower_components",
+    "test",
+    "tests"
+  ]
+}
diff --git a/wrt/node_modules/ipaddr.js/ipaddr.min.js b/wrt/node_modules/ipaddr.js/ipaddr.min.js
new file mode 100644 (file)
index 0000000..9e26307
--- /dev/null
@@ -0,0 +1 @@
+(function(){var r,t,e,n,i,o,a,s;t={},s=this,"undefined"!=typeof module&&null!==module&&module.exports?module.exports=t:s.ipaddr=t,a=function(r,t,e,n){var i,o;if(r.length!==t.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");for(i=0;n>0;){if((o=e-n)<0&&(o=0),r[i]>>o!=t[i]>>o)return!1;n-=e,i+=1}return!0},t.subnetMatch=function(r,t,e){var n,i,o,a,s;null==e&&(e="unicast");for(o in t)for(!(a=t[o])[0]||a[0]instanceof Array||(a=[a]),n=0,i=a.length;n<i;n++)if(s=a[n],r.match.apply(r,s))return o;return e},t.IPv4=function(){function r(r){var t,e,n;if(4!==r.length)throw new Error("ipaddr: ipv4 octet count should be 4");for(t=0,e=r.length;t<e;t++)if(!(0<=(n=r[t])&&n<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=r}return r.prototype.kind=function(){return"ipv4"},r.prototype.toString=function(){return this.octets.join(".")},r.prototype.toByteArray=function(){return this.octets.slice(0)},r.prototype.match=function(r,t){var e;if(void 0===t&&(r=(e=r)[0],t=e[1]),"ipv4"!==r.kind())throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return a(this.octets,r.octets,8,t)},r.prototype.SpecialRanges={unspecified:[[new r([0,0,0,0]),8]],broadcast:[[new r([255,255,255,255]),32]],multicast:[[new r([224,0,0,0]),4]],linkLocal:[[new r([169,254,0,0]),16]],loopback:[[new r([127,0,0,0]),8]],carrierGradeNat:[[new r([100,64,0,0]),10]],private:[[new r([10,0,0,0]),8],[new r([172,16,0,0]),12],[new r([192,168,0,0]),16]],reserved:[[new r([192,0,0,0]),24],[new r([192,0,2,0]),24],[new r([192,88,99,0]),24],[new r([198,51,100,0]),24],[new r([203,0,113,0]),24],[new r([240,0,0,0]),4]]},r.prototype.range=function(){return t.subnetMatch(this,this.SpecialRanges)},r.prototype.toIPv4MappedAddress=function(){return t.IPv6.parse("::ffff:"+this.toString())},r.prototype.prefixLengthFromSubnetMask=function(){var r,t,e,n,i,o,a;for(a={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},r=0,i=!1,t=e=3;e>=0;t=e+=-1){if(!((n=this.octets[t])in a))return null;if(o=a[n],i&&0!==o)return null;8!==o&&(i=!0),r+=o}return 32-r},r}(),e="(0?\\d+|0x[a-f0-9]+)",n={fourOctet:new RegExp("^"+e+"\\."+e+"\\."+e+"\\."+e+"$","i"),longValue:new RegExp("^"+e+"$","i")},t.IPv4.parser=function(r){var t,e,i,o,a;if(e=function(r){return"0"===r[0]&&"x"!==r[1]?parseInt(r,8):parseInt(r)},t=r.match(n.fourOctet))return function(){var r,n,o,a;for(a=[],r=0,n=(o=t.slice(1,6)).length;r<n;r++)i=o[r],a.push(e(i));return a}();if(t=r.match(n.longValue)){if((a=e(t[1]))>4294967295||a<0)throw new Error("ipaddr: address outside defined range");return function(){var r,t;for(t=[],o=r=0;r<=24;o=r+=8)t.push(a>>o&255);return t}().reverse()}return null},t.IPv6=function(){function r(r){var t,e,n,i,o,a;if(16===r.length)for(this.parts=[],t=e=0;e<=14;t=e+=2)this.parts.push(r[t]<<8|r[t+1]);else{if(8!==r.length)throw new Error("ipaddr: ipv6 part count should be 8 or 16");this.parts=r}for(n=0,i=(a=this.parts).length;n<i;n++)if(!(0<=(o=a[n])&&o<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits")}return r.prototype.kind=function(){return"ipv6"},r.prototype.toString=function(){var r,t,e,n,i,o,a;for(a=function(){var r,t,e,i;for(i=[],r=0,t=(e=this.parts).length;r<t;r++)n=e[r],i.push(n.toString(16));return i}.call(this),r=[],i=function(t){return r.push(t)},o=0,t=0,e=a.length;t<e;t++)switch(n=a[t],o){case 0:i("0"===n?"":n),o=1;break;case 1:"0"===n?o=2:i(n);break;case 2:"0"!==n&&(i(""),i(n),o=3);break;case 3:i(n)}return 2===o&&(i(""),i("")),r.join(":")},r.prototype.toByteArray=function(){var r,t,e,n,i;for(r=[],t=0,e=(i=this.parts).length;t<e;t++)n=i[t],r.push(n>>8),r.push(255&n);return r},r.prototype.toNormalizedString=function(){var r;return function(){var t,e,n,i;for(i=[],t=0,e=(n=this.parts).length;t<e;t++)r=n[t],i.push(r.toString(16));return i}.call(this).join(":")},r.prototype.match=function(r,t){var e;if(void 0===t&&(r=(e=r)[0],t=e[1]),"ipv6"!==r.kind())throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return a(this.parts,r.parts,16,t)},r.prototype.SpecialRanges={unspecified:[new r([0,0,0,0,0,0,0,0]),128],linkLocal:[new r([65152,0,0,0,0,0,0,0]),10],multicast:[new r([65280,0,0,0,0,0,0,0]),8],loopback:[new r([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new r([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new r([0,0,0,0,0,65535,0,0]),96],rfc6145:[new r([0,0,0,0,65535,0,0,0]),96],rfc6052:[new r([100,65435,0,0,0,0,0,0]),96],"6to4":[new r([8194,0,0,0,0,0,0,0]),16],teredo:[new r([8193,0,0,0,0,0,0,0]),32],reserved:[[new r([8193,3512,0,0,0,0,0,0]),32]]},r.prototype.range=function(){return t.subnetMatch(this,this.SpecialRanges)},r.prototype.isIPv4MappedAddress=function(){return"ipv4Mapped"===this.range()},r.prototype.toIPv4Address=function(){var r,e,n;if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");return n=this.parts.slice(-2),r=n[0],e=n[1],new t.IPv4([r>>8,255&r,e>>8,255&e])},r}(),i="(?:[0-9a-f]+::?)+",o={native:new RegExp("^(::)?("+i+")?([0-9a-f]+)?(::)?$","i"),transitional:new RegExp("^((?:"+i+")|(?:::)(?:"+i+")?)"+e+"\\."+e+"\\."+e+"\\."+e+"$","i")},r=function(r,t){var e,n,i,o,a;if(r.indexOf("::")!==r.lastIndexOf("::"))return null;for(e=0,n=-1;(n=r.indexOf(":",n+1))>=0;)e++;if("::"===r.substr(0,2)&&e--,"::"===r.substr(-2,2)&&e--,e>t)return null;for(a=t-e,o=":";a--;)o+="0:";return":"===(r=r.replace("::",o))[0]&&(r=r.slice(1)),":"===r[r.length-1]&&(r=r.slice(0,-1)),function(){var t,e,n,o;for(o=[],t=0,e=(n=r.split(":")).length;t<e;t++)i=n[t],o.push(parseInt(i,16));return o}()},t.IPv6.parser=function(t){var e,n,i,a,s,p;if(t.match(o.native))return r(t,8);if((i=t.match(o.transitional))&&(p=r(i[1].slice(0,-1),6))){for(e=0,n=(s=[parseInt(i[2]),parseInt(i[3]),parseInt(i[4]),parseInt(i[5])]).length;e<n;e++)if(!(0<=(a=s[e])&&a<=255))return null;return p.push(s[0]<<8|s[1]),p.push(s[2]<<8|s[3]),p}return null},t.IPv4.isIPv4=t.IPv6.isIPv6=function(r){return null!==this.parser(r)},t.IPv4.isValid=function(r){try{return new this(this.parser(r)),!0}catch(r){return r,!1}},t.IPv4.isValidFourPartDecimal=function(r){return!(!t.IPv4.isValid(r)||!r.match(/^\d+(\.\d+){3}$/))},t.IPv6.isValid=function(r){if("string"==typeof r&&-1===r.indexOf(":"))return!1;try{return new this(this.parser(r)),!0}catch(r){return r,!1}},t.IPv4.parse=t.IPv6.parse=function(r){var t;if(null===(t=this.parser(r)))throw new Error("ipaddr: string is not formatted like ip address");return new this(t)},t.IPv4.parseCIDR=function(r){var t,e;if((e=r.match(/^(.+)\/(\d+)$/))&&(t=parseInt(e[2]))>=0&&t<=32)return[this.parse(e[1]),t];throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},t.IPv4.subnetMaskFromPrefixLength=function(r){var e,n;if(r<0||r>32)throw new Error("ipaddr: invalid prefix length");for(n=Array(4).fill(0),e=0;e<Math.floor(r/8);)n[e]=255,e++;return n[Math.floor(r/8)]=Math.pow(2,r%8)-1<<8-r%8,new t.IPv4(n)},t.IPv4.broadcastAddressFromCIDR=function(r){var e,n,i,o;try{for(n=t.IPv4.parseCIDR(r)[0],o=this.subnetMaskFromPrefixLength([t.IPv4.parseCIDR(r)[1]]),i=[],e=0;e<4;)i.push(parseInt(n.octets[e],10)|255^parseInt(o.octets[e],10)),e++;return new t.IPv4(i)}catch(r){throw r,new Error("ipaddr: the address does not have IPv4 CIDR format")}},t.IPv4.networkAddressFromCIDR=function(r){var e,n,i,o;try{for(n=t.IPv4.parseCIDR(r)[0],o=this.subnetMaskFromPrefixLength([t.IPv4.parseCIDR(r)[1]]),i=[],e=0;e<4;)i.push(parseInt(n.octets[e],10)&parseInt(o.octets[e],10)),e++;return new t.IPv4(i)}catch(r){throw r,new Error("ipaddr: the address does not have IPv4 CIDR format")}},t.IPv6.parseCIDR=function(r){var t,e;if((e=r.match(/^(.+)\/(\d+)$/))&&(t=parseInt(e[2]))>=0&&t<=128)return[this.parse(e[1]),t];throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},t.isValid=function(r){return t.IPv6.isValid(r)||t.IPv4.isValid(r)},t.parse=function(r){if(t.IPv6.isValid(r))return t.IPv6.parse(r);if(t.IPv4.isValid(r))return t.IPv4.parse(r);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},t.parseCIDR=function(r){try{return t.IPv6.parseCIDR(r)}catch(e){e;try{return t.IPv4.parseCIDR(r)}catch(r){throw r,new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},t.fromByteArray=function(r){var e;if(4===(e=r.length))return new t.IPv4(r);if(16===e)return new t.IPv6(r);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},t.process=function(r){var t;return t=this.parse(r),"ipv6"===t.kind()&&t.isIPv4MappedAddress()?t.toIPv4Address():t}}).call(this);
\ No newline at end of file
diff --git a/wrt/node_modules/ipaddr.js/lib/ipaddr.js b/wrt/node_modules/ipaddr.js/lib/ipaddr.js
new file mode 100644 (file)
index 0000000..6b985ac
--- /dev/null
@@ -0,0 +1,586 @@
+(function() {
+  var expandIPv6, ipaddr, ipv4Part, ipv4Regexes, ipv6Part, ipv6Regexes, matchCIDR, root;
+
+  ipaddr = {};
+
+  root = this;
+
+  if ((typeof module !== "undefined" && module !== null) && module.exports) {
+    module.exports = ipaddr;
+  } else {
+    root['ipaddr'] = ipaddr;
+  }
+
+  matchCIDR = function(first, second, partSize, cidrBits) {
+    var part, shift;
+    if (first.length !== second.length) {
+      throw new Error("ipaddr: cannot match CIDR for objects with different lengths");
+    }
+    part = 0;
+    while (cidrBits > 0) {
+      shift = partSize - cidrBits;
+      if (shift < 0) {
+        shift = 0;
+      }
+      if (first[part] >> shift !== second[part] >> shift) {
+        return false;
+      }
+      cidrBits -= partSize;
+      part += 1;
+    }
+    return true;
+  };
+
+  ipaddr.subnetMatch = function(address, rangeList, defaultName) {
+    var k, len, rangeName, rangeSubnets, subnet;
+    if (defaultName == null) {
+      defaultName = 'unicast';
+    }
+    for (rangeName in rangeList) {
+      rangeSubnets = rangeList[rangeName];
+      if (rangeSubnets[0] && !(rangeSubnets[0] instanceof Array)) {
+        rangeSubnets = [rangeSubnets];
+      }
+      for (k = 0, len = rangeSubnets.length; k < len; k++) {
+        subnet = rangeSubnets[k];
+        if (address.match.apply(address, subnet)) {
+          return rangeName;
+        }
+      }
+    }
+    return defaultName;
+  };
+
+  ipaddr.IPv4 = (function() {
+    function IPv4(octets) {
+      var k, len, octet;
+      if (octets.length !== 4) {
+        throw new Error("ipaddr: ipv4 octet count should be 4");
+      }
+      for (k = 0, len = octets.length; k < len; k++) {
+        octet = octets[k];
+        if (!((0 <= octet && octet <= 255))) {
+          throw new Error("ipaddr: ipv4 octet should fit in 8 bits");
+        }
+      }
+      this.octets = octets;
+    }
+
+    IPv4.prototype.kind = function() {
+      return 'ipv4';
+    };
+
+    IPv4.prototype.toString = function() {
+      return this.octets.join(".");
+    };
+
+    IPv4.prototype.toByteArray = function() {
+      return this.octets.slice(0);
+    };
+
+    IPv4.prototype.match = function(other, cidrRange) {
+      var ref;
+      if (cidrRange === void 0) {
+        ref = other, other = ref[0], cidrRange = ref[1];
+      }
+      if (other.kind() !== 'ipv4') {
+        throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");
+      }
+      return matchCIDR(this.octets, other.octets, 8, cidrRange);
+    };
+
+    IPv4.prototype.SpecialRanges = {
+      unspecified: [[new IPv4([0, 0, 0, 0]), 8]],
+      broadcast: [[new IPv4([255, 255, 255, 255]), 32]],
+      multicast: [[new IPv4([224, 0, 0, 0]), 4]],
+      linkLocal: [[new IPv4([169, 254, 0, 0]), 16]],
+      loopback: [[new IPv4([127, 0, 0, 0]), 8]],
+      carrierGradeNat: [[new IPv4([100, 64, 0, 0]), 10]],
+      "private": [[new IPv4([10, 0, 0, 0]), 8], [new IPv4([172, 16, 0, 0]), 12], [new IPv4([192, 168, 0, 0]), 16]],
+      reserved: [[new IPv4([192, 0, 0, 0]), 24], [new IPv4([192, 0, 2, 0]), 24], [new IPv4([192, 88, 99, 0]), 24], [new IPv4([198, 51, 100, 0]), 24], [new IPv4([203, 0, 113, 0]), 24], [new IPv4([240, 0, 0, 0]), 4]]
+    };
+
+    IPv4.prototype.range = function() {
+      return ipaddr.subnetMatch(this, this.SpecialRanges);
+    };
+
+    IPv4.prototype.toIPv4MappedAddress = function() {
+      return ipaddr.IPv6.parse("::ffff:" + (this.toString()));
+    };
+
+    IPv4.prototype.prefixLengthFromSubnetMask = function() {
+      var cidr, i, k, octet, stop, zeros, zerotable;
+      zerotable = {
+        0: 8,
+        128: 7,
+        192: 6,
+        224: 5,
+        240: 4,
+        248: 3,
+        252: 2,
+        254: 1,
+        255: 0
+      };
+      cidr = 0;
+      stop = false;
+      for (i = k = 3; k >= 0; i = k += -1) {
+        octet = this.octets[i];
+        if (octet in zerotable) {
+          zeros = zerotable[octet];
+          if (stop && zeros !== 0) {
+            return null;
+          }
+          if (zeros !== 8) {
+            stop = true;
+          }
+          cidr += zeros;
+        } else {
+          return null;
+        }
+      }
+      return 32 - cidr;
+    };
+
+    return IPv4;
+
+  })();
+
+  ipv4Part = "(0?\\d+|0x[a-f0-9]+)";
+
+  ipv4Regexes = {
+    fourOctet: new RegExp("^" + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "$", 'i'),
+    longValue: new RegExp("^" + ipv4Part + "$", 'i')
+  };
+
+  ipaddr.IPv4.parser = function(string) {
+    var match, parseIntAuto, part, shift, value;
+    parseIntAuto = function(string) {
+      if (string[0] === "0" && string[1] !== "x") {
+        return parseInt(string, 8);
+      } else {
+        return parseInt(string);
+      }
+    };
+    if (match = string.match(ipv4Regexes.fourOctet)) {
+      return (function() {
+        var k, len, ref, results;
+        ref = match.slice(1, 6);
+        results = [];
+        for (k = 0, len = ref.length; k < len; k++) {
+          part = ref[k];
+          results.push(parseIntAuto(part));
+        }
+        return results;
+      })();
+    } else if (match = string.match(ipv4Regexes.longValue)) {
+      value = parseIntAuto(match[1]);
+      if (value > 0xffffffff || value < 0) {
+        throw new Error("ipaddr: address outside defined range");
+      }
+      return ((function() {
+        var k, results;
+        results = [];
+        for (shift = k = 0; k <= 24; shift = k += 8) {
+          results.push((value >> shift) & 0xff);
+        }
+        return results;
+      })()).reverse();
+    } else {
+      return null;
+    }
+  };
+
+  ipaddr.IPv6 = (function() {
+    function IPv6(parts) {
+      var i, k, l, len, part, ref;
+      if (parts.length === 16) {
+        this.parts = [];
+        for (i = k = 0; k <= 14; i = k += 2) {
+          this.parts.push((parts[i] << 8) | parts[i + 1]);
+        }
+      } else if (parts.length === 8) {
+        this.parts = parts;
+      } else {
+        throw new Error("ipaddr: ipv6 part count should be 8 or 16");
+      }
+      ref = this.parts;
+      for (l = 0, len = ref.length; l < len; l++) {
+        part = ref[l];
+        if (!((0 <= part && part <= 0xffff))) {
+          throw new Error("ipaddr: ipv6 part should fit in 16 bits");
+        }
+      }
+    }
+
+    IPv6.prototype.kind = function() {
+      return 'ipv6';
+    };
+
+    IPv6.prototype.toString = function() {
+      var compactStringParts, k, len, part, pushPart, state, stringParts;
+      stringParts = (function() {
+        var k, len, ref, results;
+        ref = this.parts;
+        results = [];
+        for (k = 0, len = ref.length; k < len; k++) {
+          part = ref[k];
+          results.push(part.toString(16));
+        }
+        return results;
+      }).call(this);
+      compactStringParts = [];
+      pushPart = function(part) {
+        return compactStringParts.push(part);
+      };
+      state = 0;
+      for (k = 0, len = stringParts.length; k < len; k++) {
+        part = stringParts[k];
+        switch (state) {
+          case 0:
+            if (part === '0') {
+              pushPart('');
+            } else {
+              pushPart(part);
+            }
+            state = 1;
+            break;
+          case 1:
+            if (part === '0') {
+              state = 2;
+            } else {
+              pushPart(part);
+            }
+            break;
+          case 2:
+            if (part !== '0') {
+              pushPart('');
+              pushPart(part);
+              state = 3;
+            }
+            break;
+          case 3:
+            pushPart(part);
+        }
+      }
+      if (state === 2) {
+        pushPart('');
+        pushPart('');
+      }
+      return compactStringParts.join(":");
+    };
+
+    IPv6.prototype.toByteArray = function() {
+      var bytes, k, len, part, ref;
+      bytes = [];
+      ref = this.parts;
+      for (k = 0, len = ref.length; k < len; k++) {
+        part = ref[k];
+        bytes.push(part >> 8);
+        bytes.push(part & 0xff);
+      }
+      return bytes;
+    };
+
+    IPv6.prototype.toNormalizedString = function() {
+      var part;
+      return ((function() {
+        var k, len, ref, results;
+        ref = this.parts;
+        results = [];
+        for (k = 0, len = ref.length; k < len; k++) {
+          part = ref[k];
+          results.push(part.toString(16));
+        }
+        return results;
+      }).call(this)).join(":");
+    };
+
+    IPv6.prototype.match = function(other, cidrRange) {
+      var ref;
+      if (cidrRange === void 0) {
+        ref = other, other = ref[0], cidrRange = ref[1];
+      }
+      if (other.kind() !== 'ipv6') {
+        throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");
+      }
+      return matchCIDR(this.parts, other.parts, 16, cidrRange);
+    };
+
+    IPv6.prototype.SpecialRanges = {
+      unspecified: [new IPv6([0, 0, 0, 0, 0, 0, 0, 0]), 128],
+      linkLocal: [new IPv6([0xfe80, 0, 0, 0, 0, 0, 0, 0]), 10],
+      multicast: [new IPv6([0xff00, 0, 0, 0, 0, 0, 0, 0]), 8],
+      loopback: [new IPv6([0, 0, 0, 0, 0, 0, 0, 1]), 128],
+      uniqueLocal: [new IPv6([0xfc00, 0, 0, 0, 0, 0, 0, 0]), 7],
+      ipv4Mapped: [new IPv6([0, 0, 0, 0, 0, 0xffff, 0, 0]), 96],
+      rfc6145: [new IPv6([0, 0, 0, 0, 0xffff, 0, 0, 0]), 96],
+      rfc6052: [new IPv6([0x64, 0xff9b, 0, 0, 0, 0, 0, 0]), 96],
+      '6to4': [new IPv6([0x2002, 0, 0, 0, 0, 0, 0, 0]), 16],
+      teredo: [new IPv6([0x2001, 0, 0, 0, 0, 0, 0, 0]), 32],
+      reserved: [[new IPv6([0x2001, 0xdb8, 0, 0, 0, 0, 0, 0]), 32]]
+    };
+
+    IPv6.prototype.range = function() {
+      return ipaddr.subnetMatch(this, this.SpecialRanges);
+    };
+
+    IPv6.prototype.isIPv4MappedAddress = function() {
+      return this.range() === 'ipv4Mapped';
+    };
+
+    IPv6.prototype.toIPv4Address = function() {
+      var high, low, ref;
+      if (!this.isIPv4MappedAddress()) {
+        throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");
+      }
+      ref = this.parts.slice(-2), high = ref[0], low = ref[1];
+      return new ipaddr.IPv4([high >> 8, high & 0xff, low >> 8, low & 0xff]);
+    };
+
+    return IPv6;
+
+  })();
+
+  ipv6Part = "(?:[0-9a-f]+::?)+";
+
+  ipv6Regexes = {
+    "native": new RegExp("^(::)?(" + ipv6Part + ")?([0-9a-f]+)?(::)?$", 'i'),
+    transitional: new RegExp(("^((?:" + ipv6Part + ")|(?:::)(?:" + ipv6Part + ")?)") + (ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "$"), 'i')
+  };
+
+  expandIPv6 = function(string, parts) {
+    var colonCount, lastColon, part, replacement, replacementCount;
+    if (string.indexOf('::') !== string.lastIndexOf('::')) {
+      return null;
+    }
+    colonCount = 0;
+    lastColon = -1;
+    while ((lastColon = string.indexOf(':', lastColon + 1)) >= 0) {
+      colonCount++;
+    }
+    if (string.substr(0, 2) === '::') {
+      colonCount--;
+    }
+    if (string.substr(-2, 2) === '::') {
+      colonCount--;
+    }
+    if (colonCount > parts) {
+      return null;
+    }
+    replacementCount = parts - colonCount;
+    replacement = ':';
+    while (replacementCount--) {
+      replacement += '0:';
+    }
+    string = string.replace('::', replacement);
+    if (string[0] === ':') {
+      string = string.slice(1);
+    }
+    if (string[string.length - 1] === ':') {
+      string = string.slice(0, -1);
+    }
+    return (function() {
+      var k, len, ref, results;
+      ref = string.split(":");
+      results = [];
+      for (k = 0, len = ref.length; k < len; k++) {
+        part = ref[k];
+        results.push(parseInt(part, 16));
+      }
+      return results;
+    })();
+  };
+
+  ipaddr.IPv6.parser = function(string) {
+    var k, len, match, octet, octets, parts;
+    if (string.match(ipv6Regexes['native'])) {
+      return expandIPv6(string, 8);
+    } else if (match = string.match(ipv6Regexes['transitional'])) {
+      parts = expandIPv6(match[1].slice(0, -1), 6);
+      if (parts) {
+        octets = [parseInt(match[2]), parseInt(match[3]), parseInt(match[4]), parseInt(match[5])];
+        for (k = 0, len = octets.length; k < len; k++) {
+          octet = octets[k];
+          if (!((0 <= octet && octet <= 255))) {
+            return null;
+          }
+        }
+        parts.push(octets[0] << 8 | octets[1]);
+        parts.push(octets[2] << 8 | octets[3]);
+        return parts;
+      }
+    }
+    return null;
+  };
+
+  ipaddr.IPv4.isIPv4 = ipaddr.IPv6.isIPv6 = function(string) {
+    return this.parser(string) !== null;
+  };
+
+  ipaddr.IPv4.isValid = function(string) {
+    var e;
+    try {
+      new this(this.parser(string));
+      return true;
+    } catch (error1) {
+      e = error1;
+      return false;
+    }
+  };
+
+  ipaddr.IPv4.isValidFourPartDecimal = function(string) {
+    if (ipaddr.IPv4.isValid(string) && string.match(/^\d+(\.\d+){3}$/)) {
+      return true;
+    } else {
+      return false;
+    }
+  };
+
+  ipaddr.IPv6.isValid = function(string) {
+    var e;
+    if (typeof string === "string" && string.indexOf(":") === -1) {
+      return false;
+    }
+    try {
+      new this(this.parser(string));
+      return true;
+    } catch (error1) {
+      e = error1;
+      return false;
+    }
+  };
+
+  ipaddr.IPv4.parse = ipaddr.IPv6.parse = function(string) {
+    var parts;
+    parts = this.parser(string);
+    if (parts === null) {
+      throw new Error("ipaddr: string is not formatted like ip address");
+    }
+    return new this(parts);
+  };
+
+  ipaddr.IPv4.parseCIDR = function(string) {
+    var maskLength, match;
+    if (match = string.match(/^(.+)\/(\d+)$/)) {
+      maskLength = parseInt(match[2]);
+      if (maskLength >= 0 && maskLength <= 32) {
+        return [this.parse(match[1]), maskLength];
+      }
+    }
+    throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range");
+  };
+
+  ipaddr.IPv4.subnetMaskFromPrefixLength = function(prefix) {
+    var j, octets;
+    if (prefix < 0 || prefix > 32) {
+      throw new Error('ipaddr: invalid prefix length');
+    }
+    octets = Array(4).fill(0);
+    j = 0;
+    while (j < Math.floor(prefix / 8)) {
+      octets[j] = 255;
+      j++;
+    }
+    octets[Math.floor(prefix / 8)] = Math.pow(2, prefix % 8) - 1 << 8 - (prefix % 8);
+    return new ipaddr.IPv4(octets);
+  };
+
+  ipaddr.IPv4.broadcastAddressFromCIDR = function(string) {
+    var error, i, ipInterface, octets, subnetMask;
+    try {
+      ipInterface = ipaddr.IPv4.parseCIDR(string)[0];
+      subnetMask = this.subnetMaskFromPrefixLength([ipaddr.IPv4.parseCIDR(string)[1]]);
+      octets = [];
+      i = 0;
+      while (i < 4) {
+        octets.push(parseInt(ipInterface.octets[i], 10) | parseInt(subnetMask.octets[i], 10) ^ 255);
+        i++;
+      }
+      return new ipaddr.IPv4(octets);
+    } catch (error1) {
+      error = error1;
+      throw new Error('ipaddr: the address does not have IPv4 CIDR format');
+    }
+  };
+
+  ipaddr.IPv4.networkAddressFromCIDR = function(string) {
+    var error, i, ipInterface, octets, subnetMask;
+    try {
+      ipInterface = ipaddr.IPv4.parseCIDR(string)[0];
+      subnetMask = this.subnetMaskFromPrefixLength([ipaddr.IPv4.parseCIDR(string)[1]]);
+      octets = [];
+      i = 0;
+      while (i < 4) {
+        octets.push(parseInt(ipInterface.octets[i], 10) & parseInt(subnetMask.octets[i], 10));
+        i++;
+      }
+      return new ipaddr.IPv4(octets);
+    } catch (error1) {
+      error = error1;
+      throw new Error('ipaddr: the address does not have IPv4 CIDR format');
+    }
+  };
+
+  ipaddr.IPv6.parseCIDR = function(string) {
+    var maskLength, match;
+    if (match = string.match(/^(.+)\/(\d+)$/)) {
+      maskLength = parseInt(match[2]);
+      if (maskLength >= 0 && maskLength <= 128) {
+        return [this.parse(match[1]), maskLength];
+      }
+    }
+    throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range");
+  };
+
+  ipaddr.isValid = function(string) {
+    return ipaddr.IPv6.isValid(string) || ipaddr.IPv4.isValid(string);
+  };
+
+  ipaddr.parse = function(string) {
+    if (ipaddr.IPv6.isValid(string)) {
+      return ipaddr.IPv6.parse(string);
+    } else if (ipaddr.IPv4.isValid(string)) {
+      return ipaddr.IPv4.parse(string);
+    } else {
+      throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format");
+    }
+  };
+
+  ipaddr.parseCIDR = function(string) {
+    var e;
+    try {
+      return ipaddr.IPv6.parseCIDR(string);
+    } catch (error1) {
+      e = error1;
+      try {
+        return ipaddr.IPv4.parseCIDR(string);
+      } catch (error1) {
+        e = error1;
+        throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format");
+      }
+    }
+  };
+
+  ipaddr.fromByteArray = function(bytes) {
+    var length;
+    length = bytes.length;
+    if (length === 4) {
+      return new ipaddr.IPv4(bytes);
+    } else if (length === 16) {
+      return new ipaddr.IPv6(bytes);
+    } else {
+      throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address");
+    }
+  };
+
+  ipaddr.process = function(string) {
+    var addr;
+    addr = this.parse(string);
+    if (addr.kind() === 'ipv6' && addr.isIPv4MappedAddress()) {
+      return addr.toIPv4Address();
+    } else {
+      return addr;
+    }
+  };
+
+}).call(this);
diff --git a/wrt/node_modules/ipaddr.js/package.json b/wrt/node_modules/ipaddr.js/package.json
new file mode 100644 (file)
index 0000000..61adae7
--- /dev/null
@@ -0,0 +1,97 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "ipaddr.js@1.4.0",
+        "scope": null,
+        "escapedName": "ipaddr.js",
+        "name": "ipaddr.js",
+        "rawSpec": "1.4.0",
+        "spec": "1.4.0",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/proxy-addr"
+    ]
+  ],
+  "_from": "ipaddr.js@1.4.0",
+  "_id": "ipaddr.js@1.4.0",
+  "_inCache": true,
+  "_location": "/ipaddr.js",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/ipaddr.js-1.4.0.tgz_1498164481108_0.6096577865537256"
+  },
+  "_npmUser": {
+    "name": "whitequark",
+    "email": "whitequark@whitequark.org"
+  },
+  "_npmVersion": "1.4.21",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "ipaddr.js@1.4.0",
+    "scope": null,
+    "escapedName": "ipaddr.js",
+    "name": "ipaddr.js",
+    "rawSpec": "1.4.0",
+    "spec": "1.4.0",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/proxy-addr"
+  ],
+  "_resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.4.0.tgz",
+  "_shasum": "296aca878a821816e5b85d0a285a99bcff4582f0",
+  "_shrinkwrap": null,
+  "_spec": "ipaddr.js@1.4.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/proxy-addr",
+  "author": {
+    "name": "whitequark",
+    "email": "whitequark@whitequark.org"
+  },
+  "bugs": {
+    "url": "https://github.com/whitequark/ipaddr.js/issues"
+  },
+  "dependencies": {},
+  "description": "A library for manipulating IPv4 and IPv6 addresses in JavaScript.",
+  "devDependencies": {
+    "coffee-script": "~1.12.6",
+    "nodeunit": ">=0.8.2 <0.8.7",
+    "uglify-js": "~3.0.19"
+  },
+  "directories": {
+    "lib": "./lib"
+  },
+  "dist": {
+    "shasum": "296aca878a821816e5b85d0a285a99bcff4582f0",
+    "tarball": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.4.0.tgz"
+  },
+  "engines": {
+    "node": ">= 0.10"
+  },
+  "gitHead": "e0f2a074f47c51941cbfd26cf38a327f847e6286",
+  "homepage": "https://github.com/whitequark/ipaddr.js#readme",
+  "keywords": [
+    "ip",
+    "ipv4",
+    "ipv6"
+  ],
+  "license": "MIT",
+  "main": "./lib/ipaddr",
+  "maintainers": [
+    {
+      "name": "whitequark",
+      "email": "whitequark@whitequark.org"
+    }
+  ],
+  "name": "ipaddr.js",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/whitequark/ipaddr.js.git"
+  },
+  "scripts": {
+    "test": "cake build test"
+  },
+  "version": "1.4.0"
+}
diff --git a/wrt/node_modules/ipaddr.js/src/ipaddr.coffee b/wrt/node_modules/ipaddr.js/src/ipaddr.coffee
new file mode 100644 (file)
index 0000000..97ac999
--- /dev/null
@@ -0,0 +1,504 @@
+# Define the main object
+ipaddr = {}
+
+root = this
+
+# Export for both the CommonJS and browser-like environment
+if module? && module.exports
+  module.exports = ipaddr
+else
+  root['ipaddr'] = ipaddr
+
+# A generic CIDR (Classless Inter-Domain Routing) RFC1518 range matcher.
+matchCIDR = (first, second, partSize, cidrBits) ->
+  if first.length != second.length
+    throw new Error "ipaddr: cannot match CIDR for objects with different lengths"
+
+  part = 0
+  while cidrBits > 0
+    shift = partSize - cidrBits
+    shift = 0 if shift < 0
+
+    if first[part] >> shift != second[part] >> shift
+      return false
+
+    cidrBits -= partSize
+    part     += 1
+
+  return true
+
+# An utility function to ease named range matching. See examples below.
+ipaddr.subnetMatch = (address, rangeList, defaultName='unicast') ->
+  for rangeName, rangeSubnets of rangeList
+    # ECMA5 Array.isArray isn't available everywhere
+    if rangeSubnets[0] && !(rangeSubnets[0] instanceof Array)
+      rangeSubnets = [ rangeSubnets ]
+
+    for subnet in rangeSubnets
+      return rangeName if address.match.apply(address, subnet)
+
+  return defaultName
+
+# An IPv4 address (RFC791).
+class ipaddr.IPv4
+  # Constructs a new IPv4 address from an array of four octets
+  # in network order (MSB first)
+  # Verifies the input.
+  constructor: (octets) ->
+    if octets.length != 4
+      throw new Error "ipaddr: ipv4 octet count should be 4"
+
+    for octet in octets
+      if !(0 <= octet <= 255)
+        throw new Error "ipaddr: ipv4 octet should fit in 8 bits"
+
+    @octets = octets
+
+  # The 'kind' method exists on both IPv4 and IPv6 classes.
+  kind: ->
+    return 'ipv4'
+
+  # Returns the address in convenient, decimal-dotted format.
+  toString: ->
+    return @octets.join "."
+
+  # Returns an array of byte-sized values in network order (MSB first)
+  toByteArray: ->
+    return @octets.slice(0) # octets.clone
+
+  # Checks if this address matches other one within given CIDR range.
+  match: (other, cidrRange) ->
+    if cidrRange == undefined
+      [other, cidrRange] = other
+
+    if other.kind() != 'ipv4'
+      throw new Error "ipaddr: cannot match ipv4 address with non-ipv4 one"
+
+    return matchCIDR(this.octets, other.octets, 8, cidrRange)
+
+  # Special IPv4 address ranges.
+  # See also https://en.wikipedia.org/wiki/Reserved_IP_addresses
+  SpecialRanges:
+    unspecified: [
+      [ new IPv4([0,     0,    0,   0]),  8 ]
+    ]
+    broadcast: [
+      [ new IPv4([255, 255,  255, 255]), 32 ]
+    ]
+    multicast: [ # RFC3171
+      [ new IPv4([224,   0,    0,   0]), 4  ]
+    ]
+    linkLocal: [ # RFC3927
+      [ new IPv4([169,   254,  0,   0]), 16 ]
+    ]
+    loopback: [ # RFC5735
+      [ new IPv4([127,   0,    0,   0]), 8  ]
+    ]
+    carrierGradeNat: [ # RFC6598
+      [ new IPv4([100,   64,   0,   0]), 10 ]
+    ]
+    private: [ # RFC1918
+      [ new IPv4([10,    0,    0,   0]), 8  ]
+      [ new IPv4([172,   16,   0,   0]), 12 ]
+      [ new IPv4([192,   168,  0,   0]), 16 ]
+    ]
+    reserved: [ # Reserved and testing-only ranges; RFCs 5735, 5737, 2544, 1700
+      [ new IPv4([192,   0,    0,   0]), 24 ]
+      [ new IPv4([192,   0,    2,   0]), 24 ]
+      [ new IPv4([192,  88,   99,   0]), 24 ]
+      [ new IPv4([198,  51,  100,   0]), 24 ]
+      [ new IPv4([203,   0,  113,   0]), 24 ]
+      [ new IPv4([240,   0,    0,   0]), 4  ]
+    ]
+
+  # Checks if the address corresponds to one of the special ranges.
+  range: ->
+    return ipaddr.subnetMatch(this, @SpecialRanges)
+
+  # Convrets this IPv4 address to an IPv4-mapped IPv6 address.
+  toIPv4MappedAddress: ->
+    return ipaddr.IPv6.parse "::ffff:#{@toString()}"
+
+  # returns a number of leading ones in IPv4 address, making sure that
+  # the rest is a solid sequence of 0's (valid netmask)
+  # returns either the CIDR length or null if mask is not valid
+  prefixLengthFromSubnetMask: ->
+    # number of zeroes in octet
+    zerotable =
+      0:   8
+      128: 7
+      192: 6
+      224: 5
+      240: 4
+      248: 3
+      252: 2
+      254: 1
+      255: 0
+
+    cidr = 0
+    # non-zero encountered stop scanning for zeroes
+    stop = false
+    for i in [3..0] by -1
+      octet = @octets[i]
+      if octet of zerotable
+        zeros = zerotable[octet]
+        if stop and zeros != 0
+          return null
+        unless zeros == 8
+          stop = true
+        cidr += zeros
+      else
+        return null
+    return 32 - cidr
+
+# A list of regular expressions that match arbitrary IPv4 addresses,
+# for which a number of weird notations exist.
+# Note that an address like 0010.0xa5.1.1 is considered legal.
+ipv4Part = "(0?\\d+|0x[a-f0-9]+)"
+ipv4Regexes =
+  fourOctet: new RegExp "^#{ipv4Part}\\.#{ipv4Part}\\.#{ipv4Part}\\.#{ipv4Part}$", 'i'
+  longValue: new RegExp "^#{ipv4Part}$", 'i'
+
+# Classful variants (like a.b, where a is an octet, and b is a 24-bit
+# value representing last three octets; this corresponds to a class C
+# address) are omitted due to classless nature of modern Internet.
+ipaddr.IPv4.parser = (string) ->
+  parseIntAuto = (string) ->
+    if string[0] == "0" && string[1] != "x"
+      parseInt(string, 8)
+    else
+      parseInt(string)
+
+  # parseInt recognizes all that octal & hexadecimal weirdness for us
+  if match = string.match(ipv4Regexes.fourOctet)
+    return (parseIntAuto(part) for part in match[1..5])
+  else if match = string.match(ipv4Regexes.longValue)
+    value = parseIntAuto(match[1])
+    if value > 0xffffffff || value < 0
+      throw new Error "ipaddr: address outside defined range"
+    return ((value >> shift) & 0xff for shift in [0..24] by 8).reverse()
+  else
+    return null
+
+# An IPv6 address (RFC2460)
+class ipaddr.IPv6
+  # Constructs an IPv6 address from an array of eight 16-bit parts
+  # or sixteen 8-bit parts in network order (MSB first).
+  # Throws an error if the input is invalid.
+  constructor: (parts) ->
+    if parts.length == 16
+      @parts = []
+      for i in [0..14] by 2
+        @parts.push((parts[i] << 8) | parts[i + 1])
+    else if parts.length == 8
+      @parts = parts
+    else
+      throw new Error "ipaddr: ipv6 part count should be 8 or 16"
+
+    for part in @parts
+      if !(0 <= part <= 0xffff)
+        throw new Error "ipaddr: ipv6 part should fit in 16 bits"
+
+  # The 'kind' method exists on both IPv4 and IPv6 classes.
+  kind: ->
+    return 'ipv6'
+
+  # Returns the address in compact, human-readable format like
+  # 2001:db8:8:66::1
+  toString: ->
+    stringParts = (part.toString(16) for part in @parts)
+
+    compactStringParts = []
+    pushPart = (part) -> compactStringParts.push part
+
+    state = 0
+    for part in stringParts
+      switch state
+        when 0
+          if part == '0'
+            pushPart('')
+          else
+            pushPart(part)
+
+          state = 1
+        when 1
+          if part == '0'
+            state = 2
+          else
+            pushPart(part)
+        when 2
+          unless part == '0'
+            pushPart('')
+            pushPart(part)
+            state = 3
+        when 3
+          pushPart(part)
+
+    if state == 2
+      pushPart('')
+      pushPart('')
+
+    return compactStringParts.join ":"
+
+  # Returns an array of byte-sized values in network order (MSB first)
+  toByteArray: ->
+    bytes = []
+    for part in @parts
+      bytes.push(part >> 8)
+      bytes.push(part & 0xff)
+
+    return bytes
+
+  # Returns the address in expanded format with all zeroes included, like
+  # 2001:db8:8:66:0:0:0:1
+  toNormalizedString: ->
+    return (part.toString(16) for part in @parts).join ":"
+
+  # Checks if this address matches other one within given CIDR range.
+  match: (other, cidrRange) ->
+    if cidrRange == undefined
+      [other, cidrRange] = other
+
+    if other.kind() != 'ipv6'
+      throw new Error "ipaddr: cannot match ipv6 address with non-ipv6 one"
+
+    return matchCIDR(this.parts, other.parts, 16, cidrRange)
+
+  # Special IPv6 ranges
+  SpecialRanges:
+    unspecified: [ new IPv6([0,      0,      0, 0, 0,      0,      0, 0]), 128 ] # RFC4291, here and after
+    linkLocal:   [ new IPv6([0xfe80, 0,      0, 0, 0,      0,      0, 0]), 10  ]
+    multicast:   [ new IPv6([0xff00, 0,      0, 0, 0,      0,      0, 0]), 8   ]
+    loopback:    [ new IPv6([0,      0,      0, 0, 0,      0,      0, 1]), 128 ]
+    uniqueLocal: [ new IPv6([0xfc00, 0,      0, 0, 0,      0,      0, 0]), 7   ]
+    ipv4Mapped:  [ new IPv6([0,      0,      0, 0, 0,      0xffff, 0, 0]), 96  ]
+    rfc6145:     [ new IPv6([0,      0,      0, 0, 0xffff, 0,      0, 0]), 96  ] # RFC6145
+    rfc6052:     [ new IPv6([0x64,   0xff9b, 0, 0, 0,      0,      0, 0]), 96  ] # RFC6052
+    '6to4':      [ new IPv6([0x2002, 0,      0, 0, 0,      0,      0, 0]), 16  ] # RFC3056
+    teredo:      [ new IPv6([0x2001, 0,      0, 0, 0,      0,      0, 0]), 32  ] # RFC6052, RFC6146
+    reserved: [
+      [ new IPv6([ 0x2001, 0xdb8, 0, 0, 0, 0, 0, 0]), 32 ] # RFC4291
+    ]
+
+  # Checks if the address corresponds to one of the special ranges.
+  range: ->
+    return ipaddr.subnetMatch(this, @SpecialRanges)
+
+  # Checks if this address is an IPv4-mapped IPv6 address.
+  isIPv4MappedAddress: ->
+    return @range() == 'ipv4Mapped'
+
+  # Converts this address to IPv4 address if it is an IPv4-mapped IPv6 address.
+  # Throws an error otherwise.
+  toIPv4Address: ->
+    unless @isIPv4MappedAddress()
+      throw new Error "ipaddr: trying to convert a generic ipv6 address to ipv4"
+
+    [high, low] = @parts[-2..-1]
+
+    return new ipaddr.IPv4([high >> 8, high & 0xff, low >> 8, low & 0xff])
+
+# IPv6-matching regular expressions.
+# For IPv6, the task is simpler: it is enough to match the colon-delimited
+# hexadecimal IPv6 and a transitional variant with dotted-decimal IPv4 at
+# the end.
+ipv6Part = "(?:[0-9a-f]+::?)+"
+ipv6Regexes =
+  native:       new RegExp "^(::)?(#{ipv6Part})?([0-9a-f]+)?(::)?$", 'i'
+  transitional: new RegExp "^((?:#{ipv6Part})|(?:::)(?:#{ipv6Part})?)" +
+                           "#{ipv4Part}\\.#{ipv4Part}\\.#{ipv4Part}\\.#{ipv4Part}$", 'i'
+
+# Expand :: in an IPv6 address or address part consisting of `parts` groups.
+expandIPv6 = (string, parts) ->
+  # More than one '::' means invalid adddress
+  if string.indexOf('::') != string.lastIndexOf('::')
+    return null
+
+  # How many parts do we already have?
+  colonCount = 0
+  lastColon = -1
+  while (lastColon = string.indexOf(':', lastColon + 1)) >= 0
+    colonCount++
+
+  # 0::0 is two parts more than ::
+  colonCount-- if string.substr(0, 2) == '::'
+  colonCount-- if string.substr(-2, 2) == '::'
+
+  # The following loop would hang if colonCount > parts
+  if colonCount > parts
+    return null
+
+  # replacement = ':' + '0:' * (parts - colonCount)
+  replacementCount = parts - colonCount
+  replacement = ':'
+  while replacementCount--
+    replacement += '0:'
+
+  # Insert the missing zeroes
+  string = string.replace('::', replacement)
+
+  # Trim any garbage which may be hanging around if :: was at the edge in
+  # the source string
+  string = string[1..-1] if string[0] == ':'
+  string = string[0..-2] if string[string.length-1] == ':'
+
+  return (parseInt(part, 16) for part in string.split(":"))
+
+# Parse an IPv6 address.
+ipaddr.IPv6.parser = (string) ->
+  if string.match(ipv6Regexes['native'])
+    return expandIPv6(string, 8)
+
+  else if match = string.match(ipv6Regexes['transitional'])
+    parts = expandIPv6(match[1][0..-2], 6)
+    if parts
+      octets = [parseInt(match[2]), parseInt(match[3]),
+                parseInt(match[4]), parseInt(match[5])]
+      for octet in octets
+        if !(0 <= octet <= 255)
+          return null
+
+      parts.push(octets[0] << 8 | octets[1])
+      parts.push(octets[2] << 8 | octets[3])
+      return parts
+
+  return null
+
+# Checks if a given string is formatted like IPv4/IPv6 address.
+ipaddr.IPv4.isIPv4 = ipaddr.IPv6.isIPv6 = (string) ->
+  return @parser(string) != null
+
+# Checks if a given string is a valid IPv4/IPv6 address.
+ipaddr.IPv4.isValid = (string) ->
+  try
+    new this(@parser(string))
+    return true
+  catch e
+    return false
+
+ipaddr.IPv4.isValidFourPartDecimal = (string) ->
+  if ipaddr.IPv4.isValid(string) and string.match(/^\d+(\.\d+){3}$/)
+    return true
+  else
+    return false
+
+ipaddr.IPv6.isValid = (string) ->
+  # Since IPv6.isValid is always called first, this shortcut
+  # provides a substantial performance gain.
+  if typeof string == "string" and string.indexOf(":") == -1
+    return false
+
+  try
+    new this(@parser(string))
+    return true
+  catch e
+    return false
+
+# Tries to parse and validate a string with IPv4/IPv6 address.
+# Throws an error if it fails.
+ipaddr.IPv4.parse = ipaddr.IPv6.parse = (string) ->
+  parts = @parser(string)
+  if parts == null
+    throw new Error "ipaddr: string is not formatted like ip address"
+
+  return new this(parts)
+
+ipaddr.IPv4.parseCIDR = (string) ->
+  if match = string.match(/^(.+)\/(\d+)$/)
+    maskLength = parseInt(match[2])
+    if maskLength >= 0 and maskLength <= 32
+      return [@parse(match[1]), maskLength]
+
+  throw new Error "ipaddr: string is not formatted like an IPv4 CIDR range"
+
+# A utility function to return subnet mask in IPv4 format given the prefix length
+ipaddr.IPv4.subnetMaskFromPrefixLength = (prefix) ->
+  if prefix < 0 or prefix > 32
+    throw new Error('ipaddr: invalid prefix length')
+  octets = Array(4).fill(0)
+  j = 0
+  while j < Math.floor(prefix / 8)
+    octets[j] = 255
+    j++
+  octets[Math.floor(prefix / 8)] = Math.pow(2, (prefix % 8)) - 1 << 8 - (prefix % 8)
+  new (ipaddr.IPv4)(octets)
+
+# A utility function to return broadcast address given the IPv4 interface and prefix length in CIDR notation
+ipaddr.IPv4.broadcastAddressFromCIDR = (string) ->
+  try
+    ipInterface = ipaddr.IPv4.parseCIDR(string)[0]
+    subnetMask = @subnetMaskFromPrefixLength([ ipaddr.IPv4.parseCIDR(string)[1] ])
+    octets = []
+    i = 0
+    while i < 4
+      # Broadcast address is bitwise OR between ip interface and inverted mask
+      octets.push parseInt(ipInterface.octets[i], 10) | parseInt(subnetMask.octets[i], 10) ^ 255
+      i++
+    return new (ipaddr.IPv4)(octets)
+  catch error
+    throw new Error('ipaddr: the address does not have IPv4 CIDR format')
+  return
+
+# A utility function to return network address given the IPv4 interface and prefix length in CIDR notation
+ipaddr.IPv4.networkAddressFromCIDR = (string) ->
+  try
+    ipInterface = ipaddr.IPv4.parseCIDR(string)[0]
+    subnetMask = @subnetMaskFromPrefixLength([ ipaddr.IPv4.parseCIDR(string)[1] ])
+    octets = []
+    i = 0
+    while i < 4
+      # Network address is bitwise AND between ip interface and mask
+      octets.push parseInt(ipInterface.octets[i], 10) & parseInt(subnetMask.octets[i], 10)
+      i++
+    return new (ipaddr.IPv4)(octets)
+  catch error
+    throw new Error('ipaddr: the address does not have IPv4 CIDR format')
+  return
+
+ipaddr.IPv6.parseCIDR = (string) ->
+  if match = string.match(/^(.+)\/(\d+)$/)
+    maskLength = parseInt(match[2])
+    if maskLength >= 0 and maskLength <= 128
+      return [@parse(match[1]), maskLength]
+
+  throw new Error "ipaddr: string is not formatted like an IPv6 CIDR range"
+
+# Checks if the address is valid IP address
+ipaddr.isValid = (string) ->
+  return ipaddr.IPv6.isValid(string) || ipaddr.IPv4.isValid(string)
+
+# Try to parse an address and throw an error if it is impossible
+ipaddr.parse = (string) ->
+  if ipaddr.IPv6.isValid(string)
+    return ipaddr.IPv6.parse(string)
+  else if ipaddr.IPv4.isValid(string)
+    return ipaddr.IPv4.parse(string)
+  else
+    throw new Error "ipaddr: the address has neither IPv6 nor IPv4 format"
+
+ipaddr.parseCIDR = (string) ->
+  try
+    return ipaddr.IPv6.parseCIDR(string)
+  catch e
+    try
+      return ipaddr.IPv4.parseCIDR(string)
+    catch e
+      throw new Error "ipaddr: the address has neither IPv6 nor IPv4 CIDR format"
+
+# Try to parse an array in network order (MSB first) for IPv4 and IPv6
+ipaddr.fromByteArray = (bytes) ->
+  length = bytes.length
+  if length == 4
+    return new ipaddr.IPv4(bytes)
+  else if length == 16
+    return new ipaddr.IPv6(bytes)
+  else
+    throw new Error "ipaddr: the binary input is neither an IPv6 nor IPv4 address"
+
+# Parse an address and return plain IPv4 address if it is an IPv4-mapped address
+ipaddr.process = (string) ->
+  addr = @parse(string)
+  if addr.kind() == 'ipv6' && addr.isIPv4MappedAddress()
+    return addr.toIPv4Address()
+  else
+    return addr
diff --git a/wrt/node_modules/ipaddr.js/src/ipaddr.js b/wrt/node_modules/ipaddr.js/src/ipaddr.js
new file mode 100644 (file)
index 0000000..90cdc14
--- /dev/null
@@ -0,0 +1,586 @@
+(function() {
+  var expandIPv6, ipaddr, ipv4Part, ipv4Regexes, ipv6Part, ipv6Regexes, matchCIDR, root;
+
+  ipaddr = {};
+
+  root = this;
+
+  if ((typeof module !== "undefined" && module !== null) && module.exports) {
+    module.exports = ipaddr;
+  } else {
+    root['ipaddr'] = ipaddr;
+  }
+
+  matchCIDR = function(first, second, partSize, cidrBits) {
+    var part, shift;
+    if (first.length !== second.length) {
+      throw new Error("ipaddr: cannot match CIDR for objects with different lengths");
+    }
+    part = 0;
+    while (cidrBits > 0) {
+      shift = partSize - cidrBits;
+      if (shift < 0) {
+        shift = 0;
+      }
+      if (first[part] >> shift !== second[part] >> shift) {
+        return false;
+      }
+      cidrBits -= partSize;
+      part += 1;
+    }
+    return true;
+  };
+
+  ipaddr.subnetMatch = function(address, rangeList, defaultName) {
+    var rangeName, rangeSubnets, subnet, _i, _len;
+    if (defaultName == null) {
+      defaultName = 'unicast';
+    }
+    for (rangeName in rangeList) {
+      rangeSubnets = rangeList[rangeName];
+      if (rangeSubnets[0] && !(rangeSubnets[0] instanceof Array)) {
+        rangeSubnets = [rangeSubnets];
+      }
+      for (_i = 0, _len = rangeSubnets.length; _i < _len; _i++) {
+        subnet = rangeSubnets[_i];
+        if (address.match.apply(address, subnet)) {
+          return rangeName;
+        }
+      }
+    }
+    return defaultName;
+  };
+
+  ipaddr.IPv4 = (function() {
+    function IPv4(octets) {
+      var octet, _i, _len;
+      if (octets.length !== 4) {
+        throw new Error("ipaddr: ipv4 octet count should be 4");
+      }
+      for (_i = 0, _len = octets.length; _i < _len; _i++) {
+        octet = octets[_i];
+        if (!((0 <= octet && octet <= 255))) {
+          throw new Error("ipaddr: ipv4 octet should fit in 8 bits");
+        }
+      }
+      this.octets = octets;
+    }
+
+    IPv4.prototype.kind = function() {
+      return 'ipv4';
+    };
+
+    IPv4.prototype.toString = function() {
+      return this.octets.join(".");
+    };
+
+    IPv4.prototype.toByteArray = function() {
+      return this.octets.slice(0);
+    };
+
+    IPv4.prototype.match = function(other, cidrRange) {
+      var _ref;
+      if (cidrRange === void 0) {
+        _ref = other, other = _ref[0], cidrRange = _ref[1];
+      }
+      if (other.kind() !== 'ipv4') {
+        throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");
+      }
+      return matchCIDR(this.octets, other.octets, 8, cidrRange);
+    };
+
+    IPv4.prototype.SpecialRanges = {
+      unspecified: [[new IPv4([0, 0, 0, 0]), 8]],
+      broadcast: [[new IPv4([255, 255, 255, 255]), 32]],
+      multicast: [[new IPv4([224, 0, 0, 0]), 4]],
+      linkLocal: [[new IPv4([169, 254, 0, 0]), 16]],
+      loopback: [[new IPv4([127, 0, 0, 0]), 8]],
+      carrierGradeNat: [[new IPv4([100, 64, 0, 0]), 10]],
+      "private": [[new IPv4([10, 0, 0, 0]), 8], [new IPv4([172, 16, 0, 0]), 12], [new IPv4([192, 168, 0, 0]), 16]],
+      reserved: [[new IPv4([192, 0, 0, 0]), 24], [new IPv4([192, 0, 2, 0]), 24], [new IPv4([192, 88, 99, 0]), 24], [new IPv4([198, 51, 100, 0]), 24], [new IPv4([203, 0, 113, 0]), 24], [new IPv4([240, 0, 0, 0]), 4]]
+    };
+
+    IPv4.prototype.range = function() {
+      return ipaddr.subnetMatch(this, this.SpecialRanges);
+    };
+
+    IPv4.prototype.toIPv4MappedAddress = function() {
+      return ipaddr.IPv6.parse("::ffff:" + (this.toString()));
+    };
+
+    IPv4.prototype.prefixLengthFromSubnetMask = function() {
+      var cidr, i, octet, stop, zeros, zerotable, _i;
+      zerotable = {
+        0: 8,
+        128: 7,
+        192: 6,
+        224: 5,
+        240: 4,
+        248: 3,
+        252: 2,
+        254: 1,
+        255: 0
+      };
+      cidr = 0;
+      stop = false;
+      for (i = _i = 3; _i >= 0; i = _i += -1) {
+        octet = this.octets[i];
+        if (octet in zerotable) {
+          zeros = zerotable[octet];
+          if (stop && zeros !== 0) {
+            return null;
+          }
+          if (zeros !== 8) {
+            stop = true;
+          }
+          cidr += zeros;
+        } else {
+          return null;
+        }
+      }
+      return 32 - cidr;
+    };
+
+    return IPv4;
+
+  })();
+
+  ipv4Part = "(0?\\d+|0x[a-f0-9]+)";
+
+  ipv4Regexes = {
+    fourOctet: new RegExp("^" + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "$", 'i'),
+    longValue: new RegExp("^" + ipv4Part + "$", 'i')
+  };
+
+  ipaddr.IPv4.parser = function(string) {
+    var match, parseIntAuto, part, shift, value;
+    parseIntAuto = function(string) {
+      if (string[0] === "0" && string[1] !== "x") {
+        return parseInt(string, 8);
+      } else {
+        return parseInt(string);
+      }
+    };
+    if (match = string.match(ipv4Regexes.fourOctet)) {
+      return (function() {
+        var _i, _len, _ref, _results;
+        _ref = match.slice(1, 6);
+        _results = [];
+        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+          part = _ref[_i];
+          _results.push(parseIntAuto(part));
+        }
+        return _results;
+      })();
+    } else if (match = string.match(ipv4Regexes.longValue)) {
+      value = parseIntAuto(match[1]);
+      if (value > 0xffffffff || value < 0) {
+        throw new Error("ipaddr: address outside defined range");
+      }
+      return ((function() {
+        var _i, _results;
+        _results = [];
+        for (shift = _i = 0; _i <= 24; shift = _i += 8) {
+          _results.push((value >> shift) & 0xff);
+        }
+        return _results;
+      })()).reverse();
+    } else {
+      return null;
+    }
+  };
+
+  ipaddr.IPv6 = (function() {
+    function IPv6(parts) {
+      var i, part, _i, _j, _len, _ref;
+      if (parts.length === 16) {
+        this.parts = [];
+        for (i = _i = 0; _i <= 14; i = _i += 2) {
+          this.parts.push((parts[i] << 8) | parts[i + 1]);
+        }
+      } else if (parts.length === 8) {
+        this.parts = parts;
+      } else {
+        throw new Error("ipaddr: ipv6 part count should be 8 or 16");
+      }
+      _ref = this.parts;
+      for (_j = 0, _len = _ref.length; _j < _len; _j++) {
+        part = _ref[_j];
+        if (!((0 <= part && part <= 0xffff))) {
+          throw new Error("ipaddr: ipv6 part should fit in 16 bits");
+        }
+      }
+    }
+
+    IPv6.prototype.kind = function() {
+      return 'ipv6';
+    };
+
+    IPv6.prototype.toString = function() {
+      var compactStringParts, part, pushPart, state, stringParts, _i, _len;
+      stringParts = (function() {
+        var _i, _len, _ref, _results;
+        _ref = this.parts;
+        _results = [];
+        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+          part = _ref[_i];
+          _results.push(part.toString(16));
+        }
+        return _results;
+      }).call(this);
+      compactStringParts = [];
+      pushPart = function(part) {
+        return compactStringParts.push(part);
+      };
+      state = 0;
+      for (_i = 0, _len = stringParts.length; _i < _len; _i++) {
+        part = stringParts[_i];
+        switch (state) {
+          case 0:
+            if (part === '0') {
+              pushPart('');
+            } else {
+              pushPart(part);
+            }
+            state = 1;
+            break;
+          case 1:
+            if (part === '0') {
+              state = 2;
+            } else {
+              pushPart(part);
+            }
+            break;
+          case 2:
+            if (part !== '0') {
+              pushPart('');
+              pushPart(part);
+              state = 3;
+            }
+            break;
+          case 3:
+            pushPart(part);
+        }
+      }
+      if (state === 2) {
+        pushPart('');
+        pushPart('');
+      }
+      return compactStringParts.join(":");
+    };
+
+    IPv6.prototype.toByteArray = function() {
+      var bytes, part, _i, _len, _ref;
+      bytes = [];
+      _ref = this.parts;
+      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+        part = _ref[_i];
+        bytes.push(part >> 8);
+        bytes.push(part & 0xff);
+      }
+      return bytes;
+    };
+
+    IPv6.prototype.toNormalizedString = function() {
+      var part;
+      return ((function() {
+        var _i, _len, _ref, _results;
+        _ref = this.parts;
+        _results = [];
+        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+          part = _ref[_i];
+          _results.push(part.toString(16));
+        }
+        return _results;
+      }).call(this)).join(":");
+    };
+
+    IPv6.prototype.match = function(other, cidrRange) {
+      var _ref;
+      if (cidrRange === void 0) {
+        _ref = other, other = _ref[0], cidrRange = _ref[1];
+      }
+      if (other.kind() !== 'ipv6') {
+        throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");
+      }
+      return matchCIDR(this.parts, other.parts, 16, cidrRange);
+    };
+
+    IPv6.prototype.SpecialRanges = {
+      unspecified: [new IPv6([0, 0, 0, 0, 0, 0, 0, 0]), 128],
+      linkLocal: [new IPv6([0xfe80, 0, 0, 0, 0, 0, 0, 0]), 10],
+      multicast: [new IPv6([0xff00, 0, 0, 0, 0, 0, 0, 0]), 8],
+      loopback: [new IPv6([0, 0, 0, 0, 0, 0, 0, 1]), 128],
+      uniqueLocal: [new IPv6([0xfc00, 0, 0, 0, 0, 0, 0, 0]), 7],
+      ipv4Mapped: [new IPv6([0, 0, 0, 0, 0, 0xffff, 0, 0]), 96],
+      rfc6145: [new IPv6([0, 0, 0, 0, 0xffff, 0, 0, 0]), 96],
+      rfc6052: [new IPv6([0x64, 0xff9b, 0, 0, 0, 0, 0, 0]), 96],
+      '6to4': [new IPv6([0x2002, 0, 0, 0, 0, 0, 0, 0]), 16],
+      teredo: [new IPv6([0x2001, 0, 0, 0, 0, 0, 0, 0]), 32],
+      reserved: [[new IPv6([0x2001, 0xdb8, 0, 0, 0, 0, 0, 0]), 32]]
+    };
+
+    IPv6.prototype.range = function() {
+      return ipaddr.subnetMatch(this, this.SpecialRanges);
+    };
+
+    IPv6.prototype.isIPv4MappedAddress = function() {
+      return this.range() === 'ipv4Mapped';
+    };
+
+    IPv6.prototype.toIPv4Address = function() {
+      var high, low, _ref;
+      if (!this.isIPv4MappedAddress()) {
+        throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");
+      }
+      _ref = this.parts.slice(-2), high = _ref[0], low = _ref[1];
+      return new ipaddr.IPv4([high >> 8, high & 0xff, low >> 8, low & 0xff]);
+    };
+
+    return IPv6;
+
+  })();
+
+  ipv6Part = "(?:[0-9a-f]+::?)+";
+
+  ipv6Regexes = {
+    "native": new RegExp("^(::)?(" + ipv6Part + ")?([0-9a-f]+)?(::)?$", 'i'),
+    transitional: new RegExp(("^((?:" + ipv6Part + ")|(?:::)(?:" + ipv6Part + ")?)") + ("" + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "\\." + ipv4Part + "$"), 'i')
+  };
+
+  expandIPv6 = function(string, parts) {
+    var colonCount, lastColon, part, replacement, replacementCount;
+    if (string.indexOf('::') !== string.lastIndexOf('::')) {
+      return null;
+    }
+    colonCount = 0;
+    lastColon = -1;
+    while ((lastColon = string.indexOf(':', lastColon + 1)) >= 0) {
+      colonCount++;
+    }
+    if (string.substr(0, 2) === '::') {
+      colonCount--;
+    }
+    if (string.substr(-2, 2) === '::') {
+      colonCount--;
+    }
+    if (colonCount > parts) {
+      return null;
+    }
+    replacementCount = parts - colonCount;
+    replacement = ':';
+    while (replacementCount--) {
+      replacement += '0:';
+    }
+    string = string.replace('::', replacement);
+    if (string[0] === ':') {
+      string = string.slice(1);
+    }
+    if (string[string.length - 1] === ':') {
+      string = string.slice(0, -1);
+    }
+    return (function() {
+      var _i, _len, _ref, _results;
+      _ref = string.split(":");
+      _results = [];
+      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+        part = _ref[_i];
+        _results.push(parseInt(part, 16));
+      }
+      return _results;
+    })();
+  };
+
+  ipaddr.IPv6.parser = function(string) {
+    var match, octet, octets, parts, _i, _len;
+    if (string.match(ipv6Regexes['native'])) {
+      return expandIPv6(string, 8);
+    } else if (match = string.match(ipv6Regexes['transitional'])) {
+      parts = expandIPv6(match[1].slice(0, -1), 6);
+      if (parts) {
+        octets = [parseInt(match[2]), parseInt(match[3]), parseInt(match[4]), parseInt(match[5])];
+        for (_i = 0, _len = octets.length; _i < _len; _i++) {
+          octet = octets[_i];
+          if (!((0 <= octet && octet <= 255))) {
+            return null;
+          }
+        }
+        parts.push(octets[0] << 8 | octets[1]);
+        parts.push(octets[2] << 8 | octets[3]);
+        return parts;
+      }
+    }
+    return null;
+  };
+
+  ipaddr.IPv4.isIPv4 = ipaddr.IPv6.isIPv6 = function(string) {
+    return this.parser(string) !== null;
+  };
+
+  ipaddr.IPv4.isValid = function(string) {
+    var e;
+    try {
+      new this(this.parser(string));
+      return true;
+    } catch (_error) {
+      e = _error;
+      return false;
+    }
+  };
+
+  ipaddr.IPv4.isValidFourPartDecimal = function(string) {
+    if (ipaddr.IPv4.isValid(string) && string.match(/^\d+(\.\d+){3}$/)) {
+      return true;
+    } else {
+      return false;
+    }
+  };
+
+  ipaddr.IPv6.isValid = function(string) {
+    var e;
+    if (typeof string === "string" && string.indexOf(":") === -1) {
+      return false;
+    }
+    try {
+      new this(this.parser(string));
+      return true;
+    } catch (_error) {
+      e = _error;
+      return false;
+    }
+  };
+
+  ipaddr.IPv4.parse = ipaddr.IPv6.parse = function(string) {
+    var parts;
+    parts = this.parser(string);
+    if (parts === null) {
+      throw new Error("ipaddr: string is not formatted like ip address");
+    }
+    return new this(parts);
+  };
+
+  ipaddr.IPv4.parseCIDR = function(string) {
+    var maskLength, match;
+    if (match = string.match(/^(.+)\/(\d+)$/)) {
+      maskLength = parseInt(match[2]);
+      if (maskLength >= 0 && maskLength <= 32) {
+        return [this.parse(match[1]), maskLength];
+      }
+    }
+    throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range");
+  };
+
+  ipaddr.IPv4.subnetMaskFromPrefixLength = function(prefix) {
+    var j, octets;
+    if (prefix < 0 || prefix > 32) {
+      throw new Error('ipaddr: invalid prefix length');
+    }
+    octets = Array(4).fill(0);
+    j = 0;
+    while (j < Math.floor(prefix / 8)) {
+      octets[j] = 255;
+      j++;
+    }
+    octets[Math.floor(prefix / 8)] = Math.pow(2, prefix % 8) - 1 << 8 - (prefix % 8);
+    return new ipaddr.IPv4(octets);
+  };
+
+  ipaddr.IPv4.broadcastAddressFromCIDR = function(string) {
+    var error, i, ipInterface, octets, subnetMask;
+    try {
+      ipInterface = ipaddr.IPv4.parseCIDR(string)[0];
+      subnetMask = this.subnetMaskFromPrefixLength([ipaddr.IPv4.parseCIDR(string)[1]]);
+      octets = [];
+      i = 0;
+      while (i < 4) {
+        octets.push(parseInt(ipInterface.octets[i], 10) | parseInt(subnetMask.octets[i], 10) ^ 255);
+        i++;
+      }
+      return new ipaddr.IPv4(octets);
+    } catch (_error) {
+      error = _error;
+      throw new Error('ipaddr: the address does not have IPv4 CIDR format');
+    }
+  };
+
+  ipaddr.IPv4.networkAddressFromCIDR = function(string) {
+    var error, i, ipInterface, octets, subnetMask;
+    try {
+      ipInterface = ipaddr.IPv4.parseCIDR(string)[0];
+      subnetMask = this.subnetMaskFromPrefixLength([ipaddr.IPv4.parseCIDR(string)[1]]);
+      octets = [];
+      i = 0;
+      while (i < 4) {
+        octets.push(parseInt(ipInterface.octets[i], 10) & parseInt(subnetMask.octets[i], 10));
+        i++;
+      }
+      return new ipaddr.IPv4(octets);
+    } catch (_error) {
+      error = _error;
+      throw new Error('ipaddr: the address does not have IPv4 CIDR format');
+    }
+  };
+
+  ipaddr.IPv6.parseCIDR = function(string) {
+    var maskLength, match;
+    if (match = string.match(/^(.+)\/(\d+)$/)) {
+      maskLength = parseInt(match[2]);
+      if (maskLength >= 0 && maskLength <= 128) {
+        return [this.parse(match[1]), maskLength];
+      }
+    }
+    throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range");
+  };
+
+  ipaddr.isValid = function(string) {
+    return ipaddr.IPv6.isValid(string) || ipaddr.IPv4.isValid(string);
+  };
+
+  ipaddr.parse = function(string) {
+    if (ipaddr.IPv6.isValid(string)) {
+      return ipaddr.IPv6.parse(string);
+    } else if (ipaddr.IPv4.isValid(string)) {
+      return ipaddr.IPv4.parse(string);
+    } else {
+      throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format");
+    }
+  };
+
+  ipaddr.parseCIDR = function(string) {
+    var e;
+    try {
+      return ipaddr.IPv6.parseCIDR(string);
+    } catch (_error) {
+      e = _error;
+      try {
+        return ipaddr.IPv4.parseCIDR(string);
+      } catch (_error) {
+        e = _error;
+        throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format");
+      }
+    }
+  };
+
+  ipaddr.fromByteArray = function(bytes) {
+    var length;
+    length = bytes.length;
+    if (length === 4) {
+      return new ipaddr.IPv4(bytes);
+    } else if (length === 16) {
+      return new ipaddr.IPv6(bytes);
+    } else {
+      throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address");
+    }
+  };
+
+  ipaddr.process = function(string) {
+    var addr;
+    addr = this.parse(string);
+    if (addr.kind() === 'ipv6' && addr.isIPv4MappedAddress()) {
+      return addr.toIPv4Address();
+    } else {
+      return addr;
+    }
+  };
+
+}).call(this);
diff --git a/wrt/node_modules/ipaddr.js/test/ipaddr.js b/wrt/node_modules/ipaddr.js/test/ipaddr.js
new file mode 100644 (file)
index 0000000..ae92354
--- /dev/null
@@ -0,0 +1,424 @@
+(function() {
+  var ipaddr;
+
+  ipaddr = require('../lib/ipaddr');
+
+  module.exports = {
+    'should define main classes': function(test) {
+      test.ok(ipaddr.IPv4 != null, 'defines IPv4 class');
+      test.ok(ipaddr.IPv6 != null, 'defines IPv6 class');
+      return test.done();
+    },
+    'can construct IPv4 from octets': function(test) {
+      test.doesNotThrow(function() {
+        return new ipaddr.IPv4([192, 168, 1, 2]);
+      });
+      return test.done();
+    },
+    'refuses to construct invalid IPv4': function(test) {
+      test.throws(function() {
+        return new ipaddr.IPv4([300, 1, 2, 3]);
+      });
+      test.throws(function() {
+        return new ipaddr.IPv4([8, 8, 8]);
+      });
+      return test.done();
+    },
+    'converts IPv4 to string correctly': function(test) {
+      var addr;
+      addr = new ipaddr.IPv4([192, 168, 1, 1]);
+      test.equal(addr.toString(), '192.168.1.1');
+      return test.done();
+    },
+    'returns correct kind for IPv4': function(test) {
+      var addr;
+      addr = new ipaddr.IPv4([1, 2, 3, 4]);
+      test.equal(addr.kind(), 'ipv4');
+      return test.done();
+    },
+    'allows to access IPv4 octets': function(test) {
+      var addr;
+      addr = new ipaddr.IPv4([42, 0, 0, 0]);
+      test.equal(addr.octets[0], 42);
+      return test.done();
+    },
+    'checks IPv4 address format': function(test) {
+      test.equal(ipaddr.IPv4.isIPv4('192.168.007.0xa'), true);
+      test.equal(ipaddr.IPv4.isIPv4('1024.0.0.1'), true);
+      test.equal(ipaddr.IPv4.isIPv4('8.0xa.wtf.6'), false);
+      return test.done();
+    },
+    'validates IPv4 addresses': function(test) {
+      test.equal(ipaddr.IPv4.isValid('192.168.007.0xa'), true);
+      test.equal(ipaddr.IPv4.isValid('1024.0.0.1'), false);
+      test.equal(ipaddr.IPv4.isValid('8.0xa.wtf.6'), false);
+      return test.done();
+    },
+    'parses IPv4 in several weird formats': function(test) {
+      test.deepEqual(ipaddr.IPv4.parse('192.168.1.1').octets, [192, 168, 1, 1]);
+      test.deepEqual(ipaddr.IPv4.parse('0xc0.168.1.1').octets, [192, 168, 1, 1]);
+      test.deepEqual(ipaddr.IPv4.parse('192.0250.1.1').octets, [192, 168, 1, 1]);
+      test.deepEqual(ipaddr.IPv4.parse('0xc0a80101').octets, [192, 168, 1, 1]);
+      test.deepEqual(ipaddr.IPv4.parse('030052000401').octets, [192, 168, 1, 1]);
+      test.deepEqual(ipaddr.IPv4.parse('3232235777').octets, [192, 168, 1, 1]);
+      return test.done();
+    },
+    'barfs at invalid IPv4': function(test) {
+      test.throws(function() {
+        return ipaddr.IPv4.parse('10.0.0.wtf');
+      });
+      return test.done();
+    },
+    'matches IPv4 CIDR correctly': function(test) {
+      var addr;
+      addr = new ipaddr.IPv4([10, 5, 0, 1]);
+      test.equal(addr.match(ipaddr.IPv4.parse('0.0.0.0'), 0), true);
+      test.equal(addr.match(ipaddr.IPv4.parse('11.0.0.0'), 8), false);
+      test.equal(addr.match(ipaddr.IPv4.parse('10.0.0.0'), 8), true);
+      test.equal(addr.match(ipaddr.IPv4.parse('10.0.0.1'), 8), true);
+      test.equal(addr.match(ipaddr.IPv4.parse('10.0.0.10'), 8), true);
+      test.equal(addr.match(ipaddr.IPv4.parse('10.5.5.0'), 16), true);
+      test.equal(addr.match(ipaddr.IPv4.parse('10.4.5.0'), 16), false);
+      test.equal(addr.match(ipaddr.IPv4.parse('10.4.5.0'), 15), true);
+      test.equal(addr.match(ipaddr.IPv4.parse('10.5.0.2'), 32), false);
+      test.equal(addr.match(addr, 32), true);
+      return test.done();
+    },
+    'parses IPv4 CIDR correctly': function(test) {
+      var addr;
+      addr = new ipaddr.IPv4([10, 5, 0, 1]);
+      test.equal(addr.match(ipaddr.IPv4.parseCIDR('0.0.0.0/0')), true);
+      test.equal(addr.match(ipaddr.IPv4.parseCIDR('11.0.0.0/8')), false);
+      test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.0.0.0/8')), true);
+      test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.0.0.1/8')), true);
+      test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.0.0.10/8')), true);
+      test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.5.5.0/16')), true);
+      test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.4.5.0/16')), false);
+      test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.4.5.0/15')), true);
+      test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.5.0.2/32')), false);
+      test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.5.0.1/32')), true);
+      test.throws(function() {
+        return ipaddr.IPv4.parseCIDR('10.5.0.1');
+      });
+      test.throws(function() {
+        return ipaddr.IPv4.parseCIDR('0.0.0.0/-1');
+      });
+      test.throws(function() {
+        return ipaddr.IPv4.parseCIDR('0.0.0.0/33');
+      });
+      return test.done();
+    },
+    'detects reserved IPv4 networks': function(test) {
+      test.equal(ipaddr.IPv4.parse('0.0.0.0').range(), 'unspecified');
+      test.equal(ipaddr.IPv4.parse('0.1.0.0').range(), 'unspecified');
+      test.equal(ipaddr.IPv4.parse('10.1.0.1').range(), 'private');
+      test.equal(ipaddr.IPv4.parse('100.64.0.0').range(), 'carrierGradeNat');
+      test.equal(ipaddr.IPv4.parse('100.127.255.255').range(), 'carrierGradeNat');
+      test.equal(ipaddr.IPv4.parse('192.168.2.1').range(), 'private');
+      test.equal(ipaddr.IPv4.parse('224.100.0.1').range(), 'multicast');
+      test.equal(ipaddr.IPv4.parse('169.254.15.0').range(), 'linkLocal');
+      test.equal(ipaddr.IPv4.parse('127.1.1.1').range(), 'loopback');
+      test.equal(ipaddr.IPv4.parse('255.255.255.255').range(), 'broadcast');
+      test.equal(ipaddr.IPv4.parse('240.1.2.3').range(), 'reserved');
+      test.equal(ipaddr.IPv4.parse('8.8.8.8').range(), 'unicast');
+      return test.done();
+    },
+    'checks the conventional IPv4 address format': function(test) {
+      test.equal(ipaddr.IPv4.isValidFourPartDecimal('192.168.1.1'), true);
+      test.equal(ipaddr.IPv4.isValidFourPartDecimal('0xc0.168.1.1'), false);
+      return test.done();
+    },
+    'can construct IPv6 from 16bit parts': function(test) {
+      test.doesNotThrow(function() {
+        return new ipaddr.IPv6([0x2001, 0xdb8, 0xf53a, 0, 0, 0, 0, 1]);
+      });
+      return test.done();
+    },
+    'can construct IPv6 from 8bit parts': function(test) {
+      test.doesNotThrow(function() {
+        return new ipaddr.IPv6([0x20, 0x01, 0xd, 0xb8, 0xf5, 0x3a, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]);
+      });
+      test.deepEqual(new ipaddr.IPv6([0x20, 0x01, 0xd, 0xb8, 0xf5, 0x3a, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]), new ipaddr.IPv6([0x2001, 0xdb8, 0xf53a, 0, 0, 0, 0, 1]));
+      return test.done();
+    },
+    'refuses to construct invalid IPv6': function(test) {
+      test.throws(function() {
+        return new ipaddr.IPv6([0xfffff, 0, 0, 0, 0, 0, 0, 1]);
+      });
+      test.throws(function() {
+        return new ipaddr.IPv6([0xfffff, 0, 0, 0, 0, 0, 1]);
+      });
+      test.throws(function() {
+        return new ipaddr.IPv6([0xffff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]);
+      });
+      return test.done();
+    },
+    'converts IPv6 to string correctly': function(test) {
+      var addr;
+      addr = new ipaddr.IPv6([0x2001, 0xdb8, 0xf53a, 0, 0, 0, 0, 1]);
+      test.equal(addr.toNormalizedString(), '2001:db8:f53a:0:0:0:0:1');
+      test.equal(addr.toString(), '2001:db8:f53a::1');
+      test.equal(new ipaddr.IPv6([0, 0, 0, 0, 0, 0, 0, 1]).toString(), '::1');
+      test.equal(new ipaddr.IPv6([0x2001, 0xdb8, 0, 0, 0, 0, 0, 0]).toString(), '2001:db8::');
+      return test.done();
+    },
+    'returns correct kind for IPv6': function(test) {
+      var addr;
+      addr = new ipaddr.IPv6([0x2001, 0xdb8, 0xf53a, 0, 0, 0, 0, 1]);
+      test.equal(addr.kind(), 'ipv6');
+      return test.done();
+    },
+    'allows to access IPv6 address parts': function(test) {
+      var addr;
+      addr = new ipaddr.IPv6([0x2001, 0xdb8, 0xf53a, 0, 0, 42, 0, 1]);
+      test.equal(addr.parts[5], 42);
+      return test.done();
+    },
+    'checks IPv6 address format': function(test) {
+      test.equal(ipaddr.IPv6.isIPv6('2001:db8:F53A::1'), true);
+      test.equal(ipaddr.IPv6.isIPv6('200001::1'), true);
+      test.equal(ipaddr.IPv6.isIPv6('::ffff:192.168.1.1'), true);
+      test.equal(ipaddr.IPv6.isIPv6('::ffff:300.168.1.1'), false);
+      test.equal(ipaddr.IPv6.isIPv6('::ffff:300.168.1.1:0'), false);
+      test.equal(ipaddr.IPv6.isIPv6('fe80::wtf'), false);
+      return test.done();
+    },
+    'validates IPv6 addresses': function(test) {
+      test.equal(ipaddr.IPv6.isValid('2001:db8:F53A::1'), true);
+      test.equal(ipaddr.IPv6.isValid('200001::1'), false);
+      test.equal(ipaddr.IPv6.isValid('::ffff:192.168.1.1'), true);
+      test.equal(ipaddr.IPv6.isValid('::ffff:300.168.1.1'), false);
+      test.equal(ipaddr.IPv6.isValid('::ffff:300.168.1.1:0'), false);
+      test.equal(ipaddr.IPv6.isValid('::ffff:222.1.41.9000'), false);
+      test.equal(ipaddr.IPv6.isValid('2001:db8::F53A::1'), false);
+      test.equal(ipaddr.IPv6.isValid('fe80::wtf'), false);
+      test.equal(ipaddr.IPv6.isValid('2002::2:'), false);
+      test.equal(ipaddr.IPv6.isValid(void 0), false);
+      return test.done();
+    },
+    'parses IPv6 in different formats': function(test) {
+      test.deepEqual(ipaddr.IPv6.parse('2001:db8:F53A:0:0:0:0:1').parts, [0x2001, 0xdb8, 0xf53a, 0, 0, 0, 0, 1]);
+      test.deepEqual(ipaddr.IPv6.parse('fe80::10').parts, [0xfe80, 0, 0, 0, 0, 0, 0, 0x10]);
+      test.deepEqual(ipaddr.IPv6.parse('2001:db8:F53A::').parts, [0x2001, 0xdb8, 0xf53a, 0, 0, 0, 0, 0]);
+      test.deepEqual(ipaddr.IPv6.parse('::1').parts, [0, 0, 0, 0, 0, 0, 0, 1]);
+      test.deepEqual(ipaddr.IPv6.parse('::').parts, [0, 0, 0, 0, 0, 0, 0, 0]);
+      return test.done();
+    },
+    'barfs at invalid IPv6': function(test) {
+      test.throws(function() {
+        return ipaddr.IPv6.parse('fe80::0::1');
+      });
+      return test.done();
+    },
+    'matches IPv6 CIDR correctly': function(test) {
+      var addr;
+      addr = ipaddr.IPv6.parse('2001:db8:f53a::1');
+      test.equal(addr.match(ipaddr.IPv6.parse('::'), 0), true);
+      test.equal(addr.match(ipaddr.IPv6.parse('2001:db8:f53a::1:1'), 64), true);
+      test.equal(addr.match(ipaddr.IPv6.parse('2001:db8:f53b::1:1'), 48), false);
+      test.equal(addr.match(ipaddr.IPv6.parse('2001:db8:f531::1:1'), 44), true);
+      test.equal(addr.match(ipaddr.IPv6.parse('2001:db8:f500::1'), 40), true);
+      test.equal(addr.match(ipaddr.IPv6.parse('2001:db9:f500::1'), 40), false);
+      test.equal(addr.match(addr, 128), true);
+      return test.done();
+    },
+    'parses IPv6 CIDR correctly': function(test) {
+      var addr;
+      addr = ipaddr.IPv6.parse('2001:db8:f53a::1');
+      test.equal(addr.match(ipaddr.IPv6.parseCIDR('::/0')), true);
+      test.equal(addr.match(ipaddr.IPv6.parseCIDR('2001:db8:f53a::1:1/64')), true);
+      test.equal(addr.match(ipaddr.IPv6.parseCIDR('2001:db8:f53b::1:1/48')), false);
+      test.equal(addr.match(ipaddr.IPv6.parseCIDR('2001:db8:f531::1:1/44')), true);
+      test.equal(addr.match(ipaddr.IPv6.parseCIDR('2001:db8:f500::1/40')), true);
+      test.equal(addr.match(ipaddr.IPv6.parseCIDR('2001:db9:f500::1/40')), false);
+      test.equal(addr.match(ipaddr.IPv6.parseCIDR('2001:db8:f53a::1/128')), true);
+      test.throws(function() {
+        return ipaddr.IPv6.parseCIDR('2001:db8:f53a::1');
+      });
+      test.throws(function() {
+        return ipaddr.IPv6.parseCIDR('2001:db8:f53a::1/-1');
+      });
+      test.throws(function() {
+        return ipaddr.IPv6.parseCIDR('2001:db8:f53a::1/129');
+      });
+      return test.done();
+    },
+    'converts between IPv4-mapped IPv6 addresses and IPv4 addresses': function(test) {
+      var addr, mapped;
+      addr = ipaddr.IPv4.parse('77.88.21.11');
+      mapped = addr.toIPv4MappedAddress();
+      test.deepEqual(mapped.parts, [0, 0, 0, 0, 0, 0xffff, 0x4d58, 0x150b]);
+      test.deepEqual(mapped.toIPv4Address().octets, addr.octets);
+      return test.done();
+    },
+    'refuses to convert non-IPv4-mapped IPv6 address to IPv4 address': function(test) {
+      test.throws(function() {
+        return ipaddr.IPv6.parse('2001:db8::1').toIPv4Address();
+      });
+      return test.done();
+    },
+    'detects reserved IPv6 networks': function(test) {
+      test.equal(ipaddr.IPv6.parse('::').range(), 'unspecified');
+      test.equal(ipaddr.IPv6.parse('fe80::1234:5678:abcd:0123').range(), 'linkLocal');
+      test.equal(ipaddr.IPv6.parse('ff00::1234').range(), 'multicast');
+      test.equal(ipaddr.IPv6.parse('::1').range(), 'loopback');
+      test.equal(ipaddr.IPv6.parse('fc00::').range(), 'uniqueLocal');
+      test.equal(ipaddr.IPv6.parse('::ffff:192.168.1.10').range(), 'ipv4Mapped');
+      test.equal(ipaddr.IPv6.parse('::ffff:0:192.168.1.10').range(), 'rfc6145');
+      test.equal(ipaddr.IPv6.parse('64:ff9b::1234').range(), 'rfc6052');
+      test.equal(ipaddr.IPv6.parse('2002:1f63:45e8::1').range(), '6to4');
+      test.equal(ipaddr.IPv6.parse('2001::4242').range(), 'teredo');
+      test.equal(ipaddr.IPv6.parse('2001:db8::3210').range(), 'reserved');
+      test.equal(ipaddr.IPv6.parse('2001:470:8:66::1').range(), 'unicast');
+      return test.done();
+    },
+    'is able to determine IP address type': function(test) {
+      test.equal(ipaddr.parse('8.8.8.8').kind(), 'ipv4');
+      test.equal(ipaddr.parse('2001:db8:3312::1').kind(), 'ipv6');
+      return test.done();
+    },
+    'throws an error if tried to parse an invalid address': function(test) {
+      test.throws(function() {
+        return ipaddr.parse('::some.nonsense');
+      });
+      return test.done();
+    },
+    'correctly processes IPv4-mapped addresses': function(test) {
+      test.equal(ipaddr.process('8.8.8.8').kind(), 'ipv4');
+      test.equal(ipaddr.process('2001:db8:3312::1').kind(), 'ipv6');
+      test.equal(ipaddr.process('::ffff:192.168.1.1').kind(), 'ipv4');
+      return test.done();
+    },
+    'correctly converts IPv6 and IPv4 addresses to byte arrays': function(test) {
+      test.deepEqual(ipaddr.parse('1.2.3.4').toByteArray(), [0x1, 0x2, 0x3, 0x4]);
+      test.deepEqual(ipaddr.parse('2a00:1450:8007::68').toByteArray(), [42, 0x00, 0x14, 0x50, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68]);
+      return test.done();
+    },
+    'correctly parses 1 as an IPv4 address': function(test) {
+      test.equal(ipaddr.IPv6.isValid('1'), false);
+      test.equal(ipaddr.IPv4.isValid('1'), true);
+      test.deepEqual(new ipaddr.IPv4([0, 0, 0, 1]), ipaddr.parse('1'));
+      return test.done();
+    },
+    'correctly detects IPv4 and IPv6 CIDR addresses': function(test) {
+      test.deepEqual([ipaddr.IPv6.parse('fc00::'), 64], ipaddr.parseCIDR('fc00::/64'));
+      test.deepEqual([ipaddr.IPv4.parse('1.2.3.4'), 5], ipaddr.parseCIDR('1.2.3.4/5'));
+      return test.done();
+    },
+    'does not consider a very large or very small number a valid IP address': function(test) {
+      test.equal(ipaddr.isValid('4999999999'), false);
+      test.equal(ipaddr.isValid('-1'), false);
+      return test.done();
+    },
+    'does not hang on ::8:8:8:8:8:8:8:8:8': function(test) {
+      test.equal(ipaddr.IPv6.isValid('::8:8:8:8:8:8:8:8:8'), false);
+      return test.done();
+    },
+    'subnetMatch does not fail on empty range': function(test) {
+      ipaddr.subnetMatch(new ipaddr.IPv4([1, 2, 3, 4]), {}, false);
+      ipaddr.subnetMatch(new ipaddr.IPv4([1, 2, 3, 4]), {
+        subnet: []
+      }, false);
+      return test.done();
+    },
+    'subnetMatch returns default subnet on empty range': function(test) {
+      test.equal(ipaddr.subnetMatch(new ipaddr.IPv4([1, 2, 3, 4]), {}, false), false);
+      test.equal(ipaddr.subnetMatch(new ipaddr.IPv4([1, 2, 3, 4]), {
+        subnet: []
+      }, false), false);
+      return test.done();
+    },
+    'is able to determine IP address type from byte array input': function(test) {
+      test.equal(ipaddr.fromByteArray([0x7f, 0, 0, 1]).kind(), 'ipv4');
+      test.equal(ipaddr.fromByteArray([0x20, 0x01, 0xd, 0xb8, 0xf5, 0x3a, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]).kind(), 'ipv6');
+      test.throws(function() {
+        return ipaddr.fromByteArray([1]);
+      });
+      return test.done();
+    },
+    'prefixLengthFromSubnetMask returns proper CIDR notation for standard IPv4 masks': function(test) {
+      test.equal(ipaddr.IPv4.parse('255.255.255.255').prefixLengthFromSubnetMask(), 32);
+      test.equal(ipaddr.IPv4.parse('255.255.255.254').prefixLengthFromSubnetMask(), 31);
+      test.equal(ipaddr.IPv4.parse('255.255.255.252').prefixLengthFromSubnetMask(), 30);
+      test.equal(ipaddr.IPv4.parse('255.255.255.248').prefixLengthFromSubnetMask(), 29);
+      test.equal(ipaddr.IPv4.parse('255.255.255.240').prefixLengthFromSubnetMask(), 28);
+      test.equal(ipaddr.IPv4.parse('255.255.255.224').prefixLengthFromSubnetMask(), 27);
+      test.equal(ipaddr.IPv4.parse('255.255.255.192').prefixLengthFromSubnetMask(), 26);
+      test.equal(ipaddr.IPv4.parse('255.255.255.128').prefixLengthFromSubnetMask(), 25);
+      test.equal(ipaddr.IPv4.parse('255.255.255.0').prefixLengthFromSubnetMask(), 24);
+      test.equal(ipaddr.IPv4.parse('255.255.254.0').prefixLengthFromSubnetMask(), 23);
+      test.equal(ipaddr.IPv4.parse('255.255.252.0').prefixLengthFromSubnetMask(), 22);
+      test.equal(ipaddr.IPv4.parse('255.255.248.0').prefixLengthFromSubnetMask(), 21);
+      test.equal(ipaddr.IPv4.parse('255.255.240.0').prefixLengthFromSubnetMask(), 20);
+      test.equal(ipaddr.IPv4.parse('255.255.224.0').prefixLengthFromSubnetMask(), 19);
+      test.equal(ipaddr.IPv4.parse('255.255.192.0').prefixLengthFromSubnetMask(), 18);
+      test.equal(ipaddr.IPv4.parse('255.255.128.0').prefixLengthFromSubnetMask(), 17);
+      test.equal(ipaddr.IPv4.parse('255.255.0.0').prefixLengthFromSubnetMask(), 16);
+      test.equal(ipaddr.IPv4.parse('255.254.0.0').prefixLengthFromSubnetMask(), 15);
+      test.equal(ipaddr.IPv4.parse('255.252.0.0').prefixLengthFromSubnetMask(), 14);
+      test.equal(ipaddr.IPv4.parse('255.248.0.0').prefixLengthFromSubnetMask(), 13);
+      test.equal(ipaddr.IPv4.parse('255.240.0.0').prefixLengthFromSubnetMask(), 12);
+      test.equal(ipaddr.IPv4.parse('255.224.0.0').prefixLengthFromSubnetMask(), 11);
+      test.equal(ipaddr.IPv4.parse('255.192.0.0').prefixLengthFromSubnetMask(), 10);
+      test.equal(ipaddr.IPv4.parse('255.128.0.0').prefixLengthFromSubnetMask(), 9);
+      test.equal(ipaddr.IPv4.parse('255.0.0.0').prefixLengthFromSubnetMask(), 8);
+      test.equal(ipaddr.IPv4.parse('254.0.0.0').prefixLengthFromSubnetMask(), 7);
+      test.equal(ipaddr.IPv4.parse('252.0.0.0').prefixLengthFromSubnetMask(), 6);
+      test.equal(ipaddr.IPv4.parse('248.0.0.0').prefixLengthFromSubnetMask(), 5);
+      test.equal(ipaddr.IPv4.parse('240.0.0.0').prefixLengthFromSubnetMask(), 4);
+      test.equal(ipaddr.IPv4.parse('224.0.0.0').prefixLengthFromSubnetMask(), 3);
+      test.equal(ipaddr.IPv4.parse('192.0.0.0').prefixLengthFromSubnetMask(), 2);
+      test.equal(ipaddr.IPv4.parse('128.0.0.0').prefixLengthFromSubnetMask(), 1);
+      test.equal(ipaddr.IPv4.parse('0.0.0.0').prefixLengthFromSubnetMask(), 0);
+      test.equal(ipaddr.IPv4.parse('192.168.255.0').prefixLengthFromSubnetMask(), null);
+      test.equal(ipaddr.IPv4.parse('255.0.255.0').prefixLengthFromSubnetMask(), null);
+      return test.done();
+    },
+    'subnetMaskFromPrefixLength returns correct subnet mask given prefix length': function(test) {
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("0"), "0.0.0.0");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("1"), "128.0.0.0");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("2"), "192.0.0.0");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("3"), "224.0.0.0");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("4"), "240.0.0.0");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("5"), "248.0.0.0");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("6"), "252.0.0.0");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("7"), "254.0.0.0");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("8"), "255.0.0.0");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("9"), "255.128.0.0");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("10"), "255.192.0.0");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("11"), "255.224.0.0");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("12"), "255.240.0.0");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("13"), "255.248.0.0");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("14"), "255.252.0.0");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("15"), "255.254.0.0");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("16"), "255.255.0.0");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("17"), "255.255.128.0");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("18"), "255.255.192.0");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("19"), "255.255.224.0");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("20"), "255.255.240.0");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("21"), "255.255.248.0");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("22"), "255.255.252.0");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("23"), "255.255.254.0");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("24"), "255.255.255.0");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("25"), "255.255.255.128");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("26"), "255.255.255.192");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("27"), "255.255.255.224");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("28"), "255.255.255.240");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("29"), "255.255.255.248");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("30"), "255.255.255.252");
+      test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("31"), "255.255.255.254");
+      return test.done();
+    },
+    'broadcastAddressFromCIDR returns correct broadcast address': function(test) {
+      test.equal(ipaddr.IPv4.broadcastAddressFromCIDR("172.0.0.1/24"), "172.0.0.255");
+      test.equal(ipaddr.IPv4.broadcastAddressFromCIDR("172.0.0.1/26"), "172.0.0.63");
+      return test.done();
+    },
+    'networkAddressFromCIDR returns correct network address': function(test) {
+      test.equal(ipaddr.IPv4.networkAddressFromCIDR("172.0.0.1/24"), "172.0.0.0");
+      test.equal(ipaddr.IPv4.networkAddressFromCIDR("172.0.0.1/5"), "168.0.0.0");
+      return test.done();
+    }
+  };
+
+}).call(this);
diff --git a/wrt/node_modules/ipaddr.js/test/ipaddr.test.coffee b/wrt/node_modules/ipaddr.js/test/ipaddr.test.coffee
new file mode 100644 (file)
index 0000000..0f96eaf
--- /dev/null
@@ -0,0 +1,391 @@
+ipaddr = require '../lib/ipaddr'
+
+module.exports =
+  'should define main classes': (test) ->
+    test.ok(ipaddr.IPv4?, 'defines IPv4 class')
+    test.ok(ipaddr.IPv6?, 'defines IPv6 class')
+    test.done()
+
+  'can construct IPv4 from octets': (test) ->
+    test.doesNotThrow ->
+      new ipaddr.IPv4([192, 168, 1, 2])
+    test.done()
+
+  'refuses to construct invalid IPv4': (test) ->
+    test.throws ->
+      new ipaddr.IPv4([300, 1, 2, 3])
+    test.throws ->
+      new ipaddr.IPv4([8, 8, 8])
+    test.done()
+
+  'converts IPv4 to string correctly': (test) ->
+    addr = new ipaddr.IPv4([192, 168, 1, 1])
+    test.equal(addr.toString(), '192.168.1.1')
+    test.done()
+
+  'returns correct kind for IPv4': (test) ->
+    addr = new ipaddr.IPv4([1, 2, 3, 4])
+    test.equal(addr.kind(), 'ipv4')
+    test.done()
+
+  'allows to access IPv4 octets': (test) ->
+    addr = new ipaddr.IPv4([42, 0, 0, 0])
+    test.equal(addr.octets[0], 42)
+    test.done()
+
+  'checks IPv4 address format': (test) ->
+    test.equal(ipaddr.IPv4.isIPv4('192.168.007.0xa'), true)
+    test.equal(ipaddr.IPv4.isIPv4('1024.0.0.1'),      true)
+    test.equal(ipaddr.IPv4.isIPv4('8.0xa.wtf.6'),     false)
+    test.done()
+
+  'validates IPv4 addresses': (test) ->
+    test.equal(ipaddr.IPv4.isValid('192.168.007.0xa'), true)
+    test.equal(ipaddr.IPv4.isValid('1024.0.0.1'),      false)
+    test.equal(ipaddr.IPv4.isValid('8.0xa.wtf.6'),     false)
+    test.done()
+
+  'parses IPv4 in several weird formats': (test) ->
+    test.deepEqual(ipaddr.IPv4.parse('192.168.1.1').octets,  [192, 168, 1, 1])
+    test.deepEqual(ipaddr.IPv4.parse('0xc0.168.1.1').octets, [192, 168, 1, 1])
+    test.deepEqual(ipaddr.IPv4.parse('192.0250.1.1').octets, [192, 168, 1, 1])
+    test.deepEqual(ipaddr.IPv4.parse('0xc0a80101').octets,   [192, 168, 1, 1])
+    test.deepEqual(ipaddr.IPv4.parse('030052000401').octets, [192, 168, 1, 1])
+    test.deepEqual(ipaddr.IPv4.parse('3232235777').octets,   [192, 168, 1, 1])
+    test.done()
+
+  'barfs at invalid IPv4': (test) ->
+    test.throws ->
+      ipaddr.IPv4.parse('10.0.0.wtf')
+    test.done()
+
+  'matches IPv4 CIDR correctly': (test) ->
+    addr = new ipaddr.IPv4([10, 5, 0, 1])
+    test.equal(addr.match(ipaddr.IPv4.parse('0.0.0.0'), 0),   true)
+    test.equal(addr.match(ipaddr.IPv4.parse('11.0.0.0'), 8),  false)
+    test.equal(addr.match(ipaddr.IPv4.parse('10.0.0.0'), 8),  true)
+    test.equal(addr.match(ipaddr.IPv4.parse('10.0.0.1'), 8),  true)
+    test.equal(addr.match(ipaddr.IPv4.parse('10.0.0.10'), 8), true)
+    test.equal(addr.match(ipaddr.IPv4.parse('10.5.5.0'), 16), true)
+    test.equal(addr.match(ipaddr.IPv4.parse('10.4.5.0'), 16), false)
+    test.equal(addr.match(ipaddr.IPv4.parse('10.4.5.0'), 15), true)
+    test.equal(addr.match(ipaddr.IPv4.parse('10.5.0.2'), 32), false)
+    test.equal(addr.match(addr, 32), true)
+    test.done()
+
+  'parses IPv4 CIDR correctly': (test) ->
+    addr = new ipaddr.IPv4([10, 5, 0, 1])
+    test.equal(addr.match(ipaddr.IPv4.parseCIDR('0.0.0.0/0')),   true)
+    test.equal(addr.match(ipaddr.IPv4.parseCIDR('11.0.0.0/8')),  false)
+    test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.0.0.0/8')),  true)
+    test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.0.0.1/8')),  true)
+    test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.0.0.10/8')), true)
+    test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.5.5.0/16')), true)
+    test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.4.5.0/16')), false)
+    test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.4.5.0/15')), true)
+    test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.5.0.2/32')), false)
+    test.equal(addr.match(ipaddr.IPv4.parseCIDR('10.5.0.1/32')), true)
+    test.throws ->
+      ipaddr.IPv4.parseCIDR('10.5.0.1')
+    test.throws ->
+      ipaddr.IPv4.parseCIDR('0.0.0.0/-1')
+    test.throws ->
+      ipaddr.IPv4.parseCIDR('0.0.0.0/33')
+    test.done()
+
+  'detects reserved IPv4 networks': (test) ->
+    test.equal(ipaddr.IPv4.parse('0.0.0.0').range(),         'unspecified')
+    test.equal(ipaddr.IPv4.parse('0.1.0.0').range(),         'unspecified')
+    test.equal(ipaddr.IPv4.parse('10.1.0.1').range(),        'private')
+    test.equal(ipaddr.IPv4.parse('100.64.0.0').range(),      'carrierGradeNat')
+    test.equal(ipaddr.IPv4.parse('100.127.255.255').range(), 'carrierGradeNat')
+    test.equal(ipaddr.IPv4.parse('192.168.2.1').range(),     'private')
+    test.equal(ipaddr.IPv4.parse('224.100.0.1').range(),     'multicast')
+    test.equal(ipaddr.IPv4.parse('169.254.15.0').range(),    'linkLocal')
+    test.equal(ipaddr.IPv4.parse('127.1.1.1').range(),       'loopback')
+    test.equal(ipaddr.IPv4.parse('255.255.255.255').range(), 'broadcast')
+    test.equal(ipaddr.IPv4.parse('240.1.2.3').range(),       'reserved')
+    test.equal(ipaddr.IPv4.parse('8.8.8.8').range(),         'unicast')
+    test.done()
+
+  'checks the conventional IPv4 address format': (test) ->
+      test.equal(ipaddr.IPv4.isValidFourPartDecimal('192.168.1.1'),  true)
+      test.equal(ipaddr.IPv4.isValidFourPartDecimal('0xc0.168.1.1'), false)
+      test.done()
+
+  'can construct IPv6 from 16bit parts': (test) ->
+    test.doesNotThrow ->
+      new ipaddr.IPv6([0x2001, 0xdb8, 0xf53a, 0, 0, 0, 0, 1])
+    test.done()
+
+  'can construct IPv6 from 8bit parts': (test) ->
+    test.doesNotThrow ->
+      new ipaddr.IPv6([0x20, 0x01, 0xd, 0xb8, 0xf5, 0x3a, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1])
+    test.deepEqual(new ipaddr.IPv6([0x20, 0x01, 0xd, 0xb8, 0xf5, 0x3a, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]),
+      new ipaddr.IPv6([0x2001, 0xdb8, 0xf53a, 0, 0, 0, 0, 1]))
+    test.done()
+
+  'refuses to construct invalid IPv6': (test) ->
+    test.throws ->
+      new ipaddr.IPv6([0xfffff, 0, 0, 0, 0, 0, 0, 1])
+    test.throws ->
+      new ipaddr.IPv6([0xfffff, 0, 0, 0, 0, 0, 1])
+    test.throws ->
+      new ipaddr.IPv6([0xffff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1])
+    test.done()
+
+  'converts IPv6 to string correctly': (test) ->
+    addr = new ipaddr.IPv6([0x2001, 0xdb8, 0xf53a, 0, 0, 0, 0, 1])
+    test.equal(addr.toNormalizedString(), '2001:db8:f53a:0:0:0:0:1')
+    test.equal(addr.toString(), '2001:db8:f53a::1')
+    test.equal(new ipaddr.IPv6([0, 0, 0, 0, 0, 0, 0, 1]).toString(), '::1')
+    test.equal(new ipaddr.IPv6([0x2001, 0xdb8, 0, 0, 0, 0, 0, 0]).toString(), '2001:db8::')
+    test.done()
+
+  'returns correct kind for IPv6': (test) ->
+    addr = new ipaddr.IPv6([0x2001, 0xdb8, 0xf53a, 0, 0, 0, 0, 1])
+    test.equal(addr.kind(), 'ipv6')
+    test.done()
+
+  'allows to access IPv6 address parts': (test) ->
+    addr = new ipaddr.IPv6([0x2001, 0xdb8, 0xf53a, 0, 0, 42, 0, 1])
+    test.equal(addr.parts[5], 42)
+    test.done()
+
+  'checks IPv6 address format': (test) ->
+    test.equal(ipaddr.IPv6.isIPv6('2001:db8:F53A::1'),     true)
+    test.equal(ipaddr.IPv6.isIPv6('200001::1'),            true)
+    test.equal(ipaddr.IPv6.isIPv6('::ffff:192.168.1.1'),   true)
+    test.equal(ipaddr.IPv6.isIPv6('::ffff:300.168.1.1'),   false)
+    test.equal(ipaddr.IPv6.isIPv6('::ffff:300.168.1.1:0'), false)
+    test.equal(ipaddr.IPv6.isIPv6('fe80::wtf'),            false)
+    test.done()
+
+  'validates IPv6 addresses': (test) ->
+    test.equal(ipaddr.IPv6.isValid('2001:db8:F53A::1'),     true)
+    test.equal(ipaddr.IPv6.isValid('200001::1'),            false)
+    test.equal(ipaddr.IPv6.isValid('::ffff:192.168.1.1'),   true)
+    test.equal(ipaddr.IPv6.isValid('::ffff:300.168.1.1'),   false)
+    test.equal(ipaddr.IPv6.isValid('::ffff:300.168.1.1:0'), false)
+    test.equal(ipaddr.IPv6.isValid('::ffff:222.1.41.9000'), false)
+    test.equal(ipaddr.IPv6.isValid('2001:db8::F53A::1'),    false)
+    test.equal(ipaddr.IPv6.isValid('fe80::wtf'),            false)
+    test.equal(ipaddr.IPv6.isValid('2002::2:'),             false)
+    test.equal(ipaddr.IPv6.isValid(undefined),              false)
+    test.done()
+
+  'parses IPv6 in different formats': (test) ->
+    test.deepEqual(ipaddr.IPv6.parse('2001:db8:F53A:0:0:0:0:1').parts, [0x2001, 0xdb8, 0xf53a, 0, 0, 0, 0, 1])
+    test.deepEqual(ipaddr.IPv6.parse('fe80::10').parts, [0xfe80, 0, 0, 0, 0, 0, 0, 0x10])
+    test.deepEqual(ipaddr.IPv6.parse('2001:db8:F53A::').parts, [0x2001, 0xdb8, 0xf53a, 0, 0, 0, 0, 0])
+    test.deepEqual(ipaddr.IPv6.parse('::1').parts, [0, 0, 0, 0, 0, 0, 0, 1])
+    test.deepEqual(ipaddr.IPv6.parse('::').parts, [0, 0, 0, 0, 0, 0, 0, 0])
+    test.done()
+
+  'barfs at invalid IPv6': (test) ->
+    test.throws ->
+      ipaddr.IPv6.parse('fe80::0::1')
+    test.done()
+
+  'matches IPv6 CIDR correctly': (test) ->
+    addr = ipaddr.IPv6.parse('2001:db8:f53a::1')
+    test.equal(addr.match(ipaddr.IPv6.parse('::'), 0),                  true)
+    test.equal(addr.match(ipaddr.IPv6.parse('2001:db8:f53a::1:1'), 64), true)
+    test.equal(addr.match(ipaddr.IPv6.parse('2001:db8:f53b::1:1'), 48), false)
+    test.equal(addr.match(ipaddr.IPv6.parse('2001:db8:f531::1:1'), 44), true)
+    test.equal(addr.match(ipaddr.IPv6.parse('2001:db8:f500::1'), 40),   true)
+    test.equal(addr.match(ipaddr.IPv6.parse('2001:db9:f500::1'), 40),   false)
+    test.equal(addr.match(addr, 128), true)
+    test.done()
+
+  'parses IPv6 CIDR correctly': (test) ->
+    addr = ipaddr.IPv6.parse('2001:db8:f53a::1')
+    test.equal(addr.match(ipaddr.IPv6.parseCIDR('::/0')),                  true)
+    test.equal(addr.match(ipaddr.IPv6.parseCIDR('2001:db8:f53a::1:1/64')), true)
+    test.equal(addr.match(ipaddr.IPv6.parseCIDR('2001:db8:f53b::1:1/48')), false)
+    test.equal(addr.match(ipaddr.IPv6.parseCIDR('2001:db8:f531::1:1/44')), true)
+    test.equal(addr.match(ipaddr.IPv6.parseCIDR('2001:db8:f500::1/40')),   true)
+    test.equal(addr.match(ipaddr.IPv6.parseCIDR('2001:db9:f500::1/40')),   false)
+    test.equal(addr.match(ipaddr.IPv6.parseCIDR('2001:db8:f53a::1/128')),  true)
+    test.throws ->
+      ipaddr.IPv6.parseCIDR('2001:db8:f53a::1')
+    test.throws ->
+      ipaddr.IPv6.parseCIDR('2001:db8:f53a::1/-1')
+    test.throws ->
+      ipaddr.IPv6.parseCIDR('2001:db8:f53a::1/129')
+    test.done()
+
+  'converts between IPv4-mapped IPv6 addresses and IPv4 addresses': (test) ->
+    addr = ipaddr.IPv4.parse('77.88.21.11')
+    mapped = addr.toIPv4MappedAddress()
+    test.deepEqual(mapped.parts, [0, 0, 0, 0, 0, 0xffff, 0x4d58, 0x150b])
+    test.deepEqual(mapped.toIPv4Address().octets, addr.octets)
+    test.done()
+
+  'refuses to convert non-IPv4-mapped IPv6 address to IPv4 address': (test) ->
+    test.throws ->
+      ipaddr.IPv6.parse('2001:db8::1').toIPv4Address()
+    test.done()
+
+  'detects reserved IPv6 networks': (test) ->
+    test.equal(ipaddr.IPv6.parse('::').range(),                        'unspecified')
+    test.equal(ipaddr.IPv6.parse('fe80::1234:5678:abcd:0123').range(), 'linkLocal')
+    test.equal(ipaddr.IPv6.parse('ff00::1234').range(),                'multicast')
+    test.equal(ipaddr.IPv6.parse('::1').range(),                       'loopback')
+    test.equal(ipaddr.IPv6.parse('fc00::').range(),                    'uniqueLocal')
+    test.equal(ipaddr.IPv6.parse('::ffff:192.168.1.10').range(),       'ipv4Mapped')
+    test.equal(ipaddr.IPv6.parse('::ffff:0:192.168.1.10').range(),     'rfc6145')
+    test.equal(ipaddr.IPv6.parse('64:ff9b::1234').range(),             'rfc6052')
+    test.equal(ipaddr.IPv6.parse('2002:1f63:45e8::1').range(),         '6to4')
+    test.equal(ipaddr.IPv6.parse('2001::4242').range(),                'teredo')
+    test.equal(ipaddr.IPv6.parse('2001:db8::3210').range(),            'reserved')
+    test.equal(ipaddr.IPv6.parse('2001:470:8:66::1').range(),          'unicast')
+    test.done()
+
+  'is able to determine IP address type': (test) ->
+    test.equal(ipaddr.parse('8.8.8.8').kind(), 'ipv4')
+    test.equal(ipaddr.parse('2001:db8:3312::1').kind(), 'ipv6')
+    test.done()
+
+  'throws an error if tried to parse an invalid address': (test) ->
+    test.throws ->
+      ipaddr.parse('::some.nonsense')
+    test.done()
+
+  'correctly processes IPv4-mapped addresses': (test) ->
+    test.equal(ipaddr.process('8.8.8.8').kind(), 'ipv4')
+    test.equal(ipaddr.process('2001:db8:3312::1').kind(), 'ipv6')
+    test.equal(ipaddr.process('::ffff:192.168.1.1').kind(), 'ipv4')
+    test.done()
+
+  'correctly converts IPv6 and IPv4 addresses to byte arrays': (test) ->
+    test.deepEqual(ipaddr.parse('1.2.3.4').toByteArray(),
+          [0x1, 0x2, 0x3, 0x4]);
+    # Fuck yeah. The first byte of Google's IPv6 address is 42. 42!
+    test.deepEqual(ipaddr.parse('2a00:1450:8007::68').toByteArray(),
+          [42, 0x00, 0x14, 0x50, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68 ])
+    test.done()
+
+  'correctly parses 1 as an IPv4 address': (test) ->
+    test.equal(ipaddr.IPv6.isValid('1'), false)
+    test.equal(ipaddr.IPv4.isValid('1'), true)
+    test.deepEqual(new ipaddr.IPv4([0, 0, 0, 1]), ipaddr.parse('1'))
+    test.done()
+
+  'correctly detects IPv4 and IPv6 CIDR addresses': (test) ->
+    test.deepEqual([ipaddr.IPv6.parse('fc00::'), 64],
+                   ipaddr.parseCIDR('fc00::/64'))
+    test.deepEqual([ipaddr.IPv4.parse('1.2.3.4'), 5],
+                   ipaddr.parseCIDR('1.2.3.4/5'))
+    test.done()
+
+  'does not consider a very large or very small number a valid IP address': (test) ->
+    test.equal(ipaddr.isValid('4999999999'), false)
+    test.equal(ipaddr.isValid('-1'), false)
+    test.done()
+
+  'does not hang on ::8:8:8:8:8:8:8:8:8': (test) ->
+    test.equal(ipaddr.IPv6.isValid('::8:8:8:8:8:8:8:8:8'), false)
+    test.done()
+
+  'subnetMatch does not fail on empty range': (test) ->
+    ipaddr.subnetMatch(new ipaddr.IPv4([1,2,3,4]), {}, false)
+    ipaddr.subnetMatch(new ipaddr.IPv4([1,2,3,4]), {subnet: []}, false)
+    test.done()
+
+  'subnetMatch returns default subnet on empty range': (test) ->
+    test.equal(ipaddr.subnetMatch(new ipaddr.IPv4([1,2,3,4]), {}, false), false)
+    test.equal(ipaddr.subnetMatch(new ipaddr.IPv4([1,2,3,4]), {subnet: []}, false), false)
+    test.done()
+
+  'is able to determine IP address type from byte array input': (test) ->
+    test.equal(ipaddr.fromByteArray([0x7f, 0, 0, 1]).kind(), 'ipv4')
+    test.equal(ipaddr.fromByteArray([0x20, 0x01, 0xd, 0xb8, 0xf5, 0x3a, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]).kind(), 'ipv6')
+    test.throws ->
+      ipaddr.fromByteArray([1])
+    test.done()
+
+  'prefixLengthFromSubnetMask returns proper CIDR notation for standard IPv4 masks': (test) ->
+    test.equal(ipaddr.IPv4.parse('255.255.255.255').prefixLengthFromSubnetMask(), 32)
+    test.equal(ipaddr.IPv4.parse('255.255.255.254').prefixLengthFromSubnetMask(), 31)
+    test.equal(ipaddr.IPv4.parse('255.255.255.252').prefixLengthFromSubnetMask(), 30)
+    test.equal(ipaddr.IPv4.parse('255.255.255.248').prefixLengthFromSubnetMask(), 29)
+    test.equal(ipaddr.IPv4.parse('255.255.255.240').prefixLengthFromSubnetMask(), 28)
+    test.equal(ipaddr.IPv4.parse('255.255.255.224').prefixLengthFromSubnetMask(), 27)
+    test.equal(ipaddr.IPv4.parse('255.255.255.192').prefixLengthFromSubnetMask(), 26)
+    test.equal(ipaddr.IPv4.parse('255.255.255.128').prefixLengthFromSubnetMask(), 25)
+    test.equal(ipaddr.IPv4.parse('255.255.255.0').prefixLengthFromSubnetMask(), 24)
+    test.equal(ipaddr.IPv4.parse('255.255.254.0').prefixLengthFromSubnetMask(), 23)
+    test.equal(ipaddr.IPv4.parse('255.255.252.0').prefixLengthFromSubnetMask(), 22)
+    test.equal(ipaddr.IPv4.parse('255.255.248.0').prefixLengthFromSubnetMask(), 21)
+    test.equal(ipaddr.IPv4.parse('255.255.240.0').prefixLengthFromSubnetMask(), 20)
+    test.equal(ipaddr.IPv4.parse('255.255.224.0').prefixLengthFromSubnetMask(), 19)
+    test.equal(ipaddr.IPv4.parse('255.255.192.0').prefixLengthFromSubnetMask(), 18)
+    test.equal(ipaddr.IPv4.parse('255.255.128.0').prefixLengthFromSubnetMask(), 17)
+    test.equal(ipaddr.IPv4.parse('255.255.0.0').prefixLengthFromSubnetMask(), 16)
+    test.equal(ipaddr.IPv4.parse('255.254.0.0').prefixLengthFromSubnetMask(), 15)
+    test.equal(ipaddr.IPv4.parse('255.252.0.0').prefixLengthFromSubnetMask(), 14)
+    test.equal(ipaddr.IPv4.parse('255.248.0.0').prefixLengthFromSubnetMask(), 13)
+    test.equal(ipaddr.IPv4.parse('255.240.0.0').prefixLengthFromSubnetMask(), 12)
+    test.equal(ipaddr.IPv4.parse('255.224.0.0').prefixLengthFromSubnetMask(), 11)
+    test.equal(ipaddr.IPv4.parse('255.192.0.0').prefixLengthFromSubnetMask(), 10)
+    test.equal(ipaddr.IPv4.parse('255.128.0.0').prefixLengthFromSubnetMask(), 9)
+    test.equal(ipaddr.IPv4.parse('255.0.0.0').prefixLengthFromSubnetMask(), 8)
+    test.equal(ipaddr.IPv4.parse('254.0.0.0').prefixLengthFromSubnetMask(), 7)
+    test.equal(ipaddr.IPv4.parse('252.0.0.0').prefixLengthFromSubnetMask(), 6)
+    test.equal(ipaddr.IPv4.parse('248.0.0.0').prefixLengthFromSubnetMask(), 5)
+    test.equal(ipaddr.IPv4.parse('240.0.0.0').prefixLengthFromSubnetMask(), 4)
+    test.equal(ipaddr.IPv4.parse('224.0.0.0').prefixLengthFromSubnetMask(), 3)
+    test.equal(ipaddr.IPv4.parse('192.0.0.0').prefixLengthFromSubnetMask(), 2)
+    test.equal(ipaddr.IPv4.parse('128.0.0.0').prefixLengthFromSubnetMask(), 1)
+    test.equal(ipaddr.IPv4.parse('0.0.0.0').prefixLengthFromSubnetMask(), 0)
+    # negative cases
+    test.equal(ipaddr.IPv4.parse('192.168.255.0').prefixLengthFromSubnetMask(), null)
+    test.equal(ipaddr.IPv4.parse('255.0.255.0').prefixLengthFromSubnetMask(), null)
+    test.done()
+
+  'subnetMaskFromPrefixLength returns correct subnet mask given prefix length': (test) ->
+        
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("0"), "0.0.0.0");
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("1"), "128.0.0.0")
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("2"), "192.0.0.0")
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("3"), "224.0.0.0")
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("4"), "240.0.0.0")
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("5"), "248.0.0.0")
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("6"), "252.0.0.0")
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("7"), "254.0.0.0")
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("8"), "255.0.0.0");
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("9"), "255.128.0.0")
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("10"), "255.192.0.0")
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("11"), "255.224.0.0")
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("12"), "255.240.0.0")
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("13"), "255.248.0.0")
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("14"), "255.252.0.0")
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("15"), "255.254.0.0")
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("16"), "255.255.0.0")
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("17"), "255.255.128.0")
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("18"), "255.255.192.0")
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("19"), "255.255.224.0")
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("20"), "255.255.240.0")
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("21"), "255.255.248.0")
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("22"), "255.255.252.0")
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("23"), "255.255.254.0")
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("24"), "255.255.255.0")
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("25"), "255.255.255.128")
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("26"), "255.255.255.192")
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("27"), "255.255.255.224")
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("28"), "255.255.255.240")
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("29"), "255.255.255.248")
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("30"), "255.255.255.252")
+    test.equal(ipaddr.IPv4.subnetMaskFromPrefixLength("31"), "255.255.255.254")
+    test.done()
+    
+  'broadcastAddressFromCIDR returns correct broadcast address': (test) ->
+    test.equal(ipaddr.IPv4.broadcastAddressFromCIDR("172.0.0.1/24"), "172.0.0.255")
+    test.equal(ipaddr.IPv4.broadcastAddressFromCIDR("172.0.0.1/26"), "172.0.0.63")
+    test.done()
+        
+  'networkAddressFromCIDR returns correct network address': (test) ->
+    test.equal(ipaddr.IPv4.networkAddressFromCIDR("172.0.0.1/24"), "172.0.0.0")
+    test.equal(ipaddr.IPv4.networkAddressFromCIDR("172.0.0.1/5"), "168.0.0.0")
+    test.done()
diff --git a/wrt/node_modules/is-buffer/.npmignore b/wrt/node_modules/is-buffer/.npmignore
new file mode 100644 (file)
index 0000000..9cdaef9
--- /dev/null
@@ -0,0 +1,2 @@
+.travis.yml
+.zuul.yml
diff --git a/wrt/node_modules/is-buffer/LICENSE b/wrt/node_modules/is-buffer/LICENSE
new file mode 100644 (file)
index 0000000..0c068ce
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Feross Aboukhadijeh
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/is-buffer/README.md b/wrt/node_modules/is-buffer/README.md
new file mode 100644 (file)
index 0000000..cb6f356
--- /dev/null
@@ -0,0 +1,49 @@
+# is-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][npm-url]
+
+#### Determine if an object is a [`Buffer`](http://nodejs.org/api/buffer.html) (including the [browserify Buffer](https://github.com/feross/buffer))
+
+[![saucelabs][saucelabs-image]][saucelabs-url]
+
+[travis-image]: https://img.shields.io/travis/feross/is-buffer/master.svg
+[travis-url]: https://travis-ci.org/feross/is-buffer
+[npm-image]: https://img.shields.io/npm/v/is-buffer.svg
+[npm-url]: https://npmjs.org/package/is-buffer
+[downloads-image]: https://img.shields.io/npm/dm/is-buffer.svg
+[saucelabs-image]: https://saucelabs.com/browser-matrix/is-buffer.svg
+[saucelabs-url]: https://saucelabs.com/u/is-buffer
+
+## Why not use `Buffer.isBuffer`?
+
+This module lets you check if an object is a `Buffer` without using `Buffer.isBuffer` (which includes the whole [buffer](https://github.com/feross/buffer) module in [browserify](http://browserify.org/)).
+
+It's future-proof and works in node too!
+
+## install
+
+```bash
+npm install is-buffer
+```
+
+## usage
+
+```js
+var isBuffer = require('is-buffer')
+
+isBuffer(new Buffer(4)) // true
+
+isBuffer(undefined) // false
+isBuffer(null) // false
+isBuffer('') // false
+isBuffer(true) // false
+isBuffer(false) // false
+isBuffer(0) // false
+isBuffer(1) // false
+isBuffer(1.0) // false
+isBuffer('string') // false
+isBuffer({}) // false
+isBuffer(function foo () {}) // false
+```
+
+## license
+
+MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org).
diff --git a/wrt/node_modules/is-buffer/index.js b/wrt/node_modules/is-buffer/index.js
new file mode 100644 (file)
index 0000000..36c808e
--- /dev/null
@@ -0,0 +1,21 @@
+/*!
+ * Determine if an object is a Buffer
+ *
+ * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
+ * @license  MIT
+ */
+
+// The _isBuffer check is for Safari 5-7 support, because it's missing
+// Object.prototype.constructor. Remove this eventually
+module.exports = function (obj) {
+  return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
+}
+
+function isBuffer (obj) {
+  return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
+}
+
+// For Node v0.10 support. Remove this eventually.
+function isSlowBuffer (obj) {
+  return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
+}
diff --git a/wrt/node_modules/is-buffer/package.json b/wrt/node_modules/is-buffer/package.json
new file mode 100644 (file)
index 0000000..85eae8e
--- /dev/null
@@ -0,0 +1,77 @@
+{
+  "_from": "is-buffer@^1.1.5",
+  "_id": "is-buffer@1.1.5",
+  "_inBundle": false,
+  "_integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=",
+  "_location": "/is-buffer",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "is-buffer@^1.1.5",
+    "name": "is-buffer",
+    "escapedName": "is-buffer",
+    "rawSpec": "^1.1.5",
+    "saveSpec": null,
+    "fetchSpec": "^1.1.5"
+  },
+  "_requiredBy": [
+    "/kind-of"
+  ],
+  "_resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz",
+  "_shasum": "1f3b26ef613b214b88cbca23cc6c01d87961eecc",
+  "_spec": "is-buffer@^1.1.5",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was/node_modules/kind-of",
+  "author": {
+    "name": "Feross Aboukhadijeh",
+    "email": "feross@feross.org",
+    "url": "http://feross.org/"
+  },
+  "bugs": {
+    "url": "https://github.com/feross/is-buffer/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {},
+  "deprecated": false,
+  "description": "Determine if an object is a Buffer",
+  "devDependencies": {
+    "standard": "*",
+    "tape": "^4.0.0",
+    "zuul": "^3.0.0"
+  },
+  "homepage": "https://github.com/feross/is-buffer#readme",
+  "keywords": [
+    "buffer",
+    "buffers",
+    "type",
+    "core buffer",
+    "browser buffer",
+    "browserify",
+    "typed array",
+    "uint32array",
+    "int16array",
+    "int32array",
+    "float32array",
+    "float64array",
+    "browser",
+    "arraybuffer",
+    "dataview"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "name": "is-buffer",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/feross/is-buffer.git"
+  },
+  "scripts": {
+    "test": "standard && npm run test-node && npm run test-browser",
+    "test-browser": "zuul -- test/*.js",
+    "test-browser-local": "zuul --local -- test/*.js",
+    "test-node": "tape test/*.js"
+  },
+  "testling": {
+    "files": "test/*.js"
+  },
+  "version": "1.1.5"
+}
diff --git a/wrt/node_modules/is-buffer/test/basic.js b/wrt/node_modules/is-buffer/test/basic.js
new file mode 100644 (file)
index 0000000..43b7c82
--- /dev/null
@@ -0,0 +1,25 @@
+var buffer = require('buffer')
+var isBuffer = require('../')
+var test = require('tape')
+
+test('is-buffer', function (t) {
+  t.equal(isBuffer(new Buffer(4)), true, 'new Buffer(4)')
+  t.equal(isBuffer(buffer.SlowBuffer(100)), true, 'SlowBuffer(100)')
+
+  t.equal(isBuffer(undefined), false, 'undefined')
+  t.equal(isBuffer(null), false, 'null')
+  t.equal(isBuffer(''), false, 'empty string')
+  t.equal(isBuffer(true), false, 'true')
+  t.equal(isBuffer(false), false, 'false')
+  t.equal(isBuffer(0), false, '0')
+  t.equal(isBuffer(1), false, '1')
+  t.equal(isBuffer(1.0), false, '1.0')
+  t.equal(isBuffer('string'), false, 'string')
+  t.equal(isBuffer({}), false, '{}')
+  t.equal(isBuffer([]), false, '[]')
+  t.equal(isBuffer(function foo () {}), false, 'function foo () {}')
+  t.equal(isBuffer({ isBuffer: null }), false, '{ isBuffer: null }')
+  t.equal(isBuffer({ isBuffer: function () { throw new Error() } }), false, '{ isBuffer: function () { throw new Error() } }')
+
+  t.end()
+})
diff --git a/wrt/node_modules/isarray/README.md b/wrt/node_modules/isarray/README.md
new file mode 100644 (file)
index 0000000..052a62b
--- /dev/null
@@ -0,0 +1,54 @@
+
+# isarray
+
+`Array#isArray` for older browsers.
+
+## Usage
+
+```js
+var isArray = require('isarray');
+
+console.log(isArray([])); // => true
+console.log(isArray({})); // => false
+```
+
+## Installation
+
+With [npm](http://npmjs.org) do
+
+```bash
+$ npm install isarray
+```
+
+Then bundle for the browser with
+[browserify](https://github.com/substack/browserify).
+
+With [component](http://component.io) do
+
+```bash
+$ component install juliangruber/isarray
+```
+
+## License
+
+(MIT)
+
+Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/wrt/node_modules/isarray/build/build.js b/wrt/node_modules/isarray/build/build.js
new file mode 100644 (file)
index 0000000..ec58596
--- /dev/null
@@ -0,0 +1,209 @@
+
+/**
+ * Require the given path.
+ *
+ * @param {String} path
+ * @return {Object} exports
+ * @api public
+ */
+
+function require(path, parent, orig) {
+  var resolved = require.resolve(path);
+
+  // lookup failed
+  if (null == resolved) {
+    orig = orig || path;
+    parent = parent || 'root';
+    var err = new Error('Failed to require "' + orig + '" from "' + parent + '"');
+    err.path = orig;
+    err.parent = parent;
+    err.require = true;
+    throw err;
+  }
+
+  var module = require.modules[resolved];
+
+  // perform real require()
+  // by invoking the module's
+  // registered function
+  if (!module.exports) {
+    module.exports = {};
+    module.client = module.component = true;
+    module.call(this, module.exports, require.relative(resolved), module);
+  }
+
+  return module.exports;
+}
+
+/**
+ * Registered modules.
+ */
+
+require.modules = {};
+
+/**
+ * Registered aliases.
+ */
+
+require.aliases = {};
+
+/**
+ * Resolve `path`.
+ *
+ * Lookup:
+ *
+ *   - PATH/index.js
+ *   - PATH.js
+ *   - PATH
+ *
+ * @param {String} path
+ * @return {String} path or null
+ * @api private
+ */
+
+require.resolve = function(path) {
+  if (path.charAt(0) === '/') path = path.slice(1);
+  var index = path + '/index.js';
+
+  var paths = [
+    path,
+    path + '.js',
+    path + '.json',
+    path + '/index.js',
+    path + '/index.json'
+  ];
+
+  for (var i = 0; i < paths.length; i++) {
+    var path = paths[i];
+    if (require.modules.hasOwnProperty(path)) return path;
+  }
+
+  if (require.aliases.hasOwnProperty(index)) {
+    return require.aliases[index];
+  }
+};
+
+/**
+ * Normalize `path` relative to the current path.
+ *
+ * @param {String} curr
+ * @param {String} path
+ * @return {String}
+ * @api private
+ */
+
+require.normalize = function(curr, path) {
+  var segs = [];
+
+  if ('.' != path.charAt(0)) return path;
+
+  curr = curr.split('/');
+  path = path.split('/');
+
+  for (var i = 0; i < path.length; ++i) {
+    if ('..' == path[i]) {
+      curr.pop();
+    } else if ('.' != path[i] && '' != path[i]) {
+      segs.push(path[i]);
+    }
+  }
+
+  return curr.concat(segs).join('/');
+};
+
+/**
+ * Register module at `path` with callback `definition`.
+ *
+ * @param {String} path
+ * @param {Function} definition
+ * @api private
+ */
+
+require.register = function(path, definition) {
+  require.modules[path] = definition;
+};
+
+/**
+ * Alias a module definition.
+ *
+ * @param {String} from
+ * @param {String} to
+ * @api private
+ */
+
+require.alias = function(from, to) {
+  if (!require.modules.hasOwnProperty(from)) {
+    throw new Error('Failed to alias "' + from + '", it does not exist');
+  }
+  require.aliases[to] = from;
+};
+
+/**
+ * Return a require function relative to the `parent` path.
+ *
+ * @param {String} parent
+ * @return {Function}
+ * @api private
+ */
+
+require.relative = function(parent) {
+  var p = require.normalize(parent, '..');
+
+  /**
+   * lastIndexOf helper.
+   */
+
+  function lastIndexOf(arr, obj) {
+    var i = arr.length;
+    while (i--) {
+      if (arr[i] === obj) return i;
+    }
+    return -1;
+  }
+
+  /**
+   * The relative require() itself.
+   */
+
+  function localRequire(path) {
+    var resolved = localRequire.resolve(path);
+    return require(resolved, parent, path);
+  }
+
+  /**
+   * Resolve relative to the parent.
+   */
+
+  localRequire.resolve = function(path) {
+    var c = path.charAt(0);
+    if ('/' == c) return path.slice(1);
+    if ('.' == c) return require.normalize(p, path);
+
+    // resolve deps by returning
+    // the dep in the nearest "deps"
+    // directory
+    var segs = parent.split('/');
+    var i = lastIndexOf(segs, 'deps') + 1;
+    if (!i) i = 0;
+    path = segs.slice(0, i + 1).join('/') + '/deps/' + path;
+    return path;
+  };
+
+  /**
+   * Check if module is defined at `path`.
+   */
+
+  localRequire.exists = function(path) {
+    return require.modules.hasOwnProperty(localRequire.resolve(path));
+  };
+
+  return localRequire;
+};
+require.register("isarray/index.js", function(exports, require, module){
+module.exports = Array.isArray || function (arr) {
+  return Object.prototype.toString.call(arr) == '[object Array]';
+};
+
+});
+require.alias("isarray/index.js", "isarray/index.js");
+
diff --git a/wrt/node_modules/isarray/component.json b/wrt/node_modules/isarray/component.json
new file mode 100644 (file)
index 0000000..9e31b68
--- /dev/null
@@ -0,0 +1,19 @@
+{
+  "name" : "isarray",
+  "description" : "Array#isArray for older browsers",
+  "version" : "0.0.1",
+  "repository" : "juliangruber/isarray",
+  "homepage": "https://github.com/juliangruber/isarray",
+  "main" : "index.js",
+  "scripts" : [
+    "index.js"
+  ],
+  "dependencies" : {},
+  "keywords": ["browser","isarray","array"],
+  "author": {
+    "name": "Julian Gruber",
+    "email": "mail@juliangruber.com",
+    "url": "http://juliangruber.com"
+  },
+  "license": "MIT"
+}
diff --git a/wrt/node_modules/isarray/index.js b/wrt/node_modules/isarray/index.js
new file mode 100644 (file)
index 0000000..5f5ad45
--- /dev/null
@@ -0,0 +1,3 @@
+module.exports = Array.isArray || function (arr) {
+  return Object.prototype.toString.call(arr) == '[object Array]';
+};
diff --git a/wrt/node_modules/isarray/package.json b/wrt/node_modules/isarray/package.json
new file mode 100644 (file)
index 0000000..44b961c
--- /dev/null
@@ -0,0 +1,86 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "isarray@0.0.1",
+        "scope": null,
+        "escapedName": "isarray",
+        "name": "isarray",
+        "rawSpec": "0.0.1",
+        "spec": "0.0.1",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/readable-stream"
+    ]
+  ],
+  "_from": "isarray@0.0.1",
+  "_id": "isarray@0.0.1",
+  "_inCache": true,
+  "_location": "/isarray",
+  "_npmUser": {
+    "name": "juliangruber",
+    "email": "julian@juliangruber.com"
+  },
+  "_npmVersion": "1.2.18",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "isarray@0.0.1",
+    "scope": null,
+    "escapedName": "isarray",
+    "name": "isarray",
+    "rawSpec": "0.0.1",
+    "spec": "0.0.1",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/readable-stream"
+  ],
+  "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
+  "_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf",
+  "_shrinkwrap": null,
+  "_spec": "isarray@0.0.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/readable-stream",
+  "author": {
+    "name": "Julian Gruber",
+    "email": "mail@juliangruber.com",
+    "url": "http://juliangruber.com"
+  },
+  "bugs": {
+    "url": "https://github.com/juliangruber/isarray/issues"
+  },
+  "dependencies": {},
+  "description": "Array#isArray for older browsers",
+  "devDependencies": {
+    "tap": "*"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf",
+    "tarball": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
+  },
+  "homepage": "https://github.com/juliangruber/isarray",
+  "keywords": [
+    "browser",
+    "isarray",
+    "array"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "juliangruber",
+      "email": "julian@juliangruber.com"
+    }
+  ],
+  "name": "isarray",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/juliangruber/isarray.git"
+  },
+  "scripts": {
+    "test": "tap test/*.js"
+  },
+  "version": "0.0.1"
+}
diff --git a/wrt/node_modules/kind-of/LICENSE b/wrt/node_modules/kind-of/LICENSE
new file mode 100644 (file)
index 0000000..d734237
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014-2017, Jon Schlinkert
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/kind-of/README.md b/wrt/node_modules/kind-of/README.md
new file mode 100644 (file)
index 0000000..6a9df36
--- /dev/null
@@ -0,0 +1,261 @@
+# kind-of [![NPM version](https://img.shields.io/npm/v/kind-of.svg?style=flat)](https://www.npmjs.com/package/kind-of) [![NPM monthly downloads](https://img.shields.io/npm/dm/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![NPM total downloads](https://img.shields.io/npm/dt/kind-of.svg?style=flat)](https://npmjs.org/package/kind-of) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/kind-of.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/kind-of)
+
+> Get the native type of a value.
+
+## Install
+
+Install with [npm](https://www.npmjs.com/):
+
+```sh
+$ npm install --save kind-of
+```
+
+## Install
+
+Install with [bower](https://bower.io/)
+
+```sh
+$ bower install kind-of --save
+```
+
+## Usage
+
+> es5, browser and es6 ready
+
+```js
+var kindOf = require('kind-of');
+
+kindOf(undefined);
+//=> 'undefined'
+
+kindOf(null);
+//=> 'null'
+
+kindOf(true);
+//=> 'boolean'
+
+kindOf(false);
+//=> 'boolean'
+
+kindOf(new Boolean(true));
+//=> 'boolean'
+
+kindOf(new Buffer(''));
+//=> 'buffer'
+
+kindOf(42);
+//=> 'number'
+
+kindOf(new Number(42));
+//=> 'number'
+
+kindOf('str');
+//=> 'string'
+
+kindOf(new String('str'));
+//=> 'string'
+
+kindOf(arguments);
+//=> 'arguments'
+
+kindOf({});
+//=> 'object'
+
+kindOf(Object.create(null));
+//=> 'object'
+
+kindOf(new Test());
+//=> 'object'
+
+kindOf(new Date());
+//=> 'date'
+
+kindOf([]);
+//=> 'array'
+
+kindOf([1, 2, 3]);
+//=> 'array'
+
+kindOf(new Array());
+//=> 'array'
+
+kindOf(/foo/);
+//=> 'regexp'
+
+kindOf(new RegExp('foo'));
+//=> 'regexp'
+
+kindOf(function () {});
+//=> 'function'
+
+kindOf(function * () {});
+//=> 'function'
+
+kindOf(new Function());
+//=> 'function'
+
+kindOf(new Map());
+//=> 'map'
+
+kindOf(new WeakMap());
+//=> 'weakmap'
+
+kindOf(new Set());
+//=> 'set'
+
+kindOf(new WeakSet());
+//=> 'weakset'
+
+kindOf(Symbol('str'));
+//=> 'symbol'
+
+kindOf(new Int8Array());
+//=> 'int8array'
+
+kindOf(new Uint8Array());
+//=> 'uint8array'
+
+kindOf(new Uint8ClampedArray());
+//=> 'uint8clampedarray'
+
+kindOf(new Int16Array());
+//=> 'int16array'
+
+kindOf(new Uint16Array());
+//=> 'uint16array'
+
+kindOf(new Int32Array());
+//=> 'int32array'
+
+kindOf(new Uint32Array());
+//=> 'uint32array'
+
+kindOf(new Float32Array());
+//=> 'float32array'
+
+kindOf(new Float64Array());
+//=> 'float64array'
+```
+
+## Benchmarks
+
+Benchmarked against [typeof](http://github.com/CodingFu/typeof) and [type-of](https://github.com/ForbesLindesay/type-of).
+Note that performaces is slower for es6 features `Map`, `WeakMap`, `Set` and `WeakSet`.
+
+```bash
+#1: array
+  current x 23,329,397 ops/sec ±0.82% (94 runs sampled)
+  lib-type-of x 4,170,273 ops/sec ±0.55% (94 runs sampled)
+  lib-typeof x 9,686,935 ops/sec ±0.59% (98 runs sampled)
+
+#2: boolean
+  current x 27,197,115 ops/sec ±0.85% (94 runs sampled)
+  lib-type-of x 3,145,791 ops/sec ±0.73% (97 runs sampled)
+  lib-typeof x 9,199,562 ops/sec ±0.44% (99 runs sampled)
+
+#3: date
+  current x 20,190,117 ops/sec ±0.86% (92 runs sampled)
+  lib-type-of x 5,166,970 ops/sec ±0.74% (94 runs sampled)
+  lib-typeof x 9,610,821 ops/sec ±0.50% (96 runs sampled)
+
+#4: function
+  current x 23,855,460 ops/sec ±0.60% (97 runs sampled)
+  lib-type-of x 5,667,740 ops/sec ±0.54% (100 runs sampled)
+  lib-typeof x 10,010,644 ops/sec ±0.44% (100 runs sampled)
+
+#5: null
+  current x 27,061,047 ops/sec ±0.97% (96 runs sampled)
+  lib-type-of x 13,965,573 ops/sec ±0.62% (97 runs sampled)
+  lib-typeof x 8,460,194 ops/sec ±0.61% (97 runs sampled)
+
+#6: number
+  current x 25,075,682 ops/sec ±0.53% (99 runs sampled)
+  lib-type-of x 2,266,405 ops/sec ±0.41% (98 runs sampled)
+  lib-typeof x 9,821,481 ops/sec ±0.45% (99 runs sampled)
+
+#7: object
+  current x 3,348,980 ops/sec ±0.49% (99 runs sampled)
+  lib-type-of x 3,245,138 ops/sec ±0.60% (94 runs sampled)
+  lib-typeof x 9,262,952 ops/sec ±0.59% (99 runs sampled)
+
+#8: regex
+  current x 21,284,827 ops/sec ±0.72% (96 runs sampled)
+  lib-type-of x 4,689,241 ops/sec ±0.43% (100 runs sampled)
+  lib-typeof x 8,957,593 ops/sec ±0.62% (98 runs sampled)
+
+#9: string
+  current x 25,379,234 ops/sec ±0.58% (96 runs sampled)
+  lib-type-of x 3,635,148 ops/sec ±0.76% (93 runs sampled)
+  lib-typeof x 9,494,134 ops/sec ±0.49% (98 runs sampled)
+
+#10: undef
+  current x 27,459,221 ops/sec ±1.01% (93 runs sampled)
+  lib-type-of x 14,360,433 ops/sec ±0.52% (99 runs sampled)
+  lib-typeof x 23,202,868 ops/sec ±0.59% (94 runs sampled)
+
+```
+
+## Optimizations
+
+In 7 out of 8 cases, this library is 2x-10x faster than other top libraries included in the benchmarks. There are a few things that lead to this performance advantage, none of them hard and fast rules, but all of them simple and repeatable in almost any code library:
+
+1. Optimize around the fastest and most common use cases first. Of course, this will change from project-to-project, but I took some time to understand how and why `typeof` checks were being used in my own libraries and other libraries I use a lot.
+2. Optimize around bottlenecks - In other words, the order in which conditionals are implemented is significant, because each check is only as fast as the failing checks that came before it. Here, the biggest bottleneck by far is checking for plain objects (an object that was created by the `Object` constructor). I opted to make this check happen by process of elimination rather than brute force up front (e.g. by using something like `val.constructor.name`), so that every other type check would not be penalized it.
+3. Don't do uneccessary processing - why do `.slice(8, -1).toLowerCase();` just to get the word `regex`? It's much faster to do `if (type === '[object RegExp]') return 'regex'`
+
+## About
+
+### Related projects
+
+* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet")
+* [is-number](https://www.npmjs.com/package/is-number): Returns true if the value is a number. comprehensive tests. | [homepage](https://github.com/jonschlinkert/is-number "Returns true if the value is a number. comprehensive tests.")
+* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive.  | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ")
+
+### Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
+
+### Contributors
+
+| **Commits** | **Contributor** | 
+| --- | --- |
+| 59 | [jonschlinkert](https://github.com/jonschlinkert) |
+| 2 | [miguelmota](https://github.com/miguelmota) |
+| 1 | [dtothefp](https://github.com/dtothefp) |
+| 1 | [ksheedlo](https://github.com/ksheedlo) |
+| 1 | [pdehaan](https://github.com/pdehaan) |
+| 1 | [laggingreflex](https://github.com/laggingreflex) |
+
+### Building docs
+
+_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
+
+To generate the readme, run the following command:
+
+```sh
+$ npm install -g verbose/verb#dev verb-generate-readme && verb
+```
+
+### Running tests
+
+Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
+
+```sh
+$ npm install && npm test
+```
+
+### Author
+
+**Jon Schlinkert**
+
+* [github/jonschlinkert](https://github.com/jonschlinkert)
+* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
+
+### License
+
+Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
+Released under the [MIT License](LICENSE).
+
+***
+
+_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on May 16, 2017._
\ No newline at end of file
diff --git a/wrt/node_modules/kind-of/index.js b/wrt/node_modules/kind-of/index.js
new file mode 100644 (file)
index 0000000..b52c291
--- /dev/null
@@ -0,0 +1,116 @@
+var isBuffer = require('is-buffer');
+var toString = Object.prototype.toString;
+
+/**
+ * Get the native `typeof` a value.
+ *
+ * @param  {*} `val`
+ * @return {*} Native javascript type
+ */
+
+module.exports = function kindOf(val) {
+  // primitivies
+  if (typeof val === 'undefined') {
+    return 'undefined';
+  }
+  if (val === null) {
+    return 'null';
+  }
+  if (val === true || val === false || val instanceof Boolean) {
+    return 'boolean';
+  }
+  if (typeof val === 'string' || val instanceof String) {
+    return 'string';
+  }
+  if (typeof val === 'number' || val instanceof Number) {
+    return 'number';
+  }
+
+  // functions
+  if (typeof val === 'function' || val instanceof Function) {
+    return 'function';
+  }
+
+  // array
+  if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) {
+    return 'array';
+  }
+
+  // check for instances of RegExp and Date before calling `toString`
+  if (val instanceof RegExp) {
+    return 'regexp';
+  }
+  if (val instanceof Date) {
+    return 'date';
+  }
+
+  // other objects
+  var type = toString.call(val);
+
+  if (type === '[object RegExp]') {
+    return 'regexp';
+  }
+  if (type === '[object Date]') {
+    return 'date';
+  }
+  if (type === '[object Arguments]') {
+    return 'arguments';
+  }
+  if (type === '[object Error]') {
+    return 'error';
+  }
+
+  // buffer
+  if (isBuffer(val)) {
+    return 'buffer';
+  }
+
+  // es6: Map, WeakMap, Set, WeakSet
+  if (type === '[object Set]') {
+    return 'set';
+  }
+  if (type === '[object WeakSet]') {
+    return 'weakset';
+  }
+  if (type === '[object Map]') {
+    return 'map';
+  }
+  if (type === '[object WeakMap]') {
+    return 'weakmap';
+  }
+  if (type === '[object Symbol]') {
+    return 'symbol';
+  }
+
+  // typed arrays
+  if (type === '[object Int8Array]') {
+    return 'int8array';
+  }
+  if (type === '[object Uint8Array]') {
+    return 'uint8array';
+  }
+  if (type === '[object Uint8ClampedArray]') {
+    return 'uint8clampedarray';
+  }
+  if (type === '[object Int16Array]') {
+    return 'int16array';
+  }
+  if (type === '[object Uint16Array]') {
+    return 'uint16array';
+  }
+  if (type === '[object Int32Array]') {
+    return 'int32array';
+  }
+  if (type === '[object Uint32Array]') {
+    return 'uint32array';
+  }
+  if (type === '[object Float32Array]') {
+    return 'float32array';
+  }
+  if (type === '[object Float64Array]') {
+    return 'float64array';
+  }
+
+  // must be a plain object
+  return 'object';
+};
diff --git a/wrt/node_modules/kind-of/package.json b/wrt/node_modules/kind-of/package.json
new file mode 100644 (file)
index 0000000..453f163
--- /dev/null
@@ -0,0 +1,139 @@
+{
+  "_from": "kind-of@^3.0.2",
+  "_id": "kind-of@3.2.2",
+  "_inBundle": false,
+  "_integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
+  "_location": "/kind-of",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "kind-of@^3.0.2",
+    "name": "kind-of",
+    "escapedName": "kind-of",
+    "rawSpec": "^3.0.2",
+    "saveSpec": null,
+    "fetchSpec": "^3.0.2"
+  },
+  "_requiredBy": [
+    "/align-text"
+  ],
+  "_resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+  "_shasum": "31ea21a734bab9bbb0f32466d893aea51e4a3c64",
+  "_spec": "kind-of@^3.0.2",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was/node_modules/align-text",
+  "author": {
+    "name": "Jon Schlinkert",
+    "url": "https://github.com/jonschlinkert"
+  },
+  "bugs": {
+    "url": "https://github.com/jonschlinkert/kind-of/issues"
+  },
+  "bundleDependencies": false,
+  "contributors": [
+    {
+      "name": "David Fox-Powell",
+      "url": "https://dtothefp.github.io/me"
+    },
+    {
+      "name": "Jon Schlinkert",
+      "url": "http://twitter.com/jonschlinkert"
+    },
+    {
+      "name": "Ken Sheedlo",
+      "url": "kensheedlo.com"
+    },
+    {
+      "name": "laggingreflex",
+      "url": "https://github.com/laggingreflex"
+    },
+    {
+      "name": "Miguel Mota",
+      "url": "https://miguelmota.com"
+    },
+    {
+      "name": "Peter deHaan",
+      "url": "http://about.me/peterdehaan"
+    }
+  ],
+  "dependencies": {
+    "is-buffer": "^1.1.5"
+  },
+  "deprecated": false,
+  "description": "Get the native type of a value.",
+  "devDependencies": {
+    "ansi-bold": "^0.1.1",
+    "benchmarked": "^1.0.0",
+    "browserify": "^14.3.0",
+    "glob": "^7.1.1",
+    "gulp-format-md": "^0.1.12",
+    "mocha": "^3.3.0",
+    "type-of": "^2.0.1",
+    "typeof": "^1.0.0"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/jonschlinkert/kind-of",
+  "keywords": [
+    "arguments",
+    "array",
+    "boolean",
+    "check",
+    "date",
+    "function",
+    "is",
+    "is-type",
+    "is-type-of",
+    "kind",
+    "kind-of",
+    "number",
+    "object",
+    "of",
+    "regexp",
+    "string",
+    "test",
+    "type",
+    "type-of",
+    "typeof",
+    "types"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "name": "kind-of",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/jonschlinkert/kind-of.git"
+  },
+  "scripts": {
+    "prepublish": "browserify -o browser.js -e index.js -s index --bare",
+    "test": "mocha"
+  },
+  "verb": {
+    "related": {
+      "list": [
+        "is-glob",
+        "is-number",
+        "is-primitive"
+      ]
+    },
+    "toc": false,
+    "layout": "default",
+    "tasks": [
+      "readme"
+    ],
+    "plugins": [
+      "gulp-format-md"
+    ],
+    "lint": {
+      "reflinks": true
+    },
+    "reflinks": [
+      "verb"
+    ]
+  },
+  "version": "3.2.2"
+}
diff --git a/wrt/node_modules/lazy-cache/LICENSE b/wrt/node_modules/lazy-cache/LICENSE
new file mode 100644 (file)
index 0000000..1e49edf
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2015-2016, Jon Schlinkert.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/lazy-cache/README.md b/wrt/node_modules/lazy-cache/README.md
new file mode 100644 (file)
index 0000000..33b5a4d
--- /dev/null
@@ -0,0 +1,147 @@
+# lazy-cache [![NPM version](https://img.shields.io/npm/v/lazy-cache.svg?style=flat)](https://www.npmjs.com/package/lazy-cache) [![NPM downloads](https://img.shields.io/npm/dm/lazy-cache.svg?style=flat)](https://npmjs.org/package/lazy-cache) [![Build Status](https://img.shields.io/travis/jonschlinkert/lazy-cache.svg?style=flat)](https://travis-ci.org/jonschlinkert/lazy-cache)
+
+> Cache requires to be lazy-loaded when needed.
+
+## Install
+
+Install with [npm](https://www.npmjs.com/):
+
+```sh
+$ npm install lazy-cache --save
+```
+
+If you use webpack and are experiencing issues, try using [unlazy-loader](https://github.com/doowb/unlazy-loader), a webpack loader that fixes the bug that prevents webpack from working with native javascript getters.
+
+## Usage
+
+```js
+var utils = require('lazy-cache')(require);
+```
+
+**Use as a property on `lazy`**
+
+The module is also added as a property to the `lazy` function
+so it can be called without having to call a function first.
+
+```js
+var utils = require('lazy-cache')(require);
+
+// `npm install glob`
+utils('glob');
+
+// glob sync
+console.log(utils.glob.sync('*.js'));
+
+// glob async
+utils.glob('*.js', function (err, files) {
+  console.log(files);
+});
+```
+
+**Use as a function**
+
+```js
+var utils = require('lazy-cache')(require);
+var glob = utils('glob');
+
+// `glob` is a now a function that may be called when needed
+glob().sync('foo/*.js');
+```
+
+## Aliases
+
+An alias may be passed as the second argument if you don't want to use the automatically camel-cased variable name.
+
+**Example**
+
+```js
+var utils = require('lazy-cache')(require);
+
+// alias `ansi-yellow` as `yellow`
+utils('ansi-yellow', 'yellow');
+console.log(utils.yellow('foo'));
+```
+
+## Browserify usage
+
+**Example**
+
+```js
+var utils = require('lazy-cache')(require);
+// temporarily re-assign `require` to trick browserify
+var fn = require;
+require = utils;
+// list module dependencies (here, `require` is actually `lazy-cache`)
+require('glob');
+require = fn; // restore the native `require` function
+
+/**
+ * Now you can use glob with the `utils.glob` variable
+ */
+
+// sync
+console.log(utils.glob.sync('*.js'));
+
+// async
+utils.glob('*.js', function (err, files) {
+  console.log(files.join('\n'));
+});
+```
+
+## Kill switch
+
+In certain rare edge cases it may be necessary to unlazy all lazy-cached dependencies (5 reported cases after ~30 million downloads).
+
+To force lazy-cache to immediately invoke all dependencies, do:
+
+```js
+process.env.UNLAZY = true;
+```
+
+## Related projects
+
+You might also be interested in these projects:
+
+[lint-deps](https://www.npmjs.com/package/lint-deps): CLI tool that tells you when dependencies are missing from package.json and offers you a… [more](https://www.npmjs.com/package/lint-deps) | [homepage](https://github.com/jonschlinkert/lint-deps)
+
+## Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/lazy-cache/issues/new).
+
+## Building docs
+
+Generate readme and API documentation with [verb](https://github.com/verbose/verb):
+
+```sh
+$ npm install verb && npm run docs
+```
+
+Or, if [verb](https://github.com/verbose/verb) is installed globally:
+
+```sh
+$ verb
+```
+
+## Running tests
+
+Install dev dependencies:
+
+```sh
+$ npm install -d && npm test
+```
+
+## Author
+
+**Jon Schlinkert**
+
+* [github/jonschlinkert](https://github.com/jonschlinkert)
+* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
+
+## License
+
+Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
+Released under the [MIT license](https://github.com/jonschlinkert/lazy-cache/blob/master/LICENSE).
+
+***
+
+_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on April 22, 2016._
\ No newline at end of file
diff --git a/wrt/node_modules/lazy-cache/index.js b/wrt/node_modules/lazy-cache/index.js
new file mode 100644 (file)
index 0000000..da7897d
--- /dev/null
@@ -0,0 +1,67 @@
+'use strict';
+
+/**
+ * Cache results of the first function call to ensure only calling once.
+ *
+ * ```js
+ * var utils = require('lazy-cache')(require);
+ * // cache the call to `require('ansi-yellow')`
+ * utils('ansi-yellow', 'yellow');
+ * // use `ansi-yellow`
+ * console.log(utils.yellow('this is yellow'));
+ * ```
+ *
+ * @param  {Function} `fn` Function that will be called only once.
+ * @return {Function} Function that can be called to get the cached function
+ * @api public
+ */
+
+function lazyCache(fn) {
+  var cache = {};
+  var proxy = function(mod, name) {
+    name = name || camelcase(mod);
+
+    // check both boolean and string in case `process.env` cases to string
+    if (process.env.UNLAZY === 'true' || process.env.UNLAZY === true || process.env.TRAVIS) {
+      cache[name] = fn(mod);
+    }
+
+    Object.defineProperty(proxy, name, {
+      enumerable: true,
+      configurable: true,
+      get: getter
+    });
+
+    function getter() {
+      if (cache.hasOwnProperty(name)) {
+        return cache[name];
+      }
+      return (cache[name] = fn(mod));
+    }
+    return getter;
+  };
+  return proxy;
+}
+
+/**
+ * Used to camelcase the name to be stored on the `lazy` object.
+ *
+ * @param  {String} `str` String containing `_`, `.`, `-` or whitespace that will be camelcased.
+ * @return {String} camelcased string.
+ */
+
+function camelcase(str) {
+  if (str.length === 1) {
+    return str.toLowerCase();
+  }
+  str = str.replace(/^[\W_]+|[\W_]+$/g, '').toLowerCase();
+  return str.replace(/[\W_]+(\w|$)/g, function(_, ch) {
+    return ch.toUpperCase();
+  });
+}
+
+/**
+ * Expose `lazyCache`
+ */
+
+module.exports = lazyCache;
diff --git a/wrt/node_modules/lazy-cache/package.json b/wrt/node_modules/lazy-cache/package.json
new file mode 100644 (file)
index 0000000..b3b651b
--- /dev/null
@@ -0,0 +1,89 @@
+{
+  "_from": "lazy-cache@^1.0.3",
+  "_id": "lazy-cache@1.0.4",
+  "_inBundle": false,
+  "_integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=",
+  "_location": "/lazy-cache",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "lazy-cache@^1.0.3",
+    "name": "lazy-cache",
+    "escapedName": "lazy-cache",
+    "rawSpec": "^1.0.3",
+    "saveSpec": null,
+    "fetchSpec": "^1.0.3"
+  },
+  "_requiredBy": [
+    "/center-align"
+  ],
+  "_resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz",
+  "_shasum": "a1d78fc3a50474cb80845d3b3b6e1da49a446e8e",
+  "_spec": "lazy-cache@^1.0.3",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was/node_modules/center-align",
+  "author": {
+    "name": "Jon Schlinkert",
+    "url": "https://github.com/jonschlinkert"
+  },
+  "bugs": {
+    "url": "https://github.com/jonschlinkert/lazy-cache/issues"
+  },
+  "bundleDependencies": false,
+  "deprecated": false,
+  "description": "Cache requires to be lazy-loaded when needed.",
+  "devDependencies": {
+    "ansi-yellow": "^0.1.1",
+    "glob": "^7.0.3",
+    "gulp-format-md": "^0.1.8",
+    "mocha": "^2.4.5"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/jonschlinkert/lazy-cache",
+  "keywords": [
+    "cache",
+    "caching",
+    "dependencies",
+    "dependency",
+    "lazy",
+    "require",
+    "requires"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "name": "lazy-cache",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/jonschlinkert/lazy-cache.git"
+  },
+  "scripts": {
+    "test": "mocha"
+  },
+  "verb": {
+    "related": {
+      "list": [
+        "lint-deps"
+      ]
+    },
+    "plugins": [
+      "gulp-format-md"
+    ],
+    "toc": false,
+    "layout": "default",
+    "tasks": [
+      "readme"
+    ],
+    "lint": {
+      "reflinks": true
+    },
+    "reflinks": [
+      "verb"
+    ]
+  },
+  "version": "1.0.4"
+}
diff --git a/wrt/node_modules/longest/LICENSE b/wrt/node_modules/longest/LICENSE
new file mode 100644 (file)
index 0000000..fa30c4c
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014-2015, Jon Schlinkert.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/longest/README.md b/wrt/node_modules/longest/README.md
new file mode 100644 (file)
index 0000000..cdffe65
--- /dev/null
@@ -0,0 +1,65 @@
+# longest [![NPM version](https://badge.fury.io/js/longest.svg)](http://badge.fury.io/js/longest)  [![Build Status](https://travis-ci.org/jonschlinkert/longest.svg)](https://travis-ci.org/jonschlinkert/longest) 
+
+> Get the longest item in an array.
+
+## Install with [npm](npmjs.org)
+
+```bash
+npm i longest --save
+```
+### Install with [bower](https://github.com/bower/bower)
+
+```bash
+bower install longest --save
+```
+
+## Running tests
+Install dev dependencies.
+
+```bash
+npm i -d && npm test
+```
+
+## Usage
+
+```js
+var longest = require('longest');
+longest(['a', 'abcde', 'abc']);
+//=> 'abcde'
+
+longest(['a', 'abcde', 'abc']).length;
+//=> 5
+```
+
+## Related projects
+* [longest-value](https://github.com/jonschlinkert/longest-value): Get the longest value for the given property from an array of objects. Useful for aligning values.
+* [right-align-values](https://github.com/jonschlinkert/right-align-values): Right align the values of a given property for each object in an array. Useful for creating text columns or tables.
+* [right-pad-values](https://github.com/jonschlinkert/right-pad-values): Right pad the values of a given property for each object in an array. Useful for creating text columns or tables.
+* [repeat-string](https://github.com/jonschlinkert/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string.
+* [pad-right](https://github.com/jonschlinkert/pad-right): Right pad a string with zeros or a specified string. Fastest implementation.
+* [pad-left](https://github.com/jonschlinkert/pad-left): Left pad a string with zeros or a specified string. Fastest implementation.  
+
+## Running tests
+Install dev dependencies.
+
+```bash
+npm i -d && npm test
+```
+
+## Contributing
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/longest/issues)
+
+## Author
+
+**Jon Schlinkert**
++ [github/jonschlinkert](https://github.com/jonschlinkert)
++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) 
+
+## License
+Copyright (c) 2015 Jon Schlinkert  
+Released under the MIT license
+
+***
+
+_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on March 31, 2015._
\ No newline at end of file
diff --git a/wrt/node_modules/longest/index.js b/wrt/node_modules/longest/index.js
new file mode 100644 (file)
index 0000000..9892e52
--- /dev/null
@@ -0,0 +1,37 @@
+/*!
+ * longest <https://github.com/jonschlinkert/longest>
+ *
+ * Copyright (c) 2014-2015, Jon Schlinkert.
+ * Licensed under the MIT License.
+ */
+
+'use strict';
+
+module.exports = function(arr) {
+  if (!arr) {
+    return null;
+  }
+
+  var len = arr.length;
+  if (!len) {
+    return null;
+  }
+
+  var c = 0;
+  var i = 0;
+  var ele;
+  var elen;
+  var res;
+
+  for (; i < len; i++) {
+    ele = arr[i].toString();
+    elen = ele.length;
+
+    if (elen > c) {
+      res = ele;
+      c = elen;
+    }
+  }
+
+  return res;
+};
diff --git a/wrt/node_modules/longest/package.json b/wrt/node_modules/longest/package.json
new file mode 100644 (file)
index 0000000..415430d
--- /dev/null
@@ -0,0 +1,68 @@
+{
+  "_from": "longest@^1.0.1",
+  "_id": "longest@1.0.1",
+  "_inBundle": false,
+  "_integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=",
+  "_location": "/longest",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "longest@^1.0.1",
+    "name": "longest",
+    "escapedName": "longest",
+    "rawSpec": "^1.0.1",
+    "saveSpec": null,
+    "fetchSpec": "^1.0.1"
+  },
+  "_requiredBy": [
+    "/align-text"
+  ],
+  "_resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz",
+  "_shasum": "30a0b2da38f73770e8294a0d22e6625ed77d0097",
+  "_spec": "longest@^1.0.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was/node_modules/align-text",
+  "author": {
+    "name": "Jon Schlinkert",
+    "url": "https://github.com/jonschlinkert"
+  },
+  "bugs": {
+    "url": "https://github.com/jonschlinkert/longest/issues"
+  },
+  "bundleDependencies": false,
+  "deprecated": false,
+  "description": "Get the longest item in an array.",
+  "devDependencies": {
+    "fill-range": "^2.1.0",
+    "mocha": "*"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/jonschlinkert/longest",
+  "keywords": [
+    "array",
+    "element",
+    "item",
+    "long",
+    "length",
+    "longest"
+  ],
+  "license": {
+    "type": "MIT",
+    "url": "https://github.com/jonschlinkert/longest/blob/master/LICENSE"
+  },
+  "main": "index.js",
+  "name": "longest",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/jonschlinkert/longest.git"
+  },
+  "scripts": {
+    "test": "mocha"
+  },
+  "version": "1.0.1"
+}
diff --git a/wrt/node_modules/match-stream/.idea/.name b/wrt/node_modules/match-stream/.idea/.name
new file mode 100644 (file)
index 0000000..fb0c74e
--- /dev/null
@@ -0,0 +1 @@
+match-stream
\ No newline at end of file
diff --git a/wrt/node_modules/match-stream/.idea/encodings.xml b/wrt/node_modules/match-stream/.idea/encodings.xml
new file mode 100644 (file)
index 0000000..e206d70
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
+</project>
+
diff --git a/wrt/node_modules/match-stream/.idea/jsLibraryMappings.xml b/wrt/node_modules/match-stream/.idea/jsLibraryMappings.xml
new file mode 100644 (file)
index 0000000..9898895
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="JavaScriptLibraryMappings">
+    <file url="PROJECT" libraries="{Node.js v0.9.12 Core Modules}" />
+  </component>
+</project>
+
diff --git a/wrt/node_modules/match-stream/.idea/match-stream.iml b/wrt/node_modules/match-stream/.idea/match-stream.iml
new file mode 100644 (file)
index 0000000..7ca609e
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="WEB_MODULE" version="4">
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$" />
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="library" name="Node.js v0.9.12 Core Modules" level="application" />
+  </component>
+</module>
+
diff --git a/wrt/node_modules/match-stream/.idea/misc.xml b/wrt/node_modules/match-stream/.idea/misc.xml
new file mode 100644 (file)
index 0000000..1162f43
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectRootManager" version="2" />
+</project>
+
diff --git a/wrt/node_modules/match-stream/.idea/modules.xml b/wrt/node_modules/match-stream/.idea/modules.xml
new file mode 100644 (file)
index 0000000..7159708
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/match-stream.iml" filepath="$PROJECT_DIR$/.idea/match-stream.iml" />
+    </modules>
+  </component>
+</project>
+
diff --git a/wrt/node_modules/match-stream/.idea/scopes/scope_settings.xml b/wrt/node_modules/match-stream/.idea/scopes/scope_settings.xml
new file mode 100644 (file)
index 0000000..922003b
--- /dev/null
@@ -0,0 +1,5 @@
+<component name="DependencyValidationManager">
+  <state>
+    <option name="SKIP_IMPORT_STATEMENTS" value="false" />
+  </state>
+</component>
\ No newline at end of file
diff --git a/wrt/node_modules/match-stream/.idea/vcs.xml b/wrt/node_modules/match-stream/.idea/vcs.xml
new file mode 100644 (file)
index 0000000..9d32e50
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="" vcs="" />
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
+  </component>
+</project>
+
diff --git a/wrt/node_modules/match-stream/.idea/workspace.xml b/wrt/node_modules/match-stream/.idea/workspace.xml
new file mode 100644 (file)
index 0000000..c259a7d
--- /dev/null
@@ -0,0 +1,434 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ChangeListManager">
+    <list default="true" id="6f2c25bb-86f8-4448-bba5-59bca70aeec8" name="Default" comment="" />
+    <ignored path="match-stream.iws" />
+    <ignored path=".idea/workspace.xml" />
+    <file path="/until.js" changelist="6f2c25bb-86f8-4448-bba5-59bca70aeec8" time="1363328129947" ignored="false" />
+    <file path="/match.js" changelist="6f2c25bb-86f8-4448-bba5-59bca70aeec8" time="1362945907050" ignored="false" />
+    <file path="/Dummy.txt" changelist="6f2c25bb-86f8-4448-bba5-59bca70aeec8" time="1363326769174" ignored="false" />
+    <file path="/_stream_transform.js" changelist="6f2c25bb-86f8-4448-bba5-59bca70aeec8" time="1362890686540" ignored="false" />
+    <file path="/split.js" changelist="6f2c25bb-86f8-4448-bba5-59bca70aeec8" time="1363054598649" ignored="false" />
+    <file path="/README.md" changelist="6f2c25bb-86f8-4448-bba5-59bca70aeec8" time="1363328840341" ignored="false" />
+    <file path="$PROJECT_DIR$/../slice-stream/examples/until.js" changelist="6f2c25bb-86f8-4448-bba5-59bca70aeec8" time="1363328367631" ignored="false" />
+    <file path="$PROJECT_DIR$/../slice-stream/slicestream.js" changelist="6f2c25bb-86f8-4448-bba5-59bca70aeec8" time="1363328367631" ignored="false" />
+    <file path="/slicestream.js" changelist="6f2c25bb-86f8-4448-bba5-59bca70aeec8" time="1363327928400" ignored="false" />
+    <file path="$PROJECT_DIR$/../slice-stream/package.json" changelist="6f2c25bb-86f8-4448-bba5-59bca70aeec8" time="1363328725638" ignored="false" />
+    <file path="$PROJECT_DIR$/../slice-stream/test/until.js" changelist="6f2c25bb-86f8-4448-bba5-59bca70aeec8" time="1363328367631" ignored="false" />
+    <file path="$PROJECT_DIR$/../slice-stream/README.md" changelist="6f2c25bb-86f8-4448-bba5-59bca70aeec8" time="1363328840341" ignored="false" />
+    <option name="TRACKING_ENABLED" value="true" />
+    <option name="SHOW_DIALOG" value="false" />
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+    <option name="LAST_RESOLUTION" value="IGNORE" />
+  </component>
+  <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
+  <component name="CreatePatchCommitExecutor">
+    <option name="PATCH_PATH" value="" />
+  </component>
+  <component name="DaemonCodeAnalyzer">
+    <disable_hints />
+  </component>
+  <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
+  <component name="FavoritesManager">
+    <favorites_list name="match-stream" />
+  </component>
+  <component name="FileEditorManager">
+    <leaf>
+      <file leaf-file-name="match.js" pinned="false" current="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/match.js">
+          <provider selected="true" editor-type-id="text-editor">
+            <state line="20" column="20" selection-start="466" selection-end="466" vertical-scroll-proportion="0.0">
+              <folding />
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file leaf-file-name="until.js" pinned="false" current="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/test/until.js">
+          <provider selected="true" editor-type-id="text-editor">
+            <state line="5" column="12" selection-start="168" selection-end="168" vertical-scroll-proportion="0.0">
+              <folding />
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file leaf-file-name="until.js" pinned="false" current="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/examples/until.js">
+          <provider selected="true" editor-type-id="text-editor">
+            <state line="0" column="0" selection-start="0" selection-end="735" vertical-scroll-proportion="0.0">
+              <folding />
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file leaf-file-name="README.md" pinned="false" current="true" current-in-tab="true">
+        <entry file="file://$PROJECT_DIR$/README.md">
+          <provider selected="true" editor-type-id="text-editor">
+            <state line="13" column="23" selection-start="311" selection-end="311" vertical-scroll-proportion="0.25549132">
+              <folding />
+            </state>
+          </provider>
+        </entry>
+      </file>
+    </leaf>
+  </component>
+  <component name="FindManager">
+    <FindUsagesManager>
+      <setting name="OPEN_NEW_TAB" value="false" />
+    </FindUsagesManager>
+  </component>
+  <component name="Git.Settings">
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
+  </component>
+  <component name="GitLogSettings">
+    <option name="myDateState">
+      <MyDateState />
+    </option>
+  </component>
+  <component name="IdeDocumentHistory">
+    <option name="changedFiles">
+      <list>
+        <option value="$PROJECT_DIR$/node_modules/readable-stream/lib/_stream_transform.js" />
+        <option value="$PROJECT_DIR$/examples/lorem.txt" />
+        <option value="$PROJECT_DIR$/test/until.js" />
+        <option value="$PROJECT_DIR$/match.js" />
+        <option value="$PROJECT_DIR$/examples/until.js" />
+        <option value="$PROJECT_DIR$/test/split.js" />
+        <option value="$PROJECT_DIR$/examples/split.js" />
+        <option value="$PROJECT_DIR$/README.md" />
+      </list>
+    </option>
+  </component>
+  <component name="ProjectFrameBounds">
+    <option name="x" value="793" />
+    <option name="y" value="22" />
+    <option name="width" value="1031" />
+    <option name="height" value="1024" />
+  </component>
+  <component name="ProjectLevelVcsManager" settingsEditedManually="true">
+    <OptionsSetting value="true" id="Add" />
+    <OptionsSetting value="true" id="Remove" />
+    <OptionsSetting value="true" id="Checkout" />
+    <OptionsSetting value="true" id="Update" />
+    <OptionsSetting value="true" id="Status" />
+    <OptionsSetting value="true" id="Edit" />
+    <ConfirmationsSetting value="0" id="Add" />
+    <ConfirmationsSetting value="0" id="Remove" />
+  </component>
+  <component name="ProjectReloadState">
+    <option name="STATE" value="0" />
+  </component>
+  <component name="ProjectView">
+    <navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
+      <flattenPackages />
+      <showMembers />
+      <showModules />
+      <showLibraryContents ProjectPane="true" />
+      <hideEmptyPackages />
+      <abbreviatePackageNames />
+      <autoscrollToSource />
+      <autoscrollFromSource />
+      <sortByType />
+    </navigator>
+    <panes>
+      <pane id="Scope" />
+      <pane id="ProjectPane">
+        <subPane>
+          <PATH>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="match-stream" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+            </PATH_ELEMENT>
+          </PATH>
+          <PATH>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="match-stream" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="match-stream" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+          </PATH>
+          <PATH>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="match-stream" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="match-stream" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="test" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+          </PATH>
+          <PATH>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="match-stream" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="match-stream" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="examples" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+          </PATH>
+        </subPane>
+      </pane>
+    </panes>
+  </component>
+  <component name="PropertiesComponent">
+    <property name="options.splitter.main.proportions" value="0.3" />
+    <property name="WebServerToolWindowFactoryState" value="false" />
+    <property name="recentsLimit" value="5" />
+    <property name="options.lastSelected" value="project.propVCSSupport.Mappings" />
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/../node-unzip" />
+    <property name="options.splitter.details.proportions" value="0.2" />
+    <property name="options.searchVisible" value="true" />
+  </component>
+  <component name="RunManager" selected="JsTestDriver.until.js">
+    <configuration default="false" name="until.js" type="JSTestDriver:ConfigurationType" factoryName="JsTestDriver" temporary="true">
+      <setting name="configLocationType" value="JS_FILE" />
+      <setting name="configType" value="FILE_PATH" />
+      <setting name="settingsFile" value="" />
+      <setting name="jsFile" value="$PROJECT_DIR$/test/until.js" />
+      <setting name="serverType" value="INTERNAL" />
+      <setting name="preferredDebugBrowser" value="CHROME" />
+      <method />
+    </configuration>
+    <configuration default="true" type="DartUnitRunConfigurationType" factoryName="DartUnit">
+      <option name="VMOptions" />
+      <option name="arguments" />
+      <option name="filePath" />
+      <option name="scope" value="ALL" />
+      <option name="testName" />
+      <method />
+    </configuration>
+    <configuration default="true" type="JSTestDriver:ConfigurationType" factoryName="JsTestDriver">
+      <setting name="configLocationType" value="CONFIG_FILE" />
+      <setting name="settingsFile" value="" />
+      <setting name="serverType" value="INTERNAL" />
+      <setting name="preferredDebugBrowser" value="CHROME" />
+      <method />
+    </configuration>
+    <list size="1">
+      <item index="0" class="java.lang.String" itemvalue="JsTestDriver.until.js" />
+    </list>
+    <recent_temporary>
+      <list size="1">
+        <item index="0" class="java.lang.String" itemvalue="JsTestDriver.until.js" />
+      </list>
+    </recent_temporary>
+  </component>
+  <component name="ShelveChangesManager" show_recycled="false" />
+  <component name="SvnConfiguration" maxAnnotateRevisions="500" myUseAcceleration="nothing" myAutoUpdateAfterCommit="false" cleanupOnStartRun="false" SSL_PROTOCOLS="sslv3">
+    <option name="USER" value="" />
+    <option name="PASSWORD" value="" />
+    <option name="mySSHConnectionTimeout" value="30000" />
+    <option name="mySSHReadTimeout" value="30000" />
+    <option name="LAST_MERGED_REVISION" />
+    <option name="MERGE_DRY_RUN" value="false" />
+    <option name="MERGE_DIFF_USE_ANCESTRY" value="true" />
+    <option name="UPDATE_LOCK_ON_DEMAND" value="false" />
+    <option name="IGNORE_SPACES_IN_MERGE" value="false" />
+    <option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />
+    <option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
+    <option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
+    <option name="FORCE_UPDATE" value="false" />
+    <option name="IGNORE_EXTERNALS" value="false" />
+    <myIsUseDefaultProxy>false</myIsUseDefaultProxy>
+  </component>
+  <component name="TaskManager">
+    <task active="true" id="Default" summary="Default task">
+      <changelist id="6f2c25bb-86f8-4448-bba5-59bca70aeec8" name="Default" comment="" />
+      <created>1362863989494</created>
+      <updated>1362863989494</updated>
+    </task>
+    <servers />
+  </component>
+  <component name="ToolWindowManager">
+    <frame x="793" y="22" width="1031" height="1024" extended-state="0" />
+    <editor active="true" />
+    <layout>
+      <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
+      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
+      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.16468254" sideWeight="0.9933712" order="1" side_tool="false" content_ui="combo" />
+      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
+      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32893157" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3289183" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
+      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
+      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
+      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
+    </layout>
+  </component>
+  <component name="VcsContentAnnotationSettings">
+    <option name="myLimit" value="2678400000" />
+  </component>
+  <component name="VcsManagerConfiguration">
+    <option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />
+    <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" />
+    <option name="CHECK_NEW_TODO" value="true" />
+    <option name="myTodoPanelSettings">
+      <value>
+        <are-packages-shown value="false" />
+        <are-modules-shown value="false" />
+        <flatten-packages value="false" />
+        <is-autoscroll-to-source value="false" />
+      </value>
+    </option>
+    <option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" />
+    <option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" />
+    <option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />
+    <option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" />
+    <option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
+    <option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />
+    <option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false" />
+    <option name="CHANGED_ON_SERVER_INTERVAL" value="60" />
+    <option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" />
+    <option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />
+    <option name="DEFAULT_PATCH_EXTENSION" value="patch" />
+    <option name="SHORT_DIFF_HORISONTALLY" value="true" />
+    <option name="SHORT_DIFF_EXTRA_LINES" value="2" />
+    <option name="SOFT_WRAPS_IN_SHORT_DIFF" value="true" />
+    <option name="INCLUDE_TEXT_INTO_PATCH" value="false" />
+    <option name="INCLUDE_TEXT_INTO_SHELF" value="false" />
+    <option name="SHOW_FILE_HISTORY_DETAILS" value="true" />
+    <option name="SHOW_VCS_ERROR_NOTIFICATIONS" value="true" />
+    <option name="SHOW_DIRTY_RECURSIVELY" value="false" />
+    <option name="LIMIT_HISTORY" value="true" />
+    <option name="MAXIMUM_HISTORY_ROWS" value="1000" />
+    <option name="UPDATE_FILTER_SCOPE_NAME" />
+    <option name="USE_COMMIT_MESSAGE_MARGIN" value="false" />
+    <option name="COMMIT_MESSAGE_MARGIN_SIZE" value="72" />
+    <option name="WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN" value="false" />
+    <option name="FORCE_NON_EMPTY_COMMENT" value="false" />
+    <option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="false" />
+    <option name="LAST_COMMIT_MESSAGE" />
+    <option name="MAKE_NEW_CHANGELIST_ACTIVE" value="false" />
+    <option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
+    <option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
+    <option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
+    <option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
+    <option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
+    <option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
+    <option name="ACTIVE_VCS_NAME" />
+    <option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
+    <option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
+    <option name="UPDATE_FILTER_BY_SCOPE" value="false" />
+    <option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
+    <option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
+  </component>
+  <component name="XDebuggerManager">
+    <breakpoint-manager />
+  </component>
+  <component name="editorHistoryManager">
+    <entry file="file://$USER_HOME$/Library/Caches/WebStorm6/extLibs/nodejs-v0.9.12-src/core-modules-sources/lib/_stream_readable.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="527" column="34" selection-start="15379" selection-end="15384" vertical-scroll-proportion="0.0" />
+      </provider>
+    </entry>
+    <entry file="file://$USER_HOME$/Library/Caches/WebStorm6/extLibs/nodejs-v0.9.12-src/core-modules-sources/lib/_stream_transform.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="148" column="32" selection-start="5526" selection-end="5526" vertical-scroll-proportion="0.0" />
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/node_modules/readable-stream/lib/_stream_transform.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="156" column="0" selection-start="5865" selection-end="5865" vertical-scroll-proportion="-10.423077" />
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/../until-stream/test/pipeUntil.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="4" column="0" selection-start="114" selection-end="155" vertical-scroll-proportion="0.0" />
+      </provider>
+    </entry>
+    <entry file="jar://$APPLICATION_HOME_DIR$/plugins/JavaScriptLanguage/lib/JavascriptLanguage.jar!/com/intellij/lang/javascript/index/predefined/EcmaScript5.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="157" column="19" selection-start="2889" selection-end="2889" vertical-scroll-proportion="0.3997722" />
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/../until-stream/until.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="122" column="36" selection-start="3395" selection-end="3427" vertical-scroll-proportion="1.3678815" />
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/node_modules/stream-buffers/README.md">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="70" column="13" selection-start="3170" selection-end="3179" vertical-scroll-proportion="0.4857143" />
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/node_modules/readable-stream/lib/_stream_readable.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="534" column="13" selection-start="15634" selection-end="15638" vertical-scroll-proportion="0.83463037" />
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/examples/lorem.txt">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="0" column="22" selection-start="0" selection-end="612" vertical-scroll-proportion="0.0" />
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/test/split.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="63" column="3" selection-start="2573" selection-end="2573" vertical-scroll-proportion="0.0">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/examples/until.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="0" column="0" selection-start="0" selection-end="735" vertical-scroll-proportion="0.0">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/examples/split.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="16" column="15" selection-start="396" selection-end="396" vertical-scroll-proportion="0.26459143">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/match.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="20" column="20" selection-start="466" selection-end="466" vertical-scroll-proportion="0.0">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/test/until.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="5" column="12" selection-start="168" selection-end="168" vertical-scroll-proportion="0.0">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/package.json">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="3" column="31" selection-start="81" selection-end="81" vertical-scroll-proportion="-1.9615384">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/README.md">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="13" column="23" selection-start="311" selection-end="311" vertical-scroll-proportion="0.25549132">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+  </component>
+</project>
+
diff --git a/wrt/node_modules/match-stream/.travis.yml b/wrt/node_modules/match-stream/.travis.yml
new file mode 100644 (file)
index 0000000..85fc71b
--- /dev/null
@@ -0,0 +1,5 @@
+language: node_js
+node_js:
+  - "0.10"
+  - "0.8"
+
diff --git a/wrt/node_modules/match-stream/LICENSE b/wrt/node_modules/match-stream/LICENSE
new file mode 100644 (file)
index 0000000..5ff03ca
--- /dev/null
@@ -0,0 +1,22 @@
+Copyright (c) 2013 Evan Oxfeld
+
+MIT License
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/match-stream/README.md b/wrt/node_modules/match-stream/README.md
new file mode 100644 (file)
index 0000000..624f67b
--- /dev/null
@@ -0,0 +1,75 @@
+match-stream [![Build Status](https://travis-ci.org/EvanOxfeld/match-stream.png)](https://travis-ci.org/EvanOxfeld/match-stream)
+============
+
+Supply a function to handle pattern matches within a NodeJS stream.
+
+## Installation
+
+```bash
+$ npm install match-stream
+```
+
+## Quick Examples
+
+### End stream on match
+
+```javascript
+var MatchStream = require('match-stream');
+var streamBuffers = require("stream-buffers");
+
+var ms = new MatchStream({ pattern: 'World'}, function (buf, matched, extra) {
+  if (!matched) {
+    return this.push(buf);
+  }
+  this.push(buf);
+  return this.push(null); //signal end of data
+});
+
+var sourceStream = new streamBuffers.ReadableStreamBuffer();
+sourceStream.put("Hello World");
+var writableStream = new streamBuffers.WritableStreamBuffer();
+
+sourceStream
+  .pipe(ms)
+  .pipe(writableStream)
+  .once('close', function () {
+    var str = writableStream.getContentsAsString('utf8');
+    console.log('Piped data before pattern occurs:', "'" + str + "'");
+    sourceStream.destroy();
+  });
+
+//Output
+//Piped data before pattern occurs: 'Hello '
+```
+
+### Split stream
+
+```javascript
+var MatchStream = require('match-stream');
+var fs = require('fs');
+
+var line = "";
+var loremLines = [];
+var ms = new MatchStream({ pattern: '.', consume: true}, function (buf, matched, extra) {
+  line += buf.toString();
+  if (matched) {
+    loremLines.push(line.trim());
+    line = "";
+  }
+});
+
+fs.createReadStream('lorem.txt')
+  .pipe(ms)
+  .once('finish', function() {
+    console.log(loremLines);
+  });
+```
+
+## License
+
+MIT
+
+## Acknowledgements
+
+Special thanks to @wanderview for assisting with the API.
+
diff --git a/wrt/node_modules/match-stream/examples/lorem.txt b/wrt/node_modules/match-stream/examples/lorem.txt
new file mode 100644 (file)
index 0000000..6bb9216
--- /dev/null
@@ -0,0 +1 @@
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas varius tempor arcu, quis hendrerit nunc accumsan quis. In ut dolor metus, eget viverra odio. Quisque sed suscipit leo. Curabitur dictum magna ut turpis interdum a mollis nunc condimentum. Praesent leo est, hendreriteget condimentum sit amet, placerat adipiscing neque. Curabitur id metus tellus, sed semper odio. Phasellus id justo ante, vel bibendum eros. Nulla suscipit felis eget erat iaculis et aliquam turpis consequat. Nunc posuere mollis tellus sit amet dapibus. Praesent sagittis quam sit amet mauris venenatis in dignissim purus dapibus.
\ No newline at end of file
diff --git a/wrt/node_modules/match-stream/examples/split.js b/wrt/node_modules/match-stream/examples/split.js
new file mode 100644 (file)
index 0000000..340b939
--- /dev/null
@@ -0,0 +1,32 @@
+var MatchStream = require('../');
+var fs = require('fs');
+var path = require('path');
+
+var line = "";
+var loremLines = [];
+var ms = new MatchStream({ pattern: '.', consume: true}, function (buf, matched, extra) {
+  line += buf.toString();
+  if (matched) {
+    loremLines.push(line.trim());
+    line = "";
+  }
+});
+
+fs.createReadStream(path.join(__dirname, 'lorem.txt'))
+  .pipe(ms)
+  .once('finish', function() {
+    console.log(loremLines);
+  });
+
+//Output
+//[ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit',
+//  'Maecenas varius tempor arcu, quis hendrerit nunc accumsan quis',
+//  'In ut dolor metus, eget viverra odio',
+//  'Quisque sed suscipit leo',
+//  'Curabitur dictum magna ut turpis interdum a mollis nunc condimentum',
+//  'Praesent leo est, hendreriteget condimentum sit amet, placerat adipiscing neque',
+//  'Curabitur id metus tellus, sed semper odio',
+//  'Phasellus id justo ante, vel bibendum eros',
+//  'Nulla suscipit felis eget erat iaculis et aliquam turpis consequat',
+//  'Nunc posuere mollis tellus sit amet dapibus',
+//  'Praesent sagittis quam sit amet mauris venenatis in dignissim purus dapibus' ]
\ No newline at end of file
diff --git a/wrt/node_modules/match-stream/examples/until.js b/wrt/node_modules/match-stream/examples/until.js
new file mode 100644 (file)
index 0000000..b58fb73
--- /dev/null
@@ -0,0 +1,26 @@
+var MatchStream = require('../');
+var streamBuffers = require("stream-buffers");
+
+var ms = new MatchStream({ pattern: 'World'}, function (buf, matched, extra) {
+  if (!matched) {
+    return this.push(buf);
+  }
+  this.push(buf);
+  return this.push(null); //signal end of data
+});
+
+var sourceStream = new streamBuffers.ReadableStreamBuffer();
+sourceStream.put("Hello World");
+var writableStream = new streamBuffers.WritableStreamBuffer();
+
+sourceStream
+  .pipe(ms)
+  .pipe(writableStream)
+  .once('close', function () {
+    var str = writableStream.getContentsAsString('utf8');
+    console.log('Piped data before pattern occurs:', "'" + str + "'");
+    sourceStream.destroy();
+  });
+
+//Output
+//Piped data before pattern occurs: 'Hello '
\ No newline at end of file
diff --git a/wrt/node_modules/match-stream/match.js b/wrt/node_modules/match-stream/match.js
new file mode 100644 (file)
index 0000000..43088a1
--- /dev/null
@@ -0,0 +1,60 @@
+'use strict';
+
+module.exports = Match;
+
+var Transform = require('stream').Transform;
+var inherits = require("util").inherits;
+var Buffers = require('buffers');
+
+if (!Transform) {
+  Transform = require('readable-stream/transform');
+}
+
+inherits(Match, Transform);
+
+function Match(opts, matchFn) {
+  if (!(this instanceof Match)) {
+    return new Match(opts, matchFn);
+  }
+
+  //todo - better handle opts e.g. pattern.length can't be > highWaterMark
+  this._opts = opts;
+  if (typeof this._opts.pattern === "string") {
+    this._opts.pattern = new Buffer(this._opts.pattern);
+  }
+  this._matchFn = matchFn;
+  this._bufs = Buffers();
+
+  Transform.call(this);
+}
+
+Match.prototype._transform = function (chunk, encoding, callback) {
+  var pattern = this._opts.pattern;
+  this._bufs.push(chunk);
+
+  var index = this._bufs.indexOf(pattern);
+  if (index >= 0) {
+    processMatches.call(this, index, pattern, callback);
+  } else {
+    var buf = this._bufs.splice(0, this._bufs.length - chunk.length);
+    if (buf && buf.length > 0) {
+      this._matchFn(buf.toBuffer());
+    }
+    callback();
+  }
+};
+
+function processMatches(index, pattern, callback) {
+  var buf = this._bufs.splice(0, index).toBuffer();
+  if (this._opts.consume) {
+    this._bufs.splice(0, pattern.length);
+  }
+  this._matchFn(buf, pattern, this._bufs.toBuffer());
+
+  index = this._bufs.indexOf(pattern);
+  if (index > 0 || this._opts.consume && index === 0) {
+    process.nextTick(processMatches.bind(this, index, pattern, callback));
+  } else {
+    callback();
+  }
+}
diff --git a/wrt/node_modules/match-stream/package.json b/wrt/node_modules/match-stream/package.json
new file mode 100644 (file)
index 0000000..b9282a4
--- /dev/null
@@ -0,0 +1,94 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "match-stream@>= 0.0.2 < 1",
+        "scope": null,
+        "escapedName": "match-stream",
+        "name": "match-stream",
+        "rawSpec": ">= 0.0.2 < 1",
+        "spec": ">=0.0.2 <1.0.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/unzip"
+    ]
+  ],
+  "_from": "match-stream@>=0.0.2 <1.0.0",
+  "_id": "match-stream@0.0.2",
+  "_inCache": true,
+  "_location": "/match-stream",
+  "_npmUser": {
+    "name": "evanoxfeld",
+    "email": "eoxfeld@gmail.com"
+  },
+  "_npmVersion": "1.2.17",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "match-stream@>= 0.0.2 < 1",
+    "scope": null,
+    "escapedName": "match-stream",
+    "name": "match-stream",
+    "rawSpec": ">= 0.0.2 < 1",
+    "spec": ">=0.0.2 <1.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/unzip"
+  ],
+  "_resolved": "https://registry.npmjs.org/match-stream/-/match-stream-0.0.2.tgz",
+  "_shasum": "99eb050093b34dffade421b9ac0b410a9cfa17cf",
+  "_shrinkwrap": null,
+  "_spec": "match-stream@>= 0.0.2 < 1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/unzip",
+  "author": {
+    "name": "Evan Oxfeld",
+    "email": "eoxfeld@gmail.com"
+  },
+  "bugs": {
+    "url": "https://github.com/EvanOxfeld/match-stream/issues"
+  },
+  "dependencies": {
+    "buffers": "~0.1.1",
+    "readable-stream": "~1.0.0"
+  },
+  "description": "Match a pattern within a stream",
+  "devDependencies": {
+    "stream-buffers": "~0.2.4",
+    "tap": "~0.4.0"
+  },
+  "directories": {
+    "example": "examples",
+    "test": "test"
+  },
+  "dist": {
+    "shasum": "99eb050093b34dffade421b9ac0b410a9cfa17cf",
+    "tarball": "https://registry.npmjs.org/match-stream/-/match-stream-0.0.2.tgz"
+  },
+  "gitHead": "665dabbb0a3593310012eb041fc07395db632a20",
+  "homepage": "https://github.com/EvanOxfeld/match-stream#readme",
+  "keywords": [
+    "match",
+    "stream",
+    "split"
+  ],
+  "license": "MIT",
+  "main": "match.js",
+  "maintainers": [
+    {
+      "name": "evanoxfeld",
+      "email": "eoxfeld@gmail.com"
+    }
+  ],
+  "name": "match-stream",
+  "optionalDependencies": {},
+  "readme": "match-stream [![Build Status](https://travis-ci.org/EvanOxfeld/match-stream.png)](https://travis-ci.org/EvanOxfeld/match-stream)\n============\n\nSupply a function to handle pattern matches within a NodeJS stream.\n\n## Installation\n\n```bash\n$ npm install match-stream\n```\n\n## Quick Examples\n\n### End stream on match\n\n```javascript\nvar MatchStream = require('match-stream');\nvar streamBuffers = require(\"stream-buffers\");\n\nvar ms = new MatchStream({ pattern: 'World'}, function (buf, matched, extra) {\n  if (!matched) {\n    return this.push(buf);\n  }\n  this.push(buf);\n  return this.push(null); //signal end of data\n});\n\nvar sourceStream = new streamBuffers.ReadableStreamBuffer();\nsourceStream.put(\"Hello World\");\nvar writableStream = new streamBuffers.WritableStreamBuffer();\n\nsourceStream\n  .pipe(ms)\n  .pipe(writableStream)\n  .once('close', function () {\n    var str = writableStream.getContentsAsString('utf8');\n    console.log('Piped data before pattern occurs:', \"'\" + str + \"'\");\n    sourceStream.destroy();\n  });\n\n//Output\n//Piped data before pattern occurs: 'Hello '\n```\n\n### Split stream\n\n```javascript\nvar MatchStream = require('match-stream');\nvar fs = require('fs');\n\nvar line = \"\";\nvar loremLines = [];\nvar ms = new MatchStream({ pattern: '.', consume: true}, function (buf, matched, extra) {\n  line += buf.toString();\n  if (matched) {\n    loremLines.push(line.trim());\n    line = \"\";\n  }\n});\n\nfs.createReadStream('lorem.txt')\n  .pipe(ms)\n  .once('finish', function() {\n    console.log(loremLines);\n  });\n```\n\n## License\n\nMIT\n\n## Acknowledgements\n\nSpecial thanks to @wanderview for assisting with the API.\n\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/EvanOxfeld/match-stream.git"
+  },
+  "scripts": {
+    "test": "./node_modules/.bin/tap ./test/*.js"
+  },
+  "version": "0.0.2"
+}
diff --git a/wrt/node_modules/match-stream/test/split.js b/wrt/node_modules/match-stream/test/split.js
new file mode 100644 (file)
index 0000000..aad7c57
--- /dev/null
@@ -0,0 +1,64 @@
+var test = require('tap').test;
+var fs = require('fs');
+var path = require('path');
+var streamBuffers = require("stream-buffers");
+var MatchStream = require('../');
+
+var expected = [ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit',
+  'Maecenas varius tempor arcu, quis hendrerit nunc accumsan quis',
+  'In ut dolor metus, eget viverra odio',
+  'Quisque sed suscipit leo',
+  'Curabitur dictum magna ut turpis interdum a mollis nunc condimentum',
+  'Praesent leo est, hendreriteget condimentum sit amet, placerat adipiscing neque',
+  'Curabitur id metus tellus, sed semper odio',
+  'Phasellus id justo ante, vel bibendum eros',
+  'Nulla suscipit felis eget erat iaculis et aliquam turpis consequat',
+  'Nunc posuere mollis tellus sit amet dapibus',
+  'Praesent sagittis quam sit amet mauris venenatis in dignissim purus dapibus' ];
+
+test("multiple matches within a single _transform() chunk", function (t) {
+  t.plan(1);
+
+  var line = "";
+  var loremLines = [];
+  var ms = new MatchStream({ pattern: '.', consume: true}, function (buf, matched, extra) {
+    line += buf.toString();
+    if (matched) {
+      loremLines.push(line.trim());
+      line = "";
+    }
+  });
+
+  fs.createReadStream(path.join(__dirname, '../examples/lorem.txt'))
+    .pipe(ms)
+    .on('finish', function() {
+      t.deepEqual(loremLines, expected);
+      t.end();
+    });
+});
+
+test("multiple chunks passed to _transform()", function (t) {
+  t.plan(1);
+
+  var line = "";
+  var loremLines = [];
+  var ms = new MatchStream({ pattern: '.', consume: true}, function (buf, matched, extra) {
+    line += buf.toString();
+    if (matched) {
+      loremLines.push(line.trim());
+      line = "";
+    }
+  });
+
+  var lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas varius tempor arcu, quis hendrerit nunc accumsan quis. In ut dolor metus, eget viverra odio. Quisque sed suscipit leo. Curabitur dictum magna ut turpis interdum a mollis nunc condimentum. Praesent leo est, hendreriteget condimentum sit amet, placerat adipiscing neque. Curabitur id metus tellus, sed semper odio. Phasellus id justo ante, vel bibendum eros. Nulla suscipit felis eget erat iaculis et aliquam turpis consequat. Nunc posuere mollis tellus sit amet dapibus. Praesent sagittis quam sit amet mauris venenatis in dignissim purus dapibus.";
+  var sourceStream = new streamBuffers.ReadableStreamBuffer({ chunkSize: 10});
+  sourceStream.put(lorem);
+
+  sourceStream
+    .pipe(ms)
+    .on('finish', function() {
+      sourceStream.destroy();
+      t.deepEqual(loremLines, expected);
+      t.end();
+    });
+});
\ No newline at end of file
diff --git a/wrt/node_modules/match-stream/test/until.js b/wrt/node_modules/match-stream/test/until.js
new file mode 100644 (file)
index 0000000..a70c7a0
--- /dev/null
@@ -0,0 +1,30 @@
+var test = require('tap').test;
+var streamBuffers = require("stream-buffers");
+var MatchStream = require('../');
+
+test("pipe until pattern", function (t) {
+  t.plan(2);
+
+  var ms = new MatchStream({ pattern: 'World'}, function (buf, matched, extra) {
+    if (!matched) {
+      return this.push(buf);
+    }
+    this.push(buf);
+    t.equal(extra.toString(), 'World');
+    return this.push(null); //end the stream
+  });
+
+  var sourceStream = new streamBuffers.ReadableStreamBuffer();
+  sourceStream.put("Hello World");
+  var writableStream = new streamBuffers.WritableStreamBuffer();
+
+  sourceStream
+    .pipe(ms)
+    .pipe(writableStream)
+    .once('close', function () {
+      var str = writableStream.getContentsAsString('utf8');
+      t.equal(str, 'Hello ');
+      sourceStream.destroy();
+      t.end();
+    });
+});
\ No newline at end of file
diff --git a/wrt/node_modules/media-typer/HISTORY.md b/wrt/node_modules/media-typer/HISTORY.md
new file mode 100644 (file)
index 0000000..62c2003
--- /dev/null
@@ -0,0 +1,22 @@
+0.3.0 / 2014-09-07
+==================
+
+  * Support Node.js 0.6
+  * Throw error when parameter format invalid on parse
+
+0.2.0 / 2014-06-18
+==================
+
+  * Add `typer.format()` to format media types
+
+0.1.0 / 2014-06-17
+==================
+
+  * Accept `req` as argument to `parse`
+  * Accept `res` as argument to `parse`
+  * Parse media type with extra LWS between type and first parameter
+
+0.0.0 / 2014-06-13
+==================
+
+  * Initial implementation
diff --git a/wrt/node_modules/media-typer/LICENSE b/wrt/node_modules/media-typer/LICENSE
new file mode 100644 (file)
index 0000000..b7dce6c
--- /dev/null
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2014 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/media-typer/README.md b/wrt/node_modules/media-typer/README.md
new file mode 100644 (file)
index 0000000..d8df623
--- /dev/null
@@ -0,0 +1,81 @@
+# media-typer
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+Simple RFC 6838 media type parser
+
+## Installation
+
+```sh
+$ npm install media-typer
+```
+
+## API
+
+```js
+var typer = require('media-typer')
+```
+
+### typer.parse(string)
+
+```js
+var obj = typer.parse('image/svg+xml; charset=utf-8')
+```
+
+Parse a media type string. This will return an object with the following
+properties (examples are shown for the string `'image/svg+xml; charset=utf-8'`):
+
+ - `type`: The type of the media type (always lower case). Example: `'image'`
+
+ - `subtype`: The subtype of the media type (always lower case). Example: `'svg'`
+
+ - `suffix`: The suffix of the media type (always lower case). Example: `'xml'`
+
+ - `parameters`: An object of the parameters in the media type (name of parameter always lower case). Example: `{charset: 'utf-8'}`
+
+### typer.parse(req)
+
+```js
+var obj = typer.parse(req)
+```
+
+Parse the `content-type` header from the given `req`. Short-cut for
+`typer.parse(req.headers['content-type'])`.
+
+### typer.parse(res)
+
+```js
+var obj = typer.parse(res)
+```
+
+Parse the `content-type` header set on the given `res`. Short-cut for
+`typer.parse(res.getHeader('content-type'))`.
+
+### typer.format(obj)
+
+```js
+var obj = typer.format({type: 'image', subtype: 'svg', suffix: 'xml'})
+```
+
+Format an object into a media type string. This will return a string of the
+mime type for the given object. For the properties of the object, see the
+documentation for `typer.parse(string)`.
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/media-typer.svg?style=flat
+[npm-url]: https://npmjs.org/package/media-typer
+[node-version-image]: https://img.shields.io/badge/node.js-%3E%3D_0.6-brightgreen.svg?style=flat
+[node-version-url]: http://nodejs.org/download/
+[travis-image]: https://img.shields.io/travis/jshttp/media-typer.svg?style=flat
+[travis-url]: https://travis-ci.org/jshttp/media-typer
+[coveralls-image]: https://img.shields.io/coveralls/jshttp/media-typer.svg?style=flat
+[coveralls-url]: https://coveralls.io/r/jshttp/media-typer
+[downloads-image]: https://img.shields.io/npm/dm/media-typer.svg?style=flat
+[downloads-url]: https://npmjs.org/package/media-typer
diff --git a/wrt/node_modules/media-typer/index.js b/wrt/node_modules/media-typer/index.js
new file mode 100644 (file)
index 0000000..07f7295
--- /dev/null
@@ -0,0 +1,270 @@
+/*!
+ * media-typer
+ * Copyright(c) 2014 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+/**
+ * RegExp to match *( ";" parameter ) in RFC 2616 sec 3.7
+ *
+ * parameter     = token "=" ( token | quoted-string )
+ * token         = 1*<any CHAR except CTLs or separators>
+ * separators    = "(" | ")" | "<" | ">" | "@"
+ *               | "," | ";" | ":" | "\" | <">
+ *               | "/" | "[" | "]" | "?" | "="
+ *               | "{" | "}" | SP | HT
+ * quoted-string = ( <"> *(qdtext | quoted-pair ) <"> )
+ * qdtext        = <any TEXT except <">>
+ * quoted-pair   = "\" CHAR
+ * CHAR          = <any US-ASCII character (octets 0 - 127)>
+ * TEXT          = <any OCTET except CTLs, but including LWS>
+ * LWS           = [CRLF] 1*( SP | HT )
+ * CRLF          = CR LF
+ * CR            = <US-ASCII CR, carriage return (13)>
+ * LF            = <US-ASCII LF, linefeed (10)>
+ * SP            = <US-ASCII SP, space (32)>
+ * SHT           = <US-ASCII HT, horizontal-tab (9)>
+ * CTL           = <any US-ASCII control character (octets 0 - 31) and DEL (127)>
+ * OCTET         = <any 8-bit sequence of data>
+ */
+var paramRegExp = /; *([!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) *= *("(?:[ !\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u0020-\u007e])*"|[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) */g;
+var textRegExp = /^[\u0020-\u007e\u0080-\u00ff]+$/
+var tokenRegExp = /^[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+$/
+
+/**
+ * RegExp to match quoted-pair in RFC 2616
+ *
+ * quoted-pair = "\" CHAR
+ * CHAR        = <any US-ASCII character (octets 0 - 127)>
+ */
+var qescRegExp = /\\([\u0000-\u007f])/g;
+
+/**
+ * RegExp to match chars that must be quoted-pair in RFC 2616
+ */
+var quoteRegExp = /([\\"])/g;
+
+/**
+ * RegExp to match type in RFC 6838
+ *
+ * type-name = restricted-name
+ * subtype-name = restricted-name
+ * restricted-name = restricted-name-first *126restricted-name-chars
+ * restricted-name-first  = ALPHA / DIGIT
+ * restricted-name-chars  = ALPHA / DIGIT / "!" / "#" /
+ *                          "$" / "&" / "-" / "^" / "_"
+ * restricted-name-chars =/ "." ; Characters before first dot always
+ *                              ; specify a facet name
+ * restricted-name-chars =/ "+" ; Characters after last plus always
+ *                              ; specify a structured syntax suffix
+ * ALPHA =  %x41-5A / %x61-7A   ; A-Z / a-z
+ * DIGIT =  %x30-39             ; 0-9
+ */
+var subtypeNameRegExp = /^[A-Za-z0-9][A-Za-z0-9!#$&^_.-]{0,126}$/
+var typeNameRegExp = /^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}$/
+var typeRegExp = /^ *([A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126})\/([A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}) *$/;
+
+/**
+ * Module exports.
+ */
+
+exports.format = format
+exports.parse = parse
+
+/**
+ * Format object to media type.
+ *
+ * @param {object} obj
+ * @return {string}
+ * @api public
+ */
+
+function format(obj) {
+  if (!obj || typeof obj !== 'object') {
+    throw new TypeError('argument obj is required')
+  }
+
+  var parameters = obj.parameters
+  var subtype = obj.subtype
+  var suffix = obj.suffix
+  var type = obj.type
+
+  if (!type || !typeNameRegExp.test(type)) {
+    throw new TypeError('invalid type')
+  }
+
+  if (!subtype || !subtypeNameRegExp.test(subtype)) {
+    throw new TypeError('invalid subtype')
+  }
+
+  // format as type/subtype
+  var string = type + '/' + subtype
+
+  // append +suffix
+  if (suffix) {
+    if (!typeNameRegExp.test(suffix)) {
+      throw new TypeError('invalid suffix')
+    }
+
+    string += '+' + suffix
+  }
+
+  // append parameters
+  if (parameters && typeof parameters === 'object') {
+    var param
+    var params = Object.keys(parameters).sort()
+
+    for (var i = 0; i < params.length; i++) {
+      param = params[i]
+
+      if (!tokenRegExp.test(param)) {
+        throw new TypeError('invalid parameter name')
+      }
+
+      string += '; ' + param + '=' + qstring(parameters[param])
+    }
+  }
+
+  return string
+}
+
+/**
+ * Parse media type to object.
+ *
+ * @param {string|object} string
+ * @return {Object}
+ * @api public
+ */
+
+function parse(string) {
+  if (!string) {
+    throw new TypeError('argument string is required')
+  }
+
+  // support req/res-like objects as argument
+  if (typeof string === 'object') {
+    string = getcontenttype(string)
+  }
+
+  if (typeof string !== 'string') {
+    throw new TypeError('argument string is required to be a string')
+  }
+
+  var index = string.indexOf(';')
+  var type = index !== -1
+    ? string.substr(0, index)
+    : string
+
+  var key
+  var match
+  var obj = splitType(type)
+  var params = {}
+  var value
+
+  paramRegExp.lastIndex = index
+
+  while (match = paramRegExp.exec(string)) {
+    if (match.index !== index) {
+      throw new TypeError('invalid parameter format')
+    }
+
+    index += match[0].length
+    key = match[1].toLowerCase()
+    value = match[2]
+
+    if (value[0] === '"') {
+      // remove quotes and escapes
+      value = value
+        .substr(1, value.length - 2)
+        .replace(qescRegExp, '$1')
+    }
+
+    params[key] = value
+  }
+
+  if (index !== -1 && index !== string.length) {
+    throw new TypeError('invalid parameter format')
+  }
+
+  obj.parameters = params
+
+  return obj
+}
+
+/**
+ * Get content-type from req/res objects.
+ *
+ * @param {object}
+ * @return {Object}
+ * @api private
+ */
+
+function getcontenttype(obj) {
+  if (typeof obj.getHeader === 'function') {
+    // res-like
+    return obj.getHeader('content-type')
+  }
+
+  if (typeof obj.headers === 'object') {
+    // req-like
+    return obj.headers && obj.headers['content-type']
+  }
+}
+
+/**
+ * Quote a string if necessary.
+ *
+ * @param {string} val
+ * @return {string}
+ * @api private
+ */
+
+function qstring(val) {
+  var str = String(val)
+
+  // no need to quote tokens
+  if (tokenRegExp.test(str)) {
+    return str
+  }
+
+  if (str.length > 0 && !textRegExp.test(str)) {
+    throw new TypeError('invalid parameter value')
+  }
+
+  return '"' + str.replace(quoteRegExp, '\\$1') + '"'
+}
+
+/**
+ * Simply "type/subtype+siffx" into parts.
+ *
+ * @param {string} string
+ * @return {Object}
+ * @api private
+ */
+
+function splitType(string) {
+  var match = typeRegExp.exec(string.toLowerCase())
+
+  if (!match) {
+    throw new TypeError('invalid media type')
+  }
+
+  var type = match[1]
+  var subtype = match[2]
+  var suffix
+
+  // suffix after last +
+  var index = subtype.lastIndexOf('+')
+  if (index !== -1) {
+    suffix = subtype.substr(index + 1)
+    subtype = subtype.substr(0, index)
+  }
+
+  var obj = {
+    type: type,
+    subtype: subtype,
+    suffix: suffix
+  }
+
+  return obj
+}
diff --git a/wrt/node_modules/media-typer/package.json b/wrt/node_modules/media-typer/package.json
new file mode 100644 (file)
index 0000000..d97d625
--- /dev/null
@@ -0,0 +1,92 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "media-typer@0.3.0",
+        "scope": null,
+        "escapedName": "media-typer",
+        "name": "media-typer",
+        "rawSpec": "0.3.0",
+        "spec": "0.3.0",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/type-is"
+    ]
+  ],
+  "_from": "media-typer@0.3.0",
+  "_id": "media-typer@0.3.0",
+  "_inCache": true,
+  "_location": "/media-typer",
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "1.4.21",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "media-typer@0.3.0",
+    "scope": null,
+    "escapedName": "media-typer",
+    "name": "media-typer",
+    "rawSpec": "0.3.0",
+    "spec": "0.3.0",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/type-is"
+  ],
+  "_resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
+  "_shasum": "8710d7af0aa626f8fffa1ce00168545263255748",
+  "_shrinkwrap": null,
+  "_spec": "media-typer@0.3.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/type-is",
+  "author": {
+    "name": "Douglas Christopher Wilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "bugs": {
+    "url": "https://github.com/jshttp/media-typer/issues"
+  },
+  "dependencies": {},
+  "description": "Simple RFC 6838 media type parser and formatter",
+  "devDependencies": {
+    "istanbul": "0.3.2",
+    "mocha": "~1.21.4",
+    "should": "~4.0.4"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "8710d7af0aa626f8fffa1ce00168545263255748",
+    "tarball": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz"
+  },
+  "engines": {
+    "node": ">= 0.6"
+  },
+  "files": [
+    "LICENSE",
+    "HISTORY.md",
+    "index.js"
+  ],
+  "gitHead": "d49d41ffd0bb5a0655fa44a59df2ec0bfc835b16",
+  "homepage": "https://github.com/jshttp/media-typer",
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "name": "media-typer",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/jshttp/media-typer.git"
+  },
+  "scripts": {
+    "test": "mocha --reporter spec --check-leaks --bail test/",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
+    "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
+  },
+  "version": "0.3.0"
+}
diff --git a/wrt/node_modules/merge-descriptors/HISTORY.md b/wrt/node_modules/merge-descriptors/HISTORY.md
new file mode 100644 (file)
index 0000000..486771f
--- /dev/null
@@ -0,0 +1,21 @@
+1.0.1 / 2016-01-17
+==================
+
+  * perf: enable strict mode
+
+1.0.0 / 2015-03-01
+==================
+
+  * Add option to only add new descriptors
+  * Add simple argument validation
+  * Add jsdoc to source file
+
+0.0.2 / 2013-12-14
+==================
+
+  * Move repository to `component` organization
+
+0.0.1 / 2013-10-29
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/merge-descriptors/LICENSE b/wrt/node_modules/merge-descriptors/LICENSE
new file mode 100644 (file)
index 0000000..274bfd8
--- /dev/null
@@ -0,0 +1,23 @@
+(The MIT License)
+
+Copyright (c) 2013 Jonathan Ong <me@jongleberry.com>
+Copyright (c) 2015 Douglas Christopher Wilson <doug@somethingdoug.com>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/merge-descriptors/README.md b/wrt/node_modules/merge-descriptors/README.md
new file mode 100644 (file)
index 0000000..d593c0e
--- /dev/null
@@ -0,0 +1,48 @@
+# Merge Descriptors
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+Merge objects using descriptors.
+
+```js
+var thing = {
+  get name() {
+    return 'jon'
+  }
+}
+
+var animal = {
+
+}
+
+merge(animal, thing)
+
+animal.name === 'jon'
+```
+
+## API
+
+### merge(destination, source)
+
+Redefines `destination`'s descriptors with `source`'s.
+
+### merge(destination, source, false)
+
+Defines `source`'s descriptors on `destination` if `destination` does not have
+a descriptor by the same name.
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/merge-descriptors.svg
+[npm-url]: https://npmjs.org/package/merge-descriptors
+[travis-image]: https://img.shields.io/travis/component/merge-descriptors/master.svg
+[travis-url]: https://travis-ci.org/component/merge-descriptors
+[coveralls-image]: https://img.shields.io/coveralls/component/merge-descriptors/master.svg
+[coveralls-url]: https://coveralls.io/r/component/merge-descriptors?branch=master
+[downloads-image]: https://img.shields.io/npm/dm/merge-descriptors.svg
+[downloads-url]: https://npmjs.org/package/merge-descriptors
diff --git a/wrt/node_modules/merge-descriptors/index.js b/wrt/node_modules/merge-descriptors/index.js
new file mode 100644 (file)
index 0000000..573b132
--- /dev/null
@@ -0,0 +1,60 @@
+/*!
+ * merge-descriptors
+ * Copyright(c) 2014 Jonathan Ong
+ * Copyright(c) 2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = merge
+
+/**
+ * Module variables.
+ * @private
+ */
+
+var hasOwnProperty = Object.prototype.hasOwnProperty
+
+/**
+ * Merge the property descriptors of `src` into `dest`
+ *
+ * @param {object} dest Object to add descriptors to
+ * @param {object} src Object to clone descriptors from
+ * @param {boolean} [redefine=true] Redefine `dest` properties with `src` properties
+ * @returns {object} Reference to dest
+ * @public
+ */
+
+function merge(dest, src, redefine) {
+  if (!dest) {
+    throw new TypeError('argument dest is required')
+  }
+
+  if (!src) {
+    throw new TypeError('argument src is required')
+  }
+
+  if (redefine === undefined) {
+    // Default to true
+    redefine = true
+  }
+
+  Object.getOwnPropertyNames(src).forEach(function forEachOwnPropertyName(name) {
+    if (!redefine && hasOwnProperty.call(dest, name)) {
+      // Skip desriptor
+      return
+    }
+
+    // Copy descriptor
+    var descriptor = Object.getOwnPropertyDescriptor(src, name)
+    Object.defineProperty(dest, name, descriptor)
+  })
+
+  return dest
+}
diff --git a/wrt/node_modules/merge-descriptors/package.json b/wrt/node_modules/merge-descriptors/package.json
new file mode 100644 (file)
index 0000000..55e257f
--- /dev/null
@@ -0,0 +1,172 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "merge-descriptors@1.0.1",
+        "scope": null,
+        "escapedName": "merge-descriptors",
+        "name": "merge-descriptors",
+        "rawSpec": "1.0.1",
+        "spec": "1.0.1",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express"
+    ]
+  ],
+  "_from": "merge-descriptors@1.0.1",
+  "_id": "merge-descriptors@1.0.1",
+  "_inCache": true,
+  "_location": "/merge-descriptors",
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "1.4.28",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "merge-descriptors@1.0.1",
+    "scope": null,
+    "escapedName": "merge-descriptors",
+    "name": "merge-descriptors",
+    "rawSpec": "1.0.1",
+    "spec": "1.0.1",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/express"
+  ],
+  "_resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
+  "_shasum": "b00aaa556dd8b44568150ec9d1b953f3f90cbb61",
+  "_shrinkwrap": null,
+  "_spec": "merge-descriptors@1.0.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express",
+  "author": {
+    "name": "Jonathan Ong",
+    "email": "me@jongleberry.com",
+    "url": "http://jongleberry.com"
+  },
+  "bugs": {
+    "url": "https://github.com/component/merge-descriptors/issues"
+  },
+  "contributors": [
+    {
+      "name": "Douglas Christopher Wilson",
+      "email": "doug@somethingdoug.com"
+    },
+    {
+      "name": "Mike Grabowski",
+      "email": "grabbou@gmail.com"
+    }
+  ],
+  "dependencies": {},
+  "description": "Merge objects using descriptors",
+  "devDependencies": {
+    "istanbul": "0.4.1",
+    "mocha": "1.21.5"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "b00aaa556dd8b44568150ec9d1b953f3f90cbb61",
+    "tarball": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz"
+  },
+  "files": [
+    "HISTORY.md",
+    "LICENSE",
+    "README.md",
+    "index.js"
+  ],
+  "gitHead": "f26c49c3b423b0b2ac31f6e32a84e1632f2d7ac2",
+  "homepage": "https://github.com/component/merge-descriptors",
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "anthonyshort",
+      "email": "antshort@gmail.com"
+    },
+    {
+      "name": "clintwood",
+      "email": "clint@anotherway.co.za"
+    },
+    {
+      "name": "dfcreative",
+      "email": "df.creative@gmail.com"
+    },
+    {
+      "name": "dominicbarnes",
+      "email": "dominic@dbarnes.info"
+    },
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    },
+    {
+      "name": "ianstormtaylor",
+      "email": "ian@ianstormtaylor.com"
+    },
+    {
+      "name": "jonathanong",
+      "email": "jonathanrichardong@gmail.com"
+    },
+    {
+      "name": "jongleberry",
+      "email": "jonathanrichardong@gmail.com"
+    },
+    {
+      "name": "juliangruber",
+      "email": "julian@juliangruber.com"
+    },
+    {
+      "name": "mattmueller",
+      "email": "mattmuelle@gmail.com"
+    },
+    {
+      "name": "queckezz",
+      "email": "fabian.eichenberger@gmail.com"
+    },
+    {
+      "name": "stephenmathieson",
+      "email": "me@stephenmathieson.com"
+    },
+    {
+      "name": "thehydroimpulse",
+      "email": "dnfagnan@gmail.com"
+    },
+    {
+      "name": "timaschew",
+      "email": "timaschew@gmail.com"
+    },
+    {
+      "name": "timoxley",
+      "email": "secoif@gmail.com"
+    },
+    {
+      "name": "tjholowaychuk",
+      "email": "tj@vision-media.ca"
+    },
+    {
+      "name": "tootallnate",
+      "email": "nathan@tootallnate.net"
+    },
+    {
+      "name": "trevorgerhardt",
+      "email": "trevorgerhardt@gmail.com"
+    },
+    {
+      "name": "yields",
+      "email": "yields@icloud.com"
+    }
+  ],
+  "name": "merge-descriptors",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/component/merge-descriptors.git"
+  },
+  "scripts": {
+    "test": "mocha --reporter spec --bail --check-leaks test/",
+    "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/"
+  },
+  "version": "1.0.1"
+}
diff --git a/wrt/node_modules/merge/.npmignore b/wrt/node_modules/merge/.npmignore
new file mode 100644 (file)
index 0000000..3598c30
--- /dev/null
@@ -0,0 +1 @@
+tests
\ No newline at end of file
diff --git a/wrt/node_modules/merge/LICENSE b/wrt/node_modules/merge/LICENSE
new file mode 100644 (file)
index 0000000..5351894
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)\r
+\r
+Copyright (c) 2014 yeikos - http://www.yeikos.com\r
+\r
+Permission is hereby granted, free of charge, to any person obtaining a copy\r
+of this software and associated documentation files (the "Software"), to deal\r
+in the Software without restriction, including without limitation the rights\r
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+copies of the Software, and to permit persons to whom the Software is\r
+furnished to do so, subject to the following conditions:\r
+\r
+The above copyright notice and this permission notice shall be included in\r
+all copies or substantial portions of the Software.\r
+\r
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
+THE SOFTWARE.
\ No newline at end of file
diff --git a/wrt/node_modules/merge/README.md b/wrt/node_modules/merge/README.md
new file mode 100644 (file)
index 0000000..317b139
--- /dev/null
@@ -0,0 +1,58 @@
+# Merge\r
+\r
+Merge multiple objects into one, optionally creating a new cloned object.\r
+Similar to the jQuery.extend but more flexible. Works in Node.js and the\r
+browser.\r
+\r
+## Node.js Usage\r
+\r
+```sh\r
+npm install merge --save\r
+```\r
+\r
+```js\r
+var merge = require('merge'), original, cloned;\r
+\r
+console.log(merge({one:'hello'}, {two: 'world'}));\r
+// -> {"one": "hello", "two": "world"}\r
+\r
+original = { x: { y: 1 } };\r
+cloned = merge(true, original);\r
+cloned.x.y++;\r
+\r
+console.log(original.x.y, cloned.x.y);\r
+// -> 1, 2\r
+\r
+console.log(merge.recursive(true, original, { x: { z: 2 } }));\r
+// -> {"x": { "y": 1, "z": 2 } }\r
+\r
+```\r
+\r
+## Browser Usage\r
+\r
+```html\r
+<script src="http://files.yeikos.com/merge.js"></script>\r
+<script>\r
+       var original, cloned;\r
+\r
+       console.log(merge({one:'hello'}, {two: 'world'}));\r
+       // -> {"one": "hello", "two": "world"}\r
+\r
+       original = { x: { y: 1 } };\r
+       cloned = merge(true, original);\r
+       cloned.x.y++;\r
+\r
+       console.log(original.x.y, cloned.x.y);\r
+       // -> 1, 2\r
+\r
+       console.log(merge.recursive(true, original, { x: { z: 2 } }));\r
+       // -> {"x": { "y": 1, "z": 2 } }\r
+\r
+</script>\r
+```\r
+\r
+## Tests\r
+\r
+```sh\r
+npm test\r
+```\r
diff --git a/wrt/node_modules/merge/bower.json b/wrt/node_modules/merge/bower.json
new file mode 100644 (file)
index 0000000..bd5de03
--- /dev/null
@@ -0,0 +1,22 @@
+{
+  "name": "merge",
+  "version": "1.2.0",
+  "homepage": "https://github.com/yeikos/js.merge",
+  "authors": [
+    "yeikos <yeikos@gmail.com>"
+  ],
+  "description": "Merge multiple objects into one, optionally creating a new cloned object. Similar to the jQuery.extend but more flexible. Works in Node.js and the browser.",
+  "main": "merge.js",
+  "keywords": [
+    "merge",
+    "recursive",
+    "extend",
+    "clone",
+    "object",
+    "browser"
+  ],
+  "license": "MIT",
+  "ignore": [
+    "tests"
+  ]
+}
diff --git a/wrt/node_modules/merge/merge.js b/wrt/node_modules/merge/merge.js
new file mode 100644 (file)
index 0000000..43089c8
--- /dev/null
@@ -0,0 +1,175 @@
+/*!\r
+ * @name JavaScript/NodeJS Merge v1.2.0\r
+ * @author yeikos\r
+ * @repository https://github.com/yeikos/js.merge\r
+\r
+ * Copyright 2014 yeikos - MIT license\r
+ * https://raw.github.com/yeikos/js.merge/master/LICENSE\r
+ */\r
+\r
+;(function(isNode) {\r
+\r
+       /**\r
+        * Merge one or more objects \r
+        * @param bool? clone\r
+        * @param mixed,... arguments\r
+        * @return object\r
+        */\r
+\r
+       var Public = function(clone) {\r
+\r
+               return merge(clone === true, false, arguments);\r
+\r
+       }, publicName = 'merge';\r
+\r
+       /**\r
+        * Merge two or more objects recursively \r
+        * @param bool? clone\r
+        * @param mixed,... arguments\r
+        * @return object\r
+        */\r
+\r
+       Public.recursive = function(clone) {\r
+\r
+               return merge(clone === true, true, arguments);\r
+\r
+       };\r
+\r
+       /**\r
+        * Clone the input removing any reference\r
+        * @param mixed input\r
+        * @return mixed\r
+        */\r
+\r
+       Public.clone = function(input) {\r
+\r
+               var output = input,\r
+                       type = typeOf(input),\r
+                       index, size;\r
+\r
+               if (type === 'array') {\r
+\r
+                       output = [];\r
+                       size = input.length;\r
+\r
+                       for (index=0;index<size;++index)\r
+\r
+                               output[index] = Public.clone(input[index]);\r
+\r
+               } else if (type === 'object') {\r
+\r
+                       output = {};\r
+\r
+                       for (index in input)\r
+\r
+                               output[index] = Public.clone(input[index]);\r
+\r
+               }\r
+\r
+               return output;\r
+\r
+       };\r
+\r
+       /**\r
+        * Merge two objects recursively\r
+        * @param mixed input\r
+        * @param mixed extend\r
+        * @return mixed\r
+        */\r
+\r
+       function merge_recursive(base, extend) {\r
+\r
+               if (typeOf(base) !== 'object')\r
+\r
+                       return extend;\r
+\r
+               for (var key in extend) {\r
+\r
+                       if (typeOf(base[key]) === 'object' && typeOf(extend[key]) === 'object') {\r
+\r
+                               base[key] = merge_recursive(base[key], extend[key]);\r
+\r
+                       } else {\r
+\r
+                               base[key] = extend[key];\r
+\r
+                       }\r
+\r
+               }\r
+\r
+               return base;\r
+\r
+       }\r
+\r
+       /**\r
+        * Merge two or more objects\r
+        * @param bool clone\r
+        * @param bool recursive\r
+        * @param array argv\r
+        * @return object\r
+        */\r
+\r
+       function merge(clone, recursive, argv) {\r
+\r
+               var result = argv[0],\r
+                       size = argv.length;\r
+\r
+               if (clone || typeOf(result) !== 'object')\r
+\r
+                       result = {};\r
+\r
+               for (var index=0;index<size;++index) {\r
+\r
+                       var item = argv[index],\r
+\r
+                               type = typeOf(item);\r
+\r
+                       if (type !== 'object') continue;\r
+\r
+                       for (var key in item) {\r
+\r
+                               var sitem = clone ? Public.clone(item[key]) : item[key];\r
+\r
+                               if (recursive) {\r
+\r
+                                       result[key] = merge_recursive(result[key], sitem);\r
+\r
+                               } else {\r
+\r
+                                       result[key] = sitem;\r
+\r
+                               }\r
+\r
+                       }\r
+\r
+               }\r
+\r
+               return result;\r
+\r
+       }\r
+\r
+       /**\r
+        * Get type of variable\r
+        * @param mixed input\r
+        * @return string\r
+        *\r
+        * @see http://jsperf.com/typeofvar\r
+        */\r
+\r
+       function typeOf(input) {\r
+\r
+               return ({}).toString.call(input).slice(8, -1).toLowerCase();\r
+\r
+       }\r
+\r
+       if (isNode) {\r
+\r
+               module.exports = Public;\r
+\r
+       } else {\r
+\r
+               window[publicName] = Public;\r
+\r
+       }\r
+\r
+})(typeof module === 'object' && module && typeof module.exports === 'object' && module.exports);
\ No newline at end of file
diff --git a/wrt/node_modules/merge/merge.min.js b/wrt/node_modules/merge/merge.min.js
new file mode 100644 (file)
index 0000000..5672f55
--- /dev/null
@@ -0,0 +1,3 @@
+/*! JavaScript/NodeJS Merge v1.2.0 | Copyright 2014 yeikos - MIT license | https://github.com/yeikos/js.merge */\r
+\r
+;(function(e){function r(e,t){if(s(e)!=="object")return t;for(var n in t){if(s(e[n])==="object"&&s(t[n])==="object"){e[n]=r(e[n],t[n])}else{e[n]=t[n]}}return e}function i(e,n,i){var o=i[0],u=i.length;if(e||s(o)!=="object")o={};for(var a=0;a<u;++a){var f=i[a],l=s(f);if(l!=="object")continue;for(var c in f){var h=e?t.clone(f[c]):f[c];if(n){o[c]=r(o[c],h)}else{o[c]=h}}}return o}function s(e){return{}.toString.call(e).slice(8,-1).toLowerCase()}var t=function(e){return i(e===true,false,arguments)},n="merge";t.recursive=function(e){return i(e===true,true,arguments)};t.clone=function(e){var n=e,r=s(e),i,o;if(r==="array"){n=[];o=e.length;for(i=0;i<o;++i)n[i]=t.clone(e[i])}else if(r==="object"){n={};for(i in e)n[i]=t.clone(e[i])}return n};if(e){module.exports=t}else{window[n]=t}})(typeof module==="object"&&module&&typeof module.exports==="object"&&module.exports);
\ No newline at end of file
diff --git a/wrt/node_modules/merge/package.json b/wrt/node_modules/merge/package.json
new file mode 100644 (file)
index 0000000..a234485
--- /dev/null
@@ -0,0 +1,87 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "merge@^1.1.3",
+        "scope": null,
+        "escapedName": "merge",
+        "name": "merge",
+        "rawSpec": "^1.1.3",
+        "spec": ">=1.1.3 <2.0.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/diskdb"
+    ]
+  ],
+  "_from": "merge@>=1.1.3 <2.0.0",
+  "_id": "merge@1.2.0",
+  "_inCache": true,
+  "_location": "/merge",
+  "_npmUser": {
+    "name": "yeikos",
+    "email": "yeikos@gmail.com"
+  },
+  "_npmVersion": "1.4.21",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "merge@^1.1.3",
+    "scope": null,
+    "escapedName": "merge",
+    "name": "merge",
+    "rawSpec": "^1.1.3",
+    "spec": ">=1.1.3 <2.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/diskdb"
+  ],
+  "_resolved": "https://registry.npmjs.org/merge/-/merge-1.2.0.tgz",
+  "_shasum": "7531e39d4949c281a66b8c5a6e0265e8b05894da",
+  "_shrinkwrap": null,
+  "_spec": "merge@^1.1.3",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/diskdb",
+  "author": {
+    "name": "yeikos",
+    "url": "http://www.yeikos.com"
+  },
+  "bugs": {
+    "url": "https://github.com/yeikos/js.merge/issues"
+  },
+  "dependencies": {},
+  "description": "Merge multiple objects into one, optionally creating a new cloned object. Similar to the jQuery.extend but more flexible. Works in Node.js and the browser.",
+  "devDependencies": {},
+  "directories": {},
+  "dist": {
+    "shasum": "7531e39d4949c281a66b8c5a6e0265e8b05894da",
+    "tarball": "https://registry.npmjs.org/merge/-/merge-1.2.0.tgz"
+  },
+  "gitHead": "6fc27c23e1ebf54a4f6ba8a7224dd48dfd9faf7c",
+  "homepage": "https://github.com/yeikos/js.merge",
+  "keywords": [
+    "merge",
+    "recursive",
+    "extend",
+    "clone",
+    "object",
+    "browser"
+  ],
+  "license": "MIT",
+  "main": "merge.js",
+  "maintainers": [
+    {
+      "name": "yeikos",
+      "email": "yeikos@gmail.com"
+    }
+  ],
+  "name": "merge",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/yeikos/js.merge.git"
+  },
+  "scripts": {
+    "test": "cd tests; node index.js"
+  },
+  "version": "1.2.0"
+}
diff --git a/wrt/node_modules/methods/HISTORY.md b/wrt/node_modules/methods/HISTORY.md
new file mode 100644 (file)
index 0000000..c0ecf07
--- /dev/null
@@ -0,0 +1,29 @@
+1.1.2 / 2016-01-17
+==================
+
+  * perf: enable strict mode
+
+1.1.1 / 2014-12-30
+==================
+
+  * Improve `browserify` support
+
+1.1.0 / 2014-07-05
+==================
+
+  * Add `CONNECT` method
+1.0.1 / 2014-06-02
+==================
+
+  * Fix module to work with harmony transform
+
+1.0.0 / 2014-05-08
+==================
+
+  * Add `PURGE` method
+
+0.1.0 / 2013-10-28
+==================
+
+  * Add `http.METHODS` support
diff --git a/wrt/node_modules/methods/LICENSE b/wrt/node_modules/methods/LICENSE
new file mode 100644 (file)
index 0000000..220dc1a
--- /dev/null
@@ -0,0 +1,24 @@
+(The MIT License)
+
+Copyright (c) 2013-2014 TJ Holowaychuk <tj@vision-media.ca>
+Copyright (c) 2015-2016 Douglas Christopher Wilson <doug@somethingdoug.com>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/wrt/node_modules/methods/README.md b/wrt/node_modules/methods/README.md
new file mode 100644 (file)
index 0000000..672a32b
--- /dev/null
@@ -0,0 +1,51 @@
+# Methods
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+HTTP verbs that Node.js core's HTTP parser supports.
+
+This module provides an export that is just like `http.METHODS` from Node.js core,
+with the following differences:
+
+  * All method names are lower-cased.
+  * Contains a fallback list of methods for Node.js versions that do not have a
+    `http.METHODS` export (0.10 and lower).
+  * Provides the fallback list when using tools like `browserify` without pulling
+    in the `http` shim module.
+
+## Install
+
+```bash
+$ npm install methods
+```
+
+## API
+
+```js
+var methods = require('methods')
+```
+
+### methods
+
+This is an array of lower-cased method names that Node.js supports. If Node.js
+provides the `http.METHODS` export, then this is the same array lower-cased,
+otherwise it is a snapshot of the verbs from Node.js 0.10.
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/methods.svg?style=flat
+[npm-url]: https://npmjs.org/package/methods
+[node-version-image]: https://img.shields.io/node/v/methods.svg?style=flat
+[node-version-url]: https://nodejs.org/en/download/
+[travis-image]: https://img.shields.io/travis/jshttp/methods.svg?style=flat
+[travis-url]: https://travis-ci.org/jshttp/methods
+[coveralls-image]: https://img.shields.io/coveralls/jshttp/methods.svg?style=flat
+[coveralls-url]: https://coveralls.io/r/jshttp/methods?branch=master
+[downloads-image]: https://img.shields.io/npm/dm/methods.svg?style=flat
+[downloads-url]: https://npmjs.org/package/methods
diff --git a/wrt/node_modules/methods/index.js b/wrt/node_modules/methods/index.js
new file mode 100644 (file)
index 0000000..667a50b
--- /dev/null
@@ -0,0 +1,69 @@
+/*!
+ * methods
+ * Copyright(c) 2013-2014 TJ Holowaychuk
+ * Copyright(c) 2015-2016 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict';
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var http = require('http');
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = getCurrentNodeMethods() || getBasicNodeMethods();
+
+/**
+ * Get the current Node.js methods.
+ * @private
+ */
+
+function getCurrentNodeMethods() {
+  return http.METHODS && http.METHODS.map(function lowerCaseMethod(method) {
+    return method.toLowerCase();
+  });
+}
+
+/**
+ * Get the "basic" Node.js methods, a snapshot from Node.js 0.10.
+ * @private
+ */
+
+function getBasicNodeMethods() {
+  return [
+    'get',
+    'post',
+    'put',
+    'head',
+    'delete',
+    'options',
+    'trace',
+    'copy',
+    'lock',
+    'mkcol',
+    'move',
+    'purge',
+    'propfind',
+    'proppatch',
+    'unlock',
+    'report',
+    'mkactivity',
+    'checkout',
+    'merge',
+    'm-search',
+    'notify',
+    'subscribe',
+    'unsubscribe',
+    'patch',
+    'search',
+    'connect'
+  ];
+}
diff --git a/wrt/node_modules/methods/package.json b/wrt/node_modules/methods/package.json
new file mode 100644 (file)
index 0000000..f8a012e
--- /dev/null
@@ -0,0 +1,122 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "methods@~1.1.2",
+        "scope": null,
+        "escapedName": "methods",
+        "name": "methods",
+        "rawSpec": "~1.1.2",
+        "spec": ">=1.1.2 <1.2.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express"
+    ]
+  ],
+  "_from": "methods@>=1.1.2 <1.2.0",
+  "_id": "methods@1.1.2",
+  "_inCache": true,
+  "_location": "/methods",
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "1.4.28",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "methods@~1.1.2",
+    "scope": null,
+    "escapedName": "methods",
+    "name": "methods",
+    "rawSpec": "~1.1.2",
+    "spec": ">=1.1.2 <1.2.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/express"
+  ],
+  "_resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
+  "_shasum": "5529a4d67654134edcc5266656835b0f851afcee",
+  "_shrinkwrap": null,
+  "_spec": "methods@~1.1.2",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express",
+  "browser": {
+    "http": false
+  },
+  "bugs": {
+    "url": "https://github.com/jshttp/methods/issues"
+  },
+  "contributors": [
+    {
+      "name": "Douglas Christopher Wilson",
+      "email": "doug@somethingdoug.com"
+    },
+    {
+      "name": "Jonathan Ong",
+      "email": "me@jongleberry.com",
+      "url": "http://jongleberry.com"
+    },
+    {
+      "name": "TJ Holowaychuk",
+      "email": "tj@vision-media.ca",
+      "url": "http://tjholowaychuk.com"
+    }
+  ],
+  "dependencies": {},
+  "description": "HTTP methods that node supports",
+  "devDependencies": {
+    "istanbul": "0.4.1",
+    "mocha": "1.21.5"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "5529a4d67654134edcc5266656835b0f851afcee",
+    "tarball": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz"
+  },
+  "engines": {
+    "node": ">= 0.6"
+  },
+  "files": [
+    "index.js",
+    "HISTORY.md",
+    "LICENSE"
+  ],
+  "gitHead": "25d257d913f1b94bd2d73581521ff72c81469140",
+  "homepage": "https://github.com/jshttp/methods",
+  "keywords": [
+    "http",
+    "methods"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "tjholowaychuk",
+      "email": "tj@vision-media.ca"
+    },
+    {
+      "name": "jonathanong",
+      "email": "jonathanrichardong@gmail.com"
+    },
+    {
+      "name": "jongleberry",
+      "email": "jonathanrichardong@gmail.com"
+    },
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "name": "methods",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/jshttp/methods.git"
+  },
+  "scripts": {
+    "test": "mocha --reporter spec --bail --check-leaks test/",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
+    "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
+  },
+  "version": "1.1.2"
+}
diff --git a/wrt/node_modules/mime-db/HISTORY.md b/wrt/node_modules/mime-db/HISTORY.md
new file mode 100644 (file)
index 0000000..b2870c4
--- /dev/null
@@ -0,0 +1,343 @@
+1.30.0 / 2017-08-27
+===================
+
+  * Add `application/vnd.ms-outlook`
+  * Add `application/x-arj`
+  * Add extension `.mjs` to `application/javascript`
+  * Add glTF types and extensions
+  * Add new upstream MIME types
+  * Add `text/x-org`
+  * Add VirtualBox MIME types
+  * Fix `source` records for `video/*` types that are IANA
+  * Update `font/opentype` to registered `font/otf`
+
+1.29.0 / 2017-07-10
+===================
+
+  * Add `application/fido.trusted-apps+json`
+  * Add extension `.wadl` to `application/vnd.sun.wadl+xml`
+  * Add new upstream MIME types
+  * Add `UTF-8` as default charset for `text/css`
+
+1.28.0 / 2017-05-14
+===================
+
+  * Add new upstream MIME types
+  * Add extension `.gz` to `application/gzip`
+  * Update extensions `.md` and `.markdown` to be `text/markdown`
+
+1.27.0 / 2017-03-16
+===================
+
+  * Add new upstream MIME types
+  * Add `image/apng` with extension `.apng`
+
+1.26.0 / 2017-01-14
+===================
+
+  * Add new upstream MIME types
+  * Add extension `.geojson` to `application/geo+json`
+
+1.25.0 / 2016-11-11
+===================
+
+  * Add new upstream MIME types
+
+1.24.0 / 2016-09-18
+===================
+
+  * Add `audio/mp3`
+  * Add new upstream MIME types
+
+1.23.0 / 2016-05-01
+===================
+
+  * Add new upstream MIME types
+  * Add extension `.3gpp` to `audio/3gpp`
+
+1.22.0 / 2016-02-15
+===================
+
+  * Add `text/slim`
+  * Add extension `.rng` to `application/xml`
+  * Add new upstream MIME types
+  * Fix extension of `application/dash+xml` to be `.mpd`
+  * Update primary extension to `.m4a` for `audio/mp4`
+
+1.21.0 / 2016-01-06
+===================
+
+  * Add Google document types
+  * Add new upstream MIME types
+
+1.20.0 / 2015-11-10
+===================
+
+  * Add `text/x-suse-ymp`
+  * Add new upstream MIME types
+
+1.19.0 / 2015-09-17
+===================
+
+  * Add `application/vnd.apple.pkpass`
+  * Add new upstream MIME types
+
+1.18.0 / 2015-09-03
+===================
+
+  * Add new upstream MIME types
+
+1.17.0 / 2015-08-13
+===================
+
+  * Add `application/x-msdos-program`
+  * Add `audio/g711-0`
+  * Add `image/vnd.mozilla.apng`
+  * Add extension `.exe` to `application/x-msdos-program`
+
+1.16.0 / 2015-07-29
+===================
+
+  * Add `application/vnd.uri-map`
+
+1.15.0 / 2015-07-13
+===================
+
+  * Add `application/x-httpd-php`
+
+1.14.0 / 2015-06-25
+===================
+
+  * Add `application/scim+json`
+  * Add `application/vnd.3gpp.ussd+xml`
+  * Add `application/vnd.biopax.rdf+xml`
+  * Add `text/x-processing`
+
+1.13.0 / 2015-06-07
+===================
+
+  * Add nginx as a source
+  * Add `application/x-cocoa`
+  * Add `application/x-java-archive-diff`
+  * Add `application/x-makeself`
+  * Add `application/x-perl`
+  * Add `application/x-pilot`
+  * Add `application/x-redhat-package-manager`
+  * Add `application/x-sea`
+  * Add `audio/x-m4a`
+  * Add `audio/x-realaudio`
+  * Add `image/x-jng`
+  * Add `text/mathml`
+
+1.12.0 / 2015-06-05
+===================
+
+  * Add `application/bdoc`
+  * Add `application/vnd.hyperdrive+json`
+  * Add `application/x-bdoc`
+  * Add extension `.rtf` to `text/rtf`
+
+1.11.0 / 2015-05-31
+===================
+
+  * Add `audio/wav`
+  * Add `audio/wave`
+  * Add extension `.litcoffee` to `text/coffeescript`
+  * Add extension `.sfd-hdstx` to `application/vnd.hydrostatix.sof-data`
+  * Add extension `.n-gage` to `application/vnd.nokia.n-gage.symbian.install`
+
+1.10.0 / 2015-05-19
+===================
+
+  * Add `application/vnd.balsamiq.bmpr`
+  * Add `application/vnd.microsoft.portable-executable`
+  * Add `application/x-ns-proxy-autoconfig`
+
+1.9.1 / 2015-04-19
+==================
+
+  * Remove `.json` extension from `application/manifest+json`
+    - This is causing bugs downstream
+
+1.9.0 / 2015-04-19
+==================
+
+  * Add `application/manifest+json`
+  * Add `application/vnd.micro+json`
+  * Add `image/vnd.zbrush.pcx`
+  * Add `image/x-ms-bmp`
+
+1.8.0 / 2015-03-13
+==================
+
+  * Add `application/vnd.citationstyles.style+xml`
+  * Add `application/vnd.fastcopy-disk-image`
+  * Add `application/vnd.gov.sk.xmldatacontainer+xml`
+  * Add extension `.jsonld` to `application/ld+json`
+
+1.7.0 / 2015-02-08
+==================
+
+  * Add `application/vnd.gerber`
+  * Add `application/vnd.msa-disk-image`
+
+1.6.1 / 2015-02-05
+==================
+
+  * Community extensions ownership transferred from `node-mime`
+
+1.6.0 / 2015-01-29
+==================
+
+  * Add `application/jose`
+  * Add `application/jose+json`
+  * Add `application/json-seq`
+  * Add `application/jwk+json`
+  * Add `application/jwk-set+json`
+  * Add `application/jwt`
+  * Add `application/rdap+json`
+  * Add `application/vnd.gov.sk.e-form+xml`
+  * Add `application/vnd.ims.imsccv1p3`
+
+1.5.0 / 2014-12-30
+==================
+
+  * Add `application/vnd.oracle.resource+json`
+  * Fix various invalid MIME type entries
+    - `application/mbox+xml`
+    - `application/oscp-response`
+    - `application/vwg-multiplexed`
+    - `audio/g721`
+
+1.4.0 / 2014-12-21
+==================
+
+  * Add `application/vnd.ims.imsccv1p2`
+  * Fix various invalid MIME type entries
+    - `application/vnd-acucobol`
+    - `application/vnd-curl`
+    - `application/vnd-dart`
+    - `application/vnd-dxr`
+    - `application/vnd-fdf`
+    - `application/vnd-mif`
+    - `application/vnd-sema`
+    - `application/vnd-wap-wmlc`
+    - `application/vnd.adobe.flash-movie`
+    - `application/vnd.dece-zip`
+    - `application/vnd.dvb_service`
+    - `application/vnd.micrografx-igx`
+    - `application/vnd.sealed-doc`
+    - `application/vnd.sealed-eml`
+    - `application/vnd.sealed-mht`
+    - `application/vnd.sealed-ppt`
+    - `application/vnd.sealed-tiff`
+    - `application/vnd.sealed-xls`
+    - `application/vnd.sealedmedia.softseal-html`
+    - `application/vnd.sealedmedia.softseal-pdf`
+    - `application/vnd.wap-slc`
+    - `application/vnd.wap-wbxml`
+    - `audio/vnd.sealedmedia.softseal-mpeg`
+    - `image/vnd-djvu`
+    - `image/vnd-svf`
+    - `image/vnd-wap-wbmp`
+    - `image/vnd.sealed-png`
+    - `image/vnd.sealedmedia.softseal-gif`
+    - `image/vnd.sealedmedia.softseal-jpg`
+    - `model/vnd-dwf`
+    - `model/vnd.parasolid.transmit-binary`
+    - `model/vnd.parasolid.transmit-text`
+    - `text/vnd-a`
+    - `text/vnd-curl`
+    - `text/vnd.wap-wml`
+  * Remove example template MIME types
+    - `application/example`
+    - `audio/example`
+    - `image/example`
+    - `message/example`
+    - `model/example`
+    - `multipart/example`
+    - `text/example`
+    - `video/example`
+
+1.3.1 / 2014-12-16
+==================
+
+  * Fix missing extensions
+    - `application/json5`
+    - `text/hjson`
+
+1.3.0 / 2014-12-07
+==================
+
+  * Add `application/a2l`
+  * Add `application/aml`
+  * Add `application/atfx`
+  * Add `application/atxml`
+  * Add `application/cdfx+xml`
+  * Add `application/dii`
+  * Add `application/json5`
+  * Add `application/lxf`
+  * Add `application/mf4`
+  * Add `application/vnd.apache.thrift.compact`
+  * Add `application/vnd.apache.thrift.json`
+  * Add `application/vnd.coffeescript`
+  * Add `application/vnd.enphase.envoy`
+  * Add `application/vnd.ims.imsccv1p1`
+  * Add `text/csv-schema`
+  * Add `text/hjson`
+  * Add `text/markdown`
+  * Add `text/yaml`
+
+1.2.0 / 2014-11-09
+==================
+
+  * Add `application/cea`
+  * Add `application/dit`
+  * Add `application/vnd.gov.sk.e-form+zip`
+  * Add `application/vnd.tmd.mediaflex.api+xml`
+  * Type `application/epub+zip` is now IANA-registered
+
+1.1.2 / 2014-10-23
+==================
+
+  * Rebuild database for `application/x-www-form-urlencoded` change
+
+1.1.1 / 2014-10-20
+==================
+
+  * Mark `application/x-www-form-urlencoded` as compressible.
+
+1.1.0 / 2014-09-28
+==================
+
+  * Add `application/font-woff2`
+
+1.0.3 / 2014-09-25
+==================
+
+  * Fix engine requirement in package
+
+1.0.2 / 2014-09-25
+==================
+
+  * Add `application/coap-group+json`
+  * Add `application/dcd`
+  * Add `application/vnd.apache.thrift.binary`
+  * Add `image/vnd.tencent.tap`
+  * Mark all JSON-derived types as compressible
+  * Update `text/vtt` data
+
+1.0.1 / 2014-08-30
+==================
+
+  * Fix extension ordering
+
+1.0.0 / 2014-08-30
+==================
+
+  * Add `application/atf`
+  * Add `application/merge-patch+json`
+  * Add `multipart/x-mixed-replace`
+  * Add `source: 'apache'` metadata
+  * Add `source: 'iana'` metadata
+  * Remove badly-assumed charset data
diff --git a/wrt/node_modules/mime-db/LICENSE b/wrt/node_modules/mime-db/LICENSE
new file mode 100644 (file)
index 0000000..a7ae8ee
--- /dev/null
@@ -0,0 +1,22 @@
+
+The MIT License (MIT)
+
+Copyright (c) 2014 Jonathan Ong me@jongleberry.com
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/mime-db/README.md b/wrt/node_modules/mime-db/README.md
new file mode 100644 (file)
index 0000000..320c1c9
--- /dev/null
@@ -0,0 +1,94 @@
+# mime-db
+
+[![NPM Version][npm-version-image]][npm-url]
+[![NPM Downloads][npm-downloads-image]][npm-url]
+[![Node.js Version][node-image]][node-url]
+[![Build Status][travis-image]][travis-url]
+[![Coverage Status][coveralls-image]][coveralls-url]
+
+This is a database of all mime types.
+It consists of a single, public JSON file and does not include any logic,
+allowing it to remain as un-opinionated as possible with an API.
+It aggregates data from the following sources:
+
+- http://www.iana.org/assignments/media-types/media-types.xhtml
+- http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
+- http://hg.nginx.org/nginx/raw-file/default/conf/mime.types
+
+## Installation
+
+```bash
+npm install mime-db
+```
+
+### Database Download
+
+If you're crazy enough to use this in the browser, you can just grab the
+JSON file using [RawGit](https://rawgit.com/). It is recommended to replace
+`master` with [a release tag](https://github.com/jshttp/mime-db/tags) as the
+JSON format may change in the future.
+
+```
+https://cdn.rawgit.com/jshttp/mime-db/master/db.json
+```
+
+## Usage
+
+```js
+var db = require('mime-db');
+
+// grab data on .js files
+var data = db['application/javascript'];
+```
+
+## Data Structure
+
+The JSON file is a map lookup for lowercased mime types.
+Each mime type has the following properties:
+
+- `.source` - where the mime type is defined.
+    If not set, it's probably a custom media type.
+    - `apache` - [Apache common media types](http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types)
+    - `iana` - [IANA-defined media types](http://www.iana.org/assignments/media-types/media-types.xhtml)
+    - `nginx` - [nginx media types](http://hg.nginx.org/nginx/raw-file/default/conf/mime.types)
+- `.extensions[]` - known extensions associated with this mime type.
+- `.compressible` - whether a file of this type can be gzipped.
+- `.charset` - the default charset associated with this type, if any.
+
+If unknown, every property could be `undefined`.
+
+## Contributing
+
+To edit the database, only make PRs against `src/custom.json` or
+`src/custom-suffix.json`.
+
+The `src/custom.json` file is a JSON object with the MIME type as the keys
+and the values being an object with the following keys:
+
+- `compressible` - leave out if you don't know, otherwise `true`/`false` for
+  if the data represented by the time is typically compressible.
+- `extensions` - include an array of file extensions that are associated with
+  the type.
+- `notes` - human-readable notes about the type, typically what the type is.
+- `sources` - include an array of URLs of where the MIME type and the associated
+  extensions are sourced from. This needs to be a [primary source](https://en.wikipedia.org/wiki/Primary_source);
+  links to type aggregating sites and Wikipedia are _not acceptible_.
+
+To update the build, run `npm run build`.
+
+## Adding Custom Media Types
+
+The best way to get new media types included in this library is to register
+them with the IANA. The community registration procedure is outlined in
+[RFC 6838 section 5](http://tools.ietf.org/html/rfc6838#section-5). Types
+registered with the IANA are automatically pulled into this library.
+
+[npm-version-image]: https://img.shields.io/npm/v/mime-db.svg
+[npm-downloads-image]: https://img.shields.io/npm/dm/mime-db.svg
+[npm-url]: https://npmjs.org/package/mime-db
+[travis-image]: https://img.shields.io/travis/jshttp/mime-db/master.svg
+[travis-url]: https://travis-ci.org/jshttp/mime-db
+[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-db/master.svg
+[coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master
+[node-image]: https://img.shields.io/node/v/mime-db.svg
+[node-url]: http://nodejs.org/download/
diff --git a/wrt/node_modules/mime-db/db.json b/wrt/node_modules/mime-db/db.json
new file mode 100644 (file)
index 0000000..0fc2a72
--- /dev/null
@@ -0,0 +1,6966 @@
+{
+  "application/1d-interleaved-parityfec": {
+    "source": "iana"
+  },
+  "application/3gpdash-qoe-report+xml": {
+    "source": "iana"
+  },
+  "application/3gpp-ims+xml": {
+    "source": "iana"
+  },
+  "application/a2l": {
+    "source": "iana"
+  },
+  "application/activemessage": {
+    "source": "iana"
+  },
+  "application/alto-costmap+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/alto-costmapfilter+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/alto-directory+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/alto-endpointcost+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/alto-endpointcostparams+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/alto-endpointprop+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/alto-endpointpropparams+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/alto-error+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/alto-networkmap+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/alto-networkmapfilter+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/aml": {
+    "source": "iana"
+  },
+  "application/andrew-inset": {
+    "source": "iana",
+    "extensions": ["ez"]
+  },
+  "application/applefile": {
+    "source": "iana"
+  },
+  "application/applixware": {
+    "source": "apache",
+    "extensions": ["aw"]
+  },
+  "application/atf": {
+    "source": "iana"
+  },
+  "application/atfx": {
+    "source": "iana"
+  },
+  "application/atom+xml": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["atom"]
+  },
+  "application/atomcat+xml": {
+    "source": "iana",
+    "extensions": ["atomcat"]
+  },
+  "application/atomdeleted+xml": {
+    "source": "iana"
+  },
+  "application/atomicmail": {
+    "source": "iana"
+  },
+  "application/atomsvc+xml": {
+    "source": "iana",
+    "extensions": ["atomsvc"]
+  },
+  "application/atxml": {
+    "source": "iana"
+  },
+  "application/auth-policy+xml": {
+    "source": "iana"
+  },
+  "application/bacnet-xdd+zip": {
+    "source": "iana"
+  },
+  "application/batch-smtp": {
+    "source": "iana"
+  },
+  "application/bdoc": {
+    "compressible": false,
+    "extensions": ["bdoc"]
+  },
+  "application/beep+xml": {
+    "source": "iana"
+  },
+  "application/calendar+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/calendar+xml": {
+    "source": "iana"
+  },
+  "application/call-completion": {
+    "source": "iana"
+  },
+  "application/cals-1840": {
+    "source": "iana"
+  },
+  "application/cbor": {
+    "source": "iana"
+  },
+  "application/cccex": {
+    "source": "iana"
+  },
+  "application/ccmp+xml": {
+    "source": "iana"
+  },
+  "application/ccxml+xml": {
+    "source": "iana",
+    "extensions": ["ccxml"]
+  },
+  "application/cdfx+xml": {
+    "source": "iana"
+  },
+  "application/cdmi-capability": {
+    "source": "iana",
+    "extensions": ["cdmia"]
+  },
+  "application/cdmi-container": {
+    "source": "iana",
+    "extensions": ["cdmic"]
+  },
+  "application/cdmi-domain": {
+    "source": "iana",
+    "extensions": ["cdmid"]
+  },
+  "application/cdmi-object": {
+    "source": "iana",
+    "extensions": ["cdmio"]
+  },
+  "application/cdmi-queue": {
+    "source": "iana",
+    "extensions": ["cdmiq"]
+  },
+  "application/cdni": {
+    "source": "iana"
+  },
+  "application/cea": {
+    "source": "iana"
+  },
+  "application/cea-2018+xml": {
+    "source": "iana"
+  },
+  "application/cellml+xml": {
+    "source": "iana"
+  },
+  "application/cfw": {
+    "source": "iana"
+  },
+  "application/clue_info+xml": {
+    "source": "iana"
+  },
+  "application/cms": {
+    "source": "iana"
+  },
+  "application/cnrp+xml": {
+    "source": "iana"
+  },
+  "application/coap-group+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/coap-payload": {
+    "source": "iana"
+  },
+  "application/commonground": {
+    "source": "iana"
+  },
+  "application/conference-info+xml": {
+    "source": "iana"
+  },
+  "application/cose": {
+    "source": "iana"
+  },
+  "application/cose-key": {
+    "source": "iana"
+  },
+  "application/cose-key-set": {
+    "source": "iana"
+  },
+  "application/cpl+xml": {
+    "source": "iana"
+  },
+  "application/csrattrs": {
+    "source": "iana"
+  },
+  "application/csta+xml": {
+    "source": "iana"
+  },
+  "application/cstadata+xml": {
+    "source": "iana"
+  },
+  "application/csvm+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/cu-seeme": {
+    "source": "apache",
+    "extensions": ["cu"]
+  },
+  "application/cybercash": {
+    "source": "iana"
+  },
+  "application/dart": {
+    "compressible": true
+  },
+  "application/dash+xml": {
+    "source": "iana",
+    "extensions": ["mpd"]
+  },
+  "application/dashdelta": {
+    "source": "iana"
+  },
+  "application/davmount+xml": {
+    "source": "iana",
+    "extensions": ["davmount"]
+  },
+  "application/dca-rft": {
+    "source": "iana"
+  },
+  "application/dcd": {
+    "source": "iana"
+  },
+  "application/dec-dx": {
+    "source": "iana"
+  },
+  "application/dialog-info+xml": {
+    "source": "iana"
+  },
+  "application/dicom": {
+    "source": "iana"
+  },
+  "application/dicom+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/dicom+xml": {
+    "source": "iana"
+  },
+  "application/dii": {
+    "source": "iana"
+  },
+  "application/dit": {
+    "source": "iana"
+  },
+  "application/dns": {
+    "source": "iana"
+  },
+  "application/docbook+xml": {
+    "source": "apache",
+    "extensions": ["dbk"]
+  },
+  "application/dskpp+xml": {
+    "source": "iana"
+  },
+  "application/dssc+der": {
+    "source": "iana",
+    "extensions": ["dssc"]
+  },
+  "application/dssc+xml": {
+    "source": "iana",
+    "extensions": ["xdssc"]
+  },
+  "application/dvcs": {
+    "source": "iana"
+  },
+  "application/ecmascript": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["ecma"]
+  },
+  "application/edi-consent": {
+    "source": "iana"
+  },
+  "application/edi-x12": {
+    "source": "iana",
+    "compressible": false
+  },
+  "application/edifact": {
+    "source": "iana",
+    "compressible": false
+  },
+  "application/efi": {
+    "source": "iana"
+  },
+  "application/emergencycalldata.comment+xml": {
+    "source": "iana"
+  },
+  "application/emergencycalldata.control+xml": {
+    "source": "iana"
+  },
+  "application/emergencycalldata.deviceinfo+xml": {
+    "source": "iana"
+  },
+  "application/emergencycalldata.ecall.msd": {
+    "source": "iana"
+  },
+  "application/emergencycalldata.providerinfo+xml": {
+    "source": "iana"
+  },
+  "application/emergencycalldata.serviceinfo+xml": {
+    "source": "iana"
+  },
+  "application/emergencycalldata.subscriberinfo+xml": {
+    "source": "iana"
+  },
+  "application/emergencycalldata.veds+xml": {
+    "source": "iana"
+  },
+  "application/emma+xml": {
+    "source": "iana",
+    "extensions": ["emma"]
+  },
+  "application/emotionml+xml": {
+    "source": "iana"
+  },
+  "application/encaprtp": {
+    "source": "iana"
+  },
+  "application/epp+xml": {
+    "source": "iana"
+  },
+  "application/epub+zip": {
+    "source": "iana",
+    "extensions": ["epub"]
+  },
+  "application/eshop": {
+    "source": "iana"
+  },
+  "application/exi": {
+    "source": "iana",
+    "extensions": ["exi"]
+  },
+  "application/fastinfoset": {
+    "source": "iana"
+  },
+  "application/fastsoap": {
+    "source": "iana"
+  },
+  "application/fdt+xml": {
+    "source": "iana"
+  },
+  "application/fido.trusted-apps+json": {
+    "compressible": true
+  },
+  "application/fits": {
+    "source": "iana"
+  },
+  "application/font-sfnt": {
+    "source": "iana"
+  },
+  "application/font-tdpfr": {
+    "source": "iana",
+    "extensions": ["pfr"]
+  },
+  "application/font-woff": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["woff"]
+  },
+  "application/font-woff2": {
+    "compressible": false,
+    "extensions": ["woff2"]
+  },
+  "application/framework-attributes+xml": {
+    "source": "iana"
+  },
+  "application/geo+json": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["geojson"]
+  },
+  "application/geo+json-seq": {
+    "source": "iana"
+  },
+  "application/geoxacml+xml": {
+    "source": "iana"
+  },
+  "application/gml+xml": {
+    "source": "iana",
+    "extensions": ["gml"]
+  },
+  "application/gpx+xml": {
+    "source": "apache",
+    "extensions": ["gpx"]
+  },
+  "application/gxf": {
+    "source": "apache",
+    "extensions": ["gxf"]
+  },
+  "application/gzip": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["gz"]
+  },
+  "application/h224": {
+    "source": "iana"
+  },
+  "application/held+xml": {
+    "source": "iana"
+  },
+  "application/http": {
+    "source": "iana"
+  },
+  "application/hyperstudio": {
+    "source": "iana",
+    "extensions": ["stk"]
+  },
+  "application/ibe-key-request+xml": {
+    "source": "iana"
+  },
+  "application/ibe-pkg-reply+xml": {
+    "source": "iana"
+  },
+  "application/ibe-pp-data": {
+    "source": "iana"
+  },
+  "application/iges": {
+    "source": "iana"
+  },
+  "application/im-iscomposing+xml": {
+    "source": "iana"
+  },
+  "application/index": {
+    "source": "iana"
+  },
+  "application/index.cmd": {
+    "source": "iana"
+  },
+  "application/index.obj": {
+    "source": "iana"
+  },
+  "application/index.response": {
+    "source": "iana"
+  },
+  "application/index.vnd": {
+    "source": "iana"
+  },
+  "application/inkml+xml": {
+    "source": "iana",
+    "extensions": ["ink","inkml"]
+  },
+  "application/iotp": {
+    "source": "iana"
+  },
+  "application/ipfix": {
+    "source": "iana",
+    "extensions": ["ipfix"]
+  },
+  "application/ipp": {
+    "source": "iana"
+  },
+  "application/isup": {
+    "source": "iana"
+  },
+  "application/its+xml": {
+    "source": "iana"
+  },
+  "application/java-archive": {
+    "source": "apache",
+    "compressible": false,
+    "extensions": ["jar","war","ear"]
+  },
+  "application/java-serialized-object": {
+    "source": "apache",
+    "compressible": false,
+    "extensions": ["ser"]
+  },
+  "application/java-vm": {
+    "source": "apache",
+    "compressible": false,
+    "extensions": ["class"]
+  },
+  "application/javascript": {
+    "source": "iana",
+    "charset": "UTF-8",
+    "compressible": true,
+    "extensions": ["js","mjs"]
+  },
+  "application/jf2feed+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/jose": {
+    "source": "iana"
+  },
+  "application/jose+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/jrd+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/json": {
+    "source": "iana",
+    "charset": "UTF-8",
+    "compressible": true,
+    "extensions": ["json","map"]
+  },
+  "application/json-patch+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/json-seq": {
+    "source": "iana"
+  },
+  "application/json5": {
+    "extensions": ["json5"]
+  },
+  "application/jsonml+json": {
+    "source": "apache",
+    "compressible": true,
+    "extensions": ["jsonml"]
+  },
+  "application/jwk+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/jwk-set+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/jwt": {
+    "source": "iana"
+  },
+  "application/kpml-request+xml": {
+    "source": "iana"
+  },
+  "application/kpml-response+xml": {
+    "source": "iana"
+  },
+  "application/ld+json": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["jsonld"]
+  },
+  "application/lgr+xml": {
+    "source": "iana"
+  },
+  "application/link-format": {
+    "source": "iana"
+  },
+  "application/load-control+xml": {
+    "source": "iana"
+  },
+  "application/lost+xml": {
+    "source": "iana",
+    "extensions": ["lostxml"]
+  },
+  "application/lostsync+xml": {
+    "source": "iana"
+  },
+  "application/lxf": {
+    "source": "iana"
+  },
+  "application/mac-binhex40": {
+    "source": "iana",
+    "extensions": ["hqx"]
+  },
+  "application/mac-compactpro": {
+    "source": "apache",
+    "extensions": ["cpt"]
+  },
+  "application/macwriteii": {
+    "source": "iana"
+  },
+  "application/mads+xml": {
+    "source": "iana",
+    "extensions": ["mads"]
+  },
+  "application/manifest+json": {
+    "charset": "UTF-8",
+    "compressible": true,
+    "extensions": ["webmanifest"]
+  },
+  "application/marc": {
+    "source": "iana",
+    "extensions": ["mrc"]
+  },
+  "application/marcxml+xml": {
+    "source": "iana",
+    "extensions": ["mrcx"]
+  },
+  "application/mathematica": {
+    "source": "iana",
+    "extensions": ["ma","nb","mb"]
+  },
+  "application/mathml+xml": {
+    "source": "iana",
+    "extensions": ["mathml"]
+  },
+  "application/mathml-content+xml": {
+    "source": "iana"
+  },
+  "application/mathml-presentation+xml": {
+    "source": "iana"
+  },
+  "application/mbms-associated-procedure-description+xml": {
+    "source": "iana"
+  },
+  "application/mbms-deregister+xml": {
+    "source": "iana"
+  },
+  "application/mbms-envelope+xml": {
+    "source": "iana"
+  },
+  "application/mbms-msk+xml": {
+    "source": "iana"
+  },
+  "application/mbms-msk-response+xml": {
+    "source": "iana"
+  },
+  "application/mbms-protection-description+xml": {
+    "source": "iana"
+  },
+  "application/mbms-reception-report+xml": {
+    "source": "iana"
+  },
+  "application/mbms-register+xml": {
+    "source": "iana"
+  },
+  "application/mbms-register-response+xml": {
+    "source": "iana"
+  },
+  "application/mbms-schedule+xml": {
+    "source": "iana"
+  },
+  "application/mbms-user-service-description+xml": {
+    "source": "iana"
+  },
+  "application/mbox": {
+    "source": "iana",
+    "extensions": ["mbox"]
+  },
+  "application/media-policy-dataset+xml": {
+    "source": "iana"
+  },
+  "application/media_control+xml": {
+    "source": "iana"
+  },
+  "application/mediaservercontrol+xml": {
+    "source": "iana",
+    "extensions": ["mscml"]
+  },
+  "application/merge-patch+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/metalink+xml": {
+    "source": "apache",
+    "extensions": ["metalink"]
+  },
+  "application/metalink4+xml": {
+    "source": "iana",
+    "extensions": ["meta4"]
+  },
+  "application/mets+xml": {
+    "source": "iana",
+    "extensions": ["mets"]
+  },
+  "application/mf4": {
+    "source": "iana"
+  },
+  "application/mikey": {
+    "source": "iana"
+  },
+  "application/mmt-usd+xml": {
+    "source": "iana"
+  },
+  "application/mods+xml": {
+    "source": "iana",
+    "extensions": ["mods"]
+  },
+  "application/moss-keys": {
+    "source": "iana"
+  },
+  "application/moss-signature": {
+    "source": "iana"
+  },
+  "application/mosskey-data": {
+    "source": "iana"
+  },
+  "application/mosskey-request": {
+    "source": "iana"
+  },
+  "application/mp21": {
+    "source": "iana",
+    "extensions": ["m21","mp21"]
+  },
+  "application/mp4": {
+    "source": "iana",
+    "extensions": ["mp4s","m4p"]
+  },
+  "application/mpeg4-generic": {
+    "source": "iana"
+  },
+  "application/mpeg4-iod": {
+    "source": "iana"
+  },
+  "application/mpeg4-iod-xmt": {
+    "source": "iana"
+  },
+  "application/mrb-consumer+xml": {
+    "source": "iana"
+  },
+  "application/mrb-publish+xml": {
+    "source": "iana"
+  },
+  "application/msc-ivr+xml": {
+    "source": "iana"
+  },
+  "application/msc-mixer+xml": {
+    "source": "iana"
+  },
+  "application/msword": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["doc","dot"]
+  },
+  "application/mud+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/mxf": {
+    "source": "iana",
+    "extensions": ["mxf"]
+  },
+  "application/n-quads": {
+    "source": "iana"
+  },
+  "application/n-triples": {
+    "source": "iana"
+  },
+  "application/nasdata": {
+    "source": "iana"
+  },
+  "application/news-checkgroups": {
+    "source": "iana"
+  },
+  "application/news-groupinfo": {
+    "source": "iana"
+  },
+  "application/news-transmission": {
+    "source": "iana"
+  },
+  "application/nlsml+xml": {
+    "source": "iana"
+  },
+  "application/nss": {
+    "source": "iana"
+  },
+  "application/ocsp-request": {
+    "source": "iana"
+  },
+  "application/ocsp-response": {
+    "source": "iana"
+  },
+  "application/octet-stream": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]
+  },
+  "application/oda": {
+    "source": "iana",
+    "extensions": ["oda"]
+  },
+  "application/odx": {
+    "source": "iana"
+  },
+  "application/oebps-package+xml": {
+    "source": "iana",
+    "extensions": ["opf"]
+  },
+  "application/ogg": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["ogx"]
+  },
+  "application/omdoc+xml": {
+    "source": "apache",
+    "extensions": ["omdoc"]
+  },
+  "application/onenote": {
+    "source": "apache",
+    "extensions": ["onetoc","onetoc2","onetmp","onepkg"]
+  },
+  "application/oxps": {
+    "source": "iana",
+    "extensions": ["oxps"]
+  },
+  "application/p2p-overlay+xml": {
+    "source": "iana"
+  },
+  "application/parityfec": {
+    "source": "iana"
+  },
+  "application/passport": {
+    "source": "iana"
+  },
+  "application/patch-ops-error+xml": {
+    "source": "iana",
+    "extensions": ["xer"]
+  },
+  "application/pdf": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["pdf"]
+  },
+  "application/pdx": {
+    "source": "iana"
+  },
+  "application/pgp-encrypted": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["pgp"]
+  },
+  "application/pgp-keys": {
+    "source": "iana"
+  },
+  "application/pgp-signature": {
+    "source": "iana",
+    "extensions": ["asc","sig"]
+  },
+  "application/pics-rules": {
+    "source": "apache",
+    "extensions": ["prf"]
+  },
+  "application/pidf+xml": {
+    "source": "iana"
+  },
+  "application/pidf-diff+xml": {
+    "source": "iana"
+  },
+  "application/pkcs10": {
+    "source": "iana",
+    "extensions": ["p10"]
+  },
+  "application/pkcs12": {
+    "source": "iana"
+  },
+  "application/pkcs7-mime": {
+    "source": "iana",
+    "extensions": ["p7m","p7c"]
+  },
+  "application/pkcs7-signature": {
+    "source": "iana",
+    "extensions": ["p7s"]
+  },
+  "application/pkcs8": {
+    "source": "iana",
+    "extensions": ["p8"]
+  },
+  "application/pkix-attr-cert": {
+    "source": "iana",
+    "extensions": ["ac"]
+  },
+  "application/pkix-cert": {
+    "source": "iana",
+    "extensions": ["cer"]
+  },
+  "application/pkix-crl": {
+    "source": "iana",
+    "extensions": ["crl"]
+  },
+  "application/pkix-pkipath": {
+    "source": "iana",
+    "extensions": ["pkipath"]
+  },
+  "application/pkixcmp": {
+    "source": "iana",
+    "extensions": ["pki"]
+  },
+  "application/pls+xml": {
+    "source": "iana",
+    "extensions": ["pls"]
+  },
+  "application/poc-settings+xml": {
+    "source": "iana"
+  },
+  "application/postscript": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["ai","eps","ps"]
+  },
+  "application/ppsp-tracker+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/problem+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/problem+xml": {
+    "source": "iana"
+  },
+  "application/provenance+xml": {
+    "source": "iana"
+  },
+  "application/prs.alvestrand.titrax-sheet": {
+    "source": "iana"
+  },
+  "application/prs.cww": {
+    "source": "iana",
+    "extensions": ["cww"]
+  },
+  "application/prs.hpub+zip": {
+    "source": "iana"
+  },
+  "application/prs.nprend": {
+    "source": "iana"
+  },
+  "application/prs.plucker": {
+    "source": "iana"
+  },
+  "application/prs.rdf-xml-crypt": {
+    "source": "iana"
+  },
+  "application/prs.xsf+xml": {
+    "source": "iana"
+  },
+  "application/pskc+xml": {
+    "source": "iana",
+    "extensions": ["pskcxml"]
+  },
+  "application/qsig": {
+    "source": "iana"
+  },
+  "application/raptorfec": {
+    "source": "iana"
+  },
+  "application/rdap+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/rdf+xml": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["rdf"]
+  },
+  "application/reginfo+xml": {
+    "source": "iana",
+    "extensions": ["rif"]
+  },
+  "application/relax-ng-compact-syntax": {
+    "source": "iana",
+    "extensions": ["rnc"]
+  },
+  "application/remote-printing": {
+    "source": "iana"
+  },
+  "application/reputon+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/resource-lists+xml": {
+    "source": "iana",
+    "extensions": ["rl"]
+  },
+  "application/resource-lists-diff+xml": {
+    "source": "iana",
+    "extensions": ["rld"]
+  },
+  "application/rfc+xml": {
+    "source": "iana"
+  },
+  "application/riscos": {
+    "source": "iana"
+  },
+  "application/rlmi+xml": {
+    "source": "iana"
+  },
+  "application/rls-services+xml": {
+    "source": "iana",
+    "extensions": ["rs"]
+  },
+  "application/route-apd+xml": {
+    "source": "iana"
+  },
+  "application/route-s-tsid+xml": {
+    "source": "iana"
+  },
+  "application/route-usd+xml": {
+    "source": "iana"
+  },
+  "application/rpki-ghostbusters": {
+    "source": "iana",
+    "extensions": ["gbr"]
+  },
+  "application/rpki-manifest": {
+    "source": "iana",
+    "extensions": ["mft"]
+  },
+  "application/rpki-publication": {
+    "source": "iana"
+  },
+  "application/rpki-roa": {
+    "source": "iana",
+    "extensions": ["roa"]
+  },
+  "application/rpki-updown": {
+    "source": "iana"
+  },
+  "application/rsd+xml": {
+    "source": "apache",
+    "extensions": ["rsd"]
+  },
+  "application/rss+xml": {
+    "source": "apache",
+    "compressible": true,
+    "extensions": ["rss"]
+  },
+  "application/rtf": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["rtf"]
+  },
+  "application/rtploopback": {
+    "source": "iana"
+  },
+  "application/rtx": {
+    "source": "iana"
+  },
+  "application/samlassertion+xml": {
+    "source": "iana"
+  },
+  "application/samlmetadata+xml": {
+    "source": "iana"
+  },
+  "application/sbml+xml": {
+    "source": "iana",
+    "extensions": ["sbml"]
+  },
+  "application/scaip+xml": {
+    "source": "iana"
+  },
+  "application/scim+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/scvp-cv-request": {
+    "source": "iana",
+    "extensions": ["scq"]
+  },
+  "application/scvp-cv-response": {
+    "source": "iana",
+    "extensions": ["scs"]
+  },
+  "application/scvp-vp-request": {
+    "source": "iana",
+    "extensions": ["spq"]
+  },
+  "application/scvp-vp-response": {
+    "source": "iana",
+    "extensions": ["spp"]
+  },
+  "application/sdp": {
+    "source": "iana",
+    "extensions": ["sdp"]
+  },
+  "application/sep+xml": {
+    "source": "iana"
+  },
+  "application/sep-exi": {
+    "source": "iana"
+  },
+  "application/session-info": {
+    "source": "iana"
+  },
+  "application/set-payment": {
+    "source": "iana"
+  },
+  "application/set-payment-initiation": {
+    "source": "iana",
+    "extensions": ["setpay"]
+  },
+  "application/set-registration": {
+    "source": "iana"
+  },
+  "application/set-registration-initiation": {
+    "source": "iana",
+    "extensions": ["setreg"]
+  },
+  "application/sgml": {
+    "source": "iana"
+  },
+  "application/sgml-open-catalog": {
+    "source": "iana"
+  },
+  "application/shf+xml": {
+    "source": "iana",
+    "extensions": ["shf"]
+  },
+  "application/sieve": {
+    "source": "iana"
+  },
+  "application/simple-filter+xml": {
+    "source": "iana"
+  },
+  "application/simple-message-summary": {
+    "source": "iana"
+  },
+  "application/simplesymbolcontainer": {
+    "source": "iana"
+  },
+  "application/slate": {
+    "source": "iana"
+  },
+  "application/smil": {
+    "source": "iana"
+  },
+  "application/smil+xml": {
+    "source": "iana",
+    "extensions": ["smi","smil"]
+  },
+  "application/smpte336m": {
+    "source": "iana"
+  },
+  "application/soap+fastinfoset": {
+    "source": "iana"
+  },
+  "application/soap+xml": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/sparql-query": {
+    "source": "iana",
+    "extensions": ["rq"]
+  },
+  "application/sparql-results+xml": {
+    "source": "iana",
+    "extensions": ["srx"]
+  },
+  "application/spirits-event+xml": {
+    "source": "iana"
+  },
+  "application/sql": {
+    "source": "iana"
+  },
+  "application/srgs": {
+    "source": "iana",
+    "extensions": ["gram"]
+  },
+  "application/srgs+xml": {
+    "source": "iana",
+    "extensions": ["grxml"]
+  },
+  "application/sru+xml": {
+    "source": "iana",
+    "extensions": ["sru"]
+  },
+  "application/ssdl+xml": {
+    "source": "apache",
+    "extensions": ["ssdl"]
+  },
+  "application/ssml+xml": {
+    "source": "iana",
+    "extensions": ["ssml"]
+  },
+  "application/tamp-apex-update": {
+    "source": "iana"
+  },
+  "application/tamp-apex-update-confirm": {
+    "source": "iana"
+  },
+  "application/tamp-community-update": {
+    "source": "iana"
+  },
+  "application/tamp-community-update-confirm": {
+    "source": "iana"
+  },
+  "application/tamp-error": {
+    "source": "iana"
+  },
+  "application/tamp-sequence-adjust": {
+    "source": "iana"
+  },
+  "application/tamp-sequence-adjust-confirm": {
+    "source": "iana"
+  },
+  "application/tamp-status-query": {
+    "source": "iana"
+  },
+  "application/tamp-status-response": {
+    "source": "iana"
+  },
+  "application/tamp-update": {
+    "source": "iana"
+  },
+  "application/tamp-update-confirm": {
+    "source": "iana"
+  },
+  "application/tar": {
+    "compressible": true
+  },
+  "application/tei+xml": {
+    "source": "iana",
+    "extensions": ["tei","teicorpus"]
+  },
+  "application/thraud+xml": {
+    "source": "iana",
+    "extensions": ["tfi"]
+  },
+  "application/timestamp-query": {
+    "source": "iana"
+  },
+  "application/timestamp-reply": {
+    "source": "iana"
+  },
+  "application/timestamped-data": {
+    "source": "iana",
+    "extensions": ["tsd"]
+  },
+  "application/trig": {
+    "source": "iana"
+  },
+  "application/ttml+xml": {
+    "source": "iana"
+  },
+  "application/tve-trigger": {
+    "source": "iana"
+  },
+  "application/ulpfec": {
+    "source": "iana"
+  },
+  "application/urc-grpsheet+xml": {
+    "source": "iana"
+  },
+  "application/urc-ressheet+xml": {
+    "source": "iana"
+  },
+  "application/urc-targetdesc+xml": {
+    "source": "iana"
+  },
+  "application/urc-uisocketdesc+xml": {
+    "source": "iana"
+  },
+  "application/vcard+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vcard+xml": {
+    "source": "iana"
+  },
+  "application/vemmi": {
+    "source": "iana"
+  },
+  "application/vividence.scriptfile": {
+    "source": "apache"
+  },
+  "application/vnd.1000minds.decision-model+xml": {
+    "source": "iana"
+  },
+  "application/vnd.3gpp-prose+xml": {
+    "source": "iana"
+  },
+  "application/vnd.3gpp-prose-pc3ch+xml": {
+    "source": "iana"
+  },
+  "application/vnd.3gpp.access-transfer-events+xml": {
+    "source": "iana"
+  },
+  "application/vnd.3gpp.bsf+xml": {
+    "source": "iana"
+  },
+  "application/vnd.3gpp.gmop+xml": {
+    "source": "iana"
+  },
+  "application/vnd.3gpp.mcptt-info+xml": {
+    "source": "iana"
+  },
+  "application/vnd.3gpp.mcptt-mbms-usage-info+xml": {
+    "source": "iana"
+  },
+  "application/vnd.3gpp.mid-call+xml": {
+    "source": "iana"
+  },
+  "application/vnd.3gpp.pic-bw-large": {
+    "source": "iana",
+    "extensions": ["plb"]
+  },
+  "application/vnd.3gpp.pic-bw-small": {
+    "source": "iana",
+    "extensions": ["psb"]
+  },
+  "application/vnd.3gpp.pic-bw-var": {
+    "source": "iana",
+    "extensions": ["pvb"]
+  },
+  "application/vnd.3gpp.sms": {
+    "source": "iana"
+  },
+  "application/vnd.3gpp.sms+xml": {
+    "source": "iana"
+  },
+  "application/vnd.3gpp.srvcc-ext+xml": {
+    "source": "iana"
+  },
+  "application/vnd.3gpp.srvcc-info+xml": {
+    "source": "iana"
+  },
+  "application/vnd.3gpp.state-and-event-info+xml": {
+    "source": "iana"
+  },
+  "application/vnd.3gpp.ussd+xml": {
+    "source": "iana"
+  },
+  "application/vnd.3gpp2.bcmcsinfo+xml": {
+    "source": "iana"
+  },
+  "application/vnd.3gpp2.sms": {
+    "source": "iana"
+  },
+  "application/vnd.3gpp2.tcap": {
+    "source": "iana",
+    "extensions": ["tcap"]
+  },
+  "application/vnd.3lightssoftware.imagescal": {
+    "source": "iana"
+  },
+  "application/vnd.3m.post-it-notes": {
+    "source": "iana",
+    "extensions": ["pwn"]
+  },
+  "application/vnd.accpac.simply.aso": {
+    "source": "iana",
+    "extensions": ["aso"]
+  },
+  "application/vnd.accpac.simply.imp": {
+    "source": "iana",
+    "extensions": ["imp"]
+  },
+  "application/vnd.acucobol": {
+    "source": "iana",
+    "extensions": ["acu"]
+  },
+  "application/vnd.acucorp": {
+    "source": "iana",
+    "extensions": ["atc","acutc"]
+  },
+  "application/vnd.adobe.air-application-installer-package+zip": {
+    "source": "apache",
+    "extensions": ["air"]
+  },
+  "application/vnd.adobe.flash.movie": {
+    "source": "iana"
+  },
+  "application/vnd.adobe.formscentral.fcdt": {
+    "source": "iana",
+    "extensions": ["fcdt"]
+  },
+  "application/vnd.adobe.fxp": {
+    "source": "iana",
+    "extensions": ["fxp","fxpl"]
+  },
+  "application/vnd.adobe.partial-upload": {
+    "source": "iana"
+  },
+  "application/vnd.adobe.xdp+xml": {
+    "source": "iana",
+    "extensions": ["xdp"]
+  },
+  "application/vnd.adobe.xfdf": {
+    "source": "iana",
+    "extensions": ["xfdf"]
+  },
+  "application/vnd.aether.imp": {
+    "source": "iana"
+  },
+  "application/vnd.ah-barcode": {
+    "source": "iana"
+  },
+  "application/vnd.ahead.space": {
+    "source": "iana",
+    "extensions": ["ahead"]
+  },
+  "application/vnd.airzip.filesecure.azf": {
+    "source": "iana",
+    "extensions": ["azf"]
+  },
+  "application/vnd.airzip.filesecure.azs": {
+    "source": "iana",
+    "extensions": ["azs"]
+  },
+  "application/vnd.amazon.ebook": {
+    "source": "apache",
+    "extensions": ["azw"]
+  },
+  "application/vnd.amazon.mobi8-ebook": {
+    "source": "iana"
+  },
+  "application/vnd.americandynamics.acc": {
+    "source": "iana",
+    "extensions": ["acc"]
+  },
+  "application/vnd.amiga.ami": {
+    "source": "iana",
+    "extensions": ["ami"]
+  },
+  "application/vnd.amundsen.maze+xml": {
+    "source": "iana"
+  },
+  "application/vnd.android.package-archive": {
+    "source": "apache",
+    "compressible": false,
+    "extensions": ["apk"]
+  },
+  "application/vnd.anki": {
+    "source": "iana"
+  },
+  "application/vnd.anser-web-certificate-issue-initiation": {
+    "source": "iana",
+    "extensions": ["cii"]
+  },
+  "application/vnd.anser-web-funds-transfer-initiation": {
+    "source": "apache",
+    "extensions": ["fti"]
+  },
+  "application/vnd.antix.game-component": {
+    "source": "iana",
+    "extensions": ["atx"]
+  },
+  "application/vnd.apache.thrift.binary": {
+    "source": "iana"
+  },
+  "application/vnd.apache.thrift.compact": {
+    "source": "iana"
+  },
+  "application/vnd.apache.thrift.json": {
+    "source": "iana"
+  },
+  "application/vnd.api+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.apothekende.reservation+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.apple.installer+xml": {
+    "source": "iana",
+    "extensions": ["mpkg"]
+  },
+  "application/vnd.apple.mpegurl": {
+    "source": "iana",
+    "extensions": ["m3u8"]
+  },
+  "application/vnd.apple.pkpass": {
+    "compressible": false,
+    "extensions": ["pkpass"]
+  },
+  "application/vnd.arastra.swi": {
+    "source": "iana"
+  },
+  "application/vnd.aristanetworks.swi": {
+    "source": "iana",
+    "extensions": ["swi"]
+  },
+  "application/vnd.artsquare": {
+    "source": "iana"
+  },
+  "application/vnd.astraea-software.iota": {
+    "source": "iana",
+    "extensions": ["iota"]
+  },
+  "application/vnd.audiograph": {
+    "source": "iana",
+    "extensions": ["aep"]
+  },
+  "application/vnd.autopackage": {
+    "source": "iana"
+  },
+  "application/vnd.avistar+xml": {
+    "source": "iana"
+  },
+  "application/vnd.balsamiq.bmml+xml": {
+    "source": "iana"
+  },
+  "application/vnd.balsamiq.bmpr": {
+    "source": "iana"
+  },
+  "application/vnd.bekitzur-stech+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.bint.med-content": {
+    "source": "iana"
+  },
+  "application/vnd.biopax.rdf+xml": {
+    "source": "iana"
+  },
+  "application/vnd.blink-idb-value-wrapper": {
+    "source": "iana"
+  },
+  "application/vnd.blueice.multipass": {
+    "source": "iana",
+    "extensions": ["mpm"]
+  },
+  "application/vnd.bluetooth.ep.oob": {
+    "source": "iana"
+  },
+  "application/vnd.bluetooth.le.oob": {
+    "source": "iana"
+  },
+  "application/vnd.bmi": {
+    "source": "iana",
+    "extensions": ["bmi"]
+  },
+  "application/vnd.businessobjects": {
+    "source": "iana",
+    "extensions": ["rep"]
+  },
+  "application/vnd.cab-jscript": {
+    "source": "iana"
+  },
+  "application/vnd.canon-cpdl": {
+    "source": "iana"
+  },
+  "application/vnd.canon-lips": {
+    "source": "iana"
+  },
+  "application/vnd.capasystems-pg+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.cendio.thinlinc.clientconf": {
+    "source": "iana"
+  },
+  "application/vnd.century-systems.tcp_stream": {
+    "source": "iana"
+  },
+  "application/vnd.chemdraw+xml": {
+    "source": "iana",
+    "extensions": ["cdxml"]
+  },
+  "application/vnd.chess-pgn": {
+    "source": "iana"
+  },
+  "application/vnd.chipnuts.karaoke-mmd": {
+    "source": "iana",
+    "extensions": ["mmd"]
+  },
+  "application/vnd.cinderella": {
+    "source": "iana",
+    "extensions": ["cdy"]
+  },
+  "application/vnd.cirpack.isdn-ext": {
+    "source": "iana"
+  },
+  "application/vnd.citationstyles.style+xml": {
+    "source": "iana"
+  },
+  "application/vnd.claymore": {
+    "source": "iana",
+    "extensions": ["cla"]
+  },
+  "application/vnd.cloanto.rp9": {
+    "source": "iana",
+    "extensions": ["rp9"]
+  },
+  "application/vnd.clonk.c4group": {
+    "source": "iana",
+    "extensions": ["c4g","c4d","c4f","c4p","c4u"]
+  },
+  "application/vnd.cluetrust.cartomobile-config": {
+    "source": "iana",
+    "extensions": ["c11amc"]
+  },
+  "application/vnd.cluetrust.cartomobile-config-pkg": {
+    "source": "iana",
+    "extensions": ["c11amz"]
+  },
+  "application/vnd.coffeescript": {
+    "source": "iana"
+  },
+  "application/vnd.collection+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.collection.doc+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.collection.next+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.comicbook+zip": {
+    "source": "iana"
+  },
+  "application/vnd.commerce-battelle": {
+    "source": "iana"
+  },
+  "application/vnd.commonspace": {
+    "source": "iana",
+    "extensions": ["csp"]
+  },
+  "application/vnd.contact.cmsg": {
+    "source": "iana",
+    "extensions": ["cdbcmsg"]
+  },
+  "application/vnd.coreos.ignition+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.cosmocaller": {
+    "source": "iana",
+    "extensions": ["cmc"]
+  },
+  "application/vnd.crick.clicker": {
+    "source": "iana",
+    "extensions": ["clkx"]
+  },
+  "application/vnd.crick.clicker.keyboard": {
+    "source": "iana",
+    "extensions": ["clkk"]
+  },
+  "application/vnd.crick.clicker.palette": {
+    "source": "iana",
+    "extensions": ["clkp"]
+  },
+  "application/vnd.crick.clicker.template": {
+    "source": "iana",
+    "extensions": ["clkt"]
+  },
+  "application/vnd.crick.clicker.wordbank": {
+    "source": "iana",
+    "extensions": ["clkw"]
+  },
+  "application/vnd.criticaltools.wbs+xml": {
+    "source": "iana",
+    "extensions": ["wbs"]
+  },
+  "application/vnd.ctc-posml": {
+    "source": "iana",
+    "extensions": ["pml"]
+  },
+  "application/vnd.ctct.ws+xml": {
+    "source": "iana"
+  },
+  "application/vnd.cups-pdf": {
+    "source": "iana"
+  },
+  "application/vnd.cups-postscript": {
+    "source": "iana"
+  },
+  "application/vnd.cups-ppd": {
+    "source": "iana",
+    "extensions": ["ppd"]
+  },
+  "application/vnd.cups-raster": {
+    "source": "iana"
+  },
+  "application/vnd.cups-raw": {
+    "source": "iana"
+  },
+  "application/vnd.curl": {
+    "source": "iana"
+  },
+  "application/vnd.curl.car": {
+    "source": "apache",
+    "extensions": ["car"]
+  },
+  "application/vnd.curl.pcurl": {
+    "source": "apache",
+    "extensions": ["pcurl"]
+  },
+  "application/vnd.cyan.dean.root+xml": {
+    "source": "iana"
+  },
+  "application/vnd.cybank": {
+    "source": "iana"
+  },
+  "application/vnd.d2l.coursepackage1p0+zip": {
+    "source": "iana"
+  },
+  "application/vnd.dart": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["dart"]
+  },
+  "application/vnd.data-vision.rdz": {
+    "source": "iana",
+    "extensions": ["rdz"]
+  },
+  "application/vnd.datapackage+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.dataresource+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.debian.binary-package": {
+    "source": "iana"
+  },
+  "application/vnd.dece.data": {
+    "source": "iana",
+    "extensions": ["uvf","uvvf","uvd","uvvd"]
+  },
+  "application/vnd.dece.ttml+xml": {
+    "source": "iana",
+    "extensions": ["uvt","uvvt"]
+  },
+  "application/vnd.dece.unspecified": {
+    "source": "iana",
+    "extensions": ["uvx","uvvx"]
+  },
+  "application/vnd.dece.zip": {
+    "source": "iana",
+    "extensions": ["uvz","uvvz"]
+  },
+  "application/vnd.denovo.fcselayout-link": {
+    "source": "iana",
+    "extensions": ["fe_launch"]
+  },
+  "application/vnd.desmume-movie": {
+    "source": "iana"
+  },
+  "application/vnd.desmume.movie": {
+    "source": "apache"
+  },
+  "application/vnd.dir-bi.plate-dl-nosuffix": {
+    "source": "iana"
+  },
+  "application/vnd.dm.delegation+xml": {
+    "source": "iana"
+  },
+  "application/vnd.dna": {
+    "source": "iana",
+    "extensions": ["dna"]
+  },
+  "application/vnd.document+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.dolby.mlp": {
+    "source": "apache",
+    "extensions": ["mlp"]
+  },
+  "application/vnd.dolby.mobile.1": {
+    "source": "iana"
+  },
+  "application/vnd.dolby.mobile.2": {
+    "source": "iana"
+  },
+  "application/vnd.doremir.scorecloud-binary-document": {
+    "source": "iana"
+  },
+  "application/vnd.dpgraph": {
+    "source": "iana",
+    "extensions": ["dpg"]
+  },
+  "application/vnd.dreamfactory": {
+    "source": "iana",
+    "extensions": ["dfac"]
+  },
+  "application/vnd.drive+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.ds-keypoint": {
+    "source": "apache",
+    "extensions": ["kpxx"]
+  },
+  "application/vnd.dtg.local": {
+    "source": "iana"
+  },
+  "application/vnd.dtg.local.flash": {
+    "source": "iana"
+  },
+  "application/vnd.dtg.local.html": {
+    "source": "iana"
+  },
+  "application/vnd.dvb.ait": {
+    "source": "iana",
+    "extensions": ["ait"]
+  },
+  "application/vnd.dvb.dvbj": {
+    "source": "iana"
+  },
+  "application/vnd.dvb.esgcontainer": {
+    "source": "iana"
+  },
+  "application/vnd.dvb.ipdcdftnotifaccess": {
+    "source": "iana"
+  },
+  "application/vnd.dvb.ipdcesgaccess": {
+    "source": "iana"
+  },
+  "application/vnd.dvb.ipdcesgaccess2": {
+    "source": "iana"
+  },
+  "application/vnd.dvb.ipdcesgpdd": {
+    "source": "iana"
+  },
+  "application/vnd.dvb.ipdcroaming": {
+    "source": "iana"
+  },
+  "application/vnd.dvb.iptv.alfec-base": {
+    "source": "iana"
+  },
+  "application/vnd.dvb.iptv.alfec-enhancement": {
+    "source": "iana"
+  },
+  "application/vnd.dvb.notif-aggregate-root+xml": {
+    "source": "iana"
+  },
+  "application/vnd.dvb.notif-container+xml": {
+    "source": "iana"
+  },
+  "application/vnd.dvb.notif-generic+xml": {
+    "source": "iana"
+  },
+  "application/vnd.dvb.notif-ia-msglist+xml": {
+    "source": "iana"
+  },
+  "application/vnd.dvb.notif-ia-registration-request+xml": {
+    "source": "iana"
+  },
+  "application/vnd.dvb.notif-ia-registration-response+xml": {
+    "source": "iana"
+  },
+  "application/vnd.dvb.notif-init+xml": {
+    "source": "iana"
+  },
+  "application/vnd.dvb.pfr": {
+    "source": "iana"
+  },
+  "application/vnd.dvb.service": {
+    "source": "iana",
+    "extensions": ["svc"]
+  },
+  "application/vnd.dxr": {
+    "source": "iana"
+  },
+  "application/vnd.dynageo": {
+    "source": "iana",
+    "extensions": ["geo"]
+  },
+  "application/vnd.dzr": {
+    "source": "iana"
+  },
+  "application/vnd.easykaraoke.cdgdownload": {
+    "source": "iana"
+  },
+  "application/vnd.ecdis-update": {
+    "source": "iana"
+  },
+  "application/vnd.ecowin.chart": {
+    "source": "iana",
+    "extensions": ["mag"]
+  },
+  "application/vnd.ecowin.filerequest": {
+    "source": "iana"
+  },
+  "application/vnd.ecowin.fileupdate": {
+    "source": "iana"
+  },
+  "application/vnd.ecowin.series": {
+    "source": "iana"
+  },
+  "application/vnd.ecowin.seriesrequest": {
+    "source": "iana"
+  },
+  "application/vnd.ecowin.seriesupdate": {
+    "source": "iana"
+  },
+  "application/vnd.efi.img": {
+    "source": "iana"
+  },
+  "application/vnd.efi.iso": {
+    "source": "iana"
+  },
+  "application/vnd.emclient.accessrequest+xml": {
+    "source": "iana"
+  },
+  "application/vnd.enliven": {
+    "source": "iana",
+    "extensions": ["nml"]
+  },
+  "application/vnd.enphase.envoy": {
+    "source": "iana"
+  },
+  "application/vnd.eprints.data+xml": {
+    "source": "iana"
+  },
+  "application/vnd.epson.esf": {
+    "source": "iana",
+    "extensions": ["esf"]
+  },
+  "application/vnd.epson.msf": {
+    "source": "iana",
+    "extensions": ["msf"]
+  },
+  "application/vnd.epson.quickanime": {
+    "source": "iana",
+    "extensions": ["qam"]
+  },
+  "application/vnd.epson.salt": {
+    "source": "iana",
+    "extensions": ["slt"]
+  },
+  "application/vnd.epson.ssf": {
+    "source": "iana",
+    "extensions": ["ssf"]
+  },
+  "application/vnd.ericsson.quickcall": {
+    "source": "iana"
+  },
+  "application/vnd.espass-espass+zip": {
+    "source": "iana"
+  },
+  "application/vnd.eszigno3+xml": {
+    "source": "iana",
+    "extensions": ["es3","et3"]
+  },
+  "application/vnd.etsi.aoc+xml": {
+    "source": "iana"
+  },
+  "application/vnd.etsi.asic-e+zip": {
+    "source": "iana"
+  },
+  "application/vnd.etsi.asic-s+zip": {
+    "source": "iana"
+  },
+  "application/vnd.etsi.cug+xml": {
+    "source": "iana"
+  },
+  "application/vnd.etsi.iptvcommand+xml": {
+    "source": "iana"
+  },
+  "application/vnd.etsi.iptvdiscovery+xml": {
+    "source": "iana"
+  },
+  "application/vnd.etsi.iptvprofile+xml": {
+    "source": "iana"
+  },
+  "application/vnd.etsi.iptvsad-bc+xml": {
+    "source": "iana"
+  },
+  "application/vnd.etsi.iptvsad-cod+xml": {
+    "source": "iana"
+  },
+  "application/vnd.etsi.iptvsad-npvr+xml": {
+    "source": "iana"
+  },
+  "application/vnd.etsi.iptvservice+xml": {
+    "source": "iana"
+  },
+  "application/vnd.etsi.iptvsync+xml": {
+    "source": "iana"
+  },
+  "application/vnd.etsi.iptvueprofile+xml": {
+    "source": "iana"
+  },
+  "application/vnd.etsi.mcid+xml": {
+    "source": "iana"
+  },
+  "application/vnd.etsi.mheg5": {
+    "source": "iana"
+  },
+  "application/vnd.etsi.overload-control-policy-dataset+xml": {
+    "source": "iana"
+  },
+  "application/vnd.etsi.pstn+xml": {
+    "source": "iana"
+  },
+  "application/vnd.etsi.sci+xml": {
+    "source": "iana"
+  },
+  "application/vnd.etsi.simservs+xml": {
+    "source": "iana"
+  },
+  "application/vnd.etsi.timestamp-token": {
+    "source": "iana"
+  },
+  "application/vnd.etsi.tsl+xml": {
+    "source": "iana"
+  },
+  "application/vnd.etsi.tsl.der": {
+    "source": "iana"
+  },
+  "application/vnd.eudora.data": {
+    "source": "iana"
+  },
+  "application/vnd.evolv.ecig.profile": {
+    "source": "iana"
+  },
+  "application/vnd.evolv.ecig.settings": {
+    "source": "iana"
+  },
+  "application/vnd.evolv.ecig.theme": {
+    "source": "iana"
+  },
+  "application/vnd.ezpix-album": {
+    "source": "iana",
+    "extensions": ["ez2"]
+  },
+  "application/vnd.ezpix-package": {
+    "source": "iana",
+    "extensions": ["ez3"]
+  },
+  "application/vnd.f-secure.mobile": {
+    "source": "iana"
+  },
+  "application/vnd.fastcopy-disk-image": {
+    "source": "iana"
+  },
+  "application/vnd.fdf": {
+    "source": "iana",
+    "extensions": ["fdf"]
+  },
+  "application/vnd.fdsn.mseed": {
+    "source": "iana",
+    "extensions": ["mseed"]
+  },
+  "application/vnd.fdsn.seed": {
+    "source": "iana",
+    "extensions": ["seed","dataless"]
+  },
+  "application/vnd.ffsns": {
+    "source": "iana"
+  },
+  "application/vnd.filmit.zfc": {
+    "source": "iana"
+  },
+  "application/vnd.fints": {
+    "source": "iana"
+  },
+  "application/vnd.firemonkeys.cloudcell": {
+    "source": "iana"
+  },
+  "application/vnd.flographit": {
+    "source": "iana",
+    "extensions": ["gph"]
+  },
+  "application/vnd.fluxtime.clip": {
+    "source": "iana",
+    "extensions": ["ftc"]
+  },
+  "application/vnd.font-fontforge-sfd": {
+    "source": "iana"
+  },
+  "application/vnd.framemaker": {
+    "source": "iana",
+    "extensions": ["fm","frame","maker","book"]
+  },
+  "application/vnd.frogans.fnc": {
+    "source": "iana",
+    "extensions": ["fnc"]
+  },
+  "application/vnd.frogans.ltf": {
+    "source": "iana",
+    "extensions": ["ltf"]
+  },
+  "application/vnd.fsc.weblaunch": {
+    "source": "iana",
+    "extensions": ["fsc"]
+  },
+  "application/vnd.fujitsu.oasys": {
+    "source": "iana",
+    "extensions": ["oas"]
+  },
+  "application/vnd.fujitsu.oasys2": {
+    "source": "iana",
+    "extensions": ["oa2"]
+  },
+  "application/vnd.fujitsu.oasys3": {
+    "source": "iana",
+    "extensions": ["oa3"]
+  },
+  "application/vnd.fujitsu.oasysgp": {
+    "source": "iana",
+    "extensions": ["fg5"]
+  },
+  "application/vnd.fujitsu.oasysprs": {
+    "source": "iana",
+    "extensions": ["bh2"]
+  },
+  "application/vnd.fujixerox.art-ex": {
+    "source": "iana"
+  },
+  "application/vnd.fujixerox.art4": {
+    "source": "iana"
+  },
+  "application/vnd.fujixerox.ddd": {
+    "source": "iana",
+    "extensions": ["ddd"]
+  },
+  "application/vnd.fujixerox.docuworks": {
+    "source": "iana",
+    "extensions": ["xdw"]
+  },
+  "application/vnd.fujixerox.docuworks.binder": {
+    "source": "iana",
+    "extensions": ["xbd"]
+  },
+  "application/vnd.fujixerox.docuworks.container": {
+    "source": "iana"
+  },
+  "application/vnd.fujixerox.hbpl": {
+    "source": "iana"
+  },
+  "application/vnd.fut-misnet": {
+    "source": "iana"
+  },
+  "application/vnd.fuzzysheet": {
+    "source": "iana",
+    "extensions": ["fzs"]
+  },
+  "application/vnd.genomatix.tuxedo": {
+    "source": "iana",
+    "extensions": ["txd"]
+  },
+  "application/vnd.geo+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.geocube+xml": {
+    "source": "iana"
+  },
+  "application/vnd.geogebra.file": {
+    "source": "iana",
+    "extensions": ["ggb"]
+  },
+  "application/vnd.geogebra.tool": {
+    "source": "iana",
+    "extensions": ["ggt"]
+  },
+  "application/vnd.geometry-explorer": {
+    "source": "iana",
+    "extensions": ["gex","gre"]
+  },
+  "application/vnd.geonext": {
+    "source": "iana",
+    "extensions": ["gxt"]
+  },
+  "application/vnd.geoplan": {
+    "source": "iana",
+    "extensions": ["g2w"]
+  },
+  "application/vnd.geospace": {
+    "source": "iana",
+    "extensions": ["g3w"]
+  },
+  "application/vnd.gerber": {
+    "source": "iana"
+  },
+  "application/vnd.globalplatform.card-content-mgt": {
+    "source": "iana"
+  },
+  "application/vnd.globalplatform.card-content-mgt-response": {
+    "source": "iana"
+  },
+  "application/vnd.gmx": {
+    "source": "iana",
+    "extensions": ["gmx"]
+  },
+  "application/vnd.google-apps.document": {
+    "compressible": false,
+    "extensions": ["gdoc"]
+  },
+  "application/vnd.google-apps.presentation": {
+    "compressible": false,
+    "extensions": ["gslides"]
+  },
+  "application/vnd.google-apps.spreadsheet": {
+    "compressible": false,
+    "extensions": ["gsheet"]
+  },
+  "application/vnd.google-earth.kml+xml": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["kml"]
+  },
+  "application/vnd.google-earth.kmz": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["kmz"]
+  },
+  "application/vnd.gov.sk.e-form+xml": {
+    "source": "iana"
+  },
+  "application/vnd.gov.sk.e-form+zip": {
+    "source": "iana"
+  },
+  "application/vnd.gov.sk.xmldatacontainer+xml": {
+    "source": "iana"
+  },
+  "application/vnd.grafeq": {
+    "source": "iana",
+    "extensions": ["gqf","gqs"]
+  },
+  "application/vnd.gridmp": {
+    "source": "iana"
+  },
+  "application/vnd.groove-account": {
+    "source": "iana",
+    "extensions": ["gac"]
+  },
+  "application/vnd.groove-help": {
+    "source": "iana",
+    "extensions": ["ghf"]
+  },
+  "application/vnd.groove-identity-message": {
+    "source": "iana",
+    "extensions": ["gim"]
+  },
+  "application/vnd.groove-injector": {
+    "source": "iana",
+    "extensions": ["grv"]
+  },
+  "application/vnd.groove-tool-message": {
+    "source": "iana",
+    "extensions": ["gtm"]
+  },
+  "application/vnd.groove-tool-template": {
+    "source": "iana",
+    "extensions": ["tpl"]
+  },
+  "application/vnd.groove-vcard": {
+    "source": "iana",
+    "extensions": ["vcg"]
+  },
+  "application/vnd.hal+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.hal+xml": {
+    "source": "iana",
+    "extensions": ["hal"]
+  },
+  "application/vnd.handheld-entertainment+xml": {
+    "source": "iana",
+    "extensions": ["zmm"]
+  },
+  "application/vnd.hbci": {
+    "source": "iana",
+    "extensions": ["hbci"]
+  },
+  "application/vnd.hc+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.hcl-bireports": {
+    "source": "iana"
+  },
+  "application/vnd.hdt": {
+    "source": "iana"
+  },
+  "application/vnd.heroku+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.hhe.lesson-player": {
+    "source": "iana",
+    "extensions": ["les"]
+  },
+  "application/vnd.hp-hpgl": {
+    "source": "iana",
+    "extensions": ["hpgl"]
+  },
+  "application/vnd.hp-hpid": {
+    "source": "iana",
+    "extensions": ["hpid"]
+  },
+  "application/vnd.hp-hps": {
+    "source": "iana",
+    "extensions": ["hps"]
+  },
+  "application/vnd.hp-jlyt": {
+    "source": "iana",
+    "extensions": ["jlt"]
+  },
+  "application/vnd.hp-pcl": {
+    "source": "iana",
+    "extensions": ["pcl"]
+  },
+  "application/vnd.hp-pclxl": {
+    "source": "iana",
+    "extensions": ["pclxl"]
+  },
+  "application/vnd.httphone": {
+    "source": "iana"
+  },
+  "application/vnd.hydrostatix.sof-data": {
+    "source": "iana",
+    "extensions": ["sfd-hdstx"]
+  },
+  "application/vnd.hyper-item+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.hyperdrive+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.hzn-3d-crossword": {
+    "source": "iana"
+  },
+  "application/vnd.ibm.afplinedata": {
+    "source": "iana"
+  },
+  "application/vnd.ibm.electronic-media": {
+    "source": "iana"
+  },
+  "application/vnd.ibm.minipay": {
+    "source": "iana",
+    "extensions": ["mpy"]
+  },
+  "application/vnd.ibm.modcap": {
+    "source": "iana",
+    "extensions": ["afp","listafp","list3820"]
+  },
+  "application/vnd.ibm.rights-management": {
+    "source": "iana",
+    "extensions": ["irm"]
+  },
+  "application/vnd.ibm.secure-container": {
+    "source": "iana",
+    "extensions": ["sc"]
+  },
+  "application/vnd.iccprofile": {
+    "source": "iana",
+    "extensions": ["icc","icm"]
+  },
+  "application/vnd.ieee.1905": {
+    "source": "iana"
+  },
+  "application/vnd.igloader": {
+    "source": "iana",
+    "extensions": ["igl"]
+  },
+  "application/vnd.imagemeter.folder+zip": {
+    "source": "iana"
+  },
+  "application/vnd.imagemeter.image+zip": {
+    "source": "iana"
+  },
+  "application/vnd.immervision-ivp": {
+    "source": "iana",
+    "extensions": ["ivp"]
+  },
+  "application/vnd.immervision-ivu": {
+    "source": "iana",
+    "extensions": ["ivu"]
+  },
+  "application/vnd.ims.imsccv1p1": {
+    "source": "iana"
+  },
+  "application/vnd.ims.imsccv1p2": {
+    "source": "iana"
+  },
+  "application/vnd.ims.imsccv1p3": {
+    "source": "iana"
+  },
+  "application/vnd.ims.lis.v2.result+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.ims.lti.v2.toolconsumerprofile+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.ims.lti.v2.toolproxy+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.ims.lti.v2.toolproxy.id+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.ims.lti.v2.toolsettings+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.ims.lti.v2.toolsettings.simple+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.informedcontrol.rms+xml": {
+    "source": "iana"
+  },
+  "application/vnd.informix-visionary": {
+    "source": "iana"
+  },
+  "application/vnd.infotech.project": {
+    "source": "iana"
+  },
+  "application/vnd.infotech.project+xml": {
+    "source": "iana"
+  },
+  "application/vnd.innopath.wamp.notification": {
+    "source": "iana"
+  },
+  "application/vnd.insors.igm": {
+    "source": "iana",
+    "extensions": ["igm"]
+  },
+  "application/vnd.intercon.formnet": {
+    "source": "iana",
+    "extensions": ["xpw","xpx"]
+  },
+  "application/vnd.intergeo": {
+    "source": "iana",
+    "extensions": ["i2g"]
+  },
+  "application/vnd.intertrust.digibox": {
+    "source": "iana"
+  },
+  "application/vnd.intertrust.nncp": {
+    "source": "iana"
+  },
+  "application/vnd.intu.qbo": {
+    "source": "iana",
+    "extensions": ["qbo"]
+  },
+  "application/vnd.intu.qfx": {
+    "source": "iana",
+    "extensions": ["qfx"]
+  },
+  "application/vnd.iptc.g2.catalogitem+xml": {
+    "source": "iana"
+  },
+  "application/vnd.iptc.g2.conceptitem+xml": {
+    "source": "iana"
+  },
+  "application/vnd.iptc.g2.knowledgeitem+xml": {
+    "source": "iana"
+  },
+  "application/vnd.iptc.g2.newsitem+xml": {
+    "source": "iana"
+  },
+  "application/vnd.iptc.g2.newsmessage+xml": {
+    "source": "iana"
+  },
+  "application/vnd.iptc.g2.packageitem+xml": {
+    "source": "iana"
+  },
+  "application/vnd.iptc.g2.planningitem+xml": {
+    "source": "iana"
+  },
+  "application/vnd.ipunplugged.rcprofile": {
+    "source": "iana",
+    "extensions": ["rcprofile"]
+  },
+  "application/vnd.irepository.package+xml": {
+    "source": "iana",
+    "extensions": ["irp"]
+  },
+  "application/vnd.is-xpr": {
+    "source": "iana",
+    "extensions": ["xpr"]
+  },
+  "application/vnd.isac.fcs": {
+    "source": "iana",
+    "extensions": ["fcs"]
+  },
+  "application/vnd.jam": {
+    "source": "iana",
+    "extensions": ["jam"]
+  },
+  "application/vnd.japannet-directory-service": {
+    "source": "iana"
+  },
+  "application/vnd.japannet-jpnstore-wakeup": {
+    "source": "iana"
+  },
+  "application/vnd.japannet-payment-wakeup": {
+    "source": "iana"
+  },
+  "application/vnd.japannet-registration": {
+    "source": "iana"
+  },
+  "application/vnd.japannet-registration-wakeup": {
+    "source": "iana"
+  },
+  "application/vnd.japannet-setstore-wakeup": {
+    "source": "iana"
+  },
+  "application/vnd.japannet-verification": {
+    "source": "iana"
+  },
+  "application/vnd.japannet-verification-wakeup": {
+    "source": "iana"
+  },
+  "application/vnd.jcp.javame.midlet-rms": {
+    "source": "iana",
+    "extensions": ["rms"]
+  },
+  "application/vnd.jisp": {
+    "source": "iana",
+    "extensions": ["jisp"]
+  },
+  "application/vnd.joost.joda-archive": {
+    "source": "iana",
+    "extensions": ["joda"]
+  },
+  "application/vnd.jsk.isdn-ngn": {
+    "source": "iana"
+  },
+  "application/vnd.kahootz": {
+    "source": "iana",
+    "extensions": ["ktz","ktr"]
+  },
+  "application/vnd.kde.karbon": {
+    "source": "iana",
+    "extensions": ["karbon"]
+  },
+  "application/vnd.kde.kchart": {
+    "source": "iana",
+    "extensions": ["chrt"]
+  },
+  "application/vnd.kde.kformula": {
+    "source": "iana",
+    "extensions": ["kfo"]
+  },
+  "application/vnd.kde.kivio": {
+    "source": "iana",
+    "extensions": ["flw"]
+  },
+  "application/vnd.kde.kontour": {
+    "source": "iana",
+    "extensions": ["kon"]
+  },
+  "application/vnd.kde.kpresenter": {
+    "source": "iana",
+    "extensions": ["kpr","kpt"]
+  },
+  "application/vnd.kde.kspread": {
+    "source": "iana",
+    "extensions": ["ksp"]
+  },
+  "application/vnd.kde.kword": {
+    "source": "iana",
+    "extensions": ["kwd","kwt"]
+  },
+  "application/vnd.kenameaapp": {
+    "source": "iana",
+    "extensions": ["htke"]
+  },
+  "application/vnd.kidspiration": {
+    "source": "iana",
+    "extensions": ["kia"]
+  },
+  "application/vnd.kinar": {
+    "source": "iana",
+    "extensions": ["kne","knp"]
+  },
+  "application/vnd.koan": {
+    "source": "iana",
+    "extensions": ["skp","skd","skt","skm"]
+  },
+  "application/vnd.kodak-descriptor": {
+    "source": "iana",
+    "extensions": ["sse"]
+  },
+  "application/vnd.las.las+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.las.las+xml": {
+    "source": "iana",
+    "extensions": ["lasxml"]
+  },
+  "application/vnd.liberty-request+xml": {
+    "source": "iana"
+  },
+  "application/vnd.llamagraphics.life-balance.desktop": {
+    "source": "iana",
+    "extensions": ["lbd"]
+  },
+  "application/vnd.llamagraphics.life-balance.exchange+xml": {
+    "source": "iana",
+    "extensions": ["lbe"]
+  },
+  "application/vnd.lotus-1-2-3": {
+    "source": "iana",
+    "extensions": ["123"]
+  },
+  "application/vnd.lotus-approach": {
+    "source": "iana",
+    "extensions": ["apr"]
+  },
+  "application/vnd.lotus-freelance": {
+    "source": "iana",
+    "extensions": ["pre"]
+  },
+  "application/vnd.lotus-notes": {
+    "source": "iana",
+    "extensions": ["nsf"]
+  },
+  "application/vnd.lotus-organizer": {
+    "source": "iana",
+    "extensions": ["org"]
+  },
+  "application/vnd.lotus-screencam": {
+    "source": "iana",
+    "extensions": ["scm"]
+  },
+  "application/vnd.lotus-wordpro": {
+    "source": "iana",
+    "extensions": ["lwp"]
+  },
+  "application/vnd.macports.portpkg": {
+    "source": "iana",
+    "extensions": ["portpkg"]
+  },
+  "application/vnd.mapbox-vector-tile": {
+    "source": "iana"
+  },
+  "application/vnd.marlin.drm.actiontoken+xml": {
+    "source": "iana"
+  },
+  "application/vnd.marlin.drm.conftoken+xml": {
+    "source": "iana"
+  },
+  "application/vnd.marlin.drm.license+xml": {
+    "source": "iana"
+  },
+  "application/vnd.marlin.drm.mdcf": {
+    "source": "iana"
+  },
+  "application/vnd.mason+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.maxmind.maxmind-db": {
+    "source": "iana"
+  },
+  "application/vnd.mcd": {
+    "source": "iana",
+    "extensions": ["mcd"]
+  },
+  "application/vnd.medcalcdata": {
+    "source": "iana",
+    "extensions": ["mc1"]
+  },
+  "application/vnd.mediastation.cdkey": {
+    "source": "iana",
+    "extensions": ["cdkey"]
+  },
+  "application/vnd.meridian-slingshot": {
+    "source": "iana"
+  },
+  "application/vnd.mfer": {
+    "source": "iana",
+    "extensions": ["mwf"]
+  },
+  "application/vnd.mfmp": {
+    "source": "iana",
+    "extensions": ["mfm"]
+  },
+  "application/vnd.micro+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.micrografx.flo": {
+    "source": "iana",
+    "extensions": ["flo"]
+  },
+  "application/vnd.micrografx.igx": {
+    "source": "iana",
+    "extensions": ["igx"]
+  },
+  "application/vnd.microsoft.portable-executable": {
+    "source": "iana"
+  },
+  "application/vnd.microsoft.windows.thumbnail-cache": {
+    "source": "iana"
+  },
+  "application/vnd.miele+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.mif": {
+    "source": "iana",
+    "extensions": ["mif"]
+  },
+  "application/vnd.minisoft-hp3000-save": {
+    "source": "iana"
+  },
+  "application/vnd.mitsubishi.misty-guard.trustweb": {
+    "source": "iana"
+  },
+  "application/vnd.mobius.daf": {
+    "source": "iana",
+    "extensions": ["daf"]
+  },
+  "application/vnd.mobius.dis": {
+    "source": "iana",
+    "extensions": ["dis"]
+  },
+  "application/vnd.mobius.mbk": {
+    "source": "iana",
+    "extensions": ["mbk"]
+  },
+  "application/vnd.mobius.mqy": {
+    "source": "iana",
+    "extensions": ["mqy"]
+  },
+  "application/vnd.mobius.msl": {
+    "source": "iana",
+    "extensions": ["msl"]
+  },
+  "application/vnd.mobius.plc": {
+    "source": "iana",
+    "extensions": ["plc"]
+  },
+  "application/vnd.mobius.txf": {
+    "source": "iana",
+    "extensions": ["txf"]
+  },
+  "application/vnd.mophun.application": {
+    "source": "iana",
+    "extensions": ["mpn"]
+  },
+  "application/vnd.mophun.certificate": {
+    "source": "iana",
+    "extensions": ["mpc"]
+  },
+  "application/vnd.motorola.flexsuite": {
+    "source": "iana"
+  },
+  "application/vnd.motorola.flexsuite.adsi": {
+    "source": "iana"
+  },
+  "application/vnd.motorola.flexsuite.fis": {
+    "source": "iana"
+  },
+  "application/vnd.motorola.flexsuite.gotap": {
+    "source": "iana"
+  },
+  "application/vnd.motorola.flexsuite.kmr": {
+    "source": "iana"
+  },
+  "application/vnd.motorola.flexsuite.ttc": {
+    "source": "iana"
+  },
+  "application/vnd.motorola.flexsuite.wem": {
+    "source": "iana"
+  },
+  "application/vnd.motorola.iprm": {
+    "source": "iana"
+  },
+  "application/vnd.mozilla.xul+xml": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["xul"]
+  },
+  "application/vnd.ms-3mfdocument": {
+    "source": "iana"
+  },
+  "application/vnd.ms-artgalry": {
+    "source": "iana",
+    "extensions": ["cil"]
+  },
+  "application/vnd.ms-asf": {
+    "source": "iana"
+  },
+  "application/vnd.ms-cab-compressed": {
+    "source": "iana",
+    "extensions": ["cab"]
+  },
+  "application/vnd.ms-color.iccprofile": {
+    "source": "apache"
+  },
+  "application/vnd.ms-excel": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["xls","xlm","xla","xlc","xlt","xlw"]
+  },
+  "application/vnd.ms-excel.addin.macroenabled.12": {
+    "source": "iana",
+    "extensions": ["xlam"]
+  },
+  "application/vnd.ms-excel.sheet.binary.macroenabled.12": {
+    "source": "iana",
+    "extensions": ["xlsb"]
+  },
+  "application/vnd.ms-excel.sheet.macroenabled.12": {
+    "source": "iana",
+    "extensions": ["xlsm"]
+  },
+  "application/vnd.ms-excel.template.macroenabled.12": {
+    "source": "iana",
+    "extensions": ["xltm"]
+  },
+  "application/vnd.ms-fontobject": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["eot"]
+  },
+  "application/vnd.ms-htmlhelp": {
+    "source": "iana",
+    "extensions": ["chm"]
+  },
+  "application/vnd.ms-ims": {
+    "source": "iana",
+    "extensions": ["ims"]
+  },
+  "application/vnd.ms-lrm": {
+    "source": "iana",
+    "extensions": ["lrm"]
+  },
+  "application/vnd.ms-office.activex+xml": {
+    "source": "iana"
+  },
+  "application/vnd.ms-officetheme": {
+    "source": "iana",
+    "extensions": ["thmx"]
+  },
+  "application/vnd.ms-opentype": {
+    "source": "apache",
+    "compressible": true
+  },
+  "application/vnd.ms-outlook": {
+    "compressible": false,
+    "extensions": ["msg"]
+  },
+  "application/vnd.ms-package.obfuscated-opentype": {
+    "source": "apache"
+  },
+  "application/vnd.ms-pki.seccat": {
+    "source": "apache",
+    "extensions": ["cat"]
+  },
+  "application/vnd.ms-pki.stl": {
+    "source": "apache",
+    "extensions": ["stl"]
+  },
+  "application/vnd.ms-playready.initiator+xml": {
+    "source": "iana"
+  },
+  "application/vnd.ms-powerpoint": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["ppt","pps","pot"]
+  },
+  "application/vnd.ms-powerpoint.addin.macroenabled.12": {
+    "source": "iana",
+    "extensions": ["ppam"]
+  },
+  "application/vnd.ms-powerpoint.presentation.macroenabled.12": {
+    "source": "iana",
+    "extensions": ["pptm"]
+  },
+  "application/vnd.ms-powerpoint.slide.macroenabled.12": {
+    "source": "iana",
+    "extensions": ["sldm"]
+  },
+  "application/vnd.ms-powerpoint.slideshow.macroenabled.12": {
+    "source": "iana",
+    "extensions": ["ppsm"]
+  },
+  "application/vnd.ms-powerpoint.template.macroenabled.12": {
+    "source": "iana",
+    "extensions": ["potm"]
+  },
+  "application/vnd.ms-printdevicecapabilities+xml": {
+    "source": "iana"
+  },
+  "application/vnd.ms-printing.printticket+xml": {
+    "source": "apache"
+  },
+  "application/vnd.ms-printschematicket+xml": {
+    "source": "iana"
+  },
+  "application/vnd.ms-project": {
+    "source": "iana",
+    "extensions": ["mpp","mpt"]
+  },
+  "application/vnd.ms-tnef": {
+    "source": "iana"
+  },
+  "application/vnd.ms-windows.devicepairing": {
+    "source": "iana"
+  },
+  "application/vnd.ms-windows.nwprinting.oob": {
+    "source": "iana"
+  },
+  "application/vnd.ms-windows.printerpairing": {
+    "source": "iana"
+  },
+  "application/vnd.ms-windows.wsd.oob": {
+    "source": "iana"
+  },
+  "application/vnd.ms-wmdrm.lic-chlg-req": {
+    "source": "iana"
+  },
+  "application/vnd.ms-wmdrm.lic-resp": {
+    "source": "iana"
+  },
+  "application/vnd.ms-wmdrm.meter-chlg-req": {
+    "source": "iana"
+  },
+  "application/vnd.ms-wmdrm.meter-resp": {
+    "source": "iana"
+  },
+  "application/vnd.ms-word.document.macroenabled.12": {
+    "source": "iana",
+    "extensions": ["docm"]
+  },
+  "application/vnd.ms-word.template.macroenabled.12": {
+    "source": "iana",
+    "extensions": ["dotm"]
+  },
+  "application/vnd.ms-works": {
+    "source": "iana",
+    "extensions": ["wps","wks","wcm","wdb"]
+  },
+  "application/vnd.ms-wpl": {
+    "source": "iana",
+    "extensions": ["wpl"]
+  },
+  "application/vnd.ms-xpsdocument": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["xps"]
+  },
+  "application/vnd.msa-disk-image": {
+    "source": "iana"
+  },
+  "application/vnd.mseq": {
+    "source": "iana",
+    "extensions": ["mseq"]
+  },
+  "application/vnd.msign": {
+    "source": "iana"
+  },
+  "application/vnd.multiad.creator": {
+    "source": "iana"
+  },
+  "application/vnd.multiad.creator.cif": {
+    "source": "iana"
+  },
+  "application/vnd.music-niff": {
+    "source": "iana"
+  },
+  "application/vnd.musician": {
+    "source": "iana",
+    "extensions": ["mus"]
+  },
+  "application/vnd.muvee.style": {
+    "source": "iana",
+    "extensions": ["msty"]
+  },
+  "application/vnd.mynfc": {
+    "source": "iana",
+    "extensions": ["taglet"]
+  },
+  "application/vnd.ncd.control": {
+    "source": "iana"
+  },
+  "application/vnd.ncd.reference": {
+    "source": "iana"
+  },
+  "application/vnd.nearst.inv+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.nervana": {
+    "source": "iana"
+  },
+  "application/vnd.netfpx": {
+    "source": "iana"
+  },
+  "application/vnd.neurolanguage.nlu": {
+    "source": "iana",
+    "extensions": ["nlu"]
+  },
+  "application/vnd.nintendo.nitro.rom": {
+    "source": "iana"
+  },
+  "application/vnd.nintendo.snes.rom": {
+    "source": "iana"
+  },
+  "application/vnd.nitf": {
+    "source": "iana",
+    "extensions": ["ntf","nitf"]
+  },
+  "application/vnd.noblenet-directory": {
+    "source": "iana",
+    "extensions": ["nnd"]
+  },
+  "application/vnd.noblenet-sealer": {
+    "source": "iana",
+    "extensions": ["nns"]
+  },
+  "application/vnd.noblenet-web": {
+    "source": "iana",
+    "extensions": ["nnw"]
+  },
+  "application/vnd.nokia.catalogs": {
+    "source": "iana"
+  },
+  "application/vnd.nokia.conml+wbxml": {
+    "source": "iana"
+  },
+  "application/vnd.nokia.conml+xml": {
+    "source": "iana"
+  },
+  "application/vnd.nokia.iptv.config+xml": {
+    "source": "iana"
+  },
+  "application/vnd.nokia.isds-radio-presets": {
+    "source": "iana"
+  },
+  "application/vnd.nokia.landmark+wbxml": {
+    "source": "iana"
+  },
+  "application/vnd.nokia.landmark+xml": {
+    "source": "iana"
+  },
+  "application/vnd.nokia.landmarkcollection+xml": {
+    "source": "iana"
+  },
+  "application/vnd.nokia.n-gage.ac+xml": {
+    "source": "iana"
+  },
+  "application/vnd.nokia.n-gage.data": {
+    "source": "iana",
+    "extensions": ["ngdat"]
+  },
+  "application/vnd.nokia.n-gage.symbian.install": {
+    "source": "iana",
+    "extensions": ["n-gage"]
+  },
+  "application/vnd.nokia.ncd": {
+    "source": "iana"
+  },
+  "application/vnd.nokia.pcd+wbxml": {
+    "source": "iana"
+  },
+  "application/vnd.nokia.pcd+xml": {
+    "source": "iana"
+  },
+  "application/vnd.nokia.radio-preset": {
+    "source": "iana",
+    "extensions": ["rpst"]
+  },
+  "application/vnd.nokia.radio-presets": {
+    "source": "iana",
+    "extensions": ["rpss"]
+  },
+  "application/vnd.novadigm.edm": {
+    "source": "iana",
+    "extensions": ["edm"]
+  },
+  "application/vnd.novadigm.edx": {
+    "source": "iana",
+    "extensions": ["edx"]
+  },
+  "application/vnd.novadigm.ext": {
+    "source": "iana",
+    "extensions": ["ext"]
+  },
+  "application/vnd.ntt-local.content-share": {
+    "source": "iana"
+  },
+  "application/vnd.ntt-local.file-transfer": {
+    "source": "iana"
+  },
+  "application/vnd.ntt-local.ogw_remote-access": {
+    "source": "iana"
+  },
+  "application/vnd.ntt-local.sip-ta_remote": {
+    "source": "iana"
+  },
+  "application/vnd.ntt-local.sip-ta_tcp_stream": {
+    "source": "iana"
+  },
+  "application/vnd.oasis.opendocument.chart": {
+    "source": "iana",
+    "extensions": ["odc"]
+  },
+  "application/vnd.oasis.opendocument.chart-template": {
+    "source": "iana",
+    "extensions": ["otc"]
+  },
+  "application/vnd.oasis.opendocument.database": {
+    "source": "iana",
+    "extensions": ["odb"]
+  },
+  "application/vnd.oasis.opendocument.formula": {
+    "source": "iana",
+    "extensions": ["odf"]
+  },
+  "application/vnd.oasis.opendocument.formula-template": {
+    "source": "iana",
+    "extensions": ["odft"]
+  },
+  "application/vnd.oasis.opendocument.graphics": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["odg"]
+  },
+  "application/vnd.oasis.opendocument.graphics-template": {
+    "source": "iana",
+    "extensions": ["otg"]
+  },
+  "application/vnd.oasis.opendocument.image": {
+    "source": "iana",
+    "extensions": ["odi"]
+  },
+  "application/vnd.oasis.opendocument.image-template": {
+    "source": "iana",
+    "extensions": ["oti"]
+  },
+  "application/vnd.oasis.opendocument.presentation": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["odp"]
+  },
+  "application/vnd.oasis.opendocument.presentation-template": {
+    "source": "iana",
+    "extensions": ["otp"]
+  },
+  "application/vnd.oasis.opendocument.spreadsheet": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["ods"]
+  },
+  "application/vnd.oasis.opendocument.spreadsheet-template": {
+    "source": "iana",
+    "extensions": ["ots"]
+  },
+  "application/vnd.oasis.opendocument.text": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["odt"]
+  },
+  "application/vnd.oasis.opendocument.text-master": {
+    "source": "iana",
+    "extensions": ["odm"]
+  },
+  "application/vnd.oasis.opendocument.text-template": {
+    "source": "iana",
+    "extensions": ["ott"]
+  },
+  "application/vnd.oasis.opendocument.text-web": {
+    "source": "iana",
+    "extensions": ["oth"]
+  },
+  "application/vnd.obn": {
+    "source": "iana"
+  },
+  "application/vnd.ocf+cbor": {
+    "source": "iana"
+  },
+  "application/vnd.oftn.l10n+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.oipf.contentaccessdownload+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oipf.contentaccessstreaming+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oipf.cspg-hexbinary": {
+    "source": "iana"
+  },
+  "application/vnd.oipf.dae.svg+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oipf.dae.xhtml+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oipf.mippvcontrolmessage+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oipf.pae.gem": {
+    "source": "iana"
+  },
+  "application/vnd.oipf.spdiscovery+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oipf.spdlist+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oipf.ueprofile+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oipf.userprofile+xml": {
+    "source": "iana"
+  },
+  "application/vnd.olpc-sugar": {
+    "source": "iana",
+    "extensions": ["xo"]
+  },
+  "application/vnd.oma-scws-config": {
+    "source": "iana"
+  },
+  "application/vnd.oma-scws-http-request": {
+    "source": "iana"
+  },
+  "application/vnd.oma-scws-http-response": {
+    "source": "iana"
+  },
+  "application/vnd.oma.bcast.associated-procedure-parameter+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oma.bcast.drm-trigger+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oma.bcast.imd+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oma.bcast.ltkm": {
+    "source": "iana"
+  },
+  "application/vnd.oma.bcast.notification+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oma.bcast.provisioningtrigger": {
+    "source": "iana"
+  },
+  "application/vnd.oma.bcast.sgboot": {
+    "source": "iana"
+  },
+  "application/vnd.oma.bcast.sgdd+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oma.bcast.sgdu": {
+    "source": "iana"
+  },
+  "application/vnd.oma.bcast.simple-symbol-container": {
+    "source": "iana"
+  },
+  "application/vnd.oma.bcast.smartcard-trigger+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oma.bcast.sprov+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oma.bcast.stkm": {
+    "source": "iana"
+  },
+  "application/vnd.oma.cab-address-book+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oma.cab-feature-handler+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oma.cab-pcc+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oma.cab-subs-invite+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oma.cab-user-prefs+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oma.dcd": {
+    "source": "iana"
+  },
+  "application/vnd.oma.dcdc": {
+    "source": "iana"
+  },
+  "application/vnd.oma.dd2+xml": {
+    "source": "iana",
+    "extensions": ["dd2"]
+  },
+  "application/vnd.oma.drm.risd+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oma.group-usage-list+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oma.lwm2m+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.oma.lwm2m+tlv": {
+    "source": "iana"
+  },
+  "application/vnd.oma.pal+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oma.poc.detailed-progress-report+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oma.poc.final-report+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oma.poc.groups+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oma.poc.invocation-descriptor+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oma.poc.optimized-progress-report+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oma.push": {
+    "source": "iana"
+  },
+  "application/vnd.oma.scidm.messages+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oma.xcap-directory+xml": {
+    "source": "iana"
+  },
+  "application/vnd.omads-email+xml": {
+    "source": "iana"
+  },
+  "application/vnd.omads-file+xml": {
+    "source": "iana"
+  },
+  "application/vnd.omads-folder+xml": {
+    "source": "iana"
+  },
+  "application/vnd.omaloc-supl-init": {
+    "source": "iana"
+  },
+  "application/vnd.onepager": {
+    "source": "iana"
+  },
+  "application/vnd.onepagertamp": {
+    "source": "iana"
+  },
+  "application/vnd.onepagertamx": {
+    "source": "iana"
+  },
+  "application/vnd.onepagertat": {
+    "source": "iana"
+  },
+  "application/vnd.onepagertatp": {
+    "source": "iana"
+  },
+  "application/vnd.onepagertatx": {
+    "source": "iana"
+  },
+  "application/vnd.openblox.game+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openblox.game-binary": {
+    "source": "iana"
+  },
+  "application/vnd.openeye.oeb": {
+    "source": "iana"
+  },
+  "application/vnd.openofficeorg.extension": {
+    "source": "apache",
+    "extensions": ["oxt"]
+  },
+  "application/vnd.openstreetmap.data+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.custom-properties+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.drawing+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.extended-properties+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.presentationml-template": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.presentationml.presentation": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["pptx"]
+  },
+  "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.presentationml.slide": {
+    "source": "iana",
+    "extensions": ["sldx"]
+  },
+  "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.presentationml.slideshow": {
+    "source": "iana",
+    "extensions": ["ppsx"]
+  },
+  "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.presentationml.template": {
+    "source": "apache",
+    "extensions": ["potx"]
+  },
+  "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.spreadsheetml-template": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["xlsx"]
+  },
+  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.spreadsheetml.template": {
+    "source": "apache",
+    "extensions": ["xltx"]
+  },
+  "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.theme+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.themeoverride+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.vmldrawing": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.wordprocessingml-template": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.wordprocessingml.document": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["docx"]
+  },
+  "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.wordprocessingml.template": {
+    "source": "apache",
+    "extensions": ["dotx"]
+  },
+  "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-package.core-properties+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": {
+    "source": "iana"
+  },
+  "application/vnd.openxmlformats-package.relationships+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oracle.resource+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.orange.indata": {
+    "source": "iana"
+  },
+  "application/vnd.osa.netdeploy": {
+    "source": "iana"
+  },
+  "application/vnd.osgeo.mapguide.package": {
+    "source": "iana",
+    "extensions": ["mgp"]
+  },
+  "application/vnd.osgi.bundle": {
+    "source": "iana"
+  },
+  "application/vnd.osgi.dp": {
+    "source": "iana",
+    "extensions": ["dp"]
+  },
+  "application/vnd.osgi.subsystem": {
+    "source": "iana",
+    "extensions": ["esa"]
+  },
+  "application/vnd.otps.ct-kip+xml": {
+    "source": "iana"
+  },
+  "application/vnd.oxli.countgraph": {
+    "source": "iana"
+  },
+  "application/vnd.pagerduty+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.palm": {
+    "source": "iana",
+    "extensions": ["pdb","pqa","oprc"]
+  },
+  "application/vnd.panoply": {
+    "source": "iana"
+  },
+  "application/vnd.paos+xml": {
+    "source": "iana"
+  },
+  "application/vnd.paos.xml": {
+    "source": "apache"
+  },
+  "application/vnd.pawaafile": {
+    "source": "iana",
+    "extensions": ["paw"]
+  },
+  "application/vnd.pcos": {
+    "source": "iana"
+  },
+  "application/vnd.pg.format": {
+    "source": "iana",
+    "extensions": ["str"]
+  },
+  "application/vnd.pg.osasli": {
+    "source": "iana",
+    "extensions": ["ei6"]
+  },
+  "application/vnd.piaccess.application-licence": {
+    "source": "iana"
+  },
+  "application/vnd.picsel": {
+    "source": "iana",
+    "extensions": ["efif"]
+  },
+  "application/vnd.pmi.widget": {
+    "source": "iana",
+    "extensions": ["wg"]
+  },
+  "application/vnd.poc.group-advertisement+xml": {
+    "source": "iana"
+  },
+  "application/vnd.pocketlearn": {
+    "source": "iana",
+    "extensions": ["plf"]
+  },
+  "application/vnd.powerbuilder6": {
+    "source": "iana",
+    "extensions": ["pbd"]
+  },
+  "application/vnd.powerbuilder6-s": {
+    "source": "iana"
+  },
+  "application/vnd.powerbuilder7": {
+    "source": "iana"
+  },
+  "application/vnd.powerbuilder7-s": {
+    "source": "iana"
+  },
+  "application/vnd.powerbuilder75": {
+    "source": "iana"
+  },
+  "application/vnd.powerbuilder75-s": {
+    "source": "iana"
+  },
+  "application/vnd.preminet": {
+    "source": "iana"
+  },
+  "application/vnd.previewsystems.box": {
+    "source": "iana",
+    "extensions": ["box"]
+  },
+  "application/vnd.proteus.magazine": {
+    "source": "iana",
+    "extensions": ["mgz"]
+  },
+  "application/vnd.publishare-delta-tree": {
+    "source": "iana",
+    "extensions": ["qps"]
+  },
+  "application/vnd.pvi.ptid1": {
+    "source": "iana",
+    "extensions": ["ptid"]
+  },
+  "application/vnd.pwg-multiplexed": {
+    "source": "iana"
+  },
+  "application/vnd.pwg-xhtml-print+xml": {
+    "source": "iana"
+  },
+  "application/vnd.qualcomm.brew-app-res": {
+    "source": "iana"
+  },
+  "application/vnd.quarantainenet": {
+    "source": "iana"
+  },
+  "application/vnd.quark.quarkxpress": {
+    "source": "iana",
+    "extensions": ["qxd","qxt","qwd","qwt","qxl","qxb"]
+  },
+  "application/vnd.quobject-quoxdocument": {
+    "source": "iana"
+  },
+  "application/vnd.radisys.moml+xml": {
+    "source": "iana"
+  },
+  "application/vnd.radisys.msml+xml": {
+    "source": "iana"
+  },
+  "application/vnd.radisys.msml-audit+xml": {
+    "source": "iana"
+  },
+  "application/vnd.radisys.msml-audit-conf+xml": {
+    "source": "iana"
+  },
+  "application/vnd.radisys.msml-audit-conn+xml": {
+    "source": "iana"
+  },
+  "application/vnd.radisys.msml-audit-dialog+xml": {
+    "source": "iana"
+  },
+  "application/vnd.radisys.msml-audit-stream+xml": {
+    "source": "iana"
+  },
+  "application/vnd.radisys.msml-conf+xml": {
+    "source": "iana"
+  },
+  "application/vnd.radisys.msml-dialog+xml": {
+    "source": "iana"
+  },
+  "application/vnd.radisys.msml-dialog-base+xml": {
+    "source": "iana"
+  },
+  "application/vnd.radisys.msml-dialog-fax-detect+xml": {
+    "source": "iana"
+  },
+  "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": {
+    "source": "iana"
+  },
+  "application/vnd.radisys.msml-dialog-group+xml": {
+    "source": "iana"
+  },
+  "application/vnd.radisys.msml-dialog-speech+xml": {
+    "source": "iana"
+  },
+  "application/vnd.radisys.msml-dialog-transform+xml": {
+    "source": "iana"
+  },
+  "application/vnd.rainstor.data": {
+    "source": "iana"
+  },
+  "application/vnd.rapid": {
+    "source": "iana"
+  },
+  "application/vnd.rar": {
+    "source": "iana"
+  },
+  "application/vnd.realvnc.bed": {
+    "source": "iana",
+    "extensions": ["bed"]
+  },
+  "application/vnd.recordare.musicxml": {
+    "source": "iana",
+    "extensions": ["mxl"]
+  },
+  "application/vnd.recordare.musicxml+xml": {
+    "source": "iana",
+    "extensions": ["musicxml"]
+  },
+  "application/vnd.renlearn.rlprint": {
+    "source": "iana"
+  },
+  "application/vnd.rig.cryptonote": {
+    "source": "iana",
+    "extensions": ["cryptonote"]
+  },
+  "application/vnd.rim.cod": {
+    "source": "apache",
+    "extensions": ["cod"]
+  },
+  "application/vnd.rn-realmedia": {
+    "source": "apache",
+    "extensions": ["rm"]
+  },
+  "application/vnd.rn-realmedia-vbr": {
+    "source": "apache",
+    "extensions": ["rmvb"]
+  },
+  "application/vnd.route66.link66+xml": {
+    "source": "iana",
+    "extensions": ["link66"]
+  },
+  "application/vnd.rs-274x": {
+    "source": "iana"
+  },
+  "application/vnd.ruckus.download": {
+    "source": "iana"
+  },
+  "application/vnd.s3sms": {
+    "source": "iana"
+  },
+  "application/vnd.sailingtracker.track": {
+    "source": "iana",
+    "extensions": ["st"]
+  },
+  "application/vnd.sbm.cid": {
+    "source": "iana"
+  },
+  "application/vnd.sbm.mid2": {
+    "source": "iana"
+  },
+  "application/vnd.scribus": {
+    "source": "iana"
+  },
+  "application/vnd.sealed.3df": {
+    "source": "iana"
+  },
+  "application/vnd.sealed.csf": {
+    "source": "iana"
+  },
+  "application/vnd.sealed.doc": {
+    "source": "iana"
+  },
+  "application/vnd.sealed.eml": {
+    "source": "iana"
+  },
+  "application/vnd.sealed.mht": {
+    "source": "iana"
+  },
+  "application/vnd.sealed.net": {
+    "source": "iana"
+  },
+  "application/vnd.sealed.ppt": {
+    "source": "iana"
+  },
+  "application/vnd.sealed.tiff": {
+    "source": "iana"
+  },
+  "application/vnd.sealed.xls": {
+    "source": "iana"
+  },
+  "application/vnd.sealedmedia.softseal.html": {
+    "source": "iana"
+  },
+  "application/vnd.sealedmedia.softseal.pdf": {
+    "source": "iana"
+  },
+  "application/vnd.seemail": {
+    "source": "iana",
+    "extensions": ["see"]
+  },
+  "application/vnd.sema": {
+    "source": "iana",
+    "extensions": ["sema"]
+  },
+  "application/vnd.semd": {
+    "source": "iana",
+    "extensions": ["semd"]
+  },
+  "application/vnd.semf": {
+    "source": "iana",
+    "extensions": ["semf"]
+  },
+  "application/vnd.shana.informed.formdata": {
+    "source": "iana",
+    "extensions": ["ifm"]
+  },
+  "application/vnd.shana.informed.formtemplate": {
+    "source": "iana",
+    "extensions": ["itp"]
+  },
+  "application/vnd.shana.informed.interchange": {
+    "source": "iana",
+    "extensions": ["iif"]
+  },
+  "application/vnd.shana.informed.package": {
+    "source": "iana",
+    "extensions": ["ipk"]
+  },
+  "application/vnd.sigrok.session": {
+    "source": "iana"
+  },
+  "application/vnd.simtech-mindmapper": {
+    "source": "iana",
+    "extensions": ["twd","twds"]
+  },
+  "application/vnd.siren+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.smaf": {
+    "source": "iana",
+    "extensions": ["mmf"]
+  },
+  "application/vnd.smart.notebook": {
+    "source": "iana"
+  },
+  "application/vnd.smart.teacher": {
+    "source": "iana",
+    "extensions": ["teacher"]
+  },
+  "application/vnd.software602.filler.form+xml": {
+    "source": "iana"
+  },
+  "application/vnd.software602.filler.form-xml-zip": {
+    "source": "iana"
+  },
+  "application/vnd.solent.sdkm+xml": {
+    "source": "iana",
+    "extensions": ["sdkm","sdkd"]
+  },
+  "application/vnd.spotfire.dxp": {
+    "source": "iana",
+    "extensions": ["dxp"]
+  },
+  "application/vnd.spotfire.sfs": {
+    "source": "iana",
+    "extensions": ["sfs"]
+  },
+  "application/vnd.sss-cod": {
+    "source": "iana"
+  },
+  "application/vnd.sss-dtf": {
+    "source": "iana"
+  },
+  "application/vnd.sss-ntf": {
+    "source": "iana"
+  },
+  "application/vnd.stardivision.calc": {
+    "source": "apache",
+    "extensions": ["sdc"]
+  },
+  "application/vnd.stardivision.draw": {
+    "source": "apache",
+    "extensions": ["sda"]
+  },
+  "application/vnd.stardivision.impress": {
+    "source": "apache",
+    "extensions": ["sdd"]
+  },
+  "application/vnd.stardivision.math": {
+    "source": "apache",
+    "extensions": ["smf"]
+  },
+  "application/vnd.stardivision.writer": {
+    "source": "apache",
+    "extensions": ["sdw","vor"]
+  },
+  "application/vnd.stardivision.writer-global": {
+    "source": "apache",
+    "extensions": ["sgl"]
+  },
+  "application/vnd.stepmania.package": {
+    "source": "iana",
+    "extensions": ["smzip"]
+  },
+  "application/vnd.stepmania.stepchart": {
+    "source": "iana",
+    "extensions": ["sm"]
+  },
+  "application/vnd.street-stream": {
+    "source": "iana"
+  },
+  "application/vnd.sun.wadl+xml": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["wadl"]
+  },
+  "application/vnd.sun.xml.calc": {
+    "source": "apache",
+    "extensions": ["sxc"]
+  },
+  "application/vnd.sun.xml.calc.template": {
+    "source": "apache",
+    "extensions": ["stc"]
+  },
+  "application/vnd.sun.xml.draw": {
+    "source": "apache",
+    "extensions": ["sxd"]
+  },
+  "application/vnd.sun.xml.draw.template": {
+    "source": "apache",
+    "extensions": ["std"]
+  },
+  "application/vnd.sun.xml.impress": {
+    "source": "apache",
+    "extensions": ["sxi"]
+  },
+  "application/vnd.sun.xml.impress.template": {
+    "source": "apache",
+    "extensions": ["sti"]
+  },
+  "application/vnd.sun.xml.math": {
+    "source": "apache",
+    "extensions": ["sxm"]
+  },
+  "application/vnd.sun.xml.writer": {
+    "source": "apache",
+    "extensions": ["sxw"]
+  },
+  "application/vnd.sun.xml.writer.global": {
+    "source": "apache",
+    "extensions": ["sxg"]
+  },
+  "application/vnd.sun.xml.writer.template": {
+    "source": "apache",
+    "extensions": ["stw"]
+  },
+  "application/vnd.sus-calendar": {
+    "source": "iana",
+    "extensions": ["sus","susp"]
+  },
+  "application/vnd.svd": {
+    "source": "iana",
+    "extensions": ["svd"]
+  },
+  "application/vnd.swiftview-ics": {
+    "source": "iana"
+  },
+  "application/vnd.symbian.install": {
+    "source": "apache",
+    "extensions": ["sis","sisx"]
+  },
+  "application/vnd.syncml+xml": {
+    "source": "iana",
+    "extensions": ["xsm"]
+  },
+  "application/vnd.syncml.dm+wbxml": {
+    "source": "iana",
+    "extensions": ["bdm"]
+  },
+  "application/vnd.syncml.dm+xml": {
+    "source": "iana",
+    "extensions": ["xdm"]
+  },
+  "application/vnd.syncml.dm.notification": {
+    "source": "iana"
+  },
+  "application/vnd.syncml.dmddf+wbxml": {
+    "source": "iana"
+  },
+  "application/vnd.syncml.dmddf+xml": {
+    "source": "iana"
+  },
+  "application/vnd.syncml.dmtnds+wbxml": {
+    "source": "iana"
+  },
+  "application/vnd.syncml.dmtnds+xml": {
+    "source": "iana"
+  },
+  "application/vnd.syncml.ds.notification": {
+    "source": "iana"
+  },
+  "application/vnd.tableschema+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.tao.intent-module-archive": {
+    "source": "iana",
+    "extensions": ["tao"]
+  },
+  "application/vnd.tcpdump.pcap": {
+    "source": "iana",
+    "extensions": ["pcap","cap","dmp"]
+  },
+  "application/vnd.tmd.mediaflex.api+xml": {
+    "source": "iana"
+  },
+  "application/vnd.tml": {
+    "source": "iana"
+  },
+  "application/vnd.tmobile-livetv": {
+    "source": "iana",
+    "extensions": ["tmo"]
+  },
+  "application/vnd.tri.onesource": {
+    "source": "iana"
+  },
+  "application/vnd.trid.tpt": {
+    "source": "iana",
+    "extensions": ["tpt"]
+  },
+  "application/vnd.triscape.mxs": {
+    "source": "iana",
+    "extensions": ["mxs"]
+  },
+  "application/vnd.trueapp": {
+    "source": "iana",
+    "extensions": ["tra"]
+  },
+  "application/vnd.truedoc": {
+    "source": "iana"
+  },
+  "application/vnd.ubisoft.webplayer": {
+    "source": "iana"
+  },
+  "application/vnd.ufdl": {
+    "source": "iana",
+    "extensions": ["ufd","ufdl"]
+  },
+  "application/vnd.uiq.theme": {
+    "source": "iana",
+    "extensions": ["utz"]
+  },
+  "application/vnd.umajin": {
+    "source": "iana",
+    "extensions": ["umj"]
+  },
+  "application/vnd.unity": {
+    "source": "iana",
+    "extensions": ["unityweb"]
+  },
+  "application/vnd.uoml+xml": {
+    "source": "iana",
+    "extensions": ["uoml"]
+  },
+  "application/vnd.uplanet.alert": {
+    "source": "iana"
+  },
+  "application/vnd.uplanet.alert-wbxml": {
+    "source": "iana"
+  },
+  "application/vnd.uplanet.bearer-choice": {
+    "source": "iana"
+  },
+  "application/vnd.uplanet.bearer-choice-wbxml": {
+    "source": "iana"
+  },
+  "application/vnd.uplanet.cacheop": {
+    "source": "iana"
+  },
+  "application/vnd.uplanet.cacheop-wbxml": {
+    "source": "iana"
+  },
+  "application/vnd.uplanet.channel": {
+    "source": "iana"
+  },
+  "application/vnd.uplanet.channel-wbxml": {
+    "source": "iana"
+  },
+  "application/vnd.uplanet.list": {
+    "source": "iana"
+  },
+  "application/vnd.uplanet.list-wbxml": {
+    "source": "iana"
+  },
+  "application/vnd.uplanet.listcmd": {
+    "source": "iana"
+  },
+  "application/vnd.uplanet.listcmd-wbxml": {
+    "source": "iana"
+  },
+  "application/vnd.uplanet.signal": {
+    "source": "iana"
+  },
+  "application/vnd.uri-map": {
+    "source": "iana"
+  },
+  "application/vnd.valve.source.material": {
+    "source": "iana"
+  },
+  "application/vnd.vcx": {
+    "source": "iana",
+    "extensions": ["vcx"]
+  },
+  "application/vnd.vd-study": {
+    "source": "iana"
+  },
+  "application/vnd.vectorworks": {
+    "source": "iana"
+  },
+  "application/vnd.vel+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.verimatrix.vcas": {
+    "source": "iana"
+  },
+  "application/vnd.vidsoft.vidconference": {
+    "source": "iana"
+  },
+  "application/vnd.visio": {
+    "source": "iana",
+    "extensions": ["vsd","vst","vss","vsw"]
+  },
+  "application/vnd.visionary": {
+    "source": "iana",
+    "extensions": ["vis"]
+  },
+  "application/vnd.vividence.scriptfile": {
+    "source": "iana"
+  },
+  "application/vnd.vsf": {
+    "source": "iana",
+    "extensions": ["vsf"]
+  },
+  "application/vnd.wap.sic": {
+    "source": "iana"
+  },
+  "application/vnd.wap.slc": {
+    "source": "iana"
+  },
+  "application/vnd.wap.wbxml": {
+    "source": "iana",
+    "extensions": ["wbxml"]
+  },
+  "application/vnd.wap.wmlc": {
+    "source": "iana",
+    "extensions": ["wmlc"]
+  },
+  "application/vnd.wap.wmlscriptc": {
+    "source": "iana",
+    "extensions": ["wmlsc"]
+  },
+  "application/vnd.webturbo": {
+    "source": "iana",
+    "extensions": ["wtb"]
+  },
+  "application/vnd.wfa.p2p": {
+    "source": "iana"
+  },
+  "application/vnd.wfa.wsc": {
+    "source": "iana"
+  },
+  "application/vnd.windows.devicepairing": {
+    "source": "iana"
+  },
+  "application/vnd.wmc": {
+    "source": "iana"
+  },
+  "application/vnd.wmf.bootstrap": {
+    "source": "iana"
+  },
+  "application/vnd.wolfram.mathematica": {
+    "source": "iana"
+  },
+  "application/vnd.wolfram.mathematica.package": {
+    "source": "iana"
+  },
+  "application/vnd.wolfram.player": {
+    "source": "iana",
+    "extensions": ["nbp"]
+  },
+  "application/vnd.wordperfect": {
+    "source": "iana",
+    "extensions": ["wpd"]
+  },
+  "application/vnd.wqd": {
+    "source": "iana",
+    "extensions": ["wqd"]
+  },
+  "application/vnd.wrq-hp3000-labelled": {
+    "source": "iana"
+  },
+  "application/vnd.wt.stf": {
+    "source": "iana",
+    "extensions": ["stf"]
+  },
+  "application/vnd.wv.csp+wbxml": {
+    "source": "iana"
+  },
+  "application/vnd.wv.csp+xml": {
+    "source": "iana"
+  },
+  "application/vnd.wv.ssp+xml": {
+    "source": "iana"
+  },
+  "application/vnd.xacml+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/vnd.xara": {
+    "source": "iana",
+    "extensions": ["xar"]
+  },
+  "application/vnd.xfdl": {
+    "source": "iana",
+    "extensions": ["xfdl"]
+  },
+  "application/vnd.xfdl.webform": {
+    "source": "iana"
+  },
+  "application/vnd.xmi+xml": {
+    "source": "iana"
+  },
+  "application/vnd.xmpie.cpkg": {
+    "source": "iana"
+  },
+  "application/vnd.xmpie.dpkg": {
+    "source": "iana"
+  },
+  "application/vnd.xmpie.plan": {
+    "source": "iana"
+  },
+  "application/vnd.xmpie.ppkg": {
+    "source": "iana"
+  },
+  "application/vnd.xmpie.xlim": {
+    "source": "iana"
+  },
+  "application/vnd.yamaha.hv-dic": {
+    "source": "iana",
+    "extensions": ["hvd"]
+  },
+  "application/vnd.yamaha.hv-script": {
+    "source": "iana",
+    "extensions": ["hvs"]
+  },
+  "application/vnd.yamaha.hv-voice": {
+    "source": "iana",
+    "extensions": ["hvp"]
+  },
+  "application/vnd.yamaha.openscoreformat": {
+    "source": "iana",
+    "extensions": ["osf"]
+  },
+  "application/vnd.yamaha.openscoreformat.osfpvg+xml": {
+    "source": "iana",
+    "extensions": ["osfpvg"]
+  },
+  "application/vnd.yamaha.remote-setup": {
+    "source": "iana"
+  },
+  "application/vnd.yamaha.smaf-audio": {
+    "source": "iana",
+    "extensions": ["saf"]
+  },
+  "application/vnd.yamaha.smaf-phrase": {
+    "source": "iana",
+    "extensions": ["spf"]
+  },
+  "application/vnd.yamaha.through-ngn": {
+    "source": "iana"
+  },
+  "application/vnd.yamaha.tunnel-udpencap": {
+    "source": "iana"
+  },
+  "application/vnd.yaoweme": {
+    "source": "iana"
+  },
+  "application/vnd.yellowriver-custom-menu": {
+    "source": "iana",
+    "extensions": ["cmp"]
+  },
+  "application/vnd.zul": {
+    "source": "iana",
+    "extensions": ["zir","zirz"]
+  },
+  "application/vnd.zzazz.deck+xml": {
+    "source": "iana",
+    "extensions": ["zaz"]
+  },
+  "application/voicexml+xml": {
+    "source": "iana",
+    "extensions": ["vxml"]
+  },
+  "application/vq-rtcpxr": {
+    "source": "iana"
+  },
+  "application/watcherinfo+xml": {
+    "source": "iana"
+  },
+  "application/whoispp-query": {
+    "source": "iana"
+  },
+  "application/whoispp-response": {
+    "source": "iana"
+  },
+  "application/widget": {
+    "source": "iana",
+    "extensions": ["wgt"]
+  },
+  "application/winhlp": {
+    "source": "apache",
+    "extensions": ["hlp"]
+  },
+  "application/wita": {
+    "source": "iana"
+  },
+  "application/wordperfect5.1": {
+    "source": "iana"
+  },
+  "application/wsdl+xml": {
+    "source": "iana",
+    "extensions": ["wsdl"]
+  },
+  "application/wspolicy+xml": {
+    "source": "iana",
+    "extensions": ["wspolicy"]
+  },
+  "application/x-7z-compressed": {
+    "source": "apache",
+    "compressible": false,
+    "extensions": ["7z"]
+  },
+  "application/x-abiword": {
+    "source": "apache",
+    "extensions": ["abw"]
+  },
+  "application/x-ace-compressed": {
+    "source": "apache",
+    "extensions": ["ace"]
+  },
+  "application/x-amf": {
+    "source": "apache"
+  },
+  "application/x-apple-diskimage": {
+    "source": "apache",
+    "extensions": ["dmg"]
+  },
+  "application/x-arj": {
+    "compressible": false,
+    "extensions": ["arj"]
+  },
+  "application/x-authorware-bin": {
+    "source": "apache",
+    "extensions": ["aab","x32","u32","vox"]
+  },
+  "application/x-authorware-map": {
+    "source": "apache",
+    "extensions": ["aam"]
+  },
+  "application/x-authorware-seg": {
+    "source": "apache",
+    "extensions": ["aas"]
+  },
+  "application/x-bcpio": {
+    "source": "apache",
+    "extensions": ["bcpio"]
+  },
+  "application/x-bdoc": {
+    "compressible": false,
+    "extensions": ["bdoc"]
+  },
+  "application/x-bittorrent": {
+    "source": "apache",
+    "extensions": ["torrent"]
+  },
+  "application/x-blorb": {
+    "source": "apache",
+    "extensions": ["blb","blorb"]
+  },
+  "application/x-bzip": {
+    "source": "apache",
+    "compressible": false,
+    "extensions": ["bz"]
+  },
+  "application/x-bzip2": {
+    "source": "apache",
+    "compressible": false,
+    "extensions": ["bz2","boz"]
+  },
+  "application/x-cbr": {
+    "source": "apache",
+    "extensions": ["cbr","cba","cbt","cbz","cb7"]
+  },
+  "application/x-cdlink": {
+    "source": "apache",
+    "extensions": ["vcd"]
+  },
+  "application/x-cfs-compressed": {
+    "source": "apache",
+    "extensions": ["cfs"]
+  },
+  "application/x-chat": {
+    "source": "apache",
+    "extensions": ["chat"]
+  },
+  "application/x-chess-pgn": {
+    "source": "apache",
+    "extensions": ["pgn"]
+  },
+  "application/x-chrome-extension": {
+    "extensions": ["crx"]
+  },
+  "application/x-cocoa": {
+    "source": "nginx",
+    "extensions": ["cco"]
+  },
+  "application/x-compress": {
+    "source": "apache"
+  },
+  "application/x-conference": {
+    "source": "apache",
+    "extensions": ["nsc"]
+  },
+  "application/x-cpio": {
+    "source": "apache",
+    "extensions": ["cpio"]
+  },
+  "application/x-csh": {
+    "source": "apache",
+    "extensions": ["csh"]
+  },
+  "application/x-deb": {
+    "compressible": false
+  },
+  "application/x-debian-package": {
+    "source": "apache",
+    "extensions": ["deb","udeb"]
+  },
+  "application/x-dgc-compressed": {
+    "source": "apache",
+    "extensions": ["dgc"]
+  },
+  "application/x-director": {
+    "source": "apache",
+    "extensions": ["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]
+  },
+  "application/x-doom": {
+    "source": "apache",
+    "extensions": ["wad"]
+  },
+  "application/x-dtbncx+xml": {
+    "source": "apache",
+    "extensions": ["ncx"]
+  },
+  "application/x-dtbook+xml": {
+    "source": "apache",
+    "extensions": ["dtb"]
+  },
+  "application/x-dtbresource+xml": {
+    "source": "apache",
+    "extensions": ["res"]
+  },
+  "application/x-dvi": {
+    "source": "apache",
+    "compressible": false,
+    "extensions": ["dvi"]
+  },
+  "application/x-envoy": {
+    "source": "apache",
+    "extensions": ["evy"]
+  },
+  "application/x-eva": {
+    "source": "apache",
+    "extensions": ["eva"]
+  },
+  "application/x-font-bdf": {
+    "source": "apache",
+    "extensions": ["bdf"]
+  },
+  "application/x-font-dos": {
+    "source": "apache"
+  },
+  "application/x-font-framemaker": {
+    "source": "apache"
+  },
+  "application/x-font-ghostscript": {
+    "source": "apache",
+    "extensions": ["gsf"]
+  },
+  "application/x-font-libgrx": {
+    "source": "apache"
+  },
+  "application/x-font-linux-psf": {
+    "source": "apache",
+    "extensions": ["psf"]
+  },
+  "application/x-font-otf": {
+    "source": "apache",
+    "compressible": true,
+    "extensions": ["otf"]
+  },
+  "application/x-font-pcf": {
+    "source": "apache",
+    "extensions": ["pcf"]
+  },
+  "application/x-font-snf": {
+    "source": "apache",
+    "extensions": ["snf"]
+  },
+  "application/x-font-speedo": {
+    "source": "apache"
+  },
+  "application/x-font-sunos-news": {
+    "source": "apache"
+  },
+  "application/x-font-ttf": {
+    "source": "apache",
+    "compressible": true,
+    "extensions": ["ttf","ttc"]
+  },
+  "application/x-font-type1": {
+    "source": "apache",
+    "extensions": ["pfa","pfb","pfm","afm"]
+  },
+  "application/x-font-vfont": {
+    "source": "apache"
+  },
+  "application/x-freearc": {
+    "source": "apache",
+    "extensions": ["arc"]
+  },
+  "application/x-futuresplash": {
+    "source": "apache",
+    "extensions": ["spl"]
+  },
+  "application/x-gca-compressed": {
+    "source": "apache",
+    "extensions": ["gca"]
+  },
+  "application/x-glulx": {
+    "source": "apache",
+    "extensions": ["ulx"]
+  },
+  "application/x-gnumeric": {
+    "source": "apache",
+    "extensions": ["gnumeric"]
+  },
+  "application/x-gramps-xml": {
+    "source": "apache",
+    "extensions": ["gramps"]
+  },
+  "application/x-gtar": {
+    "source": "apache",
+    "extensions": ["gtar"]
+  },
+  "application/x-gzip": {
+    "source": "apache"
+  },
+  "application/x-hdf": {
+    "source": "apache",
+    "extensions": ["hdf"]
+  },
+  "application/x-httpd-php": {
+    "compressible": true,
+    "extensions": ["php"]
+  },
+  "application/x-install-instructions": {
+    "source": "apache",
+    "extensions": ["install"]
+  },
+  "application/x-iso9660-image": {
+    "source": "apache",
+    "extensions": ["iso"]
+  },
+  "application/x-java-archive-diff": {
+    "source": "nginx",
+    "extensions": ["jardiff"]
+  },
+  "application/x-java-jnlp-file": {
+    "source": "apache",
+    "compressible": false,
+    "extensions": ["jnlp"]
+  },
+  "application/x-javascript": {
+    "compressible": true
+  },
+  "application/x-latex": {
+    "source": "apache",
+    "compressible": false,
+    "extensions": ["latex"]
+  },
+  "application/x-lua-bytecode": {
+    "extensions": ["luac"]
+  },
+  "application/x-lzh-compressed": {
+    "source": "apache",
+    "extensions": ["lzh","lha"]
+  },
+  "application/x-makeself": {
+    "source": "nginx",
+    "extensions": ["run"]
+  },
+  "application/x-mie": {
+    "source": "apache",
+    "extensions": ["mie"]
+  },
+  "application/x-mobipocket-ebook": {
+    "source": "apache",
+    "extensions": ["prc","mobi"]
+  },
+  "application/x-mpegurl": {
+    "compressible": false
+  },
+  "application/x-ms-application": {
+    "source": "apache",
+    "extensions": ["application"]
+  },
+  "application/x-ms-shortcut": {
+    "source": "apache",
+    "extensions": ["lnk"]
+  },
+  "application/x-ms-wmd": {
+    "source": "apache",
+    "extensions": ["wmd"]
+  },
+  "application/x-ms-wmz": {
+    "source": "apache",
+    "extensions": ["wmz"]
+  },
+  "application/x-ms-xbap": {
+    "source": "apache",
+    "extensions": ["xbap"]
+  },
+  "application/x-msaccess": {
+    "source": "apache",
+    "extensions": ["mdb"]
+  },
+  "application/x-msbinder": {
+    "source": "apache",
+    "extensions": ["obd"]
+  },
+  "application/x-mscardfile": {
+    "source": "apache",
+    "extensions": ["crd"]
+  },
+  "application/x-msclip": {
+    "source": "apache",
+    "extensions": ["clp"]
+  },
+  "application/x-msdos-program": {
+    "extensions": ["exe"]
+  },
+  "application/x-msdownload": {
+    "source": "apache",
+    "extensions": ["exe","dll","com","bat","msi"]
+  },
+  "application/x-msmediaview": {
+    "source": "apache",
+    "extensions": ["mvb","m13","m14"]
+  },
+  "application/x-msmetafile": {
+    "source": "apache",
+    "extensions": ["wmf","wmz","emf","emz"]
+  },
+  "application/x-msmoney": {
+    "source": "apache",
+    "extensions": ["mny"]
+  },
+  "application/x-mspublisher": {
+    "source": "apache",
+    "extensions": ["pub"]
+  },
+  "application/x-msschedule": {
+    "source": "apache",
+    "extensions": ["scd"]
+  },
+  "application/x-msterminal": {
+    "source": "apache",
+    "extensions": ["trm"]
+  },
+  "application/x-mswrite": {
+    "source": "apache",
+    "extensions": ["wri"]
+  },
+  "application/x-netcdf": {
+    "source": "apache",
+    "extensions": ["nc","cdf"]
+  },
+  "application/x-ns-proxy-autoconfig": {
+    "compressible": true,
+    "extensions": ["pac"]
+  },
+  "application/x-nzb": {
+    "source": "apache",
+    "extensions": ["nzb"]
+  },
+  "application/x-perl": {
+    "source": "nginx",
+    "extensions": ["pl","pm"]
+  },
+  "application/x-pilot": {
+    "source": "nginx",
+    "extensions": ["prc","pdb"]
+  },
+  "application/x-pkcs12": {
+    "source": "apache",
+    "compressible": false,
+    "extensions": ["p12","pfx"]
+  },
+  "application/x-pkcs7-certificates": {
+    "source": "apache",
+    "extensions": ["p7b","spc"]
+  },
+  "application/x-pkcs7-certreqresp": {
+    "source": "apache",
+    "extensions": ["p7r"]
+  },
+  "application/x-rar-compressed": {
+    "source": "apache",
+    "compressible": false,
+    "extensions": ["rar"]
+  },
+  "application/x-redhat-package-manager": {
+    "source": "nginx",
+    "extensions": ["rpm"]
+  },
+  "application/x-research-info-systems": {
+    "source": "apache",
+    "extensions": ["ris"]
+  },
+  "application/x-sea": {
+    "source": "nginx",
+    "extensions": ["sea"]
+  },
+  "application/x-sh": {
+    "source": "apache",
+    "compressible": true,
+    "extensions": ["sh"]
+  },
+  "application/x-shar": {
+    "source": "apache",
+    "extensions": ["shar"]
+  },
+  "application/x-shockwave-flash": {
+    "source": "apache",
+    "compressible": false,
+    "extensions": ["swf"]
+  },
+  "application/x-silverlight-app": {
+    "source": "apache",
+    "extensions": ["xap"]
+  },
+  "application/x-sql": {
+    "source": "apache",
+    "extensions": ["sql"]
+  },
+  "application/x-stuffit": {
+    "source": "apache",
+    "compressible": false,
+    "extensions": ["sit"]
+  },
+  "application/x-stuffitx": {
+    "source": "apache",
+    "extensions": ["sitx"]
+  },
+  "application/x-subrip": {
+    "source": "apache",
+    "extensions": ["srt"]
+  },
+  "application/x-sv4cpio": {
+    "source": "apache",
+    "extensions": ["sv4cpio"]
+  },
+  "application/x-sv4crc": {
+    "source": "apache",
+    "extensions": ["sv4crc"]
+  },
+  "application/x-t3vm-image": {
+    "source": "apache",
+    "extensions": ["t3"]
+  },
+  "application/x-tads": {
+    "source": "apache",
+    "extensions": ["gam"]
+  },
+  "application/x-tar": {
+    "source": "apache",
+    "compressible": true,
+    "extensions": ["tar"]
+  },
+  "application/x-tcl": {
+    "source": "apache",
+    "extensions": ["tcl","tk"]
+  },
+  "application/x-tex": {
+    "source": "apache",
+    "extensions": ["tex"]
+  },
+  "application/x-tex-tfm": {
+    "source": "apache",
+    "extensions": ["tfm"]
+  },
+  "application/x-texinfo": {
+    "source": "apache",
+    "extensions": ["texinfo","texi"]
+  },
+  "application/x-tgif": {
+    "source": "apache",
+    "extensions": ["obj"]
+  },
+  "application/x-ustar": {
+    "source": "apache",
+    "extensions": ["ustar"]
+  },
+  "application/x-virtualbox-hdd": {
+    "compressible": true,
+    "extensions": ["hdd"]
+  },
+  "application/x-virtualbox-ova": {
+    "compressible": true,
+    "extensions": ["ova"]
+  },
+  "application/x-virtualbox-ovf": {
+    "compressible": true,
+    "extensions": ["ovf"]
+  },
+  "application/x-virtualbox-vbox": {
+    "compressible": true,
+    "extensions": ["vbox"]
+  },
+  "application/x-virtualbox-vbox-extpack": {
+    "compressible": false,
+    "extensions": ["vbox-extpack"]
+  },
+  "application/x-virtualbox-vdi": {
+    "compressible": true,
+    "extensions": ["vdi"]
+  },
+  "application/x-virtualbox-vhd": {
+    "compressible": true,
+    "extensions": ["vhd"]
+  },
+  "application/x-virtualbox-vmdk": {
+    "compressible": true,
+    "extensions": ["vmdk"]
+  },
+  "application/x-wais-source": {
+    "source": "apache",
+    "extensions": ["src"]
+  },
+  "application/x-web-app-manifest+json": {
+    "compressible": true,
+    "extensions": ["webapp"]
+  },
+  "application/x-www-form-urlencoded": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/x-x509-ca-cert": {
+    "source": "apache",
+    "extensions": ["der","crt","pem"]
+  },
+  "application/x-xfig": {
+    "source": "apache",
+    "extensions": ["fig"]
+  },
+  "application/x-xliff+xml": {
+    "source": "apache",
+    "extensions": ["xlf"]
+  },
+  "application/x-xpinstall": {
+    "source": "apache",
+    "compressible": false,
+    "extensions": ["xpi"]
+  },
+  "application/x-xz": {
+    "source": "apache",
+    "extensions": ["xz"]
+  },
+  "application/x-zmachine": {
+    "source": "apache",
+    "extensions": ["z1","z2","z3","z4","z5","z6","z7","z8"]
+  },
+  "application/x400-bp": {
+    "source": "iana"
+  },
+  "application/xacml+xml": {
+    "source": "iana"
+  },
+  "application/xaml+xml": {
+    "source": "apache",
+    "extensions": ["xaml"]
+  },
+  "application/xcap-att+xml": {
+    "source": "iana"
+  },
+  "application/xcap-caps+xml": {
+    "source": "iana"
+  },
+  "application/xcap-diff+xml": {
+    "source": "iana",
+    "extensions": ["xdf"]
+  },
+  "application/xcap-el+xml": {
+    "source": "iana"
+  },
+  "application/xcap-error+xml": {
+    "source": "iana"
+  },
+  "application/xcap-ns+xml": {
+    "source": "iana"
+  },
+  "application/xcon-conference-info+xml": {
+    "source": "iana"
+  },
+  "application/xcon-conference-info-diff+xml": {
+    "source": "iana"
+  },
+  "application/xenc+xml": {
+    "source": "iana",
+    "extensions": ["xenc"]
+  },
+  "application/xhtml+xml": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["xhtml","xht"]
+  },
+  "application/xhtml-voice+xml": {
+    "source": "apache"
+  },
+  "application/xml": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["xml","xsl","xsd","rng"]
+  },
+  "application/xml-dtd": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["dtd"]
+  },
+  "application/xml-external-parsed-entity": {
+    "source": "iana"
+  },
+  "application/xml-patch+xml": {
+    "source": "iana"
+  },
+  "application/xmpp+xml": {
+    "source": "iana"
+  },
+  "application/xop+xml": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["xop"]
+  },
+  "application/xproc+xml": {
+    "source": "apache",
+    "extensions": ["xpl"]
+  },
+  "application/xslt+xml": {
+    "source": "iana",
+    "extensions": ["xslt"]
+  },
+  "application/xspf+xml": {
+    "source": "apache",
+    "extensions": ["xspf"]
+  },
+  "application/xv+xml": {
+    "source": "iana",
+    "extensions": ["mxml","xhvml","xvml","xvm"]
+  },
+  "application/yang": {
+    "source": "iana",
+    "extensions": ["yang"]
+  },
+  "application/yang-data+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/yang-data+xml": {
+    "source": "iana"
+  },
+  "application/yang-patch+json": {
+    "source": "iana",
+    "compressible": true
+  },
+  "application/yang-patch+xml": {
+    "source": "iana"
+  },
+  "application/yin+xml": {
+    "source": "iana",
+    "extensions": ["yin"]
+  },
+  "application/zip": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["zip"]
+  },
+  "application/zlib": {
+    "source": "iana"
+  },
+  "audio/1d-interleaved-parityfec": {
+    "source": "iana"
+  },
+  "audio/32kadpcm": {
+    "source": "iana"
+  },
+  "audio/3gpp": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["3gpp"]
+  },
+  "audio/3gpp2": {
+    "source": "iana"
+  },
+  "audio/ac3": {
+    "source": "iana"
+  },
+  "audio/adpcm": {
+    "source": "apache",
+    "extensions": ["adp"]
+  },
+  "audio/amr": {
+    "source": "iana"
+  },
+  "audio/amr-wb": {
+    "source": "iana"
+  },
+  "audio/amr-wb+": {
+    "source": "iana"
+  },
+  "audio/aptx": {
+    "source": "iana"
+  },
+  "audio/asc": {
+    "source": "iana"
+  },
+  "audio/atrac-advanced-lossless": {
+    "source": "iana"
+  },
+  "audio/atrac-x": {
+    "source": "iana"
+  },
+  "audio/atrac3": {
+    "source": "iana"
+  },
+  "audio/basic": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["au","snd"]
+  },
+  "audio/bv16": {
+    "source": "iana"
+  },
+  "audio/bv32": {
+    "source": "iana"
+  },
+  "audio/clearmode": {
+    "source": "iana"
+  },
+  "audio/cn": {
+    "source": "iana"
+  },
+  "audio/dat12": {
+    "source": "iana"
+  },
+  "audio/dls": {
+    "source": "iana"
+  },
+  "audio/dsr-es201108": {
+    "source": "iana"
+  },
+  "audio/dsr-es202050": {
+    "source": "iana"
+  },
+  "audio/dsr-es202211": {
+    "source": "iana"
+  },
+  "audio/dsr-es202212": {
+    "source": "iana"
+  },
+  "audio/dv": {
+    "source": "iana"
+  },
+  "audio/dvi4": {
+    "source": "iana"
+  },
+  "audio/eac3": {
+    "source": "iana"
+  },
+  "audio/encaprtp": {
+    "source": "iana"
+  },
+  "audio/evrc": {
+    "source": "iana"
+  },
+  "audio/evrc-qcp": {
+    "source": "iana"
+  },
+  "audio/evrc0": {
+    "source": "iana"
+  },
+  "audio/evrc1": {
+    "source": "iana"
+  },
+  "audio/evrcb": {
+    "source": "iana"
+  },
+  "audio/evrcb0": {
+    "source": "iana"
+  },
+  "audio/evrcb1": {
+    "source": "iana"
+  },
+  "audio/evrcnw": {
+    "source": "iana"
+  },
+  "audio/evrcnw0": {
+    "source": "iana"
+  },
+  "audio/evrcnw1": {
+    "source": "iana"
+  },
+  "audio/evrcwb": {
+    "source": "iana"
+  },
+  "audio/evrcwb0": {
+    "source": "iana"
+  },
+  "audio/evrcwb1": {
+    "source": "iana"
+  },
+  "audio/evs": {
+    "source": "iana"
+  },
+  "audio/fwdred": {
+    "source": "iana"
+  },
+  "audio/g711-0": {
+    "source": "iana"
+  },
+  "audio/g719": {
+    "source": "iana"
+  },
+  "audio/g722": {
+    "source": "iana"
+  },
+  "audio/g7221": {
+    "source": "iana"
+  },
+  "audio/g723": {
+    "source": "iana"
+  },
+  "audio/g726-16": {
+    "source": "iana"
+  },
+  "audio/g726-24": {
+    "source": "iana"
+  },
+  "audio/g726-32": {
+    "source": "iana"
+  },
+  "audio/g726-40": {
+    "source": "iana"
+  },
+  "audio/g728": {
+    "source": "iana"
+  },
+  "audio/g729": {
+    "source": "iana"
+  },
+  "audio/g7291": {
+    "source": "iana"
+  },
+  "audio/g729d": {
+    "source": "iana"
+  },
+  "audio/g729e": {
+    "source": "iana"
+  },
+  "audio/gsm": {
+    "source": "iana"
+  },
+  "audio/gsm-efr": {
+    "source": "iana"
+  },
+  "audio/gsm-hr-08": {
+    "source": "iana"
+  },
+  "audio/ilbc": {
+    "source": "iana"
+  },
+  "audio/ip-mr_v2.5": {
+    "source": "iana"
+  },
+  "audio/isac": {
+    "source": "apache"
+  },
+  "audio/l16": {
+    "source": "iana"
+  },
+  "audio/l20": {
+    "source": "iana"
+  },
+  "audio/l24": {
+    "source": "iana",
+    "compressible": false
+  },
+  "audio/l8": {
+    "source": "iana"
+  },
+  "audio/lpc": {
+    "source": "iana"
+  },
+  "audio/melp": {
+    "source": "iana"
+  },
+  "audio/melp1200": {
+    "source": "iana"
+  },
+  "audio/melp2400": {
+    "source": "iana"
+  },
+  "audio/melp600": {
+    "source": "iana"
+  },
+  "audio/midi": {
+    "source": "apache",
+    "extensions": ["mid","midi","kar","rmi"]
+  },
+  "audio/mobile-xmf": {
+    "source": "iana"
+  },
+  "audio/mp3": {
+    "compressible": false,
+    "extensions": ["mp3"]
+  },
+  "audio/mp4": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["m4a","mp4a"]
+  },
+  "audio/mp4a-latm": {
+    "source": "iana"
+  },
+  "audio/mpa": {
+    "source": "iana"
+  },
+  "audio/mpa-robust": {
+    "source": "iana"
+  },
+  "audio/mpeg": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["mpga","mp2","mp2a","mp3","m2a","m3a"]
+  },
+  "audio/mpeg4-generic": {
+    "source": "iana"
+  },
+  "audio/musepack": {
+    "source": "apache"
+  },
+  "audio/ogg": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["oga","ogg","spx"]
+  },
+  "audio/opus": {
+    "source": "iana"
+  },
+  "audio/parityfec": {
+    "source": "iana"
+  },
+  "audio/pcma": {
+    "source": "iana"
+  },
+  "audio/pcma-wb": {
+    "source": "iana"
+  },
+  "audio/pcmu": {
+    "source": "iana"
+  },
+  "audio/pcmu-wb": {
+    "source": "iana"
+  },
+  "audio/prs.sid": {
+    "source": "iana"
+  },
+  "audio/qcelp": {
+    "source": "iana"
+  },
+  "audio/raptorfec": {
+    "source": "iana"
+  },
+  "audio/red": {
+    "source": "iana"
+  },
+  "audio/rtp-enc-aescm128": {
+    "source": "iana"
+  },
+  "audio/rtp-midi": {
+    "source": "iana"
+  },
+  "audio/rtploopback": {
+    "source": "iana"
+  },
+  "audio/rtx": {
+    "source": "iana"
+  },
+  "audio/s3m": {
+    "source": "apache",
+    "extensions": ["s3m"]
+  },
+  "audio/silk": {
+    "source": "apache",
+    "extensions": ["sil"]
+  },
+  "audio/smv": {
+    "source": "iana"
+  },
+  "audio/smv-qcp": {
+    "source": "iana"
+  },
+  "audio/smv0": {
+    "source": "iana"
+  },
+  "audio/sp-midi": {
+    "source": "iana"
+  },
+  "audio/speex": {
+    "source": "iana"
+  },
+  "audio/t140c": {
+    "source": "iana"
+  },
+  "audio/t38": {
+    "source": "iana"
+  },
+  "audio/telephone-event": {
+    "source": "iana"
+  },
+  "audio/tone": {
+    "source": "iana"
+  },
+  "audio/uemclip": {
+    "source": "iana"
+  },
+  "audio/ulpfec": {
+    "source": "iana"
+  },
+  "audio/vdvi": {
+    "source": "iana"
+  },
+  "audio/vmr-wb": {
+    "source": "iana"
+  },
+  "audio/vnd.3gpp.iufp": {
+    "source": "iana"
+  },
+  "audio/vnd.4sb": {
+    "source": "iana"
+  },
+  "audio/vnd.audiokoz": {
+    "source": "iana"
+  },
+  "audio/vnd.celp": {
+    "source": "iana"
+  },
+  "audio/vnd.cisco.nse": {
+    "source": "iana"
+  },
+  "audio/vnd.cmles.radio-events": {
+    "source": "iana"
+  },
+  "audio/vnd.cns.anp1": {
+    "source": "iana"
+  },
+  "audio/vnd.cns.inf1": {
+    "source": "iana"
+  },
+  "audio/vnd.dece.audio": {
+    "source": "iana",
+    "extensions": ["uva","uvva"]
+  },
+  "audio/vnd.digital-winds": {
+    "source": "iana",
+    "extensions": ["eol"]
+  },
+  "audio/vnd.dlna.adts": {
+    "source": "iana"
+  },
+  "audio/vnd.dolby.heaac.1": {
+    "source": "iana"
+  },
+  "audio/vnd.dolby.heaac.2": {
+    "source": "iana"
+  },
+  "audio/vnd.dolby.mlp": {
+    "source": "iana"
+  },
+  "audio/vnd.dolby.mps": {
+    "source": "iana"
+  },
+  "audio/vnd.dolby.pl2": {
+    "source": "iana"
+  },
+  "audio/vnd.dolby.pl2x": {
+    "source": "iana"
+  },
+  "audio/vnd.dolby.pl2z": {
+    "source": "iana"
+  },
+  "audio/vnd.dolby.pulse.1": {
+    "source": "iana"
+  },
+  "audio/vnd.dra": {
+    "source": "iana",
+    "extensions": ["dra"]
+  },
+  "audio/vnd.dts": {
+    "source": "iana",
+    "extensions": ["dts"]
+  },
+  "audio/vnd.dts.hd": {
+    "source": "iana",
+    "extensions": ["dtshd"]
+  },
+  "audio/vnd.dvb.file": {
+    "source": "iana"
+  },
+  "audio/vnd.everad.plj": {
+    "source": "iana"
+  },
+  "audio/vnd.hns.audio": {
+    "source": "iana"
+  },
+  "audio/vnd.lucent.voice": {
+    "source": "iana",
+    "extensions": ["lvp"]
+  },
+  "audio/vnd.ms-playready.media.pya": {
+    "source": "iana",
+    "extensions": ["pya"]
+  },
+  "audio/vnd.nokia.mobile-xmf": {
+    "source": "iana"
+  },
+  "audio/vnd.nortel.vbk": {
+    "source": "iana"
+  },
+  "audio/vnd.nuera.ecelp4800": {
+    "source": "iana",
+    "extensions": ["ecelp4800"]
+  },
+  "audio/vnd.nuera.ecelp7470": {
+    "source": "iana",
+    "extensions": ["ecelp7470"]
+  },
+  "audio/vnd.nuera.ecelp9600": {
+    "source": "iana",
+    "extensions": ["ecelp9600"]
+  },
+  "audio/vnd.octel.sbc": {
+    "source": "iana"
+  },
+  "audio/vnd.presonus.multitrack": {
+    "source": "iana"
+  },
+  "audio/vnd.qcelp": {
+    "source": "iana"
+  },
+  "audio/vnd.rhetorex.32kadpcm": {
+    "source": "iana"
+  },
+  "audio/vnd.rip": {
+    "source": "iana",
+    "extensions": ["rip"]
+  },
+  "audio/vnd.rn-realaudio": {
+    "compressible": false
+  },
+  "audio/vnd.sealedmedia.softseal.mpeg": {
+    "source": "iana"
+  },
+  "audio/vnd.vmx.cvsd": {
+    "source": "iana"
+  },
+  "audio/vnd.wave": {
+    "compressible": false
+  },
+  "audio/vorbis": {
+    "source": "iana",
+    "compressible": false
+  },
+  "audio/vorbis-config": {
+    "source": "iana"
+  },
+  "audio/wav": {
+    "compressible": false,
+    "extensions": ["wav"]
+  },
+  "audio/wave": {
+    "compressible": false,
+    "extensions": ["wav"]
+  },
+  "audio/webm": {
+    "source": "apache",
+    "compressible": false,
+    "extensions": ["weba"]
+  },
+  "audio/x-aac": {
+    "source": "apache",
+    "compressible": false,
+    "extensions": ["aac"]
+  },
+  "audio/x-aiff": {
+    "source": "apache",
+    "extensions": ["aif","aiff","aifc"]
+  },
+  "audio/x-caf": {
+    "source": "apache",
+    "compressible": false,
+    "extensions": ["caf"]
+  },
+  "audio/x-flac": {
+    "source": "apache",
+    "extensions": ["flac"]
+  },
+  "audio/x-m4a": {
+    "source": "nginx",
+    "extensions": ["m4a"]
+  },
+  "audio/x-matroska": {
+    "source": "apache",
+    "extensions": ["mka"]
+  },
+  "audio/x-mpegurl": {
+    "source": "apache",
+    "extensions": ["m3u"]
+  },
+  "audio/x-ms-wax": {
+    "source": "apache",
+    "extensions": ["wax"]
+  },
+  "audio/x-ms-wma": {
+    "source": "apache",
+    "extensions": ["wma"]
+  },
+  "audio/x-pn-realaudio": {
+    "source": "apache",
+    "extensions": ["ram","ra"]
+  },
+  "audio/x-pn-realaudio-plugin": {
+    "source": "apache",
+    "extensions": ["rmp"]
+  },
+  "audio/x-realaudio": {
+    "source": "nginx",
+    "extensions": ["ra"]
+  },
+  "audio/x-tta": {
+    "source": "apache"
+  },
+  "audio/x-wav": {
+    "source": "apache",
+    "extensions": ["wav"]
+  },
+  "audio/xm": {
+    "source": "apache",
+    "extensions": ["xm"]
+  },
+  "chemical/x-cdx": {
+    "source": "apache",
+    "extensions": ["cdx"]
+  },
+  "chemical/x-cif": {
+    "source": "apache",
+    "extensions": ["cif"]
+  },
+  "chemical/x-cmdf": {
+    "source": "apache",
+    "extensions": ["cmdf"]
+  },
+  "chemical/x-cml": {
+    "source": "apache",
+    "extensions": ["cml"]
+  },
+  "chemical/x-csml": {
+    "source": "apache",
+    "extensions": ["csml"]
+  },
+  "chemical/x-pdb": {
+    "source": "apache"
+  },
+  "chemical/x-xyz": {
+    "source": "apache",
+    "extensions": ["xyz"]
+  },
+  "font/otf": {
+    "compressible": true,
+    "extensions": ["otf"]
+  },
+  "image/apng": {
+    "compressible": false,
+    "extensions": ["apng"]
+  },
+  "image/bmp": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["bmp"]
+  },
+  "image/cgm": {
+    "source": "iana",
+    "extensions": ["cgm"]
+  },
+  "image/dicom-rle": {
+    "source": "iana"
+  },
+  "image/emf": {
+    "source": "iana"
+  },
+  "image/fits": {
+    "source": "iana"
+  },
+  "image/g3fax": {
+    "source": "iana",
+    "extensions": ["g3"]
+  },
+  "image/gif": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["gif"]
+  },
+  "image/ief": {
+    "source": "iana",
+    "extensions": ["ief"]
+  },
+  "image/jls": {
+    "source": "iana"
+  },
+  "image/jp2": {
+    "source": "iana"
+  },
+  "image/jpeg": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["jpeg","jpg","jpe"]
+  },
+  "image/jpm": {
+    "source": "iana"
+  },
+  "image/jpx": {
+    "source": "iana"
+  },
+  "image/ktx": {
+    "source": "iana",
+    "extensions": ["ktx"]
+  },
+  "image/naplps": {
+    "source": "iana"
+  },
+  "image/pjpeg": {
+    "compressible": false
+  },
+  "image/png": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["png"]
+  },
+  "image/prs.btif": {
+    "source": "iana",
+    "extensions": ["btif"]
+  },
+  "image/prs.pti": {
+    "source": "iana"
+  },
+  "image/pwg-raster": {
+    "source": "iana"
+  },
+  "image/sgi": {
+    "source": "apache",
+    "extensions": ["sgi"]
+  },
+  "image/svg+xml": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["svg","svgz"]
+  },
+  "image/t38": {
+    "source": "iana"
+  },
+  "image/tiff": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["tiff","tif"]
+  },
+  "image/tiff-fx": {
+    "source": "iana"
+  },
+  "image/vnd.adobe.photoshop": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["psd"]
+  },
+  "image/vnd.airzip.accelerator.azv": {
+    "source": "iana"
+  },
+  "image/vnd.cns.inf2": {
+    "source": "iana"
+  },
+  "image/vnd.dece.graphic": {
+    "source": "iana",
+    "extensions": ["uvi","uvvi","uvg","uvvg"]
+  },
+  "image/vnd.djvu": {
+    "source": "iana",
+    "extensions": ["djvu","djv"]
+  },
+  "image/vnd.dvb.subtitle": {
+    "source": "iana",
+    "extensions": ["sub"]
+  },
+  "image/vnd.dwg": {
+    "source": "iana",
+    "extensions": ["dwg"]
+  },
+  "image/vnd.dxf": {
+    "source": "iana",
+    "extensions": ["dxf"]
+  },
+  "image/vnd.fastbidsheet": {
+    "source": "iana",
+    "extensions": ["fbs"]
+  },
+  "image/vnd.fpx": {
+    "source": "iana",
+    "extensions": ["fpx"]
+  },
+  "image/vnd.fst": {
+    "source": "iana",
+    "extensions": ["fst"]
+  },
+  "image/vnd.fujixerox.edmics-mmr": {
+    "source": "iana",
+    "extensions": ["mmr"]
+  },
+  "image/vnd.fujixerox.edmics-rlc": {
+    "source": "iana",
+    "extensions": ["rlc"]
+  },
+  "image/vnd.globalgraphics.pgb": {
+    "source": "iana"
+  },
+  "image/vnd.microsoft.icon": {
+    "source": "iana"
+  },
+  "image/vnd.mix": {
+    "source": "iana"
+  },
+  "image/vnd.mozilla.apng": {
+    "source": "iana"
+  },
+  "image/vnd.ms-modi": {
+    "source": "iana",
+    "extensions": ["mdi"]
+  },
+  "image/vnd.ms-photo": {
+    "source": "apache",
+    "extensions": ["wdp"]
+  },
+  "image/vnd.net-fpx": {
+    "source": "iana",
+    "extensions": ["npx"]
+  },
+  "image/vnd.radiance": {
+    "source": "iana"
+  },
+  "image/vnd.sealed.png": {
+    "source": "iana"
+  },
+  "image/vnd.sealedmedia.softseal.gif": {
+    "source": "iana"
+  },
+  "image/vnd.sealedmedia.softseal.jpg": {
+    "source": "iana"
+  },
+  "image/vnd.svf": {
+    "source": "iana"
+  },
+  "image/vnd.tencent.tap": {
+    "source": "iana"
+  },
+  "image/vnd.valve.source.texture": {
+    "source": "iana"
+  },
+  "image/vnd.wap.wbmp": {
+    "source": "iana",
+    "extensions": ["wbmp"]
+  },
+  "image/vnd.xiff": {
+    "source": "iana",
+    "extensions": ["xif"]
+  },
+  "image/vnd.zbrush.pcx": {
+    "source": "iana"
+  },
+  "image/webp": {
+    "source": "apache",
+    "extensions": ["webp"]
+  },
+  "image/wmf": {
+    "source": "iana"
+  },
+  "image/x-3ds": {
+    "source": "apache",
+    "extensions": ["3ds"]
+  },
+  "image/x-cmu-raster": {
+    "source": "apache",
+    "extensions": ["ras"]
+  },
+  "image/x-cmx": {
+    "source": "apache",
+    "extensions": ["cmx"]
+  },
+  "image/x-freehand": {
+    "source": "apache",
+    "extensions": ["fh","fhc","fh4","fh5","fh7"]
+  },
+  "image/x-icon": {
+    "source": "apache",
+    "compressible": true,
+    "extensions": ["ico"]
+  },
+  "image/x-jng": {
+    "source": "nginx",
+    "extensions": ["jng"]
+  },
+  "image/x-mrsid-image": {
+    "source": "apache",
+    "extensions": ["sid"]
+  },
+  "image/x-ms-bmp": {
+    "source": "nginx",
+    "compressible": true,
+    "extensions": ["bmp"]
+  },
+  "image/x-pcx": {
+    "source": "apache",
+    "extensions": ["pcx"]
+  },
+  "image/x-pict": {
+    "source": "apache",
+    "extensions": ["pic","pct"]
+  },
+  "image/x-portable-anymap": {
+    "source": "apache",
+    "extensions": ["pnm"]
+  },
+  "image/x-portable-bitmap": {
+    "source": "apache",
+    "extensions": ["pbm"]
+  },
+  "image/x-portable-graymap": {
+    "source": "apache",
+    "extensions": ["pgm"]
+  },
+  "image/x-portable-pixmap": {
+    "source": "apache",
+    "extensions": ["ppm"]
+  },
+  "image/x-rgb": {
+    "source": "apache",
+    "extensions": ["rgb"]
+  },
+  "image/x-tga": {
+    "source": "apache",
+    "extensions": ["tga"]
+  },
+  "image/x-xbitmap": {
+    "source": "apache",
+    "extensions": ["xbm"]
+  },
+  "image/x-xcf": {
+    "compressible": false
+  },
+  "image/x-xpixmap": {
+    "source": "apache",
+    "extensions": ["xpm"]
+  },
+  "image/x-xwindowdump": {
+    "source": "apache",
+    "extensions": ["xwd"]
+  },
+  "message/cpim": {
+    "source": "iana"
+  },
+  "message/delivery-status": {
+    "source": "iana"
+  },
+  "message/disposition-notification": {
+    "source": "iana"
+  },
+  "message/external-body": {
+    "source": "iana"
+  },
+  "message/feedback-report": {
+    "source": "iana"
+  },
+  "message/global": {
+    "source": "iana"
+  },
+  "message/global-delivery-status": {
+    "source": "iana"
+  },
+  "message/global-disposition-notification": {
+    "source": "iana"
+  },
+  "message/global-headers": {
+    "source": "iana"
+  },
+  "message/http": {
+    "source": "iana",
+    "compressible": false
+  },
+  "message/imdn+xml": {
+    "source": "iana",
+    "compressible": true
+  },
+  "message/news": {
+    "source": "iana"
+  },
+  "message/partial": {
+    "source": "iana",
+    "compressible": false
+  },
+  "message/rfc822": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["eml","mime"]
+  },
+  "message/s-http": {
+    "source": "iana"
+  },
+  "message/sip": {
+    "source": "iana"
+  },
+  "message/sipfrag": {
+    "source": "iana"
+  },
+  "message/tracking-status": {
+    "source": "iana"
+  },
+  "message/vnd.si.simp": {
+    "source": "iana"
+  },
+  "message/vnd.wfa.wsc": {
+    "source": "iana"
+  },
+  "model/3mf": {
+    "source": "iana"
+  },
+  "model/gltf+json": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["gltf"]
+  },
+  "model/gltf-binary": {
+    "compressible": true,
+    "extensions": ["glb"]
+  },
+  "model/iges": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["igs","iges"]
+  },
+  "model/mesh": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["msh","mesh","silo"]
+  },
+  "model/vnd.collada+xml": {
+    "source": "iana",
+    "extensions": ["dae"]
+  },
+  "model/vnd.dwf": {
+    "source": "iana",
+    "extensions": ["dwf"]
+  },
+  "model/vnd.flatland.3dml": {
+    "source": "iana"
+  },
+  "model/vnd.gdl": {
+    "source": "iana",
+    "extensions": ["gdl"]
+  },
+  "model/vnd.gs-gdl": {
+    "source": "apache"
+  },
+  "model/vnd.gs.gdl": {
+    "source": "iana"
+  },
+  "model/vnd.gtw": {
+    "source": "iana",
+    "extensions": ["gtw"]
+  },
+  "model/vnd.moml+xml": {
+    "source": "iana"
+  },
+  "model/vnd.mts": {
+    "source": "iana",
+    "extensions": ["mts"]
+  },
+  "model/vnd.opengex": {
+    "source": "iana"
+  },
+  "model/vnd.parasolid.transmit.binary": {
+    "source": "iana"
+  },
+  "model/vnd.parasolid.transmit.text": {
+    "source": "iana"
+  },
+  "model/vnd.rosette.annotated-data-model": {
+    "source": "iana"
+  },
+  "model/vnd.valve.source.compiled-map": {
+    "source": "iana"
+  },
+  "model/vnd.vtu": {
+    "source": "iana",
+    "extensions": ["vtu"]
+  },
+  "model/vrml": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["wrl","vrml"]
+  },
+  "model/x3d+binary": {
+    "source": "apache",
+    "compressible": false,
+    "extensions": ["x3db","x3dbz"]
+  },
+  "model/x3d+fastinfoset": {
+    "source": "iana"
+  },
+  "model/x3d+vrml": {
+    "source": "apache",
+    "compressible": false,
+    "extensions": ["x3dv","x3dvz"]
+  },
+  "model/x3d+xml": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["x3d","x3dz"]
+  },
+  "model/x3d-vrml": {
+    "source": "iana"
+  },
+  "multipart/alternative": {
+    "source": "iana",
+    "compressible": false
+  },
+  "multipart/appledouble": {
+    "source": "iana"
+  },
+  "multipart/byteranges": {
+    "source": "iana"
+  },
+  "multipart/digest": {
+    "source": "iana"
+  },
+  "multipart/encrypted": {
+    "source": "iana",
+    "compressible": false
+  },
+  "multipart/form-data": {
+    "source": "iana",
+    "compressible": false
+  },
+  "multipart/header-set": {
+    "source": "iana"
+  },
+  "multipart/mixed": {
+    "source": "iana",
+    "compressible": false
+  },
+  "multipart/parallel": {
+    "source": "iana"
+  },
+  "multipart/related": {
+    "source": "iana",
+    "compressible": false
+  },
+  "multipart/report": {
+    "source": "iana"
+  },
+  "multipart/signed": {
+    "source": "iana",
+    "compressible": false
+  },
+  "multipart/vnd.bint.med-plus": {
+    "source": "iana"
+  },
+  "multipart/voice-message": {
+    "source": "iana"
+  },
+  "multipart/x-mixed-replace": {
+    "source": "iana"
+  },
+  "text/1d-interleaved-parityfec": {
+    "source": "iana"
+  },
+  "text/cache-manifest": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["appcache","manifest"]
+  },
+  "text/calendar": {
+    "source": "iana",
+    "extensions": ["ics","ifb"]
+  },
+  "text/calender": {
+    "compressible": true
+  },
+  "text/cmd": {
+    "compressible": true
+  },
+  "text/coffeescript": {
+    "extensions": ["coffee","litcoffee"]
+  },
+  "text/css": {
+    "source": "iana",
+    "charset": "UTF-8",
+    "compressible": true,
+    "extensions": ["css"]
+  },
+  "text/csv": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["csv"]
+  },
+  "text/csv-schema": {
+    "source": "iana"
+  },
+  "text/directory": {
+    "source": "iana"
+  },
+  "text/dns": {
+    "source": "iana"
+  },
+  "text/ecmascript": {
+    "source": "iana"
+  },
+  "text/encaprtp": {
+    "source": "iana"
+  },
+  "text/enriched": {
+    "source": "iana"
+  },
+  "text/fwdred": {
+    "source": "iana"
+  },
+  "text/grammar-ref-list": {
+    "source": "iana"
+  },
+  "text/hjson": {
+    "extensions": ["hjson"]
+  },
+  "text/html": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["html","htm","shtml"]
+  },
+  "text/jade": {
+    "extensions": ["jade"]
+  },
+  "text/javascript": {
+    "source": "iana",
+    "compressible": true
+  },
+  "text/jcr-cnd": {
+    "source": "iana"
+  },
+  "text/jsx": {
+    "compressible": true,
+    "extensions": ["jsx"]
+  },
+  "text/less": {
+    "extensions": ["less"]
+  },
+  "text/markdown": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["markdown","md"]
+  },
+  "text/mathml": {
+    "source": "nginx",
+    "extensions": ["mml"]
+  },
+  "text/mizar": {
+    "source": "iana"
+  },
+  "text/n3": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["n3"]
+  },
+  "text/parameters": {
+    "source": "iana"
+  },
+  "text/parityfec": {
+    "source": "iana"
+  },
+  "text/plain": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["txt","text","conf","def","list","log","in","ini"]
+  },
+  "text/provenance-notation": {
+    "source": "iana"
+  },
+  "text/prs.fallenstein.rst": {
+    "source": "iana"
+  },
+  "text/prs.lines.tag": {
+    "source": "iana",
+    "extensions": ["dsc"]
+  },
+  "text/prs.prop.logic": {
+    "source": "iana"
+  },
+  "text/raptorfec": {
+    "source": "iana"
+  },
+  "text/red": {
+    "source": "iana"
+  },
+  "text/rfc822-headers": {
+    "source": "iana"
+  },
+  "text/richtext": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["rtx"]
+  },
+  "text/rtf": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["rtf"]
+  },
+  "text/rtp-enc-aescm128": {
+    "source": "iana"
+  },
+  "text/rtploopback": {
+    "source": "iana"
+  },
+  "text/rtx": {
+    "source": "iana"
+  },
+  "text/sgml": {
+    "source": "iana",
+    "extensions": ["sgml","sgm"]
+  },
+  "text/slim": {
+    "extensions": ["slim","slm"]
+  },
+  "text/strings": {
+    "source": "iana"
+  },
+  "text/stylus": {
+    "extensions": ["stylus","styl"]
+  },
+  "text/t140": {
+    "source": "iana"
+  },
+  "text/tab-separated-values": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["tsv"]
+  },
+  "text/troff": {
+    "source": "iana",
+    "extensions": ["t","tr","roff","man","me","ms"]
+  },
+  "text/turtle": {
+    "source": "iana",
+    "extensions": ["ttl"]
+  },
+  "text/ulpfec": {
+    "source": "iana"
+  },
+  "text/uri-list": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["uri","uris","urls"]
+  },
+  "text/vcard": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["vcard"]
+  },
+  "text/vnd.a": {
+    "source": "iana"
+  },
+  "text/vnd.abc": {
+    "source": "iana"
+  },
+  "text/vnd.ascii-art": {
+    "source": "iana"
+  },
+  "text/vnd.curl": {
+    "source": "iana",
+    "extensions": ["curl"]
+  },
+  "text/vnd.curl.dcurl": {
+    "source": "apache",
+    "extensions": ["dcurl"]
+  },
+  "text/vnd.curl.mcurl": {
+    "source": "apache",
+    "extensions": ["mcurl"]
+  },
+  "text/vnd.curl.scurl": {
+    "source": "apache",
+    "extensions": ["scurl"]
+  },
+  "text/vnd.debian.copyright": {
+    "source": "iana"
+  },
+  "text/vnd.dmclientscript": {
+    "source": "iana"
+  },
+  "text/vnd.dvb.subtitle": {
+    "source": "iana",
+    "extensions": ["sub"]
+  },
+  "text/vnd.esmertec.theme-descriptor": {
+    "source": "iana"
+  },
+  "text/vnd.fly": {
+    "source": "iana",
+    "extensions": ["fly"]
+  },
+  "text/vnd.fmi.flexstor": {
+    "source": "iana",
+    "extensions": ["flx"]
+  },
+  "text/vnd.graphviz": {
+    "source": "iana",
+    "extensions": ["gv"]
+  },
+  "text/vnd.in3d.3dml": {
+    "source": "iana",
+    "extensions": ["3dml"]
+  },
+  "text/vnd.in3d.spot": {
+    "source": "iana",
+    "extensions": ["spot"]
+  },
+  "text/vnd.iptc.newsml": {
+    "source": "iana"
+  },
+  "text/vnd.iptc.nitf": {
+    "source": "iana"
+  },
+  "text/vnd.latex-z": {
+    "source": "iana"
+  },
+  "text/vnd.motorola.reflex": {
+    "source": "iana"
+  },
+  "text/vnd.ms-mediapackage": {
+    "source": "iana"
+  },
+  "text/vnd.net2phone.commcenter.command": {
+    "source": "iana"
+  },
+  "text/vnd.radisys.msml-basic-layout": {
+    "source": "iana"
+  },
+  "text/vnd.si.uricatalogue": {
+    "source": "iana"
+  },
+  "text/vnd.sun.j2me.app-descriptor": {
+    "source": "iana",
+    "extensions": ["jad"]
+  },
+  "text/vnd.trolltech.linguist": {
+    "source": "iana"
+  },
+  "text/vnd.wap.si": {
+    "source": "iana"
+  },
+  "text/vnd.wap.sl": {
+    "source": "iana"
+  },
+  "text/vnd.wap.wml": {
+    "source": "iana",
+    "extensions": ["wml"]
+  },
+  "text/vnd.wap.wmlscript": {
+    "source": "iana",
+    "extensions": ["wmls"]
+  },
+  "text/vtt": {
+    "charset": "UTF-8",
+    "compressible": true,
+    "extensions": ["vtt"]
+  },
+  "text/x-asm": {
+    "source": "apache",
+    "extensions": ["s","asm"]
+  },
+  "text/x-c": {
+    "source": "apache",
+    "extensions": ["c","cc","cxx","cpp","h","hh","dic"]
+  },
+  "text/x-component": {
+    "source": "nginx",
+    "extensions": ["htc"]
+  },
+  "text/x-fortran": {
+    "source": "apache",
+    "extensions": ["f","for","f77","f90"]
+  },
+  "text/x-gwt-rpc": {
+    "compressible": true
+  },
+  "text/x-handlebars-template": {
+    "extensions": ["hbs"]
+  },
+  "text/x-java-source": {
+    "source": "apache",
+    "extensions": ["java"]
+  },
+  "text/x-jquery-tmpl": {
+    "compressible": true
+  },
+  "text/x-lua": {
+    "extensions": ["lua"]
+  },
+  "text/x-markdown": {
+    "compressible": true,
+    "extensions": ["mkd"]
+  },
+  "text/x-nfo": {
+    "source": "apache",
+    "extensions": ["nfo"]
+  },
+  "text/x-opml": {
+    "source": "apache",
+    "extensions": ["opml"]
+  },
+  "text/x-org": {
+    "compressible": true,
+    "extensions": ["org"]
+  },
+  "text/x-pascal": {
+    "source": "apache",
+    "extensions": ["p","pas"]
+  },
+  "text/x-processing": {
+    "compressible": true,
+    "extensions": ["pde"]
+  },
+  "text/x-sass": {
+    "extensions": ["sass"]
+  },
+  "text/x-scss": {
+    "extensions": ["scss"]
+  },
+  "text/x-setext": {
+    "source": "apache",
+    "extensions": ["etx"]
+  },
+  "text/x-sfv": {
+    "source": "apache",
+    "extensions": ["sfv"]
+  },
+  "text/x-suse-ymp": {
+    "compressible": true,
+    "extensions": ["ymp"]
+  },
+  "text/x-uuencode": {
+    "source": "apache",
+    "extensions": ["uu"]
+  },
+  "text/x-vcalendar": {
+    "source": "apache",
+    "extensions": ["vcs"]
+  },
+  "text/x-vcard": {
+    "source": "apache",
+    "extensions": ["vcf"]
+  },
+  "text/xml": {
+    "source": "iana",
+    "compressible": true,
+    "extensions": ["xml"]
+  },
+  "text/xml-external-parsed-entity": {
+    "source": "iana"
+  },
+  "text/yaml": {
+    "extensions": ["yaml","yml"]
+  },
+  "video/1d-interleaved-parityfec": {
+    "source": "iana"
+  },
+  "video/3gpp": {
+    "source": "iana",
+    "extensions": ["3gp","3gpp"]
+  },
+  "video/3gpp-tt": {
+    "source": "iana"
+  },
+  "video/3gpp2": {
+    "source": "iana",
+    "extensions": ["3g2"]
+  },
+  "video/bmpeg": {
+    "source": "iana"
+  },
+  "video/bt656": {
+    "source": "iana"
+  },
+  "video/celb": {
+    "source": "iana"
+  },
+  "video/dv": {
+    "source": "iana"
+  },
+  "video/encaprtp": {
+    "source": "iana"
+  },
+  "video/h261": {
+    "source": "iana",
+    "extensions": ["h261"]
+  },
+  "video/h263": {
+    "source": "iana",
+    "extensions": ["h263"]
+  },
+  "video/h263-1998": {
+    "source": "iana"
+  },
+  "video/h263-2000": {
+    "source": "iana"
+  },
+  "video/h264": {
+    "source": "iana",
+    "extensions": ["h264"]
+  },
+  "video/h264-rcdo": {
+    "source": "iana"
+  },
+  "video/h264-svc": {
+    "source": "iana"
+  },
+  "video/h265": {
+    "source": "iana"
+  },
+  "video/iso.segment": {
+    "source": "iana"
+  },
+  "video/jpeg": {
+    "source": "iana",
+    "extensions": ["jpgv"]
+  },
+  "video/jpeg2000": {
+    "source": "iana"
+  },
+  "video/jpm": {
+    "source": "apache",
+    "extensions": ["jpm","jpgm"]
+  },
+  "video/mj2": {
+    "source": "iana",
+    "extensions": ["mj2","mjp2"]
+  },
+  "video/mp1s": {
+    "source": "iana"
+  },
+  "video/mp2p": {
+    "source": "iana"
+  },
+  "video/mp2t": {
+    "source": "iana",
+    "extensions": ["ts"]
+  },
+  "video/mp4": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["mp4","mp4v","mpg4"]
+  },
+  "video/mp4v-es": {
+    "source": "iana"
+  },
+  "video/mpeg": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["mpeg","mpg","mpe","m1v","m2v"]
+  },
+  "video/mpeg4-generic": {
+    "source": "iana"
+  },
+  "video/mpv": {
+    "source": "iana"
+  },
+  "video/nv": {
+    "source": "iana"
+  },
+  "video/ogg": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["ogv"]
+  },
+  "video/parityfec": {
+    "source": "iana"
+  },
+  "video/pointer": {
+    "source": "iana"
+  },
+  "video/quicktime": {
+    "source": "iana",
+    "compressible": false,
+    "extensions": ["qt","mov"]
+  },
+  "video/raptorfec": {
+    "source": "iana"
+  },
+  "video/raw": {
+    "source": "iana"
+  },
+  "video/rtp-enc-aescm128": {
+    "source": "iana"
+  },
+  "video/rtploopback": {
+    "source": "iana"
+  },
+  "video/rtx": {
+    "source": "iana"
+  },
+  "video/smpte292m": {
+    "source": "iana"
+  },
+  "video/ulpfec": {
+    "source": "iana"
+  },
+  "video/vc1": {
+    "source": "iana"
+  },
+  "video/vnd.cctv": {
+    "source": "iana"
+  },
+  "video/vnd.dece.hd": {
+    "source": "iana",
+    "extensions": ["uvh","uvvh"]
+  },
+  "video/vnd.dece.mobile": {
+    "source": "iana",
+    "extensions": ["uvm","uvvm"]
+  },
+  "video/vnd.dece.mp4": {
+    "source": "iana"
+  },
+  "video/vnd.dece.pd": {
+    "source": "iana",
+    "extensions": ["uvp","uvvp"]
+  },
+  "video/vnd.dece.sd": {
+    "source": "iana",
+    "extensions": ["uvs","uvvs"]
+  },
+  "video/vnd.dece.video": {
+    "source": "iana",
+    "extensions": ["uvv","uvvv"]
+  },
+  "video/vnd.directv.mpeg": {
+    "source": "iana"
+  },
+  "video/vnd.directv.mpeg-tts": {
+    "source": "iana"
+  },
+  "video/vnd.dlna.mpeg-tts": {
+    "source": "iana"
+  },
+  "video/vnd.dvb.file": {
+    "source": "iana",
+    "extensions": ["dvb"]
+  },
+  "video/vnd.fvt": {
+    "source": "iana",
+    "extensions": ["fvt"]
+  },
+  "video/vnd.hns.video": {
+    "source": "iana"
+  },
+  "video/vnd.iptvforum.1dparityfec-1010": {
+    "source": "iana"
+  },
+  "video/vnd.iptvforum.1dparityfec-2005": {
+    "source": "iana"
+  },
+  "video/vnd.iptvforum.2dparityfec-1010": {
+    "source": "iana"
+  },
+  "video/vnd.iptvforum.2dparityfec-2005": {
+    "source": "iana"
+  },
+  "video/vnd.iptvforum.ttsavc": {
+    "source": "iana"
+  },
+  "video/vnd.iptvforum.ttsmpeg2": {
+    "source": "iana"
+  },
+  "video/vnd.motorola.video": {
+    "source": "iana"
+  },
+  "video/vnd.motorola.videop": {
+    "source": "iana"
+  },
+  "video/vnd.mpegurl": {
+    "source": "iana",
+    "extensions": ["mxu","m4u"]
+  },
+  "video/vnd.ms-playready.media.pyv": {
+    "source": "iana",
+    "extensions": ["pyv"]
+  },
+  "video/vnd.nokia.interleaved-multimedia": {
+    "source": "iana"
+  },
+  "video/vnd.nokia.videovoip": {
+    "source": "iana"
+  },
+  "video/vnd.objectvideo": {
+    "source": "iana"
+  },
+  "video/vnd.radgamettools.bink": {
+    "source": "iana"
+  },
+  "video/vnd.radgamettools.smacker": {
+    "source": "iana"
+  },
+  "video/vnd.sealed.mpeg1": {
+    "source": "iana"
+  },
+  "video/vnd.sealed.mpeg4": {
+    "source": "iana"
+  },
+  "video/vnd.sealed.swf": {
+    "source": "iana"
+  },
+  "video/vnd.sealedmedia.softseal.mov": {
+    "source": "iana"
+  },
+  "video/vnd.uvvu.mp4": {
+    "source": "iana",
+    "extensions": ["uvu","uvvu"]
+  },
+  "video/vnd.vivo": {
+    "source": "iana",
+    "extensions": ["viv"]
+  },
+  "video/vp8": {
+    "source": "iana"
+  },
+  "video/webm": {
+    "source": "apache",
+    "compressible": false,
+    "extensions": ["webm"]
+  },
+  "video/x-f4v": {
+    "source": "apache",
+    "extensions": ["f4v"]
+  },
+  "video/x-fli": {
+    "source": "apache",
+    "extensions": ["fli"]
+  },
+  "video/x-flv": {
+    "source": "apache",
+    "compressible": false,
+    "extensions": ["flv"]
+  },
+  "video/x-m4v": {
+    "source": "apache",
+    "extensions": ["m4v"]
+  },
+  "video/x-matroska": {
+    "source": "apache",
+    "compressible": false,
+    "extensions": ["mkv","mk3d","mks"]
+  },
+  "video/x-mng": {
+    "source": "apache",
+    "extensions": ["mng"]
+  },
+  "video/x-ms-asf": {
+    "source": "apache",
+    "extensions": ["asf","asx"]
+  },
+  "video/x-ms-vob": {
+    "source": "apache",
+    "extensions": ["vob"]
+  },
+  "video/x-ms-wm": {
+    "source": "apache",
+    "extensions": ["wm"]
+  },
+  "video/x-ms-wmv": {
+    "source": "apache",
+    "compressible": false,
+    "extensions": ["wmv"]
+  },
+  "video/x-ms-wmx": {
+    "source": "apache",
+    "extensions": ["wmx"]
+  },
+  "video/x-ms-wvx": {
+    "source": "apache",
+    "extensions": ["wvx"]
+  },
+  "video/x-msvideo": {
+    "source": "apache",
+    "extensions": ["avi"]
+  },
+  "video/x-sgi-movie": {
+    "source": "apache",
+    "extensions": ["movie"]
+  },
+  "video/x-smv": {
+    "source": "apache",
+    "extensions": ["smv"]
+  },
+  "x-conference/x-cooltalk": {
+    "source": "apache",
+    "extensions": ["ice"]
+  },
+  "x-shader/x-fragment": {
+    "compressible": true
+  },
+  "x-shader/x-vertex": {
+    "compressible": true
+  }
+}
diff --git a/wrt/node_modules/mime-db/index.js b/wrt/node_modules/mime-db/index.js
new file mode 100644 (file)
index 0000000..551031f
--- /dev/null
@@ -0,0 +1,11 @@
+/*!
+ * mime-db
+ * Copyright(c) 2014 Jonathan Ong
+ * MIT Licensed
+ */
+
+/**
+ * Module exports.
+ */
+
+module.exports = require('./db.json')
diff --git a/wrt/node_modules/mime-db/package.json b/wrt/node_modules/mime-db/package.json
new file mode 100644 (file)
index 0000000..570a13f
--- /dev/null
@@ -0,0 +1,140 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "mime-db@~1.30.0",
+        "scope": null,
+        "escapedName": "mime-db",
+        "name": "mime-db",
+        "rawSpec": "~1.30.0",
+        "spec": ">=1.30.0 <1.31.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/mime-types"
+    ]
+  ],
+  "_from": "mime-db@>=1.30.0 <1.31.0",
+  "_id": "mime-db@1.30.0",
+  "_inCache": true,
+  "_location": "/mime-db",
+  "_nodeVersion": "6.11.1",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/mime-db-1.30.0.tgz_1503887330099_0.8198229141999036"
+  },
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "3.10.10",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "mime-db@~1.30.0",
+    "scope": null,
+    "escapedName": "mime-db",
+    "name": "mime-db",
+    "rawSpec": "~1.30.0",
+    "spec": ">=1.30.0 <1.31.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/mime-types"
+  ],
+  "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz",
+  "_shasum": "74c643da2dd9d6a45399963465b26d5ca7d71f01",
+  "_shrinkwrap": null,
+  "_spec": "mime-db@~1.30.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/mime-types",
+  "bugs": {
+    "url": "https://github.com/jshttp/mime-db/issues"
+  },
+  "contributors": [
+    {
+      "name": "Douglas Christopher Wilson",
+      "email": "doug@somethingdoug.com"
+    },
+    {
+      "name": "Jonathan Ong",
+      "email": "me@jongleberry.com",
+      "url": "http://jongleberry.com"
+    },
+    {
+      "name": "Robert Kieffer",
+      "email": "robert@broofa.com",
+      "url": "http://github.com/broofa"
+    }
+  ],
+  "dependencies": {},
+  "description": "Media Type Database",
+  "devDependencies": {
+    "bluebird": "3.5.0",
+    "co": "4.6.0",
+    "cogent": "1.0.1",
+    "csv-parse": "1.2.1",
+    "eslint": "3.19.0",
+    "eslint-config-standard": "10.2.1",
+    "eslint-plugin-import": "2.7.0",
+    "eslint-plugin-node": "5.1.1",
+    "eslint-plugin-promise": "3.5.0",
+    "eslint-plugin-standard": "3.0.1",
+    "gnode": "0.1.2",
+    "mocha": "1.21.5",
+    "nyc": "11.1.0",
+    "raw-body": "2.3.0",
+    "stream-to-array": "2.3.0"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "74c643da2dd9d6a45399963465b26d5ca7d71f01",
+    "tarball": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz"
+  },
+  "engines": {
+    "node": ">= 0.6"
+  },
+  "files": [
+    "HISTORY.md",
+    "LICENSE",
+    "README.md",
+    "db.json",
+    "index.js"
+  ],
+  "gitHead": "e62cf46c206681ca88b2e275f442a9885f1f86e4",
+  "homepage": "https://github.com/jshttp/mime-db#readme",
+  "keywords": [
+    "mime",
+    "db",
+    "type",
+    "types",
+    "database",
+    "charset",
+    "charsets"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    },
+    {
+      "name": "jongleberry",
+      "email": "jonathanrichardong@gmail.com"
+    }
+  ],
+  "name": "mime-db",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/jshttp/mime-db.git"
+  },
+  "scripts": {
+    "build": "node scripts/build",
+    "fetch": "gnode scripts/fetch-apache && gnode scripts/fetch-iana && gnode scripts/fetch-nginx",
+    "lint": "eslint .",
+    "test": "mocha --reporter spec --bail --check-leaks test/",
+    "test-cov": "nyc --reporter=html --reporter=text npm test",
+    "test-travis": "nyc --reporter=text npm test",
+    "update": "npm run fetch && npm run build"
+  },
+  "version": "1.30.0"
+}
diff --git a/wrt/node_modules/mime-types/HISTORY.md b/wrt/node_modules/mime-types/HISTORY.md
new file mode 100644 (file)
index 0000000..7517c11
--- /dev/null
@@ -0,0 +1,247 @@
+2.1.17 / 2017-09-01
+===================
+
+  * deps: mime-db@~1.30.0
+    - Add `application/vnd.ms-outlook`
+    - Add `application/x-arj`
+    - Add extension `.mjs` to `application/javascript`
+    - Add glTF types and extensions
+    - Add new upstream MIME types
+    - Add `text/x-org`
+    - Add VirtualBox MIME types
+    - Fix `source` records for `video/*` types that are IANA
+    - Update `font/opentype` to registered `font/otf`
+
+2.1.16 / 2017-07-24
+===================
+
+  * deps: mime-db@~1.29.0
+    - Add `application/fido.trusted-apps+json`
+    - Add extension `.wadl` to `application/vnd.sun.wadl+xml`
+    - Add extension `.gz` to `application/gzip`
+    - Add new upstream MIME types
+    - Update extensions `.md` and `.markdown` to be `text/markdown`
+
+2.1.15 / 2017-03-23
+===================
+
+  * deps: mime-db@~1.27.0
+    - Add new mime types
+    - Add `image/apng`
+
+2.1.14 / 2017-01-14
+===================
+
+  * deps: mime-db@~1.26.0
+    - Add new mime types
+
+2.1.13 / 2016-11-18
+===================
+
+  * deps: mime-db@~1.25.0
+    - Add new mime types
+
+2.1.12 / 2016-09-18
+===================
+
+  * deps: mime-db@~1.24.0
+    - Add new mime types
+    - Add `audio/mp3`
+
+2.1.11 / 2016-05-01
+===================
+
+  * deps: mime-db@~1.23.0
+    - Add new mime types
+
+2.1.10 / 2016-02-15
+===================
+
+  * deps: mime-db@~1.22.0
+    - Add new mime types
+    - Fix extension of `application/dash+xml`
+    - Update primary extension for `audio/mp4`
+
+2.1.9 / 2016-01-06
+==================
+
+  * deps: mime-db@~1.21.0
+    - Add new mime types
+
+2.1.8 / 2015-11-30
+==================
+
+  * deps: mime-db@~1.20.0
+    - Add new mime types
+
+2.1.7 / 2015-09-20
+==================
+
+  * deps: mime-db@~1.19.0
+    - Add new mime types
+
+2.1.6 / 2015-09-03
+==================
+
+  * deps: mime-db@~1.18.0
+    - Add new mime types
+
+2.1.5 / 2015-08-20
+==================
+
+  * deps: mime-db@~1.17.0
+    - Add new mime types
+
+2.1.4 / 2015-07-30
+==================
+
+  * deps: mime-db@~1.16.0
+    - Add new mime types
+
+2.1.3 / 2015-07-13
+==================
+
+  * deps: mime-db@~1.15.0
+    - Add new mime types
+
+2.1.2 / 2015-06-25
+==================
+
+  * deps: mime-db@~1.14.0
+    - Add new mime types
+
+2.1.1 / 2015-06-08
+==================
+
+  * perf: fix deopt during mapping
+
+2.1.0 / 2015-06-07
+==================
+
+  * Fix incorrectly treating extension-less file name as extension
+    - i.e. `'path/to/json'` will no longer return `application/json`
+  * Fix `.charset(type)` to accept parameters
+  * Fix `.charset(type)` to match case-insensitive
+  * Improve generation of extension to MIME mapping
+  * Refactor internals for readability and no argument reassignment
+  * Prefer `application/*` MIME types from the same source
+  * Prefer any type over `application/octet-stream`
+  * deps: mime-db@~1.13.0
+    - Add nginx as a source
+    - Add new mime types
+
+2.0.14 / 2015-06-06
+===================
+
+  * deps: mime-db@~1.12.0
+    - Add new mime types
+
+2.0.13 / 2015-05-31
+===================
+
+  * deps: mime-db@~1.11.0
+    - Add new mime types
+
+2.0.12 / 2015-05-19
+===================
+
+  * deps: mime-db@~1.10.0
+    - Add new mime types
+
+2.0.11 / 2015-05-05
+===================
+
+  * deps: mime-db@~1.9.1
+    - Add new mime types
+
+2.0.10 / 2015-03-13
+===================
+
+  * deps: mime-db@~1.8.0
+    - Add new mime types
+
+2.0.9 / 2015-02-09
+==================
+
+  * deps: mime-db@~1.7.0
+    - Add new mime types
+    - Community extensions ownership transferred from `node-mime`
+
+2.0.8 / 2015-01-29
+==================
+
+  * deps: mime-db@~1.6.0
+    - Add new mime types
+
+2.0.7 / 2014-12-30
+==================
+
+  * deps: mime-db@~1.5.0
+    - Add new mime types
+    - Fix various invalid MIME type entries
+
+2.0.6 / 2014-12-30
+==================
+
+  * deps: mime-db@~1.4.0
+    - Add new mime types
+    - Fix various invalid MIME type entries
+    - Remove example template MIME types
+
+2.0.5 / 2014-12-29
+==================
+
+  * deps: mime-db@~1.3.1
+    - Fix missing extensions
+
+2.0.4 / 2014-12-10
+==================
+
+  * deps: mime-db@~1.3.0
+    - Add new mime types
+
+2.0.3 / 2014-11-09
+==================
+
+  * deps: mime-db@~1.2.0
+    - Add new mime types
+
+2.0.2 / 2014-09-28
+==================
+
+  * deps: mime-db@~1.1.0
+    - Add new mime types
+    - Add additional compressible
+    - Update charsets
+
+2.0.1 / 2014-09-07
+==================
+
+  * Support Node.js 0.6
+
+2.0.0 / 2014-09-02
+==================
+
+  * Use `mime-db`
+  * Remove `.define()`
+
+1.0.2 / 2014-08-04
+==================
+
+  * Set charset=utf-8 for `text/javascript`
+
+1.0.1 / 2014-06-24
+==================
+
+  * Add `text/jsx` type
+
+1.0.0 / 2014-05-12
+==================
+
+  * Return `false` for unknown types
+  * Set charset=utf-8 for `application/json`
+
+0.1.0 / 2014-05-02
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/mime-types/LICENSE b/wrt/node_modules/mime-types/LICENSE
new file mode 100644 (file)
index 0000000..0616607
--- /dev/null
@@ -0,0 +1,23 @@
+(The MIT License)
+
+Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
+Copyright (c) 2015 Douglas Christopher Wilson <doug@somethingdoug.com>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/mime-types/README.md b/wrt/node_modules/mime-types/README.md
new file mode 100644 (file)
index 0000000..571031c
--- /dev/null
@@ -0,0 +1,108 @@
+# mime-types
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+The ultimate javascript content-type utility.
+
+Similar to [the `mime` module](https://www.npmjs.com/package/mime), except:
+
+- __No fallbacks.__ Instead of naively returning the first available type,
+  `mime-types` simply returns `false`, so do
+  `var type = mime.lookup('unrecognized') || 'application/octet-stream'`.
+- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`.
+- No `.define()` functionality
+- Bug fixes for `.lookup(path)`
+
+Otherwise, the API is compatible.
+
+## Install
+
+This is a [Node.js](https://nodejs.org/en/) module available through the
+[npm registry](https://www.npmjs.com/). Installation is done using the
+[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
+
+```sh
+$ npm install mime-types
+```
+
+## Adding Types
+
+All mime types are based on [mime-db](https://www.npmjs.com/package/mime-db),
+so open a PR there if you'd like to add mime types.
+
+## API
+
+```js
+var mime = require('mime-types')
+```
+
+All functions return `false` if input is invalid or not found.
+
+### mime.lookup(path)
+
+Lookup the content-type associated with a file.
+
+```js
+mime.lookup('json')             // 'application/json'
+mime.lookup('.md')              // 'text/markdown'
+mime.lookup('file.html')        // 'text/html'
+mime.lookup('folder/file.js')   // 'application/javascript'
+mime.lookup('folder/.htaccess') // false
+
+mime.lookup('cats') // false
+```
+
+### mime.contentType(type)
+
+Create a full content-type header given a content-type or extension.
+
+```js
+mime.contentType('markdown')  // 'text/x-markdown; charset=utf-8'
+mime.contentType('file.json') // 'application/json; charset=utf-8'
+
+// from a full path
+mime.contentType(path.extname('/path/to/file.json')) // 'application/json; charset=utf-8'
+```
+
+### mime.extension(type)
+
+Get the default extension for a content-type.
+
+```js
+mime.extension('application/octet-stream') // 'bin'
+```
+
+### mime.charset(type)
+
+Lookup the implied default charset of a content-type.
+
+```js
+mime.charset('text/markdown') // 'UTF-8'
+```
+
+### var type = mime.types[extension]
+
+A map of content-types by extension.
+
+### [extensions...] = mime.extensions[type]
+
+A map of extensions by content-type.
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/mime-types.svg
+[npm-url]: https://npmjs.org/package/mime-types
+[node-version-image]: https://img.shields.io/node/v/mime-types.svg
+[node-version-url]: https://nodejs.org/en/download/
+[travis-image]: https://img.shields.io/travis/jshttp/mime-types/master.svg
+[travis-url]: https://travis-ci.org/jshttp/mime-types
+[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-types/master.svg
+[coveralls-url]: https://coveralls.io/r/jshttp/mime-types
+[downloads-image]: https://img.shields.io/npm/dm/mime-types.svg
+[downloads-url]: https://npmjs.org/package/mime-types
diff --git a/wrt/node_modules/mime-types/index.js b/wrt/node_modules/mime-types/index.js
new file mode 100644 (file)
index 0000000..b9f34d5
--- /dev/null
@@ -0,0 +1,188 @@
+/*!
+ * mime-types
+ * Copyright(c) 2014 Jonathan Ong
+ * Copyright(c) 2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var db = require('mime-db')
+var extname = require('path').extname
+
+/**
+ * Module variables.
+ * @private
+ */
+
+var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/
+var TEXT_TYPE_REGEXP = /^text\//i
+
+/**
+ * Module exports.
+ * @public
+ */
+
+exports.charset = charset
+exports.charsets = { lookup: charset }
+exports.contentType = contentType
+exports.extension = extension
+exports.extensions = Object.create(null)
+exports.lookup = lookup
+exports.types = Object.create(null)
+
+// Populate the extensions/types maps
+populateMaps(exports.extensions, exports.types)
+
+/**
+ * Get the default charset for a MIME type.
+ *
+ * @param {string} type
+ * @return {boolean|string}
+ */
+
+function charset (type) {
+  if (!type || typeof type !== 'string') {
+    return false
+  }
+
+  // TODO: use media-typer
+  var match = EXTRACT_TYPE_REGEXP.exec(type)
+  var mime = match && db[match[1].toLowerCase()]
+
+  if (mime && mime.charset) {
+    return mime.charset
+  }
+
+  // default text/* to utf-8
+  if (match && TEXT_TYPE_REGEXP.test(match[1])) {
+    return 'UTF-8'
+  }
+
+  return false
+}
+
+/**
+ * Create a full Content-Type header given a MIME type or extension.
+ *
+ * @param {string} str
+ * @return {boolean|string}
+ */
+
+function contentType (str) {
+  // TODO: should this even be in this module?
+  if (!str || typeof str !== 'string') {
+    return false
+  }
+
+  var mime = str.indexOf('/') === -1
+    ? exports.lookup(str)
+    : str
+
+  if (!mime) {
+    return false
+  }
+
+  // TODO: use content-type or other module
+  if (mime.indexOf('charset') === -1) {
+    var charset = exports.charset(mime)
+    if (charset) mime += '; charset=' + charset.toLowerCase()
+  }
+
+  return mime
+}
+
+/**
+ * Get the default extension for a MIME type.
+ *
+ * @param {string} type
+ * @return {boolean|string}
+ */
+
+function extension (type) {
+  if (!type || typeof type !== 'string') {
+    return false
+  }
+
+  // TODO: use media-typer
+  var match = EXTRACT_TYPE_REGEXP.exec(type)
+
+  // get extensions
+  var exts = match && exports.extensions[match[1].toLowerCase()]
+
+  if (!exts || !exts.length) {
+    return false
+  }
+
+  return exts[0]
+}
+
+/**
+ * Lookup the MIME type for a file path/extension.
+ *
+ * @param {string} path
+ * @return {boolean|string}
+ */
+
+function lookup (path) {
+  if (!path || typeof path !== 'string') {
+    return false
+  }
+
+  // get the extension ("ext" or ".ext" or full path)
+  var extension = extname('x.' + path)
+    .toLowerCase()
+    .substr(1)
+
+  if (!extension) {
+    return false
+  }
+
+  return exports.types[extension] || false
+}
+
+/**
+ * Populate the extensions and types maps.
+ * @private
+ */
+
+function populateMaps (extensions, types) {
+  // source preference (least -> most)
+  var preference = ['nginx', 'apache', undefined, 'iana']
+
+  Object.keys(db).forEach(function forEachMimeType (type) {
+    var mime = db[type]
+    var exts = mime.extensions
+
+    if (!exts || !exts.length) {
+      return
+    }
+
+    // mime -> extensions
+    extensions[type] = exts
+
+    // extension -> mime
+    for (var i = 0; i < exts.length; i++) {
+      var extension = exts[i]
+
+      if (types[extension]) {
+        var from = preference.indexOf(db[types[extension]].source)
+        var to = preference.indexOf(mime.source)
+
+        if (types[extension] !== 'application/octet-stream' &&
+          (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) {
+          // skip the remapping
+          continue
+        }
+      }
+
+      // set the extension -> mime
+      types[extension] = type
+    }
+  })
+}
diff --git a/wrt/node_modules/mime-types/package.json b/wrt/node_modules/mime-types/package.json
new file mode 100644 (file)
index 0000000..7c5efab
--- /dev/null
@@ -0,0 +1,129 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "mime-types@~2.1.11",
+        "scope": null,
+        "escapedName": "mime-types",
+        "name": "mime-types",
+        "rawSpec": "~2.1.11",
+        "spec": ">=2.1.11 <2.2.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/accepts"
+    ]
+  ],
+  "_from": "mime-types@>=2.1.11 <2.2.0",
+  "_id": "mime-types@2.1.17",
+  "_inCache": true,
+  "_location": "/mime-types",
+  "_nodeVersion": "6.11.1",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/mime-types-2.1.17.tgz_1504322793218_0.6663200033362955"
+  },
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "3.10.10",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "mime-types@~2.1.11",
+    "scope": null,
+    "escapedName": "mime-types",
+    "name": "mime-types",
+    "rawSpec": "~2.1.11",
+    "spec": ">=2.1.11 <2.2.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/accepts"
+  ],
+  "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz",
+  "_shasum": "09d7a393f03e995a79f8af857b70a9e0ab16557a",
+  "_shrinkwrap": null,
+  "_spec": "mime-types@~2.1.11",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/accepts",
+  "bugs": {
+    "url": "https://github.com/jshttp/mime-types/issues"
+  },
+  "contributors": [
+    {
+      "name": "Douglas Christopher Wilson",
+      "email": "doug@somethingdoug.com"
+    },
+    {
+      "name": "Jeremiah Senkpiel",
+      "email": "fishrock123@rocketmail.com",
+      "url": "https://searchbeam.jit.su"
+    },
+    {
+      "name": "Jonathan Ong",
+      "email": "me@jongleberry.com",
+      "url": "http://jongleberry.com"
+    }
+  ],
+  "dependencies": {
+    "mime-db": "~1.30.0"
+  },
+  "description": "The ultimate javascript content-type utility.",
+  "devDependencies": {
+    "eslint": "3.19.0",
+    "eslint-config-standard": "10.2.1",
+    "eslint-plugin-import": "2.7.0",
+    "eslint-plugin-node": "5.1.1",
+    "eslint-plugin-promise": "3.5.0",
+    "eslint-plugin-standard": "3.0.1",
+    "istanbul": "0.4.5",
+    "mocha": "1.21.5"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "09d7a393f03e995a79f8af857b70a9e0ab16557a",
+    "tarball": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz"
+  },
+  "engines": {
+    "node": ">= 0.6"
+  },
+  "files": [
+    "HISTORY.md",
+    "LICENSE",
+    "index.js"
+  ],
+  "gitHead": "80039fe78213821c2e9b25132d6b02cc37202e8a",
+  "homepage": "https://github.com/jshttp/mime-types#readme",
+  "keywords": [
+    "mime",
+    "types"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "fishrock123",
+      "email": "fishrock123@rocketmail.com"
+    },
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    },
+    {
+      "name": "jongleberry",
+      "email": "jonathanrichardong@gmail.com"
+    }
+  ],
+  "name": "mime-types",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/jshttp/mime-types.git"
+  },
+  "scripts": {
+    "lint": "eslint .",
+    "test": "mocha --reporter spec test/test.js",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/test.js",
+    "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot test/test.js"
+  },
+  "version": "2.1.17"
+}
diff --git a/wrt/node_modules/mime/.npmignore b/wrt/node_modules/mime/.npmignore
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/wrt/node_modules/mime/LICENSE b/wrt/node_modules/mime/LICENSE
new file mode 100644 (file)
index 0000000..451fc45
--- /dev/null
@@ -0,0 +1,19 @@
+Copyright (c) 2010 Benjamin Thomas, Robert Kieffer
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/mime/README.md b/wrt/node_modules/mime/README.md
new file mode 100644 (file)
index 0000000..506fbe5
--- /dev/null
@@ -0,0 +1,90 @@
+# mime
+
+Comprehensive MIME type mapping API based on mime-db module.
+
+## Install
+
+Install with [npm](http://github.com/isaacs/npm):
+
+    npm install mime
+
+## Contributing / Testing
+
+    npm run test
+
+## Command Line
+
+    mime [path_string]
+
+E.g.
+
+    > mime scripts/jquery.js
+    application/javascript
+
+## API - Queries
+
+### mime.lookup(path)
+Get the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.').  E.g.
+
+```js
+var mime = require('mime');
+
+mime.lookup('/path/to/file.txt');         // => 'text/plain'
+mime.lookup('file.txt');                  // => 'text/plain'
+mime.lookup('.TXT');                      // => 'text/plain'
+mime.lookup('htm');                       // => 'text/html'
+```
+
+### mime.default_type
+Sets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.)
+
+### mime.extension(type)
+Get the default extension for `type`
+
+```js
+mime.extension('text/html');                 // => 'html'
+mime.extension('application/octet-stream');  // => 'bin'
+```
+
+### mime.charsets.lookup()
+
+Map mime-type to charset
+
+```js
+mime.charsets.lookup('text/plain');        // => 'UTF-8'
+```
+
+(The logic for charset lookups is pretty rudimentary.  Feel free to suggest improvements.)
+
+## API - Defining Custom Types
+
+Custom type mappings can be added on a per-project basis via the following APIs.
+
+### mime.define()
+
+Add custom mime/extension mappings
+
+```js
+mime.define({
+    'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'],
+    'application/x-my-type': ['x-mt', 'x-mtt'],
+    // etc ...
+});
+
+mime.lookup('x-sft');                 // => 'text/x-some-format'
+```
+
+The first entry in the extensions array is returned by `mime.extension()`. E.g.
+
+```js
+mime.extension('text/x-some-format'); // => 'x-sf'
+```
+
+### mime.load(filepath)
+
+Load mappings from an Apache ".types" format file
+
+```js
+mime.load('./my_project.types');
+```
+The .types file format is simple -  See the `types` dir for examples.
diff --git a/wrt/node_modules/mime/build/build.js b/wrt/node_modules/mime/build/build.js
new file mode 100644 (file)
index 0000000..ed5313e
--- /dev/null
@@ -0,0 +1,11 @@
+var db = require('mime-db');
+
+var mapByType = {};
+Object.keys(db).forEach(function(key) {
+  var extensions = db[key].extensions;
+  if (extensions) {
+    mapByType[key] = extensions;
+  }
+});
+
+console.log(JSON.stringify(mapByType));
diff --git a/wrt/node_modules/mime/build/test.js b/wrt/node_modules/mime/build/test.js
new file mode 100644 (file)
index 0000000..58b9ba7
--- /dev/null
@@ -0,0 +1,57 @@
+/**
+ * Usage: node test.js
+ */
+
+var mime = require('../mime');
+var assert = require('assert');
+var path = require('path');
+
+//
+// Test mime lookups
+//
+
+assert.equal('text/plain', mime.lookup('text.txt'));     // normal file
+assert.equal('text/plain', mime.lookup('TEXT.TXT'));     // uppercase
+assert.equal('text/plain', mime.lookup('dir/text.txt')); // dir + file
+assert.equal('text/plain', mime.lookup('.text.txt'));    // hidden file
+assert.equal('text/plain', mime.lookup('.txt'));         // nameless
+assert.equal('text/plain', mime.lookup('txt'));          // extension-only
+assert.equal('text/plain', mime.lookup('/txt'));         // extension-less ()
+assert.equal('text/plain', mime.lookup('\\txt'));        // Windows, extension-less
+assert.equal('application/octet-stream', mime.lookup('text.nope')); // unrecognized
+assert.equal('fallback', mime.lookup('text.fallback', 'fallback')); // alternate default
+
+//
+// Test extensions
+//
+
+assert.equal('txt', mime.extension(mime.types.text));
+assert.equal('html', mime.extension(mime.types.htm));
+assert.equal('bin', mime.extension('application/octet-stream'));
+assert.equal('bin', mime.extension('application/octet-stream '));
+assert.equal('html', mime.extension(' text/html; charset=UTF-8'));
+assert.equal('html', mime.extension('text/html; charset=UTF-8 '));
+assert.equal('html', mime.extension('text/html; charset=UTF-8'));
+assert.equal('html', mime.extension('text/html ; charset=UTF-8'));
+assert.equal('html', mime.extension('text/html;charset=UTF-8'));
+assert.equal('html', mime.extension('text/Html;charset=UTF-8'));
+assert.equal(undefined, mime.extension('unrecognized'));
+
+//
+// Test node.types lookups
+//
+
+assert.equal('application/font-woff', mime.lookup('file.woff'));
+assert.equal('application/octet-stream', mime.lookup('file.buffer'));
+assert.equal('audio/mp4', mime.lookup('file.m4a'));
+assert.equal('font/opentype', mime.lookup('file.otf'));
+
+//
+// Test charsets
+//
+
+assert.equal('UTF-8', mime.charsets.lookup('text/plain'));
+assert.equal(undefined, mime.charsets.lookup(mime.types.js));
+assert.equal('fallback', mime.charsets.lookup('application/octet-stream', 'fallback'));
+
+console.log('\nAll tests passed');
diff --git a/wrt/node_modules/mime/cli.js b/wrt/node_modules/mime/cli.js
new file mode 100755 (executable)
index 0000000..20b1ffe
--- /dev/null
@@ -0,0 +1,8 @@
+#!/usr/bin/env node
+
+var mime = require('./mime.js');
+var file = process.argv[2];
+var type = mime.lookup(file);
+
+process.stdout.write(type + '\n');
+
diff --git a/wrt/node_modules/mime/mime.js b/wrt/node_modules/mime/mime.js
new file mode 100644 (file)
index 0000000..341b6a5
--- /dev/null
@@ -0,0 +1,108 @@
+var path = require('path');
+var fs = require('fs');
+
+function Mime() {
+  // Map of extension -> mime type
+  this.types = Object.create(null);
+
+  // Map of mime type -> extension
+  this.extensions = Object.create(null);
+}
+
+/**
+ * Define mimetype -> extension mappings.  Each key is a mime-type that maps
+ * to an array of extensions associated with the type.  The first extension is
+ * used as the default extension for the type.
+ *
+ * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']});
+ *
+ * @param map (Object) type definitions
+ */
+Mime.prototype.define = function (map) {
+  for (var type in map) {
+    var exts = map[type];
+    for (var i = 0; i < exts.length; i++) {
+      if (process.env.DEBUG_MIME && this.types[exts]) {
+        console.warn(this._loading.replace(/.*\//, ''), 'changes "' + exts[i] + '" extension type from ' +
+          this.types[exts] + ' to ' + type);
+      }
+
+      this.types[exts[i]] = type;
+    }
+
+    // Default extension is the first one we encounter
+    if (!this.extensions[type]) {
+      this.extensions[type] = exts[0];
+    }
+  }
+};
+
+/**
+ * Load an Apache2-style ".types" file
+ *
+ * This may be called multiple times (it's expected).  Where files declare
+ * overlapping types/extensions, the last file wins.
+ *
+ * @param file (String) path of file to load.
+ */
+Mime.prototype.load = function(file) {
+  this._loading = file;
+  // Read file and split into lines
+  var map = {},
+      content = fs.readFileSync(file, 'ascii'),
+      lines = content.split(/[\r\n]+/);
+
+  lines.forEach(function(line) {
+    // Clean up whitespace/comments, and split into fields
+    var fields = line.replace(/\s*#.*|^\s*|\s*$/g, '').split(/\s+/);
+    map[fields.shift()] = fields;
+  });
+
+  this.define(map);
+
+  this._loading = null;
+};
+
+/**
+ * Lookup a mime type based on extension
+ */
+Mime.prototype.lookup = function(path, fallback) {
+  var ext = path.replace(/.*[\.\/\\]/, '').toLowerCase();
+
+  return this.types[ext] || fallback || this.default_type;
+};
+
+/**
+ * Return file extension associated with a mime type
+ */
+Mime.prototype.extension = function(mimeType) {
+  var type = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase();
+  return this.extensions[type];
+};
+
+// Default instance
+var mime = new Mime();
+
+// Define built-in types
+mime.define(require('./types.json'));
+
+// Default type
+mime.default_type = mime.lookup('bin');
+
+//
+// Additional API specific to the default instance
+//
+
+mime.Mime = Mime;
+
+/**
+ * Lookup a charset based on mime type.
+ */
+mime.charsets = {
+  lookup: function(mimeType, fallback) {
+    // Assume text types are utf8
+    return (/^text\//).test(mimeType) ? 'UTF-8' : fallback;
+  }
+};
+
+module.exports = mime;
diff --git a/wrt/node_modules/mime/package.json b/wrt/node_modules/mime/package.json
new file mode 100644 (file)
index 0000000..ba7711d
--- /dev/null
@@ -0,0 +1,106 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "mime@1.3.4",
+        "scope": null,
+        "escapedName": "mime",
+        "name": "mime",
+        "rawSpec": "1.3.4",
+        "spec": "1.3.4",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/send"
+    ]
+  ],
+  "_from": "mime@1.3.4",
+  "_id": "mime@1.3.4",
+  "_inCache": true,
+  "_location": "/mime",
+  "_npmUser": {
+    "name": "broofa",
+    "email": "robert@broofa.com"
+  },
+  "_npmVersion": "1.4.28",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "mime@1.3.4",
+    "scope": null,
+    "escapedName": "mime",
+    "name": "mime",
+    "rawSpec": "1.3.4",
+    "spec": "1.3.4",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/send"
+  ],
+  "_resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz",
+  "_shasum": "115f9e3b6b3daf2959983cb38f149a2d40eb5d53",
+  "_shrinkwrap": null,
+  "_spec": "mime@1.3.4",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/send",
+  "author": {
+    "name": "Robert Kieffer",
+    "email": "robert@broofa.com",
+    "url": "http://github.com/broofa"
+  },
+  "bin": {
+    "mime": "cli.js"
+  },
+  "bugs": {
+    "url": "https://github.com/broofa/node-mime/issues"
+  },
+  "contributors": [
+    {
+      "name": "Benjamin Thomas",
+      "email": "benjamin@benjaminthomas.org",
+      "url": "http://github.com/bentomas"
+    }
+  ],
+  "dependencies": {},
+  "description": "A comprehensive library for mime-type mapping",
+  "devDependencies": {
+    "mime-db": "^1.2.0"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "115f9e3b6b3daf2959983cb38f149a2d40eb5d53",
+    "tarball": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz"
+  },
+  "gitHead": "1628f6e0187095009dcef4805c3a49706f137974",
+  "homepage": "https://github.com/broofa/node-mime",
+  "keywords": [
+    "util",
+    "mime"
+  ],
+  "licenses": [
+    {
+      "type": "MIT",
+      "url": "https://raw.github.com/broofa/node-mime/master/LICENSE"
+    }
+  ],
+  "main": "mime.js",
+  "maintainers": [
+    {
+      "name": "broofa",
+      "email": "robert@broofa.com"
+    },
+    {
+      "name": "bentomas",
+      "email": "benjamin@benjaminthomas.org"
+    }
+  ],
+  "name": "mime",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "url": "git+https://github.com/broofa/node-mime.git",
+    "type": "git"
+  },
+  "scripts": {
+    "prepublish": "node build/build.js > types.json",
+    "test": "node build/test.js"
+  },
+  "version": "1.3.4"
+}
diff --git a/wrt/node_modules/mime/types.json b/wrt/node_modules/mime/types.json
new file mode 100644 (file)
index 0000000..c674b1c
--- /dev/null
@@ -0,0 +1 @@
+{"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mdp"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/font-tdpfr":["pfr"],"application/font-woff":["woff"],"application/font-woff2":["woff2"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/java-archive":["jar"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/prs.cww":["cww"],"application/pskc+xml":["pskcxml"],"application/rdf+xml":["rdf"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"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"]}
diff --git a/wrt/node_modules/minimatch/LICENSE b/wrt/node_modules/minimatch/LICENSE
new file mode 100644 (file)
index 0000000..19129e3
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/wrt/node_modules/minimatch/README.md b/wrt/node_modules/minimatch/README.md
new file mode 100644 (file)
index 0000000..ad72b81
--- /dev/null
@@ -0,0 +1,209 @@
+# minimatch
+
+A minimal matching utility.
+
+[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.svg)](http://travis-ci.org/isaacs/minimatch)
+
+
+This is the matching library used internally by npm.
+
+It works by converting glob expressions into JavaScript `RegExp`
+objects.
+
+## Usage
+
+```javascript
+var minimatch = require("minimatch")
+
+minimatch("bar.foo", "*.foo") // true!
+minimatch("bar.foo", "*.bar") // false!
+minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy!
+```
+
+## Features
+
+Supports these glob features:
+
+* Brace Expansion
+* Extended glob matching
+* "Globstar" `**` matching
+
+See:
+
+* `man sh`
+* `man bash`
+* `man 3 fnmatch`
+* `man 5 gitignore`
+
+## Minimatch Class
+
+Create a minimatch object by instantiating the `minimatch.Minimatch` class.
+
+```javascript
+var Minimatch = require("minimatch").Minimatch
+var mm = new Minimatch(pattern, options)
+```
+
+### Properties
+
+* `pattern` The original pattern the minimatch object represents.
+* `options` The options supplied to the constructor.
+* `set` A 2-dimensional array of regexp or string expressions.
+  Each row in the
+  array corresponds to a brace-expanded pattern.  Each item in the row
+  corresponds to a single path-part.  For example, the pattern
+  `{a,b/c}/d` would expand to a set of patterns like:
+
+        [ [ a, d ]
+        , [ b, c, d ] ]
+
+    If a portion of the pattern doesn't have any "magic" in it
+    (that is, it's something like `"foo"` rather than `fo*o?`), then it
+    will be left as a string rather than converted to a regular
+    expression.
+
+* `regexp` Created by the `makeRe` method.  A single regular expression
+  expressing the entire pattern.  This is useful in cases where you wish
+  to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled.
+* `negate` True if the pattern is negated.
+* `comment` True if the pattern is a comment.
+* `empty` True if the pattern is `""`.
+
+### Methods
+
+* `makeRe` Generate the `regexp` member if necessary, and return it.
+  Will return `false` if the pattern is invalid.
+* `match(fname)` Return true if the filename matches the pattern, or
+  false otherwise.
+* `matchOne(fileArray, patternArray, partial)` Take a `/`-split
+  filename, and match it against a single row in the `regExpSet`.  This
+  method is mainly for internal use, but is exposed so that it can be
+  used by a glob-walker that needs to avoid excessive filesystem calls.
+
+All other methods are internal, and will be called as necessary.
+
+### minimatch(path, pattern, options)
+
+Main export.  Tests a path against the pattern using the options.
+
+```javascript
+var isJS = minimatch(file, "*.js", { matchBase: true })
+```
+
+### minimatch.filter(pattern, options)
+
+Returns a function that tests its
+supplied argument, suitable for use with `Array.filter`.  Example:
+
+```javascript
+var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true}))
+```
+
+### minimatch.match(list, pattern, options)
+
+Match against the list of
+files, in the style of fnmatch or glob.  If nothing is matched, and
+options.nonull is set, then return a list containing the pattern itself.
+
+```javascript
+var javascripts = minimatch.match(fileList, "*.js", {matchBase: true}))
+```
+
+### minimatch.makeRe(pattern, options)
+
+Make a regular expression object from the pattern.
+
+## Options
+
+All options are `false` by default.
+
+### debug
+
+Dump a ton of stuff to stderr.
+
+### nobrace
+
+Do not expand `{a,b}` and `{1..3}` brace sets.
+
+### noglobstar
+
+Disable `**` matching against multiple folder names.
+
+### dot
+
+Allow patterns to match filenames starting with a period, even if
+the pattern does not explicitly have a period in that spot.
+
+Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot`
+is set.
+
+### noext
+
+Disable "extglob" style patterns like `+(a|b)`.
+
+### nocase
+
+Perform a case-insensitive match.
+
+### nonull
+
+When a match is not found by `minimatch.match`, return a list containing
+the pattern itself if this option is set.  When not set, an empty list
+is returned if there are no matches.
+
+### matchBase
+
+If set, then patterns without slashes will be matched
+against the basename of the path if it contains slashes.  For example,
+`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`.
+
+### nocomment
+
+Suppress the behavior of treating `#` at the start of a pattern as a
+comment.
+
+### nonegate
+
+Suppress the behavior of treating a leading `!` character as negation.
+
+### flipNegate
+
+Returns from negate expressions the same as if they were not negated.
+(Ie, true on a hit, false on a miss.)
+
+
+## Comparisons to other fnmatch/glob implementations
+
+While strict compliance with the existing standards is a worthwhile
+goal, some discrepancies exist between minimatch and other
+implementations, and are intentional.
+
+If the pattern starts with a `!` character, then it is negated.  Set the
+`nonegate` flag to suppress this behavior, and treat leading `!`
+characters normally.  This is perhaps relevant if you wish to start the
+pattern with a negative extglob pattern like `!(a|B)`.  Multiple `!`
+characters at the start of a pattern will negate the pattern multiple
+times.
+
+If a pattern starts with `#`, then it is treated as a comment, and
+will not match anything.  Use `\#` to match a literal `#` at the
+start of a line, or set the `nocomment` flag to suppress this behavior.
+
+The double-star character `**` is supported by default, unless the
+`noglobstar` flag is set.  This is supported in the manner of bsdglob
+and bash 4.1, where `**` only has special significance if it is the only
+thing in a path part.  That is, `a/**/b` will match `a/x/y/b`, but
+`a/**b` will not.
+
+If an escaped pattern has no matches, and the `nonull` flag is set,
+then minimatch.match returns the pattern as-provided, rather than
+interpreting the character escapes.  For example,
+`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than
+`"*a?"`.  This is akin to setting the `nullglob` option in bash, except
+that it does not resolve escaped pattern characters.
+
+If brace expansion is not disabled, then it is performed before any
+other interpretation of the glob pattern.  Thus, a pattern like
+`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded
+**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are
+checked for validity.  Since those two are valid, matching proceeds.
diff --git a/wrt/node_modules/minimatch/minimatch.js b/wrt/node_modules/minimatch/minimatch.js
new file mode 100644 (file)
index 0000000..5b5f8cf
--- /dev/null
@@ -0,0 +1,923 @@
+module.exports = minimatch
+minimatch.Minimatch = Minimatch
+
+var path = { sep: '/' }
+try {
+  path = require('path')
+} catch (er) {}
+
+var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}
+var expand = require('brace-expansion')
+
+var plTypes = {
+  '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},
+  '?': { open: '(?:', close: ')?' },
+  '+': { open: '(?:', close: ')+' },
+  '*': { open: '(?:', close: ')*' },
+  '@': { open: '(?:', close: ')' }
+}
+
+// any single thing other than /
+// don't need to escape / when using new RegExp()
+var qmark = '[^/]'
+
+// * => any number of characters
+var star = qmark + '*?'
+
+// ** when dots are allowed.  Anything goes, except .. and .
+// not (^ or / followed by one or two dots followed by $ or /),
+// followed by anything, any number of times.
+var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?'
+
+// not a ^ or / followed by a dot,
+// followed by anything, any number of times.
+var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?'
+
+// characters that need to be escaped in RegExp.
+var reSpecials = charSet('().*{}+?[]^$\\!')
+
+// "abc" -> { a:true, b:true, c:true }
+function charSet (s) {
+  return s.split('').reduce(function (set, c) {
+    set[c] = true
+    return set
+  }, {})
+}
+
+// normalizes slashes.
+var slashSplit = /\/+/
+
+minimatch.filter = filter
+function filter (pattern, options) {
+  options = options || {}
+  return function (p, i, list) {
+    return minimatch(p, pattern, options)
+  }
+}
+
+function ext (a, b) {
+  a = a || {}
+  b = b || {}
+  var t = {}
+  Object.keys(b).forEach(function (k) {
+    t[k] = b[k]
+  })
+  Object.keys(a).forEach(function (k) {
+    t[k] = a[k]
+  })
+  return t
+}
+
+minimatch.defaults = function (def) {
+  if (!def || !Object.keys(def).length) return minimatch
+
+  var orig = minimatch
+
+  var m = function minimatch (p, pattern, options) {
+    return orig.minimatch(p, pattern, ext(def, options))
+  }
+
+  m.Minimatch = function Minimatch (pattern, options) {
+    return new orig.Minimatch(pattern, ext(def, options))
+  }
+
+  return m
+}
+
+Minimatch.defaults = function (def) {
+  if (!def || !Object.keys(def).length) return Minimatch
+  return minimatch.defaults(def).Minimatch
+}
+
+function minimatch (p, pattern, options) {
+  if (typeof pattern !== 'string') {
+    throw new TypeError('glob pattern string required')
+  }
+
+  if (!options) options = {}
+
+  // shortcut: comments match nothing.
+  if (!options.nocomment && pattern.charAt(0) === '#') {
+    return false
+  }
+
+  // "" only matches ""
+  if (pattern.trim() === '') return p === ''
+
+  return new Minimatch(pattern, options).match(p)
+}
+
+function Minimatch (pattern, options) {
+  if (!(this instanceof Minimatch)) {
+    return new Minimatch(pattern, options)
+  }
+
+  if (typeof pattern !== 'string') {
+    throw new TypeError('glob pattern string required')
+  }
+
+  if (!options) options = {}
+  pattern = pattern.trim()
+
+  // windows support: need to use /, not \
+  if (path.sep !== '/') {
+    pattern = pattern.split(path.sep).join('/')
+  }
+
+  this.options = options
+  this.set = []
+  this.pattern = pattern
+  this.regexp = null
+  this.negate = false
+  this.comment = false
+  this.empty = false
+
+  // make the set of regexps etc.
+  this.make()
+}
+
+Minimatch.prototype.debug = function () {}
+
+Minimatch.prototype.make = make
+function make () {
+  // don't do it more than once.
+  if (this._made) return
+
+  var pattern = this.pattern
+  var options = this.options
+
+  // empty patterns and comments match nothing.
+  if (!options.nocomment && pattern.charAt(0) === '#') {
+    this.comment = true
+    return
+  }
+  if (!pattern) {
+    this.empty = true
+    return
+  }
+
+  // step 1: figure out negation, etc.
+  this.parseNegate()
+
+  // step 2: expand braces
+  var set = this.globSet = this.braceExpand()
+
+  if (options.debug) this.debug = console.error
+
+  this.debug(this.pattern, set)
+
+  // step 3: now we have a set, so turn each one into a series of path-portion
+  // matching patterns.
+  // These will be regexps, except in the case of "**", which is
+  // set to the GLOBSTAR object for globstar behavior,
+  // and will not contain any / characters
+  set = this.globParts = set.map(function (s) {
+    return s.split(slashSplit)
+  })
+
+  this.debug(this.pattern, set)
+
+  // glob --> regexps
+  set = set.map(function (s, si, set) {
+    return s.map(this.parse, this)
+  }, this)
+
+  this.debug(this.pattern, set)
+
+  // filter out everything that didn't compile properly.
+  set = set.filter(function (s) {
+    return s.indexOf(false) === -1
+  })
+
+  this.debug(this.pattern, set)
+
+  this.set = set
+}
+
+Minimatch.prototype.parseNegate = parseNegate
+function parseNegate () {
+  var pattern = this.pattern
+  var negate = false
+  var options = this.options
+  var negateOffset = 0
+
+  if (options.nonegate) return
+
+  for (var i = 0, l = pattern.length
+    ; i < l && pattern.charAt(i) === '!'
+    ; i++) {
+    negate = !negate
+    negateOffset++
+  }
+
+  if (negateOffset) this.pattern = pattern.substr(negateOffset)
+  this.negate = negate
+}
+
+// Brace expansion:
+// a{b,c}d -> abd acd
+// a{b,}c -> abc ac
+// a{0..3}d -> a0d a1d a2d a3d
+// a{b,c{d,e}f}g -> abg acdfg acefg
+// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
+//
+// Invalid sets are not expanded.
+// a{2..}b -> a{2..}b
+// a{b}c -> a{b}c
+minimatch.braceExpand = function (pattern, options) {
+  return braceExpand(pattern, options)
+}
+
+Minimatch.prototype.braceExpand = braceExpand
+
+function braceExpand (pattern, options) {
+  if (!options) {
+    if (this instanceof Minimatch) {
+      options = this.options
+    } else {
+      options = {}
+    }
+  }
+
+  pattern = typeof pattern === 'undefined'
+    ? this.pattern : pattern
+
+  if (typeof pattern === 'undefined') {
+    throw new TypeError('undefined pattern')
+  }
+
+  if (options.nobrace ||
+    !pattern.match(/\{.*\}/)) {
+    // shortcut. no need to expand.
+    return [pattern]
+  }
+
+  return expand(pattern)
+}
+
+// parse a component of the expanded set.
+// At this point, no pattern may contain "/" in it
+// so we're going to return a 2d array, where each entry is the full
+// pattern, split on '/', and then turned into a regular expression.
+// A regexp is made at the end which joins each array with an
+// escaped /, and another full one which joins each regexp with |.
+//
+// Following the lead of Bash 4.1, note that "**" only has special meaning
+// when it is the *only* thing in a path portion.  Otherwise, any series
+// of * is equivalent to a single *.  Globstar behavior is enabled by
+// default, and can be disabled by setting options.noglobstar.
+Minimatch.prototype.parse = parse
+var SUBPARSE = {}
+function parse (pattern, isSub) {
+  if (pattern.length > 1024 * 64) {
+    throw new TypeError('pattern is too long')
+  }
+
+  var options = this.options
+
+  // shortcuts
+  if (!options.noglobstar && pattern === '**') return GLOBSTAR
+  if (pattern === '') return ''
+
+  var re = ''
+  var hasMagic = !!options.nocase
+  var escaping = false
+  // ? => one single character
+  var patternListStack = []
+  var negativeLists = []
+  var stateChar
+  var inClass = false
+  var reClassStart = -1
+  var classStart = -1
+  // . and .. never match anything that doesn't start with .,
+  // even when options.dot is set.
+  var patternStart = pattern.charAt(0) === '.' ? '' // anything
+  // not (start or / followed by . or .. followed by / or end)
+  : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))'
+  : '(?!\\.)'
+  var self = this
+
+  function clearStateChar () {
+    if (stateChar) {
+      // we had some state-tracking character
+      // that wasn't consumed by this pass.
+      switch (stateChar) {
+        case '*':
+          re += star
+          hasMagic = true
+        break
+        case '?':
+          re += qmark
+          hasMagic = true
+        break
+        default:
+          re += '\\' + stateChar
+        break
+      }
+      self.debug('clearStateChar %j %j', stateChar, re)
+      stateChar = false
+    }
+  }
+
+  for (var i = 0, len = pattern.length, c
+    ; (i < len) && (c = pattern.charAt(i))
+    ; i++) {
+    this.debug('%s\t%s %s %j', pattern, i, re, c)
+
+    // skip over any that are escaped.
+    if (escaping && reSpecials[c]) {
+      re += '\\' + c
+      escaping = false
+      continue
+    }
+
+    switch (c) {
+      case '/':
+        // completely not allowed, even escaped.
+        // Should already be path-split by now.
+        return false
+
+      case '\\':
+        clearStateChar()
+        escaping = true
+      continue
+
+      // the various stateChar values
+      // for the "extglob" stuff.
+      case '?':
+      case '*':
+      case '+':
+      case '@':
+      case '!':
+        this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c)
+
+        // all of those are literals inside a class, except that
+        // the glob [!a] means [^a] in regexp
+        if (inClass) {
+          this.debug('  in class')
+          if (c === '!' && i === classStart + 1) c = '^'
+          re += c
+          continue
+        }
+
+        // if we already have a stateChar, then it means
+        // that there was something like ** or +? in there.
+        // Handle the stateChar, then proceed with this one.
+        self.debug('call clearStateChar %j', stateChar)
+        clearStateChar()
+        stateChar = c
+        // if extglob is disabled, then +(asdf|foo) isn't a thing.
+        // just clear the statechar *now*, rather than even diving into
+        // the patternList stuff.
+        if (options.noext) clearStateChar()
+      continue
+
+      case '(':
+        if (inClass) {
+          re += '('
+          continue
+        }
+
+        if (!stateChar) {
+          re += '\\('
+          continue
+        }
+
+        patternListStack.push({
+          type: stateChar,
+          start: i - 1,
+          reStart: re.length,
+          open: plTypes[stateChar].open,
+          close: plTypes[stateChar].close
+        })
+        // negation is (?:(?!js)[^/]*)
+        re += stateChar === '!' ? '(?:(?!(?:' : '(?:'
+        this.debug('plType %j %j', stateChar, re)
+        stateChar = false
+      continue
+
+      case ')':
+        if (inClass || !patternListStack.length) {
+          re += '\\)'
+          continue
+        }
+
+        clearStateChar()
+        hasMagic = true
+        var pl = patternListStack.pop()
+        // negation is (?:(?!js)[^/]*)
+        // The others are (?:<pattern>)<type>
+        re += pl.close
+        if (pl.type === '!') {
+          negativeLists.push(pl)
+        }
+        pl.reEnd = re.length
+      continue
+
+      case '|':
+        if (inClass || !patternListStack.length || escaping) {
+          re += '\\|'
+          escaping = false
+          continue
+        }
+
+        clearStateChar()
+        re += '|'
+      continue
+
+      // these are mostly the same in regexp and glob
+      case '[':
+        // swallow any state-tracking char before the [
+        clearStateChar()
+
+        if (inClass) {
+          re += '\\' + c
+          continue
+        }
+
+        inClass = true
+        classStart = i
+        reClassStart = re.length
+        re += c
+      continue
+
+      case ']':
+        //  a right bracket shall lose its special
+        //  meaning and represent itself in
+        //  a bracket expression if it occurs
+        //  first in the list.  -- POSIX.2 2.8.3.2
+        if (i === classStart + 1 || !inClass) {
+          re += '\\' + c
+          escaping = false
+          continue
+        }
+
+        // handle the case where we left a class open.
+        // "[z-a]" is valid, equivalent to "\[z-a\]"
+        if (inClass) {
+          // split where the last [ was, make sure we don't have
+          // an invalid re. if so, re-walk the contents of the
+          // would-be class to re-translate any characters that
+          // were passed through as-is
+          // TODO: It would probably be faster to determine this
+          // without a try/catch and a new RegExp, but it's tricky
+          // to do safely.  For now, this is safe and works.
+          var cs = pattern.substring(classStart + 1, i)
+          try {
+            RegExp('[' + cs + ']')
+          } catch (er) {
+            // not a valid class!
+            var sp = this.parse(cs, SUBPARSE)
+            re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'
+            hasMagic = hasMagic || sp[1]
+            inClass = false
+            continue
+          }
+        }
+
+        // finish up the class.
+        hasMagic = true
+        inClass = false
+        re += c
+      continue
+
+      default:
+        // swallow any state char that wasn't consumed
+        clearStateChar()
+
+        if (escaping) {
+          // no need
+          escaping = false
+        } else if (reSpecials[c]
+          && !(c === '^' && inClass)) {
+          re += '\\'
+        }
+
+        re += c
+
+    } // switch
+  } // for
+
+  // handle the case where we left a class open.
+  // "[abc" is valid, equivalent to "\[abc"
+  if (inClass) {
+    // split where the last [ was, and escape it
+    // this is a huge pita.  We now have to re-walk
+    // the contents of the would-be class to re-translate
+    // any characters that were passed through as-is
+    cs = pattern.substr(classStart + 1)
+    sp = this.parse(cs, SUBPARSE)
+    re = re.substr(0, reClassStart) + '\\[' + sp[0]
+    hasMagic = hasMagic || sp[1]
+  }
+
+  // handle the case where we had a +( thing at the *end*
+  // of the pattern.
+  // each pattern list stack adds 3 chars, and we need to go through
+  // and escape any | chars that were passed through as-is for the regexp.
+  // Go through and escape them, taking care not to double-escape any
+  // | chars that were already escaped.
+  for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
+    var tail = re.slice(pl.reStart + pl.open.length)
+    this.debug('setting tail', re, pl)
+    // maybe some even number of \, then maybe 1 \, followed by a |
+    tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) {
+      if (!$2) {
+        // the | isn't already escaped, so escape it.
+        $2 = '\\'
+      }
+
+      // need to escape all those slashes *again*, without escaping the
+      // one that we need for escaping the | character.  As it works out,
+      // escaping an even number of slashes can be done by simply repeating
+      // it exactly after itself.  That's why this trick works.
+      //
+      // I am sorry that you have to see this.
+      return $1 + $1 + $2 + '|'
+    })
+
+    this.debug('tail=%j\n   %s', tail, tail, pl, re)
+    var t = pl.type === '*' ? star
+      : pl.type === '?' ? qmark
+      : '\\' + pl.type
+
+    hasMagic = true
+    re = re.slice(0, pl.reStart) + t + '\\(' + tail
+  }
+
+  // handle trailing things that only matter at the very end.
+  clearStateChar()
+  if (escaping) {
+    // trailing \\
+    re += '\\\\'
+  }
+
+  // only need to apply the nodot start if the re starts with
+  // something that could conceivably capture a dot
+  var addPatternStart = false
+  switch (re.charAt(0)) {
+    case '.':
+    case '[':
+    case '(': addPatternStart = true
+  }
+
+  // Hack to work around lack of negative lookbehind in JS
+  // A pattern like: *.!(x).!(y|z) needs to ensure that a name
+  // like 'a.xyz.yz' doesn't match.  So, the first negative
+  // lookahead, has to look ALL the way ahead, to the end of
+  // the pattern.
+  for (var n = negativeLists.length - 1; n > -1; n--) {
+    var nl = negativeLists[n]
+
+    var nlBefore = re.slice(0, nl.reStart)
+    var nlFirst = re.slice(nl.reStart, nl.reEnd - 8)
+    var nlLast = re.slice(nl.reEnd - 8, nl.reEnd)
+    var nlAfter = re.slice(nl.reEnd)
+
+    nlLast += nlAfter
+
+    // Handle nested stuff like *(*.js|!(*.json)), where open parens
+    // mean that we should *not* include the ) in the bit that is considered
+    // "after" the negated section.
+    var openParensBefore = nlBefore.split('(').length - 1
+    var cleanAfter = nlAfter
+    for (i = 0; i < openParensBefore; i++) {
+      cleanAfter = cleanAfter.replace(/\)[+*?]?/, '')
+    }
+    nlAfter = cleanAfter
+
+    var dollar = ''
+    if (nlAfter === '' && isSub !== SUBPARSE) {
+      dollar = '$'
+    }
+    var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast
+    re = newRe
+  }
+
+  // if the re is not "" at this point, then we need to make sure
+  // it doesn't match against an empty path part.
+  // Otherwise a/* will match a/, which it should not.
+  if (re !== '' && hasMagic) {
+    re = '(?=.)' + re
+  }
+
+  if (addPatternStart) {
+    re = patternStart + re
+  }
+
+  // parsing just a piece of a larger pattern.
+  if (isSub === SUBPARSE) {
+    return [re, hasMagic]
+  }
+
+  // skip the regexp for non-magical patterns
+  // unescape anything in it, though, so that it'll be
+  // an exact match against a file etc.
+  if (!hasMagic) {
+    return globUnescape(pattern)
+  }
+
+  var flags = options.nocase ? 'i' : ''
+  try {
+    var regExp = new RegExp('^' + re + '$', flags)
+  } catch (er) {
+    // If it was an invalid regular expression, then it can't match
+    // anything.  This trick looks for a character after the end of
+    // the string, which is of course impossible, except in multi-line
+    // mode, but it's not a /m regex.
+    return new RegExp('$.')
+  }
+
+  regExp._glob = pattern
+  regExp._src = re
+
+  return regExp
+}
+
+minimatch.makeRe = function (pattern, options) {
+  return new Minimatch(pattern, options || {}).makeRe()
+}
+
+Minimatch.prototype.makeRe = makeRe
+function makeRe () {
+  if (this.regexp || this.regexp === false) return this.regexp
+
+  // at this point, this.set is a 2d array of partial
+  // pattern strings, or "**".
+  //
+  // It's better to use .match().  This function shouldn't
+  // be used, really, but it's pretty convenient sometimes,
+  // when you just want to work with a regex.
+  var set = this.set
+
+  if (!set.length) {
+    this.regexp = false
+    return this.regexp
+  }
+  var options = this.options
+
+  var twoStar = options.noglobstar ? star
+    : options.dot ? twoStarDot
+    : twoStarNoDot
+  var flags = options.nocase ? 'i' : ''
+
+  var re = set.map(function (pattern) {
+    return pattern.map(function (p) {
+      return (p === GLOBSTAR) ? twoStar
+      : (typeof p === 'string') ? regExpEscape(p)
+      : p._src
+    }).join('\\\/')
+  }).join('|')
+
+  // must match entire pattern
+  // ending in a * or ** will make it less strict.
+  re = '^(?:' + re + ')$'
+
+  // can match anything, as long as it's not this.
+  if (this.negate) re = '^(?!' + re + ').*$'
+
+  try {
+    this.regexp = new RegExp(re, flags)
+  } catch (ex) {
+    this.regexp = false
+  }
+  return this.regexp
+}
+
+minimatch.match = function (list, pattern, options) {
+  options = options || {}
+  var mm = new Minimatch(pattern, options)
+  list = list.filter(function (f) {
+    return mm.match(f)
+  })
+  if (mm.options.nonull && !list.length) {
+    list.push(pattern)
+  }
+  return list
+}
+
+Minimatch.prototype.match = match
+function match (f, partial) {
+  this.debug('match', f, this.pattern)
+  // short-circuit in the case of busted things.
+  // comments, etc.
+  if (this.comment) return false
+  if (this.empty) return f === ''
+
+  if (f === '/' && partial) return true
+
+  var options = this.options
+
+  // windows: need to use /, not \
+  if (path.sep !== '/') {
+    f = f.split(path.sep).join('/')
+  }
+
+  // treat the test path as a set of pathparts.
+  f = f.split(slashSplit)
+  this.debug(this.pattern, 'split', f)
+
+  // just ONE of the pattern sets in this.set needs to match
+  // in order for it to be valid.  If negating, then just one
+  // match means that we have failed.
+  // Either way, return on the first hit.
+
+  var set = this.set
+  this.debug(this.pattern, 'set', set)
+
+  // Find the basename of the path by looking for the last non-empty segment
+  var filename
+  var i
+  for (i = f.length - 1; i >= 0; i--) {
+    filename = f[i]
+    if (filename) break
+  }
+
+  for (i = 0; i < set.length; i++) {
+    var pattern = set[i]
+    var file = f
+    if (options.matchBase && pattern.length === 1) {
+      file = [filename]
+    }
+    var hit = this.matchOne(file, pattern, partial)
+    if (hit) {
+      if (options.flipNegate) return true
+      return !this.negate
+    }
+  }
+
+  // didn't get any hits.  this is success if it's a negative
+  // pattern, failure otherwise.
+  if (options.flipNegate) return false
+  return this.negate
+}
+
+// set partial to true to test if, for example,
+// "/a/b" matches the start of "/*/b/*/d"
+// Partial means, if you run out of file before you run
+// out of pattern, then that's fine, as long as all
+// the parts match.
+Minimatch.prototype.matchOne = function (file, pattern, partial) {
+  var options = this.options
+
+  this.debug('matchOne',
+    { 'this': this, file: file, pattern: pattern })
+
+  this.debug('matchOne', file.length, pattern.length)
+
+  for (var fi = 0,
+      pi = 0,
+      fl = file.length,
+      pl = pattern.length
+      ; (fi < fl) && (pi < pl)
+      ; fi++, pi++) {
+    this.debug('matchOne loop')
+    var p = pattern[pi]
+    var f = file[fi]
+
+    this.debug(pattern, p, f)
+
+    // should be impossible.
+    // some invalid regexp stuff in the set.
+    if (p === false) return false
+
+    if (p === GLOBSTAR) {
+      this.debug('GLOBSTAR', [pattern, p, f])
+
+      // "**"
+      // a/**/b/**/c would match the following:
+      // a/b/x/y/z/c
+      // a/x/y/z/b/c
+      // a/b/x/b/x/c
+      // a/b/c
+      // To do this, take the rest of the pattern after
+      // the **, and see if it would match the file remainder.
+      // If so, return success.
+      // If not, the ** "swallows" a segment, and try again.
+      // This is recursively awful.
+      //
+      // a/**/b/**/c matching a/b/x/y/z/c
+      // - a matches a
+      // - doublestar
+      //   - matchOne(b/x/y/z/c, b/**/c)
+      //     - b matches b
+      //     - doublestar
+      //       - matchOne(x/y/z/c, c) -> no
+      //       - matchOne(y/z/c, c) -> no
+      //       - matchOne(z/c, c) -> no
+      //       - matchOne(c, c) yes, hit
+      var fr = fi
+      var pr = pi + 1
+      if (pr === pl) {
+        this.debug('** at the end')
+        // a ** at the end will just swallow the rest.
+        // We have found a match.
+        // however, it will not swallow /.x, unless
+        // options.dot is set.
+        // . and .. are *never* matched by **, for explosively
+        // exponential reasons.
+        for (; fi < fl; fi++) {
+          if (file[fi] === '.' || file[fi] === '..' ||
+            (!options.dot && file[fi].charAt(0) === '.')) return false
+        }
+        return true
+      }
+
+      // ok, let's see if we can swallow whatever we can.
+      while (fr < fl) {
+        var swallowee = file[fr]
+
+        this.debug('\nglobstar while', file, fr, pattern, pr, swallowee)
+
+        // XXX remove this slice.  Just pass the start index.
+        if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
+          this.debug('globstar found match!', fr, fl, swallowee)
+          // found a match.
+          return true
+        } else {
+          // can't swallow "." or ".." ever.
+          // can only swallow ".foo" when explicitly asked.
+          if (swallowee === '.' || swallowee === '..' ||
+            (!options.dot && swallowee.charAt(0) === '.')) {
+            this.debug('dot detected!', file, fr, pattern, pr)
+            break
+          }
+
+          // ** swallows a segment, and continue.
+          this.debug('globstar swallow a segment, and continue')
+          fr++
+        }
+      }
+
+      // no match was found.
+      // However, in partial mode, we can't say this is necessarily over.
+      // If there's more *pattern* left, then
+      if (partial) {
+        // ran out of file
+        this.debug('\n>>> no match, partial?', file, fr, pattern, pr)
+        if (fr === fl) return true
+      }
+      return false
+    }
+
+    // something other than **
+    // non-magic patterns just have to match exactly
+    // patterns with magic have been turned into regexps.
+    var hit
+    if (typeof p === 'string') {
+      if (options.nocase) {
+        hit = f.toLowerCase() === p.toLowerCase()
+      } else {
+        hit = f === p
+      }
+      this.debug('string match', p, f, hit)
+    } else {
+      hit = f.match(p)
+      this.debug('pattern match', p, f, hit)
+    }
+
+    if (!hit) return false
+  }
+
+  // Note: ending in / means that we'll get a final ""
+  // at the end of the pattern.  This can only match a
+  // corresponding "" at the end of the file.
+  // If the file ends in /, then it can only match a
+  // a pattern that ends in /, unless the pattern just
+  // doesn't have any more for it. But, a/b/ should *not*
+  // match "a/b/*", even though "" matches against the
+  // [^/]*? pattern, except in partial mode, where it might
+  // simply not be reached yet.
+  // However, a/b/ should still satisfy a/*
+
+  // now either we fell off the end of the pattern, or we're done.
+  if (fi === fl && pi === pl) {
+    // ran out of pattern and filename at the same time.
+    // an exact hit!
+    return true
+  } else if (fi === fl) {
+    // ran out of file, but still had pattern left.
+    // this is ok if we're doing the match as part of
+    // a glob fs traversal.
+    return partial
+  } else if (pi === pl) {
+    // ran out of pattern, still have file left.
+    // this is only acceptable if we're on the very last
+    // empty segment of a file with a trailing slash.
+    // a/* should match a/b/
+    var emptyFileEnd = (fi === fl - 1) && (file[fi] === '')
+    return emptyFileEnd
+  }
+
+  // should be unreachable.
+  throw new Error('wtf?')
+}
+
+// replace stuff like \* with *
+function globUnescape (s) {
+  return s.replace(/\\(.)/g, '$1')
+}
+
+function regExpEscape (s) {
+  return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
+}
diff --git a/wrt/node_modules/minimatch/package.json b/wrt/node_modules/minimatch/package.json
new file mode 100644 (file)
index 0000000..74f5110
--- /dev/null
@@ -0,0 +1,67 @@
+{
+  "_from": "minimatch@2 || 3",
+  "_id": "minimatch@3.0.4",
+  "_inBundle": false,
+  "_integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
+  "_location": "/minimatch",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "minimatch@2 || 3",
+    "name": "minimatch",
+    "escapedName": "minimatch",
+    "rawSpec": "2 || 3",
+    "saveSpec": null,
+    "fetchSpec": "2 || 3"
+  },
+  "_requiredBy": [
+    "/coffeelint/glob",
+    "/glob",
+    "/node-gyp",
+    "/node-gyp/glob",
+    "/rimraf/glob"
+  ],
+  "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
+  "_shasum": "5166e286457f03306064be5497e8dbb0c3d32083",
+  "_spec": "minimatch@2 || 3",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was/node_modules/glob",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me"
+  },
+  "bugs": {
+    "url": "https://github.com/isaacs/minimatch/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {
+    "brace-expansion": "^1.1.7"
+  },
+  "deprecated": false,
+  "description": "a glob matcher in javascript",
+  "devDependencies": {
+    "tap": "^10.3.2"
+  },
+  "engines": {
+    "node": "*"
+  },
+  "files": [
+    "minimatch.js"
+  ],
+  "homepage": "https://github.com/isaacs/minimatch#readme",
+  "license": "ISC",
+  "main": "minimatch.js",
+  "name": "minimatch",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/minimatch.git"
+  },
+  "scripts": {
+    "postpublish": "git push origin --all; git push origin --tags",
+    "postversion": "npm publish",
+    "preversion": "npm test",
+    "test": "tap test/*.js --cov"
+  },
+  "version": "3.0.4"
+}
diff --git a/wrt/node_modules/minimist/.travis.yml b/wrt/node_modules/minimist/.travis.yml
new file mode 100644 (file)
index 0000000..cc4dba2
--- /dev/null
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+  - "0.8"
+  - "0.10"
diff --git a/wrt/node_modules/minimist/LICENSE b/wrt/node_modules/minimist/LICENSE
new file mode 100644 (file)
index 0000000..ee27ba4
--- /dev/null
@@ -0,0 +1,18 @@
+This software is released under the MIT license:
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/minimist/example/parse.js b/wrt/node_modules/minimist/example/parse.js
new file mode 100644 (file)
index 0000000..abff3e8
--- /dev/null
@@ -0,0 +1,2 @@
+var argv = require('../')(process.argv.slice(2));
+console.dir(argv);
diff --git a/wrt/node_modules/minimist/index.js b/wrt/node_modules/minimist/index.js
new file mode 100644 (file)
index 0000000..584f551
--- /dev/null
@@ -0,0 +1,187 @@
+module.exports = function (args, opts) {
+    if (!opts) opts = {};
+    
+    var flags = { bools : {}, strings : {} };
+    
+    [].concat(opts['boolean']).filter(Boolean).forEach(function (key) {
+        flags.bools[key] = true;
+    });
+    
+    [].concat(opts.string).filter(Boolean).forEach(function (key) {
+        flags.strings[key] = true;
+    });
+    
+    var aliases = {};
+    Object.keys(opts.alias || {}).forEach(function (key) {
+        aliases[key] = [].concat(opts.alias[key]);
+        aliases[key].forEach(function (x) {
+            aliases[x] = [key].concat(aliases[key].filter(function (y) {
+                return x !== y;
+            }));
+        });
+    });
+    
+    var defaults = opts['default'] || {};
+    
+    var argv = { _ : [] };
+    Object.keys(flags.bools).forEach(function (key) {
+        setArg(key, defaults[key] === undefined ? false : defaults[key]);
+    });
+    
+    var notFlags = [];
+
+    if (args.indexOf('--') !== -1) {
+        notFlags = args.slice(args.indexOf('--')+1);
+        args = args.slice(0, args.indexOf('--'));
+    }
+
+    function setArg (key, val) {
+        var value = !flags.strings[key] && isNumber(val)
+            ? Number(val) : val
+        ;
+        setKey(argv, key.split('.'), value);
+        
+        (aliases[key] || []).forEach(function (x) {
+            setKey(argv, x.split('.'), value);
+        });
+    }
+    
+    for (var i = 0; i < args.length; i++) {
+        var arg = args[i];
+        
+        if (/^--.+=/.test(arg)) {
+            // Using [\s\S] instead of . because js doesn't support the
+            // 'dotall' regex modifier. See:
+            // http://stackoverflow.com/a/1068308/13216
+            var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
+            setArg(m[1], m[2]);
+        }
+        else if (/^--no-.+/.test(arg)) {
+            var key = arg.match(/^--no-(.+)/)[1];
+            setArg(key, false);
+        }
+        else if (/^--.+/.test(arg)) {
+            var key = arg.match(/^--(.+)/)[1];
+            var next = args[i + 1];
+            if (next !== undefined && !/^-/.test(next)
+            && !flags.bools[key]
+            && (aliases[key] ? !flags.bools[aliases[key]] : true)) {
+                setArg(key, next);
+                i++;
+            }
+            else if (/^(true|false)$/.test(next)) {
+                setArg(key, next === 'true');
+                i++;
+            }
+            else {
+                setArg(key, flags.strings[key] ? '' : true);
+            }
+        }
+        else if (/^-[^-]+/.test(arg)) {
+            var letters = arg.slice(1,-1).split('');
+            
+            var broken = false;
+            for (var j = 0; j < letters.length; j++) {
+                var next = arg.slice(j+2);
+                
+                if (next === '-') {
+                    setArg(letters[j], next)
+                    continue;
+                }
+                
+                if (/[A-Za-z]/.test(letters[j])
+                && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
+                    setArg(letters[j], next);
+                    broken = true;
+                    break;
+                }
+                
+                if (letters[j+1] && letters[j+1].match(/\W/)) {
+                    setArg(letters[j], arg.slice(j+2));
+                    broken = true;
+                    break;
+                }
+                else {
+                    setArg(letters[j], flags.strings[letters[j]] ? '' : true);
+                }
+            }
+            
+            var key = arg.slice(-1)[0];
+            if (!broken && key !== '-') {
+                if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1])
+                && !flags.bools[key]
+                && (aliases[key] ? !flags.bools[aliases[key]] : true)) {
+                    setArg(key, args[i+1]);
+                    i++;
+                }
+                else if (args[i+1] && /true|false/.test(args[i+1])) {
+                    setArg(key, args[i+1] === 'true');
+                    i++;
+                }
+                else {
+                    setArg(key, flags.strings[key] ? '' : true);
+                }
+            }
+        }
+        else {
+            argv._.push(
+                flags.strings['_'] || !isNumber(arg) ? arg : Number(arg)
+            );
+        }
+    }
+    
+    Object.keys(defaults).forEach(function (key) {
+        if (!hasKey(argv, key.split('.'))) {
+            setKey(argv, key.split('.'), defaults[key]);
+            
+            (aliases[key] || []).forEach(function (x) {
+                setKey(argv, x.split('.'), defaults[key]);
+            });
+        }
+    });
+    
+    notFlags.forEach(function(key) {
+        argv._.push(key);
+    });
+
+    return argv;
+};
+
+function hasKey (obj, keys) {
+    var o = obj;
+    keys.slice(0,-1).forEach(function (key) {
+        o = (o[key] || {});
+    });
+
+    var key = keys[keys.length - 1];
+    return key in o;
+}
+
+function setKey (obj, keys, value) {
+    var o = obj;
+    keys.slice(0,-1).forEach(function (key) {
+        if (o[key] === undefined) o[key] = {};
+        o = o[key];
+    });
+    
+    var key = keys[keys.length - 1];
+    if (o[key] === undefined || typeof o[key] === 'boolean') {
+        o[key] = value;
+    }
+    else if (Array.isArray(o[key])) {
+        o[key].push(value);
+    }
+    else {
+        o[key] = [ o[key], value ];
+    }
+}
+
+function isNumber (x) {
+    if (typeof x === 'number') return true;
+    if (/^0x[0-9a-f]+$/i.test(x)) return true;
+    return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
+}
+
+function longest (xs) {
+    return Math.max.apply(null, xs.map(function (x) { return x.length }));
+}
diff --git a/wrt/node_modules/minimist/package.json b/wrt/node_modules/minimist/package.json
new file mode 100644 (file)
index 0000000..4fda080
--- /dev/null
@@ -0,0 +1,72 @@
+{
+  "_from": "minimist@0.0.8",
+  "_id": "minimist@0.0.8",
+  "_inBundle": false,
+  "_integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
+  "_location": "/minimist",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "minimist@0.0.8",
+    "name": "minimist",
+    "escapedName": "minimist",
+    "rawSpec": "0.0.8",
+    "saveSpec": null,
+    "fetchSpec": "0.0.8"
+  },
+  "_requiredBy": [
+    "/mkdirp",
+    "/optimist"
+  ],
+  "_resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
+  "_shasum": "857fcabfc3397d2625b8228262e86aa7a011b05d",
+  "_spec": "minimist@0.0.8",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was/node_modules/mkdirp",
+  "author": {
+    "name": "James Halliday",
+    "email": "mail@substack.net",
+    "url": "http://substack.net"
+  },
+  "bugs": {
+    "url": "https://github.com/substack/minimist/issues"
+  },
+  "bundleDependencies": false,
+  "deprecated": false,
+  "description": "parse argument options",
+  "devDependencies": {
+    "tap": "~0.4.0",
+    "tape": "~1.0.4"
+  },
+  "homepage": "https://github.com/substack/minimist",
+  "keywords": [
+    "argv",
+    "getopt",
+    "parser",
+    "optimist"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "name": "minimist",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/substack/minimist.git"
+  },
+  "scripts": {
+    "test": "tap test/*.js"
+  },
+  "testling": {
+    "files": "test/*.js",
+    "browsers": [
+      "ie/6..latest",
+      "ff/5",
+      "firefox/latest",
+      "chrome/10",
+      "chrome/latest",
+      "safari/5.1",
+      "safari/latest",
+      "opera/12"
+    ]
+  },
+  "version": "0.0.8"
+}
diff --git a/wrt/node_modules/minimist/readme.markdown b/wrt/node_modules/minimist/readme.markdown
new file mode 100644 (file)
index 0000000..c256353
--- /dev/null
@@ -0,0 +1,73 @@
+# minimist
+
+parse argument options
+
+This module is the guts of optimist's argument parser without all the
+fanciful decoration.
+
+[![browser support](https://ci.testling.com/substack/minimist.png)](http://ci.testling.com/substack/minimist)
+
+[![build status](https://secure.travis-ci.org/substack/minimist.png)](http://travis-ci.org/substack/minimist)
+
+# example
+
+``` js
+var argv = require('minimist')(process.argv.slice(2));
+console.dir(argv);
+```
+
+```
+$ node example/parse.js -a beep -b boop
+{ _: [], a: 'beep', b: 'boop' }
+```
+
+```
+$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz
+{ _: [ 'foo', 'bar', 'baz' ],
+  x: 3,
+  y: 4,
+  n: 5,
+  a: true,
+  b: true,
+  c: true,
+  beep: 'boop' }
+```
+
+# methods
+
+``` js
+var parseArgs = require('minimist')
+```
+
+## var argv = parseArgs(args, opts={})
+
+Return an argument object `argv` populated with the array arguments from `args`.
+
+`argv._` contains all the arguments that didn't have an option associated with
+them.
+
+Numeric-looking arguments will be returned as numbers unless `opts.string` or
+`opts.boolean` is set for that argument name.
+
+Any arguments after `'--'` will not be parsed and will end up in `argv._`.
+
+options can be:
+
+* `opts.string` - a string or array of strings argument names to always treat as
+strings
+* `opts.boolean` - a string or array of strings to always treat as booleans
+* `opts.alias` - an object mapping string names to strings or arrays of string
+argument names to use as aliases
+* `opts.default` - an object mapping string argument names to default values
+
+# install
+
+With [npm](https://npmjs.org) do:
+
+```
+npm install minimist
+```
+
+# license
+
+MIT
diff --git a/wrt/node_modules/minimist/test/dash.js b/wrt/node_modules/minimist/test/dash.js
new file mode 100644 (file)
index 0000000..8b034b9
--- /dev/null
@@ -0,0 +1,24 @@
+var parse = require('../');
+var test = require('tape');
+
+test('-', function (t) {
+    t.plan(5);
+    t.deepEqual(parse([ '-n', '-' ]), { n: '-', _: [] });
+    t.deepEqual(parse([ '-' ]), { _: [ '-' ] });
+    t.deepEqual(parse([ '-f-' ]), { f: '-', _: [] });
+    t.deepEqual(
+        parse([ '-b', '-' ], { boolean: 'b' }),
+        { b: true, _: [ '-' ] }
+    );
+    t.deepEqual(
+        parse([ '-s', '-' ], { string: 's' }),
+        { s: '-', _: [] }
+    );
+});
+
+test('-a -- b', function (t) {
+    t.plan(3);
+    t.deepEqual(parse([ '-a', '--', 'b' ]), { a: true, _: [ 'b' ] });
+    t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] });
+    t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] });
+});
diff --git a/wrt/node_modules/minimist/test/default_bool.js b/wrt/node_modules/minimist/test/default_bool.js
new file mode 100644 (file)
index 0000000..f0041ee
--- /dev/null
@@ -0,0 +1,20 @@
+var test = require('tape');
+var parse = require('../');
+
+test('boolean default true', function (t) {
+    var argv = parse([], {
+        boolean: 'sometrue',
+        default: { sometrue: true }
+    });
+    t.equal(argv.sometrue, true);
+    t.end();
+});
+
+test('boolean default false', function (t) {
+    var argv = parse([], {
+        boolean: 'somefalse',
+        default: { somefalse: false }
+    });
+    t.equal(argv.somefalse, false);
+    t.end();
+});
diff --git a/wrt/node_modules/minimist/test/dotted.js b/wrt/node_modules/minimist/test/dotted.js
new file mode 100644 (file)
index 0000000..ef0ae34
--- /dev/null
@@ -0,0 +1,16 @@
+var parse = require('../');
+var test = require('tape');
+
+test('dotted alias', function (t) {
+    var argv = parse(['--a.b', '22'], {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}});
+    t.equal(argv.a.b, 22);
+    t.equal(argv.aa.bb, 22);
+    t.end();
+});
+
+test('dotted default', function (t) {
+    var argv = parse('', {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}});
+    t.equal(argv.a.b, 11);
+    t.equal(argv.aa.bb, 11);
+    t.end();
+});
diff --git a/wrt/node_modules/minimist/test/long.js b/wrt/node_modules/minimist/test/long.js
new file mode 100644 (file)
index 0000000..5d3a1e0
--- /dev/null
@@ -0,0 +1,31 @@
+var test = require('tape');
+var parse = require('../');
+
+test('long opts', function (t) {
+    t.deepEqual(
+        parse([ '--bool' ]),
+        { bool : true, _ : [] },
+        'long boolean'
+    );
+    t.deepEqual(
+        parse([ '--pow', 'xixxle' ]),
+        { pow : 'xixxle', _ : [] },
+        'long capture sp'
+    );
+    t.deepEqual(
+        parse([ '--pow=xixxle' ]),
+        { pow : 'xixxle', _ : [] },
+        'long capture eq'
+    );
+    t.deepEqual(
+        parse([ '--host', 'localhost', '--port', '555' ]),
+        { host : 'localhost', port : 555, _ : [] },
+        'long captures sp'
+    );
+    t.deepEqual(
+        parse([ '--host=localhost', '--port=555' ]),
+        { host : 'localhost', port : 555, _ : [] },
+        'long captures eq'
+    );
+    t.end();
+});
diff --git a/wrt/node_modules/minimist/test/parse.js b/wrt/node_modules/minimist/test/parse.js
new file mode 100644 (file)
index 0000000..8a90646
--- /dev/null
@@ -0,0 +1,318 @@
+var parse = require('../');
+var test = require('tape');
+
+test('parse args', function (t) {
+    t.deepEqual(
+        parse([ '--no-moo' ]),
+        { moo : false, _ : [] },
+        'no'
+    );
+    t.deepEqual(
+        parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]),
+        { v : ['a','b','c'], _ : [] },
+        'multi'
+    );
+    t.end();
+});
+test('comprehensive', function (t) {
+    t.deepEqual(
+        parse([
+            '--name=meowmers', 'bare', '-cats', 'woo',
+            '-h', 'awesome', '--multi=quux',
+            '--key', 'value',
+            '-b', '--bool', '--no-meep', '--multi=baz',
+            '--', '--not-a-flag', 'eek'
+        ]),
+        {
+            c : true,
+            a : true,
+            t : true,
+            s : 'woo',
+            h : 'awesome',
+            b : true,
+            bool : true,
+            key : 'value',
+            multi : [ 'quux', 'baz' ],
+            meep : false,
+            name : 'meowmers',
+            _ : [ 'bare', '--not-a-flag', 'eek' ]
+        }
+    );
+    t.end();
+});
+
+test('nums', function (t) {
+    var argv = parse([
+        '-x', '1234',
+        '-y', '5.67',
+        '-z', '1e7',
+        '-w', '10f',
+        '--hex', '0xdeadbeef',
+        '789'
+    ]);
+    t.deepEqual(argv, {
+        x : 1234,
+        y : 5.67,
+        z : 1e7,
+        w : '10f',
+        hex : 0xdeadbeef,
+        _ : [ 789 ]
+    });
+    t.deepEqual(typeof argv.x, 'number');
+    t.deepEqual(typeof argv.y, 'number');
+    t.deepEqual(typeof argv.z, 'number');
+    t.deepEqual(typeof argv.w, 'string');
+    t.deepEqual(typeof argv.hex, 'number');
+    t.deepEqual(typeof argv._[0], 'number');
+    t.end();
+});
+
+test('flag boolean', function (t) {
+    var argv = parse([ '-t', 'moo' ], { boolean: 't' });
+    t.deepEqual(argv, { t : true, _ : [ 'moo' ] });
+    t.deepEqual(typeof argv.t, 'boolean');
+    t.end();
+});
+
+test('flag boolean value', function (t) {
+    var argv = parse(['--verbose', 'false', 'moo', '-t', 'true'], {
+        boolean: [ 't', 'verbose' ],
+        default: { verbose: true }
+    });
+    
+    t.deepEqual(argv, {
+        verbose: false,
+        t: true,
+        _: ['moo']
+    });
+    
+    t.deepEqual(typeof argv.verbose, 'boolean');
+    t.deepEqual(typeof argv.t, 'boolean');
+    t.end();
+});
+
+test('flag boolean default false', function (t) {
+    var argv = parse(['moo'], {
+        boolean: ['t', 'verbose'],
+        default: { verbose: false, t: false }
+    });
+    
+    t.deepEqual(argv, {
+        verbose: false,
+        t: false,
+        _: ['moo']
+    });
+    
+    t.deepEqual(typeof argv.verbose, 'boolean');
+    t.deepEqual(typeof argv.t, 'boolean');
+    t.end();
+
+});
+
+test('boolean groups', function (t) {
+    var argv = parse([ '-x', '-z', 'one', 'two', 'three' ], {
+        boolean: ['x','y','z']
+    });
+    
+    t.deepEqual(argv, {
+        x : true,
+        y : false,
+        z : true,
+        _ : [ 'one', 'two', 'three' ]
+    });
+    
+    t.deepEqual(typeof argv.x, 'boolean');
+    t.deepEqual(typeof argv.y, 'boolean');
+    t.deepEqual(typeof argv.z, 'boolean');
+    t.end();
+});
+
+test('newlines in params' , function (t) {
+    var args = parse([ '-s', "X\nX" ])
+    t.deepEqual(args, { _ : [], s : "X\nX" });
+    
+    // reproduce in bash:
+    // VALUE="new
+    // line"
+    // node program.js --s="$VALUE"
+    args = parse([ "--s=X\nX" ])
+    t.deepEqual(args, { _ : [], s : "X\nX" });
+    t.end();
+});
+
+test('strings' , function (t) {
+    var s = parse([ '-s', '0001234' ], { string: 's' }).s;
+    t.equal(s, '0001234');
+    t.equal(typeof s, 'string');
+    
+    var x = parse([ '-x', '56' ], { string: 'x' }).x;
+    t.equal(x, '56');
+    t.equal(typeof x, 'string');
+    t.end();
+});
+
+test('stringArgs', function (t) {
+    var s = parse([ '  ', '  ' ], { string: '_' })._;
+    t.same(s.length, 2);
+    t.same(typeof s[0], 'string');
+    t.same(s[0], '  ');
+    t.same(typeof s[1], 'string');
+    t.same(s[1], '  ');
+    t.end();
+});
+
+test('empty strings', function(t) {
+    var s = parse([ '-s' ], { string: 's' }).s;
+    t.equal(s, '');
+    t.equal(typeof s, 'string');
+
+    var str = parse([ '--str' ], { string: 'str' }).str;
+    t.equal(str, '');
+    t.equal(typeof str, 'string');
+
+    var letters = parse([ '-art' ], {
+        string: [ 'a', 't' ]
+    });
+
+    t.equal(letters.a, '');
+    t.equal(letters.r, true);
+    t.equal(letters.t, '');
+
+    t.end();
+});
+
+
+test('slashBreak', function (t) {
+    t.same(
+        parse([ '-I/foo/bar/baz' ]),
+        { I : '/foo/bar/baz', _ : [] }
+    );
+    t.same(
+        parse([ '-xyz/foo/bar/baz' ]),
+        { x : true, y : true, z : '/foo/bar/baz', _ : [] }
+    );
+    t.end();
+});
+
+test('alias', function (t) {
+    var argv = parse([ '-f', '11', '--zoom', '55' ], {
+        alias: { z: 'zoom' }
+    });
+    t.equal(argv.zoom, 55);
+    t.equal(argv.z, argv.zoom);
+    t.equal(argv.f, 11);
+    t.end();
+});
+
+test('multiAlias', function (t) {
+    var argv = parse([ '-f', '11', '--zoom', '55' ], {
+        alias: { z: [ 'zm', 'zoom' ] }
+    });
+    t.equal(argv.zoom, 55);
+    t.equal(argv.z, argv.zoom);
+    t.equal(argv.z, argv.zm);
+    t.equal(argv.f, 11);
+    t.end();
+});
+
+test('nested dotted objects', function (t) {
+    var argv = parse([
+        '--foo.bar', '3', '--foo.baz', '4',
+        '--foo.quux.quibble', '5', '--foo.quux.o_O',
+        '--beep.boop'
+    ]);
+    
+    t.same(argv.foo, {
+        bar : 3,
+        baz : 4,
+        quux : {
+            quibble : 5,
+            o_O : true
+        }
+    });
+    t.same(argv.beep, { boop : true });
+    t.end();
+});
+
+test('boolean and alias with chainable api', function (t) {
+    var aliased = [ '-h', 'derp' ];
+    var regular = [ '--herp',  'derp' ];
+    var opts = {
+        herp: { alias: 'h', boolean: true }
+    };
+    var aliasedArgv = parse(aliased, {
+        boolean: 'herp',
+        alias: { h: 'herp' }
+    });
+    var propertyArgv = parse(regular, {
+        boolean: 'herp',
+        alias: { h: 'herp' }
+    });
+    var expected = {
+        herp: true,
+        h: true,
+        '_': [ 'derp' ]
+    };
+    
+    t.same(aliasedArgv, expected);
+    t.same(propertyArgv, expected); 
+    t.end();
+});
+
+test('boolean and alias with options hash', function (t) {
+    var aliased = [ '-h', 'derp' ];
+    var regular = [ '--herp', 'derp' ];
+    var opts = {
+        alias: { 'h': 'herp' },
+        boolean: 'herp'
+    };
+    var aliasedArgv = parse(aliased, opts);
+    var propertyArgv = parse(regular, opts);
+    var expected = {
+        herp: true,
+        h: true,
+        '_': [ 'derp' ]
+    };
+    t.same(aliasedArgv, expected);
+    t.same(propertyArgv, expected);
+    t.end();
+});
+
+test('boolean and alias using explicit true', function (t) {
+    var aliased = [ '-h', 'true' ];
+    var regular = [ '--herp',  'true' ];
+    var opts = {
+        alias: { h: 'herp' },
+        boolean: 'h'
+    };
+    var aliasedArgv = parse(aliased, opts);
+    var propertyArgv = parse(regular, opts);
+    var expected = {
+        herp: true,
+        h: true,
+        '_': [ ]
+    };
+
+    t.same(aliasedArgv, expected);
+    t.same(propertyArgv, expected); 
+    t.end();
+});
+
+// regression, see https://github.com/substack/node-optimist/issues/71
+test('boolean and --x=true', function(t) {
+    var parsed = parse(['--boool', '--other=true'], {
+        boolean: 'boool'
+    });
+
+    t.same(parsed.boool, true);
+    t.same(parsed.other, 'true');
+
+    parsed = parse(['--boool', '--other=false'], {
+        boolean: 'boool'
+    });
+    
+    t.same(parsed.boool, true);
+    t.same(parsed.other, 'false');
+    t.end();
+});
diff --git a/wrt/node_modules/minimist/test/parse_modified.js b/wrt/node_modules/minimist/test/parse_modified.js
new file mode 100644 (file)
index 0000000..21851b0
--- /dev/null
@@ -0,0 +1,9 @@
+var parse = require('../');
+var test = require('tape');
+
+test('parse with modifier functions' , function (t) {
+    t.plan(1);
+    
+    var argv = parse([ '-b', '123' ], { boolean: 'b' });
+    t.deepEqual(argv, { b: true, _: ['123'] });
+});
diff --git a/wrt/node_modules/minimist/test/short.js b/wrt/node_modules/minimist/test/short.js
new file mode 100644 (file)
index 0000000..d513a1c
--- /dev/null
@@ -0,0 +1,67 @@
+var parse = require('../');
+var test = require('tape');
+
+test('numeric short args', function (t) {
+    t.plan(2);
+    t.deepEqual(parse([ '-n123' ]), { n: 123, _: [] });
+    t.deepEqual(
+        parse([ '-123', '456' ]),
+        { 1: true, 2: true, 3: 456, _: [] }
+    );
+});
+
+test('short', function (t) {
+    t.deepEqual(
+        parse([ '-b' ]),
+        { b : true, _ : [] },
+        'short boolean'
+    );
+    t.deepEqual(
+        parse([ 'foo', 'bar', 'baz' ]),
+        { _ : [ 'foo', 'bar', 'baz' ] },
+        'bare'
+    );
+    t.deepEqual(
+        parse([ '-cats' ]),
+        { c : true, a : true, t : true, s : true, _ : [] },
+        'group'
+    );
+    t.deepEqual(
+        parse([ '-cats', 'meow' ]),
+        { c : true, a : true, t : true, s : 'meow', _ : [] },
+        'short group next'
+    );
+    t.deepEqual(
+        parse([ '-h', 'localhost' ]),
+        { h : 'localhost', _ : [] },
+        'short capture'
+    );
+    t.deepEqual(
+        parse([ '-h', 'localhost', '-p', '555' ]),
+        { h : 'localhost', p : 555, _ : [] },
+        'short captures'
+    );
+    t.end();
+});
+test('mixed short bool and capture', function (t) {
+    t.same(
+        parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]),
+        {
+            f : true, p : 555, h : 'localhost',
+            _ : [ 'script.js' ]
+        }
+    );
+    t.end();
+});
+test('short and long', function (t) {
+    t.deepEqual(
+        parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]),
+        {
+            f : true, p : 555, h : 'localhost',
+            _ : [ 'script.js' ]
+        }
+    );
+    t.end();
+});
diff --git a/wrt/node_modules/minimist/test/whitespace.js b/wrt/node_modules/minimist/test/whitespace.js
new file mode 100644 (file)
index 0000000..8a52a58
--- /dev/null
@@ -0,0 +1,8 @@
+var parse = require('../');
+var test = require('tape');
+
+test('whitespace should be whitespace' , function (t) {
+    t.plan(1);
+    var x = parse([ '-x', '\t' ]).x;
+    t.equal(x, '\t');
+});
diff --git a/wrt/node_modules/mkdirp/.travis.yml b/wrt/node_modules/mkdirp/.travis.yml
new file mode 100644 (file)
index 0000000..74c57bf
--- /dev/null
@@ -0,0 +1,8 @@
+language: node_js
+node_js:
+  - "0.8"
+  - "0.10"
+  - "0.12"
+  - "iojs"
+before_install:
+  - npm install -g npm@~1.4.6
diff --git a/wrt/node_modules/mkdirp/LICENSE b/wrt/node_modules/mkdirp/LICENSE
new file mode 100644 (file)
index 0000000..432d1ae
--- /dev/null
@@ -0,0 +1,21 @@
+Copyright 2010 James Halliday (mail@substack.net)
+
+This project is free software released under the MIT/X11 license:
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/mkdirp/examples/pow.js b/wrt/node_modules/mkdirp/examples/pow.js
new file mode 100644 (file)
index 0000000..e692421
--- /dev/null
@@ -0,0 +1,6 @@
+var mkdirp = require('mkdirp');
+
+mkdirp('/tmp/foo/bar/baz', function (err) {
+    if (err) console.error(err)
+    else console.log('pow!')
+});
diff --git a/wrt/node_modules/mkdirp/index.js b/wrt/node_modules/mkdirp/index.js
new file mode 100644 (file)
index 0000000..6ce241b
--- /dev/null
@@ -0,0 +1,98 @@
+var path = require('path');
+var fs = require('fs');
+var _0777 = parseInt('0777', 8);
+
+module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
+
+function mkdirP (p, opts, f, made) {
+    if (typeof opts === 'function') {
+        f = opts;
+        opts = {};
+    }
+    else if (!opts || typeof opts !== 'object') {
+        opts = { mode: opts };
+    }
+    
+    var mode = opts.mode;
+    var xfs = opts.fs || fs;
+    
+    if (mode === undefined) {
+        mode = _0777 & (~process.umask());
+    }
+    if (!made) made = null;
+    
+    var cb = f || function () {};
+    p = path.resolve(p);
+    
+    xfs.mkdir(p, mode, function (er) {
+        if (!er) {
+            made = made || p;
+            return cb(null, made);
+        }
+        switch (er.code) {
+            case 'ENOENT':
+                mkdirP(path.dirname(p), opts, function (er, made) {
+                    if (er) cb(er, made);
+                    else mkdirP(p, opts, cb, made);
+                });
+                break;
+
+            // In the case of any other error, just see if there's a dir
+            // there already.  If so, then hooray!  If not, then something
+            // is borked.
+            default:
+                xfs.stat(p, function (er2, stat) {
+                    // if the stat fails, then that's super weird.
+                    // let the original error be the failure reason.
+                    if (er2 || !stat.isDirectory()) cb(er, made)
+                    else cb(null, made);
+                });
+                break;
+        }
+    });
+}
+
+mkdirP.sync = function sync (p, opts, made) {
+    if (!opts || typeof opts !== 'object') {
+        opts = { mode: opts };
+    }
+    
+    var mode = opts.mode;
+    var xfs = opts.fs || fs;
+    
+    if (mode === undefined) {
+        mode = _0777 & (~process.umask());
+    }
+    if (!made) made = null;
+
+    p = path.resolve(p);
+
+    try {
+        xfs.mkdirSync(p, mode);
+        made = made || p;
+    }
+    catch (err0) {
+        switch (err0.code) {
+            case 'ENOENT' :
+                made = sync(path.dirname(p), opts, made);
+                sync(p, opts, made);
+                break;
+
+            // In the case of any other error, just see if there's a dir
+            // there already.  If so, then hooray!  If not, then something
+            // is borked.
+            default:
+                var stat;
+                try {
+                    stat = xfs.statSync(p);
+                }
+                catch (err1) {
+                    throw err0;
+                }
+                if (!stat.isDirectory()) throw err0;
+                break;
+        }
+    }
+
+    return made;
+};
diff --git a/wrt/node_modules/mkdirp/package.json b/wrt/node_modules/mkdirp/package.json
new file mode 100644 (file)
index 0000000..d27c460
--- /dev/null
@@ -0,0 +1,67 @@
+{
+  "_from": "mkdirp@~0.5.1",
+  "_id": "mkdirp@0.5.1",
+  "_inBundle": false,
+  "_integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
+  "_location": "/mkdirp",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "mkdirp@~0.5.1",
+    "name": "mkdirp",
+    "escapedName": "mkdirp",
+    "rawSpec": "~0.5.1",
+    "saveSpec": null,
+    "fetchSpec": "~0.5.1"
+  },
+  "_requiredBy": [
+    "/asar",
+    "/fs-plus",
+    "/fstream",
+    "/mv",
+    "/node-gyp",
+    "/unzip/fstream"
+  ],
+  "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
+  "_shasum": "30057438eac6cf7f8c4767f38648d6697d75c903",
+  "_spec": "mkdirp@~0.5.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was/node_modules/mv",
+  "author": {
+    "name": "James Halliday",
+    "email": "mail@substack.net",
+    "url": "http://substack.net"
+  },
+  "bin": {
+    "mkdirp": "bin/cmd.js"
+  },
+  "bugs": {
+    "url": "https://github.com/substack/node-mkdirp/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {
+    "minimist": "0.0.8"
+  },
+  "deprecated": false,
+  "description": "Recursively mkdir, like `mkdir -p`",
+  "devDependencies": {
+    "mock-fs": "2 >=2.7.0",
+    "tap": "1"
+  },
+  "homepage": "https://github.com/substack/node-mkdirp#readme",
+  "keywords": [
+    "mkdir",
+    "directory"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "name": "mkdirp",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/substack/node-mkdirp.git"
+  },
+  "scripts": {
+    "test": "tap test/*.js"
+  },
+  "version": "0.5.1"
+}
diff --git a/wrt/node_modules/mkdirp/readme.markdown b/wrt/node_modules/mkdirp/readme.markdown
new file mode 100644 (file)
index 0000000..3cc1315
--- /dev/null
@@ -0,0 +1,100 @@
+# mkdirp
+
+Like `mkdir -p`, but in node.js!
+
+[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp)
+
+# example
+
+## pow.js
+
+```js
+var mkdirp = require('mkdirp');
+    
+mkdirp('/tmp/foo/bar/baz', function (err) {
+    if (err) console.error(err)
+    else console.log('pow!')
+});
+```
+
+Output
+
+```
+pow!
+```
+
+And now /tmp/foo/bar/baz exists, huzzah!
+
+# methods
+
+```js
+var mkdirp = require('mkdirp');
+```
+
+## mkdirp(dir, opts, cb)
+
+Create a new directory and any necessary subdirectories at `dir` with octal
+permission string `opts.mode`. If `opts` is a non-object, it will be treated as
+the `opts.mode`.
+
+If `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`.
+
+`cb(err, made)` fires with the error or the first directory `made`
+that had to be created, if any.
+
+You can optionally pass in an alternate `fs` implementation by passing in
+`opts.fs`. Your implementation should have `opts.fs.mkdir(path, mode, cb)` and
+`opts.fs.stat(path, cb)`.
+
+## mkdirp.sync(dir, opts)
+
+Synchronously create a new directory and any necessary subdirectories at `dir`
+with octal permission string `opts.mode`. If `opts` is a non-object, it will be
+treated as the `opts.mode`.
+
+If `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`.
+
+Returns the first directory that had to be created, if any.
+
+You can optionally pass in an alternate `fs` implementation by passing in
+`opts.fs`. Your implementation should have `opts.fs.mkdirSync(path, mode)` and
+`opts.fs.statSync(path)`.
+
+# usage
+
+This package also ships with a `mkdirp` command.
+
+```
+usage: mkdirp [DIR1,DIR2..] {OPTIONS}
+
+  Create each supplied directory including any necessary parent directories that
+  don't yet exist.
+  
+  If the directory already exists, do nothing.
+
+OPTIONS are:
+
+  -m, --mode   If a directory needs to be created, set the mode as an octal
+               permission string.
+
+```
+
+# install
+
+With [npm](http://npmjs.org) do:
+
+```
+npm install mkdirp
+```
+
+to get the library, or
+
+```
+npm install -g mkdirp
+```
+
+to get the command.
+
+# license
+
+MIT
diff --git a/wrt/node_modules/mkdirp/test/chmod.js b/wrt/node_modules/mkdirp/test/chmod.js
new file mode 100644 (file)
index 0000000..6a404b9
--- /dev/null
@@ -0,0 +1,41 @@
+var mkdirp = require('../').mkdirp;
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
+var _0744 = parseInt('0744', 8);
+
+var ps = [ '', 'tmp' ];
+
+for (var i = 0; i < 25; i++) {
+    var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    ps.push(dir);
+}
+
+var file = ps.join('/');
+
+test('chmod-pre', function (t) {
+    var mode = _0744
+    mkdirp(file, mode, function (er) {
+        t.ifError(er, 'should not error');
+        fs.stat(file, function (er, stat) {
+            t.ifError(er, 'should exist');
+            t.ok(stat && stat.isDirectory(), 'should be directory');
+            t.equal(stat && stat.mode & _0777, mode, 'should be 0744');
+            t.end();
+        });
+    });
+});
+
+test('chmod', function (t) {
+    var mode = _0755
+    mkdirp(file, mode, function (er) {
+        t.ifError(er, 'should not error');
+        fs.stat(file, function (er, stat) {
+            t.ifError(er, 'should exist');
+            t.ok(stat && stat.isDirectory(), 'should be directory');
+            t.end();
+        });
+    });
+});
diff --git a/wrt/node_modules/mkdirp/test/clobber.js b/wrt/node_modules/mkdirp/test/clobber.js
new file mode 100644 (file)
index 0000000..2433b9a
--- /dev/null
@@ -0,0 +1,38 @@
+var mkdirp = require('../').mkdirp;
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+var _0755 = parseInt('0755', 8);
+
+var ps = [ '', 'tmp' ];
+
+for (var i = 0; i < 25; i++) {
+    var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    ps.push(dir);
+}
+
+var file = ps.join('/');
+
+// a file in the way
+var itw = ps.slice(0, 3).join('/');
+
+
+test('clobber-pre', function (t) {
+    console.error("about to write to "+itw)
+    fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.');
+
+    fs.stat(itw, function (er, stat) {
+        t.ifError(er)
+        t.ok(stat && stat.isFile(), 'should be file')
+        t.end()
+    })
+})
+
+test('clobber', function (t) {
+    t.plan(2);
+    mkdirp(file, _0755, function (err) {
+        t.ok(err);
+        t.equal(err.code, 'ENOTDIR');
+        t.end();
+    });
+});
diff --git a/wrt/node_modules/mkdirp/test/mkdirp.js b/wrt/node_modules/mkdirp/test/mkdirp.js
new file mode 100644 (file)
index 0000000..eaa8921
--- /dev/null
@@ -0,0 +1,28 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var exists = fs.exists || path.exists;
+var test = require('tap').test;
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
+
+test('woo', function (t) {
+    t.plan(5);
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    
+    var file = '/tmp/' + [x,y,z].join('/');
+    
+    mkdirp(file, _0755, function (err) {
+        t.ifError(err);
+        exists(file, function (ex) {
+            t.ok(ex, 'file created');
+            fs.stat(file, function (err, stat) {
+                t.ifError(err);
+                t.equal(stat.mode & _0777, _0755);
+                t.ok(stat.isDirectory(), 'target not a directory');
+            })
+        })
+    });
+});
diff --git a/wrt/node_modules/mkdirp/test/opts_fs.js b/wrt/node_modules/mkdirp/test/opts_fs.js
new file mode 100644 (file)
index 0000000..97186b6
--- /dev/null
@@ -0,0 +1,29 @@
+var mkdirp = require('../');
+var path = require('path');
+var test = require('tap').test;
+var mockfs = require('mock-fs');
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
+
+test('opts.fs', function (t) {
+    t.plan(5);
+    
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    
+    var file = '/beep/boop/' + [x,y,z].join('/');
+    var xfs = mockfs.fs();
+    
+    mkdirp(file, { fs: xfs, mode: _0755 }, function (err) {
+        t.ifError(err);
+        xfs.exists(file, function (ex) {
+            t.ok(ex, 'created file');
+            xfs.stat(file, function (err, stat) {
+                t.ifError(err);
+                t.equal(stat.mode & _0777, _0755);
+                t.ok(stat.isDirectory(), 'target not a directory');
+            });
+        });
+    });
+});
diff --git a/wrt/node_modules/mkdirp/test/opts_fs_sync.js b/wrt/node_modules/mkdirp/test/opts_fs_sync.js
new file mode 100644 (file)
index 0000000..6c370aa
--- /dev/null
@@ -0,0 +1,27 @@
+var mkdirp = require('../');
+var path = require('path');
+var test = require('tap').test;
+var mockfs = require('mock-fs');
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
+
+test('opts.fs sync', function (t) {
+    t.plan(4);
+    
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    
+    var file = '/beep/boop/' + [x,y,z].join('/');
+    var xfs = mockfs.fs();
+    
+    mkdirp.sync(file, { fs: xfs, mode: _0755 });
+    xfs.exists(file, function (ex) {
+        t.ok(ex, 'created file');
+        xfs.stat(file, function (err, stat) {
+            t.ifError(err);
+            t.equal(stat.mode & _0777, _0755);
+            t.ok(stat.isDirectory(), 'target not a directory');
+        });
+    });
+});
diff --git a/wrt/node_modules/mkdirp/test/perm.js b/wrt/node_modules/mkdirp/test/perm.js
new file mode 100644 (file)
index 0000000..fbce44b
--- /dev/null
@@ -0,0 +1,32 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var exists = fs.exists || path.exists;
+var test = require('tap').test;
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
+
+test('async perm', function (t) {
+    t.plan(5);
+    var file = '/tmp/' + (Math.random() * (1<<30)).toString(16);
+    
+    mkdirp(file, _0755, function (err) {
+        t.ifError(err);
+        exists(file, function (ex) {
+            t.ok(ex, 'file created');
+            fs.stat(file, function (err, stat) {
+                t.ifError(err);
+                t.equal(stat.mode & _0777, _0755);
+                t.ok(stat.isDirectory(), 'target not a directory');
+            })
+        })
+    });
+});
+
+test('async root perm', function (t) {
+    mkdirp('/tmp', _0755, function (err) {
+        if (err) t.fail(err);
+        t.end();
+    });
+    t.end();
+});
diff --git a/wrt/node_modules/mkdirp/test/perm_sync.js b/wrt/node_modules/mkdirp/test/perm_sync.js
new file mode 100644 (file)
index 0000000..398229f
--- /dev/null
@@ -0,0 +1,36 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var exists = fs.exists || path.exists;
+var test = require('tap').test;
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
+
+test('sync perm', function (t) {
+    t.plan(4);
+    var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json';
+    
+    mkdirp.sync(file, _0755);
+    exists(file, function (ex) {
+        t.ok(ex, 'file created');
+        fs.stat(file, function (err, stat) {
+            t.ifError(err);
+            t.equal(stat.mode & _0777, _0755);
+            t.ok(stat.isDirectory(), 'target not a directory');
+        });
+    });
+});
+
+test('sync root perm', function (t) {
+    t.plan(3);
+    
+    var file = '/tmp';
+    mkdirp.sync(file, _0755);
+    exists(file, function (ex) {
+        t.ok(ex, 'file created');
+        fs.stat(file, function (err, stat) {
+            t.ifError(err);
+            t.ok(stat.isDirectory(), 'target not a directory');
+        })
+    });
+});
diff --git a/wrt/node_modules/mkdirp/test/race.js b/wrt/node_modules/mkdirp/test/race.js
new file mode 100644 (file)
index 0000000..b0b9e18
--- /dev/null
@@ -0,0 +1,37 @@
+var mkdirp = require('../').mkdirp;
+var path = require('path');
+var fs = require('fs');
+var exists = fs.exists || path.exists;
+var test = require('tap').test;
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
+
+test('race', function (t) {
+    t.plan(10);
+    var ps = [ '', 'tmp' ];
+    
+    for (var i = 0; i < 25; i++) {
+        var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+        ps.push(dir);
+    }
+    var file = ps.join('/');
+    
+    var res = 2;
+    mk(file);
+    
+    mk(file);
+    
+    function mk (file, cb) {
+        mkdirp(file, _0755, function (err) {
+            t.ifError(err);
+            exists(file, function (ex) {
+                t.ok(ex, 'file created');
+                fs.stat(file, function (err, stat) {
+                    t.ifError(err);
+                    t.equal(stat.mode & _0777, _0755);
+                    t.ok(stat.isDirectory(), 'target not a directory');
+                });
+            })
+        });
+    }
+});
diff --git a/wrt/node_modules/mkdirp/test/rel.js b/wrt/node_modules/mkdirp/test/rel.js
new file mode 100644 (file)
index 0000000..4ddb342
--- /dev/null
@@ -0,0 +1,32 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var exists = fs.exists || path.exists;
+var test = require('tap').test;
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
+
+test('rel', function (t) {
+    t.plan(5);
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    
+    var cwd = process.cwd();
+    process.chdir('/tmp');
+    
+    var file = [x,y,z].join('/');
+    
+    mkdirp(file, _0755, function (err) {
+        t.ifError(err);
+        exists(file, function (ex) {
+            t.ok(ex, 'file created');
+            fs.stat(file, function (err, stat) {
+                t.ifError(err);
+                process.chdir(cwd);
+                t.equal(stat.mode & _0777, _0755);
+                t.ok(stat.isDirectory(), 'target not a directory');
+            })
+        })
+    });
+});
diff --git a/wrt/node_modules/mkdirp/test/return.js b/wrt/node_modules/mkdirp/test/return.js
new file mode 100644 (file)
index 0000000..bce68e5
--- /dev/null
@@ -0,0 +1,25 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('return value', function (t) {
+    t.plan(4);
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+    var file = '/tmp/' + [x,y,z].join('/');
+
+    // should return the first dir created.
+    // By this point, it would be profoundly surprising if /tmp didn't
+    // already exist, since every other test makes things in there.
+    mkdirp(file, function (err, made) {
+        t.ifError(err);
+        t.equal(made, '/tmp/' + x);
+        mkdirp(file, function (err, made) {
+          t.ifError(err);
+          t.equal(made, null);
+        });
+    });
+});
diff --git a/wrt/node_modules/mkdirp/test/return_sync.js b/wrt/node_modules/mkdirp/test/return_sync.js
new file mode 100644 (file)
index 0000000..7c222d3
--- /dev/null
@@ -0,0 +1,24 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('return value', function (t) {
+    t.plan(2);
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+    var file = '/tmp/' + [x,y,z].join('/');
+
+    // should return the first dir created.
+    // By this point, it would be profoundly surprising if /tmp didn't
+    // already exist, since every other test makes things in there.
+    // Note that this will throw on failure, which will fail the test.
+    var made = mkdirp.sync(file);
+    t.equal(made, '/tmp/' + x);
+
+    // making the same file again should have no effect.
+    made = mkdirp.sync(file);
+    t.equal(made, null);
+});
diff --git a/wrt/node_modules/mkdirp/test/root.js b/wrt/node_modules/mkdirp/test/root.js
new file mode 100644 (file)
index 0000000..9e7d079
--- /dev/null
@@ -0,0 +1,19 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+var _0755 = parseInt('0755', 8);
+
+test('root', function (t) {
+    // '/' on unix, 'c:/' on windows.
+    var file = path.resolve('/');
+
+    mkdirp(file, _0755, function (err) {
+        if (err) throw err
+        fs.stat(file, function (er, stat) {
+            if (er) throw er
+            t.ok(stat.isDirectory(), 'target is a directory');
+            t.end();
+        })
+    });
+});
diff --git a/wrt/node_modules/mkdirp/test/sync.js b/wrt/node_modules/mkdirp/test/sync.js
new file mode 100644 (file)
index 0000000..8c8dc93
--- /dev/null
@@ -0,0 +1,32 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var exists = fs.exists || path.exists;
+var test = require('tap').test;
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
+
+test('sync', function (t) {
+    t.plan(4);
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+    var file = '/tmp/' + [x,y,z].join('/');
+
+    try {
+        mkdirp.sync(file, _0755);
+    } catch (err) {
+        t.fail(err);
+        return t.end();
+    }
+
+    exists(file, function (ex) {
+        t.ok(ex, 'file created');
+        fs.stat(file, function (err, stat) {
+            t.ifError(err);
+            t.equal(stat.mode & _0777, _0755);
+            t.ok(stat.isDirectory(), 'target not a directory');
+        });
+    });
+});
diff --git a/wrt/node_modules/mkdirp/test/umask.js b/wrt/node_modules/mkdirp/test/umask.js
new file mode 100644 (file)
index 0000000..2033c63
--- /dev/null
@@ -0,0 +1,28 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var exists = fs.exists || path.exists;
+var test = require('tap').test;
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
+
+test('implicit mode from umask', function (t) {
+    t.plan(5);
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    
+    var file = '/tmp/' + [x,y,z].join('/');
+    
+    mkdirp(file, function (err) {
+        t.ifError(err);
+        exists(file, function (ex) {
+            t.ok(ex, 'file created');
+            fs.stat(file, function (err, stat) {
+                t.ifError(err);
+                t.equal(stat.mode & _0777, _0777 & (~process.umask()));
+                t.ok(stat.isDirectory(), 'target not a directory');
+            });
+        })
+    });
+});
diff --git a/wrt/node_modules/mkdirp/test/umask_sync.js b/wrt/node_modules/mkdirp/test/umask_sync.js
new file mode 100644 (file)
index 0000000..11a7614
--- /dev/null
@@ -0,0 +1,32 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var exists = fs.exists || path.exists;
+var test = require('tap').test;
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
+
+test('umask sync modes', function (t) {
+    t.plan(4);
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+    var file = '/tmp/' + [x,y,z].join('/');
+
+    try {
+        mkdirp.sync(file);
+    } catch (err) {
+        t.fail(err);
+        return t.end();
+    }
+
+    exists(file, function (ex) {
+        t.ok(ex, 'file created');
+        fs.stat(file, function (err, stat) {
+            t.ifError(err);
+            t.equal(stat.mode & _0777, (_0777 & (~process.umask())));
+            t.ok(stat.isDirectory(), 'target not a directory');
+        });
+    });
+});
diff --git a/wrt/node_modules/ms/index.js b/wrt/node_modules/ms/index.js
new file mode 100644 (file)
index 0000000..6a522b1
--- /dev/null
@@ -0,0 +1,152 @@
+/**
+ * Helpers.
+ */
+
+var s = 1000;
+var m = s * 60;
+var h = m * 60;
+var d = h * 24;
+var y = d * 365.25;
+
+/**
+ * Parse or format the given `val`.
+ *
+ * Options:
+ *
+ *  - `long` verbose formatting [false]
+ *
+ * @param {String|Number} val
+ * @param {Object} [options]
+ * @throws {Error} throw an error if val is not a non-empty string or a number
+ * @return {String|Number}
+ * @api public
+ */
+
+module.exports = function(val, options) {
+  options = options || {};
+  var type = typeof val;
+  if (type === 'string' && val.length > 0) {
+    return parse(val);
+  } else if (type === 'number' && isNaN(val) === false) {
+    return options.long ? fmtLong(val) : fmtShort(val);
+  }
+  throw new Error(
+    'val is not a non-empty string or a valid number. val=' +
+      JSON.stringify(val)
+  );
+};
+
+/**
+ * Parse the given `str` and return milliseconds.
+ *
+ * @param {String} str
+ * @return {Number}
+ * @api private
+ */
+
+function parse(str) {
+  str = String(str);
+  if (str.length > 100) {
+    return;
+  }
+  var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
+    str
+  );
+  if (!match) {
+    return;
+  }
+  var n = parseFloat(match[1]);
+  var type = (match[2] || 'ms').toLowerCase();
+  switch (type) {
+    case 'years':
+    case 'year':
+    case 'yrs':
+    case 'yr':
+    case 'y':
+      return n * y;
+    case 'days':
+    case 'day':
+    case 'd':
+      return n * d;
+    case 'hours':
+    case 'hour':
+    case 'hrs':
+    case 'hr':
+    case 'h':
+      return n * h;
+    case 'minutes':
+    case 'minute':
+    case 'mins':
+    case 'min':
+    case 'm':
+      return n * m;
+    case 'seconds':
+    case 'second':
+    case 'secs':
+    case 'sec':
+    case 's':
+      return n * s;
+    case 'milliseconds':
+    case 'millisecond':
+    case 'msecs':
+    case 'msec':
+    case 'ms':
+      return n;
+    default:
+      return undefined;
+  }
+}
+
+/**
+ * Short format for `ms`.
+ *
+ * @param {Number} ms
+ * @return {String}
+ * @api private
+ */
+
+function fmtShort(ms) {
+  if (ms >= d) {
+    return Math.round(ms / d) + 'd';
+  }
+  if (ms >= h) {
+    return Math.round(ms / h) + 'h';
+  }
+  if (ms >= m) {
+    return Math.round(ms / m) + 'm';
+  }
+  if (ms >= s) {
+    return Math.round(ms / s) + 's';
+  }
+  return ms + 'ms';
+}
+
+/**
+ * Long format for `ms`.
+ *
+ * @param {Number} ms
+ * @return {String}
+ * @api private
+ */
+
+function fmtLong(ms) {
+  return plural(ms, d, 'day') ||
+    plural(ms, h, 'hour') ||
+    plural(ms, m, 'minute') ||
+    plural(ms, s, 'second') ||
+    ms + ' ms';
+}
+
+/**
+ * Pluralization helper.
+ */
+
+function plural(ms, n, name) {
+  if (ms < n) {
+    return;
+  }
+  if (ms < n * 1.5) {
+    return Math.floor(ms / n) + ' ' + name;
+  }
+  return Math.ceil(ms / n) + ' ' + name + 's';
+}
diff --git a/wrt/node_modules/ms/license.md b/wrt/node_modules/ms/license.md
new file mode 100644 (file)
index 0000000..69b6125
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Zeit, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/wrt/node_modules/ms/package.json b/wrt/node_modules/ms/package.json
new file mode 100644 (file)
index 0000000..f252e15
--- /dev/null
@@ -0,0 +1,109 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "ms@2.0.0",
+        "scope": null,
+        "escapedName": "ms",
+        "name": "ms",
+        "rawSpec": "2.0.0",
+        "spec": "2.0.0",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/debug"
+    ]
+  ],
+  "_from": "ms@2.0.0",
+  "_id": "ms@2.0.0",
+  "_inCache": true,
+  "_location": "/ms",
+  "_nodeVersion": "7.8.0",
+  "_npmOperationalInternal": {
+    "host": "packages-18-east.internal.npmjs.com",
+    "tmp": "tmp/ms-2.0.0.tgz_1494937565215_0.34005374647676945"
+  },
+  "_npmUser": {
+    "name": "leo",
+    "email": "leo@zeit.co"
+  },
+  "_npmVersion": "4.2.0",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "ms@2.0.0",
+    "scope": null,
+    "escapedName": "ms",
+    "name": "ms",
+    "rawSpec": "2.0.0",
+    "spec": "2.0.0",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/debug"
+  ],
+  "_resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+  "_shasum": "5608aeadfc00be6c2901df5f9861788de0d597c8",
+  "_shrinkwrap": null,
+  "_spec": "ms@2.0.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/debug",
+  "bugs": {
+    "url": "https://github.com/zeit/ms/issues"
+  },
+  "dependencies": {},
+  "description": "Tiny milisecond conversion utility",
+  "devDependencies": {
+    "eslint": "3.19.0",
+    "expect.js": "0.3.1",
+    "husky": "0.13.3",
+    "lint-staged": "3.4.1",
+    "mocha": "3.4.1"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "5608aeadfc00be6c2901df5f9861788de0d597c8",
+    "tarball": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz"
+  },
+  "eslintConfig": {
+    "extends": "eslint:recommended",
+    "env": {
+      "node": true,
+      "es6": true
+    }
+  },
+  "files": [
+    "index.js"
+  ],
+  "gitHead": "9b88d1568a52ec9bb67ecc8d2aa224fa38fd41f4",
+  "homepage": "https://github.com/zeit/ms#readme",
+  "license": "MIT",
+  "lint-staged": {
+    "*.js": [
+      "npm run lint",
+      "prettier --single-quote --write",
+      "git add"
+    ]
+  },
+  "main": "./index",
+  "maintainers": [
+    {
+      "name": "leo",
+      "email": "leo@zeit.co"
+    },
+    {
+      "name": "rauchg",
+      "email": "rauchg@gmail.com"
+    }
+  ],
+  "name": "ms",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/zeit/ms.git"
+  },
+  "scripts": {
+    "lint": "eslint lib/* bin/*",
+    "precommit": "lint-staged",
+    "test": "mocha tests.js"
+  },
+  "version": "2.0.0"
+}
diff --git a/wrt/node_modules/ms/readme.md b/wrt/node_modules/ms/readme.md
new file mode 100644 (file)
index 0000000..84a9974
--- /dev/null
@@ -0,0 +1,51 @@
+# ms
+
+[![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms)
+[![Slack Channel](http://zeit-slackin.now.sh/badge.svg)](https://zeit.chat/)
+
+Use this package to easily convert various time formats to milliseconds.
+
+## Examples
+
+```js
+ms('2 days')  // 172800000
+ms('1d')      // 86400000
+ms('10h')     // 36000000
+ms('2.5 hrs') // 9000000
+ms('2h')      // 7200000
+ms('1m')      // 60000
+ms('5s')      // 5000
+ms('1y')      // 31557600000
+ms('100')     // 100
+```
+
+### Convert from milliseconds
+
+```js
+ms(60000)             // "1m"
+ms(2 * 60000)         // "2m"
+ms(ms('10 hours'))    // "10h"
+```
+
+### Time format written-out
+
+```js
+ms(60000, { long: true })             // "1 minute"
+ms(2 * 60000, { long: true })         // "2 minutes"
+ms(ms('10 hours'), { long: true })    // "10 hours"
+```
+
+## Features
+
+- Works both in [node](https://nodejs.org) and in the browser.
+- If a number is supplied to `ms`, a string with a unit is returned.
+- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`).
+- If you pass a string with a number and a valid unit, the number of equivalent ms is returned.
+
+## Caught a bug?
+
+1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
+2. Link the package to the global module directory: `npm link`
+3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, node will now use your clone of ms!
+
+As always, you can run the tests using: `npm test`
diff --git a/wrt/node_modules/mv/.npmignore b/wrt/node_modules/mv/.npmignore
new file mode 100644 (file)
index 0000000..07e6e47
--- /dev/null
@@ -0,0 +1 @@
+/node_modules
diff --git a/wrt/node_modules/mv/.travis.yml b/wrt/node_modules/mv/.travis.yml
new file mode 100644 (file)
index 0000000..125e04a
--- /dev/null
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+  - "0.12"
+  - "0.10"
diff --git a/wrt/node_modules/mv/LICENSE b/wrt/node_modules/mv/LICENSE
new file mode 100644 (file)
index 0000000..e57596d
--- /dev/null
@@ -0,0 +1,21 @@
+Copyright (c) 2014 Andrew Kelley
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation files
+(the "Software"), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/wrt/node_modules/mv/README.md b/wrt/node_modules/mv/README.md
new file mode 100644 (file)
index 0000000..7708039
--- /dev/null
@@ -0,0 +1,33 @@
+[![Build Status](https://secure.travis-ci.org/andrewrk/node-mv.png)](http://travis-ci.org/andrewrk/node-mv)
+
+Usage:
+------
+
+```js
+var mv = require('mv');
+
+mv('source/file', 'dest/file', function(err) {
+  // done. it tried fs.rename first, and then falls back to
+  // piping the source file to the dest file and then unlinking
+  // the source file.
+});
+```
+
+Another example:
+
+```js
+mv('source/dir', 'dest/a/b/c/dir', {mkdirp: true}, function(err) {
+  // done. it first created all the necessary directories, and then
+  // tried fs.rename, then falls back to using ncp to copy the dir
+  // to dest and then rimraf to remove the source dir
+});
+```
+
+Another example:
+
+```js
+mv('source/file', 'dest/file', {clobber: false}, function(err) {
+  // done. If 'dest/file' exists, an error is returned
+  // with err.code === 'EEXIST'.
+});
+```
diff --git a/wrt/node_modules/mv/index.js b/wrt/node_modules/mv/index.js
new file mode 100644 (file)
index 0000000..ec6c8ee
--- /dev/null
@@ -0,0 +1,105 @@
+var fs = require('fs');
+var ncp = require('ncp').ncp;
+var path = require('path');
+var rimraf = require('rimraf');
+var mkdirp = require('mkdirp');
+
+module.exports = mv;
+
+function mv(source, dest, options, cb){
+  if (typeof options === 'function') {
+    cb = options;
+    options = {};
+  }
+  var shouldMkdirp = !!options.mkdirp;
+  var clobber = options.clobber !== false;
+  var limit = options.limit || 16;
+
+  if (shouldMkdirp) {
+    mkdirs();
+  } else {
+    doRename();
+  }
+
+  function mkdirs() {
+    mkdirp(path.dirname(dest), function(err) {
+      if (err) return cb(err);
+      doRename();
+    });
+  }
+
+  function doRename() {
+    if (clobber) {
+      fs.rename(source, dest, function(err) {
+        if (!err) return cb();
+        if (err.code !== 'EXDEV') return cb(err);
+        moveFileAcrossDevice(source, dest, clobber, limit, cb);
+      });
+    } else {
+      fs.link(source, dest, function(err) {
+        if (err) {
+          if (err.code === 'EXDEV') {
+            moveFileAcrossDevice(source, dest, clobber, limit, cb);
+            return;
+          }
+          if (err.code === 'EISDIR' || err.code === 'EPERM') {
+            moveDirAcrossDevice(source, dest, clobber, limit, cb);
+            return;
+          }
+          cb(err);
+          return;
+        }
+        fs.unlink(source, cb);
+      });
+    }
+  }
+}
+
+function moveFileAcrossDevice(source, dest, clobber, limit, cb) {
+  var outFlags = clobber ? 'w' : 'wx';
+  var ins = fs.createReadStream(source);
+  var outs = fs.createWriteStream(dest, {flags: outFlags});
+  ins.on('error', function(err){
+    ins.destroy();
+    outs.destroy();
+    outs.removeListener('close', onClose);
+    if (err.code === 'EISDIR' || err.code === 'EPERM') {
+      moveDirAcrossDevice(source, dest, clobber, limit, cb);
+    } else {
+      cb(err);
+    }
+  });
+  outs.on('error', function(err){
+    ins.destroy();
+    outs.destroy();
+    outs.removeListener('close', onClose);
+    cb(err);
+  });
+  outs.once('close', onClose);
+  ins.pipe(outs);
+  function onClose(){
+    fs.unlink(source, cb);
+  }
+}
+
+function moveDirAcrossDevice(source, dest, clobber, limit, cb) {
+  var options = {
+    stopOnErr: true,
+    clobber: false,
+    limit: limit,
+  };
+  if (clobber) {
+    rimraf(dest, { disableGlob: true }, function(err) {
+      if (err) return cb(err);
+      startNcp();
+    });
+  } else {
+    startNcp();
+  }
+  function startNcp() {
+    ncp(source, dest, options, function(errList) {
+      if (errList) return cb(errList[0]);
+      rimraf(source, { disableGlob: true }, cb);
+    });
+  }
+}
diff --git a/wrt/node_modules/mv/node_modules/.bin/rimraf b/wrt/node_modules/mv/node_modules/.bin/rimraf
new file mode 120000 (symlink)
index 0000000..4cd49a4
--- /dev/null
@@ -0,0 +1 @@
+../rimraf/bin.js
\ No newline at end of file
diff --git a/wrt/node_modules/mv/node_modules/rimraf/LICENSE b/wrt/node_modules/mv/node_modules/rimraf/LICENSE
new file mode 100644 (file)
index 0000000..19129e3
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/wrt/node_modules/mv/node_modules/rimraf/README.md b/wrt/node_modules/mv/node_modules/rimraf/README.md
new file mode 100644 (file)
index 0000000..de7c4bb
--- /dev/null
@@ -0,0 +1,43 @@
+[![Build Status](https://travis-ci.org/isaacs/rimraf.svg?branch=master)](https://travis-ci.org/isaacs/rimraf) [![Dependency Status](https://david-dm.org/isaacs/rimraf.svg)](https://david-dm.org/isaacs/rimraf) [![devDependency Status](https://david-dm.org/isaacs/rimraf/dev-status.svg)](https://david-dm.org/isaacs/rimraf#info=devDependencies)
+
+The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node.
+
+Install with `npm install rimraf`, or just drop rimraf.js somewhere.
+
+## API
+
+`rimraf(f, [opts], callback)`
+
+The first parameter will be interpreted as a globbing pattern for files. If you
+want to disable globbing you can do so with `opts.disableGlob` (defaults to
+`false`). This might be handy, for instance, if you have filenames that contain
+globbing wildcard characters.
+
+The callback will be called with an error if there is one.  Certain
+errors are handled for you:
+
+* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of
+  `opts.maxBusyTries` times before giving up, adding 100ms of wait
+  between each attempt.  The default `maxBusyTries` is 3.
+* `ENOENT` - If the file doesn't exist, rimraf will return
+  successfully, since your desired outcome is already the case.
+* `EMFILE` - Since `readdir` requires opening a file descriptor, it's
+  possible to hit `EMFILE` if too many file descriptors are in use.
+  In the sync case, there's nothing to be done for this.  But in the
+  async case, rimraf will gradually back off with timeouts up to
+  `opts.emfileWait` ms, which defaults to 1000.
+
+## rimraf.sync
+
+It can remove stuff synchronously, too.  But that's not so good.  Use
+the async API.  It's better.
+
+## CLI
+
+If installed with `npm install rimraf -g` it can be used as a global
+command `rimraf <path> [<path> ...]` which is useful for cross platform support.
+
+## mkdirp
+
+If you need to create a directory recursively, check out
+[mkdirp](https://github.com/substack/node-mkdirp).
diff --git a/wrt/node_modules/mv/node_modules/rimraf/bin.js b/wrt/node_modules/mv/node_modules/rimraf/bin.js
new file mode 100755 (executable)
index 0000000..1bd5a0d
--- /dev/null
@@ -0,0 +1,40 @@
+#!/usr/bin/env node
+
+var rimraf = require('./')
+
+var help = false
+var dashdash = false
+var args = process.argv.slice(2).filter(function(arg) {
+  if (dashdash)
+    return !!arg
+  else if (arg === '--')
+    dashdash = true
+  else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/))
+    help = true
+  else
+    return !!arg
+});
+
+if (help || args.length === 0) {
+  // If they didn't ask for help, then this is not a "success"
+  var log = help ? console.log : console.error
+  log('Usage: rimraf <path> [<path> ...]')
+  log('')
+  log('  Deletes all files and folders at "path" recursively.')
+  log('')
+  log('Options:')
+  log('')
+  log('  -h, --help    Display this usage info')
+  process.exit(help ? 0 : 1)
+} else
+  go(0)
+
+function go (n) {
+  if (n >= args.length)
+    return
+  rimraf(args[n], function (er) {
+    if (er)
+      throw er
+    go(n+1)
+  })
+}
diff --git a/wrt/node_modules/mv/node_modules/rimraf/package.json b/wrt/node_modules/mv/node_modules/rimraf/package.json
new file mode 100644 (file)
index 0000000..8e9cd3e
--- /dev/null
@@ -0,0 +1,95 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "rimraf@~2.4.0",
+        "scope": null,
+        "escapedName": "rimraf",
+        "name": "rimraf",
+        "rawSpec": "~2.4.0",
+        "spec": ">=2.4.0 <2.5.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/mv"
+    ]
+  ],
+  "_from": "rimraf@>=2.4.0 <2.5.0",
+  "_id": "rimraf@2.4.5",
+  "_inCache": true,
+  "_location": "/mv/rimraf",
+  "_nodeVersion": "4.0.0",
+  "_npmUser": {
+    "name": "isaacs",
+    "email": "i@izs.me"
+  },
+  "_npmVersion": "3.3.2",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "rimraf@~2.4.0",
+    "scope": null,
+    "escapedName": "rimraf",
+    "name": "rimraf",
+    "rawSpec": "~2.4.0",
+    "spec": ">=2.4.0 <2.5.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/mv"
+  ],
+  "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.4.5.tgz",
+  "_shasum": "ee710ce5d93a8fdb856fb5ea8ff0e2d75934b2da",
+  "_shrinkwrap": null,
+  "_spec": "rimraf@~2.4.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/mv",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bin": {
+    "rimraf": "./bin.js"
+  },
+  "bugs": {
+    "url": "https://github.com/isaacs/rimraf/issues"
+  },
+  "dependencies": {
+    "glob": "^6.0.1"
+  },
+  "description": "A deep deletion module for node (like `rm -rf`)",
+  "devDependencies": {
+    "mkdirp": "^0.5.1",
+    "tap": "^2.3.4"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "ee710ce5d93a8fdb856fb5ea8ff0e2d75934b2da",
+    "tarball": "https://registry.npmjs.org/rimraf/-/rimraf-2.4.5.tgz"
+  },
+  "files": [
+    "LICENSE",
+    "README.md",
+    "bin.js",
+    "rimraf.js"
+  ],
+  "gitHead": "02c4ecd2a7a1895ada0a244ea04e6f0996f6ba61",
+  "homepage": "https://github.com/isaacs/rimraf#readme",
+  "license": "ISC",
+  "main": "rimraf.js",
+  "maintainers": [
+    {
+      "name": "isaacs",
+      "email": "i@izs.me"
+    }
+  ],
+  "name": "rimraf",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/rimraf.git"
+  },
+  "scripts": {
+    "test": "tap test/*.js"
+  },
+  "version": "2.4.5"
+}
diff --git a/wrt/node_modules/mv/node_modules/rimraf/rimraf.js b/wrt/node_modules/mv/node_modules/rimraf/rimraf.js
new file mode 100644 (file)
index 0000000..7771b53
--- /dev/null
@@ -0,0 +1,333 @@
+module.exports = rimraf
+rimraf.sync = rimrafSync
+
+var assert = require("assert")
+var path = require("path")
+var fs = require("fs")
+var glob = require("glob")
+
+var globOpts = {
+  nosort: true,
+  nocomment: true,
+  nonegate: true,
+  silent: true
+}
+
+// for EMFILE handling
+var timeout = 0
+
+var isWindows = (process.platform === "win32")
+
+function defaults (options) {
+  var methods = [
+    'unlink',
+    'chmod',
+    'stat',
+    'lstat',
+    'rmdir',
+    'readdir'
+  ]
+  methods.forEach(function(m) {
+    options[m] = options[m] || fs[m]
+    m = m + 'Sync'
+    options[m] = options[m] || fs[m]
+  })
+
+  options.maxBusyTries = options.maxBusyTries || 3
+  options.emfileWait = options.emfileWait || 1000
+  options.disableGlob = options.disableGlob || false
+}
+
+function rimraf (p, options, cb) {
+  if (typeof options === 'function') {
+    cb = options
+    options = {}
+  }
+
+  assert(p, 'rimraf: missing path')
+  assert.equal(typeof p, 'string', 'rimraf: path should be a string')
+  assert(options, 'rimraf: missing options')
+  assert.equal(typeof options, 'object', 'rimraf: options should be object')
+  assert.equal(typeof cb, 'function', 'rimraf: callback function required')
+
+  defaults(options)
+
+  var busyTries = 0
+  var errState = null
+  var n = 0
+
+  if (options.disableGlob || !glob.hasMagic(p))
+    return afterGlob(null, [p])
+
+  fs.lstat(p, function (er, stat) {
+    if (!er)
+      return afterGlob(null, [p])
+
+    glob(p, globOpts, afterGlob)
+  })
+
+  function next (er) {
+    errState = errState || er
+    if (--n === 0)
+      cb(errState)
+  }
+
+  function afterGlob (er, results) {
+    if (er)
+      return cb(er)
+
+    n = results.length
+    if (n === 0)
+      return cb()
+
+    results.forEach(function (p) {
+      rimraf_(p, options, function CB (er) {
+        if (er) {
+          if (isWindows && (er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") &&
+              busyTries < options.maxBusyTries) {
+            busyTries ++
+            var time = busyTries * 100
+            // try again, with the same exact callback as this one.
+            return setTimeout(function () {
+              rimraf_(p, options, CB)
+            }, time)
+          }
+
+          // this one won't happen if graceful-fs is used.
+          if (er.code === "EMFILE" && timeout < options.emfileWait) {
+            return setTimeout(function () {
+              rimraf_(p, options, CB)
+            }, timeout ++)
+          }
+
+          // already gone
+          if (er.code === "ENOENT") er = null
+        }
+
+        timeout = 0
+        next(er)
+      })
+    })
+  }
+}
+
+// Two possible strategies.
+// 1. Assume it's a file.  unlink it, then do the dir stuff on EPERM or EISDIR
+// 2. Assume it's a directory.  readdir, then do the file stuff on ENOTDIR
+//
+// Both result in an extra syscall when you guess wrong.  However, there
+// are likely far more normal files in the world than directories.  This
+// is based on the assumption that a the average number of files per
+// directory is >= 1.
+//
+// If anyone ever complains about this, then I guess the strategy could
+// be made configurable somehow.  But until then, YAGNI.
+function rimraf_ (p, options, cb) {
+  assert(p)
+  assert(options)
+  assert(typeof cb === 'function')
+
+  // sunos lets the root user unlink directories, which is... weird.
+  // so we have to lstat here and make sure it's not a dir.
+  options.lstat(p, function (er, st) {
+    if (er && er.code === "ENOENT")
+      return cb(null)
+
+    if (st && st.isDirectory())
+      return rmdir(p, options, er, cb)
+
+    options.unlink(p, function (er) {
+      if (er) {
+        if (er.code === "ENOENT")
+          return cb(null)
+        if (er.code === "EPERM")
+          return (isWindows)
+            ? fixWinEPERM(p, options, er, cb)
+            : rmdir(p, options, er, cb)
+        if (er.code === "EISDIR")
+          return rmdir(p, options, er, cb)
+      }
+      return cb(er)
+    })
+  })
+}
+
+function fixWinEPERM (p, options, er, cb) {
+  assert(p)
+  assert(options)
+  assert(typeof cb === 'function')
+  if (er)
+    assert(er instanceof Error)
+
+  options.chmod(p, 666, function (er2) {
+    if (er2)
+      cb(er2.code === "ENOENT" ? null : er)
+    else
+      options.stat(p, function(er3, stats) {
+        if (er3)
+          cb(er3.code === "ENOENT" ? null : er)
+        else if (stats.isDirectory())
+          rmdir(p, options, er, cb)
+        else
+          options.unlink(p, cb)
+      })
+  })
+}
+
+function fixWinEPERMSync (p, options, er) {
+  assert(p)
+  assert(options)
+  if (er)
+    assert(er instanceof Error)
+
+  try {
+    options.chmodSync(p, 666)
+  } catch (er2) {
+    if (er2.code === "ENOENT")
+      return
+    else
+      throw er
+  }
+
+  try {
+    var stats = options.statSync(p)
+  } catch (er3) {
+    if (er3.code === "ENOENT")
+      return
+    else
+      throw er
+  }
+
+  if (stats.isDirectory())
+    rmdirSync(p, options, er)
+  else
+    options.unlinkSync(p)
+}
+
+function rmdir (p, options, originalEr, cb) {
+  assert(p)
+  assert(options)
+  if (originalEr)
+    assert(originalEr instanceof Error)
+  assert(typeof cb === 'function')
+
+  // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)
+  // if we guessed wrong, and it's not a directory, then
+  // raise the original error.
+  options.rmdir(p, function (er) {
+    if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM"))
+      rmkids(p, options, cb)
+    else if (er && er.code === "ENOTDIR")
+      cb(originalEr)
+    else
+      cb(er)
+  })
+}
+
+function rmkids(p, options, cb) {
+  assert(p)
+  assert(options)
+  assert(typeof cb === 'function')
+
+  options.readdir(p, function (er, files) {
+    if (er)
+      return cb(er)
+    var n = files.length
+    if (n === 0)
+      return options.rmdir(p, cb)
+    var errState
+    files.forEach(function (f) {
+      rimraf(path.join(p, f), options, function (er) {
+        if (errState)
+          return
+        if (er)
+          return cb(errState = er)
+        if (--n === 0)
+          options.rmdir(p, cb)
+      })
+    })
+  })
+}
+
+// this looks simpler, and is strictly *faster*, but will
+// tie up the JavaScript thread and fail on excessively
+// deep directory trees.
+function rimrafSync (p, options) {
+  options = options || {}
+  defaults(options)
+
+  assert(p, 'rimraf: missing path')
+  assert.equal(typeof p, 'string', 'rimraf: path should be a string')
+  assert(options, 'rimraf: missing options')
+  assert.equal(typeof options, 'object', 'rimraf: options should be object')
+
+  var results
+
+  if (options.disableGlob || !glob.hasMagic(p)) {
+    results = [p]
+  } else {
+    try {
+      fs.lstatSync(p)
+      results = [p]
+    } catch (er) {
+      results = glob.sync(p, globOpts)
+    }
+  }
+
+  if (!results.length)
+    return
+
+  for (var i = 0; i < results.length; i++) {
+    var p = results[i]
+
+    try {
+      var st = options.lstatSync(p)
+    } catch (er) {
+      if (er.code === "ENOENT")
+        return
+    }
+
+    try {
+      // sunos lets the root user unlink directories, which is... weird.
+      if (st && st.isDirectory())
+        rmdirSync(p, options, null)
+      else
+        options.unlinkSync(p)
+    } catch (er) {
+      if (er.code === "ENOENT")
+        return
+      if (er.code === "EPERM")
+        return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er)
+      if (er.code !== "EISDIR")
+        throw er
+      rmdirSync(p, options, er)
+    }
+  }
+}
+
+function rmdirSync (p, options, originalEr) {
+  assert(p)
+  assert(options)
+  if (originalEr)
+    assert(originalEr instanceof Error)
+
+  try {
+    options.rmdirSync(p)
+  } catch (er) {
+    if (er.code === "ENOENT")
+      return
+    if (er.code === "ENOTDIR")
+      throw originalEr
+    if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")
+      rmkidsSync(p, options)
+  }
+}
+
+function rmkidsSync (p, options) {
+  assert(p)
+  assert(options)
+  options.readdirSync(p).forEach(function (f) {
+    rimrafSync(path.join(p, f), options)
+  })
+  options.rmdirSync(p, options)
+}
diff --git a/wrt/node_modules/mv/package.json b/wrt/node_modules/mv/package.json
new file mode 100644 (file)
index 0000000..3f91b04
--- /dev/null
@@ -0,0 +1,100 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "mv",
+        "scope": null,
+        "escapedName": "mv",
+        "name": "mv",
+        "rawSpec": "",
+        "spec": "latest",
+        "type": "tag"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt"
+    ]
+  ],
+  "_from": "mv@latest",
+  "_id": "mv@2.1.1",
+  "_inCache": true,
+  "_location": "/mv",
+  "_nodeVersion": "0.12.0",
+  "_npmUser": {
+    "name": "superjoe",
+    "email": "superjoe30@gmail.com"
+  },
+  "_npmVersion": "2.5.1",
+  "_phantomChildren": {
+    "glob": "6.0.4"
+  },
+  "_requested": {
+    "raw": "mv",
+    "scope": null,
+    "escapedName": "mv",
+    "name": "mv",
+    "rawSpec": "",
+    "spec": "latest",
+    "type": "tag"
+  },
+  "_requiredBy": [
+    "#USER"
+  ],
+  "_resolved": "https://registry.npmjs.org/mv/-/mv-2.1.1.tgz",
+  "_shasum": "ae6ce0d6f6d5e0a4f7d893798d03c1ea9559b6a2",
+  "_shrinkwrap": null,
+  "_spec": "mv",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt",
+  "author": {
+    "name": "Andrew Kelley"
+  },
+  "bugs": {
+    "url": "https://github.com/andrewrk/node-mv/issues"
+  },
+  "dependencies": {
+    "mkdirp": "~0.5.1",
+    "ncp": "~2.0.0",
+    "rimraf": "~2.4.0"
+  },
+  "description": "fs.rename but works across devices. same as the unix utility 'mv'",
+  "devDependencies": {
+    "mocha": "~2.2.5"
+  },
+  "directories": {
+    "test": "test"
+  },
+  "dist": {
+    "shasum": "ae6ce0d6f6d5e0a4f7d893798d03c1ea9559b6a2",
+    "tarball": "https://registry.npmjs.org/mv/-/mv-2.1.1.tgz"
+  },
+  "engines": {
+    "node": ">=0.8.0"
+  },
+  "gitHead": "645d8f4c783abf84204be704098fdd41f36ab195",
+  "homepage": "https://github.com/andrewrk/node-mv",
+  "keywords": [
+    "mv",
+    "move",
+    "rename",
+    "device",
+    "recursive",
+    "folder"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "superjoe",
+      "email": "superjoe30@gmail.com"
+    }
+  ],
+  "name": "mv",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/andrewrk/node-mv.git"
+  },
+  "scripts": {
+    "test": "mocha test/test.js --reporter spec"
+  },
+  "version": "2.1.1"
+}
diff --git a/wrt/node_modules/mv/test/a-file b/wrt/node_modules/mv/test/a-file
new file mode 100644 (file)
index 0000000..94a709d
--- /dev/null
@@ -0,0 +1 @@
+sonic the hedgehog
diff --git a/wrt/node_modules/mv/test/a-folder/another-file b/wrt/node_modules/mv/test/a-folder/another-file
new file mode 100644 (file)
index 0000000..31340c7
--- /dev/null
@@ -0,0 +1 @@
+tails
diff --git a/wrt/node_modules/mv/test/a-folder/another-folder/file3 b/wrt/node_modules/mv/test/a-folder/another-folder/file3
new file mode 100644 (file)
index 0000000..73a394d
--- /dev/null
@@ -0,0 +1 @@
+knuckles
diff --git a/wrt/node_modules/mv/test/test.js b/wrt/node_modules/mv/test/test.js
new file mode 100644 (file)
index 0000000..ee8b2f4
--- /dev/null
@@ -0,0 +1,151 @@
+var assert = require('assert');
+var fs = require('fs');
+var rimraf = require('rimraf');
+var describe = global.describe;
+var it = global.it;
+var mv = require('../');
+
+var realFsRename = fs.rename;
+function overrideFsRename() {
+  // makes fs.rename return cross-device error.
+  fs.rename = function(src, dest, cb) {
+    setTimeout(function() {
+      var err = new Error();
+      err.code = 'EXDEV';
+      cb(err);
+    }, 10);
+  };
+}
+
+function restoreFsRename() {
+  fs.rename = realFsRename;
+}
+
+describe("mv", function() {
+  it("should rename a file on the same device", function (done) {
+    mv("test/a-file", "test/a-file-dest", function (err) {
+      assert.ifError(err);
+      fs.readFile("test/a-file-dest", 'utf8', function (err, contents) {
+        assert.ifError(err);
+        assert.strictEqual(contents, "sonic the hedgehog\n");
+        // move it back
+        mv("test/a-file-dest", "test/a-file", done);
+      });
+    });
+  });
+
+  it("should not overwrite if clobber = false", function (done) {
+    mv("test/a-file", "test/a-folder/another-file", {clobber: false}, function (err) {
+      assert.ok(err && err.code === 'EEXIST', "throw EEXIST");
+      done();
+    });
+  });
+
+  it("should not create directory structure by default", function (done) {
+    mv("test/a-file", "test/does/not/exist/a-file-dest", function (err) {
+      assert.strictEqual(err.code, 'ENOENT');
+      done();
+    });
+  });
+
+  it("should create directory structure when mkdirp option set", function (done) {
+    mv("test/a-file", "test/does/not/exist/a-file-dest", {mkdirp: true}, function (err) {
+      assert.ifError(err);
+      fs.readFile("test/does/not/exist/a-file-dest", 'utf8', function (err, contents) {
+        assert.ifError(err);
+        assert.strictEqual(contents, "sonic the hedgehog\n");
+        // move it back
+        mv("test/does/not/exist/a-file-dest", "test/a-file", function(err) {
+          assert.ifError(err);
+          rimraf("test/does", { disableGlob: true }, done);
+        });
+      });
+    });
+  });
+
+  it("should work across devices", function (done) {
+    overrideFsRename();
+    mv("test/a-file", "test/a-file-dest", function (err) {
+      assert.ifError(err);
+      fs.readFile("test/a-file-dest", 'utf8', function (err, contents) {
+        assert.ifError(err);
+        assert.strictEqual(contents, "sonic the hedgehog\n");
+        // move it back
+        mv("test/a-file-dest", "test/a-file", function(err) {
+          restoreFsRename();
+          done(err);
+        });
+      });
+    });
+  });
+
+  it("should work across devices, even with special characters", function (done) {
+    overrideFsRename();
+    mv("test/a-file", "test/a-*", function (err) {
+      assert.ifError(err);
+      fs.readFile("test/a-*", 'utf8', function (err, contents) {
+        assert.ifError(err);
+        assert.strictEqual(contents, "sonic the hedgehog\n");
+        // move it back
+        mv("test/a-*", "test/a-file", function(err) {
+          assert.ifError(err);
+          fs.readFile("test/a-file", 'utf8', function (err, contents) {
+            assert.ifError(err);
+            assert.strictEqual(contents, "sonic the hedgehog\n");
+            restoreFsRename();
+            done(err);
+          });
+        });
+      });
+    });
+  });
+
+  it("should move folders", function (done) {
+    mv("test/a-folder", "test/a-folder-dest", function (err) {
+      assert.ifError(err);
+      fs.readFile("test/a-folder-dest/another-file", 'utf8', function (err, contents) {
+        assert.ifError(err);
+        assert.strictEqual(contents, "tails\n");
+        // move it back
+        mv("test/a-folder-dest", "test/a-folder", done);
+      });
+    });
+  });
+
+  it("should move folders across devices", function (done) {
+    overrideFsRename();
+    mv("test/a-folder", "test/a-folder-dest", function (err) {
+      assert.ifError(err);
+      fs.readFile("test/a-folder-dest/another-folder/file3", 'utf8', function (err, contents) {
+        assert.ifError(err);
+        assert.strictEqual(contents, "knuckles\n");
+        // move it back
+        mv("test/a-folder-dest", "test/a-folder", function(err) {
+          restoreFsRename();
+          done(err);
+        });
+      });
+    });
+  });
+
+  it("should move folders across devices, even with special characters", function (done) {
+    overrideFsRename();
+    mv("test/a-folder", "test/a-*", function (err) {
+      assert.ifError(err);
+      fs.readFile("test/a-*/another-folder/file3", 'utf8', function (err, contents) {
+        assert.ifError(err);
+        assert.strictEqual(contents, "knuckles\n");
+        // move it back
+        mv("test/a-*", "test/a-folder", function(err) {
+          assert.ifError(err);
+          fs.readFile("test/a-folder/another-folder/file3", 'utf8', function (err, contents) {
+            assert.ifError(err);
+            assert.strictEqual(contents, "knuckles\n");
+            restoreFsRename();
+            done(err);
+          });
+        });
+      });
+    });
+  });
+});
diff --git a/wrt/node_modules/natives/README.md b/wrt/node_modules/natives/README.md
new file mode 100644 (file)
index 0000000..6fc4424
--- /dev/null
@@ -0,0 +1,64 @@
+# natives
+
+Do stuff with Node.js's native JavaScript modules
+
+## Caveat
+
+Dear Beloved User,
+
+I feel compelled to give you a word of warning if you are considering
+using this module.
+
+This module lets you do some creative things with the JavaScript code
+in Node.js.  There are some things here that are basically a recipe
+for memory leaks, or at the very least, being broken with each new
+release of Node, since none of these API surfaces are "technically"
+"supported" by the team managing the Node.js project.
+
+This module does not ship a _copy_ of Node's internals.  It does its
+thing by using the exposed source code that lives in Node.js itself.
+So, running this on different versions of Node.js will produce
+different results.
+
+When your program is broken by changes to Node's internals, or when
+Node changes in such a way that this module becomes fundamentally
+broken, you will likely get little sympathy.  Many people in the Node
+community consider this sort of behavior to be unwise and unseemly, if
+not outright hostile and morally wrong.
+
+At the very least, you probably just want to run Node with the
+(undocumented!) `--expose-internals` flag, rather than go to such
+lengths.
+
+Don't use unless you know what you're doing, or at least, are ok with
+the risks.  Don't say I didn't warn you.
+
+Eternally Yours in OSS,  
+Isaac Z. Schlueter
+
+## USAGE
+
+```javascript
+var natives = require('natives')
+
+// get the source code
+var fsCode = natives.source('fs')
+
+// get a evaluated copy of the module
+var fsCopy = natives.require('fs')
+
+// you can pass in a whitelist to NOT shim certain things
+var fsCopyWithNativeStreams = natives.require('fs', ['stream'])
+
+// note that this is not the same as the "real" fs
+assert(fsCopy !== require('fs'))
+
+// but it does have all the same entries
+fsCopy.readFileSync(__filename, 'utf8') // etc
+```
+
+## Another Caveat
+
+You can't use this to override `require("buffer")` because everything
+depends on `Buffer.isBuffer` working properly, so it's important for
+that one to be given a pass.
diff --git a/wrt/node_modules/natives/index.js b/wrt/node_modules/natives/index.js
new file mode 100644 (file)
index 0000000..6751390
--- /dev/null
@@ -0,0 +1,115 @@
+var natives = process.binding('natives')
+var module = require('module')
+var normalRequire = require
+exports.source = src
+exports.require = req
+var vm = require('vm')
+
+// fallback for 0.x support
+var runInThisContext, ContextifyScript, Script
+/*istanbul ignore next*/
+try {
+  ContextifyScript = process.binding('contextify').ContextifyScript;
+  runInThisContext = function runInThisContext(code, options) {
+    var script = new ContextifyScript(code, options);
+    return script.runInThisContext();
+  }
+} catch (er) {
+  Script = process.binding('evals').NodeScript;
+  runInThisContext = Script.runInThisContext;
+}
+
+var wrap = [
+  '(function (exports, require, module, __filename, __dirname) { ',
+  '\n});'
+];
+
+
+// Basically the same functionality as node's (buried deep)
+// NativeModule class, but without caching, or internal/ blocking,
+// or a class, since that's not really necessary.  I assume that if
+// you're loading something with this module, it's because you WANT
+// a separate copy.  However, to preserve semantics, any require()
+// calls made throughout the internal module load IS cached.
+function req (id, whitelist) {
+  var cache = Object.create(null)
+
+  if (Array.isArray(whitelist)) {
+    // a whitelist of things to pull from the "actual" native modules
+    whitelist.forEach(function (id) {
+      cache[id] = {
+        loading: false,
+        loaded: true,
+        filename: id + '.js',
+        exports: require(id)
+      }
+    })
+  }
+
+  return req_(id, cache)
+}
+
+function req_ (id, cache) {
+  // Buffer is special, because it's a type rather than a "normal"
+  // class, and many things depend on `Buffer.isBuffer` working.
+  if (id === 'buffer') {
+    return require('buffer')
+  }
+
+  // native_module isn't actually a natives binding.
+  // weird, right?
+  if (id === 'native_module') {
+    return {
+      getSource: src,
+      wrap: function (script) {
+        return wrap[0] + script + wrap[1]
+      },
+      wrapper: wrap,
+      _cache: cache
+    }
+  }
+
+  var source = src(id)
+  if (!source) {
+    return undefined
+  }
+  source = wrap[0] + source + wrap[1]
+
+  var cachingRequire = function require (id) {
+    if (cache[id]) {
+      return cache[id].exports
+    }
+    return req_(id, cache)
+  }
+
+  var nm = {
+    exports: {},
+    loading: true,
+    loaded: false,
+    filename: id + '.js'
+  }
+  cache[id] = nm
+  var fn
+  try {
+    /* istanbul ignore else */
+    if (ContextifyScript) {
+      fn = runInThisContext(source, {
+        filename: nm.filename,
+        lineOffset: 0,
+        displayErrors: true
+      });
+    } else {
+      fn = runInThisContext(source, nm.filename, true);
+    }
+    fn(nm.exports, cachingRequire, nm, nm.filename)
+    nm.loaded = true
+  } finally {
+    nm.loading = false
+  }
+
+  return nm.exports
+}
+
+function src (id) {
+  return natives[id]
+}
diff --git a/wrt/node_modules/natives/package.json b/wrt/node_modules/natives/package.json
new file mode 100644 (file)
index 0000000..6b66500
--- /dev/null
@@ -0,0 +1,90 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "natives@^1.1.0",
+        "scope": null,
+        "escapedName": "natives",
+        "name": "natives",
+        "rawSpec": "^1.1.0",
+        "spec": ">=1.1.0 <2.0.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/graceful-fs"
+    ]
+  ],
+  "_from": "natives@>=1.1.0 <2.0.0",
+  "_id": "natives@1.1.0",
+  "_inCache": true,
+  "_location": "/natives",
+  "_nodeVersion": "6.5.0",
+  "_npmOperationalInternal": {
+    "host": "packages-16-east.internal.npmjs.com",
+    "tmp": "tmp/natives-1.1.0.tgz_1472583645072_0.9239758928306401"
+  },
+  "_npmUser": {
+    "name": "isaacs",
+    "email": "i@izs.me"
+  },
+  "_npmVersion": "3.10.7",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "natives@^1.1.0",
+    "scope": null,
+    "escapedName": "natives",
+    "name": "natives",
+    "rawSpec": "^1.1.0",
+    "spec": ">=1.1.0 <2.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/graceful-fs"
+  ],
+  "_resolved": "https://registry.npmjs.org/natives/-/natives-1.1.0.tgz",
+  "_shasum": "e9ff841418a6b2ec7a495e939984f78f163e6e31",
+  "_shrinkwrap": null,
+  "_spec": "natives@^1.1.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/graceful-fs",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bugs": {
+    "url": "https://github.com/isaacs/natives/issues"
+  },
+  "dependencies": {},
+  "description": "Do stuff with Node.js's native JavaScript modules",
+  "devDependencies": {
+    "tap": "^7.0.0"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "e9ff841418a6b2ec7a495e939984f78f163e6e31",
+    "tarball": "https://registry.npmjs.org/natives/-/natives-1.1.0.tgz"
+  },
+  "files": [
+    "index.js"
+  ],
+  "gitHead": "dc1297cdce008350b679dbb86be5bf5bbf8cacbf",
+  "homepage": "https://github.com/isaacs/natives#readme",
+  "license": "ISC",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "isaacs",
+      "email": "i@izs.me"
+    }
+  ],
+  "name": "natives",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/isaacs/natives.git"
+  },
+  "scripts": {
+    "test": "tap test/*.js --100"
+  },
+  "version": "1.1.0"
+}
diff --git a/wrt/node_modules/ncp/.npmignore b/wrt/node_modules/ncp/.npmignore
new file mode 100644 (file)
index 0000000..3e6a4d7
--- /dev/null
@@ -0,0 +1,4 @@
+node_modules
+.*.sw[op]
+.DS_Store
+test/*fixtures/out
diff --git a/wrt/node_modules/ncp/.travis.yml b/wrt/node_modules/ncp/.travis.yml
new file mode 100644 (file)
index 0000000..a6e2198
--- /dev/null
@@ -0,0 +1,6 @@
+language: node_js
+
+node_js:
+  - 0.8
+  - "0.10"
+  - "0.11"
diff --git a/wrt/node_modules/ncp/LICENSE.md b/wrt/node_modules/ncp/LICENSE.md
new file mode 100644 (file)
index 0000000..e2b9b41
--- /dev/null
@@ -0,0 +1,21 @@
+# MIT License
+
+###Copyright (C) 2011 by Charlie McConnell
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/ncp/README.md b/wrt/node_modules/ncp/README.md
new file mode 100644 (file)
index 0000000..9480032
--- /dev/null
@@ -0,0 +1,63 @@
+# ncp - Asynchronous recursive file & directory copying
+
+[![Build Status](https://secure.travis-ci.org/AvianFlu/ncp.png)](http://travis-ci.org/AvianFlu/ncp)
+
+Think `cp -r`, but pure node, and asynchronous.  `ncp` can be used both as a CLI tool and programmatically.
+
+## Command Line usage
+
+Usage is simple: `ncp [source] [dest] [--limit=concurrency limit]
+[--filter=filter] --stopOnErr`
+
+The 'filter' is a Regular Expression - matched files will be copied.
+
+The 'concurrency limit' is an integer that represents how many pending file system requests `ncp` has at a time.
+
+'stoponerr' is a boolean flag that will tell `ncp` to stop immediately if any
+errors arise, rather than attempting to continue while logging errors. The default behavior is to complete as many copies as possible, logging errors along the way.
+
+If there are no errors, `ncp` will output `done.` when complete.  If there are errors, the error messages will be logged to `stdout` and to `./ncp-debug.log`, and the copy operation will attempt to continue.
+
+## Programmatic usage
+
+Programmatic usage of `ncp` is just as simple.  The only argument to the completion callback is a possible error.  
+
+```javascript
+var ncp = require('ncp').ncp;
+
+ncp.limit = 16;
+
+ncp(source, destination, function (err) {
+ if (err) {
+   return console.error(err);
+ }
+ console.log('done!');
+});
+```
+
+You can also call ncp like `ncp(source, destination, options, callback)`. 
+`options` should be a dictionary. Currently, such options are available:
+
+  * `options.filter` - a `RegExp` instance, against which each file name is
+  tested to determine whether to copy it or not, or a function taking single
+  parameter: copied file name, returning `true` or `false`, determining
+  whether to copy file or not.
+
+  * `options.transform` - a function: `function (read, write) { read.pipe(write) }`
+  used to apply streaming transforms while copying.
+
+  * `options.clobber` - boolean=true. if set to false, `ncp` will not overwrite 
+  destination files that already exist.
+
+  * `options.dereference` - boolean=false. If set to true, `ncp` will follow symbolic
+  links. For example, a symlink in the source tree pointing to a regular file
+  will become a regular file in the destination tree. Broken symlinks will result in
+  errors.
+
+  * `options.stopOnErr` - boolean=false.  If set to true, `ncp` will behave like `cp -r`,
+  and stop on the first error it encounters. By default, `ncp` continues copying, logging all
+  errors and returning an array.
+
+  * `options.errs` - stream. If `options.stopOnErr` is `false`, a stream can be provided, and errors will be written to this stream.
+
+Please open an issue if any bugs arise.  As always, I accept (working) pull requests, and refunds are available at `/dev/null`.
diff --git a/wrt/node_modules/ncp/bin/ncp b/wrt/node_modules/ncp/bin/ncp
new file mode 100755 (executable)
index 0000000..388eaba
--- /dev/null
@@ -0,0 +1,48 @@
+#!/usr/bin/env node
+
+
+
+
+var ncp = require('../lib/ncp'),
+    args = process.argv.slice(2),
+    source, dest;
+
+if (args.length < 2) {
+  console.error('Usage: ncp [source] [destination] [--filter=filter] [--limit=concurrency limit]');
+  process.exit(1);
+}
+
+// parse arguments the hard way
+function startsWith(str, prefix) {
+  return str.substr(0, prefix.length) == prefix;
+}
+
+var options = {};
+args.forEach(function (arg) {
+  if (startsWith(arg, "--limit=")) {
+    options.limit = parseInt(arg.split('=', 2)[1], 10);
+  }
+  if (startsWith(arg, "--filter=")) {
+    options.filter = new RegExp(arg.split('=', 2)[1]);
+  }
+  if (startsWith(arg, "--stoponerr")) {
+    options.stopOnErr = true;
+  }
+});
+
+ncp.ncp(args[0], args[1], options, function (err) {
+  if (Array.isArray(err)) {
+    console.error('There were errors during the copy.');
+    err.forEach(function (err) {
+      console.error(err.stack || err.message);
+    });
+    process.exit(1);
+  }
+  else if (err) {
+    console.error('An error has occurred.');
+    console.error(err.stack || err.message);
+    process.exit(1);
+  }
+});
+
+
diff --git a/wrt/node_modules/ncp/lib/ncp.js b/wrt/node_modules/ncp/lib/ncp.js
new file mode 100644 (file)
index 0000000..96eed47
--- /dev/null
@@ -0,0 +1,261 @@
+var fs = require('fs'),
+    path = require('path');
+
+module.exports = ncp;
+ncp.ncp = ncp;
+
+function ncp (source, dest, options, callback) {
+  var cback = callback;
+
+  if (!callback) {
+    cback = options;
+    options = {};
+  }
+
+  var basePath = process.cwd(),
+      currentPath = path.resolve(basePath, source),
+      targetPath = path.resolve(basePath, dest),
+      filter = options.filter,
+      rename = options.rename,
+      transform = options.transform,
+      clobber = options.clobber !== false,
+      modified = options.modified,
+      dereference = options.dereference,
+      errs = null,
+      started = 0,
+      finished = 0,
+      running = 0,
+      limit = options.limit || ncp.limit || 16;
+
+  limit = (limit < 1) ? 1 : (limit > 512) ? 512 : limit;
+
+  startCopy(currentPath);
+  
+  function startCopy(source) {
+    started++;
+    if (filter) {
+      if (filter instanceof RegExp) {
+        if (!filter.test(source)) {
+          return cb(true);
+        }
+      }
+      else if (typeof filter === 'function') {
+        if (!filter(source)) {
+          return cb(true);
+        }
+      }
+    }
+    return getStats(source);
+  }
+
+  function getStats(source) {
+    var stat = dereference ? fs.stat : fs.lstat;
+    if (running >= limit) {
+      return setImmediate(function () {
+        getStats(source);
+      });
+    }
+    running++;
+    stat(source, function (err, stats) {
+      var item = {};
+      if (err) {
+        return onError(err);
+      }
+
+      // We need to get the mode from the stats object and preserve it.
+      item.name = source;
+      item.mode = stats.mode;
+      item.mtime = stats.mtime; //modified time
+      item.atime = stats.atime; //access time
+
+      if (stats.isDirectory()) {
+        return onDir(item);
+      }
+      else if (stats.isFile()) {
+        return onFile(item);
+      }
+      else if (stats.isSymbolicLink()) {
+        // Symlinks don't really need to know about the mode.
+        return onLink(source);
+      }
+    });
+  }
+
+  function onFile(file) {
+    var target = file.name.replace(currentPath, targetPath);
+    if(rename) {
+      target =  rename(target);
+    }
+    isWritable(target, function (writable) {
+      if (writable) {
+        return copyFile(file, target);
+      }
+      if(clobber) {
+        rmFile(target, function () {
+          copyFile(file, target);
+        });
+      }
+      if (modified) {
+        var stat = dereference ? fs.stat : fs.lstat;
+        stat(target, function(err, stats) {
+            //if souce modified time greater to target modified time copy file
+            if (file.mtime.getTime()>stats.mtime.getTime())
+                copyFile(file, target);
+            else return cb();
+        });
+      }
+      else {
+        return cb();
+      }
+    });
+  }
+
+  function copyFile(file, target) {
+    var readStream = fs.createReadStream(file.name),
+        writeStream = fs.createWriteStream(target, { mode: file.mode });
+    
+    readStream.on('error', onError);
+    writeStream.on('error', onError);
+    
+    if(transform) {
+      transform(readStream, writeStream, file);
+    } else {
+      writeStream.on('open', function() {
+        readStream.pipe(writeStream);
+      });
+    }
+    writeStream.once('finish', function() {
+        if (modified) {
+            //target file modified date sync.
+            fs.utimesSync(target, file.atime, file.mtime);
+            cb();
+        }
+        else cb();
+    });
+  }
+
+  function rmFile(file, done) {
+    fs.unlink(file, function (err) {
+      if (err) {
+        return onError(err);
+      }
+      return done();
+    });
+  }
+
+  function onDir(dir) {
+    var target = dir.name.replace(currentPath, targetPath);
+    isWritable(target, function (writable) {
+      if (writable) {
+        return mkDir(dir, target);
+      }
+      copyDir(dir.name);
+    });
+  }
+
+  function mkDir(dir, target) {
+    fs.mkdir(target, dir.mode, function (err) {
+      if (err) {
+        return onError(err);
+      }
+      copyDir(dir.name);
+    });
+  }
+
+  function copyDir(dir) {
+    fs.readdir(dir, function (err, items) {
+      if (err) {
+        return onError(err);
+      }
+      items.forEach(function (item) {
+        startCopy(path.join(dir, item));
+      });
+      return cb();
+    });
+  }
+
+  function onLink(link) {
+    var target = link.replace(currentPath, targetPath);
+    fs.readlink(link, function (err, resolvedPath) {
+      if (err) {
+        return onError(err);
+      }
+      checkLink(resolvedPath, target);
+    });
+  }
+
+  function checkLink(resolvedPath, target) {
+    if (dereference) {
+      resolvedPath = path.resolve(basePath, resolvedPath);
+    }
+    isWritable(target, function (writable) {
+      if (writable) {
+        return makeLink(resolvedPath, target);
+      }
+      fs.readlink(target, function (err, targetDest) {
+        if (err) {
+          return onError(err);
+        }
+        if (dereference) {
+          targetDest = path.resolve(basePath, targetDest);
+        }
+        if (targetDest === resolvedPath) {
+          return cb();
+        }
+        return rmFile(target, function () {
+          makeLink(resolvedPath, target);
+        });
+      });
+    });
+  }
+
+  function makeLink(linkPath, target) {
+    fs.symlink(linkPath, target, function (err) {
+      if (err) {
+        return onError(err);
+      }
+      return cb();
+    });
+  }
+
+  function isWritable(path, done) {
+    fs.lstat(path, function (err) {
+      if (err) {
+        if (err.code === 'ENOENT') return done(true);
+        return done(false);
+      }
+      return done(false);
+    });
+  }
+
+  function onError(err) {
+    if (options.stopOnError) {
+      return cback(err);
+    }
+    else if (!errs && options.errs) {
+      errs = fs.createWriteStream(options.errs);
+    }
+    else if (!errs) {
+      errs = [];
+    }
+    if (typeof errs.write === 'undefined') {
+      errs.push(err);
+    }
+    else { 
+      errs.write(err.stack + '\n\n');
+    }
+    return cb();
+  }
+
+  function cb(skipped) {
+    if (!skipped) running--;
+    finished++;
+    if ((started === finished) && (running === 0)) {
+      if (cback !== undefined ) {
+        return errs ? cback(errs) : cback(null);
+      }
+    }
+  }
+}
+
+
diff --git a/wrt/node_modules/ncp/package.json b/wrt/node_modules/ncp/package.json
new file mode 100644 (file)
index 0000000..2c192a2
--- /dev/null
@@ -0,0 +1,98 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "ncp@~2.0.0",
+        "scope": null,
+        "escapedName": "ncp",
+        "name": "ncp",
+        "rawSpec": "~2.0.0",
+        "spec": ">=2.0.0 <2.1.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/mv"
+    ]
+  ],
+  "_from": "ncp@>=2.0.0 <2.1.0",
+  "_id": "ncp@2.0.0",
+  "_inCache": true,
+  "_location": "/ncp",
+  "_nodeVersion": "0.13.0-pre",
+  "_npmUser": {
+    "name": "mmalecki",
+    "email": "me@mmalecki.com"
+  },
+  "_npmVersion": "2.6.0",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "ncp@~2.0.0",
+    "scope": null,
+    "escapedName": "ncp",
+    "name": "ncp",
+    "rawSpec": "~2.0.0",
+    "spec": ">=2.0.0 <2.1.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/mv"
+  ],
+  "_resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz",
+  "_shasum": "195a21d6c46e361d2fb1281ba38b91e9df7bdbb3",
+  "_shrinkwrap": null,
+  "_spec": "ncp@~2.0.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/mv",
+  "author": {
+    "name": "AvianFlu",
+    "email": "charlie@charlieistheman.com"
+  },
+  "bin": {
+    "ncp": "./bin/ncp"
+  },
+  "bugs": {
+    "url": "https://github.com/AvianFlu/ncp/issues"
+  },
+  "dependencies": {},
+  "description": "Asynchronous recursive file copy utility.",
+  "devDependencies": {
+    "mocha": "1.15.x",
+    "read-dir-files": "0.0.x",
+    "rimraf": "1.0.x"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "195a21d6c46e361d2fb1281ba38b91e9df7bdbb3",
+    "tarball": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz"
+  },
+  "engine": {
+    "node": ">=0.10"
+  },
+  "gitHead": "93c7c6c719e2a4944dc09a16178b09aef428cdf0",
+  "homepage": "https://github.com/AvianFlu/ncp",
+  "keywords": [
+    "cli",
+    "copy"
+  ],
+  "license": "MIT",
+  "main": "./lib/ncp.js",
+  "maintainers": [
+    {
+      "name": "avianflu",
+      "email": "charlie@charlieistheman.com"
+    },
+    {
+      "name": "mmalecki",
+      "email": "me@mmalecki.com"
+    }
+  ],
+  "name": "ncp",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/AvianFlu/ncp.git"
+  },
+  "scripts": {
+    "test": "mocha -R spec"
+  },
+  "version": "2.0.0"
+}
diff --git a/wrt/node_modules/ncp/test/modified-files/out/a b/wrt/node_modules/ncp/test/modified-files/out/a
new file mode 100644 (file)
index 0000000..29f446a
--- /dev/null
@@ -0,0 +1 @@
+test3
\ No newline at end of file
diff --git a/wrt/node_modules/ncp/test/modified-files/src/a b/wrt/node_modules/ncp/test/modified-files/src/a
new file mode 100644 (file)
index 0000000..29f446a
--- /dev/null
@@ -0,0 +1 @@
+test3
\ No newline at end of file
diff --git a/wrt/node_modules/ncp/test/ncp.js b/wrt/node_modules/ncp/test/ncp.js
new file mode 100644 (file)
index 0000000..bc6df22
--- /dev/null
@@ -0,0 +1,197 @@
+
+
+var assert = require('assert'),
+    fs = require('fs'),
+    path = require('path'),
+    rimraf = require('rimraf'),
+    readDirFiles = require('read-dir-files'),
+    util = require('util'),
+    ncp = require('../').ncp;
+
+
+
+describe('ncp', function () {
+  describe('regular files and directories', function () {
+    var fixtures = path.join(__dirname, 'regular-fixtures'),
+        src = path.join(fixtures, 'src'),
+        out = path.join(fixtures, 'out');
+
+    before(function (cb) {
+      rimraf(out, function() {
+        ncp(src, out, cb);
+      });
+    });
+
+    describe('when copying a directory of files', function () {
+      it('files are copied correctly', function (cb) {
+        readDirFiles(src, 'utf8', function (srcErr, srcFiles) {
+          readDirFiles(out, 'utf8', function (outErr, outFiles) {
+            assert.ifError(srcErr);
+            assert.deepEqual(srcFiles, outFiles);
+            cb();
+          });
+        });
+      });
+    });
+
+    describe('when copying files using filter', function () {
+      before(function (cb) {
+        var filter = function(name) {
+          return name.substr(name.length - 1) != 'a';
+        };
+        rimraf(out, function () {
+          ncp(src, out, {filter: filter}, cb);
+        });
+      });
+
+      it('files are copied correctly', function (cb) {
+        readDirFiles(src, 'utf8', function (srcErr, srcFiles) {
+          function filter(files) {
+            for (var fileName in files) {
+              var curFile = files[fileName];
+              if (curFile instanceof Object)
+                return filter(curFile);
+              if (fileName.substr(fileName.length - 1) == 'a')
+                delete files[fileName];
+            }
+          }
+          filter(srcFiles);
+          readDirFiles(out, 'utf8', function (outErr, outFiles) {
+            assert.ifError(outErr);
+            assert.deepEqual(srcFiles, outFiles);
+            cb();
+          });
+        });
+      });
+    });
+
+    describe('when using clobber=false', function () {
+      it('the copy is completed successfully', function (cb) {
+        ncp(src, out, function() {
+          ncp(src, out, {clobber: false}, function(err) {
+            assert.ifError(err);
+            cb();
+          });
+        });
+      });
+    });
+
+    describe('when using transform', function () {
+      it('file descriptors are passed correctly', function (cb) {
+        ncp(src, out, {
+           transform: function(read,write,file) {
+              assert.notEqual(file.name, undefined);
+              assert.strictEqual(typeof file.mode,'number');
+              read.pipe(write);
+           }
+        }, cb);
+      });
+    });
+
+    describe('when using rename', function() {
+      it('output files are correctly redirected', function(cb) {
+        ncp(src, out, {
+          rename: function(target) {
+            if(path.basename(target) == 'a') return path.resolve(path.dirname(target), 'z');
+            return target;
+          }
+        }, function(err) {
+          if(err) return cb(err);
+
+          readDirFiles(src, 'utf8', function (srcErr, srcFiles) {
+            readDirFiles(out, 'utf8', function (outErr, outFiles) {
+              assert.ifError(srcErr);
+              assert.deepEqual(srcFiles.a, outFiles.z);
+              cb();
+            });
+          });
+        });
+      });
+    });
+  });
+
+  describe('symlink handling', function () {
+    var fixtures = path.join(__dirname, 'symlink-fixtures'),
+        src = path.join(fixtures, 'src'),
+        out = path.join(fixtures, 'out');
+
+    beforeEach(function (cb) {
+      rimraf(out, cb);
+    });
+
+    it('copies symlinks by default', function (cb) {
+      ncp(src, out, function (err) {
+        if (err) return cb(err);
+        assert.equal(fs.readlinkSync(path.join(out, 'file-symlink')), 'foo');
+        assert.equal(fs.readlinkSync(path.join(out, 'dir-symlink')), 'dir');
+        cb();
+      })
+    });
+
+    it('copies file contents when dereference=true', function (cb) {
+      ncp(src, out, { dereference: true }, function (err) {
+        var fileSymlinkPath = path.join(out, 'file-symlink');
+        assert.ok(fs.lstatSync(fileSymlinkPath).isFile());
+        assert.equal(fs.readFileSync(fileSymlinkPath), 'foo contents');
+
+        var dirSymlinkPath = path.join(out, 'dir-symlink');
+        assert.ok(fs.lstatSync(dirSymlinkPath).isDirectory());
+        assert.deepEqual(fs.readdirSync(dirSymlinkPath), ['bar']);
+
+        cb();
+      });
+    });
+  });
+
+  describe('broken symlink handling', function () {
+    var fixtures = path.join(__dirname, 'broken-symlink-fixtures'),
+        src = path.join(fixtures, 'src'),
+        out = path.join(fixtures, 'out');
+
+    beforeEach(function (cb) {
+      rimraf(out, cb);
+    });
+
+    it('copies broken symlinks by default', function (cb) {
+      ncp(src, out, function (err) {
+        if (err) return cb(err);
+        assert.equal(fs.readlinkSync(path.join(out, 'broken-symlink')), 'does-not-exist');
+        cb();
+      })
+    });
+
+    it('returns an error when dereference=true', function (cb) {
+      ncp(src, out, {dereference: true}, function (err) {
+        assert.equal(err.length, 1);
+        assert.equal(err[0].code, 'ENOENT');
+        cb();
+      });
+    });
+  });
+
+  describe('modified files copies', function () {
+      var fixtures = path.join(__dirname, 'modified-files'),
+          src = path.join(fixtures, 'src'),
+          out = path.join(fixtures, 'out');
+
+      it('if file not exists copy file to target', function(cb) {
+          rimraf(out, function() {
+              ncp(src, out, {modified: true, clobber: false}, function (err) {
+                  assert.equal(fs.existsSync(out), true);
+                  cb();
+              });
+          });
+      });
+
+      it('change source file mtime and copy', function(cb) {
+          fs.utimesSync(src+"/a", new Date().getTime()/1000, new Date('2015-01-01 00:00:00').getTime()/1000);
+          ncp(src, out, {modified: true, clobber: false}, function (err) {
+              fs.stat(out+"/a", function(err, stats) {
+                  assert.equal(stats.mtime.getTime(), new Date('2015-01-01 00:00:00').getTime());
+                  cb();
+              });
+          });
+      });
+
+  });
+});
\ No newline at end of file
diff --git a/wrt/node_modules/ncp/test/regular-fixtures/src/a b/wrt/node_modules/ncp/test/regular-fixtures/src/a
new file mode 100644 (file)
index 0000000..802992c
--- /dev/null
@@ -0,0 +1 @@
+Hello world
diff --git a/wrt/node_modules/ncp/test/regular-fixtures/src/b b/wrt/node_modules/ncp/test/regular-fixtures/src/b
new file mode 100644 (file)
index 0000000..9f6bb18
--- /dev/null
@@ -0,0 +1 @@
+Hello ncp
diff --git a/wrt/node_modules/ncp/test/regular-fixtures/src/c b/wrt/node_modules/ncp/test/regular-fixtures/src/c
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/wrt/node_modules/ncp/test/regular-fixtures/src/d b/wrt/node_modules/ncp/test/regular-fixtures/src/d
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/wrt/node_modules/ncp/test/regular-fixtures/src/e b/wrt/node_modules/ncp/test/regular-fixtures/src/e
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/wrt/node_modules/ncp/test/regular-fixtures/src/f b/wrt/node_modules/ncp/test/regular-fixtures/src/f
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/wrt/node_modules/ncp/test/regular-fixtures/src/sub/a b/wrt/node_modules/ncp/test/regular-fixtures/src/sub/a
new file mode 100644 (file)
index 0000000..cf291b5
--- /dev/null
@@ -0,0 +1 @@
+Hello nodejitsu
diff --git a/wrt/node_modules/ncp/test/regular-fixtures/src/sub/b b/wrt/node_modules/ncp/test/regular-fixtures/src/sub/b
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/wrt/node_modules/ncp/test/symlink-fixtures/src/dir/bar b/wrt/node_modules/ncp/test/symlink-fixtures/src/dir/bar
new file mode 100644 (file)
index 0000000..fd06f5f
--- /dev/null
@@ -0,0 +1 @@
+bar contents
\ No newline at end of file
diff --git a/wrt/node_modules/ncp/test/symlink-fixtures/src/foo b/wrt/node_modules/ncp/test/symlink-fixtures/src/foo
new file mode 100644 (file)
index 0000000..35fc060
--- /dev/null
@@ -0,0 +1 @@
+foo contents
\ No newline at end of file
diff --git a/wrt/node_modules/negotiator/HISTORY.md b/wrt/node_modules/negotiator/HISTORY.md
new file mode 100644 (file)
index 0000000..10b6917
--- /dev/null
@@ -0,0 +1,98 @@
+0.6.1 / 2016-05-02
+==================
+
+  * perf: improve `Accept` parsing speed
+  * perf: improve `Accept-Charset` parsing speed
+  * perf: improve `Accept-Encoding` parsing speed
+  * perf: improve `Accept-Language` parsing speed
+
+0.6.0 / 2015-09-29
+==================
+
+  * Fix including type extensions in parameters in `Accept` parsing
+  * Fix parsing `Accept` parameters with quoted equals
+  * Fix parsing `Accept` parameters with quoted semicolons
+  * Lazy-load modules from main entry point
+  * perf: delay type concatenation until needed
+  * perf: enable strict mode
+  * perf: hoist regular expressions
+  * perf: remove closures getting spec properties
+  * perf: remove a closure from media type parsing
+  * perf: remove property delete from media type parsing
+
+0.5.3 / 2015-05-10
+==================
+
+  * Fix media type parameter matching to be case-insensitive
+
+0.5.2 / 2015-05-06
+==================
+
+  * Fix comparing media types with quoted values
+  * Fix splitting media types with quoted commas
+
+0.5.1 / 2015-02-14
+==================
+
+  * Fix preference sorting to be stable for long acceptable lists
+
+0.5.0 / 2014-12-18
+==================
+
+  * Fix list return order when large accepted list
+  * Fix missing identity encoding when q=0 exists
+  * Remove dynamic building of Negotiator class
+
+0.4.9 / 2014-10-14
+==================
+
+  * Fix error when media type has invalid parameter
+
+0.4.8 / 2014-09-28
+==================
+
+  * Fix all negotiations to be case-insensitive
+  * Stable sort preferences of same quality according to client order
+  * Support Node.js 0.6
+
+0.4.7 / 2014-06-24
+==================
+
+  * Handle invalid provided languages
+  * Handle invalid provided media types
+
+0.4.6 / 2014-06-11
+==================
+
+  *  Order by specificity when quality is the same
+
+0.4.5 / 2014-05-29
+==================
+
+  * Fix regression in empty header handling
+
+0.4.4 / 2014-05-29
+==================
+
+  * Fix behaviors when headers are not present
+
+0.4.3 / 2014-04-16
+==================
+
+  * Handle slashes on media params correctly
+
+0.4.2 / 2014-02-28
+==================
+
+  * Fix media type sorting
+  * Handle media types params strictly
+
+0.4.1 / 2014-01-16
+==================
+
+  * Use most specific matches
+
+0.4.0 / 2014-01-09
+==================
+
+  * Remove preferred prefix from methods
diff --git a/wrt/node_modules/negotiator/LICENSE b/wrt/node_modules/negotiator/LICENSE
new file mode 100644 (file)
index 0000000..ea6b9e2
--- /dev/null
@@ -0,0 +1,24 @@
+(The MIT License)
+
+Copyright (c) 2012-2014 Federico Romero
+Copyright (c) 2012-2014 Isaac Z. Schlueter
+Copyright (c) 2014-2015 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/negotiator/README.md b/wrt/node_modules/negotiator/README.md
new file mode 100644 (file)
index 0000000..04a67ff
--- /dev/null
@@ -0,0 +1,203 @@
+# negotiator
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+An HTTP content negotiator for Node.js
+
+## Installation
+
+```sh
+$ npm install negotiator
+```
+
+## API
+
+```js
+var Negotiator = require('negotiator')
+```
+
+### Accept Negotiation
+
+```js
+availableMediaTypes = ['text/html', 'text/plain', 'application/json']
+
+// The negotiator constructor receives a request object
+negotiator = new Negotiator(request)
+
+// Let's say Accept header is 'text/html, application/*;q=0.2, image/jpeg;q=0.8'
+
+negotiator.mediaTypes()
+// -> ['text/html', 'image/jpeg', 'application/*']
+
+negotiator.mediaTypes(availableMediaTypes)
+// -> ['text/html', 'application/json']
+
+negotiator.mediaType(availableMediaTypes)
+// -> 'text/html'
+```
+
+You can check a working example at `examples/accept.js`.
+
+#### Methods
+
+##### mediaType()
+
+Returns the most preferred media type from the client.
+
+##### mediaType(availableMediaType)
+
+Returns the most preferred media type from a list of available media types.
+
+##### mediaTypes()
+
+Returns an array of preferred media types ordered by the client preference.
+
+##### mediaTypes(availableMediaTypes)
+
+Returns an array of preferred media types ordered by priority from a list of
+available media types.
+
+### Accept-Language Negotiation
+
+```js
+negotiator = new Negotiator(request)
+
+availableLanguages = ['en', 'es', 'fr']
+
+// Let's say Accept-Language header is 'en;q=0.8, es, pt'
+
+negotiator.languages()
+// -> ['es', 'pt', 'en']
+
+negotiator.languages(availableLanguages)
+// -> ['es', 'en']
+
+language = negotiator.language(availableLanguages)
+// -> 'es'
+```
+
+You can check a working example at `examples/language.js`.
+
+#### Methods
+
+##### language()
+
+Returns the most preferred language from the client.
+
+##### language(availableLanguages)
+
+Returns the most preferred language from a list of available languages.
+
+##### languages()
+
+Returns an array of preferred languages ordered by the client preference.
+
+##### languages(availableLanguages)
+
+Returns an array of preferred languages ordered by priority from a list of
+available languages.
+
+### Accept-Charset Negotiation
+
+```js
+availableCharsets = ['utf-8', 'iso-8859-1', 'iso-8859-5']
+
+negotiator = new Negotiator(request)
+
+// Let's say Accept-Charset header is 'utf-8, iso-8859-1;q=0.8, utf-7;q=0.2'
+
+negotiator.charsets()
+// -> ['utf-8', 'iso-8859-1', 'utf-7']
+
+negotiator.charsets(availableCharsets)
+// -> ['utf-8', 'iso-8859-1']
+
+negotiator.charset(availableCharsets)
+// -> 'utf-8'
+```
+
+You can check a working example at `examples/charset.js`.
+
+#### Methods
+
+##### charset()
+
+Returns the most preferred charset from the client.
+
+##### charset(availableCharsets)
+
+Returns the most preferred charset from a list of available charsets.
+
+##### charsets()
+
+Returns an array of preferred charsets ordered by the client preference.
+
+##### charsets(availableCharsets)
+
+Returns an array of preferred charsets ordered by priority from a list of
+available charsets.
+
+### Accept-Encoding Negotiation
+
+```js
+availableEncodings = ['identity', 'gzip']
+
+negotiator = new Negotiator(request)
+
+// Let's say Accept-Encoding header is 'gzip, compress;q=0.2, identity;q=0.5'
+
+negotiator.encodings()
+// -> ['gzip', 'identity', 'compress']
+
+negotiator.encodings(availableEncodings)
+// -> ['gzip', 'identity']
+
+negotiator.encoding(availableEncodings)
+// -> 'gzip'
+```
+
+You can check a working example at `examples/encoding.js`.
+
+#### Methods
+
+##### encoding()
+
+Returns the most preferred encoding from the client.
+
+##### encoding(availableEncodings)
+
+Returns the most preferred encoding from a list of available encodings.
+
+##### encodings()
+
+Returns an array of preferred encodings ordered by the client preference.
+
+##### encodings(availableEncodings)
+
+Returns an array of preferred encodings ordered by priority from a list of
+available encodings.
+
+## See Also
+
+The [accepts](https://npmjs.org/package/accepts#readme) module builds on
+this module and provides an alternative interface, mime type validation,
+and more.
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/negotiator.svg
+[npm-url]: https://npmjs.org/package/negotiator
+[node-version-image]: https://img.shields.io/node/v/negotiator.svg
+[node-version-url]: https://nodejs.org/en/download/
+[travis-image]: https://img.shields.io/travis/jshttp/negotiator/master.svg
+[travis-url]: https://travis-ci.org/jshttp/negotiator
+[coveralls-image]: https://img.shields.io/coveralls/jshttp/negotiator/master.svg
+[coveralls-url]: https://coveralls.io/r/jshttp/negotiator?branch=master
+[downloads-image]: https://img.shields.io/npm/dm/negotiator.svg
+[downloads-url]: https://npmjs.org/package/negotiator
diff --git a/wrt/node_modules/negotiator/index.js b/wrt/node_modules/negotiator/index.js
new file mode 100644 (file)
index 0000000..8d4f6a2
--- /dev/null
@@ -0,0 +1,124 @@
+/*!
+ * negotiator
+ * Copyright(c) 2012 Federico Romero
+ * Copyright(c) 2012-2014 Isaac Z. Schlueter
+ * Copyright(c) 2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict';
+
+/**
+ * Cached loaded submodules.
+ * @private
+ */
+
+var modules = Object.create(null);
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = Negotiator;
+module.exports.Negotiator = Negotiator;
+
+/**
+ * Create a Negotiator instance from a request.
+ * @param {object} request
+ * @public
+ */
+
+function Negotiator(request) {
+  if (!(this instanceof Negotiator)) {
+    return new Negotiator(request);
+  }
+
+  this.request = request;
+}
+
+Negotiator.prototype.charset = function charset(available) {
+  var set = this.charsets(available);
+  return set && set[0];
+};
+
+Negotiator.prototype.charsets = function charsets(available) {
+  var preferredCharsets = loadModule('charset').preferredCharsets;
+  return preferredCharsets(this.request.headers['accept-charset'], available);
+};
+
+Negotiator.prototype.encoding = function encoding(available) {
+  var set = this.encodings(available);
+  return set && set[0];
+};
+
+Negotiator.prototype.encodings = function encodings(available) {
+  var preferredEncodings = loadModule('encoding').preferredEncodings;
+  return preferredEncodings(this.request.headers['accept-encoding'], available);
+};
+
+Negotiator.prototype.language = function language(available) {
+  var set = this.languages(available);
+  return set && set[0];
+};
+
+Negotiator.prototype.languages = function languages(available) {
+  var preferredLanguages = loadModule('language').preferredLanguages;
+  return preferredLanguages(this.request.headers['accept-language'], available);
+};
+
+Negotiator.prototype.mediaType = function mediaType(available) {
+  var set = this.mediaTypes(available);
+  return set && set[0];
+};
+
+Negotiator.prototype.mediaTypes = function mediaTypes(available) {
+  var preferredMediaTypes = loadModule('mediaType').preferredMediaTypes;
+  return preferredMediaTypes(this.request.headers.accept, available);
+};
+
+// Backwards compatibility
+Negotiator.prototype.preferredCharset = Negotiator.prototype.charset;
+Negotiator.prototype.preferredCharsets = Negotiator.prototype.charsets;
+Negotiator.prototype.preferredEncoding = Negotiator.prototype.encoding;
+Negotiator.prototype.preferredEncodings = Negotiator.prototype.encodings;
+Negotiator.prototype.preferredLanguage = Negotiator.prototype.language;
+Negotiator.prototype.preferredLanguages = Negotiator.prototype.languages;
+Negotiator.prototype.preferredMediaType = Negotiator.prototype.mediaType;
+Negotiator.prototype.preferredMediaTypes = Negotiator.prototype.mediaTypes;
+
+/**
+ * Load the given module.
+ * @private
+ */
+
+function loadModule(moduleName) {
+  var module = modules[moduleName];
+
+  if (module !== undefined) {
+    return module;
+  }
+
+  // This uses a switch for static require analysis
+  switch (moduleName) {
+    case 'charset':
+      module = require('./lib/charset');
+      break;
+    case 'encoding':
+      module = require('./lib/encoding');
+      break;
+    case 'language':
+      module = require('./lib/language');
+      break;
+    case 'mediaType':
+      module = require('./lib/mediaType');
+      break;
+    default:
+      throw new Error('Cannot find module \'' + moduleName + '\'');
+  }
+
+  // Store to prevent invoking require()
+  modules[moduleName] = module;
+
+  return module;
+}
diff --git a/wrt/node_modules/negotiator/lib/charset.js b/wrt/node_modules/negotiator/lib/charset.js
new file mode 100644 (file)
index 0000000..ac4217b
--- /dev/null
@@ -0,0 +1,169 @@
+/**
+ * negotiator
+ * Copyright(c) 2012 Isaac Z. Schlueter
+ * Copyright(c) 2014 Federico Romero
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict';
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = preferredCharsets;
+module.exports.preferredCharsets = preferredCharsets;
+
+/**
+ * Module variables.
+ * @private
+ */
+
+var simpleCharsetRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/;
+
+/**
+ * Parse the Accept-Charset header.
+ * @private
+ */
+
+function parseAcceptCharset(accept) {
+  var accepts = accept.split(',');
+
+  for (var i = 0, j = 0; i < accepts.length; i++) {
+    var charset = parseCharset(accepts[i].trim(), i);
+
+    if (charset) {
+      accepts[j++] = charset;
+    }
+  }
+
+  // trim accepts
+  accepts.length = j;
+
+  return accepts;
+}
+
+/**
+ * Parse a charset from the Accept-Charset header.
+ * @private
+ */
+
+function parseCharset(str, i) {
+  var match = simpleCharsetRegExp.exec(str);
+  if (!match) return null;
+
+  var charset = match[1];
+  var q = 1;
+  if (match[2]) {
+    var params = match[2].split(';')
+    for (var i = 0; i < params.length; i ++) {
+      var p = params[i].trim().split('=');
+      if (p[0] === 'q') {
+        q = parseFloat(p[1]);
+        break;
+      }
+    }
+  }
+
+  return {
+    charset: charset,
+    q: q,
+    i: i
+  };
+}
+
+/**
+ * Get the priority of a charset.
+ * @private
+ */
+
+function getCharsetPriority(charset, accepted, index) {
+  var priority = {o: -1, q: 0, s: 0};
+
+  for (var i = 0; i < accepted.length; i++) {
+    var spec = specify(charset, accepted[i], index);
+
+    if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {
+      priority = spec;
+    }
+  }
+
+  return priority;
+}
+
+/**
+ * Get the specificity of the charset.
+ * @private
+ */
+
+function specify(charset, spec, index) {
+  var s = 0;
+  if(spec.charset.toLowerCase() === charset.toLowerCase()){
+    s |= 1;
+  } else if (spec.charset !== '*' ) {
+    return null
+  }
+
+  return {
+    i: index,
+    o: spec.i,
+    q: spec.q,
+    s: s
+  }
+}
+
+/**
+ * Get the preferred charsets from an Accept-Charset header.
+ * @public
+ */
+
+function preferredCharsets(accept, provided) {
+  // RFC 2616 sec 14.2: no header = *
+  var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || '');
+
+  if (!provided) {
+    // sorted list of all charsets
+    return accepts
+      .filter(isQuality)
+      .sort(compareSpecs)
+      .map(getFullCharset);
+  }
+
+  var priorities = provided.map(function getPriority(type, index) {
+    return getCharsetPriority(type, accepts, index);
+  });
+
+  // sorted list of accepted charsets
+  return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) {
+    return provided[priorities.indexOf(priority)];
+  });
+}
+
+/**
+ * Compare two specs.
+ * @private
+ */
+
+function compareSpecs(a, b) {
+  return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0;
+}
+
+/**
+ * Get full charset string.
+ * @private
+ */
+
+function getFullCharset(spec) {
+  return spec.charset;
+}
+
+/**
+ * Check if a spec has any quality.
+ * @private
+ */
+
+function isQuality(spec) {
+  return spec.q > 0;
+}
diff --git a/wrt/node_modules/negotiator/lib/encoding.js b/wrt/node_modules/negotiator/lib/encoding.js
new file mode 100644 (file)
index 0000000..70ac3de
--- /dev/null
@@ -0,0 +1,184 @@
+/**
+ * negotiator
+ * Copyright(c) 2012 Isaac Z. Schlueter
+ * Copyright(c) 2014 Federico Romero
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict';
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = preferredEncodings;
+module.exports.preferredEncodings = preferredEncodings;
+
+/**
+ * Module variables.
+ * @private
+ */
+
+var simpleEncodingRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/;
+
+/**
+ * Parse the Accept-Encoding header.
+ * @private
+ */
+
+function parseAcceptEncoding(accept) {
+  var accepts = accept.split(',');
+  var hasIdentity = false;
+  var minQuality = 1;
+
+  for (var i = 0, j = 0; i < accepts.length; i++) {
+    var encoding = parseEncoding(accepts[i].trim(), i);
+
+    if (encoding) {
+      accepts[j++] = encoding;
+      hasIdentity = hasIdentity || specify('identity', encoding);
+      minQuality = Math.min(minQuality, encoding.q || 1);
+    }
+  }
+
+  if (!hasIdentity) {
+    /*
+     * If identity doesn't explicitly appear in the accept-encoding header,
+     * it's added to the list of acceptable encoding with the lowest q
+     */
+    accepts[j++] = {
+      encoding: 'identity',
+      q: minQuality,
+      i: i
+    };
+  }
+
+  // trim accepts
+  accepts.length = j;
+
+  return accepts;
+}
+
+/**
+ * Parse an encoding from the Accept-Encoding header.
+ * @private
+ */
+
+function parseEncoding(str, i) {
+  var match = simpleEncodingRegExp.exec(str);
+  if (!match) return null;
+
+  var encoding = match[1];
+  var q = 1;
+  if (match[2]) {
+    var params = match[2].split(';');
+    for (var i = 0; i < params.length; i ++) {
+      var p = params[i].trim().split('=');
+      if (p[0] === 'q') {
+        q = parseFloat(p[1]);
+        break;
+      }
+    }
+  }
+
+  return {
+    encoding: encoding,
+    q: q,
+    i: i
+  };
+}
+
+/**
+ * Get the priority of an encoding.
+ * @private
+ */
+
+function getEncodingPriority(encoding, accepted, index) {
+  var priority = {o: -1, q: 0, s: 0};
+
+  for (var i = 0; i < accepted.length; i++) {
+    var spec = specify(encoding, accepted[i], index);
+
+    if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {
+      priority = spec;
+    }
+  }
+
+  return priority;
+}
+
+/**
+ * Get the specificity of the encoding.
+ * @private
+ */
+
+function specify(encoding, spec, index) {
+  var s = 0;
+  if(spec.encoding.toLowerCase() === encoding.toLowerCase()){
+    s |= 1;
+  } else if (spec.encoding !== '*' ) {
+    return null
+  }
+
+  return {
+    i: index,
+    o: spec.i,
+    q: spec.q,
+    s: s
+  }
+};
+
+/**
+ * Get the preferred encodings from an Accept-Encoding header.
+ * @public
+ */
+
+function preferredEncodings(accept, provided) {
+  var accepts = parseAcceptEncoding(accept || '');
+
+  if (!provided) {
+    // sorted list of all encodings
+    return accepts
+      .filter(isQuality)
+      .sort(compareSpecs)
+      .map(getFullEncoding);
+  }
+
+  var priorities = provided.map(function getPriority(type, index) {
+    return getEncodingPriority(type, accepts, index);
+  });
+
+  // sorted list of accepted encodings
+  return priorities.filter(isQuality).sort(compareSpecs).map(function getEncoding(priority) {
+    return provided[priorities.indexOf(priority)];
+  });
+}
+
+/**
+ * Compare two specs.
+ * @private
+ */
+
+function compareSpecs(a, b) {
+  return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0;
+}
+
+/**
+ * Get full encoding string.
+ * @private
+ */
+
+function getFullEncoding(spec) {
+  return spec.encoding;
+}
+
+/**
+ * Check if a spec has any quality.
+ * @private
+ */
+
+function isQuality(spec) {
+  return spec.q > 0;
+}
diff --git a/wrt/node_modules/negotiator/lib/language.js b/wrt/node_modules/negotiator/lib/language.js
new file mode 100644 (file)
index 0000000..1bd2d0e
--- /dev/null
@@ -0,0 +1,179 @@
+/**
+ * negotiator
+ * Copyright(c) 2012 Isaac Z. Schlueter
+ * Copyright(c) 2014 Federico Romero
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict';
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = preferredLanguages;
+module.exports.preferredLanguages = preferredLanguages;
+
+/**
+ * Module variables.
+ * @private
+ */
+
+var simpleLanguageRegExp = /^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;
+
+/**
+ * Parse the Accept-Language header.
+ * @private
+ */
+
+function parseAcceptLanguage(accept) {
+  var accepts = accept.split(',');
+
+  for (var i = 0, j = 0; i < accepts.length; i++) {
+    var langauge = parseLanguage(accepts[i].trim(), i);
+
+    if (langauge) {
+      accepts[j++] = langauge;
+    }
+  }
+
+  // trim accepts
+  accepts.length = j;
+
+  return accepts;
+}
+
+/**
+ * Parse a language from the Accept-Language header.
+ * @private
+ */
+
+function parseLanguage(str, i) {
+  var match = simpleLanguageRegExp.exec(str);
+  if (!match) return null;
+
+  var prefix = match[1],
+      suffix = match[2],
+      full = prefix;
+
+  if (suffix) full += "-" + suffix;
+
+  var q = 1;
+  if (match[3]) {
+    var params = match[3].split(';')
+    for (var i = 0; i < params.length; i ++) {
+      var p = params[i].split('=');
+      if (p[0] === 'q') q = parseFloat(p[1]);
+    }
+  }
+
+  return {
+    prefix: prefix,
+    suffix: suffix,
+    q: q,
+    i: i,
+    full: full
+  };
+}
+
+/**
+ * Get the priority of a language.
+ * @private
+ */
+
+function getLanguagePriority(language, accepted, index) {
+  var priority = {o: -1, q: 0, s: 0};
+
+  for (var i = 0; i < accepted.length; i++) {
+    var spec = specify(language, accepted[i], index);
+
+    if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {
+      priority = spec;
+    }
+  }
+
+  return priority;
+}
+
+/**
+ * Get the specificity of the language.
+ * @private
+ */
+
+function specify(language, spec, index) {
+  var p = parseLanguage(language)
+  if (!p) return null;
+  var s = 0;
+  if(spec.full.toLowerCase() === p.full.toLowerCase()){
+    s |= 4;
+  } else if (spec.prefix.toLowerCase() === p.full.toLowerCase()) {
+    s |= 2;
+  } else if (spec.full.toLowerCase() === p.prefix.toLowerCase()) {
+    s |= 1;
+  } else if (spec.full !== '*' ) {
+    return null
+  }
+
+  return {
+    i: index,
+    o: spec.i,
+    q: spec.q,
+    s: s
+  }
+};
+
+/**
+ * Get the preferred languages from an Accept-Language header.
+ * @public
+ */
+
+function preferredLanguages(accept, provided) {
+  // RFC 2616 sec 14.4: no header = *
+  var accepts = parseAcceptLanguage(accept === undefined ? '*' : accept || '');
+
+  if (!provided) {
+    // sorted list of all languages
+    return accepts
+      .filter(isQuality)
+      .sort(compareSpecs)
+      .map(getFullLanguage);
+  }
+
+  var priorities = provided.map(function getPriority(type, index) {
+    return getLanguagePriority(type, accepts, index);
+  });
+
+  // sorted list of accepted languages
+  return priorities.filter(isQuality).sort(compareSpecs).map(function getLanguage(priority) {
+    return provided[priorities.indexOf(priority)];
+  });
+}
+
+/**
+ * Compare two specs.
+ * @private
+ */
+
+function compareSpecs(a, b) {
+  return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0;
+}
+
+/**
+ * Get full language string.
+ * @private
+ */
+
+function getFullLanguage(spec) {
+  return spec.full;
+}
+
+/**
+ * Check if a spec has any quality.
+ * @private
+ */
+
+function isQuality(spec) {
+  return spec.q > 0;
+}
diff --git a/wrt/node_modules/negotiator/lib/mediaType.js b/wrt/node_modules/negotiator/lib/mediaType.js
new file mode 100644 (file)
index 0000000..67309dd
--- /dev/null
@@ -0,0 +1,294 @@
+/**
+ * negotiator
+ * Copyright(c) 2012 Isaac Z. Schlueter
+ * Copyright(c) 2014 Federico Romero
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict';
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = preferredMediaTypes;
+module.exports.preferredMediaTypes = preferredMediaTypes;
+
+/**
+ * Module variables.
+ * @private
+ */
+
+var simpleMediaTypeRegExp = /^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;
+
+/**
+ * Parse the Accept header.
+ * @private
+ */
+
+function parseAccept(accept) {
+  var accepts = splitMediaTypes(accept);
+
+  for (var i = 0, j = 0; i < accepts.length; i++) {
+    var mediaType = parseMediaType(accepts[i].trim(), i);
+
+    if (mediaType) {
+      accepts[j++] = mediaType;
+    }
+  }
+
+  // trim accepts
+  accepts.length = j;
+
+  return accepts;
+}
+
+/**
+ * Parse a media type from the Accept header.
+ * @private
+ */
+
+function parseMediaType(str, i) {
+  var match = simpleMediaTypeRegExp.exec(str);
+  if (!match) return null;
+
+  var params = Object.create(null);
+  var q = 1;
+  var subtype = match[2];
+  var type = match[1];
+
+  if (match[3]) {
+    var kvps = splitParameters(match[3]).map(splitKeyValuePair);
+
+    for (var j = 0; j < kvps.length; j++) {
+      var pair = kvps[j];
+      var key = pair[0].toLowerCase();
+      var val = pair[1];
+
+      // get the value, unwrapping quotes
+      var value = val && val[0] === '"' && val[val.length - 1] === '"'
+        ? val.substr(1, val.length - 2)
+        : val;
+
+      if (key === 'q') {
+        q = parseFloat(value);
+        break;
+      }
+
+      // store parameter
+      params[key] = value;
+    }
+  }
+
+  return {
+    type: type,
+    subtype: subtype,
+    params: params,
+    q: q,
+    i: i
+  };
+}
+
+/**
+ * Get the priority of a media type.
+ * @private
+ */
+
+function getMediaTypePriority(type, accepted, index) {
+  var priority = {o: -1, q: 0, s: 0};
+
+  for (var i = 0; i < accepted.length; i++) {
+    var spec = specify(type, accepted[i], index);
+
+    if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) {
+      priority = spec;
+    }
+  }
+
+  return priority;
+}
+
+/**
+ * Get the specificity of the media type.
+ * @private
+ */
+
+function specify(type, spec, index) {
+  var p = parseMediaType(type);
+  var s = 0;
+
+  if (!p) {
+    return null;
+  }
+
+  if(spec.type.toLowerCase() == p.type.toLowerCase()) {
+    s |= 4
+  } else if(spec.type != '*') {
+    return null;
+  }
+
+  if(spec.subtype.toLowerCase() == p.subtype.toLowerCase()) {
+    s |= 2
+  } else if(spec.subtype != '*') {
+    return null;
+  }
+
+  var keys = Object.keys(spec.params);
+  if (keys.length > 0) {
+    if (keys.every(function (k) {
+      return spec.params[k] == '*' || (spec.params[k] || '').toLowerCase() == (p.params[k] || '').toLowerCase();
+    })) {
+      s |= 1
+    } else {
+      return null
+    }
+  }
+
+  return {
+    i: index,
+    o: spec.i,
+    q: spec.q,
+    s: s,
+  }
+}
+
+/**
+ * Get the preferred media types from an Accept header.
+ * @public
+ */
+
+function preferredMediaTypes(accept, provided) {
+  // RFC 2616 sec 14.2: no header = */*
+  var accepts = parseAccept(accept === undefined ? '*/*' : accept || '');
+
+  if (!provided) {
+    // sorted list of all types
+    return accepts
+      .filter(isQuality)
+      .sort(compareSpecs)
+      .map(getFullType);
+  }
+
+  var priorities = provided.map(function getPriority(type, index) {
+    return getMediaTypePriority(type, accepts, index);
+  });
+
+  // sorted list of accepted types
+  return priorities.filter(isQuality).sort(compareSpecs).map(function getType(priority) {
+    return provided[priorities.indexOf(priority)];
+  });
+}
+
+/**
+ * Compare two specs.
+ * @private
+ */
+
+function compareSpecs(a, b) {
+  return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0;
+}
+
+/**
+ * Get full type string.
+ * @private
+ */
+
+function getFullType(spec) {
+  return spec.type + '/' + spec.subtype;
+}
+
+/**
+ * Check if a spec has any quality.
+ * @private
+ */
+
+function isQuality(spec) {
+  return spec.q > 0;
+}
+
+/**
+ * Count the number of quotes in a string.
+ * @private
+ */
+
+function quoteCount(string) {
+  var count = 0;
+  var index = 0;
+
+  while ((index = string.indexOf('"', index)) !== -1) {
+    count++;
+    index++;
+  }
+
+  return count;
+}
+
+/**
+ * Split a key value pair.
+ * @private
+ */
+
+function splitKeyValuePair(str) {
+  var index = str.indexOf('=');
+  var key;
+  var val;
+
+  if (index === -1) {
+    key = str;
+  } else {
+    key = str.substr(0, index);
+    val = str.substr(index + 1);
+  }
+
+  return [key, val];
+}
+
+/**
+ * Split an Accept header into media types.
+ * @private
+ */
+
+function splitMediaTypes(accept) {
+  var accepts = accept.split(',');
+
+  for (var i = 1, j = 0; i < accepts.length; i++) {
+    if (quoteCount(accepts[j]) % 2 == 0) {
+      accepts[++j] = accepts[i];
+    } else {
+      accepts[j] += ',' + accepts[i];
+    }
+  }
+
+  // trim accepts
+  accepts.length = j + 1;
+
+  return accepts;
+}
+
+/**
+ * Split a string of parameters.
+ * @private
+ */
+
+function splitParameters(str) {
+  var parameters = str.split(';');
+
+  for (var i = 1, j = 0; i < parameters.length; i++) {
+    if (quoteCount(parameters[j]) % 2 == 0) {
+      parameters[++j] = parameters[i];
+    } else {
+      parameters[j] += ';' + parameters[i];
+    }
+  }
+
+  // trim parameters
+  parameters.length = j + 1;
+
+  for (var i = 0; i < parameters.length; i++) {
+    parameters[i] = parameters[i].trim();
+  }
+
+  return parameters;
+}
diff --git a/wrt/node_modules/negotiator/package.json b/wrt/node_modules/negotiator/package.json
new file mode 100644 (file)
index 0000000..6a43b99
--- /dev/null
@@ -0,0 +1,125 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "negotiator@0.6.1",
+        "scope": null,
+        "escapedName": "negotiator",
+        "name": "negotiator",
+        "rawSpec": "0.6.1",
+        "spec": "0.6.1",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/accepts"
+    ]
+  ],
+  "_from": "negotiator@0.6.1",
+  "_id": "negotiator@0.6.1",
+  "_inCache": true,
+  "_location": "/negotiator",
+  "_nodeVersion": "4.4.3",
+  "_npmOperationalInternal": {
+    "host": "packages-16-east.internal.npmjs.com",
+    "tmp": "tmp/negotiator-0.6.1.tgz_1462250848695_0.027451182017102838"
+  },
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "2.15.1",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "negotiator@0.6.1",
+    "scope": null,
+    "escapedName": "negotiator",
+    "name": "negotiator",
+    "rawSpec": "0.6.1",
+    "spec": "0.6.1",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/accepts"
+  ],
+  "_resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz",
+  "_shasum": "2b327184e8992101177b28563fb5e7102acd0ca9",
+  "_shrinkwrap": null,
+  "_spec": "negotiator@0.6.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/accepts",
+  "bugs": {
+    "url": "https://github.com/jshttp/negotiator/issues"
+  },
+  "contributors": [
+    {
+      "name": "Douglas Christopher Wilson",
+      "email": "doug@somethingdoug.com"
+    },
+    {
+      "name": "Federico Romero",
+      "email": "federico.romero@outboxlabs.com"
+    },
+    {
+      "name": "Isaac Z. Schlueter",
+      "email": "i@izs.me",
+      "url": "http://blog.izs.me/"
+    }
+  ],
+  "dependencies": {},
+  "description": "HTTP content negotiation",
+  "devDependencies": {
+    "istanbul": "0.4.3",
+    "mocha": "~1.21.5"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "2b327184e8992101177b28563fb5e7102acd0ca9",
+    "tarball": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz"
+  },
+  "engines": {
+    "node": ">= 0.6"
+  },
+  "files": [
+    "lib/",
+    "HISTORY.md",
+    "LICENSE",
+    "index.js",
+    "README.md"
+  ],
+  "gitHead": "751c381c32707f238143cd65d78520e16f4ef9e5",
+  "homepage": "https://github.com/jshttp/negotiator#readme",
+  "keywords": [
+    "http",
+    "content negotiation",
+    "accept",
+    "accept-language",
+    "accept-encoding",
+    "accept-charset"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    },
+    {
+      "name": "federomero",
+      "email": "federomero@gmail.com"
+    },
+    {
+      "name": "jongleberry",
+      "email": "jonathanrichardong@gmail.com"
+    }
+  ],
+  "name": "negotiator",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/jshttp/negotiator.git"
+  },
+  "scripts": {
+    "test": "mocha --reporter spec --check-leaks --bail test/",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
+    "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
+  },
+  "version": "0.6.1"
+}
diff --git a/wrt/node_modules/node-constants/.npmignore b/wrt/node_modules/node-constants/.npmignore
new file mode 100644 (file)
index 0000000..93f1361
--- /dev/null
@@ -0,0 +1,2 @@
+node_modules
+npm-debug.log
diff --git a/wrt/node_modules/node-constants/LICENSE b/wrt/node_modules/node-constants/LICENSE
new file mode 100644 (file)
index 0000000..ee27ba4
--- /dev/null
@@ -0,0 +1,18 @@
+This software is released under the MIT license:
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/node-constants/README.md b/wrt/node_modules/node-constants/README.md
new file mode 100644 (file)
index 0000000..0826200
--- /dev/null
@@ -0,0 +1,30 @@
+# node-constants
+
+A small library for defining module-level constants.
+
+Check for further examples in the `examples` folder.
+Also, the source code is really small and well documented.
+
+**NOTE:** newer versions of node use the name
+["constants"](https://github.com/joyent/node/blob/master/lib/constants.js)
+internally, which clobbers any attempt to use this library. As a result,
+I've had to rename to the more verbose,
+["node-constants"](https://www.npmjs.org/package/node-constants).
+
+## Basic Usage
+
+    var define = require("node-constants")(exports);
+    // define is a function that binds "constants" to an object (commonly exports)
+
+    // a single constant
+    define("PI", 3.14);
+
+    // or multiple
+    define({
+        DAYS_IN_WEEK: 7,
+        SECONDS_IN_MINUTE: 60
+    });
+
+## Installation
+
+    npm install --save node-constants
diff --git a/wrt/node_modules/node-constants/examples/define.js b/wrt/node_modules/node-constants/examples/define.js
new file mode 100644 (file)
index 0000000..4db2013
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * This is the most verbose of the methods to use this module,
+ * and also the most flexible in case you have multiple objects
+ * you want to define constants on (particularly if there is a
+ * hierarchy of constants)
+ */
+
+var constants = require("../");
+
+// constants.define() takes 2-3 params
+// the first is the object to bind a new "constant" to
+
+// then you can either specify a single key/value pair as 2 params
+constants.define(exports, "DAYS_IN_WEEK", 7);
+constants.define(exports, "SECONDS_IN_MINUTE", 60);
+constants.define(exports, "HOURS_IN_DAY", 24);
+
+// or
+
+// you can specify an entire group with a shallow hash of key/value pairs
+constants.define(exports, {
+    DAYS_IN_WEEK: 7,
+    SECONDS_IN_MINUTE: 60,
+    HOURS_IN_DAY: 24
+});
+
+console.log(exports);
diff --git a/wrt/node_modules/node-constants/examples/definer.js b/wrt/node_modules/node-constants/examples/definer.js
new file mode 100644 (file)
index 0000000..3ea87f6
--- /dev/null
@@ -0,0 +1,28 @@
+/**
+ * constants.definer() creates a new function that is bound
+ * to the input object. Although I'm using exports directly here,
+ * that is not what you are limited to each call to define will
+ * return the object that was operated on
+ */
+
+var constants = require("../"),
+    // bind to exports (ie. module.exports)
+    define = constants.definer(exports);
+
+// the newly created function only needs 1-2 params
+
+// either a single key/value pair as 2 params
+define("DAYS_IN_WEEK", 7);
+define("SECONDS_IN_MINUTE", 60);
+define("HOURS_IN_DAY", 24);
+
+// or
+
+// a hash of key/value pairs
+define({
+    DAYS_IN_WEEK: 7,
+    SECONDS_IN_MINUTE: 60,
+    HOURS_IN_DAY: 24
+});
+
+console.log(exports);
diff --git a/wrt/node_modules/node-constants/examples/not_exports.js b/wrt/node_modules/node-constants/examples/not_exports.js
new file mode 100644 (file)
index 0000000..126caea
--- /dev/null
@@ -0,0 +1,16 @@
+/**
+ * Although definer can accept an object parameter, if none is entered
+ * a new empty object will be created via Object.create(null) and used
+ * instead. You can retrieve that object from any calls to the returned
+ * definer.
+ */
+
+var constants = require("../"),
+    define = constants.definer(); // defaults to a new empty object
+
+// since define (as well as any created definer) return the object
+// that was operated on, you can store your constants module without
+// ever explicitly creating it
+var my_constants = define("MEANING_OF_LIFE", 42);
+
+console.log(my_constants);
diff --git a/wrt/node_modules/node-constants/examples/quick_definer.js b/wrt/node_modules/node-constants/examples/quick_definer.js
new file mode 100644 (file)
index 0000000..041a85b
--- /dev/null
@@ -0,0 +1,20 @@
+/**
+ * The module itself is actually a function object that takes a single
+ * param and passes it along to constants.definer(). This enables you
+ * to quickly get a definer() in as little code as possible
+ */
+
+// the returned function will be bound to exports (module.exports)
+var define = require("../")(exports);
+
+define("PI", 3.14);
+define("ZERO", 0);
+
+// or
+
+define({
+    PI:   3.14,
+    ZERO: 0
+});
+
+console.log(exports);
diff --git a/wrt/node_modules/node-constants/index.js b/wrt/node_modules/node-constants/index.js
new file mode 100644 (file)
index 0000000..bf63049
--- /dev/null
@@ -0,0 +1 @@
+module.exports = require("./lib");
diff --git a/wrt/node_modules/node-constants/lib/index.js b/wrt/node_modules/node-constants/lib/index.js
new file mode 100644 (file)
index 0000000..ca1c13c
--- /dev/null
@@ -0,0 +1,56 @@
+/**
+ * Provides short-hand for creating a definer right away
+ *
+ * @param {object} [object]  The object to bind the constants to
+ *
+ * @returns {function}  @see exports.definer
+ */
+module.exports = function (object) {
+    return module.exports.definer(object);
+};
+
+/**
+ * Binds a new "constant" property to an input object
+ *
+ * @param {object} object
+ * @param {string} name
+ * @param {mixed}  value
+ *
+ * @return {object}  The input object
+ */
+module.exports.define = function (object, name, value) {
+    var key;
+
+    // if an object, loop the properties for the definitions
+    if (typeof name === "object") {
+        for (key in name) {
+            if (name.hasOwnProperty(key)) {
+                module.exports.define(object, key, name[key]);
+            }
+        }
+    // otherwise, just operate on a single property
+    } else {
+        Object.defineProperty(object, name, {
+            value:        value,
+            enumerable:   true,
+            writable:     false,
+            configurable: false
+        });
+    }
+
+    return object;
+};
+
+/**
+ * Creates a "definer" function that is bound to an input object (or a new empty object)
+ *
+ * @param {object} [object]
+ *
+ * @return {function}
+ */
+module.exports.definer = function (object) {
+    object = object || Object.create(null);
+    return function (name, value) {
+        return module.exports.define(object, name, value);
+    };
+};
diff --git a/wrt/node_modules/node-constants/package.json b/wrt/node_modules/node-constants/package.json
new file mode 100644 (file)
index 0000000..cce6b74
--- /dev/null
@@ -0,0 +1,87 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "node-constants",
+        "scope": null,
+        "escapedName": "node-constants",
+        "name": "node-constants",
+        "rawSpec": "",
+        "spec": "latest",
+        "type": "tag"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt"
+    ]
+  ],
+  "_from": "node-constants@latest",
+  "_id": "node-constants@0.0.2",
+  "_inCache": true,
+  "_location": "/node-constants",
+  "_npmUser": {
+    "name": "dominicbarnes",
+    "email": "contact@dominicbarnes.us"
+  },
+  "_npmVersion": "1.4.3",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "node-constants",
+    "scope": null,
+    "escapedName": "node-constants",
+    "name": "node-constants",
+    "rawSpec": "",
+    "spec": "latest",
+    "type": "tag"
+  },
+  "_requiredBy": [
+    "#USER"
+  ],
+  "_resolved": "https://registry.npmjs.org/node-constants/-/node-constants-0.0.2.tgz",
+  "_shasum": "db676f714082c1a233fe19f57c0243d0077c38bd",
+  "_shrinkwrap": null,
+  "_spec": "node-constants",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt",
+  "author": {
+    "name": "Dominic Barnes",
+    "email": "dominic@dbarnes.info"
+  },
+  "bugs": {
+    "url": "https://github.com/dominicbarnes/node-constants/issues"
+  },
+  "dependencies": {},
+  "description": "Small library for defining constants for your modules",
+  "devDependencies": {
+    "mocha": "~1.9.0"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "db676f714082c1a233fe19f57c0243d0077c38bd",
+    "tarball": "https://registry.npmjs.org/node-constants/-/node-constants-0.0.2.tgz"
+  },
+  "engines": {
+    "node": ">= 0.4"
+  },
+  "homepage": "http://github.com/dominicbarnes/node-constants",
+  "keywords": [
+    "constants",
+    "modules"
+  ],
+  "license": "MIT",
+  "main": "index",
+  "maintainers": [
+    {
+      "name": "dominicbarnes",
+      "email": "contact@dominicbarnes.us"
+    }
+  ],
+  "name": "node-constants",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/dominicbarnes/node-constants.git"
+  },
+  "scripts": {
+    "test": "mocha"
+  },
+  "version": "0.0.2"
+}
diff --git a/wrt/node_modules/node-constants/test/main.js b/wrt/node_modules/node-constants/test/main.js
new file mode 100644 (file)
index 0000000..a5469fe
--- /dev/null
@@ -0,0 +1,53 @@
+var test = require("assert"),
+    constants = require("../");
+
+module.exports = {
+    define: function (done) {
+        var o = {},
+            ret = constants.define(o, "PI", 3.14);
+
+        // make sure it is not writable
+        test.equal(o.PI, 3.14);
+        o.PI = 5;
+        test.equal(o.PI, 3.14);
+
+        // test a collection
+        constants.define(o, {
+            MEANING_OF_LIFE: 42,
+            SECONDS_IN_MINUTE: 60
+        });
+
+        // make sure it's not writable
+        test.equal(o.MEANING_OF_LIFE, 42);
+        o.MEANING_OF_LIFE = 100;
+        test.equal(o.MEANING_OF_LIFE, 42);
+
+        test.strictEqual(o, ret);
+        done();
+    },
+    definer: function (done) {
+        var define = constants.definer(),
+            a, b;
+
+        a = define("QUARTS_IN_GALLON", 4);
+        b = define("LETTERS_IN_ALPHABET", 24);
+
+        // make sure the same object is returned
+        test.strictEqual(a, b);
+
+        // test constants
+        test.equal(a.QUARTS_IN_GALLON, 4);
+        test.equal(b.LETTERS_IN_ALPHABET, 24);
+
+        done();
+    },
+    quick: function (done) {
+        var define = constants(),
+            o = define("ZERO", 0);
+
+        test.ok(o);
+        test.strictEqual(o.ZERO, 0);
+
+        done();
+    }
+};
diff --git a/wrt/node_modules/node-constants/test/mocha.opts b/wrt/node_modules/node-constants/test/mocha.opts
new file mode 100644 (file)
index 0000000..d63aa2e
--- /dev/null
@@ -0,0 +1,2 @@
+--reporter list
+--ui exports
diff --git a/wrt/node_modules/node-uuid/.npmignore b/wrt/node_modules/node-uuid/.npmignore
new file mode 100644 (file)
index 0000000..8886139
--- /dev/null
@@ -0,0 +1,4 @@
+node_modules
+.DS_Store
+.nyc_output
+coverage
diff --git a/wrt/node_modules/node-uuid/LICENSE.md b/wrt/node_modules/node-uuid/LICENSE.md
new file mode 100644 (file)
index 0000000..652609b
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c)  2010-2012 Robert Kieffer 
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/wrt/node_modules/node-uuid/README.md b/wrt/node_modules/node-uuid/README.md
new file mode 100644 (file)
index 0000000..3dc67d3
--- /dev/null
@@ -0,0 +1,8 @@
+# node-uuid
+
+DEPRECATED: Use the `uuid` package instead.  See
+
+* On NPM: https://www.npmjs.com/package/uuid
+* On Github: https://github.com/kelektiv/node-uuid
+
+(Yes, the github project is still called "node-uuid". We merged the two projects. Sorry for the confusion.)
diff --git a/wrt/node_modules/node-uuid/benchmark/README.md b/wrt/node_modules/node-uuid/benchmark/README.md
new file mode 100644 (file)
index 0000000..aaeb2ea
--- /dev/null
@@ -0,0 +1,53 @@
+# node-uuid Benchmarks
+
+### Results
+
+To see the results of our benchmarks visit https://github.com/broofa/node-uuid/wiki/Benchmark
+
+### Run them yourself
+
+node-uuid comes with some benchmarks to measure performance of generating UUIDs. These can be run using node.js. node-uuid is being benchmarked against some other uuid modules, that are available through npm namely `uuid` and `uuid-js`.
+
+To prepare and run the benchmark issue;
+
+```
+npm install uuid uuid-js
+node benchmark/benchmark.js
+```
+
+You'll see an output like this one:
+
+```
+# v4
+nodeuuid.v4(): 854700 uuids/second
+nodeuuid.v4('binary'): 788643 uuids/second
+nodeuuid.v4('binary', buffer): 1336898 uuids/second
+uuid(): 479386 uuids/second
+uuid('binary'): 582072 uuids/second
+uuidjs.create(4): 312304 uuids/second
+
+# v1
+nodeuuid.v1(): 938086 uuids/second
+nodeuuid.v1('binary'): 683060 uuids/second
+nodeuuid.v1('binary', buffer): 1644736 uuids/second
+uuidjs.create(1): 190621 uuids/second
+```
+
+* The `uuid()` entries are for Nikhil Marathe's [uuid module](https://bitbucket.org/nikhilm/uuidjs) which is a wrapper around the native libuuid library.
+* The `uuidjs()` entries are for Patrick Negri's [uuid-js module](https://github.com/pnegri/uuid-js) which is a pure javascript implementation based on [UUID.js](https://github.com/LiosK/UUID.js) by LiosK.
+
+If you want to get more reliable results you can run the benchmark multiple times and write the output into a log file:
+
+```
+for i in {0..9}; do node benchmark/benchmark.js >> benchmark/bench_0.4.12.log; done;
+```
+
+If you're interested in how performance varies between different node versions, you can issue the above command multiple times.
+
+You can then use the shell script `bench.sh` provided in this directory to calculate the averages over all benchmark runs and draw a nice plot:
+
+```
+(cd benchmark/ && ./bench.sh)
+```
+
+This assumes you have [gnuplot](http://www.gnuplot.info/) and [ImageMagick](http://www.imagemagick.org/) installed. You'll find a nice `bench.png` graph in the `benchmark/` directory then.
diff --git a/wrt/node_modules/node-uuid/benchmark/bench.gnu b/wrt/node_modules/node-uuid/benchmark/bench.gnu
new file mode 100644 (file)
index 0000000..a342fbb
--- /dev/null
@@ -0,0 +1,174 @@
+#!/opt/local/bin/gnuplot -persist
+#
+#    
+#      G N U P L O T
+#      Version 4.4 patchlevel 3
+#      last modified March 2011
+#      System: Darwin 10.8.0
+#    
+#      Copyright (C) 1986-1993, 1998, 2004, 2007-2010
+#      Thomas Williams, Colin Kelley and many others
+#    
+#      gnuplot home:     http://www.gnuplot.info
+#      faq, bugs, etc:   type "help seeking-assistance"
+#      immediate help:   type "help"
+#      plot window:      hit 'h'
+set terminal postscript eps noenhanced defaultplex \
+ leveldefault color colortext \
+ solid linewidth 1.2 butt noclip \
+ palfuncparam 2000,0.003 \
+ "Helvetica" 14 
+set output 'bench.eps'
+unset clip points
+set clip one
+unset clip two
+set bar 1.000000 front
+set border 31 front linetype -1 linewidth 1.000
+set xdata
+set ydata
+set zdata
+set x2data
+set y2data
+set timefmt x "%d/%m/%y,%H:%M"
+set timefmt y "%d/%m/%y,%H:%M"
+set timefmt z "%d/%m/%y,%H:%M"
+set timefmt x2 "%d/%m/%y,%H:%M"
+set timefmt y2 "%d/%m/%y,%H:%M"
+set timefmt cb "%d/%m/%y,%H:%M"
+set boxwidth
+set style fill  empty border
+set style rectangle back fc lt -3 fillstyle   solid 1.00 border lt -1
+set style circle radius graph 0.02, first 0, 0 
+set dummy x,y
+set format x "% g"
+set format y "% g"
+set format x2 "% g"
+set format y2 "% g"
+set format z "% g"
+set format cb "% g"
+set angles radians
+unset grid
+set key title ""
+set key outside left top horizontal Right noreverse enhanced autotitles columnhead nobox
+set key noinvert samplen 4 spacing 1 width 0 height 0 
+set key maxcolumns 2 maxrows 0
+unset label
+unset arrow
+set style increment default
+unset style line
+set style line 1  linetype 1 linewidth 2.000 pointtype 1 pointsize default pointinterval 0
+unset style arrow
+set style histogram clustered gap 2 title  offset character 0, 0, 0
+unset logscale
+set offsets graph 0.05, 0.15, 0, 0
+set pointsize 1.5
+set pointintervalbox 1
+set encoding default
+unset polar
+unset parametric
+unset decimalsign
+set view 60, 30, 1, 1
+set samples 100, 100
+set isosamples 10, 10
+set surface
+unset contour
+set clabel '%8.3g'
+set mapping cartesian
+set datafile separator whitespace
+unset hidden3d
+set cntrparam order 4
+set cntrparam linear
+set cntrparam levels auto 5
+set cntrparam points 5
+set size ratio 0 1,1
+set origin 0,0
+set style data points
+set style function lines
+set xzeroaxis linetype -2 linewidth 1.000
+set yzeroaxis linetype -2 linewidth 1.000
+set zzeroaxis linetype -2 linewidth 1.000
+set x2zeroaxis linetype -2 linewidth 1.000
+set y2zeroaxis linetype -2 linewidth 1.000
+set ticslevel 0.5
+set mxtics default
+set mytics default
+set mztics default
+set mx2tics default
+set my2tics default
+set mcbtics default
+set xtics border in scale 1,0.5 mirror norotate  offset character 0, 0, 0
+set xtics  norangelimit
+set xtics   ()
+set ytics border in scale 1,0.5 mirror norotate  offset character 0, 0, 0
+set ytics autofreq  norangelimit
+set ztics border in scale 1,0.5 nomirror norotate  offset character 0, 0, 0
+set ztics autofreq  norangelimit
+set nox2tics
+set noy2tics
+set cbtics border in scale 1,0.5 mirror norotate  offset character 0, 0, 0
+set cbtics autofreq  norangelimit
+set title "" 
+set title  offset character 0, 0, 0 font "" norotate
+set timestamp bottom 
+set timestamp "" 
+set timestamp  offset character 0, 0, 0 font "" norotate
+set rrange [ * : * ] noreverse nowriteback  # (currently [8.98847e+307:-8.98847e+307] )
+set autoscale rfixmin
+set autoscale rfixmax
+set trange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )
+set autoscale tfixmin
+set autoscale tfixmax
+set urange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set autoscale ufixmin
+set autoscale ufixmax
+set vrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set autoscale vfixmin
+set autoscale vfixmax
+set xlabel "" 
+set xlabel  offset character 0, 0, 0 font "" textcolor lt -1 norotate
+set x2label "" 
+set x2label  offset character 0, 0, 0 font "" textcolor lt -1 norotate
+set xrange [ * : * ] noreverse nowriteback  # (currently [-0.150000:3.15000] )
+set autoscale xfixmin
+set autoscale xfixmax
+set x2range [ * : * ] noreverse nowriteback  # (currently [0.00000:3.00000] )
+set autoscale x2fixmin
+set autoscale x2fixmax
+set ylabel "" 
+set ylabel  offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270
+set y2label "" 
+set y2label  offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270
+set yrange [ 0.00000 : 1.90000e+06 ] noreverse nowriteback  # (currently [:] )
+set autoscale yfixmin
+set autoscale yfixmax
+set y2range [ * : * ] noreverse nowriteback  # (currently [0.00000:1.90000e+06] )
+set autoscale y2fixmin
+set autoscale y2fixmax
+set zlabel "" 
+set zlabel  offset character 0, 0, 0 font "" textcolor lt -1 norotate
+set zrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set autoscale zfixmin
+set autoscale zfixmax
+set cblabel "" 
+set cblabel  offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270
+set cbrange [ * : * ] noreverse nowriteback  # (currently [8.98847e+307:-8.98847e+307] )
+set autoscale cbfixmin
+set autoscale cbfixmax
+set zero 1e-08
+set lmargin  -1
+set bmargin  -1
+set rmargin  -1
+set tmargin  -1
+set pm3d explicit at s
+set pm3d scansautomatic
+set pm3d interpolate 1,1 flush begin noftriangles nohidden3d corners2color mean
+set palette positive nops_allcF maxcolors 0 gamma 1.5 color model RGB 
+set palette rgbformulae 7, 5, 15
+set colorbox default
+set colorbox vertical origin screen 0.9, 0.2, 0 size screen 0.05, 0.6, 0 front bdefault
+set loadpath 
+set fontpath 
+set fit noerrorvariables
+GNUTERM = "aqua"
+plot 'bench_results.txt' using 2:xticlabel(1) w lp lw 2, '' using 3:xticlabel(1) w lp lw 2, '' using 4:xticlabel(1) w lp lw 2, '' using 5:xticlabel(1) w lp lw 2, '' using 6:xticlabel(1) w lp lw 2, '' using 7:xticlabel(1) w lp lw 2, '' using 8:xticlabel(1) w lp lw 2, '' using 9:xticlabel(1) w lp lw 2
+#    EOF
diff --git a/wrt/node_modules/node-uuid/benchmark/bench.sh b/wrt/node_modules/node-uuid/benchmark/bench.sh
new file mode 100755 (executable)
index 0000000..d870a0c
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+# for a given node version run:
+# for i in {0..9}; do node benchmark.js >> bench_0.6.2.log; done;
+
+PATTERNS=('nodeuuid.v1()' "nodeuuid.v1('binary'," 'nodeuuid.v4()' "nodeuuid.v4('binary'," "uuid()" "uuid('binary')" 'uuidjs.create(1)' 'uuidjs.create(4)' '140byte')
+FILES=(node_uuid_v1_string node_uuid_v1_buf node_uuid_v4_string node_uuid_v4_buf libuuid_v4_string libuuid_v4_binary uuidjs_v1_string uuidjs_v4_string 140byte_es)
+INDICES=(2 3 2 3 2 2 2 2 2)
+VERSIONS=$( ls bench_*.log | sed -e 's/^bench_\([0-9\.]*\)\.log/\1/' | tr "\\n" " " )
+TMPJOIN="tmp_join"
+OUTPUT="bench_results.txt"
+
+for I in ${!FILES[*]}; do
+  F=${FILES[$I]}
+  P=${PATTERNS[$I]}
+  INDEX=${INDICES[$I]}
+  echo "version $F" > $F
+  for V in $VERSIONS; do
+    (VAL=$( grep "$P" bench_$V.log | LC_ALL=en_US awk '{ sum += $'$INDEX' } END { print sum/NR }' ); echo $V $VAL) >> $F
+  done
+  if [ $I == 0 ]; then
+    cat $F > $TMPJOIN
+  else
+    join $TMPJOIN $F > $OUTPUT
+    cp $OUTPUT $TMPJOIN
+  fi
+  rm $F
+done
+
+rm $TMPJOIN
+
+gnuplot bench.gnu
+convert -density 200 -resize 800x560 -flatten bench.eps bench.png
+rm bench.eps
diff --git a/wrt/node_modules/node-uuid/benchmark/benchmark-native.c b/wrt/node_modules/node-uuid/benchmark/benchmark-native.c
new file mode 100644 (file)
index 0000000..dbfc75f
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+Test performance of native C UUID generation
+
+To Compile: cc -luuid benchmark-native.c -o benchmark-native
+*/
+
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/time.h>
+#include <uuid/uuid.h>
+
+int main() {
+  uuid_t myid;
+  char buf[36+1];
+  int i;
+  struct timeval t;
+  double start, finish;
+
+  gettimeofday(&t, NULL);
+  start = t.tv_sec + t.tv_usec/1e6;
+
+  int n = 2e5;
+  for (i = 0; i < n; i++) {
+    uuid_generate(myid);
+    uuid_unparse(myid, buf);
+  }
+
+  gettimeofday(&t, NULL);
+  finish = t.tv_sec + t.tv_usec/1e6;
+  double dur = finish - start;
+
+  printf("%d uuids/sec", (int)(n/dur));
+  return 0;
+}
diff --git a/wrt/node_modules/node-uuid/benchmark/benchmark.js b/wrt/node_modules/node-uuid/benchmark/benchmark.js
new file mode 100644 (file)
index 0000000..40e6efb
--- /dev/null
@@ -0,0 +1,84 @@
+try {
+  var nodeuuid = require('../uuid');
+} catch (e) {
+  console.error('node-uuid require failed - skipping tests');
+}
+
+try {
+  var uuid = require('uuid');
+} catch (e) {
+  console.error('uuid require failed - skipping tests');
+}
+
+try {
+  var uuidjs = require('uuid-js');
+} catch (e) {
+  console.error('uuid-js require failed - skipping tests');
+}
+
+var N = 5e5;
+
+function rate(msg, t) {
+  console.log(msg + ': ' +
+    (N / (Date.now() - t) * 1e3 | 0) +
+    ' uuids/second');
+}
+
+console.log('# v4');
+
+// node-uuid - string form
+if (nodeuuid) {
+  for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4();
+  rate('nodeuuid.v4() - using node.js crypto RNG', t);
+
+  for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4({rng: nodeuuid.mathRNG});
+  rate('nodeuuid.v4() - using Math.random() RNG', t);
+
+  for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4('binary');
+  rate('nodeuuid.v4(\'binary\')', t);
+
+  var buffer = new nodeuuid.BufferClass(16);
+  for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4('binary', buffer);
+  rate('nodeuuid.v4(\'binary\', buffer)', t);
+}
+
+// libuuid - string form
+if (uuid) {
+  for (var i = 0, t = Date.now(); i < N; i++) uuid();
+  rate('uuid()', t);
+
+  for (var i = 0, t = Date.now(); i < N; i++) uuid('binary');
+  rate('uuid(\'binary\')', t);
+}
+
+// uuid-js - string form
+if (uuidjs) {
+  for (var i = 0, t = Date.now(); i < N; i++) uuidjs.create(4);
+  rate('uuidjs.create(4)', t);
+}
+
+// 140byte.es
+for (var i = 0, t = Date.now(); i < N; i++) 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(s,r){r=Math.random()*16|0;return (s=='x'?r:r&0x3|0x8).toString(16)});
+rate('140byte.es_v4', t);
+
+console.log('');
+console.log('# v1');
+
+// node-uuid - v1 string form
+if (nodeuuid) {
+  for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1();
+  rate('nodeuuid.v1()', t);
+
+  for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1('binary');
+  rate('nodeuuid.v1(\'binary\')', t);
+
+  var buffer = new nodeuuid.BufferClass(16);
+  for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1('binary', buffer);
+  rate('nodeuuid.v1(\'binary\', buffer)', t);
+}
+
+// uuid-js - v1 string form
+if (uuidjs) {
+  for (var i = 0, t = Date.now(); i < N; i++) uuidjs.create(1);
+  rate('uuidjs.create(1)', t);
+}
diff --git a/wrt/node_modules/node-uuid/bin/uuid b/wrt/node_modules/node-uuid/bin/uuid
new file mode 100755 (executable)
index 0000000..f732e99
--- /dev/null
@@ -0,0 +1,26 @@
+#!/usr/bin/env node
+
+var path = require('path');
+var uuid = require(path.join(__dirname, '..'));
+
+var arg = process.argv[2];
+
+if ('--help' === arg) {
+  console.log('\n  USAGE: uuid [version] [options]\n\n');
+  console.log('  options:\n');
+  console.log('  --help                     Display this message and exit\n');
+  process.exit(0);
+}
+
+if (null == arg) {
+  console.log(uuid());
+  process.exit(0);
+}
+
+if ('v1' !== arg && 'v4' !== arg) {
+  console.error('Version must be RFC4122 version 1 or version 4, denoted as "v1" or "v4"');
+  process.exit(1);
+}
+
+console.log(uuid[arg]());
+process.exit(0);
diff --git a/wrt/node_modules/node-uuid/bower.json b/wrt/node_modules/node-uuid/bower.json
new file mode 100644 (file)
index 0000000..c0925e1
--- /dev/null
@@ -0,0 +1,23 @@
+{
+  "name": "node-uuid",
+  "version": "1.4.7",
+  "homepage": "https://github.com/broofa/node-uuid",
+  "authors": [
+    "Robert Kieffer <robert@broofa.com>"
+  ],
+  "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.",
+  "main": "uuid.js",
+  "keywords": [
+    "uuid",
+    "gid",
+    "rfc4122"
+  ],
+  "license": "MIT",
+  "ignore": [
+    "**/.*",
+    "node_modules",
+    "bower_components",
+    "test",
+    "tests"
+  ]
+}
diff --git a/wrt/node_modules/node-uuid/component.json b/wrt/node_modules/node-uuid/component.json
new file mode 100644 (file)
index 0000000..3ff4633
--- /dev/null
@@ -0,0 +1,25 @@
+{
+  "name": "node-uuid",
+  "repo": "broofa/node-uuid",
+  "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.",
+  "version": "1.4.7",
+  "author": "Robert Kieffer <robert@broofa.com>",
+  "contributors": [
+    {
+      "name": "Christoph Tavan <dev@tavan.de>",
+      "github": "https://github.com/ctavan"
+    }
+  ],
+  "keywords": [
+    "uuid",
+    "guid",
+    "rfc4122"
+  ],
+  "dependencies": {},
+  "development": {},
+  "main": "uuid.js",
+  "scripts": [
+    "uuid.js"
+  ],
+  "license": "MIT"
+}
\ No newline at end of file
diff --git a/wrt/node_modules/node-uuid/lib/sha1-browser.js b/wrt/node_modules/node-uuid/lib/sha1-browser.js
new file mode 100644 (file)
index 0000000..fea185e
--- /dev/null
@@ -0,0 +1,120 @@
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
+/* SHA-1 (FIPS 180-4) implementation in JavaScript                    (c) Chris Veness 2002-2016  */
+/*                                                                                   MIT Licence  */
+/* www.movable-type.co.uk/scripts/sha1.html                                                       */
+/*                                                                                                */
+/*  - see http://csrc.nist.gov/groups/ST/toolkit/secure_hashing.html                              */
+/*        http://csrc.nist.gov/groups/ST/toolkit/examples.html                                    */
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
+
+'use strict';
+
+function f(s, x, y, z)  {
+    switch (s) {
+        case 0: return (x & y) ^ (~x & z);           // Ch()
+        case 1: return  x ^ y  ^  z;                 // Parity()
+        case 2: return (x & y) ^ (x & z) ^ (y & z);  // Maj()
+        case 3: return  x ^ y  ^  z;                 // Parity()
+    }
+}
+
+function ROTL(x, n) {
+    return (x<<n) | (x>>>(32-n));
+}
+
+var Sha1 = {};
+
+Sha1.hash = function(msg, options) {
+    var defaults = { msgFormat: 'string', outFormat: 'hex' };
+    var opt = Object.assign(defaults, options);
+
+    switch (opt.msgFormat) {
+        default: // default is to convert string to UTF-8, as SHA only deals with byte-streams
+        case 'string':   msg = Sha1.utf8Encode(msg);       break;
+        case 'hex-bytes':msg = Sha1.hexBytesToString(msg); break; // mostly for running tests
+    }
+
+    // constants [¤4.2.1]
+    var K = [ 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6 ];
+
+    // initial hash value [¤5.3.1]
+    var H = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ];
+
+    // PREPROCESSING [¤6.1.1]
+
+    msg += String.fromCharCode(0x80);  // add trailing '1' bit (+ 0's padding) to string [¤5.1.1]
+
+    // convert string msg into 512-bit/16-integer blocks arrays of ints [¤5.2.1]
+    var l = msg.length/4 + 2; // length (in 32-bit integers) of msg + Ô1Õ + appended length
+    var N = Math.ceil(l/16);  // number of 16-integer-blocks required to hold 'l' ints
+    var M = new Array(N);
+
+    for (var i=0; i<N; i++) {
+        M[i] = new Array(16);
+        for (var j=0; j<16; j++) {  // encode 4 chars per integer, big-endian encoding
+            M[i][j] = (msg.charCodeAt(i*64+j*4)<<24) | (msg.charCodeAt(i*64+j*4+1)<<16) |
+                (msg.charCodeAt(i*64+j*4+2)<<8) | (msg.charCodeAt(i*64+j*4+3));
+        } // note running off the end of msg is ok 'cos bitwise ops on NaN return 0
+    }
+    // add length (in bits) into final pair of 32-bit integers (big-endian) [¤5.1.1]
+    // note: most significant word would be (len-1)*8 >>> 32, but since JS converts
+    // bitwise-op args to 32 bits, we need to simulate this by arithmetic operators
+    M[N-1][14] = ((msg.length-1)*8) / Math.pow(2, 32); M[N-1][14] = Math.floor(M[N-1][14]);
+    M[N-1][15] = ((msg.length-1)*8) & 0xffffffff;
+
+    // HASH COMPUTATION [¤6.1.2]
+
+    for (var i=0; i<N; i++) {
+        var W = new Array(80);
+
+        // 1 - prepare message schedule 'W'
+        for (var t=0;  t<16; t++) W[t] = M[i][t];
+        for (var t=16; t<80; t++) W[t] = ROTL(W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16], 1);
+
+        // 2 - initialise five working variables a, b, c, d, e with previous hash value
+        var a = H[0], b = H[1], c = H[2], d = H[3], e = H[4];
+
+        // 3 - main loop (use JavaScript '>>> 0' to emulate UInt32 variables)
+        for (var t=0; t<80; t++) {
+            var s = Math.floor(t/20); // seq for blocks of 'f' functions and 'K' constants
+            var T = (ROTL(a,5) + f(s,b,c,d) + e + K[s] + W[t]) >>> 0;
+            e = d;
+            d = c;
+            c = ROTL(b, 30) >>> 0;
+            b = a;
+            a = T;
+        }
+
+        // 4 - compute the new intermediate hash value (note 'addition modulo 2^32' Ð JavaScript
+        // '>>> 0' coerces to unsigned UInt32 which achieves modulo 2^32 addition)
+        H[0] = (H[0]+a) >>> 0;
+        H[1] = (H[1]+b) >>> 0;
+        H[2] = (H[2]+c) >>> 0;
+        H[3] = (H[3]+d) >>> 0;
+        H[4] = (H[4]+e) >>> 0;
+    }
+
+    // convert H0..H4 to hex strings (with leading zeros)
+    for (var h=0; h<H.length; h++) H[h] = ('00000000'+H[h].toString(16)).slice(-8);
+
+    // concatenate H0..H4, with separator if required
+    var separator = opt.outFormat=='hex-w' ? ' ' : '';
+
+    return H.join(separator);
+};
+
+Sha1.utf8Encode = function(str) {
+    return unescape(encodeURIComponent(str));
+};
+
+Sha1.hexBytesToString = function(hexStr) {
+    hexStr = hexStr.replace(' ', ''); // allow space-separated groups
+    var str = '';
+    for (var i=0; i<hexStr.length; i+=2) {
+        str += String.fromCharCode(parseInt(hexStr.slice(i, i+2), 16));
+    }
+    return str;
+};
+
+
+module.exports = Sha1; // CommonJs export
diff --git a/wrt/node_modules/node-uuid/package.json b/wrt/node_modules/node-uuid/package.json
new file mode 100644 (file)
index 0000000..432208f
--- /dev/null
@@ -0,0 +1,118 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "node-uuid@^1.4.1",
+        "scope": null,
+        "escapedName": "node-uuid",
+        "name": "node-uuid",
+        "rawSpec": "^1.4.1",
+        "spec": ">=1.4.1 <2.0.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/diskdb"
+    ]
+  ],
+  "_from": "node-uuid@>=1.4.1 <2.0.0",
+  "_id": "node-uuid@1.4.8",
+  "_inCache": true,
+  "_location": "/node-uuid",
+  "_nodeVersion": "6.9.2",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/node-uuid-1.4.8.tgz_1490142638297_0.6400028455536813"
+  },
+  "_npmUser": {
+    "name": "broofa",
+    "email": "robert@broofa.com"
+  },
+  "_npmVersion": "4.3.0",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "node-uuid@^1.4.1",
+    "scope": null,
+    "escapedName": "node-uuid",
+    "name": "node-uuid",
+    "rawSpec": "^1.4.1",
+    "spec": ">=1.4.1 <2.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/diskdb"
+  ],
+  "_resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.8.tgz",
+  "_shasum": "b040eb0923968afabf8d32fb1f17f1167fdab907",
+  "_shrinkwrap": null,
+  "_spec": "node-uuid@^1.4.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/diskdb",
+  "author": {
+    "name": "Robert Kieffer",
+    "email": "robert@broofa.com"
+  },
+  "bin": {
+    "uuid": "./bin/uuid"
+  },
+  "bugs": {
+    "url": "https://github.com/broofa/node-uuid/issues"
+  },
+  "contributors": [
+    {
+      "name": "AJ ONeal",
+      "email": "coolaj86@gmail.com"
+    },
+    {
+      "name": "Christoph Tavan",
+      "email": "dev@tavan.de"
+    }
+  ],
+  "dependencies": {},
+  "deprecated": "Use uuid module instead",
+  "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.",
+  "devDependencies": {
+    "nyc": "^2.2.0"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "b040eb0923968afabf8d32fb1f17f1167fdab907",
+    "tarball": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.8.tgz"
+  },
+  "gitHead": "6f0f31b997cd6bec7919223e8897454350ed820f",
+  "homepage": "https://github.com/broofa/node-uuid",
+  "installable": true,
+  "keywords": [
+    "guid",
+    "rfc4122",
+    "uuid"
+  ],
+  "lib": ".",
+  "licenses": [
+    {
+      "type": "MIT",
+      "url": "https://raw.github.com/broofa/node-uuid/master/LICENSE.md"
+    }
+  ],
+  "main": "./uuid.js",
+  "maintainers": [
+    {
+      "name": "broofa",
+      "email": "robert@broofa.com"
+    },
+    {
+      "name": "defunctzombie",
+      "email": "shtylman@gmail.com"
+    }
+  ],
+  "name": "node-uuid",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/broofa/node-uuid.git"
+  },
+  "scripts": {
+    "coverage": "nyc npm test && nyc report",
+    "test": "node test/test.js"
+  },
+  "url": "http://github.com/broofa/node-uuid",
+  "version": "1.4.8"
+}
diff --git a/wrt/node_modules/node-uuid/test/compare_v1.js b/wrt/node_modules/node-uuid/test/compare_v1.js
new file mode 100644 (file)
index 0000000..05af822
--- /dev/null
@@ -0,0 +1,63 @@
+var assert = require('assert'),
+    nodeuuid = require('../uuid'),
+    uuidjs = require('uuid-js'),
+    libuuid = require('uuid').generate,
+    util = require('util'),
+    exec = require('child_process').exec,
+    os = require('os');
+
+// On Mac Os X / macports there's only the ossp-uuid package that provides uuid
+// On Linux there's uuid-runtime which provides uuidgen
+var uuidCmd = os.type() === 'Darwin' ? 'uuid -1' : 'uuidgen -t';
+
+function compare(ids) {
+  console.log(ids);
+  for (var i = 0; i < ids.length; i++) {
+    var id = ids[i].split('-');
+    id = [id[2], id[1], id[0]].join('');
+    ids[i] = id;
+  }
+  var sorted = ([].concat(ids)).sort();
+
+  if (sorted.toString() !== ids.toString()) {
+    console.log('Warning: sorted !== ids');
+  } else {
+    console.log('everything in order!');
+  }
+}
+
+// Test time order of v1 uuids
+var ids = [];
+while (ids.length < 10e3) ids.push(nodeuuid.v1());
+
+var max = 10;
+console.log('node-uuid:');
+ids = [];
+for (var i = 0; i < max; i++) ids.push(nodeuuid.v1());
+compare(ids);
+
+console.log('');
+console.log('uuidjs:');
+ids = [];
+for (var i = 0; i < max; i++) ids.push(uuidjs.create(1).toString());
+compare(ids);
+
+console.log('');
+console.log('libuuid:');
+ids = [];
+var count = 0;
+var last = function() {
+  compare(ids);
+}
+var cb = function(err, stdout, stderr) {
+  ids.push(stdout.substring(0, stdout.length-1));
+  count++;
+  if (count < max) {
+    return next();
+  }
+  last();
+};
+var next = function() {
+  exec(uuidCmd, cb);
+};
+next();
diff --git a/wrt/node_modules/node-uuid/test/test.html b/wrt/node_modules/node-uuid/test/test.html
new file mode 100644 (file)
index 0000000..d80326e
--- /dev/null
@@ -0,0 +1,17 @@
+<html>
+  <head>
+    <style>
+      div {
+        font-family: monospace;
+        font-size: 8pt;
+      }
+      div.log {color: #444;}
+      div.warn {color: #550;}
+      div.error {color: #800; font-weight: bold;}
+    </style>
+    <script src="../uuid.js"></script>
+  </head>
+  <body>
+    <script src="./test.js"></script>
+  </body>
+</html>
diff --git a/wrt/node_modules/node-uuid/test/test.js b/wrt/node_modules/node-uuid/test/test.js
new file mode 100644 (file)
index 0000000..5f1113d
--- /dev/null
@@ -0,0 +1,231 @@
+if (!this.uuid) {
+  // node.js
+  uuid = require('../uuid');
+  if (!/_rb/.test(uuid._rng.toString())) {
+    throw new Error("should use crypto for node.js");
+  }
+}
+
+//
+// x-platform log/assert shims
+//
+
+function _log(msg, type) {
+  type = type || 'log';
+
+  if (typeof(document) != 'undefined') {
+    document.write('<div class="' + type + '">' + msg.replace(/\n/g, '<br />') + '</div>');
+  }
+  if (typeof(console) != 'undefined') {
+    var color = {
+      log: '\033[39m',
+      warn: '\033[33m',
+      error: '\033[31m'
+    };
+    console[type](color[type] + msg + color.log);
+  }
+}
+
+function log(msg) {_log(msg, 'log');}
+function warn(msg) {_log(msg, 'warn');}
+function error(msg) {_log(msg, 'error');}
+
+function assert(res, msg) {
+  if (!res) {
+    error('FAIL: ' + msg);
+  } else {
+    log('Pass: ' + msg);
+  }
+}
+
+//
+// Unit tests
+//
+
+// Verify ordering of v1 ids created with explicit times
+var TIME = 1321644961388; // 2011-11-18 11:36:01.388-08:00
+
+function compare(name, ids) {
+  ids = ids.map(function(id) {
+    return id.split('-').reverse().join('-');
+  }).sort();
+  var sorted = ([].concat(ids)).sort();
+
+  assert(sorted.toString() == ids.toString(), name + ' have expected order');
+}
+
+// Verify ordering of v1 ids created using default behavior
+compare('uuids with current time', [
+  uuid.v1(),
+  uuid.v1(),
+  uuid.v1(),
+  uuid.v1(),
+  uuid.v1()
+]);
+
+// Verify ordering of v1 ids created with explicit times
+compare('uuids with time option', [
+  uuid.v1({msecs: TIME - 10*3600*1000}),
+  uuid.v1({msecs: TIME - 1}),
+  uuid.v1({msecs: TIME}),
+  uuid.v1({msecs: TIME + 1}),
+  uuid.v1({msecs: TIME + 28*24*3600*1000})
+]);
+
+assert(
+  uuid.v1({msecs: TIME}) != uuid.v1({msecs: TIME}),
+  'IDs created at same msec are different'
+);
+
+// Verify throw if too many ids created
+var thrown = false;
+try {
+  uuid.v1({msecs: TIME, nsecs: 10000});
+} catch (e) {
+  thrown = true;
+}
+assert(thrown, 'Exception thrown when > 10K ids created in 1 ms');
+
+// Verify clock regression bumps clockseq
+var uidt = uuid.v1({msecs: TIME});
+var uidtb = uuid.v1({msecs: TIME - 1});
+assert(
+  parseInt(uidtb.split('-')[3], 16) - parseInt(uidt.split('-')[3], 16) === 1,
+  'Clock regression by msec increments the clockseq'
+);
+
+// Verify clock regression bumps clockseq
+var uidtn = uuid.v1({msecs: TIME, nsecs: 10});
+var uidtnb = uuid.v1({msecs: TIME, nsecs: 9});
+assert(
+  parseInt(uidtnb.split('-')[3], 16) - parseInt(uidtn.split('-')[3], 16) === 1,
+  'Clock regression by nsec increments the clockseq'
+);
+
+// Verify explicit options produce expected id
+var id = uuid.v1({
+  msecs: 1321651533573,
+  nsecs: 5432,
+  clockseq: 0x385c,
+  node: [ 0x61, 0xcd, 0x3c, 0xbb, 0x32, 0x10 ]
+});
+assert(id == 'd9428888-122b-11e1-b85c-61cd3cbb3210', 'Explicit options produce expected id');
+
+// Verify adjacent ids across a msec boundary are 1 time unit apart
+var u0 = uuid.v1({msecs: TIME, nsecs: 9999});
+var u1 = uuid.v1({msecs: TIME + 1, nsecs: 0});
+
+var before = u0.split('-')[0], after = u1.split('-')[0];
+var dt = parseInt(after, 16) - parseInt(before, 16);
+assert(dt === 1, 'Ids spanning 1ms boundary are 100ns apart');
+
+//
+// Test parse/unparse
+//
+
+id = '00112233445566778899aabbccddeeff';
+assert(uuid.unparse(uuid.parse(id.substr(0,10))) ==
+  '00112233-4400-0000-0000-000000000000', 'Short parse');
+assert(uuid.unparse(uuid.parse('(this is the uuid -> ' + id + id)) ==
+  '00112233-4455-6677-8899-aabbccddeeff', 'Dirty parse');
+
+//
+// Perf tests
+//
+
+var generators = {
+  v1: uuid.v1,
+  v4: uuid.v4
+};
+
+var UUID_FORMAT = {
+  v1: /[0-9a-f]{8}-[0-9a-f]{4}-1[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i,
+  v4: /[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i
+};
+
+var N = 1e4;
+
+// Get %'age an actual value differs from the ideal value
+function divergence(actual, ideal) {
+  return Math.round(100*100*(actual - ideal)/ideal)/100;
+}
+
+function rate(msg, t) {
+  log(msg + ': ' + (N / (Date.now() - t) * 1e3 | 0) + ' uuids\/second');
+}
+
+for (var version in generators) {
+  var counts = {}, max = 0;
+  var generator = generators[version];
+  var format = UUID_FORMAT[version];
+
+  log('\nSanity check ' + N + ' ' + version + ' uuids');
+  for (var i = 0, ok = 0; i < N; i++) {
+    id = generator();
+    if (!format.test(id)) {
+      throw Error(id + ' is not a valid UUID string');
+    }
+
+    if (id != uuid.unparse(uuid.parse(id))) {
+      assert(fail, id + ' is not a valid id');
+    }
+
+    // Count digits for our randomness check
+    if (version == 'v4') {
+      var digits = id.replace(/-/g, '').split('');
+      for (var j = digits.length-1; j >= 0; j--) {
+        var c = digits[j];
+        max = Math.max(max, counts[c] = (counts[c] || 0) + 1);
+      }
+    }
+  }
+
+  // Check randomness for v4 UUIDs
+  if (version == 'v4') {
+    // Limit that we get worried about randomness. (Purely empirical choice, this!)
+    var limit = 2*100*Math.sqrt(1/N);
+
+    log('\nChecking v4 randomness.  Distribution of Hex Digits (% deviation from ideal)');
+
+    for (var i = 0; i < 16; i++) {
+      var c = i.toString(16);
+      var bar = '', n = counts[c], p = Math.round(n/max*100|0);
+
+      // 1-3,5-8, and D-F: 1:16 odds over 30 digits
+      var ideal = N*30/16;
+      if (i == 4) {
+        // 4: 1:1 odds on 1 digit, plus 1:16 odds on 30 digits
+        ideal = N*(1 + 30/16);
+      } else if (i >= 8 && i <= 11) {
+        // 8-B: 1:4 odds on 1 digit, plus 1:16 odds on 30 digits
+        ideal = N*(1/4 + 30/16);
+      } else {
+        // Otherwise: 1:16 odds on 30 digits
+        ideal = N*30/16;
+      }
+      var d = divergence(n, ideal);
+
+      // Draw bar using UTF squares (just for grins)
+      var s = n/max*50 | 0;
+      while (s--) bar += '=';
+
+      assert(Math.abs(d) < limit, c + ' |' + bar + '| ' + counts[c] + ' (' + d + '% < ' + limit + '%)');
+    }
+  }
+}
+
+// Perf tests
+for (var version in generators) {
+  log('\nPerformance testing ' + version + ' UUIDs');
+  var generator = generators[version];
+  var buf = new uuid.BufferClass(16);
+
+  for (var i = 0, t = Date.now(); i < N; i++) generator();
+  rate('uuid.' + version + '()', t);
+
+  for (var i = 0, t = Date.now(); i < N; i++) generator('binary');
+  rate('uuid.' + version + '(\'binary\')', t);
+
+  for (var i = 0, t = Date.now(); i < N; i++) generator('binary', buf);
+  rate('uuid.' + version + '(\'binary\', buffer)', t);
+}
diff --git a/wrt/node_modules/node-uuid/uuid.js b/wrt/node_modules/node-uuid/uuid.js
new file mode 100644 (file)
index 0000000..89c5b8f
--- /dev/null
@@ -0,0 +1,272 @@
+//     uuid.js
+//
+//     Copyright (c) 2010-2012 Robert Kieffer
+//     MIT License - http://opensource.org/licenses/mit-license.php
+
+/*global window, require, define */
+(function(_window) {
+  'use strict';
+
+  // Unique ID creation requires a high quality random # generator.  We feature
+  // detect to determine the best RNG source, normalizing to a function that
+  // returns 128-bits of randomness, since that's what's usually required
+  var _rng, _mathRNG, _nodeRNG, _whatwgRNG, _previousRoot;
+
+  function setupBrowser() {
+    // Allow for MSIE11 msCrypto
+    var _crypto = _window.crypto || _window.msCrypto;
+
+    if (!_rng && _crypto && _crypto.getRandomValues) {
+      // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto
+      //
+      // Moderately fast, high quality
+      try {
+        var _rnds8 = new Uint8Array(16);
+        _whatwgRNG = _rng = function whatwgRNG() {
+          _crypto.getRandomValues(_rnds8);
+          return _rnds8;
+        };
+        _rng();
+      } catch(e) {}
+    }
+
+    if (!_rng) {
+      // Math.random()-based (RNG)
+      //
+      // If all else fails, use Math.random().  It's fast, but is of unspecified
+      // quality.
+      var  _rnds = new Array(16);
+      _mathRNG = _rng = function() {
+        for (var i = 0, r; i < 16; i++) {
+          if ((i & 0x03) === 0) { r = Math.random() * 0x100000000; }
+          _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
+        }
+
+        return _rnds;
+      };
+      if ('undefined' !== typeof console && console.warn) {
+        console.warn("[SECURITY] node-uuid: crypto not usable, falling back to insecure Math.random()");
+      }
+    }
+  }
+
+  function setupNode() {
+    // Node.js crypto-based RNG - http://nodejs.org/docs/v0.6.2/api/crypto.html
+    //
+    // Moderately fast, high quality
+    if ('function' === typeof require) {
+      try {
+        var _rb = require('crypto').randomBytes;
+        _nodeRNG = _rng = _rb && function() {return _rb(16);};
+        _rng();
+      } catch(e) {}
+    }
+  }
+
+  if (_window) {
+    setupBrowser();
+  } else {
+    setupNode();
+  }
+
+  // Buffer class to use
+  var BufferClass = ('function' === typeof Buffer) ? Buffer : Array;
+
+  // Maps for number <-> hex string conversion
+  var _byteToHex = [];
+  var _hexToByte = {};
+  for (var i = 0; i < 256; i++) {
+    _byteToHex[i] = (i + 0x100).toString(16).substr(1);
+    _hexToByte[_byteToHex[i]] = i;
+  }
+
+  // **`parse()` - Parse a UUID into it's component bytes**
+  function parse(s, buf, offset) {
+    var i = (buf && offset) || 0, ii = 0;
+
+    buf = buf || [];
+    s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) {
+      if (ii < 16) { // Don't overflow!
+        buf[i + ii++] = _hexToByte[oct];
+      }
+    });
+
+    // Zero out remaining bytes if string was short
+    while (ii < 16) {
+      buf[i + ii++] = 0;
+    }
+
+    return buf;
+  }
+
+  // **`unparse()` - Convert UUID byte array (ala parse()) into a string**
+  function unparse(buf, offset) {
+    var i = offset || 0, bth = _byteToHex;
+    return  bth[buf[i++]] + bth[buf[i++]] +
+            bth[buf[i++]] + bth[buf[i++]] + '-' +
+            bth[buf[i++]] + bth[buf[i++]] + '-' +
+            bth[buf[i++]] + bth[buf[i++]] + '-' +
+            bth[buf[i++]] + bth[buf[i++]] + '-' +
+            bth[buf[i++]] + bth[buf[i++]] +
+            bth[buf[i++]] + bth[buf[i++]] +
+            bth[buf[i++]] + bth[buf[i++]];
+  }
+
+  // **`v1()` - Generate time-based UUID**
+  //
+  // Inspired by https://github.com/LiosK/UUID.js
+  // and http://docs.python.org/library/uuid.html
+
+  // random #'s we need to init node and clockseq
+  var _seedBytes = _rng();
+
+  // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
+  var _nodeId = [
+    _seedBytes[0] | 0x01,
+    _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5]
+  ];
+
+  // Per 4.2.2, randomize (14 bit) clockseq
+  var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff;
+
+  // Previous uuid creation time
+  var _lastMSecs = 0, _lastNSecs = 0;
+
+  // See https://github.com/broofa/node-uuid for API details
+  function v1(options, buf, offset) {
+    var i = buf && offset || 0;
+    var b = buf || [];
+
+    options = options || {};
+
+    var clockseq = (options.clockseq != null) ? options.clockseq : _clockseq;
+
+    // UUID timestamps are 100 nano-second units since the Gregorian epoch,
+    // (1582-10-15 00:00).  JSNumbers aren't precise enough for this, so
+    // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
+    // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
+    var msecs = (options.msecs != null) ? options.msecs : new Date().getTime();
+
+    // Per 4.2.1.2, use count of uuid's generated during the current clock
+    // cycle to simulate higher resolution clock
+    var nsecs = (options.nsecs != null) ? options.nsecs : _lastNSecs + 1;
+
+    // Time since last uuid creation (in msecs)
+    var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
+
+    // Per 4.2.1.2, Bump clockseq on clock regression
+    if (dt < 0 && options.clockseq == null) {
+      clockseq = clockseq + 1 & 0x3fff;
+    }
+
+    // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
+    // time interval
+    if ((dt < 0 || msecs > _lastMSecs) && options.nsecs == null) {
+      nsecs = 0;
+    }
+
+    // Per 4.2.1.2 Throw error if too many uuids are requested
+    if (nsecs >= 10000) {
+      throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
+    }
+
+    _lastMSecs = msecs;
+    _lastNSecs = nsecs;
+    _clockseq = clockseq;
+
+    // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
+    msecs += 12219292800000;
+
+    // `time_low`
+    var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
+    b[i++] = tl >>> 24 & 0xff;
+    b[i++] = tl >>> 16 & 0xff;
+    b[i++] = tl >>> 8 & 0xff;
+    b[i++] = tl & 0xff;
+
+    // `time_mid`
+    var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;
+    b[i++] = tmh >>> 8 & 0xff;
+    b[i++] = tmh & 0xff;
+
+    // `time_high_and_version`
+    b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
+    b[i++] = tmh >>> 16 & 0xff;
+
+    // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
+    b[i++] = clockseq >>> 8 | 0x80;
+
+    // `clock_seq_low`
+    b[i++] = clockseq & 0xff;
+
+    // `node`
+    var node = options.node || _nodeId;
+    for (var n = 0; n < 6; n++) {
+      b[i + n] = node[n];
+    }
+
+    return buf ? buf : unparse(b);
+  }
+
+  // **`v4()` - Generate random UUID**
+
+  // See https://github.com/broofa/node-uuid for API details
+  function v4(options, buf, offset) {
+    // Deprecated - 'format' argument, as supported in v1.2
+    var i = buf && offset || 0;
+
+    if (typeof(options) === 'string') {
+      buf = (options === 'binary') ? new BufferClass(16) : null;
+      options = null;
+    }
+    options = options || {};
+
+    var rnds = options.random || (options.rng || _rng)();
+
+    // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
+    rnds[6] = (rnds[6] & 0x0f) | 0x40;
+    rnds[8] = (rnds[8] & 0x3f) | 0x80;
+
+    // Copy bytes to buffer, if provided
+    if (buf) {
+      for (var ii = 0; ii < 16; ii++) {
+        buf[i + ii] = rnds[ii];
+      }
+    }
+
+    return buf || unparse(rnds);
+  }
+
+  // Export public API
+  var uuid = v4;
+  uuid.v1 = v1;
+  uuid.v4 = v4;
+  uuid.parse = parse;
+  uuid.unparse = unparse;
+  uuid.BufferClass = BufferClass;
+  uuid._rng = _rng;
+  uuid._mathRNG = _mathRNG;
+  uuid._nodeRNG = _nodeRNG;
+  uuid._whatwgRNG = _whatwgRNG;
+
+  if (('undefined' !== typeof module) && module.exports) {
+    // Publish as node.js module
+    module.exports = uuid;
+  } else if (typeof define === 'function' && define.amd) {
+    // Publish as AMD module
+    define(function() {return uuid;});
+
+
+  } else {
+    // Publish as global (in browsers)
+    _previousRoot = _window.uuid;
+
+    // **`noConflict()` - (browser only) to reset global 'uuid' var**
+    uuid.noConflict = function() {
+      _window.uuid = _previousRoot;
+      return uuid;
+    };
+
+    _window.uuid = uuid;
+  }
+})('undefined' !== typeof window ? window : null);
diff --git a/wrt/node_modules/node-uuid/v3.js b/wrt/node_modules/node-uuid/v3.js
new file mode 100644 (file)
index 0000000..a27c5b3
--- /dev/null
@@ -0,0 +1,54 @@
+var rng = require('./lib/rng');
+var bytesToUuid = require('./lib/bytesToUuid');
+
+function v3(name, namespaceUuid, buf, offset) {
+  var i = buf && offset || 0;
+
+  if (typeof(name) != 'string) {
+    throw TypeError('name must be defined')
+  }
+  if (typeof(namespaceUuid) != 'string) {
+    throw TypeError('name must be defined')
+  }
+
+  if (typeof(options) == 'string') {
+    buf = options == 'binary' ? new Array(16) : null;
+    options = null;
+  }
+  options = options || {};
+
+  var rnds = options.random || (options.rng || rng)();
+
+  // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
+  rnds[6] = (rnds[6] & 0x0f) | 0x40;
+  rnds[8] = (rnds[8] & 0x3f) | 0x80;
+
+  // Copy bytes to buffer, if provided
+  if (buf) {
+    for (var ii = 0; ii < 16; ++ii) {
+      buf[i + ii] = rnds[ii];
+    }
+  }
+
+  return buf || bytesToUuid(rnds);
+}
+
+exports.namespace = function(uuid) {
+  // Parse namespace uuid
+  var namespaceBytes = (uuid).match(/([0-9a-f][0-9a-f])/gi).map(function(s) {
+    return parseInt(s, 16);
+  });
+
+  return function(name) {
+    var bytes = [].concat(namespaceBytes);
+
+    var utf8String = unescape(encodeURIComponent(s))
+    for (var i = 0; i < utf8String.length; i++) {
+      bytes.push(utf8String.charCodeAt(i));
+    }
+
+    var hash = md5(bytes);
+  }
+}
+
+module.exports = v4;
diff --git a/wrt/node_modules/object-assign/index.js b/wrt/node_modules/object-assign/index.js
new file mode 100644 (file)
index 0000000..0930cf8
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+object-assign
+(c) Sindre Sorhus
+@license MIT
+*/
+
+'use strict';
+/* eslint-disable no-unused-vars */
+var getOwnPropertySymbols = Object.getOwnPropertySymbols;
+var hasOwnProperty = Object.prototype.hasOwnProperty;
+var propIsEnumerable = Object.prototype.propertyIsEnumerable;
+
+function toObject(val) {
+       if (val === null || val === undefined) {
+               throw new TypeError('Object.assign cannot be called with null or undefined');
+       }
+
+       return Object(val);
+}
+
+function shouldUseNative() {
+       try {
+               if (!Object.assign) {
+                       return false;
+               }
+
+               // Detect buggy property enumeration order in older V8 versions.
+
+               // https://bugs.chromium.org/p/v8/issues/detail?id=4118
+               var test1 = new String('abc');  // eslint-disable-line no-new-wrappers
+               test1[5] = 'de';
+               if (Object.getOwnPropertyNames(test1)[0] === '5') {
+                       return false;
+               }
+
+               // https://bugs.chromium.org/p/v8/issues/detail?id=3056
+               var test2 = {};
+               for (var i = 0; i < 10; i++) {
+                       test2['_' + String.fromCharCode(i)] = i;
+               }
+               var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
+                       return test2[n];
+               });
+               if (order2.join('') !== '0123456789') {
+                       return false;
+               }
+
+               // https://bugs.chromium.org/p/v8/issues/detail?id=3056
+               var test3 = {};
+               'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
+                       test3[letter] = letter;
+               });
+               if (Object.keys(Object.assign({}, test3)).join('') !==
+                               'abcdefghijklmnopqrst') {
+                       return false;
+               }
+
+               return true;
+       } catch (err) {
+               // We don't expect any of the above to throw, but better to be safe.
+               return false;
+       }
+}
+
+module.exports = shouldUseNative() ? Object.assign : function (target, source) {
+       var from;
+       var to = toObject(target);
+       var symbols;
+
+       for (var s = 1; s < arguments.length; s++) {
+               from = Object(arguments[s]);
+
+               for (var key in from) {
+                       if (hasOwnProperty.call(from, key)) {
+                               to[key] = from[key];
+                       }
+               }
+
+               if (getOwnPropertySymbols) {
+                       symbols = getOwnPropertySymbols(from);
+                       for (var i = 0; i < symbols.length; i++) {
+                               if (propIsEnumerable.call(from, symbols[i])) {
+                                       to[symbols[i]] = from[symbols[i]];
+                               }
+                       }
+               }
+       }
+
+       return to;
+};
diff --git a/wrt/node_modules/object-assign/license b/wrt/node_modules/object-assign/license
new file mode 100644 (file)
index 0000000..654d0bf
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/object-assign/package.json b/wrt/node_modules/object-assign/package.json
new file mode 100644 (file)
index 0000000..c054eb8
--- /dev/null
@@ -0,0 +1,118 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "object-assign@~4.1.1",
+        "scope": null,
+        "escapedName": "object-assign",
+        "name": "object-assign",
+        "rawSpec": "~4.1.1",
+        "spec": ">=4.1.1 <4.2.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io"
+    ]
+  ],
+  "_from": "object-assign@>=4.1.1 <4.2.0",
+  "_id": "object-assign@4.1.1",
+  "_inCache": true,
+  "_location": "/object-assign",
+  "_nodeVersion": "4.6.2",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/object-assign-4.1.1.tgz_1484580915042_0.07107710791751742"
+  },
+  "_npmUser": {
+    "name": "sindresorhus",
+    "email": "sindresorhus@gmail.com"
+  },
+  "_npmVersion": "2.15.11",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "object-assign@~4.1.1",
+    "scope": null,
+    "escapedName": "object-assign",
+    "name": "object-assign",
+    "rawSpec": "~4.1.1",
+    "spec": ">=4.1.1 <4.2.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/socket.io"
+  ],
+  "_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
+  "_shasum": "2109adc7965887cfc05cbbd442cac8bfbb360863",
+  "_shrinkwrap": null,
+  "_spec": "object-assign@~4.1.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io",
+  "author": {
+    "name": "Sindre Sorhus",
+    "email": "sindresorhus@gmail.com",
+    "url": "sindresorhus.com"
+  },
+  "bugs": {
+    "url": "https://github.com/sindresorhus/object-assign/issues"
+  },
+  "dependencies": {},
+  "description": "ES2015 `Object.assign()` ponyfill",
+  "devDependencies": {
+    "ava": "^0.16.0",
+    "lodash": "^4.16.4",
+    "matcha": "^0.7.0",
+    "xo": "^0.16.0"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "2109adc7965887cfc05cbbd442cac8bfbb360863",
+    "tarball": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "files": [
+    "index.js"
+  ],
+  "gitHead": "a89774b252c91612203876984bbd6addbe3b5a0e",
+  "homepage": "https://github.com/sindresorhus/object-assign#readme",
+  "keywords": [
+    "object",
+    "assign",
+    "extend",
+    "properties",
+    "es2015",
+    "ecmascript",
+    "harmony",
+    "ponyfill",
+    "prollyfill",
+    "polyfill",
+    "shim",
+    "browser"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "gaearon",
+      "email": "dan.abramov@gmail.com"
+    },
+    {
+      "name": "sindresorhus",
+      "email": "sindresorhus@gmail.com"
+    },
+    {
+      "name": "spicyj",
+      "email": "ben@benalpert.com"
+    }
+  ],
+  "name": "object-assign",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/sindresorhus/object-assign.git"
+  },
+  "scripts": {
+    "bench": "matcha bench.js",
+    "test": "xo && ava"
+  },
+  "version": "4.1.1"
+}
diff --git a/wrt/node_modules/object-assign/readme.md b/wrt/node_modules/object-assign/readme.md
new file mode 100644 (file)
index 0000000..1be09d3
--- /dev/null
@@ -0,0 +1,61 @@
+# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign)
+
+> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) [ponyfill](https://ponyfill.com)
+
+
+## Use the built-in
+
+Node.js 4 and up, as well as every evergreen browser (Chrome, Edge, Firefox, Opera, Safari),
+support `Object.assign()` :tada:. If you target only those environments, then by all
+means, use `Object.assign()` instead of this package.
+
+
+## Install
+
+```
+$ npm install --save object-assign
+```
+
+
+## Usage
+
+```js
+const objectAssign = require('object-assign');
+
+objectAssign({foo: 0}, {bar: 1});
+//=> {foo: 0, bar: 1}
+
+// multiple sources
+objectAssign({foo: 0}, {bar: 1}, {baz: 2});
+//=> {foo: 0, bar: 1, baz: 2}
+
+// overwrites equal keys
+objectAssign({foo: 0}, {foo: 1}, {foo: 2});
+//=> {foo: 2}
+
+// ignores null and undefined sources
+objectAssign({foo: 0}, null, {bar: 1}, undefined);
+//=> {foo: 0, bar: 1}
+```
+
+
+## API
+
+### objectAssign(target, [source, ...])
+
+Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones.
+
+
+## Resources
+
+- [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign)
+
+
+## Related
+
+- [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()`
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/wrt/node_modules/object-component/.npmignore b/wrt/node_modules/object-component/.npmignore
new file mode 100644 (file)
index 0000000..665aa21
--- /dev/null
@@ -0,0 +1,3 @@
+components
+build
+node_modules
diff --git a/wrt/node_modules/object-component/History.md b/wrt/node_modules/object-component/History.md
new file mode 100644 (file)
index 0000000..15e0ee0
--- /dev/null
@@ -0,0 +1,10 @@
+
+0.0.3 / 2012-10-15 
+==================
+
+  * package: added `component` namespace (fixes #1)
+
+0.0.2 / 2012-09-20 
+==================
+
+  * add code smell to `.merge()`
diff --git a/wrt/node_modules/object-component/Makefile b/wrt/node_modules/object-component/Makefile
new file mode 100644 (file)
index 0000000..b6b9850
--- /dev/null
@@ -0,0 +1,16 @@
+
+build: components index.js
+       @component build
+
+components:
+       @Component install
+
+clean:
+       rm -fr build components template.js
+
+test:
+       @./node_modules/.bin/mocha \
+               --require should \
+               --reporter spec
+
+.PHONY: clean test
diff --git a/wrt/node_modules/object-component/Readme.md b/wrt/node_modules/object-component/Readme.md
new file mode 100644 (file)
index 0000000..2c1f2d6
--- /dev/null
@@ -0,0 +1,31 @@
+
+# object
+
+  Object utils.
+
+## API
+
+### .keys(obj)
+
+  Return the keys for `obj`.
+
+### .values(obj)
+
+  Return the values for `obj`.
+
+### .length(obj)
+
+  Return the number of keys for `obj`.
+
+### .isEmpty(obj)
+
+  Check if `obj` is empty.
+
+### .merge(a, b)
+
+  Merge object `b` into `a`, returns `a`.
+  Precedence is given to `b`.
+
+## License
+
+  MIT
\ No newline at end of file
diff --git a/wrt/node_modules/object-component/component.json b/wrt/node_modules/object-component/component.json
new file mode 100644 (file)
index 0000000..eebc82a
--- /dev/null
@@ -0,0 +1,10 @@
+{
+  "name": "object",
+  "description": "Object keys / values / length",
+  "version": "0.0.3",
+  "keywords": ["object", "keys", "utility"],
+  "dependencies": {},
+  "scripts": [
+    "index.js"
+  ]
+}
\ No newline at end of file
diff --git a/wrt/node_modules/object-component/index.js b/wrt/node_modules/object-component/index.js
new file mode 100644 (file)
index 0000000..dba9eeb
--- /dev/null
@@ -0,0 +1,84 @@
+
+/**
+ * HOP ref.
+ */
+
+var has = Object.prototype.hasOwnProperty;
+
+/**
+ * Return own keys in `obj`.
+ *
+ * @param {Object} obj
+ * @return {Array}
+ * @api public
+ */
+
+exports.keys = Object.keys || function(obj){
+  var keys = [];
+  for (var key in obj) {
+    if (has.call(obj, key)) {
+      keys.push(key);
+    }
+  }
+  return keys;
+};
+
+/**
+ * Return own values in `obj`.
+ *
+ * @param {Object} obj
+ * @return {Array}
+ * @api public
+ */
+
+exports.values = function(obj){
+  var vals = [];
+  for (var key in obj) {
+    if (has.call(obj, key)) {
+      vals.push(obj[key]);
+    }
+  }
+  return vals;
+};
+
+/**
+ * Merge `b` into `a`.
+ *
+ * @param {Object} a
+ * @param {Object} b
+ * @return {Object} a
+ * @api public
+ */
+
+exports.merge = function(a, b){
+  for (var key in b) {
+    if (has.call(b, key)) {
+      a[key] = b[key];
+    }
+  }
+  return a;
+};
+
+/**
+ * Return length of `obj`.
+ *
+ * @param {Object} obj
+ * @return {Number}
+ * @api public
+ */
+
+exports.length = function(obj){
+  return exports.keys(obj).length;
+};
+
+/**
+ * Check if `obj` is empty.
+ *
+ * @param {Object} obj
+ * @return {Boolean}
+ * @api public
+ */
+
+exports.isEmpty = function(obj){
+  return 0 == exports.length(obj);
+};
\ No newline at end of file
diff --git a/wrt/node_modules/object-component/package.json b/wrt/node_modules/object-component/package.json
new file mode 100644 (file)
index 0000000..55782a0
--- /dev/null
@@ -0,0 +1,69 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "object-component@0.0.3",
+        "scope": null,
+        "escapedName": "object-component",
+        "name": "object-component",
+        "rawSpec": "0.0.3",
+        "spec": "0.0.3",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io-client"
+    ]
+  ],
+  "_from": "object-component@0.0.3",
+  "_id": "object-component@0.0.3",
+  "_inCache": true,
+  "_location": "/object-component",
+  "_npmUser": {
+    "name": "tjholowaychuk",
+    "email": "tj@vision-media.ca"
+  },
+  "_npmVersion": "1.1.61",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "object-component@0.0.3",
+    "scope": null,
+    "escapedName": "object-component",
+    "name": "object-component",
+    "rawSpec": "0.0.3",
+    "spec": "0.0.3",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/socket.io-client"
+  ],
+  "_resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz",
+  "_shasum": "f0c69aa50efc95b866c186f400a33769cb2f1291",
+  "_shrinkwrap": null,
+  "_spec": "object-component@0.0.3",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io-client",
+  "component": {
+    "scripts": {
+      "object/index.js": "index.js"
+    }
+  },
+  "dependencies": {},
+  "description": "Object utils.",
+  "devDependencies": {
+    "mocha": "*",
+    "should": "*"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "f0c69aa50efc95b866c186f400a33769cb2f1291",
+    "tarball": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "tjholowaychuk",
+      "email": "tj@vision-media.ca"
+    }
+  ],
+  "name": "object-component",
+  "optionalDependencies": {},
+  "readme": "\n# object\n\n  Object utils.\n\n## API\n\n### .keys(obj)\n\n  Return the keys for `obj`.\n\n### .values(obj)\n\n  Return the values for `obj`.\n\n### .length(obj)\n\n  Return the number of keys for `obj`.\n\n### .isEmpty(obj)\n\n  Check if `obj` is empty.\n\n### .merge(a, b)\n\n  Merge object `b` into `a`, returns `a`.\n  Precedence is given to `b`.\n\n## License\n\n  MIT",
+  "version": "0.0.3"
+}
diff --git a/wrt/node_modules/object-component/test/object.js b/wrt/node_modules/object-component/test/object.js
new file mode 100644 (file)
index 0000000..23a7423
--- /dev/null
@@ -0,0 +1,48 @@
+
+/**
+ * Module dependencies.
+ */
+
+var object = require('..');
+
+describe('.keys(obj)', function(){
+  it('should return the keys of an object', function(){
+    var obj = { name: 'tobi', age: 1 };
+    object.keys(obj).should.eql(['name', 'age']);
+  })
+})
+
+describe('.values(obj)', function(){
+  it('should return the values of an object', function(){
+    var obj = { name: 'tobi', age: 1 };
+    object.values(obj).should.eql(['tobi', 1]);
+  })
+})
+
+describe('.length(obj)', function(){
+  it('should return key count', function(){
+    var obj = { name: 'tobi', age: 1 };
+    object.length(obj).should.equal(2);
+  })
+})
+
+describe('.merge(a, b)', function(){
+  it('should merge two objects', function(){
+    var a = { foo: 'bar' };
+    var b = { bar: 'baz' };
+    object.merge(a, b).should.eql({ foo: 'bar', bar: 'baz' });
+  })
+
+  it('should give precedence to b', function(){
+    var a = { foo: 'bar' };
+    var b = { foo: 'baz' };
+    object.merge(a, b).should.eql({ foo: 'baz' });
+  })
+})
+
+describe('.isEmpty()', function(){
+  it('should check if the object is empty', function(){
+    object.isEmpty({}).should.be.true;
+    object.isEmpty({ foo: 'bar' }).should.be.false;
+  })
+})
\ No newline at end of file
diff --git a/wrt/node_modules/on-finished/HISTORY.md b/wrt/node_modules/on-finished/HISTORY.md
new file mode 100644 (file)
index 0000000..98ff0e9
--- /dev/null
@@ -0,0 +1,88 @@
+2.3.0 / 2015-05-26
+==================
+
+  * Add defined behavior for HTTP `CONNECT` requests
+  * Add defined behavior for HTTP `Upgrade` requests
+  * deps: ee-first@1.1.1
+
+2.2.1 / 2015-04-22
+==================
+
+  * Fix `isFinished(req)` when data buffered
+
+2.2.0 / 2014-12-22
+==================
+
+  * Add message object to callback arguments
+
+2.1.1 / 2014-10-22
+==================
+
+  * Fix handling of pipelined requests
+
+2.1.0 / 2014-08-16
+==================
+
+  * Check if `socket` is detached
+  * Return `undefined` for `isFinished` if state unknown
+
+2.0.0 / 2014-08-16
+==================
+
+  * Add `isFinished` function
+  * Move to `jshttp` organization
+  * Remove support for plain socket argument
+  * Rename to `on-finished`
+  * Support both `req` and `res` as arguments
+  * deps: ee-first@1.0.5
+
+1.2.2 / 2014-06-10
+==================
+
+  * Reduce listeners added to emitters
+    - avoids "event emitter leak" warnings when used multiple times on same request
+
+1.2.1 / 2014-06-08
+==================
+
+  * Fix returned value when already finished
+
+1.2.0 / 2014-06-05
+==================
+
+  * Call callback when called on already-finished socket
+
+1.1.4 / 2014-05-27
+==================
+
+  * Support node.js 0.8
+
+1.1.3 / 2014-04-30
+==================
+
+  * Make sure errors passed as instanceof `Error`
+
+1.1.2 / 2014-04-18
+==================
+
+  * Default the `socket` to passed-in object
+
+1.1.1 / 2014-01-16
+==================
+
+  * Rename module to `finished`
+
+1.1.0 / 2013-12-25
+==================
+
+  * Call callback when called on already-errored socket
+
+1.0.1 / 2013-12-20
+==================
+
+  * Actually pass the error to the callback
+
+1.0.0 / 2013-12-20
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/on-finished/LICENSE b/wrt/node_modules/on-finished/LICENSE
new file mode 100644 (file)
index 0000000..5931fd2
--- /dev/null
@@ -0,0 +1,23 @@
+(The MIT License)
+
+Copyright (c) 2013 Jonathan Ong <me@jongleberry.com>
+Copyright (c) 2014 Douglas Christopher Wilson <doug@somethingdoug.com>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/on-finished/README.md b/wrt/node_modules/on-finished/README.md
new file mode 100644 (file)
index 0000000..a0e1157
--- /dev/null
@@ -0,0 +1,154 @@
+# on-finished
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+Execute a callback when a HTTP request closes, finishes, or errors.
+
+## Install
+
+```sh
+$ npm install on-finished
+```
+
+## API
+
+```js
+var onFinished = require('on-finished')
+```
+
+### onFinished(res, listener)
+
+Attach a listener to listen for the response to finish. The listener will
+be invoked only once when the response finished. If the response finished
+to an error, the first argument will contain the error. If the response
+has already finished, the listener will be invoked.
+
+Listening to the end of a response would be used to close things associated
+with the response, like open files.
+
+Listener is invoked as `listener(err, res)`.
+
+```js
+onFinished(res, function (err, res) {
+  // clean up open fds, etc.
+  // err contains the error is request error'd
+})
+```
+
+### onFinished(req, listener)
+
+Attach a listener to listen for the request to finish. The listener will
+be invoked only once when the request finished. If the request finished
+to an error, the first argument will contain the error. If the request
+has already finished, the listener will be invoked.
+
+Listening to the end of a request would be used to know when to continue
+after reading the data.
+
+Listener is invoked as `listener(err, req)`.
+
+```js
+var data = ''
+
+req.setEncoding('utf8')
+res.on('data', function (str) {
+  data += str
+})
+
+onFinished(req, function (err, req) {
+  // data is read unless there is err
+})
+```
+
+### onFinished.isFinished(res)
+
+Determine if `res` is already finished. This would be useful to check and
+not even start certain operations if the response has already finished.
+
+### onFinished.isFinished(req)
+
+Determine if `req` is already finished. This would be useful to check and
+not even start certain operations if the request has already finished.
+
+## Special Node.js requests
+
+### HTTP CONNECT method
+
+The meaning of the `CONNECT` method from RFC 7231, section 4.3.6:
+
+> The CONNECT method requests that the recipient establish a tunnel to
+> the destination origin server identified by the request-target and,
+> if successful, thereafter restrict its behavior to blind forwarding
+> of packets, in both directions, until the tunnel is closed.  Tunnels
+> are commonly used to create an end-to-end virtual connection, through
+> one or more proxies, which can then be secured using TLS (Transport
+> Layer Security, [RFC5246]).
+
+In Node.js, these request objects come from the `'connect'` event on
+the HTTP server.
+
+When this module is used on a HTTP `CONNECT` request, the request is
+considered "finished" immediately, **due to limitations in the Node.js
+interface**. This means if the `CONNECT` request contains a request entity,
+the request will be considered "finished" even before it has been read.
+
+There is no such thing as a response object to a `CONNECT` request in
+Node.js, so there is no support for for one.
+
+### HTTP Upgrade request
+
+The meaning of the `Upgrade` header from RFC 7230, section 6.1:
+
+> The "Upgrade" header field is intended to provide a simple mechanism
+> for transitioning from HTTP/1.1 to some other protocol on the same
+> connection.
+
+In Node.js, these request objects come from the `'upgrade'` event on
+the HTTP server.
+
+When this module is used on a HTTP request with an `Upgrade` header, the
+request is considered "finished" immediately, **due to limitations in the
+Node.js interface**. This means if the `Upgrade` request contains a request
+entity, the request will be considered "finished" even before it has been
+read.
+
+There is no such thing as a response object to a `Upgrade` request in
+Node.js, so there is no support for for one.
+
+## Example
+
+The following code ensures that file descriptors are always closed
+once the response finishes.
+
+```js
+var destroy = require('destroy')
+var http = require('http')
+var onFinished = require('on-finished')
+
+http.createServer(function onRequest(req, res) {
+  var stream = fs.createReadStream('package.json')
+  stream.pipe(res)
+  onFinished(res, function (err) {
+    destroy(stream)
+  })
+})
+```
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/on-finished.svg
+[npm-url]: https://npmjs.org/package/on-finished
+[node-version-image]: https://img.shields.io/node/v/on-finished.svg
+[node-version-url]: http://nodejs.org/download/
+[travis-image]: https://img.shields.io/travis/jshttp/on-finished/master.svg
+[travis-url]: https://travis-ci.org/jshttp/on-finished
+[coveralls-image]: https://img.shields.io/coveralls/jshttp/on-finished/master.svg
+[coveralls-url]: https://coveralls.io/r/jshttp/on-finished?branch=master
+[downloads-image]: https://img.shields.io/npm/dm/on-finished.svg
+[downloads-url]: https://npmjs.org/package/on-finished
diff --git a/wrt/node_modules/on-finished/index.js b/wrt/node_modules/on-finished/index.js
new file mode 100644 (file)
index 0000000..9abd98f
--- /dev/null
@@ -0,0 +1,196 @@
+/*!
+ * on-finished
+ * Copyright(c) 2013 Jonathan Ong
+ * Copyright(c) 2014 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = onFinished
+module.exports.isFinished = isFinished
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var first = require('ee-first')
+
+/**
+ * Variables.
+ * @private
+ */
+
+/* istanbul ignore next */
+var defer = typeof setImmediate === 'function'
+  ? setImmediate
+  : function(fn){ process.nextTick(fn.bind.apply(fn, arguments)) }
+
+/**
+ * Invoke callback when the response has finished, useful for
+ * cleaning up resources afterwards.
+ *
+ * @param {object} msg
+ * @param {function} listener
+ * @return {object}
+ * @public
+ */
+
+function onFinished(msg, listener) {
+  if (isFinished(msg) !== false) {
+    defer(listener, null, msg)
+    return msg
+  }
+
+  // attach the listener to the message
+  attachListener(msg, listener)
+
+  return msg
+}
+
+/**
+ * Determine if message is already finished.
+ *
+ * @param {object} msg
+ * @return {boolean}
+ * @public
+ */
+
+function isFinished(msg) {
+  var socket = msg.socket
+
+  if (typeof msg.finished === 'boolean') {
+    // OutgoingMessage
+    return Boolean(msg.finished || (socket && !socket.writable))
+  }
+
+  if (typeof msg.complete === 'boolean') {
+    // IncomingMessage
+    return Boolean(msg.upgrade || !socket || !socket.readable || (msg.complete && !msg.readable))
+  }
+
+  // don't know
+  return undefined
+}
+
+/**
+ * Attach a finished listener to the message.
+ *
+ * @param {object} msg
+ * @param {function} callback
+ * @private
+ */
+
+function attachFinishedListener(msg, callback) {
+  var eeMsg
+  var eeSocket
+  var finished = false
+
+  function onFinish(error) {
+    eeMsg.cancel()
+    eeSocket.cancel()
+
+    finished = true
+    callback(error)
+  }
+
+  // finished on first message event
+  eeMsg = eeSocket = first([[msg, 'end', 'finish']], onFinish)
+
+  function onSocket(socket) {
+    // remove listener
+    msg.removeListener('socket', onSocket)
+
+    if (finished) return
+    if (eeMsg !== eeSocket) return
+
+    // finished on first socket event
+    eeSocket = first([[socket, 'error', 'close']], onFinish)
+  }
+
+  if (msg.socket) {
+    // socket already assigned
+    onSocket(msg.socket)
+    return
+  }
+
+  // wait for socket to be assigned
+  msg.on('socket', onSocket)
+
+  if (msg.socket === undefined) {
+    // node.js 0.8 patch
+    patchAssignSocket(msg, onSocket)
+  }
+}
+
+/**
+ * Attach the listener to the message.
+ *
+ * @param {object} msg
+ * @return {function}
+ * @private
+ */
+
+function attachListener(msg, listener) {
+  var attached = msg.__onFinished
+
+  // create a private single listener with queue
+  if (!attached || !attached.queue) {
+    attached = msg.__onFinished = createListener(msg)
+    attachFinishedListener(msg, attached)
+  }
+
+  attached.queue.push(listener)
+}
+
+/**
+ * Create listener on message.
+ *
+ * @param {object} msg
+ * @return {function}
+ * @private
+ */
+
+function createListener(msg) {
+  function listener(err) {
+    if (msg.__onFinished === listener) msg.__onFinished = null
+    if (!listener.queue) return
+
+    var queue = listener.queue
+    listener.queue = null
+
+    for (var i = 0; i < queue.length; i++) {
+      queue[i](err, msg)
+    }
+  }
+
+  listener.queue = []
+
+  return listener
+}
+
+/**
+ * Patch ServerResponse.prototype.assignSocket for node.js 0.8.
+ *
+ * @param {ServerResponse} res
+ * @param {function} callback
+ * @private
+ */
+
+function patchAssignSocket(res, callback) {
+  var assignSocket = res.assignSocket
+
+  if (typeof assignSocket !== 'function') return
+
+  // res.on('socket', callback) is broken in 0.8
+  res.assignSocket = function _assignSocket(socket) {
+    assignSocket.call(this, socket)
+    callback(socket)
+  }
+}
diff --git a/wrt/node_modules/on-finished/package.json b/wrt/node_modules/on-finished/package.json
new file mode 100644 (file)
index 0000000..4668dc5
--- /dev/null
@@ -0,0 +1,106 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "on-finished@~2.3.0",
+        "scope": null,
+        "escapedName": "on-finished",
+        "name": "on-finished",
+        "rawSpec": "~2.3.0",
+        "spec": ">=2.3.0 <2.4.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express"
+    ]
+  ],
+  "_from": "on-finished@>=2.3.0 <2.4.0",
+  "_id": "on-finished@2.3.0",
+  "_inCache": true,
+  "_location": "/on-finished",
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "1.4.28",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "on-finished@~2.3.0",
+    "scope": null,
+    "escapedName": "on-finished",
+    "name": "on-finished",
+    "rawSpec": "~2.3.0",
+    "spec": ">=2.3.0 <2.4.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/express",
+    "/finalhandler",
+    "/send"
+  ],
+  "_resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
+  "_shasum": "20f1336481b083cd75337992a16971aa2d906947",
+  "_shrinkwrap": null,
+  "_spec": "on-finished@~2.3.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express",
+  "bugs": {
+    "url": "https://github.com/jshttp/on-finished/issues"
+  },
+  "contributors": [
+    {
+      "name": "Douglas Christopher Wilson",
+      "email": "doug@somethingdoug.com"
+    },
+    {
+      "name": "Jonathan Ong",
+      "email": "me@jongleberry.com",
+      "url": "http://jongleberry.com"
+    }
+  ],
+  "dependencies": {
+    "ee-first": "1.1.1"
+  },
+  "description": "Execute a callback when a request closes, finishes, or errors",
+  "devDependencies": {
+    "istanbul": "0.3.9",
+    "mocha": "2.2.5"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "20f1336481b083cd75337992a16971aa2d906947",
+    "tarball": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz"
+  },
+  "engines": {
+    "node": ">= 0.8"
+  },
+  "files": [
+    "HISTORY.md",
+    "LICENSE",
+    "index.js"
+  ],
+  "gitHead": "34babcb58126a416fcf5205768204f2e12699dda",
+  "homepage": "https://github.com/jshttp/on-finished",
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    },
+    {
+      "name": "jongleberry",
+      "email": "jonathanrichardong@gmail.com"
+    }
+  ],
+  "name": "on-finished",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/jshttp/on-finished.git"
+  },
+  "scripts": {
+    "test": "mocha --reporter spec --bail --check-leaks test/",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
+    "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
+  },
+  "version": "2.3.0"
+}
diff --git a/wrt/node_modules/once/LICENSE b/wrt/node_modules/once/LICENSE
new file mode 100644 (file)
index 0000000..19129e3
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/wrt/node_modules/once/README.md b/wrt/node_modules/once/README.md
new file mode 100644 (file)
index 0000000..1f1ffca
--- /dev/null
@@ -0,0 +1,79 @@
+# once
+
+Only call a function once.
+
+## usage
+
+```javascript
+var once = require('once')
+
+function load (file, cb) {
+  cb = once(cb)
+  loader.load('file')
+  loader.once('load', cb)
+  loader.once('error', cb)
+}
+```
+
+Or add to the Function.prototype in a responsible way:
+
+```javascript
+// only has to be done once
+require('once').proto()
+
+function load (file, cb) {
+  cb = cb.once()
+  loader.load('file')
+  loader.once('load', cb)
+  loader.once('error', cb)
+}
+```
+
+Ironically, the prototype feature makes this module twice as
+complicated as necessary.
+
+To check whether you function has been called, use `fn.called`. Once the
+function is called for the first time the return value of the original
+function is saved in `fn.value` and subsequent calls will continue to
+return this value.
+
+```javascript
+var once = require('once')
+
+function load (cb) {
+  cb = once(cb)
+  var stream = createStream()
+  stream.once('data', cb)
+  stream.once('end', function () {
+    if (!cb.called) cb(new Error('not found'))
+  })
+}
+```
+
+## `once.strict(func)`
+
+Throw an error if the function is called twice.
+
+Some functions are expected to be called only once. Using `once` for them would
+potentially hide logical errors.
+
+In the example below, the `greet` function has to call the callback only once:
+
+```javascript
+function greet (name, cb) {
+  // return is missing from the if statement
+  // when no name is passed, the callback is called twice
+  if (!name) cb('Hello anonymous')
+  cb('Hello ' + name)
+}
+
+function log (msg) {
+  console.log(msg)
+}
+
+// this will print 'Hello anonymous' but the logical error will be missed
+greet(null, once(msg))
+
+// once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time
+greet(null, once.strict(msg))
+```
diff --git a/wrt/node_modules/once/once.js b/wrt/node_modules/once/once.js
new file mode 100644 (file)
index 0000000..2354067
--- /dev/null
@@ -0,0 +1,42 @@
+var wrappy = require('wrappy')
+module.exports = wrappy(once)
+module.exports.strict = wrappy(onceStrict)
+
+once.proto = once(function () {
+  Object.defineProperty(Function.prototype, 'once', {
+    value: function () {
+      return once(this)
+    },
+    configurable: true
+  })
+
+  Object.defineProperty(Function.prototype, 'onceStrict', {
+    value: function () {
+      return onceStrict(this)
+    },
+    configurable: true
+  })
+})
+
+function once (fn) {
+  var f = function () {
+    if (f.called) return f.value
+    f.called = true
+    return f.value = fn.apply(this, arguments)
+  }
+  f.called = false
+  return f
+}
+
+function onceStrict (fn) {
+  var f = function () {
+    if (f.called)
+      throw new Error(f.onceError)
+    f.called = true
+    return f.value = fn.apply(this, arguments)
+  }
+  var name = fn.name || 'Function wrapped with `once`'
+  f.onceError = name + " shouldn't be called more than once"
+  f.called = false
+  return f
+}
diff --git a/wrt/node_modules/once/package.json b/wrt/node_modules/once/package.json
new file mode 100644 (file)
index 0000000..36abed7
--- /dev/null
@@ -0,0 +1,71 @@
+{
+  "_from": "once@^1.3.0",
+  "_id": "once@1.4.0",
+  "_inBundle": false,
+  "_integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
+  "_location": "/once",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "once@^1.3.0",
+    "name": "once",
+    "escapedName": "once",
+    "rawSpec": "^1.3.0",
+    "saveSpec": null,
+    "fetchSpec": "^1.3.0"
+  },
+  "_requiredBy": [
+    "/asar/glob",
+    "/coffeelint/glob",
+    "/glob",
+    "/inflight",
+    "/node-gyp/glob",
+    "/rimraf/glob"
+  ],
+  "_resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
+  "_shasum": "583b1aa775961d4b113ac17d9c50baef9dd76bd1",
+  "_spec": "once@^1.3.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was/node_modules/glob",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bugs": {
+    "url": "https://github.com/isaacs/once/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {
+    "wrappy": "1"
+  },
+  "deprecated": false,
+  "description": "Run a function exactly one time",
+  "devDependencies": {
+    "tap": "^7.0.1"
+  },
+  "directories": {
+    "test": "test"
+  },
+  "files": [
+    "once.js"
+  ],
+  "homepage": "https://github.com/isaacs/once#readme",
+  "keywords": [
+    "once",
+    "function",
+    "one",
+    "single"
+  ],
+  "license": "ISC",
+  "main": "once.js",
+  "name": "once",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/once.git"
+  },
+  "scripts": {
+    "test": "tap test/*.js"
+  },
+  "version": "1.4.0"
+}
diff --git a/wrt/node_modules/over/.npmignore b/wrt/node_modules/over/.npmignore
new file mode 100644 (file)
index 0000000..05ade97
--- /dev/null
@@ -0,0 +1,3 @@
+node_modules
+npm-debug.log
+.idea
diff --git a/wrt/node_modules/over/README.md b/wrt/node_modules/over/README.md
new file mode 100644 (file)
index 0000000..0991549
--- /dev/null
@@ -0,0 +1,112 @@
+# over
+
+JavaScript function overloading framework.
+
+## Installation
+
+```bash
+$ npm install over
+```
+
+## Quick Examples
+
+```javascript
+var over = require('over');
+
+var myfn = over([
+  [over.string, function (str) { console.log('got a string' + str); }],
+  [over.string, over.numberOptionalWithDefault(5), over.callbackOptional, function (str, number, callback) {
+    console.log('got a string and a number and a callback');
+    callback(str, number);
+  }],
+  function() {
+    // default function if nothing else matches
+  }
+]);
+```
+
+## Builtin Test functions
+
+* func
+* funcOptional
+* funcOptionalWithDefault
+* callbackOptional  // Will return an empty function of parameter is not given
+* string
+* stringOptional
+* stringOptionalWithDefault
+* number
+* numberOptional
+* numberOptionalWithDefault
+* array
+* arrayOptional
+* arrayOptionalWithDefault
+* object
+* objectOptional
+* objectOptionalWithDefault
+
+The built in optional functions with a suffix of "WithDefault" take a default value as well which will be used if
+it is not passed in.
+
+```javascript
+var myfn = over([
+  [over.stringOptionalWithDefault('default value'), function (str) { console.log('got a string' + str); }],
+]);
+```
+
+## Write your own test functions
+
+Simple optional test
+
+```javascript
+function greaterThan5Optional(arg) {
+  return arg > 5;
+}
+greaterThan5Optional.optional = true; // mark it as an optional parameter
+
+var myfn = over([
+  [greaterThan5Optional, function (v) { console.log('got a value' + v); }]
+]);
+```
+
+Optional test with default
+
+```javascript
+function greaterThan5OptionalWithDefault(def) {
+  return function greaterThan5OptionalWithDefault2(arg) {
+    if (arg === undefined) {
+      return { defaultValue: def };
+    }
+    return arg > 5;
+  }
+}
+greaterThan5OptionalWithDefault.optional = true; // mark it as an optional parameter
+
+var myfn = over([
+  [greaterThan5OptionalWithDefault, function (v) { console.log('got a value' + v); }]
+]);
+```
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2012 Near Infinity Corporation
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/over/overload.js b/wrt/node_modules/over/overload.js
new file mode 100644 (file)
index 0000000..7e593c1
--- /dev/null
@@ -0,0 +1,236 @@
+'use strict';
+
+// overloadDefs
+// self, overloadDefs
+var overload = module.exports = function () {
+  var self, selfSet = false, overloadDefs;
+  if (arguments.length === 1) {
+    overloadDefs = arguments[0];
+  } else {
+    selfSet = true;
+    self = arguments[0];
+    overloadDefs = arguments[1];
+  }
+  return function () {
+    if (!selfSet) {
+      self = this;
+    }
+    var args = Array.prototype.slice.call(arguments);
+    var overloadMatchData = findOverload(overloadDefs, args);
+    if (!overloadMatchData) {
+      throw new Error(createErrorMessage('No match found.', overloadDefs));
+    }
+    var overloadFn = overloadMatchData.def[overloadMatchData.def.length - 1];
+    return overloadFn.apply(self, overloadMatchData.args);
+  };
+};
+
+var findOverload = overload.findOverload = function (overloadDefs, args) {
+  for (var i = 0; i < overloadDefs.length; i++) {
+    if (i === overloadDefs.length - 1 && typeof(overloadDefs[i]) === 'function') {
+      return { args: args, def: [overloadDefs[i]] };
+    }
+    var newArgs;
+    if (newArgs = isMatch(overloadDefs[i], args)) {
+      return { args: newArgs, def: overloadDefs[i] };
+    }
+  }
+  return null;
+};
+
+function isMatch(overloadDef, args) {
+  var overloadDefIdx;
+  var argIdx;
+  var newArgs = [];
+  for (overloadDefIdx = 0, argIdx = 0; overloadDefIdx < overloadDef.length - 1; overloadDefIdx++) {
+    if (typeof(overloadDef[overloadDefIdx]) !== 'function') {
+      throw new Error("Invalid overload definition. Array should only contain functions.");
+    }
+    //console.log('overloadDef/arg:', overloadDef[overloadDefIdx], args[argIdx]);
+    var result = overloadDef[overloadDefIdx](args[argIdx]);
+    //console.log('result:', result);
+    if (result) {
+      if (result.hasOwnProperty('defaultValue')) {
+        newArgs.push(result.defaultValue);
+      } else {
+        if (overloadDef[overloadDefIdx].optional && args[argIdx] === null) {
+          argIdx++;
+          newArgs.push(overloadDef[overloadDefIdx].defaultValue);
+          continue;
+        }
+        newArgs.push(args[argIdx]);
+        argIdx++;
+      }
+    } else {
+      if (overloadDef[overloadDefIdx].optional) {
+        newArgs.push(overloadDef[overloadDefIdx].defaultValue);
+        continue;
+      }
+      return false;
+    }
+  }
+  //console.log('compares', overloadDefIdx, overloadDef.length - 1, argIdx, args.length, newArgs.length);
+  if (overloadDefIdx === overloadDef.length - 1 && argIdx >= args.length) {
+    return newArgs;
+  }
+  return false;
+}
+
+function createErrorMessage(message, overloadDefs) {
+  message += '\n';
+  message += '  Possible matches:\n';
+  for (var i = 0; i < overloadDefs.length; i++) {
+    var overloadDef = overloadDefs[i];
+    if (typeof(overloadDef) === 'function') {
+      message += '   [default]\n';
+    } else {
+      var matchers = overloadDef.slice(0, overloadDef.length - 1);
+      matchers = matchers.map(function (m) {
+        if (!m) {
+          return '[invalid argument definition]';
+        }
+        return m.name || m;
+      });
+      if (matchers.length === 0) {
+        message += '   ()\n';
+      } else {
+        message += '   (' + matchers.join(', ') + ')\n';
+      }
+    }
+  }
+  return message;
+}
+
+// --- func
+overload.func = function func(arg) {
+  return typeof(arg) === 'function';
+};
+
+overload.funcOptional = function funcOptional(arg) {
+  if (!arg) {
+    return true;
+  }
+  return overload.func(arg);
+};
+overload.funcOptional.optional = true;
+
+overload.funcOptionalWithDefault = function (def) {
+  var fn = function funcOptionalWithDefault(arg) {
+    if (arg === undefined) {
+      return false;
+    }
+    return overload.func(arg);
+  };
+  fn.optional = true;
+  fn.defaultValue = def;
+  return fn;
+};
+
+// --- callback
+overload.callbackOptional = function callbackOptional(arg) {
+  if (!arg) {
+    return { defaultValue: function defaultCallback() {} };
+  }
+  return overload.func(arg);
+};
+overload.callbackOptional.optional = true;
+
+// --- string
+overload.string = function string(arg) {
+  return typeof(arg) === 'string';
+};
+
+overload.stringOptional = function stringOptional(arg) {
+  if (!arg) {
+    return true;
+  }
+  return overload.string(arg);
+};
+overload.stringOptional.optional = true;
+
+overload.stringOptionalWithDefault = function (def) {
+  var fn = function stringOptionalWithDefault(arg) {
+    if (arg === undefined) {
+      return false;
+    }
+    return overload.string(arg);
+  };
+  fn.optional = true;
+  fn.defaultValue = def;
+  return fn;
+};
+
+// --- number
+overload.number = function number(arg) {
+  return typeof(arg) === 'number';
+};
+
+overload.numberOptional = function numberOptional(arg) {
+  if (!arg) {
+    return true;
+  }
+  return overload.number(arg);
+};
+overload.numberOptional.optional = true;
+
+overload.numberOptionalWithDefault = function (def) {
+  var fn = function numberOptionalWithDefault(arg) {
+    if (arg === undefined) {
+      return false;
+    }
+    return overload.number(arg);
+  };
+  fn.optional = true;
+  fn.defaultValue = def;
+  return fn;
+};
+
+// --- array
+overload.array = function array(arg) {
+  return arg instanceof Array;
+};
+
+overload.arrayOptional = function arrayOptional(arg) {
+  if (!arg) {
+    return true;
+  }
+  return overload.array(arg);
+};
+overload.arrayOptional.optional = true;
+
+overload.arrayOptionalWithDefault = function (def) {
+  var fn = function arrayOptionalWithDefault(arg) {
+    if (arg === undefined) {
+      return false;
+    }
+    return overload.array(arg);
+  };
+  fn.optional = true;
+  fn.defaultValue = def;
+  return fn;
+};
+
+// --- object
+overload.object = function object(arg) {
+  return typeof(arg) === 'object';
+};
+
+overload.objectOptional = function objectOptional(arg) {
+  if (!arg) {
+    return true;
+  }
+  return overload.object(arg);
+};
+overload.objectOptional.optional = true;
+
+overload.objectOptionalWithDefault = function (def) {
+  var fn = function objectOptionalWithDefault(arg) {
+    if (arg === undefined) {
+      return false;
+    }
+    return overload.object(arg);
+  };
+  fn.optional = true;
+  fn.defaultValue = def;
+  return fn;
+};
diff --git a/wrt/node_modules/over/package.json b/wrt/node_modules/over/package.json
new file mode 100644 (file)
index 0000000..6436405
--- /dev/null
@@ -0,0 +1,82 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "over@>= 0.0.5 < 1",
+        "scope": null,
+        "escapedName": "over",
+        "name": "over",
+        "rawSpec": ">= 0.0.5 < 1",
+        "spec": ">=0.0.5 <1.0.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/pullstream"
+    ]
+  ],
+  "_from": "over@>=0.0.5 <1.0.0",
+  "_id": "over@0.0.5",
+  "_inCache": true,
+  "_location": "/over",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "over@>= 0.0.5 < 1",
+    "scope": null,
+    "escapedName": "over",
+    "name": "over",
+    "rawSpec": ">= 0.0.5 < 1",
+    "spec": ">=0.0.5 <1.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/pullstream"
+  ],
+  "_resolved": "https://registry.npmjs.org/over/-/over-0.0.5.tgz",
+  "_shasum": "f29852e70fd7e25f360e013a8ec44c82aedb5708",
+  "_shrinkwrap": null,
+  "_spec": "over@>= 0.0.5 < 1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/pullstream",
+  "author": {
+    "name": "Joe Ferner",
+    "email": "joe@fernsroth.com"
+  },
+  "bugs": {
+    "url": "https://github.com/nearinfinity/node-over/issues"
+  },
+  "dependencies": {},
+  "description": "JavaScript function overloading framework.",
+  "devDependencies": {
+    "nodeunit": "~0.7.4"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "f29852e70fd7e25f360e013a8ec44c82aedb5708",
+    "tarball": "https://registry.npmjs.org/over/-/over-0.0.5.tgz"
+  },
+  "engines": {
+    "node": "*"
+  },
+  "homepage": "https://github.com/nearinfinity/node-over#readme",
+  "keywords": [
+    "function",
+    "overload"
+  ],
+  "license": "MIT",
+  "main": "overload.js",
+  "maintainers": [
+    {
+      "name": "joeferner",
+      "email": "joe@fernsroth.com"
+    }
+  ],
+  "name": "over",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/nearinfinity/node-over.git"
+  },
+  "scripts": {
+    "test": "./node_modules/.bin/nodeunit test"
+  },
+  "version": "0.0.5"
+}
diff --git a/wrt/node_modules/over/test/defFunctionsTest.js b/wrt/node_modules/over/test/defFunctionsTest.js
new file mode 100644 (file)
index 0000000..b163e3c
--- /dev/null
@@ -0,0 +1,89 @@
+'use strict';
+
+var overload = require('../');
+
+module.exports = {
+  'required, good': function (test) {
+    var items = [
+      { fn: overload.func, param: function () {} },
+      { fn: overload.funcOptional, param: function () {} },
+      { fn: overload.funcOptionalWithDefault(function () {}), param: function () {} },
+      { fn: overload.callbackOptional, param: function () {} },
+      { fn: overload.string, param: 'test' },
+      { fn: overload.stringOptional, param: 'test' },
+      { fn: overload.stringOptionalWithDefault('test'), param: 'test' },
+      { fn: overload.number, param: 5 },
+      { fn: overload.numberOptional, param: 5 },
+      { fn: overload.numberOptionalWithDefault(5), param: 5 },
+      { fn: overload.array, param: [1] },
+      { fn: overload.arrayOptional, param: [1] },
+      { fn: overload.arrayOptionalWithDefault([1]), param: [1] },
+      { fn: overload.object, param: {} },
+      { fn: overload.objectOptional, param: {} },
+      { fn: overload.objectOptionalWithDefault({}), param: {} }
+    ];
+    items.forEach(function (item) {
+      test.equals(item.fn(item.param), true);
+    });
+    test.done();
+  },
+
+  'required, bad': function (test) {
+    var items = [
+      { fn: overload.func, param: 5 },
+      { fn: overload.funcOptional, param: 5 },
+      { fn: overload.funcOptionalWithDefault(function () {}), param: 5 },
+      { fn: overload.callbackOptional, param: 5 },
+      { fn: overload.string, param: 5 },
+      { fn: overload.stringOptional, param: 5 },
+      { fn: overload.stringOptionalWithDefault('test'), param: 5 },
+      { fn: overload.number, param: 'test' },
+      { fn: overload.numberOptional, param: 'test' },
+      { fn: overload.numberOptionalWithDefault(5), param: 'test' },
+      { fn: overload.array, param: 5 },
+      { fn: overload.arrayOptional, param: 5 },
+      { fn: overload.arrayOptionalWithDefault([]), param: 5 },
+      { fn: overload.object, param: 5 },
+      { fn: overload.objectOptional, param: 5 },
+      { fn: overload.objectOptionalWithDefault({}), param: 5 }
+    ];
+    items.forEach(function (item) {
+      test.equals(item.fn(item.param), false);
+    });
+    test.done();
+  },
+
+  'optional, null': function (test) {
+    var items = [
+      { fn: overload.funcOptional },
+      { fn: overload.stringOptional },
+      { fn: overload.numberOptional },
+      { fn: overload.arrayOptional },
+      { fn: overload.objectOptional }
+    ];
+    items.forEach(function (item) {
+      test.equals(item.fn(null), true, 'invalid results for function: ' + item.fn.name);
+    });
+    test.done();
+  },
+
+  'optional, callback': function (test) {
+    test.equals(typeof(overload.callbackOptional(null).defaultValue), 'function');
+    test.done();
+  },
+
+  'with defaults': function (test) {
+    var fn = function () {};
+    var items = [
+      { fn: overload.funcOptionalWithDefault(fn), expected: fn },
+      { fn: overload.stringOptionalWithDefault('test'), expected: 'test' },
+      { fn: overload.numberOptionalWithDefault(5), expected: 5 },
+      { fn: overload.arrayOptionalWithDefault([]), expected: [] },
+      { fn: overload.objectOptionalWithDefault({}), expected: {} }
+    ];
+    items.forEach(function (item) {
+      test.deepEqual(item.fn.defaultValue, item.expected);
+    });
+    test.done();
+  }
+};
diff --git a/wrt/node_modules/over/test/overloadTest.js b/wrt/node_modules/over/test/overloadTest.js
new file mode 100644 (file)
index 0000000..c099008
--- /dev/null
@@ -0,0 +1,295 @@
+'use strict';
+
+var overload = require('../');
+
+module.exports = {
+  'no parameters, valid args': function (test) {
+    var called = 0;
+    var fn = overload([
+      [function () { called++; return 42; }]
+    ]);
+    var ret = fn();
+    test.equals(called, 1);
+    test.equals(ret, 42);
+    test.done();
+  },
+
+  'no parameters, invalid args': function (test) {
+    var called = 0;
+    var fn = overload([
+      [function () { called++; }]
+    ]);
+    try {
+      fn(1);
+      test.fail('should throw exception');
+    } catch (ex) {
+
+    }
+    test.done();
+  },
+
+  'default callback': function (test) {
+    var called = 0;
+    var args = null;
+    var fn = overload([
+      [overload.func, function (fn) { test.fail('should not be called.'); }],
+      function () {
+        called++;
+        args = Array.prototype.slice.call(arguments);
+      }
+    ]);
+    fn('test');
+    test.equals(called, 1, 'overload not called');
+    test.deepEqual(args, ['test']);
+    test.done();
+  },
+
+  'one parameter, valid args': function (test) {
+    var called = 0;
+    var argFnCalled = 0;
+    var fn = overload([
+      [overload.func, function (fn) {
+        called++;
+        fn();
+      }]
+    ]);
+    fn(function () { argFnCalled++; });
+    test.equals(called, 1, 'overload not called');
+    test.equals(argFnCalled, 1, 'arg function not called');
+    test.done();
+  },
+
+  'one parameter, invalid args': function (test) {
+    var called = 0;
+    var fn = overload([
+      [overload.func, function () { called++; }]
+    ]);
+    try {
+      fn(1);
+      test.fail('should throw exception');
+    } catch (ex) {
+
+    }
+    test.done();
+  },
+
+  'optional parameter, valid args': function (test) {
+    var called = 0;
+    var argFnCalled = 0;
+    var fn = overload([
+      [overload.funcOptional, function (fn) {
+        called++;
+        fn();
+      }]
+    ]);
+    fn(function () { argFnCalled++; });
+    test.equals(called, 1, 'overload not called');
+    test.equals(argFnCalled, 1, 'arg function not called');
+    test.done();
+  },
+
+  'optional parameter, no args': function (test) {
+    var called = 0;
+    var fn = overload([
+      [overload.funcOptional, function (fn) {
+        called++;
+        if (fn) {
+          test.fail('no function should be passed');
+        }
+      }]
+    ]);
+    fn();
+    test.equals(called, 1, 'overload not called');
+    test.done();
+  },
+
+  'optional parameter, invalid args': function (test) {
+    var called = 0;
+    var fn = overload([
+      [overload.funcOptional, function () { called++; }]
+    ]);
+    try {
+      fn(1);
+      test.fail('should throw exception');
+    } catch (ex) {
+
+    }
+    test.done();
+  },
+
+  'multiple overloads, valid args': function (test) {
+    var called = 0;
+    var val = null;
+    var fn = overload([
+      [overload.number, function (n) { test.fail('this function should not be called'); }],
+      [overload.string, function (s) {
+        val = s;
+        called++;
+      }]
+    ]);
+    fn('test');
+    test.equals(called, 1, 'overload not called');
+    test.equals(val, 'test', 'overload called with wrong value');
+    test.done();
+  },
+
+  'multiple overloads, invalid args': function (test) {
+    var called = 0;
+    var fn = overload([
+      [overload.number, function (n) { test.fail('this function should not be called'); }],
+      [overload.string, function (s) { called++; }]
+    ]);
+    try {
+      fn(function () {});
+      test.fail('should throw exception');
+    } catch (ex) {
+
+    }
+    test.done();
+  },
+
+  'optional parameter, with default value': function (test) {
+    var called = 0;
+    var val = null;
+    var fn = overload([
+      [overload.numberOptionalWithDefault(5), overload.func, function (n) {
+        called++;
+        val = n;
+      }]
+    ]);
+    fn(function() {});
+    test.equals(called, 1, 'overload not called');
+    test.equals(val, 5);
+    test.done();
+  },
+
+  'number optional parameter, called with non-zero number': function (test) {
+    var called = 0;
+    var val = null;
+    var fn = overload([
+      [overload.numberOptionalWithDefault(5), overload.func, function (n) {
+        called++;
+        val = n;
+      }]
+    ]);
+    fn(3, function() {});
+    test.equals(called, 1, 'overload not called');
+    test.equals(val, 3);
+    test.done();
+  },
+
+  'number optional parameter, called with zero': function (test) {
+    var called = 0;
+    var val = null;
+    var fn = overload([
+      [overload.numberOptionalWithDefault(5), overload.func, function (n) {
+        called++;
+        val = n;
+      }]
+    ]);
+    fn(0, function() {});
+    test.equals(called, 1, 'overload not called');
+    test.equals(val, 0);
+    test.done();
+  },
+
+  'string optional parameter, called with empty string': function (test) {
+    var called = 0;
+    var val = null;
+    var fn = overload([
+      [overload.stringOptionalWithDefault("hello world"), overload.func, function (n) {
+        called++;
+        val = n;
+      }]
+    ]);
+    fn("", function() {});
+    test.equals(called, 1, 'overload not called');
+    test.equals(val, "");
+    test.done();
+  },
+
+  'callback, with default value': function (test) {
+    var called = 0;
+    var fn = overload([
+      [overload.callbackOptional, function (callback) {
+        callback();
+      }]
+    ]);
+    fn(function () { called++; });
+    test.equals(called, 1, 'overload not called');
+    test.done();
+  },
+
+  'multiple optionals': function (test) {
+    var called = 0;
+    var args;
+    var fn = overload([
+      [overload.string, overload.arrayOptionalWithDefault(null), overload.callbackOptional, function (str, arr, callback) {
+        args = arguments;
+        called++;
+      }]
+    ]);
+    fn('test');
+    test.equals(called, 1, 'overload not called');
+    test.equals(args.length, 3);
+    test.equals(args[0], 'test');
+    test.ok(args[1] === null);
+    test.equals(typeof(args[2]), 'function');
+    test.done();
+  },
+
+  'multiple optionals, skipping middle one': function (test) {
+    var called = 0;
+    var args;
+    var fn = overload([
+      [overload.string, overload.arrayOptional, overload.callbackOptional, function (str, arr, callback) {
+        args = arguments;
+        called++;
+      }]
+    ]);
+    var fnTest = function zzz() {};
+    fn('test', fnTest);
+    test.equals(called, 1, 'overload not called');
+    test.equals(args.length, 3);
+    test.equals(args[0], 'test');
+    test.ok(args[1] === undefined, 'invalid argument, expected undefined: ' + args[1]);
+    test.equals(args[2].name, 'zzz');
+    test.done();
+  },
+
+  'multiple optionals, null middle one': function (test) {
+    var called = 0;
+    var args;
+    var fn = overload([
+      [overload.string, overload.arrayOptional, overload.callbackOptional, function (str, arr, callback) {
+        args = arguments;
+        called++;
+      }]
+    ]);
+    var fnTest = function zzz() {};
+    fn('test', null, fnTest);
+    test.equals(called, 1, 'overload not called');
+    test.equals(args.length, 3);
+    test.equals(args[0], 'test');
+    test.ok(args[1] === undefined, 'invalid argument, expected undefined: ' + args[1]);
+    test.equals(args[2].name, 'zzz');
+    test.done();
+  },
+
+  'complex': function (test) {
+    var called = 0;
+    var args = null;
+    var fn = overload([
+      [overload.string, function () { test.fail('this function should not be called'); }],
+      [overload.string, overload.number, overload.funcOptional, function () {
+        args = Array.prototype.slice.call(arguments, 0);
+        called++;
+      }]
+    ]);
+    var argFn = function () {};
+    fn('test', 5, argFn);
+    test.equals(called, 1, 'overload not called');
+    test.deepEqual(args, ['test', 5, argFn], 'overload called with wrong args');
+    test.done();
+  }
+};
diff --git a/wrt/node_modules/parsejson/.npmignore b/wrt/node_modules/parsejson/.npmignore
new file mode 100644 (file)
index 0000000..5f8ef48
--- /dev/null
@@ -0,0 +1,2 @@
+.DS_Store\r
+node_modules
\ No newline at end of file
diff --git a/wrt/node_modules/parsejson/LICENSE b/wrt/node_modules/parsejson/LICENSE
new file mode 100644 (file)
index 0000000..1472010
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)\r
+\r
+Copyright (c) 2015 Gal Koren\r
+\r
+Permission is hereby granted, free of charge, to any person obtaining a copy\r
+of this software and associated documentation files (the "Software"), to deal\r
+in the Software without restriction, including without limitation the rights\r
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+copies of the Software, and to permit persons to whom the Software is\r
+furnished to do so, subject to the following conditions:\r
+\r
+The above copyright notice and this permission notice shall be included in\r
+all copies or substantial portions of the Software.\r
+\r
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
+THE SOFTWARE.\r
diff --git a/wrt/node_modules/parsejson/Makefile b/wrt/node_modules/parsejson/Makefile
new file mode 100644 (file)
index 0000000..2fbcce9
--- /dev/null
@@ -0,0 +1,3 @@
+\r
+test:\r
+       @./node_modules/.bin/mocha test.js\r
diff --git a/wrt/node_modules/parsejson/README.md b/wrt/node_modules/parsejson/README.md
new file mode 100644 (file)
index 0000000..bb1fc9f
--- /dev/null
@@ -0,0 +1,2 @@
+# parsejson\r
+engine.io-client JSON-parsing module\r
diff --git a/wrt/node_modules/parsejson/index.js b/wrt/node_modules/parsejson/index.js
new file mode 100644 (file)
index 0000000..423c93d
--- /dev/null
@@ -0,0 +1,32 @@
+/**\r
+ * JSON parse.\r
+ *\r
+ * @see Based on jQuery#parseJSON (MIT) and JSON2\r
+ * @api private\r
+ */\r
+\r
+var rvalidchars = /^[\],:{}\s]*$/;\r
+var rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g;\r
+var rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g;\r
+var rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g;\r
+var rtrimLeft = /^\s+/;\r
+var rtrimRight = /\s+$/;\r
+\r
+module.exports = function parsejson(data) {\r
+  if ('string' != typeof data || !data) {\r
+    return null;\r
+  }\r
+\r
+  data = data.replace(rtrimLeft, '').replace(rtrimRight, '');\r
+\r
+  // Attempt to parse using the native JSON parser first\r
+  if (global.JSON && JSON.parse) {\r
+    return JSON.parse(data);\r
+  }\r
+\r
+  if (rvalidchars.test(data.replace(rvalidescape, '@')\r
+      .replace(rvalidtokens, ']')\r
+      .replace(rvalidbraces, ''))) {\r
+    return (new Function('return ' + data))();\r
+  }\r
+};
\ No newline at end of file
diff --git a/wrt/node_modules/parsejson/package.json b/wrt/node_modules/parsejson/package.json
new file mode 100644 (file)
index 0000000..eb8a3c1
--- /dev/null
@@ -0,0 +1,87 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "parsejson@0.0.3",
+        "scope": null,
+        "escapedName": "parsejson",
+        "name": "parsejson",
+        "rawSpec": "0.0.3",
+        "spec": "0.0.3",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io-client"
+    ]
+  ],
+  "_from": "parsejson@0.0.3",
+  "_id": "parsejson@0.0.3",
+  "_inCache": true,
+  "_location": "/parsejson",
+  "_nodeVersion": "6.9.1",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/parsejson-0.0.3.tgz_1477582490190_0.9499260517768562"
+  },
+  "_npmUser": {
+    "name": "gal",
+    "email": "koren@mit.edu"
+  },
+  "_npmVersion": "3.10.8",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "parsejson@0.0.3",
+    "scope": null,
+    "escapedName": "parsejson",
+    "name": "parsejson",
+    "rawSpec": "0.0.3",
+    "spec": "0.0.3",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/engine.io-client"
+  ],
+  "_resolved": "https://registry.npmjs.org/parsejson/-/parsejson-0.0.3.tgz",
+  "_shasum": "ab7e3759f209ece99437973f7d0f1f64ae0e64ab",
+  "_shrinkwrap": null,
+  "_spec": "parsejson@0.0.3",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io-client",
+  "author": {
+    "name": "Gal Koren"
+  },
+  "bugs": {
+    "url": "https://github.com/get/parsejson/issues"
+  },
+  "dependencies": {
+    "better-assert": "~1.0.0"
+  },
+  "description": "Method that parses a JSON string and returns a JSON object",
+  "devDependencies": {
+    "better-assert": "~1.0.0",
+    "mocha": "1.17.1"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "ab7e3759f209ece99437973f7d0f1f64ae0e64ab",
+    "tarball": "https://registry.npmjs.org/parsejson/-/parsejson-0.0.3.tgz"
+  },
+  "gitHead": "7c26d14d9a076e50f582f4d3e7472cfe36b6d930",
+  "homepage": "https://github.com/get/parsejson",
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "gal",
+      "email": "koren@mit.edu"
+    }
+  ],
+  "name": "parsejson",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/get/parsejson.git"
+  },
+  "scripts": {
+    "test": "make test"
+  },
+  "version": "0.0.3"
+}
diff --git a/wrt/node_modules/parsejson/test.js b/wrt/node_modules/parsejson/test.js
new file mode 100644 (file)
index 0000000..fbee2d0
--- /dev/null
@@ -0,0 +1,21 @@
+var assert = require('better-assert');\r
+var expect = require('expect.js');\r
+var parsejson = require('./index.js');\r
+\r
+describe('my suite', function(){\r
+       it('should parse a JSON string', function () {\r
+               \r
+               var jsonString =  '{"users" :[{"first_name":"foo", "last_name":"bar"}],' +\r
+                                                  '"id"    :40,' + \r
+                                                  '"cities":["los angeles", "new york", "boston"]}';\r
+               \r
+               var jsonObj = parsejson(jsonString);\r
+               expect(jsonObj.users[0].first_name).to.be("foo");\r
+               expect(jsonObj.users[0].last_name).to.be("bar");\r
+               expect(jsonObj.id).to.be(40);\r
+               expect(jsonObj.cities[0]).to.be('los angeles');\r
+               expect(jsonObj.cities[1]).to.be('new york');\r
+               expect(jsonObj.cities[2]).to.be('boston');\r
+                               \r
+  });\r
+});\r
diff --git a/wrt/node_modules/parseqs/.npmignore b/wrt/node_modules/parseqs/.npmignore
new file mode 100644 (file)
index 0000000..38920e1
--- /dev/null
@@ -0,0 +1,3 @@
+.DS_Store\r
+node_modules\r
+npm-debug.log
\ No newline at end of file
diff --git a/wrt/node_modules/parseqs/LICENSE b/wrt/node_modules/parseqs/LICENSE
new file mode 100644 (file)
index 0000000..1472010
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)\r
+\r
+Copyright (c) 2015 Gal Koren\r
+\r
+Permission is hereby granted, free of charge, to any person obtaining a copy\r
+of this software and associated documentation files (the "Software"), to deal\r
+in the Software without restriction, including without limitation the rights\r
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+copies of the Software, and to permit persons to whom the Software is\r
+furnished to do so, subject to the following conditions:\r
+\r
+The above copyright notice and this permission notice shall be included in\r
+all copies or substantial portions of the Software.\r
+\r
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
+THE SOFTWARE.\r
diff --git a/wrt/node_modules/parseqs/Makefile b/wrt/node_modules/parseqs/Makefile
new file mode 100644 (file)
index 0000000..2fbcce9
--- /dev/null
@@ -0,0 +1,3 @@
+\r
+test:\r
+       @./node_modules/.bin/mocha test.js\r
diff --git a/wrt/node_modules/parseqs/README.md b/wrt/node_modules/parseqs/README.md
new file mode 100644 (file)
index 0000000..8c3148a
--- /dev/null
@@ -0,0 +1 @@
+Provides methods for converting an object into string representation, and vice versa.\r
diff --git a/wrt/node_modules/parseqs/index.js b/wrt/node_modules/parseqs/index.js
new file mode 100644 (file)
index 0000000..f8b486f
--- /dev/null
@@ -0,0 +1,37 @@
+/**\r
+ * Compiles a querystring\r
+ * Returns string representation of the object\r
+ *\r
+ * @param {Object}\r
+ * @api private\r
+ */\r
+\r
+exports.encode = function (obj) {\r
+  var str = '';\r
+\r
+  for (var i in obj) {\r
+    if (obj.hasOwnProperty(i)) {\r
+      if (str.length) str += '&';\r
+      str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]);\r
+    }\r
+  }\r
+\r
+  return str;\r
+};\r
+\r
+/**\r
+ * Parses a simple querystring into an object\r
+ *\r
+ * @param {String} qs\r
+ * @api private\r
+ */\r
+\r
+exports.decode = function(qs){\r
+  var qry = {};\r
+  var pairs = qs.split('&');\r
+  for (var i = 0, l = pairs.length; i < l; i++) {\r
+    var pair = pairs[i].split('=');\r
+    qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);\r
+  }\r
+  return qry;\r
+};\r
diff --git a/wrt/node_modules/parseqs/package.json b/wrt/node_modules/parseqs/package.json
new file mode 100644 (file)
index 0000000..36491c8
--- /dev/null
@@ -0,0 +1,88 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "parseqs@0.0.5",
+        "scope": null,
+        "escapedName": "parseqs",
+        "name": "parseqs",
+        "rawSpec": "0.0.5",
+        "spec": "0.0.5",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io-client"
+    ]
+  ],
+  "_from": "parseqs@0.0.5",
+  "_id": "parseqs@0.0.5",
+  "_inCache": true,
+  "_location": "/parseqs",
+  "_nodeVersion": "6.9.1",
+  "_npmOperationalInternal": {
+    "host": "packages-18-east.internal.npmjs.com",
+    "tmp": "tmp/parseqs-0.0.5.tgz_1477582844598_0.35737923183478415"
+  },
+  "_npmUser": {
+    "name": "gal",
+    "email": "koren@mit.edu"
+  },
+  "_npmVersion": "3.10.8",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "parseqs@0.0.5",
+    "scope": null,
+    "escapedName": "parseqs",
+    "name": "parseqs",
+    "rawSpec": "0.0.5",
+    "spec": "0.0.5",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/engine.io-client",
+    "/socket.io-client"
+  ],
+  "_resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz",
+  "_shasum": "d5208a3738e46766e291ba2ea173684921a8b89d",
+  "_shrinkwrap": null,
+  "_spec": "parseqs@0.0.5",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io-client",
+  "author": {
+    "name": "Gal Koren"
+  },
+  "bugs": {
+    "url": "https://github.com/get/querystring/issues"
+  },
+  "dependencies": {
+    "better-assert": "~1.0.0"
+  },
+  "description": "Provides methods for parsing a query string into an object, and vice versa.",
+  "devDependencies": {
+    "better-assert": "~1.0.0",
+    "mocha": "1.17.1"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "d5208a3738e46766e291ba2ea173684921a8b89d",
+    "tarball": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz"
+  },
+  "gitHead": "4d037fc0625fb72eec9394724e18f29e0a946af5",
+  "homepage": "https://github.com/get/querystring",
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "gal",
+      "email": "koren@mit.edu"
+    }
+  ],
+  "name": "parseqs",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/get/querystring.git"
+  },
+  "scripts": {
+    "test": "make test"
+  },
+  "version": "0.0.5"
+}
diff --git a/wrt/node_modules/parseqs/test.js b/wrt/node_modules/parseqs/test.js
new file mode 100644 (file)
index 0000000..362ae65
--- /dev/null
@@ -0,0 +1,27 @@
+var assert = require('better-assert');\r
+var expect = require('expect.js');\r
+var util = require('./index.js');\r
+\r
+describe('querystring test suite', function(){\r
+       it('should parse a querystring and return an object', function () {\r
+               \r
+               // Single assignment\r
+               var queryObj = util.decode("foo=bar");\r
+               expect(queryObj.foo).to.be("bar");\r
+               \r
+               // Multiple assignments\r
+               queryObj = util.decode("france=paris&germany=berlin");\r
+               expect(queryObj.france).to.be("paris");\r
+               expect(queryObj.germany).to.be("berlin");\r
+               \r
+               // Assignments containing non-alphanumeric characters\r
+               queryObj = util.decode("india=new%20delhi");\r
+               expect(queryObj.india).to.be("new delhi");\r
+       });\r
+       \r
+       it('should construct a query string from an object', function () {\r
+               expect(util.encode({ a: 'b' })).to.be('a=b');\r
+               expect(util.encode({ a: 'b', c: 'd' })).to.be('a=b&c=d');\r
+               expect(util.encode({ a: 'b', c: 'tobi rocks' })).to.be('a=b&c=tobi%20rocks');\r
+       });\r
+});\r
diff --git a/wrt/node_modules/parseuri/.npmignore b/wrt/node_modules/parseuri/.npmignore
new file mode 100644 (file)
index 0000000..2bae02e
--- /dev/null
@@ -0,0 +1,2 @@
+.DS_Store\r
+.node_modules/*
\ No newline at end of file
diff --git a/wrt/node_modules/parseuri/History.md b/wrt/node_modules/parseuri/History.md
new file mode 100644 (file)
index 0000000..c198d2c
--- /dev/null
@@ -0,0 +1,5 @@
+\r
+n.n.n / 2014-02-09\r
+==================\r
+\r
+ * parseuri first commit\r
diff --git a/wrt/node_modules/parseuri/LICENSE b/wrt/node_modules/parseuri/LICENSE
new file mode 100644 (file)
index 0000000..25556e8
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)\r
+\r
+Copyright (c) 2014 Gal Koren\r
+\r
+Permission is hereby granted, free of charge, to any person obtaining a copy\r
+of this software and associated documentation files (the "Software"), to deal\r
+in the Software without restriction, including without limitation the rights\r
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+copies of the Software, and to permit persons to whom the Software is\r
+furnished to do so, subject to the following conditions:\r
+\r
+The above copyright notice and this permission notice shall be included in\r
+all copies or substantial portions of the Software.\r
+\r
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
+THE SOFTWARE.\r
diff --git a/wrt/node_modules/parseuri/Makefile b/wrt/node_modules/parseuri/Makefile
new file mode 100644 (file)
index 0000000..2fbcce9
--- /dev/null
@@ -0,0 +1,3 @@
+\r
+test:\r
+       @./node_modules/.bin/mocha test.js\r
diff --git a/wrt/node_modules/parseuri/README.md b/wrt/node_modules/parseuri/README.md
new file mode 100644 (file)
index 0000000..f108180
--- /dev/null
@@ -0,0 +1,2 @@
+# parseuri\r
+Module for parsing URI's in engine.io-client\r
diff --git a/wrt/node_modules/parseuri/index.js b/wrt/node_modules/parseuri/index.js
new file mode 100644 (file)
index 0000000..88639d5
--- /dev/null
@@ -0,0 +1,39 @@
+/**\r
+ * Parses an URI\r
+ *\r
+ * @author Steven Levithan <stevenlevithan.com> (MIT license)\r
+ * @api private\r
+ */\r
+\r
+var re = /^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/;\r
+\r
+var parts = [\r
+    'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'\r
+];\r
+\r
+module.exports = function parseuri(str) {\r
+    var src = str,\r
+        b = str.indexOf('['),\r
+        e = str.indexOf(']');\r
+\r
+    if (b != -1 && e != -1) {\r
+        str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length);\r
+    }\r
+\r
+    var m = re.exec(str || ''),\r
+        uri = {},\r
+        i = 14;\r
+\r
+    while (i--) {\r
+        uri[parts[i]] = m[i] || '';\r
+    }\r
+\r
+    if (b != -1 && e != -1) {\r
+        uri.source = src;\r
+        uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':');\r
+        uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':');\r
+        uri.ipv6uri = true;\r
+    }\r
+\r
+    return uri;\r
+};\r
diff --git a/wrt/node_modules/parseuri/package.json b/wrt/node_modules/parseuri/package.json
new file mode 100644 (file)
index 0000000..19ae848
--- /dev/null
@@ -0,0 +1,86 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "parseuri@0.0.5",
+        "scope": null,
+        "escapedName": "parseuri",
+        "name": "parseuri",
+        "rawSpec": "0.0.5",
+        "spec": "0.0.5",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io-client"
+    ]
+  ],
+  "_from": "parseuri@0.0.5",
+  "_id": "parseuri@0.0.5",
+  "_inCache": true,
+  "_location": "/parseuri",
+  "_nodeVersion": "6.9.1",
+  "_npmOperationalInternal": {
+    "host": "packages-18-east.internal.npmjs.com",
+    "tmp": "tmp/parseuri-0.0.5.tgz_1477582137634_0.3768787120934576"
+  },
+  "_npmUser": {
+    "name": "gal",
+    "email": "koren@mit.edu"
+  },
+  "_npmVersion": "3.10.8",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "parseuri@0.0.5",
+    "scope": null,
+    "escapedName": "parseuri",
+    "name": "parseuri",
+    "rawSpec": "0.0.5",
+    "spec": "0.0.5",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/engine.io-client",
+    "/socket.io-client"
+  ],
+  "_resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz",
+  "_shasum": "80204a50d4dbb779bfdc6ebe2778d90e4bce320a",
+  "_shrinkwrap": null,
+  "_spec": "parseuri@0.0.5",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io-client",
+  "author": "",
+  "bugs": {
+    "url": "https://github.com/get/parseuri/issues"
+  },
+  "dependencies": {
+    "better-assert": "~1.0.0"
+  },
+  "description": "Method that parses a URI and returns an array of its components",
+  "devDependencies": {
+    "better-assert": "1.0.0",
+    "mocha": "1.17.1"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "80204a50d4dbb779bfdc6ebe2778d90e4bce320a",
+    "tarball": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz"
+  },
+  "gitHead": "792c9a63162a4484eb6b4f95fc611ccf224a24b6",
+  "homepage": "https://github.com/get/parseuri",
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "gal",
+      "email": "koren@mit.edu"
+    }
+  ],
+  "name": "parseuri",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/get/parseuri.git"
+  },
+  "scripts": {
+    "test": "make test"
+  },
+  "version": "0.0.5"
+}
diff --git a/wrt/node_modules/parseuri/test.js b/wrt/node_modules/parseuri/test.js
new file mode 100644 (file)
index 0000000..01f5d8c
--- /dev/null
@@ -0,0 +1,51 @@
+var assert = require('better-assert');\r
+var expect = require('expect.js');\r
+var parseuri = require('./index.js');\r
+\r
+describe('my suite', function(){\r
+       it('should parse an uri', function () {\r
+    var http = parseuri('http://google.com')\r
+      , https = parseuri('https://www.google.com:80')\r
+      , query = parseuri('google.com:8080/foo/bar?foo=bar')\r
+      , localhost = parseuri('localhost:8080')\r
+      , ipv6 = parseuri('2001:0db8:85a3:0042:1000:8a2e:0370:7334')\r
+      , ipv6short = parseuri('2001:db8:85a3:42:1000:8a2e:370:7334')\r
+      , ipv6port = parseuri('2001:db8:85a3:42:1000:8a2e:370:7334:80')\r
+      , ipv6abbrev = parseuri('2001::7334:a:80')\r
+      , ipv6http = parseuri('http://[2001::7334:a]:80')\r
+      , ipv6query = parseuri('http://[2001::7334:a]:80/foo/bar?foo=bar')\r
+\r
+    expect(http.protocol).to.be('http');\r
+    expect(http.port).to.be('');\r
+    expect(http.host).to.be('google.com');\r
+    expect(https.protocol).to.be('https');\r
+    expect(https.port).to.be('80');\r
+    expect(https.host).to.be('www.google.com');\r
+    expect(query.port).to.be('8080');\r
+    expect(query.query).to.be('foo=bar');\r
+    expect(query.path).to.be('/foo/bar');\r
+    expect(query.relative).to.be('/foo/bar?foo=bar');\r
+    expect(localhost.protocol).to.be('');\r
+    expect(localhost.host).to.be('localhost');\r
+    expect(localhost.port).to.be('8080');\r
+    expect(ipv6.protocol).to.be('');\r
+    expect(ipv6.host).to.be('2001:0db8:85a3:0042:1000:8a2e:0370:7334');\r
+    expect(ipv6.port).to.be('');\r
+    expect(ipv6short.protocol).to.be('');\r
+    expect(ipv6short.host).to.be('2001:db8:85a3:42:1000:8a2e:370:7334');\r
+    expect(ipv6short.port).to.be('');\r
+    expect(ipv6port.protocol).to.be('');\r
+    expect(ipv6port.host).to.be('2001:db8:85a3:42:1000:8a2e:370:7334');\r
+    expect(ipv6port.port).to.be('80');\r
+    expect(ipv6abbrev.protocol).to.be('');\r
+    expect(ipv6abbrev.host).to.be('2001::7334:a:80');\r
+    expect(ipv6abbrev.port).to.be('');\r
+    expect(ipv6http.protocol).to.be('http');\r
+    expect(ipv6http.port).to.be('80');\r
+    expect(ipv6http.host).to.be('2001::7334:a');\r
+    expect(ipv6query.protocol).to.be('http');\r
+    expect(ipv6query.port).to.be('80');\r
+    expect(ipv6query.host).to.be('2001::7334:a');\r
+    expect(ipv6query.relative).to.be('/foo/bar?foo=bar');\r
+  });\r
+});\r
diff --git a/wrt/node_modules/parseurl/HISTORY.md b/wrt/node_modules/parseurl/HISTORY.md
new file mode 100644 (file)
index 0000000..4803393
--- /dev/null
@@ -0,0 +1,53 @@
+1.3.2 / 2017-09-09
+==================
+
+  * perf: reduce overhead for full URLs
+  * perf: unroll the "fast-path" `RegExp`
+
+1.3.1 / 2016-01-17
+==================
+
+  * perf: enable strict mode
+
+1.3.0 / 2014-08-09
+==================
+
+  * Add `parseurl.original` for parsing `req.originalUrl` with fallback
+  * Return `undefined` if `req.url` is `undefined`
+
+1.2.0 / 2014-07-21
+==================
+
+  * Cache URLs based on original value
+  * Remove no-longer-needed URL mis-parse work-around
+  * Simplify the "fast-path" `RegExp`
+
+1.1.3 / 2014-07-08
+==================
+
+  * Fix typo
+
+1.1.2 / 2014-07-08
+==================
+
+  * Seriously fix Node.js 0.8 compatibility
+
+1.1.1 / 2014-07-08
+==================
+
+  * Fix Node.js 0.8 compatibility
+
+1.1.0 / 2014-07-08
+==================
+
+  * Incorporate URL href-only parse fast-path
+
+1.0.1 / 2014-03-08
+==================
+
+  * Add missing `require`
+
+1.0.0 / 2014-03-08
+==================
+
+  * Genesis from `connect`
diff --git a/wrt/node_modules/parseurl/LICENSE b/wrt/node_modules/parseurl/LICENSE
new file mode 100644 (file)
index 0000000..27653d3
--- /dev/null
@@ -0,0 +1,24 @@
+
+(The MIT License)
+
+Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
+Copyright (c) 2014-2017 Douglas Christopher Wilson <doug@somethingdoug.com>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/parseurl/README.md b/wrt/node_modules/parseurl/README.md
new file mode 100644 (file)
index 0000000..a5ccc51
--- /dev/null
@@ -0,0 +1,124 @@
+# parseurl
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+Parse a URL with memoization.
+
+## Install
+
+This is a [Node.js](https://nodejs.org/en/) module available through the
+[npm registry](https://www.npmjs.com/). Installation is done using the
+[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
+
+```sh
+$ npm install parseurl
+```
+
+## API
+
+```js
+var parseurl = require('parseurl')
+```
+
+### parseurl(req)
+
+Parse the URL of the given request object (looks at the `req.url` property)
+and return the result. The result is the same as `url.parse` in Node.js core.
+Calling this function multiple times on the same `req` where `req.url` does
+not change will return a cached parsed object, rather than parsing again.
+
+### parseurl.original(req)
+
+Parse the original URL of the given request object and return the result.
+This works by trying to parse `req.originalUrl` if it is a string, otherwise
+parses `req.url`. The result is the same as `url.parse` in Node.js core.
+Calling this function multiple times on the same `req` where `req.originalUrl`
+does not change will return a cached parsed object, rather than parsing again.
+
+## Benchmark
+
+```bash
+$ npm run-script bench
+
+> parseurl@1.3.2 bench nodejs-parseurl
+> node benchmark/index.js
+
+  http_parser@2.7.0
+  node@4.8.4
+  v8@4.5.103.47
+  uv@1.9.1
+  zlib@1.2.11
+  ares@1.10.1-DEV
+  icu@56.1
+  modules@46
+  openssl@1.0.2k
+
+> node benchmark/fullurl.js
+
+  Parsing URL "http://localhost:8888/foo/bar?user=tj&pet=fluffy"
+
+  3 tests completed.
+
+  fasturl   x 1,246,766 ops/sec ±0.74% (188 runs sampled)
+  nativeurl x    91,536 ops/sec ±0.54% (189 runs sampled)
+  parseurl  x    90,645 ops/sec ±0.38% (189 runs sampled)
+
+> node benchmark/pathquery.js
+
+  Parsing URL "/foo/bar?user=tj&pet=fluffy"
+
+  3 tests completed.
+
+  fasturl   x 2,077,650 ops/sec ±0.69% (186 runs sampled)
+  nativeurl x   638,669 ops/sec ±0.67% (189 runs sampled)
+  parseurl  x 2,431,842 ops/sec ±0.71% (189 runs sampled)
+
+> node benchmark/samerequest.js
+
+  Parsing URL "/foo/bar?user=tj&pet=fluffy" on same request object
+
+  3 tests completed.
+
+  fasturl   x  2,135,391 ops/sec ±0.69% (188 runs sampled)
+  nativeurl x    672,809 ops/sec ±3.83% (186 runs sampled)
+  parseurl  x 11,604,947 ops/sec ±0.70% (189 runs sampled)
+
+> node benchmark/simplepath.js
+
+  Parsing URL "/foo/bar"
+
+  3 tests completed.
+
+  fasturl   x 4,961,391 ops/sec ±0.97% (186 runs sampled)
+  nativeurl x   914,931 ops/sec ±0.83% (186 runs sampled)
+  parseurl  x 7,559,196 ops/sec ±0.66% (188 runs sampled)
+
+> node benchmark/slash.js
+
+  Parsing URL "/"
+
+  3 tests completed.
+
+  fasturl   x  4,053,379 ops/sec ±0.91% (187 runs sampled)
+  nativeurl x    963,999 ops/sec ±0.58% (189 runs sampled)
+  parseurl  x 11,516,143 ops/sec ±0.58% (188 runs sampled)
+```
+
+## License
+
+  [MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/parseurl.svg
+[npm-url]: https://npmjs.org/package/parseurl
+[node-version-image]: https://img.shields.io/node/v/parseurl.svg
+[node-version-url]: https://nodejs.org/en/download/
+[travis-image]: https://img.shields.io/travis/pillarjs/parseurl/master.svg
+[travis-url]: https://travis-ci.org/pillarjs/parseurl
+[coveralls-image]: https://img.shields.io/coveralls/pillarjs/parseurl/master.svg
+[coveralls-url]: https://coveralls.io/r/pillarjs/parseurl?branch=master
+[downloads-image]: https://img.shields.io/npm/dm/parseurl.svg
+[downloads-url]: https://npmjs.org/package/parseurl
diff --git a/wrt/node_modules/parseurl/index.js b/wrt/node_modules/parseurl/index.js
new file mode 100644 (file)
index 0000000..603eabe
--- /dev/null
@@ -0,0 +1,154 @@
+/*!
+ * parseurl
+ * Copyright(c) 2014 Jonathan Ong
+ * Copyright(c) 2014-2017 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var url = require('url')
+var parse = url.parse
+var Url = url.Url
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = parseurl
+module.exports.original = originalurl
+
+/**
+ * Parse the `req` url with memoization.
+ *
+ * @param {ServerRequest} req
+ * @return {Object}
+ * @public
+ */
+
+function parseurl (req) {
+  var url = req.url
+
+  if (url === undefined) {
+    // URL is undefined
+    return undefined
+  }
+
+  var parsed = req._parsedUrl
+
+  if (fresh(url, parsed)) {
+    // Return cached URL parse
+    return parsed
+  }
+
+  // Parse the URL
+  parsed = fastparse(url)
+  parsed._raw = url
+
+  return (req._parsedUrl = parsed)
+};
+
+/**
+ * Parse the `req` original url with fallback and memoization.
+ *
+ * @param {ServerRequest} req
+ * @return {Object}
+ * @public
+ */
+
+function originalurl (req) {
+  var url = req.originalUrl
+
+  if (typeof url !== 'string') {
+    // Fallback
+    return parseurl(req)
+  }
+
+  var parsed = req._parsedOriginalUrl
+
+  if (fresh(url, parsed)) {
+    // Return cached URL parse
+    return parsed
+  }
+
+  // Parse the URL
+  parsed = fastparse(url)
+  parsed._raw = url
+
+  return (req._parsedOriginalUrl = parsed)
+};
+
+/**
+ * Parse the `str` url with fast-path short-cut.
+ *
+ * @param {string} str
+ * @return {Object}
+ * @private
+ */
+
+function fastparse (str) {
+  if (typeof str !== 'string' || str.charCodeAt(0) !== 0x2f /* / */) {
+    return parse(str)
+  }
+
+  var pathname = str
+  var query = null
+  var search = null
+
+  // This takes the regexp from https://github.com/joyent/node/pull/7878
+  // Which is /^(\/[^?#\s]*)(\?[^#\s]*)?$/
+  // And unrolls it into a for loop
+  for (var i = 1; i < str.length; i++) {
+    switch (str.charCodeAt(i)) {
+      case 0x3f: /* ?  */
+        if (search === null) {
+          pathname = str.substring(0, i)
+          query = str.substring(i + 1)
+          search = str.substring(i)
+        }
+        break
+      case 0x09: /* \t */
+      case 0x0a: /* \n */
+      case 0x0c: /* \f */
+      case 0x0d: /* \r */
+      case 0x20: /*    */
+      case 0x23: /* #  */
+      case 0xa0:
+      case 0xfeff:
+        return parse(str)
+    }
+  }
+
+  var url = Url !== undefined
+    ? new Url()
+    : {}
+  url.path = str
+  url.href = str
+  url.pathname = pathname
+  url.query = query
+  url.search = search
+
+  return url
+}
+
+/**
+ * Determine if parsed is still fresh for url.
+ *
+ * @param {string} url
+ * @param {object} parsedUrl
+ * @return {boolean}
+ * @private
+ */
+
+function fresh (url, parsedUrl) {
+  return typeof parsedUrl === 'object' &&
+    parsedUrl !== null &&
+    (Url === undefined || parsedUrl instanceof Url) &&
+    parsedUrl._raw === url
+}
diff --git a/wrt/node_modules/parseurl/package.json b/wrt/node_modules/parseurl/package.json
new file mode 100644 (file)
index 0000000..d1e4559
--- /dev/null
@@ -0,0 +1,117 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "parseurl@~1.3.1",
+        "scope": null,
+        "escapedName": "parseurl",
+        "name": "parseurl",
+        "rawSpec": "~1.3.1",
+        "spec": ">=1.3.1 <1.4.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express"
+    ]
+  ],
+  "_from": "parseurl@>=1.3.1 <1.4.0",
+  "_id": "parseurl@1.3.2",
+  "_inCache": true,
+  "_location": "/parseurl",
+  "_nodeVersion": "6.11.1",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/parseurl-1.3.2.tgz_1504992079883_0.05658079497516155"
+  },
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "3.10.10",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "parseurl@~1.3.1",
+    "scope": null,
+    "escapedName": "parseurl",
+    "name": "parseurl",
+    "rawSpec": "~1.3.1",
+    "spec": ">=1.3.1 <1.4.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/express",
+    "/finalhandler",
+    "/serve-static"
+  ],
+  "_resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz",
+  "_shasum": "fc289d4ed8993119460c156253262cdc8de65bf3",
+  "_shrinkwrap": null,
+  "_spec": "parseurl@~1.3.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express",
+  "bugs": {
+    "url": "https://github.com/pillarjs/parseurl/issues"
+  },
+  "contributors": [
+    {
+      "name": "Douglas Christopher Wilson",
+      "email": "doug@somethingdoug.com"
+    },
+    {
+      "name": "Jonathan Ong",
+      "email": "me@jongleberry.com",
+      "url": "http://jongleberry.com"
+    }
+  ],
+  "dependencies": {},
+  "description": "parse a url with memoization",
+  "devDependencies": {
+    "beautify-benchmark": "0.2.4",
+    "benchmark": "2.1.4",
+    "eslint": "3.19.0",
+    "eslint-config-standard": "10.2.1",
+    "eslint-plugin-import": "2.7.0",
+    "eslint-plugin-node": "5.1.1",
+    "eslint-plugin-promise": "3.5.0",
+    "eslint-plugin-standard": "3.0.1",
+    "fast-url-parser": "1.1.3",
+    "istanbul": "0.4.5",
+    "mocha": "2.5.3"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "fc289d4ed8993119460c156253262cdc8de65bf3",
+    "tarball": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz"
+  },
+  "engines": {
+    "node": ">= 0.8"
+  },
+  "files": [
+    "LICENSE",
+    "HISTORY.md",
+    "README.md",
+    "index.js"
+  ],
+  "gitHead": "0022a009d0973a44ae3849e83112ea4d12ad5b49",
+  "homepage": "https://github.com/pillarjs/parseurl#readme",
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "name": "parseurl",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/pillarjs/parseurl.git"
+  },
+  "scripts": {
+    "bench": "node benchmark/index.js",
+    "lint": "eslint .",
+    "test": "mocha --check-leaks --bail --reporter spec test/",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot test/",
+    "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec test/"
+  },
+  "version": "1.3.2"
+}
diff --git a/wrt/node_modules/path-is-absolute/index.js b/wrt/node_modules/path-is-absolute/index.js
new file mode 100644 (file)
index 0000000..22aa6c3
--- /dev/null
@@ -0,0 +1,20 @@
+'use strict';
+
+function posix(path) {
+       return path.charAt(0) === '/';
+}
+
+function win32(path) {
+       // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56
+       var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
+       var result = splitDeviceRe.exec(path);
+       var device = result[1] || '';
+       var isUnc = Boolean(device && device.charAt(1) !== ':');
+
+       // UNC paths are always absolute
+       return Boolean(result[2] || isUnc);
+}
+
+module.exports = process.platform === 'win32' ? win32 : posix;
+module.exports.posix = posix;
+module.exports.win32 = win32;
diff --git a/wrt/node_modules/path-is-absolute/license b/wrt/node_modules/path-is-absolute/license
new file mode 100644 (file)
index 0000000..654d0bf
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/path-is-absolute/package.json b/wrt/node_modules/path-is-absolute/package.json
new file mode 100644 (file)
index 0000000..2843c5c
--- /dev/null
@@ -0,0 +1,79 @@
+{
+  "_from": "path-is-absolute@^1.0.0",
+  "_id": "path-is-absolute@1.0.1",
+  "_inBundle": false,
+  "_integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
+  "_location": "/path-is-absolute",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "path-is-absolute@^1.0.0",
+    "name": "path-is-absolute",
+    "escapedName": "path-is-absolute",
+    "rawSpec": "^1.0.0",
+    "saveSpec": null,
+    "fetchSpec": "^1.0.0"
+  },
+  "_requiredBy": [
+    "/asar/glob",
+    "/coffeelint/glob",
+    "/glob",
+    "/node-gyp/glob",
+    "/rimraf/glob"
+  ],
+  "_resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
+  "_shasum": "174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f",
+  "_spec": "path-is-absolute@^1.0.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was/node_modules/glob",
+  "author": {
+    "name": "Sindre Sorhus",
+    "email": "sindresorhus@gmail.com",
+    "url": "sindresorhus.com"
+  },
+  "bugs": {
+    "url": "https://github.com/sindresorhus/path-is-absolute/issues"
+  },
+  "bundleDependencies": false,
+  "deprecated": false,
+  "description": "Node.js 0.12 path.isAbsolute() ponyfill",
+  "devDependencies": {
+    "xo": "^0.16.0"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/sindresorhus/path-is-absolute#readme",
+  "keywords": [
+    "path",
+    "paths",
+    "file",
+    "dir",
+    "absolute",
+    "isabsolute",
+    "is-absolute",
+    "built-in",
+    "util",
+    "utils",
+    "core",
+    "ponyfill",
+    "polyfill",
+    "shim",
+    "is",
+    "detect",
+    "check"
+  ],
+  "license": "MIT",
+  "name": "path-is-absolute",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/sindresorhus/path-is-absolute.git"
+  },
+  "scripts": {
+    "test": "xo && node test.js"
+  },
+  "version": "1.0.1"
+}
diff --git a/wrt/node_modules/path-is-absolute/readme.md b/wrt/node_modules/path-is-absolute/readme.md
new file mode 100644 (file)
index 0000000..8dbdf5f
--- /dev/null
@@ -0,0 +1,59 @@
+# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute)
+
+> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) [ponyfill](https://ponyfill.com)
+
+
+## Install
+
+```
+$ npm install --save path-is-absolute
+```
+
+
+## Usage
+
+```js
+const pathIsAbsolute = require('path-is-absolute');
+
+// Running on Linux
+pathIsAbsolute('/home/foo');
+//=> true
+pathIsAbsolute('C:/Users/foo');
+//=> false
+
+// Running on Windows
+pathIsAbsolute('C:/Users/foo');
+//=> true
+pathIsAbsolute('/home/foo');
+//=> false
+
+// Running on any OS
+pathIsAbsolute.posix('/home/foo');
+//=> true
+pathIsAbsolute.posix('C:/Users/foo');
+//=> false
+pathIsAbsolute.win32('C:/Users/foo');
+//=> true
+pathIsAbsolute.win32('/home/foo');
+//=> false
+```
+
+
+## API
+
+See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path).
+
+### pathIsAbsolute(path)
+
+### pathIsAbsolute.posix(path)
+
+POSIX specific version.
+
+### pathIsAbsolute.win32(path)
+
+Windows specific version.
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/wrt/node_modules/path-to-regexp/History.md b/wrt/node_modules/path-to-regexp/History.md
new file mode 100644 (file)
index 0000000..7f65878
--- /dev/null
@@ -0,0 +1,36 @@
+0.1.7 / 2015-07-28
+==================
+
+  * Fixed regression with escaped round brackets and matching groups.
+
+0.1.6 / 2015-06-19
+==================
+
+  * Replace `index` feature by outputting all parameters, unnamed and named.
+
+0.1.5 / 2015-05-08
+==================
+
+  * Add an index property for position in match result.
+
+0.1.4 / 2015-03-05
+==================
+
+  * Add license information
+
+0.1.3 / 2014-07-06
+==================
+
+  * Better array support
+  * Improved support for trailing slash in non-ending mode
+
+0.1.0 / 2014-03-06
+==================
+
+  * add options.end
+
+0.0.2 / 2013-02-10
+==================
+
+  * Update to match current express
+  * add .license property to component.json
diff --git a/wrt/node_modules/path-to-regexp/LICENSE b/wrt/node_modules/path-to-regexp/LICENSE
new file mode 100644 (file)
index 0000000..983fbe8
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/path-to-regexp/Readme.md b/wrt/node_modules/path-to-regexp/Readme.md
new file mode 100644 (file)
index 0000000..95452a6
--- /dev/null
@@ -0,0 +1,35 @@
+# Path-to-RegExp
+
+Turn an Express-style path string such as `/user/:name` into a regular expression.
+
+**Note:** This is a legacy branch. You should upgrade to `1.x`.
+
+## Usage
+
+```javascript
+var pathToRegexp = require('path-to-regexp');
+```
+
+### pathToRegexp(path, keys, options)
+
+ - **path** A string in the express format, an array of such strings, or a regular expression
+ - **keys** An array to be populated with the keys present in the url.  Once the function completes, this will be an array of strings.
+ - **options**
+   - **options.sensitive** Defaults to false, set this to true to make routes case sensitive
+   - **options.strict** Defaults to false, set this to true to make the trailing slash matter.
+   - **options.end** Defaults to true, set this to false to only match the prefix of the URL.
+
+```javascript
+var keys = [];
+var exp = pathToRegexp('/foo/:bar', keys);
+//keys = ['bar']
+//exp = /^\/foo\/(?:([^\/]+?))\/?$/i
+```
+
+## Live Demo
+
+You can see a live demo of this library in use at [express-route-tester](http://forbeslindesay.github.com/express-route-tester/).
+
+## License
+
+  MIT
diff --git a/wrt/node_modules/path-to-regexp/index.js b/wrt/node_modules/path-to-regexp/index.js
new file mode 100644 (file)
index 0000000..500d1da
--- /dev/null
@@ -0,0 +1,129 @@
+/**
+ * Expose `pathtoRegexp`.
+ */
+
+module.exports = pathtoRegexp;
+
+/**
+ * Match matching groups in a regular expression.
+ */
+var MATCHING_GROUP_REGEXP = /\((?!\?)/g;
+
+/**
+ * Normalize the given path string,
+ * returning a regular expression.
+ *
+ * An empty array should be passed,
+ * which will contain the placeholder
+ * key names. For example "/user/:id" will
+ * then contain ["id"].
+ *
+ * @param  {String|RegExp|Array} path
+ * @param  {Array} keys
+ * @param  {Object} options
+ * @return {RegExp}
+ * @api private
+ */
+
+function pathtoRegexp(path, keys, options) {
+  options = options || {};
+  keys = keys || [];
+  var strict = options.strict;
+  var end = options.end !== false;
+  var flags = options.sensitive ? '' : 'i';
+  var extraOffset = 0;
+  var keysOffset = keys.length;
+  var i = 0;
+  var name = 0;
+  var m;
+
+  if (path instanceof RegExp) {
+    while (m = MATCHING_GROUP_REGEXP.exec(path.source)) {
+      keys.push({
+        name: name++,
+        optional: false,
+        offset: m.index
+      });
+    }
+
+    return path;
+  }
+
+  if (Array.isArray(path)) {
+    // Map array parts into regexps and return their source. We also pass
+    // the same keys and options instance into every generation to get
+    // consistent matching groups before we join the sources together.
+    path = path.map(function (value) {
+      return pathtoRegexp(value, keys, options).source;
+    });
+
+    return new RegExp('(?:' + path.join('|') + ')', flags);
+  }
+
+  path = ('^' + path + (strict ? '' : path[path.length - 1] === '/' ? '?' : '/?'))
+    .replace(/\/\(/g, '/(?:')
+    .replace(/([\/\.])/g, '\\$1')
+    .replace(/(\\\/)?(\\\.)?:(\w+)(\(.*?\))?(\*)?(\?)?/g, function (match, slash, format, key, capture, star, optional, offset) {
+      slash = slash || '';
+      format = format || '';
+      capture = capture || '([^\\/' + format + ']+?)';
+      optional = optional || '';
+
+      keys.push({
+        name: key,
+        optional: !!optional,
+        offset: offset + extraOffset
+      });
+
+      var result = ''
+        + (optional ? '' : slash)
+        + '(?:'
+        + format + (optional ? slash : '') + capture
+        + (star ? '((?:[\\/' + format + '].+?)?)' : '')
+        + ')'
+        + optional;
+
+      extraOffset += result.length - match.length;
+
+      return result;
+    })
+    .replace(/\*/g, function (star, index) {
+      var len = keys.length
+
+      while (len-- > keysOffset && keys[len].offset > index) {
+        keys[len].offset += 3; // Replacement length minus asterisk length.
+      }
+
+      return '(.*)';
+    });
+
+  // This is a workaround for handling unnamed matching groups.
+  while (m = MATCHING_GROUP_REGEXP.exec(path)) {
+    var escapeCount = 0;
+    var index = m.index;
+
+    while (path.charAt(--index) === '\\') {
+      escapeCount++;
+    }
+
+    // It's possible to escape the bracket.
+    if (escapeCount % 2 === 1) {
+      continue;
+    }
+
+    if (keysOffset + i === keys.length || keys[keysOffset + i].offset > m.index) {
+      keys.splice(keysOffset + i, 0, {
+        name: name++, // Unnamed matching groups must be consistently linear.
+        optional: false,
+        offset: m.index
+      });
+    }
+
+    i++;
+  }
+
+  // If the path is non-ending, match until the end or a slash.
+  path += (end ? '$' : (path[path.length - 1] === '/' ? '' : '(?=\\/|$)'));
+
+  return new RegExp(path, flags);
+};
diff --git a/wrt/node_modules/path-to-regexp/package.json b/wrt/node_modules/path-to-regexp/package.json
new file mode 100644 (file)
index 0000000..f2bebda
--- /dev/null
@@ -0,0 +1,219 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "path-to-regexp@0.1.7",
+        "scope": null,
+        "escapedName": "path-to-regexp",
+        "name": "path-to-regexp",
+        "rawSpec": "0.1.7",
+        "spec": "0.1.7",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express"
+    ]
+  ],
+  "_from": "path-to-regexp@0.1.7",
+  "_id": "path-to-regexp@0.1.7",
+  "_inCache": true,
+  "_location": "/path-to-regexp",
+  "_nodeVersion": "2.3.3",
+  "_npmUser": {
+    "name": "blakeembrey",
+    "email": "hello@blakeembrey.com"
+  },
+  "_npmVersion": "2.13.2",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "path-to-regexp@0.1.7",
+    "scope": null,
+    "escapedName": "path-to-regexp",
+    "name": "path-to-regexp",
+    "rawSpec": "0.1.7",
+    "spec": "0.1.7",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/express"
+  ],
+  "_resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
+  "_shasum": "df604178005f522f15eb4490e7247a1bfaa67f8c",
+  "_shrinkwrap": null,
+  "_spec": "path-to-regexp@0.1.7",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express",
+  "bugs": {
+    "url": "https://github.com/component/path-to-regexp/issues"
+  },
+  "component": {
+    "scripts": {
+      "path-to-regexp": "index.js"
+    }
+  },
+  "dependencies": {},
+  "description": "Express style path to RegExp utility",
+  "devDependencies": {
+    "istanbul": "^0.2.6",
+    "mocha": "^1.17.1"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "df604178005f522f15eb4490e7247a1bfaa67f8c",
+    "tarball": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz"
+  },
+  "files": [
+    "index.js",
+    "LICENSE"
+  ],
+  "gitHead": "039118d6c3c186d3f176c73935ca887a32a33d93",
+  "homepage": "https://github.com/component/path-to-regexp#readme",
+  "keywords": [
+    "express",
+    "regexp"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "tjholowaychuk",
+      "email": "tj@vision-media.ca"
+    },
+    {
+      "name": "hughsk",
+      "email": "hughskennedy@gmail.com"
+    },
+    {
+      "name": "timaschew",
+      "email": "timaschew@gmail.com"
+    },
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    },
+    {
+      "name": "jongleberry",
+      "email": "jonathanrichardong@gmail.com"
+    },
+    {
+      "name": "dominicbarnes",
+      "email": "dominic@dbarnes.info"
+    },
+    {
+      "name": "tootallnate",
+      "email": "nathan@tootallnate.net"
+    },
+    {
+      "name": "rauchg",
+      "email": "rauchg@gmail.com"
+    },
+    {
+      "name": "retrofox",
+      "email": "rdsuarez@gmail.com"
+    },
+    {
+      "name": "coreh",
+      "email": "thecoreh@gmail.com"
+    },
+    {
+      "name": "forbeslindesay",
+      "email": "forbes@lindesay.co.uk"
+    },
+    {
+      "name": "kelonye",
+      "email": "kelonyemitchel@gmail.com"
+    },
+    {
+      "name": "mattmueller",
+      "email": "mattmuelle@gmail.com"
+    },
+    {
+      "name": "yields",
+      "email": "yields@icloud.com"
+    },
+    {
+      "name": "anthonyshort",
+      "email": "antshort@gmail.com"
+    },
+    {
+      "name": "ianstormtaylor",
+      "email": "ian@ianstormtaylor.com"
+    },
+    {
+      "name": "cristiandouce",
+      "email": "cristian@gravityonmars.com"
+    },
+    {
+      "name": "swatinem",
+      "email": "arpad.borsos@googlemail.com"
+    },
+    {
+      "name": "stagas",
+      "email": "gstagas@gmail.com"
+    },
+    {
+      "name": "amasad",
+      "email": "amjad.masad@gmail.com"
+    },
+    {
+      "name": "juliangruber",
+      "email": "julian@juliangruber.com"
+    },
+    {
+      "name": "calvinfo",
+      "email": "calvin@calv.info"
+    },
+    {
+      "name": "blakeembrey",
+      "email": "hello@blakeembrey.com"
+    },
+    {
+      "name": "timoxley",
+      "email": "secoif@gmail.com"
+    },
+    {
+      "name": "jonathanong",
+      "email": "jonathanrichardong@gmail.com"
+    },
+    {
+      "name": "queckezz",
+      "email": "fabian.eichenberger@gmail.com"
+    },
+    {
+      "name": "nami-doc",
+      "email": "vendethiel@hotmail.fr"
+    },
+    {
+      "name": "clintwood",
+      "email": "clint@anotherway.co.za"
+    },
+    {
+      "name": "thehydroimpulse",
+      "email": "dnfagnan@gmail.com"
+    },
+    {
+      "name": "stephenmathieson",
+      "email": "me@stephenmathieson.com"
+    },
+    {
+      "name": "trevorgerhardt",
+      "email": "trevorgerhardt@gmail.com"
+    },
+    {
+      "name": "dfcreative",
+      "email": "df.creative@gmail.com"
+    },
+    {
+      "name": "defunctzombie",
+      "email": "shtylman@gmail.com"
+    }
+  ],
+  "name": "path-to-regexp",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/component/path-to-regexp.git"
+  },
+  "scripts": {
+    "test": "istanbul cover _mocha -- -R spec"
+  },
+  "version": "0.1.7"
+}
diff --git a/wrt/node_modules/proxy-addr/HISTORY.md b/wrt/node_modules/proxy-addr/HISTORY.md
new file mode 100644 (file)
index 0000000..b909ce8
--- /dev/null
@@ -0,0 +1,115 @@
+1.1.5 / 2017-07-25
+==================
+
+  * Fix array argument being altered
+  * deps: ipaddr.js@1.4.0
+
+1.1.4 / 2017-03-24
+==================
+
+  * deps: ipaddr.js@1.3.0
+
+1.1.3 / 2017-01-14
+==================
+
+  * deps: ipaddr.js@1.2.0
+
+1.1.2 / 2016-05-29
+==================
+
+  * deps: ipaddr.js@1.1.1
+    - Fix IPv6-mapped IPv4 validation edge cases
+
+1.1.1 / 2016-05-03
+==================
+
+  * Fix regression matching mixed versions against multiple subnets
+
+1.1.0 / 2016-05-01
+==================
+
+  * Fix accepting various invalid netmasks
+    - IPv4 netmasks must be contingous
+    - IPv6 addresses cannot be used as a netmask
+  * deps: ipaddr.js@1.1.0
+
+1.0.10 / 2015-12-09
+===================
+
+  * deps: ipaddr.js@1.0.5
+    - Fix regression in `isValid` with non-string arguments
+
+1.0.9 / 2015-12-01
+==================
+
+  * deps: ipaddr.js@1.0.4
+    - Fix accepting some invalid IPv6 addresses
+    - Reject CIDRs with negative or overlong masks
+  * perf: enable strict mode
+
+1.0.8 / 2015-05-10
+==================
+
+  * deps: ipaddr.js@1.0.1
+
+1.0.7 / 2015-03-16
+==================
+
+  * deps: ipaddr.js@0.1.9
+    - Fix OOM on certain inputs to `isValid`
+
+1.0.6 / 2015-02-01
+==================
+
+  * deps: ipaddr.js@0.1.8
+
+1.0.5 / 2015-01-08
+==================
+
+  * deps: ipaddr.js@0.1.6
+
+1.0.4 / 2014-11-23
+==================
+
+  * deps: ipaddr.js@0.1.5
+    - Fix edge cases with `isValid`
+
+1.0.3 / 2014-09-21
+==================
+
+  * Use `forwarded` npm module
+
+1.0.2 / 2014-09-18
+==================
+
+  * Fix a global leak when multiple subnets are trusted
+  * Support Node.js 0.6
+  * deps: ipaddr.js@0.1.3
+
+1.0.1 / 2014-06-03
+==================
+
+  * Fix links in npm package
+
+1.0.0 / 2014-05-08
+==================
+
+  * Add `trust` argument to determine proxy trust on
+    * Accepts custom function
+    * Accepts IPv4/IPv6 address(es)
+    * Accepts subnets
+    * Accepts pre-defined names
+  * Add optional `trust` argument to `proxyaddr.all` to
+    stop at first untrusted
+  * Add `proxyaddr.compile` to pre-compile `trust` function
+    to make subsequent calls faster
+
+0.0.1 / 2014-05-04
+==================
+
+  * Fix bad npm publish
+
+0.0.0 / 2014-05-04
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/proxy-addr/LICENSE b/wrt/node_modules/proxy-addr/LICENSE
new file mode 100644 (file)
index 0000000..cab251c
--- /dev/null
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2014-2016 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/proxy-addr/README.md b/wrt/node_modules/proxy-addr/README.md
new file mode 100644 (file)
index 0000000..6b1075a
--- /dev/null
@@ -0,0 +1,140 @@
+# proxy-addr
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+Determine address of proxied request
+
+## Install
+
+This is a [Node.js](https://nodejs.org/en/) module available through the
+[npm registry](https://www.npmjs.com/). Installation is done using the
+[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
+
+```sh
+$ npm install proxy-addr
+```
+
+## API
+
+```js
+var proxyaddr = require('proxy-addr')
+```
+
+### proxyaddr(req, trust)
+
+Return the address of the request, using the given `trust` parameter.
+
+The `trust` argument is a function that returns `true` if you trust
+the address, `false` if you don't. The closest untrusted address is
+returned.
+
+```js
+proxyaddr(req, function(addr){ return addr === '127.0.0.1' })
+proxyaddr(req, function(addr, i){ return i < 1 })
+```
+
+The `trust` arugment may also be a single IP address string or an
+array of trusted addresses, as plain IP addresses, CIDR-formatted
+strings, or IP/netmask strings.
+
+```js
+proxyaddr(req, '127.0.0.1')
+proxyaddr(req, ['127.0.0.0/8', '10.0.0.0/8'])
+proxyaddr(req, ['127.0.0.0/255.0.0.0', '192.168.0.0/255.255.0.0'])
+```
+
+This module also supports IPv6. Your IPv6 addresses will be normalized
+automatically (i.e. `fe80::00ed:1` equals `fe80:0:0:0:0:0:ed:1`).
+
+```js
+proxyaddr(req, '::1')
+proxyaddr(req, ['::1/128', 'fe80::/10'])
+```
+
+This module will automatically work with IPv4-mapped IPv6 addresses
+as well to support node.js in IPv6-only mode. This means that you do
+not have to specify both `::ffff:a00:1` and `10.0.0.1`.
+
+As a convenience, this module also takes certain pre-defined names
+in addition to IP addresses, which expand into IP addresses:
+
+```js
+proxyaddr(req, 'loopback')
+proxyaddr(req, ['loopback', 'fc00:ac:1ab5:fff::1/64'])
+```
+
+  * `loopback`: IPv4 and IPv6 loopback addresses (like `::1` and
+    `127.0.0.1`).
+  * `linklocal`: IPv4 and IPv6 link-local addresses (like
+    `fe80::1:1:1:1` and `169.254.0.1`).
+  * `uniquelocal`: IPv4 private addresses and IPv6 unique-local
+    addresses (like `fc00:ac:1ab5:fff::1` and `192.168.0.1`).
+
+When `trust` is specified as a function, it will be called for each
+address to determine if it is a trusted address. The function is
+given two arguments: `addr` and `i`, where `addr` is a string of
+the address to check and `i` is a number that represents the distance
+from the socket address.
+
+### proxyaddr.all(req, [trust])
+
+Return all the addresses of the request, optionally stopping at the
+first untrusted. This array is ordered from closest to furthest
+(i.e. `arr[0] === req.connection.remoteAddress`).
+
+```js
+proxyaddr.all(req)
+```
+
+The optional `trust` argument takes the same arguments as `trust`
+does in `proxyaddr(req, trust)`.
+
+```js
+proxyaddr.all(req, 'loopback')
+```
+
+### proxyaddr.compile(val)
+
+Compiles argument `val` into a `trust` function. This function takes
+the same arguments as `trust` does in `proxyaddr(req, trust)` and
+returns a function suitable for `proxyaddr(req, trust)`.
+
+```js
+var trust = proxyaddr.compile('localhost')
+var addr  = proxyaddr(req, trust)
+```
+
+This function is meant to be optimized for use against every request.
+It is recommend to compile a trust function up-front for the trusted
+configuration and pass that to `proxyaddr(req, trust)` for each request.
+
+## Testing
+
+```sh
+$ npm test
+```
+
+## Benchmarks
+
+```sh
+$ npm run-script bench
+```
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/proxy-addr.svg
+[npm-url]: https://npmjs.org/package/proxy-addr
+[node-version-image]: https://img.shields.io/node/v/proxy-addr.svg
+[node-version-url]: https://nodejs.org/en/download/
+[travis-image]: https://img.shields.io/travis/jshttp/proxy-addr/master.svg
+[travis-url]: https://travis-ci.org/jshttp/proxy-addr
+[coveralls-image]: https://img.shields.io/coveralls/jshttp/proxy-addr/master.svg
+[coveralls-url]: https://coveralls.io/r/jshttp/proxy-addr?branch=master
+[downloads-image]: https://img.shields.io/npm/dm/proxy-addr.svg
+[downloads-url]: https://npmjs.org/package/proxy-addr
diff --git a/wrt/node_modules/proxy-addr/index.js b/wrt/node_modules/proxy-addr/index.js
new file mode 100644 (file)
index 0000000..c5266e0
--- /dev/null
@@ -0,0 +1,327 @@
+/*!
+ * proxy-addr
+ * Copyright(c) 2014-2016 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = proxyaddr;
+module.exports.all = alladdrs;
+module.exports.compile = compile;
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var forwarded = require('forwarded');
+var ipaddr = require('ipaddr.js');
+
+/**
+ * Variables.
+ * @private
+ */
+
+var digitre = /^[0-9]+$/;
+var isip = ipaddr.isValid;
+var parseip = ipaddr.parse;
+
+/**
+ * Pre-defined IP ranges.
+ * @private
+ */
+
+var ipranges = {
+  linklocal: ['169.254.0.0/16', 'fe80::/10'],
+  loopback: ['127.0.0.1/8', '::1/128'],
+  uniquelocal: ['10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16', 'fc00::/7']
+};
+
+/**
+ * Get all addresses in the request, optionally stopping
+ * at the first untrusted.
+ *
+ * @param {Object} request
+ * @param {Function|Array|String} [trust]
+ * @public
+ */
+
+function alladdrs(req, trust) {
+  // get addresses
+  var addrs = forwarded(req);
+
+  if (!trust) {
+    // Return all addresses
+    return addrs;
+  }
+
+  if (typeof trust !== 'function') {
+    trust = compile(trust);
+  }
+
+  for (var i = 0; i < addrs.length - 1; i++) {
+    if (trust(addrs[i], i)) continue;
+
+    addrs.length = i + 1;
+  }
+
+  return addrs;
+}
+
+/**
+ * Compile argument into trust function.
+ *
+ * @param {Array|String} val
+ * @private
+ */
+
+function compile(val) {
+  if (!val) {
+    throw new TypeError('argument is required');
+  }
+
+  var trust;
+
+  if (typeof val === 'string') {
+    trust = [val];
+  } else if (Array.isArray(val)) {
+    trust = val.slice();
+  } else {
+    throw new TypeError('unsupported trust argument');
+  }
+
+  for (var i = 0; i < trust.length; i++) {
+    val = trust[i];
+
+    if (!ipranges.hasOwnProperty(val)) {
+      continue;
+    }
+
+    // Splice in pre-defined range
+    val = ipranges[val];
+    trust.splice.apply(trust, [i, 1].concat(val));
+    i += val.length - 1;
+  }
+
+  return compileTrust(compileRangeSubnets(trust));
+}
+
+/**
+ * Compile `arr` elements into range subnets.
+ *
+ * @param {Array} arr
+ * @private
+ */
+
+function compileRangeSubnets(arr) {
+  var rangeSubnets = new Array(arr.length);
+
+  for (var i = 0; i < arr.length; i++) {
+    rangeSubnets[i] = parseipNotation(arr[i]);
+  }
+
+  return rangeSubnets;
+}
+
+/**
+ * Compile range subnet array into trust function.
+ *
+ * @param {Array} rangeSubnets
+ * @private
+ */
+
+function compileTrust(rangeSubnets) {
+  // Return optimized function based on length
+  var len = rangeSubnets.length;
+  return len === 0
+    ? trustNone
+    : len === 1
+    ? trustSingle(rangeSubnets[0])
+    : trustMulti(rangeSubnets);
+}
+
+/**
+ * Parse IP notation string into range subnet.
+ *
+ * @param {String} note
+ * @private
+ */
+
+function parseipNotation(note) {
+  var pos = note.lastIndexOf('/');
+  var str = pos !== -1
+    ? note.substring(0, pos)
+    : note;
+
+  if (!isip(str)) {
+    throw new TypeError('invalid IP address: ' + str);
+  }
+
+  var ip = parseip(str);
+
+  if (pos === -1 && ip.kind() === 'ipv6' && ip.isIPv4MappedAddress()) {
+    // Store as IPv4
+    ip = ip.toIPv4Address();
+  }
+
+  var max = ip.kind() === 'ipv6'
+    ? 128
+    : 32;
+
+  var range = pos !== -1
+    ? note.substring(pos + 1, note.length)
+    : null;
+
+  if (range === null) {
+    range = max;
+  } else if (digitre.test(range)) {
+    range = parseInt(range, 10);
+  } else if (ip.kind() === 'ipv4' && isip(range)) {
+    range = parseNetmask(range);
+  } else {
+    range = null;
+  }
+
+  if (range <= 0 || range > max) {
+    throw new TypeError('invalid range on address: ' + note);
+  }
+
+  return [ip, range];
+}
+
+/**
+ * Parse netmask string into CIDR range.
+ *
+ * @param {String} netmask
+ * @private
+ */
+
+function parseNetmask(netmask) {
+  var ip = parseip(netmask);
+  var kind = ip.kind();
+
+  return kind === 'ipv4'
+    ? ip.prefixLengthFromSubnetMask()
+    : null;
+}
+
+/**
+ * Determine address of proxied request.
+ *
+ * @param {Object} request
+ * @param {Function|Array|String} trust
+ * @public
+ */
+
+function proxyaddr(req, trust) {
+  if (!req) {
+    throw new TypeError('req argument is required');
+  }
+
+  if (!trust) {
+    throw new TypeError('trust argument is required');
+  }
+
+  var addrs = alladdrs(req, trust);
+  var addr = addrs[addrs.length - 1];
+
+  return addr;
+}
+
+/**
+ * Static trust function to trust nothing.
+ *
+ * @private
+ */
+
+function trustNone() {
+  return false;
+}
+
+/**
+ * Compile trust function for multiple subnets.
+ *
+ * @param {Array} subnets
+ * @private
+ */
+
+function trustMulti(subnets) {
+  return function trust(addr) {
+    if (!isip(addr)) return false;
+
+    var ip = parseip(addr);
+    var ipconv;
+    var kind = ip.kind();
+
+    for (var i = 0; i < subnets.length; i++) {
+      var subnet = subnets[i];
+      var subnetip = subnet[0];
+      var subnetkind = subnetip.kind();
+      var subnetrange = subnet[1];
+      var trusted = ip;
+
+      if (kind !== subnetkind) {
+        if (subnetkind === 'ipv4' && !ip.isIPv4MappedAddress()) {
+          // Incompatible IP addresses
+          continue;
+        }
+
+        if (!ipconv) {
+          // Convert IP to match subnet IP kind
+          ipconv = subnetkind === 'ipv4'
+            ? ip.toIPv4Address()
+            : ip.toIPv4MappedAddress();
+        }
+
+        trusted = ipconv;
+      }
+
+      if (trusted.match(subnetip, subnetrange)) {
+        return true;
+      }
+    }
+
+    return false;
+  };
+}
+
+/**
+ * Compile trust function for single subnet.
+ *
+ * @param {Object} subnet
+ * @private
+ */
+
+function trustSingle(subnet) {
+  var subnetip = subnet[0];
+  var subnetkind = subnetip.kind();
+  var subnetisipv4 = subnetkind === 'ipv4';
+  var subnetrange = subnet[1];
+
+  return function trust(addr) {
+    if (!isip(addr)) return false;
+
+    var ip = parseip(addr);
+    var kind = ip.kind();
+
+    if (kind !== subnetkind) {
+      if (subnetisipv4 && !ip.isIPv4MappedAddress()) {
+        // Incompatible IP addresses
+        return false;
+      }
+
+      // Convert IP to match subnet IP kind
+      ip = subnetisipv4
+        ? ip.toIPv4Address()
+        : ip.toIPv4MappedAddress();
+    }
+
+    return ip.match(subnetip, subnetrange);
+  };
+}
diff --git a/wrt/node_modules/proxy-addr/package.json b/wrt/node_modules/proxy-addr/package.json
new file mode 100644 (file)
index 0000000..d2a9722
--- /dev/null
@@ -0,0 +1,108 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "proxy-addr@~1.1.5",
+        "scope": null,
+        "escapedName": "proxy-addr",
+        "name": "proxy-addr",
+        "rawSpec": "~1.1.5",
+        "spec": ">=1.1.5 <1.2.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express"
+    ]
+  ],
+  "_from": "proxy-addr@>=1.1.5 <1.2.0",
+  "_id": "proxy-addr@1.1.5",
+  "_inCache": true,
+  "_location": "/proxy-addr",
+  "_nodeVersion": "6.11.1",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/proxy-addr-1.1.5.tgz_1501030838206_0.9159589342307299"
+  },
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "3.10.10",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "proxy-addr@~1.1.5",
+    "scope": null,
+    "escapedName": "proxy-addr",
+    "name": "proxy-addr",
+    "rawSpec": "~1.1.5",
+    "spec": ">=1.1.5 <1.2.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/express"
+  ],
+  "_resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-1.1.5.tgz",
+  "_shasum": "71c0ee3b102de3f202f3b64f608d173fcba1a918",
+  "_shrinkwrap": null,
+  "_spec": "proxy-addr@~1.1.5",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express",
+  "author": {
+    "name": "Douglas Christopher Wilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "bugs": {
+    "url": "https://github.com/jshttp/proxy-addr/issues"
+  },
+  "dependencies": {
+    "forwarded": "~0.1.0",
+    "ipaddr.js": "1.4.0"
+  },
+  "description": "Determine address of proxied request",
+  "devDependencies": {
+    "beautify-benchmark": "0.2.4",
+    "benchmark": "2.1.4",
+    "istanbul": "0.4.5",
+    "mocha": "~1.21.5"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "71c0ee3b102de3f202f3b64f608d173fcba1a918",
+    "tarball": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-1.1.5.tgz"
+  },
+  "engines": {
+    "node": ">= 0.6"
+  },
+  "files": [
+    "LICENSE",
+    "HISTORY.md",
+    "README.md",
+    "index.js"
+  ],
+  "gitHead": "f40ceab074ec2f92399d112793d9ad1c9d96e146",
+  "homepage": "https://github.com/jshttp/proxy-addr#readme",
+  "keywords": [
+    "ip",
+    "proxy",
+    "x-forwarded-for"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "name": "proxy-addr",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/jshttp/proxy-addr.git"
+  },
+  "scripts": {
+    "bench": "node benchmark/index.js",
+    "test": "mocha --reporter spec --bail --check-leaks test/",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
+    "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
+  },
+  "version": "1.1.5"
+}
diff --git a/wrt/node_modules/pullstream/.npmignore b/wrt/node_modules/pullstream/.npmignore
new file mode 100644 (file)
index 0000000..a9b46ea
--- /dev/null
@@ -0,0 +1,8 @@
+/build/*
+node_modules
+*.node
+*.sh
+*.swp
+.lock*
+npm-debug.log
+.idea
diff --git a/wrt/node_modules/pullstream/.travis.yml b/wrt/node_modules/pullstream/.travis.yml
new file mode 100644 (file)
index 0000000..4a83e22
--- /dev/null
@@ -0,0 +1,5 @@
+language: node_js
+node_js:
+  - "0.11"
+  - "0.10"
+  - "0.8"
diff --git a/wrt/node_modules/pullstream/.vimrc b/wrt/node_modules/pullstream/.vimrc
new file mode 100644 (file)
index 0000000..33173f0
--- /dev/null
@@ -0,0 +1,2 @@
+set expandtab
+set shiftwidth=2
diff --git a/wrt/node_modules/pullstream/LICENSE b/wrt/node_modules/pullstream/LICENSE
new file mode 100644 (file)
index 0000000..ccfbbcd
--- /dev/null
@@ -0,0 +1,20 @@
+Copyright (c) 2012 - 2013 Near Infinity Corporation
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/pullstream/README.md b/wrt/node_modules/pullstream/README.md
new file mode 100644 (file)
index 0000000..20f429d
--- /dev/null
@@ -0,0 +1,214 @@
+pullstream [![Build Status](https://travis-ci.org/EvanOxfeld/node-pullstream.png)](https://travis-ci.org/EvanOxfeld/node-pullstream)
+==========
+
+Tired of getting a firehose worth of data from your streams. This module is here to save the day. PullStream allows
+you to pull data when you want and as much as you want.
+
+## Quick Examples
+
+```javascript
+var PullStream = require('pullstream');
+var fs = require('fs');
+
+var ps = new PullStream();
+var loremIpsumStream = fs.createReadStream('loremIpsum.txt');
+var outputStream = fs.createWriteStream(path.join(__dirname, 'loremIpsum.out'));
+
+loremIpsumStream.pipe(ps);
+
+// pull 5 bytes
+ps.pull(5, function(err, data) {
+  console.log(data.toString('utf8'));
+
+  //synchronously pull 1000 bytes or howevery many bytes are available
+  var bytes = ps.pullUpTo(1000);
+
+  // pipe the next 100 to a file
+  ps.pipe(100, outputStream).on('end', function () {
+    console.log('all done');
+  });
+});
+```
+
+# API Index
+
+## PullStream
+ * [pull](#pullStreamPull)
+ * [pullUpTo](#pullStreamPullUpTo)
+ * [pipe](#pullStreamPipe)
+ * [drain](#pullStreamDrain)
+ * [write](#pullStreamWrite)
+ * [end](#pullStreamEnd)
+ * [prepend](#pullStreamPrepend)
+
+# API Documentation
+
+<a name="pullStream"/>
+## PullStream
+
+<a name="pullStreamPull" />
+### ps.pull([number], callback)
+
+Calls a callback when the specified number of bytes are ready. If no number is specified pull will read until the end
+of the input stream.
+
+__Arguments__
+
+* number (optional) - Number of bytes to wait for. If not specified reads to the end of input stream.
+* callback(err, data) - Callback called when the bytes are ready. data is a buffer containing the bytes.
+
+__Example__
+
+```javascript
+var ps = new PullStream();
+
+ps.pull(5, function(err, data) {
+  console.log(data.toString('utf8'));
+});
+```
+
+<a name="pullStreamPullUpTo" />
+### ps.pullUpTo([number])
+
+Synchronously returns the specified number of bytes or however many bytes are available from the input stream. If no
+number is specified pullUpTo will return however many bytes are available from the input stream.
+
+__Arguments__
+
+* number (optional) - Number of bytes to read from the input stream.
+
+__Example__
+
+```javascript
+var ps = new PullStream();
+
+var data = ps.pullUpTo(1000);
+console.log(data.toString('utf8'));
+```
+
+<a name="pullStreamPipe" />
+### ps.pipe([number], destStream)
+
+Pipes the specified number of bytes to destStream. If a number is not specified pipe will pipe the remainder
+of the input stream to destStream. Back-pressure is properly managed.
+
+__Arguments__
+
+* number (optional) - Number of bytes to pipe. If not specified pipe the rest of input stream.
+* destStream - The stream to pipe data to.
+
+__Returns__
+
+Returns destStream.
+
+__Example__
+
+```javascript
+var ps = new PullStream();
+var outputStream = fs.createWriteStream(path.join(__dirname, 'loremIpsum.out'));
+
+ps.pipe(100, out).on('end', function() {
+  console.log('done with pipe');
+});
+```
+
+<a name="pullStreamDrain" />
+### ps.drain(number, callback)
+
+Consume the specified number of bytes and send them to nowhere. Also drains from upstream as necessary if the specified
+number of bytes is less than the length of the pull stream's internal buffer.
+
+__Example__
+
+```javascript
+var ps = new PullStream();
+
+ps.drain(5, function(err) {
+  console.log('5 bytes removed from pull stream');
+});
+```
+
+<a name="pullStreamWrite" />
+### ps.write(data, [encoding])
+
+Writes data to input side of a pull stream.
+
+__Arguments__
+
+* data - Buffer or string to write to the input side of the pull stream.
+* encoding (optional) - Encoding to use if data is a string. If not specified 'utf8' is used.
+
+__Example__
+
+```javascript
+var ps = new PullStream();
+
+ps.pull(5, function(err, data) {
+  console.log(data.toString('ascii'));
+});
+
+ps.write('Hello World', 'ascii');
+```
+
+<a name="pullStreamEnd" />
+### ps.end()
+
+Manually ends a pull stream.
+
+__Example__
+
+```javascript
+var ps = new PullStream();
+
+ps.pull(5, function(err, data) {
+  console.log(data.toString('utf8'));
+});
+
+ps.write('Hello World');
+ps.end();
+```
+
+<a name="pullStreamPrepend" />
+### ps.prepend()
+
+Writes data to the front of the input side of a pull stream.
+
+__Example__
+
+```javascript
+var ps = new PullStream();
+
+ps.pull(11, function(err, data) {
+  console.log(data.toString());
+});
+
+ps.write('World');
+ps.prepend('Hello ');
+ps.end();
+```
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2012 - 2013 Near Infinity Corporation
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/wrt/node_modules/pullstream/examples/loremIpsum.txt b/wrt/node_modules/pullstream/examples/loremIpsum.txt
new file mode 100644 (file)
index 0000000..d89eff9
--- /dev/null
@@ -0,0 +1,9 @@
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. In erat mauris, faucibus quis pharetra sit amet, pretium ac libero. Etiam vehicula eleifend bibendum. Morbi gravida metus ut sapien condimentum sodales mollis augue sodales. Vestibulum quis quam at sem placerat aliquet. Curabitur a felis at sapien ullamcorper fermentum. Mauris molestie arcu et lectus iaculis sit amet eleifend eros posuere. Fusce nec porta orci.
+
+Integer vitae neque odio, a sollicitudin lorem. Aenean orci mauris, tristique luctus fermentum eu, feugiat vel massa. Fusce sem sem, egestas nec vulputate vel, pretium sit amet mi. Fusce ut nisl id risus facilisis euismod. Curabitur et elementum purus. Duis tincidunt fringilla eleifend. Morbi id lorem eu ante adipiscing feugiat. Sed congue erat in enim eleifend dignissim at in nisl. Donec tortor mauris, mollis vel pretium vitae, lacinia nec sapien. Donec erat neque, ullamcorper tincidunt iaculis sit amet, pharetra bibendum ipsum. Nunc mattis risus ac ante consequat nec pulvinar neque molestie. Etiam interdum nunc at metus lacinia non varius erat dignissim. Integer elementum, felis id facilisis vulputate, ipsum tellus venenatis dui, at blandit nibh massa in dolor. Cras a ultricies sapien. Vivamus adipiscing feugiat pharetra.
+
+Donec consectetur pellentesque nisi sit amet elementum. Duis iaculis velit at eros dapibus vehicula. Vestibulum erat risus, rutrum ut vulputate eu, rhoncus ut dolor. Etiam pellentesque lobortis velit. Suspendisse arcu lacus, ornare in sollicitudin eget, hendrerit a neque. Donec ac justo in ante gravida mollis. Praesent scelerisque molestie risus sodales fringilla. Vivamus quis lorem in mauris pulvinar tempor. Nam in nisl vel neque commodo semper sed eu nibh. Duis cursus lectus vel odio posuere quis aliquet quam blandit. Maecenas neque nibh, sollicitudin posuere tempus adipiscing, molestie vel nibh. Mauris porttitor, lacus vitae aliquam aliquam, risus urna tempus elit, sit amet malesuada erat dolor iaculis mi. Donec quam sapien, adipiscing eget sodales vitae, blandit eu odio.
+
+Nullam elementum, felis vitae tempor ullamcorper, ipsum metus dapibus lorem, non molestie tellus libero et nisi. Donec lacinia massa a lacus interdum dapibus. Nulla facilisi. Nulla sollicitudin porta odio non iaculis. Donec lobortis dapibus urna, commodo condimentum magna interdum non. Quisque ultrices adipiscing ante et suscipit. Nullam quis libero leo. Donec molestie semper est, at faucibus risus pharetra non. Praesent pretium lorem nec sem aliquam rhoncus.
+
+Vestibulum facilisis, nulla tincidunt eleifend aliquet, tortor lorem ornare dolor, vitae scelerisque mi ante in felis. Nulla dictum interdum velit in bibendum. In varius aliquet purus et auctor. Nunc imperdiet mi sagittis magna rutrum vehicula. Nullam in lorem nibh, at faucibus tellus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Curabitur ullamcorper ornare est et dapibus. Vivamus sagittis nulla eget enim posuere vel blandit neque adipiscing. Sed ligula odio, ultricies vestibulum fermentum ut, malesuada ac erat. Aliquam erat volutpat.
\ No newline at end of file
diff --git a/wrt/node_modules/pullstream/examples/pullFromFile.js b/wrt/node_modules/pullstream/examples/pullFromFile.js
new file mode 100644 (file)
index 0000000..4fb30df
--- /dev/null
@@ -0,0 +1,18 @@
+var PullStream = require('../');
+var fs = require('fs');
+var path = require('path');
+
+var ps = new PullStream();
+var loremIpsumStream = fs.createReadStream(path.join(__dirname, 'loremIpsum.txt'));
+var outputStream = fs.createWriteStream(path.join(__dirname, 'loremIpsum.out'));
+
+loremIpsumStream.pipe(ps);
+
+ps.pull(5, function (err, data) {
+  console.log(data.toString('utf8'));
+
+  ps.pipe(100, outputStream).on('end', function () {
+    console.log('all done');
+  });
+});
+
diff --git a/wrt/node_modules/pullstream/package.json b/wrt/node_modules/pullstream/package.json
new file mode 100644 (file)
index 0000000..8567470
--- /dev/null
@@ -0,0 +1,92 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "pullstream@>= 0.4.1 < 1",
+        "scope": null,
+        "escapedName": "pullstream",
+        "name": "pullstream",
+        "rawSpec": ">= 0.4.1 < 1",
+        "spec": ">=0.4.1 <1.0.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/unzip"
+    ]
+  ],
+  "_from": "pullstream@>=0.4.1 <1.0.0",
+  "_id": "pullstream@0.4.1",
+  "_inCache": true,
+  "_location": "/pullstream",
+  "_npmUser": {
+    "name": "evanoxfeld",
+    "email": "eoxfeld@gmail.com"
+  },
+  "_npmVersion": "1.4.21",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "pullstream@>= 0.4.1 < 1",
+    "scope": null,
+    "escapedName": "pullstream",
+    "name": "pullstream",
+    "rawSpec": ">= 0.4.1 < 1",
+    "spec": ">=0.4.1 <1.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/unzip"
+  ],
+  "_resolved": "https://registry.npmjs.org/pullstream/-/pullstream-0.4.1.tgz",
+  "_shasum": "d6fb3bf5aed697e831150eb1002c25a3f8ae1314",
+  "_shrinkwrap": null,
+  "_spec": "pullstream@>= 0.4.1 < 1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/unzip",
+  "bugs": {
+    "url": "https://github.com/nearinfinity/node-pullstream/issues"
+  },
+  "dependencies": {
+    "over": ">= 0.0.5 < 1",
+    "readable-stream": "~1.0.31",
+    "setimmediate": ">= 1.0.2 < 2",
+    "slice-stream": ">= 1.0.0 < 2"
+  },
+  "description": "A stream you can pull data from.",
+  "devDependencies": {
+    "async": ">= 0.9.0 <",
+    "nodeunit": ">= 0.9.0 < 1",
+    "stream-buffers": ">= 0.2.6 < 1"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "d6fb3bf5aed697e831150eb1002c25a3f8ae1314",
+    "tarball": "https://registry.npmjs.org/pullstream/-/pullstream-0.4.1.tgz"
+  },
+  "gitHead": "26d5da948c105c25fe85ae5598651c44c00a38f4",
+  "homepage": "https://github.com/nearinfinity/node-pullstream",
+  "keywords": [
+    "stream",
+    "pull"
+  ],
+  "license": "MIT",
+  "main": "pullstream.js",
+  "maintainers": [
+    {
+      "name": "joeferner",
+      "email": "joe@fernsroth.com"
+    },
+    {
+      "name": "evanoxfeld",
+      "email": "eoxfeld@gmail.com"
+    }
+  ],
+  "name": "pullstream",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/nearinfinity/node-pullstream.git"
+  },
+  "scripts": {
+    "test": "nodeunit test"
+  },
+  "version": "0.4.1"
+}
diff --git a/wrt/node_modules/pullstream/pullstream.js b/wrt/node_modules/pullstream/pullstream.js
new file mode 100644 (file)
index 0000000..2c46e7f
--- /dev/null
@@ -0,0 +1,137 @@
+'use strict';
+
+module.exports = PullStream;
+
+require("setimmediate");
+var inherits = require("util").inherits;
+var PassThrough = require('readable-stream/passthrough');
+var over = require('over');
+var SliceStream = require('slice-stream');
+
+function PullStream(opts) {
+  var self = this;
+  this.opts = opts || {};
+  PassThrough.call(this, opts);
+  this.once('finish', function() {
+    self._writesFinished = true;
+    if (self._flushed) {
+      self._finish();
+    }
+  });
+  this.on('readable', function() {
+    self._process();
+  });
+}
+inherits(PullStream, PassThrough);
+
+PullStream.prototype.pull = over([
+  [over.numberOptionalWithDefault(null), over.func, function (len, callback) {
+    if (len === 0) {
+      return callback(null, new Buffer(0));
+    }
+
+    var self = this;
+    pullServiceRequest();
+
+    function pullServiceRequest() {
+      self._serviceRequests = null;
+      if (self._flushed) {
+        return callback(new Error('End of Stream'));
+      }
+
+      var data = self.read(len || undefined);
+      if (data) {
+        setImmediate(callback.bind(null, null, data));
+      } else {
+        self._serviceRequests = pullServiceRequest;
+      }
+    }
+  }]
+]);
+
+PullStream.prototype.pullUpTo = over([
+  [over.numberOptionalWithDefault(null), function (len) {
+    var data = this.read(len);
+    if (len && !data) {
+      data = this.read();
+    }
+    return data;
+  }]
+]);
+
+PullStream.prototype.pipe = over([
+  [over.numberOptionalWithDefault(null), over.object, function (len, destStream) {
+    if (!len) {
+      return PassThrough.prototype.pipe.call(this, destStream);
+    }
+
+    if (len === 0) {
+      return destStream.end();
+    }
+
+
+    var pullstream = this;
+    pullstream
+      .pipe(new SliceStream({ length: len }, function (buf, sliceEnd, extra) {
+        if (!sliceEnd) {
+          return this.push(buf);
+        }
+        pullstream.unpipe();
+        pullstream.unshift(extra);
+        this.push(buf);
+        return this.push(null);
+      }))
+      .pipe(destStream);
+
+    return destStream;
+  }]
+]);
+
+PullStream.prototype._process = function () {
+  if (this._serviceRequests) {
+    this._serviceRequests();
+  }
+};
+
+PullStream.prototype.prepend = function (chunk) {
+  this.unshift(chunk);
+};
+
+PullStream.prototype.drain = function (len, callback) {
+  if (this._flushed) {
+    return callback(new Error('End of Stream'));
+  }
+
+  var data = this.pullUpTo(len);
+  var bytesDrained = data && data.length || 0;
+  if (bytesDrained === len) {
+     setImmediate(callback);
+  } else if (bytesDrained > 0) {
+    this.drain(len - bytesDrained, callback);
+  } else {
+    //internal buffer is empty, wait until data can be consumed
+    this.once('readable', this.drain.bind(this, len - bytesDrained, callback));
+  }
+};
+
+PullStream.prototype._flush = function (callback) {
+  var self = this;
+  if (this._readableState.length > 0) {
+    return setImmediate(self._flush.bind(self, callback));
+  }
+
+  this._flushed = true;
+  if (self._writesFinished) {
+    self._finish(callback);
+  } else {
+    callback();
+  }
+};
+
+PullStream.prototype._finish = function (callback) {
+  callback = callback || function () {};
+  if (this._serviceRequests) {
+    this._serviceRequests();
+  }
+  setImmediate(callback);
+};
diff --git a/wrt/node_modules/pullstream/test/pullStreamTest.js b/wrt/node_modules/pullstream/test/pullStreamTest.js
new file mode 100644 (file)
index 0000000..cbafcd4
--- /dev/null
@@ -0,0 +1,430 @@
+'use strict';
+
+var nodeunit = require('nodeunit');
+var fs = require("fs");
+var path = require("path");
+var streamBuffers = require("stream-buffers");
+var async = require('async')
+var PullStream = require('../');
+
+module.exports = {
+  "source sending 1-byte at a time": function (t) {
+    t.expect(3);
+    var ps = new PullStream({ lowWaterMark : 0 });
+    ps.on('finish', function () {
+      sourceStream.destroy();
+    });
+
+    var sourceStream = new streamBuffers.ReadableStreamBuffer({
+      frequency: 0,
+      chunkSize: 1
+    });
+
+    sourceStream.pipe(ps);
+    sourceStream.put("Hello World!");
+
+    ps.pull('Hello'.length, function (err, data) {
+      if (err) {
+        return t.done(err);
+      }
+      t.equal('Hello', data.toString());
+
+      var writableStream = new streamBuffers.WritableStreamBuffer({
+        initialSize: 100
+      });
+      writableStream.on('close', function () {
+        var str = writableStream.getContentsAsString('utf8');
+        t.equal(' World', str);
+
+        ps.pull(function (err, data) {
+          if (err) {
+            return t.done(err);
+          }
+          t.equal('!', data.toString());
+          return t.done();
+        });
+      });
+
+      ps.pipe(' World'.length, writableStream);
+    });
+  },
+
+  "source sending twelve bytes at once": function (t) {
+    t.expect(3);
+    var ps = new PullStream({ lowWaterMark : 0 });
+    ps.on('finish', function () {
+      sourceStream.destroy();
+    });
+
+    var sourceStream = new streamBuffers.ReadableStreamBuffer({
+      frequency: 0,
+      chunkSize: 1000
+    });
+
+    sourceStream.pipe(ps);
+    sourceStream.put("Hello World!");
+
+    ps.pull('Hello'.length, function (err, data) {
+      if (err) {
+        return t.done(err);
+      }
+      t.equal('Hello', data.toString());
+
+      var writableStream = new streamBuffers.WritableStreamBuffer({
+        initialSize: 100
+      });
+      writableStream.on('close', function () {
+        var str = writableStream.getContentsAsString('utf8');
+        t.equal(' World', str);
+
+        ps.pull(function (err, data) {
+          if (err) {
+            return t.done(err);
+          }
+          t.equal('!', data.toString());
+          return t.done();
+        });
+      });
+
+      ps.pipe(' World'.length, writableStream);
+    });
+  },
+
+  "source sending 512 bytes at once": function (t) {
+    t.expect(512 / 4);
+    var ps = new PullStream({ lowWaterMark : 0 });
+    ps.on('finish', function() {
+      sourceStream.destroy();
+    });
+
+    var values = [];
+    for (var i = 0; i < 512; i+=4) {
+      values.push(i + 1000);
+    }
+    var sourceStream = new streamBuffers.ReadableStreamBuffer({
+      frequency: 0,
+      chunkSize: 1000
+    });
+
+    sourceStream.pipe(ps);
+    values.forEach(function(val) {
+      sourceStream.put(val);
+    });
+
+    async.forEachSeries(values, function (val, callback) {
+      ps.pull(4, function (err, data) {
+        if (err) {
+          return callback(err);
+        }
+        t.equal(val, data.toString());
+        return callback(null);
+      });
+    }, function (err) {
+      t.done(err);
+    });
+  },
+
+  "two length pulls": function (t) {
+    t.expect(2);
+    var ps = new PullStream({ lowWaterMark : 0 });
+    ps.on('finish', function () {
+      sourceStream.destroy();
+    });
+
+    var sourceStream = new streamBuffers.ReadableStreamBuffer({
+      frequency: 0,
+      chunkSize: 1000
+    });
+
+    sourceStream.pipe(ps);
+    sourceStream.put("Hello World!");
+
+    ps.pull('Hello'.length, function (err, data) {
+      if (err) {
+        return t.done(err);
+      }
+      t.equal('Hello', data.toString());
+
+      ps.pull(' World!'.length, function (err, data) {
+        if (err) {
+          return t.done(err);
+        }
+        t.equal(' World!', data.toString());
+        return t.done();
+      });
+    });
+  },
+
+  "pulling zero bytes returns empty data": function (t) {
+    t.expect(1);
+    var ps = new PullStream({ lowWaterMark : 0 });
+
+    var sourceStream = new streamBuffers.ReadableStreamBuffer({
+      chunkSize: 1000
+    });
+
+    sourceStream.pipe(ps);
+    sourceStream.put("Hello World!");
+
+    ps.pull(0, function (err, data) {
+      if (err) {
+        return t.done(err);
+      }
+
+      t.equal(0, data.length, "data is empty");
+      sourceStream.destroy();
+      return t.done();
+    });
+  },
+
+  "read from file": function (t) {
+    t.expect(2);
+    var ps = new PullStream({ lowWaterMark : 0 });
+
+    var sourceStream = fs.createReadStream(path.join(__dirname, 'testFile.txt'));
+
+    sourceStream.pipe(ps);
+
+    ps.pull('Hello'.length, function (err, data) {
+      if (err) {
+        return t.done(err);
+      }
+      t.equal('Hello', data.toString());
+
+      ps.pull(' World!'.length, function (err, data) {
+        if (err) {
+          return t.done(err);
+        }
+        t.equal(' World!', data.toString());
+        return t.done();
+      });
+    });
+  },
+
+  "read past end of stream": function (t) {
+    t.expect(2);
+    var ps = new PullStream({ lowWaterMark : 0 });
+    ps.on('finish', function () {
+      sourceStream.destroy();
+    });
+
+    var sourceStream = new streamBuffers.ReadableStreamBuffer({
+      frequency: 1,
+      chunkSize: 1000
+    });
+
+    sourceStream.pipe(ps);
+    sourceStream.put("Hello World!");
+
+    ps.pull('Hello World!'.length, function (err, data) {
+      if (err) {
+        return t.done(err);
+      }
+      t.equal('Hello World!', data.toString());
+
+      ps.pull(1, function (err, data) {
+        if (err) {
+          t.ok(err, 'should get an error');
+        }
+        t.done();
+      });
+    });
+  },
+
+  "pipe with no length": function (t) {
+    t.expect(2);
+    var ps = new PullStream({ lowWaterMark : 0 });
+    ps.on('end', function () {
+      t.ok(true, "pullstream should end");
+    });
+
+    var writableStream = new streamBuffers.WritableStreamBuffer({
+      initialSize: 100
+    });
+    writableStream.on('close', function () {
+      var str = writableStream.getContentsAsString('utf8');
+      t.equal('Hello World!', str);
+      t.done();
+    });
+
+    ps.pipe(writableStream);
+
+    process.nextTick(function () {
+      ps.write(new Buffer('Hello', 'utf8'));
+      ps.write(new Buffer(' World', 'utf8'));
+      process.nextTick(function () {
+        ps.write(new Buffer('!', 'utf8'));
+        ps.end();
+      });
+    });
+  },
+
+  "throw on calling write() after end": function (t) {
+    t.expect(1);
+    var ps = new PullStream({ lowWaterMark : 0 });
+    ps.end();
+
+    try {
+      ps.write(new Buffer('hello', 'utf8'));
+      t.fail("should throw error");
+    } catch (ex) {
+      t.ok(ex);
+    }
+
+    t.done();
+  },
+
+  "pipe more bytes than the pullstream buffer size": function (t) {
+    t.expect(1);
+    var ps = new PullStream();
+    ps.on('end', function() {
+      sourceStream.destroy();
+    });
+
+    var aVals = "", bVals = "";
+    for (var i = 0; i < 20 * 1000; i++) {
+      aVals += 'a';
+    }
+    for (var i = 0; i < 180 * 1000; i++) {
+      bVals += 'b';
+    }
+    var combined = aVals + bVals;
+
+    var sourceStream = new streamBuffers.ReadableStreamBuffer({
+      frequency: 0,
+      chunkSize: 40 * 1024
+    });
+
+    sourceStream.pipe(ps);
+    sourceStream.put(aVals);
+
+    var writableStream = new streamBuffers.WritableStreamBuffer({
+      initialSize: 200 * 1000
+    });
+    writableStream.on('close', function () {
+      var str = writableStream.getContentsAsString('utf8');
+      t.equal(combined, str);
+      t.done();
+    });
+
+    ps.once('drain', function () {
+      ps.pipe(200 * 1000, writableStream);
+      process.nextTick(sourceStream.put.bind(null, bVals));
+    });
+  },
+
+  "mix asynchronous pull with synchronous pullUpTo - exact number of bytes returned": function (t) {
+    t.expect(2);
+    var ps = new PullStream();
+
+    var sourceStream = new streamBuffers.ReadableStreamBuffer({
+      frequency: 0,
+      chunkSize: 1000
+    });
+
+    sourceStream.pipe(ps);
+    sourceStream.put("Hello World!");
+
+    ps.pull('Hello'.length, function (err, data) {
+      if (err) {
+        return t.done(err);
+      }
+      t.equal('Hello', data.toString());
+      var data = ps.pullUpTo(" World!".length);
+      t.equal(" World!", data.toString());
+      sourceStream.destroy();
+      t.done();
+    });
+  },
+
+  "mix asynchronous pull with pullUpTo - fewer bytes returned than requested": function (t) {
+    t.expect(2);
+    var ps = new PullStream();
+
+    var sourceStream = new streamBuffers.ReadableStreamBuffer({
+      frequency: 0,
+      chunkSize: 1000
+    });
+
+    sourceStream.pipe(ps);
+    sourceStream.put("Hello World!");
+
+
+    ps.pull('Hello'.length, function (err, data) {
+      if (err) {
+        return t.done(err);
+      }
+      t.equal('Hello', data.toString());
+      var data = ps.pullUpTo(1000);
+      t.equal(" World!", data.toString());
+      sourceStream.destroy();
+      t.done();
+    });
+  },
+
+  "retrieve all currently remaining bytes": function (t) {
+    t.expect(2);
+    var ps = new PullStream();
+
+    var sourceStream = new streamBuffers.ReadableStreamBuffer({
+      frequency: 0,
+      chunkSize: 1000
+    });
+
+    sourceStream.pipe(ps);
+    sourceStream.put("Hello World!");
+
+    ps.pull('Hello'.length, function (err, data) {
+      if (err) {
+        return t.done(err);
+      }
+      t.equal('Hello', data.toString());
+      var data = ps.pullUpTo();
+      t.equal(" World!", data.toString());
+      sourceStream.destroy();
+      t.done();
+    });
+  },
+
+// TODO: node PassThrough stream doesn't handle unshift the same way anymore.
+//  "prepend": function (t) {
+//    t.expect(1);
+//    var ps = new PullStream();
+//
+//    var sourceStream = new streamBuffers.ReadableStreamBuffer();
+//
+//    sourceStream.pipe(ps);
+//    sourceStream.put("World!");
+//    ps.prepend("Hello ");
+//
+//    ps.pull('Hello World!'.length, function (err, data) {
+//      if (err) {
+//        return t.done(err);
+//      }
+//      t.equal('Hello World!', data.toString());
+//      sourceStream.destroy();
+//      t.done();
+//    });
+//  },
+
+  "drain": function (t) {
+    t.expect(1);
+    var ps = new PullStream();
+
+    var sourceStream = new streamBuffers.ReadableStreamBuffer();
+
+    sourceStream.pipe(ps);
+    sourceStream.put("Hello World!");
+
+    ps.drain('Hello '.length, function (err) {
+      if (err) {
+        return t.done(err);
+      }
+      ps.pull('World!'.length, function (err, data) {
+        t.equal('World!', data.toString());
+        sourceStream.destroy();
+        t.done();
+      });
+    });
+  }
+};
diff --git a/wrt/node_modules/pullstream/test/testFile.txt b/wrt/node_modules/pullstream/test/testFile.txt
new file mode 100644 (file)
index 0000000..c57eff5
--- /dev/null
@@ -0,0 +1 @@
+Hello World!
\ No newline at end of file
diff --git a/wrt/node_modules/qs/.editorconfig b/wrt/node_modules/qs/.editorconfig
new file mode 100644 (file)
index 0000000..b2654e7
--- /dev/null
@@ -0,0 +1,30 @@
+root = true
+
+[*]
+indent_style = space
+indent_size = 4
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+max_line_length = 140
+
+[test/*]
+max_line_length = off
+
+[*.md]
+max_line_length = off
+
+[*.json]
+max_line_length = off
+
+[Makefile]
+max_line_length = off
+
+[CHANGELOG.md]
+indent_style = space
+indent_size = 2
+
+[LICENSE]
+indent_size = 2
+max_line_length = off
diff --git a/wrt/node_modules/qs/.eslintignore b/wrt/node_modules/qs/.eslintignore
new file mode 100644 (file)
index 0000000..1521c8b
--- /dev/null
@@ -0,0 +1 @@
+dist
diff --git a/wrt/node_modules/qs/.eslintrc b/wrt/node_modules/qs/.eslintrc
new file mode 100644 (file)
index 0000000..9309ed5
--- /dev/null
@@ -0,0 +1,18 @@
+{
+    "root": true,
+
+    "extends": "@ljharb",
+
+    "rules": {
+        "complexity": [2, 28],
+        "consistent-return": 1,
+        "id-length": [2, { "min": 1, "max": 25, "properties": "never" }],
+        "indent": [2, 4],
+        "max-params": [2, 12],
+        "max-statements": [2, 45],
+        "no-continue": 1,
+        "no-magic-numbers": 0,
+        "no-restricted-syntax": [2, "BreakStatement", "DebuggerStatement", "ForInStatement", "LabeledStatement", "WithStatement"],
+        "operator-linebreak": [2, "before"],
+    }
+}
diff --git a/wrt/node_modules/qs/CHANGELOG.md b/wrt/node_modules/qs/CHANGELOG.md
new file mode 100644 (file)
index 0000000..5cbd313
--- /dev/null
@@ -0,0 +1,212 @@
+## **6.5.0**
+- [New] add `utils.assign`
+- [New] pass default encoder/decoder to custom encoder/decoder functions (#206)
+- [New] `parse`/`stringify`: add `ignoreQueryPrefix`/`addQueryPrefix` options, respectively (#213)
+- [Fix] Handle stringifying empty objects with addQueryPrefix (#217)
+- [Fix] do not mutate `options` argument (#207)
+- [Refactor] `parse`: cache index to reuse in else statement (#182)
+- [Docs] add various badges to readme (#208)
+- [Dev Deps] update `eslint`, `browserify`, `iconv-lite`, `tape`
+- [Tests] up to `node` `v8.1`, `v7.10`, `v6.11`; npm v4.6 breaks on node < v1; npm v5+ breaks on node < v4
+- [Tests] add `editorconfig-tools`
+
+## **6.4.0**
+- [New] `qs.stringify`: add `encodeValuesOnly` option
+- [Fix] follow `allowPrototypes` option during merge (#201, #201)
+- [Fix] support keys starting with brackets (#202, #200)
+- [Fix] chmod a-x
+- [Dev Deps] update `eslint`
+- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds
+- [eslint] reduce warnings
+
+## **6.3.2**
+- [Fix] follow `allowPrototypes` option during merge (#201, #200)
+- [Dev Deps] update `eslint`
+- [Fix] chmod a-x
+- [Fix] support keys starting with brackets (#202, #200)
+- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds
+
+## **6.3.1**
+- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties (thanks, @snyk!)
+- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `browserify`, `iconv-lite`, `qs-iconv`, `tape`
+- [Tests] on all node minors; improve test matrix
+- [Docs] document stringify option `allowDots` (#195)
+- [Docs] add empty object and array values example (#195)
+- [Docs] Fix minor inconsistency/typo (#192)
+- [Docs] document stringify option `sort` (#191)
+- [Refactor] `stringify`: throw faster with an invalid encoder
+- [Refactor] remove unnecessary escapes (#184)
+- Remove contributing.md, since `qs` is no longer part of `hapi` (#183)
+
+## **6.3.0**
+- [New] Add support for RFC 1738 (#174, #173)
+- [New] `stringify`: Add `serializeDate` option to customize Date serialization (#159)
+- [Fix] ensure `utils.merge` handles merging two arrays
+- [Refactor] only constructors should be capitalized
+- [Refactor] capitalized var names are for constructors only
+- [Refactor] avoid using a sparse array
+- [Robustness] `formats`: cache `String#replace`
+- [Dev Deps] update `browserify`, `eslint`, `@ljharb/eslint-config`; add `safe-publish-latest`
+- [Tests] up to `node` `v6.8`, `v4.6`; improve test matrix
+- [Tests] flesh out arrayLimit/arrayFormat tests (#107)
+- [Tests] skip Object.create tests when null objects are not available
+- [Tests] Turn on eslint for test files (#175)
+
+## **6.2.3**
+- [Fix] follow `allowPrototypes` option during merge (#201, #200)
+- [Fix] chmod a-x
+- [Fix] support keys starting with brackets (#202, #200)
+- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds
+
+## **6.2.2**
+- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties
+
+## **6.2.1**
+- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values
+- [Refactor] Be explicit and use `Object.prototype.hasOwnProperty.call`
+- [Tests] remove `parallelshell` since it does not reliably report failures
+- [Tests] up to `node` `v6.3`, `v5.12`
+- [Dev Deps] update `tape`, `eslint`, `@ljharb/eslint-config`, `qs-iconv`
+
+## [**6.2.0**](https://github.com/ljharb/qs/issues?milestone=36&state=closed)
+- [New] pass Buffers to the encoder/decoder directly (#161)
+- [New] add "encoder" and "decoder" options, for custom param encoding/decoding (#160)
+- [Fix] fix compacting of nested sparse arrays (#150)
+
+## **6.1.2
+- [Fix] follow `allowPrototypes` option during merge (#201, #200)
+- [Fix] chmod a-x
+- [Fix] support keys starting with brackets (#202, #200)
+- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds
+
+## **6.1.1**
+- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties
+
+## [**6.1.0**](https://github.com/ljharb/qs/issues?milestone=35&state=closed)
+- [New] allowDots option for `stringify` (#151)
+- [Fix] "sort" option should work at a depth of 3 or more (#151)
+- [Fix] Restore `dist` directory; will be removed in v7 (#148)
+
+## **6.0.4**
+- [Fix] follow `allowPrototypes` option during merge (#201, #200)
+- [Fix] chmod a-x
+- [Fix] support keys starting with brackets (#202, #200)
+- [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds
+
+## **6.0.3**
+- [Fix] ensure that `allowPrototypes: false` does not ever shadow Object.prototype properties
+- [Fix] Restore `dist` directory; will be removed in v7 (#148)
+
+## [**6.0.2**](https://github.com/ljharb/qs/issues?milestone=33&state=closed)
+- Revert ES6 requirement and restore support for node down to v0.8.
+
+## [**6.0.1**](https://github.com/ljharb/qs/issues?milestone=32&state=closed)
+- [**#127**](https://github.com/ljharb/qs/pull/127) Fix engines definition in package.json
+
+## [**6.0.0**](https://github.com/ljharb/qs/issues?milestone=31&state=closed)
+- [**#124**](https://github.com/ljharb/qs/issues/124) Use ES6 and drop support for node < v4
+
+## **5.2.1**
+- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values
+
+## [**5.2.0**](https://github.com/ljharb/qs/issues?milestone=30&state=closed)
+- [**#64**](https://github.com/ljharb/qs/issues/64) Add option to sort object keys in the query string
+
+## [**5.1.0**](https://github.com/ljharb/qs/issues?milestone=29&state=closed)
+- [**#117**](https://github.com/ljharb/qs/issues/117) make URI encoding stringified results optional
+- [**#106**](https://github.com/ljharb/qs/issues/106) Add flag `skipNulls` to optionally skip null values in stringify
+
+## [**5.0.0**](https://github.com/ljharb/qs/issues?milestone=28&state=closed)
+- [**#114**](https://github.com/ljharb/qs/issues/114) default allowDots to false
+- [**#100**](https://github.com/ljharb/qs/issues/100) include dist to npm
+
+## [**4.0.0**](https://github.com/ljharb/qs/issues?milestone=26&state=closed)
+- [**#98**](https://github.com/ljharb/qs/issues/98) make returning plain objects and allowing prototype overwriting properties optional
+
+## [**3.1.0**](https://github.com/ljharb/qs/issues?milestone=24&state=closed)
+- [**#89**](https://github.com/ljharb/qs/issues/89) Add option to disable "Transform dot notation to bracket notation"
+
+## [**3.0.0**](https://github.com/ljharb/qs/issues?milestone=23&state=closed)
+- [**#80**](https://github.com/ljharb/qs/issues/80) qs.parse silently drops properties
+- [**#77**](https://github.com/ljharb/qs/issues/77) Perf boost
+- [**#60**](https://github.com/ljharb/qs/issues/60) Add explicit option to disable array parsing
+- [**#74**](https://github.com/ljharb/qs/issues/74) Bad parse when turning array into object
+- [**#81**](https://github.com/ljharb/qs/issues/81) Add a `filter` option
+- [**#68**](https://github.com/ljharb/qs/issues/68) Fixed issue with recursion and passing strings into objects.
+- [**#66**](https://github.com/ljharb/qs/issues/66) Add mixed array and object dot notation support Closes: #47
+- [**#76**](https://github.com/ljharb/qs/issues/76) RFC 3986
+- [**#85**](https://github.com/ljharb/qs/issues/85) No equal sign
+- [**#84**](https://github.com/ljharb/qs/issues/84) update license attribute
+
+## [**2.4.1**](https://github.com/ljharb/qs/issues?milestone=20&state=closed)
+- [**#73**](https://github.com/ljharb/qs/issues/73) Property 'hasOwnProperty' of object #<Object> is not a function
+
+## [**2.4.0**](https://github.com/ljharb/qs/issues?milestone=19&state=closed)
+- [**#70**](https://github.com/ljharb/qs/issues/70) Add arrayFormat option
+
+## [**2.3.3**](https://github.com/ljharb/qs/issues?milestone=18&state=closed)
+- [**#59**](https://github.com/ljharb/qs/issues/59) make sure array indexes are >= 0, closes #57
+- [**#58**](https://github.com/ljharb/qs/issues/58) make qs usable for browser loader
+
+## [**2.3.2**](https://github.com/ljharb/qs/issues?milestone=17&state=closed)
+- [**#55**](https://github.com/ljharb/qs/issues/55) allow merging a string into an object
+
+## [**2.3.1**](https://github.com/ljharb/qs/issues?milestone=16&state=closed)
+- [**#52**](https://github.com/ljharb/qs/issues/52) Return "undefined" and "false" instead of throwing "TypeError".
+
+## [**2.3.0**](https://github.com/ljharb/qs/issues?milestone=15&state=closed)
+- [**#50**](https://github.com/ljharb/qs/issues/50) add option to omit array indices, closes #46
+
+## [**2.2.5**](https://github.com/ljharb/qs/issues?milestone=14&state=closed)
+- [**#39**](https://github.com/ljharb/qs/issues/39) Is there an alternative to Buffer.isBuffer?
+- [**#49**](https://github.com/ljharb/qs/issues/49) refactor utils.merge, fixes #45
+- [**#41**](https://github.com/ljharb/qs/issues/41) avoid browserifying Buffer, for #39
+
+## [**2.2.4**](https://github.com/ljharb/qs/issues?milestone=13&state=closed)
+- [**#38**](https://github.com/ljharb/qs/issues/38) how to handle object keys beginning with a number
+
+## [**2.2.3**](https://github.com/ljharb/qs/issues?milestone=12&state=closed)
+- [**#37**](https://github.com/ljharb/qs/issues/37) parser discards first empty value in array
+- [**#36**](https://github.com/ljharb/qs/issues/36) Update to lab 4.x
+
+## [**2.2.2**](https://github.com/ljharb/qs/issues?milestone=11&state=closed)
+- [**#33**](https://github.com/ljharb/qs/issues/33) Error when plain object in a value
+- [**#34**](https://github.com/ljharb/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty
+- [**#24**](https://github.com/ljharb/qs/issues/24) Changelog? Semver?
+
+## [**2.2.1**](https://github.com/ljharb/qs/issues?milestone=10&state=closed)
+- [**#32**](https://github.com/ljharb/qs/issues/32) account for circular references properly, closes #31
+- [**#31**](https://github.com/ljharb/qs/issues/31) qs.parse stackoverflow on circular objects
+
+## [**2.2.0**](https://github.com/ljharb/qs/issues?milestone=9&state=closed)
+- [**#26**](https://github.com/ljharb/qs/issues/26) Don't use Buffer global if it's not present
+- [**#30**](https://github.com/ljharb/qs/issues/30) Bug when merging non-object values into arrays
+- [**#29**](https://github.com/ljharb/qs/issues/29) Don't call Utils.clone at the top of Utils.merge
+- [**#23**](https://github.com/ljharb/qs/issues/23) Ability to not limit parameters?
+
+## [**2.1.0**](https://github.com/ljharb/qs/issues?milestone=8&state=closed)
+- [**#22**](https://github.com/ljharb/qs/issues/22) Enable using a RegExp as delimiter
+
+## [**2.0.0**](https://github.com/ljharb/qs/issues?milestone=7&state=closed)
+- [**#18**](https://github.com/ljharb/qs/issues/18) Why is there arrayLimit?
+- [**#20**](https://github.com/ljharb/qs/issues/20) Configurable parametersLimit
+- [**#21**](https://github.com/ljharb/qs/issues/21) make all limits optional, for #18, for #20
+
+## [**1.2.2**](https://github.com/ljharb/qs/issues?milestone=6&state=closed)
+- [**#19**](https://github.com/ljharb/qs/issues/19) Don't overwrite null values
+
+## [**1.2.1**](https://github.com/ljharb/qs/issues?milestone=5&state=closed)
+- [**#16**](https://github.com/ljharb/qs/issues/16) ignore non-string delimiters
+- [**#15**](https://github.com/ljharb/qs/issues/15) Close code block
+
+## [**1.2.0**](https://github.com/ljharb/qs/issues?milestone=4&state=closed)
+- [**#12**](https://github.com/ljharb/qs/issues/12) Add optional delim argument
+- [**#13**](https://github.com/ljharb/qs/issues/13) fix #11: flattened keys in array are now correctly parsed
+
+## [**1.1.0**](https://github.com/ljharb/qs/issues?milestone=3&state=closed)
+- [**#7**](https://github.com/ljharb/qs/issues/7) Empty values of a POST array disappear after being submitted
+- [**#9**](https://github.com/ljharb/qs/issues/9) Should not omit equals signs (=) when value is null
+- [**#6**](https://github.com/ljharb/qs/issues/6) Minor grammar fix in README
+
+## [**1.0.2**](https://github.com/ljharb/qs/issues?milestone=2&state=closed)
+- [**#5**](https://github.com/ljharb/qs/issues/5) array holes incorrectly copied into object on large index
diff --git a/wrt/node_modules/qs/LICENSE b/wrt/node_modules/qs/LICENSE
new file mode 100644 (file)
index 0000000..d456948
--- /dev/null
@@ -0,0 +1,28 @@
+Copyright (c) 2014 Nathan LaFreniere and other contributors.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * The names of any contributors may not be used to endorse or promote
+      products derived from this software without specific prior written
+      permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+                                  *   *   *
+
+The complete list of contributors can be found at: https://github.com/hapijs/qs/graphs/contributors
diff --git a/wrt/node_modules/qs/README.md b/wrt/node_modules/qs/README.md
new file mode 100644 (file)
index 0000000..d811966
--- /dev/null
@@ -0,0 +1,475 @@
+# qs <sup>[![Version Badge][2]][1]</sup>
+
+[![Build Status][3]][4]
+[![dependency status][5]][6]
+[![dev dependency status][7]][8]
+[![License][license-image]][license-url]
+[![Downloads][downloads-image]][downloads-url]
+
+[![npm badge][11]][1]
+
+A querystring parsing and stringifying library with some added security.
+
+Lead Maintainer: [Jordan Harband](https://github.com/ljharb)
+
+The **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring).
+
+## Usage
+
+```javascript
+var qs = require('qs');
+var assert = require('assert');
+
+var obj = qs.parse('a=c');
+assert.deepEqual(obj, { a: 'c' });
+
+var str = qs.stringify(obj);
+assert.equal(str, 'a=c');
+```
+
+### Parsing Objects
+
+[](#preventEval)
+```javascript
+qs.parse(string, [options]);
+```
+
+**qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`.
+For example, the string `'foo[bar]=baz'` converts to:
+
+```javascript
+assert.deepEqual(qs.parse('foo[bar]=baz'), {
+    foo: {
+        bar: 'baz'
+    }
+});
+```
+
+When using the `plainObjects` option the parsed value is returned as a null object, created via `Object.create(null)` and as such you should be aware that prototype methods will not exist on it and a user may set those names to whatever value they like:
+
+```javascript
+var nullObject = qs.parse('a[hasOwnProperty]=b', { plainObjects: true });
+assert.deepEqual(nullObject, { a: { hasOwnProperty: 'b' } });
+```
+
+By default parameters that would overwrite properties on the object prototype are ignored, if you wish to keep the data from those fields either use `plainObjects` as mentioned above, or set `allowPrototypes` to `true` which will allow user input to overwrite those properties. *WARNING* It is generally a bad idea to enable this option as it can cause problems when attempting to use the properties that have been overwritten. Always be careful with this option.
+
+```javascript
+var protoObject = qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true });
+assert.deepEqual(protoObject, { a: { hasOwnProperty: 'b' } });
+```
+
+URI encoded strings work too:
+
+```javascript
+assert.deepEqual(qs.parse('a%5Bb%5D=c'), {
+    a: { b: 'c' }
+});
+```
+
+You can also nest your objects, like `'foo[bar][baz]=foobarbaz'`:
+
+```javascript
+assert.deepEqual(qs.parse('foo[bar][baz]=foobarbaz'), {
+    foo: {
+        bar: {
+            baz: 'foobarbaz'
+        }
+    }
+});
+```
+
+By default, when nesting objects **qs** will only parse up to 5 children deep. This means if you attempt to parse a string like
+`'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be:
+
+```javascript
+var expected = {
+    a: {
+        b: {
+            c: {
+                d: {
+                    e: {
+                        f: {
+                            '[g][h][i]': 'j'
+                        }
+                    }
+                }
+            }
+        }
+    }
+};
+var string = 'a[b][c][d][e][f][g][h][i]=j';
+assert.deepEqual(qs.parse(string), expected);
+```
+
+This depth can be overridden by passing a `depth` option to `qs.parse(string, [options])`:
+
+```javascript
+var deep = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 });
+assert.deepEqual(deep, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } });
+```
+
+The depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number.
+
+For similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option:
+
+```javascript
+var limited = qs.parse('a=b&c=d', { parameterLimit: 1 });
+assert.deepEqual(limited, { a: 'b' });
+```
+
+To bypass the leading question mark, use `ignoreQueryPrefix`:
+
+```javascript
+var prefixed = qs.parse('?a=b&c=d', { ignoreQueryPrefix: true });
+assert.deepEqual(prefixed, { a: 'b', c: 'd' });
+```
+
+An optional delimiter can also be passed:
+
+```javascript
+var delimited = qs.parse('a=b;c=d', { delimiter: ';' });
+assert.deepEqual(delimited, { a: 'b', c: 'd' });
+```
+
+Delimiters can be a regular expression too:
+
+```javascript
+var regexed = qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ });
+assert.deepEqual(regexed, { a: 'b', c: 'd', e: 'f' });
+```
+
+Option `allowDots` can be used to enable dot notation:
+
+```javascript
+var withDots = qs.parse('a.b=c', { allowDots: true });
+assert.deepEqual(withDots, { a: { b: 'c' } });
+```
+
+### Parsing Arrays
+
+**qs** can also parse arrays using a similar `[]` notation:
+
+```javascript
+var withArray = qs.parse('a[]=b&a[]=c');
+assert.deepEqual(withArray, { a: ['b', 'c'] });
+```
+
+You may specify an index as well:
+
+```javascript
+var withIndexes = qs.parse('a[1]=c&a[0]=b');
+assert.deepEqual(withIndexes, { a: ['b', 'c'] });
+```
+
+Note that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number
+to create an array. When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preserving
+their order:
+
+```javascript
+var noSparse = qs.parse('a[1]=b&a[15]=c');
+assert.deepEqual(noSparse, { a: ['b', 'c'] });
+```
+
+Note that an empty string is also a value, and will be preserved:
+
+```javascript
+var withEmptyString = qs.parse('a[]=&a[]=b');
+assert.deepEqual(withEmptyString, { a: ['', 'b'] });
+
+var withIndexedEmptyString = qs.parse('a[0]=b&a[1]=&a[2]=c');
+assert.deepEqual(withIndexedEmptyString, { a: ['b', '', 'c'] });
+```
+
+**qs** will also limit specifying indices in an array to a maximum index of `20`. Any array members with an index of greater than `20` will
+instead be converted to an object with the index as the key:
+
+```javascript
+var withMaxIndex = qs.parse('a[100]=b');
+assert.deepEqual(withMaxIndex, { a: { '100': 'b' } });
+```
+
+This limit can be overridden by passing an `arrayLimit` option:
+
+```javascript
+var withArrayLimit = qs.parse('a[1]=b', { arrayLimit: 0 });
+assert.deepEqual(withArrayLimit, { a: { '1': 'b' } });
+```
+
+To disable array parsing entirely, set `parseArrays` to `false`.
+
+```javascript
+var noParsingArrays = qs.parse('a[]=b', { parseArrays: false });
+assert.deepEqual(noParsingArrays, { a: { '0': 'b' } });
+```
+
+If you mix notations, **qs** will merge the two items into an object:
+
+```javascript
+var mixedNotation = qs.parse('a[0]=b&a[b]=c');
+assert.deepEqual(mixedNotation, { a: { '0': 'b', b: 'c' } });
+```
+
+You can also create arrays of objects:
+
+```javascript
+var arraysOfObjects = qs.parse('a[][b]=c');
+assert.deepEqual(arraysOfObjects, { a: [{ b: 'c' }] });
+```
+
+### Stringifying
+
+[](#preventEval)
+```javascript
+qs.stringify(object, [options]);
+```
+
+When stringifying, **qs** by default URI encodes output. Objects are stringified as you would expect:
+
+```javascript
+assert.equal(qs.stringify({ a: 'b' }), 'a=b');
+assert.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c');
+```
+
+This encoding can be disabled by setting the `encode` option to `false`:
+
+```javascript
+var unencoded = qs.stringify({ a: { b: 'c' } }, { encode: false });
+assert.equal(unencoded, 'a[b]=c');
+```
+
+Encoding can be disabled for keys by setting the `encodeValuesOnly` option to `true`:
+```javascript
+var encodedValues = qs.stringify(
+    { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] },
+    { encodeValuesOnly: true }
+);
+assert.equal(encodedValues,'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h');
+```
+
+This encoding can also be replaced by a custom encoding method set as `encoder` option:
+
+```javascript
+var encoded = qs.stringify({ a: { b: 'c' } }, { encoder: function (str) {
+    // Passed in values `a`, `b`, `c`
+    return // Return encoded string
+}})
+```
+
+_(Note: the `encoder` option does not apply if `encode` is `false`)_
+
+Analogue to the `encoder` there is a `decoder` option for `parse` to override decoding of properties and values:
+
+```javascript
+var decoded = qs.parse('x=z', { decoder: function (str) {
+    // Passed in values `x`, `z`
+    return // Return decoded string
+}})
+```
+
+Examples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage.
+
+When arrays are stringified, by default they are given explicit indices:
+
+```javascript
+qs.stringify({ a: ['b', 'c', 'd'] });
+// 'a[0]=b&a[1]=c&a[2]=d'
+```
+
+You may override this by setting the `indices` option to `false`:
+
+```javascript
+qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false });
+// 'a=b&a=c&a=d'
+```
+
+You may use the `arrayFormat` option to specify the format of the output array:
+
+```javascript
+qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' })
+// 'a[0]=b&a[1]=c'
+qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' })
+// 'a[]=b&a[]=c'
+qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' })
+// 'a=b&a=c'
+```
+
+When objects are stringified, by default they use bracket notation:
+
+```javascript
+qs.stringify({ a: { b: { c: 'd', e: 'f' } } });
+// 'a[b][c]=d&a[b][e]=f'
+```
+
+You may override this to use dot notation by setting the `allowDots` option to `true`:
+
+```javascript
+qs.stringify({ a: { b: { c: 'd', e: 'f' } } }, { allowDots: true });
+// 'a.b.c=d&a.b.e=f'
+```
+
+Empty strings and null values will omit the value, but the equals sign (=) remains in place:
+
+```javascript
+assert.equal(qs.stringify({ a: '' }), 'a=');
+```
+
+Key with no values (such as an empty object or array) will return nothing:
+
+```javascript
+assert.equal(qs.stringify({ a: [] }), '');
+assert.equal(qs.stringify({ a: {} }), '');
+assert.equal(qs.stringify({ a: [{}] }), '');
+assert.equal(qs.stringify({ a: { b: []} }), '');
+assert.equal(qs.stringify({ a: { b: {}} }), '');
+```
+
+Properties that are set to `undefined` will be omitted entirely:
+
+```javascript
+assert.equal(qs.stringify({ a: null, b: undefined }), 'a=');
+```
+
+The query string may optionally be prepended with a question mark:
+
+```javascript
+assert.equal(qs.stringify({ a: 'b', c: 'd' }, { addQueryPrefix: true }), '?a=b&c=d');
+```
+
+The delimiter may be overridden with stringify as well:
+
+```javascript
+assert.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d');
+```
+
+If you only want to override the serialization of `Date` objects, you can provide a `serializeDate` option:
+
+```javascript
+var date = new Date(7);
+assert.equal(qs.stringify({ a: date }), 'a=1970-01-01T00:00:00.007Z'.replace(/:/g, '%3A'));
+assert.equal(
+    qs.stringify({ a: date }, { serializeDate: function (d) { return d.getTime(); } }),
+    'a=7'
+);
+```
+
+You may use the `sort` option to affect the order of parameter keys:
+
+```javascript
+function alphabeticalSort(a, b) {
+    return a.localeCompare(b);
+}
+assert.equal(qs.stringify({ a: 'c', z: 'y', b : 'f' }, { sort: alphabeticalSort }), 'a=c&b=f&z=y');
+```
+
+Finally, you can use the `filter` option to restrict which keys will be included in the stringified output.
+If you pass a function, it will be called for each key to obtain the replacement value. Otherwise, if you
+pass an array, it will be used to select properties and array indices for stringification:
+
+```javascript
+function filterFunc(prefix, value) {
+    if (prefix == 'b') {
+        // Return an `undefined` value to omit a property.
+        return;
+    }
+    if (prefix == 'e[f]') {
+        return value.getTime();
+    }
+    if (prefix == 'e[g][0]') {
+        return value * 2;
+    }
+    return value;
+}
+qs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: filterFunc });
+// 'a=b&c=d&e[f]=123&e[g][0]=4'
+qs.stringify({ a: 'b', c: 'd', e: 'f' }, { filter: ['a', 'e'] });
+// 'a=b&e=f'
+qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] });
+// 'a[0]=b&a[2]=d'
+```
+
+### Handling of `null` values
+
+By default, `null` values are treated like empty strings:
+
+```javascript
+var withNull = qs.stringify({ a: null, b: '' });
+assert.equal(withNull, 'a=&b=');
+```
+
+Parsing does not distinguish between parameters with and without equal signs. Both are converted to empty strings.
+
+```javascript
+var equalsInsensitive = qs.parse('a&b=');
+assert.deepEqual(equalsInsensitive, { a: '', b: '' });
+```
+
+To distinguish between `null` values and empty strings use the `strictNullHandling` flag. In the result string the `null`
+values have no `=` sign:
+
+```javascript
+var strictNull = qs.stringify({ a: null, b: '' }, { strictNullHandling: true });
+assert.equal(strictNull, 'a&b=');
+```
+
+To parse values without `=` back to `null` use the `strictNullHandling` flag:
+
+```javascript
+var parsedStrictNull = qs.parse('a&b=', { strictNullHandling: true });
+assert.deepEqual(parsedStrictNull, { a: null, b: '' });
+```
+
+To completely skip rendering keys with `null` values, use the `skipNulls` flag:
+
+```javascript
+var nullsSkipped = qs.stringify({ a: 'b', c: null}, { skipNulls: true });
+assert.equal(nullsSkipped, 'a=b');
+```
+
+### Dealing with special character sets
+
+By default the encoding and decoding of characters is done in `utf-8`. If you
+wish to encode querystrings to a different character set (i.e.
+[Shift JIS](https://en.wikipedia.org/wiki/Shift_JIS)) you can use the
+[`qs-iconv`](https://github.com/martinheidegger/qs-iconv) library:
+
+```javascript
+var encoder = require('qs-iconv/encoder')('shift_jis');
+var shiftJISEncoded = qs.stringify({ a: 'こんにちは!' }, { encoder: encoder });
+assert.equal(shiftJISEncoded, 'a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I');
+```
+
+This also works for decoding of query strings:
+
+```javascript
+var decoder = require('qs-iconv/decoder')('shift_jis');
+var obj = qs.parse('a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I', { decoder: decoder });
+assert.deepEqual(obj, { a: 'こんにちは!' });
+```
+
+### RFC 3986 and RFC 1738 space encoding
+
+RFC3986 used as default option and encodes ' ' to *%20* which is backward compatible.
+In the same time, output can be stringified as per RFC1738 with ' ' equal to '+'.
+
+```
+assert.equal(qs.stringify({ a: 'b c' }), 'a=b%20c');
+assert.equal(qs.stringify({ a: 'b c' }, { format : 'RFC3986' }), 'a=b%20c');
+assert.equal(qs.stringify({ a: 'b c' }, { format : 'RFC1738' }), 'a=b+c');
+```
+
+[1]: https://npmjs.org/package/qs
+[2]: http://versionbadg.es/ljharb/qs.svg
+[3]: https://api.travis-ci.org/ljharb/qs.svg
+[4]: https://travis-ci.org/ljharb/qs
+[5]: https://david-dm.org/ljharb/qs.svg
+[6]: https://david-dm.org/ljharb/qs
+[7]: https://david-dm.org/ljharb/qs/dev-status.svg
+[8]: https://david-dm.org/ljharb/qs?type=dev
+[9]: https://ci.testling.com/ljharb/qs.png
+[10]: https://ci.testling.com/ljharb/qs
+[11]: https://nodei.co/npm/qs.png?downloads=true&stars=true
+[license-image]: http://img.shields.io/npm/l/qs.svg
+[license-url]: LICENSE
+[downloads-image]: http://img.shields.io/npm/dm/qs.svg
+[downloads-url]: http://npm-stat.com/charts.html?package=qs
diff --git a/wrt/node_modules/qs/dist/qs.js b/wrt/node_modules/qs/dist/qs.js
new file mode 100644 (file)
index 0000000..fb3cd18
--- /dev/null
@@ -0,0 +1,615 @@
+(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Qs = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
+'use strict';
+
+var replace = String.prototype.replace;
+var percentTwenties = /%20/g;
+
+module.exports = {
+    'default': 'RFC3986',
+    formatters: {
+        RFC1738: function (value) {
+            return replace.call(value, percentTwenties, '+');
+        },
+        RFC3986: function (value) {
+            return value;
+        }
+    },
+    RFC1738: 'RFC1738',
+    RFC3986: 'RFC3986'
+};
+
+},{}],2:[function(require,module,exports){
+'use strict';
+
+var stringify = require('./stringify');
+var parse = require('./parse');
+var formats = require('./formats');
+
+module.exports = {
+    formats: formats,
+    parse: parse,
+    stringify: stringify
+};
+
+},{"./formats":1,"./parse":3,"./stringify":4}],3:[function(require,module,exports){
+'use strict';
+
+var utils = require('./utils');
+
+var has = Object.prototype.hasOwnProperty;
+
+var defaults = {
+    allowDots: false,
+    allowPrototypes: false,
+    arrayLimit: 20,
+    decoder: utils.decode,
+    delimiter: '&',
+    depth: 5,
+    parameterLimit: 1000,
+    plainObjects: false,
+    strictNullHandling: false
+};
+
+var parseValues = function parseQueryStringValues(str, options) {
+    var obj = {};
+    var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
+    var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
+    var parts = cleanStr.split(options.delimiter, limit);
+
+    for (var i = 0; i < parts.length; ++i) {
+        var part = parts[i];
+
+        var bracketEqualsPos = part.indexOf(']=');
+        var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
+
+        var key, val;
+        if (pos === -1) {
+            key = options.decoder(part, defaults.decoder);
+            val = options.strictNullHandling ? null : '';
+        } else {
+            key = options.decoder(part.slice(0, pos), defaults.decoder);
+            val = options.decoder(part.slice(pos + 1), defaults.decoder);
+        }
+        if (has.call(obj, key)) {
+            obj[key] = [].concat(obj[key]).concat(val);
+        } else {
+            obj[key] = val;
+        }
+    }
+
+    return obj;
+};
+
+var parseObject = function parseObjectRecursive(chain, val, options) {
+    if (!chain.length) {
+        return val;
+    }
+
+    var root = chain.shift();
+
+    var obj;
+    if (root === '[]') {
+        obj = [];
+        obj = obj.concat(parseObject(chain, val, options));
+    } else {
+        obj = options.plainObjects ? Object.create(null) : {};
+        var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
+        var index = parseInt(cleanRoot, 10);
+        if (
+            !isNaN(index)
+            && root !== cleanRoot
+            && String(index) === cleanRoot
+            && index >= 0
+            && (options.parseArrays && index <= options.arrayLimit)
+        ) {
+            obj = [];
+            obj[index] = parseObject(chain, val, options);
+        } else {
+            obj[cleanRoot] = parseObject(chain, val, options);
+        }
+    }
+
+    return obj;
+};
+
+var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
+    if (!givenKey) {
+        return;
+    }
+
+    // Transform dot notation to bracket notation
+    var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
+
+    // The regex chunks
+
+    var brackets = /(\[[^[\]]*])/;
+    var child = /(\[[^[\]]*])/g;
+
+    // Get the parent
+
+    var segment = brackets.exec(key);
+    var parent = segment ? key.slice(0, segment.index) : key;
+
+    // Stash the parent if it exists
+
+    var keys = [];
+    if (parent) {
+        // If we aren't using plain objects, optionally prefix keys
+        // that would overwrite object prototype properties
+        if (!options.plainObjects && has.call(Object.prototype, parent)) {
+            if (!options.allowPrototypes) {
+                return;
+            }
+        }
+
+        keys.push(parent);
+    }
+
+    // Loop through children appending to the array until we hit depth
+
+    var i = 0;
+    while ((segment = child.exec(key)) !== null && i < options.depth) {
+        i += 1;
+        if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
+            if (!options.allowPrototypes) {
+                return;
+            }
+        }
+        keys.push(segment[1]);
+    }
+
+    // If there's a remainder, just add whatever is left
+
+    if (segment) {
+        keys.push('[' + key.slice(segment.index) + ']');
+    }
+
+    return parseObject(keys, val, options);
+};
+
+module.exports = function (str, opts) {
+    var options = opts ? utils.assign({}, opts) : {};
+
+    if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') {
+        throw new TypeError('Decoder has to be a function.');
+    }
+
+    options.ignoreQueryPrefix = options.ignoreQueryPrefix === true;
+    options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter;
+    options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth;
+    options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit;
+    options.parseArrays = options.parseArrays !== false;
+    options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder;
+    options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots;
+    options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects;
+    options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes;
+    options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit;
+    options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
+
+    if (str === '' || str === null || typeof str === 'undefined') {
+        return options.plainObjects ? Object.create(null) : {};
+    }
+
+    var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
+    var obj = options.plainObjects ? Object.create(null) : {};
+
+    // Iterate over the keys and setup the new object
+
+    var keys = Object.keys(tempObj);
+    for (var i = 0; i < keys.length; ++i) {
+        var key = keys[i];
+        var newObj = parseKeys(key, tempObj[key], options);
+        obj = utils.merge(obj, newObj, options);
+    }
+
+    return utils.compact(obj);
+};
+
+},{"./utils":5}],4:[function(require,module,exports){
+'use strict';
+
+var utils = require('./utils');
+var formats = require('./formats');
+
+var arrayPrefixGenerators = {
+    brackets: function brackets(prefix) { // eslint-disable-line func-name-matching
+        return prefix + '[]';
+    },
+    indices: function indices(prefix, key) { // eslint-disable-line func-name-matching
+        return prefix + '[' + key + ']';
+    },
+    repeat: function repeat(prefix) { // eslint-disable-line func-name-matching
+        return prefix;
+    }
+};
+
+var toISO = Date.prototype.toISOString;
+
+var defaults = {
+    delimiter: '&',
+    encode: true,
+    encoder: utils.encode,
+    encodeValuesOnly: false,
+    serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching
+        return toISO.call(date);
+    },
+    skipNulls: false,
+    strictNullHandling: false
+};
+
+var stringify = function stringify( // eslint-disable-line func-name-matching
+    object,
+    prefix,
+    generateArrayPrefix,
+    strictNullHandling,
+    skipNulls,
+    encoder,
+    filter,
+    sort,
+    allowDots,
+    serializeDate,
+    formatter,
+    encodeValuesOnly
+) {
+    var obj = object;
+    if (typeof filter === 'function') {
+        obj = filter(prefix, obj);
+    } else if (obj instanceof Date) {
+        obj = serializeDate(obj);
+    } else if (obj === null) {
+        if (strictNullHandling) {
+            return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix;
+        }
+
+        obj = '';
+    }
+
+    if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) {
+        if (encoder) {
+            var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder);
+            return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))];
+        }
+        return [formatter(prefix) + '=' + formatter(String(obj))];
+    }
+
+    var values = [];
+
+    if (typeof obj === 'undefined') {
+        return values;
+    }
+
+    var objKeys;
+    if (Array.isArray(filter)) {
+        objKeys = filter;
+    } else {
+        var keys = Object.keys(obj);
+        objKeys = sort ? keys.sort(sort) : keys;
+    }
+
+    for (var i = 0; i < objKeys.length; ++i) {
+        var key = objKeys[i];
+
+        if (skipNulls && obj[key] === null) {
+            continue;
+        }
+
+        if (Array.isArray(obj)) {
+            values = values.concat(stringify(
+                obj[key],
+                generateArrayPrefix(prefix, key),
+                generateArrayPrefix,
+                strictNullHandling,
+                skipNulls,
+                encoder,
+                filter,
+                sort,
+                allowDots,
+                serializeDate,
+                formatter,
+                encodeValuesOnly
+            ));
+        } else {
+            values = values.concat(stringify(
+                obj[key],
+                prefix + (allowDots ? '.' + key : '[' + key + ']'),
+                generateArrayPrefix,
+                strictNullHandling,
+                skipNulls,
+                encoder,
+                filter,
+                sort,
+                allowDots,
+                serializeDate,
+                formatter,
+                encodeValuesOnly
+            ));
+        }
+    }
+
+    return values;
+};
+
+module.exports = function (object, opts) {
+    var obj = object;
+    var options = opts ? utils.assign({}, opts) : {};
+
+    if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') {
+        throw new TypeError('Encoder has to be a function.');
+    }
+
+    var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter;
+    var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
+    var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls;
+    var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode;
+    var encoder = typeof options.encoder === 'function' ? options.encoder : defaults.encoder;
+    var sort = typeof options.sort === 'function' ? options.sort : null;
+    var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots;
+    var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate;
+    var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults.encodeValuesOnly;
+    if (typeof options.format === 'undefined') {
+        options.format = formats.default;
+    } else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) {
+        throw new TypeError('Unknown format option provided.');
+    }
+    var formatter = formats.formatters[options.format];
+    var objKeys;
+    var filter;
+
+    if (typeof options.filter === 'function') {
+        filter = options.filter;
+        obj = filter('', obj);
+    } else if (Array.isArray(options.filter)) {
+        filter = options.filter;
+        objKeys = filter;
+    }
+
+    var keys = [];
+
+    if (typeof obj !== 'object' || obj === null) {
+        return '';
+    }
+
+    var arrayFormat;
+    if (options.arrayFormat in arrayPrefixGenerators) {
+        arrayFormat = options.arrayFormat;
+    } else if ('indices' in options) {
+        arrayFormat = options.indices ? 'indices' : 'repeat';
+    } else {
+        arrayFormat = 'indices';
+    }
+
+    var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
+
+    if (!objKeys) {
+        objKeys = Object.keys(obj);
+    }
+
+    if (sort) {
+        objKeys.sort(sort);
+    }
+
+    for (var i = 0; i < objKeys.length; ++i) {
+        var key = objKeys[i];
+
+        if (skipNulls && obj[key] === null) {
+            continue;
+        }
+
+        keys = keys.concat(stringify(
+            obj[key],
+            key,
+            generateArrayPrefix,
+            strictNullHandling,
+            skipNulls,
+            encode ? encoder : null,
+            filter,
+            sort,
+            allowDots,
+            serializeDate,
+            formatter,
+            encodeValuesOnly
+        ));
+    }
+
+    var joined = keys.join(delimiter);
+    var prefix = options.addQueryPrefix === true ? '?' : '';
+
+    return joined.length > 0 ? prefix + joined : '';
+};
+
+},{"./formats":1,"./utils":5}],5:[function(require,module,exports){
+'use strict';
+
+var has = Object.prototype.hasOwnProperty;
+
+var hexTable = (function () {
+    var array = [];
+    for (var i = 0; i < 256; ++i) {
+        array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
+    }
+
+    return array;
+}());
+
+exports.arrayToObject = function (source, options) {
+    var obj = options && options.plainObjects ? Object.create(null) : {};
+    for (var i = 0; i < source.length; ++i) {
+        if (typeof source[i] !== 'undefined') {
+            obj[i] = source[i];
+        }
+    }
+
+    return obj;
+};
+
+exports.merge = function (target, source, options) {
+    if (!source) {
+        return target;
+    }
+
+    if (typeof source !== 'object') {
+        if (Array.isArray(target)) {
+            target.push(source);
+        } else if (typeof target === 'object') {
+            if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) {
+                target[source] = true;
+            }
+        } else {
+            return [target, source];
+        }
+
+        return target;
+    }
+
+    if (typeof target !== 'object') {
+        return [target].concat(source);
+    }
+
+    var mergeTarget = target;
+    if (Array.isArray(target) && !Array.isArray(source)) {
+        mergeTarget = exports.arrayToObject(target, options);
+    }
+
+    if (Array.isArray(target) && Array.isArray(source)) {
+        source.forEach(function (item, i) {
+            if (has.call(target, i)) {
+                if (target[i] && typeof target[i] === 'object') {
+                    target[i] = exports.merge(target[i], item, options);
+                } else {
+                    target.push(item);
+                }
+            } else {
+                target[i] = item;
+            }
+        });
+        return target;
+    }
+
+    return Object.keys(source).reduce(function (acc, key) {
+        var value = source[key];
+
+        if (has.call(acc, key)) {
+            acc[key] = exports.merge(acc[key], value, options);
+        } else {
+            acc[key] = value;
+        }
+        return acc;
+    }, mergeTarget);
+};
+
+exports.assign = function assignSingleSource(target, source) {
+    return Object.keys(source).reduce(function (acc, key) {
+        acc[key] = source[key];
+        return acc;
+    }, target);
+};
+
+exports.decode = function (str) {
+    try {
+        return decodeURIComponent(str.replace(/\+/g, ' '));
+    } catch (e) {
+        return str;
+    }
+};
+
+exports.encode = function (str) {
+    // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
+    // It has been adapted here for stricter adherence to RFC 3986
+    if (str.length === 0) {
+        return str;
+    }
+
+    var string = typeof str === 'string' ? str : String(str);
+
+    var out = '';
+    for (var i = 0; i < string.length; ++i) {
+        var c = string.charCodeAt(i);
+
+        if (
+            c === 0x2D    // -
+            || c === 0x2E // .
+            || c === 0x5F // _
+            || c === 0x7E // ~
+            || (c >= 0x30 && c <= 0x39) // 0-9
+            || (c >= 0x41 && c <= 0x5A) // a-z
+            || (c >= 0x61 && c <= 0x7A) // A-Z
+        ) {
+            out += string.charAt(i);
+            continue;
+        }
+
+        if (c < 0x80) {
+            out = out + hexTable[c];
+            continue;
+        }
+
+        if (c < 0x800) {
+            out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
+            continue;
+        }
+
+        if (c < 0xD800 || c >= 0xE000) {
+            out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
+            continue;
+        }
+
+        i += 1;
+        c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
+        out += hexTable[0xF0 | (c >> 18)]
+            + hexTable[0x80 | ((c >> 12) & 0x3F)]
+            + hexTable[0x80 | ((c >> 6) & 0x3F)]
+            + hexTable[0x80 | (c & 0x3F)];
+    }
+
+    return out;
+};
+
+exports.compact = function (obj, references) {
+    if (typeof obj !== 'object' || obj === null) {
+        return obj;
+    }
+
+    var refs = references || [];
+    var lookup = refs.indexOf(obj);
+    if (lookup !== -1) {
+        return refs[lookup];
+    }
+
+    refs.push(obj);
+
+    if (Array.isArray(obj)) {
+        var compacted = [];
+
+        for (var i = 0; i < obj.length; ++i) {
+            if (obj[i] && typeof obj[i] === 'object') {
+                compacted.push(exports.compact(obj[i], refs));
+            } else if (typeof obj[i] !== 'undefined') {
+                compacted.push(obj[i]);
+            }
+        }
+
+        return compacted;
+    }
+
+    var keys = Object.keys(obj);
+    keys.forEach(function (key) {
+        obj[key] = exports.compact(obj[key], refs);
+    });
+
+    return obj;
+};
+
+exports.isRegExp = function (obj) {
+    return Object.prototype.toString.call(obj) === '[object RegExp]';
+};
+
+exports.isBuffer = function (obj) {
+    if (obj === null || typeof obj === 'undefined') {
+        return false;
+    }
+
+    return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
+};
+
+},{}]},{},[2])(2)
+});
\ No newline at end of file
diff --git a/wrt/node_modules/qs/lib/formats.js b/wrt/node_modules/qs/lib/formats.js
new file mode 100644 (file)
index 0000000..df45997
--- /dev/null
@@ -0,0 +1,18 @@
+'use strict';
+
+var replace = String.prototype.replace;
+var percentTwenties = /%20/g;
+
+module.exports = {
+    'default': 'RFC3986',
+    formatters: {
+        RFC1738: function (value) {
+            return replace.call(value, percentTwenties, '+');
+        },
+        RFC3986: function (value) {
+            return value;
+        }
+    },
+    RFC1738: 'RFC1738',
+    RFC3986: 'RFC3986'
+};
diff --git a/wrt/node_modules/qs/lib/index.js b/wrt/node_modules/qs/lib/index.js
new file mode 100644 (file)
index 0000000..0d6a97d
--- /dev/null
@@ -0,0 +1,11 @@
+'use strict';
+
+var stringify = require('./stringify');
+var parse = require('./parse');
+var formats = require('./formats');
+
+module.exports = {
+    formats: formats,
+    parse: parse,
+    stringify: stringify
+};
diff --git a/wrt/node_modules/qs/lib/parse.js b/wrt/node_modules/qs/lib/parse.js
new file mode 100644 (file)
index 0000000..b6ae645
--- /dev/null
@@ -0,0 +1,172 @@
+'use strict';
+
+var utils = require('./utils');
+
+var has = Object.prototype.hasOwnProperty;
+
+var defaults = {
+    allowDots: false,
+    allowPrototypes: false,
+    arrayLimit: 20,
+    decoder: utils.decode,
+    delimiter: '&',
+    depth: 5,
+    parameterLimit: 1000,
+    plainObjects: false,
+    strictNullHandling: false
+};
+
+var parseValues = function parseQueryStringValues(str, options) {
+    var obj = {};
+    var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
+    var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
+    var parts = cleanStr.split(options.delimiter, limit);
+
+    for (var i = 0; i < parts.length; ++i) {
+        var part = parts[i];
+
+        var bracketEqualsPos = part.indexOf(']=');
+        var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
+
+        var key, val;
+        if (pos === -1) {
+            key = options.decoder(part, defaults.decoder);
+            val = options.strictNullHandling ? null : '';
+        } else {
+            key = options.decoder(part.slice(0, pos), defaults.decoder);
+            val = options.decoder(part.slice(pos + 1), defaults.decoder);
+        }
+        if (has.call(obj, key)) {
+            obj[key] = [].concat(obj[key]).concat(val);
+        } else {
+            obj[key] = val;
+        }
+    }
+
+    return obj;
+};
+
+var parseObject = function parseObjectRecursive(chain, val, options) {
+    if (!chain.length) {
+        return val;
+    }
+
+    var root = chain.shift();
+
+    var obj;
+    if (root === '[]') {
+        obj = [];
+        obj = obj.concat(parseObject(chain, val, options));
+    } else {
+        obj = options.plainObjects ? Object.create(null) : {};
+        var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
+        var index = parseInt(cleanRoot, 10);
+        if (
+            !isNaN(index)
+            && root !== cleanRoot
+            && String(index) === cleanRoot
+            && index >= 0
+            && (options.parseArrays && index <= options.arrayLimit)
+        ) {
+            obj = [];
+            obj[index] = parseObject(chain, val, options);
+        } else {
+            obj[cleanRoot] = parseObject(chain, val, options);
+        }
+    }
+
+    return obj;
+};
+
+var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
+    if (!givenKey) {
+        return;
+    }
+
+    // Transform dot notation to bracket notation
+    var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
+
+    // The regex chunks
+
+    var brackets = /(\[[^[\]]*])/;
+    var child = /(\[[^[\]]*])/g;
+
+    // Get the parent
+
+    var segment = brackets.exec(key);
+    var parent = segment ? key.slice(0, segment.index) : key;
+
+    // Stash the parent if it exists
+
+    var keys = [];
+    if (parent) {
+        // If we aren't using plain objects, optionally prefix keys
+        // that would overwrite object prototype properties
+        if (!options.plainObjects && has.call(Object.prototype, parent)) {
+            if (!options.allowPrototypes) {
+                return;
+            }
+        }
+
+        keys.push(parent);
+    }
+
+    // Loop through children appending to the array until we hit depth
+
+    var i = 0;
+    while ((segment = child.exec(key)) !== null && i < options.depth) {
+        i += 1;
+        if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
+            if (!options.allowPrototypes) {
+                return;
+            }
+        }
+        keys.push(segment[1]);
+    }
+
+    // If there's a remainder, just add whatever is left
+
+    if (segment) {
+        keys.push('[' + key.slice(segment.index) + ']');
+    }
+
+    return parseObject(keys, val, options);
+};
+
+module.exports = function (str, opts) {
+    var options = opts ? utils.assign({}, opts) : {};
+
+    if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') {
+        throw new TypeError('Decoder has to be a function.');
+    }
+
+    options.ignoreQueryPrefix = options.ignoreQueryPrefix === true;
+    options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter;
+    options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth;
+    options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit;
+    options.parseArrays = options.parseArrays !== false;
+    options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder;
+    options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots;
+    options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects;
+    options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes;
+    options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit;
+    options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
+
+    if (str === '' || str === null || typeof str === 'undefined') {
+        return options.plainObjects ? Object.create(null) : {};
+    }
+
+    var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
+    var obj = options.plainObjects ? Object.create(null) : {};
+
+    // Iterate over the keys and setup the new object
+
+    var keys = Object.keys(tempObj);
+    for (var i = 0; i < keys.length; ++i) {
+        var key = keys[i];
+        var newObj = parseKeys(key, tempObj[key], options);
+        obj = utils.merge(obj, newObj, options);
+    }
+
+    return utils.compact(obj);
+};
diff --git a/wrt/node_modules/qs/lib/stringify.js b/wrt/node_modules/qs/lib/stringify.js
new file mode 100644 (file)
index 0000000..036f18b
--- /dev/null
@@ -0,0 +1,210 @@
+'use strict';
+
+var utils = require('./utils');
+var formats = require('./formats');
+
+var arrayPrefixGenerators = {
+    brackets: function brackets(prefix) { // eslint-disable-line func-name-matching
+        return prefix + '[]';
+    },
+    indices: function indices(prefix, key) { // eslint-disable-line func-name-matching
+        return prefix + '[' + key + ']';
+    },
+    repeat: function repeat(prefix) { // eslint-disable-line func-name-matching
+        return prefix;
+    }
+};
+
+var toISO = Date.prototype.toISOString;
+
+var defaults = {
+    delimiter: '&',
+    encode: true,
+    encoder: utils.encode,
+    encodeValuesOnly: false,
+    serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching
+        return toISO.call(date);
+    },
+    skipNulls: false,
+    strictNullHandling: false
+};
+
+var stringify = function stringify( // eslint-disable-line func-name-matching
+    object,
+    prefix,
+    generateArrayPrefix,
+    strictNullHandling,
+    skipNulls,
+    encoder,
+    filter,
+    sort,
+    allowDots,
+    serializeDate,
+    formatter,
+    encodeValuesOnly
+) {
+    var obj = object;
+    if (typeof filter === 'function') {
+        obj = filter(prefix, obj);
+    } else if (obj instanceof Date) {
+        obj = serializeDate(obj);
+    } else if (obj === null) {
+        if (strictNullHandling) {
+            return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix;
+        }
+
+        obj = '';
+    }
+
+    if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) {
+        if (encoder) {
+            var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder);
+            return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))];
+        }
+        return [formatter(prefix) + '=' + formatter(String(obj))];
+    }
+
+    var values = [];
+
+    if (typeof obj === 'undefined') {
+        return values;
+    }
+
+    var objKeys;
+    if (Array.isArray(filter)) {
+        objKeys = filter;
+    } else {
+        var keys = Object.keys(obj);
+        objKeys = sort ? keys.sort(sort) : keys;
+    }
+
+    for (var i = 0; i < objKeys.length; ++i) {
+        var key = objKeys[i];
+
+        if (skipNulls && obj[key] === null) {
+            continue;
+        }
+
+        if (Array.isArray(obj)) {
+            values = values.concat(stringify(
+                obj[key],
+                generateArrayPrefix(prefix, key),
+                generateArrayPrefix,
+                strictNullHandling,
+                skipNulls,
+                encoder,
+                filter,
+                sort,
+                allowDots,
+                serializeDate,
+                formatter,
+                encodeValuesOnly
+            ));
+        } else {
+            values = values.concat(stringify(
+                obj[key],
+                prefix + (allowDots ? '.' + key : '[' + key + ']'),
+                generateArrayPrefix,
+                strictNullHandling,
+                skipNulls,
+                encoder,
+                filter,
+                sort,
+                allowDots,
+                serializeDate,
+                formatter,
+                encodeValuesOnly
+            ));
+        }
+    }
+
+    return values;
+};
+
+module.exports = function (object, opts) {
+    var obj = object;
+    var options = opts ? utils.assign({}, opts) : {};
+
+    if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') {
+        throw new TypeError('Encoder has to be a function.');
+    }
+
+    var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter;
+    var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
+    var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls;
+    var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode;
+    var encoder = typeof options.encoder === 'function' ? options.encoder : defaults.encoder;
+    var sort = typeof options.sort === 'function' ? options.sort : null;
+    var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots;
+    var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate;
+    var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults.encodeValuesOnly;
+    if (typeof options.format === 'undefined') {
+        options.format = formats.default;
+    } else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) {
+        throw new TypeError('Unknown format option provided.');
+    }
+    var formatter = formats.formatters[options.format];
+    var objKeys;
+    var filter;
+
+    if (typeof options.filter === 'function') {
+        filter = options.filter;
+        obj = filter('', obj);
+    } else if (Array.isArray(options.filter)) {
+        filter = options.filter;
+        objKeys = filter;
+    }
+
+    var keys = [];
+
+    if (typeof obj !== 'object' || obj === null) {
+        return '';
+    }
+
+    var arrayFormat;
+    if (options.arrayFormat in arrayPrefixGenerators) {
+        arrayFormat = options.arrayFormat;
+    } else if ('indices' in options) {
+        arrayFormat = options.indices ? 'indices' : 'repeat';
+    } else {
+        arrayFormat = 'indices';
+    }
+
+    var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
+
+    if (!objKeys) {
+        objKeys = Object.keys(obj);
+    }
+
+    if (sort) {
+        objKeys.sort(sort);
+    }
+
+    for (var i = 0; i < objKeys.length; ++i) {
+        var key = objKeys[i];
+
+        if (skipNulls && obj[key] === null) {
+            continue;
+        }
+
+        keys = keys.concat(stringify(
+            obj[key],
+            key,
+            generateArrayPrefix,
+            strictNullHandling,
+            skipNulls,
+            encode ? encoder : null,
+            filter,
+            sort,
+            allowDots,
+            serializeDate,
+            formatter,
+            encodeValuesOnly
+        ));
+    }
+
+    var joined = keys.join(delimiter);
+    var prefix = options.addQueryPrefix === true ? '?' : '';
+
+    return joined.length > 0 ? prefix + joined : '';
+};
diff --git a/wrt/node_modules/qs/lib/utils.js b/wrt/node_modules/qs/lib/utils.js
new file mode 100644 (file)
index 0000000..9be00de
--- /dev/null
@@ -0,0 +1,192 @@
+'use strict';
+
+var has = Object.prototype.hasOwnProperty;
+
+var hexTable = (function () {
+    var array = [];
+    for (var i = 0; i < 256; ++i) {
+        array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
+    }
+
+    return array;
+}());
+
+exports.arrayToObject = function (source, options) {
+    var obj = options && options.plainObjects ? Object.create(null) : {};
+    for (var i = 0; i < source.length; ++i) {
+        if (typeof source[i] !== 'undefined') {
+            obj[i] = source[i];
+        }
+    }
+
+    return obj;
+};
+
+exports.merge = function (target, source, options) {
+    if (!source) {
+        return target;
+    }
+
+    if (typeof source !== 'object') {
+        if (Array.isArray(target)) {
+            target.push(source);
+        } else if (typeof target === 'object') {
+            if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) {
+                target[source] = true;
+            }
+        } else {
+            return [target, source];
+        }
+
+        return target;
+    }
+
+    if (typeof target !== 'object') {
+        return [target].concat(source);
+    }
+
+    var mergeTarget = target;
+    if (Array.isArray(target) && !Array.isArray(source)) {
+        mergeTarget = exports.arrayToObject(target, options);
+    }
+
+    if (Array.isArray(target) && Array.isArray(source)) {
+        source.forEach(function (item, i) {
+            if (has.call(target, i)) {
+                if (target[i] && typeof target[i] === 'object') {
+                    target[i] = exports.merge(target[i], item, options);
+                } else {
+                    target.push(item);
+                }
+            } else {
+                target[i] = item;
+            }
+        });
+        return target;
+    }
+
+    return Object.keys(source).reduce(function (acc, key) {
+        var value = source[key];
+
+        if (has.call(acc, key)) {
+            acc[key] = exports.merge(acc[key], value, options);
+        } else {
+            acc[key] = value;
+        }
+        return acc;
+    }, mergeTarget);
+};
+
+exports.assign = function assignSingleSource(target, source) {
+    return Object.keys(source).reduce(function (acc, key) {
+        acc[key] = source[key];
+        return acc;
+    }, target);
+};
+
+exports.decode = function (str) {
+    try {
+        return decodeURIComponent(str.replace(/\+/g, ' '));
+    } catch (e) {
+        return str;
+    }
+};
+
+exports.encode = function (str) {
+    // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
+    // It has been adapted here for stricter adherence to RFC 3986
+    if (str.length === 0) {
+        return str;
+    }
+
+    var string = typeof str === 'string' ? str : String(str);
+
+    var out = '';
+    for (var i = 0; i < string.length; ++i) {
+        var c = string.charCodeAt(i);
+
+        if (
+            c === 0x2D    // -
+            || c === 0x2E // .
+            || c === 0x5F // _
+            || c === 0x7E // ~
+            || (c >= 0x30 && c <= 0x39) // 0-9
+            || (c >= 0x41 && c <= 0x5A) // a-z
+            || (c >= 0x61 && c <= 0x7A) // A-Z
+        ) {
+            out += string.charAt(i);
+            continue;
+        }
+
+        if (c < 0x80) {
+            out = out + hexTable[c];
+            continue;
+        }
+
+        if (c < 0x800) {
+            out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
+            continue;
+        }
+
+        if (c < 0xD800 || c >= 0xE000) {
+            out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
+            continue;
+        }
+
+        i += 1;
+        c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
+        out += hexTable[0xF0 | (c >> 18)]
+            + hexTable[0x80 | ((c >> 12) & 0x3F)]
+            + hexTable[0x80 | ((c >> 6) & 0x3F)]
+            + hexTable[0x80 | (c & 0x3F)];
+    }
+
+    return out;
+};
+
+exports.compact = function (obj, references) {
+    if (typeof obj !== 'object' || obj === null) {
+        return obj;
+    }
+
+    var refs = references || [];
+    var lookup = refs.indexOf(obj);
+    if (lookup !== -1) {
+        return refs[lookup];
+    }
+
+    refs.push(obj);
+
+    if (Array.isArray(obj)) {
+        var compacted = [];
+
+        for (var i = 0; i < obj.length; ++i) {
+            if (obj[i] && typeof obj[i] === 'object') {
+                compacted.push(exports.compact(obj[i], refs));
+            } else if (typeof obj[i] !== 'undefined') {
+                compacted.push(obj[i]);
+            }
+        }
+
+        return compacted;
+    }
+
+    var keys = Object.keys(obj);
+    keys.forEach(function (key) {
+        obj[key] = exports.compact(obj[key], refs);
+    });
+
+    return obj;
+};
+
+exports.isRegExp = function (obj) {
+    return Object.prototype.toString.call(obj) === '[object RegExp]';
+};
+
+exports.isBuffer = function (obj) {
+    if (obj === null || typeof obj === 'undefined') {
+        return false;
+    }
+
+    return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
+};
diff --git a/wrt/node_modules/qs/package.json b/wrt/node_modules/qs/package.json
new file mode 100644 (file)
index 0000000..2b7427c
--- /dev/null
@@ -0,0 +1,123 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "qs@6.5.0",
+        "scope": null,
+        "escapedName": "qs",
+        "name": "qs",
+        "rawSpec": "6.5.0",
+        "spec": "6.5.0",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express"
+    ]
+  ],
+  "_from": "qs@6.5.0",
+  "_id": "qs@6.5.0",
+  "_inCache": true,
+  "_location": "/qs",
+  "_nodeVersion": "8.1.2",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/qs-6.5.0.tgz_1498633673933_0.663175018504262"
+  },
+  "_npmUser": {
+    "name": "ljharb",
+    "email": "ljharb@gmail.com"
+  },
+  "_npmVersion": "5.0.3",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "qs@6.5.0",
+    "scope": null,
+    "escapedName": "qs",
+    "name": "qs",
+    "rawSpec": "6.5.0",
+    "spec": "6.5.0",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/express"
+  ],
+  "_resolved": "https://registry.npmjs.org/qs/-/qs-6.5.0.tgz",
+  "_shasum": "8d04954d364def3efc55b5a0793e1e2c8b1e6e49",
+  "_shrinkwrap": null,
+  "_spec": "qs@6.5.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express",
+  "bugs": {
+    "url": "https://github.com/ljharb/qs/issues"
+  },
+  "contributors": [
+    {
+      "name": "Jordan Harband",
+      "email": "ljharb@gmail.com",
+      "url": "http://ljharb.codes"
+    }
+  ],
+  "dependencies": {},
+  "description": "A querystring parser that supports nesting and arrays, with a depth limit",
+  "devDependencies": {
+    "@ljharb/eslint-config": "^11.0.0",
+    "browserify": "^14.4.0",
+    "covert": "^1.1.0",
+    "editorconfig-tools": "^0.1.1",
+    "eslint": "^3.19.0",
+    "evalmd": "^0.0.17",
+    "iconv-lite": "^0.4.18",
+    "mkdirp": "^0.5.1",
+    "qs-iconv": "^1.0.4",
+    "safe-publish-latest": "^1.1.1",
+    "tape": "^4.7.0"
+  },
+  "directories": {},
+  "dist": {
+    "integrity": "sha512-fjVFjW9yhqMhVGwRExCXLhJKrLlkYSaxNWdyc9rmHlrVZbk35YHH312dFd7191uQeXkI3mKLZTIbSvIeFwFemg==",
+    "shasum": "8d04954d364def3efc55b5a0793e1e2c8b1e6e49",
+    "tarball": "https://registry.npmjs.org/qs/-/qs-6.5.0.tgz"
+  },
+  "engines": {
+    "node": ">=0.6"
+  },
+  "gitHead": "d66ac175bbf8afa44b41c2c85b04ae00bac7c916",
+  "homepage": "https://github.com/ljharb/qs",
+  "keywords": [
+    "querystring",
+    "qs"
+  ],
+  "license": "BSD-3-Clause",
+  "main": "lib/index.js",
+  "maintainers": [
+    {
+      "name": "ljharb",
+      "email": "ljharb@gmail.com"
+    },
+    {
+      "name": "hueniverse",
+      "email": "eran@hammer.io"
+    },
+    {
+      "name": "nlf",
+      "email": "quitlahok@gmail.com"
+    }
+  ],
+  "name": "qs",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/ljharb/qs.git"
+  },
+  "scripts": {
+    "coverage": "covert test",
+    "dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js",
+    "lint": "eslint lib/*.js test/*.js",
+    "prelint": "editorconfig-tools check * lib/* test/*",
+    "prepublish": "safe-publish-latest && npm run dist",
+    "pretest": "npm run --silent readme && npm run --silent lint",
+    "readme": "evalmd README.md",
+    "test": "npm run --silent coverage",
+    "tests-only": "node test"
+  },
+  "version": "6.5.0"
+}
diff --git a/wrt/node_modules/qs/test/.eslintrc b/wrt/node_modules/qs/test/.eslintrc
new file mode 100644 (file)
index 0000000..c4f52d0
--- /dev/null
@@ -0,0 +1,11 @@
+{
+    "rules": {
+               "consistent-return": 2,
+        "max-lines": 0,
+        "max-nested-callbacks": [2, 3],
+        "max-statements": 0,
+        "no-extend-native": 0,
+        "no-magic-numbers": 0,
+        "sort-keys": 0
+    }
+}
diff --git a/wrt/node_modules/qs/test/index.js b/wrt/node_modules/qs/test/index.js
new file mode 100644 (file)
index 0000000..5e6bc8f
--- /dev/null
@@ -0,0 +1,7 @@
+'use strict';
+
+require('./parse');
+
+require('./stringify');
+
+require('./utils');
diff --git a/wrt/node_modules/qs/test/parse.js b/wrt/node_modules/qs/test/parse.js
new file mode 100644 (file)
index 0000000..a4b2418
--- /dev/null
@@ -0,0 +1,546 @@
+'use strict';
+
+var test = require('tape');
+var qs = require('../');
+var utils = require('../lib/utils');
+var iconv = require('iconv-lite');
+
+test('parse()', function (t) {
+    t.test('parses a simple string', function (st) {
+        st.deepEqual(qs.parse('0=foo'), { 0: 'foo' });
+        st.deepEqual(qs.parse('foo=c++'), { foo: 'c  ' });
+        st.deepEqual(qs.parse('a[>=]=23'), { a: { '>=': '23' } });
+        st.deepEqual(qs.parse('a[<=>]==23'), { a: { '<=>': '=23' } });
+        st.deepEqual(qs.parse('a[==]=23'), { a: { '==': '23' } });
+        st.deepEqual(qs.parse('foo', { strictNullHandling: true }), { foo: null });
+        st.deepEqual(qs.parse('foo'), { foo: '' });
+        st.deepEqual(qs.parse('foo='), { foo: '' });
+        st.deepEqual(qs.parse('foo=bar'), { foo: 'bar' });
+        st.deepEqual(qs.parse(' foo = bar = baz '), { ' foo ': ' bar = baz ' });
+        st.deepEqual(qs.parse('foo=bar=baz'), { foo: 'bar=baz' });
+        st.deepEqual(qs.parse('foo=bar&bar=baz'), { foo: 'bar', bar: 'baz' });
+        st.deepEqual(qs.parse('foo2=bar2&baz2='), { foo2: 'bar2', baz2: '' });
+        st.deepEqual(qs.parse('foo=bar&baz', { strictNullHandling: true }), { foo: 'bar', baz: null });
+        st.deepEqual(qs.parse('foo=bar&baz'), { foo: 'bar', baz: '' });
+        st.deepEqual(qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World'), {
+            cht: 'p3',
+            chd: 't:60,40',
+            chs: '250x100',
+            chl: 'Hello|World'
+        });
+        st.end();
+    });
+
+    t.test('allows enabling dot notation', function (st) {
+        st.deepEqual(qs.parse('a.b=c'), { 'a.b': 'c' });
+        st.deepEqual(qs.parse('a.b=c', { allowDots: true }), { a: { b: 'c' } });
+        st.end();
+    });
+
+    t.deepEqual(qs.parse('a[b]=c'), { a: { b: 'c' } }, 'parses a single nested string');
+    t.deepEqual(qs.parse('a[b][c]=d'), { a: { b: { c: 'd' } } }, 'parses a double nested string');
+    t.deepEqual(
+        qs.parse('a[b][c][d][e][f][g][h]=i'),
+        { a: { b: { c: { d: { e: { f: { '[g][h]': 'i' } } } } } } },
+        'defaults to a depth of 5'
+    );
+
+    t.test('only parses one level when depth = 1', function (st) {
+        st.deepEqual(qs.parse('a[b][c]=d', { depth: 1 }), { a: { b: { '[c]': 'd' } } });
+        st.deepEqual(qs.parse('a[b][c][d]=e', { depth: 1 }), { a: { b: { '[c][d]': 'e' } } });
+        st.end();
+    });
+
+    t.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] }, 'parses a simple array');
+
+    t.test('parses an explicit array', function (st) {
+        st.deepEqual(qs.parse('a[]=b'), { a: ['b'] });
+        st.deepEqual(qs.parse('a[]=b&a[]=c'), { a: ['b', 'c'] });
+        st.deepEqual(qs.parse('a[]=b&a[]=c&a[]=d'), { a: ['b', 'c', 'd'] });
+        st.end();
+    });
+
+    t.test('parses a mix of simple and explicit arrays', function (st) {
+        st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] });
+        st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] });
+        st.deepEqual(qs.parse('a[0]=b&a=c'), { a: ['b', 'c'] });
+        st.deepEqual(qs.parse('a=b&a[0]=c'), { a: ['b', 'c'] });
+
+        st.deepEqual(qs.parse('a[1]=b&a=c', { arrayLimit: 20 }), { a: ['b', 'c'] });
+        st.deepEqual(qs.parse('a[]=b&a=c', { arrayLimit: 0 }), { a: ['b', 'c'] });
+        st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] });
+
+        st.deepEqual(qs.parse('a=b&a[1]=c', { arrayLimit: 20 }), { a: ['b', 'c'] });
+        st.deepEqual(qs.parse('a=b&a[]=c', { arrayLimit: 0 }), { a: ['b', 'c'] });
+        st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] });
+
+        st.end();
+    });
+
+    t.test('parses a nested array', function (st) {
+        st.deepEqual(qs.parse('a[b][]=c&a[b][]=d'), { a: { b: ['c', 'd'] } });
+        st.deepEqual(qs.parse('a[>=]=25'), { a: { '>=': '25' } });
+        st.end();
+    });
+
+    t.test('allows to specify array indices', function (st) {
+        st.deepEqual(qs.parse('a[1]=c&a[0]=b&a[2]=d'), { a: ['b', 'c', 'd'] });
+        st.deepEqual(qs.parse('a[1]=c&a[0]=b'), { a: ['b', 'c'] });
+        st.deepEqual(qs.parse('a[1]=c', { arrayLimit: 20 }), { a: ['c'] });
+        st.deepEqual(qs.parse('a[1]=c', { arrayLimit: 0 }), { a: { 1: 'c' } });
+        st.deepEqual(qs.parse('a[1]=c'), { a: ['c'] });
+        st.end();
+    });
+
+    t.test('limits specific array indices to arrayLimit', function (st) {
+        st.deepEqual(qs.parse('a[20]=a', { arrayLimit: 20 }), { a: ['a'] });
+        st.deepEqual(qs.parse('a[21]=a', { arrayLimit: 20 }), { a: { 21: 'a' } });
+        st.end();
+    });
+
+    t.deepEqual(qs.parse('a[12b]=c'), { a: { '12b': 'c' } }, 'supports keys that begin with a number');
+
+    t.test('supports encoded = signs', function (st) {
+        st.deepEqual(qs.parse('he%3Dllo=th%3Dere'), { 'he=llo': 'th=ere' });
+        st.end();
+    });
+
+    t.test('is ok with url encoded strings', function (st) {
+        st.deepEqual(qs.parse('a[b%20c]=d'), { a: { 'b c': 'd' } });
+        st.deepEqual(qs.parse('a[b]=c%20d'), { a: { b: 'c d' } });
+        st.end();
+    });
+
+    t.test('allows brackets in the value', function (st) {
+        st.deepEqual(qs.parse('pets=["tobi"]'), { pets: '["tobi"]' });
+        st.deepEqual(qs.parse('operators=[">=", "<="]'), { operators: '[">=", "<="]' });
+        st.end();
+    });
+
+    t.test('allows empty values', function (st) {
+        st.deepEqual(qs.parse(''), {});
+        st.deepEqual(qs.parse(null), {});
+        st.deepEqual(qs.parse(undefined), {});
+        st.end();
+    });
+
+    t.test('transforms arrays to objects', function (st) {
+        st.deepEqual(qs.parse('foo[0]=bar&foo[bad]=baz'), { foo: { 0: 'bar', bad: 'baz' } });
+        st.deepEqual(qs.parse('foo[bad]=baz&foo[0]=bar'), { foo: { bad: 'baz', 0: 'bar' } });
+        st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar'), { foo: { bad: 'baz', 0: 'bar' } });
+        st.deepEqual(qs.parse('foo[]=bar&foo[bad]=baz'), { foo: { 0: 'bar', bad: 'baz' } });
+        st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar&foo[]=foo'), { foo: { bad: 'baz', 0: 'bar', 1: 'foo' } });
+        st.deepEqual(qs.parse('foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb'), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] });
+
+        st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: false }), { a: { 0: 'b', t: 'u' } });
+        st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: true }), { a: { 0: 'b', t: 'u', hasOwnProperty: 'c' } });
+        st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: false }), { a: { 0: 'b', x: 'y' } });
+        st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: true }), { a: { 0: 'b', hasOwnProperty: 'c', x: 'y' } });
+        st.end();
+    });
+
+    t.test('transforms arrays to objects (dot notation)', function (st) {
+        st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: 'baz' } });
+        st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad.boo=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: { boo: 'baz' } } });
+        st.deepEqual(qs.parse('foo[0][0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [[{ baz: 'bar' }]], fool: { bad: 'baz' } });
+        st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15'], bar: '2' }] });
+        st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].baz[1]=16&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15', '16'], bar: '2' }] });
+        st.deepEqual(qs.parse('foo.bad=baz&foo[0]=bar', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar' } });
+        st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar' } });
+        st.deepEqual(qs.parse('foo[]=bar&foo.bad=baz', { allowDots: true }), { foo: { 0: 'bar', bad: 'baz' } });
+        st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar&foo[]=foo', { allowDots: true }), { foo: { bad: 'baz', 0: 'bar', 1: 'foo' } });
+        st.deepEqual(qs.parse('foo[0].a=a&foo[0].b=b&foo[1].a=aa&foo[1].b=bb', { allowDots: true }), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] });
+        st.end();
+    });
+
+    t.test('correctly prunes undefined values when converting an array to an object', function (st) {
+        st.deepEqual(qs.parse('a[2]=b&a[99999999]=c'), { a: { 2: 'b', 99999999: 'c' } });
+        st.end();
+    });
+
+    t.test('supports malformed uri characters', function (st) {
+        st.deepEqual(qs.parse('{%:%}', { strictNullHandling: true }), { '{%:%}': null });
+        st.deepEqual(qs.parse('{%:%}='), { '{%:%}': '' });
+        st.deepEqual(qs.parse('foo=%:%}'), { foo: '%:%}' });
+        st.end();
+    });
+
+    t.test('doesn\'t produce empty keys', function (st) {
+        st.deepEqual(qs.parse('_r=1&'), { _r: '1' });
+        st.end();
+    });
+
+    t.test('cannot access Object prototype', function (st) {
+        qs.parse('constructor[prototype][bad]=bad');
+        qs.parse('bad[constructor][prototype][bad]=bad');
+        st.equal(typeof Object.prototype.bad, 'undefined');
+        st.end();
+    });
+
+    t.test('parses arrays of objects', function (st) {
+        st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] });
+        st.deepEqual(qs.parse('a[0][b]=c'), { a: [{ b: 'c' }] });
+        st.end();
+    });
+
+    t.test('allows for empty strings in arrays', function (st) {
+        st.deepEqual(qs.parse('a[]=b&a[]=&a[]=c'), { a: ['b', '', 'c'] });
+
+        st.deepEqual(
+            qs.parse('a[0]=b&a[1]&a[2]=c&a[19]=', { strictNullHandling: true, arrayLimit: 20 }),
+            { a: ['b', null, 'c', ''] },
+            'with arrayLimit 20 + array indices: null then empty string works'
+        );
+        st.deepEqual(
+            qs.parse('a[]=b&a[]&a[]=c&a[]=', { strictNullHandling: true, arrayLimit: 0 }),
+            { a: ['b', null, 'c', ''] },
+            'with arrayLimit 0 + array brackets: null then empty string works'
+        );
+
+        st.deepEqual(
+            qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]', { strictNullHandling: true, arrayLimit: 20 }),
+            { a: ['b', '', 'c', null] },
+            'with arrayLimit 20 + array indices: empty string then null works'
+        );
+        st.deepEqual(
+            qs.parse('a[]=b&a[]=&a[]=c&a[]', { strictNullHandling: true, arrayLimit: 0 }),
+            { a: ['b', '', 'c', null] },
+            'with arrayLimit 0 + array brackets: empty string then null works'
+        );
+
+        st.deepEqual(
+            qs.parse('a[]=&a[]=b&a[]=c'),
+            { a: ['', 'b', 'c'] },
+            'array brackets: empty strings work'
+        );
+        st.end();
+    });
+
+    t.test('compacts sparse arrays', function (st) {
+        st.deepEqual(qs.parse('a[10]=1&a[2]=2', { arrayLimit: 20 }), { a: ['2', '1'] });
+        st.deepEqual(qs.parse('a[1][b][2][c]=1', { arrayLimit: 20 }), { a: [{ b: [{ c: '1' }] }] });
+        st.deepEqual(qs.parse('a[1][2][3][c]=1', { arrayLimit: 20 }), { a: [[[{ c: '1' }]]] });
+        st.deepEqual(qs.parse('a[1][2][3][c][1]=1', { arrayLimit: 20 }), { a: [[[{ c: ['1'] }]]] });
+        st.end();
+    });
+
+    t.test('parses semi-parsed strings', function (st) {
+        st.deepEqual(qs.parse({ 'a[b]': 'c' }), { a: { b: 'c' } });
+        st.deepEqual(qs.parse({ 'a[b]': 'c', 'a[d]': 'e' }), { a: { b: 'c', d: 'e' } });
+        st.end();
+    });
+
+    t.test('parses buffers correctly', function (st) {
+        var b = new Buffer('test');
+        st.deepEqual(qs.parse({ a: b }), { a: b });
+        st.end();
+    });
+
+    t.test('continues parsing when no parent is found', function (st) {
+        st.deepEqual(qs.parse('[]=&a=b'), { 0: '', a: 'b' });
+        st.deepEqual(qs.parse('[]&a=b', { strictNullHandling: true }), { 0: null, a: 'b' });
+        st.deepEqual(qs.parse('[foo]=bar'), { foo: 'bar' });
+        st.end();
+    });
+
+    t.test('does not error when parsing a very long array', function (st) {
+        var str = 'a[]=a';
+        while (Buffer.byteLength(str) < 128 * 1024) {
+            str = str + '&' + str;
+        }
+
+        st.doesNotThrow(function () {
+            qs.parse(str);
+        });
+
+        st.end();
+    });
+
+    t.test('should not throw when a native prototype has an enumerable property', { parallel: false }, function (st) {
+        Object.prototype.crash = '';
+        Array.prototype.crash = '';
+        st.doesNotThrow(qs.parse.bind(null, 'a=b'));
+        st.deepEqual(qs.parse('a=b'), { a: 'b' });
+        st.doesNotThrow(qs.parse.bind(null, 'a[][b]=c'));
+        st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] });
+        delete Object.prototype.crash;
+        delete Array.prototype.crash;
+        st.end();
+    });
+
+    t.test('parses a string with an alternative string delimiter', function (st) {
+        st.deepEqual(qs.parse('a=b;c=d', { delimiter: ';' }), { a: 'b', c: 'd' });
+        st.end();
+    });
+
+    t.test('parses a string with an alternative RegExp delimiter', function (st) {
+        st.deepEqual(qs.parse('a=b; c=d', { delimiter: /[;,] */ }), { a: 'b', c: 'd' });
+        st.end();
+    });
+
+    t.test('does not use non-splittable objects as delimiters', function (st) {
+        st.deepEqual(qs.parse('a=b&c=d', { delimiter: true }), { a: 'b', c: 'd' });
+        st.end();
+    });
+
+    t.test('allows overriding parameter limit', function (st) {
+        st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: 1 }), { a: 'b' });
+        st.end();
+    });
+
+    t.test('allows setting the parameter limit to Infinity', function (st) {
+        st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: Infinity }), { a: 'b', c: 'd' });
+        st.end();
+    });
+
+    t.test('allows overriding array limit', function (st) {
+        st.deepEqual(qs.parse('a[0]=b', { arrayLimit: -1 }), { a: { 0: 'b' } });
+        st.deepEqual(qs.parse('a[-1]=b', { arrayLimit: -1 }), { a: { '-1': 'b' } });
+        st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayLimit: 0 }), { a: { 0: 'b', 1: 'c' } });
+        st.end();
+    });
+
+    t.test('allows disabling array parsing', function (st) {
+        st.deepEqual(qs.parse('a[0]=b&a[1]=c', { parseArrays: false }), { a: { 0: 'b', 1: 'c' } });
+        st.end();
+    });
+
+    t.test('allows for query string prefix', function (st) {
+        st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' });
+        st.deepEqual(qs.parse('foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' });
+        st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: false }), { '?foo': 'bar' });
+        st.end();
+    });
+
+    t.test('parses an object', function (st) {
+        var input = {
+            'user[name]': { 'pop[bob]': 3 },
+            'user[email]': null
+        };
+
+        var expected = {
+            user: {
+                name: { 'pop[bob]': 3 },
+                email: null
+            }
+        };
+
+        var result = qs.parse(input);
+
+        st.deepEqual(result, expected);
+        st.end();
+    });
+
+    t.test('parses an object in dot notation', function (st) {
+        var input = {
+            'user.name': { 'pop[bob]': 3 },
+            'user.email.': null
+        };
+
+        var expected = {
+            user: {
+                name: { 'pop[bob]': 3 },
+                email: null
+            }
+        };
+
+        var result = qs.parse(input, { allowDots: true });
+
+        st.deepEqual(result, expected);
+        st.end();
+    });
+
+    t.test('parses an object and not child values', function (st) {
+        var input = {
+            'user[name]': { 'pop[bob]': { test: 3 } },
+            'user[email]': null
+        };
+
+        var expected = {
+            user: {
+                name: { 'pop[bob]': { test: 3 } },
+                email: null
+            }
+        };
+
+        var result = qs.parse(input);
+
+        st.deepEqual(result, expected);
+        st.end();
+    });
+
+    t.test('does not blow up when Buffer global is missing', function (st) {
+        var tempBuffer = global.Buffer;
+        delete global.Buffer;
+        var result = qs.parse('a=b&c=d');
+        global.Buffer = tempBuffer;
+        st.deepEqual(result, { a: 'b', c: 'd' });
+        st.end();
+    });
+
+    t.test('does not crash when parsing circular references', function (st) {
+        var a = {};
+        a.b = a;
+
+        var parsed;
+
+        st.doesNotThrow(function () {
+            parsed = qs.parse({ 'foo[bar]': 'baz', 'foo[baz]': a });
+        });
+
+        st.equal('foo' in parsed, true, 'parsed has "foo" property');
+        st.equal('bar' in parsed.foo, true);
+        st.equal('baz' in parsed.foo, true);
+        st.equal(parsed.foo.bar, 'baz');
+        st.deepEqual(parsed.foo.baz, a);
+        st.end();
+    });
+
+    t.test('parses null objects correctly', { skip: !Object.create }, function (st) {
+        var a = Object.create(null);
+        a.b = 'c';
+
+        st.deepEqual(qs.parse(a), { b: 'c' });
+        var result = qs.parse({ a: a });
+        st.equal('a' in result, true, 'result has "a" property');
+        st.deepEqual(result.a, a);
+        st.end();
+    });
+
+    t.test('parses dates correctly', function (st) {
+        var now = new Date();
+        st.deepEqual(qs.parse({ a: now }), { a: now });
+        st.end();
+    });
+
+    t.test('parses regular expressions correctly', function (st) {
+        var re = /^test$/;
+        st.deepEqual(qs.parse({ a: re }), { a: re });
+        st.end();
+    });
+
+    t.test('does not allow overwriting prototype properties', function (st) {
+        st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: false }), {});
+        st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: false }), {});
+
+        st.deepEqual(
+            qs.parse('toString', { allowPrototypes: false }),
+            {},
+            'bare "toString" results in {}'
+        );
+
+        st.end();
+    });
+
+    t.test('can allow overwriting prototype properties', function (st) {
+        st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }), { a: { hasOwnProperty: 'b' } });
+        st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: true }), { hasOwnProperty: 'b' });
+
+        st.deepEqual(
+            qs.parse('toString', { allowPrototypes: true }),
+            { toString: '' },
+            'bare "toString" results in { toString: "" }'
+        );
+
+        st.end();
+    });
+
+    t.test('params starting with a closing bracket', function (st) {
+        st.deepEqual(qs.parse(']=toString'), { ']': 'toString' });
+        st.deepEqual(qs.parse(']]=toString'), { ']]': 'toString' });
+        st.deepEqual(qs.parse(']hello]=toString'), { ']hello]': 'toString' });
+        st.end();
+    });
+
+    t.test('params starting with a starting bracket', function (st) {
+        st.deepEqual(qs.parse('[=toString'), { '[': 'toString' });
+        st.deepEqual(qs.parse('[[=toString'), { '[[': 'toString' });
+        st.deepEqual(qs.parse('[hello[=toString'), { '[hello[': 'toString' });
+        st.end();
+    });
+
+    t.test('add keys to objects', function (st) {
+        st.deepEqual(
+            qs.parse('a[b]=c&a=d'),
+            { a: { b: 'c', d: true } },
+            'can add keys to objects'
+        );
+
+        st.deepEqual(
+            qs.parse('a[b]=c&a=toString'),
+            { a: { b: 'c' } },
+            'can not overwrite prototype'
+        );
+
+        st.deepEqual(
+            qs.parse('a[b]=c&a=toString', { allowPrototypes: true }),
+            { a: { b: 'c', toString: true } },
+            'can overwrite prototype with allowPrototypes true'
+        );
+
+        st.deepEqual(
+            qs.parse('a[b]=c&a=toString', { plainObjects: true }),
+            { a: { b: 'c', toString: true } },
+            'can overwrite prototype with plainObjects true'
+        );
+
+        st.end();
+    });
+
+    t.test('can return null objects', { skip: !Object.create }, function (st) {
+        var expected = Object.create(null);
+        expected.a = Object.create(null);
+        expected.a.b = 'c';
+        expected.a.hasOwnProperty = 'd';
+        st.deepEqual(qs.parse('a[b]=c&a[hasOwnProperty]=d', { plainObjects: true }), expected);
+        st.deepEqual(qs.parse(null, { plainObjects: true }), Object.create(null));
+        var expectedArray = Object.create(null);
+        expectedArray.a = Object.create(null);
+        expectedArray.a[0] = 'b';
+        expectedArray.a.c = 'd';
+        st.deepEqual(qs.parse('a[]=b&a[c]=d', { plainObjects: true }), expectedArray);
+        st.end();
+    });
+
+    t.test('can parse with custom encoding', function (st) {
+        st.deepEqual(qs.parse('%8c%a7=%91%e5%8d%e3%95%7b', {
+            decoder: function (str) {
+                var reg = /%([0-9A-F]{2})/ig;
+                var result = [];
+                var parts = reg.exec(str);
+                while (parts) {
+                    result.push(parseInt(parts[1], 16));
+                    parts = reg.exec(str);
+                }
+                return iconv.decode(new Buffer(result), 'shift_jis').toString();
+            }
+        }), { 県: '大阪府' });
+        st.end();
+    });
+
+    t.test('receives the default decoder as a second argument', function (st) {
+        st.plan(1);
+        qs.parse('a', {
+            decoder: function (str, defaultDecoder) {
+                st.equal(defaultDecoder, utils.decode);
+            }
+        });
+        st.end();
+    });
+
+    t.test('throws error with wrong decoder', function (st) {
+        st.throws(function () {
+            qs.parse({}, { decoder: 'string' });
+        }, new TypeError('Decoder has to be a function.'));
+        st.end();
+    });
+
+    t.test('does not mutate the options argument', function (st) {
+        var options = {};
+        qs.parse('a[b]=true', options);
+        st.deepEqual(options, {});
+        st.end();
+    });
+
+    t.end();
+});
diff --git a/wrt/node_modules/qs/test/stringify.js b/wrt/node_modules/qs/test/stringify.js
new file mode 100644 (file)
index 0000000..537872c
--- /dev/null
@@ -0,0 +1,596 @@
+'use strict';
+
+var test = require('tape');
+var qs = require('../');
+var utils = require('../lib/utils');
+var iconv = require('iconv-lite');
+
+test('stringify()', function (t) {
+    t.test('stringifies a querystring object', function (st) {
+        st.equal(qs.stringify({ a: 'b' }), 'a=b');
+        st.equal(qs.stringify({ a: 1 }), 'a=1');
+        st.equal(qs.stringify({ a: 1, b: 2 }), 'a=1&b=2');
+        st.equal(qs.stringify({ a: 'A_Z' }), 'a=A_Z');
+        st.equal(qs.stringify({ a: '€' }), 'a=%E2%82%AC');
+        st.equal(qs.stringify({ a: '' }), 'a=%EE%80%80');
+        st.equal(qs.stringify({ a: 'א' }), 'a=%D7%90');
+        st.equal(qs.stringify({ a: '𐐷' }), 'a=%F0%90%90%B7');
+        st.end();
+    });
+
+    t.test('adds query prefix', function (st) {
+        st.equal(qs.stringify({ a: 'b' }, { addQueryPrefix: true }), '?a=b');
+        st.end();
+    });
+
+    t.test('with query prefix, outputs blank string given an empty object', function (st) {
+        st.equal(qs.stringify({}, { addQueryPrefix: true }), '');
+        st.end();
+    });
+
+    t.test('stringifies a nested object', function (st) {
+        st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c');
+        st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }), 'a%5Bb%5D%5Bc%5D%5Bd%5D=e');
+        st.end();
+    });
+
+    t.test('stringifies a nested object with dots notation', function (st) {
+        st.equal(qs.stringify({ a: { b: 'c' } }, { allowDots: true }), 'a.b=c');
+        st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }, { allowDots: true }), 'a.b.c.d=e');
+        st.end();
+    });
+
+    t.test('stringifies an array value', function (st) {
+        st.equal(
+            qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'indices' }),
+            'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d',
+            'indices => indices'
+        );
+        st.equal(
+            qs.stringify({ a: ['b', 'c', 'd'] }, { arrayFormat: 'brackets' }),
+            'a%5B%5D=b&a%5B%5D=c&a%5B%5D=d',
+            'brackets => brackets'
+        );
+        st.equal(
+            qs.stringify({ a: ['b', 'c', 'd'] }),
+            'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d',
+            'default => indices'
+        );
+        st.end();
+    });
+
+    t.test('omits nulls when asked', function (st) {
+        st.equal(qs.stringify({ a: 'b', c: null }, { skipNulls: true }), 'a=b');
+        st.end();
+    });
+
+    t.test('omits nested nulls when asked', function (st) {
+        st.equal(qs.stringify({ a: { b: 'c', d: null } }, { skipNulls: true }), 'a%5Bb%5D=c');
+        st.end();
+    });
+
+    t.test('omits array indices when asked', function (st) {
+        st.equal(qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }), 'a=b&a=c&a=d');
+        st.end();
+    });
+
+    t.test('stringifies a nested array value', function (st) {
+        st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { arrayFormat: 'indices' }), 'a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d');
+        st.equal(qs.stringify({ a: { b: ['c', 'd'] } }, { arrayFormat: 'brackets' }), 'a%5Bb%5D%5B%5D=c&a%5Bb%5D%5B%5D=d');
+        st.equal(qs.stringify({ a: { b: ['c', 'd'] } }), 'a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d');
+        st.end();
+    });
+
+    t.test('stringifies a nested array value with dots notation', function (st) {
+        st.equal(
+            qs.stringify(
+                { a: { b: ['c', 'd'] } },
+                { allowDots: true, encode: false, arrayFormat: 'indices' }
+            ),
+            'a.b[0]=c&a.b[1]=d',
+            'indices: stringifies with dots + indices'
+        );
+        st.equal(
+            qs.stringify(
+                { a: { b: ['c', 'd'] } },
+                { allowDots: true, encode: false, arrayFormat: 'brackets' }
+            ),
+            'a.b[]=c&a.b[]=d',
+            'brackets: stringifies with dots + brackets'
+        );
+        st.equal(
+            qs.stringify(
+                { a: { b: ['c', 'd'] } },
+                { allowDots: true, encode: false }
+            ),
+            'a.b[0]=c&a.b[1]=d',
+            'default: stringifies with dots + indices'
+        );
+        st.end();
+    });
+
+    t.test('stringifies an object inside an array', function (st) {
+        st.equal(
+            qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'indices' }),
+            'a%5B0%5D%5Bb%5D=c',
+            'indices => brackets'
+        );
+        st.equal(
+            qs.stringify({ a: [{ b: 'c' }] }, { arrayFormat: 'brackets' }),
+            'a%5B%5D%5Bb%5D=c',
+            'brackets => brackets'
+        );
+        st.equal(
+            qs.stringify({ a: [{ b: 'c' }] }),
+            'a%5B0%5D%5Bb%5D=c',
+            'default => indices'
+        );
+
+        st.equal(
+            qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'indices' }),
+            'a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1',
+            'indices => indices'
+        );
+
+        st.equal(
+            qs.stringify({ a: [{ b: { c: [1] } }] }, { arrayFormat: 'brackets' }),
+            'a%5B%5D%5Bb%5D%5Bc%5D%5B%5D=1',
+            'brackets => brackets'
+        );
+
+        st.equal(
+            qs.stringify({ a: [{ b: { c: [1] } }] }),
+            'a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1',
+            'default => indices'
+        );
+
+        st.end();
+    });
+
+    t.test('stringifies an array with mixed objects and primitives', function (st) {
+        st.equal(
+            qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encode: false, arrayFormat: 'indices' }),
+            'a[0][b]=1&a[1]=2&a[2]=3',
+            'indices => indices'
+        );
+        st.equal(
+            qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encode: false, arrayFormat: 'brackets' }),
+            'a[][b]=1&a[]=2&a[]=3',
+            'brackets => brackets'
+        );
+        st.equal(
+            qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encode: false }),
+            'a[0][b]=1&a[1]=2&a[2]=3',
+            'default => indices'
+        );
+
+        st.end();
+    });
+
+    t.test('stringifies an object inside an array with dots notation', function (st) {
+        st.equal(
+            qs.stringify(
+                { a: [{ b: 'c' }] },
+                { allowDots: true, encode: false, arrayFormat: 'indices' }
+            ),
+            'a[0].b=c',
+            'indices => indices'
+        );
+        st.equal(
+            qs.stringify(
+                { a: [{ b: 'c' }] },
+                { allowDots: true, encode: false, arrayFormat: 'brackets' }
+            ),
+            'a[].b=c',
+            'brackets => brackets'
+        );
+        st.equal(
+            qs.stringify(
+                { a: [{ b: 'c' }] },
+                { allowDots: true, encode: false }
+            ),
+            'a[0].b=c',
+            'default => indices'
+        );
+
+        st.equal(
+            qs.stringify(
+                { a: [{ b: { c: [1] } }] },
+                { allowDots: true, encode: false, arrayFormat: 'indices' }
+            ),
+            'a[0].b.c[0]=1',
+            'indices => indices'
+        );
+        st.equal(
+            qs.stringify(
+                { a: [{ b: { c: [1] } }] },
+                { allowDots: true, encode: false, arrayFormat: 'brackets' }
+            ),
+            'a[].b.c[]=1',
+            'brackets => brackets'
+        );
+        st.equal(
+            qs.stringify(
+                { a: [{ b: { c: [1] } }] },
+                { allowDots: true, encode: false }
+            ),
+            'a[0].b.c[0]=1',
+            'default => indices'
+        );
+
+        st.end();
+    });
+
+    t.test('does not omit object keys when indices = false', function (st) {
+        st.equal(qs.stringify({ a: [{ b: 'c' }] }, { indices: false }), 'a%5Bb%5D=c');
+        st.end();
+    });
+
+    t.test('uses indices notation for arrays when indices=true', function (st) {
+        st.equal(qs.stringify({ a: ['b', 'c'] }, { indices: true }), 'a%5B0%5D=b&a%5B1%5D=c');
+        st.end();
+    });
+
+    t.test('uses indices notation for arrays when no arrayFormat is specified', function (st) {
+        st.equal(qs.stringify({ a: ['b', 'c'] }), 'a%5B0%5D=b&a%5B1%5D=c');
+        st.end();
+    });
+
+    t.test('uses indices notation for arrays when no arrayFormat=indices', function (st) {
+        st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }), 'a%5B0%5D=b&a%5B1%5D=c');
+        st.end();
+    });
+
+    t.test('uses repeat notation for arrays when no arrayFormat=repeat', function (st) {
+        st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }), 'a=b&a=c');
+        st.end();
+    });
+
+    t.test('uses brackets notation for arrays when no arrayFormat=brackets', function (st) {
+        st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }), 'a%5B%5D=b&a%5B%5D=c');
+        st.end();
+    });
+
+    t.test('stringifies a complicated object', function (st) {
+        st.equal(qs.stringify({ a: { b: 'c', d: 'e' } }), 'a%5Bb%5D=c&a%5Bd%5D=e');
+        st.end();
+    });
+
+    t.test('stringifies an empty value', function (st) {
+        st.equal(qs.stringify({ a: '' }), 'a=');
+        st.equal(qs.stringify({ a: null }, { strictNullHandling: true }), 'a');
+
+        st.equal(qs.stringify({ a: '', b: '' }), 'a=&b=');
+        st.equal(qs.stringify({ a: null, b: '' }, { strictNullHandling: true }), 'a&b=');
+
+        st.equal(qs.stringify({ a: { b: '' } }), 'a%5Bb%5D=');
+        st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: true }), 'a%5Bb%5D');
+        st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: false }), 'a%5Bb%5D=');
+
+        st.end();
+    });
+
+    t.test('stringifies a null object', { skip: !Object.create }, function (st) {
+        var obj = Object.create(null);
+        obj.a = 'b';
+        st.equal(qs.stringify(obj), 'a=b');
+        st.end();
+    });
+
+    t.test('returns an empty string for invalid input', function (st) {
+        st.equal(qs.stringify(undefined), '');
+        st.equal(qs.stringify(false), '');
+        st.equal(qs.stringify(null), '');
+        st.equal(qs.stringify(''), '');
+        st.end();
+    });
+
+    t.test('stringifies an object with a null object as a child', { skip: !Object.create }, function (st) {
+        var obj = { a: Object.create(null) };
+
+        obj.a.b = 'c';
+        st.equal(qs.stringify(obj), 'a%5Bb%5D=c');
+        st.end();
+    });
+
+    t.test('drops keys with a value of undefined', function (st) {
+        st.equal(qs.stringify({ a: undefined }), '');
+
+        st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: true }), 'a%5Bc%5D');
+        st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: false }), 'a%5Bc%5D=');
+        st.equal(qs.stringify({ a: { b: undefined, c: '' } }), 'a%5Bc%5D=');
+        st.end();
+    });
+
+    t.test('url encodes values', function (st) {
+        st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c');
+        st.end();
+    });
+
+    t.test('stringifies a date', function (st) {
+        var now = new Date();
+        var str = 'a=' + encodeURIComponent(now.toISOString());
+        st.equal(qs.stringify({ a: now }), str);
+        st.end();
+    });
+
+    t.test('stringifies the weird object from qs', function (st) {
+        st.equal(qs.stringify({ 'my weird field': '~q1!2"\'w$5&7/z8)?' }), 'my%20weird%20field=~q1%212%22%27w%245%267%2Fz8%29%3F');
+        st.end();
+    });
+
+    t.test('skips properties that are part of the object prototype', function (st) {
+        Object.prototype.crash = 'test';
+        st.equal(qs.stringify({ a: 'b' }), 'a=b');
+        st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c');
+        delete Object.prototype.crash;
+        st.end();
+    });
+
+    t.test('stringifies boolean values', function (st) {
+        st.equal(qs.stringify({ a: true }), 'a=true');
+        st.equal(qs.stringify({ a: { b: true } }), 'a%5Bb%5D=true');
+        st.equal(qs.stringify({ b: false }), 'b=false');
+        st.equal(qs.stringify({ b: { c: false } }), 'b%5Bc%5D=false');
+        st.end();
+    });
+
+    t.test('stringifies buffer values', function (st) {
+        st.equal(qs.stringify({ a: new Buffer('test') }), 'a=test');
+        st.equal(qs.stringify({ a: { b: new Buffer('test') } }), 'a%5Bb%5D=test');
+        st.end();
+    });
+
+    t.test('stringifies an object using an alternative delimiter', function (st) {
+        st.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d');
+        st.end();
+    });
+
+    t.test('doesn\'t blow up when Buffer global is missing', function (st) {
+        var tempBuffer = global.Buffer;
+        delete global.Buffer;
+        var result = qs.stringify({ a: 'b', c: 'd' });
+        global.Buffer = tempBuffer;
+        st.equal(result, 'a=b&c=d');
+        st.end();
+    });
+
+    t.test('selects properties when filter=array', function (st) {
+        st.equal(qs.stringify({ a: 'b' }, { filter: ['a'] }), 'a=b');
+        st.equal(qs.stringify({ a: 1 }, { filter: [] }), '');
+
+        st.equal(
+            qs.stringify(
+                { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' },
+                { filter: ['a', 'b', 0, 2], arrayFormat: 'indices' }
+            ),
+            'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3',
+            'indices => indices'
+        );
+        st.equal(
+            qs.stringify(
+                { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' },
+                { filter: ['a', 'b', 0, 2], arrayFormat: 'brackets' }
+            ),
+            'a%5Bb%5D%5B%5D=1&a%5Bb%5D%5B%5D=3',
+            'brackets => brackets'
+        );
+        st.equal(
+            qs.stringify(
+                { a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' },
+                { filter: ['a', 'b', 0, 2] }
+            ),
+            'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3',
+            'default => indices'
+        );
+
+        st.end();
+    });
+
+    t.test('supports custom representations when filter=function', function (st) {
+        var calls = 0;
+        var obj = { a: 'b', c: 'd', e: { f: new Date(1257894000000) } };
+        var filterFunc = function (prefix, value) {
+            calls += 1;
+            if (calls === 1) {
+                st.equal(prefix, '', 'prefix is empty');
+                st.equal(value, obj);
+            } else if (prefix === 'c') {
+                return void 0;
+            } else if (value instanceof Date) {
+                st.equal(prefix, 'e[f]');
+                return value.getTime();
+            }
+            return value;
+        };
+
+        st.equal(qs.stringify(obj, { filter: filterFunc }), 'a=b&e%5Bf%5D=1257894000000');
+        st.equal(calls, 5);
+        st.end();
+    });
+
+    t.test('can disable uri encoding', function (st) {
+        st.equal(qs.stringify({ a: 'b' }, { encode: false }), 'a=b');
+        st.equal(qs.stringify({ a: { b: 'c' } }, { encode: false }), 'a[b]=c');
+        st.equal(qs.stringify({ a: 'b', c: null }, { strictNullHandling: true, encode: false }), 'a=b&c');
+        st.end();
+    });
+
+    t.test('can sort the keys', function (st) {
+        var sort = function (a, b) {
+            return a.localeCompare(b);
+        };
+        st.equal(qs.stringify({ a: 'c', z: 'y', b: 'f' }, { sort: sort }), 'a=c&b=f&z=y');
+        st.equal(qs.stringify({ a: 'c', z: { j: 'a', i: 'b' }, b: 'f' }, { sort: sort }), 'a=c&b=f&z%5Bi%5D=b&z%5Bj%5D=a');
+        st.end();
+    });
+
+    t.test('can sort the keys at depth 3 or more too', function (st) {
+        var sort = function (a, b) {
+            return a.localeCompare(b);
+        };
+        st.equal(
+            qs.stringify(
+                { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' },
+                { sort: sort, encode: false }
+            ),
+            'a=a&b=b&z[zi][zia]=zia&z[zi][zib]=zib&z[zj][zja]=zja&z[zj][zjb]=zjb'
+        );
+        st.equal(
+            qs.stringify(
+                { a: 'a', z: { zj: { zjb: 'zjb', zja: 'zja' }, zi: { zib: 'zib', zia: 'zia' } }, b: 'b' },
+                { sort: null, encode: false }
+            ),
+            'a=a&z[zj][zjb]=zjb&z[zj][zja]=zja&z[zi][zib]=zib&z[zi][zia]=zia&b=b'
+        );
+        st.end();
+    });
+
+    t.test('can stringify with custom encoding', function (st) {
+        st.equal(qs.stringify({ 県: '大阪府', '': '' }, {
+            encoder: function (str) {
+                if (str.length === 0) {
+                    return '';
+                }
+                var buf = iconv.encode(str, 'shiftjis');
+                var result = [];
+                for (var i = 0; i < buf.length; ++i) {
+                    result.push(buf.readUInt8(i).toString(16));
+                }
+                return '%' + result.join('%');
+            }
+        }), '%8c%a7=%91%e5%8d%e3%95%7b&=');
+        st.end();
+    });
+
+    t.test('receives the default encoder as a second argument', function (st) {
+        st.plan(2);
+        qs.stringify({ a: 1 }, {
+            encoder: function (str, defaultEncoder) {
+                st.equal(defaultEncoder, utils.encode);
+            }
+        });
+        st.end();
+    });
+
+    t.test('throws error with wrong encoder', function (st) {
+        st.throws(function () {
+            qs.stringify({}, { encoder: 'string' });
+        }, new TypeError('Encoder has to be a function.'));
+        st.end();
+    });
+
+    t.test('can use custom encoder for a buffer object', { skip: typeof Buffer === 'undefined' }, function (st) {
+        st.equal(qs.stringify({ a: new Buffer([1]) }, {
+            encoder: function (buffer) {
+                if (typeof buffer === 'string') {
+                    return buffer;
+                }
+                return String.fromCharCode(buffer.readUInt8(0) + 97);
+            }
+        }), 'a=b');
+        st.end();
+    });
+
+    t.test('serializeDate option', function (st) {
+        var date = new Date();
+        st.equal(
+            qs.stringify({ a: date }),
+            'a=' + date.toISOString().replace(/:/g, '%3A'),
+            'default is toISOString'
+        );
+
+        var mutatedDate = new Date();
+        mutatedDate.toISOString = function () {
+            throw new SyntaxError();
+        };
+        st.throws(function () {
+            mutatedDate.toISOString();
+        }, SyntaxError);
+        st.equal(
+            qs.stringify({ a: mutatedDate }),
+            'a=' + Date.prototype.toISOString.call(mutatedDate).replace(/:/g, '%3A'),
+            'toISOString works even when method is not locally present'
+        );
+
+        var specificDate = new Date(6);
+        st.equal(
+            qs.stringify(
+                { a: specificDate },
+                { serializeDate: function (d) { return d.getTime() * 7; } }
+            ),
+            'a=42',
+            'custom serializeDate function called'
+        );
+
+        st.end();
+    });
+
+    t.test('RFC 1738 spaces serialization', function (st) {
+        st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC1738 }), 'a=b+c');
+        st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC1738 }), 'a+b=c+d');
+        st.end();
+    });
+
+    t.test('RFC 3986 spaces serialization', function (st) {
+        st.equal(qs.stringify({ a: 'b c' }, { format: qs.formats.RFC3986 }), 'a=b%20c');
+        st.equal(qs.stringify({ 'a b': 'c d' }, { format: qs.formats.RFC3986 }), 'a%20b=c%20d');
+        st.end();
+    });
+
+    t.test('Backward compatibility to RFC 3986', function (st) {
+        st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c');
+        st.end();
+    });
+
+    t.test('Edge cases and unknown formats', function (st) {
+        ['UFO1234', false, 1234, null, {}, []].forEach(
+            function (format) {
+                st.throws(
+                    function () {
+                        qs.stringify({ a: 'b c' }, { format: format });
+                    },
+                    new TypeError('Unknown format option provided.')
+                );
+            }
+        );
+        st.end();
+    });
+
+    t.test('encodeValuesOnly', function (st) {
+        st.equal(
+            qs.stringify(
+                { a: 'b', c: ['d', 'e=f'], f: [['g'], ['h']] },
+                { encodeValuesOnly: true }
+            ),
+            'a=b&c[0]=d&c[1]=e%3Df&f[0][0]=g&f[1][0]=h'
+        );
+        st.equal(
+            qs.stringify(
+                { a: 'b', c: ['d', 'e'], f: [['g'], ['h']] }
+            ),
+            'a=b&c%5B0%5D=d&c%5B1%5D=e&f%5B0%5D%5B0%5D=g&f%5B1%5D%5B0%5D=h'
+        );
+        st.end();
+    });
+
+    t.test('encodeValuesOnly - strictNullHandling', function (st) {
+        st.equal(
+            qs.stringify(
+                { a: { b: null } },
+                { encodeValuesOnly: true, strictNullHandling: true }
+            ),
+            'a[b]'
+        );
+        st.end();
+    });
+
+    t.test('does not mutate the options argument', function (st) {
+        var options = {};
+        qs.stringify({}, options);
+        st.deepEqual(options, {});
+        st.end();
+    });
+
+    t.end();
+});
diff --git a/wrt/node_modules/qs/test/utils.js b/wrt/node_modules/qs/test/utils.js
new file mode 100644 (file)
index 0000000..eff4011
--- /dev/null
@@ -0,0 +1,34 @@
+'use strict';
+
+var test = require('tape');
+var utils = require('../lib/utils');
+
+test('merge()', function (t) {
+    t.deepEqual(utils.merge({ a: 'b' }, { a: 'c' }), { a: ['b', 'c'] }, 'merges two objects with the same key');
+
+    var oneMerged = utils.merge({ foo: 'bar' }, { foo: { first: '123' } });
+    t.deepEqual(oneMerged, { foo: ['bar', { first: '123' }] }, 'merges a standalone and an object into an array');
+
+    var twoMerged = utils.merge({ foo: ['bar', { first: '123' }] }, { foo: { second: '456' } });
+    t.deepEqual(twoMerged, { foo: { 0: 'bar', 1: { first: '123' }, second: '456' } }, 'merges a standalone and two objects into an array');
+
+    var sandwiched = utils.merge({ foo: ['bar', { first: '123', second: '456' }] }, { foo: 'baz' });
+    t.deepEqual(sandwiched, { foo: ['bar', { first: '123', second: '456' }, 'baz'] }, 'merges an object sandwiched by two standalones into an array');
+
+    var nestedArrays = utils.merge({ foo: ['baz'] }, { foo: ['bar', 'xyzzy'] });
+    t.deepEqual(nestedArrays, { foo: ['baz', 'bar', 'xyzzy'] });
+
+    t.end();
+});
+
+test('assign()', function (t) {
+    var target = { a: 1, b: 2 };
+    var source = { b: 3, c: 4 };
+    var result = utils.assign(target, source);
+
+    t.equal(result, target, 'returns the target');
+    t.deepEqual(target, { a: 1, b: 3, c: 4 }, 'target and source are merged');
+    t.deepEqual(source, { b: 3, c: 4 }, 'source is untouched');
+
+    t.end();
+});
diff --git a/wrt/node_modules/range-parser/HISTORY.md b/wrt/node_modules/range-parser/HISTORY.md
new file mode 100644 (file)
index 0000000..5e01eef
--- /dev/null
@@ -0,0 +1,51 @@
+1.2.0 / 2016-06-01
+==================
+
+  * Add `combine` option to combine overlapping ranges
+
+1.1.0 / 2016-05-13
+==================
+
+  * Fix incorrectly returning -1 when there is at least one valid range
+  * perf: remove internal function
+
+1.0.3 / 2015-10-29
+==================
+
+  * perf: enable strict mode
+
+1.0.2 / 2014-09-08
+==================
+
+  * Support Node.js 0.6
+
+1.0.1 / 2014-09-07
+==================
+
+  * Move repository to jshttp
+
+1.0.0 / 2013-12-11
+==================
+
+  * Add repository to package.json
+  * Add MIT license
+
+0.0.4 / 2012-06-17
+==================
+
+  * Change ret -1 for unsatisfiable and -2 when invalid
+
+0.0.3 / 2012-06-17
+==================
+
+  * Fix last-byte-pos default to len - 1
+
+0.0.2 / 2012-06-14
+==================
+
+  * Add `.type`
+
+0.0.1 / 2012-06-11
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/range-parser/LICENSE b/wrt/node_modules/range-parser/LICENSE
new file mode 100644 (file)
index 0000000..3599954
--- /dev/null
@@ -0,0 +1,23 @@
+(The MIT License)
+
+Copyright (c) 2012-2014 TJ Holowaychuk <tj@vision-media.ca>
+Copyright (c) 2015-2016 Douglas Christopher Wilson <doug@somethingdoug.com
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/range-parser/README.md b/wrt/node_modules/range-parser/README.md
new file mode 100644 (file)
index 0000000..1b24375
--- /dev/null
@@ -0,0 +1,75 @@
+# range-parser
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+Range header field parser.
+
+## Installation
+
+```
+$ npm install range-parser
+```
+
+## API
+
+```js
+var parseRange = require('range-parser')
+```
+
+### parseRange(size, header, options)
+
+Parse the given `header` string where `size` is the maximum size of the resource.
+An array of ranges will be returned or negative numbers indicating an error parsing.
+
+  * `-2` signals a malformed header string
+  * `-1` signals an unsatisfiable range
+
+```js
+// parse header from request
+var range = parseRange(size, req.headers.range)
+
+// the type of the range
+if (range.type === 'bytes') {
+  // the ranges
+  range.forEach(function (r) {
+    // do something with r.start and r.end
+  })
+}
+```
+
+#### Options
+
+These properties are accepted in the options object.
+
+##### combine
+
+Specifies if overlapping & adjacent ranges should be combined, defaults to `false`.
+When `true`, ranges will be combined and returned as if they were specified that
+way in the header.
+
+```js
+parseRange(100, 'bytes=50-55,0-10,5-10,56-60', { combine: true })
+// => [
+//      { start: 0,  end: 10 },
+//      { start: 50, end: 60 }
+//    ]
+```
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/range-parser.svg
+[npm-url]: https://npmjs.org/package/range-parser
+[node-version-image]: https://img.shields.io/node/v/range-parser.svg
+[node-version-url]: https://nodejs.org/endownload
+[travis-image]: https://img.shields.io/travis/jshttp/range-parser.svg
+[travis-url]: https://travis-ci.org/jshttp/range-parser
+[coveralls-image]: https://img.shields.io/coveralls/jshttp/range-parser.svg
+[coveralls-url]: https://coveralls.io/r/jshttp/range-parser
+[downloads-image]: https://img.shields.io/npm/dm/range-parser.svg
+[downloads-url]: https://npmjs.org/package/range-parser
diff --git a/wrt/node_modules/range-parser/index.js b/wrt/node_modules/range-parser/index.js
new file mode 100644 (file)
index 0000000..83b2eb6
--- /dev/null
@@ -0,0 +1,158 @@
+/*!
+ * range-parser
+ * Copyright(c) 2012-2014 TJ Holowaychuk
+ * Copyright(c) 2015-2016 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = rangeParser
+
+/**
+ * Parse "Range" header `str` relative to the given file `size`.
+ *
+ * @param {Number} size
+ * @param {String} str
+ * @param {Object} [options]
+ * @return {Array}
+ * @public
+ */
+
+function rangeParser (size, str, options) {
+  var index = str.indexOf('=')
+
+  if (index === -1) {
+    return -2
+  }
+
+  // split the range string
+  var arr = str.slice(index + 1).split(',')
+  var ranges = []
+
+  // add ranges type
+  ranges.type = str.slice(0, index)
+
+  // parse all ranges
+  for (var i = 0; i < arr.length; i++) {
+    var range = arr[i].split('-')
+    var start = parseInt(range[0], 10)
+    var end = parseInt(range[1], 10)
+
+    // -nnn
+    if (isNaN(start)) {
+      start = size - end
+      end = size - 1
+    // nnn-
+    } else if (isNaN(end)) {
+      end = size - 1
+    }
+
+    // limit last-byte-pos to current length
+    if (end > size - 1) {
+      end = size - 1
+    }
+
+    // invalid or unsatisifiable
+    if (isNaN(start) || isNaN(end) || start > end || start < 0) {
+      continue
+    }
+
+    // add range
+    ranges.push({
+      start: start,
+      end: end
+    })
+  }
+
+  if (ranges.length < 1) {
+    // unsatisifiable
+    return -1
+  }
+
+  return options && options.combine
+    ? combineRanges(ranges)
+    : ranges
+}
+
+/**
+ * Combine overlapping & adjacent ranges.
+ * @private
+ */
+
+function combineRanges (ranges) {
+  var ordered = ranges.map(mapWithIndex).sort(sortByRangeStart)
+
+  for (var j = 0, i = 1; i < ordered.length; i++) {
+    var range = ordered[i]
+    var current = ordered[j]
+
+    if (range.start > current.end + 1) {
+      // next range
+      ordered[++j] = range
+    } else if (range.end > current.end) {
+      // extend range
+      current.end = range.end
+      current.index = Math.min(current.index, range.index)
+    }
+  }
+
+  // trim ordered array
+  ordered.length = j + 1
+
+  // generate combined range
+  var combined = ordered.sort(sortByRangeIndex).map(mapWithoutIndex)
+
+  // copy ranges type
+  combined.type = ranges.type
+
+  return combined
+}
+
+/**
+ * Map function to add index value to ranges.
+ * @private
+ */
+
+function mapWithIndex (range, index) {
+  return {
+    start: range.start,
+    end: range.end,
+    index: index
+  }
+}
+
+/**
+ * Map function to remove index value from ranges.
+ * @private
+ */
+
+function mapWithoutIndex (range) {
+  return {
+    start: range.start,
+    end: range.end
+  }
+}
+
+/**
+ * Sort function to sort ranges by index.
+ * @private
+ */
+
+function sortByRangeIndex (a, b) {
+  return a.index - b.index
+}
+
+/**
+ * Sort function to sort ranges by start position.
+ * @private
+ */
+
+function sortByRangeStart (a, b) {
+  return a.start - b.start
+}
diff --git a/wrt/node_modules/range-parser/package.json b/wrt/node_modules/range-parser/package.json
new file mode 100644 (file)
index 0000000..922acfd
--- /dev/null
@@ -0,0 +1,134 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "range-parser@~1.2.0",
+        "scope": null,
+        "escapedName": "range-parser",
+        "name": "range-parser",
+        "rawSpec": "~1.2.0",
+        "spec": ">=1.2.0 <1.3.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express"
+    ]
+  ],
+  "_from": "range-parser@>=1.2.0 <1.3.0",
+  "_id": "range-parser@1.2.0",
+  "_inCache": true,
+  "_location": "/range-parser",
+  "_npmOperationalInternal": {
+    "host": "packages-16-east.internal.npmjs.com",
+    "tmp": "tmp/range-parser-1.2.0.tgz_1464803293097_0.6830497414339334"
+  },
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "1.4.28",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "range-parser@~1.2.0",
+    "scope": null,
+    "escapedName": "range-parser",
+    "name": "range-parser",
+    "rawSpec": "~1.2.0",
+    "spec": ">=1.2.0 <1.3.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/express",
+    "/send"
+  ],
+  "_resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz",
+  "_shasum": "f49be6b487894ddc40dcc94a322f611092e00d5e",
+  "_shrinkwrap": null,
+  "_spec": "range-parser@~1.2.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express",
+  "author": {
+    "name": "TJ Holowaychuk",
+    "email": "tj@vision-media.ca",
+    "url": "http://tjholowaychuk.com"
+  },
+  "bugs": {
+    "url": "https://github.com/jshttp/range-parser/issues"
+  },
+  "contributors": [
+    {
+      "name": "Douglas Christopher Wilson",
+      "email": "doug@somethingdoug.com"
+    },
+    {
+      "name": "James Wyatt Cready",
+      "email": "wyatt.cready@lanetix.com"
+    },
+    {
+      "name": "Jonathan Ong",
+      "email": "me@jongleberry.com",
+      "url": "http://jongleberry.com"
+    }
+  ],
+  "dependencies": {},
+  "description": "Range header field string parser",
+  "devDependencies": {
+    "eslint": "2.11.1",
+    "eslint-config-standard": "5.3.1",
+    "eslint-plugin-promise": "1.1.0",
+    "eslint-plugin-standard": "1.3.2",
+    "istanbul": "0.4.3",
+    "mocha": "1.21.5"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "f49be6b487894ddc40dcc94a322f611092e00d5e",
+    "tarball": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz"
+  },
+  "engines": {
+    "node": ">= 0.6"
+  },
+  "files": [
+    "HISTORY.md",
+    "LICENSE",
+    "index.js"
+  ],
+  "gitHead": "0665aca31639d799dee1d35fb10970799559ec48",
+  "homepage": "https://github.com/jshttp/range-parser",
+  "keywords": [
+    "range",
+    "parser",
+    "http"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    },
+    {
+      "name": "jonathanong",
+      "email": "jonathanrichardong@gmail.com"
+    },
+    {
+      "name": "jongleberry",
+      "email": "jonathanrichardong@gmail.com"
+    },
+    {
+      "name": "tjholowaychuk",
+      "email": "tj@vision-media.ca"
+    }
+  ],
+  "name": "range-parser",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/jshttp/range-parser.git"
+  },
+  "scripts": {
+    "lint": "eslint **/*.js",
+    "test": "mocha --reporter spec",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot",
+    "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"
+  },
+  "version": "1.2.0"
+}
diff --git a/wrt/node_modules/readable-stream/.npmignore b/wrt/node_modules/readable-stream/.npmignore
new file mode 100644 (file)
index 0000000..38344f8
--- /dev/null
@@ -0,0 +1,5 @@
+build/
+test/
+examples/
+fs.js
+zlib.js
\ No newline at end of file
diff --git a/wrt/node_modules/readable-stream/LICENSE b/wrt/node_modules/readable-stream/LICENSE
new file mode 100644 (file)
index 0000000..e3d4e69
--- /dev/null
@@ -0,0 +1,18 @@
+Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
diff --git a/wrt/node_modules/readable-stream/README.md b/wrt/node_modules/readable-stream/README.md
new file mode 100644 (file)
index 0000000..3fb3e80
--- /dev/null
@@ -0,0 +1,15 @@
+# readable-stream
+
+***Node-core streams for userland***
+
+[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/)
+[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/)
+
+This package is a mirror of the Streams2 and Streams3 implementations in Node-core.
+
+If you want to guarantee a stable streams base, regardless of what version of Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core.
+
+**readable-stream** comes in two major versions, v1.0.x and v1.1.x. The former tracks the Streams2 implementation in Node 0.10, including bug-fixes and minor improvements as they are added. The latter tracks Streams3 as it develops in Node 0.11; we will likely see a v1.2.x branch for Node 0.12.
+
+**readable-stream** uses proper patch-level versioning so if you pin to `"~1.0.0"` you’ll get the latest Node 0.10 Streams2 implementation, including any fixes and minor non-breaking improvements. The patch-level versions of 1.0.x and 1.1.x should mirror the patch-level versions of Node-core releases. You should prefer the **1.0.x** releases for now and when you’re ready to start using Streams3, pin to `"~1.1.0"`
+
diff --git a/wrt/node_modules/readable-stream/duplex.js b/wrt/node_modules/readable-stream/duplex.js
new file mode 100644 (file)
index 0000000..ca807af
--- /dev/null
@@ -0,0 +1 @@
+module.exports = require("./lib/_stream_duplex.js")
diff --git a/wrt/node_modules/readable-stream/lib/_stream_duplex.js b/wrt/node_modules/readable-stream/lib/_stream_duplex.js
new file mode 100644 (file)
index 0000000..b513d61
--- /dev/null
@@ -0,0 +1,89 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// a duplex stream is just a stream that is both readable and writable.
+// Since JS doesn't have multiple prototypal inheritance, this class
+// prototypally inherits from Readable, and then parasitically from
+// Writable.
+
+module.exports = Duplex;
+
+/*<replacement>*/
+var objectKeys = Object.keys || function (obj) {
+  var keys = [];
+  for (var key in obj) keys.push(key);
+  return keys;
+}
+/*</replacement>*/
+
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+var Readable = require('./_stream_readable');
+var Writable = require('./_stream_writable');
+
+util.inherits(Duplex, Readable);
+
+forEach(objectKeys(Writable.prototype), function(method) {
+  if (!Duplex.prototype[method])
+    Duplex.prototype[method] = Writable.prototype[method];
+});
+
+function Duplex(options) {
+  if (!(this instanceof Duplex))
+    return new Duplex(options);
+
+  Readable.call(this, options);
+  Writable.call(this, options);
+
+  if (options && options.readable === false)
+    this.readable = false;
+
+  if (options && options.writable === false)
+    this.writable = false;
+
+  this.allowHalfOpen = true;
+  if (options && options.allowHalfOpen === false)
+    this.allowHalfOpen = false;
+
+  this.once('end', onend);
+}
+
+// the no-half-open enforcer
+function onend() {
+  // if we allow half-open state, or if the writable side ended,
+  // then we're ok.
+  if (this.allowHalfOpen || this._writableState.ended)
+    return;
+
+  // no more data can be written.
+  // But allow more writes to happen in this tick.
+  process.nextTick(this.end.bind(this));
+}
+
+function forEach (xs, f) {
+  for (var i = 0, l = xs.length; i < l; i++) {
+    f(xs[i], i);
+  }
+}
diff --git a/wrt/node_modules/readable-stream/lib/_stream_passthrough.js b/wrt/node_modules/readable-stream/lib/_stream_passthrough.js
new file mode 100644 (file)
index 0000000..895ca50
--- /dev/null
@@ -0,0 +1,46 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// a passthrough stream.
+// basically just the most minimal sort of Transform stream.
+// Every written chunk gets output as-is.
+
+module.exports = PassThrough;
+
+var Transform = require('./_stream_transform');
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+util.inherits(PassThrough, Transform);
+
+function PassThrough(options) {
+  if (!(this instanceof PassThrough))
+    return new PassThrough(options);
+
+  Transform.call(this, options);
+}
+
+PassThrough.prototype._transform = function(chunk, encoding, cb) {
+  cb(null, chunk);
+};
diff --git a/wrt/node_modules/readable-stream/lib/_stream_readable.js b/wrt/node_modules/readable-stream/lib/_stream_readable.js
new file mode 100644 (file)
index 0000000..6307220
--- /dev/null
@@ -0,0 +1,982 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+module.exports = Readable;
+
+/*<replacement>*/
+var isArray = require('isarray');
+/*</replacement>*/
+
+
+/*<replacement>*/
+var Buffer = require('buffer').Buffer;
+/*</replacement>*/
+
+Readable.ReadableState = ReadableState;
+
+var EE = require('events').EventEmitter;
+
+/*<replacement>*/
+if (!EE.listenerCount) EE.listenerCount = function(emitter, type) {
+  return emitter.listeners(type).length;
+};
+/*</replacement>*/
+
+var Stream = require('stream');
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+var StringDecoder;
+
+util.inherits(Readable, Stream);
+
+function ReadableState(options, stream) {
+  options = options || {};
+
+  // the point at which it stops calling _read() to fill the buffer
+  // Note: 0 is a valid value, means "don't call _read preemptively ever"
+  var hwm = options.highWaterMark;
+  this.highWaterMark = (hwm || hwm === 0) ? hwm : 16 * 1024;
+
+  // cast to ints.
+  this.highWaterMark = ~~this.highWaterMark;
+
+  this.buffer = [];
+  this.length = 0;
+  this.pipes = null;
+  this.pipesCount = 0;
+  this.flowing = false;
+  this.ended = false;
+  this.endEmitted = false;
+  this.reading = false;
+
+  // In streams that never have any data, and do push(null) right away,
+  // the consumer can miss the 'end' event if they do some I/O before
+  // consuming the stream.  So, we don't emit('end') until some reading
+  // happens.
+  this.calledRead = false;
+
+  // a flag to be able to tell if the onwrite cb is called immediately,
+  // or on a later tick.  We set this to true at first, becuase any
+  // actions that shouldn't happen until "later" should generally also
+  // not happen before the first write call.
+  this.sync = true;
+
+  // whenever we return null, then we set a flag to say
+  // that we're awaiting a 'readable' event emission.
+  this.needReadable = false;
+  this.emittedReadable = false;
+  this.readableListening = false;
+
+
+  // object stream flag. Used to make read(n) ignore n and to
+  // make all the buffer merging and length checks go away
+  this.objectMode = !!options.objectMode;
+
+  // Crypto is kind of old and crusty.  Historically, its default string
+  // encoding is 'binary' so we have to make this configurable.
+  // Everything else in the universe uses 'utf8', though.
+  this.defaultEncoding = options.defaultEncoding || 'utf8';
+
+  // when piping, we only care about 'readable' events that happen
+  // after read()ing all the bytes and not getting any pushback.
+  this.ranOut = false;
+
+  // the number of writers that are awaiting a drain event in .pipe()s
+  this.awaitDrain = 0;
+
+  // if true, a maybeReadMore has been scheduled
+  this.readingMore = false;
+
+  this.decoder = null;
+  this.encoding = null;
+  if (options.encoding) {
+    if (!StringDecoder)
+      StringDecoder = require('string_decoder/').StringDecoder;
+    this.decoder = new StringDecoder(options.encoding);
+    this.encoding = options.encoding;
+  }
+}
+
+function Readable(options) {
+  if (!(this instanceof Readable))
+    return new Readable(options);
+
+  this._readableState = new ReadableState(options, this);
+
+  // legacy
+  this.readable = true;
+
+  Stream.call(this);
+}
+
+// Manually shove something into the read() buffer.
+// This returns true if the highWaterMark has not been hit yet,
+// similar to how Writable.write() returns true if you should
+// write() some more.
+Readable.prototype.push = function(chunk, encoding) {
+  var state = this._readableState;
+
+  if (typeof chunk === 'string' && !state.objectMode) {
+    encoding = encoding || state.defaultEncoding;
+    if (encoding !== state.encoding) {
+      chunk = new Buffer(chunk, encoding);
+      encoding = '';
+    }
+  }
+
+  return readableAddChunk(this, state, chunk, encoding, false);
+};
+
+// Unshift should *always* be something directly out of read()
+Readable.prototype.unshift = function(chunk) {
+  var state = this._readableState;
+  return readableAddChunk(this, state, chunk, '', true);
+};
+
+function readableAddChunk(stream, state, chunk, encoding, addToFront) {
+  var er = chunkInvalid(state, chunk);
+  if (er) {
+    stream.emit('error', er);
+  } else if (chunk === null || chunk === undefined) {
+    state.reading = false;
+    if (!state.ended)
+      onEofChunk(stream, state);
+  } else if (state.objectMode || chunk && chunk.length > 0) {
+    if (state.ended && !addToFront) {
+      var e = new Error('stream.push() after EOF');
+      stream.emit('error', e);
+    } else if (state.endEmitted && addToFront) {
+      var e = new Error('stream.unshift() after end event');
+      stream.emit('error', e);
+    } else {
+      if (state.decoder && !addToFront && !encoding)
+        chunk = state.decoder.write(chunk);
+
+      // update the buffer info.
+      state.length += state.objectMode ? 1 : chunk.length;
+      if (addToFront) {
+        state.buffer.unshift(chunk);
+      } else {
+        state.reading = false;
+        state.buffer.push(chunk);
+      }
+
+      if (state.needReadable)
+        emitReadable(stream);
+
+      maybeReadMore(stream, state);
+    }
+  } else if (!addToFront) {
+    state.reading = false;
+  }
+
+  return needMoreData(state);
+}
+
+
+
+// if it's past the high water mark, we can push in some more.
+// Also, if we have no data yet, we can stand some
+// more bytes.  This is to work around cases where hwm=0,
+// such as the repl.  Also, if the push() triggered a
+// readable event, and the user called read(largeNumber) such that
+// needReadable was set, then we ought to push more, so that another
+// 'readable' event will be triggered.
+function needMoreData(state) {
+  return !state.ended &&
+         (state.needReadable ||
+          state.length < state.highWaterMark ||
+          state.length === 0);
+}
+
+// backwards compatibility.
+Readable.prototype.setEncoding = function(enc) {
+  if (!StringDecoder)
+    StringDecoder = require('string_decoder/').StringDecoder;
+  this._readableState.decoder = new StringDecoder(enc);
+  this._readableState.encoding = enc;
+};
+
+// Don't raise the hwm > 128MB
+var MAX_HWM = 0x800000;
+function roundUpToNextPowerOf2(n) {
+  if (n >= MAX_HWM) {
+    n = MAX_HWM;
+  } else {
+    // Get the next highest power of 2
+    n--;
+    for (var p = 1; p < 32; p <<= 1) n |= n >> p;
+    n++;
+  }
+  return n;
+}
+
+function howMuchToRead(n, state) {
+  if (state.length === 0 && state.ended)
+    return 0;
+
+  if (state.objectMode)
+    return n === 0 ? 0 : 1;
+
+  if (n === null || isNaN(n)) {
+    // only flow one buffer at a time
+    if (state.flowing && state.buffer.length)
+      return state.buffer[0].length;
+    else
+      return state.length;
+  }
+
+  if (n <= 0)
+    return 0;
+
+  // If we're asking for more than the target buffer level,
+  // then raise the water mark.  Bump up to the next highest
+  // power of 2, to prevent increasing it excessively in tiny
+  // amounts.
+  if (n > state.highWaterMark)
+    state.highWaterMark = roundUpToNextPowerOf2(n);
+
+  // don't have that much.  return null, unless we've ended.
+  if (n > state.length) {
+    if (!state.ended) {
+      state.needReadable = true;
+      return 0;
+    } else
+      return state.length;
+  }
+
+  return n;
+}
+
+// you can override either this method, or the async _read(n) below.
+Readable.prototype.read = function(n) {
+  var state = this._readableState;
+  state.calledRead = true;
+  var nOrig = n;
+  var ret;
+
+  if (typeof n !== 'number' || n > 0)
+    state.emittedReadable = false;
+
+  // if we're doing read(0) to trigger a readable event, but we
+  // already have a bunch of data in the buffer, then just trigger
+  // the 'readable' event and move on.
+  if (n === 0 &&
+      state.needReadable &&
+      (state.length >= state.highWaterMark || state.ended)) {
+    emitReadable(this);
+    return null;
+  }
+
+  n = howMuchToRead(n, state);
+
+  // if we've ended, and we're now clear, then finish it up.
+  if (n === 0 && state.ended) {
+    ret = null;
+
+    // In cases where the decoder did not receive enough data
+    // to produce a full chunk, then immediately received an
+    // EOF, state.buffer will contain [<Buffer >, <Buffer 00 ...>].
+    // howMuchToRead will see this and coerce the amount to
+    // read to zero (because it's looking at the length of the
+    // first <Buffer > in state.buffer), and we'll end up here.
+    //
+    // This can only happen via state.decoder -- no other venue
+    // exists for pushing a zero-length chunk into state.buffer
+    // and triggering this behavior. In this case, we return our
+    // remaining data and end the stream, if appropriate.
+    if (state.length > 0 && state.decoder) {
+      ret = fromList(n, state);
+      state.length -= ret.length;
+    }
+
+    if (state.length === 0)
+      endReadable(this);
+
+    return ret;
+  }
+
+  // All the actual chunk generation logic needs to be
+  // *below* the call to _read.  The reason is that in certain
+  // synthetic stream cases, such as passthrough streams, _read
+  // may be a completely synchronous operation which may change
+  // the state of the read buffer, providing enough data when
+  // before there was *not* enough.
+  //
+  // So, the steps are:
+  // 1. Figure out what the state of things will be after we do
+  // a read from the buffer.
+  //
+  // 2. If that resulting state will trigger a _read, then call _read.
+  // Note that this may be asynchronous, or synchronous.  Yes, it is
+  // deeply ugly to write APIs this way, but that still doesn't mean
+  // that the Readable class should behave improperly, as streams are
+  // designed to be sync/async agnostic.
+  // Take note if the _read call is sync or async (ie, if the read call
+  // has returned yet), so that we know whether or not it's safe to emit
+  // 'readable' etc.
+  //
+  // 3. Actually pull the requested chunks out of the buffer and return.
+
+  // if we need a readable event, then we need to do some reading.
+  var doRead = state.needReadable;
+
+  // if we currently have less than the highWaterMark, then also read some
+  if (state.length - n <= state.highWaterMark)
+    doRead = true;
+
+  // however, if we've ended, then there's no point, and if we're already
+  // reading, then it's unnecessary.
+  if (state.ended || state.reading)
+    doRead = false;
+
+  if (doRead) {
+    state.reading = true;
+    state.sync = true;
+    // if the length is currently zero, then we *need* a readable event.
+    if (state.length === 0)
+      state.needReadable = true;
+    // call internal read method
+    this._read(state.highWaterMark);
+    state.sync = false;
+  }
+
+  // If _read called its callback synchronously, then `reading`
+  // will be false, and we need to re-evaluate how much data we
+  // can return to the user.
+  if (doRead && !state.reading)
+    n = howMuchToRead(nOrig, state);
+
+  if (n > 0)
+    ret = fromList(n, state);
+  else
+    ret = null;
+
+  if (ret === null) {
+    state.needReadable = true;
+    n = 0;
+  }
+
+  state.length -= n;
+
+  // If we have nothing in the buffer, then we want to know
+  // as soon as we *do* get something into the buffer.
+  if (state.length === 0 && !state.ended)
+    state.needReadable = true;
+
+  // If we happened to read() exactly the remaining amount in the
+  // buffer, and the EOF has been seen at this point, then make sure
+  // that we emit 'end' on the very next tick.
+  if (state.ended && !state.endEmitted && state.length === 0)
+    endReadable(this);
+
+  return ret;
+};
+
+function chunkInvalid(state, chunk) {
+  var er = null;
+  if (!Buffer.isBuffer(chunk) &&
+      'string' !== typeof chunk &&
+      chunk !== null &&
+      chunk !== undefined &&
+      !state.objectMode) {
+    er = new TypeError('Invalid non-string/buffer chunk');
+  }
+  return er;
+}
+
+
+function onEofChunk(stream, state) {
+  if (state.decoder && !state.ended) {
+    var chunk = state.decoder.end();
+    if (chunk && chunk.length) {
+      state.buffer.push(chunk);
+      state.length += state.objectMode ? 1 : chunk.length;
+    }
+  }
+  state.ended = true;
+
+  // if we've ended and we have some data left, then emit
+  // 'readable' now to make sure it gets picked up.
+  if (state.length > 0)
+    emitReadable(stream);
+  else
+    endReadable(stream);
+}
+
+// Don't emit readable right away in sync mode, because this can trigger
+// another read() call => stack overflow.  This way, it might trigger
+// a nextTick recursion warning, but that's not so bad.
+function emitReadable(stream) {
+  var state = stream._readableState;
+  state.needReadable = false;
+  if (state.emittedReadable)
+    return;
+
+  state.emittedReadable = true;
+  if (state.sync)
+    process.nextTick(function() {
+      emitReadable_(stream);
+    });
+  else
+    emitReadable_(stream);
+}
+
+function emitReadable_(stream) {
+  stream.emit('readable');
+}
+
+
+// at this point, the user has presumably seen the 'readable' event,
+// and called read() to consume some data.  that may have triggered
+// in turn another _read(n) call, in which case reading = true if
+// it's in progress.
+// However, if we're not ended, or reading, and the length < hwm,
+// then go ahead and try to read some more preemptively.
+function maybeReadMore(stream, state) {
+  if (!state.readingMore) {
+    state.readingMore = true;
+    process.nextTick(function() {
+      maybeReadMore_(stream, state);
+    });
+  }
+}
+
+function maybeReadMore_(stream, state) {
+  var len = state.length;
+  while (!state.reading && !state.flowing && !state.ended &&
+         state.length < state.highWaterMark) {
+    stream.read(0);
+    if (len === state.length)
+      // didn't get any data, stop spinning.
+      break;
+    else
+      len = state.length;
+  }
+  state.readingMore = false;
+}
+
+// abstract method.  to be overridden in specific implementation classes.
+// call cb(er, data) where data is <= n in length.
+// for virtual (non-string, non-buffer) streams, "length" is somewhat
+// arbitrary, and perhaps not very meaningful.
+Readable.prototype._read = function(n) {
+  this.emit('error', new Error('not implemented'));
+};
+
+Readable.prototype.pipe = function(dest, pipeOpts) {
+  var src = this;
+  var state = this._readableState;
+
+  switch (state.pipesCount) {
+    case 0:
+      state.pipes = dest;
+      break;
+    case 1:
+      state.pipes = [state.pipes, dest];
+      break;
+    default:
+      state.pipes.push(dest);
+      break;
+  }
+  state.pipesCount += 1;
+
+  var doEnd = (!pipeOpts || pipeOpts.end !== false) &&
+              dest !== process.stdout &&
+              dest !== process.stderr;
+
+  var endFn = doEnd ? onend : cleanup;
+  if (state.endEmitted)
+    process.nextTick(endFn);
+  else
+    src.once('end', endFn);
+
+  dest.on('unpipe', onunpipe);
+  function onunpipe(readable) {
+    if (readable !== src) return;
+    cleanup();
+  }
+
+  function onend() {
+    dest.end();
+  }
+
+  // when the dest drains, it reduces the awaitDrain counter
+  // on the source.  This would be more elegant with a .once()
+  // handler in flow(), but adding and removing repeatedly is
+  // too slow.
+  var ondrain = pipeOnDrain(src);
+  dest.on('drain', ondrain);
+
+  function cleanup() {
+    // cleanup event handlers once the pipe is broken
+    dest.removeListener('close', onclose);
+    dest.removeListener('finish', onfinish);
+    dest.removeListener('drain', ondrain);
+    dest.removeListener('error', onerror);
+    dest.removeListener('unpipe', onunpipe);
+    src.removeListener('end', onend);
+    src.removeListener('end', cleanup);
+
+    // if the reader is waiting for a drain event from this
+    // specific writer, then it would cause it to never start
+    // flowing again.
+    // So, if this is awaiting a drain, then we just call it now.
+    // If we don't know, then assume that we are waiting for one.
+    if (!dest._writableState || dest._writableState.needDrain)
+      ondrain();
+  }
+
+  // if the dest has an error, then stop piping into it.
+  // however, don't suppress the throwing behavior for this.
+  function onerror(er) {
+    unpipe();
+    dest.removeListener('error', onerror);
+    if (EE.listenerCount(dest, 'error') === 0)
+      dest.emit('error', er);
+  }
+  // This is a brutally ugly hack to make sure that our error handler
+  // is attached before any userland ones.  NEVER DO THIS.
+  if (!dest._events || !dest._events.error)
+    dest.on('error', onerror);
+  else if (isArray(dest._events.error))
+    dest._events.error.unshift(onerror);
+  else
+    dest._events.error = [onerror, dest._events.error];
+
+
+
+  // Both close and finish should trigger unpipe, but only once.
+  function onclose() {
+    dest.removeListener('finish', onfinish);
+    unpipe();
+  }
+  dest.once('close', onclose);
+  function onfinish() {
+    dest.removeListener('close', onclose);
+    unpipe();
+  }
+  dest.once('finish', onfinish);
+
+  function unpipe() {
+    src.unpipe(dest);
+  }
+
+  // tell the dest that it's being piped to
+  dest.emit('pipe', src);
+
+  // start the flow if it hasn't been started already.
+  if (!state.flowing) {
+    // the handler that waits for readable events after all
+    // the data gets sucked out in flow.
+    // This would be easier to follow with a .once() handler
+    // in flow(), but that is too slow.
+    this.on('readable', pipeOnReadable);
+
+    state.flowing = true;
+    process.nextTick(function() {
+      flow(src);
+    });
+  }
+
+  return dest;
+};
+
+function pipeOnDrain(src) {
+  return function() {
+    var dest = this;
+    var state = src._readableState;
+    state.awaitDrain--;
+    if (state.awaitDrain === 0)
+      flow(src);
+  };
+}
+
+function flow(src) {
+  var state = src._readableState;
+  var chunk;
+  state.awaitDrain = 0;
+
+  function write(dest, i, list) {
+    var written = dest.write(chunk);
+    if (false === written) {
+      state.awaitDrain++;
+    }
+  }
+
+  while (state.pipesCount && null !== (chunk = src.read())) {
+
+    if (state.pipesCount === 1)
+      write(state.pipes, 0, null);
+    else
+      forEach(state.pipes, write);
+
+    src.emit('data', chunk);
+
+    // if anyone needs a drain, then we have to wait for that.
+    if (state.awaitDrain > 0)
+      return;
+  }
+
+  // if every destination was unpiped, either before entering this
+  // function, or in the while loop, then stop flowing.
+  //
+  // NB: This is a pretty rare edge case.
+  if (state.pipesCount === 0) {
+    state.flowing = false;
+
+    // if there were data event listeners added, then switch to old mode.
+    if (EE.listenerCount(src, 'data') > 0)
+      emitDataEvents(src);
+    return;
+  }
+
+  // at this point, no one needed a drain, so we just ran out of data
+  // on the next readable event, start it over again.
+  state.ranOut = true;
+}
+
+function pipeOnReadable() {
+  if (this._readableState.ranOut) {
+    this._readableState.ranOut = false;
+    flow(this);
+  }
+}
+
+
+Readable.prototype.unpipe = function(dest) {
+  var state = this._readableState;
+
+  // if we're not piping anywhere, then do nothing.
+  if (state.pipesCount === 0)
+    return this;
+
+  // just one destination.  most common case.
+  if (state.pipesCount === 1) {
+    // passed in one, but it's not the right one.
+    if (dest && dest !== state.pipes)
+      return this;
+
+    if (!dest)
+      dest = state.pipes;
+
+    // got a match.
+    state.pipes = null;
+    state.pipesCount = 0;
+    this.removeListener('readable', pipeOnReadable);
+    state.flowing = false;
+    if (dest)
+      dest.emit('unpipe', this);
+    return this;
+  }
+
+  // slow case. multiple pipe destinations.
+
+  if (!dest) {
+    // remove all.
+    var dests = state.pipes;
+    var len = state.pipesCount;
+    state.pipes = null;
+    state.pipesCount = 0;
+    this.removeListener('readable', pipeOnReadable);
+    state.flowing = false;
+
+    for (var i = 0; i < len; i++)
+      dests[i].emit('unpipe', this);
+    return this;
+  }
+
+  // try to find the right one.
+  var i = indexOf(state.pipes, dest);
+  if (i === -1)
+    return this;
+
+  state.pipes.splice(i, 1);
+  state.pipesCount -= 1;
+  if (state.pipesCount === 1)
+    state.pipes = state.pipes[0];
+
+  dest.emit('unpipe', this);
+
+  return this;
+};
+
+// set up data events if they are asked for
+// Ensure readable listeners eventually get something
+Readable.prototype.on = function(ev, fn) {
+  var res = Stream.prototype.on.call(this, ev, fn);
+
+  if (ev === 'data' && !this._readableState.flowing)
+    emitDataEvents(this);
+
+  if (ev === 'readable' && this.readable) {
+    var state = this._readableState;
+    if (!state.readableListening) {
+      state.readableListening = true;
+      state.emittedReadable = false;
+      state.needReadable = true;
+      if (!state.reading) {
+        this.read(0);
+      } else if (state.length) {
+        emitReadable(this, state);
+      }
+    }
+  }
+
+  return res;
+};
+Readable.prototype.addListener = Readable.prototype.on;
+
+// pause() and resume() are remnants of the legacy readable stream API
+// If the user uses them, then switch into old mode.
+Readable.prototype.resume = function() {
+  emitDataEvents(this);
+  this.read(0);
+  this.emit('resume');
+};
+
+Readable.prototype.pause = function() {
+  emitDataEvents(this, true);
+  this.emit('pause');
+};
+
+function emitDataEvents(stream, startPaused) {
+  var state = stream._readableState;
+
+  if (state.flowing) {
+    // https://github.com/isaacs/readable-stream/issues/16
+    throw new Error('Cannot switch to old mode now.');
+  }
+
+  var paused = startPaused || false;
+  var readable = false;
+
+  // convert to an old-style stream.
+  stream.readable = true;
+  stream.pipe = Stream.prototype.pipe;
+  stream.on = stream.addListener = Stream.prototype.on;
+
+  stream.on('readable', function() {
+    readable = true;
+
+    var c;
+    while (!paused && (null !== (c = stream.read())))
+      stream.emit('data', c);
+
+    if (c === null) {
+      readable = false;
+      stream._readableState.needReadable = true;
+    }
+  });
+
+  stream.pause = function() {
+    paused = true;
+    this.emit('pause');
+  };
+
+  stream.resume = function() {
+    paused = false;
+    if (readable)
+      process.nextTick(function() {
+        stream.emit('readable');
+      });
+    else
+      this.read(0);
+    this.emit('resume');
+  };
+
+  // now make it start, just in case it hadn't already.
+  stream.emit('readable');
+}
+
+// wrap an old-style stream as the async data source.
+// This is *not* part of the readable stream interface.
+// It is an ugly unfortunate mess of history.
+Readable.prototype.wrap = function(stream) {
+  var state = this._readableState;
+  var paused = false;
+
+  var self = this;
+  stream.on('end', function() {
+    if (state.decoder && !state.ended) {
+      var chunk = state.decoder.end();
+      if (chunk && chunk.length)
+        self.push(chunk);
+    }
+
+    self.push(null);
+  });
+
+  stream.on('data', function(chunk) {
+    if (state.decoder)
+      chunk = state.decoder.write(chunk);
+
+    // don't skip over falsy values in objectMode
+    //if (state.objectMode && util.isNullOrUndefined(chunk))
+    if (state.objectMode && (chunk === null || chunk === undefined))
+      return;
+    else if (!state.objectMode && (!chunk || !chunk.length))
+      return;
+
+    var ret = self.push(chunk);
+    if (!ret) {
+      paused = true;
+      stream.pause();
+    }
+  });
+
+  // proxy all the other methods.
+  // important when wrapping filters and duplexes.
+  for (var i in stream) {
+    if (typeof stream[i] === 'function' &&
+        typeof this[i] === 'undefined') {
+      this[i] = function(method) { return function() {
+        return stream[method].apply(stream, arguments);
+      }}(i);
+    }
+  }
+
+  // proxy certain important events.
+  var events = ['error', 'close', 'destroy', 'pause', 'resume'];
+  forEach(events, function(ev) {
+    stream.on(ev, self.emit.bind(self, ev));
+  });
+
+  // when we try to consume some more bytes, simply unpause the
+  // underlying stream.
+  self._read = function(n) {
+    if (paused) {
+      paused = false;
+      stream.resume();
+    }
+  };
+
+  return self;
+};
+
+
+
+// exposed for testing purposes only.
+Readable._fromList = fromList;
+
+// Pluck off n bytes from an array of buffers.
+// Length is the combined lengths of all the buffers in the list.
+function fromList(n, state) {
+  var list = state.buffer;
+  var length = state.length;
+  var stringMode = !!state.decoder;
+  var objectMode = !!state.objectMode;
+  var ret;
+
+  // nothing in the list, definitely empty.
+  if (list.length === 0)
+    return null;
+
+  if (length === 0)
+    ret = null;
+  else if (objectMode)
+    ret = list.shift();
+  else if (!n || n >= length) {
+    // read it all, truncate the array.
+    if (stringMode)
+      ret = list.join('');
+    else
+      ret = Buffer.concat(list, length);
+    list.length = 0;
+  } else {
+    // read just some of it.
+    if (n < list[0].length) {
+      // just take a part of the first list item.
+      // slice is the same for buffers and strings.
+      var buf = list[0];
+      ret = buf.slice(0, n);
+      list[0] = buf.slice(n);
+    } else if (n === list[0].length) {
+      // first list is a perfect match
+      ret = list.shift();
+    } else {
+      // complex case.
+      // we have enough to cover it, but it spans past the first buffer.
+      if (stringMode)
+        ret = '';
+      else
+        ret = new Buffer(n);
+
+      var c = 0;
+      for (var i = 0, l = list.length; i < l && c < n; i++) {
+        var buf = list[0];
+        var cpy = Math.min(n - c, buf.length);
+
+        if (stringMode)
+          ret += buf.slice(0, cpy);
+        else
+          buf.copy(ret, c, 0, cpy);
+
+        if (cpy < buf.length)
+          list[0] = buf.slice(cpy);
+        else
+          list.shift();
+
+        c += cpy;
+      }
+    }
+  }
+
+  return ret;
+}
+
+function endReadable(stream) {
+  var state = stream._readableState;
+
+  // If we get here before consuming all the bytes, then that is a
+  // bug in node.  Should never happen.
+  if (state.length > 0)
+    throw new Error('endReadable called on non-empty stream');
+
+  if (!state.endEmitted && state.calledRead) {
+    state.ended = true;
+    process.nextTick(function() {
+      // Check that we didn't get one last unshift.
+      if (!state.endEmitted && state.length === 0) {
+        state.endEmitted = true;
+        stream.readable = false;
+        stream.emit('end');
+      }
+    });
+  }
+}
+
+function forEach (xs, f) {
+  for (var i = 0, l = xs.length; i < l; i++) {
+    f(xs[i], i);
+  }
+}
+
+function indexOf (xs, x) {
+  for (var i = 0, l = xs.length; i < l; i++) {
+    if (xs[i] === x) return i;
+  }
+  return -1;
+}
diff --git a/wrt/node_modules/readable-stream/lib/_stream_transform.js b/wrt/node_modules/readable-stream/lib/_stream_transform.js
new file mode 100644 (file)
index 0000000..eb188df
--- /dev/null
@@ -0,0 +1,210 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+// a transform stream is a readable/writable stream where you do
+// something with the data.  Sometimes it's called a "filter",
+// but that's not a great name for it, since that implies a thing where
+// some bits pass through, and others are simply ignored.  (That would
+// be a valid example of a transform, of course.)
+//
+// While the output is causally related to the input, it's not a
+// necessarily symmetric or synchronous transformation.  For example,
+// a zlib stream might take multiple plain-text writes(), and then
+// emit a single compressed chunk some time in the future.
+//
+// Here's how this works:
+//
+// The Transform stream has all the aspects of the readable and writable
+// stream classes.  When you write(chunk), that calls _write(chunk,cb)
+// internally, and returns false if there's a lot of pending writes
+// buffered up.  When you call read(), that calls _read(n) until
+// there's enough pending readable data buffered up.
+//
+// In a transform stream, the written data is placed in a buffer.  When
+// _read(n) is called, it transforms the queued up data, calling the
+// buffered _write cb's as it consumes chunks.  If consuming a single
+// written chunk would result in multiple output chunks, then the first
+// outputted bit calls the readcb, and subsequent chunks just go into
+// the read buffer, and will cause it to emit 'readable' if necessary.
+//
+// This way, back-pressure is actually determined by the reading side,
+// since _read has to be called to start processing a new chunk.  However,
+// a pathological inflate type of transform can cause excessive buffering
+// here.  For example, imagine a stream where every byte of input is
+// interpreted as an integer from 0-255, and then results in that many
+// bytes of output.  Writing the 4 bytes {ff,ff,ff,ff} would result in
+// 1kb of data being output.  In this case, you could write a very small
+// amount of input, and end up with a very large amount of output.  In
+// such a pathological inflating mechanism, there'd be no way to tell
+// the system to stop doing the transform.  A single 4MB write could
+// cause the system to run out of memory.
+//
+// However, even in such a pathological case, only a single written chunk
+// would be consumed, and then the rest would wait (un-transformed) until
+// the results of the previous transformed chunk were consumed.
+
+module.exports = Transform;
+
+var Duplex = require('./_stream_duplex');
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+util.inherits(Transform, Duplex);
+
+
+function TransformState(options, stream) {
+  this.afterTransform = function(er, data) {
+    return afterTransform(stream, er, data);
+  };
+
+  this.needTransform = false;
+  this.transforming = false;
+  this.writecb = null;
+  this.writechunk = null;
+}
+
+function afterTransform(stream, er, data) {
+  var ts = stream._transformState;
+  ts.transforming = false;
+
+  var cb = ts.writecb;
+
+  if (!cb)
+    return stream.emit('error', new Error('no writecb in Transform class'));
+
+  ts.writechunk = null;
+  ts.writecb = null;
+
+  if (data !== null && data !== undefined)
+    stream.push(data);
+
+  if (cb)
+    cb(er);
+
+  var rs = stream._readableState;
+  rs.reading = false;
+  if (rs.needReadable || rs.length < rs.highWaterMark) {
+    stream._read(rs.highWaterMark);
+  }
+}
+
+
+function Transform(options) {
+  if (!(this instanceof Transform))
+    return new Transform(options);
+
+  Duplex.call(this, options);
+
+  var ts = this._transformState = new TransformState(options, this);
+
+  // when the writable side finishes, then flush out anything remaining.
+  var stream = this;
+
+  // start out asking for a readable event once data is transformed.
+  this._readableState.needReadable = true;
+
+  // we have implemented the _read method, and done the other things
+  // that Readable wants before the first _read call, so unset the
+  // sync guard flag.
+  this._readableState.sync = false;
+
+  this.once('finish', function() {
+    if ('function' === typeof this._flush)
+      this._flush(function(er) {
+        done(stream, er);
+      });
+    else
+      done(stream);
+  });
+}
+
+Transform.prototype.push = function(chunk, encoding) {
+  this._transformState.needTransform = false;
+  return Duplex.prototype.push.call(this, chunk, encoding);
+};
+
+// This is the part where you do stuff!
+// override this function in implementation classes.
+// 'chunk' is an input chunk.
+//
+// Call `push(newChunk)` to pass along transformed output
+// to the readable side.  You may call 'push' zero or more times.
+//
+// Call `cb(err)` when you are done with this chunk.  If you pass
+// an error, then that'll put the hurt on the whole operation.  If you
+// never call cb(), then you'll never get another chunk.
+Transform.prototype._transform = function(chunk, encoding, cb) {
+  throw new Error('not implemented');
+};
+
+Transform.prototype._write = function(chunk, encoding, cb) {
+  var ts = this._transformState;
+  ts.writecb = cb;
+  ts.writechunk = chunk;
+  ts.writeencoding = encoding;
+  if (!ts.transforming) {
+    var rs = this._readableState;
+    if (ts.needTransform ||
+        rs.needReadable ||
+        rs.length < rs.highWaterMark)
+      this._read(rs.highWaterMark);
+  }
+};
+
+// Doesn't matter what the args are here.
+// _transform does all the work.
+// That we got here means that the readable side wants more data.
+Transform.prototype._read = function(n) {
+  var ts = this._transformState;
+
+  if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
+    ts.transforming = true;
+    this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
+  } else {
+    // mark that we need a transform, so that any data that comes in
+    // will get processed, now that we've asked for it.
+    ts.needTransform = true;
+  }
+};
+
+
+function done(stream, er) {
+  if (er)
+    return stream.emit('error', er);
+
+  // if there's nothing in the write buffer, then that means
+  // that nothing more will ever be provided
+  var ws = stream._writableState;
+  var rs = stream._readableState;
+  var ts = stream._transformState;
+
+  if (ws.length)
+    throw new Error('calling transform done when ws.length != 0');
+
+  if (ts.transforming)
+    throw new Error('calling transform done when still transforming');
+
+  return stream.push(null);
+}
diff --git a/wrt/node_modules/readable-stream/lib/_stream_writable.js b/wrt/node_modules/readable-stream/lib/_stream_writable.js
new file mode 100644 (file)
index 0000000..4bdaa4f
--- /dev/null
@@ -0,0 +1,386 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// A bit simpler than readable streams.
+// Implement an async ._write(chunk, cb), and it'll handle all
+// the drain event emission and buffering.
+
+module.exports = Writable;
+
+/*<replacement>*/
+var Buffer = require('buffer').Buffer;
+/*</replacement>*/
+
+Writable.WritableState = WritableState;
+
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+var Stream = require('stream');
+
+util.inherits(Writable, Stream);
+
+function WriteReq(chunk, encoding, cb) {
+  this.chunk = chunk;
+  this.encoding = encoding;
+  this.callback = cb;
+}
+
+function WritableState(options, stream) {
+  options = options || {};
+
+  // the point at which write() starts returning false
+  // Note: 0 is a valid value, means that we always return false if
+  // the entire buffer is not flushed immediately on write()
+  var hwm = options.highWaterMark;
+  this.highWaterMark = (hwm || hwm === 0) ? hwm : 16 * 1024;
+
+  // object stream flag to indicate whether or not this stream
+  // contains buffers or objects.
+  this.objectMode = !!options.objectMode;
+
+  // cast to ints.
+  this.highWaterMark = ~~this.highWaterMark;
+
+  this.needDrain = false;
+  // at the start of calling end()
+  this.ending = false;
+  // when end() has been called, and returned
+  this.ended = false;
+  // when 'finish' is emitted
+  this.finished = false;
+
+  // should we decode strings into buffers before passing to _write?
+  // this is here so that some node-core streams can optimize string
+  // handling at a lower level.
+  var noDecode = options.decodeStrings === false;
+  this.decodeStrings = !noDecode;
+
+  // Crypto is kind of old and crusty.  Historically, its default string
+  // encoding is 'binary' so we have to make this configurable.
+  // Everything else in the universe uses 'utf8', though.
+  this.defaultEncoding = options.defaultEncoding || 'utf8';
+
+  // not an actual buffer we keep track of, but a measurement
+  // of how much we're waiting to get pushed to some underlying
+  // socket or file.
+  this.length = 0;
+
+  // a flag to see when we're in the middle of a write.
+  this.writing = false;
+
+  // a flag to be able to tell if the onwrite cb is called immediately,
+  // or on a later tick.  We set this to true at first, becuase any
+  // actions that shouldn't happen until "later" should generally also
+  // not happen before the first write call.
+  this.sync = true;
+
+  // a flag to know if we're processing previously buffered items, which
+  // may call the _write() callback in the same tick, so that we don't
+  // end up in an overlapped onwrite situation.
+  this.bufferProcessing = false;
+
+  // the callback that's passed to _write(chunk,cb)
+  this.onwrite = function(er) {
+    onwrite(stream, er);
+  };
+
+  // the callback that the user supplies to write(chunk,encoding,cb)
+  this.writecb = null;
+
+  // the amount that is being written when _write is called.
+  this.writelen = 0;
+
+  this.buffer = [];
+
+  // True if the error was already emitted and should not be thrown again
+  this.errorEmitted = false;
+}
+
+function Writable(options) {
+  var Duplex = require('./_stream_duplex');
+
+  // Writable ctor is applied to Duplexes, though they're not
+  // instanceof Writable, they're instanceof Readable.
+  if (!(this instanceof Writable) && !(this instanceof Duplex))
+    return new Writable(options);
+
+  this._writableState = new WritableState(options, this);
+
+  // legacy.
+  this.writable = true;
+
+  Stream.call(this);
+}
+
+// Otherwise people can pipe Writable streams, which is just wrong.
+Writable.prototype.pipe = function() {
+  this.emit('error', new Error('Cannot pipe. Not readable.'));
+};
+
+
+function writeAfterEnd(stream, state, cb) {
+  var er = new Error('write after end');
+  // TODO: defer error events consistently everywhere, not just the cb
+  stream.emit('error', er);
+  process.nextTick(function() {
+    cb(er);
+  });
+}
+
+// If we get something that is not a buffer, string, null, or undefined,
+// and we're not in objectMode, then that's an error.
+// Otherwise stream chunks are all considered to be of length=1, and the
+// watermarks determine how many objects to keep in the buffer, rather than
+// how many bytes or characters.
+function validChunk(stream, state, chunk, cb) {
+  var valid = true;
+  if (!Buffer.isBuffer(chunk) &&
+      'string' !== typeof chunk &&
+      chunk !== null &&
+      chunk !== undefined &&
+      !state.objectMode) {
+    var er = new TypeError('Invalid non-string/buffer chunk');
+    stream.emit('error', er);
+    process.nextTick(function() {
+      cb(er);
+    });
+    valid = false;
+  }
+  return valid;
+}
+
+Writable.prototype.write = function(chunk, encoding, cb) {
+  var state = this._writableState;
+  var ret = false;
+
+  if (typeof encoding === 'function') {
+    cb = encoding;
+    encoding = null;
+  }
+
+  if (Buffer.isBuffer(chunk))
+    encoding = 'buffer';
+  else if (!encoding)
+    encoding = state.defaultEncoding;
+
+  if (typeof cb !== 'function')
+    cb = function() {};
+
+  if (state.ended)
+    writeAfterEnd(this, state, cb);
+  else if (validChunk(this, state, chunk, cb))
+    ret = writeOrBuffer(this, state, chunk, encoding, cb);
+
+  return ret;
+};
+
+function decodeChunk(state, chunk, encoding) {
+  if (!state.objectMode &&
+      state.decodeStrings !== false &&
+      typeof chunk === 'string') {
+    chunk = new Buffer(chunk, encoding);
+  }
+  return chunk;
+}
+
+// if we're already writing something, then just put this
+// in the queue, and wait our turn.  Otherwise, call _write
+// If we return false, then we need a drain event, so set that flag.
+function writeOrBuffer(stream, state, chunk, encoding, cb) {
+  chunk = decodeChunk(state, chunk, encoding);
+  if (Buffer.isBuffer(chunk))
+    encoding = 'buffer';
+  var len = state.objectMode ? 1 : chunk.length;
+
+  state.length += len;
+
+  var ret = state.length < state.highWaterMark;
+  // we must ensure that previous needDrain will not be reset to false.
+  if (!ret)
+    state.needDrain = true;
+
+  if (state.writing)
+    state.buffer.push(new WriteReq(chunk, encoding, cb));
+  else
+    doWrite(stream, state, len, chunk, encoding, cb);
+
+  return ret;
+}
+
+function doWrite(stream, state, len, chunk, encoding, cb) {
+  state.writelen = len;
+  state.writecb = cb;
+  state.writing = true;
+  state.sync = true;
+  stream._write(chunk, encoding, state.onwrite);
+  state.sync = false;
+}
+
+function onwriteError(stream, state, sync, er, cb) {
+  if (sync)
+    process.nextTick(function() {
+      cb(er);
+    });
+  else
+    cb(er);
+
+  stream._writableState.errorEmitted = true;
+  stream.emit('error', er);
+}
+
+function onwriteStateUpdate(state) {
+  state.writing = false;
+  state.writecb = null;
+  state.length -= state.writelen;
+  state.writelen = 0;
+}
+
+function onwrite(stream, er) {
+  var state = stream._writableState;
+  var sync = state.sync;
+  var cb = state.writecb;
+
+  onwriteStateUpdate(state);
+
+  if (er)
+    onwriteError(stream, state, sync, er, cb);
+  else {
+    // Check if we're actually ready to finish, but don't emit yet
+    var finished = needFinish(stream, state);
+
+    if (!finished && !state.bufferProcessing && state.buffer.length)
+      clearBuffer(stream, state);
+
+    if (sync) {
+      process.nextTick(function() {
+        afterWrite(stream, state, finished, cb);
+      });
+    } else {
+      afterWrite(stream, state, finished, cb);
+    }
+  }
+}
+
+function afterWrite(stream, state, finished, cb) {
+  if (!finished)
+    onwriteDrain(stream, state);
+  cb();
+  if (finished)
+    finishMaybe(stream, state);
+}
+
+// Must force callback to be called on nextTick, so that we don't
+// emit 'drain' before the write() consumer gets the 'false' return
+// value, and has a chance to attach a 'drain' listener.
+function onwriteDrain(stream, state) {
+  if (state.length === 0 && state.needDrain) {
+    state.needDrain = false;
+    stream.emit('drain');
+  }
+}
+
+
+// if there's something in the buffer waiting, then process it
+function clearBuffer(stream, state) {
+  state.bufferProcessing = true;
+
+  for (var c = 0; c < state.buffer.length; c++) {
+    var entry = state.buffer[c];
+    var chunk = entry.chunk;
+    var encoding = entry.encoding;
+    var cb = entry.callback;
+    var len = state.objectMode ? 1 : chunk.length;
+
+    doWrite(stream, state, len, chunk, encoding, cb);
+
+    // if we didn't call the onwrite immediately, then
+    // it means that we need to wait until it does.
+    // also, that means that the chunk and cb are currently
+    // being processed, so move the buffer counter past them.
+    if (state.writing) {
+      c++;
+      break;
+    }
+  }
+
+  state.bufferProcessing = false;
+  if (c < state.buffer.length)
+    state.buffer = state.buffer.slice(c);
+  else
+    state.buffer.length = 0;
+}
+
+Writable.prototype._write = function(chunk, encoding, cb) {
+  cb(new Error('not implemented'));
+};
+
+Writable.prototype.end = function(chunk, encoding, cb) {
+  var state = this._writableState;
+
+  if (typeof chunk === 'function') {
+    cb = chunk;
+    chunk = null;
+    encoding = null;
+  } else if (typeof encoding === 'function') {
+    cb = encoding;
+    encoding = null;
+  }
+
+  if (typeof chunk !== 'undefined' && chunk !== null)
+    this.write(chunk, encoding);
+
+  // ignore unnecessary end() calls.
+  if (!state.ending && !state.finished)
+    endWritable(this, state, cb);
+};
+
+
+function needFinish(stream, state) {
+  return (state.ending &&
+          state.length === 0 &&
+          !state.finished &&
+          !state.writing);
+}
+
+function finishMaybe(stream, state) {
+  var need = needFinish(stream, state);
+  if (need) {
+    state.finished = true;
+    stream.emit('finish');
+  }
+  return need;
+}
+
+function endWritable(stream, state, cb) {
+  state.ending = true;
+  finishMaybe(stream, state);
+  if (cb) {
+    if (state.finished)
+      process.nextTick(cb);
+    else
+      stream.once('finish', cb);
+  }
+  state.ended = true;
+}
diff --git a/wrt/node_modules/readable-stream/package.json b/wrt/node_modules/readable-stream/package.json
new file mode 100644 (file)
index 0000000..929bd2e
--- /dev/null
@@ -0,0 +1,115 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "readable-stream@~1.0.31",
+        "scope": null,
+        "escapedName": "readable-stream",
+        "name": "readable-stream",
+        "rawSpec": "~1.0.31",
+        "spec": ">=1.0.31 <1.1.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/unzip"
+    ]
+  ],
+  "_from": "readable-stream@>=1.0.31 <1.1.0",
+  "_id": "readable-stream@1.0.34",
+  "_inCache": true,
+  "_location": "/readable-stream",
+  "_nodeVersion": "5.10.1",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/readable-stream-1.0.34.tgz_1460562521506_0.019665231462568045"
+  },
+  "_npmUser": {
+    "name": "cwmma",
+    "email": "calvin.metcalf@gmail.com"
+  },
+  "_npmVersion": "3.8.3",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "readable-stream@~1.0.31",
+    "scope": null,
+    "escapedName": "readable-stream",
+    "name": "readable-stream",
+    "rawSpec": "~1.0.31",
+    "spec": ">=1.0.31 <1.1.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/match-stream",
+    "/pullstream",
+    "/slice-stream",
+    "/unzip"
+  ],
+  "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz",
+  "_shasum": "125820e34bc842d2f2aaafafe4c2916ee32c157c",
+  "_shrinkwrap": null,
+  "_spec": "readable-stream@~1.0.31",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/unzip",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "browser": {
+    "util": false
+  },
+  "bugs": {
+    "url": "https://github.com/isaacs/readable-stream/issues"
+  },
+  "dependencies": {
+    "core-util-is": "~1.0.0",
+    "inherits": "~2.0.1",
+    "isarray": "0.0.1",
+    "string_decoder": "~0.10.x"
+  },
+  "description": "Streams2, a user-land copy of the stream library from Node.js v0.10.x",
+  "devDependencies": {
+    "tap": "~0.2.6"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "125820e34bc842d2f2aaafafe4c2916ee32c157c",
+    "tarball": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz"
+  },
+  "gitHead": "1227c7b66deedb1dc5284a89425854d5f7ad9576",
+  "homepage": "https://github.com/isaacs/readable-stream#readme",
+  "keywords": [
+    "readable",
+    "stream",
+    "pipe"
+  ],
+  "license": "MIT",
+  "main": "readable.js",
+  "maintainers": [
+    {
+      "name": "isaacs",
+      "email": "isaacs@npmjs.com"
+    },
+    {
+      "name": "tootallnate",
+      "email": "nathan@tootallnate.net"
+    },
+    {
+      "name": "rvagg",
+      "email": "rod@vagg.org"
+    },
+    {
+      "name": "cwmma",
+      "email": "calvin.metcalf@gmail.com"
+    }
+  ],
+  "name": "readable-stream",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/readable-stream.git"
+  },
+  "scripts": {
+    "test": "tap test/simple/*.js"
+  },
+  "version": "1.0.34"
+}
diff --git a/wrt/node_modules/readable-stream/passthrough.js b/wrt/node_modules/readable-stream/passthrough.js
new file mode 100644 (file)
index 0000000..27e8d8a
--- /dev/null
@@ -0,0 +1 @@
+module.exports = require("./lib/_stream_passthrough.js")
diff --git a/wrt/node_modules/readable-stream/readable.js b/wrt/node_modules/readable-stream/readable.js
new file mode 100644 (file)
index 0000000..26511e8
--- /dev/null
@@ -0,0 +1,11 @@
+var Stream = require('stream'); // hack to fix a circular dependency issue when used with browserify
+exports = module.exports = require('./lib/_stream_readable.js');
+exports.Stream = Stream;
+exports.Readable = exports;
+exports.Writable = require('./lib/_stream_writable.js');
+exports.Duplex = require('./lib/_stream_duplex.js');
+exports.Transform = require('./lib/_stream_transform.js');
+exports.PassThrough = require('./lib/_stream_passthrough.js');
+if (!process.browser && process.env.READABLE_STREAM === 'disable') {
+  module.exports = require('stream');
+}
diff --git a/wrt/node_modules/readable-stream/transform.js b/wrt/node_modules/readable-stream/transform.js
new file mode 100644 (file)
index 0000000..5d482f0
--- /dev/null
@@ -0,0 +1 @@
+module.exports = require("./lib/_stream_transform.js")
diff --git a/wrt/node_modules/readable-stream/writable.js b/wrt/node_modules/readable-stream/writable.js
new file mode 100644 (file)
index 0000000..e1e9efd
--- /dev/null
@@ -0,0 +1 @@
+module.exports = require("./lib/_stream_writable.js")
diff --git a/wrt/node_modules/repeat-string/LICENSE b/wrt/node_modules/repeat-string/LICENSE
new file mode 100644 (file)
index 0000000..39245ac
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014-2016, Jon Schlinkert.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/repeat-string/README.md b/wrt/node_modules/repeat-string/README.md
new file mode 100644 (file)
index 0000000..aaa5e91
--- /dev/null
@@ -0,0 +1,136 @@
+# repeat-string [![NPM version](https://img.shields.io/npm/v/repeat-string.svg?style=flat)](https://www.npmjs.com/package/repeat-string) [![NPM monthly downloads](https://img.shields.io/npm/dm/repeat-string.svg?style=flat)](https://npmjs.org/package/repeat-string)  [![NPM total downloads](https://img.shields.io/npm/dt/repeat-string.svg?style=flat)](https://npmjs.org/package/repeat-string) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/repeat-string.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/repeat-string)
+
+> Repeat the given string n times. Fastest implementation for repeating a string.
+
+## Install
+
+Install with [npm](https://www.npmjs.com/):
+
+```sh
+$ npm install --save repeat-string
+```
+
+## Usage
+
+### [repeat](index.js#L41)
+
+Repeat the given `string` the specified `number` of times.
+
+**Example:**
+
+**Example**
+
+```js
+var repeat = require('repeat-string');
+repeat('A', 5);
+//=> AAAAA
+```
+
+**Params**
+
+* `string` **{String}**: The string to repeat
+* `number` **{Number}**: The number of times to repeat the string
+* `returns` **{String}**: Repeated string
+
+## Benchmarks
+
+Repeat string is significantly faster than the native method (which is itself faster than [repeating](https://github.com/sindresorhus/repeating)):
+
+```sh
+# 2x
+repeat-string  █████████████████████████  (26,953,977 ops/sec)
+repeating      █████████                  (9,855,695 ops/sec)
+native         ██████████████████         (19,453,895 ops/sec)
+
+# 3x
+repeat-string  █████████████████████████  (19,445,252 ops/sec)
+repeating      ███████████                (8,661,565 ops/sec)
+native         ████████████████████       (16,020,598 ops/sec)
+
+# 10x
+repeat-string  █████████████████████████  (23,792,521 ops/sec)
+repeating      █████████                  (8,571,332 ops/sec)
+native         ███████████████            (14,582,955 ops/sec)
+
+# 50x
+repeat-string  █████████████████████████  (23,640,179 ops/sec)
+repeating      █████                      (5,505,509 ops/sec)
+native         ██████████                 (10,085,557 ops/sec)
+
+# 250x
+repeat-string  █████████████████████████  (23,489,618 ops/sec)
+repeating      ████                       (3,962,937 ops/sec)
+native         ████████                   (7,724,892 ops/sec)
+
+# 2000x
+repeat-string  █████████████████████████  (20,315,172 ops/sec)
+repeating      ████                       (3,297,079 ops/sec)
+native         ███████                    (6,203,331 ops/sec)
+
+# 20000x
+repeat-string  █████████████████████████  (23,382,915 ops/sec)
+repeating      ███                        (2,980,058 ops/sec)
+native         █████                      (5,578,808 ops/sec)
+```
+
+**Run the benchmarks**
+
+Install dev dependencies:
+
+```sh
+npm i -d && node benchmark
+```
+
+## About
+
+### Related projects
+
+[repeat-element](https://www.npmjs.com/package/repeat-element): Create an array by repeating the given value n times. | [homepage](https://github.com/jonschlinkert/repeat-element "Create an array by repeating the given value n times.")
+
+### Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
+
+### Contributors
+
+| **Commits** | **Contributor**<br/> | 
+| --- | --- |
+| 51 | [jonschlinkert](https://github.com/jonschlinkert) |
+| 2 | [LinusU](https://github.com/LinusU) |
+| 2 | [tbusser](https://github.com/tbusser) |
+| 1 | [doowb](https://github.com/doowb) |
+| 1 | [wooorm](https://github.com/wooorm) |
+
+### Building docs
+
+_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_
+
+To generate the readme and API documentation with [verb](https://github.com/verbose/verb):
+
+```sh
+$ npm install -g verb verb-generate-readme && verb
+```
+
+### Running tests
+
+Install dev dependencies:
+
+```sh
+$ npm install -d && npm test
+```
+
+### Author
+
+**Jon Schlinkert**
+
+* [github/jonschlinkert](https://github.com/jonschlinkert)
+* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
+
+### License
+
+Copyright © 2016, [Jon Schlinkert](http://github.com/jonschlinkert).
+Released under the [MIT license](https://github.com/jonschlinkert/repeat-string/blob/master/LICENSE).
+
+***
+
+_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on October 23, 2016._
\ No newline at end of file
diff --git a/wrt/node_modules/repeat-string/index.js b/wrt/node_modules/repeat-string/index.js
new file mode 100644 (file)
index 0000000..4459afd
--- /dev/null
@@ -0,0 +1,70 @@
+/*!
+ * repeat-string <https://github.com/jonschlinkert/repeat-string>
+ *
+ * Copyright (c) 2014-2015, Jon Schlinkert.
+ * Licensed under the MIT License.
+ */
+
+'use strict';
+
+/**
+ * Results cache
+ */
+
+var res = '';
+var cache;
+
+/**
+ * Expose `repeat`
+ */
+
+module.exports = repeat;
+
+/**
+ * Repeat the given `string` the specified `number`
+ * of times.
+ *
+ * **Example:**
+ *
+ * ```js
+ * var repeat = require('repeat-string');
+ * repeat('A', 5);
+ * //=> AAAAA
+ * ```
+ *
+ * @param {String} `string` The string to repeat
+ * @param {Number} `number` The number of times to repeat the string
+ * @return {String} Repeated string
+ * @api public
+ */
+
+function repeat(str, num) {
+  if (typeof str !== 'string') {
+    throw new TypeError('expected a string');
+  }
+
+  // cover common, quick use cases
+  if (num === 1) return str;
+  if (num === 2) return str + str;
+
+  var max = str.length * num;
+  if (cache !== str || typeof cache === 'undefined') {
+    cache = str;
+    res = '';
+  } else if (res.length >= max) {
+    return res.substr(0, max);
+  }
+
+  while (max > res.length && num > 1) {
+    if (num & 1) {
+      res += str;
+    }
+
+    num >>= 1;
+    str += str;
+  }
+
+  res += str;
+  res = res.substr(0, max);
+  return res;
+}
diff --git a/wrt/node_modules/repeat-string/package.json b/wrt/node_modules/repeat-string/package.json
new file mode 100644 (file)
index 0000000..0081942
--- /dev/null
@@ -0,0 +1,128 @@
+{
+  "_from": "repeat-string@^1.5.2",
+  "_id": "repeat-string@1.6.1",
+  "_inBundle": false,
+  "_integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=",
+  "_location": "/repeat-string",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "repeat-string@^1.5.2",
+    "name": "repeat-string",
+    "escapedName": "repeat-string",
+    "rawSpec": "^1.5.2",
+    "saveSpec": null,
+    "fetchSpec": "^1.5.2"
+  },
+  "_requiredBy": [
+    "/align-text"
+  ],
+  "_resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz",
+  "_shasum": "8dcae470e1c88abc2d600fff4a776286da75e637",
+  "_spec": "repeat-string@^1.5.2",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was/node_modules/align-text",
+  "author": {
+    "name": "Jon Schlinkert",
+    "url": "http://github.com/jonschlinkert"
+  },
+  "bugs": {
+    "url": "https://github.com/jonschlinkert/repeat-string/issues"
+  },
+  "bundleDependencies": false,
+  "contributors": [
+    {
+      "name": "Brian Woodward",
+      "email": "brian.woodward@gmail.com",
+      "url": "https://github.com/doowb"
+    },
+    {
+      "name": "Jon Schlinkert",
+      "email": "jon.schlinkert@sellside.com",
+      "url": "http://twitter.com/jonschlinkert"
+    },
+    {
+      "name": "Linus Unnebäck",
+      "email": "linus@folkdatorn.se",
+      "url": "http://linus.unnebäck.se"
+    },
+    {
+      "name": "Thijs Busser",
+      "email": "tbusser@gmail.com",
+      "url": "http://tbusser.net"
+    },
+    {
+      "name": "Titus",
+      "email": "tituswormer@gmail.com",
+      "url": "wooorm.com"
+    }
+  ],
+  "deprecated": false,
+  "description": "Repeat the given string n times. Fastest implementation for repeating a string.",
+  "devDependencies": {
+    "ansi-cyan": "^0.1.1",
+    "benchmarked": "^0.2.5",
+    "gulp-format-md": "^0.1.11",
+    "isobject": "^2.1.0",
+    "mocha": "^3.1.2",
+    "repeating": "^3.0.0",
+    "text-table": "^0.2.0",
+    "yargs-parser": "^4.0.2"
+  },
+  "engines": {
+    "node": ">=0.10"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/jonschlinkert/repeat-string",
+  "keywords": [
+    "fast",
+    "fastest",
+    "fill",
+    "left",
+    "left-pad",
+    "multiple",
+    "pad",
+    "padding",
+    "repeat",
+    "repeating",
+    "repetition",
+    "right",
+    "right-pad",
+    "string",
+    "times"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "name": "repeat-string",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/jonschlinkert/repeat-string.git"
+  },
+  "scripts": {
+    "test": "mocha"
+  },
+  "verb": {
+    "toc": false,
+    "layout": "default",
+    "tasks": [
+      "readme"
+    ],
+    "plugins": [
+      "gulp-format-md"
+    ],
+    "related": {
+      "list": [
+        "repeat-element"
+      ]
+    },
+    "helpers": [
+      "./benchmark/helper.js"
+    ],
+    "reflinks": [
+      "verb"
+    ]
+  },
+  "version": "1.6.1"
+}
diff --git a/wrt/node_modules/right-align/LICENSE b/wrt/node_modules/right-align/LICENSE
new file mode 100644 (file)
index 0000000..65f90ac
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2015, Jon Schlinkert.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/right-align/README.md b/wrt/node_modules/right-align/README.md
new file mode 100644 (file)
index 0000000..3abdfb3
--- /dev/null
@@ -0,0 +1,77 @@
+# right-align [![NPM version](https://badge.fury.io/js/right-align.svg)](http://badge.fury.io/js/right-align)
+
+> Right-align the text in a string.
+
+Install with [npm](https://www.npmjs.com/)
+
+```sh
+$ npm i right-align --save
+```
+
+## Usage
+
+```js
+var rightAlign = require('right-align');
+rightAlign(string);
+```
+
+**Example**
+
+If used on the following:
+
+```
+Lorem ipsum dolor sit amet,
+consectetur adipiscing
+elit, sed do eiusmod tempor incididunt
+ut labore et dolore
+magna aliqua. Ut enim ad minim
+veniam, quis
+```
+
+The result would be:
+
+```
+           Lorem ipsum dolor sit amet,
+                consectetur adipiscing
+elit, sed do eiusmod tempor incididunt
+                   ut labore et dolore
+        magna aliqua. Ut enim ad minim
+                          veniam, quis
+```
+
+## Related projects
+
+* [align-text](https://github.com/jonschlinkert/align-text): Align the text in a string.
+* [center-align](https://github.com/jonschlinkert/center-align): Center-align the text in a string.
+* [justify](https://github.com/bahamas10/node-justify): Left or right (or both) justify text using a custom width and character
+* [repeat-string](https://github.com/jonschlinkert/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string.
+* [repeat-element](https://github.com/jonschlinkert/repeat-element): Create an array by repeating the given value n times.
+* [word-wrap](https://github.com/jonschlinkert/word-wrap): Wrap words to a specified length.
+
+## Running tests
+
+Install dev dependencies:
+
+```sh
+$ npm i -d && npm test
+```
+
+## Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/right-align/issues/new)
+
+## Author
+
+**Jon Schlinkert**
+
++ [github/jonschlinkert](https://github.com/jonschlinkert)
++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
+
+## License
+
+Copyright © 2015 Jon Schlinkert
+Released under the MIT license.
+
+***
+
+_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 09, 2015._
diff --git a/wrt/node_modules/right-align/index.js b/wrt/node_modules/right-align/index.js
new file mode 100644 (file)
index 0000000..ad54f5f
--- /dev/null
@@ -0,0 +1,16 @@
+/*!
+ * right-align <https://github.com/jonschlinkert/right-align>
+ *
+ * Copyright (c) 2015, Jon Schlinkert.
+ * Licensed under the MIT License.
+ */
+
+'use strict';
+
+var align = require('align-text');
+
+module.exports = function rightAlign(val) {
+  return align(val, function (len, longest) {
+    return longest - len;
+  });
+};
diff --git a/wrt/node_modules/right-align/package.json b/wrt/node_modules/right-align/package.json
new file mode 100644 (file)
index 0000000..cda4cbe
--- /dev/null
@@ -0,0 +1,70 @@
+{
+  "_from": "right-align@^0.1.1",
+  "_id": "right-align@0.1.3",
+  "_inBundle": false,
+  "_integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=",
+  "_location": "/right-align",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "right-align@^0.1.1",
+    "name": "right-align",
+    "escapedName": "right-align",
+    "rawSpec": "^0.1.1",
+    "saveSpec": null,
+    "fetchSpec": "^0.1.1"
+  },
+  "_requiredBy": [
+    "/yargs/cliui"
+  ],
+  "_resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz",
+  "_shasum": "61339b722fe6a3515689210d24e14c96148613ef",
+  "_spec": "right-align@^0.1.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was/node_modules/yargs/node_modules/cliui",
+  "author": {
+    "name": "Jon Schlinkert",
+    "url": "https://github.com/jonschlinkert"
+  },
+  "bugs": {
+    "url": "https://github.com/jonschlinkert/right-align/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {
+    "align-text": "^0.1.1"
+  },
+  "deprecated": false,
+  "description": "Right-align the text in a string.",
+  "devDependencies": {
+    "mocha": "*",
+    "should": "*"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/jonschlinkert/right-align",
+  "keywords": [
+    "align",
+    "align-center",
+    "center",
+    "center-align",
+    "right",
+    "right-align",
+    "text",
+    "typography"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "name": "right-align",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/jonschlinkert/right-align.git"
+  },
+  "scripts": {
+    "test": "mocha"
+  },
+  "version": "0.1.3"
+}
diff --git a/wrt/node_modules/rimraf/LICENSE b/wrt/node_modules/rimraf/LICENSE
new file mode 100644 (file)
index 0000000..19129e3
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/wrt/node_modules/rimraf/README.md b/wrt/node_modules/rimraf/README.md
new file mode 100644 (file)
index 0000000..423b8cf
--- /dev/null
@@ -0,0 +1,101 @@
+[![Build Status](https://travis-ci.org/isaacs/rimraf.svg?branch=master)](https://travis-ci.org/isaacs/rimraf) [![Dependency Status](https://david-dm.org/isaacs/rimraf.svg)](https://david-dm.org/isaacs/rimraf) [![devDependency Status](https://david-dm.org/isaacs/rimraf/dev-status.svg)](https://david-dm.org/isaacs/rimraf#info=devDependencies)
+
+The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node.
+
+Install with `npm install rimraf`, or just drop rimraf.js somewhere.
+
+## API
+
+`rimraf(f, [opts], callback)`
+
+The first parameter will be interpreted as a globbing pattern for files. If you
+want to disable globbing you can do so with `opts.disableGlob` (defaults to
+`false`). This might be handy, for instance, if you have filenames that contain
+globbing wildcard characters.
+
+The callback will be called with an error if there is one.  Certain
+errors are handled for you:
+
+* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of
+  `opts.maxBusyTries` times before giving up, adding 100ms of wait
+  between each attempt.  The default `maxBusyTries` is 3.
+* `ENOENT` - If the file doesn't exist, rimraf will return
+  successfully, since your desired outcome is already the case.
+* `EMFILE` - Since `readdir` requires opening a file descriptor, it's
+  possible to hit `EMFILE` if too many file descriptors are in use.
+  In the sync case, there's nothing to be done for this.  But in the
+  async case, rimraf will gradually back off with timeouts up to
+  `opts.emfileWait` ms, which defaults to 1000.
+
+## options
+
+* unlink, chmod, stat, lstat, rmdir, readdir,
+  unlinkSync, chmodSync, statSync, lstatSync, rmdirSync, readdirSync
+
+    In order to use a custom file system library, you can override
+    specific fs functions on the options object.
+
+    If any of these functions are present on the options object, then
+    the supplied function will be used instead of the default fs
+    method.
+
+    Sync methods are only relevant for `rimraf.sync()`, of course.
+
+    For example:
+
+    ```javascript
+    var myCustomFS = require('some-custom-fs')
+
+    rimraf('some-thing', myCustomFS, callback)
+    ```
+
+* maxBusyTries
+
+    If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error code is encountered
+    on Windows systems, then rimraf will retry with a linear backoff
+    wait of 100ms longer on each try.  The default maxBusyTries is 3.
+
+    Only relevant for async usage.
+
+* emfileWait
+
+    If an `EMFILE` error is encountered, then rimraf will retry
+    repeatedly with a linear backoff of 1ms longer on each try, until
+    the timeout counter hits this max.  The default limit is 1000.
+
+    If you repeatedly encounter `EMFILE` errors, then consider using
+    [graceful-fs](http://npm.im/graceful-fs) in your program.
+
+    Only relevant for async usage.
+
+* glob
+
+    Set to `false` to disable [glob](http://npm.im/glob) pattern
+    matching.
+
+    Set to an object to pass options to the glob module.  The default
+    glob options are `{ nosort: true, silent: true }`.
+
+    Glob version 6 is used in this module.
+
+    Relevant for both sync and async usage.
+
+* disableGlob
+
+    Set to any non-falsey value to disable globbing entirely.
+    (Equivalent to setting `glob: false`.)
+
+## rimraf.sync
+
+It can remove stuff synchronously, too.  But that's not so good.  Use
+the async API.  It's better.
+
+## CLI
+
+If installed with `npm install rimraf -g` it can be used as a global
+command `rimraf <path> [<path> ...]` which is useful for cross platform support.
+
+## mkdirp
+
+If you need to create a directory recursively, check out
+[mkdirp](https://github.com/substack/node-mkdirp).
diff --git a/wrt/node_modules/rimraf/bin.js b/wrt/node_modules/rimraf/bin.js
new file mode 100755 (executable)
index 0000000..0d1e17b
--- /dev/null
@@ -0,0 +1,50 @@
+#!/usr/bin/env node
+
+var rimraf = require('./')
+
+var help = false
+var dashdash = false
+var noglob = false
+var args = process.argv.slice(2).filter(function(arg) {
+  if (dashdash)
+    return !!arg
+  else if (arg === '--')
+    dashdash = true
+  else if (arg === '--no-glob' || arg === '-G')
+    noglob = true
+  else if (arg === '--glob' || arg === '-g')
+    noglob = false
+  else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/))
+    help = true
+  else
+    return !!arg
+})
+
+if (help || args.length === 0) {
+  // If they didn't ask for help, then this is not a "success"
+  var log = help ? console.log : console.error
+  log('Usage: rimraf <path> [<path> ...]')
+  log('')
+  log('  Deletes all files and folders at "path" recursively.')
+  log('')
+  log('Options:')
+  log('')
+  log('  -h, --help     Display this usage info')
+  log('  -G, --no-glob  Do not expand glob patterns in arguments')
+  log('  -g, --glob     Expand glob patterns in arguments (default)')
+  process.exit(help ? 0 : 1)
+} else
+  go(0)
+
+function go (n) {
+  if (n >= args.length)
+    return
+  var options = {}
+  if (noglob)
+    options = { glob: false }
+  rimraf(args[n], options, function (er) {
+    if (er)
+      throw er
+    go(n+1)
+  })
+}
diff --git a/wrt/node_modules/rimraf/node_modules/glob/LICENSE b/wrt/node_modules/rimraf/node_modules/glob/LICENSE
new file mode 100644 (file)
index 0000000..19129e3
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/wrt/node_modules/rimraf/node_modules/glob/README.md b/wrt/node_modules/rimraf/node_modules/glob/README.md
new file mode 100644 (file)
index 0000000..baa1d1b
--- /dev/null
@@ -0,0 +1,368 @@
+# Glob
+
+Match files using the patterns the shell uses, like stars and stuff.
+
+[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master)
+
+This is a glob implementation in JavaScript.  It uses the `minimatch`
+library to do its matching.
+
+![](oh-my-glob.gif)
+
+## Usage
+
+Install with npm
+
+```
+npm i glob
+```
+
+```javascript
+var glob = require("glob")
+
+// options is optional
+glob("**/*.js", options, function (er, files) {
+  // files is an array of filenames.
+  // If the `nonull` option is set, and nothing
+  // was found, then files is ["**/*.js"]
+  // er is an error object or null.
+})
+```
+
+## Glob Primer
+
+"Globs" are the patterns you type when you do stuff like `ls *.js` on
+the command line, or put `build/*` in a `.gitignore` file.
+
+Before parsing the path part patterns, braced sections are expanded
+into a set.  Braced sections start with `{` and end with `}`, with any
+number of comma-delimited sections within.  Braced sections may contain
+slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`.
+
+The following characters have special magic meaning when used in a
+path portion:
+
+* `*` Matches 0 or more characters in a single path portion
+* `?` Matches 1 character
+* `[...]` Matches a range of characters, similar to a RegExp range.
+  If the first character of the range is `!` or `^` then it matches
+  any character not in the range.
+* `!(pattern|pattern|pattern)` Matches anything that does not match
+  any of the patterns provided.
+* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the
+  patterns provided.
+* `+(pattern|pattern|pattern)` Matches one or more occurrences of the
+  patterns provided.
+* `*(a|b|c)` Matches zero or more occurrences of the patterns provided
+* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns
+  provided
+* `**` If a "globstar" is alone in a path portion, then it matches
+  zero or more directories and subdirectories searching for matches.
+  It does not crawl symlinked directories.
+
+### Dots
+
+If a file or directory path portion has a `.` as the first character,
+then it will not match any glob pattern unless that pattern's
+corresponding path part also has a `.` as its first character.
+
+For example, the pattern `a/.*/c` would match the file at `a/.b/c`.
+However the pattern `a/*/c` would not, because `*` does not start with
+a dot character.
+
+You can make glob treat dots as normal characters by setting
+`dot:true` in the options.
+
+### Basename Matching
+
+If you set `matchBase:true` in the options, and the pattern has no
+slashes in it, then it will seek for any file anywhere in the tree
+with a matching basename.  For example, `*.js` would match
+`test/simple/basic.js`.
+
+### Empty Sets
+
+If no matching files are found, then an empty array is returned.  This
+differs from the shell, where the pattern itself is returned.  For
+example:
+
+    $ echo a*s*d*f
+    a*s*d*f
+
+To get the bash-style behavior, set the `nonull:true` in the options.
+
+### See Also:
+
+* `man sh`
+* `man bash` (Search for "Pattern Matching")
+* `man 3 fnmatch`
+* `man 5 gitignore`
+* [minimatch documentation](https://github.com/isaacs/minimatch)
+
+## glob.hasMagic(pattern, [options])
+
+Returns `true` if there are any special characters in the pattern, and
+`false` otherwise.
+
+Note that the options affect the results.  If `noext:true` is set in
+the options object, then `+(a|b)` will not be considered a magic
+pattern.  If the pattern has a brace expansion, like `a/{b/c,x/y}`
+then that is considered magical, unless `nobrace:true` is set in the
+options.
+
+## glob(pattern, [options], cb)
+
+* `pattern` `{String}` Pattern to be matched
+* `options` `{Object}`
+* `cb` `{Function}`
+  * `err` `{Error | null}`
+  * `matches` `{Array<String>}` filenames found matching the pattern
+
+Perform an asynchronous glob search.
+
+## glob.sync(pattern, [options])
+
+* `pattern` `{String}` Pattern to be matched
+* `options` `{Object}`
+* return: `{Array<String>}` filenames found matching the pattern
+
+Perform a synchronous glob search.
+
+## Class: glob.Glob
+
+Create a Glob object by instantiating the `glob.Glob` class.
+
+```javascript
+var Glob = require("glob").Glob
+var mg = new Glob(pattern, options, cb)
+```
+
+It's an EventEmitter, and starts walking the filesystem to find matches
+immediately.
+
+### new glob.Glob(pattern, [options], [cb])
+
+* `pattern` `{String}` pattern to search for
+* `options` `{Object}`
+* `cb` `{Function}` Called when an error occurs, or matches are found
+  * `err` `{Error | null}`
+  * `matches` `{Array<String>}` filenames found matching the pattern
+
+Note that if the `sync` flag is set in the options, then matches will
+be immediately available on the `g.found` member.
+
+### Properties
+
+* `minimatch` The minimatch object that the glob uses.
+* `options` The options object passed in.
+* `aborted` Boolean which is set to true when calling `abort()`.  There
+  is no way at this time to continue a glob search after aborting, but
+  you can re-use the statCache to avoid having to duplicate syscalls.
+* `cache` Convenience object.  Each field has the following possible
+  values:
+  * `false` - Path does not exist
+  * `true` - Path exists
+  * `'FILE'` - Path exists, and is not a directory
+  * `'DIR'` - Path exists, and is a directory
+  * `[file, entries, ...]` - Path exists, is a directory, and the
+    array value is the results of `fs.readdir`
+* `statCache` Cache of `fs.stat` results, to prevent statting the same
+  path multiple times.
+* `symlinks` A record of which paths are symbolic links, which is
+  relevant in resolving `**` patterns.
+* `realpathCache` An optional object which is passed to `fs.realpath`
+  to minimize unnecessary syscalls.  It is stored on the instantiated
+  Glob object, and may be re-used.
+
+### Events
+
+* `end` When the matching is finished, this is emitted with all the
+  matches found.  If the `nonull` option is set, and no match was found,
+  then the `matches` list contains the original pattern.  The matches
+  are sorted, unless the `nosort` flag is set.
+* `match` Every time a match is found, this is emitted with the specific
+  thing that matched. It is not deduplicated or resolved to a realpath.
+* `error` Emitted when an unexpected error is encountered, or whenever
+  any fs error occurs if `options.strict` is set.
+* `abort` When `abort()` is called, this event is raised.
+
+### Methods
+
+* `pause` Temporarily stop the search
+* `resume` Resume the search
+* `abort` Stop the search forever
+
+### Options
+
+All the options that can be passed to Minimatch can also be passed to
+Glob to change pattern matching behavior.  Also, some have been added,
+or have glob-specific ramifications.
+
+All options are false by default, unless otherwise noted.
+
+All options are added to the Glob object, as well.
+
+If you are running many `glob` operations, you can pass a Glob object
+as the `options` argument to a subsequent operation to shortcut some
+`stat` and `readdir` calls.  At the very least, you may pass in shared
+`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that
+parallel glob operations will be sped up by sharing information about
+the filesystem.
+
+* `cwd` The current working directory in which to search.  Defaults
+  to `process.cwd()`.
+* `root` The place where patterns starting with `/` will be mounted
+  onto.  Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix
+  systems, and `C:\` or some such on Windows.)
+* `dot` Include `.dot` files in normal matches and `globstar` matches.
+  Note that an explicit dot in a portion of the pattern will always
+  match dot files.
+* `nomount` By default, a pattern starting with a forward-slash will be
+  "mounted" onto the root setting, so that a valid filesystem path is
+  returned.  Set this flag to disable that behavior.
+* `mark` Add a `/` character to directory matches.  Note that this
+  requires additional stat calls.
+* `nosort` Don't sort the results.
+* `stat` Set to true to stat *all* results.  This reduces performance
+  somewhat, and is completely unnecessary, unless `readdir` is presumed
+  to be an untrustworthy indicator of file existence.
+* `silent` When an unusual error is encountered when attempting to
+  read a directory, a warning will be printed to stderr.  Set the
+  `silent` option to true to suppress these warnings.
+* `strict` When an unusual error is encountered when attempting to
+  read a directory, the process will just continue on in search of
+  other matches.  Set the `strict` option to raise an error in these
+  cases.
+* `cache` See `cache` property above.  Pass in a previously generated
+  cache object to save some fs calls.
+* `statCache` A cache of results of filesystem information, to prevent
+  unnecessary stat calls.  While it should not normally be necessary
+  to set this, you may pass the statCache from one glob() call to the
+  options object of another, if you know that the filesystem will not
+  change between calls.  (See "Race Conditions" below.)
+* `symlinks` A cache of known symbolic links.  You may pass in a
+  previously generated `symlinks` object to save `lstat` calls when
+  resolving `**` matches.
+* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead.
+* `nounique` In some cases, brace-expanded patterns can result in the
+  same file showing up multiple times in the result set.  By default,
+  this implementation prevents duplicates in the result set.  Set this
+  flag to disable that behavior.
+* `nonull` Set to never return an empty set, instead returning a set
+  containing the pattern itself.  This is the default in glob(3).
+* `debug` Set to enable debug logging in minimatch and glob.
+* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets.
+* `noglobstar` Do not match `**` against multiple filenames.  (Ie,
+  treat it as a normal `*` instead.)
+* `noext` Do not match `+(a|b)` "extglob" patterns.
+* `nocase` Perform a case-insensitive match.  Note: on
+  case-insensitive filesystems, non-magic patterns will match by
+  default, since `stat` and `readdir` will not raise errors.
+* `matchBase` Perform a basename-only match if the pattern does not
+  contain any slash characters.  That is, `*.js` would be treated as
+  equivalent to `**/*.js`, matching all js files in all directories.
+* `nodir` Do not match directories, only files.  (Note: to match
+  *only* directories, simply put a `/` at the end of the pattern.)
+* `ignore` Add a pattern or an array of glob patterns to exclude matches.
+  Note: `ignore` patterns are *always* in `dot:true` mode, regardless
+  of any other settings.
+* `follow` Follow symlinked directories when expanding `**` patterns.
+  Note that this can result in a lot of duplicate references in the
+  presence of cyclic links.
+* `realpath` Set to true to call `fs.realpath` on all of the results.
+  In the case of a symlink that cannot be resolved, the full absolute
+  path to the matched entry is returned (though it will usually be a
+  broken symlink)
+* `absolute` Set to true to always receive absolute paths for matched
+  files.  Unlike `realpath`, this also affects the values returned in
+  the `match` event.
+
+## Comparisons to other fnmatch/glob implementations
+
+While strict compliance with the existing standards is a worthwhile
+goal, some discrepancies exist between node-glob and other
+implementations, and are intentional.
+
+The double-star character `**` is supported by default, unless the
+`noglobstar` flag is set.  This is supported in the manner of bsdglob
+and bash 4.3, where `**` only has special significance if it is the only
+thing in a path part.  That is, `a/**/b` will match `a/x/y/b`, but
+`a/**b` will not.
+
+Note that symlinked directories are not crawled as part of a `**`,
+though their contents may match against subsequent portions of the
+pattern.  This prevents infinite loops and duplicates and the like.
+
+If an escaped pattern has no matches, and the `nonull` flag is set,
+then glob returns the pattern as-provided, rather than
+interpreting the character escapes.  For example,
+`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than
+`"*a?"`.  This is akin to setting the `nullglob` option in bash, except
+that it does not resolve escaped pattern characters.
+
+If brace expansion is not disabled, then it is performed before any
+other interpretation of the glob pattern.  Thus, a pattern like
+`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded
+**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are
+checked for validity.  Since those two are valid, matching proceeds.
+
+### Comments and Negation
+
+Previously, this module let you mark a pattern as a "comment" if it
+started with a `#` character, or a "negated" pattern if it started
+with a `!` character.
+
+These options were deprecated in version 5, and removed in version 6.
+
+To specify things that should not match, use the `ignore` option.
+
+## Windows
+
+**Please only use forward-slashes in glob expressions.**
+
+Though windows uses either `/` or `\` as its path separator, only `/`
+characters are used by this glob implementation.  You must use
+forward-slashes **only** in glob expressions.  Back-slashes will always
+be interpreted as escape characters, not path separators.
+
+Results from absolute patterns such as `/foo/*` are mounted onto the
+root setting using `path.join`.  On windows, this will by default result
+in `/foo/*` matching `C:\foo\bar.txt`.
+
+## Race Conditions
+
+Glob searching, by its very nature, is susceptible to race conditions,
+since it relies on directory walking and such.
+
+As a result, it is possible that a file that exists when glob looks for
+it may have been deleted or modified by the time it returns the result.
+
+As part of its internal implementation, this program caches all stat
+and readdir calls that it makes, in order to cut down on system
+overhead.  However, this also makes it even more susceptible to races,
+especially if the cache or statCache objects are reused between glob
+calls.
+
+Users are thus advised not to use a glob result as a guarantee of
+filesystem state in the face of rapid changes.  For the vast majority
+of operations, this is never a problem.
+
+## Contributing
+
+Any change to behavior (including bugfixes) must come with a test.
+
+Patches that fail tests or reduce performance will be rejected.
+
+```
+# to run tests
+npm test
+
+# to re-generate test fixtures
+npm run test-regen
+
+# to benchmark against bash/zsh
+npm run bench
+
+# to profile javascript
+npm run prof
+```
diff --git a/wrt/node_modules/rimraf/node_modules/glob/changelog.md b/wrt/node_modules/rimraf/node_modules/glob/changelog.md
new file mode 100644 (file)
index 0000000..4163677
--- /dev/null
@@ -0,0 +1,67 @@
+## 7.0
+
+- Raise error if `options.cwd` is specified, and not a directory
+
+## 6.0
+
+- Remove comment and negation pattern support
+- Ignore patterns are always in `dot:true` mode
+
+## 5.0
+
+- Deprecate comment and negation patterns
+- Fix regression in `mark` and `nodir` options from making all cache
+  keys absolute path.
+- Abort if `fs.readdir` returns an error that's unexpected
+- Don't emit `match` events for ignored items
+- Treat ENOTSUP like ENOTDIR in readdir
+
+## 4.5
+
+- Add `options.follow` to always follow directory symlinks in globstar
+- Add `options.realpath` to call `fs.realpath` on all results
+- Always cache based on absolute path
+
+## 4.4
+
+- Add `options.ignore`
+- Fix handling of broken symlinks
+
+## 4.3
+
+- Bump minimatch to 2.x
+- Pass all tests on Windows
+
+## 4.2
+
+- Add `glob.hasMagic` function
+- Add `options.nodir` flag
+
+## 4.1
+
+- Refactor sync and async implementations for performance
+- Throw if callback provided to sync glob function
+- Treat symbolic links in globstar results the same as Bash 4.3
+
+## 4.0
+
+- Use `^` for dependency versions (bumped major because this breaks
+  older npm versions)
+- Ensure callbacks are only ever called once
+- switch to ISC license
+
+## 3.x
+
+- Rewrite in JavaScript
+- Add support for setting root, cwd, and windows support
+- Cache many fs calls
+- Add globstar support
+- emit match events
+
+## 2.x
+
+- Use `glob.h` and `fnmatch.h` from NetBSD
+
+## 1.x
+
+- `glob.h` static binding.
diff --git a/wrt/node_modules/rimraf/node_modules/glob/common.js b/wrt/node_modules/rimraf/node_modules/glob/common.js
new file mode 100644 (file)
index 0000000..66651bb
--- /dev/null
@@ -0,0 +1,240 @@
+exports.alphasort = alphasort
+exports.alphasorti = alphasorti
+exports.setopts = setopts
+exports.ownProp = ownProp
+exports.makeAbs = makeAbs
+exports.finish = finish
+exports.mark = mark
+exports.isIgnored = isIgnored
+exports.childrenIgnored = childrenIgnored
+
+function ownProp (obj, field) {
+  return Object.prototype.hasOwnProperty.call(obj, field)
+}
+
+var path = require("path")
+var minimatch = require("minimatch")
+var isAbsolute = require("path-is-absolute")
+var Minimatch = minimatch.Minimatch
+
+function alphasorti (a, b) {
+  return a.toLowerCase().localeCompare(b.toLowerCase())
+}
+
+function alphasort (a, b) {
+  return a.localeCompare(b)
+}
+
+function setupIgnores (self, options) {
+  self.ignore = options.ignore || []
+
+  if (!Array.isArray(self.ignore))
+    self.ignore = [self.ignore]
+
+  if (self.ignore.length) {
+    self.ignore = self.ignore.map(ignoreMap)
+  }
+}
+
+// ignore patterns are always in dot:true mode.
+function ignoreMap (pattern) {
+  var gmatcher = null
+  if (pattern.slice(-3) === '/**') {
+    var gpattern = pattern.replace(/(\/\*\*)+$/, '')
+    gmatcher = new Minimatch(gpattern, { dot: true })
+  }
+
+  return {
+    matcher: new Minimatch(pattern, { dot: true }),
+    gmatcher: gmatcher
+  }
+}
+
+function setopts (self, pattern, options) {
+  if (!options)
+    options = {}
+
+  // base-matching: just use globstar for that.
+  if (options.matchBase && -1 === pattern.indexOf("/")) {
+    if (options.noglobstar) {
+      throw new Error("base matching requires globstar")
+    }
+    pattern = "**/" + pattern
+  }
+
+  self.silent = !!options.silent
+  self.pattern = pattern
+  self.strict = options.strict !== false
+  self.realpath = !!options.realpath
+  self.realpathCache = options.realpathCache || Object.create(null)
+  self.follow = !!options.follow
+  self.dot = !!options.dot
+  self.mark = !!options.mark
+  self.nodir = !!options.nodir
+  if (self.nodir)
+    self.mark = true
+  self.sync = !!options.sync
+  self.nounique = !!options.nounique
+  self.nonull = !!options.nonull
+  self.nosort = !!options.nosort
+  self.nocase = !!options.nocase
+  self.stat = !!options.stat
+  self.noprocess = !!options.noprocess
+  self.absolute = !!options.absolute
+
+  self.maxLength = options.maxLength || Infinity
+  self.cache = options.cache || Object.create(null)
+  self.statCache = options.statCache || Object.create(null)
+  self.symlinks = options.symlinks || Object.create(null)
+
+  setupIgnores(self, options)
+
+  self.changedCwd = false
+  var cwd = process.cwd()
+  if (!ownProp(options, "cwd"))
+    self.cwd = cwd
+  else {
+    self.cwd = path.resolve(options.cwd)
+    self.changedCwd = self.cwd !== cwd
+  }
+
+  self.root = options.root || path.resolve(self.cwd, "/")
+  self.root = path.resolve(self.root)
+  if (process.platform === "win32")
+    self.root = self.root.replace(/\\/g, "/")
+
+  // TODO: is an absolute `cwd` supposed to be resolved against `root`?
+  // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test')
+  self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd)
+  if (process.platform === "win32")
+    self.cwdAbs = self.cwdAbs.replace(/\\/g, "/")
+  self.nomount = !!options.nomount
+
+  // disable comments and negation in Minimatch.
+  // Note that they are not supported in Glob itself anyway.
+  options.nonegate = true
+  options.nocomment = true
+
+  self.minimatch = new Minimatch(pattern, options)
+  self.options = self.minimatch.options
+}
+
+function finish (self) {
+  var nou = self.nounique
+  var all = nou ? [] : Object.create(null)
+
+  for (var i = 0, l = self.matches.length; i < l; i ++) {
+    var matches = self.matches[i]
+    if (!matches || Object.keys(matches).length === 0) {
+      if (self.nonull) {
+        // do like the shell, and spit out the literal glob
+        var literal = self.minimatch.globSet[i]
+        if (nou)
+          all.push(literal)
+        else
+          all[literal] = true
+      }
+    } else {
+      // had matches
+      var m = Object.keys(matches)
+      if (nou)
+        all.push.apply(all, m)
+      else
+        m.forEach(function (m) {
+          all[m] = true
+        })
+    }
+  }
+
+  if (!nou)
+    all = Object.keys(all)
+
+  if (!self.nosort)
+    all = all.sort(self.nocase ? alphasorti : alphasort)
+
+  // at *some* point we statted all of these
+  if (self.mark) {
+    for (var i = 0; i < all.length; i++) {
+      all[i] = self._mark(all[i])
+    }
+    if (self.nodir) {
+      all = all.filter(function (e) {
+        var notDir = !(/\/$/.test(e))
+        var c = self.cache[e] || self.cache[makeAbs(self, e)]
+        if (notDir && c)
+          notDir = c !== 'DIR' && !Array.isArray(c)
+        return notDir
+      })
+    }
+  }
+
+  if (self.ignore.length)
+    all = all.filter(function(m) {
+      return !isIgnored(self, m)
+    })
+
+  self.found = all
+}
+
+function mark (self, p) {
+  var abs = makeAbs(self, p)
+  var c = self.cache[abs]
+  var m = p
+  if (c) {
+    var isDir = c === 'DIR' || Array.isArray(c)
+    var slash = p.slice(-1) === '/'
+
+    if (isDir && !slash)
+      m += '/'
+    else if (!isDir && slash)
+      m = m.slice(0, -1)
+
+    if (m !== p) {
+      var mabs = makeAbs(self, m)
+      self.statCache[mabs] = self.statCache[abs]
+      self.cache[mabs] = self.cache[abs]
+    }
+  }
+
+  return m
+}
+
+// lotta situps...
+function makeAbs (self, f) {
+  var abs = f
+  if (f.charAt(0) === '/') {
+    abs = path.join(self.root, f)
+  } else if (isAbsolute(f) || f === '') {
+    abs = f
+  } else if (self.changedCwd) {
+    abs = path.resolve(self.cwd, f)
+  } else {
+    abs = path.resolve(f)
+  }
+
+  if (process.platform === 'win32')
+    abs = abs.replace(/\\/g, '/')
+
+  return abs
+}
+
+
+// Return true, if pattern ends with globstar '**', for the accompanying parent directory.
+// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents
+function isIgnored (self, path) {
+  if (!self.ignore.length)
+    return false
+
+  return self.ignore.some(function(item) {
+    return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))
+  })
+}
+
+function childrenIgnored (self, path) {
+  if (!self.ignore.length)
+    return false
+
+  return self.ignore.some(function(item) {
+    return !!(item.gmatcher && item.gmatcher.match(path))
+  })
+}
diff --git a/wrt/node_modules/rimraf/node_modules/glob/glob.js b/wrt/node_modules/rimraf/node_modules/glob/glob.js
new file mode 100644 (file)
index 0000000..58dec0f
--- /dev/null
@@ -0,0 +1,790 @@
+// Approach:
+//
+// 1. Get the minimatch set
+// 2. For each pattern in the set, PROCESS(pattern, false)
+// 3. Store matches per-set, then uniq them
+//
+// PROCESS(pattern, inGlobStar)
+// Get the first [n] items from pattern that are all strings
+// Join these together.  This is PREFIX.
+//   If there is no more remaining, then stat(PREFIX) and
+//   add to matches if it succeeds.  END.
+//
+// If inGlobStar and PREFIX is symlink and points to dir
+//   set ENTRIES = []
+// else readdir(PREFIX) as ENTRIES
+//   If fail, END
+//
+// with ENTRIES
+//   If pattern[n] is GLOBSTAR
+//     // handle the case where the globstar match is empty
+//     // by pruning it out, and testing the resulting pattern
+//     PROCESS(pattern[0..n] + pattern[n+1 .. $], false)
+//     // handle other cases.
+//     for ENTRY in ENTRIES (not dotfiles)
+//       // attach globstar + tail onto the entry
+//       // Mark that this entry is a globstar match
+//       PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true)
+//
+//   else // not globstar
+//     for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot)
+//       Test ENTRY against pattern[n]
+//       If fails, continue
+//       If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $])
+//
+// Caveat:
+//   Cache all stats and readdirs results to minimize syscall.  Since all
+//   we ever care about is existence and directory-ness, we can just keep
+//   `true` for files, and [children,...] for directories, or `false` for
+//   things that don't exist.
+
+module.exports = glob
+
+var fs = require('fs')
+var rp = require('fs.realpath')
+var minimatch = require('minimatch')
+var Minimatch = minimatch.Minimatch
+var inherits = require('inherits')
+var EE = require('events').EventEmitter
+var path = require('path')
+var assert = require('assert')
+var isAbsolute = require('path-is-absolute')
+var globSync = require('./sync.js')
+var common = require('./common.js')
+var alphasort = common.alphasort
+var alphasorti = common.alphasorti
+var setopts = common.setopts
+var ownProp = common.ownProp
+var inflight = require('inflight')
+var util = require('util')
+var childrenIgnored = common.childrenIgnored
+var isIgnored = common.isIgnored
+
+var once = require('once')
+
+function glob (pattern, options, cb) {
+  if (typeof options === 'function') cb = options, options = {}
+  if (!options) options = {}
+
+  if (options.sync) {
+    if (cb)
+      throw new TypeError('callback provided to sync glob')
+    return globSync(pattern, options)
+  }
+
+  return new Glob(pattern, options, cb)
+}
+
+glob.sync = globSync
+var GlobSync = glob.GlobSync = globSync.GlobSync
+
+// old api surface
+glob.glob = glob
+
+function extend (origin, add) {
+  if (add === null || typeof add !== 'object') {
+    return origin
+  }
+
+  var keys = Object.keys(add)
+  var i = keys.length
+  while (i--) {
+    origin[keys[i]] = add[keys[i]]
+  }
+  return origin
+}
+
+glob.hasMagic = function (pattern, options_) {
+  var options = extend({}, options_)
+  options.noprocess = true
+
+  var g = new Glob(pattern, options)
+  var set = g.minimatch.set
+
+  if (!pattern)
+    return false
+
+  if (set.length > 1)
+    return true
+
+  for (var j = 0; j < set[0].length; j++) {
+    if (typeof set[0][j] !== 'string')
+      return true
+  }
+
+  return false
+}
+
+glob.Glob = Glob
+inherits(Glob, EE)
+function Glob (pattern, options, cb) {
+  if (typeof options === 'function') {
+    cb = options
+    options = null
+  }
+
+  if (options && options.sync) {
+    if (cb)
+      throw new TypeError('callback provided to sync glob')
+    return new GlobSync(pattern, options)
+  }
+
+  if (!(this instanceof Glob))
+    return new Glob(pattern, options, cb)
+
+  setopts(this, pattern, options)
+  this._didRealPath = false
+
+  // process each pattern in the minimatch set
+  var n = this.minimatch.set.length
+
+  // The matches are stored as {<filename>: true,...} so that
+  // duplicates are automagically pruned.
+  // Later, we do an Object.keys() on these.
+  // Keep them as a list so we can fill in when nonull is set.
+  this.matches = new Array(n)
+
+  if (typeof cb === 'function') {
+    cb = once(cb)
+    this.on('error', cb)
+    this.on('end', function (matches) {
+      cb(null, matches)
+    })
+  }
+
+  var self = this
+  this._processing = 0
+
+  this._emitQueue = []
+  this._processQueue = []
+  this.paused = false
+
+  if (this.noprocess)
+    return this
+
+  if (n === 0)
+    return done()
+
+  var sync = true
+  for (var i = 0; i < n; i ++) {
+    this._process(this.minimatch.set[i], i, false, done)
+  }
+  sync = false
+
+  function done () {
+    --self._processing
+    if (self._processing <= 0) {
+      if (sync) {
+        process.nextTick(function () {
+          self._finish()
+        })
+      } else {
+        self._finish()
+      }
+    }
+  }
+}
+
+Glob.prototype._finish = function () {
+  assert(this instanceof Glob)
+  if (this.aborted)
+    return
+
+  if (this.realpath && !this._didRealpath)
+    return this._realpath()
+
+  common.finish(this)
+  this.emit('end', this.found)
+}
+
+Glob.prototype._realpath = function () {
+  if (this._didRealpath)
+    return
+
+  this._didRealpath = true
+
+  var n = this.matches.length
+  if (n === 0)
+    return this._finish()
+
+  var self = this
+  for (var i = 0; i < this.matches.length; i++)
+    this._realpathSet(i, next)
+
+  function next () {
+    if (--n === 0)
+      self._finish()
+  }
+}
+
+Glob.prototype._realpathSet = function (index, cb) {
+  var matchset = this.matches[index]
+  if (!matchset)
+    return cb()
+
+  var found = Object.keys(matchset)
+  var self = this
+  var n = found.length
+
+  if (n === 0)
+    return cb()
+
+  var set = this.matches[index] = Object.create(null)
+  found.forEach(function (p, i) {
+    // If there's a problem with the stat, then it means that
+    // one or more of the links in the realpath couldn't be
+    // resolved.  just return the abs value in that case.
+    p = self._makeAbs(p)
+    rp.realpath(p, self.realpathCache, function (er, real) {
+      if (!er)
+        set[real] = true
+      else if (er.syscall === 'stat')
+        set[p] = true
+      else
+        self.emit('error', er) // srsly wtf right here
+
+      if (--n === 0) {
+        self.matches[index] = set
+        cb()
+      }
+    })
+  })
+}
+
+Glob.prototype._mark = function (p) {
+  return common.mark(this, p)
+}
+
+Glob.prototype._makeAbs = function (f) {
+  return common.makeAbs(this, f)
+}
+
+Glob.prototype.abort = function () {
+  this.aborted = true
+  this.emit('abort')
+}
+
+Glob.prototype.pause = function () {
+  if (!this.paused) {
+    this.paused = true
+    this.emit('pause')
+  }
+}
+
+Glob.prototype.resume = function () {
+  if (this.paused) {
+    this.emit('resume')
+    this.paused = false
+    if (this._emitQueue.length) {
+      var eq = this._emitQueue.slice(0)
+      this._emitQueue.length = 0
+      for (var i = 0; i < eq.length; i ++) {
+        var e = eq[i]
+        this._emitMatch(e[0], e[1])
+      }
+    }
+    if (this._processQueue.length) {
+      var pq = this._processQueue.slice(0)
+      this._processQueue.length = 0
+      for (var i = 0; i < pq.length; i ++) {
+        var p = pq[i]
+        this._processing--
+        this._process(p[0], p[1], p[2], p[3])
+      }
+    }
+  }
+}
+
+Glob.prototype._process = function (pattern, index, inGlobStar, cb) {
+  assert(this instanceof Glob)
+  assert(typeof cb === 'function')
+
+  if (this.aborted)
+    return
+
+  this._processing++
+  if (this.paused) {
+    this._processQueue.push([pattern, index, inGlobStar, cb])
+    return
+  }
+
+  //console.error('PROCESS %d', this._processing, pattern)
+
+  // Get the first [n] parts of pattern that are all strings.
+  var n = 0
+  while (typeof pattern[n] === 'string') {
+    n ++
+  }
+  // now n is the index of the first one that is *not* a string.
+
+  // see if there's anything else
+  var prefix
+  switch (n) {
+    // if not, then this is rather simple
+    case pattern.length:
+      this._processSimple(pattern.join('/'), index, cb)
+      return
+
+    case 0:
+      // pattern *starts* with some non-trivial item.
+      // going to readdir(cwd), but not include the prefix in matches.
+      prefix = null
+      break
+
+    default:
+      // pattern has some string bits in the front.
+      // whatever it starts with, whether that's 'absolute' like /foo/bar,
+      // or 'relative' like '../baz'
+      prefix = pattern.slice(0, n).join('/')
+      break
+  }
+
+  var remain = pattern.slice(n)
+
+  // get the list of entries.
+  var read
+  if (prefix === null)
+    read = '.'
+  else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
+    if (!prefix || !isAbsolute(prefix))
+      prefix = '/' + prefix
+    read = prefix
+  } else
+    read = prefix
+
+  var abs = this._makeAbs(read)
+
+  //if ignored, skip _processing
+  if (childrenIgnored(this, read))
+    return cb()
+
+  var isGlobStar = remain[0] === minimatch.GLOBSTAR
+  if (isGlobStar)
+    this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb)
+  else
+    this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb)
+}
+
+Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) {
+  var self = this
+  this._readdir(abs, inGlobStar, function (er, entries) {
+    return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
+  })
+}
+
+Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
+
+  // if the abs isn't a dir, then nothing can match!
+  if (!entries)
+    return cb()
+
+  // It will only match dot entries if it starts with a dot, or if
+  // dot is set.  Stuff like @(.foo|.bar) isn't allowed.
+  var pn = remain[0]
+  var negate = !!this.minimatch.negate
+  var rawGlob = pn._glob
+  var dotOk = this.dot || rawGlob.charAt(0) === '.'
+
+  var matchedEntries = []
+  for (var i = 0; i < entries.length; i++) {
+    var e = entries[i]
+    if (e.charAt(0) !== '.' || dotOk) {
+      var m
+      if (negate && !prefix) {
+        m = !e.match(pn)
+      } else {
+        m = e.match(pn)
+      }
+      if (m)
+        matchedEntries.push(e)
+    }
+  }
+
+  //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries)
+
+  var len = matchedEntries.length
+  // If there are no matched entries, then nothing matches.
+  if (len === 0)
+    return cb()
+
+  // if this is the last remaining pattern bit, then no need for
+  // an additional stat *unless* the user has specified mark or
+  // stat explicitly.  We know they exist, since readdir returned
+  // them.
+
+  if (remain.length === 1 && !this.mark && !this.stat) {
+    if (!this.matches[index])
+      this.matches[index] = Object.create(null)
+
+    for (var i = 0; i < len; i ++) {
+      var e = matchedEntries[i]
+      if (prefix) {
+        if (prefix !== '/')
+          e = prefix + '/' + e
+        else
+          e = prefix + e
+      }
+
+      if (e.charAt(0) === '/' && !this.nomount) {
+        e = path.join(this.root, e)
+      }
+      this._emitMatch(index, e)
+    }
+    // This was the last one, and no stats were needed
+    return cb()
+  }
+
+  // now test all matched entries as stand-ins for that part
+  // of the pattern.
+  remain.shift()
+  for (var i = 0; i < len; i ++) {
+    var e = matchedEntries[i]
+    var newPattern
+    if (prefix) {
+      if (prefix !== '/')
+        e = prefix + '/' + e
+      else
+        e = prefix + e
+    }
+    this._process([e].concat(remain), index, inGlobStar, cb)
+  }
+  cb()
+}
+
+Glob.prototype._emitMatch = function (index, e) {
+  if (this.aborted)
+    return
+
+  if (isIgnored(this, e))
+    return
+
+  if (this.paused) {
+    this._emitQueue.push([index, e])
+    return
+  }
+
+  var abs = isAbsolute(e) ? e : this._makeAbs(e)
+
+  if (this.mark)
+    e = this._mark(e)
+
+  if (this.absolute)
+    e = abs
+
+  if (this.matches[index][e])
+    return
+
+  if (this.nodir) {
+    var c = this.cache[abs]
+    if (c === 'DIR' || Array.isArray(c))
+      return
+  }
+
+  this.matches[index][e] = true
+
+  var st = this.statCache[abs]
+  if (st)
+    this.emit('stat', e, st)
+
+  this.emit('match', e)
+}
+
+Glob.prototype._readdirInGlobStar = function (abs, cb) {
+  if (this.aborted)
+    return
+
+  // follow all symlinked directories forever
+  // just proceed as if this is a non-globstar situation
+  if (this.follow)
+    return this._readdir(abs, false, cb)
+
+  var lstatkey = 'lstat\0' + abs
+  var self = this
+  var lstatcb = inflight(lstatkey, lstatcb_)
+
+  if (lstatcb)
+    fs.lstat(abs, lstatcb)
+
+  function lstatcb_ (er, lstat) {
+    if (er && er.code === 'ENOENT')
+      return cb()
+
+    var isSym = lstat && lstat.isSymbolicLink()
+    self.symlinks[abs] = isSym
+
+    // If it's not a symlink or a dir, then it's definitely a regular file.
+    // don't bother doing a readdir in that case.
+    if (!isSym && lstat && !lstat.isDirectory()) {
+      self.cache[abs] = 'FILE'
+      cb()
+    } else
+      self._readdir(abs, false, cb)
+  }
+}
+
+Glob.prototype._readdir = function (abs, inGlobStar, cb) {
+  if (this.aborted)
+    return
+
+  cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb)
+  if (!cb)
+    return
+
+  //console.error('RD %j %j', +inGlobStar, abs)
+  if (inGlobStar && !ownProp(this.symlinks, abs))
+    return this._readdirInGlobStar(abs, cb)
+
+  if (ownProp(this.cache, abs)) {
+    var c = this.cache[abs]
+    if (!c || c === 'FILE')
+      return cb()
+
+    if (Array.isArray(c))
+      return cb(null, c)
+  }
+
+  var self = this
+  fs.readdir(abs, readdirCb(this, abs, cb))
+}
+
+function readdirCb (self, abs, cb) {
+  return function (er, entries) {
+    if (er)
+      self._readdirError(abs, er, cb)
+    else
+      self._readdirEntries(abs, entries, cb)
+  }
+}
+
+Glob.prototype._readdirEntries = function (abs, entries, cb) {
+  if (this.aborted)
+    return
+
+  // if we haven't asked to stat everything, then just
+  // assume that everything in there exists, so we can avoid
+  // having to stat it a second time.
+  if (!this.mark && !this.stat) {
+    for (var i = 0; i < entries.length; i ++) {
+      var e = entries[i]
+      if (abs === '/')
+        e = abs + e
+      else
+        e = abs + '/' + e
+      this.cache[e] = true
+    }
+  }
+
+  this.cache[abs] = entries
+  return cb(null, entries)
+}
+
+Glob.prototype._readdirError = function (f, er, cb) {
+  if (this.aborted)
+    return
+
+  // handle errors, and cache the information
+  switch (er.code) {
+    case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
+    case 'ENOTDIR': // totally normal. means it *does* exist.
+      var abs = this._makeAbs(f)
+      this.cache[abs] = 'FILE'
+      if (abs === this.cwdAbs) {
+        var error = new Error(er.code + ' invalid cwd ' + this.cwd)
+        error.path = this.cwd
+        error.code = er.code
+        this.emit('error', error)
+        this.abort()
+      }
+      break
+
+    case 'ENOENT': // not terribly unusual
+    case 'ELOOP':
+    case 'ENAMETOOLONG':
+    case 'UNKNOWN':
+      this.cache[this._makeAbs(f)] = false
+      break
+
+    default: // some unusual error.  Treat as failure.
+      this.cache[this._makeAbs(f)] = false
+      if (this.strict) {
+        this.emit('error', er)
+        // If the error is handled, then we abort
+        // if not, we threw out of here
+        this.abort()
+      }
+      if (!this.silent)
+        console.error('glob error', er)
+      break
+  }
+
+  return cb()
+}
+
+Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) {
+  var self = this
+  this._readdir(abs, inGlobStar, function (er, entries) {
+    self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
+  })
+}
+
+
+Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
+  //console.error('pgs2', prefix, remain[0], entries)
+
+  // no entries means not a dir, so it can never have matches
+  // foo.txt/** doesn't match foo.txt
+  if (!entries)
+    return cb()
+
+  // test without the globstar, and with every child both below
+  // and replacing the globstar.
+  var remainWithoutGlobStar = remain.slice(1)
+  var gspref = prefix ? [ prefix ] : []
+  var noGlobStar = gspref.concat(remainWithoutGlobStar)
+
+  // the noGlobStar pattern exits the inGlobStar state
+  this._process(noGlobStar, index, false, cb)
+
+  var isSym = this.symlinks[abs]
+  var len = entries.length
+
+  // If it's a symlink, and we're in a globstar, then stop
+  if (isSym && inGlobStar)
+    return cb()
+
+  for (var i = 0; i < len; i++) {
+    var e = entries[i]
+    if (e.charAt(0) === '.' && !this.dot)
+      continue
+
+    // these two cases enter the inGlobStar state
+    var instead = gspref.concat(entries[i], remainWithoutGlobStar)
+    this._process(instead, index, true, cb)
+
+    var below = gspref.concat(entries[i], remain)
+    this._process(below, index, true, cb)
+  }
+
+  cb()
+}
+
+Glob.prototype._processSimple = function (prefix, index, cb) {
+  // XXX review this.  Shouldn't it be doing the mounting etc
+  // before doing stat?  kinda weird?
+  var self = this
+  this._stat(prefix, function (er, exists) {
+    self._processSimple2(prefix, index, er, exists, cb)
+  })
+}
+Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) {
+
+  //console.error('ps2', prefix, exists)
+
+  if (!this.matches[index])
+    this.matches[index] = Object.create(null)
+
+  // If it doesn't exist, then just mark the lack of results
+  if (!exists)
+    return cb()
+
+  if (prefix && isAbsolute(prefix) && !this.nomount) {
+    var trail = /[\/\\]$/.test(prefix)
+    if (prefix.charAt(0) === '/') {
+      prefix = path.join(this.root, prefix)
+    } else {
+      prefix = path.resolve(this.root, prefix)
+      if (trail)
+        prefix += '/'
+    }
+  }
+
+  if (process.platform === 'win32')
+    prefix = prefix.replace(/\\/g, '/')
+
+  // Mark this as a match
+  this._emitMatch(index, prefix)
+  cb()
+}
+
+// Returns either 'DIR', 'FILE', or false
+Glob.prototype._stat = function (f, cb) {
+  var abs = this._makeAbs(f)
+  var needDir = f.slice(-1) === '/'
+
+  if (f.length > this.maxLength)
+    return cb()
+
+  if (!this.stat && ownProp(this.cache, abs)) {
+    var c = this.cache[abs]
+
+    if (Array.isArray(c))
+      c = 'DIR'
+
+    // It exists, but maybe not how we need it
+    if (!needDir || c === 'DIR')
+      return cb(null, c)
+
+    if (needDir && c === 'FILE')
+      return cb()
+
+    // otherwise we have to stat, because maybe c=true
+    // if we know it exists, but not what it is.
+  }
+
+  var exists
+  var stat = this.statCache[abs]
+  if (stat !== undefined) {
+    if (stat === false)
+      return cb(null, stat)
+    else {
+      var type = stat.isDirectory() ? 'DIR' : 'FILE'
+      if (needDir && type === 'FILE')
+        return cb()
+      else
+        return cb(null, type, stat)
+    }
+  }
+
+  var self = this
+  var statcb = inflight('stat\0' + abs, lstatcb_)
+  if (statcb)
+    fs.lstat(abs, statcb)
+
+  function lstatcb_ (er, lstat) {
+    if (lstat && lstat.isSymbolicLink()) {
+      // If it's a symlink, then treat it as the target, unless
+      // the target does not exist, then treat it as a file.
+      return fs.stat(abs, function (er, stat) {
+        if (er)
+          self._stat2(f, abs, null, lstat, cb)
+        else
+          self._stat2(f, abs, er, stat, cb)
+      })
+    } else {
+      self._stat2(f, abs, er, lstat, cb)
+    }
+  }
+}
+
+Glob.prototype._stat2 = function (f, abs, er, stat, cb) {
+  if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
+    this.statCache[abs] = false
+    return cb()
+  }
+
+  var needDir = f.slice(-1) === '/'
+  this.statCache[abs] = stat
+
+  if (abs.slice(-1) === '/' && stat && !stat.isDirectory())
+    return cb(null, false, stat)
+
+  var c = true
+  if (stat)
+    c = stat.isDirectory() ? 'DIR' : 'FILE'
+  this.cache[abs] = this.cache[abs] || c
+
+  if (needDir && c === 'FILE')
+    return cb()
+
+  return cb(null, c, stat)
+}
diff --git a/wrt/node_modules/rimraf/node_modules/glob/package.json b/wrt/node_modules/rimraf/node_modules/glob/package.json
new file mode 100644 (file)
index 0000000..6146270
--- /dev/null
@@ -0,0 +1,76 @@
+{
+  "_from": "glob@^7.0.5",
+  "_id": "glob@7.1.2",
+  "_inBundle": false,
+  "_integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
+  "_location": "/rimraf/glob",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "glob@^7.0.5",
+    "name": "glob",
+    "escapedName": "glob",
+    "rawSpec": "^7.0.5",
+    "saveSpec": null,
+    "fetchSpec": "^7.0.5"
+  },
+  "_requiredBy": [
+    "/rimraf"
+  ],
+  "_resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
+  "_shasum": "c19c9df9a028702d678612384a6552404c636d15",
+  "_spec": "glob@^7.0.5",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was/node_modules/rimraf",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bugs": {
+    "url": "https://github.com/isaacs/node-glob/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {
+    "fs.realpath": "^1.0.0",
+    "inflight": "^1.0.4",
+    "inherits": "2",
+    "minimatch": "^3.0.4",
+    "once": "^1.3.0",
+    "path-is-absolute": "^1.0.0"
+  },
+  "deprecated": false,
+  "description": "a little globber",
+  "devDependencies": {
+    "mkdirp": "0",
+    "rimraf": "^2.2.8",
+    "tap": "^7.1.2",
+    "tick": "0.0.6"
+  },
+  "engines": {
+    "node": "*"
+  },
+  "files": [
+    "glob.js",
+    "sync.js",
+    "common.js"
+  ],
+  "homepage": "https://github.com/isaacs/node-glob#readme",
+  "license": "ISC",
+  "main": "glob.js",
+  "name": "glob",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/node-glob.git"
+  },
+  "scripts": {
+    "bench": "bash benchmark.sh",
+    "benchclean": "node benchclean.js",
+    "prepublish": "npm run benchclean",
+    "prof": "bash prof.sh && cat profile.txt",
+    "profclean": "rm -f v8.log profile.txt",
+    "test": "tap test/*.js --cov",
+    "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js"
+  },
+  "version": "7.1.2"
+}
diff --git a/wrt/node_modules/rimraf/node_modules/glob/sync.js b/wrt/node_modules/rimraf/node_modules/glob/sync.js
new file mode 100644 (file)
index 0000000..c952134
--- /dev/null
@@ -0,0 +1,486 @@
+module.exports = globSync
+globSync.GlobSync = GlobSync
+
+var fs = require('fs')
+var rp = require('fs.realpath')
+var minimatch = require('minimatch')
+var Minimatch = minimatch.Minimatch
+var Glob = require('./glob.js').Glob
+var util = require('util')
+var path = require('path')
+var assert = require('assert')
+var isAbsolute = require('path-is-absolute')
+var common = require('./common.js')
+var alphasort = common.alphasort
+var alphasorti = common.alphasorti
+var setopts = common.setopts
+var ownProp = common.ownProp
+var childrenIgnored = common.childrenIgnored
+var isIgnored = common.isIgnored
+
+function globSync (pattern, options) {
+  if (typeof options === 'function' || arguments.length === 3)
+    throw new TypeError('callback provided to sync glob\n'+
+                        'See: https://github.com/isaacs/node-glob/issues/167')
+
+  return new GlobSync(pattern, options).found
+}
+
+function GlobSync (pattern, options) {
+  if (!pattern)
+    throw new Error('must provide pattern')
+
+  if (typeof options === 'function' || arguments.length === 3)
+    throw new TypeError('callback provided to sync glob\n'+
+                        'See: https://github.com/isaacs/node-glob/issues/167')
+
+  if (!(this instanceof GlobSync))
+    return new GlobSync(pattern, options)
+
+  setopts(this, pattern, options)
+
+  if (this.noprocess)
+    return this
+
+  var n = this.minimatch.set.length
+  this.matches = new Array(n)
+  for (var i = 0; i < n; i ++) {
+    this._process(this.minimatch.set[i], i, false)
+  }
+  this._finish()
+}
+
+GlobSync.prototype._finish = function () {
+  assert(this instanceof GlobSync)
+  if (this.realpath) {
+    var self = this
+    this.matches.forEach(function (matchset, index) {
+      var set = self.matches[index] = Object.create(null)
+      for (var p in matchset) {
+        try {
+          p = self._makeAbs(p)
+          var real = rp.realpathSync(p, self.realpathCache)
+          set[real] = true
+        } catch (er) {
+          if (er.syscall === 'stat')
+            set[self._makeAbs(p)] = true
+          else
+            throw er
+        }
+      }
+    })
+  }
+  common.finish(this)
+}
+
+
+GlobSync.prototype._process = function (pattern, index, inGlobStar) {
+  assert(this instanceof GlobSync)
+
+  // Get the first [n] parts of pattern that are all strings.
+  var n = 0
+  while (typeof pattern[n] === 'string') {
+    n ++
+  }
+  // now n is the index of the first one that is *not* a string.
+
+  // See if there's anything else
+  var prefix
+  switch (n) {
+    // if not, then this is rather simple
+    case pattern.length:
+      this._processSimple(pattern.join('/'), index)
+      return
+
+    case 0:
+      // pattern *starts* with some non-trivial item.
+      // going to readdir(cwd), but not include the prefix in matches.
+      prefix = null
+      break
+
+    default:
+      // pattern has some string bits in the front.
+      // whatever it starts with, whether that's 'absolute' like /foo/bar,
+      // or 'relative' like '../baz'
+      prefix = pattern.slice(0, n).join('/')
+      break
+  }
+
+  var remain = pattern.slice(n)
+
+  // get the list of entries.
+  var read
+  if (prefix === null)
+    read = '.'
+  else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
+    if (!prefix || !isAbsolute(prefix))
+      prefix = '/' + prefix
+    read = prefix
+  } else
+    read = prefix
+
+  var abs = this._makeAbs(read)
+
+  //if ignored, skip processing
+  if (childrenIgnored(this, read))
+    return
+
+  var isGlobStar = remain[0] === minimatch.GLOBSTAR
+  if (isGlobStar)
+    this._processGlobStar(prefix, read, abs, remain, index, inGlobStar)
+  else
+    this._processReaddir(prefix, read, abs, remain, index, inGlobStar)
+}
+
+
+GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) {
+  var entries = this._readdir(abs, inGlobStar)
+
+  // if the abs isn't a dir, then nothing can match!
+  if (!entries)
+    return
+
+  // It will only match dot entries if it starts with a dot, or if
+  // dot is set.  Stuff like @(.foo|.bar) isn't allowed.
+  var pn = remain[0]
+  var negate = !!this.minimatch.negate
+  var rawGlob = pn._glob
+  var dotOk = this.dot || rawGlob.charAt(0) === '.'
+
+  var matchedEntries = []
+  for (var i = 0; i < entries.length; i++) {
+    var e = entries[i]
+    if (e.charAt(0) !== '.' || dotOk) {
+      var m
+      if (negate && !prefix) {
+        m = !e.match(pn)
+      } else {
+        m = e.match(pn)
+      }
+      if (m)
+        matchedEntries.push(e)
+    }
+  }
+
+  var len = matchedEntries.length
+  // If there are no matched entries, then nothing matches.
+  if (len === 0)
+    return
+
+  // if this is the last remaining pattern bit, then no need for
+  // an additional stat *unless* the user has specified mark or
+  // stat explicitly.  We know they exist, since readdir returned
+  // them.
+
+  if (remain.length === 1 && !this.mark && !this.stat) {
+    if (!this.matches[index])
+      this.matches[index] = Object.create(null)
+
+    for (var i = 0; i < len; i ++) {
+      var e = matchedEntries[i]
+      if (prefix) {
+        if (prefix.slice(-1) !== '/')
+          e = prefix + '/' + e
+        else
+          e = prefix + e
+      }
+
+      if (e.charAt(0) === '/' && !this.nomount) {
+        e = path.join(this.root, e)
+      }
+      this._emitMatch(index, e)
+    }
+    // This was the last one, and no stats were needed
+    return
+  }
+
+  // now test all matched entries as stand-ins for that part
+  // of the pattern.
+  remain.shift()
+  for (var i = 0; i < len; i ++) {
+    var e = matchedEntries[i]
+    var newPattern
+    if (prefix)
+      newPattern = [prefix, e]
+    else
+      newPattern = [e]
+    this._process(newPattern.concat(remain), index, inGlobStar)
+  }
+}
+
+
+GlobSync.prototype._emitMatch = function (index, e) {
+  if (isIgnored(this, e))
+    return
+
+  var abs = this._makeAbs(e)
+
+  if (this.mark)
+    e = this._mark(e)
+
+  if (this.absolute) {
+    e = abs
+  }
+
+  if (this.matches[index][e])
+    return
+
+  if (this.nodir) {
+    var c = this.cache[abs]
+    if (c === 'DIR' || Array.isArray(c))
+      return
+  }
+
+  this.matches[index][e] = true
+
+  if (this.stat)
+    this._stat(e)
+}
+
+
+GlobSync.prototype._readdirInGlobStar = function (abs) {
+  // follow all symlinked directories forever
+  // just proceed as if this is a non-globstar situation
+  if (this.follow)
+    return this._readdir(abs, false)
+
+  var entries
+  var lstat
+  var stat
+  try {
+    lstat = fs.lstatSync(abs)
+  } catch (er) {
+    if (er.code === 'ENOENT') {
+      // lstat failed, doesn't exist
+      return null
+    }
+  }
+
+  var isSym = lstat && lstat.isSymbolicLink()
+  this.symlinks[abs] = isSym
+
+  // If it's not a symlink or a dir, then it's definitely a regular file.
+  // don't bother doing a readdir in that case.
+  if (!isSym && lstat && !lstat.isDirectory())
+    this.cache[abs] = 'FILE'
+  else
+    entries = this._readdir(abs, false)
+
+  return entries
+}
+
+GlobSync.prototype._readdir = function (abs, inGlobStar) {
+  var entries
+
+  if (inGlobStar && !ownProp(this.symlinks, abs))
+    return this._readdirInGlobStar(abs)
+
+  if (ownProp(this.cache, abs)) {
+    var c = this.cache[abs]
+    if (!c || c === 'FILE')
+      return null
+
+    if (Array.isArray(c))
+      return c
+  }
+
+  try {
+    return this._readdirEntries(abs, fs.readdirSync(abs))
+  } catch (er) {
+    this._readdirError(abs, er)
+    return null
+  }
+}
+
+GlobSync.prototype._readdirEntries = function (abs, entries) {
+  // if we haven't asked to stat everything, then just
+  // assume that everything in there exists, so we can avoid
+  // having to stat it a second time.
+  if (!this.mark && !this.stat) {
+    for (var i = 0; i < entries.length; i ++) {
+      var e = entries[i]
+      if (abs === '/')
+        e = abs + e
+      else
+        e = abs + '/' + e
+      this.cache[e] = true
+    }
+  }
+
+  this.cache[abs] = entries
+
+  // mark and cache dir-ness
+  return entries
+}
+
+GlobSync.prototype._readdirError = function (f, er) {
+  // handle errors, and cache the information
+  switch (er.code) {
+    case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
+    case 'ENOTDIR': // totally normal. means it *does* exist.
+      var abs = this._makeAbs(f)
+      this.cache[abs] = 'FILE'
+      if (abs === this.cwdAbs) {
+        var error = new Error(er.code + ' invalid cwd ' + this.cwd)
+        error.path = this.cwd
+        error.code = er.code
+        throw error
+      }
+      break
+
+    case 'ENOENT': // not terribly unusual
+    case 'ELOOP':
+    case 'ENAMETOOLONG':
+    case 'UNKNOWN':
+      this.cache[this._makeAbs(f)] = false
+      break
+
+    default: // some unusual error.  Treat as failure.
+      this.cache[this._makeAbs(f)] = false
+      if (this.strict)
+        throw er
+      if (!this.silent)
+        console.error('glob error', er)
+      break
+  }
+}
+
+GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) {
+
+  var entries = this._readdir(abs, inGlobStar)
+
+  // no entries means not a dir, so it can never have matches
+  // foo.txt/** doesn't match foo.txt
+  if (!entries)
+    return
+
+  // test without the globstar, and with every child both below
+  // and replacing the globstar.
+  var remainWithoutGlobStar = remain.slice(1)
+  var gspref = prefix ? [ prefix ] : []
+  var noGlobStar = gspref.concat(remainWithoutGlobStar)
+
+  // the noGlobStar pattern exits the inGlobStar state
+  this._process(noGlobStar, index, false)
+
+  var len = entries.length
+  var isSym = this.symlinks[abs]
+
+  // If it's a symlink, and we're in a globstar, then stop
+  if (isSym && inGlobStar)
+    return
+
+  for (var i = 0; i < len; i++) {
+    var e = entries[i]
+    if (e.charAt(0) === '.' && !this.dot)
+      continue
+
+    // these two cases enter the inGlobStar state
+    var instead = gspref.concat(entries[i], remainWithoutGlobStar)
+    this._process(instead, index, true)
+
+    var below = gspref.concat(entries[i], remain)
+    this._process(below, index, true)
+  }
+}
+
+GlobSync.prototype._processSimple = function (prefix, index) {
+  // XXX review this.  Shouldn't it be doing the mounting etc
+  // before doing stat?  kinda weird?
+  var exists = this._stat(prefix)
+
+  if (!this.matches[index])
+    this.matches[index] = Object.create(null)
+
+  // If it doesn't exist, then just mark the lack of results
+  if (!exists)
+    return
+
+  if (prefix && isAbsolute(prefix) && !this.nomount) {
+    var trail = /[\/\\]$/.test(prefix)
+    if (prefix.charAt(0) === '/') {
+      prefix = path.join(this.root, prefix)
+    } else {
+      prefix = path.resolve(this.root, prefix)
+      if (trail)
+        prefix += '/'
+    }
+  }
+
+  if (process.platform === 'win32')
+    prefix = prefix.replace(/\\/g, '/')
+
+  // Mark this as a match
+  this._emitMatch(index, prefix)
+}
+
+// Returns either 'DIR', 'FILE', or false
+GlobSync.prototype._stat = function (f) {
+  var abs = this._makeAbs(f)
+  var needDir = f.slice(-1) === '/'
+
+  if (f.length > this.maxLength)
+    return false
+
+  if (!this.stat && ownProp(this.cache, abs)) {
+    var c = this.cache[abs]
+
+    if (Array.isArray(c))
+      c = 'DIR'
+
+    // It exists, but maybe not how we need it
+    if (!needDir || c === 'DIR')
+      return c
+
+    if (needDir && c === 'FILE')
+      return false
+
+    // otherwise we have to stat, because maybe c=true
+    // if we know it exists, but not what it is.
+  }
+
+  var exists
+  var stat = this.statCache[abs]
+  if (!stat) {
+    var lstat
+    try {
+      lstat = fs.lstatSync(abs)
+    } catch (er) {
+      if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
+        this.statCache[abs] = false
+        return false
+      }
+    }
+
+    if (lstat && lstat.isSymbolicLink()) {
+      try {
+        stat = fs.statSync(abs)
+      } catch (er) {
+        stat = lstat
+      }
+    } else {
+      stat = lstat
+    }
+  }
+
+  this.statCache[abs] = stat
+
+  var c = true
+  if (stat)
+    c = stat.isDirectory() ? 'DIR' : 'FILE'
+
+  this.cache[abs] = this.cache[abs] || c
+
+  if (needDir && c === 'FILE')
+    return false
+
+  return c
+}
+
+GlobSync.prototype._mark = function (p) {
+  return common.mark(this, p)
+}
+
+GlobSync.prototype._makeAbs = function (f) {
+  return common.makeAbs(this, f)
+}
diff --git a/wrt/node_modules/rimraf/package.json b/wrt/node_modules/rimraf/package.json
new file mode 100644 (file)
index 0000000..ec53604
--- /dev/null
@@ -0,0 +1,107 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "rimraf",
+        "scope": null,
+        "escapedName": "rimraf",
+        "name": "rimraf",
+        "rawSpec": "",
+        "spec": "latest",
+        "type": "tag"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt"
+    ]
+  ],
+  "_from": "rimraf@latest",
+  "_id": "rimraf@2.6.1",
+  "_inCache": true,
+  "_location": "/rimraf",
+  "_nodeVersion": "8.0.0-pre",
+  "_npmOperationalInternal": {
+    "host": "packages-18-east.internal.npmjs.com",
+    "tmp": "tmp/rimraf-2.6.1.tgz_1487908074285_0.8205490333493799"
+  },
+  "_npmUser": {
+    "name": "isaacs",
+    "email": "i@izs.me"
+  },
+  "_npmVersion": "4.3.0",
+  "_phantomChildren": {
+    "fs.realpath": "1.0.0",
+    "inflight": "1.0.6",
+    "inherits": "2.0.3",
+    "minimatch": "3.0.4",
+    "once": "1.4.0",
+    "path-is-absolute": "1.0.1"
+  },
+  "_requested": {
+    "raw": "rimraf",
+    "scope": null,
+    "escapedName": "rimraf",
+    "name": "rimraf",
+    "rawSpec": "",
+    "spec": "latest",
+    "type": "tag"
+  },
+  "_requiredBy": [
+    "#USER",
+    "/fs-plus"
+  ],
+  "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz",
+  "_shasum": "c2338ec643df7a1b7fe5c54fa86f57428a55f33d",
+  "_shrinkwrap": null,
+  "_spec": "rimraf",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bin": {
+    "rimraf": "./bin.js"
+  },
+  "bugs": {
+    "url": "https://github.com/isaacs/rimraf/issues"
+  },
+  "dependencies": {
+    "glob": "^7.0.5"
+  },
+  "description": "A deep deletion module for node (like `rm -rf`)",
+  "devDependencies": {
+    "mkdirp": "^0.5.1",
+    "tap": "^10.1.2"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "c2338ec643df7a1b7fe5c54fa86f57428a55f33d",
+    "tarball": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.1.tgz"
+  },
+  "files": [
+    "LICENSE",
+    "README.md",
+    "bin.js",
+    "rimraf.js"
+  ],
+  "gitHead": "d84fe2cc6646d30a401baadcee22ae105a2d4909",
+  "homepage": "https://github.com/isaacs/rimraf#readme",
+  "license": "ISC",
+  "main": "rimraf.js",
+  "maintainers": [
+    {
+      "name": "isaacs",
+      "email": "i@izs.me"
+    }
+  ],
+  "name": "rimraf",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/rimraf.git"
+  },
+  "scripts": {
+    "test": "tap test/*.js"
+  },
+  "version": "2.6.1"
+}
diff --git a/wrt/node_modules/rimraf/rimraf.js b/wrt/node_modules/rimraf/rimraf.js
new file mode 100644 (file)
index 0000000..c263312
--- /dev/null
@@ -0,0 +1,363 @@
+module.exports = rimraf
+rimraf.sync = rimrafSync
+
+var assert = require("assert")
+var path = require("path")
+var fs = require("fs")
+var glob = require("glob")
+
+var defaultGlobOpts = {
+  nosort: true,
+  silent: true
+}
+
+// for EMFILE handling
+var timeout = 0
+
+var isWindows = (process.platform === "win32")
+
+function defaults (options) {
+  var methods = [
+    'unlink',
+    'chmod',
+    'stat',
+    'lstat',
+    'rmdir',
+    'readdir'
+  ]
+  methods.forEach(function(m) {
+    options[m] = options[m] || fs[m]
+    m = m + 'Sync'
+    options[m] = options[m] || fs[m]
+  })
+
+  options.maxBusyTries = options.maxBusyTries || 3
+  options.emfileWait = options.emfileWait || 1000
+  if (options.glob === false) {
+    options.disableGlob = true
+  }
+  options.disableGlob = options.disableGlob || false
+  options.glob = options.glob || defaultGlobOpts
+}
+
+function rimraf (p, options, cb) {
+  if (typeof options === 'function') {
+    cb = options
+    options = {}
+  }
+
+  assert(p, 'rimraf: missing path')
+  assert.equal(typeof p, 'string', 'rimraf: path should be a string')
+  assert.equal(typeof cb, 'function', 'rimraf: callback function required')
+  assert(options, 'rimraf: invalid options argument provided')
+  assert.equal(typeof options, 'object', 'rimraf: options should be object')
+
+  defaults(options)
+
+  var busyTries = 0
+  var errState = null
+  var n = 0
+
+  if (options.disableGlob || !glob.hasMagic(p))
+    return afterGlob(null, [p])
+
+  options.lstat(p, function (er, stat) {
+    if (!er)
+      return afterGlob(null, [p])
+
+    glob(p, options.glob, afterGlob)
+  })
+
+  function next (er) {
+    errState = errState || er
+    if (--n === 0)
+      cb(errState)
+  }
+
+  function afterGlob (er, results) {
+    if (er)
+      return cb(er)
+
+    n = results.length
+    if (n === 0)
+      return cb()
+
+    results.forEach(function (p) {
+      rimraf_(p, options, function CB (er) {
+        if (er) {
+          if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") &&
+              busyTries < options.maxBusyTries) {
+            busyTries ++
+            var time = busyTries * 100
+            // try again, with the same exact callback as this one.
+            return setTimeout(function () {
+              rimraf_(p, options, CB)
+            }, time)
+          }
+
+          // this one won't happen if graceful-fs is used.
+          if (er.code === "EMFILE" && timeout < options.emfileWait) {
+            return setTimeout(function () {
+              rimraf_(p, options, CB)
+            }, timeout ++)
+          }
+
+          // already gone
+          if (er.code === "ENOENT") er = null
+        }
+
+        timeout = 0
+        next(er)
+      })
+    })
+  }
+}
+
+// Two possible strategies.
+// 1. Assume it's a file.  unlink it, then do the dir stuff on EPERM or EISDIR
+// 2. Assume it's a directory.  readdir, then do the file stuff on ENOTDIR
+//
+// Both result in an extra syscall when you guess wrong.  However, there
+// are likely far more normal files in the world than directories.  This
+// is based on the assumption that a the average number of files per
+// directory is >= 1.
+//
+// If anyone ever complains about this, then I guess the strategy could
+// be made configurable somehow.  But until then, YAGNI.
+function rimraf_ (p, options, cb) {
+  assert(p)
+  assert(options)
+  assert(typeof cb === 'function')
+
+  // sunos lets the root user unlink directories, which is... weird.
+  // so we have to lstat here and make sure it's not a dir.
+  options.lstat(p, function (er, st) {
+    if (er && er.code === "ENOENT")
+      return cb(null)
+
+    // Windows can EPERM on stat.  Life is suffering.
+    if (er && er.code === "EPERM" && isWindows)
+      fixWinEPERM(p, options, er, cb)
+
+    if (st && st.isDirectory())
+      return rmdir(p, options, er, cb)
+
+    options.unlink(p, function (er) {
+      if (er) {
+        if (er.code === "ENOENT")
+          return cb(null)
+        if (er.code === "EPERM")
+          return (isWindows)
+            ? fixWinEPERM(p, options, er, cb)
+            : rmdir(p, options, er, cb)
+        if (er.code === "EISDIR")
+          return rmdir(p, options, er, cb)
+      }
+      return cb(er)
+    })
+  })
+}
+
+function fixWinEPERM (p, options, er, cb) {
+  assert(p)
+  assert(options)
+  assert(typeof cb === 'function')
+  if (er)
+    assert(er instanceof Error)
+
+  options.chmod(p, 666, function (er2) {
+    if (er2)
+      cb(er2.code === "ENOENT" ? null : er)
+    else
+      options.stat(p, function(er3, stats) {
+        if (er3)
+          cb(er3.code === "ENOENT" ? null : er)
+        else if (stats.isDirectory())
+          rmdir(p, options, er, cb)
+        else
+          options.unlink(p, cb)
+      })
+  })
+}
+
+function fixWinEPERMSync (p, options, er) {
+  assert(p)
+  assert(options)
+  if (er)
+    assert(er instanceof Error)
+
+  try {
+    options.chmodSync(p, 666)
+  } catch (er2) {
+    if (er2.code === "ENOENT")
+      return
+    else
+      throw er
+  }
+
+  try {
+    var stats = options.statSync(p)
+  } catch (er3) {
+    if (er3.code === "ENOENT")
+      return
+    else
+      throw er
+  }
+
+  if (stats.isDirectory())
+    rmdirSync(p, options, er)
+  else
+    options.unlinkSync(p)
+}
+
+function rmdir (p, options, originalEr, cb) {
+  assert(p)
+  assert(options)
+  if (originalEr)
+    assert(originalEr instanceof Error)
+  assert(typeof cb === 'function')
+
+  // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)
+  // if we guessed wrong, and it's not a directory, then
+  // raise the original error.
+  options.rmdir(p, function (er) {
+    if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM"))
+      rmkids(p, options, cb)
+    else if (er && er.code === "ENOTDIR")
+      cb(originalEr)
+    else
+      cb(er)
+  })
+}
+
+function rmkids(p, options, cb) {
+  assert(p)
+  assert(options)
+  assert(typeof cb === 'function')
+
+  options.readdir(p, function (er, files) {
+    if (er)
+      return cb(er)
+    var n = files.length
+    if (n === 0)
+      return options.rmdir(p, cb)
+    var errState
+    files.forEach(function (f) {
+      rimraf(path.join(p, f), options, function (er) {
+        if (errState)
+          return
+        if (er)
+          return cb(errState = er)
+        if (--n === 0)
+          options.rmdir(p, cb)
+      })
+    })
+  })
+}
+
+// this looks simpler, and is strictly *faster*, but will
+// tie up the JavaScript thread and fail on excessively
+// deep directory trees.
+function rimrafSync (p, options) {
+  options = options || {}
+  defaults(options)
+
+  assert(p, 'rimraf: missing path')
+  assert.equal(typeof p, 'string', 'rimraf: path should be a string')
+  assert(options, 'rimraf: missing options')
+  assert.equal(typeof options, 'object', 'rimraf: options should be object')
+
+  var results
+
+  if (options.disableGlob || !glob.hasMagic(p)) {
+    results = [p]
+  } else {
+    try {
+      options.lstatSync(p)
+      results = [p]
+    } catch (er) {
+      results = glob.sync(p, options.glob)
+    }
+  }
+
+  if (!results.length)
+    return
+
+  for (var i = 0; i < results.length; i++) {
+    var p = results[i]
+
+    try {
+      var st = options.lstatSync(p)
+    } catch (er) {
+      if (er.code === "ENOENT")
+        return
+
+      // Windows can EPERM on stat.  Life is suffering.
+      if (er.code === "EPERM" && isWindows)
+        fixWinEPERMSync(p, options, er)
+    }
+
+    try {
+      // sunos lets the root user unlink directories, which is... weird.
+      if (st && st.isDirectory())
+        rmdirSync(p, options, null)
+      else
+        options.unlinkSync(p)
+    } catch (er) {
+      if (er.code === "ENOENT")
+        return
+      if (er.code === "EPERM")
+        return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er)
+      if (er.code !== "EISDIR")
+        throw er
+
+      rmdirSync(p, options, er)
+    }
+  }
+}
+
+function rmdirSync (p, options, originalEr) {
+  assert(p)
+  assert(options)
+  if (originalEr)
+    assert(originalEr instanceof Error)
+
+  try {
+    options.rmdirSync(p)
+  } catch (er) {
+    if (er.code === "ENOENT")
+      return
+    if (er.code === "ENOTDIR")
+      throw originalEr
+    if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")
+      rmkidsSync(p, options)
+  }
+}
+
+function rmkidsSync (p, options) {
+  assert(p)
+  assert(options)
+  options.readdirSync(p).forEach(function (f) {
+    rimrafSync(path.join(p, f), options)
+  })
+
+  // We only end up here once we got ENOTEMPTY at least once, and
+  // at this point, we are guaranteed to have removed all the kids.
+  // So, we know that it won't be ENOENT or ENOTDIR or anything else.
+  // try really hard to delete stuff on windows, because it has a
+  // PROFOUNDLY annoying habit of not closing handles promptly when
+  // files are deleted, resulting in spurious ENOTEMPTY errors.
+  var retries = isWindows ? 100 : 1
+  var i = 0
+  do {
+    var threw = true
+    try {
+      var ret = options.rmdirSync(p, options)
+      threw = false
+      return ret
+    } finally {
+      if (++i < retries && threw)
+        continue
+    }
+  } while (true)
+}
diff --git a/wrt/node_modules/run-series/.travis.yml b/wrt/node_modules/run-series/.travis.yml
new file mode 100644 (file)
index 0000000..9667c9f
--- /dev/null
@@ -0,0 +1,7 @@
+language: node_js
+node_js:
+- iojs
+env:
+  global:
+  - secure: HOrgHaG2QGLNFsFaF3ap0JvKouREay2UGrHbLbddL6IXNFJq+x8enmvcXCTmo+GvCrjLyis2/DRii5zkwugiNoiA1Jh6TyX7TAekCeKGsObY+IFW/k7M3XzibnO/6NwnW1GZwLihaD3eOelNAkWw/hfwCvUyfIZiLUri+GdmbhY=
+  - secure: YvEwB2a/WTQoge0zoG9o1SJgU2lhvFVCQtzOzt0g1xn0lRA96fy5WFt8SG68zrv82J0UlQenSzG1YVV1dmOSKys8HeCh4ofxc82FVVOaliLRxNHi4aUYO9/zzEqbbRxenIt2Xvm4TH0kd9YqJwwkQCVhr2Uq+97PXYRX/5cCk0Y=
diff --git a/wrt/node_modules/run-series/.zuul.yml b/wrt/node_modules/run-series/.zuul.yml
new file mode 100644 (file)
index 0000000..00fd8dd
--- /dev/null
@@ -0,0 +1,16 @@
+ui: tape
+browsers:
+  - name: chrome
+    version: latest
+  - name: firefox
+    version: latest
+  - name: safari
+    version: latest
+  - name: ie
+    version: latest
+  - name: iphone
+    version: latest
+  - name: ipad
+    version: latest
+  - name: android
+    version: latest
diff --git a/wrt/node_modules/run-series/LICENSE b/wrt/node_modules/run-series/LICENSE
new file mode 100644 (file)
index 0000000..c7e6852
--- /dev/null
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright (c) Feross Aboukhadijeh
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/run-series/README.md b/wrt/node_modules/run-series/README.md
new file mode 100644 (file)
index 0000000..59977c1
--- /dev/null
@@ -0,0 +1,76 @@
+# run-series [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url]
+
+[travis-image]: https://img.shields.io/travis/feross/run-series.svg?style=flat
+[travis-url]: https://travis-ci.org/feross/run-series
+[npm-image]: https://img.shields.io/npm/v/run-series.svg?style=flat
+[npm-url]: https://npmjs.org/package/run-series
+[downloads-image]: https://img.shields.io/npm/dm/run-series.svg?style=flat
+[downloads-url]: https://npmjs.org/package/run-series
+
+### Run an array of functions in series
+
+![series](https://raw.githubusercontent.com/feross/run-series/master/img.png) [![Sauce Test Status](https://saucelabs.com/browser-matrix/run-series.svg)](https://saucelabs.com/u/run-series)
+
+### install
+
+```
+npm install run-series
+```
+
+### usage
+
+#### series(tasks, [callback])
+
+Run the functions in the `tasks` array in series, each one running once the previous
+function has completed. If any functions in the series pass an error to its callback, no
+more functions are run, and `callback` is immediately called with the value of the error.
+Otherwise, `callback` receives an array of results when `tasks` have completed.
+
+##### arguments
+
+- `tasks` - An array containing functions to run, each function is passed a
+`callback(err, result)` which it must call on completion with an error `err` (which can
+be `null`) and an optional result value.
+- `callback(err, results)` - An optional callback to run once all the functions have
+completed. This function gets a results array containing all the result arguments passed
+to the task callbacks.
+
+##### example
+
+```js
+var series = require('run-series')
+
+series([
+  function (callback) {
+    // do some stuff ...
+    callback(null, 'one')
+  },
+  function (callback) {
+    // do some stuff ...
+    callback(null, 'two')
+  }
+],
+// optional callback
+function (err, results) {
+  // the results array will equal ['one','two']
+})
+```
+
+This module is basically equavalent to
+[`async.series`](https://github.com/caolan/async#seriestasks-callback), but it's
+handy to just have the functions you need instead of the kitchen sink. Modularity!
+Especially handy if you're serving to the browser and need to reduce your javascript
+bundle size.
+
+Works great in the browser with [browserify](http://browserify.org/)!
+
+### see also
+
+- [run-auto](https://github.com/feross/run-auto)
+- [run-parallel](https://github.com/feross/run-parallel)
+- [run-parallel-limit](https://github.com/feross/run-parallel-limit)
+- [run-waterfall](https://github.com/feross/run-waterfall)
+
+### license
+
+MIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org).
diff --git a/wrt/node_modules/run-series/img.png b/wrt/node_modules/run-series/img.png
new file mode 100644 (file)
index 0000000..86516cb
Binary files /dev/null and b/wrt/node_modules/run-series/img.png differ
diff --git a/wrt/node_modules/run-series/index.js b/wrt/node_modules/run-series/index.js
new file mode 100644 (file)
index 0000000..fece9fe
--- /dev/null
@@ -0,0 +1,24 @@
+module.exports = function (tasks, cb) {
+  var current = 0
+  var results = []
+  var isSync = true
+
+  function done (err) {
+    function end () {
+      if (cb) cb(err, results)
+    }
+    if (isSync) process.nextTick(end)
+    else end()
+  }
+
+  function each (err, result) {
+    results.push(result)
+    if (++current >= tasks.length || err) done(err)
+    else tasks[current](each)
+  }
+
+  if (tasks.length > 0) tasks[0](each)
+  else done(null)
+
+  isSync = false
+}
diff --git a/wrt/node_modules/run-series/package.json b/wrt/node_modules/run-series/package.json
new file mode 100644 (file)
index 0000000..70ec1c0
--- /dev/null
@@ -0,0 +1,98 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "run-series",
+        "scope": null,
+        "escapedName": "run-series",
+        "name": "run-series",
+        "rawSpec": "",
+        "spec": "latest",
+        "type": "tag"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt"
+    ]
+  ],
+  "_from": "run-series@latest",
+  "_id": "run-series@1.1.4",
+  "_inCache": true,
+  "_location": "/run-series",
+  "_nodeVersion": "4.1.0",
+  "_npmUser": {
+    "name": "feross",
+    "email": "feross@feross.org"
+  },
+  "_npmVersion": "2.14.3",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "run-series",
+    "scope": null,
+    "escapedName": "run-series",
+    "name": "run-series",
+    "rawSpec": "",
+    "spec": "latest",
+    "type": "tag"
+  },
+  "_requiredBy": [
+    "#USER"
+  ],
+  "_resolved": "https://registry.npmjs.org/run-series/-/run-series-1.1.4.tgz",
+  "_shasum": "89a73ddc5e75c9ef8ab6320c0a1600d6a41179b9",
+  "_shrinkwrap": null,
+  "_spec": "run-series",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt",
+  "author": {
+    "name": "Feross Aboukhadijeh",
+    "email": "feross@feross.org",
+    "url": "http://feross.org/"
+  },
+  "bugs": {
+    "url": "https://github.com/feross/run-series/issues"
+  },
+  "dependencies": {},
+  "description": "Run an array of functions in series",
+  "devDependencies": {
+    "standard": "^4.3.2",
+    "tape": "^4.0.0",
+    "zuul": "^3.1.0"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "89a73ddc5e75c9ef8ab6320c0a1600d6a41179b9",
+    "tarball": "https://registry.npmjs.org/run-series/-/run-series-1.1.4.tgz"
+  },
+  "gitHead": "35e62fe9fdf745a952bd38163d4dee3eb9e80a54",
+  "homepage": "https://github.com/feross/run-series",
+  "keywords": [
+    "series",
+    "async",
+    "function",
+    "callback",
+    "asynchronous",
+    "run",
+    "array",
+    "run series"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "feross",
+      "email": "feross@feross.org"
+    }
+  ],
+  "name": "run-series",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/feross/run-series.git"
+  },
+  "scripts": {
+    "test": "standard && npm run test-node && npm run test-browser",
+    "test-browser": "zuul -- test/*.js",
+    "test-browser-local": "zuul --local -- test/*.js",
+    "test-node": "tape test/*.js"
+  },
+  "version": "1.1.4"
+}
diff --git a/wrt/node_modules/run-series/test/basic.js b/wrt/node_modules/run-series/test/basic.js
new file mode 100644 (file)
index 0000000..04479b6
--- /dev/null
@@ -0,0 +1,71 @@
+var series = require('../')
+var test = require('tape')
+
+test('functions run in series', function (t) {
+  t.plan(4)
+
+  var tasks = [
+    function (cb) {
+      t.pass('cb 1')
+      cb(null)
+    },
+    function (cb) {
+      t.pass('cb 2')
+      cb(null)
+    },
+    function (cb) {
+      t.pass('cb 3')
+      cb(null)
+    }
+  ]
+
+  series(tasks, function (err) {
+    t.error(err)
+  })
+})
+
+test('functions that return results', function (t) {
+  t.plan(4)
+
+  var tasks = [
+    function (cb) {
+      t.pass('cb 1')
+      cb(null, 1)
+    },
+    function (cb) {
+      t.pass('cb 2')
+      cb(null, 2)
+    }
+  ]
+
+  series(tasks, function (err, results) {
+    t.error(err)
+    t.deepEqual(results, [1, 2])
+  })
+})
+
+test('functions that return results preserve order', function (t) {
+  t.plan(4)
+
+  var tasks = [
+    function (cb) {
+      setTimeout(function () {
+        t.pass('cb 1')
+        cb(null, 1)
+      }, 200)
+    },
+    function (cb) {
+      setTimeout(function () {
+        t.pass('cb 2')
+        cb(null, 2)
+      }, 100)
+    }
+  ]
+
+  series(tasks, function (err, results) {
+    t.error(err)
+
+    // 2 should be second, even though it gets returned first
+    t.deepEqual(results, [1, 2])
+  })
+})
diff --git a/wrt/node_modules/run-series/test/empty-array.js b/wrt/node_modules/run-series/test/empty-array.js
new file mode 100644 (file)
index 0000000..603a181
--- /dev/null
@@ -0,0 +1,16 @@
+var series = require('../')
+var test = require('tape')
+
+test('empty tasks array', function (t) {
+  t.plan(1)
+
+  series([], function (err) {
+    t.error(err)
+  })
+})
+
+test('empty tasks array and no callback', function (t) {
+  series([])
+  t.pass('did not throw')
+  t.end()
+})
diff --git a/wrt/node_modules/run-series/test/error.js b/wrt/node_modules/run-series/test/error.js
new file mode 100644 (file)
index 0000000..4eef69f
--- /dev/null
@@ -0,0 +1,23 @@
+var series = require('../')
+var test = require('tape')
+
+test('functions that return errors', function (t) {
+  t.plan(2)
+
+  var tasks = [
+    function (cb) {
+      t.pass('cb 1')
+      cb(new Error('oops'))
+    },
+    function (cb) {
+      setTimeout(function () {
+        t.fail('should not execute')
+        cb(null, 2)
+      }, 100)
+    }
+  ]
+
+  series(tasks, function (err) {
+    t.ok(err instanceof Error)
+  })
+})
diff --git a/wrt/node_modules/run-series/test/no-callback.js b/wrt/node_modules/run-series/test/no-callback.js
new file mode 100644 (file)
index 0000000..b576871
--- /dev/null
@@ -0,0 +1,19 @@
+var series = require('../')
+var test = require('tape')
+
+test('no callback', function (t) {
+  t.plan(2)
+
+  var tasks = [
+    function (cb) {
+      t.pass('cb 1')
+      cb(null)
+    },
+    function (cb) {
+      t.pass('cb 2')
+      cb(null)
+    }
+  ]
+
+  series(tasks)
+})
diff --git a/wrt/node_modules/safe-buffer/.travis.yml b/wrt/node_modules/safe-buffer/.travis.yml
new file mode 100644 (file)
index 0000000..7b20f28
--- /dev/null
@@ -0,0 +1,7 @@
+language: node_js
+node_js:
+  - 'node'
+  - '5'
+  - '4'
+  - '0.12'
+  - '0.10'
diff --git a/wrt/node_modules/safe-buffer/LICENSE b/wrt/node_modules/safe-buffer/LICENSE
new file mode 100644 (file)
index 0000000..0c068ce
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Feross Aboukhadijeh
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/safe-buffer/README.md b/wrt/node_modules/safe-buffer/README.md
new file mode 100644 (file)
index 0000000..96eb387
--- /dev/null
@@ -0,0 +1,581 @@
+# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][npm-url]
+
+#### Safer Node.js Buffer API
+
+**Use the new Node.js v6 Buffer APIs (`Buffer.from`, `Buffer.alloc`,
+`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in Node.js v0.10, v0.12, v4.x, and v5.x.**
+
+**Uses the built-in implementations when available.**
+
+[travis-image]: https://img.shields.io/travis/feross/safe-buffer.svg
+[travis-url]: https://travis-ci.org/feross/safe-buffer
+[npm-image]: https://img.shields.io/npm/v/safe-buffer.svg
+[npm-url]: https://npmjs.org/package/safe-buffer
+[downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg
+
+## install
+
+```
+npm install safe-buffer
+```
+
+## usage
+
+The goal of this package is to provide a safe replacement for the node.js `Buffer`.
+
+It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to
+the top of your node.js modules:
+
+```js
+var Buffer = require('safe-buffer').Buffer
+
+// Existing buffer code will continue to work without issues:
+
+new Buffer('hey', 'utf8')
+new Buffer([1, 2, 3], 'utf8')
+new Buffer(obj)
+new Buffer(16) // create an uninitialized buffer (potentially unsafe)
+
+// But you can use these new explicit APIs to make clear what you want:
+
+Buffer.from('hey', 'utf8') // convert from many types to a Buffer
+Buffer.alloc(16) // create a zero-filled buffer (safe)
+Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe)
+```
+
+## api
+
+### Class Method: Buffer.from(array)
+<!-- YAML
+added: v3.0.0
+-->
+
+* `array` {Array}
+
+Allocates a new `Buffer` using an `array` of octets.
+
+```js
+const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]);
+  // creates a new Buffer containing ASCII bytes
+  // ['b','u','f','f','e','r']
+```
+
+A `TypeError` will be thrown if `array` is not an `Array`.
+
+### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]])
+<!-- YAML
+added: v5.10.0
+-->
+
+* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or
+  a `new ArrayBuffer()`
+* `byteOffset` {Number} Default: `0`
+* `length` {Number} Default: `arrayBuffer.length - byteOffset`
+
+When passed a reference to the `.buffer` property of a `TypedArray` instance,
+the newly created `Buffer` will share the same allocated memory as the
+TypedArray.
+
+```js
+const arr = new Uint16Array(2);
+arr[0] = 5000;
+arr[1] = 4000;
+
+const buf = Buffer.from(arr.buffer); // shares the memory with arr;
+
+console.log(buf);
+  // Prints: <Buffer 88 13 a0 0f>
+
+// changing the TypedArray changes the Buffer also
+arr[1] = 6000;
+
+console.log(buf);
+  // Prints: <Buffer 88 13 70 17>
+```
+
+The optional `byteOffset` and `length` arguments specify a memory range within
+the `arrayBuffer` that will be shared by the `Buffer`.
+
+```js
+const ab = new ArrayBuffer(10);
+const buf = Buffer.from(ab, 0, 2);
+console.log(buf.length);
+  // Prints: 2
+```
+
+A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`.
+
+### Class Method: Buffer.from(buffer)
+<!-- YAML
+added: v3.0.0
+-->
+
+* `buffer` {Buffer}
+
+Copies the passed `buffer` data onto a new `Buffer` instance.
+
+```js
+const buf1 = Buffer.from('buffer');
+const buf2 = Buffer.from(buf1);
+
+buf1[0] = 0x61;
+console.log(buf1.toString());
+  // 'auffer'
+console.log(buf2.toString());
+  // 'buffer' (copy is not changed)
+```
+
+A `TypeError` will be thrown if `buffer` is not a `Buffer`.
+
+### Class Method: Buffer.from(str[, encoding])
+<!-- YAML
+added: v5.10.0
+-->
+
+* `str` {String} String to encode.
+* `encoding` {String} Encoding to use, Default: `'utf8'`
+
+Creates a new `Buffer` containing the given JavaScript string `str`. If
+provided, the `encoding` parameter identifies the character encoding.
+If not provided, `encoding` defaults to `'utf8'`.
+
+```js
+const buf1 = Buffer.from('this is a tést');
+console.log(buf1.toString());
+  // prints: this is a tést
+console.log(buf1.toString('ascii'));
+  // prints: this is a tC)st
+
+const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex');
+console.log(buf2.toString());
+  // prints: this is a tést
+```
+
+A `TypeError` will be thrown if `str` is not a string.
+
+### Class Method: Buffer.alloc(size[, fill[, encoding]])
+<!-- YAML
+added: v5.10.0
+-->
+
+* `size` {Number}
+* `fill` {Value} Default: `undefined`
+* `encoding` {String} Default: `utf8`
+
+Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the
+`Buffer` will be *zero-filled*.
+
+```js
+const buf = Buffer.alloc(5);
+console.log(buf);
+  // <Buffer 00 00 00 00 00>
+```
+
+The `size` must be less than or equal to the value of
+`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is
+`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will
+be created if a `size` less than or equal to 0 is specified.
+
+If `fill` is specified, the allocated `Buffer` will be initialized by calling
+`buf.fill(fill)`. See [`buf.fill()`][] for more information.
+
+```js
+const buf = Buffer.alloc(5, 'a');
+console.log(buf);
+  // <Buffer 61 61 61 61 61>
+```
+
+If both `fill` and `encoding` are specified, the allocated `Buffer` will be
+initialized by calling `buf.fill(fill, encoding)`. For example:
+
+```js
+const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');
+console.log(buf);
+  // <Buffer 68 65 6c 6c 6f 20 77 6f 72 6c 64>
+```
+
+Calling `Buffer.alloc(size)` can be significantly slower than the alternative
+`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance
+contents will *never contain sensitive data*.
+
+A `TypeError` will be thrown if `size` is not a number.
+
+### Class Method: Buffer.allocUnsafe(size)
+<!-- YAML
+added: v5.10.0
+-->
+
+* `size` {Number}
+
+Allocates a new *non-zero-filled* `Buffer` of `size` bytes.  The `size` must
+be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit
+architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is
+thrown. A zero-length Buffer will be created if a `size` less than or equal to
+0 is specified.
+
+The underlying memory for `Buffer` instances created in this way is *not
+initialized*. The contents of the newly created `Buffer` are unknown and
+*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such
+`Buffer` instances to zeroes.
+
+```js
+const buf = Buffer.allocUnsafe(5);
+console.log(buf);
+  // <Buffer 78 e0 82 02 01>
+  // (octets will be different, every time)
+buf.fill(0);
+console.log(buf);
+  // <Buffer 00 00 00 00 00>
+```
+
+A `TypeError` will be thrown if `size` is not a number.
+
+Note that the `Buffer` module pre-allocates an internal `Buffer` instance of
+size `Buffer.poolSize` that is used as a pool for the fast allocation of new
+`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated
+`new Buffer(size)` constructor) only when `size` is less than or equal to
+`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default
+value of `Buffer.poolSize` is `8192` but can be modified.
+
+Use of this pre-allocated internal memory pool is a key difference between
+calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`.
+Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer
+pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal
+Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The
+difference is subtle but can be important when an application requires the
+additional performance that `Buffer.allocUnsafe(size)` provides.
+
+### Class Method: Buffer.allocUnsafeSlow(size)
+<!-- YAML
+added: v5.10.0
+-->
+
+* `size` {Number}
+
+Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes.  The
+`size` must be less than or equal to the value of
+`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is
+`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will
+be created if a `size` less than or equal to 0 is specified.
+
+The underlying memory for `Buffer` instances created in this way is *not
+initialized*. The contents of the newly created `Buffer` are unknown and
+*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such
+`Buffer` instances to zeroes.
+
+When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances,
+allocations under 4KB are, by default, sliced from a single pre-allocated
+`Buffer`. This allows applications to avoid the garbage collection overhead of
+creating many individually allocated Buffers. This approach improves both
+performance and memory usage by eliminating the need to track and cleanup as
+many `Persistent` objects.
+
+However, in the case where a developer may need to retain a small chunk of
+memory from a pool for an indeterminate amount of time, it may be appropriate
+to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then
+copy out the relevant bits.
+
+```js
+// need to keep around a few small chunks of memory
+const store = [];
+
+socket.on('readable', () => {
+  const data = socket.read();
+  // allocate for retained data
+  const sb = Buffer.allocUnsafeSlow(10);
+  // copy the data into the new allocation
+  data.copy(sb, 0, 0, 10);
+  store.push(sb);
+});
+```
+
+Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after*
+a developer has observed undue memory retention in their applications.
+
+A `TypeError` will be thrown if `size` is not a number.
+
+### All the Rest
+
+The rest of the `Buffer` API is exactly the same as in node.js.
+[See the docs](https://nodejs.org/api/buffer.html).
+
+
+## Related links
+
+- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660)
+- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4)
+
+## Why is `Buffer` unsafe?
+
+Today, the node.js `Buffer` constructor is overloaded to handle many different argument
+types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.),
+`ArrayBuffer`, and also `Number`.
+
+The API is optimized for convenience: you can throw any type at it, and it will try to do
+what you want.
+
+Because the Buffer constructor is so powerful, you often see code like this:
+
+```js
+// Convert UTF-8 strings to hex
+function toHex (str) {
+  return new Buffer(str).toString('hex')
+}
+```
+
+***But what happens if `toHex` is called with a `Number` argument?***
+
+### Remote Memory Disclosure
+
+If an attacker can make your program call the `Buffer` constructor with a `Number`
+argument, then they can make it allocate uninitialized memory from the node.js process.
+This could potentially disclose TLS private keys, user data, or database passwords.
+
+When the `Buffer` constructor is passed a `Number` argument, it returns an
+**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like
+this, you **MUST** overwrite the contents before returning it to the user.
+
+From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size):
+
+> `new Buffer(size)`
+>
+> - `size` Number
+>
+> The underlying memory for `Buffer` instances created in this way is not initialized.
+> **The contents of a newly created `Buffer` are unknown and could contain sensitive
+> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes.
+
+(Emphasis our own.)
+
+Whenever the programmer intended to create an uninitialized `Buffer` you often see code
+like this:
+
+```js
+var buf = new Buffer(16)
+
+// Immediately overwrite the uninitialized buffer with data from another buffer
+for (var i = 0; i < buf.length; i++) {
+  buf[i] = otherBuf[i]
+}
+```
+
+
+### Would this ever be a problem in real code?
+
+Yes. It's surprisingly common to forget to check the type of your variables in a
+dynamically-typed language like JavaScript.
+
+Usually the consequences of assuming the wrong type is that your program crashes with an
+uncaught exception. But the failure mode for forgetting to check the type of arguments to
+the `Buffer` constructor is more catastrophic.
+
+Here's an example of a vulnerable service that takes a JSON payload and converts it to
+hex:
+
+```js
+// Take a JSON payload {str: "some string"} and convert it to hex
+var server = http.createServer(function (req, res) {
+  var data = ''
+  req.setEncoding('utf8')
+  req.on('data', function (chunk) {
+    data += chunk
+  })
+  req.on('end', function () {
+    var body = JSON.parse(data)
+    res.end(new Buffer(body.str).toString('hex'))
+  })
+})
+
+server.listen(8080)
+```
+
+In this example, an http client just has to send:
+
+```json
+{
+  "str": 1000
+}
+```
+
+and it will get back 1,000 bytes of uninitialized memory from the server.
+
+This is a very serious bug. It's similar in severity to the
+[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process
+memory by remote attackers.
+
+
+### Which real-world packages were vulnerable?
+
+#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht)
+
+[Mathias Buus](https://github.com/mafintosh) and I
+([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages,
+[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow
+anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get
+them to reveal 20 bytes at a time of uninitialized memory from the node.js process.
+
+Here's
+[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8)
+that fixed it. We released a new fixed version, created a
+[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all
+vulnerable versions on npm so users will get a warning to upgrade to a newer version.
+
+#### [`ws`](https://www.npmjs.com/package/ws)
+
+That got us wondering if there were other vulnerable packages. Sure enough, within a short
+period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the
+most popular WebSocket implementation in node.js.
+
+If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as
+expected, then uninitialized server memory would be disclosed to the remote peer.
+
+These were the vulnerable methods:
+
+```js
+socket.send(number)
+socket.ping(number)
+socket.pong(number)
+```
+
+Here's a vulnerable socket server with some echo functionality:
+
+```js
+server.on('connection', function (socket) {
+  socket.on('message', function (message) {
+    message = JSON.parse(message)
+    if (message.type === 'echo') {
+      socket.send(message.data) // send back the user's message
+    }
+  })
+})
+```
+
+`socket.send(number)` called on the server, will disclose server memory.
+
+Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue
+was fixed, with a more detailed explanation. Props to
+[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the
+[Node Security Project disclosure](https://nodesecurity.io/advisories/67).
+
+
+### What's the solution?
+
+It's important that node.js offers a fast way to get memory otherwise performance-critical
+applications would needlessly get a lot slower.
+
+But we need a better way to *signal our intent* as programmers. **When we want
+uninitialized memory, we should request it explicitly.**
+
+Sensitive functionality should not be packed into a developer-friendly API that loosely
+accepts many different types. This type of API encourages the lazy practice of passing
+variables in without checking the type very carefully.
+
+#### A new API: `Buffer.allocUnsafe(number)`
+
+The functionality of creating buffers with uninitialized memory should be part of another
+API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that
+frequently gets user input of all sorts of different types passed into it.
+
+```js
+var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory!
+
+// Immediately overwrite the uninitialized buffer with data from another buffer
+for (var i = 0; i < buf.length; i++) {
+  buf[i] = otherBuf[i]
+}
+```
+
+
+### How do we fix node.js core?
+
+We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as
+`semver-major`) which defends against one case:
+
+```js
+var str = 16
+new Buffer(str, 'utf8')
+```
+
+In this situation, it's implied that the programmer intended the first argument to be a
+string, since they passed an encoding as a second argument. Today, node.js will allocate
+uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not
+what the programmer intended.
+
+But this is only a partial solution, since if the programmer does `new Buffer(variable)`
+(without an `encoding` parameter) there's no way to know what they intended. If `variable`
+is sometimes a number, then uninitialized memory will sometimes be returned.
+
+### What's the real long-term fix?
+
+We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when
+we need uninitialized memory. But that would break 1000s of packages.
+
+~~We believe the best solution is to:~~
+
+~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~
+
+~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~
+
+#### Update
+
+We now support adding three new APIs:
+
+- `Buffer.from(value)` - convert from any type to a buffer
+- `Buffer.alloc(size)` - create a zero-filled buffer
+- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size
+
+This solves the core problem that affected `ws` and `bittorrent-dht` which is
+`Buffer(variable)` getting tricked into taking a number argument.
+
+This way, existing code continues working and the impact on the npm ecosystem will be
+minimal. Over time, npm maintainers can migrate performance-critical code to use
+`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`.
+
+
+### Conclusion
+
+We think there's a serious design issue with the `Buffer` API as it exists today. It
+promotes insecure software by putting high-risk functionality into a convenient API
+with friendly "developer ergonomics".
+
+This wasn't merely a theoretical exercise because we found the issue in some of the
+most popular npm packages.
+
+Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of
+`buffer`.
+
+```js
+var Buffer = require('safe-buffer').Buffer
+```
+
+Eventually, we hope that node.js core can switch to this new, safer behavior. We believe
+the impact on the ecosystem would be minimal since it's not a breaking change.
+Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while
+older, insecure packages would magically become safe from this attack vector.
+
+
+## links
+
+- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514)
+- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67)
+- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68)
+
+
+## credit
+
+The original issues in `bittorrent-dht`
+([disclosure](https://nodesecurity.io/advisories/68)) and
+`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by
+[Mathias Buus](https://github.com/mafintosh) and
+[Feross Aboukhadijeh](http://feross.org/).
+
+Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues
+and for his work running the [Node Security Project](https://nodesecurity.io/).
+
+Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and
+auditing the code.
+
+
+## license
+
+MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org)
diff --git a/wrt/node_modules/safe-buffer/browser.js b/wrt/node_modules/safe-buffer/browser.js
new file mode 100644 (file)
index 0000000..0bd1202
--- /dev/null
@@ -0,0 +1 @@
+module.exports = require('buffer')
diff --git a/wrt/node_modules/safe-buffer/index.js b/wrt/node_modules/safe-buffer/index.js
new file mode 100644 (file)
index 0000000..74a7358
--- /dev/null
@@ -0,0 +1,58 @@
+var buffer = require('buffer')
+
+if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
+  module.exports = buffer
+} else {
+  // Copy properties from require('buffer')
+  Object.keys(buffer).forEach(function (prop) {
+    exports[prop] = buffer[prop]
+  })
+  exports.Buffer = SafeBuffer
+}
+
+function SafeBuffer (arg, encodingOrOffset, length) {
+  return Buffer(arg, encodingOrOffset, length)
+}
+
+// Copy static methods from Buffer
+Object.keys(Buffer).forEach(function (prop) {
+  SafeBuffer[prop] = Buffer[prop]
+})
+
+SafeBuffer.from = function (arg, encodingOrOffset, length) {
+  if (typeof arg === 'number') {
+    throw new TypeError('Argument must not be a number')
+  }
+  return Buffer(arg, encodingOrOffset, length)
+}
+
+SafeBuffer.alloc = function (size, fill, encoding) {
+  if (typeof size !== 'number') {
+    throw new TypeError('Argument must be a number')
+  }
+  var buf = Buffer(size)
+  if (fill !== undefined) {
+    if (typeof encoding === 'string') {
+      buf.fill(fill, encoding)
+    } else {
+      buf.fill(fill)
+    }
+  } else {
+    buf.fill(0)
+  }
+  return buf
+}
+
+SafeBuffer.allocUnsafe = function (size) {
+  if (typeof size !== 'number') {
+    throw new TypeError('Argument must be a number')
+  }
+  return Buffer(size)
+}
+
+SafeBuffer.allocUnsafeSlow = function (size) {
+  if (typeof size !== 'number') {
+    throw new TypeError('Argument must be a number')
+  }
+  return buffer.SlowBuffer(size)
+}
diff --git a/wrt/node_modules/safe-buffer/package.json b/wrt/node_modules/safe-buffer/package.json
new file mode 100644 (file)
index 0000000..14e1032
--- /dev/null
@@ -0,0 +1,103 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "safe-buffer@~5.0.1",
+        "scope": null,
+        "escapedName": "safe-buffer",
+        "name": "safe-buffer",
+        "rawSpec": "~5.0.1",
+        "spec": ">=5.0.1 <5.1.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/ws"
+    ]
+  ],
+  "_from": "safe-buffer@>=5.0.1 <5.1.0",
+  "_id": "safe-buffer@5.0.1",
+  "_inCache": true,
+  "_location": "/safe-buffer",
+  "_nodeVersion": "4.4.5",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/safe-buffer-5.0.1.tgz_1464588482081_0.8112505874596536"
+  },
+  "_npmUser": {
+    "name": "feross",
+    "email": "feross@feross.org"
+  },
+  "_npmVersion": "2.15.5",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "safe-buffer@~5.0.1",
+    "scope": null,
+    "escapedName": "safe-buffer",
+    "name": "safe-buffer",
+    "rawSpec": "~5.0.1",
+    "spec": ">=5.0.1 <5.1.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/ws"
+  ],
+  "_resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.0.1.tgz",
+  "_shasum": "d263ca54696cd8a306b5ca6551e92de57918fbe7",
+  "_shrinkwrap": null,
+  "_spec": "safe-buffer@~5.0.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/ws",
+  "author": {
+    "name": "Feross Aboukhadijeh",
+    "email": "feross@feross.org",
+    "url": "http://feross.org"
+  },
+  "browser": "./browser.js",
+  "bugs": {
+    "url": "https://github.com/feross/safe-buffer/issues"
+  },
+  "dependencies": {},
+  "description": "Safer Node.js Buffer API",
+  "devDependencies": {
+    "standard": "^7.0.0",
+    "tape": "^4.0.0",
+    "zuul": "^3.0.0"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "d263ca54696cd8a306b5ca6551e92de57918fbe7",
+    "tarball": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.0.1.tgz"
+  },
+  "gitHead": "1e371a367da962afae2bebc527b50271c739d28c",
+  "homepage": "https://github.com/feross/safe-buffer",
+  "keywords": [
+    "buffer",
+    "buffer allocate",
+    "node security",
+    "safe",
+    "safe-buffer",
+    "security",
+    "uninitialized"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "feross",
+      "email": "feross@feross.org"
+    },
+    {
+      "name": "mafintosh",
+      "email": "mathiasbuus@gmail.com"
+    }
+  ],
+  "name": "safe-buffer",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/feross/safe-buffer.git"
+  },
+  "scripts": {
+    "test": "standard && tape test.js"
+  },
+  "version": "5.0.1"
+}
diff --git a/wrt/node_modules/safe-buffer/test.js b/wrt/node_modules/safe-buffer/test.js
new file mode 100644 (file)
index 0000000..7da8ad7
--- /dev/null
@@ -0,0 +1,99 @@
+var test = require('tape')
+var SafeBuffer = require('./').Buffer
+
+test('new SafeBuffer(value) works just like Buffer', function (t) {
+  t.deepEqual(new SafeBuffer('hey'), new Buffer('hey'))
+  t.deepEqual(new SafeBuffer('hey', 'utf8'), new Buffer('hey', 'utf8'))
+  t.deepEqual(new SafeBuffer('686579', 'hex'), new Buffer('686579', 'hex'))
+  t.deepEqual(new SafeBuffer([1, 2, 3]), new Buffer([1, 2, 3]))
+  t.deepEqual(new SafeBuffer(new Uint8Array([1, 2, 3])), new Buffer(new Uint8Array([1, 2, 3])))
+
+  t.equal(typeof SafeBuffer.isBuffer, 'function')
+  t.equal(SafeBuffer.isBuffer(new SafeBuffer('hey')), true)
+  t.equal(Buffer.isBuffer(new SafeBuffer('hey')), true)
+  t.notOk(SafeBuffer.isBuffer({}))
+
+  t.end()
+})
+
+test('SafeBuffer.from(value) converts to a Buffer', function (t) {
+  t.deepEqual(SafeBuffer.from('hey'), new Buffer('hey'))
+  t.deepEqual(SafeBuffer.from('hey', 'utf8'), new Buffer('hey', 'utf8'))
+  t.deepEqual(SafeBuffer.from('686579', 'hex'), new Buffer('686579', 'hex'))
+  t.deepEqual(SafeBuffer.from([1, 2, 3]), new Buffer([1, 2, 3]))
+  t.deepEqual(SafeBuffer.from(new Uint8Array([1, 2, 3])), new Buffer(new Uint8Array([1, 2, 3])))
+
+  t.end()
+})
+
+test('SafeBuffer.alloc(number) returns zeroed-out memory', function (t) {
+  for (var i = 0; i < 10; i++) {
+    var expected1 = new Buffer(1000)
+    expected1.fill(0)
+    t.deepEqual(SafeBuffer.alloc(1000), expected1)
+
+    var expected2 = new Buffer(1000 * 1000)
+    expected2.fill(0)
+    t.deepEqual(SafeBuffer.alloc(1000 * 1000), expected2)
+  }
+  t.end()
+})
+
+test('SafeBuffer.allocUnsafe(number)', function (t) {
+  var buf = SafeBuffer.allocUnsafe(100) // unitialized memory
+  t.equal(buf.length, 100)
+  t.equal(SafeBuffer.isBuffer(buf), true)
+  t.equal(Buffer.isBuffer(buf), true)
+  t.end()
+})
+
+test('SafeBuffer.from() throws with number types', function (t) {
+  t.plan(5)
+  t.throws(function () {
+    SafeBuffer.from(0)
+  })
+  t.throws(function () {
+    SafeBuffer.from(-1)
+  })
+  t.throws(function () {
+    SafeBuffer.from(NaN)
+  })
+  t.throws(function () {
+    SafeBuffer.from(Infinity)
+  })
+  t.throws(function () {
+    SafeBuffer.from(99)
+  })
+})
+
+test('SafeBuffer.allocUnsafe() throws with non-number types', function (t) {
+  t.plan(4)
+  t.throws(function () {
+    SafeBuffer.allocUnsafe('hey')
+  })
+  t.throws(function () {
+    SafeBuffer.allocUnsafe('hey', 'utf8')
+  })
+  t.throws(function () {
+    SafeBuffer.allocUnsafe([1, 2, 3])
+  })
+  t.throws(function () {
+    SafeBuffer.allocUnsafe({})
+  })
+})
+
+test('SafeBuffer.alloc() throws with non-number types', function (t) {
+  t.plan(4)
+  t.throws(function () {
+    SafeBuffer.alloc('hey')
+  })
+  t.throws(function () {
+    SafeBuffer.alloc('hey', 'utf8')
+  })
+  t.throws(function () {
+    SafeBuffer.alloc([1, 2, 3])
+  })
+  t.throws(function () {
+    SafeBuffer.alloc({})
+  })
+})
diff --git a/wrt/node_modules/sax/LICENSE b/wrt/node_modules/sax/LICENSE
new file mode 100644 (file)
index 0000000..ccffa08
--- /dev/null
@@ -0,0 +1,41 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+====
+
+`String.fromCodePoint` by Mathias Bynens used according to terms of MIT
+License, as follows:
+
+    Copyright Mathias Bynens <https://mathiasbynens.be/>
+
+    Permission is hereby granted, free of charge, to any person obtaining
+    a copy of this software and associated documentation files (the
+    "Software"), to deal in the Software without restriction, including
+    without limitation the rights to use, copy, modify, merge, publish,
+    distribute, sublicense, and/or sell copies of the Software, and to
+    permit persons to whom the Software is furnished to do so, subject to
+    the following conditions:
+
+    The above copyright notice and this permission notice shall be
+    included in all copies or substantial portions of the Software.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+    LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+    OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+    WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/sax/README.md b/wrt/node_modules/sax/README.md
new file mode 100644 (file)
index 0000000..afcd3f3
--- /dev/null
@@ -0,0 +1,225 @@
+# sax js
+
+A sax-style parser for XML and HTML.
+
+Designed with [node](http://nodejs.org/) in mind, but should work fine in
+the browser or other CommonJS implementations.
+
+## What This Is
+
+* A very simple tool to parse through an XML string.
+* A stepping stone to a streaming HTML parser.
+* A handy way to deal with RSS and other mostly-ok-but-kinda-broken XML
+  docs.
+
+## What This Is (probably) Not
+
+* An HTML Parser - That's a fine goal, but this isn't it.  It's just
+  XML.
+* A DOM Builder - You can use it to build an object model out of XML,
+  but it doesn't do that out of the box.
+* XSLT - No DOM = no querying.
+* 100% Compliant with (some other SAX implementation) - Most SAX
+  implementations are in Java and do a lot more than this does.
+* An XML Validator - It does a little validation when in strict mode, but
+  not much.
+* A Schema-Aware XSD Thing - Schemas are an exercise in fetishistic
+  masochism.
+* A DTD-aware Thing - Fetching DTDs is a much bigger job.
+
+## Regarding `<!DOCTYPE`s and `<!ENTITY`s
+
+The parser will handle the basic XML entities in text nodes and attribute
+values: `&amp; &lt; &gt; &apos; &quot;`. It's possible to define additional
+entities in XML by putting them in the DTD. This parser doesn't do anything
+with that. If you want to listen to the `ondoctype` event, and then fetch
+the doctypes, and read the entities and add them to `parser.ENTITIES`, then
+be my guest.
+
+Unknown entities will fail in strict mode, and in loose mode, will pass
+through unmolested.
+
+## Usage
+
+```javascript
+var sax = require("./lib/sax"),
+  strict = true, // set to false for html-mode
+  parser = sax.parser(strict);
+
+parser.onerror = function (e) {
+  // an error happened.
+};
+parser.ontext = function (t) {
+  // got some text.  t is the string of text.
+};
+parser.onopentag = function (node) {
+  // opened a tag.  node has "name" and "attributes"
+};
+parser.onattribute = function (attr) {
+  // an attribute.  attr has "name" and "value"
+};
+parser.onend = function () {
+  // parser stream is done, and ready to have more stuff written to it.
+};
+
+parser.write('<xml>Hello, <who name="world">world</who>!</xml>').close();
+
+// stream usage
+// takes the same options as the parser
+var saxStream = require("sax").createStream(strict, options)
+saxStream.on("error", function (e) {
+  // unhandled errors will throw, since this is a proper node
+  // event emitter.
+  console.error("error!", e)
+  // clear the error
+  this._parser.error = null
+  this._parser.resume()
+})
+saxStream.on("opentag", function (node) {
+  // same object as above
+})
+// pipe is supported, and it's readable/writable
+// same chunks coming in also go out.
+fs.createReadStream("file.xml")
+  .pipe(saxStream)
+  .pipe(fs.createWriteStream("file-copy.xml"))
+```
+
+
+## Arguments
+
+Pass the following arguments to the parser function.  All are optional.
+
+`strict` - Boolean. Whether or not to be a jerk. Default: `false`.
+
+`opt` - Object bag of settings regarding string formatting.  All default to `false`.
+
+Settings supported:
+
+* `trim` - Boolean. Whether or not to trim text and comment nodes.
+* `normalize` - Boolean. If true, then turn any whitespace into a single
+  space.
+* `lowercase` - Boolean. If true, then lowercase tag names and attribute names
+  in loose mode, rather than uppercasing them.
+* `xmlns` - Boolean. If true, then namespaces are supported.
+* `position` - Boolean. If false, then don't track line/col/position.
+* `strictEntities` - Boolean. If true, only parse [predefined XML
+  entities](http://www.w3.org/TR/REC-xml/#sec-predefined-ent)
+  (`&amp;`, `&apos;`, `&gt;`, `&lt;`, and `&quot;`)
+
+## Methods
+
+`write` - Write bytes onto the stream. You don't have to do this all at
+once. You can keep writing as much as you want.
+
+`close` - Close the stream. Once closed, no more data may be written until
+it is done processing the buffer, which is signaled by the `end` event.
+
+`resume` - To gracefully handle errors, assign a listener to the `error`
+event. Then, when the error is taken care of, you can call `resume` to
+continue parsing. Otherwise, the parser will not continue while in an error
+state.
+
+## Members
+
+At all times, the parser object will have the following members:
+
+`line`, `column`, `position` - Indications of the position in the XML
+document where the parser currently is looking.
+
+`startTagPosition` - Indicates the position where the current tag starts.
+
+`closed` - Boolean indicating whether or not the parser can be written to.
+If it's `true`, then wait for the `ready` event to write again.
+
+`strict` - Boolean indicating whether or not the parser is a jerk.
+
+`opt` - Any options passed into the constructor.
+
+`tag` - The current tag being dealt with.
+
+And a bunch of other stuff that you probably shouldn't touch.
+
+## Events
+
+All events emit with a single argument. To listen to an event, assign a
+function to `on<eventname>`. Functions get executed in the this-context of
+the parser object. The list of supported events are also in the exported
+`EVENTS` array.
+
+When using the stream interface, assign handlers using the EventEmitter
+`on` function in the normal fashion.
+
+`error` - Indication that something bad happened. The error will be hanging
+out on `parser.error`, and must be deleted before parsing can continue. By
+listening to this event, you can keep an eye on that kind of stuff. Note:
+this happens *much* more in strict mode. Argument: instance of `Error`.
+
+`text` - Text node. Argument: string of text.
+
+`doctype` - The `<!DOCTYPE` declaration. Argument: doctype string.
+
+`processinginstruction` - Stuff like `<?xml foo="blerg" ?>`. Argument:
+object with `name` and `body` members. Attributes are not parsed, as
+processing instructions have implementation dependent semantics.
+
+`sgmldeclaration` - Random SGML declarations. Stuff like `<!ENTITY p>`
+would trigger this kind of event. This is a weird thing to support, so it
+might go away at some point. SAX isn't intended to be used to parse SGML,
+after all.
+
+`opentagstart` - Emitted immediately when the tag name is available,
+but before any attributes are encountered.  Argument: object with a
+`name` field and an empty `attributes` set.  Note that this is the
+same object that will later be emitted in the `opentag` event.
+
+`opentag` - An opening tag. Argument: object with `name` and `attributes`.
+In non-strict mode, tag names are uppercased, unless the `lowercase`
+option is set.  If the `xmlns` option is set, then it will contain
+namespace binding information on the `ns` member, and will have a
+`local`, `prefix`, and `uri` member.
+
+`closetag` - A closing tag. In loose mode, tags are auto-closed if their
+parent closes. In strict mode, well-formedness is enforced. Note that
+self-closing tags will have `closeTag` emitted immediately after `openTag`.
+Argument: tag name.
+
+`attribute` - An attribute node.  Argument: object with `name` and `value`.
+In non-strict mode, attribute names are uppercased, unless the `lowercase`
+option is set.  If the `xmlns` option is set, it will also contains namespace
+information.
+
+`comment` - A comment node.  Argument: the string of the comment.
+
+`opencdata` - The opening tag of a `<![CDATA[` block.
+
+`cdata` - The text of a `<![CDATA[` block. Since `<![CDATA[` blocks can get
+quite large, this event may fire multiple times for a single block, if it
+is broken up into multiple `write()`s. Argument: the string of random
+character data.
+
+`closecdata` - The closing tag (`]]>`) of a `<![CDATA[` block.
+
+`opennamespace` - If the `xmlns` option is set, then this event will
+signal the start of a new namespace binding.
+
+`closenamespace` - If the `xmlns` option is set, then this event will
+signal the end of a namespace binding.
+
+`end` - Indication that the closed stream has ended.
+
+`ready` - Indication that the stream has reset, and is ready to be written
+to.
+
+`noscript` - In non-strict mode, `<script>` tags trigger a `"script"`
+event, and their contents are not checked for special xml characters.
+If you pass `noscript: true`, then this behavior is suppressed.
+
+## Reporting Problems
+
+It's best to write a failing test if you find an issue.  I will always
+accept pull requests with failing tests if they demonstrate intended
+behavior, but it is very hard to figure out what issue you're describing
+without a test.  Writing a test is also the best way for you yourself
+to figure out if you really understand the issue you think you have with
+sax-js.
diff --git a/wrt/node_modules/sax/lib/sax.js b/wrt/node_modules/sax/lib/sax.js
new file mode 100644 (file)
index 0000000..795d607
--- /dev/null
@@ -0,0 +1,1565 @@
+;(function (sax) { // wrapper for non-node envs
+  sax.parser = function (strict, opt) { return new SAXParser(strict, opt) }
+  sax.SAXParser = SAXParser
+  sax.SAXStream = SAXStream
+  sax.createStream = createStream
+
+  // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns.
+  // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)),
+  // since that's the earliest that a buffer overrun could occur.  This way, checks are
+  // as rare as required, but as often as necessary to ensure never crossing this bound.
+  // Furthermore, buffers are only tested at most once per write(), so passing a very
+  // large string into write() might have undesirable effects, but this is manageable by
+  // the caller, so it is assumed to be safe.  Thus, a call to write() may, in the extreme
+  // edge case, result in creating at most one complete copy of the string passed in.
+  // Set to Infinity to have unlimited buffers.
+  sax.MAX_BUFFER_LENGTH = 64 * 1024
+
+  var buffers = [
+    'comment', 'sgmlDecl', 'textNode', 'tagName', 'doctype',
+    'procInstName', 'procInstBody', 'entity', 'attribName',
+    'attribValue', 'cdata', 'script'
+  ]
+
+  sax.EVENTS = [
+    'text',
+    'processinginstruction',
+    'sgmldeclaration',
+    'doctype',
+    'comment',
+    'opentagstart',
+    'attribute',
+    'opentag',
+    'closetag',
+    'opencdata',
+    'cdata',
+    'closecdata',
+    'error',
+    'end',
+    'ready',
+    'script',
+    'opennamespace',
+    'closenamespace'
+  ]
+
+  function SAXParser (strict, opt) {
+    if (!(this instanceof SAXParser)) {
+      return new SAXParser(strict, opt)
+    }
+
+    var parser = this
+    clearBuffers(parser)
+    parser.q = parser.c = ''
+    parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH
+    parser.opt = opt || {}
+    parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags
+    parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase'
+    parser.tags = []
+    parser.closed = parser.closedRoot = parser.sawRoot = false
+    parser.tag = parser.error = null
+    parser.strict = !!strict
+    parser.noscript = !!(strict || parser.opt.noscript)
+    parser.state = S.BEGIN
+    parser.strictEntities = parser.opt.strictEntities
+    parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES)
+    parser.attribList = []
+
+    // namespaces form a prototype chain.
+    // it always points at the current tag,
+    // which protos to its parent tag.
+    if (parser.opt.xmlns) {
+      parser.ns = Object.create(rootNS)
+    }
+
+    // mostly just for error reporting
+    parser.trackPosition = parser.opt.position !== false
+    if (parser.trackPosition) {
+      parser.position = parser.line = parser.column = 0
+    }
+    emit(parser, 'onready')
+  }
+
+  if (!Object.create) {
+    Object.create = function (o) {
+      function F () {}
+      F.prototype = o
+      var newf = new F()
+      return newf
+    }
+  }
+
+  if (!Object.keys) {
+    Object.keys = function (o) {
+      var a = []
+      for (var i in o) if (o.hasOwnProperty(i)) a.push(i)
+      return a
+    }
+  }
+
+  function checkBufferLength (parser) {
+    var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10)
+    var maxActual = 0
+    for (var i = 0, l = buffers.length; i < l; i++) {
+      var len = parser[buffers[i]].length
+      if (len > maxAllowed) {
+        // Text/cdata nodes can get big, and since they're buffered,
+        // we can get here under normal conditions.
+        // Avoid issues by emitting the text node now,
+        // so at least it won't get any bigger.
+        switch (buffers[i]) {
+          case 'textNode':
+            closeText(parser)
+            break
+
+          case 'cdata':
+            emitNode(parser, 'oncdata', parser.cdata)
+            parser.cdata = ''
+            break
+
+          case 'script':
+            emitNode(parser, 'onscript', parser.script)
+            parser.script = ''
+            break
+
+          default:
+            error(parser, 'Max buffer length exceeded: ' + buffers[i])
+        }
+      }
+      maxActual = Math.max(maxActual, len)
+    }
+    // schedule the next check for the earliest possible buffer overrun.
+    var m = sax.MAX_BUFFER_LENGTH - maxActual
+    parser.bufferCheckPosition = m + parser.position
+  }
+
+  function clearBuffers (parser) {
+    for (var i = 0, l = buffers.length; i < l; i++) {
+      parser[buffers[i]] = ''
+    }
+  }
+
+  function flushBuffers (parser) {
+    closeText(parser)
+    if (parser.cdata !== '') {
+      emitNode(parser, 'oncdata', parser.cdata)
+      parser.cdata = ''
+    }
+    if (parser.script !== '') {
+      emitNode(parser, 'onscript', parser.script)
+      parser.script = ''
+    }
+  }
+
+  SAXParser.prototype = {
+    end: function () { end(this) },
+    write: write,
+    resume: function () { this.error = null; return this },
+    close: function () { return this.write(null) },
+    flush: function () { flushBuffers(this) }
+  }
+
+  var Stream
+  try {
+    Stream = require('stream').Stream
+  } catch (ex) {
+    Stream = function () {}
+  }
+
+  var streamWraps = sax.EVENTS.filter(function (ev) {
+    return ev !== 'error' && ev !== 'end'
+  })
+
+  function createStream (strict, opt) {
+    return new SAXStream(strict, opt)
+  }
+
+  function SAXStream (strict, opt) {
+    if (!(this instanceof SAXStream)) {
+      return new SAXStream(strict, opt)
+    }
+
+    Stream.apply(this)
+
+    this._parser = new SAXParser(strict, opt)
+    this.writable = true
+    this.readable = true
+
+    var me = this
+
+    this._parser.onend = function () {
+      me.emit('end')
+    }
+
+    this._parser.onerror = function (er) {
+      me.emit('error', er)
+
+      // if didn't throw, then means error was handled.
+      // go ahead and clear error, so we can write again.
+      me._parser.error = null
+    }
+
+    this._decoder = null
+
+    streamWraps.forEach(function (ev) {
+      Object.defineProperty(me, 'on' + ev, {
+        get: function () {
+          return me._parser['on' + ev]
+        },
+        set: function (h) {
+          if (!h) {
+            me.removeAllListeners(ev)
+            me._parser['on' + ev] = h
+            return h
+          }
+          me.on(ev, h)
+        },
+        enumerable: true,
+        configurable: false
+      })
+    })
+  }
+
+  SAXStream.prototype = Object.create(Stream.prototype, {
+    constructor: {
+      value: SAXStream
+    }
+  })
+
+  SAXStream.prototype.write = function (data) {
+    if (typeof Buffer === 'function' &&
+      typeof Buffer.isBuffer === 'function' &&
+      Buffer.isBuffer(data)) {
+      if (!this._decoder) {
+        var SD = require('string_decoder').StringDecoder
+        this._decoder = new SD('utf8')
+      }
+      data = this._decoder.write(data)
+    }
+
+    this._parser.write(data.toString())
+    this.emit('data', data)
+    return true
+  }
+
+  SAXStream.prototype.end = function (chunk) {
+    if (chunk && chunk.length) {
+      this.write(chunk)
+    }
+    this._parser.end()
+    return true
+  }
+
+  SAXStream.prototype.on = function (ev, handler) {
+    var me = this
+    if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) {
+      me._parser['on' + ev] = function () {
+        var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments)
+        args.splice(0, 0, ev)
+        me.emit.apply(me, args)
+      }
+    }
+
+    return Stream.prototype.on.call(me, ev, handler)
+  }
+
+  // this really needs to be replaced with character classes.
+  // XML allows all manner of ridiculous numbers and digits.
+  var CDATA = '[CDATA['
+  var DOCTYPE = 'DOCTYPE'
+  var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace'
+  var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/'
+  var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE }
+
+  // http://www.w3.org/TR/REC-xml/#NT-NameStartChar
+  // This implementation works on strings, a single character at a time
+  // as such, it cannot ever support astral-plane characters (10000-EFFFF)
+  // without a significant breaking change to either this  parser, or the
+  // JavaScript language.  Implementation of an emoji-capable xml parser
+  // is left as an exercise for the reader.
+  var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/
+
+  var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/
+
+  var entityStart = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/
+  var entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/
+
+  function isWhitespace (c) {
+    return c === ' ' || c === '\n' || c === '\r' || c === '\t'
+  }
+
+  function isQuote (c) {
+    return c === '"' || c === '\''
+  }
+
+  function isAttribEnd (c) {
+    return c === '>' || isWhitespace(c)
+  }
+
+  function isMatch (regex, c) {
+    return regex.test(c)
+  }
+
+  function notMatch (regex, c) {
+    return !isMatch(regex, c)
+  }
+
+  var S = 0
+  sax.STATE = {
+    BEGIN: S++, // leading byte order mark or whitespace
+    BEGIN_WHITESPACE: S++, // leading whitespace
+    TEXT: S++, // general stuff
+    TEXT_ENTITY: S++, // &amp and such.
+    OPEN_WAKA: S++, // <
+    SGML_DECL: S++, // <!BLARG
+    SGML_DECL_QUOTED: S++, // <!BLARG foo "bar
+    DOCTYPE: S++, // <!DOCTYPE
+    DOCTYPE_QUOTED: S++, // <!DOCTYPE "//blah
+    DOCTYPE_DTD: S++, // <!DOCTYPE "//blah" [ ...
+    DOCTYPE_DTD_QUOTED: S++, // <!DOCTYPE "//blah" [ "foo
+    COMMENT_STARTING: S++, // <!-
+    COMMENT: S++, // <!--
+    COMMENT_ENDING: S++, // <!-- blah -
+    COMMENT_ENDED: S++, // <!-- blah --
+    CDATA: S++, // <![CDATA[ something
+    CDATA_ENDING: S++, // ]
+    CDATA_ENDING_2: S++, // ]]
+    PROC_INST: S++, // <?hi
+    PROC_INST_BODY: S++, // <?hi there
+    PROC_INST_ENDING: S++, // <?hi "there" ?
+    OPEN_TAG: S++, // <strong
+    OPEN_TAG_SLASH: S++, // <strong /
+    ATTRIB: S++, // <a
+    ATTRIB_NAME: S++, // <a foo
+    ATTRIB_NAME_SAW_WHITE: S++, // <a foo _
+    ATTRIB_VALUE: S++, // <a foo=
+    ATTRIB_VALUE_QUOTED: S++, // <a foo="bar
+    ATTRIB_VALUE_CLOSED: S++, // <a foo="bar"
+    ATTRIB_VALUE_UNQUOTED: S++, // <a foo=bar
+    ATTRIB_VALUE_ENTITY_Q: S++, // <foo bar="&quot;"
+    ATTRIB_VALUE_ENTITY_U: S++, // <foo bar=&quot
+    CLOSE_TAG: S++, // </a
+    CLOSE_TAG_SAW_WHITE: S++, // </a   >
+    SCRIPT: S++, // <script> ...
+    SCRIPT_ENDING: S++ // <script> ... <
+  }
+
+  sax.XML_ENTITIES = {
+    'amp': '&',
+    'gt': '>',
+    'lt': '<',
+    'quot': '"',
+    'apos': "'"
+  }
+
+  sax.ENTITIES = {
+    'amp': '&',
+    'gt': '>',
+    'lt': '<',
+    'quot': '"',
+    'apos': "'",
+    'AElig': 198,
+    'Aacute': 193,
+    'Acirc': 194,
+    'Agrave': 192,
+    'Aring': 197,
+    'Atilde': 195,
+    'Auml': 196,
+    'Ccedil': 199,
+    'ETH': 208,
+    'Eacute': 201,
+    'Ecirc': 202,
+    'Egrave': 200,
+    'Euml': 203,
+    'Iacute': 205,
+    'Icirc': 206,
+    'Igrave': 204,
+    'Iuml': 207,
+    'Ntilde': 209,
+    'Oacute': 211,
+    'Ocirc': 212,
+    'Ograve': 210,
+    'Oslash': 216,
+    'Otilde': 213,
+    'Ouml': 214,
+    'THORN': 222,
+    'Uacute': 218,
+    'Ucirc': 219,
+    'Ugrave': 217,
+    'Uuml': 220,
+    'Yacute': 221,
+    'aacute': 225,
+    'acirc': 226,
+    'aelig': 230,
+    'agrave': 224,
+    'aring': 229,
+    'atilde': 227,
+    'auml': 228,
+    'ccedil': 231,
+    'eacute': 233,
+    'ecirc': 234,
+    'egrave': 232,
+    'eth': 240,
+    'euml': 235,
+    'iacute': 237,
+    'icirc': 238,
+    'igrave': 236,
+    'iuml': 239,
+    'ntilde': 241,
+    'oacute': 243,
+    'ocirc': 244,
+    'ograve': 242,
+    'oslash': 248,
+    'otilde': 245,
+    'ouml': 246,
+    'szlig': 223,
+    'thorn': 254,
+    'uacute': 250,
+    'ucirc': 251,
+    'ugrave': 249,
+    'uuml': 252,
+    'yacute': 253,
+    'yuml': 255,
+    'copy': 169,
+    'reg': 174,
+    'nbsp': 160,
+    'iexcl': 161,
+    'cent': 162,
+    'pound': 163,
+    'curren': 164,
+    'yen': 165,
+    'brvbar': 166,
+    'sect': 167,
+    'uml': 168,
+    'ordf': 170,
+    'laquo': 171,
+    'not': 172,
+    'shy': 173,
+    'macr': 175,
+    'deg': 176,
+    'plusmn': 177,
+    'sup1': 185,
+    'sup2': 178,
+    'sup3': 179,
+    'acute': 180,
+    'micro': 181,
+    'para': 182,
+    'middot': 183,
+    'cedil': 184,
+    'ordm': 186,
+    'raquo': 187,
+    'frac14': 188,
+    'frac12': 189,
+    'frac34': 190,
+    'iquest': 191,
+    'times': 215,
+    'divide': 247,
+    'OElig': 338,
+    'oelig': 339,
+    'Scaron': 352,
+    'scaron': 353,
+    'Yuml': 376,
+    'fnof': 402,
+    'circ': 710,
+    'tilde': 732,
+    'Alpha': 913,
+    'Beta': 914,
+    'Gamma': 915,
+    'Delta': 916,
+    'Epsilon': 917,
+    'Zeta': 918,
+    'Eta': 919,
+    'Theta': 920,
+    'Iota': 921,
+    'Kappa': 922,
+    'Lambda': 923,
+    'Mu': 924,
+    'Nu': 925,
+    'Xi': 926,
+    'Omicron': 927,
+    'Pi': 928,
+    'Rho': 929,
+    'Sigma': 931,
+    'Tau': 932,
+    'Upsilon': 933,
+    'Phi': 934,
+    'Chi': 935,
+    'Psi': 936,
+    'Omega': 937,
+    'alpha': 945,
+    'beta': 946,
+    'gamma': 947,
+    'delta': 948,
+    'epsilon': 949,
+    'zeta': 950,
+    'eta': 951,
+    'theta': 952,
+    'iota': 953,
+    'kappa': 954,
+    'lambda': 955,
+    'mu': 956,
+    'nu': 957,
+    'xi': 958,
+    'omicron': 959,
+    'pi': 960,
+    'rho': 961,
+    'sigmaf': 962,
+    'sigma': 963,
+    'tau': 964,
+    'upsilon': 965,
+    'phi': 966,
+    'chi': 967,
+    'psi': 968,
+    'omega': 969,
+    'thetasym': 977,
+    'upsih': 978,
+    'piv': 982,
+    'ensp': 8194,
+    'emsp': 8195,
+    'thinsp': 8201,
+    'zwnj': 8204,
+    'zwj': 8205,
+    'lrm': 8206,
+    'rlm': 8207,
+    'ndash': 8211,
+    'mdash': 8212,
+    'lsquo': 8216,
+    'rsquo': 8217,
+    'sbquo': 8218,
+    'ldquo': 8220,
+    'rdquo': 8221,
+    'bdquo': 8222,
+    'dagger': 8224,
+    'Dagger': 8225,
+    'bull': 8226,
+    'hellip': 8230,
+    'permil': 8240,
+    'prime': 8242,
+    'Prime': 8243,
+    'lsaquo': 8249,
+    'rsaquo': 8250,
+    'oline': 8254,
+    'frasl': 8260,
+    'euro': 8364,
+    'image': 8465,
+    'weierp': 8472,
+    'real': 8476,
+    'trade': 8482,
+    'alefsym': 8501,
+    'larr': 8592,
+    'uarr': 8593,
+    'rarr': 8594,
+    'darr': 8595,
+    'harr': 8596,
+    'crarr': 8629,
+    'lArr': 8656,
+    'uArr': 8657,
+    'rArr': 8658,
+    'dArr': 8659,
+    'hArr': 8660,
+    'forall': 8704,
+    'part': 8706,
+    'exist': 8707,
+    'empty': 8709,
+    'nabla': 8711,
+    'isin': 8712,
+    'notin': 8713,
+    'ni': 8715,
+    'prod': 8719,
+    'sum': 8721,
+    'minus': 8722,
+    'lowast': 8727,
+    'radic': 8730,
+    'prop': 8733,
+    'infin': 8734,
+    'ang': 8736,
+    'and': 8743,
+    'or': 8744,
+    'cap': 8745,
+    'cup': 8746,
+    'int': 8747,
+    'there4': 8756,
+    'sim': 8764,
+    'cong': 8773,
+    'asymp': 8776,
+    'ne': 8800,
+    'equiv': 8801,
+    'le': 8804,
+    'ge': 8805,
+    'sub': 8834,
+    'sup': 8835,
+    'nsub': 8836,
+    'sube': 8838,
+    'supe': 8839,
+    'oplus': 8853,
+    'otimes': 8855,
+    'perp': 8869,
+    'sdot': 8901,
+    'lceil': 8968,
+    'rceil': 8969,
+    'lfloor': 8970,
+    'rfloor': 8971,
+    'lang': 9001,
+    'rang': 9002,
+    'loz': 9674,
+    'spades': 9824,
+    'clubs': 9827,
+    'hearts': 9829,
+    'diams': 9830
+  }
+
+  Object.keys(sax.ENTITIES).forEach(function (key) {
+    var e = sax.ENTITIES[key]
+    var s = typeof e === 'number' ? String.fromCharCode(e) : e
+    sax.ENTITIES[key] = s
+  })
+
+  for (var s in sax.STATE) {
+    sax.STATE[sax.STATE[s]] = s
+  }
+
+  // shorthand
+  S = sax.STATE
+
+  function emit (parser, event, data) {
+    parser[event] && parser[event](data)
+  }
+
+  function emitNode (parser, nodeType, data) {
+    if (parser.textNode) closeText(parser)
+    emit(parser, nodeType, data)
+  }
+
+  function closeText (parser) {
+    parser.textNode = textopts(parser.opt, parser.textNode)
+    if (parser.textNode) emit(parser, 'ontext', parser.textNode)
+    parser.textNode = ''
+  }
+
+  function textopts (opt, text) {
+    if (opt.trim) text = text.trim()
+    if (opt.normalize) text = text.replace(/\s+/g, ' ')
+    return text
+  }
+
+  function error (parser, er) {
+    closeText(parser)
+    if (parser.trackPosition) {
+      er += '\nLine: ' + parser.line +
+        '\nColumn: ' + parser.column +
+        '\nChar: ' + parser.c
+    }
+    er = new Error(er)
+    parser.error = er
+    emit(parser, 'onerror', er)
+    return parser
+  }
+
+  function end (parser) {
+    if (parser.sawRoot && !parser.closedRoot) strictFail(parser, 'Unclosed root tag')
+    if ((parser.state !== S.BEGIN) &&
+      (parser.state !== S.BEGIN_WHITESPACE) &&
+      (parser.state !== S.TEXT)) {
+      error(parser, 'Unexpected end')
+    }
+    closeText(parser)
+    parser.c = ''
+    parser.closed = true
+    emit(parser, 'onend')
+    SAXParser.call(parser, parser.strict, parser.opt)
+    return parser
+  }
+
+  function strictFail (parser, message) {
+    if (typeof parser !== 'object' || !(parser instanceof SAXParser)) {
+      throw new Error('bad call to strictFail')
+    }
+    if (parser.strict) {
+      error(parser, message)
+    }
+  }
+
+  function newTag (parser) {
+    if (!parser.strict) parser.tagName = parser.tagName[parser.looseCase]()
+    var parent = parser.tags[parser.tags.length - 1] || parser
+    var tag = parser.tag = { name: parser.tagName, attributes: {} }
+
+    // will be overridden if tag contails an xmlns="foo" or xmlns:foo="bar"
+    if (parser.opt.xmlns) {
+      tag.ns = parent.ns
+    }
+    parser.attribList.length = 0
+    emitNode(parser, 'onopentagstart', tag)
+  }
+
+  function qname (name, attribute) {
+    var i = name.indexOf(':')
+    var qualName = i < 0 ? [ '', name ] : name.split(':')
+    var prefix = qualName[0]
+    var local = qualName[1]
+
+    // <x "xmlns"="http://foo">
+    if (attribute && name === 'xmlns') {
+      prefix = 'xmlns'
+      local = ''
+    }
+
+    return { prefix: prefix, local: local }
+  }
+
+  function attrib (parser) {
+    if (!parser.strict) {
+      parser.attribName = parser.attribName[parser.looseCase]()
+    }
+
+    if (parser.attribList.indexOf(parser.attribName) !== -1 ||
+      parser.tag.attributes.hasOwnProperty(parser.attribName)) {
+      parser.attribName = parser.attribValue = ''
+      return
+    }
+
+    if (parser.opt.xmlns) {
+      var qn = qname(parser.attribName, true)
+      var prefix = qn.prefix
+      var local = qn.local
+
+      if (prefix === 'xmlns') {
+        // namespace binding attribute. push the binding into scope
+        if (local === 'xml' && parser.attribValue !== XML_NAMESPACE) {
+          strictFail(parser,
+            'xml: prefix must be bound to ' + XML_NAMESPACE + '\n' +
+            'Actual: ' + parser.attribValue)
+        } else if (local === 'xmlns' && parser.attribValue !== XMLNS_NAMESPACE) {
+          strictFail(parser,
+            'xmlns: prefix must be bound to ' + XMLNS_NAMESPACE + '\n' +
+            'Actual: ' + parser.attribValue)
+        } else {
+          var tag = parser.tag
+          var parent = parser.tags[parser.tags.length - 1] || parser
+          if (tag.ns === parent.ns) {
+            tag.ns = Object.create(parent.ns)
+          }
+          tag.ns[local] = parser.attribValue
+        }
+      }
+
+      // defer onattribute events until all attributes have been seen
+      // so any new bindings can take effect. preserve attribute order
+      // so deferred events can be emitted in document order
+      parser.attribList.push([parser.attribName, parser.attribValue])
+    } else {
+      // in non-xmlns mode, we can emit the event right away
+      parser.tag.attributes[parser.attribName] = parser.attribValue
+      emitNode(parser, 'onattribute', {
+        name: parser.attribName,
+        value: parser.attribValue
+      })
+    }
+
+    parser.attribName = parser.attribValue = ''
+  }
+
+  function openTag (parser, selfClosing) {
+    if (parser.opt.xmlns) {
+      // emit namespace binding events
+      var tag = parser.tag
+
+      // add namespace info to tag
+      var qn = qname(parser.tagName)
+      tag.prefix = qn.prefix
+      tag.local = qn.local
+      tag.uri = tag.ns[qn.prefix] || ''
+
+      if (tag.prefix && !tag.uri) {
+        strictFail(parser, 'Unbound namespace prefix: ' +
+          JSON.stringify(parser.tagName))
+        tag.uri = qn.prefix
+      }
+
+      var parent = parser.tags[parser.tags.length - 1] || parser
+      if (tag.ns && parent.ns !== tag.ns) {
+        Object.keys(tag.ns).forEach(function (p) {
+          emitNode(parser, 'onopennamespace', {
+            prefix: p,
+            uri: tag.ns[p]
+          })
+        })
+      }
+
+      // handle deferred onattribute events
+      // Note: do not apply default ns to attributes:
+      //   http://www.w3.org/TR/REC-xml-names/#defaulting
+      for (var i = 0, l = parser.attribList.length; i < l; i++) {
+        var nv = parser.attribList[i]
+        var name = nv[0]
+        var value = nv[1]
+        var qualName = qname(name, true)
+        var prefix = qualName.prefix
+        var local = qualName.local
+        var uri = prefix === '' ? '' : (tag.ns[prefix] || '')
+        var a = {
+          name: name,
+          value: value,
+          prefix: prefix,
+          local: local,
+          uri: uri
+        }
+
+        // if there's any attributes with an undefined namespace,
+        // then fail on them now.
+        if (prefix && prefix !== 'xmlns' && !uri) {
+          strictFail(parser, 'Unbound namespace prefix: ' +
+            JSON.stringify(prefix))
+          a.uri = prefix
+        }
+        parser.tag.attributes[name] = a
+        emitNode(parser, 'onattribute', a)
+      }
+      parser.attribList.length = 0
+    }
+
+    parser.tag.isSelfClosing = !!selfClosing
+
+    // process the tag
+    parser.sawRoot = true
+    parser.tags.push(parser.tag)
+    emitNode(parser, 'onopentag', parser.tag)
+    if (!selfClosing) {
+      // special case for <script> in non-strict mode.
+      if (!parser.noscript && parser.tagName.toLowerCase() === 'script') {
+        parser.state = S.SCRIPT
+      } else {
+        parser.state = S.TEXT
+      }
+      parser.tag = null
+      parser.tagName = ''
+    }
+    parser.attribName = parser.attribValue = ''
+    parser.attribList.length = 0
+  }
+
+  function closeTag (parser) {
+    if (!parser.tagName) {
+      strictFail(parser, 'Weird empty close tag.')
+      parser.textNode += '</>'
+      parser.state = S.TEXT
+      return
+    }
+
+    if (parser.script) {
+      if (parser.tagName !== 'script') {
+        parser.script += '</' + parser.tagName + '>'
+        parser.tagName = ''
+        parser.state = S.SCRIPT
+        return
+      }
+      emitNode(parser, 'onscript', parser.script)
+      parser.script = ''
+    }
+
+    // first make sure that the closing tag actually exists.
+    // <a><b></c></b></a> will close everything, otherwise.
+    var t = parser.tags.length
+    var tagName = parser.tagName
+    if (!parser.strict) {
+      tagName = tagName[parser.looseCase]()
+    }
+    var closeTo = tagName
+    while (t--) {
+      var close = parser.tags[t]
+      if (close.name !== closeTo) {
+        // fail the first time in strict mode
+        strictFail(parser, 'Unexpected close tag')
+      } else {
+        break
+      }
+    }
+
+    // didn't find it.  we already failed for strict, so just abort.
+    if (t < 0) {
+      strictFail(parser, 'Unmatched closing tag: ' + parser.tagName)
+      parser.textNode += '</' + parser.tagName + '>'
+      parser.state = S.TEXT
+      return
+    }
+    parser.tagName = tagName
+    var s = parser.tags.length
+    while (s-- > t) {
+      var tag = parser.tag = parser.tags.pop()
+      parser.tagName = parser.tag.name
+      emitNode(parser, 'onclosetag', parser.tagName)
+
+      var x = {}
+      for (var i in tag.ns) {
+        x[i] = tag.ns[i]
+      }
+
+      var parent = parser.tags[parser.tags.length - 1] || parser
+      if (parser.opt.xmlns && tag.ns !== parent.ns) {
+        // remove namespace bindings introduced by tag
+        Object.keys(tag.ns).forEach(function (p) {
+          var n = tag.ns[p]
+          emitNode(parser, 'onclosenamespace', { prefix: p, uri: n })
+        })
+      }
+    }
+    if (t === 0) parser.closedRoot = true
+    parser.tagName = parser.attribValue = parser.attribName = ''
+    parser.attribList.length = 0
+    parser.state = S.TEXT
+  }
+
+  function parseEntity (parser) {
+    var entity = parser.entity
+    var entityLC = entity.toLowerCase()
+    var num
+    var numStr = ''
+
+    if (parser.ENTITIES[entity]) {
+      return parser.ENTITIES[entity]
+    }
+    if (parser.ENTITIES[entityLC]) {
+      return parser.ENTITIES[entityLC]
+    }
+    entity = entityLC
+    if (entity.charAt(0) === '#') {
+      if (entity.charAt(1) === 'x') {
+        entity = entity.slice(2)
+        num = parseInt(entity, 16)
+        numStr = num.toString(16)
+      } else {
+        entity = entity.slice(1)
+        num = parseInt(entity, 10)
+        numStr = num.toString(10)
+      }
+    }
+    entity = entity.replace(/^0+/, '')
+    if (isNaN(num) || numStr.toLowerCase() !== entity) {
+      strictFail(parser, 'Invalid character entity')
+      return '&' + parser.entity + ';'
+    }
+
+    return String.fromCodePoint(num)
+  }
+
+  function beginWhiteSpace (parser, c) {
+    if (c === '<') {
+      parser.state = S.OPEN_WAKA
+      parser.startTagPosition = parser.position
+    } else if (!isWhitespace(c)) {
+      // have to process this as a text node.
+      // weird, but happens.
+      strictFail(parser, 'Non-whitespace before first tag.')
+      parser.textNode = c
+      parser.state = S.TEXT
+    }
+  }
+
+  function charAt (chunk, i) {
+    var result = ''
+    if (i < chunk.length) {
+      result = chunk.charAt(i)
+    }
+    return result
+  }
+
+  function write (chunk) {
+    var parser = this
+    if (this.error) {
+      throw this.error
+    }
+    if (parser.closed) {
+      return error(parser,
+        'Cannot write after close. Assign an onready handler.')
+    }
+    if (chunk === null) {
+      return end(parser)
+    }
+    if (typeof chunk === 'object') {
+      chunk = chunk.toString()
+    }
+    var i = 0
+    var c = ''
+    while (true) {
+      c = charAt(chunk, i++)
+      parser.c = c
+
+      if (!c) {
+        break
+      }
+
+      if (parser.trackPosition) {
+        parser.position++
+        if (c === '\n') {
+          parser.line++
+          parser.column = 0
+        } else {
+          parser.column++
+        }
+      }
+
+      switch (parser.state) {
+        case S.BEGIN:
+          parser.state = S.BEGIN_WHITESPACE
+          if (c === '\uFEFF') {
+            continue
+          }
+          beginWhiteSpace(parser, c)
+          continue
+
+        case S.BEGIN_WHITESPACE:
+          beginWhiteSpace(parser, c)
+          continue
+
+        case S.TEXT:
+          if (parser.sawRoot && !parser.closedRoot) {
+            var starti = i - 1
+            while (c && c !== '<' && c !== '&') {
+              c = charAt(chunk, i++)
+              if (c && parser.trackPosition) {
+                parser.position++
+                if (c === '\n') {
+                  parser.line++
+                  parser.column = 0
+                } else {
+                  parser.column++
+                }
+              }
+            }
+            parser.textNode += chunk.substring(starti, i - 1)
+          }
+          if (c === '<' && !(parser.sawRoot && parser.closedRoot && !parser.strict)) {
+            parser.state = S.OPEN_WAKA
+            parser.startTagPosition = parser.position
+          } else {
+            if (!isWhitespace(c) && (!parser.sawRoot || parser.closedRoot)) {
+              strictFail(parser, 'Text data outside of root node.')
+            }
+            if (c === '&') {
+              parser.state = S.TEXT_ENTITY
+            } else {
+              parser.textNode += c
+            }
+          }
+          continue
+
+        case S.SCRIPT:
+          // only non-strict
+          if (c === '<') {
+            parser.state = S.SCRIPT_ENDING
+          } else {
+            parser.script += c
+          }
+          continue
+
+        case S.SCRIPT_ENDING:
+          if (c === '/') {
+            parser.state = S.CLOSE_TAG
+          } else {
+            parser.script += '<' + c
+            parser.state = S.SCRIPT
+          }
+          continue
+
+        case S.OPEN_WAKA:
+          // either a /, ?, !, or text is coming next.
+          if (c === '!') {
+            parser.state = S.SGML_DECL
+            parser.sgmlDecl = ''
+          } else if (isWhitespace(c)) {
+            // wait for it...
+          } else if (isMatch(nameStart, c)) {
+            parser.state = S.OPEN_TAG
+            parser.tagName = c
+          } else if (c === '/') {
+            parser.state = S.CLOSE_TAG
+            parser.tagName = ''
+          } else if (c === '?') {
+            parser.state = S.PROC_INST
+            parser.procInstName = parser.procInstBody = ''
+          } else {
+            strictFail(parser, 'Unencoded <')
+            // if there was some whitespace, then add that in.
+            if (parser.startTagPosition + 1 < parser.position) {
+              var pad = parser.position - parser.startTagPosition
+              c = new Array(pad).join(' ') + c
+            }
+            parser.textNode += '<' + c
+            parser.state = S.TEXT
+          }
+          continue
+
+        case S.SGML_DECL:
+          if ((parser.sgmlDecl + c).toUpperCase() === CDATA) {
+            emitNode(parser, 'onopencdata')
+            parser.state = S.CDATA
+            parser.sgmlDecl = ''
+            parser.cdata = ''
+          } else if (parser.sgmlDecl + c === '--') {
+            parser.state = S.COMMENT
+            parser.comment = ''
+            parser.sgmlDecl = ''
+          } else if ((parser.sgmlDecl + c).toUpperCase() === DOCTYPE) {
+            parser.state = S.DOCTYPE
+            if (parser.doctype || parser.sawRoot) {
+              strictFail(parser,
+                'Inappropriately located doctype declaration')
+            }
+            parser.doctype = ''
+            parser.sgmlDecl = ''
+          } else if (c === '>') {
+            emitNode(parser, 'onsgmldeclaration', parser.sgmlDecl)
+            parser.sgmlDecl = ''
+            parser.state = S.TEXT
+          } else if (isQuote(c)) {
+            parser.state = S.SGML_DECL_QUOTED
+            parser.sgmlDecl += c
+          } else {
+            parser.sgmlDecl += c
+          }
+          continue
+
+        case S.SGML_DECL_QUOTED:
+          if (c === parser.q) {
+            parser.state = S.SGML_DECL
+            parser.q = ''
+          }
+          parser.sgmlDecl += c
+          continue
+
+        case S.DOCTYPE:
+          if (c === '>') {
+            parser.state = S.TEXT
+            emitNode(parser, 'ondoctype', parser.doctype)
+            parser.doctype = true // just remember that we saw it.
+          } else {
+            parser.doctype += c
+            if (c === '[') {
+              parser.state = S.DOCTYPE_DTD
+            } else if (isQuote(c)) {
+              parser.state = S.DOCTYPE_QUOTED
+              parser.q = c
+            }
+          }
+          continue
+
+        case S.DOCTYPE_QUOTED:
+          parser.doctype += c
+          if (c === parser.q) {
+            parser.q = ''
+            parser.state = S.DOCTYPE
+          }
+          continue
+
+        case S.DOCTYPE_DTD:
+          parser.doctype += c
+          if (c === ']') {
+            parser.state = S.DOCTYPE
+          } else if (isQuote(c)) {
+            parser.state = S.DOCTYPE_DTD_QUOTED
+            parser.q = c
+          }
+          continue
+
+        case S.DOCTYPE_DTD_QUOTED:
+          parser.doctype += c
+          if (c === parser.q) {
+            parser.state = S.DOCTYPE_DTD
+            parser.q = ''
+          }
+          continue
+
+        case S.COMMENT:
+          if (c === '-') {
+            parser.state = S.COMMENT_ENDING
+          } else {
+            parser.comment += c
+          }
+          continue
+
+        case S.COMMENT_ENDING:
+          if (c === '-') {
+            parser.state = S.COMMENT_ENDED
+            parser.comment = textopts(parser.opt, parser.comment)
+            if (parser.comment) {
+              emitNode(parser, 'oncomment', parser.comment)
+            }
+            parser.comment = ''
+          } else {
+            parser.comment += '-' + c
+            parser.state = S.COMMENT
+          }
+          continue
+
+        case S.COMMENT_ENDED:
+          if (c !== '>') {
+            strictFail(parser, 'Malformed comment')
+            // allow <!-- blah -- bloo --> in non-strict mode,
+            // which is a comment of " blah -- bloo "
+            parser.comment += '--' + c
+            parser.state = S.COMMENT
+          } else {
+            parser.state = S.TEXT
+          }
+          continue
+
+        case S.CDATA:
+          if (c === ']') {
+            parser.state = S.CDATA_ENDING
+          } else {
+            parser.cdata += c
+          }
+          continue
+
+        case S.CDATA_ENDING:
+          if (c === ']') {
+            parser.state = S.CDATA_ENDING_2
+          } else {
+            parser.cdata += ']' + c
+            parser.state = S.CDATA
+          }
+          continue
+
+        case S.CDATA_ENDING_2:
+          if (c === '>') {
+            if (parser.cdata) {
+              emitNode(parser, 'oncdata', parser.cdata)
+            }
+            emitNode(parser, 'onclosecdata')
+            parser.cdata = ''
+            parser.state = S.TEXT
+          } else if (c === ']') {
+            parser.cdata += ']'
+          } else {
+            parser.cdata += ']]' + c
+            parser.state = S.CDATA
+          }
+          continue
+
+        case S.PROC_INST:
+          if (c === '?') {
+            parser.state = S.PROC_INST_ENDING
+          } else if (isWhitespace(c)) {
+            parser.state = S.PROC_INST_BODY
+          } else {
+            parser.procInstName += c
+          }
+          continue
+
+        case S.PROC_INST_BODY:
+          if (!parser.procInstBody && isWhitespace(c)) {
+            continue
+          } else if (c === '?') {
+            parser.state = S.PROC_INST_ENDING
+          } else {
+            parser.procInstBody += c
+          }
+          continue
+
+        case S.PROC_INST_ENDING:
+          if (c === '>') {
+            emitNode(parser, 'onprocessinginstruction', {
+              name: parser.procInstName,
+              body: parser.procInstBody
+            })
+            parser.procInstName = parser.procInstBody = ''
+            parser.state = S.TEXT
+          } else {
+            parser.procInstBody += '?' + c
+            parser.state = S.PROC_INST_BODY
+          }
+          continue
+
+        case S.OPEN_TAG:
+          if (isMatch(nameBody, c)) {
+            parser.tagName += c
+          } else {
+            newTag(parser)
+            if (c === '>') {
+              openTag(parser)
+            } else if (c === '/') {
+              parser.state = S.OPEN_TAG_SLASH
+            } else {
+              if (!isWhitespace(c)) {
+                strictFail(parser, 'Invalid character in tag name')
+              }
+              parser.state = S.ATTRIB
+            }
+          }
+          continue
+
+        case S.OPEN_TAG_SLASH:
+          if (c === '>') {
+            openTag(parser, true)
+            closeTag(parser)
+          } else {
+            strictFail(parser, 'Forward-slash in opening tag not followed by >')
+            parser.state = S.ATTRIB
+          }
+          continue
+
+        case S.ATTRIB:
+          // haven't read the attribute name yet.
+          if (isWhitespace(c)) {
+            continue
+          } else if (c === '>') {
+            openTag(parser)
+          } else if (c === '/') {
+            parser.state = S.OPEN_TAG_SLASH
+          } else if (isMatch(nameStart, c)) {
+            parser.attribName = c
+            parser.attribValue = ''
+            parser.state = S.ATTRIB_NAME
+          } else {
+            strictFail(parser, 'Invalid attribute name')
+          }
+          continue
+
+        case S.ATTRIB_NAME:
+          if (c === '=') {
+            parser.state = S.ATTRIB_VALUE
+          } else if (c === '>') {
+            strictFail(parser, 'Attribute without value')
+            parser.attribValue = parser.attribName
+            attrib(parser)
+            openTag(parser)
+          } else if (isWhitespace(c)) {
+            parser.state = S.ATTRIB_NAME_SAW_WHITE
+          } else if (isMatch(nameBody, c)) {
+            parser.attribName += c
+          } else {
+            strictFail(parser, 'Invalid attribute name')
+          }
+          continue
+
+        case S.ATTRIB_NAME_SAW_WHITE:
+          if (c === '=') {
+            parser.state = S.ATTRIB_VALUE
+          } else if (isWhitespace(c)) {
+            continue
+          } else {
+            strictFail(parser, 'Attribute without value')
+            parser.tag.attributes[parser.attribName] = ''
+            parser.attribValue = ''
+            emitNode(parser, 'onattribute', {
+              name: parser.attribName,
+              value: ''
+            })
+            parser.attribName = ''
+            if (c === '>') {
+              openTag(parser)
+            } else if (isMatch(nameStart, c)) {
+              parser.attribName = c
+              parser.state = S.ATTRIB_NAME
+            } else {
+              strictFail(parser, 'Invalid attribute name')
+              parser.state = S.ATTRIB
+            }
+          }
+          continue
+
+        case S.ATTRIB_VALUE:
+          if (isWhitespace(c)) {
+            continue
+          } else if (isQuote(c)) {
+            parser.q = c
+            parser.state = S.ATTRIB_VALUE_QUOTED
+          } else {
+            strictFail(parser, 'Unquoted attribute value')
+            parser.state = S.ATTRIB_VALUE_UNQUOTED
+            parser.attribValue = c
+          }
+          continue
+
+        case S.ATTRIB_VALUE_QUOTED:
+          if (c !== parser.q) {
+            if (c === '&') {
+              parser.state = S.ATTRIB_VALUE_ENTITY_Q
+            } else {
+              parser.attribValue += c
+            }
+            continue
+          }
+          attrib(parser)
+          parser.q = ''
+          parser.state = S.ATTRIB_VALUE_CLOSED
+          continue
+
+        case S.ATTRIB_VALUE_CLOSED:
+          if (isWhitespace(c)) {
+            parser.state = S.ATTRIB
+          } else if (c === '>') {
+            openTag(parser)
+          } else if (c === '/') {
+            parser.state = S.OPEN_TAG_SLASH
+          } else if (isMatch(nameStart, c)) {
+            strictFail(parser, 'No whitespace between attributes')
+            parser.attribName = c
+            parser.attribValue = ''
+            parser.state = S.ATTRIB_NAME
+          } else {
+            strictFail(parser, 'Invalid attribute name')
+          }
+          continue
+
+        case S.ATTRIB_VALUE_UNQUOTED:
+          if (!isAttribEnd(c)) {
+            if (c === '&') {
+              parser.state = S.ATTRIB_VALUE_ENTITY_U
+            } else {
+              parser.attribValue += c
+            }
+            continue
+          }
+          attrib(parser)
+          if (c === '>') {
+            openTag(parser)
+          } else {
+            parser.state = S.ATTRIB
+          }
+          continue
+
+        case S.CLOSE_TAG:
+          if (!parser.tagName) {
+            if (isWhitespace(c)) {
+              continue
+            } else if (notMatch(nameStart, c)) {
+              if (parser.script) {
+                parser.script += '</' + c
+                parser.state = S.SCRIPT
+              } else {
+                strictFail(parser, 'Invalid tagname in closing tag.')
+              }
+            } else {
+              parser.tagName = c
+            }
+          } else if (c === '>') {
+            closeTag(parser)
+          } else if (isMatch(nameBody, c)) {
+            parser.tagName += c
+          } else if (parser.script) {
+            parser.script += '</' + parser.tagName
+            parser.tagName = ''
+            parser.state = S.SCRIPT
+          } else {
+            if (!isWhitespace(c)) {
+              strictFail(parser, 'Invalid tagname in closing tag')
+            }
+            parser.state = S.CLOSE_TAG_SAW_WHITE
+          }
+          continue
+
+        case S.CLOSE_TAG_SAW_WHITE:
+          if (isWhitespace(c)) {
+            continue
+          }
+          if (c === '>') {
+            closeTag(parser)
+          } else {
+            strictFail(parser, 'Invalid characters in closing tag')
+          }
+          continue
+
+        case S.TEXT_ENTITY:
+        case S.ATTRIB_VALUE_ENTITY_Q:
+        case S.ATTRIB_VALUE_ENTITY_U:
+          var returnState
+          var buffer
+          switch (parser.state) {
+            case S.TEXT_ENTITY:
+              returnState = S.TEXT
+              buffer = 'textNode'
+              break
+
+            case S.ATTRIB_VALUE_ENTITY_Q:
+              returnState = S.ATTRIB_VALUE_QUOTED
+              buffer = 'attribValue'
+              break
+
+            case S.ATTRIB_VALUE_ENTITY_U:
+              returnState = S.ATTRIB_VALUE_UNQUOTED
+              buffer = 'attribValue'
+              break
+          }
+
+          if (c === ';') {
+            parser[buffer] += parseEntity(parser)
+            parser.entity = ''
+            parser.state = returnState
+          } else if (isMatch(parser.entity.length ? entityBody : entityStart, c)) {
+            parser.entity += c
+          } else {
+            strictFail(parser, 'Invalid character in entity name')
+            parser[buffer] += '&' + parser.entity + c
+            parser.entity = ''
+            parser.state = returnState
+          }
+
+          continue
+
+        default:
+          throw new Error(parser, 'Unknown state: ' + parser.state)
+      }
+    } // while
+
+    if (parser.position >= parser.bufferCheckPosition) {
+      checkBufferLength(parser)
+    }
+    return parser
+  }
+
+  /*! http://mths.be/fromcodepoint v0.1.0 by @mathias */
+  /* istanbul ignore next */
+  if (!String.fromCodePoint) {
+    (function () {
+      var stringFromCharCode = String.fromCharCode
+      var floor = Math.floor
+      var fromCodePoint = function () {
+        var MAX_SIZE = 0x4000
+        var codeUnits = []
+        var highSurrogate
+        var lowSurrogate
+        var index = -1
+        var length = arguments.length
+        if (!length) {
+          return ''
+        }
+        var result = ''
+        while (++index < length) {
+          var codePoint = Number(arguments[index])
+          if (
+            !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
+            codePoint < 0 || // not a valid Unicode code point
+            codePoint > 0x10FFFF || // not a valid Unicode code point
+            floor(codePoint) !== codePoint // not an integer
+          ) {
+            throw RangeError('Invalid code point: ' + codePoint)
+          }
+          if (codePoint <= 0xFFFF) { // BMP code point
+            codeUnits.push(codePoint)
+          } else { // Astral code point; split in surrogate halves
+            // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
+            codePoint -= 0x10000
+            highSurrogate = (codePoint >> 10) + 0xD800
+            lowSurrogate = (codePoint % 0x400) + 0xDC00
+            codeUnits.push(highSurrogate, lowSurrogate)
+          }
+          if (index + 1 === length || codeUnits.length > MAX_SIZE) {
+            result += stringFromCharCode.apply(null, codeUnits)
+            codeUnits.length = 0
+          }
+        }
+        return result
+      }
+      /* istanbul ignore next */
+      if (Object.defineProperty) {
+        Object.defineProperty(String, 'fromCodePoint', {
+          value: fromCodePoint,
+          configurable: true,
+          writable: true
+        })
+      } else {
+        String.fromCodePoint = fromCodePoint
+      }
+    }())
+  }
+})(typeof exports === 'undefined' ? this.sax = {} : exports)
diff --git a/wrt/node_modules/sax/package.json b/wrt/node_modules/sax/package.json
new file mode 100644 (file)
index 0000000..ee2770a
--- /dev/null
@@ -0,0 +1,136 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "sax@>=0.6.0",
+        "scope": null,
+        "escapedName": "sax",
+        "name": "sax",
+        "rawSpec": ">=0.6.0",
+        "spec": ">=0.6.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/xml2js"
+    ]
+  ],
+  "_from": "sax@>=0.6.0",
+  "_id": "sax@1.2.4",
+  "_inCache": true,
+  "_location": "/sax",
+  "_nodeVersion": "8.0.0",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/sax-1.2.4.tgz_1498153598031_0.6106507133226842"
+  },
+  "_npmUser": {
+    "name": "isaacs",
+    "email": "i@izs.me"
+  },
+  "_npmVersion": "5.0.3",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "sax@>=0.6.0",
+    "scope": null,
+    "escapedName": "sax",
+    "name": "sax",
+    "rawSpec": ">=0.6.0",
+    "spec": ">=0.6.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/xml2js"
+  ],
+  "_resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
+  "_shasum": "2816234e2378bddc4e5354fab5caa895df7100d9",
+  "_shrinkwrap": null,
+  "_spec": "sax@>=0.6.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/xml2js",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bugs": {
+    "url": "https://github.com/isaacs/sax-js/issues"
+  },
+  "contributors": [
+    {
+      "name": "Isaac Z. Schlueter",
+      "email": "i@izs.me"
+    },
+    {
+      "name": "Stein Martin Hustad",
+      "email": "stein@hustad.com"
+    },
+    {
+      "name": "Mikeal Rogers",
+      "email": "mikeal.rogers@gmail.com"
+    },
+    {
+      "name": "Laurie Harper",
+      "email": "laurie@holoweb.net"
+    },
+    {
+      "name": "Jann Horn",
+      "email": "jann@Jann-PC.fritz.box"
+    },
+    {
+      "name": "Elijah Insua",
+      "email": "tmpvar@gmail.com"
+    },
+    {
+      "name": "Henry Rawas",
+      "email": "henryr@schakra.com"
+    },
+    {
+      "name": "Justin Makeig",
+      "email": "jmpublic@makeig.com"
+    },
+    {
+      "name": "Mike Schilling",
+      "email": "mike@emotive.com"
+    }
+  ],
+  "dependencies": {},
+  "description": "An evented streaming XML parser in JavaScript",
+  "devDependencies": {
+    "standard": "^8.6.0",
+    "tap": "^10.5.1"
+  },
+  "directories": {},
+  "dist": {
+    "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==",
+    "shasum": "2816234e2378bddc4e5354fab5caa895df7100d9",
+    "tarball": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz"
+  },
+  "files": [
+    "lib/sax.js",
+    "LICENSE",
+    "README.md"
+  ],
+  "gitHead": "5aee2163d55cff24b817bbf550bac44841f9df45",
+  "homepage": "https://github.com/isaacs/sax-js#readme",
+  "license": "ISC",
+  "main": "lib/sax.js",
+  "maintainers": [
+    {
+      "name": "isaacs",
+      "email": "i@izs.me"
+    }
+  ],
+  "name": "sax",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/sax-js.git"
+  },
+  "scripts": {
+    "postpublish": "git push origin --all; git push origin --tags",
+    "posttest": "standard -F test/*.js lib/*.js",
+    "postversion": "npm publish",
+    "preversion": "npm test",
+    "test": "tap test/*.js --cov -j4"
+  },
+  "version": "1.2.4"
+}
diff --git a/wrt/node_modules/send/HISTORY.md b/wrt/node_modules/send/HISTORY.md
new file mode 100644 (file)
index 0000000..bd172a8
--- /dev/null
@@ -0,0 +1,420 @@
+0.15.4 / 2017-08-05
+===================
+
+  * deps: debug@2.6.8
+  * deps: depd@~1.1.1
+    - Remove unnecessary `Buffer` loading
+  * deps: http-errors@~1.6.2
+    - deps: depd@1.1.1
+
+0.15.3 / 2017-05-16
+===================
+
+  * deps: debug@2.6.7
+    - deps: ms@2.0.0
+  * deps: ms@2.0.0
+
+0.15.2 / 2017-04-26
+===================
+
+  * deps: debug@2.6.4
+    - Fix `DEBUG_MAX_ARRAY_LENGTH`
+    - deps: ms@0.7.3
+  * deps: ms@1.0.0
+
+0.15.1 / 2017-03-04
+===================
+
+  * Fix issue when `Date.parse` does not return `NaN` on invalid date
+  * Fix strict violation in broken environments
+
+0.15.0 / 2017-02-25
+===================
+
+  * Support `If-Match` and `If-Unmodified-Since` headers
+  * Add `res` and `path` arguments to `directory` event
+  * Remove usage of `res._headers` private field
+    - Improves compatibility with Node.js 8 nightly
+  * Send complete HTML document in redirect & error responses
+  * Set default CSP header in redirect & error responses
+  * Use `res.getHeaderNames()` when available
+  * Use `res.headersSent` when available
+  * deps: debug@2.6.1
+    - Allow colors in workers
+    - Deprecated `DEBUG_FD` environment variable set to `3` or higher
+    - Fix error when running under React Native
+    - Use same color for same namespace
+    - deps: ms@0.7.2
+  * deps: etag@~1.8.0
+  * deps: fresh@0.5.0
+    - Fix false detection of `no-cache` request directive
+    - Fix incorrect result when `If-None-Match` has both `*` and ETags
+    - Fix weak `ETag` matching to match spec
+    - perf: delay reading header values until needed
+    - perf: enable strict mode
+    - perf: hoist regular expressions
+    - perf: remove duplicate conditional
+    - perf: remove unnecessary boolean coercions
+    - perf: skip checking modified time if ETag check failed
+    - perf: skip parsing `If-None-Match` when no `ETag` header
+    - perf: use `Date.parse` instead of `new Date`
+  * deps: http-errors@~1.6.1
+    - Make `message` property enumerable for `HttpError`s
+    - deps: setprototypeof@1.0.3
+
+0.14.2 / 2017-01-23
+===================
+
+  * deps: http-errors@~1.5.1
+    - deps: inherits@2.0.3
+    - deps: setprototypeof@1.0.2
+    - deps: statuses@'>= 1.3.1 < 2'
+  * deps: ms@0.7.2
+  * deps: statuses@~1.3.1
+
+0.14.1 / 2016-06-09
+===================
+
+  * Fix redirect error when `path` contains raw non-URL characters
+  * Fix redirect when `path` starts with multiple forward slashes
+
+0.14.0 / 2016-06-06
+===================
+
+  * Add `acceptRanges` option
+  * Add `cacheControl` option
+  * Attempt to combine multiple ranges into single range
+  * Correctly inherit from `Stream` class
+  * Fix `Content-Range` header in 416 responses when using `start`/`end` options
+  * Fix `Content-Range` header missing from default 416 responses
+  * Ignore non-byte `Range` headers
+  * deps: http-errors@~1.5.0
+    - Add `HttpError` export, for `err instanceof createError.HttpError`
+    - Support new code `421 Misdirected Request`
+    - Use `setprototypeof` module to replace `__proto__` setting
+    - deps: inherits@2.0.1
+    - deps: statuses@'>= 1.3.0 < 2'
+    - perf: enable strict mode
+  * deps: range-parser@~1.2.0
+    - Fix incorrectly returning -1 when there is at least one valid range
+    - perf: remove internal function
+  * deps: statuses@~1.3.0
+    - Add `421 Misdirected Request`
+    - perf: enable strict mode
+  * perf: remove argument reassignment
+
+0.13.2 / 2016-03-05
+===================
+
+  * Fix invalid `Content-Type` header when `send.mime.default_type` unset
+
+0.13.1 / 2016-01-16
+===================
+
+  * deps: depd@~1.1.0
+    - Support web browser loading
+    - perf: enable strict mode
+  * deps: destroy@~1.0.4
+    - perf: enable strict mode
+  * deps: escape-html@~1.0.3
+    - perf: enable strict mode
+    - perf: optimize string replacement
+    - perf: use faster string coercion
+  * deps: range-parser@~1.0.3
+    - perf: enable strict mode
+
+0.13.0 / 2015-06-16
+===================
+
+  * Allow Node.js HTTP server to set `Date` response header
+  * Fix incorrectly removing `Content-Location` on 304 response
+  * Improve the default redirect response headers
+  * Send appropriate headers on default error response
+  * Use `http-errors` for standard emitted errors
+  * Use `statuses` instead of `http` module for status messages
+  * deps: escape-html@1.0.2
+  * deps: etag@~1.7.0
+    - Improve stat performance by removing hashing
+  * deps: fresh@0.3.0
+    - Add weak `ETag` matching support
+  * deps: on-finished@~2.3.0
+    - Add defined behavior for HTTP `CONNECT` requests
+    - Add defined behavior for HTTP `Upgrade` requests
+    - deps: ee-first@1.1.1
+  * perf: enable strict mode
+  * perf: remove unnecessary array allocations
+
+0.12.3 / 2015-05-13
+===================
+
+  * deps: debug@~2.2.0
+    - deps: ms@0.7.1
+  * deps: depd@~1.0.1
+  * deps: etag@~1.6.0
+   - Improve support for JXcore
+   - Support "fake" stats objects in environments without `fs`
+  * deps: ms@0.7.1
+    - Prevent extraordinarily long inputs
+  * deps: on-finished@~2.2.1
+
+0.12.2 / 2015-03-13
+===================
+
+  * Throw errors early for invalid `extensions` or `index` options
+  * deps: debug@~2.1.3
+    - Fix high intensity foreground color for bold
+    - deps: ms@0.7.0
+
+0.12.1 / 2015-02-17
+===================
+
+  * Fix regression sending zero-length files
+
+0.12.0 / 2015-02-16
+===================
+
+  * Always read the stat size from the file
+  * Fix mutating passed-in `options`
+  * deps: mime@1.3.4
+
+0.11.1 / 2015-01-20
+===================
+
+  * Fix `root` path disclosure
+
+0.11.0 / 2015-01-05
+===================
+
+  * deps: debug@~2.1.1
+  * deps: etag@~1.5.1
+    - deps: crc@3.2.1
+  * deps: ms@0.7.0
+    - Add `milliseconds`
+    - Add `msecs`
+    - Add `secs`
+    - Add `mins`
+    - Add `hrs`
+    - Add `yrs`
+  * deps: on-finished@~2.2.0
+
+0.10.1 / 2014-10-22
+===================
+
+  * deps: on-finished@~2.1.1
+    - Fix handling of pipelined requests
+
+0.10.0 / 2014-10-15
+===================
+
+  * deps: debug@~2.1.0
+    - Implement `DEBUG_FD` env variable support
+  * deps: depd@~1.0.0
+  * deps: etag@~1.5.0
+    - Improve string performance
+    - Slightly improve speed for weak ETags over 1KB
+
+0.9.3 / 2014-09-24
+==================
+
+  * deps: etag@~1.4.0
+    - Support "fake" stats objects
+
+0.9.2 / 2014-09-15
+==================
+
+  * deps: depd@0.4.5
+  * deps: etag@~1.3.1
+  * deps: range-parser@~1.0.2
+
+0.9.1 / 2014-09-07
+==================
+
+  * deps: fresh@0.2.4
+
+0.9.0 / 2014-09-07
+==================
+
+  * Add `lastModified` option
+  * Use `etag` to generate `ETag` header
+  * deps: debug@~2.0.0
+
+0.8.5 / 2014-09-04
+==================
+
+  * Fix malicious path detection for empty string path
+
+0.8.4 / 2014-09-04
+==================
+
+  * Fix a path traversal issue when using `root`
+
+0.8.3 / 2014-08-16
+==================
+
+  * deps: destroy@1.0.3
+    - renamed from dethroy
+  * deps: on-finished@2.1.0
+
+0.8.2 / 2014-08-14
+==================
+
+  * Work around `fd` leak in Node.js 0.10 for `fs.ReadStream`
+  * deps: dethroy@1.0.2
+
+0.8.1 / 2014-08-05
+==================
+
+  * Fix `extensions` behavior when file already has extension
+
+0.8.0 / 2014-08-05
+==================
+
+  * Add `extensions` option
+
+0.7.4 / 2014-08-04
+==================
+
+  * Fix serving index files without root dir
+
+0.7.3 / 2014-07-29
+==================
+
+  * Fix incorrect 403 on Windows and Node.js 0.11
+
+0.7.2 / 2014-07-27
+==================
+
+  * deps: depd@0.4.4
+    - Work-around v8 generating empty stack traces
+
+0.7.1 / 2014-07-26
+==================
+
+ * deps: depd@0.4.3
+   - Fix exception when global `Error.stackTraceLimit` is too low
+
+0.7.0 / 2014-07-20
+==================
+
+ * Deprecate `hidden` option; use `dotfiles` option
+ * Add `dotfiles` option
+ * deps: debug@1.0.4
+ * deps: depd@0.4.2
+   - Add `TRACE_DEPRECATION` environment variable
+   - Remove non-standard grey color from color output
+   - Support `--no-deprecation` argument
+   - Support `--trace-deprecation` argument
+
+0.6.0 / 2014-07-11
+==================
+
+ * Deprecate `from` option; use `root` option
+ * Deprecate `send.etag()` -- use `etag` in `options`
+ * Deprecate `send.hidden()` -- use `hidden` in `options`
+ * Deprecate `send.index()` -- use `index` in `options`
+ * Deprecate `send.maxage()` -- use `maxAge` in `options`
+ * Deprecate `send.root()` -- use `root` in `options`
+ * Cap `maxAge` value to 1 year
+ * deps: debug@1.0.3
+   - Add support for multiple wildcards in namespaces
+
+0.5.0 / 2014-06-28
+==================
+
+ * Accept string for `maxAge` (converted by `ms`)
+ * Add `headers` event
+ * Include link in default redirect response
+ * Use `EventEmitter.listenerCount` to count listeners
+
+0.4.3 / 2014-06-11
+==================
+
+ * Do not throw un-catchable error on file open race condition
+ * Use `escape-html` for HTML escaping
+ * deps: debug@1.0.2
+   - fix some debugging output colors on node.js 0.8
+ * deps: finished@1.2.2
+ * deps: fresh@0.2.2
+
+0.4.2 / 2014-06-09
+==================
+
+ * fix "event emitter leak" warnings
+ * deps: debug@1.0.1
+ * deps: finished@1.2.1
+
+0.4.1 / 2014-06-02
+==================
+
+ * Send `max-age` in `Cache-Control` in correct format
+
+0.4.0 / 2014-05-27
+==================
+
+ * Calculate ETag with md5 for reduced collisions
+ * Fix wrong behavior when index file matches directory
+ * Ignore stream errors after request ends
+   - Goodbye `EBADF, read`
+ * Skip directories in index file search
+ * deps: debug@0.8.1
+
+0.3.0 / 2014-04-24
+==================
+
+ * Fix sending files with dots without root set
+ * Coerce option types
+ * Accept API options in options object
+ * Set etags to "weak"
+ * Include file path in etag
+ * Make "Can't set headers after they are sent." catchable
+ * Send full entity-body for multi range requests
+ * Default directory access to 403 when index disabled
+ * Support multiple index paths
+ * Support "If-Range" header
+ * Control whether to generate etags
+ * deps: mime@1.2.11
+
+0.2.0 / 2014-01-29
+==================
+
+ * update range-parser and fresh
+
+0.1.4 / 2013-08-11 
+==================
+
+ * update fresh
+
+0.1.3 / 2013-07-08 
+==================
+
+ * Revert "Fix fd leak"
+
+0.1.2 / 2013-07-03 
+==================
+
+ * Fix fd leak
+
+0.1.0 / 2012-08-25 
+==================
+
+  * add options parameter to send() that is passed to fs.createReadStream() [kanongil]
+
+0.0.4 / 2012-08-16 
+==================
+
+  * allow custom "Accept-Ranges" definition
+
+0.0.3 / 2012-07-16 
+==================
+
+  * fix normalization of the root directory. Closes #3
+
+0.0.2 / 2012-07-09 
+==================
+
+  * add passing of req explicitly for now (YUCK)
+
+0.0.1 / 2010-01-03
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/send/LICENSE b/wrt/node_modules/send/LICENSE
new file mode 100644 (file)
index 0000000..4aa69e8
--- /dev/null
@@ -0,0 +1,23 @@
+(The MIT License)
+
+Copyright (c) 2012 TJ Holowaychuk
+Copyright (c) 2014-2016 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/send/README.md b/wrt/node_modules/send/README.md
new file mode 100644 (file)
index 0000000..0c8d11d
--- /dev/null
@@ -0,0 +1,301 @@
+# send
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Linux Build][travis-image]][travis-url]
+[![Windows Build][appveyor-image]][appveyor-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+[![Gratipay][gratipay-image]][gratipay-url]
+
+Send is a library for streaming files from the file system as a http response
+supporting partial responses (Ranges), conditional-GET negotiation (If-Match,
+If-Unmodified-Since, If-None-Match, If-Modified-Since), high test coverage,
+and granular events which may be leveraged to take appropriate actions in your
+application or framework.
+
+Looking to serve up entire folders mapped to URLs? Try [serve-static](https://www.npmjs.org/package/serve-static).
+
+## Installation
+
+This is a [Node.js](https://nodejs.org/en/) module available through the
+[npm registry](https://www.npmjs.com/). Installation is done using the
+[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
+
+```bash
+$ npm install send
+```
+
+## API
+
+<!-- eslint-disable no-unused-vars -->
+
+```js
+var send = require('send')
+```
+
+### send(req, path, [options])
+
+Create a new `SendStream` for the given path to send to a `res`. The `req` is
+the Node.js HTTP request and the `path` is a urlencoded path to send (urlencoded,
+not the actual file-system path).
+
+#### Options
+
+##### acceptRanges
+
+Enable or disable accepting ranged requests, defaults to true.
+Disabling this will not send `Accept-Ranges` and ignore the contents
+of the `Range` request header.
+
+##### cacheControl
+
+Enable or disable setting `Cache-Control` response header, defaults to
+true. Disabling this will ignore the `maxAge` option.
+
+##### dotfiles
+
+Set how "dotfiles" are treated when encountered. A dotfile is a file
+or directory that begins with a dot ("."). Note this check is done on
+the path itself without checking if the path actually exists on the
+disk. If `root` is specified, only the dotfiles above the root are
+checked (i.e. the root itself can be within a dotfile when when set
+to "deny").
+
+  - `'allow'` No special treatment for dotfiles.
+  - `'deny'` Send a 403 for any request for a dotfile.
+  - `'ignore'` Pretend like the dotfile does not exist and 404.
+
+The default value is _similar_ to `'ignore'`, with the exception that
+this default will not ignore the files within a directory that begins
+with a dot, for backward-compatibility.
+
+##### end
+
+Byte offset at which the stream ends, defaults to the length of the file
+minus 1. The end is inclusive in the stream, meaning `end: 3` will include
+the 4th byte in the stream.
+
+##### etag
+
+Enable or disable etag generation, defaults to true.
+
+##### extensions
+
+If a given file doesn't exist, try appending one of the given extensions,
+in the given order. By default, this is disabled (set to `false`). An
+example value that will serve extension-less HTML files: `['html', 'htm']`.
+This is skipped if the requested file already has an extension.
+
+##### index
+
+By default send supports "index.html" files, to disable this
+set `false` or to supply a new index pass a string or an array
+in preferred order.
+
+##### lastModified
+
+Enable or disable `Last-Modified` header, defaults to true. Uses the file
+system's last modified value.
+
+##### maxAge
+
+Provide a max-age in milliseconds for http caching, defaults to 0.
+This can also be a string accepted by the
+[ms](https://www.npmjs.org/package/ms#readme) module.
+
+##### root
+
+Serve files relative to `path`.
+
+##### start
+
+Byte offset at which the stream starts, defaults to 0. The start is inclusive,
+meaning `start: 2` will include the 3rd byte in the stream.
+
+#### Events
+
+The `SendStream` is an event emitter and will emit the following events:
+
+  - `error` an error occurred `(err)`
+  - `directory` a directory was requested `(res, path)`
+  - `file` a file was requested `(path, stat)`
+  - `headers` the headers are about to be set on a file `(res, path, stat)`
+  - `stream` file streaming has started `(stream)`
+  - `end` streaming has completed
+
+#### .pipe
+
+The `pipe` method is used to pipe the response into the Node.js HTTP response
+object, typically `send(req, path, options).pipe(res)`.
+
+### .mime
+
+The `mime` export is the global instance of of the
+[`mime` npm module](https://www.npmjs.com/package/mime).
+
+This is used to configure the MIME types that are associated with file extensions
+as well as other options for how to resolve the MIME type of a file (like the
+default type to use for an unknown file extension).
+
+## Error-handling
+
+By default when no `error` listeners are present an automatic response will be
+made, otherwise you have full control over the response, aka you may show a 5xx
+page etc.
+
+## Caching
+
+It does _not_ perform internal caching, you should use a reverse proxy cache
+such as Varnish for this, or those fancy things called CDNs. If your
+application is small enough that it would benefit from single-node memory
+caching, it's small enough that it does not need caching at all ;).
+
+## Debugging
+
+To enable `debug()` instrumentation output export __DEBUG__:
+
+```
+$ DEBUG=send node app
+```
+
+## Running tests
+
+```
+$ npm install
+$ npm test
+```
+
+## Examples
+
+### Small example
+
+```js
+var http = require('http')
+var parseUrl = require('parseurl')
+var send = require('send')
+
+var server = http.createServer(function onRequest (req, res) {
+  send(req, parseUrl(req).pathname).pipe(res)
+})
+
+server.listen(3000)
+```
+
+### Custom file types
+
+```js
+var http = require('http')
+var parseUrl = require('parseurl')
+var send = require('send')
+
+// Default unknown types to text/plain
+send.mime.default_type = 'text/plain'
+
+// Add a custom type
+send.mime.define({
+  'application/x-my-type': ['x-mt', 'x-mtt']
+})
+
+var server = http.createServer(function onRequest (req, res) {
+  send(req, parseUrl(req).pathname).pipe(res)
+})
+
+server.listen(3000)
+```
+
+### Custom directory index view
+
+This is a example of serving up a structure of directories with a
+custom function to render a listing of a directory.
+
+```js
+var http = require('http')
+var fs = require('fs')
+var parseUrl = require('parseurl')
+var send = require('send')
+
+// Transfer arbitrary files from within /www/example.com/public/*
+// with a custom handler for directory listing
+var server = http.createServer(function onRequest (req, res) {
+  send(req, parseUrl(req).pathname, {index: false, root: '/www/example.com/public'})
+  .once('directory', directory)
+  .pipe(res)
+})
+
+server.listen(3000)
+
+// Custom directory handler
+function directory (res, path) {
+  var stream = this
+
+  // redirect to trailing slash for consistent url
+  if (!stream.hasTrailingSlash()) {
+    return stream.redirect(path)
+  }
+
+  // get directory list
+  fs.readdir(path, function onReaddir (err, list) {
+    if (err) return stream.error(err)
+
+    // render an index for the directory
+    res.setHeader('Content-Type', 'text/plain; charset=UTF-8')
+    res.end(list.join('\n') + '\n')
+  })
+}
+```
+
+### Serving from a root directory with custom error-handling
+
+```js
+var http = require('http')
+var parseUrl = require('parseurl')
+var send = require('send')
+
+var server = http.createServer(function onRequest (req, res) {
+  // your custom error-handling logic:
+  function error (err) {
+    res.statusCode = err.status || 500
+    res.end(err.message)
+  }
+
+  // your custom headers
+  function headers (res, path, stat) {
+    // serve all files for download
+    res.setHeader('Content-Disposition', 'attachment')
+  }
+
+  // your custom directory handling logic:
+  function redirect () {
+    res.statusCode = 301
+    res.setHeader('Location', req.url + '/')
+    res.end('Redirecting to ' + req.url + '/')
+  }
+
+  // transfer arbitrary files from within
+  // /www/example.com/public/*
+  send(req, parseUrl(req).pathname, {root: '/www/example.com/public'})
+  .on('error', error)
+  .on('directory', redirect)
+  .on('headers', headers)
+  .pipe(res)
+})
+
+server.listen(3000)
+```
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/send.svg
+[npm-url]: https://npmjs.org/package/send
+[travis-image]: https://img.shields.io/travis/pillarjs/send/master.svg?label=linux
+[travis-url]: https://travis-ci.org/pillarjs/send
+[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/send/master.svg?label=windows
+[appveyor-url]: https://ci.appveyor.com/project/dougwilson/send
+[coveralls-image]: https://img.shields.io/coveralls/pillarjs/send/master.svg
+[coveralls-url]: https://coveralls.io/r/pillarjs/send?branch=master
+[downloads-image]: https://img.shields.io/npm/dm/send.svg
+[downloads-url]: https://npmjs.org/package/send
+[gratipay-image]: https://img.shields.io/gratipay/dougwilson.svg
+[gratipay-url]: https://www.gratipay.com/dougwilson/
diff --git a/wrt/node_modules/send/index.js b/wrt/node_modules/send/index.js
new file mode 100644 (file)
index 0000000..3756841
--- /dev/null
@@ -0,0 +1,1074 @@
+/*!
+ * send
+ * Copyright(c) 2012 TJ Holowaychuk
+ * Copyright(c) 2014-2016 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var createError = require('http-errors')
+var debug = require('debug')('send')
+var deprecate = require('depd')('send')
+var destroy = require('destroy')
+var encodeUrl = require('encodeurl')
+var escapeHtml = require('escape-html')
+var etag = require('etag')
+var EventEmitter = require('events').EventEmitter
+var fresh = require('fresh')
+var fs = require('fs')
+var mime = require('mime')
+var ms = require('ms')
+var onFinished = require('on-finished')
+var parseRange = require('range-parser')
+var path = require('path')
+var statuses = require('statuses')
+var Stream = require('stream')
+var util = require('util')
+
+/**
+ * Path function references.
+ * @private
+ */
+
+var extname = path.extname
+var join = path.join
+var normalize = path.normalize
+var resolve = path.resolve
+var sep = path.sep
+
+/**
+ * Regular expression for identifying a bytes Range header.
+ * @private
+ */
+
+var BYTES_RANGE_REGEXP = /^ *bytes=/
+
+/**
+ * Simple expression to split token list.
+ * @private
+ */
+
+var TOKEN_LIST_REGEXP = / *, */
+
+/**
+ * Maximum value allowed for the max age.
+ * @private
+ */
+
+var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1000 // 1 year
+
+/**
+ * Regular expression to match a path with a directory up component.
+ * @private
+ */
+
+var UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = send
+module.exports.mime = mime
+
+/**
+ * Shim EventEmitter.listenerCount for node.js < 0.10
+ */
+
+/* istanbul ignore next */
+var listenerCount = EventEmitter.listenerCount ||
+  function (emitter, type) { return emitter.listeners(type).length }
+
+/**
+ * Return a `SendStream` for `req` and `path`.
+ *
+ * @param {object} req
+ * @param {string} path
+ * @param {object} [options]
+ * @return {SendStream}
+ * @public
+ */
+
+function send (req, path, options) {
+  return new SendStream(req, path, options)
+}
+
+/**
+ * Initialize a `SendStream` with the given `path`.
+ *
+ * @param {Request} req
+ * @param {String} path
+ * @param {object} [options]
+ * @private
+ */
+
+function SendStream (req, path, options) {
+  Stream.call(this)
+
+  var opts = options || {}
+
+  this.options = opts
+  this.path = path
+  this.req = req
+
+  this._acceptRanges = opts.acceptRanges !== undefined
+    ? Boolean(opts.acceptRanges)
+    : true
+
+  this._cacheControl = opts.cacheControl !== undefined
+    ? Boolean(opts.cacheControl)
+    : true
+
+  this._etag = opts.etag !== undefined
+    ? Boolean(opts.etag)
+    : true
+
+  this._dotfiles = opts.dotfiles !== undefined
+    ? opts.dotfiles
+    : 'ignore'
+
+  if (this._dotfiles !== 'ignore' && this._dotfiles !== 'allow' && this._dotfiles !== 'deny') {
+    throw new TypeError('dotfiles option must be "allow", "deny", or "ignore"')
+  }
+
+  this._hidden = Boolean(opts.hidden)
+
+  if (opts.hidden !== undefined) {
+    deprecate('hidden: use dotfiles: \'' + (this._hidden ? 'allow' : 'ignore') + '\' instead')
+  }
+
+  // legacy support
+  if (opts.dotfiles === undefined) {
+    this._dotfiles = undefined
+  }
+
+  this._extensions = opts.extensions !== undefined
+    ? normalizeList(opts.extensions, 'extensions option')
+    : []
+
+  this._index = opts.index !== undefined
+    ? normalizeList(opts.index, 'index option')
+    : ['index.html']
+
+  this._lastModified = opts.lastModified !== undefined
+    ? Boolean(opts.lastModified)
+    : true
+
+  this._maxage = opts.maxAge || opts.maxage
+  this._maxage = typeof this._maxage === 'string'
+    ? ms(this._maxage)
+    : Number(this._maxage)
+  this._maxage = !isNaN(this._maxage)
+    ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE)
+    : 0
+
+  this._root = opts.root
+    ? resolve(opts.root)
+    : null
+
+  if (!this._root && opts.from) {
+    this.from(opts.from)
+  }
+}
+
+/**
+ * Inherits from `Stream`.
+ */
+
+util.inherits(SendStream, Stream)
+
+/**
+ * Enable or disable etag generation.
+ *
+ * @param {Boolean} val
+ * @return {SendStream}
+ * @api public
+ */
+
+SendStream.prototype.etag = deprecate.function(function etag (val) {
+  this._etag = Boolean(val)
+  debug('etag %s', this._etag)
+  return this
+}, 'send.etag: pass etag as option')
+
+/**
+ * Enable or disable "hidden" (dot) files.
+ *
+ * @param {Boolean} path
+ * @return {SendStream}
+ * @api public
+ */
+
+SendStream.prototype.hidden = deprecate.function(function hidden (val) {
+  this._hidden = Boolean(val)
+  this._dotfiles = undefined
+  debug('hidden %s', this._hidden)
+  return this
+}, 'send.hidden: use dotfiles option')
+
+/**
+ * Set index `paths`, set to a falsy
+ * value to disable index support.
+ *
+ * @param {String|Boolean|Array} paths
+ * @return {SendStream}
+ * @api public
+ */
+
+SendStream.prototype.index = deprecate.function(function index (paths) {
+  var index = !paths ? [] : normalizeList(paths, 'paths argument')
+  debug('index %o', paths)
+  this._index = index
+  return this
+}, 'send.index: pass index as option')
+
+/**
+ * Set root `path`.
+ *
+ * @param {String} path
+ * @return {SendStream}
+ * @api public
+ */
+
+SendStream.prototype.root = function root (path) {
+  this._root = resolve(String(path))
+  debug('root %s', this._root)
+  return this
+}
+
+SendStream.prototype.from = deprecate.function(SendStream.prototype.root,
+  'send.from: pass root as option')
+
+SendStream.prototype.root = deprecate.function(SendStream.prototype.root,
+  'send.root: pass root as option')
+
+/**
+ * Set max-age to `maxAge`.
+ *
+ * @param {Number} maxAge
+ * @return {SendStream}
+ * @api public
+ */
+
+SendStream.prototype.maxage = deprecate.function(function maxage (maxAge) {
+  this._maxage = typeof maxAge === 'string'
+    ? ms(maxAge)
+    : Number(maxAge)
+  this._maxage = !isNaN(this._maxage)
+    ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE)
+    : 0
+  debug('max-age %d', this._maxage)
+  return this
+}, 'send.maxage: pass maxAge as option')
+
+/**
+ * Emit error with `status`.
+ *
+ * @param {number} status
+ * @param {Error} [err]
+ * @private
+ */
+
+SendStream.prototype.error = function error (status, err) {
+  // emit if listeners instead of responding
+  if (listenerCount(this, 'error') !== 0) {
+    return this.emit('error', createError(status, err, {
+      expose: false
+    }))
+  }
+
+  var res = this.res
+  var msg = statuses[status] || String(status)
+  var doc = createHtmlDocument('Error', escapeHtml(msg))
+
+  // clear existing headers
+  clearHeaders(res)
+
+  // add error headers
+  if (err && err.headers) {
+    setHeaders(res, err.headers)
+  }
+
+  // send basic response
+  res.statusCode = status
+  res.setHeader('Content-Type', 'text/html; charset=UTF-8')
+  res.setHeader('Content-Length', Buffer.byteLength(doc))
+  res.setHeader('Content-Security-Policy', "default-src 'self'")
+  res.setHeader('X-Content-Type-Options', 'nosniff')
+  res.end(doc)
+}
+
+/**
+ * Check if the pathname ends with "/".
+ *
+ * @return {boolean}
+ * @private
+ */
+
+SendStream.prototype.hasTrailingSlash = function hasTrailingSlash () {
+  return this.path[this.path.length - 1] === '/'
+}
+
+/**
+ * Check if this is a conditional GET request.
+ *
+ * @return {Boolean}
+ * @api private
+ */
+
+SendStream.prototype.isConditionalGET = function isConditionalGET () {
+  return this.req.headers['if-match'] ||
+    this.req.headers['if-unmodified-since'] ||
+    this.req.headers['if-none-match'] ||
+    this.req.headers['if-modified-since']
+}
+
+/**
+ * Check if the request preconditions failed.
+ *
+ * @return {boolean}
+ * @private
+ */
+
+SendStream.prototype.isPreconditionFailure = function isPreconditionFailure () {
+  var req = this.req
+  var res = this.res
+
+  // if-match
+  var match = req.headers['if-match']
+  if (match) {
+    var etag = res.getHeader('ETag')
+    return !etag || (match !== '*' && match.split(TOKEN_LIST_REGEXP).every(function (match) {
+      return match !== etag && match !== 'W/' + etag && 'W/' + match !== etag
+    }))
+  }
+
+  // if-unmodified-since
+  var unmodifiedSince = parseHttpDate(req.headers['if-unmodified-since'])
+  if (!isNaN(unmodifiedSince)) {
+    var lastModified = parseHttpDate(res.getHeader('Last-Modified'))
+    return isNaN(lastModified) || lastModified > unmodifiedSince
+  }
+
+  return false
+}
+
+/**
+ * Strip content-* header fields.
+ *
+ * @private
+ */
+
+SendStream.prototype.removeContentHeaderFields = function removeContentHeaderFields () {
+  var res = this.res
+  var headers = getHeaderNames(res)
+
+  for (var i = 0; i < headers.length; i++) {
+    var header = headers[i]
+    if (header.substr(0, 8) === 'content-' && header !== 'content-location') {
+      res.removeHeader(header)
+    }
+  }
+}
+
+/**
+ * Respond with 304 not modified.
+ *
+ * @api private
+ */
+
+SendStream.prototype.notModified = function notModified () {
+  var res = this.res
+  debug('not modified')
+  this.removeContentHeaderFields()
+  res.statusCode = 304
+  res.end()
+}
+
+/**
+ * Raise error that headers already sent.
+ *
+ * @api private
+ */
+
+SendStream.prototype.headersAlreadySent = function headersAlreadySent () {
+  var err = new Error('Can\'t set headers after they are sent.')
+  debug('headers already sent')
+  this.error(500, err)
+}
+
+/**
+ * Check if the request is cacheable, aka
+ * responded with 2xx or 304 (see RFC 2616 section 14.2{5,6}).
+ *
+ * @return {Boolean}
+ * @api private
+ */
+
+SendStream.prototype.isCachable = function isCachable () {
+  var statusCode = this.res.statusCode
+  return (statusCode >= 200 && statusCode < 300) ||
+    statusCode === 304
+}
+
+/**
+ * Handle stat() error.
+ *
+ * @param {Error} error
+ * @private
+ */
+
+SendStream.prototype.onStatError = function onStatError (error) {
+  switch (error.code) {
+    case 'ENAMETOOLONG':
+    case 'ENOENT':
+    case 'ENOTDIR':
+      this.error(404, error)
+      break
+    default:
+      this.error(500, error)
+      break
+  }
+}
+
+/**
+ * Check if the cache is fresh.
+ *
+ * @return {Boolean}
+ * @api private
+ */
+
+SendStream.prototype.isFresh = function isFresh () {
+  return fresh(this.req.headers, {
+    'etag': this.res.getHeader('ETag'),
+    'last-modified': this.res.getHeader('Last-Modified')
+  })
+}
+
+/**
+ * Check if the range is fresh.
+ *
+ * @return {Boolean}
+ * @api private
+ */
+
+SendStream.prototype.isRangeFresh = function isRangeFresh () {
+  var ifRange = this.req.headers['if-range']
+
+  if (!ifRange) {
+    return true
+  }
+
+  // if-range as etag
+  if (ifRange.indexOf('"') !== -1) {
+    var etag = this.res.getHeader('ETag')
+    return Boolean(etag && ifRange.indexOf(etag) !== -1)
+  }
+
+  // if-range as modified date
+  var lastModified = this.res.getHeader('Last-Modified')
+  return parseHttpDate(lastModified) <= parseHttpDate(ifRange)
+}
+
+/**
+ * Redirect to path.
+ *
+ * @param {string} path
+ * @private
+ */
+
+SendStream.prototype.redirect = function redirect (path) {
+  var res = this.res
+
+  if (listenerCount(this, 'directory') !== 0) {
+    this.emit('directory', res, path)
+    return
+  }
+
+  if (this.hasTrailingSlash()) {
+    this.error(403)
+    return
+  }
+
+  var loc = encodeUrl(collapseLeadingSlashes(this.path + '/'))
+  var doc = createHtmlDocument('Redirecting', 'Redirecting to <a href="' + escapeHtml(loc) + '">' +
+    escapeHtml(loc) + '</a>')
+
+  // redirect
+  res.statusCode = 301
+  res.setHeader('Content-Type', 'text/html; charset=UTF-8')
+  res.setHeader('Content-Length', Buffer.byteLength(doc))
+  res.setHeader('Content-Security-Policy', "default-src 'self'")
+  res.setHeader('X-Content-Type-Options', 'nosniff')
+  res.setHeader('Location', loc)
+  res.end(doc)
+}
+
+/**
+ * Pipe to `res.
+ *
+ * @param {Stream} res
+ * @return {Stream} res
+ * @api public
+ */
+
+SendStream.prototype.pipe = function pipe (res) {
+  // root path
+  var root = this._root
+
+  // references
+  this.res = res
+
+  // decode the path
+  var path = decode(this.path)
+  if (path === -1) {
+    this.error(400)
+    return res
+  }
+
+  // null byte(s)
+  if (~path.indexOf('\0')) {
+    this.error(400)
+    return res
+  }
+
+  var parts
+  if (root !== null) {
+    // malicious path
+    if (UP_PATH_REGEXP.test(normalize('.' + sep + path))) {
+      debug('malicious path "%s"', path)
+      this.error(403)
+      return res
+    }
+
+    // join / normalize from optional root dir
+    path = normalize(join(root, path))
+    root = normalize(root + sep)
+
+    // explode path parts
+    parts = path.substr(root.length).split(sep)
+  } else {
+    // ".." is malicious without "root"
+    if (UP_PATH_REGEXP.test(path)) {
+      debug('malicious path "%s"', path)
+      this.error(403)
+      return res
+    }
+
+    // explode path parts
+    parts = normalize(path).split(sep)
+
+    // resolve the path
+    path = resolve(path)
+  }
+
+  // dotfile handling
+  if (containsDotFile(parts)) {
+    var access = this._dotfiles
+
+    // legacy support
+    if (access === undefined) {
+      access = parts[parts.length - 1][0] === '.'
+        ? (this._hidden ? 'allow' : 'ignore')
+        : 'allow'
+    }
+
+    debug('%s dotfile "%s"', access, path)
+    switch (access) {
+      case 'allow':
+        break
+      case 'deny':
+        this.error(403)
+        return res
+      case 'ignore':
+      default:
+        this.error(404)
+        return res
+    }
+  }
+
+  // index file support
+  if (this._index.length && this.hasTrailingSlash()) {
+    this.sendIndex(path)
+    return res
+  }
+
+  this.sendFile(path)
+  return res
+}
+
+/**
+ * Transfer `path`.
+ *
+ * @param {String} path
+ * @api public
+ */
+
+SendStream.prototype.send = function send (path, stat) {
+  var len = stat.size
+  var options = this.options
+  var opts = {}
+  var res = this.res
+  var req = this.req
+  var ranges = req.headers.range
+  var offset = options.start || 0
+
+  if (headersSent(res)) {
+    // impossible to send now
+    this.headersAlreadySent()
+    return
+  }
+
+  debug('pipe "%s"', path)
+
+  // set header fields
+  this.setHeader(path, stat)
+
+  // set content-type
+  this.type(path)
+
+  // conditional GET support
+  if (this.isConditionalGET()) {
+    if (this.isPreconditionFailure()) {
+      this.error(412)
+      return
+    }
+
+    if (this.isCachable() && this.isFresh()) {
+      this.notModified()
+      return
+    }
+  }
+
+  // adjust len to start/end options
+  len = Math.max(0, len - offset)
+  if (options.end !== undefined) {
+    var bytes = options.end - offset + 1
+    if (len > bytes) len = bytes
+  }
+
+  // Range support
+  if (this._acceptRanges && BYTES_RANGE_REGEXP.test(ranges)) {
+    // parse
+    ranges = parseRange(len, ranges, {
+      combine: true
+    })
+
+    // If-Range support
+    if (!this.isRangeFresh()) {
+      debug('range stale')
+      ranges = -2
+    }
+
+    // unsatisfiable
+    if (ranges === -1) {
+      debug('range unsatisfiable')
+
+      // Content-Range
+      res.setHeader('Content-Range', contentRange('bytes', len))
+
+      // 416 Requested Range Not Satisfiable
+      return this.error(416, {
+        headers: {'Content-Range': res.getHeader('Content-Range')}
+      })
+    }
+
+    // valid (syntactically invalid/multiple ranges are treated as a regular response)
+    if (ranges !== -2 && ranges.length === 1) {
+      debug('range %j', ranges)
+
+      // Content-Range
+      res.statusCode = 206
+      res.setHeader('Content-Range', contentRange('bytes', len, ranges[0]))
+
+      // adjust for requested range
+      offset += ranges[0].start
+      len = ranges[0].end - ranges[0].start + 1
+    }
+  }
+
+  // clone options
+  for (var prop in options) {
+    opts[prop] = options[prop]
+  }
+
+  // set read options
+  opts.start = offset
+  opts.end = Math.max(offset, offset + len - 1)
+
+  // content-length
+  res.setHeader('Content-Length', len)
+
+  // HEAD support
+  if (req.method === 'HEAD') {
+    res.end()
+    return
+  }
+
+  this.stream(path, opts)
+}
+
+/**
+ * Transfer file for `path`.
+ *
+ * @param {String} path
+ * @api private
+ */
+SendStream.prototype.sendFile = function sendFile (path) {
+  var i = 0
+  var self = this
+
+  debug('stat "%s"', path)
+  fs.stat(path, function onstat (err, stat) {
+    if (err && err.code === 'ENOENT' && !extname(path) && path[path.length - 1] !== sep) {
+      // not found, check extensions
+      return next(err)
+    }
+    if (err) return self.onStatError(err)
+    if (stat.isDirectory()) return self.redirect(path)
+    self.emit('file', path, stat)
+    self.send(path, stat)
+  })
+
+  function next (err) {
+    if (self._extensions.length <= i) {
+      return err
+        ? self.onStatError(err)
+        : self.error(404)
+    }
+
+    var p = path + '.' + self._extensions[i++]
+
+    debug('stat "%s"', p)
+    fs.stat(p, function (err, stat) {
+      if (err) return next(err)
+      if (stat.isDirectory()) return next()
+      self.emit('file', p, stat)
+      self.send(p, stat)
+    })
+  }
+}
+
+/**
+ * Transfer index for `path`.
+ *
+ * @param {String} path
+ * @api private
+ */
+SendStream.prototype.sendIndex = function sendIndex (path) {
+  var i = -1
+  var self = this
+
+  function next (err) {
+    if (++i >= self._index.length) {
+      if (err) return self.onStatError(err)
+      return self.error(404)
+    }
+
+    var p = join(path, self._index[i])
+
+    debug('stat "%s"', p)
+    fs.stat(p, function (err, stat) {
+      if (err) return next(err)
+      if (stat.isDirectory()) return next()
+      self.emit('file', p, stat)
+      self.send(p, stat)
+    })
+  }
+
+  next()
+}
+
+/**
+ * Stream `path` to the response.
+ *
+ * @param {String} path
+ * @param {Object} options
+ * @api private
+ */
+
+SendStream.prototype.stream = function stream (path, options) {
+  // TODO: this is all lame, refactor meeee
+  var finished = false
+  var self = this
+  var res = this.res
+
+  // pipe
+  var stream = fs.createReadStream(path, options)
+  this.emit('stream', stream)
+  stream.pipe(res)
+
+  // response finished, done with the fd
+  onFinished(res, function onfinished () {
+    finished = true
+    destroy(stream)
+  })
+
+  // error handling code-smell
+  stream.on('error', function onerror (err) {
+    // request already finished
+    if (finished) return
+
+    // clean up stream
+    finished = true
+    destroy(stream)
+
+    // error
+    self.onStatError(err)
+  })
+
+  // end
+  stream.on('end', function onend () {
+    self.emit('end')
+  })
+}
+
+/**
+ * Set content-type based on `path`
+ * if it hasn't been explicitly set.
+ *
+ * @param {String} path
+ * @api private
+ */
+
+SendStream.prototype.type = function type (path) {
+  var res = this.res
+
+  if (res.getHeader('Content-Type')) return
+
+  var type = mime.lookup(path)
+
+  if (!type) {
+    debug('no content-type')
+    return
+  }
+
+  var charset = mime.charsets.lookup(type)
+
+  debug('content-type %s', type)
+  res.setHeader('Content-Type', type + (charset ? '; charset=' + charset : ''))
+}
+
+/**
+ * Set response header fields, most
+ * fields may be pre-defined.
+ *
+ * @param {String} path
+ * @param {Object} stat
+ * @api private
+ */
+
+SendStream.prototype.setHeader = function setHeader (path, stat) {
+  var res = this.res
+
+  this.emit('headers', res, path, stat)
+
+  if (this._acceptRanges && !res.getHeader('Accept-Ranges')) {
+    debug('accept ranges')
+    res.setHeader('Accept-Ranges', 'bytes')
+  }
+
+  if (this._cacheControl && !res.getHeader('Cache-Control')) {
+    var cacheControl = 'public, max-age=' + Math.floor(this._maxage / 1000)
+    debug('cache-control %s', cacheControl)
+    res.setHeader('Cache-Control', cacheControl)
+  }
+
+  if (this._lastModified && !res.getHeader('Last-Modified')) {
+    var modified = stat.mtime.toUTCString()
+    debug('modified %s', modified)
+    res.setHeader('Last-Modified', modified)
+  }
+
+  if (this._etag && !res.getHeader('ETag')) {
+    var val = etag(stat)
+    debug('etag %s', val)
+    res.setHeader('ETag', val)
+  }
+}
+
+/**
+ * Clear all headers from a response.
+ *
+ * @param {object} res
+ * @private
+ */
+
+function clearHeaders (res) {
+  var headers = getHeaderNames(res)
+
+  for (var i = 0; i < headers.length; i++) {
+    res.removeHeader(headers[i])
+  }
+}
+
+/**
+ * Collapse all leading slashes into a single slash
+ *
+ * @param {string} str
+ * @private
+ */
+function collapseLeadingSlashes (str) {
+  for (var i = 0; i < str.length; i++) {
+    if (str[i] !== '/') {
+      break
+    }
+  }
+
+  return i > 1
+    ? '/' + str.substr(i)
+    : str
+}
+
+/**
+ * Determine if path parts contain a dotfile.
+ *
+ * @api private
+ */
+
+function containsDotFile (parts) {
+  for (var i = 0; i < parts.length; i++) {
+    if (parts[i][0] === '.') {
+      return true
+    }
+  }
+
+  return false
+}
+
+/**
+ * Create a Content-Range header.
+ *
+ * @param {string} type
+ * @param {number} size
+ * @param {array} [range]
+ */
+
+function contentRange (type, size, range) {
+  return type + ' ' + (range ? range.start + '-' + range.end : '*') + '/' + size
+}
+
+/**
+ * Create a minimal HTML document.
+ *
+ * @param {string} title
+ * @param {string} body
+ * @private
+ */
+
+function createHtmlDocument (title, body) {
+  return '<!DOCTYPE html>\n' +
+    '<html lang="en">\n' +
+    '<head>\n' +
+    '<meta charset="utf-8">\n' +
+    '<title>' + title + '</title>\n' +
+    '</head>\n' +
+    '<body>\n' +
+    '<pre>' + body + '</pre>\n' +
+    '</body>\n'
+}
+
+/**
+ * decodeURIComponent.
+ *
+ * Allows V8 to only deoptimize this fn instead of all
+ * of send().
+ *
+ * @param {String} path
+ * @api private
+ */
+
+function decode (path) {
+  try {
+    return decodeURIComponent(path)
+  } catch (err) {
+    return -1
+  }
+}
+
+/**
+ * Get the header names on a respnse.
+ *
+ * @param {object} res
+ * @returns {array[string]}
+ * @private
+ */
+
+function getHeaderNames (res) {
+  return typeof res.getHeaderNames !== 'function'
+    ? Object.keys(res._headers || {})
+    : res.getHeaderNames()
+}
+
+/**
+ * Determine if the response headers have been sent.
+ *
+ * @param {object} res
+ * @returns {boolean}
+ * @private
+ */
+
+function headersSent (res) {
+  return typeof res.headersSent !== 'boolean'
+    ? Boolean(res._header)
+    : res.headersSent
+}
+
+/**
+ * Normalize the index option into an array.
+ *
+ * @param {boolean|string|array} val
+ * @param {string} name
+ * @private
+ */
+
+function normalizeList (val, name) {
+  var list = [].concat(val || [])
+
+  for (var i = 0; i < list.length; i++) {
+    if (typeof list[i] !== 'string') {
+      throw new TypeError(name + ' must be array of strings or false')
+    }
+  }
+
+  return list
+}
+
+/**
+ * Parse an HTTP Date into a number.
+ *
+ * @param {string} date
+ * @private
+ */
+
+function parseHttpDate (date) {
+  var timestamp = date && Date.parse(date)
+
+  return typeof timestamp === 'number'
+    ? timestamp
+    : NaN
+}
+
+/**
+ * Set an object of headers on a response.
+ *
+ * @param {object} res
+ * @param {object} headers
+ * @private
+ */
+
+function setHeaders (res, headers) {
+  var keys = Object.keys(headers)
+
+  for (var i = 0; i < keys.length; i++) {
+    var key = keys[i]
+    res.setHeader(key, headers[key])
+  }
+}
diff --git a/wrt/node_modules/send/node_modules/debug/.coveralls.yml b/wrt/node_modules/send/node_modules/debug/.coveralls.yml
new file mode 100644 (file)
index 0000000..20a7068
--- /dev/null
@@ -0,0 +1 @@
+repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve
diff --git a/wrt/node_modules/send/node_modules/debug/.eslintrc b/wrt/node_modules/send/node_modules/debug/.eslintrc
new file mode 100644 (file)
index 0000000..8a37ae2
--- /dev/null
@@ -0,0 +1,11 @@
+{
+  "env": {
+    "browser": true,
+    "node": true
+  },
+  "rules": {
+    "no-console": 0,
+    "no-empty": [1, { "allowEmptyCatch": true }]
+  },
+  "extends": "eslint:recommended"
+}
diff --git a/wrt/node_modules/send/node_modules/debug/.npmignore b/wrt/node_modules/send/node_modules/debug/.npmignore
new file mode 100644 (file)
index 0000000..5f60eec
--- /dev/null
@@ -0,0 +1,9 @@
+support
+test
+examples
+example
+*.sock
+dist
+yarn.lock
+coverage
+bower.json
diff --git a/wrt/node_modules/send/node_modules/debug/.travis.yml b/wrt/node_modules/send/node_modules/debug/.travis.yml
new file mode 100644 (file)
index 0000000..6c6090c
--- /dev/null
@@ -0,0 +1,14 @@
+
+language: node_js
+node_js:
+  - "6"
+  - "5"
+  - "4"
+
+install:
+  - make node_modules
+
+script:
+  - make lint
+  - make test
+  - make coveralls
diff --git a/wrt/node_modules/send/node_modules/debug/CHANGELOG.md b/wrt/node_modules/send/node_modules/debug/CHANGELOG.md
new file mode 100644 (file)
index 0000000..a1a270c
--- /dev/null
@@ -0,0 +1,357 @@
+
+2.6.8 / 2017-05-18
+==================
+
+  * Fix: Check for undefined on browser globals (#462, @marbemac)
+
+2.6.7 / 2017-05-16
+==================
+
+  * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom)
+  * Fix: Inline extend function in node implementation (#452, @dougwilson)
+  * Docs: Fix typo (#455, @msasad)
+
+2.6.5 / 2017-04-27
+==================
+  
+  * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek)
+  * Misc: clean up browser reference checks (#447, @thebigredgeek)
+  * Misc: add npm-debug.log to .gitignore (@thebigredgeek)
+
+
+2.6.4 / 2017-04-20
+==================
+
+  * Fix: bug that would occure if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo)
+  * Chore: ignore bower.json in npm installations. (#437, @joaovieira)
+  * Misc: update "ms" to v0.7.3 (@tootallnate)
+
+2.6.3 / 2017-03-13
+==================
+
+  * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts)
+  * Docs: Changelog fix (@thebigredgeek)
+
+2.6.2 / 2017-03-10
+==================
+
+  * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin)
+  * Docs: Add backers and sponsors from Open Collective (#422, @piamancini)
+  * Docs: Add Slackin invite badge (@tootallnate)
+
+2.6.1 / 2017-02-10
+==================
+
+  * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error
+  * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0)
+  * Fix: IE8 "Expected identifier" error (#414, @vgoma)
+  * Fix: Namespaces would not disable once enabled (#409, @musikov)
+
+2.6.0 / 2016-12-28
+==================
+
+  * Fix: added better null pointer checks for browser useColors (@thebigredgeek)
+  * Improvement: removed explicit `window.debug` export (#404, @tootallnate)
+  * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate)
+
+2.5.2 / 2016-12-25
+==================
+
+  * Fix: reference error on window within webworkers (#393, @KlausTrainer)
+  * Docs: fixed README typo (#391, @lurch)
+  * Docs: added notice about v3 api discussion (@thebigredgeek)
+
+2.5.1 / 2016-12-20
+==================
+
+  * Fix: babel-core compatibility
+
+2.5.0 / 2016-12-20
+==================
+
+  * Fix: wrong reference in bower file (@thebigredgeek)
+  * Fix: webworker compatibility (@thebigredgeek)
+  * Fix: output formatting issue (#388, @kribblo)
+  * Fix: babel-loader compatibility (#383, @escwald)
+  * Misc: removed built asset from repo and publications (@thebigredgeek)
+  * Misc: moved source files to /src (#378, @yamikuronue)
+  * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue)
+  * Test: coveralls integration (#378, @yamikuronue)
+  * Docs: simplified language in the opening paragraph (#373, @yamikuronue)
+
+2.4.5 / 2016-12-17
+==================
+
+  * Fix: `navigator` undefined in Rhino (#376, @jochenberger)
+  * Fix: custom log function (#379, @hsiliev)
+  * Improvement: bit of cleanup + linting fixes (@thebigredgeek)
+  * Improvement: rm non-maintainted `dist/` dir (#375, @freewil)
+  * Docs: simplified language in the opening paragraph. (#373, @yamikuronue)
+
+2.4.4 / 2016-12-14
+==================
+
+  * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts)
+
+2.4.3 / 2016-12-14
+==================
+
+  * Fix: navigation.userAgent error for react native (#364, @escwald)
+
+2.4.2 / 2016-12-14
+==================
+
+  * Fix: browser colors (#367, @tootallnate)
+  * Misc: travis ci integration (@thebigredgeek)
+  * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek)
+
+2.4.1 / 2016-12-13
+==================
+
+  * Fix: typo that broke the package (#356)
+
+2.4.0 / 2016-12-13
+==================
+
+  * Fix: bower.json references unbuilt src entry point (#342, @justmatt)
+  * Fix: revert "handle regex special characters" (@tootallnate)
+  * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate)
+  * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate)
+  * Improvement: allow colors in workers (#335, @botverse)
+  * Improvement: use same color for same namespace. (#338, @lchenay)
+
+2.3.3 / 2016-11-09
+==================
+
+  * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne)
+  * Fix: Returning `localStorage` saved values (#331, Levi Thomason)
+  * Improvement: Don't create an empty object when no `process` (Nathan Rajlich)
+
+2.3.2 / 2016-11-09
+==================
+
+  * Fix: be super-safe in index.js as well (@TooTallNate)
+  * Fix: should check whether process exists (Tom Newby)
+
+2.3.1 / 2016-11-09
+==================
+
+  * Fix: Added electron compatibility (#324, @paulcbetts)
+  * Improvement: Added performance optimizations (@tootallnate)
+  * Readme: Corrected PowerShell environment variable example (#252, @gimre)
+  * Misc: Removed yarn lock file from source control (#321, @fengmk2)
+
+2.3.0 / 2016-11-07
+==================
+
+  * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic)
+  * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos)
+  * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15)
+  * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran)
+  * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom)
+  * Package: Update "ms" to 0.7.2 (#315, @DevSide)
+  * Package: removed superfluous version property from bower.json (#207 @kkirsche)
+  * Readme: fix USE_COLORS to DEBUG_COLORS
+  * Readme: Doc fixes for format string sugar (#269, @mlucool)
+  * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0)
+  * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable)
+  * Readme: better docs for browser support (#224, @matthewmueller)
+  * Tooling: Added yarn integration for development (#317, @thebigredgeek)
+  * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek)
+  * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman)
+  * Misc: Updated contributors (@thebigredgeek)
+
+2.2.0 / 2015-05-09
+==================
+
+  * package: update "ms" to v0.7.1 (#202, @dougwilson)
+  * README: add logging to file example (#193, @DanielOchoa)
+  * README: fixed a typo (#191, @amir-s)
+  * browser: expose `storage` (#190, @stephenmathieson)
+  * Makefile: add a `distclean` target (#189, @stephenmathieson)
+
+2.1.3 / 2015-03-13
+==================
+
+  * Updated stdout/stderr example (#186)
+  * Updated example/stdout.js to match debug current behaviour
+  * Renamed example/stderr.js to stdout.js
+  * Update Readme.md (#184)
+  * replace high intensity foreground color for bold (#182, #183)
+
+2.1.2 / 2015-03-01
+==================
+
+  * dist: recompile
+  * update "ms" to v0.7.0
+  * package: update "browserify" to v9.0.3
+  * component: fix "ms.js" repo location
+  * changed bower package name
+  * updated documentation about using debug in a browser
+  * fix: security error on safari (#167, #168, @yields)
+
+2.1.1 / 2014-12-29
+==================
+
+  * browser: use `typeof` to check for `console` existence
+  * browser: check for `console.log` truthiness (fix IE 8/9)
+  * browser: add support for Chrome apps
+  * Readme: added Windows usage remarks
+  * Add `bower.json` to properly support bower install
+
+2.1.0 / 2014-10-15
+==================
+
+  * node: implement `DEBUG_FD` env variable support
+  * package: update "browserify" to v6.1.0
+  * package: add "license" field to package.json (#135, @panuhorsmalahti)
+
+2.0.0 / 2014-09-01
+==================
+
+  * package: update "browserify" to v5.11.0
+  * node: use stderr rather than stdout for logging (#29, @stephenmathieson)
+
+1.0.4 / 2014-07-15
+==================
+
+  * dist: recompile
+  * example: remove `console.info()` log usage
+  * example: add "Content-Type" UTF-8 header to browser example
+  * browser: place %c marker after the space character
+  * browser: reset the "content" color via `color: inherit`
+  * browser: add colors support for Firefox >= v31
+  * debug: prefer an instance `log()` function over the global one (#119)
+  * Readme: update documentation about styled console logs for FF v31 (#116, @wryk)
+
+1.0.3 / 2014-07-09
+==================
+
+  * Add support for multiple wildcards in namespaces (#122, @seegno)
+  * browser: fix lint
+
+1.0.2 / 2014-06-10
+==================
+
+  * browser: update color palette (#113, @gscottolson)
+  * common: make console logging function configurable (#108, @timoxley)
+  * node: fix %o colors on old node <= 0.8.x
+  * Makefile: find node path using shell/which (#109, @timoxley)
+
+1.0.1 / 2014-06-06
+==================
+
+  * browser: use `removeItem()` to clear localStorage
+  * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777)
+  * package: add "contributors" section
+  * node: fix comment typo
+  * README: list authors
+
+1.0.0 / 2014-06-04
+==================
+
+  * make ms diff be global, not be scope
+  * debug: ignore empty strings in enable()
+  * node: make DEBUG_COLORS able to disable coloring
+  * *: export the `colors` array
+  * npmignore: don't publish the `dist` dir
+  * Makefile: refactor to use browserify
+  * package: add "browserify" as a dev dependency
+  * Readme: add Web Inspector Colors section
+  * node: reset terminal color for the debug content
+  * node: map "%o" to `util.inspect()`
+  * browser: map "%j" to `JSON.stringify()`
+  * debug: add custom "formatters"
+  * debug: use "ms" module for humanizing the diff
+  * Readme: add "bash" syntax highlighting
+  * browser: add Firebug color support
+  * browser: add colors for WebKit browsers
+  * node: apply log to `console`
+  * rewrite: abstract common logic for Node & browsers
+  * add .jshintrc file
+
+0.8.1 / 2014-04-14
+==================
+
+  * package: re-add the "component" section
+
+0.8.0 / 2014-03-30
+==================
+
+  * add `enable()` method for nodejs. Closes #27
+  * change from stderr to stdout
+  * remove unnecessary index.js file
+
+0.7.4 / 2013-11-13
+==================
+
+  * remove "browserify" key from package.json (fixes something in browserify)
+
+0.7.3 / 2013-10-30
+==================
+
+  * fix: catch localStorage security error when cookies are blocked (Chrome)
+  * add debug(err) support. Closes #46
+  * add .browser prop to package.json. Closes #42
+
+0.7.2 / 2013-02-06
+==================
+
+  * fix package.json
+  * fix: Mobile Safari (private mode) is broken with debug
+  * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript
+
+0.7.1 / 2013-02-05
+==================
+
+  * add repository URL to package.json
+  * add DEBUG_COLORED to force colored output
+  * add browserify support
+  * fix component. Closes #24
+
+0.7.0 / 2012-05-04
+==================
+
+  * Added .component to package.json
+  * Added debug.component.js build
+
+0.6.0 / 2012-03-16
+==================
+
+  * Added support for "-" prefix in DEBUG [Vinay Pulim]
+  * Added `.enabled` flag to the node version [TooTallNate]
+
+0.5.0 / 2012-02-02
+==================
+
+  * Added: humanize diffs. Closes #8
+  * Added `debug.disable()` to the CS variant
+  * Removed padding. Closes #10
+  * Fixed: persist client-side variant again. Closes #9
+
+0.4.0 / 2012-02-01
+==================
+
+  * Added browser variant support for older browsers [TooTallNate]
+  * Added `debug.enable('project:*')` to browser variant [TooTallNate]
+  * Added padding to diff (moved it to the right)
+
+0.3.0 / 2012-01-26
+==================
+
+  * Added millisecond diff when isatty, otherwise UTC string
+
+0.2.0 / 2012-01-22
+==================
+
+  * Added wildcard support
+
+0.1.0 / 2011-12-02
+==================
+
+  * Added: remove colors unless stderr isatty [TooTallNate]
+
+0.0.1 / 2010-01-03
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/send/node_modules/debug/LICENSE b/wrt/node_modules/send/node_modules/debug/LICENSE
new file mode 100644 (file)
index 0000000..658c933
--- /dev/null
@@ -0,0 +1,19 @@
+(The MIT License)
+
+Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software 
+and associated documentation files (the 'Software'), to deal in the Software without restriction, 
+including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial 
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 
+LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/wrt/node_modules/send/node_modules/debug/Makefile b/wrt/node_modules/send/node_modules/debug/Makefile
new file mode 100644 (file)
index 0000000..584da8b
--- /dev/null
@@ -0,0 +1,50 @@
+# get Makefile directory name: http://stackoverflow.com/a/5982798/376773
+THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
+THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)
+
+# BIN directory
+BIN := $(THIS_DIR)/node_modules/.bin
+
+# Path
+PATH := node_modules/.bin:$(PATH)
+SHELL := /bin/bash
+
+# applications
+NODE ?= $(shell which node)
+YARN ?= $(shell which yarn)
+PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm))
+BROWSERIFY ?= $(NODE) $(BIN)/browserify
+
+.FORCE:
+
+install: node_modules
+
+node_modules: package.json
+       @NODE_ENV= $(PKG) install
+       @touch node_modules
+
+lint: .FORCE
+       eslint browser.js debug.js index.js node.js
+
+test-node: .FORCE
+       istanbul cover node_modules/mocha/bin/_mocha -- test/**.js
+
+test-browser: .FORCE
+       mkdir -p dist
+
+       @$(BROWSERIFY) \
+               --standalone debug \
+               . > dist/debug.js
+
+       karma start --single-run
+       rimraf dist
+
+test: .FORCE
+       concurrently \
+               "make test-node" \
+               "make test-browser"
+
+coveralls:
+       cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
+
+.PHONY: all install clean distclean
diff --git a/wrt/node_modules/send/node_modules/debug/README.md b/wrt/node_modules/send/node_modules/debug/README.md
new file mode 100644 (file)
index 0000000..f67be6b
--- /dev/null
@@ -0,0 +1,312 @@
+# debug
+[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug)  [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master)  [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) 
+[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors)
+
+
+
+A tiny node.js debugging utility modelled after node core's debugging technique.
+
+**Discussion around the V3 API is under way [here](https://github.com/visionmedia/debug/issues/370)**
+
+## Installation
+
+```bash
+$ npm install debug
+```
+
+## Usage
+
+`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole.
+
+Example _app.js_:
+
+```js
+var debug = require('debug')('http')
+  , http = require('http')
+  , name = 'My App';
+
+// fake app
+
+debug('booting %s', name);
+
+http.createServer(function(req, res){
+  debug(req.method + ' ' + req.url);
+  res.end('hello\n');
+}).listen(3000, function(){
+  debug('listening');
+});
+
+// fake worker of some kind
+
+require('./worker');
+```
+
+Example _worker.js_:
+
+```js
+var debug = require('debug')('worker');
+
+setInterval(function(){
+  debug('doing some work');
+}, 1000);
+```
+
+ The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:
+
+  ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png)
+
+  ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png)
+
+#### Windows note
+
+ On Windows the environment variable is set using the `set` command.
+
+ ```cmd
+ set DEBUG=*,-not_this
+ ```
+
+ Note that PowerShell uses different syntax to set environment variables.
+
+ ```cmd
+ $env:DEBUG = "*,-not_this"
+  ```
+
+Then, run the program to be debugged as usual.
+
+## Millisecond diff
+
+  When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.
+
+  ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png)
+
+  When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:
+
+  ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png)
+
+## Conventions
+
+  If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser".
+
+## Wildcards
+
+  The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.
+
+  You can also exclude specific debuggers by prefixing them with a "-" character.  For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:".
+
+## Environment Variables
+
+  When running through Node.js, you can set a few environment variables that will
+  change the behavior of the debug logging:
+
+| Name      | Purpose                                         |
+|-----------|-------------------------------------------------|
+| `DEBUG`   | Enables/disables specific debugging namespaces. |
+| `DEBUG_COLORS`| Whether or not to use colors in the debug output. |
+| `DEBUG_DEPTH` | Object inspection depth. |
+| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. |
+
+
+  __Note:__ The environment variables beginning with `DEBUG_` end up being
+  converted into an Options object that gets used with `%o`/`%O` formatters.
+  See the Node.js documentation for
+  [`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options)
+  for the complete list.
+
+## Formatters
+
+
+  Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. Below are the officially supported formatters:
+
+| Formatter | Representation |
+|-----------|----------------|
+| `%O`      | Pretty-print an Object on multiple lines. |
+| `%o`      | Pretty-print an Object all on a single line. |
+| `%s`      | String. |
+| `%d`      | Number (both integer and float). |
+| `%j`      | JSON. Replaced with the string '[Circular]' if the argument contains circular references. |
+| `%%`      | Single percent sign ('%'). This does not consume an argument. |
+
+### Custom formatters
+
+  You can add custom formatters by extending the `debug.formatters` object. For example, if you wanted to add support for rendering a Buffer as hex with `%h`, you could do something like:
+
+```js
+const createDebug = require('debug')
+createDebug.formatters.h = (v) => {
+  return v.toString('hex')
+}
+
+// …elsewhere
+const debug = createDebug('foo')
+debug('this is hex: %h', new Buffer('hello world'))
+//   foo this is hex: 68656c6c6f20776f726c6421 +0ms
+```
+
+## Browser support
+  You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify),
+  or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest),
+  if you don't want to build it yourself.
+
+  Debug's enable state is currently persisted by `localStorage`.
+  Consider the situation shown below where you have `worker:a` and `worker:b`,
+  and wish to debug both. You can enable this using `localStorage.debug`:
+
+```js
+localStorage.debug = 'worker:*'
+```
+
+And then refresh the page.
+
+```js
+a = debug('worker:a');
+b = debug('worker:b');
+
+setInterval(function(){
+  a('doing some work');
+}, 1000);
+
+setInterval(function(){
+  b('doing some work');
+}, 1200);
+```
+
+#### Web Inspector Colors
+
+  Colors are also enabled on "Web Inspectors" that understand the `%c` formatting
+  option. These are WebKit web inspectors, Firefox ([since version
+  31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))
+  and the Firebug plugin for Firefox (any version).
+
+  Colored output looks something like:
+
+  ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png)
+
+
+## Output streams
+
+  By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method:
+
+Example _stdout.js_:
+
+```js
+var debug = require('debug');
+var error = debug('app:error');
+
+// by default stderr is used
+error('goes to stderr!');
+
+var log = debug('app:log');
+// set this namespace to log via console.log
+log.log = console.log.bind(console); // don't forget to bind to console!
+log('goes to stdout');
+error('still goes to stderr!');
+
+// set all output to go via console.info
+// overrides all per-namespace log settings
+debug.log = console.info.bind(console);
+error('now goes to stdout via console.info');
+log('still goes to stdout, but via console.info now');
+```
+
+
+## Authors
+
+ - TJ Holowaychuk
+ - Nathan Rajlich
+ - Andrew Rhyne
+## Backers
+
+Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)]
+
+<a href="https://opencollective.com/debug/backer/0/website" target="_blank"><img src="https://opencollective.com/debug/backer/0/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/1/website" target="_blank"><img src="https://opencollective.com/debug/backer/1/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/2/website" target="_blank"><img src="https://opencollective.com/debug/backer/2/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/3/website" target="_blank"><img src="https://opencollective.com/debug/backer/3/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/4/website" target="_blank"><img src="https://opencollective.com/debug/backer/4/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/5/website" target="_blank"><img src="https://opencollective.com/debug/backer/5/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/6/website" target="_blank"><img src="https://opencollective.com/debug/backer/6/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/7/website" target="_blank"><img src="https://opencollective.com/debug/backer/7/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/8/website" target="_blank"><img src="https://opencollective.com/debug/backer/8/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/9/website" target="_blank"><img src="https://opencollective.com/debug/backer/9/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/10/website" target="_blank"><img src="https://opencollective.com/debug/backer/10/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/11/website" target="_blank"><img src="https://opencollective.com/debug/backer/11/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/12/website" target="_blank"><img src="https://opencollective.com/debug/backer/12/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/13/website" target="_blank"><img src="https://opencollective.com/debug/backer/13/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/14/website" target="_blank"><img src="https://opencollective.com/debug/backer/14/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/15/website" target="_blank"><img src="https://opencollective.com/debug/backer/15/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/16/website" target="_blank"><img src="https://opencollective.com/debug/backer/16/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/17/website" target="_blank"><img src="https://opencollective.com/debug/backer/17/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/18/website" target="_blank"><img src="https://opencollective.com/debug/backer/18/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/19/website" target="_blank"><img src="https://opencollective.com/debug/backer/19/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/20/website" target="_blank"><img src="https://opencollective.com/debug/backer/20/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/21/website" target="_blank"><img src="https://opencollective.com/debug/backer/21/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/22/website" target="_blank"><img src="https://opencollective.com/debug/backer/22/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/23/website" target="_blank"><img src="https://opencollective.com/debug/backer/23/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/24/website" target="_blank"><img src="https://opencollective.com/debug/backer/24/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/25/website" target="_blank"><img src="https://opencollective.com/debug/backer/25/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/26/website" target="_blank"><img src="https://opencollective.com/debug/backer/26/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/27/website" target="_blank"><img src="https://opencollective.com/debug/backer/27/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/28/website" target="_blank"><img src="https://opencollective.com/debug/backer/28/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/29/website" target="_blank"><img src="https://opencollective.com/debug/backer/29/avatar.svg"></a>
+
+
+## Sponsors
+
+Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)]
+
+<a href="https://opencollective.com/debug/sponsor/0/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/0/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/1/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/1/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/2/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/2/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/3/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/3/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/4/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/4/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/5/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/5/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/6/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/6/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/7/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/7/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/8/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/8/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/9/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/9/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/10/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/10/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/11/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/11/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/12/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/12/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/13/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/13/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/14/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/14/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/15/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/15/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/16/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/16/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/17/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/17/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/18/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/18/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/19/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/19/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/20/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/20/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/21/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/21/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/22/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/22/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/23/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/23/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/24/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/24/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/25/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/25/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/26/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/26/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/27/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/27/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/28/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/28/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/29/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/29/avatar.svg"></a>
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2014-2016 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/send/node_modules/debug/component.json b/wrt/node_modules/send/node_modules/debug/component.json
new file mode 100644 (file)
index 0000000..94cd36d
--- /dev/null
@@ -0,0 +1,19 @@
+{
+  "name": "debug",
+  "repo": "visionmedia/debug",
+  "description": "small debugging utility",
+  "version": "2.6.8",
+  "keywords": [
+    "debug",
+    "log",
+    "debugger"
+  ],
+  "main": "src/browser.js",
+  "scripts": [
+    "src/browser.js",
+    "src/debug.js"
+  ],
+  "dependencies": {
+    "rauchg/ms.js": "0.7.1"
+  }
+}
diff --git a/wrt/node_modules/send/node_modules/debug/karma.conf.js b/wrt/node_modules/send/node_modules/debug/karma.conf.js
new file mode 100644 (file)
index 0000000..103a82d
--- /dev/null
@@ -0,0 +1,70 @@
+// Karma configuration
+// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC)
+
+module.exports = function(config) {
+  config.set({
+
+    // base path that will be used to resolve all patterns (eg. files, exclude)
+    basePath: '',
+
+
+    // frameworks to use
+    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
+    frameworks: ['mocha', 'chai', 'sinon'],
+
+
+    // list of files / patterns to load in the browser
+    files: [
+      'dist/debug.js',
+      'test/*spec.js'
+    ],
+
+
+    // list of files to exclude
+    exclude: [
+      'src/node.js'
+    ],
+
+
+    // preprocess matching files before serving them to the browser
+    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
+    preprocessors: {
+    },
+
+    // test results reporter to use
+    // possible values: 'dots', 'progress'
+    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
+    reporters: ['progress'],
+
+
+    // web server port
+    port: 9876,
+
+
+    // enable / disable colors in the output (reporters and logs)
+    colors: true,
+
+
+    // level of logging
+    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
+    logLevel: config.LOG_INFO,
+
+
+    // enable / disable watching file and executing tests whenever any file changes
+    autoWatch: true,
+
+
+    // start these browsers
+    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
+    browsers: ['PhantomJS'],
+
+
+    // Continuous Integration mode
+    // if true, Karma captures browsers, runs the tests and exits
+    singleRun: false,
+
+    // Concurrency level
+    // how many browser should be started simultaneous
+    concurrency: Infinity
+  })
+}
diff --git a/wrt/node_modules/send/node_modules/debug/node.js b/wrt/node_modules/send/node_modules/debug/node.js
new file mode 100644 (file)
index 0000000..7fc36fe
--- /dev/null
@@ -0,0 +1 @@
+module.exports = require('./src/node');
diff --git a/wrt/node_modules/send/node_modules/debug/package.json b/wrt/node_modules/send/node_modules/debug/package.json
new file mode 100644 (file)
index 0000000..024beb6
--- /dev/null
@@ -0,0 +1,136 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "debug@2.6.8",
+        "scope": null,
+        "escapedName": "debug",
+        "name": "debug",
+        "rawSpec": "2.6.8",
+        "spec": "2.6.8",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express"
+    ],
+    [
+      {
+        "raw": "debug@2.6.8",
+        "scope": null,
+        "escapedName": "debug",
+        "name": "debug",
+        "rawSpec": "2.6.8",
+        "spec": "2.6.8",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/send"
+    ]
+  ],
+  "_from": "debug@2.6.8",
+  "_id": "debug@2.6.8",
+  "_inCache": true,
+  "_location": "/send/debug",
+  "_nodeVersion": "7.10.0",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/debug-2.6.8.tgz_1495138020906_0.5965513256378472"
+  },
+  "_npmUser": {
+    "name": "tootallnate",
+    "email": "nathan@tootallnate.net"
+  },
+  "_npmVersion": "4.2.0",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "debug@2.6.8",
+    "scope": null,
+    "escapedName": "debug",
+    "name": "debug",
+    "rawSpec": "2.6.8",
+    "spec": "2.6.8",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/send"
+  ],
+  "_resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz",
+  "_shasum": "e731531ca2ede27d188222427da17821d68ff4fc",
+  "_shrinkwrap": null,
+  "_spec": "debug@2.6.8",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/send",
+  "author": {
+    "name": "TJ Holowaychuk",
+    "email": "tj@vision-media.ca"
+  },
+  "browser": "./src/browser.js",
+  "bugs": {
+    "url": "https://github.com/visionmedia/debug/issues"
+  },
+  "component": {
+    "scripts": {
+      "debug/index.js": "browser.js",
+      "debug/debug.js": "debug.js"
+    }
+  },
+  "contributors": [
+    {
+      "name": "Nathan Rajlich",
+      "email": "nathan@tootallnate.net",
+      "url": "http://n8.io"
+    },
+    {
+      "name": "Andrew Rhyne",
+      "email": "rhyneandrew@gmail.com"
+    }
+  ],
+  "dependencies": {
+    "ms": "2.0.0"
+  },
+  "description": "small debugging utility",
+  "devDependencies": {
+    "browserify": "9.0.3",
+    "chai": "^3.5.0",
+    "concurrently": "^3.1.0",
+    "coveralls": "^2.11.15",
+    "eslint": "^3.12.1",
+    "istanbul": "^0.4.5",
+    "karma": "^1.3.0",
+    "karma-chai": "^0.1.0",
+    "karma-mocha": "^1.3.0",
+    "karma-phantomjs-launcher": "^1.0.2",
+    "karma-sinon": "^1.0.5",
+    "mocha": "^3.2.0",
+    "mocha-lcov-reporter": "^1.2.0",
+    "rimraf": "^2.5.4",
+    "sinon": "^1.17.6",
+    "sinon-chai": "^2.8.0"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "e731531ca2ede27d188222427da17821d68ff4fc",
+    "tarball": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz"
+  },
+  "gitHead": "52e1f21284322f167839e5d3a60f635c8b2dc842",
+  "homepage": "https://github.com/visionmedia/debug#readme",
+  "keywords": [
+    "debug",
+    "log",
+    "debugger"
+  ],
+  "license": "MIT",
+  "main": "./src/index.js",
+  "maintainers": [
+    {
+      "name": "thebigredgeek",
+      "email": "rhyneandrew@gmail.com"
+    }
+  ],
+  "name": "debug",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/visionmedia/debug.git"
+  },
+  "scripts": {},
+  "version": "2.6.8"
+}
diff --git a/wrt/node_modules/send/node_modules/debug/src/browser.js b/wrt/node_modules/send/node_modules/debug/src/browser.js
new file mode 100644 (file)
index 0000000..7106924
--- /dev/null
@@ -0,0 +1,185 @@
+/**
+ * This is the web browser implementation of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = require('./debug');
+exports.log = log;
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+exports.storage = 'undefined' != typeof chrome
+               && 'undefined' != typeof chrome.storage
+                  ? chrome.storage.local
+                  : localstorage();
+
+/**
+ * Colors.
+ */
+
+exports.colors = [
+  'lightseagreen',
+  'forestgreen',
+  'goldenrod',
+  'dodgerblue',
+  'darkorchid',
+  'crimson'
+];
+
+/**
+ * Currently only WebKit-based Web Inspectors, Firefox >= v31,
+ * and the Firebug extension (any Firefox version) are known
+ * to support "%c" CSS customizations.
+ *
+ * TODO: add a `localStorage` variable to explicitly enable/disable colors
+ */
+
+function useColors() {
+  // NB: In an Electron preload script, document will be defined but not fully
+  // initialized. Since we know we're in Chrome, we'll just detect this case
+  // explicitly
+  if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
+    return true;
+  }
+
+  // is webkit? http://stackoverflow.com/a/16459606/376773
+  // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
+  return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
+    // is firebug? http://stackoverflow.com/a/398120/376773
+    (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
+    // is firefox >= v31?
+    // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
+    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
+    // double check webkit in userAgent just in case we are in a worker
+    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
+}
+
+/**
+ * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
+ */
+
+exports.formatters.j = function(v) {
+  try {
+    return JSON.stringify(v);
+  } catch (err) {
+    return '[UnexpectedJSONParseError]: ' + err.message;
+  }
+};
+
+
+/**
+ * Colorize log arguments if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+  var useColors = this.useColors;
+
+  args[0] = (useColors ? '%c' : '')
+    + this.namespace
+    + (useColors ? ' %c' : ' ')
+    + args[0]
+    + (useColors ? '%c ' : ' ')
+    + '+' + exports.humanize(this.diff);
+
+  if (!useColors) return;
+
+  var c = 'color: ' + this.color;
+  args.splice(1, 0, c, 'color: inherit')
+
+  // the final "%c" is somewhat tricky, because there could be other
+  // arguments passed either before or after the %c, so we need to
+  // figure out the correct index to insert the CSS into
+  var index = 0;
+  var lastC = 0;
+  args[0].replace(/%[a-zA-Z%]/g, function(match) {
+    if ('%%' === match) return;
+    index++;
+    if ('%c' === match) {
+      // we only are interested in the *last* %c
+      // (the user may have provided their own)
+      lastC = index;
+    }
+  });
+
+  args.splice(lastC, 0, c);
+}
+
+/**
+ * Invokes `console.log()` when available.
+ * No-op when `console.log` is not a "function".
+ *
+ * @api public
+ */
+
+function log() {
+  // this hackery is required for IE8/9, where
+  // the `console.log` function doesn't have 'apply'
+  return 'object' === typeof console
+    && console.log
+    && Function.prototype.apply.call(console.log, console, arguments);
+}
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+
+function save(namespaces) {
+  try {
+    if (null == namespaces) {
+      exports.storage.removeItem('debug');
+    } else {
+      exports.storage.debug = namespaces;
+    }
+  } catch(e) {}
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+
+function load() {
+  var r;
+  try {
+    r = exports.storage.debug;
+  } catch(e) {}
+
+  // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
+  if (!r && typeof process !== 'undefined' && 'env' in process) {
+    r = process.env.DEBUG;
+  }
+
+  return r;
+}
+
+/**
+ * Enable namespaces listed in `localStorage.debug` initially.
+ */
+
+exports.enable(load());
+
+/**
+ * Localstorage attempts to return the localstorage.
+ *
+ * This is necessary because safari throws
+ * when a user disables cookies/localstorage
+ * and you attempt to access it.
+ *
+ * @return {LocalStorage}
+ * @api private
+ */
+
+function localstorage() {
+  try {
+    return window.localStorage;
+  } catch (e) {}
+}
diff --git a/wrt/node_modules/send/node_modules/debug/src/debug.js b/wrt/node_modules/send/node_modules/debug/src/debug.js
new file mode 100644 (file)
index 0000000..6a5e3fc
--- /dev/null
@@ -0,0 +1,202 @@
+
+/**
+ * This is the common logic for both the Node.js and web browser
+ * implementations of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
+exports.coerce = coerce;
+exports.disable = disable;
+exports.enable = enable;
+exports.enabled = enabled;
+exports.humanize = require('ms');
+
+/**
+ * The currently active debug mode names, and names to skip.
+ */
+
+exports.names = [];
+exports.skips = [];
+
+/**
+ * Map of special "%n" handling functions, for the debug "format" argument.
+ *
+ * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
+ */
+
+exports.formatters = {};
+
+/**
+ * Previous log timestamp.
+ */
+
+var prevTime;
+
+/**
+ * Select a color.
+ * @param {String} namespace
+ * @return {Number}
+ * @api private
+ */
+
+function selectColor(namespace) {
+  var hash = 0, i;
+
+  for (i in namespace) {
+    hash  = ((hash << 5) - hash) + namespace.charCodeAt(i);
+    hash |= 0; // Convert to 32bit integer
+  }
+
+  return exports.colors[Math.abs(hash) % exports.colors.length];
+}
+
+/**
+ * Create a debugger with the given `namespace`.
+ *
+ * @param {String} namespace
+ * @return {Function}
+ * @api public
+ */
+
+function createDebug(namespace) {
+
+  function debug() {
+    // disabled?
+    if (!debug.enabled) return;
+
+    var self = debug;
+
+    // set `diff` timestamp
+    var curr = +new Date();
+    var ms = curr - (prevTime || curr);
+    self.diff = ms;
+    self.prev = prevTime;
+    self.curr = curr;
+    prevTime = curr;
+
+    // turn the `arguments` into a proper Array
+    var args = new Array(arguments.length);
+    for (var i = 0; i < args.length; i++) {
+      args[i] = arguments[i];
+    }
+
+    args[0] = exports.coerce(args[0]);
+
+    if ('string' !== typeof args[0]) {
+      // anything else let's inspect with %O
+      args.unshift('%O');
+    }
+
+    // apply any `formatters` transformations
+    var index = 0;
+    args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
+      // if we encounter an escaped % then don't increase the array index
+      if (match === '%%') return match;
+      index++;
+      var formatter = exports.formatters[format];
+      if ('function' === typeof formatter) {
+        var val = args[index];
+        match = formatter.call(self, val);
+
+        // now we need to remove `args[index]` since it's inlined in the `format`
+        args.splice(index, 1);
+        index--;
+      }
+      return match;
+    });
+
+    // apply env-specific formatting (colors, etc.)
+    exports.formatArgs.call(self, args);
+
+    var logFn = debug.log || exports.log || console.log.bind(console);
+    logFn.apply(self, args);
+  }
+
+  debug.namespace = namespace;
+  debug.enabled = exports.enabled(namespace);
+  debug.useColors = exports.useColors();
+  debug.color = selectColor(namespace);
+
+  // env-specific initialization logic for debug instances
+  if ('function' === typeof exports.init) {
+    exports.init(debug);
+  }
+
+  return debug;
+}
+
+/**
+ * Enables a debug mode by namespaces. This can include modes
+ * separated by a colon and wildcards.
+ *
+ * @param {String} namespaces
+ * @api public
+ */
+
+function enable(namespaces) {
+  exports.save(namespaces);
+
+  exports.names = [];
+  exports.skips = [];
+
+  var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
+  var len = split.length;
+
+  for (var i = 0; i < len; i++) {
+    if (!split[i]) continue; // ignore empty strings
+    namespaces = split[i].replace(/\*/g, '.*?');
+    if (namespaces[0] === '-') {
+      exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
+    } else {
+      exports.names.push(new RegExp('^' + namespaces + '$'));
+    }
+  }
+}
+
+/**
+ * Disable debug output.
+ *
+ * @api public
+ */
+
+function disable() {
+  exports.enable('');
+}
+
+/**
+ * Returns true if the given mode name is enabled, false otherwise.
+ *
+ * @param {String} name
+ * @return {Boolean}
+ * @api public
+ */
+
+function enabled(name) {
+  var i, len;
+  for (i = 0, len = exports.skips.length; i < len; i++) {
+    if (exports.skips[i].test(name)) {
+      return false;
+    }
+  }
+  for (i = 0, len = exports.names.length; i < len; i++) {
+    if (exports.names[i].test(name)) {
+      return true;
+    }
+  }
+  return false;
+}
+
+/**
+ * Coerce `val`.
+ *
+ * @param {Mixed} val
+ * @return {Mixed}
+ * @api private
+ */
+
+function coerce(val) {
+  if (val instanceof Error) return val.stack || val.message;
+  return val;
+}
diff --git a/wrt/node_modules/send/node_modules/debug/src/index.js b/wrt/node_modules/send/node_modules/debug/src/index.js
new file mode 100644 (file)
index 0000000..e12cf4d
--- /dev/null
@@ -0,0 +1,10 @@
+/**
+ * Detect Electron renderer process, which is node, but we should
+ * treat as a browser.
+ */
+
+if (typeof process !== 'undefined' && process.type === 'renderer') {
+  module.exports = require('./browser.js');
+} else {
+  module.exports = require('./node.js');
+}
diff --git a/wrt/node_modules/send/node_modules/debug/src/node.js b/wrt/node_modules/send/node_modules/debug/src/node.js
new file mode 100644 (file)
index 0000000..af61297
--- /dev/null
@@ -0,0 +1,246 @@
+/**
+ * Module dependencies.
+ */
+
+var tty = require('tty');
+var util = require('util');
+
+/**
+ * This is the Node.js implementation of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = require('./debug');
+exports.init = init;
+exports.log = log;
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+
+/**
+ * Colors.
+ */
+
+exports.colors = [6, 2, 3, 4, 5, 1];
+
+/**
+ * Build up the default `inspectOpts` object from the environment variables.
+ *
+ *   $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
+ */
+
+exports.inspectOpts = Object.keys(process.env).filter(function (key) {
+  return /^debug_/i.test(key);
+}).reduce(function (obj, key) {
+  // camel-case
+  var prop = key
+    .substring(6)
+    .toLowerCase()
+    .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });
+
+  // coerce string value into JS value
+  var val = process.env[key];
+  if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
+  else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
+  else if (val === 'null') val = null;
+  else val = Number(val);
+
+  obj[prop] = val;
+  return obj;
+}, {});
+
+/**
+ * The file descriptor to write the `debug()` calls to.
+ * Set the `DEBUG_FD` env variable to override with another value. i.e.:
+ *
+ *   $ DEBUG_FD=3 node script.js 3>debug.log
+ */
+
+var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
+
+if (1 !== fd && 2 !== fd) {
+  util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')()
+}
+
+var stream = 1 === fd ? process.stdout :
+             2 === fd ? process.stderr :
+             createWritableStdioStream(fd);
+
+/**
+ * Is stdout a TTY? Colored output is enabled when `true`.
+ */
+
+function useColors() {
+  return 'colors' in exports.inspectOpts
+    ? Boolean(exports.inspectOpts.colors)
+    : tty.isatty(fd);
+}
+
+/**
+ * Map %o to `util.inspect()`, all on a single line.
+ */
+
+exports.formatters.o = function(v) {
+  this.inspectOpts.colors = this.useColors;
+  return util.inspect(v, this.inspectOpts)
+    .replace(/\s*\n\s*/g, ' ');
+};
+
+/**
+ * Map %o to `util.inspect()`, allowing multiple lines if needed.
+ */
+
+exports.formatters.O = function(v) {
+  this.inspectOpts.colors = this.useColors;
+  return util.inspect(v, this.inspectOpts);
+};
+
+/**
+ * Adds ANSI color escape codes if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+  var name = this.namespace;
+  var useColors = this.useColors;
+
+  if (useColors) {
+    var c = this.color;
+    var prefix = '  \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m';
+
+    args[0] = prefix + args[0].split('\n').join('\n' + prefix);
+    args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m');
+  } else {
+    args[0] = new Date().toUTCString()
+      + ' ' + name + ' ' + args[0];
+  }
+}
+
+/**
+ * Invokes `util.format()` with the specified arguments and writes to `stream`.
+ */
+
+function log() {
+  return stream.write(util.format.apply(util, arguments) + '\n');
+}
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+
+function save(namespaces) {
+  if (null == namespaces) {
+    // If you set a process.env field to null or undefined, it gets cast to the
+    // string 'null' or 'undefined'. Just delete instead.
+    delete process.env.DEBUG;
+  } else {
+    process.env.DEBUG = namespaces;
+  }
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+
+function load() {
+  return process.env.DEBUG;
+}
+
+/**
+ * Copied from `node/src/node.js`.
+ *
+ * XXX: It's lame that node doesn't expose this API out-of-the-box. It also
+ * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.
+ */
+
+function createWritableStdioStream (fd) {
+  var stream;
+  var tty_wrap = process.binding('tty_wrap');
+
+  // Note stream._type is used for test-module-load-list.js
+
+  switch (tty_wrap.guessHandleType(fd)) {
+    case 'TTY':
+      stream = new tty.WriteStream(fd);
+      stream._type = 'tty';
+
+      // Hack to have stream not keep the event loop alive.
+      // See https://github.com/joyent/node/issues/1726
+      if (stream._handle && stream._handle.unref) {
+        stream._handle.unref();
+      }
+      break;
+
+    case 'FILE':
+      var fs = require('fs');
+      stream = new fs.SyncWriteStream(fd, { autoClose: false });
+      stream._type = 'fs';
+      break;
+
+    case 'PIPE':
+    case 'TCP':
+      var net = require('net');
+      stream = new net.Socket({
+        fd: fd,
+        readable: false,
+        writable: true
+      });
+
+      // FIXME Should probably have an option in net.Socket to create a
+      // stream from an existing fd which is writable only. But for now
+      // we'll just add this hack and set the `readable` member to false.
+      // Test: ./node test/fixtures/echo.js < /etc/passwd
+      stream.readable = false;
+      stream.read = null;
+      stream._type = 'pipe';
+
+      // FIXME Hack to have stream not keep the event loop alive.
+      // See https://github.com/joyent/node/issues/1726
+      if (stream._handle && stream._handle.unref) {
+        stream._handle.unref();
+      }
+      break;
+
+    default:
+      // Probably an error on in uv_guess_handle()
+      throw new Error('Implement me. Unknown stream file type!');
+  }
+
+  // For supporting legacy API we put the FD here.
+  stream.fd = fd;
+
+  stream._isStdio = true;
+
+  return stream;
+}
+
+/**
+ * Init logic for `debug` instances.
+ *
+ * Create a new `inspectOpts` object in case `useColors` is set
+ * differently for a particular `debug` instance.
+ */
+
+function init (debug) {
+  debug.inspectOpts = {};
+
+  var keys = Object.keys(exports.inspectOpts);
+  for (var i = 0; i < keys.length; i++) {
+    debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
+  }
+}
+
+/**
+ * Enable namespaces listed in `process.env.DEBUG` initially.
+ */
+
+exports.enable(load());
diff --git a/wrt/node_modules/send/package.json b/wrt/node_modules/send/package.json
new file mode 100644 (file)
index 0000000..e105ed8
--- /dev/null
@@ -0,0 +1,141 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "send@0.15.4",
+        "scope": null,
+        "escapedName": "send",
+        "name": "send",
+        "rawSpec": "0.15.4",
+        "spec": "0.15.4",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express"
+    ]
+  ],
+  "_from": "send@0.15.4",
+  "_id": "send@0.15.4",
+  "_inCache": true,
+  "_location": "/send",
+  "_nodeVersion": "6.11.1",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/send-0.15.4.tgz_1501997109327_0.6382732526399195"
+  },
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "3.10.10",
+  "_phantomChildren": {
+    "ms": "2.0.0"
+  },
+  "_requested": {
+    "raw": "send@0.15.4",
+    "scope": null,
+    "escapedName": "send",
+    "name": "send",
+    "rawSpec": "0.15.4",
+    "spec": "0.15.4",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/express",
+    "/serve-static"
+  ],
+  "_resolved": "https://registry.npmjs.org/send/-/send-0.15.4.tgz",
+  "_shasum": "985faa3e284b0273c793364a35c6737bd93905b9",
+  "_shrinkwrap": null,
+  "_spec": "send@0.15.4",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express",
+  "author": {
+    "name": "TJ Holowaychuk",
+    "email": "tj@vision-media.ca"
+  },
+  "bugs": {
+    "url": "https://github.com/pillarjs/send/issues"
+  },
+  "contributors": [
+    {
+      "name": "Douglas Christopher Wilson",
+      "email": "doug@somethingdoug.com"
+    },
+    {
+      "name": "James Wyatt Cready",
+      "email": "jcready@gmail.com"
+    },
+    {
+      "name": "Jesús Leganés Combarro",
+      "email": "piranna@gmail.com"
+    }
+  ],
+  "dependencies": {
+    "debug": "2.6.8",
+    "depd": "~1.1.1",
+    "destroy": "~1.0.4",
+    "encodeurl": "~1.0.1",
+    "escape-html": "~1.0.3",
+    "etag": "~1.8.0",
+    "fresh": "0.5.0",
+    "http-errors": "~1.6.2",
+    "mime": "1.3.4",
+    "ms": "2.0.0",
+    "on-finished": "~2.3.0",
+    "range-parser": "~1.2.0",
+    "statuses": "~1.3.1"
+  },
+  "description": "Better streaming static file server with Range and conditional-GET support",
+  "devDependencies": {
+    "after": "0.8.2",
+    "eslint": "3.19.0",
+    "eslint-config-standard": "7.1.0",
+    "eslint-plugin-markdown": "1.0.0-beta.6",
+    "eslint-plugin-promise": "3.5.0",
+    "eslint-plugin-standard": "2.3.1",
+    "istanbul": "0.4.5",
+    "mocha": "2.5.3",
+    "supertest": "1.1.0"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "985faa3e284b0273c793364a35c6737bd93905b9",
+    "tarball": "https://registry.npmjs.org/send/-/send-0.15.4.tgz"
+  },
+  "engines": {
+    "node": ">= 0.8.0"
+  },
+  "files": [
+    "HISTORY.md",
+    "LICENSE",
+    "README.md",
+    "index.js"
+  ],
+  "gitHead": "bad2a468e4ff38c13ffb5a113ce74ba9a812f804",
+  "homepage": "https://github.com/pillarjs/send#readme",
+  "keywords": [
+    "static",
+    "file",
+    "server"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "name": "send",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/pillarjs/send.git"
+  },
+  "scripts": {
+    "lint": "eslint --plugin markdown --ext js,md .",
+    "test": "mocha --check-leaks --reporter spec --bail",
+    "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot"
+  },
+  "version": "0.15.4"
+}
diff --git a/wrt/node_modules/serve-static/HISTORY.md b/wrt/node_modules/serve-static/HISTORY.md
new file mode 100644 (file)
index 0000000..2f54467
--- /dev/null
@@ -0,0 +1,385 @@
+1.12.4 / 2017-08-05
+===================
+
+  * deps: send@0.15.4
+    - deps: debug@2.6.8
+    - deps: depd@~1.1.1
+    - deps: http-errors@~1.6.2
+
+1.12.3 / 2017-05-16
+===================
+
+  * deps: send@0.15.3
+    - deps: debug@2.6.7
+
+1.12.2 / 2017-04-26
+===================
+
+  * deps: send@0.15.2
+    - deps: debug@2.6.4
+
+1.12.1 / 2017-03-04
+===================
+
+  * deps: send@0.15.1
+    - Fix issue when `Date.parse` does not return `NaN` on invalid date
+    - Fix strict violation in broken environments
+
+1.12.0 / 2017-02-25
+===================
+
+  * Send complete HTML document in redirect response
+  * Set default CSP header in redirect response
+  * deps: send@0.15.0
+    - Fix false detection of `no-cache` request directive
+    - Fix incorrect result when `If-None-Match` has both `*` and ETags
+    - Fix weak `ETag` matching to match spec
+    - Remove usage of `res._headers` private field
+    - Support `If-Match` and `If-Unmodified-Since` headers
+    - Use `res.getHeaderNames()` when available
+    - Use `res.headersSent` when available
+    - deps: debug@2.6.1
+    - deps: etag@~1.8.0
+    - deps: fresh@0.5.0
+    - deps: http-errors@~1.6.1
+
+1.11.2 / 2017-01-23
+===================
+
+  * deps: send@0.14.2
+    - deps: http-errors@~1.5.1
+    - deps: ms@0.7.2
+    - deps: statuses@~1.3.1
+
+1.11.1 / 2016-06-10
+===================
+
+  * Fix redirect error when `req.url` contains raw non-URL characters
+  * deps: send@0.14.1
+
+1.11.0 / 2016-06-07
+===================
+
+  * Use status code 301 for redirects
+  * deps: send@0.14.0
+    - Add `acceptRanges` option
+    - Add `cacheControl` option
+    - Attempt to combine multiple ranges into single range
+    - Correctly inherit from `Stream` class
+    - Fix `Content-Range` header in 416 responses when using `start`/`end` options
+    - Fix `Content-Range` header missing from default 416 responses
+    - Ignore non-byte `Range` headers
+    - deps: http-errors@~1.5.0
+    - deps: range-parser@~1.2.0
+    - deps: statuses@~1.3.0
+    - perf: remove argument reassignment
+
+1.10.3 / 2016-05-30
+===================
+
+  * deps: send@0.13.2
+    - Fix invalid `Content-Type` header when `send.mime.default_type` unset
+
+1.10.2 / 2016-01-19
+===================
+
+  * deps: parseurl@~1.3.1
+    - perf: enable strict mode
+
+1.10.1 / 2016-01-16
+===================
+
+  * deps: escape-html@~1.0.3
+    - perf: enable strict mode
+    - perf: optimize string replacement
+    - perf: use faster string coercion
+  * deps: send@0.13.1
+    - deps: depd@~1.1.0
+    - deps: destroy@~1.0.4
+    - deps: escape-html@~1.0.3
+    - deps: range-parser@~1.0.3
+
+1.10.0 / 2015-06-17
+===================
+
+  * Add `fallthrough` option
+    - Allows declaring this middleware is the final destination
+    - Provides better integration with Express patterns
+  * Fix reading options from options prototype
+  * Improve the default redirect response headers
+  * deps: escape-html@1.0.2
+  * deps: send@0.13.0
+    - Allow Node.js HTTP server to set `Date` response header
+    - Fix incorrectly removing `Content-Location` on 304 response
+    - Improve the default redirect response headers
+    - Send appropriate headers on default error response
+    - Use `http-errors` for standard emitted errors
+    - Use `statuses` instead of `http` module for status messages
+    - deps: escape-html@1.0.2
+    - deps: etag@~1.7.0
+    - deps: fresh@0.3.0
+    - deps: on-finished@~2.3.0
+    - perf: enable strict mode
+    - perf: remove unnecessary array allocations
+  * perf: enable strict mode
+  * perf: remove argument reassignment
+
+1.9.3 / 2015-05-14
+==================
+
+  * deps: send@0.12.3
+    - deps: debug@~2.2.0
+    - deps: depd@~1.0.1
+    - deps: etag@~1.6.0
+    - deps: ms@0.7.1
+    - deps: on-finished@~2.2.1
+
+1.9.2 / 2015-03-14
+==================
+
+  * deps: send@0.12.2
+    - Throw errors early for invalid `extensions` or `index` options
+    - deps: debug@~2.1.3
+
+1.9.1 / 2015-02-17
+==================
+
+  * deps: send@0.12.1
+    - Fix regression sending zero-length files
+
+1.9.0 / 2015-02-16
+==================
+
+  * deps: send@0.12.0
+    - Always read the stat size from the file
+    - Fix mutating passed-in `options`
+    - deps: mime@1.3.4
+
+1.8.1 / 2015-01-20
+==================
+
+  * Fix redirect loop in Node.js 0.11.14
+  * deps: send@0.11.1
+    - Fix root path disclosure
+
+1.8.0 / 2015-01-05
+==================
+
+  * deps: send@0.11.0
+    - deps: debug@~2.1.1
+    - deps: etag@~1.5.1
+    - deps: ms@0.7.0
+    - deps: on-finished@~2.2.0
+
+1.7.2 / 2015-01-02
+==================
+
+  * Fix potential open redirect when mounted at root
+
+1.7.1 / 2014-10-22
+==================
+
+  * deps: send@0.10.1
+    - deps: on-finished@~2.1.1
+
+1.7.0 / 2014-10-15
+==================
+
+  * deps: send@0.10.0
+    - deps: debug@~2.1.0
+    - deps: depd@~1.0.0
+    - deps: etag@~1.5.0
+
+1.6.5 / 2015-02-04
+==================
+
+  * Fix potential open redirect when mounted at root
+    - Back-ported from v1.7.2
+
+1.6.4 / 2014-10-08
+==================
+
+  * Fix redirect loop when index file serving disabled
+
+1.6.3 / 2014-09-24
+==================
+
+  * deps: send@0.9.3
+    - deps: etag@~1.4.0
+
+1.6.2 / 2014-09-15
+==================
+
+  * deps: send@0.9.2
+    - deps: depd@0.4.5
+    - deps: etag@~1.3.1
+    - deps: range-parser@~1.0.2
+
+1.6.1 / 2014-09-07
+==================
+
+  * deps: send@0.9.1
+    - deps: fresh@0.2.4
+
+1.6.0 / 2014-09-07
+==================
+
+  * deps: send@0.9.0
+    - Add `lastModified` option
+    - Use `etag` to generate `ETag` header
+    - deps: debug@~2.0.0
+
+1.5.4 / 2014-09-04
+==================
+
+  * deps: send@0.8.5
+    - Fix a path traversal issue when using `root`
+    - Fix malicious path detection for empty string path
+
+1.5.3 / 2014-08-17
+==================
+
+  * deps: send@0.8.3
+
+1.5.2 / 2014-08-14
+==================
+
+  * deps: send@0.8.2
+    - Work around `fd` leak in Node.js 0.10 for `fs.ReadStream`
+
+1.5.1 / 2014-08-09
+==================
+
+  * Fix parsing of weird `req.originalUrl` values
+  * deps: parseurl@~1.3.0
+  * deps: utils-merge@1.0.0
+
+1.5.0 / 2014-08-05
+==================
+
+  * deps: send@0.8.1
+    - Add `extensions` option
+
+1.4.4 / 2014-08-04
+==================
+
+  * deps: send@0.7.4
+    - Fix serving index files without root dir
+
+1.4.3 / 2014-07-29
+==================
+
+  * deps: send@0.7.3
+    - Fix incorrect 403 on Windows and Node.js 0.11
+
+1.4.2 / 2014-07-27
+==================
+
+  * deps: send@0.7.2
+    - deps: depd@0.4.4
+
+1.4.1 / 2014-07-26
+==================
+
+  * deps: send@0.7.1
+    - deps: depd@0.4.3
+
+1.4.0 / 2014-07-21
+==================
+
+  * deps: parseurl@~1.2.0
+    - Cache URLs based on original value
+    - Remove no-longer-needed URL mis-parse work-around
+    - Simplify the "fast-path" `RegExp`
+  * deps: send@0.7.0
+    - Add `dotfiles` option
+    - deps: debug@1.0.4
+    - deps: depd@0.4.2
+
+1.3.2 / 2014-07-11
+==================
+
+  * deps: send@0.6.0
+    - Cap `maxAge` value to 1 year
+    - deps: debug@1.0.3
+
+1.3.1 / 2014-07-09
+==================
+
+  * deps: parseurl@~1.1.3
+    - faster parsing of href-only URLs
+
+1.3.0 / 2014-06-28
+==================
+
+  * Add `setHeaders` option
+  * Include HTML link in redirect response
+  * deps: send@0.5.0
+    - Accept string for `maxAge` (converted by `ms`)
+
+1.2.3 / 2014-06-11
+==================
+
+  * deps: send@0.4.3
+    - Do not throw un-catchable error on file open race condition
+    - Use `escape-html` for HTML escaping
+    - deps: debug@1.0.2
+    - deps: finished@1.2.2
+    - deps: fresh@0.2.2
+
+1.2.2 / 2014-06-09
+==================
+
+  * deps: send@0.4.2
+    - fix "event emitter leak" warnings
+    - deps: debug@1.0.1
+    - deps: finished@1.2.1
+
+1.2.1 / 2014-06-02
+==================
+
+  * use `escape-html` for escaping
+  * deps: send@0.4.1
+    - Send `max-age` in `Cache-Control` in correct format
+
+1.2.0 / 2014-05-29
+==================
+
+  * deps: send@0.4.0
+    - Calculate ETag with md5 for reduced collisions
+    - Fix wrong behavior when index file matches directory
+    - Ignore stream errors after request ends
+    - Skip directories in index file search
+    - deps: debug@0.8.1
+
+1.1.0 / 2014-04-24
+==================
+
+  * Accept options directly to `send` module
+  * deps: send@0.3.0
+
+1.0.4 / 2014-04-07
+==================
+
+  * Resolve relative paths at middleware setup
+  * Use parseurl to parse the URL from request
+
+1.0.3 / 2014-03-20
+==================
+
+  * Do not rely on connect-like environments
+
+1.0.2 / 2014-03-06
+==================
+
+  * deps: send@0.2.0
+
+1.0.1 / 2014-03-05
+==================
+
+  * Add mime export for back-compat
+
+1.0.0 / 2014-03-05
+==================
+
+  * Genesis from `connect`
diff --git a/wrt/node_modules/serve-static/LICENSE b/wrt/node_modules/serve-static/LICENSE
new file mode 100644 (file)
index 0000000..cbe62e8
--- /dev/null
@@ -0,0 +1,25 @@
+(The MIT License)
+
+Copyright (c) 2010 Sencha Inc.
+Copyright (c) 2011 LearnBoost
+Copyright (c) 2011 TJ Holowaychuk
+Copyright (c) 2014-2016 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/serve-static/README.md b/wrt/node_modules/serve-static/README.md
new file mode 100644 (file)
index 0000000..3dd5f48
--- /dev/null
@@ -0,0 +1,253 @@
+# serve-static
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Linux Build][travis-image]][travis-url]
+[![Windows Build][appveyor-image]][appveyor-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+[![Gratipay][gratipay-image]][gratipay-url]
+
+## Install
+
+This is a [Node.js](https://nodejs.org/en/) module available through the
+[npm registry](https://www.npmjs.com/). Installation is done using the
+[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
+
+```sh
+$ npm install serve-static
+```
+
+## API
+
+<!-- eslint-disable no-unused-vars -->
+
+```js
+var serveStatic = require('serve-static')
+```
+
+### serveStatic(root, options)
+
+Create a new middleware function to serve files from within a given root
+directory. The file to serve will be determined by combining `req.url`
+with the provided root directory. When a file is not found, instead of
+sending a 404 response, this module will instead call `next()` to move on
+to the next middleware, allowing for stacking and fall-backs.
+
+#### Options
+
+##### acceptRanges
+
+Enable or disable accepting ranged requests, defaults to true.
+Disabling this will not send `Accept-Ranges` and ignore the contents
+of the `Range` request header.
+
+##### cacheControl
+
+Enable or disable setting `Cache-Control` response header, defaults to
+true. Disabling this will ignore the `maxAge` option.
+
+##### dotfiles
+
+ Set how "dotfiles" are treated when encountered. A dotfile is a file
+or directory that begins with a dot ("."). Note this check is done on
+the path itself without checking if the path actually exists on the
+disk. If `root` is specified, only the dotfiles above the root are
+checked (i.e. the root itself can be within a dotfile when set
+to "deny").
+
+  - `'allow'` No special treatment for dotfiles.
+  - `'deny'` Deny a request for a dotfile and 403/`next()`.
+  - `'ignore'` Pretend like the dotfile does not exist and 404/`next()`.
+
+The default value is similar to `'ignore'`, with the exception that this
+default will not ignore the files within a directory that begins with a dot.
+
+##### etag
+
+Enable or disable etag generation, defaults to true.
+
+##### extensions
+
+Set file extension fallbacks. When set, if a file is not found, the given
+extensions will be added to the file name and search for. The first that
+exists will be served. Example: `['html', 'htm']`.
+
+The default value is `false`.
+
+##### fallthrough
+
+Set the middleware to have client errors fall-through as just unhandled
+requests, otherwise forward a client error. The difference is that client
+errors like a bad request or a request to a non-existent file will cause
+this middleware to simply `next()` to your next middleware when this value
+is `true`. When this value is `false`, these errors (even 404s), will invoke
+`next(err)`.
+
+Typically `true` is desired such that multiple physical directories can be
+mapped to the same web address or for routes to fill in non-existent files.
+
+The value `false` can be used if this middleware is mounted at a path that
+is designed to be strictly a single file system directory, which allows for
+short-circuiting 404s for less overhead. This middleware will also reply to
+all methods.
+
+The default value is `true`.
+
+##### index
+
+By default this module will send "index.html" files in response to a request
+on a directory. To disable this set `false` or to supply a new index pass a
+string or an array in preferred order.
+
+##### lastModified
+
+Enable or disable `Last-Modified` header, defaults to true. Uses the file
+system's last modified value.
+
+##### maxAge
+
+Provide a max-age in milliseconds for http caching, defaults to 0. This
+can also be a string accepted by the [ms](https://www.npmjs.org/package/ms#readme)
+module.
+
+##### redirect
+
+Redirect to trailing "/" when the pathname is a dir. Defaults to `true`.
+
+##### setHeaders
+
+Function to set custom headers on response. Alterations to the headers need to
+occur synchronously. The function is called as `fn(res, path, stat)`, where
+the arguments are:
+
+  - `res` the response object
+  - `path` the file path that is being sent
+  - `stat` the stat object of the file that is being sent
+
+## Examples
+
+### Serve files with vanilla node.js http server
+
+```js
+var finalhandler = require('finalhandler')
+var http = require('http')
+var serveStatic = require('serve-static')
+
+// Serve up public/ftp folder
+var serve = serveStatic('public/ftp', {'index': ['index.html', 'index.htm']})
+
+// Create server
+var server = http.createServer(function onRequest (req, res) {
+  serve(req, res, finalhandler(req, res))
+})
+
+// Listen
+server.listen(3000)
+```
+
+### Serve all files as downloads
+
+```js
+var contentDisposition = require('content-disposition')
+var finalhandler = require('finalhandler')
+var http = require('http')
+var serveStatic = require('serve-static')
+
+// Serve up public/ftp folder
+var serve = serveStatic('public/ftp', {
+  'index': false,
+  'setHeaders': setHeaders
+})
+
+// Set header to force download
+function setHeaders (res, path) {
+  res.setHeader('Content-Disposition', contentDisposition(path))
+}
+
+// Create server
+var server = http.createServer(function onRequest (req, res) {
+  serve(req, res, finalhandler(req, res))
+})
+
+// Listen
+server.listen(3000)
+```
+
+### Serving using express
+
+#### Simple
+
+This is a simple example of using Express.
+
+```js
+var express = require('express')
+var serveStatic = require('serve-static')
+
+var app = express()
+
+app.use(serveStatic('public/ftp', {'index': ['default.html', 'default.htm']}))
+app.listen(3000)
+```
+
+#### Multiple roots
+
+This example shows a simple way to search through multiple directories.
+Files are look for in `public-optimized/` first, then `public/` second as
+a fallback.
+
+```js
+var express = require('express')
+var path = require('path')
+var serveStatic = require('serve-static')
+
+var app = express()
+
+app.use(serveStatic(path.join(__dirname, 'public-optimized')))
+app.use(serveStatic(path.join(__dirname, 'public')))
+app.listen(3000)
+```
+
+#### Different settings for paths
+
+This example shows how to set a different max age depending on the served
+file type. In this example, HTML files are not cached, while everything else
+is for 1 day.
+
+```js
+var express = require('express')
+var path = require('path')
+var serveStatic = require('serve-static')
+
+var app = express()
+
+app.use(serveStatic(path.join(__dirname, 'public'), {
+  maxAge: '1d',
+  setHeaders: setCustomCacheControl
+}))
+
+app.listen(3000)
+
+function setCustomCacheControl (res, path) {
+  if (serveStatic.mime.lookup(path) === 'text/html') {
+    // Custom Cache-Control for HTML files
+    res.setHeader('Cache-Control', 'public, max-age=0')
+  }
+}
+```
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/serve-static.svg
+[npm-url]: https://npmjs.org/package/serve-static
+[travis-image]: https://img.shields.io/travis/expressjs/serve-static/master.svg?label=linux
+[travis-url]: https://travis-ci.org/expressjs/serve-static
+[appveyor-image]: https://img.shields.io/appveyor/ci/dougwilson/serve-static/master.svg?label=windows
+[appveyor-url]: https://ci.appveyor.com/project/dougwilson/serve-static
+[coveralls-image]: https://img.shields.io/coveralls/expressjs/serve-static/master.svg
+[coveralls-url]: https://coveralls.io/r/expressjs/serve-static
+[downloads-image]: https://img.shields.io/npm/dm/serve-static.svg
+[downloads-url]: https://npmjs.org/package/serve-static
+[gratipay-image]: https://img.shields.io/gratipay/dougwilson.svg
+[gratipay-url]: https://gratipay.com/dougwilson/
diff --git a/wrt/node_modules/serve-static/index.js b/wrt/node_modules/serve-static/index.js
new file mode 100644 (file)
index 0000000..85df3d0
--- /dev/null
@@ -0,0 +1,209 @@
+/*!
+ * serve-static
+ * Copyright(c) 2010 Sencha Inc.
+ * Copyright(c) 2011 TJ Holowaychuk
+ * Copyright(c) 2014-2016 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var encodeUrl = require('encodeurl')
+var escapeHtml = require('escape-html')
+var parseUrl = require('parseurl')
+var resolve = require('path').resolve
+var send = require('send')
+var url = require('url')
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = serveStatic
+module.exports.mime = send.mime
+
+/**
+ * @param {string} root
+ * @param {object} [options]
+ * @return {function}
+ * @public
+ */
+
+function serveStatic (root, options) {
+  if (!root) {
+    throw new TypeError('root path required')
+  }
+
+  if (typeof root !== 'string') {
+    throw new TypeError('root path must be a string')
+  }
+
+  // copy options object
+  var opts = Object.create(options || null)
+
+  // fall-though
+  var fallthrough = opts.fallthrough !== false
+
+  // default redirect
+  var redirect = opts.redirect !== false
+
+  // headers listener
+  var setHeaders = opts.setHeaders
+
+  if (setHeaders && typeof setHeaders !== 'function') {
+    throw new TypeError('option setHeaders must be function')
+  }
+
+  // setup options for send
+  opts.maxage = opts.maxage || opts.maxAge || 0
+  opts.root = resolve(root)
+
+  // construct directory listener
+  var onDirectory = redirect
+    ? createRedirectDirectoryListener()
+    : createNotFoundDirectoryListener()
+
+  return function serveStatic (req, res, next) {
+    if (req.method !== 'GET' && req.method !== 'HEAD') {
+      if (fallthrough) {
+        return next()
+      }
+
+      // method not allowed
+      res.statusCode = 405
+      res.setHeader('Allow', 'GET, HEAD')
+      res.setHeader('Content-Length', '0')
+      res.end()
+      return
+    }
+
+    var forwardError = !fallthrough
+    var originalUrl = parseUrl.original(req)
+    var path = parseUrl(req).pathname
+
+    // make sure redirect occurs at mount
+    if (path === '/' && originalUrl.pathname.substr(-1) !== '/') {
+      path = ''
+    }
+
+    // create send stream
+    var stream = send(req, path, opts)
+
+    // add directory handler
+    stream.on('directory', onDirectory)
+
+    // add headers listener
+    if (setHeaders) {
+      stream.on('headers', setHeaders)
+    }
+
+    // add file listener for fallthrough
+    if (fallthrough) {
+      stream.on('file', function onFile () {
+        // once file is determined, always forward error
+        forwardError = true
+      })
+    }
+
+    // forward errors
+    stream.on('error', function error (err) {
+      if (forwardError || !(err.statusCode < 500)) {
+        next(err)
+        return
+      }
+
+      next()
+    })
+
+    // pipe
+    stream.pipe(res)
+  }
+}
+
+/**
+ * Collapse all leading slashes into a single slash
+ * @private
+ */
+function collapseLeadingSlashes (str) {
+  for (var i = 0; i < str.length; i++) {
+    if (str[i] !== '/') {
+      break
+    }
+  }
+
+  return i > 1
+    ? '/' + str.substr(i)
+    : str
+}
+
+ /**
+ * Create a minimal HTML document.
+ *
+ * @param {string} title
+ * @param {string} body
+ * @private
+ */
+
+function createHtmlDocument (title, body) {
+  return '<!DOCTYPE html>\n' +
+    '<html lang="en">\n' +
+    '<head>\n' +
+    '<meta charset="utf-8">\n' +
+    '<title>' + title + '</title>\n' +
+    '</head>\n' +
+    '<body>\n' +
+    '<pre>' + body + '</pre>\n' +
+    '</body>\n'
+}
+
+/**
+ * Create a directory listener that just 404s.
+ * @private
+ */
+
+function createNotFoundDirectoryListener () {
+  return function notFound () {
+    this.error(404)
+  }
+}
+
+/**
+ * Create a directory listener that performs a redirect.
+ * @private
+ */
+
+function createRedirectDirectoryListener () {
+  return function redirect (res) {
+    if (this.hasTrailingSlash()) {
+      this.error(404)
+      return
+    }
+
+    // get original URL
+    var originalUrl = parseUrl.original(this.req)
+
+    // append trailing slash
+    originalUrl.path = null
+    originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/')
+
+    // reformat the URL
+    var loc = encodeUrl(url.format(originalUrl))
+    var doc = createHtmlDocument('Redirecting', 'Redirecting to <a href="' + escapeHtml(loc) + '">' +
+      escapeHtml(loc) + '</a>')
+
+    // send redirect response
+    res.statusCode = 301
+    res.setHeader('Content-Type', 'text/html; charset=UTF-8')
+    res.setHeader('Content-Length', Buffer.byteLength(doc))
+    res.setHeader('Content-Security-Policy', "default-src 'self'")
+    res.setHeader('X-Content-Type-Options', 'nosniff')
+    res.setHeader('Location', loc)
+    res.end(doc)
+  }
+}
diff --git a/wrt/node_modules/serve-static/package.json b/wrt/node_modules/serve-static/package.json
new file mode 100644 (file)
index 0000000..fb548d6
--- /dev/null
@@ -0,0 +1,110 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "serve-static@1.12.4",
+        "scope": null,
+        "escapedName": "serve-static",
+        "name": "serve-static",
+        "rawSpec": "1.12.4",
+        "spec": "1.12.4",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express"
+    ]
+  ],
+  "_from": "serve-static@1.12.4",
+  "_id": "serve-static@1.12.4",
+  "_inCache": true,
+  "_location": "/serve-static",
+  "_nodeVersion": "6.11.1",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/serve-static-1.12.4.tgz_1501998894621_0.48076217574998736"
+  },
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "3.10.10",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "serve-static@1.12.4",
+    "scope": null,
+    "escapedName": "serve-static",
+    "name": "serve-static",
+    "rawSpec": "1.12.4",
+    "spec": "1.12.4",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/express"
+  ],
+  "_resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.12.4.tgz",
+  "_shasum": "9b6aa98eeb7253c4eedc4c1f6fdbca609901a961",
+  "_shrinkwrap": null,
+  "_spec": "serve-static@1.12.4",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express",
+  "author": {
+    "name": "Douglas Christopher Wilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "bugs": {
+    "url": "https://github.com/expressjs/serve-static/issues"
+  },
+  "dependencies": {
+    "encodeurl": "~1.0.1",
+    "escape-html": "~1.0.3",
+    "parseurl": "~1.3.1",
+    "send": "0.15.4"
+  },
+  "description": "Serve static files",
+  "devDependencies": {
+    "eslint": "3.19.0",
+    "eslint-config-standard": "10.2.1",
+    "eslint-plugin-import": "2.6.1",
+    "eslint-plugin-markdown": "1.0.0-beta.6",
+    "eslint-plugin-node": "5.1.0",
+    "eslint-plugin-promise": "3.5.0",
+    "eslint-plugin-standard": "3.0.1",
+    "istanbul": "0.4.5",
+    "mocha": "2.5.3",
+    "supertest": "1.1.0"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "9b6aa98eeb7253c4eedc4c1f6fdbca609901a961",
+    "tarball": "https://registry.npmjs.org/serve-static/-/serve-static-1.12.4.tgz"
+  },
+  "engines": {
+    "node": ">= 0.8.0"
+  },
+  "files": [
+    "LICENSE",
+    "HISTORY.md",
+    "index.js"
+  ],
+  "gitHead": "c16b4d1c2c7bc1aaf76194187f087549b63bf2f9",
+  "homepage": "https://github.com/expressjs/serve-static#readme",
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "name": "serve-static",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/expressjs/serve-static.git"
+  },
+  "scripts": {
+    "lint": "eslint --plugin markdown --ext js,md .",
+    "test": "mocha --reporter spec --bail --check-leaks test/",
+    "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/"
+  },
+  "version": "1.12.4"
+}
diff --git a/wrt/node_modules/setimmediate/LICENSE.txt b/wrt/node_modules/setimmediate/LICENSE.txt
new file mode 100644 (file)
index 0000000..32b20de
--- /dev/null
@@ -0,0 +1,20 @@
+Copyright (c) 2012 Barnesandnoble.com, llc, Donavon West, and Domenic Denicola
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/setimmediate/package.json b/wrt/node_modules/setimmediate/package.json
new file mode 100644 (file)
index 0000000..5939457
--- /dev/null
@@ -0,0 +1,111 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "setimmediate@>= 1.0.1 < 2",
+        "scope": null,
+        "escapedName": "setimmediate",
+        "name": "setimmediate",
+        "rawSpec": ">= 1.0.1 < 2",
+        "spec": ">=1.0.1 <2.0.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/unzip"
+    ]
+  ],
+  "_from": "setimmediate@>=1.0.1 <2.0.0",
+  "_id": "setimmediate@1.0.5",
+  "_inCache": true,
+  "_location": "/setimmediate",
+  "_nodeVersion": "6.2.2",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/setimmediate-1.0.5.tgz_1473641994770_0.26671745581552386"
+  },
+  "_npmUser": {
+    "name": "domenic",
+    "email": "d@domenic.me"
+  },
+  "_npmVersion": "3.9.5",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "setimmediate@>= 1.0.1 < 2",
+    "scope": null,
+    "escapedName": "setimmediate",
+    "name": "setimmediate",
+    "rawSpec": ">= 1.0.1 < 2",
+    "spec": ">=1.0.1 <2.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/pullstream",
+    "/unzip"
+  ],
+  "_resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
+  "_shasum": "290cbb232e306942d7d7ea9b83732ab7856f8285",
+  "_shrinkwrap": null,
+  "_spec": "setimmediate@>= 1.0.1 < 2",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/unzip",
+  "author": {
+    "name": "YuzuJS"
+  },
+  "bugs": {
+    "url": "https://github.com/yuzujs/setImmediate/issues"
+  },
+  "contributors": [
+    {
+      "name": "Domenic Denicola",
+      "email": "d@domenic.me",
+      "url": "https://domenic.me"
+    },
+    {
+      "name": "Donavon West",
+      "email": "github@donavon.com",
+      "url": "http://donavon.com"
+    },
+    {
+      "name": "Yaffle"
+    }
+  ],
+  "dependencies": {},
+  "description": "A shim for the setImmediate efficient script yielding API",
+  "devDependencies": {
+    "http-server": "~0.6.1",
+    "jshint": "^2.5.0",
+    "mocha": "~1.18.2",
+    "opener": "^1.3",
+    "zuul": "^1.6.4"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "290cbb232e306942d7d7ea9b83732ab7856f8285",
+    "tarball": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz"
+  },
+  "files": [
+    "setImmediate.js"
+  ],
+  "gitHead": "f1ccbfdf09cb93aadf77c4aa749ea554503b9234",
+  "homepage": "https://github.com/yuzujs/setImmediate#readme",
+  "license": "MIT",
+  "main": "setImmediate.js",
+  "maintainers": [
+    {
+      "name": "domenic",
+      "email": "domenic@domenicdenicola.com"
+    }
+  ],
+  "name": "setimmediate",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/yuzujs/setImmediate.git"
+  },
+  "scripts": {
+    "lint": "jshint setImmediate.js",
+    "test": "mocha test/tests.js",
+    "test-browser": "opener http://localhost:9008/__zuul && zuul test/tests.js --ui mocha-bdd --local 9008",
+    "test-browser-only": "opener http://localhost:9007/test/browserOnly/index.html && http-server . -p 9007"
+  },
+  "version": "1.0.5"
+}
diff --git a/wrt/node_modules/setimmediate/setImmediate.js b/wrt/node_modules/setimmediate/setImmediate.js
new file mode 100644 (file)
index 0000000..3c1b06e
--- /dev/null
@@ -0,0 +1,186 @@
+(function (global, undefined) {
+    "use strict";
+
+    if (global.setImmediate) {
+        return;
+    }
+
+    var nextHandle = 1; // Spec says greater than zero
+    var tasksByHandle = {};
+    var currentlyRunningATask = false;
+    var doc = global.document;
+    var registerImmediate;
+
+    function setImmediate(callback) {
+      // Callback can either be a function or a string
+      if (typeof callback !== "function") {
+        callback = new Function("" + callback);
+      }
+      // Copy function arguments
+      var args = new Array(arguments.length - 1);
+      for (var i = 0; i < args.length; i++) {
+          args[i] = arguments[i + 1];
+      }
+      // Store and register the task
+      var task = { callback: callback, args: args };
+      tasksByHandle[nextHandle] = task;
+      registerImmediate(nextHandle);
+      return nextHandle++;
+    }
+
+    function clearImmediate(handle) {
+        delete tasksByHandle[handle];
+    }
+
+    function run(task) {
+        var callback = task.callback;
+        var args = task.args;
+        switch (args.length) {
+        case 0:
+            callback();
+            break;
+        case 1:
+            callback(args[0]);
+            break;
+        case 2:
+            callback(args[0], args[1]);
+            break;
+        case 3:
+            callback(args[0], args[1], args[2]);
+            break;
+        default:
+            callback.apply(undefined, args);
+            break;
+        }
+    }
+
+    function runIfPresent(handle) {
+        // From the spec: "Wait until any invocations of this algorithm started before this one have completed."
+        // So if we're currently running a task, we'll need to delay this invocation.
+        if (currentlyRunningATask) {
+            // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
+            // "too much recursion" error.
+            setTimeout(runIfPresent, 0, handle);
+        } else {
+            var task = tasksByHandle[handle];
+            if (task) {
+                currentlyRunningATask = true;
+                try {
+                    run(task);
+                } finally {
+                    clearImmediate(handle);
+                    currentlyRunningATask = false;
+                }
+            }
+        }
+    }
+
+    function installNextTickImplementation() {
+        registerImmediate = function(handle) {
+            process.nextTick(function () { runIfPresent(handle); });
+        };
+    }
+
+    function canUsePostMessage() {
+        // The test against `importScripts` prevents this implementation from being installed inside a web worker,
+        // where `global.postMessage` means something completely different and can't be used for this purpose.
+        if (global.postMessage && !global.importScripts) {
+            var postMessageIsAsynchronous = true;
+            var oldOnMessage = global.onmessage;
+            global.onmessage = function() {
+                postMessageIsAsynchronous = false;
+            };
+            global.postMessage("", "*");
+            global.onmessage = oldOnMessage;
+            return postMessageIsAsynchronous;
+        }
+    }
+
+    function installPostMessageImplementation() {
+        // Installs an event handler on `global` for the `message` event: see
+        // * https://developer.mozilla.org/en/DOM/window.postMessage
+        // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
+
+        var messagePrefix = "setImmediate$" + Math.random() + "$";
+        var onGlobalMessage = function(event) {
+            if (event.source === global &&
+                typeof event.data === "string" &&
+                event.data.indexOf(messagePrefix) === 0) {
+                runIfPresent(+event.data.slice(messagePrefix.length));
+            }
+        };
+
+        if (global.addEventListener) {
+            global.addEventListener("message", onGlobalMessage, false);
+        } else {
+            global.attachEvent("onmessage", onGlobalMessage);
+        }
+
+        registerImmediate = function(handle) {
+            global.postMessage(messagePrefix + handle, "*");
+        };
+    }
+
+    function installMessageChannelImplementation() {
+        var channel = new MessageChannel();
+        channel.port1.onmessage = function(event) {
+            var handle = event.data;
+            runIfPresent(handle);
+        };
+
+        registerImmediate = function(handle) {
+            channel.port2.postMessage(handle);
+        };
+    }
+
+    function installReadyStateChangeImplementation() {
+        var html = doc.documentElement;
+        registerImmediate = function(handle) {
+            // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
+            // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
+            var script = doc.createElement("script");
+            script.onreadystatechange = function () {
+                runIfPresent(handle);
+                script.onreadystatechange = null;
+                html.removeChild(script);
+                script = null;
+            };
+            html.appendChild(script);
+        };
+    }
+
+    function installSetTimeoutImplementation() {
+        registerImmediate = function(handle) {
+            setTimeout(runIfPresent, 0, handle);
+        };
+    }
+
+    // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.
+    var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
+    attachTo = attachTo && attachTo.setTimeout ? attachTo : global;
+
+    // Don't get fooled by e.g. browserify environments.
+    if ({}.toString.call(global.process) === "[object process]") {
+        // For Node.js before 0.9
+        installNextTickImplementation();
+
+    } else if (canUsePostMessage()) {
+        // For non-IE10 modern browsers
+        installPostMessageImplementation();
+
+    } else if (global.MessageChannel) {
+        // For web workers, where supported
+        installMessageChannelImplementation();
+
+    } else if (doc && "onreadystatechange" in doc.createElement("script")) {
+        // For IE 6–8
+        installReadyStateChangeImplementation();
+
+    } else {
+        // For older browsers
+        installSetTimeoutImplementation();
+    }
+
+    attachTo.setImmediate = setImmediate;
+    attachTo.clearImmediate = clearImmediate;
+}(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self));
diff --git a/wrt/node_modules/setprototypeof/LICENSE b/wrt/node_modules/setprototypeof/LICENSE
new file mode 100644 (file)
index 0000000..61afa2f
--- /dev/null
@@ -0,0 +1,13 @@
+Copyright (c) 2015, Wes Todd
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/wrt/node_modules/setprototypeof/README.md b/wrt/node_modules/setprototypeof/README.md
new file mode 100644 (file)
index 0000000..01d7947
--- /dev/null
@@ -0,0 +1,21 @@
+# Polyfill for `Object.setPrototypeOf`
+
+A simple cross platform implementation to set the prototype of an instianted object.  Supports all modern browsers and at least back to IE8.
+
+## Usage:
+
+```
+$ npm install --save setprototypeof
+```
+
+```javascript
+var setPrototypeOf = require('setprototypeof');
+
+var obj = {};
+setPrototypeOf(obj, {
+       foo: function() {
+               return 'bar';
+       }
+});
+obj.foo(); // bar
+```
diff --git a/wrt/node_modules/setprototypeof/index.js b/wrt/node_modules/setprototypeof/index.js
new file mode 100644 (file)
index 0000000..93ea417
--- /dev/null
@@ -0,0 +1,15 @@
+module.exports = Object.setPrototypeOf || ({__proto__:[]} instanceof Array ? setProtoOf : mixinProperties);
+
+function setProtoOf(obj, proto) {
+       obj.__proto__ = proto;
+       return obj;
+}
+
+function mixinProperties(obj, proto) {
+       for (var prop in proto) {
+               if (!obj.hasOwnProperty(prop)) {
+                       obj[prop] = proto[prop];
+               }
+       }
+       return obj;
+}
diff --git a/wrt/node_modules/setprototypeof/package.json b/wrt/node_modules/setprototypeof/package.json
new file mode 100644 (file)
index 0000000..d234b93
--- /dev/null
@@ -0,0 +1,89 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "setprototypeof@1.0.3",
+        "scope": null,
+        "escapedName": "setprototypeof",
+        "name": "setprototypeof",
+        "rawSpec": "1.0.3",
+        "spec": "1.0.3",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express"
+    ]
+  ],
+  "_from": "setprototypeof@1.0.3",
+  "_id": "setprototypeof@1.0.3",
+  "_inCache": true,
+  "_location": "/setprototypeof",
+  "_nodeVersion": "7.4.0",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/setprototypeof-1.0.3.tgz_1487607661334_0.977291816379875"
+  },
+  "_npmUser": {
+    "name": "wesleytodd",
+    "email": "wes@wesleytodd.com"
+  },
+  "_npmVersion": "4.0.5",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "setprototypeof@1.0.3",
+    "scope": null,
+    "escapedName": "setprototypeof",
+    "name": "setprototypeof",
+    "rawSpec": "1.0.3",
+    "spec": "1.0.3",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/express",
+    "/http-errors"
+  ],
+  "_resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz",
+  "_shasum": "66567e37043eeb4f04d91bd658c0cbefb55b8e04",
+  "_shrinkwrap": null,
+  "_spec": "setprototypeof@1.0.3",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express",
+  "author": {
+    "name": "Wes Todd"
+  },
+  "bugs": {
+    "url": "https://github.com/wesleytodd/setprototypeof/issues"
+  },
+  "dependencies": {},
+  "description": "A small polyfill for Object.setprototypeof",
+  "devDependencies": {},
+  "directories": {},
+  "dist": {
+    "shasum": "66567e37043eeb4f04d91bd658c0cbefb55b8e04",
+    "tarball": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz"
+  },
+  "gitHead": "a8a71aab8118651b9b0ea97ecfc28521ec82b008",
+  "homepage": "https://github.com/wesleytodd/setprototypeof",
+  "keywords": [
+    "polyfill",
+    "object",
+    "setprototypeof"
+  ],
+  "license": "ISC",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "wesleytodd",
+      "email": "wes@wesleytodd.com"
+    }
+  ],
+  "name": "setprototypeof",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/wesleytodd/setprototypeof.git"
+  },
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "version": "1.0.3"
+}
diff --git a/wrt/node_modules/slice-stream/.travis.yml b/wrt/node_modules/slice-stream/.travis.yml
new file mode 100644 (file)
index 0000000..5f6edf0
--- /dev/null
@@ -0,0 +1,6 @@
+language: node_js
+node_js:
+  - "0.11"
+  - "0.10"
+  - "0.8"
+
diff --git a/wrt/node_modules/slice-stream/LICENSE b/wrt/node_modules/slice-stream/LICENSE
new file mode 100644 (file)
index 0000000..5ff03ca
--- /dev/null
@@ -0,0 +1,22 @@
+Copyright (c) 2013 Evan Oxfeld
+
+MIT License
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/slice-stream/README.md b/wrt/node_modules/slice-stream/README.md
new file mode 100644 (file)
index 0000000..f1547b0
--- /dev/null
@@ -0,0 +1,47 @@
+slice-stream [![Build Status](https://travis-ci.org/EvanOxfeld/slice-stream.png)](https://travis-ci.org/EvanOxfeld/slice-stream)
+============
+
+Pipe data through a stream until some fixed length is reached, then callback.
+
+## Installation
+
+```bash
+$ npm install slice-stream
+```
+
+## Quick Example
+
+### End stream once a fixed length has been reached
+
+```javascript
+var SliceStream = require('../');
+var streamBuffers = require("stream-buffers");
+
+var ss = new SliceStream({ length: 5}, function (buf, sliceEnd, extra) {
+  if (!sliceEnd) {
+    return this.push(buf);
+  }
+  this.push(buf);
+  return this.push(null); //signal end of data
+});
+
+var sourceStream = new streamBuffers.ReadableStreamBuffer();
+sourceStream.put("Hello World");
+var writableStream = new streamBuffers.WritableStreamBuffer();
+
+sourceStream
+  .pipe(ss)
+  .pipe(writableStream)
+  .once('close', function () {
+    var str = writableStream.getContentsAsString('utf8');
+    console.log('First 5 bytes piped:', "'" + str + "'");
+    sourceStream.destroy();
+  });
+
+//Output
+//Piped data before pattern occurs: 'Hello'
+```
+
+## License
+
+MIT
\ No newline at end of file
diff --git a/wrt/node_modules/slice-stream/examples/until.js b/wrt/node_modules/slice-stream/examples/until.js
new file mode 100644 (file)
index 0000000..bdfb177
--- /dev/null
@@ -0,0 +1,26 @@
+var SliceStream = require('../');
+var streamBuffers = require("stream-buffers");
+
+var ss = new SliceStream({ length: 5}, function (buf, sliceEnd, extra) {
+  if (!sliceEnd) {
+    return this.push(buf);
+  }
+  this.push(buf);
+  return this.push(null); //signal end of data
+});
+
+var sourceStream = new streamBuffers.ReadableStreamBuffer();
+sourceStream.put("Hello World");
+var writableStream = new streamBuffers.WritableStreamBuffer();
+
+sourceStream
+  .pipe(ss)
+  .pipe(writableStream)
+  .once('close', function () {
+    var str = writableStream.getContentsAsString('utf8');
+    console.log('First 5 bytes piped:', "'" + str + "'");
+    sourceStream.destroy();
+  });
+
+//Output
+//Piped data before pattern occurs: 'Hello'
\ No newline at end of file
diff --git a/wrt/node_modules/slice-stream/package.json b/wrt/node_modules/slice-stream/package.json
new file mode 100644 (file)
index 0000000..7256ff1
--- /dev/null
@@ -0,0 +1,94 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "slice-stream@>= 1.0.0 < 2",
+        "scope": null,
+        "escapedName": "slice-stream",
+        "name": "slice-stream",
+        "rawSpec": ">= 1.0.0 < 2",
+        "spec": ">=1.0.0 <2.0.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/pullstream"
+    ]
+  ],
+  "_from": "slice-stream@>=1.0.0 <2.0.0",
+  "_id": "slice-stream@1.0.0",
+  "_inCache": true,
+  "_location": "/slice-stream",
+  "_npmUser": {
+    "name": "evanoxfeld",
+    "email": "eoxfeld@gmail.com"
+  },
+  "_npmVersion": "1.4.21",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "slice-stream@>= 1.0.0 < 2",
+    "scope": null,
+    "escapedName": "slice-stream",
+    "name": "slice-stream",
+    "rawSpec": ">= 1.0.0 < 2",
+    "spec": ">=1.0.0 <2.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/pullstream"
+  ],
+  "_resolved": "https://registry.npmjs.org/slice-stream/-/slice-stream-1.0.0.tgz",
+  "_shasum": "5b33bd66f013b1a7f86460b03d463dec39ad3ea0",
+  "_shrinkwrap": null,
+  "_spec": "slice-stream@>= 1.0.0 < 2",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/pullstream",
+  "author": {
+    "name": "Evan Oxfeld",
+    "email": "eoxfeld@gmail.com"
+  },
+  "bugs": {
+    "url": "https://github.com/EvanOxfeld/slice-stream/issues"
+  },
+  "dependencies": {
+    "readable-stream": "~1.0.31"
+  },
+  "description": "Pipe data through a stream until some fixed length is reached, then callback.",
+  "devDependencies": {
+    "stream-buffers": ">= 0.2.4 < 1",
+    "tap": ">= 0.4.0 < 1"
+  },
+  "directories": {
+    "example": "examples",
+    "test": "test"
+  },
+  "dist": {
+    "shasum": "5b33bd66f013b1a7f86460b03d463dec39ad3ea0",
+    "tarball": "https://registry.npmjs.org/slice-stream/-/slice-stream-1.0.0.tgz"
+  },
+  "gitHead": "9054cbab67c2e71ab9241dbe88401c786b270f8e",
+  "homepage": "https://github.com/EvanOxfeld/slice-stream",
+  "keywords": [
+    "slice",
+    "fixed",
+    "length",
+    "stream",
+    "split"
+  ],
+  "license": "MIT",
+  "main": "slicestream.js",
+  "maintainers": [
+    {
+      "name": "evanoxfeld",
+      "email": "eoxfeld@gmail.com"
+    }
+  ],
+  "name": "slice-stream",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/EvanOxfeld/slice-stream.git"
+  },
+  "scripts": {
+    "test": "tap ./test/*.js"
+  },
+  "version": "1.0.0"
+}
diff --git a/wrt/node_modules/slice-stream/slicestream.js b/wrt/node_modules/slice-stream/slicestream.js
new file mode 100644 (file)
index 0000000..83a2fae
--- /dev/null
@@ -0,0 +1,34 @@
+'use strict';
+
+module.exports = SliceStream;
+
+var Transform = require('readable-stream/transform');
+var inherits = require("util").inherits;
+
+inherits(SliceStream, Transform);
+
+function SliceStream(opts, sliceFn) {
+  if (!(this instanceof SliceStream)) {
+    return new SliceStream(opts, sliceFn);
+  }
+
+  this._opts = opts;
+  this._accumulatedLength = 0;
+  this.sliceFn = sliceFn;
+
+  Transform.call(this);
+}
+
+SliceStream.prototype._transform = function (chunk, encoding, callback) {
+  this._accumulatedLength += chunk.length;
+
+  if (this._accumulatedLength >= this._opts.length) {
+    //todo handle more than one slice in a stream
+    var offset = chunk.length - (this._accumulatedLength - this._opts.length);
+    this.sliceFn(chunk.slice(0, offset), true, chunk.slice(offset));
+    callback();
+  } else {
+    this.sliceFn(chunk);
+    callback();
+  }
+};
diff --git a/wrt/node_modules/slice-stream/test/until.js b/wrt/node_modules/slice-stream/test/until.js
new file mode 100644 (file)
index 0000000..b422732
--- /dev/null
@@ -0,0 +1,30 @@
+var test = require('tap').test;
+var streamBuffers = require("stream-buffers");
+var SliceStream = require('../');
+
+test("pipe a fixed length number of bytes, then end the stream", function (t) {
+  t.plan(2);
+
+  var ss = new SliceStream({ length: 5}, function (buf, sliceEnd, extra) {
+    if (!sliceEnd) {
+      return this.push(buf);
+    }
+    this.push(buf);
+    t.equal(extra.toString(), ' World');
+    return this.push(null);
+  });
+
+  var sourceStream = new streamBuffers.ReadableStreamBuffer();
+  sourceStream.put("Hello World");
+  var writableStream = new streamBuffers.WritableStreamBuffer();
+
+  sourceStream
+    .pipe(ss)
+    .pipe(writableStream)
+    .once('close', function () {
+      var str = writableStream.getContentsAsString('utf8');
+      t.equal(str, 'Hello');
+      sourceStream.destroy();
+      t.end();
+    });
+});
\ No newline at end of file
diff --git a/wrt/node_modules/socket.io-adapter/.npmignore b/wrt/node_modules/socket.io-adapter/.npmignore
new file mode 100644 (file)
index 0000000..3c3629e
--- /dev/null
@@ -0,0 +1 @@
+node_modules
diff --git a/wrt/node_modules/socket.io-adapter/LICENSE b/wrt/node_modules/socket.io-adapter/LICENSE
new file mode 100644 (file)
index 0000000..7e43606
--- /dev/null
@@ -0,0 +1,20 @@
+(The MIT License)
+
+Copyright (c) 2014 Guillermo Rauch <guillermo@learnboost.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the 'Software'), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/socket.io-adapter/Readme.md b/wrt/node_modules/socket.io-adapter/Readme.md
new file mode 100644 (file)
index 0000000..1327723
--- /dev/null
@@ -0,0 +1,16 @@
+
+# socket.io-adapter
+
+Default socket.io in-memory adapter class.
+
+## How to use
+
+This module is not intended for end-user usage, but can be used as an
+interface to inherit from from other adapters you might want to build.
+
+As an example of an adapter that builds on top of this, please take a look
+at [socket.io-redis](https://github.com/learnboost/socket.io-redis).
+
+## License
+
+MIT
diff --git a/wrt/node_modules/socket.io-adapter/index.js b/wrt/node_modules/socket.io-adapter/index.js
new file mode 100644 (file)
index 0000000..aeb5b6e
--- /dev/null
@@ -0,0 +1,263 @@
+
+/**
+ * Module dependencies.
+ */
+
+var Emitter = require('events').EventEmitter;
+
+/**
+ * Module exports.
+ */
+
+module.exports = Adapter;
+
+/**
+ * Memory adapter constructor.
+ *
+ * @param {Namespace} nsp
+ * @api public
+ */
+
+function Adapter(nsp){
+  this.nsp = nsp;
+  this.rooms = {};
+  this.sids = {};
+  this.encoder = nsp.server.encoder;
+}
+
+/**
+ * Inherits from `EventEmitter`.
+ */
+
+Adapter.prototype.__proto__ = Emitter.prototype;
+
+/**
+ * Adds a socket to a room.
+ *
+ * @param {String} socket id
+ * @param {String} room name
+ * @param {Function} callback
+ * @api public
+ */
+
+Adapter.prototype.add = function(id, room, fn){
+  return this.addAll(id, [ room ], fn);
+};
+
+/**
+ * Adds a socket to a list of room.
+ *
+ * @param {String} socket id
+ * @param {String} rooms
+ * @param {Function} callback
+ * @api public
+ */
+
+Adapter.prototype.addAll = function(id, rooms, fn){
+  for (var i = 0; i < rooms.length; i++) {
+    var room = rooms[i];
+    this.sids[id] = this.sids[id] || {};
+    this.sids[id][room] = true;
+    this.rooms[room] = this.rooms[room] || Room();
+    this.rooms[room].add(id);
+  }
+  if (fn) process.nextTick(fn.bind(null, null));
+};
+
+/**
+ * Removes a socket from a room.
+ *
+ * @param {String} socket id
+ * @param {String} room name
+ * @param {Function} callback
+ * @api public
+ */
+
+Adapter.prototype.del = function(id, room, fn){
+  this.sids[id] = this.sids[id] || {};
+  delete this.sids[id][room];
+  if (this.rooms.hasOwnProperty(room)) {
+    this.rooms[room].del(id);
+    if (this.rooms[room].length === 0) delete this.rooms[room];
+  }
+
+  if (fn) process.nextTick(fn.bind(null, null));
+};
+
+/**
+ * Removes a socket from all rooms it's joined.
+ *
+ * @param {String} socket id
+ * @param {Function} callback
+ * @api public
+ */
+
+Adapter.prototype.delAll = function(id, fn){
+  var rooms = this.sids[id];
+  if (rooms) {
+    for (var room in rooms) {
+      if (this.rooms.hasOwnProperty(room)) {
+        this.rooms[room].del(id);
+        if (this.rooms[room].length === 0) delete this.rooms[room];
+      }
+    }
+  }
+  delete this.sids[id];
+
+  if (fn) process.nextTick(fn.bind(null, null));
+};
+
+/**
+ * Broadcasts a packet.
+ *
+ * Options:
+ *  - `flags` {Object} flags for this packet
+ *  - `except` {Array} sids that should be excluded
+ *  - `rooms` {Array} list of rooms to broadcast to
+ *
+ * @param {Object} packet object
+ * @api public
+ */
+
+Adapter.prototype.broadcast = function(packet, opts){
+  var rooms = opts.rooms || [];
+  var except = opts.except || [];
+  var flags = opts.flags || {};
+  var packetOpts = {
+    preEncoded: true,
+    volatile: flags.volatile,
+    compress: flags.compress
+  };
+  var ids = {};
+  var self = this;
+  var socket;
+
+  packet.nsp = this.nsp.name;
+  this.encoder.encode(packet, function(encodedPackets) {
+    if (rooms.length) {
+      for (var i = 0; i < rooms.length; i++) {
+        var room = self.rooms[rooms[i]];
+        if (!room) continue;
+        var sockets = room.sockets;
+        for (var id in sockets) {
+          if (sockets.hasOwnProperty(id)) {
+            if (ids[id] || ~except.indexOf(id)) continue;
+            socket = self.nsp.connected[id];
+            if (socket) {
+              socket.packet(encodedPackets, packetOpts);
+              ids[id] = true;
+            }
+          }
+        }
+      }
+    } else {
+      for (var id in self.sids) {
+        if (self.sids.hasOwnProperty(id)) {
+          if (~except.indexOf(id)) continue;
+          socket = self.nsp.connected[id];
+          if (socket) socket.packet(encodedPackets, packetOpts);
+        }
+      }
+    }
+  });
+};
+
+/**
+ * Gets a list of clients by sid.
+ *
+ * @param {Array} explicit set of rooms to check.
+ * @param {Function} callback
+ * @api public
+ */
+
+Adapter.prototype.clients = function(rooms, fn){
+  if ('function' == typeof rooms){
+    fn = rooms;
+    rooms = null;
+  }
+
+  rooms = rooms || [];
+
+  var ids = {};
+  var sids = [];
+  var socket;
+
+  if (rooms.length) {
+    for (var i = 0; i < rooms.length; i++) {
+      var room = this.rooms[rooms[i]];
+      if (!room) continue;
+      var sockets = room.sockets;
+      for (var id in sockets) {
+        if (sockets.hasOwnProperty(id)) {
+          if (ids[id]) continue;
+          socket = this.nsp.connected[id];
+          if (socket) {
+            sids.push(id);
+            ids[id] = true;
+          }
+        }
+      }
+    }
+  } else {
+    for (var id in this.sids) {
+      if (this.sids.hasOwnProperty(id)) {
+        socket = this.nsp.connected[id];
+        if (socket) sids.push(id);
+      }
+    }
+  }
+
+  if (fn) process.nextTick(fn.bind(null, null, sids));
+};
+
+/**
+ * Gets the list of rooms a given client has joined.
+ *
+ * @param {String} socket id
+ * @param {Function} callback
+ * @api public
+ */
+Adapter.prototype.clientRooms = function(id, fn){
+  var rooms = this.sids[id];
+  if (fn) process.nextTick(fn.bind(null, null, rooms ? Object.keys(rooms) : null));
+};
+
+/**
+* Room constructor.
+*
+* @api private
+*/
+
+function Room(){
+  if (!(this instanceof Room)) return new Room();
+  this.sockets = {};
+  this.length = 0;
+}
+
+/**
+ * Adds a socket to a room.
+ *
+ * @param {String} socket id
+ * @api private
+ */
+
+Room.prototype.add = function(id){
+  if (!this.sockets.hasOwnProperty(id)) {
+    this.sockets[id] = true;
+    this.length++;
+  }
+};
+
+/**
+ * Removes a socket from a room.
+ *
+ * @param {String} socket id
+ * @api private
+ */
+
+Room.prototype.del = function(id){
+  if (this.sockets.hasOwnProperty(id)) {
+    delete this.sockets[id];
+    this.length--;
+  }
+};
diff --git a/wrt/node_modules/socket.io-adapter/package.json b/wrt/node_modules/socket.io-adapter/package.json
new file mode 100644 (file)
index 0000000..738682f
--- /dev/null
@@ -0,0 +1,81 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "socket.io-adapter@~1.1.0",
+        "scope": null,
+        "escapedName": "socket.io-adapter",
+        "name": "socket.io-adapter",
+        "rawSpec": "~1.1.0",
+        "spec": ">=1.1.0 <1.2.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io"
+    ]
+  ],
+  "_from": "socket.io-adapter@>=1.1.0 <1.2.0",
+  "_id": "socket.io-adapter@1.1.1",
+  "_inCache": true,
+  "_location": "/socket.io-adapter",
+  "_nodeVersion": "6.10.3",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/socket.io-adapter-1.1.1.tgz_1501675485180_0.7659221475478262"
+  },
+  "_npmUser": {
+    "name": "darrachequesne",
+    "email": "damien.arrachequesne@gmail.com"
+  },
+  "_npmVersion": "3.10.10",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "socket.io-adapter@~1.1.0",
+    "scope": null,
+    "escapedName": "socket.io-adapter",
+    "name": "socket.io-adapter",
+    "rawSpec": "~1.1.0",
+    "spec": ">=1.1.0 <1.2.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/socket.io"
+  ],
+  "_resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz",
+  "_shasum": "2a805e8a14d6372124dd9159ad4502f8cb07f06b",
+  "_shrinkwrap": null,
+  "_spec": "socket.io-adapter@~1.1.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io",
+  "bugs": {
+    "url": "https://github.com/socketio/socket.io-adapter/issues"
+  },
+  "dependencies": {},
+  "description": "default socket.io in-memory adapter",
+  "devDependencies": {},
+  "directories": {},
+  "dist": {
+    "shasum": "2a805e8a14d6372124dd9159ad4502f8cb07f06b",
+    "tarball": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-1.1.1.tgz"
+  },
+  "gitHead": "6874ea4952346d1dfc80c53beaa2ec014fc024b7",
+  "homepage": "https://github.com/socketio/socket.io-adapter#readme",
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "darrachequesne",
+      "email": "damien.arrachequesne@gmail.com"
+    },
+    {
+      "name": "rauchg",
+      "email": "rauchg@gmail.com"
+    }
+  ],
+  "name": "socket.io-adapter",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/socketio/socket.io-adapter.git"
+  },
+  "scripts": {},
+  "version": "1.1.1"
+}
diff --git a/wrt/node_modules/socket.io-client/History.md b/wrt/node_modules/socket.io-client/History.md
new file mode 100644 (file)
index 0000000..c4f72dd
--- /dev/null
@@ -0,0 +1,561 @@
+
+2.0.3 / 2017-06-12
+===================
+
+  * [docs] Add explicit documentation for websocket transport (#1128)
+  * [docs] Update documentation (#1124)
+
+2.0.2 / 2017-06-01
+===================
+
+  * [chore] Bump debug to version 2.6.8 (#1123)
+  * [test] Launch browser tests on localhost by default (#1122)
+  * [fix] Do not update the opts.query reference (#1121)
+
+2.0.1 / 2017-05-09
+===================
+
+(following socket.io version bump)
+
+2.0.0 / 2017-05-09
+===================
+
+`dist/socket.io.js`: 61.1 kB ; `dist/socket.io.slim.js`: 52.8 kB
+
+  * [feat] Move binary detection to the parser (#1103)
+  * [feat] Allow the use of a custom parser (#1075)
+
+  * [fix] Run tests on the minified files (#1042)
+  * [fix] Add nsp prefix to socket.id (#1058)
+
+  * [test] Update browsers matrix (#1059)
+
+  * [chore] Bump engine.io to version 3.1.0 (#1109)
+  * [chore] Bump dev dependencies (#1108)
+  * [chore] Bump debug to version 2.6.4 (#1101)
+  * [chore] Fix dependencies (#1096)
+  * [chore] Bump engine.io-client to version 2.0.2 (#1074)
+  * [chore] Bump socket.io-parser to version 2.3.2 (#1071)
+  * [chore] Bump engine.io-client to version 2.0.0 (#1062)
+  * [chore] Update issue template with fiddle (#1057)
+
+  * [docs] Fix messed events documentation (#1089)
+  * [docs] Fix Manager constructor documentation (#1093)
+  * [docs] Fix format in API.md (#1090)
+  * [docs] Add note regarding the Emitter class (#1079)
+  * [docs] Add missing path option in the documentation (#1078)
+  * [docs] Fix typo (#1076)
+  * [docs] Fix typo (#1066)
+  * [docs] Add `connect_error` and `connect_timeout` events (#1051)
+  * [docs] API documentation (#1049)
+
+1.7.2 / 2016-12-11
+===================
+
+  * [chore] Bump engine.io-client to version 1.8.2 (#1044)
+  * [chore] Speed up lint by avoiding '**/*.js' matching pattern (#1043)
+
+1.7.1 / 2016-11-28
+==================
+
+  * [docs] Add saucelabs browser matrix in README (#1035)
+  * [fix] Fix json import in slim build (#1036)
+
+1.7.0 / 2016-11-27
+==================
+
+  * [chore] Move generated files to `dist` folder (#1025)
+  * [chore] Provide a slim build without JSON3 and debug (#1030)
+  * [chore] Bump engine.io-client to 1.8.1 (#1032)
+
+1.6.0 / 2016-11-20
+==================
+
+  * [feature] emit sourcemap for socket.io.js (#953)
+  * [feature] Support minified `socket.io.min.js` (#1021)
+  * [chore] Bump dependencies (#1026)
+
+1.5.1 / 2016-10-24
+==================
+
+  * [chore] Disable AMD for json3 (#1005)
+  * [chore] Bump socket.io-parser to 2.3.0 (#1009)
+  * [chore] Bump engine.io-client to 1.7.1 (#1010)
+  * [chore] Update zuul browser settings (#1011)
+  * [chore] Add Github issue and PR templates (#1013)
+  * [chore] Bump engine.io-client to 1.7.2 and socket.io-parser to 2.3.1 (#1015)
+
+1.5.0 / 2016-10-06
+==================
+
+  * [fix] Fix query string management (#943)
+  * [chore] Add gulp & babel in the build process (#940)
+  * [chore] Add eslint (#951)
+  * [chore] bump zuul (#958)
+  * [chore] Remove jspm browser config (#957)
+  * [chore] Update zuul browser settings following EOL notices (#985)
+  * [chore] Bump zuul to 3.11.0 & zuul-ngrok to 4.0.0 (#997)
+  * [chore] reference build badge to master branch (#967)
+  * [chore] Bump engine.io-client to 1.7.0 (#996)
+  * [chore] Restrict files included in npm package (#998)
+
+1.4.8 / 2016-06-23
+==================
+
+  * package: bump `engine.io-client`
+
+1.4.7 / 2016-06-23
+==================
+
+  * bump engine.io-client
+
+1.4.6 / 2016-05-02
+==================
+
+  * bump engine.io-client
+
+1.4.5 / 2016-01-26
+==================
+
+  * fix `NativeScript` support
+
+1.4.4 / 2016-01-10
+==================
+
+  * bump `engine.io-client`
+
+1.4.3 / 2016-01-08
+==================
+
+  * remove `webpack.config.js`
+
+1.4.2 / 2016-01-07
+==================
+
+  * exclude `ws` instead of `ignore`ing it from build [@lpinca]
+  * add global object as another fallback [@ligaz]
+  * bump `engine.io-client`
+
+1.4.1 / 2016-01-07
+==================
+
+  * package: bump `engine.io-client`
+
+1.4.0 / 2015-11-28
+==================
+
+  * package: bump `engine.io-client`
+  * manager: fix `Object.prototype` extensions
+  * package: bump `zuul` and `zuul-ngrok`
+  * package: bump `debug`
+  * package: bump `socket.io-parser`
+  * package: bump `has-binary`
+  * remove unnecessary `index.js`
+  * added support for `ping` and `pong` events
+  * proper handling of disconnection while in `opening` state
+  * instrumentation / style tweaks
+  * added tests for same-namespace new connection handling
+  * do not call apply if packet id is not in acks
+  * build sio client with make to autogenerate new socket.io.js
+  * bugfix/1956 don't reuse same-namespace connections #2
+  * fix has-binary to work with all objects [gunta]
+  * bugfix/1956 don't reuse same-namespace connections
+  * add support for compression [nkzawa]
+  * fix: location.port was ignored
+
+1.3.7 / 2015-09-21
+==================
+
+  * package: bump `socket.io` for node4 support
+  * package: bump `engine.io-client` for node4 compatibility
+
+1.3.6 / 2015-07-14
+==================
+
+  * package: bump `engine.io-client` to fix build on windows
+
+1.3.5 / 2015-03-03
+==================
+
+ * package: bump parser
+
+1.3.4 / 2015-02-14
+==================
+
+ * build `socket.io.js` with `engine.io-client` `1.5.1`
+
+1.3.3 / 2015-02-03
+==================
+
+ * package: bump parser
+
+1.3.2 / 2015-01-19
+==================
+
+ * build `socket.io.js`
+
+1.3.1 / 2015-01-19
+==================
+
+ * no change on this release
+ * package: bump `engine.io-client` to not depend on `git(1)` for a dep
+
+1.3.0 / 2015-01-19
+==================
+
+ * package: bump `engine.io-client`
+ * added `socket.id` property pointing to session id [rase-]
+ * fix url parsing when uri string is undefined [defunctzombie]
+ * implemented `backo` for exponential backoff with randomization [mokesmokes]
+ * reset reconnection attempts state after a successul connection [mokesmokes]
+
+1.2.1 / 2014-11-21
+==================
+
+ * package: bump `engine.io-client`
+ * README: fixes to prevent duplicate events [nkzawa]
+ * fix reconnection after reconnecting manually [nkzawa]
+ * make ACK callbacks idempotent [thexeos]
+ * package: bump `uglify-js`
+
+1.2.0 / 2014-10-27
+==================
+
+ * bump `engine.io-client`.
+ * set `readyState` before engine.io close event
+ * fix reconnection after reconnecting manually
+ * enable to stop reconnecting
+ * downloads badge
+ * support no schema relative url
+ * enable to reconnect manually
+
+1.1.0 / 2014-09-04
+==================
+
+ * socket: fix in `has-binary`
+ * package: bump `socket.io-parser`
+ * package: bump `engine.io-client`
+ * further increase test timeout.
+ * double to singly quotes in tests.
+ * extend timeout and remember to close everything in each test case
+ * fix travis
+ * add travis + zuul matrix
+ * use svg instead of png to get better image quality in readme
+ * make CI build faster
+ * removed unnecessary code from try block. Only decode packet is needed.
+ * package: bump `browserify`
+ * package: bump `engine.io-client`
+ * fix autoConnect option
+ * npmignore: ignore `.gitignore`
+ * package: update `browserify`
+ * don't fire an extra reconnect when we're not reconnecting
+   after a failed initial connect attempt
+ * package: bump `socket.io-parser` for `component-emitter` dep fix
+ * updated tests to reflect `autoConnect` option
+ * add `autoConnect` option to wait with connecting
+
+1.0.6 / 2014-06-19
+==================
+
+ * test fixes on internet explorer
+ * fixes for duplicate event propagation from manager instance [Rase-]
+
+1.0.5 / 2014-06-16
+==================
+
+ * package: bump `engine.io-client` for better deps and smaller build
+ * handle io.connect(null, opts) correctly [audreyt]
+ * url: fix incorrect ports in certain connections [holic]
+ * manager: propagate all reconnection events to sockets [Rase-]
+ * index: added BC for `force new connection`
+ * socket: fix event buffering while in disconnected state [kevin-roark]
+ * package: stop using tarballs in dependencies [reid]
+ * manager: relay `connect_error` and `connect_timeout` to sockets
+
+1.0.4 / 2014-06-02
+==================
+
+ * update build
+
+1.0.3 / 2014-05-31
+==================
+
+ * package; bump `socket.io-parser` for binary ACK fix
+ * package: bump `engine.io-client` for binary UTF8 fix
+
+1.0.2 / 2014-05-28
+==================
+
+ * package: bump `socket.io-parser` for windows fix
+
+1.0.1 / 2014-05-28
+==================
+
+ * override npm tag
+
+1.0.0 / 2014-05-28
+==================
+
+ * stable release
+
+1.0.0-pre5 / 2014-05-22
+=======================
+
+ * package: bump `engine.io-client` for parser fixes
+
+1.0.0-pre4 / 2014-05-19
+=======================
+
+ * build
+
+1.0.0-pre3 / 2014-05-17
+=======================
+
+ * package: bump parser
+ * package: bump engine.io-client
+
+1.0.0-pre2 / 2014-04-27
+=======================
+
+ * package: bump `engine.io-client`
+ * package: bump `zuul`
+ * allows user-level query string parameters to be in socket.request
+ * package: bump `socket.io-parser`
+ * package: bump `engine.io-client` for android fix
+ * tidy up .gitignore
+
+1.0.0-pre / 2014-03-14
+======================
+
+ * implemented `engine.io-client`
+ * implemented `socket.io-parser`
+ * implemented `json3` to avoid env pollution
+ * implemented `debug`
+ * added binary support
+ * added `browserify` support
+
+0.9.11 / 2012-11-02
+===================
+
+  * Enable use of 'xhr' transport in Node.js
+  * Fix the problem with disconnecting xhr-polling users
+  * Add should to devDependencies
+  * Prefer XmlHttpRequest if CORS is available
+  * Make client compatible with AMD loaders.
+
+0.9.10 / 2012-08-10
+===================
+
+  * fix removeAllListeners to behave as expected.
+  * set withCredentials to true only if xdomain.
+  * socket: disable disconnect on unload by default.
+
+0.9.9 / 2012-08-01
+==================
+
+  * socket: fixed disconnect xhr url and made it actually sync
+  * *: bump xmlhttprequest dep
+
+0.9.8 / 2012-07-24
+==================
+
+  * Fixed build.
+
+0.9.7 / 2012-07-24
+==================
+
+  * iOS websocket crash fix.
+  * Fixed potential `open` collision.
+  * Fixed disconnectSync.
+
+0.9.6 / 2012-04-17
+==================
+
+  * Don't position the jsonp form off the screen (android fix).
+
+0.9.5 / 2012-04-05
+==================
+
+  * Bumped version.
+
+0.9.4 / 2012-04-01
+==================
+
+  * Fixes polling loop upon reconnect advice (fixes #438).
+
+0.9.3 / 2012-03-28
+==================
+
+  * Fix XHR.check, which was throwing an error transparently and causing non-IE browsers to fall back to JSONP [mikito]
+  * Fixed forced disconnect on window close [zzzaaa]
+
+0.9.2 / 2012-03-13
+==================
+
+  * Transport order set by "options" [zzzaaa]
+
+0.9.1-1 / 2012-03-02
+====================
+
+  * Fixed active-x-obfuscator NPM dependency.
+
+0.9.1 / 2012-03-02
+==================
+
+  * Misc corrections.
+  * Added warning within Firefox about webworker test in test runner.
+  * Update ws dependency [einaros]
+  * Implemented client side heartbeat checks. [felixge]
+  * Improved Firewall support with ActiveX obfuscation. [felixge]
+  * Fixed error handling during connection process. [Outsideris]
+
+0.9.0 / 2012-02-26
+==================
+
+  * Added DS_Store to gitignore.
+  * Updated depedencies.
+  * Bumped uglify
+  * Tweaking code so it doesn't throw an exception when used inside a WebWorker in Firefox
+  * Do not rely on Array.prototype.indexOf as it breaks with pages that use the Prototype.js library.
+  * Windows support landed
+  * Use @einaros ws module instead of the old crap one
+  * Fix for broken closeTimeout and 'IE + xhr' goes into infinite loop on disconnection
+  * Disabled reconnection on error if reconnect option is set to false
+  * Set withCredentials to true before xhr to fix authentication
+  * Clears the timeout from reconnection attempt when there is a successful or failed reconnection. 
+    This fixes the issue of setTimeout's carrying over from previous reconnection
+    and changing (skipping) values of self.reconnectionDelay in the newer reconnection.
+  * Removed decoding of parameters when chunking the query string.
+    This was used later on to construct the url to post to the socket.io server
+    for connection and if we're adding custom parameters of our own to this url
+    (for example for OAuth authentication) they were being sent decoded, which is wrong.
+
+0.8.7 / 2011-11-05
+==================
+
+  * Bumped client
+
+0.8.6 / 2011-10-27 
+==================
+
+  * Added WebWorker support.
+  * Fixed swfobject and web_socket.js to not assume window.
+  * Fixed CORS detection for webworker.
+  * Fix `defer` for webkit in a webworker.
+  * Fixed io.util.request to not rely on window.
+  * FIxed; use global instead of window and dont rely on document.
+  * Fixed; JSON-P handshake if CORS is not available.
+  * Made underlying Transport disconnection trigger immediate socket.io disconnect.
+  * Fixed warning when compressing with Google Closure Compiler.
+  * Fixed builder's uglify utf-8 support.
+  * Added workaround for loading indicator in FF jsonp-polling. [3rd-Eden]
+  * Fixed host discovery lookup. [holic]
+  * Fixed close timeout when disconnected/reconnecting. [jscharlach]
+  * Fixed jsonp-polling feature detection.
+  * Fixed jsonp-polling client POSTing of \n.
+  * Fixed test runner on IE6/7
+
+0.8.5 / 2011-10-07
+==================
+
+  * Bumped client
+
+0.8.4 / 2011-09-06
+==================
+
+  * Corrected build
+
+0.8.3 / 2011-09-03
+==================
+
+  * Fixed `\n` parsing for non-JSON packets.
+  * Fixed; make Socket.IO XHTML doctype compatible (fixes #460 from server)
+  * Fixed support for Node.JS running `socket.io-client`.
+  * Updated repository name in `package.json`.
+  * Added support for different policy file ports without having to port
+    forward 843 on the server side [3rd-Eden]
+
+0.8.2 / 2011-08-29
+==================
+
+  * Fixed flashsocket detection.
+
+0.8.1 / 2011-08-29
+==================
+
+  * Bump version.
+
+0.8.0 / 2011-08-28
+==================
+
+  * Added MozWebSocket support (hybi-10 doesn't require API changes) [einaros].
+
+0.7.11 / 2011-08-27
+===================
+
+  * Corrected previous release (missing build).
+
+0.7.10 / 2011-08-27
+===================
+
+  * Fix for failing fallback in websockets
+
+0.7.9 / 2011-08-12
+==================
+
+  * Added check on `Socket#onConnect` to prevent double `connect` events on the main manager.
+  * Fixed socket namespace connect test. Remove broken alternative namespace connect test.
+  * Removed test handler for removed test.
+  * Bumped version to match `socket.io` server.
+
+0.7.5 / 2011-08-08
+==================
+
+  * Added querystring support for `connect` [3rd-Eden]
+  * Added partial Node.JS transports support [3rd-Eden, josephg]
+  * Fixed builder test.
+  * Changed `util.inherit` to replicate Object.create / __proto__.
+  * Changed and cleaned up some acceptance tests.
+  * Fixed race condition with a test that could not be run multiple times.
+  * Added test for encoding a payload.
+  * Added the ability to override the transport to use in acceptance test [3rd-Eden]
+  * Fixed multiple connect packets [DanielBaulig]
+  * Fixed jsonp-polling over-buffering [3rd-Eden]
+  * Fixed ascii preservation in minified socket.io client [3rd-Eden]
+  * Fixed socket.io in situations where the page is not served through utf8.
+  * Fixed namespaces not reconnecting after disconnect [3rd-Eden]
+  * Fixed default port for secure connections.
+
+0.7.4 / 2011-07-12
+==================
+
+  * Added `SocketNamespace#of` shortcut. [3rd-Eden]
+  * Fixed a IE payload decoding bug. [3rd-Eden]
+  * Honor document protocol, unless overriden. [dvv]
+  * Fixed new builder dependencies. [3rd-Eden]
+
+0.7.3 / 2011-06-30 
+==================
+
+  * Fixed; acks don't depend on arity. They're automatic for `.send` and
+    callback based for `.emit`. [dvv]
+  * Added support for sub-sockets authorization. [3rd-Eden]
+  * Added BC support for `new io.connect`. [fat]
+  * Fixed double `connect` events. [3rd-Eden]
+  * Fixed reconnection with jsonp-polling maintaining old sessionid. [franck34]
+
+0.7.2 / 2011-06-22
+==================
+
+  * Added `noop` message type.
+
+0.7.1 / 2011-06-21
+==================
+
+  * Bumped socket.io dependency version for acceptance tests.
+
+0.7.0 / 2011-06-21
+==================
+
+  * http://socket.io/announcement.html
+
diff --git a/wrt/node_modules/socket.io-client/LICENSE b/wrt/node_modules/socket.io-client/LICENSE
new file mode 100644 (file)
index 0000000..9338df1
--- /dev/null
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Guillermo Rauch
+
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
\ No newline at end of file
diff --git a/wrt/node_modules/socket.io-client/README.md b/wrt/node_modules/socket.io-client/README.md
new file mode 100644 (file)
index 0000000..3d13652
--- /dev/null
@@ -0,0 +1,50 @@
+
+# socket.io-client
+
+[![Build Status](https://secure.travis-ci.org/socketio/socket.io-client.svg?branch=master)](http://travis-ci.org/socketio/socket.io-client)
+[![Dependency Status](https://david-dm.org/socketio/socket.io-client.svg)](https://david-dm.org/socketio/socket.io-client)
+[![devDependency Status](https://david-dm.org/socketio/socket.io-client/dev-status.svg)](https://david-dm.org/socketio/socket.io-client#info=devDependencies)
+![NPM version](https://badge.fury.io/js/socket.io-client.svg)
+![Downloads](http://img.shields.io/npm/dm/socket.io-client.svg?style=flat)
+[![](http://slack.socket.io/badge.svg?)](http://slack.socket.io)
+
+[![Sauce Test Status](https://saucelabs.com/browser-matrix/socket.svg)](https://saucelabs.com/u/socket)
+
+## How to use
+
+A standalone build of `socket.io-client` is exposed automatically by the
+socket.io server as `/socket.io/socket.io.js`. Alternatively you can
+serve the file `socket.io.js` found in the `dist` folder.
+
+```html
+<script src="/socket.io/socket.io.js"></script>
+<script>
+  var socket = io('http://localhost');
+  socket.on('connect', function(){});
+  socket.on('event', function(data){});
+  socket.on('disconnect', function(){});
+</script>
+```
+
+A slim build (without `JSON3`, a JSON polyfill for IE6/IE7, and `debug`) is also available: `socket.io.slim.js`.
+
+Socket.IO is compatible with [browserify](http://browserify.org/).
+
+### Node.JS (server-side usage)
+
+  Add `socket.io-client` to your `package.json` and then:
+
+  ```js
+  var socket = require('socket.io-client')('http://localhost');
+  socket.on('connect', function(){});
+  socket.on('event', function(data){});
+  socket.on('disconnect', function(){});
+  ```
+
+## API
+
+See [API](/docs/API.md)
+
+## License
+
+[MIT](/LICENSE)
diff --git a/wrt/node_modules/socket.io-client/dist/socket.io.js b/wrt/node_modules/socket.io-client/dist/socket.io.js
new file mode 100644 (file)
index 0000000..a61d7d0
--- /dev/null
@@ -0,0 +1,3 @@
+!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.io=e():t.io=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return t[r].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t,e){"object"===("undefined"==typeof t?"undefined":o(t))&&(e=t,t=void 0),e=e||{};var n,r=i(t),s=r.source,u=r.id,h=r.path,f=p[u]&&h in p[u].nsps,l=e.forceNew||e["force new connection"]||!1===e.multiplex||f;return l?(c("ignoring socket cache for %s",s),n=a(s,e)):(p[u]||(c("new io instance for %s",s),p[u]=a(s,e)),n=p[u]),r.query&&!e.query&&(e.query=r.query),n.socket(r.path,e)}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=n(1),s=n(7),a=n(13),c=n(3)("socket.io-client");t.exports=e=r;var p=e.managers={};e.protocol=s.protocol,e.connect=r,e.Manager=n(13),e.Socket=n(39)},function(t,e,n){(function(e){"use strict";function r(t,n){var r=t;n=n||e.location,null==t&&(t=n.protocol+"//"+n.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?n.protocol+t:n.host+t),/^(https?|wss?):\/\//.test(t)||(i("protocol-less url %s",t),t="undefined"!=typeof n?n.protocol+"//"+t:"https://"+t),i("parse %s",t),r=o(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";var s=r.host.indexOf(":")!==-1,a=s?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+a+":"+r.port,r.href=r.protocol+"://"+a+(n&&n.port===r.port?"":":"+r.port),r}var o=n(2),i=n(3)("socket.io-client:url");t.exports=r}).call(e,function(){return this}())},function(t,e){var n=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.exports=function(t){var e=t,o=t.indexOf("["),i=t.indexOf("]");o!=-1&&i!=-1&&(t=t.substring(0,o)+t.substring(o,i).replace(/:/g,";")+t.substring(i,t.length));for(var s=n.exec(t||""),a={},c=14;c--;)a[r[c]]=s[c]||"";return o!=-1&&i!=-1&&(a.source=e,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a}},function(t,e,n){(function(r){function o(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function i(t){var n=this.useColors;if(t[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+t[0]+(n?"%c ":" ")+"+"+e.humanize(this.diff),n){var r="color: "+this.color;t.splice(1,0,r,"color: inherit");var o=0,i=0;t[0].replace(/%[a-zA-Z%]/g,function(t){"%%"!==t&&(o++,"%c"===t&&(i=o))}),t.splice(i,0,r)}}function s(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(n){}}function c(){var t;try{t=e.storage.debug}catch(n){}return!t&&"undefined"!=typeof r&&"env"in r&&(t=r.env.DEBUG),t}function p(){try{return window.localStorage}catch(t){}}e=t.exports=n(5),e.log=s,e.formatArgs=i,e.save=a,e.load=c,e.useColors=o,e.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:p(),e.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],e.formatters.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},e.enable(c())}).call(e,n(4))},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(t){if(u===setTimeout)return setTimeout(t,0);if((u===n||!u)&&setTimeout)return u=setTimeout,setTimeout(t,0);try{return u(t,0)}catch(e){try{return u.call(null,t,0)}catch(e){return u.call(this,t,0)}}}function i(t){if(h===clearTimeout)return clearTimeout(t);if((h===r||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(t);try{return h(t)}catch(e){try{return h.call(null,t)}catch(e){return h.call(this,t)}}}function s(){y&&l&&(y=!1,l.length?d=l.concat(d):m=-1,d.length&&a())}function a(){if(!y){var t=o(s);y=!0;for(var e=d.length;e;){for(l=d,d=[];++m<e;)l&&l[m].run();m=-1,e=d.length}l=null,y=!1,i(t)}}function c(t,e){this.fun=t,this.array=e}function p(){}var u,h,f=t.exports={};!function(){try{u="function"==typeof setTimeout?setTimeout:n}catch(t){u=n}try{h="function"==typeof clearTimeout?clearTimeout:r}catch(t){h=r}}();var l,d=[],y=!1,m=-1;f.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];d.push(new c(t,e)),1!==d.length||y||o(a)},c.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=p,f.addListener=p,f.once=p,f.off=p,f.removeListener=p,f.removeAllListeners=p,f.emit=p,f.prependListener=p,f.prependOnceListener=p,f.listeners=function(t){return[]},f.binding=function(t){throw new Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(t){throw new Error("process.chdir is not supported")},f.umask=function(){return 0}},function(t,e,n){function r(t){var n,r=0;for(n in t)r=(r<<5)-r+t.charCodeAt(n),r|=0;return e.colors[Math.abs(r)%e.colors.length]}function o(t){function n(){if(n.enabled){var t=n,r=+new Date,o=r-(p||r);t.diff=o,t.prev=p,t.curr=r,p=r;for(var i=new Array(arguments.length),s=0;s<i.length;s++)i[s]=arguments[s];i[0]=e.coerce(i[0]),"string"!=typeof i[0]&&i.unshift("%O");var a=0;i[0]=i[0].replace(/%([a-zA-Z%])/g,function(n,r){if("%%"===n)return n;a++;var o=e.formatters[r];if("function"==typeof o){var s=i[a];n=o.call(t,s),i.splice(a,1),a--}return n}),e.formatArgs.call(t,i);var c=n.log||e.log||console.log.bind(console);c.apply(t,i)}}return n.namespace=t,n.enabled=e.enabled(t),n.useColors=e.useColors(),n.color=r(t),"function"==typeof e.init&&e.init(n),n}function i(t){e.save(t),e.names=[],e.skips=[];for(var n=("string"==typeof t?t:"").split(/[\s,]+/),r=n.length,o=0;o<r;o++)n[o]&&(t=n[o].replace(/\*/g,".*?"),"-"===t[0]?e.skips.push(new RegExp("^"+t.substr(1)+"$")):e.names.push(new RegExp("^"+t+"$")))}function s(){e.enable("")}function a(t){var n,r;for(n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1}function c(t){return t instanceof Error?t.stack||t.message:t}e=t.exports=o.debug=o["default"]=o,e.coerce=c,e.disable=s,e.enable=i,e.enabled=a,e.humanize=n(6),e.names=[],e.skips=[],e.formatters={};var p},function(t,e){function n(t){if(t=String(t),!(t.length>100)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*u;case"days":case"day":case"d":return n*p;case"hours":case"hour":case"hrs":case"hr":case"h":return n*c;case"minutes":case"minute":case"mins":case"min":case"m":return n*a;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function r(t){return t>=p?Math.round(t/p)+"d":t>=c?Math.round(t/c)+"h":t>=a?Math.round(t/a)+"m":t>=s?Math.round(t/s)+"s":t+"ms"}function o(t){return i(t,p,"day")||i(t,c,"hour")||i(t,a,"minute")||i(t,s,"second")||t+" ms"}function i(t,e,n){if(!(t<e))return t<1.5*e?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}var s=1e3,a=60*s,c=60*a,p=24*c,u=365.25*p;t.exports=function(t,e){e=e||{};var i=typeof t;if("string"===i&&t.length>0)return n(t);if("number"===i&&isNaN(t)===!1)return e["long"]?o(t):r(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},function(t,e,n){function r(){}function o(t){var n=""+t.type;return e.BINARY_EVENT!==t.type&&e.BINARY_ACK!==t.type||(n+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(n+=t.nsp+","),null!=t.id&&(n+=t.id),null!=t.data&&(n+=JSON.stringify(t.data)),h("encoded %j as %s",t,n),n}function i(t,e){function n(t){var n=d.deconstructPacket(t),r=o(n.packet),i=n.buffers;i.unshift(r),e(i)}d.removeBlobs(t,n)}function s(){this.reconstructor=null}function a(t){var n=0,r={type:Number(t.charAt(0))};if(null==e.types[r.type])return u();if(e.BINARY_EVENT===r.type||e.BINARY_ACK===r.type){for(var o="";"-"!==t.charAt(++n)&&(o+=t.charAt(n),n!=t.length););if(o!=Number(o)||"-"!==t.charAt(n))throw new Error("Illegal attachments");r.attachments=Number(o)}if("/"===t.charAt(n+1))for(r.nsp="";++n;){var i=t.charAt(n);if(","===i)break;if(r.nsp+=i,n===t.length)break}else r.nsp="/";var s=t.charAt(n+1);if(""!==s&&Number(s)==s){for(r.id="";++n;){var i=t.charAt(n);if(null==i||Number(i)!=i){--n;break}if(r.id+=t.charAt(n),n===t.length)break}r.id=Number(r.id)}return t.charAt(++n)&&(r=c(r,t.substr(n))),h("decoded %s as %j",t,r),r}function c(t,e){try{t.data=JSON.parse(e)}catch(n){return u()}return t}function p(t){this.reconPack=t,this.buffers=[]}function u(){return{type:e.ERROR,data:"parser error"}}var h=n(3)("socket.io-parser"),f=n(8),l=n(9),d=n(11),y=n(12);e.protocol=4,e.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],e.CONNECT=0,e.DISCONNECT=1,e.EVENT=2,e.ACK=3,e.ERROR=4,e.BINARY_EVENT=5,e.BINARY_ACK=6,e.Encoder=r,e.Decoder=s,r.prototype.encode=function(t,n){if(t.type!==e.EVENT&&t.type!==e.ACK||!l(t.data)||(t.type=t.type===e.EVENT?e.BINARY_EVENT:e.BINARY_ACK),h("encoding packet %j",t),e.BINARY_EVENT===t.type||e.BINARY_ACK===t.type)i(t,n);else{var r=o(t);n([r])}},f(s.prototype),s.prototype.add=function(t){var n;if("string"==typeof t)n=a(t),e.BINARY_EVENT===n.type||e.BINARY_ACK===n.type?(this.reconstructor=new p(n),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",n)):this.emit("decoded",n);else{if(!y(t)&&!t.base64)throw new Error("Unknown type: "+t);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,this.emit("decoded",n))}},s.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},p.prototype.takeBinaryData=function(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){var e=d.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null},p.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},function(t,e,n){function r(t){if(t)return o(t)}function o(t){for(var e in r.prototype)t[e]=r.prototype[e];return t}t.exports=r,r.prototype.on=r.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},r.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var r,o=0;o<n.length;o++)if(r=n[o],r===e||r.fn===e){n.splice(o,1);break}return this},r.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),n=this._callbacks["$"+t];if(n){n=n.slice(0);for(var r=0,o=n.length;r<o;++r)n[r].apply(this,e)}return this},r.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},r.prototype.hasListeners=function(t){return!!this.listeners(t).length}},function(t,e,n){(function(e){function r(t){if(!t||"object"!=typeof t)return!1;if(o(t)){for(var n=0,i=t.length;n<i;n++)if(r(t[n]))return!0;return!1}if("function"==typeof e.Buffer&&e.Buffer.isBuffer&&e.Buffer.isBuffer(t)||"function"==typeof e.ArrayBuffer&&t instanceof ArrayBuffer||s&&t instanceof Blob||a&&t instanceof File)return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return r(t.toJSON(),!0);for(var c in t)if(Object.prototype.hasOwnProperty.call(t,c)&&r(t[c]))return!0;return!1}var o=n(10),i=Object.prototype.toString,s="function"==typeof e.Blob||"[object BlobConstructor]"===i.call(e.Blob),a="function"==typeof e.File||"[object FileConstructor]"===i.call(e.File);t.exports=r}).call(e,function(){return this}())},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){(function(t){function r(t,e){if(!t)return t;if(s(t)){var n={_placeholder:!0,num:e.length};return e.push(t),n}if(i(t)){for(var o=new Array(t.length),a=0;a<t.length;a++)o[a]=r(t[a],e);return o}if("object"==typeof t&&!(t instanceof Date)){var o={};for(var c in t)o[c]=r(t[c],e);return o}return t}function o(t,e){if(!t)return t;if(t&&t._placeholder)return e[t.num];if(i(t))for(var n=0;n<t.length;n++)t[n]=o(t[n],e);else if("object"==typeof t)for(var r in t)t[r]=o(t[r],e);return t}var i=n(10),s=n(12),a=Object.prototype.toString,c="function"==typeof t.Blob||"[object BlobConstructor]"===a.call(t.Blob),p="function"==typeof t.File||"[object FileConstructor]"===a.call(t.File);e.deconstructPacket=function(t){var e=[],n=t.data,o=t;return o.data=r(n,e),o.attachments=e.length,{packet:o,buffers:e}},e.reconstructPacket=function(t,e){return t.data=o(t.data,e),t.attachments=void 0,t},e.removeBlobs=function(t,e){function n(t,a,u){if(!t)return t;if(c&&t instanceof Blob||p&&t instanceof File){r++;var h=new FileReader;h.onload=function(){u?u[a]=this.result:o=this.result,--r||e(o)},h.readAsArrayBuffer(t)}else if(i(t))for(var f=0;f<t.length;f++)n(t[f],f,t);else if("object"==typeof t&&!s(t))for(var l in t)n(t[l],l,t)}var r=0,o=t;n(o),r||e(o)}}).call(e,function(){return this}())},function(t,e){(function(e){function n(t){return e.Buffer&&e.Buffer.isBuffer(t)||e.ArrayBuffer&&t instanceof ArrayBuffer}t.exports=n}).call(e,function(){return this}())},function(t,e,n){"use strict";function r(t,e){if(!(this instanceof r))return new r(t,e);t&&"object"===("undefined"==typeof t?"undefined":o(t))&&(e=t,t=void 0),e=e||{},e.path=e.path||"/socket.io",this.nsps={},this.subs=[],this.opts=e,this.reconnection(e.reconnection!==!1),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor(e.randomizationFactor||.5),this.backoff=new l({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==e.timeout?2e4:e.timeout),this.readyState="closed",this.uri=t,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var n=e.parser||c;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this.autoConnect=e.autoConnect!==!1,this.autoConnect&&this.open()}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=n(14),s=n(39),a=n(8),c=n(7),p=n(41),u=n(42),h=n(3)("socket.io-client:manager"),f=n(37),l=n(43),d=Object.prototype.hasOwnProperty;t.exports=r,r.prototype.emitAll=function(){this.emit.apply(this,arguments);for(var t in this.nsps)d.call(this.nsps,t)&&this.nsps[t].emit.apply(this.nsps[t],arguments)},r.prototype.updateSocketIds=function(){for(var t in this.nsps)d.call(this.nsps,t)&&(this.nsps[t].id=this.generateId(t))},r.prototype.generateId=function(t){return("/"===t?"":t+"#")+this.engine.id},a(r.prototype),r.prototype.reconnection=function(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection},r.prototype.reconnectionAttempts=function(t){return arguments.length?(this._reconnectionAttempts=t,this):this._reconnectionAttempts},r.prototype.reconnectionDelay=function(t){return arguments.length?(this._reconnectionDelay=t,this.backoff&&this.backoff.setMin(t),this):this._reconnectionDelay},r.prototype.randomizationFactor=function(t){return arguments.length?(this._randomizationFactor=t,this.backoff&&this.backoff.setJitter(t),this):this._randomizationFactor},r.prototype.reconnectionDelayMax=function(t){return arguments.length?(this._reconnectionDelayMax=t,this.backoff&&this.backoff.setMax(t),this):this._reconnectionDelayMax},r.prototype.timeout=function(t){return arguments.length?(this._timeout=t,this):this._timeout},r.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},r.prototype.open=r.prototype.connect=function(t,e){if(h("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;h("opening %s",this.uri),this.engine=i(this.uri,this.opts);var n=this.engine,r=this;this.readyState="opening",this.skipReconnect=!1;var o=p(n,"open",function(){r.onopen(),t&&t()}),s=p(n,"error",function(e){if(h("connect_error"),r.cleanup(),r.readyState="closed",r.emitAll("connect_error",e),t){var n=new Error("Connection error");n.data=e,t(n)}else r.maybeReconnectOnOpen()});if(!1!==this._timeout){var a=this._timeout;h("connect attempt will timeout after %d",a);var c=setTimeout(function(){h("connect attempt timed out after %d",a),o.destroy(),n.close(),n.emit("error","timeout"),r.emitAll("connect_timeout",a)},a);this.subs.push({destroy:function(){clearTimeout(c)}})}return this.subs.push(o),this.subs.push(s),this},r.prototype.onopen=function(){h("open"),this.cleanup(),this.readyState="open",this.emit("open");var t=this.engine;this.subs.push(p(t,"data",u(this,"ondata"))),this.subs.push(p(t,"ping",u(this,"onping"))),this.subs.push(p(t,"pong",u(this,"onpong"))),this.subs.push(p(t,"error",u(this,"onerror"))),this.subs.push(p(t,"close",u(this,"onclose"))),this.subs.push(p(this.decoder,"decoded",u(this,"ondecoded")))},r.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},r.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},r.prototype.ondata=function(t){this.decoder.add(t)},r.prototype.ondecoded=function(t){this.emit("packet",t)},r.prototype.onerror=function(t){h("error",t),this.emitAll("error",t)},r.prototype.socket=function(t,e){function n(){~f(o.connecting,r)||o.connecting.push(r)}var r=this.nsps[t];if(!r){r=new s(this,t,e),this.nsps[t]=r;var o=this;r.on("connecting",n),r.on("connect",function(){r.id=o.generateId(t)}),this.autoConnect&&n()}return r},r.prototype.destroy=function(t){var e=f(this.connecting,t);~e&&this.connecting.splice(e,1),this.connecting.length||this.close()},r.prototype.packet=function(t){h("writing packet %j",t);var e=this;t.query&&0===t.type&&(t.nsp+="?"+t.query),e.encoding?e.packetBuffer.push(t):(e.encoding=!0,this.encoder.encode(t,function(n){for(var r=0;r<n.length;r++)e.engine.write(n[r],t.options);e.encoding=!1,e.processPacketQueue()}))},r.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var t=this.packetBuffer.shift();this.packet(t)}},r.prototype.cleanup=function(){h("cleanup");for(var t=this.subs.length,e=0;e<t;e++){var n=this.subs.shift();n.destroy()}this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},r.prototype.close=r.prototype.disconnect=function(){h("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,"opening"===this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},r.prototype.onclose=function(t){h("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",t),this._reconnection&&!this.skipReconnect&&this.reconnect()},r.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var t=this;if(this.backoff.attempts>=this._reconnectionAttempts)h("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var e=this.backoff.duration();h("will wait %dms before reconnect attempt",e),this.reconnecting=!0;var n=setTimeout(function(){t.skipReconnect||(h("attempting reconnect"),t.emitAll("reconnect_attempt",t.backoff.attempts),t.emitAll("reconnecting",t.backoff.attempts),t.skipReconnect||t.open(function(e){e?(h("reconnect attempt error"),t.reconnecting=!1,t.reconnect(),t.emitAll("reconnect_error",e.data)):(h("reconnect success"),t.onreconnect())}))},e);this.subs.push({destroy:function(){clearTimeout(n)}})}},r.prototype.onreconnect=function(){var t=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",t)}},function(t,e,n){t.exports=n(15)},function(t,e,n){t.exports=n(16),t.exports.parser=n(23)},function(t,e,n){(function(e){function r(t,n){if(!(this instanceof r))return new r(t,n);n=n||{},t&&"object"==typeof t&&(n=t,t=null),t?(t=u(t),n.hostname=t.host,n.secure="https"===t.protocol||"wss"===t.protocol,n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=u(n.host).host),this.secure=null!=n.secure?n.secure:e.location&&"https:"===location.protocol,n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.agent=n.agent||!1,this.hostname=n.hostname||(e.location?location.hostname:"localhost"),this.port=n.port||(e.location&&location.port?location.port:this.secure?443:80),this.query=n.query||{},"string"==typeof this.query&&(this.query=f.decode(this.query)),this.upgrade=!1!==n.upgrade,this.path=(n.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!n.forceJSONP,this.jsonp=!1!==n.jsonp,this.forceBase64=!!n.forceBase64,this.enablesXDR=!!n.enablesXDR,this.timestampParam=n.timestampParam||"t",this.timestampRequests=n.timestampRequests,this.transports=n.transports||["polling","websocket"],this.transportOptions=n.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=n.policyPort||843,this.rememberUpgrade=n.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=n.onlyBinaryUpgrades,this.perMessageDeflate=!1!==n.perMessageDeflate&&(n.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=n.pfx||null,this.key=n.key||null,this.passphrase=n.passphrase||null,this.cert=n.cert||null,this.ca=n.ca||null,this.ciphers=n.ciphers||null,this.rejectUnauthorized=void 0===n.rejectUnauthorized||n.rejectUnauthorized,this.forceNode=!!n.forceNode;var o="object"==typeof e&&e;o.global===o&&(n.extraHeaders&&Object.keys(n.extraHeaders).length>0&&(this.extraHeaders=n.extraHeaders),n.localAddress&&(this.localAddress=n.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}function o(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}var i=n(17),s=n(8),a=n(3)("engine.io-client:socket"),c=n(37),p=n(23),u=n(2),h=n(38),f=n(31);t.exports=r,r.priorWebsocketSuccess=!1,s(r.prototype),r.protocol=p.protocol,r.Socket=r,r.Transport=n(22),r.transports=n(17),r.parser=n(23),r.prototype.createTransport=function(t){a('creating transport "%s"',t);var e=o(this.query);e.EIO=p.protocol,e.transport=t;var n=this.transportOptions[t]||{};this.id&&(e.sid=this.id);var r=new i[t]({query:e,socket:this,agent:n.agent||this.agent,hostname:n.hostname||this.hostname,port:n.port||this.port,secure:n.secure||this.secure,path:n.path||this.path,forceJSONP:n.forceJSONP||this.forceJSONP,jsonp:n.jsonp||this.jsonp,forceBase64:n.forceBase64||this.forceBase64,enablesXDR:n.enablesXDR||this.enablesXDR,timestampRequests:n.timestampRequests||this.timestampRequests,timestampParam:n.timestampParam||this.timestampParam,policyPort:n.policyPort||this.policyPort,pfx:n.pfx||this.pfx,key:n.key||this.key,passphrase:n.passphrase||this.passphrase,cert:n.cert||this.cert,ca:n.ca||this.ca,ciphers:n.ciphers||this.ciphers,rejectUnauthorized:n.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:n.perMessageDeflate||this.perMessageDeflate,extraHeaders:n.extraHeaders||this.extraHeaders,forceNode:n.forceNode||this.forceNode,localAddress:n.localAddress||this.localAddress,requestTimeout:n.requestTimeout||this.requestTimeout,protocols:n.protocols||void 0});return r},r.prototype.open=function(){var t;if(this.rememberUpgrade&&r.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else{if(0===this.transports.length){var e=this;return void setTimeout(function(){e.emit("error","No transports available")},0)}t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(n){return this.transports.shift(),void this.open()}t.open(),this.setTransport(t)},r.prototype.setTransport=function(t){a("setting transport %s",t.name);var e=this;this.transport&&(a("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=t,t.on("drain",function(){e.onDrain()}).on("packet",function(t){e.onPacket(t)}).on("error",function(t){e.onError(t)}).on("close",function(){e.onClose("transport close")})},r.prototype.probe=function(t){function e(){if(f.onlyBinaryUpgrades){var e=!this.supportsBinary&&f.transport.supportsBinary;h=h||e}h||(a('probe transport "%s" opened',t),u.send([{type:"ping",data:"probe"}]),u.once("packet",function(e){if(!h)if("pong"===e.type&&"probe"===e.data){if(a('probe transport "%s" pong',t),f.upgrading=!0,f.emit("upgrading",u),!u)return;r.priorWebsocketSuccess="websocket"===u.name,a('pausing current transport "%s"',f.transport.name),f.transport.pause(function(){h||"closed"!==f.readyState&&(a("changing transport and sending upgrade packet"),p(),f.setTransport(u),u.send([{type:"upgrade"}]),f.emit("upgrade",u),u=null,f.upgrading=!1,f.flush())})}else{a('probe transport "%s" failed',t);var n=new Error("probe error");n.transport=u.name,f.emit("upgradeError",n)}}))}function n(){h||(h=!0,p(),u.close(),u=null)}function o(e){var r=new Error("probe error: "+e);r.transport=u.name,n(),a('probe transport "%s" failed because of error: %s',t,e),f.emit("upgradeError",r)}function i(){o("transport closed")}function s(){o("socket closed")}function c(t){u&&t.name!==u.name&&(a('"%s" works - aborting "%s"',t.name,u.name),n())}function p(){u.removeListener("open",e),u.removeListener("error",o),u.removeListener("close",i),f.removeListener("close",s),f.removeListener("upgrading",c)}a('probing transport "%s"',t);var u=this.createTransport(t,{probe:1}),h=!1,f=this;r.priorWebsocketSuccess=!1,u.once("open",e),u.once("error",o),u.once("close",i),this.once("close",s),this.once("upgrading",c),u.open()},r.prototype.onOpen=function(){if(a("socket open"),this.readyState="open",r.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){a("starting upgrade probes");for(var t=0,e=this.upgrades.length;t<e;t++)this.probe(this.upgrades[t])}},r.prototype.onPacket=function(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(a('socket receive: type "%s", data "%s"',t.type,t.data),this.emit("packet",t),this.emit("heartbeat"),t.type){case"open":this.onHandshake(h(t.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var e=new Error("server error");e.code=t.data,this.onError(e);break;case"message":this.emit("data",t.data),this.emit("message",t.data)}else a('packet received with socket readyState "%s"',this.readyState)},r.prototype.onHandshake=function(t){this.emit("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.onOpen(),"closed"!==this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},r.prototype.onHeartbeat=function(t){clearTimeout(this.pingTimeoutTimer);var e=this;e.pingTimeoutTimer=setTimeout(function(){"closed"!==e.readyState&&e.onClose("ping timeout")},t||e.pingInterval+e.pingTimeout)},r.prototype.setPing=function(){var t=this;clearTimeout(t.pingIntervalTimer),t.pingIntervalTimer=setTimeout(function(){a("writing ping packet - expecting pong within %sms",t.pingTimeout),t.ping(),t.onHeartbeat(t.pingTimeout)},t.pingInterval)},r.prototype.ping=function(){var t=this;this.sendPacket("ping",function(){t.emit("ping")})},r.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()},r.prototype.flush=function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(a("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},r.prototype.write=r.prototype.send=function(t,e,n){return this.sendPacket("message",t,e,n),this},r.prototype.sendPacket=function(t,e,n,r){if("function"==typeof e&&(r=e,e=void 0),"function"==typeof n&&(r=n,n=null),"closing"!==this.readyState&&"closed"!==this.readyState){n=n||{},n.compress=!1!==n.compress;var o={type:t,data:e,options:n};this.emit("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}},r.prototype.close=function(){function t(){r.onClose("forced close"),a("socket closing - telling transport to close"),r.transport.close()}function e(){r.removeListener("upgrade",e),r.removeListener("upgradeError",e),t()}function n(){r.once("upgrade",e),r.once("upgradeError",e)}if("opening"===this.readyState||"open"===this.readyState){this.readyState="closing";var r=this;this.writeBuffer.length?this.once("drain",function(){this.upgrading?n():t()}):this.upgrading?n():t()}return this},r.prototype.onError=function(t){a("socket error %j",t),r.priorWebsocketSuccess=!1,this.emit("error",t),this.onClose("transport error",t)},r.prototype.onClose=function(t,e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){a('socket close with reason: "%s"',t);var n=this;clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",t,e),n.writeBuffer=[],n.prevBufferLen=0}},r.prototype.filterUpgrades=function(t){for(var e=[],n=0,r=t.length;n<r;n++)~c(this.transports,t[n])&&e.push(t[n]);return e}}).call(e,function(){return this}())},function(t,e,n){(function(t){function r(e){var n,r=!1,a=!1,c=!1!==e.jsonp;if(t.location){var p="https:"===location.protocol,u=location.port;u||(u=p?443:80),r=e.hostname!==location.hostname||u!==e.port,a=e.secure!==p}if(e.xdomain=r,e.xscheme=a,n=new o(e),"open"in n&&!e.forceJSONP)return new i(e);if(!c)throw new Error("JSONP disabled");return new s(e)}var o=n(18),i=n(20),s=n(34),a=n(35);e.polling=r,e.websocket=a}).call(e,function(){return this}())},function(t,e,n){(function(e){var r=n(19);t.exports=function(t){var n=t.xdomain,o=t.xscheme,i=t.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!n||r))return new XMLHttpRequest}catch(s){}try{if("undefined"!=typeof XDomainRequest&&!o&&i)return new XDomainRequest}catch(s){}if(!n)try{
+return new(e[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(s){}}}).call(e,function(){return this}())},function(t,e){try{t.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(n){t.exports=!1}},function(t,e,n){(function(e){function r(){}function o(t){if(c.call(this,t),this.requestTimeout=t.requestTimeout,this.extraHeaders=t.extraHeaders,e.location){var n="https:"===location.protocol,r=location.port;r||(r=n?443:80),this.xd=t.hostname!==e.location.hostname||r!==t.port,this.xs=t.secure!==n}}function i(t){this.method=t.method||"GET",this.uri=t.uri,this.xd=!!t.xd,this.xs=!!t.xs,this.async=!1!==t.async,this.data=void 0!==t.data?t.data:null,this.agent=t.agent,this.isBinary=t.isBinary,this.supportsBinary=t.supportsBinary,this.enablesXDR=t.enablesXDR,this.requestTimeout=t.requestTimeout,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.extraHeaders=t.extraHeaders,this.create()}function s(){for(var t in i.requests)i.requests.hasOwnProperty(t)&&i.requests[t].abort()}var a=n(18),c=n(21),p=n(8),u=n(32),h=n(3)("engine.io-client:polling-xhr");t.exports=o,t.exports.Request=i,u(o,c),o.prototype.supportsBinary=!0,o.prototype.request=function(t){return t=t||{},t.uri=this.uri(),t.xd=this.xd,t.xs=this.xs,t.agent=this.agent||!1,t.supportsBinary=this.supportsBinary,t.enablesXDR=this.enablesXDR,t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized,t.requestTimeout=this.requestTimeout,t.extraHeaders=this.extraHeaders,new i(t)},o.prototype.doWrite=function(t,e){var n="string"!=typeof t&&void 0!==t,r=this.request({method:"POST",data:t,isBinary:n}),o=this;r.on("success",e),r.on("error",function(t){o.onError("xhr post error",t)}),this.sendXhr=r},o.prototype.doPoll=function(){h("xhr poll");var t=this.request(),e=this;t.on("data",function(t){e.onData(t)}),t.on("error",function(t){e.onError("xhr poll error",t)}),this.pollXhr=t},p(i.prototype),i.prototype.create=function(){var t={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized;var n=this.xhr=new a(t),r=this;try{h("xhr open %s: %s",this.method,this.uri),n.open(this.method,this.uri,this.async);try{if(this.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(var o in this.extraHeaders)this.extraHeaders.hasOwnProperty(o)&&n.setRequestHeader(o,this.extraHeaders[o])}}catch(s){}if("POST"===this.method)try{this.isBinary?n.setRequestHeader("Content-type","application/octet-stream"):n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(s){}try{n.setRequestHeader("Accept","*/*")}catch(s){}"withCredentials"in n&&(n.withCredentials=!0),this.requestTimeout&&(n.timeout=this.requestTimeout),this.hasXDR()?(n.onload=function(){r.onLoad()},n.onerror=function(){r.onError(n.responseText)}):n.onreadystatechange=function(){if(2===n.readyState){var t;try{t=n.getResponseHeader("Content-Type")}catch(e){}"application/octet-stream"===t&&(n.responseType="arraybuffer")}4===n.readyState&&(200===n.status||1223===n.status?r.onLoad():setTimeout(function(){r.onError(n.status)},0))},h("xhr data %s",this.data),n.send(this.data)}catch(s){return void setTimeout(function(){r.onError(s)},0)}e.document&&(this.index=i.requestsCount++,i.requests[this.index]=this)},i.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},i.prototype.onData=function(t){this.emit("data",t),this.onSuccess()},i.prototype.onError=function(t){this.emit("error",t),this.cleanup(!0)},i.prototype.cleanup=function(t){if("undefined"!=typeof this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=r:this.xhr.onreadystatechange=r,t)try{this.xhr.abort()}catch(n){}e.document&&delete i.requests[this.index],this.xhr=null}},i.prototype.onLoad=function(){var t;try{var e;try{e=this.xhr.getResponseHeader("Content-Type")}catch(n){}t="application/octet-stream"===e?this.xhr.response||this.xhr.responseText:this.xhr.responseText}catch(n){this.onError(n)}null!=t&&this.onData(t)},i.prototype.hasXDR=function(){return"undefined"!=typeof e.XDomainRequest&&!this.xs&&this.enablesXDR},i.prototype.abort=function(){this.cleanup()},i.requestsCount=0,i.requests={},e.document&&(e.attachEvent?e.attachEvent("onunload",s):e.addEventListener&&e.addEventListener("beforeunload",s,!1))}).call(e,function(){return this}())},function(t,e,n){function r(t){var e=t&&t.forceBase64;u&&!e||(this.supportsBinary=!1),o.call(this,t)}var o=n(22),i=n(31),s=n(23),a=n(32),c=n(33),p=n(3)("engine.io-client:polling");t.exports=r;var u=function(){var t=n(18),e=new t({xdomain:!1});return null!=e.responseType}();a(r,o),r.prototype.name="polling",r.prototype.doOpen=function(){this.poll()},r.prototype.pause=function(t){function e(){p("paused"),n.readyState="paused",t()}var n=this;if(this.readyState="pausing",this.polling||!this.writable){var r=0;this.polling&&(p("we are currently polling - waiting to pause"),r++,this.once("pollComplete",function(){p("pre-pause polling complete"),--r||e()})),this.writable||(p("we are currently writing - waiting to pause"),r++,this.once("drain",function(){p("pre-pause writing complete"),--r||e()}))}else e()},r.prototype.poll=function(){p("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},r.prototype.onData=function(t){var e=this;p("polling got data %s",t);var n=function(t,n,r){return"opening"===e.readyState&&e.onOpen(),"close"===t.type?(e.onClose(),!1):void e.onPacket(t)};s.decodePayload(t,this.socket.binaryType,n),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():p('ignoring poll - transport state "%s"',this.readyState))},r.prototype.doClose=function(){function t(){p("writing close packet"),e.write([{type:"close"}])}var e=this;"open"===this.readyState?(p("transport open - closing"),t()):(p("transport not open - deferring close"),this.once("open",t))},r.prototype.write=function(t){var e=this;this.writable=!1;var n=function(){e.writable=!0,e.emit("drain")};s.encodePayload(t,this.supportsBinary,function(t){e.doWrite(t,n)})},r.prototype.uri=function(){var t=this.query||{},e=this.secure?"https":"http",n="";!1!==this.timestampRequests&&(t[this.timestampParam]=c()),this.supportsBinary||t.sid||(t.b64=1),t=i.encode(t),this.port&&("https"===e&&443!==Number(this.port)||"http"===e&&80!==Number(this.port))&&(n=":"+this.port),t.length&&(t="?"+t);var r=this.hostname.indexOf(":")!==-1;return e+"://"+(r?"["+this.hostname+"]":this.hostname)+n+this.path+t}},function(t,e,n){function r(t){this.path=t.path,this.hostname=t.hostname,this.port=t.port,this.secure=t.secure,this.query=t.query,this.timestampParam=t.timestampParam,this.timestampRequests=t.timestampRequests,this.readyState="",this.agent=t.agent||!1,this.socket=t.socket,this.enablesXDR=t.enablesXDR,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.forceNode=t.forceNode,this.extraHeaders=t.extraHeaders,this.localAddress=t.localAddress}var o=n(23),i=n(8);t.exports=r,i(r.prototype),r.prototype.onError=function(t,e){var n=new Error(t);return n.type="TransportError",n.description=e,this.emit("error",n),this},r.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},r.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},r.prototype.send=function(t){if("open"!==this.readyState)throw new Error("Transport not open");this.write(t)},r.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},r.prototype.onData=function(t){var e=o.decodePacket(t,this.socket.binaryType);this.onPacket(e)},r.prototype.onPacket=function(t){this.emit("packet",t)},r.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},function(t,e,n){(function(t){function r(t,n){var r="b"+e.packets[t.type]+t.data.data;return n(r)}function o(t,n,r){if(!n)return e.encodeBase64Packet(t,r);var o=t.data,i=new Uint8Array(o),s=new Uint8Array(1+o.byteLength);s[0]=v[t.type];for(var a=0;a<i.length;a++)s[a+1]=i[a];return r(s.buffer)}function i(t,n,r){if(!n)return e.encodeBase64Packet(t,r);var o=new FileReader;return o.onload=function(){t.data=o.result,e.encodePacket(t,n,!0,r)},o.readAsArrayBuffer(t.data)}function s(t,n,r){if(!n)return e.encodeBase64Packet(t,r);if(g)return i(t,n,r);var o=new Uint8Array(1);o[0]=v[t.type];var s=new k([o.buffer,t.data]);return r(s)}function a(t){try{t=d.decode(t,{strict:!1})}catch(e){return!1}return t}function c(t,e,n){for(var r=new Array(t.length),o=l(t.length,n),i=function(t,n,o){e(n,function(e,n){r[t]=n,o(e,r)})},s=0;s<t.length;s++)i(s,t[s],o)}var p,u=n(24),h=n(9),f=n(25),l=n(26),d=n(27);t&&t.ArrayBuffer&&(p=n(29));var y="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),m="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),g=y||m;e.protocol=3;var v=e.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},b=u(v),w={type:"error",data:"parser error"},k=n(30);e.encodePacket=function(e,n,i,a){"function"==typeof n&&(a=n,n=!1),"function"==typeof i&&(a=i,i=null);var c=void 0===e.data?void 0:e.data.buffer||e.data;if(t.ArrayBuffer&&c instanceof ArrayBuffer)return o(e,n,a);if(k&&c instanceof t.Blob)return s(e,n,a);if(c&&c.base64)return r(e,a);var p=v[e.type];return void 0!==e.data&&(p+=i?d.encode(String(e.data),{strict:!1}):String(e.data)),a(""+p)},e.encodeBase64Packet=function(n,r){var o="b"+e.packets[n.type];if(k&&n.data instanceof t.Blob){var i=new FileReader;return i.onload=function(){var t=i.result.split(",")[1];r(o+t)},i.readAsDataURL(n.data)}var s;try{s=String.fromCharCode.apply(null,new Uint8Array(n.data))}catch(a){for(var c=new Uint8Array(n.data),p=new Array(c.length),u=0;u<c.length;u++)p[u]=c[u];s=String.fromCharCode.apply(null,p)}return o+=t.btoa(s),r(o)},e.decodePacket=function(t,n,r){if(void 0===t)return w;if("string"==typeof t){if("b"===t.charAt(0))return e.decodeBase64Packet(t.substr(1),n);if(r&&(t=a(t),t===!1))return w;var o=t.charAt(0);return Number(o)==o&&b[o]?t.length>1?{type:b[o],data:t.substring(1)}:{type:b[o]}:w}var i=new Uint8Array(t),o=i[0],s=f(t,1);return k&&"blob"===n&&(s=new k([s])),{type:b[o],data:s}},e.decodeBase64Packet=function(t,e){var n=b[t.charAt(0)];if(!p)return{type:n,data:{base64:!0,data:t.substr(1)}};var r=p.decode(t.substr(1));return"blob"===e&&k&&(r=new k([r])),{type:n,data:r}},e.encodePayload=function(t,n,r){function o(t){return t.length+":"+t}function i(t,r){e.encodePacket(t,!!s&&n,!1,function(t){r(null,o(t))})}"function"==typeof n&&(r=n,n=null);var s=h(t);return n&&s?k&&!g?e.encodePayloadAsBlob(t,r):e.encodePayloadAsArrayBuffer(t,r):t.length?void c(t,i,function(t,e){return r(e.join(""))}):r("0:")},e.decodePayload=function(t,n,r){if("string"!=typeof t)return e.decodePayloadAsBinary(t,n,r);"function"==typeof n&&(r=n,n=null);var o;if(""===t)return r(w,0,1);for(var i,s,a="",c=0,p=t.length;c<p;c++){var u=t.charAt(c);if(":"===u){if(""===a||a!=(i=Number(a)))return r(w,0,1);if(s=t.substr(c+1,i),a!=s.length)return r(w,0,1);if(s.length){if(o=e.decodePacket(s,n,!1),w.type===o.type&&w.data===o.data)return r(w,0,1);var h=r(o,c+i,p);if(!1===h)return}c+=i,a=""}else a+=u}return""!==a?r(w,0,1):void 0},e.encodePayloadAsArrayBuffer=function(t,n){function r(t,n){e.encodePacket(t,!0,!0,function(t){return n(null,t)})}return t.length?void c(t,r,function(t,e){var r=e.reduce(function(t,e){var n;return n="string"==typeof e?e.length:e.byteLength,t+n.toString().length+n+2},0),o=new Uint8Array(r),i=0;return e.forEach(function(t){var e="string"==typeof t,n=t;if(e){for(var r=new Uint8Array(t.length),s=0;s<t.length;s++)r[s]=t.charCodeAt(s);n=r.buffer}e?o[i++]=0:o[i++]=1;for(var a=n.byteLength.toString(),s=0;s<a.length;s++)o[i++]=parseInt(a[s]);o[i++]=255;for(var r=new Uint8Array(n),s=0;s<r.length;s++)o[i++]=r[s]}),n(o.buffer)}):n(new ArrayBuffer(0))},e.encodePayloadAsBlob=function(t,n){function r(t,n){e.encodePacket(t,!0,!0,function(t){var e=new Uint8Array(1);if(e[0]=1,"string"==typeof t){for(var r=new Uint8Array(t.length),o=0;o<t.length;o++)r[o]=t.charCodeAt(o);t=r.buffer,e[0]=0}for(var i=t instanceof ArrayBuffer?t.byteLength:t.size,s=i.toString(),a=new Uint8Array(s.length+1),o=0;o<s.length;o++)a[o]=parseInt(s[o]);if(a[s.length]=255,k){var c=new k([e.buffer,a.buffer,t]);n(null,c)}})}c(t,r,function(t,e){return n(new k(e))})},e.decodePayloadAsBinary=function(t,n,r){"function"==typeof n&&(r=n,n=null);for(var o=t,i=[];o.byteLength>0;){for(var s=new Uint8Array(o),a=0===s[0],c="",p=1;255!==s[p];p++){if(c.length>310)return r(w,0,1);c+=s[p]}o=f(o,2+c.length),c=parseInt(c);var u=f(o,0,c);if(a)try{u=String.fromCharCode.apply(null,new Uint8Array(u))}catch(h){var l=new Uint8Array(u);u="";for(var p=0;p<l.length;p++)u+=String.fromCharCode(l[p])}i.push(u),o=f(o,c)}var d=i.length;i.forEach(function(t,o){r(e.decodePacket(t,n,!0),o,d)})}}).call(e,function(){return this}())},function(t,e){t.exports=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var r in t)n.call(t,r)&&e.push(r);return e}},function(t,e){t.exports=function(t,e,n){var r=t.byteLength;if(e=e||0,n=n||r,t.slice)return t.slice(e,n);if(e<0&&(e+=r),n<0&&(n+=r),n>r&&(n=r),e>=r||e>=n||0===r)return new ArrayBuffer(0);for(var o=new Uint8Array(t),i=new Uint8Array(n-e),s=e,a=0;s<n;s++,a++)i[a]=o[s];return i.buffer}},function(t,e){function n(t,e,n){function o(t,r){if(o.count<=0)throw new Error("after called too many times");--o.count,t?(i=!0,e(t),e=n):0!==o.count||i||e(null,r)}var i=!1;return n=n||r,o.count=t,0===t?e():o}function r(){}t.exports=n},function(t,e,n){var r;(function(t,o){!function(i){function s(t){for(var e,n,r=[],o=0,i=t.length;o<i;)e=t.charCodeAt(o++),e>=55296&&e<=56319&&o<i?(n=t.charCodeAt(o++),56320==(64512&n)?r.push(((1023&e)<<10)+(1023&n)+65536):(r.push(e),o--)):r.push(e);return r}function a(t){for(var e,n=t.length,r=-1,o="";++r<n;)e=t[r],e>65535&&(e-=65536,o+=w(e>>>10&1023|55296),e=56320|1023&e),o+=w(e);return o}function c(t,e){if(t>=55296&&t<=57343){if(e)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function p(t,e){return w(t>>e&63|128)}function u(t,e){if(0==(4294967168&t))return w(t);var n="";return 0==(4294965248&t)?n=w(t>>6&31|192):0==(4294901760&t)?(c(t,e)||(t=65533),n=w(t>>12&15|224),n+=p(t,6)):0==(4292870144&t)&&(n=w(t>>18&7|240),n+=p(t,12),n+=p(t,6)),n+=w(63&t|128)}function h(t,e){e=e||{};for(var n,r=!1!==e.strict,o=s(t),i=o.length,a=-1,c="";++a<i;)n=o[a],c+=u(n,r);return c}function f(){if(b>=v)throw Error("Invalid byte index");var t=255&g[b];if(b++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function l(t){var e,n,r,o,i;if(b>v)throw Error("Invalid byte index");if(b==v)return!1;if(e=255&g[b],b++,0==(128&e))return e;if(192==(224&e)){if(n=f(),i=(31&e)<<6|n,i>=128)return i;throw Error("Invalid continuation byte")}if(224==(240&e)){if(n=f(),r=f(),i=(15&e)<<12|n<<6|r,i>=2048)return c(i,t)?i:65533;throw Error("Invalid continuation byte")}if(240==(248&e)&&(n=f(),r=f(),o=f(),i=(7&e)<<18|n<<12|r<<6|o,i>=65536&&i<=1114111))return i;throw Error("Invalid UTF-8 detected")}function d(t,e){e=e||{};var n=!1!==e.strict;g=s(t),v=g.length,b=0;for(var r,o=[];(r=l(n))!==!1;)o.push(r);return a(o)}var y="object"==typeof e&&e,m=("object"==typeof t&&t&&t.exports==y&&t,"object"==typeof o&&o);m.global!==m&&m.window!==m||(i=m);var g,v,b,w=String.fromCharCode,k={version:"2.1.2",encode:h,decode:d};r=function(){return k}.call(e,n,e,t),!(void 0!==r&&(t.exports=r))}(this)}).call(e,n(28)(t),function(){return this}())},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){!function(){"use strict";for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=new Uint8Array(256),r=0;r<t.length;r++)n[t.charCodeAt(r)]=r;e.encode=function(e){var n,r=new Uint8Array(e),o=r.length,i="";for(n=0;n<o;n+=3)i+=t[r[n]>>2],i+=t[(3&r[n])<<4|r[n+1]>>4],i+=t[(15&r[n+1])<<2|r[n+2]>>6],i+=t[63&r[n+2]];return o%3===2?i=i.substring(0,i.length-1)+"=":o%3===1&&(i=i.substring(0,i.length-2)+"=="),i},e.decode=function(t){var e,r,o,i,s,a=.75*t.length,c=t.length,p=0;"="===t[t.length-1]&&(a--,"="===t[t.length-2]&&a--);var u=new ArrayBuffer(a),h=new Uint8Array(u);for(e=0;e<c;e+=4)r=n[t.charCodeAt(e)],o=n[t.charCodeAt(e+1)],i=n[t.charCodeAt(e+2)],s=n[t.charCodeAt(e+3)],h[p++]=r<<2|o>>4,h[p++]=(15&o)<<4|i>>2,h[p++]=(3&i)<<6|63&s;return u}}()},function(t,e){(function(e){function n(t){for(var e=0;e<t.length;e++){var n=t[e];if(n.buffer instanceof ArrayBuffer){var r=n.buffer;if(n.byteLength!==r.byteLength){var o=new Uint8Array(n.byteLength);o.set(new Uint8Array(r,n.byteOffset,n.byteLength)),r=o.buffer}t[e]=r}}}function r(t,e){e=e||{};var r=new i;n(t);for(var o=0;o<t.length;o++)r.append(t[o]);return e.type?r.getBlob(e.type):r.getBlob()}function o(t,e){return n(t),new Blob(t,e||{})}var i=e.BlobBuilder||e.WebKitBlobBuilder||e.MSBlobBuilder||e.MozBlobBuilder,s=function(){try{var t=new Blob(["hi"]);return 2===t.size}catch(e){return!1}}(),a=s&&function(){try{var t=new Blob([new Uint8Array([1,2])]);return 2===t.size}catch(e){return!1}}(),c=i&&i.prototype.append&&i.prototype.getBlob;t.exports=function(){return s?a?e.Blob:o:c?r:void 0}()}).call(e,function(){return this}())},function(t,e){e.encode=function(t){var e="";for(var n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e},e.decode=function(t){for(var e={},n=t.split("&"),r=0,o=n.length;r<o;r++){var i=n[r].split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e}},function(t,e){t.exports=function(t,e){var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e){"use strict";function n(t){var e="";do e=s[t%a]+e,t=Math.floor(t/a);while(t>0);return e}function r(t){var e=0;for(u=0;u<t.length;u++)e=e*a+c[t.charAt(u)];return e}function o(){var t=n(+new Date);return t!==i?(p=0,i=t):t+"."+n(p++)}for(var i,s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),a=64,c={},p=0,u=0;u<a;u++)c[s[u]]=u;o.encode=n,o.decode=r,t.exports=o},function(t,e,n){(function(e){function r(){}function o(t){i.call(this,t),this.query=this.query||{},a||(e.___eio||(e.___eio=[]),a=e.___eio),this.index=a.length;var n=this;a.push(function(t){n.onData(t)}),this.query.j=this.index,e.document&&e.addEventListener&&e.addEventListener("beforeunload",function(){n.script&&(n.script.onerror=r)},!1)}var i=n(21),s=n(32);t.exports=o;var a,c=/\n/g,p=/\\n/g;s(o,i),o.prototype.supportsBinary=!1,o.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),i.prototype.doClose.call(this)},o.prototype.doPoll=function(){var t=this,e=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),e.async=!0,e.src=this.uri(),e.onerror=function(e){t.onError("jsonp poll error",e)};var n=document.getElementsByTagName("script")[0];n?n.parentNode.insertBefore(e,n):(document.head||document.body).appendChild(e),this.script=e;var r="undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent);r&&setTimeout(function(){var t=document.createElement("iframe");document.body.appendChild(t),document.body.removeChild(t)},100)},o.prototype.doWrite=function(t,e){function n(){r(),e()}function r(){if(o.iframe)try{o.form.removeChild(o.iframe)}catch(t){o.onError("jsonp polling iframe removal error",t)}try{var e='<iframe src="javascript:0" name="'+o.iframeId+'">';i=document.createElement(e)}catch(t){i=document.createElement("iframe"),i.name=o.iframeId,i.src="javascript:0"}i.id=o.iframeId,o.form.appendChild(i),o.iframe=i}var o=this;if(!this.form){var i,s=document.createElement("form"),a=document.createElement("textarea"),u=this.iframeId="eio_iframe_"+this.index;s.className="socketio",s.style.position="absolute",s.style.top="-1000px",s.style.left="-1000px",s.target=u,s.method="POST",s.setAttribute("accept-charset","utf-8"),a.name="d",s.appendChild(a),document.body.appendChild(s),this.form=s,this.area=a}this.form.action=this.uri(),r(),t=t.replace(p,"\\\n"),this.area.value=t.replace(c,"\\n");try{this.form.submit()}catch(h){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===o.iframe.readyState&&n()}:this.iframe.onload=n}}).call(e,function(){return this}())},function(t,e,n){(function(e){function r(t){var e=t&&t.forceBase64;e&&(this.supportsBinary=!1),this.perMessageDeflate=t.perMessageDeflate,this.usingBrowserWebSocket=h&&!t.forceNode,this.protocols=t.protocols,this.usingBrowserWebSocket||(l=o),i.call(this,t)}var o,i=n(22),s=n(23),a=n(31),c=n(32),p=n(33),u=n(3)("engine.io-client:websocket"),h=e.WebSocket||e.MozWebSocket;if("undefined"==typeof window)try{o=n(36)}catch(f){}var l=h;l||"undefined"!=typeof window||(l=o),t.exports=r,c(r,i),r.prototype.name="websocket",r.prototype.supportsBinary=!0,r.prototype.doOpen=function(){if(this.check()){var t=this.uri(),e=this.protocols,n={agent:this.agent,perMessageDeflate:this.perMessageDeflate};n.pfx=this.pfx,n.key=this.key,n.passphrase=this.passphrase,n.cert=this.cert,n.ca=this.ca,n.ciphers=this.ciphers,n.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(n.headers=this.extraHeaders),this.localAddress&&(n.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket?e?new l(t,e):new l(t):new l(t,e,n)}catch(r){return this.emit("error",r)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},r.prototype.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.onOpen()},this.ws.onclose=function(){t.onClose()},this.ws.onmessage=function(e){t.onData(e.data)},this.ws.onerror=function(e){t.onError("websocket error",e)}},r.prototype.write=function(t){function n(){r.emit("flush"),setTimeout(function(){r.writable=!0,r.emit("drain")},0)}var r=this;this.writable=!1;for(var o=t.length,i=0,a=o;i<a;i++)!function(t){s.encodePacket(t,r.supportsBinary,function(i){if(!r.usingBrowserWebSocket){var s={};if(t.options&&(s.compress=t.options.compress),r.perMessageDeflate){var a="string"==typeof i?e.Buffer.byteLength(i):i.length;a<r.perMessageDeflate.threshold&&(s.compress=!1)}}try{r.usingBrowserWebSocket?r.ws.send(i):r.ws.send(i,s)}catch(c){u("websocket closed before onclose event")}--o||n()})}(t[i])},r.prototype.onClose=function(){i.prototype.onClose.call(this)},r.prototype.doClose=function(){"undefined"!=typeof this.ws&&this.ws.close()},r.prototype.uri=function(){var t=this.query||{},e=this.secure?"wss":"ws",n="";this.port&&("wss"===e&&443!==Number(this.port)||"ws"===e&&80!==Number(this.port))&&(n=":"+this.port),this.timestampRequests&&(t[this.timestampParam]=p()),this.supportsBinary||(t.b64=1),t=a.encode(t),t.length&&(t="?"+t);var r=this.hostname.indexOf(":")!==-1;return e+"://"+(r?"["+this.hostname+"]":this.hostname)+n+this.path+t},r.prototype.check=function(){return!(!l||"__initialize"in l&&this.name===r.prototype.name)}}).call(e,function(){return this}())},function(t,e){},function(t,e){var n=[].indexOf;t.exports=function(t,e){if(n)return t.indexOf(e);for(var r=0;r<t.length;++r)if(t[r]===e)return r;return-1}},function(t,e){(function(e){var n=/^[\],:{}\s]*$/,r=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,o=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,i=/(?:^|:|,)(?:\s*\[)+/g,s=/^\s+/,a=/\s+$/;t.exports=function(t){return"string"==typeof t&&t?(t=t.replace(s,"").replace(a,""),e.JSON&&JSON.parse?JSON.parse(t):n.test(t.replace(r,"@").replace(o,"]").replace(i,""))?new Function("return "+t)():void 0):null}}).call(e,function(){return this}())},function(t,e,n){"use strict";function r(t,e,n){this.io=t,this.nsp=e,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,n&&n.query&&(this.query=n.query),this.io.autoConnect&&this.open()}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=n(7),s=n(8),a=n(40),c=n(41),p=n(42),u=n(3)("socket.io-client:socket"),h=n(31);t.exports=e=r;var f={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},l=s.prototype.emit;s(r.prototype),r.prototype.subEvents=function(){if(!this.subs){var t=this.io;this.subs=[c(t,"open",p(this,"onopen")),c(t,"packet",p(this,"onpacket")),c(t,"close",p(this,"onclose"))]}},r.prototype.open=r.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting"),this)},r.prototype.send=function(){var t=a(arguments);return t.unshift("message"),this.emit.apply(this,t),this},r.prototype.emit=function(t){if(f.hasOwnProperty(t))return l.apply(this,arguments),this;var e=a(arguments),n={type:i.EVENT,data:e};return n.options={},n.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof e[e.length-1]&&(u("emitting packet with ack id %d",this.ids),this.acks[this.ids]=e.pop(),n.id=this.ids++),this.connected?this.packet(n):this.sendBuffer.push(n),delete this.flags,this},r.prototype.packet=function(t){t.nsp=this.nsp,this.io.packet(t)},r.prototype.onopen=function(){if(u("transport is open - connecting"),"/"!==this.nsp)if(this.query){var t="object"===o(this.query)?h.encode(this.query):this.query;u("sending connect packet with query %s",t),this.packet({type:i.CONNECT,query:t})}else this.packet({type:i.CONNECT})},r.prototype.onclose=function(t){u("close (%s)",t),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",t)},r.prototype.onpacket=function(t){if(t.nsp===this.nsp)switch(t.type){case i.CONNECT:this.onconnect();break;case i.EVENT:this.onevent(t);break;case i.BINARY_EVENT:this.onevent(t);break;case i.ACK:this.onack(t);break;case i.BINARY_ACK:this.onack(t);break;case i.DISCONNECT:this.ondisconnect();break;case i.ERROR:this.emit("error",t.data)}},r.prototype.onevent=function(t){var e=t.data||[];u("emitting event %j",e),null!=t.id&&(u("attaching ack callback to event"),e.push(this.ack(t.id))),this.connected?l.apply(this,e):this.receiveBuffer.push(e)},r.prototype.ack=function(t){var e=this,n=!1;return function(){if(!n){n=!0;var r=a(arguments);u("sending ack %j",r),e.packet({type:i.ACK,id:t,data:r})}}},r.prototype.onack=function(t){var e=this.acks[t.id];"function"==typeof e?(u("calling ack %s with %j",t.id,t.data),e.apply(this,t.data),delete this.acks[t.id]):u("bad ack %s",t.id)},r.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},r.prototype.emitBuffered=function(){var t;for(t=0;t<this.receiveBuffer.length;t++)l.apply(this,this.receiveBuffer[t]);for(this.receiveBuffer=[],t=0;t<this.sendBuffer.length;t++)this.packet(this.sendBuffer[t]);this.sendBuffer=[]},r.prototype.ondisconnect=function(){u("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},r.prototype.destroy=function(){if(this.subs){for(var t=0;t<this.subs.length;t++)this.subs[t].destroy();this.subs=null}this.io.destroy(this)},r.prototype.close=r.prototype.disconnect=function(){return this.connected&&(u("performing disconnect (%s)",this.nsp),this.packet({type:i.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},r.prototype.compress=function(t){return this.flags=this.flags||{},this.flags.compress=t,this}},function(t,e){function n(t,e){var n=[];e=e||0;for(var r=e||0;r<t.length;r++)n[r-e]=t[r];return n}t.exports=n},function(t,e){"use strict";function n(t,e,n){return t.on(e,n),{destroy:function(){t.removeListener(e,n)}}}t.exports=n},function(t,e){var n=[].slice;t.exports=function(t,e){if("string"==typeof e&&(e=t[e]),"function"!=typeof e)throw new Error("bind() requires a function");var r=n.call(arguments,2);return function(){return e.apply(t,r.concat(n.call(arguments)))}}},function(t,e){function n(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}t.exports=n,n.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=0==(1&Math.floor(10*e))?t-n:t+n}return 0|Math.min(t,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(t){this.ms=t},n.prototype.setMax=function(t){this.max=t},n.prototype.setJitter=function(t){this.jitter=t}}])});
+//# sourceMappingURL=socket.io.js.map
\ No newline at end of file
diff --git a/wrt/node_modules/socket.io-client/dist/socket.io.js.map b/wrt/node_modules/socket.io-client/dist/socket.io.js.map
new file mode 100644 (file)
index 0000000..bffa5b2
--- /dev/null
@@ -0,0 +1 @@
+{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///socket.io.js","webpack:///webpack/bootstrap 959f0ed5f5670676a79e","webpack:///./lib/index.js","webpack:///./lib/url.js","webpack:///./~/parseuri/index.js","webpack:///./~/debug/src/browser.js","webpack:///./~/process/browser.js","webpack:///./~/debug/src/debug.js","webpack:///./~/ms/index.js","webpack:///./~/socket.io-parser/index.js","webpack:///./~/component-emitter/index.js","webpack:///./~/has-binary2/index.js","webpack:///./~/isarray/index.js","webpack:///./~/socket.io-parser/binary.js","webpack:///./~/socket.io-parser/is-buffer.js","webpack:///./lib/manager.js","webpack:///./~/engine.io-client/index.js","webpack:///./~/engine.io-client/lib/index.js","webpack:///./~/engine.io-client/lib/socket.js","webpack:///./~/engine.io-client/lib/transports/index.js","webpack:///./~/engine.io-client/lib/xmlhttprequest.js","webpack:///./~/has-cors/index.js","webpack:///./~/engine.io-client/lib/transports/polling-xhr.js","webpack:///./~/engine.io-client/lib/transports/polling.js","webpack:///./~/engine.io-client/lib/transport.js","webpack:///./~/engine.io-parser/lib/browser.js","webpack:///./~/engine.io-parser/lib/keys.js","webpack:///./~/arraybuffer.slice/index.js","webpack:///./~/after/index.js","webpack:///./~/engine.io-parser/lib/utf8.js","webpack:///(webpack)/buildin/module.js","webpack:///./~/base64-arraybuffer/lib/base64-arraybuffer.js","webpack:///./~/blob/index.js","webpack:///./~/parseqs/index.js","webpack:///./~/component-inherit/index.js","webpack:///./~/yeast/index.js","webpack:///./~/engine.io-client/lib/transports/polling-jsonp.js","webpack:///./~/engine.io-client/lib/transports/websocket.js","webpack:///./~/indexof/index.js","webpack:///./~/parsejson/index.js","webpack:///./lib/socket.js","webpack:///./~/to-array/index.js","webpack:///./lib/on.js","webpack:///./~/component-bind/index.js","webpack:///./~/backo2/index.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","lookup","uri","opts","_typeof","undefined","io","parsed","url","source","path","sameNamespace","cache","nsps","newConnection","forceNew","multiplex","debug","Manager","query","socket","Symbol","iterator","obj","constructor","prototype","parser","managers","protocol","connect","Socket","global","loc","location","host","charAt","test","parseuri","port","ipv6","indexOf","href","re","parts","str","src","b","e","substring","replace","length","exec","i","authority","ipv6uri","process","useColors","window","type","document","documentElement","style","WebkitAppearance","console","firebug","exception","table","navigator","userAgent","toLowerCase","match","parseInt","RegExp","$1","formatArgs","args","namespace","humanize","diff","color","splice","index","lastC","log","Function","apply","arguments","save","namespaces","storage","removeItem","load","r","env","DEBUG","localstorage","localStorage","chrome","local","colors","formatters","j","v","JSON","stringify","err","message","enable","defaultSetTimout","Error","defaultClearTimeout","runTimeout","fun","cachedSetTimeout","setTimeout","runClearTimeout","marker","cachedClearTimeout","clearTimeout","cleanUpNextTick","draining","currentQueue","queue","concat","queueIndex","drainQueue","timeout","len","run","Item","array","noop","nextTick","Array","push","title","browser","argv","version","versions","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","name","binding","cwd","chdir","dir","umask","selectColor","hash","charCodeAt","Math","abs","createDebug","enabled","self","curr","Date","ms","prevTime","prev","coerce","unshift","format","formatter","val","logFn","bind","init","names","skips","split","substr","disable","stack","parse","String","n","parseFloat","y","d","h","s","fmtShort","round","fmtLong","plural","floor","ceil","options","isNaN","Encoder","encodeAsString","BINARY_EVENT","BINARY_ACK","attachments","nsp","data","encodeAsBinary","callback","writeEncoding","bloblessData","deconstruction","binary","deconstructPacket","pack","packet","buffers","removeBlobs","Decoder","reconstructor","decodeString","Number","types","error","buf","next","tryParse","BinaryReconstructor","reconPack","ERROR","Emitter","hasBin","isBuf","CONNECT","DISCONNECT","EVENT","ACK","encode","encoding","add","base64","takeBinaryData","destroy","finishedReconstruction","binData","reconstructPacket","mixin","key","addEventListener","event","fn","_callbacks","removeEventListener","callbacks","cb","slice","hasListeners","hasBinary","isArray","l","Buffer","isBuffer","ArrayBuffer","withNativeBlob","Blob","withNativeFile","File","toJSON","Object","hasOwnProperty","toString","arr","_deconstructPacket","placeholder","_placeholder","num","newData","_reconstructPacket","packetData","_removeBlobs","curKey","containingObject","pendingBlobs","fileReader","FileReader","onload","result","readAsArrayBuffer","subs","reconnection","reconnectionAttempts","Infinity","reconnectionDelay","reconnectionDelayMax","randomizationFactor","backoff","Backoff","min","max","jitter","readyState","connecting","lastPing","packetBuffer","_parser","encoder","decoder","autoConnect","open","eio","has","emitAll","updateSocketIds","generateId","engine","_reconnection","_reconnectionAttempts","_reconnectionDelay","setMin","_randomizationFactor","setJitter","_reconnectionDelayMax","setMax","_timeout","maybeReconnectOnOpen","reconnecting","attempts","reconnect","skipReconnect","openSub","onopen","errorSub","cleanup","timer","close","onping","onpong","ondata","ondecoded","onerror","onConnecting","encodedPackets","write","processPacketQueue","shift","subsLength","sub","disconnect","reset","onclose","reason","delay","duration","onreconnect","attempt","hostname","secure","agent","parseqs","decode","upgrade","forceJSONP","jsonp","forceBase64","enablesXDR","timestampParam","timestampRequests","transports","transportOptions","writeBuffer","prevBufferLen","policyPort","rememberUpgrade","binaryType","onlyBinaryUpgrades","perMessageDeflate","threshold","pfx","passphrase","cert","ca","ciphers","rejectUnauthorized","forceNode","freeGlobal","extraHeaders","keys","localAddress","upgrades","pingInterval","pingTimeout","pingIntervalTimer","pingTimeoutTimer","clone","o","parsejson","priorWebsocketSuccess","Transport","createTransport","EIO","transport","sid","requestTimeout","protocols","setTransport","onDrain","onPacket","onError","onClose","probe","onTransportOpen","upgradeLosesBinary","supportsBinary","failed","send","msg","upgrading","pause","flush","freezeTransport","onTransportClose","onupgrade","to","onOpen","onHandshake","setPing","code","filterUpgrades","onHeartbeat","ping","sendPacket","writable","compress","cleanupAndClose","waitForUpgrade","desc","filteredUpgrades","polling","xhr","xd","xs","isSSL","xdomain","xscheme","XMLHttpRequest","XHR","JSONP","websocket","hasCORS","XDomainRequest","join","empty","Polling","Request","method","async","isBinary","create","unloadHandler","requests","abort","inherit","request","doWrite","req","sendXhr","doPoll","onData","pollXhr","setDisableHeaderCheck","setRequestHeader","withCredentials","hasXDR","onLoad","responseText","onreadystatechange","contentType","getResponseHeader","responseType","status","requestsCount","onSuccess","fromError","response","attachEvent","hasXHR2","yeast","doOpen","poll","onPause","total","decodePayload","doClose","packets","callbackfn","encodePayload","schema","b64","description","decodePacket","encodeBase64Object","encodeArrayBuffer","encodeBase64Packet","contentArray","Uint8Array","resultBuffer","byteLength","buffer","encodeBlobAsArrayBuffer","fr","encodePacket","encodeBlob","dontSendBlobs","blob","tryDecode","utf8","strict","map","ary","each","done","after","eachWithIndex","el","base64encoder","sliceBuffer","isAndroid","isPhantomJS","pong","packetslist","utf8encode","encoded","readAsDataURL","b64data","fromCharCode","typed","basic","btoa","utf8decode","decodeBase64Packet","asArray","rest","setLengthHeader","encodeOne","doneCallback","encodePayloadAsBlob","encodePayloadAsArrayBuffer","results","decodePayloadAsBinary","chr","ret","totalLength","reduce","acc","resultArray","bufferIndex","forEach","isString","ab","view","lenStr","binaryIdentifier","size","lengthAry","bufferTail","tailArray","msgLength","arraybuffer","start","end","bytes","abv","ii","count","err_cb","proxy","bail","__WEBPACK_AMD_DEFINE_RESULT__","ucs2decode","string","value","extra","output","counter","ucs2encode","stringFromCharCode","checkScalarValue","codePoint","toUpperCase","createByte","encodeCodePoint","symbol","codePoints","byteString","readContinuationByte","byteIndex","byteCount","continuationByte","byteArray","decodeSymbol","byte1","byte2","byte3","byte4","tmp","freeExports","webpackPolyfill","deprecate","paths","children","chars","encoded1","encoded2","encoded3","encoded4","bufferLength","mapArrayBufferViews","chunk","copy","set","byteOffset","BlobBuilderConstructor","bb","BlobBuilder","append","getBlob","BlobConstructor","WebKitBlobBuilder","MSBlobBuilder","MozBlobBuilder","blobSupported","a","blobSupportsArrayBufferView","blobBuilderSupported","encodeURIComponent","qs","qry","pairs","pair","decodeURIComponent","alphabet","decoded","now","seed","JSONPPolling","___eio","script","rNewline","rEscapedNewline","parentNode","removeChild","form","iframe","createElement","insertAt","getElementsByTagName","insertBefore","head","body","appendChild","isUAgecko","complete","initIframe","html","iframeId","area","className","position","top","left","target","setAttribute","action","submit","WS","usingBrowserWebSocket","BrowserWebSocket","WebSocket","NodeWebSocket","MozWebSocket","check","headers","ws","supports","addEventListeners","onmessage","ev","rvalidchars","rvalidescape","rvalidtokens","rvalidbraces","rtrimLeft","rtrimRight","json","ids","acks","receiveBuffer","sendBuffer","connected","disconnected","toArray","events","connect_error","connect_timeout","reconnect_attempt","reconnect_failed","reconnect_error","subEvents","flags","pop","onpacket","onconnect","onevent","onack","ondisconnect","ack","sent","emitBuffered","list","factor","pow","rand","random","deviation"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,GAAAD,IAEAD,EAAA,GAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAP,WACAS,GAAAF,EACAG,QAAA,EAUA,OANAL,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,QAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KAqCA,OATAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,GAGAR,EAAA,KDgBM,SAAUL,EAAQD,EAASM,GAEhC,YErBD,SAASS,GAAQC,EAAKC,GACD,YAAf,mBAAOD,GAAP,YAAAE,EAAOF,MACTC,EAAOD,EACPA,EAAMG,QAGRF,EAAOA,KAEP,IAQIG,GARAC,EAASC,EAAIN,GACbO,EAASF,EAAOE,OAChBd,EAAKY,EAAOZ,GACZe,EAAOH,EAAOG,KACdC,EAAgBC,EAAMjB,IAAOe,IAAQE,GAAMjB,GAAIkB,KAC/CC,EAAgBX,EAAKY,UAAYZ,EAAK,0BACtB,IAAUA,EAAKa,WAAaL,CAiBhD,OAbIG,IACFG,EAAM,+BAAgCR,GACtCH,EAAKY,EAAQT,EAAQN,KAEhBS,EAAMjB,KACTsB,EAAM,yBAA0BR,GAChCG,EAAMjB,GAAMuB,EAAQT,EAAQN,IAE9BG,EAAKM,EAAMjB,IAETY,EAAOY,QAAUhB,EAAKgB,QACxBhB,EAAKgB,MAAQZ,EAAOY,OAEfb,EAAGc,OAAOb,EAAOG,KAAMP,GFR/B,GAAIC,GAA4B,kBAAXiB,SAAoD,gBAApBA,QAAOC,SAAwB,SAAUC,GAAO,aAAcA,IAAS,SAAUA,GAAO,MAAOA,IAAyB,kBAAXF,SAAyBE,EAAIC,cAAgBH,QAAUE,IAAQF,OAAOI,UAAY,eAAkBF,IErDnQf,EAAMhB,EAAQ,GACdkC,EAASlC,EAAQ,GACjB0B,EAAU1B,EAAQ,IAClByB,EAAQzB,EAAQ,GAAS,mBAM7BL,GAAOD,QAAUA,EAAUe,CAM3B,IAAIW,GAAQ1B,EAAQyC,WAuDpBzC,GAAQ0C,SAAWF,EAAOE,SAS1B1C,EAAQ2C,QAAU5B,EAQlBf,EAAQgC,QAAU1B,EAAQ,IAC1BN,EAAQ4C,OAAStC,EAAQ,KF8DnB,SAAUL,EAAQD,EAASM,IAEJ,SAASuC,GAAS,YGtI/C,SAASvB,GAAKN,EAAK8B,GACjB,GAAIT,GAAMrB,CAGV8B,GAAMA,GAAOD,EAAOE,SAChB,MAAQ/B,IAAKA,EAAM8B,EAAIJ,SAAW,KAAOI,EAAIE,MAG7C,gBAAoBhC,KAClB,MAAQA,EAAIiC,OAAO,KAEnBjC,EADE,MAAQA,EAAIiC,OAAO,GACfH,EAAIJ,SAAW1B,EAEf8B,EAAIE,KAAOhC,GAIhB,sBAAsBkC,KAAKlC,KAC9Be,EAAM,uBAAwBf,GAE5BA,EADE,mBAAuB8B,GACnBA,EAAIJ,SAAW,KAAO1B,EAEtB,WAAaA,GAKvBe,EAAM,WAAYf,GAClBqB,EAAMc,EAASnC,IAIZqB,EAAIe,OACH,cAAcF,KAAKb,EAAIK,UACzBL,EAAIe,KAAO,KACF,eAAeF,KAAKb,EAAIK,YACjCL,EAAIe,KAAO,QAIff,EAAIb,KAAOa,EAAIb,MAAQ,GAEvB,IAAI6B,GAAOhB,EAAIW,KAAKM,QAAQ,QAAS,EACjCN,EAAOK,EAAO,IAAMhB,EAAIW,KAAO,IAAMX,EAAIW,IAO7C,OAJAX,GAAI5B,GAAK4B,EAAIK,SAAW,MAAQM,EAAO,IAAMX,EAAIe,KAEjDf,EAAIkB,KAAOlB,EAAIK,SAAW,MAAQM,GAAQF,GAAOA,EAAIM,OAASf,EAAIe,KAAO,GAAM,IAAMf,EAAIe,MAElFf,EApET,GAAIc,GAAW7C,EAAQ,GACnByB,EAAQzB,EAAQ,GAAS,uBAM7BL,GAAOD,QAAUsB,IH6NaX,KAAKX,EAAU,WAAa,MAAOI,WAI3D,SAAUH,EAAQD,GItOxB,GAAAwD,GAAA,0OAEAC,GACA,iIAGAxD,GAAAD,QAAA,SAAA0D,GACA,GAAAC,GAAAD,EACAE,EAAAF,EAAAJ,QAAA,KACAO,EAAAH,EAAAJ,QAAA,IAEAM,KAAA,GAAAC,IAAA,IACAH,IAAAI,UAAA,EAAAF,GAAAF,EAAAI,UAAAF,EAAAC,GAAAE,QAAA,UAAwEL,EAAAI,UAAAD,EAAAH,EAAAM,QAOxE,KAJA,GAAApD,GAAA4C,EAAAS,KAAAP,GAAA,IACA1C,KACAkD,EAAA,GAEAA,KACAlD,EAAAyC,EAAAS,IAAAtD,EAAAsD,IAAA,EAUA,OAPAN,KAAA,GAAAC,IAAA,IACA7C,EAAAO,OAAAoC,EACA3C,EAAAgC,KAAAhC,EAAAgC,KAAAc,UAAA,EAAA9C,EAAAgC,KAAAgB,OAAA,GAAAD,QAAA,KAAwE,KACxE/C,EAAAmD,UAAAnD,EAAAmD,UAAAJ,QAAA,QAAAA,QAAA,QAAAA,QAAA,KAAkF,KAClF/C,EAAAoD,SAAA,GAGApD,IJqPM,SAAUf,EAAQD,EAASM,IK1RjC,SAAA+D,GAsCA,QAAAC,KAIA,2BAAAC,iBAAAF,SAAA,aAAAE,OAAAF,QAAAG,QAMA,mBAAAC,oBAAAC,iBAAAD,SAAAC,gBAAAC,OAAAF,SAAAC,gBAAAC,MAAAC,kBAEA,mBAAAL,gBAAAM,UAAAN,OAAAM,QAAAC,SAAAP,OAAAM,QAAAE,WAAAR,OAAAM,QAAAG,QAGA,mBAAAC,sBAAAC,WAAAD,UAAAC,UAAAC,cAAAC,MAAA,mBAAAC,SAAAC,OAAAC,GAAA,SAEA,mBAAAN,sBAAAC,WAAAD,UAAAC,UAAAC,cAAAC,MAAA,uBAsBA,QAAAI,GAAAC,GACA,GAAAnB,GAAAlE,KAAAkE,SASA,IAPAmB,EAAA,IAAAnB,EAAA,SACAlE,KAAAsF,WACApB,EAAA,WACAmB,EAAA,IACAnB,EAAA,WACA,IAAAtE,EAAA2F,SAAAvF,KAAAwF,MAEAtB,EAAA,CAEA,GAAAzD,GAAA,UAAAT,KAAAyF,KACAJ,GAAAK,OAAA,IAAAjF,EAAA,iBAKA,IAAAkF,GAAA,EACAC,EAAA,CACAP,GAAA,GAAA1B,QAAA,uBAAAqB,GACA,OAAAA,IACAW,IACA,OAAAX,IAGAY,EAAAD,MAIAN,EAAAK,OAAAE,EAAA,EAAAnF,IAUA,QAAAoF,KAGA,sBAAApB,UACAA,QAAAoB,KACAC,SAAA3D,UAAA4D,MAAAxF,KAAAkE,QAAAoB,IAAApB,QAAAuB,WAUA,QAAAC,GAAAC,GACA,IACA,MAAAA,EACAtG,EAAAuG,QAAAC,WAAA,SAEAxG,EAAAuG,QAAAxE,MAAAuE,EAEG,MAAAzC,KAUH,QAAA4C,KACA,GAAAC,EACA,KACAA,EAAA1G,EAAAuG,QAAAxE,MACG,MAAA8B,IAOH,OAJA6C,GAAA,mBAAArC,IAAA,OAAAA,KACAqC,EAAArC,EAAAsC,IAAAC,OAGAF,EAoBA,QAAAG,KACA,IACA,MAAAtC,QAAAuC,aACG,MAAAjD,KAjLH7D,EAAAC,EAAAD,QAAAM,EAAA,GACAN,EAAAiG,MACAjG,EAAAwF,aACAxF,EAAAqG,OACArG,EAAAyG,OACAzG,EAAAsE,YACAtE,EAAAuG,QAAA,mBAAAQ,SACA,mBAAAA,QAAAR,QACAQ,OAAAR,QAAAS,MACAH,IAMA7G,EAAAiH,QACA,gBACA,cACA,YACA,aACA,aACA,WAmCAjH,EAAAkH,WAAAC,EAAA,SAAAC,GACA,IACA,MAAAC,MAAAC,UAAAF,GACG,MAAAG,GACH,qCAAAA,EAAAC,UAqGAxH,EAAAyH,OAAAhB,OL+S8B9F,KAAKX,EAASM,EAAoB,KAI1D,SAAUL,EAAQD,GM/cxB,QAAA0H,KACA,SAAAC,OAAA,mCAEA,QAAAC,KACA,SAAAD,OAAA,qCAsBA,QAAAE,GAAAC,GACA,GAAAC,IAAAC,WAEA,MAAAA,YAAAF,EAAA,EAGA,KAAAC,IAAAL,IAAAK,IAAAC,WAEA,MADAD,GAAAC,WACAA,WAAAF,EAAA,EAEA,KAEA,MAAAC,GAAAD,EAAA,GACK,MAAAjE,GACL,IAEA,MAAAkE,GAAApH,KAAA,KAAAmH,EAAA,GACS,MAAAjE,GAET,MAAAkE,GAAApH,KAAAP,KAAA0H,EAAA,KAMA,QAAAG,GAAAC,GACA,GAAAC,IAAAC,aAEA,MAAAA,cAAAF,EAGA,KAAAC,IAAAP,IAAAO,IAAAC,aAEA,MADAD,GAAAC,aACAA,aAAAF,EAEA,KAEA,MAAAC,GAAAD,GACK,MAAArE,GACL,IAEA,MAAAsE,GAAAxH,KAAA,KAAAuH,GACS,MAAArE,GAGT,MAAAsE,GAAAxH,KAAAP,KAAA8H,KAYA,QAAAG,KACAC,GAAAC,IAGAD,GAAA,EACAC,EAAAvE,OACAwE,EAAAD,EAAAE,OAAAD,GAEAE,GAAA,EAEAF,EAAAxE,QACA2E,KAIA,QAAAA,KACA,IAAAL,EAAA,CAGA,GAAAM,GAAAf,EAAAQ,EACAC,IAAA,CAGA,KADA,GAAAO,GAAAL,EAAAxE,OACA6E,GAAA,CAGA,IAFAN,EAAAC,EACAA,OACAE,EAAAG,GACAN,GACAA,EAAAG,GAAAI,KAGAJ,IAAA,EACAG,EAAAL,EAAAxE,OAEAuE,EAAA,KACAD,GAAA,EACAL,EAAAW,IAiBA,QAAAG,GAAAjB,EAAAkB,GACA5I,KAAA0H,MACA1H,KAAA4I,QAYA,QAAAC,MAhKA,GAOAlB,GACAI,EARA9D,EAAApE,EAAAD,YAgBA,WACA,IAEA+H,EADA,kBAAAC,YACAA,WAEAN,EAEK,MAAA7D,GACLkE,EAAAL,EAEA,IAEAS,EADA,kBAAAC,cACAA,aAEAR,EAEK,MAAA/D,GACLsE,EAAAP,KAuDA,IAEAW,GAFAC,KACAF,GAAA,EAEAI,GAAA,CAyCArE,GAAA6E,SAAA,SAAApB,GACA,GAAArC,GAAA,GAAA0D,OAAA/C,UAAApC,OAAA,EACA,IAAAoC,UAAApC,OAAA,EACA,OAAAE,GAAA,EAAuBA,EAAAkC,UAAApC,OAAsBE,IAC7CuB,EAAAvB,EAAA,GAAAkC,UAAAlC,EAGAsE,GAAAY,KAAA,GAAAL,GAAAjB,EAAArC,IACA,IAAA+C,EAAAxE,QAAAsE,GACAT,EAAAc,IASAI,EAAAxG,UAAAuG,IAAA,WACA1I,KAAA0H,IAAA3B,MAAA,KAAA/F,KAAA4I,QAEA3E,EAAAgF,MAAA,UACAhF,EAAAiF,SAAA,EACAjF,EAAAsC,OACAtC,EAAAkF,QACAlF,EAAAmF,QAAA,GACAnF,EAAAoF,YAIApF,EAAAqF,GAAAT,EACA5E,EAAAsF,YAAAV,EACA5E,EAAAuF,KAAAX,EACA5E,EAAAwF,IAAAZ,EACA5E,EAAAyF,eAAAb,EACA5E,EAAA0F,mBAAAd,EACA5E,EAAA2F,KAAAf,EACA5E,EAAA4F,gBAAAhB,EACA5E,EAAA6F,oBAAAjB,EAEA5E,EAAA8F,UAAA,SAAAC,GAAqC,UAErC/F,EAAAgG,QAAA,SAAAD,GACA,SAAAzC,OAAA,qCAGAtD,EAAAiG,IAAA,WAA2B,WAC3BjG,EAAAkG,MAAA,SAAAC,GACA,SAAA7C,OAAA,mCAEAtD,EAAAoG,MAAA,WAA4B,WNietB,SAAUxK,EAAQD,EAASM,GO7mBjC,QAAAoK,GAAAhF,GACA,GAAAxB,GAAAyG,EAAA,CAEA,KAAAzG,IAAAwB,GACAiF,MAAA,GAAAA,EAAAjF,EAAAkF,WAAA1G,GACAyG,GAAA,CAGA,OAAA3K,GAAAiH,OAAA4D,KAAAC,IAAAH,GAAA3K,EAAAiH,OAAAjD,QAWA,QAAA+G,GAAArF,GAEA,QAAA3D,KAEA,GAAAA,EAAAiJ,QAAA,CAEA,GAAAC,GAAAlJ,EAGAmJ,GAAA,GAAAC,MACAC,EAAAF,GAAAG,GAAAH,EACAD,GAAArF,KAAAwF,EACAH,EAAAK,KAAAD,EACAJ,EAAAC,OACAG,EAAAH,CAIA,QADAzF,GAAA,GAAA0D,OAAA/C,UAAApC,QACAE,EAAA,EAAmBA,EAAAuB,EAAAzB,OAAiBE,IACpCuB,EAAAvB,GAAAkC,UAAAlC,EAGAuB,GAAA,GAAAzF,EAAAuL,OAAA9F,EAAA,IAEA,gBAAAA,GAAA,IAEAA,EAAA+F,QAAA,KAIA,IAAAzF,GAAA,CACAN,GAAA,GAAAA,EAAA,GAAA1B,QAAA,yBAAAqB,EAAAqG,GAEA,UAAArG,EAAA,MAAAA,EACAW,IACA,IAAA2F,GAAA1L,EAAAkH,WAAAuE,EACA,sBAAAC,GAAA,CACA,GAAAC,GAAAlG,EAAAM,EACAX,GAAAsG,EAAA/K,KAAAsK,EAAAU,GAGAlG,EAAAK,OAAAC,EAAA,GACAA,IAEA,MAAAX,KAIApF,EAAAwF,WAAA7E,KAAAsK,EAAAxF,EAEA,IAAAmG,GAAA7J,EAAAkE,KAAAjG,EAAAiG,KAAApB,QAAAoB,IAAA4F,KAAAhH,QACA+G,GAAAzF,MAAA8E,EAAAxF,IAaA,MAVA1D,GAAA2D,YACA3D,EAAAiJ,QAAAhL,EAAAgL,QAAAtF,GACA3D,EAAAuC,UAAAtE,EAAAsE,YACAvC,EAAA8D,MAAA6E,EAAAhF,GAGA,kBAAA1F,GAAA8L,MACA9L,EAAA8L,KAAA/J,GAGAA,EAWA,QAAA0F,GAAAnB,GACAtG,EAAAqG,KAAAC,GAEAtG,EAAA+L,SACA/L,EAAAgM,QAKA,QAHAC,IAAA,gBAAA3F,KAAA,IAAA2F,MAAA,UACApD,EAAAoD,EAAAjI,OAEAE,EAAA,EAAiBA,EAAA2E,EAAS3E,IAC1B+H,EAAA/H,KACAoC,EAAA2F,EAAA/H,GAAAH,QAAA,aACA,MAAAuC,EAAA,GACAtG,EAAAgM,MAAA5C,KAAA,GAAA9D,QAAA,IAAAgB,EAAA4F,OAAA,SAEAlM,EAAA+L,MAAA3C,KAAA,GAAA9D,QAAA,IAAAgB,EAAA,OAWA,QAAA6F,KACAnM,EAAAyH,OAAA,IAWA,QAAAuD,GAAAZ,GACA,GAAAlG,GAAA2E,CACA,KAAA3E,EAAA,EAAA2E,EAAA7I,EAAAgM,MAAAhI,OAAyCE,EAAA2E,EAAS3E,IAClD,GAAAlE,EAAAgM,MAAA9H,GAAAhB,KAAAkH,GACA,QAGA,KAAAlG,EAAA,EAAA2E,EAAA7I,EAAA+L,MAAA/H,OAAyCE,EAAA2E,EAAS3E,IAClD,GAAAlE,EAAA+L,MAAA7H,GAAAhB,KAAAkH,GACA,QAGA,UAWA,QAAAmB,GAAAI,GACA,MAAAA,aAAAhE,OAAAgE,EAAAS,OAAAT,EAAAnE,QACAmE,EAhMA3L,EAAAC,EAAAD,QAAA+K,EAAAhJ,MAAAgJ,EAAA,WAAAA,EACA/K,EAAAuL,SACAvL,EAAAmM,UACAnM,EAAAyH,SACAzH,EAAAgL,UACAhL,EAAA2F,SAAArF,EAAA,GAMAN,EAAA+L,SACA/L,EAAAgM,SAQAhM,EAAAkH,aAMA,IAAAmE,IPs0BM,SAAUpL,EAAQD,GQ1zBxB,QAAAqM,GAAA3I,GAEA,GADAA,EAAA4I,OAAA5I,KACAA,EAAAM,OAAA,MAGA,GAAAoB,GAAA,wHAAAnB,KACAP,EAEA,IAAA0B,EAAA,CAGA,GAAAmH,GAAAC,WAAApH,EAAA,IACAZ,GAAAY,EAAA,UAAAD,aACA,QAAAX,GACA,YACA,WACA,UACA,SACA,QACA,MAAA+H,GAAAE,CACA,YACA,UACA,QACA,MAAAF,GAAAG,CACA,aACA,WACA,UACA,SACA,QACA,MAAAH,GAAAI,CACA,eACA,aACA,WACA,UACA,QACA,MAAAJ,GAAA3L,CACA,eACA,aACA,WACA,UACA,QACA,MAAA2L,GAAAK,CACA,oBACA,kBACA,YACA,WACA,SACA,MAAAL,EACA,SACA,UAYA,QAAAM,GAAAzB,GACA,MAAAA,IAAAsB,EACA7B,KAAAiC,MAAA1B,EAAAsB,GAAA,IAEAtB,GAAAuB,EACA9B,KAAAiC,MAAA1B,EAAAuB,GAAA,IAEAvB,GAAAxK,EACAiK,KAAAiC,MAAA1B,EAAAxK,GAAA,IAEAwK,GAAAwB,EACA/B,KAAAiC,MAAA1B,EAAAwB,GAAA,IAEAxB,EAAA,KAWA,QAAA2B,GAAA3B,GACA,MAAA4B,GAAA5B,EAAAsB,EAAA,QACAM,EAAA5B,EAAAuB,EAAA,SACAK,EAAA5B,EAAAxK,EAAA,WACAoM,EAAA5B,EAAAwB,EAAA,WACAxB,EAAA,MAOA,QAAA4B,GAAA5B,EAAAmB,EAAAnC,GACA,KAAAgB,EAAAmB,GAGA,MAAAnB,GAAA,IAAAmB,EACA1B,KAAAoC,MAAA7B,EAAAmB,GAAA,IAAAnC,EAEAS,KAAAqC,KAAA9B,EAAAmB,GAAA,IAAAnC,EAAA,IAlJA,GAAAwC,GAAA,IACAhM,EAAA,GAAAgM,EACAD,EAAA,GAAA/L,EACA8L,EAAA,GAAAC,EACAF,EAAA,OAAAC,CAgBAzM,GAAAD,QAAA,SAAA2L,EAAAwB,GACAA,OACA,IAAA3I,SAAAmH,EACA,eAAAnH,GAAAmH,EAAA3H,OAAA,EACA,MAAAqI,GAAAV,EACG,eAAAnH,GAAA4I,MAAAzB,MAAA,EACH,MAAAwB,WAAAJ,EAAApB,GAAAkB,EAAAlB,EAEA,UAAAhE,OACA,wDACAN,KAAAC,UAAAqE,MRo+BM,SAAU1L,EAAQD,EAASM,GSr5BjC,QAAA+M,MAoCA,QAAAC,GAAAjL,GAGA,GAAAqB,GAAA,GAAArB,EAAAmC,IAwBA,OArBAxE,GAAAuN,eAAAlL,EAAAmC,MAAAxE,EAAAwN,aAAAnL,EAAAmC,OACAd,GAAArB,EAAAoL,YAAA,KAKApL,EAAAqL,KAAA,MAAArL,EAAAqL,MACAhK,GAAArB,EAAAqL,IAAA,KAIA,MAAArL,EAAA5B,KACAiD,GAAArB,EAAA5B,IAIA,MAAA4B,EAAAsL,OACAjK,GAAA2D,KAAAC,UAAAjF,EAAAsL,OAGA5L,EAAA,mBAAAM,EAAAqB,GACAA,EAaA,QAAAkK,GAAAvL,EAAAwL,GAEA,QAAAC,GAAAC,GACA,GAAAC,GAAAC,EAAAC,kBAAAH,GACAI,EAAAb,EAAAU,EAAAI,QACAC,EAAAL,EAAAK,OAEAA,GAAA7C,QAAA2C,GACAN,EAAAQ,GAGAJ,EAAAK,YAAAjM,EAAAyL,GAUA,QAAAS,KACAnO,KAAAoO,cAAA,KAwDA,QAAAC,GAAA/K,GACA,GAAAQ,GAAA,EAEApD,GACA0D,KAAAkK,OAAAhL,EAAAT,OAAA,IAGA,UAAAjD,EAAA2O,MAAA7N,EAAA0D,MAAA,MAAAoK,IAGA,IAAA5O,EAAAuN,eAAAzM,EAAA0D,MAAAxE,EAAAwN,aAAA1M,EAAA0D,KAAA,CAEA,IADA,GAAAqK,GAAA,GACA,MAAAnL,EAAAT,SAAAiB,KACA2K,GAAAnL,EAAAT,OAAAiB,GACAA,GAAAR,EAAAM,UAEA,GAAA6K,GAAAH,OAAAG,IAAA,MAAAnL,EAAAT,OAAAiB,GACA,SAAAyD,OAAA,sBAEA7G,GAAA2M,YAAAiB,OAAAG,GAIA,SAAAnL,EAAAT,OAAAiB,EAAA,GAEA,IADApD,EAAA4M,IAAA,KACAxJ,GAAA,CACA,GAAArD,GAAA6C,EAAAT,OAAAiB,EACA,UAAArD,EAAA,KAEA,IADAC,EAAA4M,KAAA7M,EACAqD,IAAAR,EAAAM,OAAA,UAGAlD,GAAA4M,IAAA,GAIA,IAAAoB,GAAApL,EAAAT,OAAAiB,EAAA,EACA,SAAA4K,GAAAJ,OAAAI,MAAA,CAEA,IADAhO,EAAAL,GAAA,KACAyD,GAAA,CACA,GAAArD,GAAA6C,EAAAT,OAAAiB,EACA,UAAArD,GAAA6N,OAAA7N,MAAA,GACAqD,CACA,OAGA,GADApD,EAAAL,IAAAiD,EAAAT,OAAAiB,GACAA,IAAAR,EAAAM,OAAA,MAEAlD,EAAAL,GAAAiO,OAAA5N,EAAAL,IASA,MALAiD,GAAAT,SAAAiB,KACApD,EAAAiO,EAAAjO,EAAA4C,EAAAwI,OAAAhI,KAGAnC,EAAA,mBAAA2B,EAAA5C,GACAA,EAGA,QAAAiO,GAAAjO,EAAA4C,GACA,IACA5C,EAAA6M,KAAAtG,KAAAgF,MAAA3I,GACG,MAAAG,GACH,MAAA+K,KAEA,MAAA9N,GAyBA,QAAAkO,GAAAZ,GACAhO,KAAA6O,UAAAb,EACAhO,KAAAiO,WAkCA,QAAAO,KACA,OACApK,KAAAxE,EAAAkP,MACAvB,KAAA,gBAxYA,GAAA5L,GAAAzB,EAAA,uBACA6O,EAAA7O,EAAA,GACA8O,EAAA9O,EAAA,GACA2N,EAAA3N,EAAA,IACA+O,EAAA/O,EAAA,GAQAN,GAAA0C,SAAA,EAQA1C,EAAA2O,OACA,UACA,aACA,QACA,MACA,QACA,eACA,cASA3O,EAAAsP,QAAA,EAQAtP,EAAAuP,WAAA,EAQAvP,EAAAwP,MAAA,EAQAxP,EAAAyP,IAAA,EAQAzP,EAAAkP,MAAA,EAQAlP,EAAAuN,aAAA,EAQAvN,EAAAwN,WAAA,EAQAxN,EAAAqN,UAQArN,EAAAuO,UAoBAlB,EAAA9K,UAAAmN,OAAA,SAAArN,EAAAwL,GAOA,GANAxL,EAAAmC,OAAAxE,EAAAwP,OAAAnN,EAAAmC,OAAAxE,EAAAyP,MAAAL,EAAA/M,EAAAsL,QACAtL,EAAAmC,KAAAnC,EAAAmC,OAAAxE,EAAAwP,MAAAxP,EAAAuN,aAAAvN,EAAAwN,YAGAzL,EAAA,qBAAAM,GAEArC,EAAAuN,eAAAlL,EAAAmC,MAAAxE,EAAAwN,aAAAnL,EAAAmC,KACAoJ,EAAAvL,EAAAwL,OAEA,CACA,GAAA8B,GAAArC,EAAAjL,EACAwL,IAAA8B,MAiFAR,EAAAZ,EAAAhM,WAUAgM,EAAAhM,UAAAqN,IAAA,SAAAvN,GACA,GAAA+L,EACA,oBAAA/L,GACA+L,EAAAK,EAAApM,GACArC,EAAAuN,eAAAa,EAAA5J,MAAAxE,EAAAwN,aAAAY,EAAA5J,MACApE,KAAAoO,cAAA,GAAAQ,GAAAZ,GAGA,IAAAhO,KAAAoO,cAAAS,UAAAxB,aACArN,KAAA4J,KAAA,UAAAoE,IAGAhO,KAAA4J,KAAA,UAAAoE,OAGA,KAAAiB,EAAAhN,OAAAwN,OAYA,SAAAlI,OAAA,iBAAAtF,EAXA,KAAAjC,KAAAoO,cACA,SAAA7G,OAAA,mDAEAyG,GAAAhO,KAAAoO,cAAAsB,eAAAzN,GACA+L,IACAhO,KAAAoO,cAAA,KACApO,KAAA4J,KAAA,UAAAoE,MA4FAG,EAAAhM,UAAAwN,QAAA,WACA3P,KAAAoO,eACApO,KAAAoO,cAAAwB,0BA6BAhB,EAAAzM,UAAAuN,eAAA,SAAAG,GAEA,GADA7P,KAAAiO,QAAAjF,KAAA6G,GACA7P,KAAAiO,QAAArK,SAAA5D,KAAA6O,UAAAxB,YAAA,CACA,GAAAW,GAAAH,EAAAiC,kBAAA9P,KAAA6O,UAAA7O,KAAAiO,QAEA,OADAjO,MAAA4P,yBACA5B,EAEA,aASAY,EAAAzM,UAAAyN,uBAAA,WACA5P,KAAA6O,UAAA,KACA7O,KAAAiO,aTqhCM,SAAUpO,EAAQD,EAASM,GU74CjC,QAAA6O,GAAA9M,GACA,GAAAA,EAAA,MAAA8N,GAAA9N,GAWA,QAAA8N,GAAA9N,GACA,OAAA+N,KAAAjB,GAAA5M,UACAF,EAAA+N,GAAAjB,EAAA5M,UAAA6N,EAEA,OAAA/N,GAzBApC,EAAAD,QAAAmP,EAqCAA,EAAA5M,UAAAmH,GACAyF,EAAA5M,UAAA8N,iBAAA,SAAAC,EAAAC,GAIA,MAHAnQ,MAAAoQ,WAAApQ,KAAAoQ,gBACApQ,KAAAoQ,WAAA,IAAAF,GAAAlQ,KAAAoQ,WAAA,IAAAF,QACAlH,KAAAmH,GACAnQ,MAaA+O,EAAA5M,UAAAqH,KAAA,SAAA0G,EAAAC,GACA,QAAA7G,KACAtJ,KAAAyJ,IAAAyG,EAAA5G,GACA6G,EAAApK,MAAA/F,KAAAgG,WAKA,MAFAsD,GAAA6G,KACAnQ,KAAAsJ,GAAA4G,EAAA5G,GACAtJ,MAaA+O,EAAA5M,UAAAsH,IACAsF,EAAA5M,UAAAuH,eACAqF,EAAA5M,UAAAwH,mBACAoF,EAAA5M,UAAAkO,oBAAA,SAAAH,EAAAC,GAIA,GAHAnQ,KAAAoQ,WAAApQ,KAAAoQ,eAGA,GAAApK,UAAApC,OAEA,MADA5D,MAAAoQ,cACApQ,IAIA,IAAAsQ,GAAAtQ,KAAAoQ,WAAA,IAAAF,EACA,KAAAI,EAAA,MAAAtQ,KAGA,OAAAgG,UAAApC,OAEA,aADA5D,MAAAoQ,WAAA,IAAAF,GACAlQ,IAKA,QADAuQ,GACAzM,EAAA,EAAiBA,EAAAwM,EAAA1M,OAAsBE,IAEvC,GADAyM,EAAAD,EAAAxM,GACAyM,IAAAJ,GAAAI,EAAAJ,OAAA,CACAG,EAAA5K,OAAA5B,EAAA,EACA,OAGA,MAAA9D,OAWA+O,EAAA5M,UAAAyH,KAAA,SAAAsG,GACAlQ,KAAAoQ,WAAApQ,KAAAoQ,cACA,IAAA/K,MAAAmL,MAAAjQ,KAAAyF,UAAA,GACAsK,EAAAtQ,KAAAoQ,WAAA,IAAAF,EAEA,IAAAI,EAAA,CACAA,IAAAE,MAAA,EACA,QAAA1M,GAAA,EAAA2E,EAAA6H,EAAA1M,OAA2CE,EAAA2E,IAAS3E,EACpDwM,EAAAxM,GAAAiC,MAAA/F,KAAAqF,GAIA,MAAArF,OAWA+O,EAAA5M,UAAA4H,UAAA,SAAAmG,GAEA,MADAlQ,MAAAoQ,WAAApQ,KAAAoQ,eACApQ,KAAAoQ,WAAA,IAAAF,QAWAnB,EAAA5M,UAAAsO,aAAA,SAAAP,GACA,QAAAlQ,KAAA+J,UAAAmG,GAAAtM,SVo6CM,SAAU/D,EAAQD,EAASM,IWrkDjC,SAAAuC,GA2BA,QAAAiO,GAAAzO,GACA,IAAAA,GAAA,gBAAAA,GACA,QAGA,IAAA0O,EAAA1O,GAAA,CACA,OAAA6B,GAAA,EAAA8M,EAAA3O,EAAA2B,OAAmCE,EAAA8M,EAAO9M,IAC1C,GAAA4M,EAAAzO,EAAA6B,IACA,QAGA,UAGA,qBAAArB,GAAAoO,QAAApO,EAAAoO,OAAAC,UAAArO,EAAAoO,OAAAC,SAAA7O,IACA,kBAAAQ,GAAAsO,aAAA9O,YAAA8O,cACAC,GAAA/O,YAAAgP,OACAC,GAAAjP,YAAAkP,MAEA,QAIA,IAAAlP,EAAAmP,QAAA,kBAAAnP,GAAAmP,QAAA,IAAApL,UAAApC,OACA,MAAA8M,GAAAzO,EAAAmP,UAAA,EAGA,QAAApB,KAAA/N,GACA,GAAAoP,OAAAlP,UAAAmP,eAAA/Q,KAAA0B,EAAA+N,IAAAU,EAAAzO,EAAA+N,IACA,QAIA,UAtDA,GAAAW,GAAAzQ,EAAA,IAEAqR,EAAAF,OAAAlP,UAAAoP,SACAP,EAAA,kBAAAvO,GAAAwO,MAAA,6BAAAM,EAAAhR,KAAAkC,EAAAwO,MACAC,EAAA,kBAAAzO,GAAA0O,MAAA,6BAAAI,EAAAhR,KAAAkC,EAAA0O,KAMAtR,GAAAD,QAAA8Q,IXsnD8BnQ,KAAKX,EAAU,WAAa,MAAOI,WAI3D,SAAUH,EAAQD,GY1oDxB,GAAA2R,MAAiBA,QAEjB1R,GAAAD,QAAAmJ,MAAA4H,SAAA,SAAAa,GACA,wBAAAD,EAAAhR,KAAAiR,KZkpDM,SAAU3R,EAAQD,EAASM,IarpDjC,SAAAuC,GA+BA,QAAAgP,GAAAlE,EAAAU,GACA,IAAAV,EAAA,MAAAA,EAEA,IAAA0B,EAAA1B,GAAA,CACA,GAAAmE,IAAuBC,cAAA,EAAAC,IAAA3D,EAAArK,OAEvB,OADAqK,GAAAjF,KAAAuE,GACAmE,EACG,GAAAf,EAAApD,GAAA,CAEH,OADAsE,GAAA,GAAA9I,OAAAwE,EAAA3J,QACAE,EAAA,EAAmBA,EAAAyJ,EAAA3J,OAAiBE,IACpC+N,EAAA/N,GAAA2N,EAAAlE,EAAAzJ,GAAAmK,EAEA,OAAA4D,GACG,mBAAAtE,kBAAAxC,OAAA,CACH,GAAA8G,KACA,QAAA7B,KAAAzC,GACAsE,EAAA7B,GAAAyB,EAAAlE,EAAAyC,GAAA/B,EAEA,OAAA4D,GAEA,MAAAtE,GAkBA,QAAAuE,GAAAvE,EAAAU,GACA,IAAAV,EAAA,MAAAA,EAEA,IAAAA,KAAAoE,aACA,MAAA1D,GAAAV,EAAAqE,IACG,IAAAjB,EAAApD,GACH,OAAAzJ,GAAA,EAAmBA,EAAAyJ,EAAA3J,OAAiBE,IACpCyJ,EAAAzJ,GAAAgO,EAAAvE,EAAAzJ,GAAAmK,OAEG,oBAAAV,GACH,OAAAyC,KAAAzC,GACAA,EAAAyC,GAAA8B,EAAAvE,EAAAyC,GAAA/B,EAIA,OAAAV,GA9EA,GAAAoD,GAAAzQ,EAAA,IACA+O,EAAA/O,EAAA,IACAqR,EAAAF,OAAAlP,UAAAoP,SACAP,EAAA,kBAAAvO,GAAAwO,MAAA,6BAAAM,EAAAhR,KAAAkC,EAAAwO,MACAC,EAAA,kBAAAzO,GAAA0O,MAAA,6BAAAI,EAAAhR,KAAAkC,EAAA0O,KAYAvR,GAAAkO,kBAAA,SAAAE,GACA,GAAAC,MACA8D,EAAA/D,EAAAT,KACAQ,EAAAC,CAGA,OAFAD,GAAAR,KAAAkE,EAAAM,EAAA9D,GACAF,EAAAV,YAAAY,EAAArK,QACUoK,OAAAD,EAAAE,YAmCVrO,EAAAkQ,kBAAA,SAAA9B,EAAAC,GAGA,MAFAD,GAAAT,KAAAuE,EAAA9D,EAAAT,KAAAU,GACAD,EAAAX,YAAAtM,OACAiN,GA+BApO,EAAAsO,YAAA,SAAAX,EAAAE,GACA,QAAAuE,GAAA/P,EAAAgQ,EAAAC,GACA,IAAAjQ,EAAA,MAAAA,EAGA,IAAA+O,GAAA/O,YAAAgP,OACAC,GAAAjP,YAAAkP,MAAA,CACAgB,GAGA,IAAAC,GAAA,GAAAC,WACAD,GAAAE,OAAA,WACAJ,EACAA,EAAAD,GAAAjS,KAAAuS,OAGA5E,EAAA3N,KAAAuS,SAIAJ,GACA1E,EAAAE,IAIAyE,EAAAI,kBAAAvQ,OACK,IAAA0O,EAAA1O,GACL,OAAA6B,GAAA,EAAqBA,EAAA7B,EAAA2B,OAAgBE,IACrCkO,EAAA/P,EAAA6B,KAAA7B,OAEK,oBAAAA,KAAAgN,EAAAhN,GACL,OAAA+N,KAAA/N,GACA+P,EAAA/P,EAAA+N,KAAA/N,GAKA,GAAAkQ,GAAA,EACAxE,EAAAJ,CACAyE,GAAArE,GACAwE,GACA1E,EAAAE,Mb2pD8BpN,KAAKX,EAAU,WAAa,MAAOI,WAI3D,SAAUH,EAAQD,IAEK,SAAS6C,GclyDtC,QAAAwM,GAAAhN,GACA,MAAAQ,GAAAoO,QAAApO,EAAAoO,OAAAC,SAAA7O,IACAQ,EAAAsO,aAAA9O,YAAA8O,aAVAlR,EAAAD,QAAAqP,IdwzD8B1O,KAAKX,EAAU,WAAa,MAAOI,WAI3D,SAAUH,EAAQD,EAASM,GAEhC,Ye5xDD,SAAS0B,GAAShB,EAAKC,GACrB,KAAMb,eAAgB4B,IAAU,MAAO,IAAIA,GAAQhB,EAAKC,EACpDD,IAAQ,+BAAoBA,GAApB,YAAAE,EAAoBF,MAC9BC,EAAOD,EACPA,EAAMG,QAERF,EAAOA,MAEPA,EAAKO,KAAOP,EAAKO,MAAQ,aACzBpB,KAAKuB,QACLvB,KAAKyS,QACLzS,KAAKa,KAAOA,EACZb,KAAK0S,aAAa7R,EAAK6R,gBAAiB,GACxC1S,KAAK2S,qBAAqB9R,EAAK8R,sBAAwBC,KACvD5S,KAAK6S,kBAAkBhS,EAAKgS,mBAAqB,KACjD7S,KAAK8S,qBAAqBjS,EAAKiS,sBAAwB,KACvD9S,KAAK+S,oBAAoBlS,EAAKkS,qBAAuB,IACrD/S,KAAKgT,QAAU,GAAIC,IACjBC,IAAKlT,KAAK6S,oBACVM,IAAKnT,KAAK8S,uBACVM,OAAQpT,KAAK+S,wBAEf/S,KAAKwI,QAAQ,MAAQ3H,EAAK2H,QAAU,IAAQ3H,EAAK2H,SACjDxI,KAAKqT,WAAa,SAClBrT,KAAKY,IAAMA,EACXZ,KAAKsT,cACLtT,KAAKuT,SAAW,KAChBvT,KAAKuP,UAAW,EAChBvP,KAAKwT,eACL,IAAIC,GAAU5S,EAAKuB,QAAUA,CAC7BpC,MAAK0T,QAAU,GAAID,GAAQxG,QAC3BjN,KAAK2T,QAAU,GAAIF,GAAQtF,QAC3BnO,KAAK4T,YAAc/S,EAAK+S,eAAgB,EACpC5T,KAAK4T,aAAa5T,KAAK6T,Of6vD5B,GAAI/S,GAA4B,kBAAXiB,SAAoD,gBAApBA,QAAOC,SAAwB,SAAUC,GAAO,aAAcA,IAAS,SAAUA,GAAO,MAAOA,IAAyB,kBAAXF,SAAyBE,EAAIC,cAAgBH,QAAUE,IAAQF,OAAOI,UAAY,eAAkBF,Ie5zDnQ6R,EAAM5T,EAAQ,IACdsC,EAAStC,EAAQ,IACjB6O,EAAU7O,EAAQ,GAClBkC,EAASlC,EAAQ,GACjBoJ,EAAKpJ,EAAQ,IACbuL,EAAOvL,EAAQ,IACfyB,EAAQzB,EAAQ,GAAS,4BACzBgD,EAAUhD,EAAQ,IAClB+S,EAAU/S,EAAQ,IAMlB6T,EAAM1C,OAAOlP,UAAUmP,cAM3BzR,GAAOD,QAAUgC,EAoDjBA,EAAQO,UAAU6R,QAAU,WAC1BhU,KAAK4J,KAAK7D,MAAM/F,KAAMgG,UACtB,KAAK,GAAIsH,KAAOtN,MAAKuB,KACfwS,EAAIxT,KAAKP,KAAKuB,KAAM+L,IACtBtN,KAAKuB,KAAK+L,GAAK1D,KAAK7D,MAAM/F,KAAKuB,KAAK+L,GAAMtH,YAWhDpE,EAAQO,UAAU8R,gBAAkB,WAClC,IAAK,GAAI3G,KAAOtN,MAAKuB,KACfwS,EAAIxT,KAAKP,KAAKuB,KAAM+L,KACtBtN,KAAKuB,KAAK+L,GAAKjN,GAAKL,KAAKkU,WAAW5G,KAa1C1L,EAAQO,UAAU+R,WAAa,SAAU5G,GACvC,OAAgB,MAARA,EAAc,GAAMA,EAAM,KAAQtN,KAAKmU,OAAO9T,IAOxD0O,EAAQnN,EAAQO,WAUhBP,EAAQO,UAAUuQ,aAAe,SAAU1L,GACzC,MAAKhB,WAAUpC,QACf5D,KAAKoU,gBAAkBpN,EAChBhH,MAFuBA,KAAKoU,eAarCxS,EAAQO,UAAUwQ,qBAAuB,SAAU3L,GACjD,MAAKhB,WAAUpC,QACf5D,KAAKqU,sBAAwBrN,EACtBhH,MAFuBA,KAAKqU,uBAarCzS,EAAQO,UAAU0Q,kBAAoB,SAAU7L,GAC9C,MAAKhB,WAAUpC,QACf5D,KAAKsU,mBAAqBtN,EAC1BhH,KAAKgT,SAAWhT,KAAKgT,QAAQuB,OAAOvN,GAC7BhH,MAHuBA,KAAKsU,oBAMrC1S,EAAQO,UAAU4Q,oBAAsB,SAAU/L,GAChD,MAAKhB,WAAUpC,QACf5D,KAAKwU,qBAAuBxN,EAC5BhH,KAAKgT,SAAWhT,KAAKgT,QAAQyB,UAAUzN,GAChChH,MAHuBA,KAAKwU,sBAcrC5S,EAAQO,UAAU2Q,qBAAuB,SAAU9L,GACjD,MAAKhB,WAAUpC,QACf5D,KAAK0U,sBAAwB1N,EAC7BhH,KAAKgT,SAAWhT,KAAKgT,QAAQ2B,OAAO3N,GAC7BhH,MAHuBA,KAAK0U,uBAarC9S,EAAQO,UAAUqG,QAAU,SAAUxB,GACpC,MAAKhB,WAAUpC,QACf5D,KAAK4U,SAAW5N,EACThH,MAFuBA,KAAK4U,UAYrChT,EAAQO,UAAU0S,qBAAuB,YAElC7U,KAAK8U,cAAgB9U,KAAKoU,eAA2C,IAA1BpU,KAAKgT,QAAQ+B,UAE3D/U,KAAKgV,aAYTpT,EAAQO,UAAU0R,KAClBjS,EAAQO,UAAUI,QAAU,SAAU4N,EAAItP,GAExC,GADAc,EAAM,gBAAiB3B,KAAKqT,aACvBrT,KAAKqT,WAAWnQ,QAAQ,QAAS,MAAOlD,KAE7C2B,GAAM,aAAc3B,KAAKY,KACzBZ,KAAKmU,OAASL,EAAI9T,KAAKY,IAAKZ,KAAKa,KACjC,IAAIiB,GAAS9B,KAAKmU,OACdtJ,EAAO7K,IACXA,MAAKqT,WAAa,UAClBrT,KAAKiV,eAAgB,CAGrB,IAAIC,GAAU5L,EAAGxH,EAAQ,OAAQ,WAC/B+I,EAAKsK,SACLhF,GAAMA,MAIJiF,EAAW9L,EAAGxH,EAAQ,QAAS,SAAUyL,GAK3C,GAJA5L,EAAM,iBACNkJ,EAAKwK,UACLxK,EAAKwI,WAAa,SAClBxI,EAAKmJ,QAAQ,gBAAiBzG,GAC1B4C,EAAI,CACN,GAAIhJ,GAAM,GAAII,OAAM,mBACpBJ,GAAIoG,KAAOA,EACX4C,EAAGhJ,OAGH0D,GAAKgK,wBAKT,KAAI,IAAU7U,KAAK4U,SAAU,CAC3B,GAAIpM,GAAUxI,KAAK4U,QACnBjT,GAAM,wCAAyC6G,EAG/C,IAAI8M,GAAQ1N,WAAW,WACrBjG,EAAM,qCAAsC6G,GAC5C0M,EAAQvF,UACR7N,EAAOyT,QACPzT,EAAO8H,KAAK,QAAS,WACrBiB,EAAKmJ,QAAQ,kBAAmBxL,IAC/BA,EAEHxI,MAAKyS,KAAKzJ,MACR2G,QAAS,WACP3H,aAAasN,MAQnB,MAHAtV,MAAKyS,KAAKzJ,KAAKkM,GACflV,KAAKyS,KAAKzJ,KAAKoM,GAERpV,MAST4B,EAAQO,UAAUgT,OAAS,WACzBxT,EAAM,QAGN3B,KAAKqV,UAGLrV,KAAKqT,WAAa,OAClBrT,KAAK4J,KAAK,OAGV,IAAI9H,GAAS9B,KAAKmU,MAClBnU,MAAKyS,KAAKzJ,KAAKM,EAAGxH,EAAQ,OAAQ2J,EAAKzL,KAAM,YAC7CA,KAAKyS,KAAKzJ,KAAKM,EAAGxH,EAAQ,OAAQ2J,EAAKzL,KAAM,YAC7CA,KAAKyS,KAAKzJ,KAAKM,EAAGxH,EAAQ,OAAQ2J,EAAKzL,KAAM,YAC7CA,KAAKyS,KAAKzJ,KAAKM,EAAGxH,EAAQ,QAAS2J,EAAKzL,KAAM,aAC9CA,KAAKyS,KAAKzJ,KAAKM,EAAGxH,EAAQ,QAAS2J,EAAKzL,KAAM,aAC9CA,KAAKyS,KAAKzJ,KAAKM,EAAGtJ,KAAK2T,QAAS,UAAWlI,EAAKzL,KAAM,gBASxD4B,EAAQO,UAAUqT,OAAS,WACzBxV,KAAKuT,SAAW,GAAIxI,MACpB/K,KAAKgU,QAAQ,SASfpS,EAAQO,UAAUsT,OAAS,WACzBzV,KAAKgU,QAAQ,OAAQ,GAAIjJ,MAAS/K,KAAKuT,WASzC3R,EAAQO,UAAUuT,OAAS,SAAUnI,GACnCvN,KAAK2T,QAAQnE,IAAIjC,IASnB3L,EAAQO,UAAUwT,UAAY,SAAU3H,GACtChO,KAAK4J,KAAK,SAAUoE,IAStBpM,EAAQO,UAAUyT,QAAU,SAAUzO,GACpCxF,EAAM,QAASwF,GACfnH,KAAKgU,QAAQ,QAAS7M,IAUxBvF,EAAQO,UAAUL,OAAS,SAAUwL,EAAKzM,GAiBxC,QAASgV,MACD3S,EAAQ2H,EAAKyI,WAAYxR,IAC7B+I,EAAKyI,WAAWtK,KAAKlH,GAlBzB,GAAIA,GAAS9B,KAAKuB,KAAK+L,EACvB,KAAKxL,EAAQ,CACXA,EAAS,GAAIU,GAAOxC,KAAMsN,EAAKzM,GAC/Bb,KAAKuB,KAAK+L,GAAOxL,CACjB,IAAI+I,GAAO7K,IACX8B,GAAOwH,GAAG,aAAcuM,GACxB/T,EAAOwH,GAAG,UAAW,WACnBxH,EAAOzB,GAAKwK,EAAKqJ,WAAW5G,KAG1BtN,KAAK4T,aAEPiC,IAUJ,MAAO/T,IASTF,EAAQO,UAAUwN,QAAU,SAAU7N,GACpC,GAAI6D,GAAQzC,EAAQlD,KAAKsT,WAAYxR,IAChC6D,GAAO3F,KAAKsT,WAAW5N,OAAOC,EAAO,GACtC3F,KAAKsT,WAAW1P,QAEpB5D,KAAKuV,SAUP3T,EAAQO,UAAU6L,OAAS,SAAUA,GACnCrM,EAAM,oBAAqBqM,EAC3B,IAAInD,GAAO7K,IACPgO,GAAOnM,OAAyB,IAAhBmM,EAAO5J,OAAY4J,EAAOV,KAAO,IAAMU,EAAOnM,OAE7DgJ,EAAK0E,SAWR1E,EAAK2I,aAAaxK,KAAKgF,IATvBnD,EAAK0E,UAAW,EAChBvP,KAAK0T,QAAQpE,OAAOtB,EAAQ,SAAU8H,GACpC,IAAK,GAAIhS,GAAI,EAAGA,EAAIgS,EAAelS,OAAQE,IACzC+G,EAAKsJ,OAAO4B,MAAMD,EAAehS,GAAIkK,EAAOjB,QAE9ClC,GAAK0E,UAAW,EAChB1E,EAAKmL,yBAcXpU,EAAQO,UAAU6T,mBAAqB,WACrC,GAAIhW,KAAKwT,aAAa5P,OAAS,IAAM5D,KAAKuP,SAAU,CAClD,GAAIxB,GAAO/N,KAAKwT,aAAayC,OAC7BjW,MAAKgO,OAAOD,KAUhBnM,EAAQO,UAAUkT,QAAU,WAC1B1T,EAAM,UAGN,KAAK,GADDuU,GAAalW,KAAKyS,KAAK7O,OAClBE,EAAI,EAAGA,EAAIoS,EAAYpS,IAAK,CACnC,GAAIqS,GAAMnW,KAAKyS,KAAKwD,OACpBE,GAAIxG,UAGN3P,KAAKwT,gBACLxT,KAAKuP,UAAW,EAChBvP,KAAKuT,SAAW,KAEhBvT,KAAK2T,QAAQhE,WASf/N,EAAQO,UAAUoT,MAClB3T,EAAQO,UAAUiU,WAAa,WAC7BzU,EAAM,cACN3B,KAAKiV,eAAgB,EACrBjV,KAAK8U,cAAe,EAChB,YAAc9U,KAAKqT,YAGrBrT,KAAKqV,UAEPrV,KAAKgT,QAAQqD,QACbrW,KAAKqT,WAAa,SACdrT,KAAKmU,QAAQnU,KAAKmU,OAAOoB,SAS/B3T,EAAQO,UAAUmU,QAAU,SAAUC,GACpC5U,EAAM,WAEN3B,KAAKqV,UACLrV,KAAKgT,QAAQqD,QACbrW,KAAKqT,WAAa,SAClBrT,KAAK4J,KAAK,QAAS2M,GAEfvW,KAAKoU,gBAAkBpU,KAAKiV,eAC9BjV,KAAKgV,aAUTpT,EAAQO,UAAU6S,UAAY,WAC5B,GAAIhV,KAAK8U,cAAgB9U,KAAKiV,cAAe,MAAOjV,KAEpD,IAAI6K,GAAO7K,IAEX,IAAIA,KAAKgT,QAAQ+B,UAAY/U,KAAKqU,sBAChC1S,EAAM,oBACN3B,KAAKgT,QAAQqD,QACbrW,KAAKgU,QAAQ,oBACbhU,KAAK8U,cAAe,MACf,CACL,GAAI0B,GAAQxW,KAAKgT,QAAQyD,UACzB9U,GAAM,0CAA2C6U,GAEjDxW,KAAK8U,cAAe,CACpB,IAAIQ,GAAQ1N,WAAW,WACjBiD,EAAKoK,gBAETtT,EAAM,wBACNkJ,EAAKmJ,QAAQ,oBAAqBnJ,EAAKmI,QAAQ+B,UAC/ClK,EAAKmJ,QAAQ,eAAgBnJ,EAAKmI,QAAQ+B,UAGtClK,EAAKoK,eAETpK,EAAKgJ,KAAK,SAAU1M,GACdA,GACFxF,EAAM,2BACNkJ,EAAKiK,cAAe,EACpBjK,EAAKmK,YACLnK,EAAKmJ,QAAQ,kBAAmB7M,EAAIoG,QAEpC5L,EAAM,qBACNkJ,EAAK6L,mBAGRF,EAEHxW,MAAKyS,KAAKzJ,MACR2G,QAAS,WACP3H,aAAasN,QAYrB1T,EAAQO,UAAUuU,YAAc,WAC9B,GAAIC,GAAU3W,KAAKgT,QAAQ+B,QAC3B/U,MAAK8U,cAAe,EACpB9U,KAAKgT,QAAQqD,QACbrW,KAAKiU,kBACLjU,KAAKgU,QAAQ,YAAa2C,Kfs0DtB,SAAU9W,EAAQD,EAASM,GgBh4EjCL,EAAAD,QAAAM,EAAA,KhBw4EM,SAAUL,EAAQD,EAASM,GiBx4EjCL,EAAAD,QAAAM,EAAA,IAQAL,EAAAD,QAAAwC,OAAAlC,EAAA,KjBg5EM,SAAUL,EAAQD,EAASM,IkBz5EjC,SAAAuC,GA2BA,QAAAD,GAAA5B,EAAAC,GACA,KAAAb,eAAAwC,IAAA,UAAAA,GAAA5B,EAAAC,EAEAA,SAEAD,GAAA,gBAAAA,KACAC,EAAAD,EACAA,EAAA,MAGAA,GACAA,EAAAmC,EAAAnC,GACAC,EAAA+V,SAAAhW,EAAAgC,KACA/B,EAAAgW,OAAA,UAAAjW,EAAA0B,UAAA,QAAA1B,EAAA0B,SACAzB,EAAAmC,KAAApC,EAAAoC,KACApC,EAAAiB,QAAAhB,EAAAgB,MAAAjB,EAAAiB,QACGhB,EAAA+B,OACH/B,EAAA+V,SAAA7T,EAAAlC,EAAA+B,YAGA5C,KAAA6W,OAAA,MAAAhW,EAAAgW,OAAAhW,EAAAgW,OACApU,EAAAE,UAAA,WAAAA,SAAAL,SAEAzB,EAAA+V,WAAA/V,EAAAmC,OAEAnC,EAAAmC,KAAAhD,KAAA6W,OAAA,YAGA7W,KAAA8W,MAAAjW,EAAAiW,QAAA,EACA9W,KAAA4W,SAAA/V,EAAA+V,WACAnU,EAAAE,kBAAAiU,SAAA,aACA5W,KAAAgD,KAAAnC,EAAAmC,OAAAP,EAAAE,mBAAAK,KACAL,SAAAK,KACAhD,KAAA6W,OAAA,QACA7W,KAAA6B,MAAAhB,EAAAgB,UACA,gBAAA7B,MAAA6B,QAAA7B,KAAA6B,MAAAkV,EAAAC,OAAAhX,KAAA6B,QACA7B,KAAAiX,SAAA,IAAApW,EAAAoW,QACAjX,KAAAoB,MAAAP,EAAAO,MAAA,cAAAuC,QAAA,cACA3D,KAAAkX,aAAArW,EAAAqW,WACAlX,KAAAmX,OAAA,IAAAtW,EAAAsW,MACAnX,KAAAoX,cAAAvW,EAAAuW,YACApX,KAAAqX,aAAAxW,EAAAwW,WACArX,KAAAsX,eAAAzW,EAAAyW,gBAAA,IACAtX,KAAAuX,kBAAA1W,EAAA0W,kBACAvX,KAAAwX,WAAA3W,EAAA2W,aAAA,uBACAxX,KAAAyX,iBAAA5W,EAAA4W,qBACAzX,KAAAqT,WAAA,GACArT,KAAA0X,eACA1X,KAAA2X,cAAA,EACA3X,KAAA4X,WAAA/W,EAAA+W,YAAA,IACA5X,KAAA6X,gBAAAhX,EAAAgX,kBAAA,EACA7X,KAAA8X,WAAA,KACA9X,KAAA+X,mBAAAlX,EAAAkX,mBACA/X,KAAAgY,mBAAA,IAAAnX,EAAAmX,oBAAAnX,EAAAmX,wBAEA,IAAAhY,KAAAgY,oBAAAhY,KAAAgY,sBACAhY,KAAAgY,mBAAA,MAAAhY,KAAAgY,kBAAAC,YACAjY,KAAAgY,kBAAAC,UAAA,MAIAjY,KAAAkY,IAAArX,EAAAqX,KAAA,KACAlY,KAAAgQ,IAAAnP,EAAAmP,KAAA,KACAhQ,KAAAmY,WAAAtX,EAAAsX,YAAA,KACAnY,KAAAoY,KAAAvX,EAAAuX,MAAA,KACApY,KAAAqY,GAAAxX,EAAAwX,IAAA,KACArY,KAAAsY,QAAAzX,EAAAyX,SAAA,KACAtY,KAAAuY,mBAAAxX,SAAAF,EAAA0X,oBAAA1X,EAAA0X,mBACAvY,KAAAwY,YAAA3X,EAAA2X,SAGA,IAAAC,GAAA,gBAAAhW,KACAgW,GAAAhW,SAAAgW,IACA5X,EAAA6X,cAAArH,OAAAsH,KAAA9X,EAAA6X,cAAA9U,OAAA,IACA5D,KAAA0Y,aAAA7X,EAAA6X,cAGA7X,EAAA+X,eACA5Y,KAAA4Y,aAAA/X,EAAA+X,eAKA5Y,KAAAK,GAAA,KACAL,KAAA6Y,SAAA,KACA7Y,KAAA8Y,aAAA,KACA9Y,KAAA+Y,YAAA,KAGA/Y,KAAAgZ,kBAAA,KACAhZ,KAAAiZ,iBAAA,KAEAjZ,KAAA6T,OAsFA,QAAAqF,GAAAjX,GACA,GAAAkX,KACA,QAAArV,KAAA7B,GACAA,EAAAqP,eAAAxN,KACAqV,EAAArV,GAAA7B,EAAA6B,GAGA,OAAAqV,GAhNA,GAAA3B,GAAAtX,EAAA,IACA6O,EAAA7O,EAAA,GACAyB,EAAAzB,EAAA,8BACAyF,EAAAzF,EAAA,IACAkC,EAAAlC,EAAA,IACA6C,EAAA7C,EAAA,GACAkZ,EAAAlZ,EAAA,IACA6W,EAAA7W,EAAA,GAMAL,GAAAD,QAAA4C,EAyGAA,EAAA6W,uBAAA,EAMAtK,EAAAvM,EAAAL,WAQAK,EAAAF,SAAAF,EAAAE,SAOAE,WACAA,EAAA8W,UAAApZ,EAAA,IACAsC,EAAAgV,WAAAtX,EAAA,IACAsC,EAAAJ,OAAAlC,EAAA,IAUAsC,EAAAL,UAAAoX,gBAAA,SAAAvP,GACArI,EAAA,0BAAAqI,EACA,IAAAnI,GAAAqX,EAAAlZ,KAAA6B,MAGAA,GAAA2X,IAAApX,EAAAE,SAGAT,EAAA4X,UAAAzP,CAGA,IAAA+C,GAAA/M,KAAAyX,iBAAAzN,MAGAhK,MAAAK,KAAAwB,EAAA6X,IAAA1Z,KAAAK,GAEA,IAAAoZ,GAAA,GAAAjC,GAAAxN,IACAnI,QACAC,OAAA9B,KACA8W,MAAA/J,EAAA+J,OAAA9W,KAAA8W,MACAF,SAAA7J,EAAA6J,UAAA5W,KAAA4W,SACA5T,KAAA+J,EAAA/J,MAAAhD,KAAAgD,KACA6T,OAAA9J,EAAA8J,QAAA7W,KAAA6W,OACAzV,KAAA2L,EAAA3L,MAAApB,KAAAoB,KACA8V,WAAAnK,EAAAmK,YAAAlX,KAAAkX,WACAC,MAAApK,EAAAoK,OAAAnX,KAAAmX,MACAC,YAAArK,EAAAqK,aAAApX,KAAAoX,YACAC,WAAAtK,EAAAsK,YAAArX,KAAAqX,WACAE,kBAAAxK,EAAAwK,mBAAAvX,KAAAuX,kBACAD,eAAAvK,EAAAuK,gBAAAtX,KAAAsX,eACAM,WAAA7K,EAAA6K,YAAA5X,KAAA4X,WACAM,IAAAnL,EAAAmL,KAAAlY,KAAAkY,IACAlI,IAAAjD,EAAAiD,KAAAhQ,KAAAgQ,IACAmI,WAAApL,EAAAoL,YAAAnY,KAAAmY,WACAC,KAAArL,EAAAqL,MAAApY,KAAAoY,KACAC,GAAAtL,EAAAsL,IAAArY,KAAAqY,GACAC,QAAAvL,EAAAuL,SAAAtY,KAAAsY,QACAC,mBAAAxL,EAAAwL,oBAAAvY,KAAAuY,mBACAP,kBAAAjL,EAAAiL,mBAAAhY,KAAAgY,kBACAU,aAAA3L,EAAA2L,cAAA1Y,KAAA0Y,aACAF,UAAAzL,EAAAyL,WAAAxY,KAAAwY,UACAI,aAAA7L,EAAA6L,cAAA5Y,KAAA4Y,aACAe,eAAA5M,EAAA4M,gBAAA3Z,KAAA2Z,eACAC,UAAA7M,EAAA6M,WAAA,QAGA,OAAAH,IAkBAjX,EAAAL,UAAA0R,KAAA,WACA,GAAA4F,EACA,IAAAzZ,KAAA6X,iBAAArV,EAAA6W,uBAAArZ,KAAAwX,WAAAtU,QAAA,kBACAuW,EAAA,gBACG,QAAAzZ,KAAAwX,WAAA5T,OAAA,CAEH,GAAAiH,GAAA7K,IAIA,YAHA4H,YAAA,WACAiD,EAAAjB,KAAA,oCACK,GAGL6P,EAAAzZ,KAAAwX,WAAA,GAEAxX,KAAAqT,WAAA,SAGA,KACAoG,EAAAzZ,KAAAuZ,gBAAAE,GACG,MAAAhW,GAGH,MAFAzD,MAAAwX,WAAAvB,YACAjW,MAAA6T,OAIA4F,EAAA5F,OACA7T,KAAA6Z,aAAAJ,IASAjX,EAAAL,UAAA0X,aAAA,SAAAJ,GACA9X,EAAA,uBAAA8X,EAAAzP,KACA,IAAAa,GAAA7K,IAEAA,MAAAyZ,YACA9X,EAAA,iCAAA3B,KAAAyZ,UAAAzP,MACAhK,KAAAyZ,UAAA9P,sBAIA3J,KAAAyZ,YAGAA,EACAnQ,GAAA,mBACAuB,EAAAiP,YAEAxQ,GAAA,kBAAA0E,GACAnD,EAAAkP,SAAA/L,KAEA1E,GAAA,iBAAA7F,GACAoH,EAAAmP,QAAAvW,KAEA6F,GAAA,mBACAuB,EAAAoP,QAAA,sBAWAzX,EAAAL,UAAA+X,MAAA,SAAAlQ,GAQA,QAAAmQ,KACA,GAAAtP,EAAAkN,mBAAA,CACA,GAAAqC,IAAApa,KAAAqa,gBAAAxP,EAAA4O,UAAAY,cACAC,MAAAF,EAEAE,IAEA3Y,EAAA,8BAAAqI,GACAyP,EAAAc,OAAqBnW,KAAA,OAAAmJ,KAAA,WACrBkM,EAAAjQ,KAAA,kBAAAgR,GACA,IAAAF,EACA,YAAAE,EAAApW,MAAA,UAAAoW,EAAAjN,KAAA,CAIA,GAHA5L,EAAA,4BAAAqI,GACAa,EAAA4P,WAAA,EACA5P,EAAAjB,KAAA,YAAA6P,IACAA,EAAA,MACAjX,GAAA6W,sBAAA,cAAAI,EAAAzP,KAEArI,EAAA,iCAAAkJ,EAAA4O,UAAAzP,MACAa,EAAA4O,UAAAiB,MAAA,WACAJ,GACA,WAAAzP,EAAAwI,aACA1R,EAAA,iDAEA0T,IAEAxK,EAAAgP,aAAAJ,GACAA,EAAAc,OAA2BnW,KAAA,aAC3ByG,EAAAjB,KAAA,UAAA6P,GACAA,EAAA,KACA5O,EAAA4P,WAAA,EACA5P,EAAA8P,eAEO,CACPhZ,EAAA,8BAAAqI,EACA,IAAA7C,GAAA,GAAAI,OAAA,cACAJ,GAAAsS,YAAAzP,KACAa,EAAAjB,KAAA,eAAAzC,OAKA,QAAAyT,KACAN,IAGAA,GAAA,EAEAjF,IAEAoE,EAAAlE,QACAkE,EAAA,MAIA,QAAA7D,GAAAzO,GACA,GAAAqH,GAAA,GAAAjH,OAAA,gBAAAJ,EACAqH,GAAAiL,YAAAzP,KAEA4Q,IAEAjZ,EAAA,mDAAAqI,EAAA7C,GAEA0D,EAAAjB,KAAA,eAAA4E,GAGA,QAAAqM,KACAjF,EAAA,oBAIA,QAAAU,KACAV,EAAA,iBAIA,QAAAkF,GAAAC,GACAtB,GAAAsB,EAAA/Q,OAAAyP,EAAAzP,OACArI,EAAA,6BAAAoZ,EAAA/Q,KAAAyP,EAAAzP,MACA4Q,KAKA,QAAAvF,KACAoE,EAAA/P,eAAA,OAAAyQ,GACAV,EAAA/P,eAAA,QAAAkM,GACA6D,EAAA/P,eAAA,QAAAmR,GACAhQ,EAAAnB,eAAA,QAAA4M,GACAzL,EAAAnB,eAAA,YAAAoR,GAhGAnZ,EAAA,yBAAAqI,EACA,IAAAyP,GAAAzZ,KAAAuZ,gBAAAvP,GAA8CkQ,MAAA,IAC9CI,GAAA,EACAzP,EAAA7K,IAEAwC,GAAA6W,uBAAA,EA8FAI,EAAAjQ,KAAA,OAAA2Q,GACAV,EAAAjQ,KAAA,QAAAoM,GACA6D,EAAAjQ,KAAA,QAAAqR,GAEA7a,KAAAwJ,KAAA,QAAA8M,GACAtW,KAAAwJ,KAAA,YAAAsR,GAEArB,EAAA5F,QASArR,EAAAL,UAAA6Y,OAAA,WASA,GARArZ,EAAA,eACA3B,KAAAqT,WAAA,OACA7Q,EAAA6W,sBAAA,cAAArZ,KAAAyZ,UAAAzP,KACAhK,KAAA4J,KAAA,QACA5J,KAAA2a,QAIA,SAAA3a,KAAAqT,YAAArT,KAAAiX,SAAAjX,KAAAyZ,UAAAiB,MAAA,CACA/Y,EAAA,0BACA,QAAAmC,GAAA,EAAA8M,EAAA5Q,KAAA6Y,SAAAjV,OAA6CE,EAAA8M,EAAO9M,IACpD9D,KAAAka,MAAAla,KAAA6Y,SAAA/U,MAWAtB,EAAAL,UAAA4X,SAAA,SAAA/L,GACA,eAAAhO,KAAAqT,YAAA,SAAArT,KAAAqT,YACA,YAAArT,KAAAqT,WAQA,OAPA1R,EAAA,uCAAAqM,EAAA5J,KAAA4J,EAAAT,MAEAvN,KAAA4J,KAAA,SAAAoE,GAGAhO,KAAA4J,KAAA,aAEAoE,EAAA5J,MACA,WACApE,KAAAib,YAAA7B,EAAApL,EAAAT,MACA,MAEA,YACAvN,KAAAkb,UACAlb,KAAA4J,KAAA,OACA,MAEA,aACA,GAAAzC,GAAA,GAAAI,OAAA,eACAJ,GAAAgU,KAAAnN,EAAAT,KACAvN,KAAAga,QAAA7S,EACA,MAEA,eACAnH,KAAA4J,KAAA,OAAAoE,EAAAT,MACAvN,KAAA4J,KAAA,UAAAoE,EAAAT,UAIA5L,GAAA,8CAAA3B,KAAAqT,aAWA7Q,EAAAL,UAAA8Y,YAAA,SAAA1N,GACAvN,KAAA4J,KAAA,YAAA2D,GACAvN,KAAAK,GAAAkN,EAAAmM,IACA1Z,KAAAyZ,UAAA5X,MAAA6X,IAAAnM,EAAAmM,IACA1Z,KAAA6Y,SAAA7Y,KAAAob,eAAA7N,EAAAsL,UACA7Y,KAAA8Y,aAAAvL,EAAAuL,aACA9Y,KAAA+Y,YAAAxL,EAAAwL,YACA/Y,KAAAgb,SAEA,WAAAhb,KAAAqT,aACArT,KAAAkb,UAGAlb,KAAA0J,eAAA,YAAA1J,KAAAqb,aACArb,KAAAsJ,GAAA,YAAAtJ,KAAAqb,eASA7Y,EAAAL,UAAAkZ,YAAA,SAAA7S,GACAR,aAAAhI,KAAAiZ,iBACA,IAAApO,GAAA7K,IACA6K,GAAAoO,iBAAArR,WAAA,WACA,WAAAiD,EAAAwI,YACAxI,EAAAoP,QAAA,iBACGzR,GAAAqC,EAAAiO,aAAAjO,EAAAkO,cAUHvW,EAAAL,UAAA+Y,QAAA,WACA,GAAArQ,GAAA7K,IACAgI,cAAA6C,EAAAmO,mBACAnO,EAAAmO,kBAAApR,WAAA,WACAjG,EAAA,mDAAAkJ,EAAAkO,aACAlO,EAAAyQ,OACAzQ,EAAAwQ,YAAAxQ,EAAAkO,cACGlO,EAAAiO,eASHtW,EAAAL,UAAAmZ,KAAA,WACA,GAAAzQ,GAAA7K,IACAA,MAAAub,WAAA,kBACA1Q,EAAAjB,KAAA,WAUApH,EAAAL,UAAA2X,QAAA,WACA9Z,KAAA0X,YAAAhS,OAAA,EAAA1F,KAAA2X,eAKA3X,KAAA2X,cAAA,EAEA,IAAA3X,KAAA0X,YAAA9T,OACA5D,KAAA4J,KAAA,SAEA5J,KAAA2a,SAUAnY,EAAAL,UAAAwY,MAAA,WACA,WAAA3a,KAAAqT,YAAArT,KAAAyZ,UAAA+B,WACAxb,KAAAya,WAAAza,KAAA0X,YAAA9T,SACAjC,EAAA,gCAAA3B,KAAA0X,YAAA9T,QACA5D,KAAAyZ,UAAAc,KAAAva,KAAA0X,aAGA1X,KAAA2X,cAAA3X,KAAA0X,YAAA9T,OACA5D,KAAA4J,KAAA,WAcApH,EAAAL,UAAA4T,MACAvT,EAAAL,UAAAoY,KAAA,SAAAC,EAAAzN,EAAAoD,GAEA,MADAnQ,MAAAub,WAAA,UAAAf,EAAAzN,EAAAoD,GACAnQ,MAaAwC,EAAAL,UAAAoZ,WAAA,SAAAnX,EAAAmJ,EAAAR,EAAAoD,GAWA,GAVA,kBAAA5C,KACA4C,EAAA5C,EACAA,EAAAxM,QAGA,kBAAAgM,KACAoD,EAAApD,EACAA,EAAA,MAGA,YAAA/M,KAAAqT,YAAA,WAAArT,KAAAqT,WAAA,CAIAtG,QACAA,EAAA0O,UAAA,IAAA1O,EAAA0O,QAEA,IAAAzN,IACA5J,OACAmJ,OACAR,UAEA/M,MAAA4J,KAAA,eAAAoE,GACAhO,KAAA0X,YAAA1O,KAAAgF,GACAmC,GAAAnQ,KAAAwJ,KAAA,QAAA2G,GACAnQ,KAAA2a,UASAnY,EAAAL,UAAAoT,MAAA,WAqBA,QAAAA,KACA1K,EAAAoP,QAAA,gBACAtY,EAAA,+CACAkJ,EAAA4O,UAAAlE,QAGA,QAAAmG,KACA7Q,EAAAnB,eAAA,UAAAgS,GACA7Q,EAAAnB,eAAA,eAAAgS,GACAnG,IAGA,QAAAoG,KAEA9Q,EAAArB,KAAA,UAAAkS,GACA7Q,EAAArB,KAAA,eAAAkS,GAnCA,eAAA1b,KAAAqT,YAAA,SAAArT,KAAAqT,WAAA,CACArT,KAAAqT,WAAA,SAEA,IAAAxI,GAAA7K,IAEAA,MAAA0X,YAAA9T,OACA5D,KAAAwJ,KAAA,mBACAxJ,KAAAya,UACAkB,IAEApG,MAGKvV,KAAAya,UACLkB,IAEApG,IAsBA,MAAAvV,OASAwC,EAAAL,UAAA6X,QAAA,SAAA7S,GACAxF,EAAA,kBAAAwF,GACA3E,EAAA6W,uBAAA,EACArZ,KAAA4J,KAAA,QAAAzC,GACAnH,KAAAia,QAAA,kBAAA9S,IASA3E,EAAAL,UAAA8X,QAAA,SAAA1D,EAAAqF,GACA,eAAA5b,KAAAqT,YAAA,SAAArT,KAAAqT,YAAA,YAAArT,KAAAqT,WAAA,CACA1R,EAAA,iCAAA4U,EACA,IAAA1L,GAAA7K,IAGAgI,cAAAhI,KAAAgZ,mBACAhR,aAAAhI,KAAAiZ,kBAGAjZ,KAAAyZ,UAAA9P,mBAAA,SAGA3J,KAAAyZ,UAAAlE,QAGAvV,KAAAyZ,UAAA9P,qBAGA3J,KAAAqT,WAAA,SAGArT,KAAAK,GAAA,KAGAL,KAAA4J,KAAA,QAAA2M,EAAAqF,GAIA/Q,EAAA6M,eACA7M,EAAA8M,cAAA,IAYAnV,EAAAL,UAAAiZ,eAAA,SAAAvC,GAEA,OADAgD,MACA/X,EAAA,EAAAiD,EAAA8R,EAAAjV,OAAsCE,EAAAiD,EAAOjD,KAC7C6B,EAAA3F,KAAAwX,WAAAqB,EAAA/U,KAAA+X,EAAA7S,KAAA6P,EAAA/U,GAEA,OAAA+X,MlB85E8Btb,KAAKX,EAAU,WAAa,MAAOI,WAI3D,SAAUH,EAAQD,EAASM,ImBxoGjC,SAAAuC,GAuBA,QAAAqZ,GAAAjb,GACA,GAAAkb,GACAC,GAAA,EACAC,GAAA,EACA9E,GAAA,IAAAtW,EAAAsW,KAEA,IAAA1U,EAAAE,SAAA,CACA,GAAAuZ,GAAA,WAAAvZ,SAAAL,SACAU,EAAAL,SAAAK,IAGAA,KACAA,EAAAkZ,EAAA,QAGAF,EAAAnb,EAAA+V,WAAAjU,SAAAiU,UAAA5T,IAAAnC,EAAAmC,KACAiZ,EAAApb,EAAAgW,SAAAqF,EAOA,GAJArb,EAAAsb,QAAAH,EACAnb,EAAAub,QAAAH,EACAF,EAAA,GAAAM,GAAAxb,GAEA,QAAAkb,KAAAlb,EAAAqW,WACA,UAAAoF,GAAAzb,EAEA,KAAAsW,EAAA,SAAA5P,OAAA,iBACA,WAAAgV,GAAA1b,GA9CA,GAAAwb,GAAAnc,EAAA,IACAoc,EAAApc,EAAA,IACAqc,EAAArc,EAAA,IACAsc,EAAAtc,EAAA,GAMAN,GAAAkc,UACAlc,EAAA4c,cnBkrG8Bjc,KAAKX,EAAU,WAAa,MAAOI,WAI3D,SAAUH,EAAQD,EAASM,IoBpsGjC,SAAAuC,GAEA,GAAAga,GAAAvc,EAAA,GAEAL,GAAAD,QAAA,SAAAiB,GACA,GAAAsb,GAAAtb,EAAAsb,QAIAC,EAAAvb,EAAAub,QAIA/E,EAAAxW,EAAAwW,UAGA,KACA,sBAAAgF,mBAAAF,GAAAM,GACA,UAAAJ,gBAEG,MAAA5Y,IAKH,IACA,sBAAAiZ,kBAAAN,GAAA/E,EACA,UAAAqF,gBAEG,MAAAjZ,IAEH,IAAA0Y,EACA;AACA,WAAA1Z,GAAA,UAAA4F,OAAA,UAAAsU,KAAA,4BACK,MAAAlZ,QpB0sGyBlD,KAAKX,EAAU,WAAa,MAAOI,WAI3D,SAAUH,EAAQD,GqBvuGxB,IACAC,EAAAD,QAAA,mBAAAyc,iBACA,uBAAAA,gBACC,MAAAlV,GAGDtH,EAAAD,SAAA,IrBwvGM,SAAUC,EAAQD,EAASM,IsBvwGjC,SAAAuC,GAqBA,QAAAma,MASA,QAAAN,GAAAzb,GAKA,GAJAgc,EAAAtc,KAAAP,KAAAa,GACAb,KAAA2Z,eAAA9Y,EAAA8Y,eACA3Z,KAAA0Y,aAAA7X,EAAA6X,aAEAjW,EAAAE,SAAA,CACA,GAAAuZ,GAAA,WAAAvZ,SAAAL,SACAU,EAAAL,SAAAK,IAGAA,KACAA,EAAAkZ,EAAA,QAGAlc,KAAAgc,GAAAnb,EAAA+V,WAAAnU,EAAAE,SAAAiU,UACA5T,IAAAnC,EAAAmC,KACAhD,KAAAic,GAAApb,EAAAgW,SAAAqF,GA6FA,QAAAY,GAAAjc,GACAb,KAAA+c,OAAAlc,EAAAkc,QAAA,MACA/c,KAAAY,IAAAC,EAAAD,IACAZ,KAAAgc,KAAAnb,EAAAmb,GACAhc,KAAAic,KAAApb,EAAAob,GACAjc,KAAAgd,OAAA,IAAAnc,EAAAmc,MACAhd,KAAAuN,KAAAxM,SAAAF,EAAA0M,KAAA1M,EAAA0M,KAAA,KACAvN,KAAA8W,MAAAjW,EAAAiW,MACA9W,KAAAid,SAAApc,EAAAoc,SACAjd,KAAAqa,eAAAxZ,EAAAwZ,eACAra,KAAAqX,WAAAxW,EAAAwW,WACArX,KAAA2Z,eAAA9Y,EAAA8Y,eAGA3Z,KAAAkY,IAAArX,EAAAqX,IACAlY,KAAAgQ,IAAAnP,EAAAmP,IACAhQ,KAAAmY,WAAAtX,EAAAsX,WACAnY,KAAAoY,KAAAvX,EAAAuX,KACApY,KAAAqY,GAAAxX,EAAAwX,GACArY,KAAAsY,QAAAzX,EAAAyX,QACAtY,KAAAuY,mBAAA1X,EAAA0X,mBAGAvY,KAAA0Y,aAAA7X,EAAA6X,aAEA1Y,KAAAkd,SAkPA,QAAAC,KACA,OAAArZ,KAAAgZ,GAAAM,SACAN,EAAAM,SAAA9L,eAAAxN,IACAgZ,EAAAM,SAAAtZ,GAAAuZ,QArZA,GAAAhB,GAAAnc,EAAA,IACA2c,EAAA3c,EAAA,IACA6O,EAAA7O,EAAA,GACAod,EAAApd,EAAA,IACAyB,EAAAzB,EAAA,kCAMAL,GAAAD,QAAA0c,EACAzc,EAAAD,QAAAkd,UAuCAQ,EAAAhB,EAAAO,GAMAP,EAAAna,UAAAkY,gBAAA,EASAiC,EAAAna,UAAAob,QAAA,SAAA1c,GAsBA,MArBAA,SACAA,EAAAD,IAAAZ,KAAAY,MACAC,EAAAmb,GAAAhc,KAAAgc,GACAnb,EAAAob,GAAAjc,KAAAic,GACApb,EAAAiW,MAAA9W,KAAA8W,QAAA,EACAjW,EAAAwZ,eAAAra,KAAAqa,eACAxZ,EAAAwW,WAAArX,KAAAqX,WAGAxW,EAAAqX,IAAAlY,KAAAkY,IACArX,EAAAmP,IAAAhQ,KAAAgQ,IACAnP,EAAAsX,WAAAnY,KAAAmY,WACAtX,EAAAuX,KAAApY,KAAAoY,KACAvX,EAAAwX,GAAArY,KAAAqY,GACAxX,EAAAyX,QAAAtY,KAAAsY,QACAzX,EAAA0X,mBAAAvY,KAAAuY,mBACA1X,EAAA8Y,eAAA3Z,KAAA2Z,eAGA9Y,EAAA6X,aAAA1Y,KAAA0Y,aAEA,GAAAoE,GAAAjc,IAWAyb,EAAAna,UAAAqb,QAAA,SAAAjQ,EAAA4C,GACA,GAAA8M,GAAA,gBAAA1P,IAAAxM,SAAAwM,EACAkQ,EAAAzd,KAAAud,SAA0BR,OAAA,OAAAxP,OAAA0P,aAC1BpS,EAAA7K,IACAyd,GAAAnU,GAAA,UAAA6G,GACAsN,EAAAnU,GAAA,iBAAAnC,GACA0D,EAAAmP,QAAA,iBAAA7S,KAEAnH,KAAA0d,QAAAD,GASAnB,EAAAna,UAAAwb,OAAA,WACAhc,EAAA,WACA,IAAA8b,GAAAzd,KAAAud,UACA1S,EAAA7K,IACAyd,GAAAnU,GAAA,gBAAAiE,GACA1C,EAAA+S,OAAArQ,KAEAkQ,EAAAnU,GAAA,iBAAAnC,GACA0D,EAAAmP,QAAA,iBAAA7S,KAEAnH,KAAA6d,QAAAJ,GA0CA1O,EAAA+N,EAAA3a,WAQA2a,EAAA3a,UAAA+a,OAAA,WACA,GAAArc,IAAciW,MAAA9W,KAAA8W,MAAAqF,QAAAnc,KAAAgc,GAAAI,QAAApc,KAAAic,GAAA5E,WAAArX,KAAAqX,WAGdxW,GAAAqX,IAAAlY,KAAAkY,IACArX,EAAAmP,IAAAhQ,KAAAgQ,IACAnP,EAAAsX,WAAAnY,KAAAmY,WACAtX,EAAAuX,KAAApY,KAAAoY,KACAvX,EAAAwX,GAAArY,KAAAqY,GACAxX,EAAAyX,QAAAtY,KAAAsY,QACAzX,EAAA0X,mBAAAvY,KAAAuY,kBAEA,IAAAwD,GAAA/b,KAAA+b,IAAA,GAAAM,GAAAxb,GACAgK,EAAA7K,IAEA,KACA2B,EAAA,kBAAA3B,KAAA+c,OAAA/c,KAAAY,KACAmb,EAAAlI,KAAA7T,KAAA+c,OAAA/c,KAAAY,IAAAZ,KAAAgd,MACA,KACA,GAAAhd,KAAA0Y,aAAA,CACAqD,EAAA+B,uBAAA/B,EAAA+B,uBAAA,EACA,QAAAha,KAAA9D,MAAA0Y,aACA1Y,KAAA0Y,aAAApH,eAAAxN,IACAiY,EAAAgC,iBAAAja,EAAA9D,KAAA0Y,aAAA5U,KAIK,MAAAL,IAEL,YAAAzD,KAAA+c,OACA,IACA/c,KAAAid,SACAlB,EAAAgC,iBAAA,2CAEAhC,EAAAgC,iBAAA,2CAEO,MAAAta,IAGP,IACAsY,EAAAgC,iBAAA,gBACK,MAAAta,IAGL,mBAAAsY,KACAA,EAAAiC,iBAAA,GAGAhe,KAAA2Z,iBACAoC,EAAAvT,QAAAxI,KAAA2Z,gBAGA3Z,KAAAie,UACAlC,EAAAzJ,OAAA,WACAzH,EAAAqT,UAEAnC,EAAAnG,QAAA,WACA/K,EAAAmP,QAAA+B,EAAAoC,gBAGApC,EAAAqC,mBAAA,WACA,OAAArC,EAAA1I,WAAA,CACA,GAAAgL,EACA,KACAA,EAAAtC,EAAAuC,kBAAA,gBACW,MAAA7a,IACX,6BAAA4a,IACAtC,EAAAwC,aAAA,eAGA,IAAAxC,EAAA1I,aACA,MAAA0I,EAAAyC,QAAA,OAAAzC,EAAAyC,OACA3T,EAAAqT,SAIAtW,WAAA,WACAiD,EAAAmP,QAAA+B,EAAAyC,SACW,KAKX7c,EAAA,cAAA3B,KAAAuN,MACAwO,EAAAxB,KAAAva,KAAAuN,MACG,MAAA9J,GAOH,WAHAmE,YAAA,WACAiD,EAAAmP,QAAAvW,IACK,GAILhB,EAAA4B,WACArE,KAAA2F,MAAAmX,EAAA2B,gBACA3B,EAAAM,SAAApd,KAAA2F,OAAA3F,OAUA8c,EAAA3a,UAAAuc,UAAA,WACA1e,KAAA4J,KAAA,WACA5J,KAAAqV,WASAyH,EAAA3a,UAAAyb,OAAA,SAAArQ,GACAvN,KAAA4J,KAAA,OAAA2D,GACAvN,KAAA0e,aASA5B,EAAA3a,UAAA6X,QAAA,SAAA7S,GACAnH,KAAA4J,KAAA,QAAAzC,GACAnH,KAAAqV,SAAA,IASAyH,EAAA3a,UAAAkT,QAAA,SAAAsJ,GACA,sBAAA3e,MAAA+b,KAAA,OAAA/b,KAAA+b,IAAA,CAUA,GANA/b,KAAAie,SACAje,KAAA+b,IAAAzJ,OAAAtS,KAAA+b,IAAAnG,QAAAgH,EAEA5c,KAAA+b,IAAAqC,mBAAAxB,EAGA+B,EACA,IACA3e,KAAA+b,IAAAsB,QACK,MAAA5Z,IAGLhB,EAAA4B,gBACAyY,GAAAM,SAAApd,KAAA2F,OAGA3F,KAAA+b,IAAA,OASAe,EAAA3a,UAAA+b,OAAA,WACA,GAAA3Q,EACA,KACA,GAAA8Q,EACA,KACAA,EAAAre,KAAA+b,IAAAuC,kBAAA,gBACK,MAAA7a,IAEL8J,EADA,6BAAA8Q,EACAre,KAAA+b,IAAA6C,UAAA5e,KAAA+b,IAAAoC,aAEAne,KAAA+b,IAAAoC,aAEG,MAAA1a,GACHzD,KAAAga,QAAAvW,GAEA,MAAA8J,GACAvN,KAAA4d,OAAArQ,IAUAuP,EAAA3a,UAAA8b,OAAA,WACA,yBAAAxb,GAAAia,iBAAA1c,KAAAic,IAAAjc,KAAAqX,YASAyF,EAAA3a,UAAAkb,MAAA,WACArd,KAAAqV,WASAyH,EAAA2B,cAAA,EACA3B,EAAAM,YAEA3a,EAAA4B,WACA5B,EAAAoc,YACApc,EAAAoc,YAAA,WAAA1B,GACG1a,EAAAwN,kBACHxN,EAAAwN,iBAAA,eAAAkN,GAAA,MtBqxG8B5c,KAAKX,EAAU,WAAa,MAAOI,WAI3D,SAAUH,EAAQD,EAASM,GuBzoHjC,QAAA2c,GAAAhc,GACA,GAAAuW,GAAAvW,KAAAuW,WACA0H,KAAA1H,IACApX,KAAAqa,gBAAA,GAEAf,EAAA/Y,KAAAP,KAAAa,GAnCA,GAAAyY,GAAApZ,EAAA,IACA6W,EAAA7W,EAAA,IACAkC,EAAAlC,EAAA,IACAod,EAAApd,EAAA,IACA6e,EAAA7e,EAAA,IACAyB,EAAAzB,EAAA,8BAMAL,GAAAD,QAAAid,CAMA,IAAAiC,GAAA,WACA,GAAAzC,GAAAnc,EAAA,IACA6b,EAAA,GAAAM,IAAgCF,SAAA,GAChC,cAAAJ,EAAAwC,eAsBAjB,GAAAT,EAAAvD,GAMAuD,EAAA1a,UAAA6H,KAAA,UASA6S,EAAA1a,UAAA6c,OAAA,WACAhf,KAAAif,QAUApC,EAAA1a,UAAAuY,MAAA,SAAAwE,GAKA,QAAAxE,KACA/Y,EAAA,UACAkJ,EAAAwI,WAAA,SACA6L,IAPA,GAAArU,GAAA7K,IAUA,IARAA,KAAAqT,WAAA,UAQArT,KAAA8b,UAAA9b,KAAAwb,SAAA,CACA,GAAA2D,GAAA,CAEAnf,MAAA8b,UACAna,EAAA,+CACAwd,IACAnf,KAAAwJ,KAAA,0BACA7H,EAAA,gCACAwd,GAAAzE,OAIA1a,KAAAwb,WACA7Z,EAAA,+CACAwd,IACAnf,KAAAwJ,KAAA,mBACA7H,EAAA,gCACAwd,GAAAzE,WAIAA,MAUAmC,EAAA1a,UAAA8c,KAAA,WACAtd,EAAA,WACA3B,KAAA8b,SAAA,EACA9b,KAAA2d,SACA3d,KAAA4J,KAAA,SASAiT,EAAA1a,UAAAyb,OAAA,SAAArQ,GACA,GAAA1C,GAAA7K,IACA2B,GAAA,sBAAA4L,EACA,IAAAE,GAAA,SAAAO,EAAArI,EAAAwZ,GAOA,MALA,YAAAtU,EAAAwI,YACAxI,EAAAmQ,SAIA,UAAAhN,EAAA5J,MACAyG,EAAAoP,WACA,OAIApP,GAAAkP,SAAA/L,GAIA5L,GAAAgd,cAAA7R,EAAAvN,KAAA8B,OAAAgW,WAAArK,GAGA,WAAAzN,KAAAqT,aAEArT,KAAA8b,SAAA,EACA9b,KAAA4J,KAAA,gBAEA,SAAA5J,KAAAqT,WACArT,KAAAif,OAEAtd,EAAA,uCAAA3B,KAAAqT,cAWAwJ,EAAA1a,UAAAkd,QAAA,WAGA,QAAA9J,KACA5T,EAAA,wBACAkJ,EAAAkL,QAAiB3R,KAAA,WAJjB,GAAAyG,GAAA7K,IAOA,UAAAA,KAAAqT,YACA1R,EAAA,4BACA4T,MAIA5T,EAAA,wCACA3B,KAAAwJ,KAAA,OAAA+L,KAYAsH,EAAA1a,UAAA4T,MAAA,SAAAuJ,GACA,GAAAzU,GAAA7K,IACAA,MAAAwb,UAAA,CACA,IAAA+D,GAAA,WACA1U,EAAA2Q,UAAA,EACA3Q,EAAAjB,KAAA,SAGAxH,GAAAod,cAAAF,EAAAtf,KAAAqa,eAAA,SAAA9M,GACA1C,EAAA2S,QAAAjQ,EAAAgS,MAUA1C,EAAA1a,UAAAvB,IAAA,WACA,GAAAiB,GAAA7B,KAAA6B,UACA4d,EAAAzf,KAAA6W,OAAA,eACA7T,EAAA,IAGA,IAAAhD,KAAAuX,oBACA1V,EAAA7B,KAAAsX,gBAAAyH,KAGA/e,KAAAqa,gBAAAxY,EAAA6X,MACA7X,EAAA6d,IAAA,GAGA7d,EAAAkV,EAAAzH,OAAAzN,GAGA7B,KAAAgD,OAAA,UAAAyc,GAAA,MAAAnR,OAAAtO,KAAAgD,OACA,SAAAyc,GAAA,KAAAnR,OAAAtO,KAAAgD,SACAA,EAAA,IAAAhD,KAAAgD,MAIAnB,EAAA+B,SACA/B,EAAA,IAAAA,EAGA,IAAAoB,GAAAjD,KAAA4W,SAAA1T,QAAA,SACA,OAAAuc,GAAA,OAAAxc,EAAA,IAAAjD,KAAA4W,SAAA,IAAA5W,KAAA4W,UAAA5T,EAAAhD,KAAAoB,KAAAS,IvBmrHM,SAAUhC,EAAQD,EAASM,GwBl5HjC,QAAAoZ,GAAAzY,GACAb,KAAAoB,KAAAP,EAAAO,KACApB,KAAA4W,SAAA/V,EAAA+V,SACA5W,KAAAgD,KAAAnC,EAAAmC,KACAhD,KAAA6W,OAAAhW,EAAAgW,OACA7W,KAAA6B,MAAAhB,EAAAgB,MACA7B,KAAAsX,eAAAzW,EAAAyW,eACAtX,KAAAuX,kBAAA1W,EAAA0W,kBACAvX,KAAAqT,WAAA,GACArT,KAAA8W,MAAAjW,EAAAiW,QAAA,EACA9W,KAAA8B,OAAAjB,EAAAiB,OACA9B,KAAAqX,WAAAxW,EAAAwW,WAGArX,KAAAkY,IAAArX,EAAAqX,IACAlY,KAAAgQ,IAAAnP,EAAAmP,IACAhQ,KAAAmY,WAAAtX,EAAAsX,WACAnY,KAAAoY,KAAAvX,EAAAuX,KACApY,KAAAqY,GAAAxX,EAAAwX,GACArY,KAAAsY,QAAAzX,EAAAyX,QACAtY,KAAAuY,mBAAA1X,EAAA0X,mBACAvY,KAAAwY,UAAA3X,EAAA2X,UAGAxY,KAAA0Y,aAAA7X,EAAA6X,aACA1Y,KAAA4Y,aAAA/X,EAAA+X,aAzCA,GAAAxW,GAAAlC,EAAA,IACA6O,EAAA7O,EAAA,EAMAL,GAAAD,QAAA0Z,EAyCAvK,EAAAuK,EAAAnX,WAUAmX,EAAAnX,UAAA6X,QAAA,SAAAQ,EAAAoB,GACA,GAAAzU,GAAA,GAAAI,OAAAiT,EAIA,OAHArT,GAAA/C,KAAA,iBACA+C,EAAAwY,YAAA/D,EACA5b,KAAA4J,KAAA,QAAAzC,GACAnH,MASAsZ,EAAAnX,UAAA0R,KAAA,WAMA,MALA,WAAA7T,KAAAqT,YAAA,KAAArT,KAAAqT,aACArT,KAAAqT,WAAA,UACArT,KAAAgf,UAGAhf,MASAsZ,EAAAnX,UAAAoT,MAAA,WAMA,MALA,YAAAvV,KAAAqT,YAAA,SAAArT,KAAAqT,aACArT,KAAAqf,UACArf,KAAAia,WAGAja,MAUAsZ,EAAAnX,UAAAoY,KAAA,SAAA+E,GACA,YAAAtf,KAAAqT,WAGA,SAAA9L,OAAA,qBAFAvH,MAAA+V,MAAAuJ,IAYAhG,EAAAnX,UAAA6Y,OAAA,WACAhb,KAAAqT,WAAA,OACArT,KAAAwb,UAAA,EACAxb,KAAA4J,KAAA,SAUA0P,EAAAnX,UAAAyb,OAAA,SAAArQ,GACA,GAAAS,GAAA5L,EAAAwd,aAAArS,EAAAvN,KAAA8B,OAAAgW,WACA9X,MAAA+Z,SAAA/L,IAOAsL,EAAAnX,UAAA4X,SAAA,SAAA/L,GACAhO,KAAA4J,KAAA,SAAAoE,IASAsL,EAAAnX,UAAA8X,QAAA,WACAja,KAAAqT,WAAA,SACArT,KAAA4J,KAAA,WxB86HM,SAAU/J,EAAQD,EAASM,IyBzkIjC,SAAAuC,GA8HA,QAAAod,GAAA7R,EAAAP,GAEA,GAAArG,GAAA,IAAAxH,EAAA0f,QAAAtR,EAAA5J,MAAA4J,EAAAT,SACA,OAAAE,GAAArG,GAOA,QAAA0Y,GAAA9R,EAAAqM,EAAA5M,GACA,IAAA4M,EACA,MAAAza,GAAAmgB,mBAAA/R,EAAAP,EAGA,IAAAF,GAAAS,EAAAT,KACAyS,EAAA,GAAAC,YAAA1S,GACA2S,EAAA,GAAAD,YAAA,EAAA1S,EAAA4S,WAEAD,GAAA,GAAAZ,EAAAtR,EAAA5J,KACA,QAAAN,GAAA,EAAiBA,EAAAkc,EAAApc,OAAyBE,IAC1Coc,EAAApc,EAAA,GAAAkc,EAAAlc,EAGA,OAAA2J,GAAAyS,EAAAE,QAGA,QAAAC,GAAArS,EAAAqM,EAAA5M,GACA,IAAA4M,EACA,MAAAza,GAAAmgB,mBAAA/R,EAAAP,EAGA,IAAA6S,GAAA,GAAAjO,WAKA,OAJAiO,GAAAhO,OAAA,WACAtE,EAAAT,KAAA+S,EAAA/N,OACA3S,EAAA2gB,aAAAvS,EAAAqM,GAAA,EAAA5M,IAEA6S,EAAA9N,kBAAAxE,EAAAT,MAGA,QAAAiT,GAAAxS,EAAAqM,EAAA5M,GACA,IAAA4M,EACA,MAAAza,GAAAmgB,mBAAA/R,EAAAP,EAGA,IAAAgT,EACA,MAAAJ,GAAArS,EAAAqM,EAAA5M,EAGA,IAAA7J,GAAA,GAAAqc,YAAA,EACArc,GAAA,GAAA0b,EAAAtR,EAAA5J,KACA,IAAAsc,GAAA,GAAAzP,IAAArN,EAAAwc,OAAApS,EAAAT,MAEA,OAAAE,GAAAiT,GAkFA,QAAAC,GAAApT,GACA,IACAA,EAAAqT,EAAA5J,OAAAzJ,GAA8BsT,QAAA,IAC3B,MAAApd,GACH,SAEA,MAAA8J,GAgFA,QAAAuT,GAAAC,EAAAC,EAAAC,GAWA,OAVA1O,GAAA,GAAAxJ,OAAAgY,EAAAnd,QACA8K,EAAAwS,EAAAH,EAAAnd,OAAAqd,GAEAE,EAAA,SAAArd,EAAAsd,EAAA7Q,GACAyQ,EAAAI,EAAA,SAAA5S,EAAAgM,GACAjI,EAAAzO,GAAA0W,EACAjK,EAAA/B,EAAA+D,MAIAzO,EAAA,EAAiBA,EAAAid,EAAAnd,OAAgBE,IACjCqd,EAAArd,EAAAid,EAAAjd,GAAA4K,GAnWA,GAMA2S,GANA1I,EAAAzY,EAAA,IACAwQ,EAAAxQ,EAAA,GACAohB,EAAAphB,EAAA,IACAghB,EAAAhhB,EAAA,IACA0gB,EAAA1gB,EAAA,GAGAuC,MAAAsO,cACAsQ,EAAAnhB,EAAA,IAUA,IAAAqhB,GAAA,mBAAA1c,YAAA,WAAA/B,KAAA+B,UAAAC,WAQA0c,EAAA,mBAAA3c,YAAA,aAAA/B,KAAA+B,UAAAC,WAMA2b,EAAAc,GAAAC,CAMA5hB,GAAA0C,SAAA,CAMA,IAAAgd,GAAA1f,EAAA0f,SACAzL,KAAA,EACA0B,MAAA,EACA+F,KAAA,EACAmG,KAAA,EACAra,QAAA,EACA6P,QAAA,EACApO,KAAA,GAGA6Y,EAAA/I,EAAA2G,GAMAnY,GAAW/C,KAAA,QAAAmJ,KAAA,gBAMX0D,EAAA/Q,EAAA,GAkBAN,GAAA2gB,aAAA,SAAAvS,EAAAqM,EAAAsH,EAAAlU,GACA,kBAAA4M,KACA5M,EAAA4M,EACAA,GAAA,GAGA,kBAAAsH,KACAlU,EAAAkU,EACAA,EAAA,KAGA,IAAApU,GAAAxM,SAAAiN,EAAAT,KACAxM,OACAiN,EAAAT,KAAA6S,QAAApS,EAAAT,IAEA,IAAA9K,EAAAsO,aAAAxD,YAAAwD,aACA,MAAA+O,GAAA9R,EAAAqM,EAAA5M,EACG,IAAAwD,GAAA1D,YAAA9K,GAAAwO,KACH,MAAAuP,GAAAxS,EAAAqM,EAAA5M,EAIA,IAAAF,KAAAkC,OACA,MAAAoQ,GAAA7R,EAAAP,EAIA,IAAAmU,GAAAtC,EAAAtR,EAAA5J,KAOA,OAJArD,UAAAiN,EAAAT,OACAqU,GAAAD,EAAAf,EAAAtR,OAAApD,OAAA8B,EAAAT,OAA8DsT,QAAA,IAAgB3U,OAAA8B,EAAAT,OAG9EE,EAAA,GAAAmU,IAmEAhiB,EAAAmgB,mBAAA,SAAA/R,EAAAP,GACA,GAAArG,GAAA,IAAAxH,EAAA0f,QAAAtR,EAAA5J,KACA,IAAA6M,GAAAjD,EAAAT,eAAA9K,GAAAwO,KAAA,CACA,GAAAqP,GAAA,GAAAjO,WAKA,OAJAiO,GAAAhO,OAAA,WACA,GAAAoN,GAAAY,EAAA/N,OAAA1G,MAAA,OACA4B,GAAArG,EAAAsY,IAEAY,EAAAuB,cAAA7T,EAAAT,MAGA,GAAAuU,EACA,KACAA,EAAA5V,OAAA6V,aAAAhc,MAAA,QAAAka,YAAAjS,EAAAT,OACG,MAAA9J,GAIH,OAFAue,GAAA,GAAA/B,YAAAjS,EAAAT,MACA0U,EAAA,GAAAlZ,OAAAiZ,EAAApe,QACAE,EAAA,EAAmBA,EAAAke,EAAApe,OAAkBE,IACrCme,EAAAne,GAAAke,EAAAle,EAEAge,GAAA5V,OAAA6V,aAAAhc,MAAA,KAAAkc,GAGA,MADA7a,IAAA3E,EAAAyf,KAAAJ,GACArU,EAAArG,IAUAxH,EAAAggB,aAAA,SAAArS,EAAAuK,EAAAqK,GACA,GAAAphB,SAAAwM,EACA,MAAApG,EAGA,oBAAAoG,GAAA,CACA,SAAAA,EAAA1K,OAAA,GACA,MAAAjD,GAAAwiB,mBAAA7U,EAAAzB,OAAA,GAAAgM,EAGA,IAAAqK,IACA5U,EAAAoT,EAAApT,GACAA,KAAA,GACA,MAAApG,EAGA,IAAA/C,GAAAmJ,EAAA1K,OAAA,EAEA,OAAAyL,QAAAlK,OAAAsd,EAAAtd,GAIAmJ,EAAA3J,OAAA,GACcQ,KAAAsd,EAAAtd,GAAAmJ,OAAA7J,UAAA,KAEAU,KAAAsd,EAAAtd,IANd+C,EAUA,GAAAkb,GAAA,GAAApC,YAAA1S,GACAnJ,EAAAie,EAAA,GACAC,EAAAhB,EAAA/T,EAAA,EAIA,OAHA0D,IAAA,SAAA6G,IACAwK,EAAA,GAAArR,IAAAqR,MAEUle,KAAAsd,EAAAtd,GAAAmJ,KAAA+U,IAmBV1iB,EAAAwiB,mBAAA,SAAA5H,EAAA1C,GACA,GAAA1T,GAAAsd,EAAAlH,EAAA3X,OAAA,GACA,KAAAwe,EACA,OAAYjd,OAAAmJ,MAAoBkC,QAAA,EAAAlC,KAAAiN,EAAA1O,OAAA,IAGhC,IAAAyB,GAAA8T,EAAArK,OAAAwD,EAAA1O,OAAA,GAMA,OAJA,SAAAgM,GAAA7G,IACA1D,EAAA,GAAA0D,IAAA1D,MAGUnJ,OAAAmJ,SAmBV3N,EAAA4f,cAAA,SAAAF,EAAAjF,EAAA5M,GAoBA,QAAA8U,GAAAnb,GACA,MAAAA,GAAAxD,OAAA,IAAAwD,EAGA,QAAAob,GAAAxU,EAAAyU,GACA7iB,EAAA2gB,aAAAvS,IAAAiP,GAAA5C,GAAA,WAAAjT,GACAqb,EAAA,KAAAF,EAAAnb,MAzBA,kBAAAiT,KACA5M,EAAA4M,EACAA,EAAA,KAGA,IAAA4C,GAAAvM,EAAA4O,EAEA,OAAAjF,IAAA4C,EACAhM,IAAAwP,EACA7gB,EAAA8iB,oBAAApD,EAAA7R,GAGA7N,EAAA+iB,2BAAArD,EAAA7R,GAGA6R,EAAA1b,WAcAkd,GAAAxB,EAAAkD,EAAA,SAAArb,EAAAyb,GACA,MAAAnV,GAAAmV,EAAAjG,KAAA,OAdAlP,EAAA,OA8CA7N,EAAAwf,cAAA,SAAA7R,EAAAuK,EAAArK,GACA,mBAAAF,GACA,MAAA3N,GAAAijB,sBAAAtV,EAAAuK,EAAArK,EAGA,mBAAAqK,KACArK,EAAAqK,EACAA,EAAA,KAGA,IAAA9J,EACA,SAAAT,EAEA,MAAAE,GAAAtG,EAAA,IAKA,QAFAgF,GAAAqO,EAAA5W,EAAA,GAEAE,EAAA,EAAA8M,EAAArD,EAAA3J,OAAkCE,EAAA8M,EAAO9M,IAAA,CACzC,GAAAgf,GAAAvV,EAAA1K,OAAAiB,EAEA,UAAAgf,EAAA,CAKA,QAAAlf,OAAAuI,EAAAmC,OAAA1K,IAEA,MAAA6J,GAAAtG,EAAA,IAKA,IAFAqT,EAAAjN,EAAAzB,OAAAhI,EAAA,EAAAqI,GAEAvI,GAAA4W,EAAA5W,OAEA,MAAA6J,GAAAtG,EAAA,IAGA,IAAAqT,EAAA5W,OAAA,CAGA,GAFAoK,EAAApO,EAAAggB,aAAApF,EAAA1C,GAAA,GAEA3Q,EAAA/C,OAAA4J,EAAA5J,MAAA+C,EAAAoG,OAAAS,EAAAT,KAEA,MAAAE,GAAAtG,EAAA,IAGA,IAAA4b,GAAAtV,EAAAO,EAAAlK,EAAAqI,EAAAyE,EACA,SAAAmS,EAAA,OAIAjf,GAAAqI,EACAvI,EAAA,OA9BAA,IAAAkf,EAiCA,WAAAlf,EAEA6J,EAAAtG,EAAA,KAFA,QAqBAvH,EAAA+iB,2BAAA,SAAArD,EAAA7R,GAKA,QAAA+U,GAAAxU,EAAAyU,GACA7iB,EAAA2gB,aAAAvS,GAAA,cAAAT,GACA,MAAAkV,GAAA,KAAAlV,KANA,MAAA+R,GAAA1b,WAUAkd,GAAAxB,EAAAkD,EAAA,SAAArb,EAAA2O,GACA,GAAAkN,GAAAlN,EAAAmN,OAAA,SAAAC,EAAAxiB,GACA,GAAA+H,EAMA,OAJAA,GADA,gBAAA/H,GACAA,EAAAkD,OAEAlD,EAAAyf,WAEA+C,EAAAza,EAAA8I,WAAA3N,OAAA6E,EAAA,GACK,GAEL0a,EAAA,GAAAlD,YAAA+C,GAEAI,EAAA,CA8BA,OA7BAtN,GAAAuN,QAAA,SAAA3iB,GACA,GAAA4iB,GAAA,gBAAA5iB,GACA6iB,EAAA7iB,CACA,IAAA4iB,EAAA,CAEA,OADAE,GAAA,GAAAvD,YAAAvf,EAAAkD,QACAE,EAAA,EAAuBA,EAAApD,EAAAkD,OAAcE,IACrC0f,EAAA1f,GAAApD,EAAA8J,WAAA1G,EAEAyf,GAAAC,EAAApD,OAGAkD,EACAH,EAAAC,KAAA,EAEAD,EAAAC,KAAA,CAIA,QADAK,GAAAF,EAAApD,WAAA5O,WACAzN,EAAA,EAAqBA,EAAA2f,EAAA7f,OAAmBE,IACxCqf,EAAAC,KAAAne,SAAAwe,EAAA3f,GAEAqf,GAAAC,KAAA,GAGA,QADAI,GAAA,GAAAvD,YAAAsD,GACAzf,EAAA,EAAqBA,EAAA0f,EAAA5f,OAAiBE,IACtCqf,EAAAC,KAAAI,EAAA1f,KAIA2J,EAAA0V,EAAA/C,UApDA3S,EAAA,GAAAsD,aAAA,KA4DAnR,EAAA8iB,oBAAA,SAAApD,EAAA7R,GACA,QAAA+U,GAAAxU,EAAAyU,GACA7iB,EAAA2gB,aAAAvS,GAAA,cAAA4T,GACA,GAAA8B,GAAA,GAAAzD,YAAA,EAEA,IADAyD,EAAA,KACA,gBAAA9B,GAAA,CAEA,OADA4B,GAAA,GAAAvD,YAAA2B,EAAAhe,QACAE,EAAA,EAAuBA,EAAA8d,EAAAhe,OAAoBE,IAC3C0f,EAAA1f,GAAA8d,EAAApX,WAAA1G,EAEA8d,GAAA4B,EAAApD,OACAsD,EAAA,KASA,OANAjb,GAAAmZ,YAAA7Q,aACA6Q,EAAAzB,WACAyB,EAAA+B,KAEAF,EAAAhb,EAAA8I,WACAqS,EAAA,GAAA3D,YAAAwD,EAAA7f,OAAA,GACAE,EAAA,EAAqBA,EAAA2f,EAAA7f,OAAmBE,IACxC8f,EAAA9f,GAAAmB,SAAAwe,EAAA3f,GAIA,IAFA8f,EAAAH,EAAA7f,QAAA,IAEAqN,EAAA,CACA,GAAAyP,GAAA,GAAAzP,IAAAyS,EAAAtD,OAAAwD,EAAAxD,OAAAwB,GACAa,GAAA,KAAA/B,MAKAI,EAAAxB,EAAAkD,EAAA,SAAArb,EAAAyb,GACA,MAAAnV,GAAA,GAAAwD,GAAA2R,OAaAhjB,EAAAijB,sBAAA,SAAAtV,EAAAuK,EAAArK,GACA,kBAAAqK,KACArK,EAAAqK,EACAA,EAAA,KAMA,KAHA,GAAA+L,GAAAtW,EACAU,KAEA4V,EAAA1D,WAAA,IAKA,OAJA2D,GAAA,GAAA7D,YAAA4D,GACAP,EAAA,IAAAQ,EAAA,GACAC,EAAA,GAEAjgB,EAAA,EACA,MAAAggB,EAAAhgB,GADqBA,IAAA,CAIrB,GAAAigB,EAAAngB,OAAA,IACA,MAAA6J,GAAAtG,EAAA,IAGA4c,IAAAD,EAAAhgB,GAGA+f,EAAAvC,EAAAuC,EAAA,EAAAE,EAAAngB,QACAmgB,EAAA9e,SAAA8e,EAEA,IAAAvJ,GAAA8G,EAAAuC,EAAA,EAAAE,EACA,IAAAT,EACA,IACA9I,EAAAtO,OAAA6V,aAAAhc,MAAA,QAAAka,YAAAzF,IACO,MAAA/W,GAEP,GAAAue,GAAA,GAAA/B,YAAAzF,EACAA,GAAA,EACA,QAAA1W,GAAA,EAAuBA,EAAAke,EAAApe,OAAkBE,IACzC0W,GAAAtO,OAAA6V,aAAAC,EAAAle,IAKAmK,EAAAjF,KAAAwR,GACAqJ,EAAAvC,EAAAuC,EAAAE,GAGA,GAAA5E,GAAAlR,EAAArK,MACAqK,GAAAoV,QAAA,SAAAjD,EAAAtc,GACA2J,EAAA7N,EAAAggB,aAAAQ,EAAAtI,GAAA,GAAAhU,EAAAqb,QzB+kI8B5e,KAAKX,EAAU,WAAa,MAAOI,WAI3D,SAAUH,EAAQD,G0BtqJxBC,EAAAD,QAAAyR,OAAAsH,MAAA,SAAA1W,GACA,GAAAuP,MACAuC,EAAA1C,OAAAlP,UAAAmP,cAEA,QAAAxN,KAAA7B,GACA8R,EAAAxT,KAAA0B,EAAA6B,IACA0N,EAAAxI,KAAAlF,EAGA,OAAA0N,K1BsrJM,SAAU3R,EAAQD,G2BhsJxBC,EAAAD,QAAA,SAAAokB,EAAAC,EAAAC,GACA,GAAAC,GAAAH,EAAA7D,UAIA,IAHA8D,KAAA,EACAC,KAAAC,EAEAH,EAAAxT,MAA0B,MAAAwT,GAAAxT,MAAAyT,EAAAC,EAM1B,IAJAD,EAAA,IAAkBA,GAAAE,GAClBD,EAAA,IAAgBA,GAAAC,GAChBD,EAAAC,IAAoBD,EAAAC,GAEpBF,GAAAE,GAAAF,GAAAC,GAAA,IAAAC,EACA,UAAApT,aAAA,EAKA,QAFAqT,GAAA,GAAAnE,YAAA+D,GACAzR,EAAA,GAAA0N,YAAAiE,EAAAD,GACAngB,EAAAmgB,EAAAI,EAAA,EAA6BvgB,EAAAogB,EAASpgB,IAAAugB,IACtC9R,EAAA8R,GAAAD,EAAAtgB,EAEA,OAAAyO,GAAA6N,S3B+sJM,SAAUvgB,EAAQD,G4BxuJxB,QAAAshB,GAAAoD,EAAA7W,EAAA8W,GAOA,QAAAC,GAAArd,EAAAoL,GACA,GAAAiS,EAAAF,OAAA,EACA,SAAA/c,OAAA,iCAEAid,EAAAF,MAGAnd,GACAsd,GAAA,EACAhX,EAAAtG,GAEAsG,EAAA8W,GACS,IAAAC,EAAAF,OAAAG,GACThX,EAAA,KAAA8E,GAnBA,GAAAkS,IAAA,CAIA,OAHAF,MAAA1b,EACA2b,EAAAF,QAEA,IAAAA,EAAA7W,IAAA+W,EAoBA,QAAA3b,MA3BAhJ,EAAAD,QAAAshB,G5B4wJM,SAAUrhB,EAAQD,EAASM,GAEhC,GAAIwkB,I6B9wJL,SAAA7kB,EAAA4C,IACC,SAAA/C,GAqBD,QAAAilB,GAAAC,GAMA,IALA,GAGAC,GACAC,EAJAC,KACAC,EAAA,EACAphB,EAAAghB,EAAAhhB,OAGAohB,EAAAphB,GACAihB,EAAAD,EAAApa,WAAAwa,KACAH,GAAA,OAAAA,GAAA,OAAAG,EAAAphB,GAEAkhB,EAAAF,EAAApa,WAAAwa,KACA,cAAAF,GACAC,EAAA/b,OAAA,KAAA6b,IAAA,UAAAC,GAAA,QAIAC,EAAA/b,KAAA6b,GACAG,MAGAD,EAAA/b,KAAA6b,EAGA,OAAAE,GAIA,QAAAE,GAAArc,GAKA,IAJA,GAEAic,GAFAjhB,EAAAgF,EAAAhF,OACA+B,GAAA,EAEAof,EAAA,KACApf,EAAA/B,GACAihB,EAAAjc,EAAAjD,GACAkf,EAAA,QACAA,GAAA,MACAE,GAAAG,EAAAL,IAAA,eACAA,EAAA,WAAAA,GAEAE,GAAAG,EAAAL,EAEA,OAAAE,GAGA,QAAAI,GAAAC,EAAAvE,GACA,GAAAuE,GAAA,OAAAA,GAAA,OACA,GAAAvE,EACA,KAAAtZ,OACA,oBAAA6d,EAAA7T,SAAA,IAAA8T,cACA,yBAGA,UAEA,SAIA,QAAAC,GAAAF,EAAAnP,GACA,MAAAiP,GAAAE,GAAAnP,EAAA,QAGA,QAAAsP,GAAAH,EAAAvE,GACA,kBAAAuE,GACA,MAAAF,GAAAE,EAEA,IAAAI,GAAA,EAiBA,OAhBA,gBAAAJ,GACAI,EAAAN,EAAAE,GAAA,UAEA,eAAAA,IACAD,EAAAC,EAAAvE,KACAuE,EAAA,OAEAI,EAAAN,EAAAE,GAAA,WACAI,GAAAF,EAAAF,EAAA,IAEA,eAAAA,KACAI,EAAAN,EAAAE,GAAA,UACAI,GAAAF,EAAAF,EAAA,IACAI,GAAAF,EAAAF,EAAA,IAEAI,GAAAN,EAAA,GAAAE,EAAA,KAIA,QAAAzD,GAAAiD,EAAA/jB,GACAA,OAQA,KAPA,GAKAukB,GALAvE,GAAA,IAAAhgB,EAAAggB,OAEA4E,EAAAd,EAAAC,GACAhhB,EAAA6hB,EAAA7hB,OACA+B,GAAA,EAEA+f,EAAA,KACA/f,EAAA/B,GACAwhB,EAAAK,EAAA9f,GACA+f,GAAAH,EAAAH,EAAAvE,EAEA,OAAA6E,GAKA,QAAAC,KACA,GAAAC,GAAAC,EACA,KAAAte,OAAA,qBAGA,IAAAue,GAAA,IAAAC,EAAAH,EAGA,IAFAA,IAEA,UAAAE,GACA,UAAAA,CAIA,MAAAve,OAAA,6BAGA,QAAAye,GAAAnF,GACA,GAAAoF,GACAC,EACAC,EACAC,EACAhB,CAEA,IAAAQ,EAAAC,EACA,KAAAte,OAAA,qBAGA,IAAAqe,GAAAC,EACA,QAQA,IAJAI,EAAA,IAAAF,EAAAH,GACAA,IAGA,QAAAK,GACA,MAAAA,EAIA,cAAAA,GAAA,CAGA,GAFAC,EAAAP,IACAP,GAAA,GAAAa,IAAA,EAAAC,EACAd,GAAA,IACA,MAAAA,EAEA,MAAA7d,OAAA,6BAKA,aAAA0e,GAAA,CAIA,GAHAC,EAAAP,IACAQ,EAAAR,IACAP,GAAA,GAAAa,IAAA,GAAAC,GAAA,EAAAC,EACAf,GAAA,KACA,MAAAD,GAAAC,EAAAvE,GAAAuE,EAAA,KAEA,MAAA7d,OAAA,6BAKA,aAAA0e,KACAC,EAAAP,IACAQ,EAAAR,IACAS,EAAAT,IACAP,GAAA,EAAAa,IAAA,GAAAC,GAAA,GACAC,GAAA,EAAAC,EACAhB,GAAA,OAAAA,GAAA,SACA,MAAAA,EAIA,MAAA7d,OAAA,0BAMA,QAAA4a,GAAAuD,EAAA7kB,GACAA,OACA,IAAAggB,IAAA,IAAAhgB,EAAAggB,MAEAkF,GAAApB,EAAAe,GACAG,EAAAE,EAAAniB,OACAgiB,EAAA,CAGA,KAFA,GACAS,GADAZ,MAEAY,EAAAL,EAAAnF,OAAA,GACA4E,EAAAzc,KAAAqd,EAEA,OAAApB,GAAAQ,GAvNA,GAAAa,GAAA,gBAAA1mB,MAQA6Y,GALA,gBAAA5Y,OACAA,EAAAD,SAAA0mB,GAAAzmB,EAIA,gBAAA4C,MACAgW,GAAAhW,SAAAgW,KAAAtU,SAAAsU,IACA/Y,EAAA+Y,EAKA,IAyLAsN,GACAF,EACAD,EA3LAV,EAAAhZ,OAAA6V,aA6MAnB,GACAxX,QAAA,QACAkG,OAAAqS,EACA3K,OAAAmL,EAUAuC,GAAA,WACA,MAAA9D,IACGrgB,KAAAX,EAAAM,EAAAN,EAAAC,KAAAkB,SAAA2jB,IAAA7kB,EAAAD,QAAA8kB,KAeF1kB,Q7B8wJ6BO,KAAKX,EAASM,EAAoB,IAAIL,GAAU,WAAa,MAAOG,WAI5F,SAAUH,EAAQD,G8BhhKxBC,EAAAD,QAAA,SAAAC,GAQA,MAPAA,GAAA0mB,kBACA1mB,EAAA2mB,UAAA,aACA3mB,EAAA4mB,SAEA5mB,EAAA6mB,YACA7mB,EAAA0mB,gBAAA,GAEA1mB,I9BwhKM,SAAUA,EAAQD,I+BzhKxB,WACA,YAMA,QAJA+mB,GAAA,mEAGAhmB,EAAA,GAAAsf,YAAA,KACAnc,EAAA,EAAiBA,EAAA6iB,EAAA/iB,OAAkBE,IACnCnD,EAAAgmB,EAAAnc,WAAA1G,KAGAlE,GAAA0P,OAAA,SAAA0U,GACA,GACAlgB,GADAqgB,EAAA,GAAAlE,YAAA+D,GACAvb,EAAA0b,EAAAvgB,OAAA6L,EAAA,EAEA,KAAA3L,EAAA,EAAeA,EAAA2E,EAAS3E,GAAA,EACxB2L,GAAAkX,EAAAxC,EAAArgB,IAAA,GACA2L,GAAAkX,GAAA,EAAAxC,EAAArgB,KAAA,EAAAqgB,EAAArgB,EAAA,OACA2L,GAAAkX,GAAA,GAAAxC,EAAArgB,EAAA,OAAAqgB,EAAArgB,EAAA,OACA2L,GAAAkX,EAAA,GAAAxC,EAAArgB,EAAA,GASA,OANA2E,GAAA,MACAgH,IAAA/L,UAAA,EAAA+L,EAAA7L,OAAA,OACK6E,EAAA,QACLgH,IAAA/L,UAAA,EAAA+L,EAAA7L,OAAA,SAGA6L,GAGA7P,EAAAoX,OAAA,SAAAvH,GACA,GACA3L,GACA8iB,EAAAC,EAAAC,EAAAC,EAFAC,EAAA,IAAAvX,EAAA7L,OACA6E,EAAAgH,EAAA7L,OAAAlD,EAAA,CAGA,OAAA+O,IAAA7L,OAAA,KACAojB,IACA,MAAAvX,IAAA7L,OAAA,IACAojB,IAIA,IAAAhD,GAAA,GAAAjT,aAAAiW,GACA7C,EAAA,GAAAlE,YAAA+D,EAEA,KAAAlgB,EAAA,EAAeA,EAAA2E,EAAS3E,GAAA,EACxB8iB,EAAAjmB,EAAA8O,EAAAjF,WAAA1G,IACA+iB,EAAAlmB,EAAA8O,EAAAjF,WAAA1G,EAAA,IACAgjB,EAAAnmB,EAAA8O,EAAAjF,WAAA1G,EAAA,IACAijB,EAAApmB,EAAA8O,EAAAjF,WAAA1G,EAAA,IAEAqgB,EAAAzjB,KAAAkmB,GAAA,EAAAC,GAAA,EACA1C,EAAAzjB,MAAA,GAAAmmB,IAAA,EAAAC,GAAA,EACA3C,EAAAzjB,MAAA,EAAAomB,IAAA,KAAAC,CAGA,OAAA/C,Q/ByiKM,SAAUnkB,EAAQD,IgCzmKxB,SAAA6C,GAkDA,QAAAwkB,GAAAlG,GACA,OAAAjd,GAAA,EAAiBA,EAAAid,EAAAnd,OAAgBE,IAAA,CACjC,GAAAojB,GAAAnG,EAAAjd,EACA,IAAAojB,EAAA9G,iBAAArP,aAAA,CACA,GAAAtC,GAAAyY,EAAA9G,MAIA,IAAA8G,EAAA/G,aAAA1R,EAAA0R,WAAA,CACA,GAAAgH,GAAA,GAAAlH,YAAAiH,EAAA/G,WACAgH,GAAAC,IAAA,GAAAnH,YAAAxR,EAAAyY,EAAAG,WAAAH,EAAA/G,aACA1R,EAAA0Y,EAAA/G,OAGAW,EAAAjd,GAAA2K,IAKA,QAAA6Y,GAAAvG,EAAAhU,GACAA,OAEA,IAAAwa,GAAA,GAAAC,EACAP,GAAAlG,EAEA,QAAAjd,GAAA,EAAiBA,EAAAid,EAAAnd,OAAgBE,IACjCyjB,EAAAE,OAAA1G,EAAAjd,GAGA,OAAAiJ,GAAA,KAAAwa,EAAAG,QAAA3a,EAAA3I,MAAAmjB,EAAAG,UAGA,QAAAC,GAAA5G,EAAAhU,GAEA,MADAka,GAAAlG,GACA,GAAA9P,MAAA8P,EAAAhU,OAhFA,GAAAya,GAAA/kB,EAAA+kB,aACA/kB,EAAAmlB,mBACAnlB,EAAAolB,eACAplB,EAAAqlB,eAMAC,EAAA,WACA,IACA,GAAAC,GAAA,GAAA/W,OAAA,MACA,YAAA+W,EAAArE,KACG,MAAAlgB,GACH,aASAwkB,EAAAF,GAAA,WACA,IACA,GAAAvkB,GAAA,GAAAyN,OAAA,GAAAgP,aAAA,OACA,YAAAzc,EAAAmgB,KACG,MAAAlgB,GACH,aAQAykB,EAAAV,GACAA,EAAArlB,UAAAslB,QACAD,EAAArlB,UAAAulB,OA6CA7nB,GAAAD,QAAA,WACA,MAAAmoB,GACAE,EAAAxlB,EAAAwO,KAAA0W,EACGO,EACHZ,EAEA,YhC+mK8B/mB,KAAKX,EAAU,WAAa,MAAOI,WAI3D,SAAUH,EAAQD,GiCxsKxBA,EAAA0P,OAAA,SAAArN,GACA,GAAAqB,GAAA,EAEA,QAAAQ,KAAA7B,GACAA,EAAAqP,eAAAxN,KACAR,EAAAM,SAAAN,GAAA,KACAA,GAAA6kB,mBAAArkB,GAAA,IAAAqkB,mBAAAlmB,EAAA6B,IAIA,OAAAR,IAUA1D,EAAAoX,OAAA,SAAAoR,GAGA,OAFAC,MACAC,EAAAF,EAAAvc,MAAA,KACA/H,EAAA,EAAA8M,EAAA0X,EAAA1kB,OAAmCE,EAAA8M,EAAO9M,IAAA,CAC1C,GAAAykB,GAAAD,EAAAxkB,GAAA+H,MAAA,IACAwc,GAAAG,mBAAAD,EAAA,KAAAC,mBAAAD,EAAA,IAEA,MAAAF,KjCwtKM,SAAUxoB,EAAQD,GkC1vKxBC,EAAAD,QAAA,SAAAooB,EAAAxkB,GACA,GAAA2M,GAAA,YACAA,GAAAhO,UAAAqB,EAAArB,UACA6lB,EAAA7lB,UAAA,GAAAgO,GACA6X,EAAA7lB,UAAAD,YAAA8lB,IlCkwKM,SAAUnoB,EAAQD,GmCvwKxB,YAgBA,SAAA0P,GAAAsC,GACA,GAAAgQ,GAAA,EAEA,GACAA,GAAA6G,EAAA7W,EAAAhO,GAAAge,EACAhQ,EAAAnH,KAAAoC,MAAA+E,EAAAhO,SACGgO,EAAA,EAEH,OAAAgQ,GAUA,QAAA5K,GAAA1T,GACA,GAAAolB,GAAA,CAEA,KAAA5kB,EAAA,EAAaA,EAAAR,EAAAM,OAAgBE,IAC7B4kB,IAAA9kB,EAAAkd,EAAAxd,EAAAT,OAAAiB,GAGA,OAAA4kB,GASA,QAAA3J,KACA,GAAA4J,GAAArZ,GAAA,GAAAvE,MAEA,OAAA4d,KAAAzd,GAAA0d,EAAA,EAAA1d,EAAAyd,GACAA,EAAA,IAAArZ,EAAAsZ,KAMA,IA1DA,GAKA1d,GALAud,EAAA,mEAAA5c,MAAA,IACAjI,EAAA,GACAkd,KACA8H,EAAA,EACA9kB,EAAA,EAsDMA,EAAAF,EAAYE,IAAAgd,EAAA2H,EAAA3kB,KAKlBib,GAAAzP,SACAyP,EAAA/H,SACAnX,EAAAD,QAAAmf,GnC8wKM,SAAUlf,EAAQD,EAASM,IAEJ,SAASuC,GoCpzKtC,QAAAma,MASA,QAAAiM,GAAAhoB,GACAgc,EAAAtc,KAAAP,KAAAa,GAEAb,KAAA6B,MAAA7B,KAAA6B,UAIAyO,IAEA7N,EAAAqmB,SAAArmB,EAAAqmB,WACAxY,EAAA7N,EAAAqmB,QAIA9oB,KAAA2F,MAAA2K,EAAA1M,MAGA,IAAAiH,GAAA7K,IACAsQ,GAAAtH,KAAA,SAAAwR,GACA3P,EAAA+S,OAAApD,KAIAxa,KAAA6B,MAAAkF,EAAA/G,KAAA2F,MAGAlD,EAAA4B,UAAA5B,EAAAwN,kBACAxN,EAAAwN,iBAAA,0BACApF,EAAAke,SAAAle,EAAAke,OAAAnT,QAAAgH,KACK,GAhEL,GAAAC,GAAA3c,EAAA,IACAod,EAAApd,EAAA,GAMAL,GAAAD,QAAAipB,CAMA,IAOAvY,GAPA0Y,EAAA,MACAC,EAAA,MA0DA3L,GAAAuL,EAAAhM,GAMAgM,EAAA1mB,UAAAkY,gBAAA,EAQAwO,EAAA1mB,UAAAkd,QAAA,WACArf,KAAA+oB,SACA/oB,KAAA+oB,OAAAG,WAAAC,YAAAnpB,KAAA+oB,QACA/oB,KAAA+oB,OAAA,MAGA/oB,KAAAopB,OACAppB,KAAAopB,KAAAF,WAAAC,YAAAnpB,KAAAopB,MACAppB,KAAAopB,KAAA,KACAppB,KAAAqpB,OAAA,MAGAxM,EAAA1a,UAAAkd,QAAA9e,KAAAP,OASA6oB,EAAA1mB,UAAAwb,OAAA,WACA,GAAA9S,GAAA7K,KACA+oB,EAAA1kB,SAAAilB,cAAA,SAEAtpB,MAAA+oB,SACA/oB,KAAA+oB,OAAAG,WAAAC,YAAAnpB,KAAA+oB,QACA/oB,KAAA+oB,OAAA,MAGAA,EAAA/L,OAAA,EACA+L,EAAAxlB,IAAAvD,KAAAY,MACAmoB,EAAAnT,QAAA,SAAAnS,GACAoH,EAAAmP,QAAA,mBAAAvW,GAGA,IAAA8lB,GAAAllB,SAAAmlB,qBAAA,YACAD,GACAA,EAAAL,WAAAO,aAAAV,EAAAQ,IAEAllB,SAAAqlB,MAAArlB,SAAAslB,MAAAC,YAAAb,GAEA/oB,KAAA+oB,QAEA,IAAAc,GAAA,mBAAAhlB,YAAA,SAAA/B,KAAA+B,UAAAC,UAEA+kB,IACAjiB,WAAA,WACA,GAAAyhB,GAAAhlB,SAAAilB,cAAA,SACAjlB,UAAAslB,KAAAC,YAAAP,GACAhlB,SAAAslB,KAAAR,YAAAE,IACK,MAYLR,EAAA1mB,UAAAqb,QAAA,SAAAjQ,EAAA4C,GA0BA,QAAA2Z,KACAC,IACA5Z,IAGA,QAAA4Z,KACA,GAAAlf,EAAAwe,OACA,IACAxe,EAAAue,KAAAD,YAAAte,EAAAwe,QACO,MAAA5lB,GACPoH,EAAAmP,QAAA,qCAAAvW,GAIA,IAEA,GAAAumB,GAAA,oCAAAnf,EAAAof,SAAA,IACAZ,GAAAhlB,SAAAilB,cAAAU,GACK,MAAAvmB,GACL4lB,EAAAhlB,SAAAilB,cAAA,UACAD,EAAArf,KAAAa,EAAAof,SACAZ,EAAA9lB,IAAA,eAGA8lB,EAAAhpB,GAAAwK,EAAAof,SAEApf,EAAAue,KAAAQ,YAAAP,GACAxe,EAAAwe,SApDA,GAAAxe,GAAA7K,IAEA,KAAAA,KAAAopB,KAAA,CACA,GAGAC,GAHAD,EAAA/kB,SAAAilB,cAAA,QACAY,EAAA7lB,SAAAilB,cAAA,YACAjpB,EAAAL,KAAAiqB,SAAA,cAAAjqB,KAAA2F,KAGAyjB,GAAAe,UAAA,WACAf,EAAA7kB,MAAA6lB,SAAA,WACAhB,EAAA7kB,MAAA8lB,IAAA,UACAjB,EAAA7kB,MAAA+lB,KAAA,UACAlB,EAAAmB,OAAAlqB,EACA+oB,EAAArM,OAAA,OACAqM,EAAAoB,aAAA,0BACAN,EAAAlgB,KAAA,IACAof,EAAAQ,YAAAM,GACA7lB,SAAAslB,KAAAC,YAAAR,GAEAppB,KAAAopB,OACAppB,KAAAkqB,OAGAlqB,KAAAopB,KAAAqB,OAAAzqB,KAAAY,MAgCAmpB,IAIAxc,IAAA5J,QAAAslB,EAAA,QACAjpB,KAAAkqB,KAAArF,MAAAtX,EAAA5J,QAAAqlB,EAAA,MAEA,KACAhpB,KAAAopB,KAAAsB,SACG,MAAAjnB,IAEHzD,KAAAqpB,OAAAxK,YACA7e,KAAAqpB,OAAAjL,mBAAA,WACA,aAAAvT,EAAAwe,OAAAhW,YACAyW,KAIA9pB,KAAAqpB,OAAA/W,OAAAwX,KpCu1K8BvpB,KAAKX,EAAU,WAAa,MAAOI,WAI3D,SAAUH,EAAQD,EAASM,IqC/jLjC,SAAAuC,GA0CA,QAAAkoB,GAAA9pB,GACA,GAAAuW,GAAAvW,KAAAuW,WACAA,KACApX,KAAAqa,gBAAA,GAEAra,KAAAgY,kBAAAnX,EAAAmX,kBACAhY,KAAA4qB,sBAAAC,IAAAhqB,EAAA2X,UACAxY,KAAA4Z,UAAA/Y,EAAA+Y,UACA5Z,KAAA4qB,wBACAE,EAAAC,GAEAzR,EAAA/Y,KAAAP,KAAAa,GAjDA,GAOAkqB,GAPAzR,EAAApZ,EAAA,IACAkC,EAAAlC,EAAA,IACA6W,EAAA7W,EAAA,IACAod,EAAApd,EAAA,IACA6e,EAAA7e,EAAA,IACAyB,EAAAzB,EAAA,iCACA2qB,EAAApoB,EAAAqoB,WAAAroB,EAAAuoB,YAEA,uBAAA7mB,QACA,IACA4mB,EAAA7qB,EAAA,IACG,MAAAuD,IASH,GAAAqnB,GAAAD,CACAC,IAAA,mBAAA3mB,UACA2mB,EAAAC,GAOAlrB,EAAAD,QAAA+qB,EA2BArN,EAAAqN,EAAArR,GAQAqR,EAAAxoB,UAAA6H,KAAA,YAMA2gB,EAAAxoB,UAAAkY,gBAAA,EAQAsQ,EAAAxoB,UAAA6c,OAAA,WACA,GAAAhf,KAAAirB,QAAA,CAKA,GAAArqB,GAAAZ,KAAAY,MACAgZ,EAAA5Z,KAAA4Z,UACA/Y,GACAiW,MAAA9W,KAAA8W,MACAkB,kBAAAhY,KAAAgY,kBAIAnX,GAAAqX,IAAAlY,KAAAkY,IACArX,EAAAmP,IAAAhQ,KAAAgQ,IACAnP,EAAAsX,WAAAnY,KAAAmY,WACAtX,EAAAuX,KAAApY,KAAAoY,KACAvX,EAAAwX,GAAArY,KAAAqY,GACAxX,EAAAyX,QAAAtY,KAAAsY,QACAzX,EAAA0X,mBAAAvY,KAAAuY,mBACAvY,KAAA0Y,eACA7X,EAAAqqB,QAAAlrB,KAAA0Y,cAEA1Y,KAAA4Y,eACA/X,EAAA+X,aAAA5Y,KAAA4Y,aAGA,KACA5Y,KAAAmrB,GAAAnrB,KAAA4qB,sBAAAhR,EAAA,GAAAkR,GAAAlqB,EAAAgZ,GAAA,GAAAkR,GAAAlqB,GAAA,GAAAkqB,GAAAlqB,EAAAgZ,EAAA/Y,GACG,MAAAsG,GACH,MAAAnH,MAAA4J,KAAA,QAAAzC,GAGApG,SAAAf,KAAAmrB,GAAArT,aACA9X,KAAAqa,gBAAA,GAGAra,KAAAmrB,GAAAC,UAAAprB,KAAAmrB,GAAAC,SAAAvd,QACA7N,KAAAqa,gBAAA,EACAra,KAAAmrB,GAAArT,WAAA,cAEA9X,KAAAmrB,GAAArT,WAAA,cAGA9X,KAAAqrB,sBASAV,EAAAxoB,UAAAkpB,kBAAA,WACA,GAAAxgB,GAAA7K,IAEAA,MAAAmrB,GAAAhW,OAAA,WACAtK,EAAAmQ,UAEAhb,KAAAmrB,GAAA7U,QAAA,WACAzL,EAAAoP,WAEAja,KAAAmrB,GAAAG,UAAA,SAAAC,GACA1gB,EAAA+S,OAAA2N,EAAAhe,OAEAvN,KAAAmrB,GAAAvV,QAAA,SAAAnS,GACAoH,EAAAmP,QAAA,kBAAAvW,KAWAknB,EAAAxoB,UAAA4T,MAAA,SAAAuJ,GA4CA,QAAA2B,KACApW,EAAAjB,KAAA,SAIAhC,WAAA,WACAiD,EAAA2Q,UAAA,EACA3Q,EAAAjB,KAAA,UACK,GAnDL,GAAAiB,GAAA7K,IACAA,MAAAwb,UAAA,CAKA,QADA2D,GAAAG,EAAA1b,OACAE,EAAA,EAAA8M,EAAAuO,EAA4Brb,EAAA8M,EAAO9M,KACnC,SAAAkK,GACA5L,EAAAme,aAAAvS,EAAAnD,EAAAwP,eAAA,SAAA9M,GACA,IAAA1C,EAAA+f,sBAAA,CAEA,GAAA/pB,KAKA,IAJAmN,EAAAjB,UACAlM,EAAA4a,SAAAzN,EAAAjB,QAAA0O,UAGA5Q,EAAAmN,kBAAA,CACA,GAAAvP,GAAA,gBAAA8E,GAAA9K,EAAAoO,OAAAsP,WAAA5S,KAAA3J,MACA6E,GAAAoC,EAAAmN,kBAAAC,YACApX,EAAA4a,UAAA,IAQA,IACA5Q,EAAA+f,sBAEA/f,EAAAsgB,GAAA5Q,KAAAhN,GAEA1C,EAAAsgB,GAAA5Q,KAAAhN,EAAA1M,GAES,MAAA4C,GACT9B,EAAA,2CAGAwd,GAAA8B,OAEK3B,EAAAxb,KAqBL6mB,EAAAxoB,UAAA8X,QAAA,WACAX,EAAAnX,UAAA8X,QAAA1Z,KAAAP,OASA2qB,EAAAxoB,UAAAkd,QAAA,WACA,mBAAArf,MAAAmrB,IACAnrB,KAAAmrB,GAAA5V,SAUAoV,EAAAxoB,UAAAvB,IAAA,WACA,GAAAiB,GAAA7B,KAAA6B,UACA4d,EAAAzf,KAAA6W,OAAA,WACA7T,EAAA,EAGAhD,MAAAgD,OAAA,QAAAyc,GAAA,MAAAnR,OAAAtO,KAAAgD,OACA,OAAAyc,GAAA,KAAAnR,OAAAtO,KAAAgD,SACAA,EAAA,IAAAhD,KAAAgD,MAIAhD,KAAAuX,oBACA1V,EAAA7B,KAAAsX,gBAAAyH,KAIA/e,KAAAqa,iBACAxY,EAAA6d,IAAA,GAGA7d,EAAAkV,EAAAzH,OAAAzN,GAGAA,EAAA+B,SACA/B,EAAA,IAAAA,EAGA,IAAAoB,GAAAjD,KAAA4W,SAAA1T,QAAA,SACA,OAAAuc,GAAA,OAAAxc,EAAA,IAAAjD,KAAA4W,SAAA,IAAA5W,KAAA4W,UAAA5T,EAAAhD,KAAAoB,KAAAS,GAUA8oB,EAAAxoB,UAAA8oB,MAAA,WACA,SAAAH,GAAA,gBAAAA,IAAA9qB,KAAAgK,OAAA2gB,EAAAxoB,UAAA6H,SrCokL8BzJ,KAAKX,EAAU,WAAa,MAAOI,WAI3D,SAAUH,EAAQD,KAMlB,SAAUC,EAAQD,GsCz2LxB,GAAAsD,aAEArD,GAAAD,QAAA,SAAA4R,EAAAvP,GACA,GAAAiB,EAAA,MAAAsO,GAAAtO,QAAAjB,EACA,QAAA6B,GAAA,EAAiBA,EAAA0N,EAAA5N,SAAgBE,EACjC,GAAA0N,EAAA1N,KAAA7B,EAAA,MAAA6B,EAEA,YtCi3LM,SAAUjE,EAAQD,IuCz3LxB,SAAA6C,GAOA,GAAA+oB,GAAA,gBACAC,EAAA,sCACAC,EAAA,mEACAC,EAAA,uBACAC,EAAA,OACAC,EAAA,MAEAhsB,GAAAD,QAAA,SAAA2N,GACA,sBAAAA,OAIAA,IAAA5J,QAAAioB,EAAA,IAAAjoB,QAAAkoB,EAAA,IAGAppB,EAAAwE,WAAAgF,MACAhF,KAAAgF,MAAAsB,GAGAie,EAAA1oB,KAAAyK,EAAA5J,QAAA8nB,EAAA,KACA9nB,QAAA+nB,EAAA,KACA/nB,QAAAgoB,EAAA,KACA,GAAA7lB,UAAA,UAAAyH,KAHA,QAVA,QvC24L8BhN,KAAKX,EAAU,WAAa,MAAOI,WAI3D,SAAUH,EAAQD,EAASM,GAEhC,YwC32LD,SAASsC,GAAQxB,EAAIsM,EAAKzM,GACxBb,KAAKgB,GAAKA,EACVhB,KAAKsN,IAAMA,EACXtN,KAAK8rB,KAAO9rB,KACZA,KAAK+rB,IAAM,EACX/rB,KAAKgsB,QACLhsB,KAAKisB,iBACLjsB,KAAKksB,cACLlsB,KAAKmsB,WAAY,EACjBnsB,KAAKosB,cAAe,EAChBvrB,GAAQA,EAAKgB,QACf7B,KAAK6B,MAAQhB,EAAKgB,OAEhB7B,KAAKgB,GAAG4S,aAAa5T,KAAK6T,OxCg2L/B,GAAI/S,GAA4B,kBAAXiB,SAAoD,gBAApBA,QAAOC,SAAwB,SAAUC,GAAO,aAAcA,IAAS,SAAUA,GAAO,MAAOA,IAAyB,kBAAXF,SAAyBE,EAAIC,cAAgBH,QAAUE,IAAQF,OAAOI,UAAY,eAAkBF,IwC95LnQG,EAASlC,EAAQ,GACjB6O,EAAU7O,EAAQ,GAClBmsB,EAAUnsB,EAAQ,IAClBoJ,EAAKpJ,EAAQ,IACbuL,EAAOvL,EAAQ,IACfyB,EAAQzB,EAAQ,GAAS,2BACzB6W,EAAU7W,EAAQ,GAMtBL,GAAOD,QAAUA,EAAU4C,CAS3B,IAAI8pB,IACF/pB,QAAS,EACTgqB,cAAe,EACfC,gBAAiB,EACjBlZ,WAAY,EACZ8C,WAAY,EACZ5H,MAAO,EACPwG,UAAW,EACXyX,kBAAmB,EACnBC,iBAAkB,EAClBC,gBAAiB,EACjB7X,aAAc,EACdwG,KAAM,EACNmG,KAAM,GAOJ7X,EAAOmF,EAAQ5M,UAAUyH,IA4B7BmF,GAAQvM,EAAOL,WAQfK,EAAOL,UAAUyqB,UAAY,WAC3B,IAAI5sB,KAAKyS,KAAT,CAEA,GAAIzR,GAAKhB,KAAKgB,EACdhB,MAAKyS,MACHnJ,EAAGtI,EAAI,OAAQyK,EAAKzL,KAAM,WAC1BsJ,EAAGtI,EAAI,SAAUyK,EAAKzL,KAAM,aAC5BsJ,EAAGtI,EAAI,QAASyK,EAAKzL,KAAM,eAU/BwC,EAAOL,UAAU0R,KACjBrR,EAAOL,UAAUI,QAAU,WACzB,MAAIvC,MAAKmsB,UAAkBnsB,MAE3BA,KAAK4sB,YACL5sB,KAAKgB,GAAG6S,OACJ,SAAW7T,KAAKgB,GAAGqS,YAAYrT,KAAKmV,SACxCnV,KAAK4J,KAAK,cACH5J,OAUTwC,EAAOL,UAAUoY,KAAO,WACtB,GAAIlV,GAAOgnB,EAAQrmB,UAGnB,OAFAX,GAAK+F,QAAQ,WACbpL,KAAK4J,KAAK7D,MAAM/F,KAAMqF,GACfrF,MAYTwC,EAAOL,UAAUyH,KAAO,SAAU2hB,GAChC,GAAIe,EAAOhb,eAAeia,GAExB,MADA3hB,GAAK7D,MAAM/F,KAAMgG,WACVhG,IAGT,IAAIqF,GAAOgnB,EAAQrmB,WACfgI,GAAW5J,KAAMhC,EAAOgN,MAAO7B,KAAMlI,EAoBzC,OAlBA2I,GAAOjB,WACPiB,EAAOjB,QAAQ0O,UAAYzb,KAAK6sB,QAAS,IAAU7sB,KAAK6sB,MAAMpR,SAG1D,kBAAsBpW,GAAKA,EAAKzB,OAAS,KAC3CjC,EAAM,iCAAkC3B,KAAK+rB,KAC7C/rB,KAAKgsB,KAAKhsB,KAAK+rB,KAAO1mB,EAAKynB,MAC3B9e,EAAO3N,GAAKL,KAAK+rB,OAGf/rB,KAAKmsB,UACPnsB,KAAKgO,OAAOA,GAEZhO,KAAKksB,WAAWljB,KAAKgF,SAGhBhO,MAAK6sB,MAEL7sB,MAUTwC,EAAOL,UAAU6L,OAAS,SAAUA,GAClCA,EAAOV,IAAMtN,KAAKsN,IAClBtN,KAAKgB,GAAGgN,OAAOA,IASjBxL,EAAOL,UAAUgT,OAAS,WAIxB,GAHAxT,EAAM,kCAGF,MAAQ3B,KAAKsN,IACf,GAAItN,KAAK6B,MAAO,CACd,GAAIA,GAA8B,WAAtBf,EAAOd,KAAK6B,OAAqBkV,EAAQzH,OAAOtP,KAAK6B,OAAS7B,KAAK6B,KAC/EF,GAAM,uCAAwCE,GAC9C7B,KAAKgO,QAAQ5J,KAAMhC,EAAO8M,QAASrN,MAAOA,QAE1C7B,MAAKgO,QAAQ5J,KAAMhC,EAAO8M,WAYhC1M,EAAOL,UAAUmU,QAAU,SAAUC,GACnC5U,EAAM,aAAc4U,GACpBvW,KAAKmsB,WAAY,EACjBnsB,KAAKosB,cAAe,QACbpsB,MAAKK,GACZL,KAAK4J,KAAK,aAAc2M,IAU1B/T,EAAOL,UAAU4qB,SAAW,SAAU/e,GACpC,GAAIA,EAAOV,MAAQtN,KAAKsN,IAExB,OAAQU,EAAO5J,MACb,IAAKhC,GAAO8M,QACVlP,KAAKgtB,WACL,MAEF,KAAK5qB,GAAOgN,MACVpP,KAAKitB,QAAQjf,EACb,MAEF,KAAK5L,GAAO+K,aACVnN,KAAKitB,QAAQjf,EACb,MAEF,KAAK5L,GAAOiN,IACVrP,KAAKktB,MAAMlf,EACX,MAEF,KAAK5L,GAAOgL,WACVpN,KAAKktB,MAAMlf,EACX,MAEF,KAAK5L,GAAO+M,WACVnP,KAAKmtB,cACL,MAEF,KAAK/qB,GAAO0M,MACV9O,KAAK4J,KAAK,QAASoE,EAAOT,QAYhC/K,EAAOL,UAAU8qB,QAAU,SAAUjf,GACnC,GAAI3I,GAAO2I,EAAOT,QAClB5L,GAAM,oBAAqB0D,GAEvB,MAAQ2I,EAAO3N,KACjBsB,EAAM,mCACN0D,EAAK2D,KAAKhJ,KAAKotB,IAAIpf,EAAO3N,MAGxBL,KAAKmsB,UACPviB,EAAK7D,MAAM/F,KAAMqF,GAEjBrF,KAAKisB,cAAcjjB,KAAK3D,IAU5B7C,EAAOL,UAAUirB,IAAM,SAAU/sB,GAC/B,GAAIwK,GAAO7K,KACPqtB,GAAO,CACX,OAAO,YAEL,IAAIA,EAAJ,CACAA,GAAO,CACP,IAAIhoB,GAAOgnB,EAAQrmB,UACnBrE,GAAM,iBAAkB0D,GAExBwF,EAAKmD,QACH5J,KAAMhC,EAAOiN,IACbhP,GAAIA,EACJkN,KAAMlI,OAYZ7C,EAAOL,UAAU+qB,MAAQ,SAAUlf,GACjC,GAAIof,GAAMptB,KAAKgsB,KAAKhe,EAAO3N,GACvB,mBAAsB+sB,IACxBzrB,EAAM,yBAA0BqM,EAAO3N,GAAI2N,EAAOT,MAClD6f,EAAIrnB,MAAM/F,KAAMgO,EAAOT,YAChBvN,MAAKgsB,KAAKhe,EAAO3N,KAExBsB,EAAM,aAAcqM,EAAO3N,KAU/BmC,EAAOL,UAAU6qB,UAAY,WAC3BhtB,KAAKmsB,WAAY,EACjBnsB,KAAKosB,cAAe,EACpBpsB,KAAK4J,KAAK,WACV5J,KAAKstB,gBASP9qB,EAAOL,UAAUmrB,aAAe,WAC9B,GAAIxpB,EACJ,KAAKA,EAAI,EAAGA,EAAI9D,KAAKisB,cAAcroB,OAAQE,IACzC8F,EAAK7D,MAAM/F,KAAMA,KAAKisB,cAAcnoB,GAItC,KAFA9D,KAAKisB,iBAEAnoB,EAAI,EAAGA,EAAI9D,KAAKksB,WAAWtoB,OAAQE,IACtC9D,KAAKgO,OAAOhO,KAAKksB,WAAWpoB,GAE9B9D,MAAKksB,eASP1pB,EAAOL,UAAUgrB,aAAe,WAC9BxrB,EAAM,yBAA0B3B,KAAKsN,KACrCtN,KAAK2P,UACL3P,KAAKsW,QAAQ,yBAWf9T,EAAOL,UAAUwN,QAAU,WACzB,GAAI3P,KAAKyS,KAAM,CAEb,IAAK,GAAI3O,GAAI,EAAGA,EAAI9D,KAAKyS,KAAK7O,OAAQE,IACpC9D,KAAKyS,KAAK3O,GAAG6L,SAEf3P,MAAKyS,KAAO,KAGdzS,KAAKgB,GAAG2O,QAAQ3P,OAUlBwC,EAAOL,UAAUoT,MACjB/S,EAAOL,UAAUiU,WAAa,WAa5B,MAZIpW,MAAKmsB,YACPxqB,EAAM,6BAA8B3B,KAAKsN,KACzCtN,KAAKgO,QAAS5J,KAAMhC,EAAO+M,cAI7BnP,KAAK2P,UAED3P,KAAKmsB,WAEPnsB,KAAKsW,QAAQ,wBAERtW,MAWTwC,EAAOL,UAAUsZ,SAAW,SAAUA,GAGpC,MAFAzb,MAAK6sB,MAAQ7sB,KAAK6sB,UAClB7sB,KAAK6sB,MAAMpR,SAAWA,EACfzb,OxCm6LH,SAAUH,EAAQD,GyCj0MxB,QAAAysB,GAAAkB,EAAA5nB,GACA,GAAAiD,KAEAjD,MAAA,CAEA,QAAA7B,GAAA6B,GAAA,EAA4B7B,EAAAypB,EAAA3pB,OAAiBE,IAC7C8E,EAAA9E,EAAA6B,GAAA4nB,EAAAzpB,EAGA,OAAA8E,GAXA/I,EAAAD,QAAAysB,GzCs1MM,SAAUxsB,EAAQD,GAEvB,Y0Cx0MD,SAAS0J,GAAIrH,EAAKspB,EAAIpb,GAEpB,MADAlO,GAAIqH,GAAGiiB,EAAIpb,IAETR,QAAS,WACP1N,EAAIyH,eAAe6hB,EAAIpb,KAf7BtQ,EAAOD,QAAU0J,G1C+2MX,SAAUzJ,EAAQD,G2Ch3MxB,GAAA4Q,WAWA3Q,GAAAD,QAAA,SAAAqC,EAAAkO,GAEA,GADA,gBAAAA,OAAAlO,EAAAkO,IACA,kBAAAA,GAAA,SAAA5I,OAAA,6BACA,IAAAlC,GAAAmL,EAAAjQ,KAAAyF,UAAA,EACA,mBACA,MAAAmK,GAAApK,MAAA9D,EAAAoD,EAAAgD,OAAAmI,EAAAjQ,KAAAyF,gB3C63MM,SAAUnG,EAAQD,G4C93MxB,QAAAqT,GAAApS,GACAA,QACAb,KAAAgL,GAAAnK,EAAAqS,KAAA,IACAlT,KAAAmT,IAAAtS,EAAAsS,KAAA,IACAnT,KAAAwtB,OAAA3sB,EAAA2sB,QAAA,EACAxtB,KAAAoT,OAAAvS,EAAAuS,OAAA,GAAAvS,EAAAuS,QAAA,EAAAvS,EAAAuS,OAAA,EACApT,KAAA+U,SAAA,EApBAlV,EAAAD,QAAAqT,EA8BAA,EAAA9Q,UAAAsU,SAAA,WACA,GAAAzL,GAAAhL,KAAAgL,GAAAP,KAAAgjB,IAAAztB,KAAAwtB,OAAAxtB,KAAA+U,WACA,IAAA/U,KAAAoT,OAAA,CACA,GAAAsa,GAAAjjB,KAAAkjB,SACAC,EAAAnjB,KAAAoC,MAAA6gB,EAAA1tB,KAAAoT,OAAApI,EACAA,GAAA,MAAAP,KAAAoC,MAAA,GAAA6gB,IAAA1iB,EAAA4iB,EAAA5iB,EAAA4iB,EAEA,SAAAnjB,KAAAyI,IAAAlI,EAAAhL,KAAAmT,MASAF,EAAA9Q,UAAAkU,MAAA,WACArW,KAAA+U,SAAA,GASA9B,EAAA9Q,UAAAoS,OAAA,SAAArB,GACAlT,KAAAgL,GAAAkI,GASAD,EAAA9Q,UAAAwS,OAAA,SAAAxB,GACAnT,KAAAmT,OASAF,EAAA9Q,UAAAsS,UAAA,SAAArB,GACApT,KAAAoT","file":"socket.io.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"io\"] = factory();\n\telse\n\t\troot[\"io\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"io\"] = factory();\n\telse\n\t\troot[\"io\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\t\n\t/**\n\t * Module dependencies.\n\t */\n\t\n\tvar url = __webpack_require__(1);\n\tvar parser = __webpack_require__(7);\n\tvar Manager = __webpack_require__(13);\n\tvar debug = __webpack_require__(3)('socket.io-client');\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = exports = lookup;\n\t\n\t/**\n\t * Managers cache.\n\t */\n\t\n\tvar cache = exports.managers = {};\n\t\n\t/**\n\t * Looks up an existing `Manager` for multiplexing.\n\t * If the user summons:\n\t *\n\t *   `io('http://localhost/a');`\n\t *   `io('http://localhost/b');`\n\t *\n\t * We reuse the existing instance based on same scheme/port/host,\n\t * and we initialize sockets for each namespace.\n\t *\n\t * @api public\n\t */\n\t\n\tfunction lookup(uri, opts) {\n\t  if ((typeof uri === 'undefined' ? 'undefined' : _typeof(uri)) === 'object') {\n\t    opts = uri;\n\t    uri = undefined;\n\t  }\n\t\n\t  opts = opts || {};\n\t\n\t  var parsed = url(uri);\n\t  var source = parsed.source;\n\t  var id = parsed.id;\n\t  var path = parsed.path;\n\t  var sameNamespace = cache[id] && path in cache[id].nsps;\n\t  var newConnection = opts.forceNew || opts['force new connection'] || false === opts.multiplex || sameNamespace;\n\t\n\t  var io;\n\t\n\t  if (newConnection) {\n\t    debug('ignoring socket cache for %s', source);\n\t    io = Manager(source, opts);\n\t  } else {\n\t    if (!cache[id]) {\n\t      debug('new io instance for %s', source);\n\t      cache[id] = Manager(source, opts);\n\t    }\n\t    io = cache[id];\n\t  }\n\t  if (parsed.query && !opts.query) {\n\t    opts.query = parsed.query;\n\t  }\n\t  return io.socket(parsed.path, opts);\n\t}\n\t\n\t/**\n\t * Protocol version.\n\t *\n\t * @api public\n\t */\n\t\n\texports.protocol = parser.protocol;\n\t\n\t/**\n\t * `connect`.\n\t *\n\t * @param {String} uri\n\t * @api public\n\t */\n\t\n\texports.connect = lookup;\n\t\n\t/**\n\t * Expose constructors for standalone build.\n\t *\n\t * @api public\n\t */\n\t\n\texports.Manager = __webpack_require__(13);\n\texports.Socket = __webpack_require__(39);\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\t/**\n\t * Module dependencies.\n\t */\n\t\n\tvar parseuri = __webpack_require__(2);\n\tvar debug = __webpack_require__(3)('socket.io-client:url');\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = url;\n\t\n\t/**\n\t * URL parser.\n\t *\n\t * @param {String} url\n\t * @param {Object} An object meant to mimic window.location.\n\t *                 Defaults to window.location.\n\t * @api public\n\t */\n\t\n\tfunction url(uri, loc) {\n\t  var obj = uri;\n\t\n\t  // default to window.location\n\t  loc = loc || global.location;\n\t  if (null == uri) uri = loc.protocol + '//' + loc.host;\n\t\n\t  // relative path support\n\t  if ('string' === typeof uri) {\n\t    if ('/' === uri.charAt(0)) {\n\t      if ('/' === uri.charAt(1)) {\n\t        uri = loc.protocol + uri;\n\t      } else {\n\t        uri = loc.host + uri;\n\t      }\n\t    }\n\t\n\t    if (!/^(https?|wss?):\\/\\//.test(uri)) {\n\t      debug('protocol-less url %s', uri);\n\t      if ('undefined' !== typeof loc) {\n\t        uri = loc.protocol + '//' + uri;\n\t      } else {\n\t        uri = 'https://' + uri;\n\t      }\n\t    }\n\t\n\t    // parse\n\t    debug('parse %s', uri);\n\t    obj = parseuri(uri);\n\t  }\n\t\n\t  // make sure we treat `localhost:80` and `localhost` equally\n\t  if (!obj.port) {\n\t    if (/^(http|ws)$/.test(obj.protocol)) {\n\t      obj.port = '80';\n\t    } else if (/^(http|ws)s$/.test(obj.protocol)) {\n\t      obj.port = '443';\n\t    }\n\t  }\n\t\n\t  obj.path = obj.path || '/';\n\t\n\t  var ipv6 = obj.host.indexOf(':') !== -1;\n\t  var host = ipv6 ? '[' + obj.host + ']' : obj.host;\n\t\n\t  // define unique id\n\t  obj.id = obj.protocol + '://' + host + ':' + obj.port;\n\t  // define href\n\t  obj.href = obj.protocol + '://' + host + (loc && loc.port === obj.port ? '' : ':' + obj.port);\n\t\n\t  return obj;\n\t}\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\n\t/**\r\n\t * Parses an URI\r\n\t *\r\n\t * @author Steven Levithan <stevenlevithan.com> (MIT license)\r\n\t * @api private\r\n\t */\r\n\t\r\n\tvar re = /^(?:(?![^:@]+:[^:@\\/]*@)(http|https|ws|wss):\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/;\r\n\t\r\n\tvar parts = [\r\n\t    'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'\r\n\t];\r\n\t\r\n\tmodule.exports = function parseuri(str) {\r\n\t    var src = str,\r\n\t        b = str.indexOf('['),\r\n\t        e = str.indexOf(']');\r\n\t\r\n\t    if (b != -1 && e != -1) {\r\n\t        str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length);\r\n\t    }\r\n\t\r\n\t    var m = re.exec(str || ''),\r\n\t        uri = {},\r\n\t        i = 14;\r\n\t\r\n\t    while (i--) {\r\n\t        uri[parts[i]] = m[i] || '';\r\n\t    }\r\n\t\r\n\t    if (b != -1 && e != -1) {\r\n\t        uri.source = src;\r\n\t        uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':');\r\n\t        uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':');\r\n\t        uri.ipv6uri = true;\r\n\t    }\r\n\t\r\n\t    return uri;\r\n\t};\r\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(process) {/**\n\t * This is the web browser implementation of `debug()`.\n\t *\n\t * Expose `debug()` as the module.\n\t */\n\t\n\texports = module.exports = __webpack_require__(5);\n\texports.log = log;\n\texports.formatArgs = formatArgs;\n\texports.save = save;\n\texports.load = load;\n\texports.useColors = useColors;\n\texports.storage = 'undefined' != typeof chrome\n\t               && 'undefined' != typeof chrome.storage\n\t                  ? chrome.storage.local\n\t                  : localstorage();\n\t\n\t/**\n\t * Colors.\n\t */\n\t\n\texports.colors = [\n\t  'lightseagreen',\n\t  'forestgreen',\n\t  'goldenrod',\n\t  'dodgerblue',\n\t  'darkorchid',\n\t  'crimson'\n\t];\n\t\n\t/**\n\t * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n\t * and the Firebug extension (any Firefox version) are known\n\t * to support \"%c\" CSS customizations.\n\t *\n\t * TODO: add a `localStorage` variable to explicitly enable/disable colors\n\t */\n\t\n\tfunction useColors() {\n\t  // NB: In an Electron preload script, document will be defined but not fully\n\t  // initialized. Since we know we're in Chrome, we'll just detect this case\n\t  // explicitly\n\t  if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n\t    return true;\n\t  }\n\t\n\t  // is webkit? http://stackoverflow.com/a/16459606/376773\n\t  // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\t  return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t    // is firebug? http://stackoverflow.com/a/398120/376773\n\t    (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t    // is firefox >= v31?\n\t    // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t    // double check webkit in userAgent just in case we are in a worker\n\t    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n\t}\n\t\n\t/**\n\t * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n\t */\n\t\n\texports.formatters.j = function(v) {\n\t  try {\n\t    return JSON.stringify(v);\n\t  } catch (err) {\n\t    return '[UnexpectedJSONParseError]: ' + err.message;\n\t  }\n\t};\n\t\n\t\n\t/**\n\t * Colorize log arguments if enabled.\n\t *\n\t * @api public\n\t */\n\t\n\tfunction formatArgs(args) {\n\t  var useColors = this.useColors;\n\t\n\t  args[0] = (useColors ? '%c' : '')\n\t    + this.namespace\n\t    + (useColors ? ' %c' : ' ')\n\t    + args[0]\n\t    + (useColors ? '%c ' : ' ')\n\t    + '+' + exports.humanize(this.diff);\n\t\n\t  if (!useColors) return;\n\t\n\t  var c = 'color: ' + this.color;\n\t  args.splice(1, 0, c, 'color: inherit')\n\t\n\t  // the final \"%c\" is somewhat tricky, because there could be other\n\t  // arguments passed either before or after the %c, so we need to\n\t  // figure out the correct index to insert the CSS into\n\t  var index = 0;\n\t  var lastC = 0;\n\t  args[0].replace(/%[a-zA-Z%]/g, function(match) {\n\t    if ('%%' === match) return;\n\t    index++;\n\t    if ('%c' === match) {\n\t      // we only are interested in the *last* %c\n\t      // (the user may have provided their own)\n\t      lastC = index;\n\t    }\n\t  });\n\t\n\t  args.splice(lastC, 0, c);\n\t}\n\t\n\t/**\n\t * Invokes `console.log()` when available.\n\t * No-op when `console.log` is not a \"function\".\n\t *\n\t * @api public\n\t */\n\t\n\tfunction log() {\n\t  // this hackery is required for IE8/9, where\n\t  // the `console.log` function doesn't have 'apply'\n\t  return 'object' === typeof console\n\t    && console.log\n\t    && Function.prototype.apply.call(console.log, console, arguments);\n\t}\n\t\n\t/**\n\t * Save `namespaces`.\n\t *\n\t * @param {String} namespaces\n\t * @api private\n\t */\n\t\n\tfunction save(namespaces) {\n\t  try {\n\t    if (null == namespaces) {\n\t      exports.storage.removeItem('debug');\n\t    } else {\n\t      exports.storage.debug = namespaces;\n\t    }\n\t  } catch(e) {}\n\t}\n\t\n\t/**\n\t * Load `namespaces`.\n\t *\n\t * @return {String} returns the previously persisted debug modes\n\t * @api private\n\t */\n\t\n\tfunction load() {\n\t  var r;\n\t  try {\n\t    r = exports.storage.debug;\n\t  } catch(e) {}\n\t\n\t  // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\t  if (!r && typeof process !== 'undefined' && 'env' in process) {\n\t    r = process.env.DEBUG;\n\t  }\n\t\n\t  return r;\n\t}\n\t\n\t/**\n\t * Enable namespaces listed in `localStorage.debug` initially.\n\t */\n\t\n\texports.enable(load());\n\t\n\t/**\n\t * Localstorage attempts to return the localstorage.\n\t *\n\t * This is necessary because safari throws\n\t * when a user disables cookies/localstorage\n\t * and you attempt to access it.\n\t *\n\t * @return {LocalStorage}\n\t * @api private\n\t */\n\t\n\tfunction localstorage() {\n\t  try {\n\t    return window.localStorage;\n\t  } catch (e) {}\n\t}\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\n\t// shim for using process in browser\n\tvar process = module.exports = {};\n\t\n\t// cached from whatever global is present so that test runners that stub it\n\t// don't break things.  But we need to wrap it in a try catch in case it is\n\t// wrapped in strict mode code which doesn't define any globals.  It's inside a\n\t// function because try/catches deoptimize in certain engines.\n\t\n\tvar cachedSetTimeout;\n\tvar cachedClearTimeout;\n\t\n\tfunction defaultSetTimout() {\n\t    throw new Error('setTimeout has not been defined');\n\t}\n\tfunction defaultClearTimeout () {\n\t    throw new Error('clearTimeout has not been defined');\n\t}\n\t(function () {\n\t    try {\n\t        if (typeof setTimeout === 'function') {\n\t            cachedSetTimeout = setTimeout;\n\t        } else {\n\t            cachedSetTimeout = defaultSetTimout;\n\t        }\n\t    } catch (e) {\n\t        cachedSetTimeout = defaultSetTimout;\n\t    }\n\t    try {\n\t        if (typeof clearTimeout === 'function') {\n\t            cachedClearTimeout = clearTimeout;\n\t        } else {\n\t            cachedClearTimeout = defaultClearTimeout;\n\t        }\n\t    } catch (e) {\n\t        cachedClearTimeout = defaultClearTimeout;\n\t    }\n\t} ())\n\tfunction runTimeout(fun) {\n\t    if (cachedSetTimeout === setTimeout) {\n\t        //normal enviroments in sane situations\n\t        return setTimeout(fun, 0);\n\t    }\n\t    // if setTimeout wasn't available but was latter defined\n\t    if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n\t        cachedSetTimeout = setTimeout;\n\t        return setTimeout(fun, 0);\n\t    }\n\t    try {\n\t        // when when somebody has screwed with setTimeout but no I.E. maddness\n\t        return cachedSetTimeout(fun, 0);\n\t    } catch(e){\n\t        try {\n\t            // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n\t            return cachedSetTimeout.call(null, fun, 0);\n\t        } catch(e){\n\t            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n\t            return cachedSetTimeout.call(this, fun, 0);\n\t        }\n\t    }\n\t\n\t\n\t}\n\tfunction runClearTimeout(marker) {\n\t    if (cachedClearTimeout === clearTimeout) {\n\t        //normal enviroments in sane situations\n\t        return clearTimeout(marker);\n\t    }\n\t    // if clearTimeout wasn't available but was latter defined\n\t    if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n\t        cachedClearTimeout = clearTimeout;\n\t        return clearTimeout(marker);\n\t    }\n\t    try {\n\t        // when when somebody has screwed with setTimeout but no I.E. maddness\n\t        return cachedClearTimeout(marker);\n\t    } catch (e){\n\t        try {\n\t            // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally\n\t            return cachedClearTimeout.call(null, marker);\n\t        } catch (e){\n\t            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n\t            // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n\t            return cachedClearTimeout.call(this, marker);\n\t        }\n\t    }\n\t\n\t\n\t\n\t}\n\tvar queue = [];\n\tvar draining = false;\n\tvar currentQueue;\n\tvar queueIndex = -1;\n\t\n\tfunction cleanUpNextTick() {\n\t    if (!draining || !currentQueue) {\n\t        return;\n\t    }\n\t    draining = false;\n\t    if (currentQueue.length) {\n\t        queue = currentQueue.concat(queue);\n\t    } else {\n\t        queueIndex = -1;\n\t    }\n\t    if (queue.length) {\n\t        drainQueue();\n\t    }\n\t}\n\t\n\tfunction drainQueue() {\n\t    if (draining) {\n\t        return;\n\t    }\n\t    var timeout = runTimeout(cleanUpNextTick);\n\t    draining = true;\n\t\n\t    var len = queue.length;\n\t    while(len) {\n\t        currentQueue = queue;\n\t        queue = [];\n\t        while (++queueIndex < len) {\n\t            if (currentQueue) {\n\t                currentQueue[queueIndex].run();\n\t            }\n\t        }\n\t        queueIndex = -1;\n\t        len = queue.length;\n\t    }\n\t    currentQueue = null;\n\t    draining = false;\n\t    runClearTimeout(timeout);\n\t}\n\t\n\tprocess.nextTick = function (fun) {\n\t    var args = new Array(arguments.length - 1);\n\t    if (arguments.length > 1) {\n\t        for (var i = 1; i < arguments.length; i++) {\n\t            args[i - 1] = arguments[i];\n\t        }\n\t    }\n\t    queue.push(new Item(fun, args));\n\t    if (queue.length === 1 && !draining) {\n\t        runTimeout(drainQueue);\n\t    }\n\t};\n\t\n\t// v8 likes predictible objects\n\tfunction Item(fun, array) {\n\t    this.fun = fun;\n\t    this.array = array;\n\t}\n\tItem.prototype.run = function () {\n\t    this.fun.apply(null, this.array);\n\t};\n\tprocess.title = 'browser';\n\tprocess.browser = true;\n\tprocess.env = {};\n\tprocess.argv = [];\n\tprocess.version = ''; // empty string to avoid regexp issues\n\tprocess.versions = {};\n\t\n\tfunction noop() {}\n\t\n\tprocess.on = noop;\n\tprocess.addListener = noop;\n\tprocess.once = noop;\n\tprocess.off = noop;\n\tprocess.removeListener = noop;\n\tprocess.removeAllListeners = noop;\n\tprocess.emit = noop;\n\tprocess.prependListener = noop;\n\tprocess.prependOnceListener = noop;\n\t\n\tprocess.listeners = function (name) { return [] }\n\t\n\tprocess.binding = function (name) {\n\t    throw new Error('process.binding is not supported');\n\t};\n\t\n\tprocess.cwd = function () { return '/' };\n\tprocess.chdir = function (dir) {\n\t    throw new Error('process.chdir is not supported');\n\t};\n\tprocess.umask = function() { return 0; };\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t\n\t/**\n\t * This is the common logic for both the Node.js and web browser\n\t * implementations of `debug()`.\n\t *\n\t * Expose `debug()` as the module.\n\t */\n\t\n\texports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\n\texports.coerce = coerce;\n\texports.disable = disable;\n\texports.enable = enable;\n\texports.enabled = enabled;\n\texports.humanize = __webpack_require__(6);\n\t\n\t/**\n\t * The currently active debug mode names, and names to skip.\n\t */\n\t\n\texports.names = [];\n\texports.skips = [];\n\t\n\t/**\n\t * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t *\n\t * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t */\n\t\n\texports.formatters = {};\n\t\n\t/**\n\t * Previous log timestamp.\n\t */\n\t\n\tvar prevTime;\n\t\n\t/**\n\t * Select a color.\n\t * @param {String} namespace\n\t * @return {Number}\n\t * @api private\n\t */\n\t\n\tfunction selectColor(namespace) {\n\t  var hash = 0, i;\n\t\n\t  for (i in namespace) {\n\t    hash  = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t    hash |= 0; // Convert to 32bit integer\n\t  }\n\t\n\t  return exports.colors[Math.abs(hash) % exports.colors.length];\n\t}\n\t\n\t/**\n\t * Create a debugger with the given `namespace`.\n\t *\n\t * @param {String} namespace\n\t * @return {Function}\n\t * @api public\n\t */\n\t\n\tfunction createDebug(namespace) {\n\t\n\t  function debug() {\n\t    // disabled?\n\t    if (!debug.enabled) return;\n\t\n\t    var self = debug;\n\t\n\t    // set `diff` timestamp\n\t    var curr = +new Date();\n\t    var ms = curr - (prevTime || curr);\n\t    self.diff = ms;\n\t    self.prev = prevTime;\n\t    self.curr = curr;\n\t    prevTime = curr;\n\t\n\t    // turn the `arguments` into a proper Array\n\t    var args = new Array(arguments.length);\n\t    for (var i = 0; i < args.length; i++) {\n\t      args[i] = arguments[i];\n\t    }\n\t\n\t    args[0] = exports.coerce(args[0]);\n\t\n\t    if ('string' !== typeof args[0]) {\n\t      // anything else let's inspect with %O\n\t      args.unshift('%O');\n\t    }\n\t\n\t    // apply any `formatters` transformations\n\t    var index = 0;\n\t    args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n\t      // if we encounter an escaped % then don't increase the array index\n\t      if (match === '%%') return match;\n\t      index++;\n\t      var formatter = exports.formatters[format];\n\t      if ('function' === typeof formatter) {\n\t        var val = args[index];\n\t        match = formatter.call(self, val);\n\t\n\t        // now we need to remove `args[index]` since it's inlined in the `format`\n\t        args.splice(index, 1);\n\t        index--;\n\t      }\n\t      return match;\n\t    });\n\t\n\t    // apply env-specific formatting (colors, etc.)\n\t    exports.formatArgs.call(self, args);\n\t\n\t    var logFn = debug.log || exports.log || console.log.bind(console);\n\t    logFn.apply(self, args);\n\t  }\n\t\n\t  debug.namespace = namespace;\n\t  debug.enabled = exports.enabled(namespace);\n\t  debug.useColors = exports.useColors();\n\t  debug.color = selectColor(namespace);\n\t\n\t  // env-specific initialization logic for debug instances\n\t  if ('function' === typeof exports.init) {\n\t    exports.init(debug);\n\t  }\n\t\n\t  return debug;\n\t}\n\t\n\t/**\n\t * Enables a debug mode by namespaces. This can include modes\n\t * separated by a colon and wildcards.\n\t *\n\t * @param {String} namespaces\n\t * @api public\n\t */\n\t\n\tfunction enable(namespaces) {\n\t  exports.save(namespaces);\n\t\n\t  exports.names = [];\n\t  exports.skips = [];\n\t\n\t  var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t  var len = split.length;\n\t\n\t  for (var i = 0; i < len; i++) {\n\t    if (!split[i]) continue; // ignore empty strings\n\t    namespaces = split[i].replace(/\\*/g, '.*?');\n\t    if (namespaces[0] === '-') {\n\t      exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n\t    } else {\n\t      exports.names.push(new RegExp('^' + namespaces + '$'));\n\t    }\n\t  }\n\t}\n\t\n\t/**\n\t * Disable debug output.\n\t *\n\t * @api public\n\t */\n\t\n\tfunction disable() {\n\t  exports.enable('');\n\t}\n\t\n\t/**\n\t * Returns true if the given mode name is enabled, false otherwise.\n\t *\n\t * @param {String} name\n\t * @return {Boolean}\n\t * @api public\n\t */\n\t\n\tfunction enabled(name) {\n\t  var i, len;\n\t  for (i = 0, len = exports.skips.length; i < len; i++) {\n\t    if (exports.skips[i].test(name)) {\n\t      return false;\n\t    }\n\t  }\n\t  for (i = 0, len = exports.names.length; i < len; i++) {\n\t    if (exports.names[i].test(name)) {\n\t      return true;\n\t    }\n\t  }\n\t  return false;\n\t}\n\t\n\t/**\n\t * Coerce `val`.\n\t *\n\t * @param {Mixed} val\n\t * @return {Mixed}\n\t * @api private\n\t */\n\t\n\tfunction coerce(val) {\n\t  if (val instanceof Error) return val.stack || val.message;\n\t  return val;\n\t}\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports) {\n\n\t/**\n\t * Helpers.\n\t */\n\t\n\tvar s = 1000;\n\tvar m = s * 60;\n\tvar h = m * 60;\n\tvar d = h * 24;\n\tvar y = d * 365.25;\n\t\n\t/**\n\t * Parse or format the given `val`.\n\t *\n\t * Options:\n\t *\n\t *  - `long` verbose formatting [false]\n\t *\n\t * @param {String|Number} val\n\t * @param {Object} [options]\n\t * @throws {Error} throw an error if val is not a non-empty string or a number\n\t * @return {String|Number}\n\t * @api public\n\t */\n\t\n\tmodule.exports = function(val, options) {\n\t  options = options || {};\n\t  var type = typeof val;\n\t  if (type === 'string' && val.length > 0) {\n\t    return parse(val);\n\t  } else if (type === 'number' && isNaN(val) === false) {\n\t    return options.long ? fmtLong(val) : fmtShort(val);\n\t  }\n\t  throw new Error(\n\t    'val is not a non-empty string or a valid number. val=' +\n\t      JSON.stringify(val)\n\t  );\n\t};\n\t\n\t/**\n\t * Parse the given `str` and return milliseconds.\n\t *\n\t * @param {String} str\n\t * @return {Number}\n\t * @api private\n\t */\n\t\n\tfunction parse(str) {\n\t  str = String(str);\n\t  if (str.length > 100) {\n\t    return;\n\t  }\n\t  var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n\t    str\n\t  );\n\t  if (!match) {\n\t    return;\n\t  }\n\t  var n = parseFloat(match[1]);\n\t  var type = (match[2] || 'ms').toLowerCase();\n\t  switch (type) {\n\t    case 'years':\n\t    case 'year':\n\t    case 'yrs':\n\t    case 'yr':\n\t    case 'y':\n\t      return n * y;\n\t    case 'days':\n\t    case 'day':\n\t    case 'd':\n\t      return n * d;\n\t    case 'hours':\n\t    case 'hour':\n\t    case 'hrs':\n\t    case 'hr':\n\t    case 'h':\n\t      return n * h;\n\t    case 'minutes':\n\t    case 'minute':\n\t    case 'mins':\n\t    case 'min':\n\t    case 'm':\n\t      return n * m;\n\t    case 'seconds':\n\t    case 'second':\n\t    case 'secs':\n\t    case 'sec':\n\t    case 's':\n\t      return n * s;\n\t    case 'milliseconds':\n\t    case 'millisecond':\n\t    case 'msecs':\n\t    case 'msec':\n\t    case 'ms':\n\t      return n;\n\t    default:\n\t      return undefined;\n\t  }\n\t}\n\t\n\t/**\n\t * Short format for `ms`.\n\t *\n\t * @param {Number} ms\n\t * @return {String}\n\t * @api private\n\t */\n\t\n\tfunction fmtShort(ms) {\n\t  if (ms >= d) {\n\t    return Math.round(ms / d) + 'd';\n\t  }\n\t  if (ms >= h) {\n\t    return Math.round(ms / h) + 'h';\n\t  }\n\t  if (ms >= m) {\n\t    return Math.round(ms / m) + 'm';\n\t  }\n\t  if (ms >= s) {\n\t    return Math.round(ms / s) + 's';\n\t  }\n\t  return ms + 'ms';\n\t}\n\t\n\t/**\n\t * Long format for `ms`.\n\t *\n\t * @param {Number} ms\n\t * @return {String}\n\t * @api private\n\t */\n\t\n\tfunction fmtLong(ms) {\n\t  return plural(ms, d, 'day') ||\n\t    plural(ms, h, 'hour') ||\n\t    plural(ms, m, 'minute') ||\n\t    plural(ms, s, 'second') ||\n\t    ms + ' ms';\n\t}\n\t\n\t/**\n\t * Pluralization helper.\n\t */\n\t\n\tfunction plural(ms, n, name) {\n\t  if (ms < n) {\n\t    return;\n\t  }\n\t  if (ms < n * 1.5) {\n\t    return Math.floor(ms / n) + ' ' + name;\n\t  }\n\t  return Math.ceil(ms / n) + ' ' + name + 's';\n\t}\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t\n\t/**\n\t * Module dependencies.\n\t */\n\t\n\tvar debug = __webpack_require__(3)('socket.io-parser');\n\tvar Emitter = __webpack_require__(8);\n\tvar hasBin = __webpack_require__(9);\n\tvar binary = __webpack_require__(11);\n\tvar isBuf = __webpack_require__(12);\n\t\n\t/**\n\t * Protocol version.\n\t *\n\t * @api public\n\t */\n\t\n\texports.protocol = 4;\n\t\n\t/**\n\t * Packet types.\n\t *\n\t * @api public\n\t */\n\t\n\texports.types = [\n\t  'CONNECT',\n\t  'DISCONNECT',\n\t  'EVENT',\n\t  'ACK',\n\t  'ERROR',\n\t  'BINARY_EVENT',\n\t  'BINARY_ACK'\n\t];\n\t\n\t/**\n\t * Packet type `connect`.\n\t *\n\t * @api public\n\t */\n\t\n\texports.CONNECT = 0;\n\t\n\t/**\n\t * Packet type `disconnect`.\n\t *\n\t * @api public\n\t */\n\t\n\texports.DISCONNECT = 1;\n\t\n\t/**\n\t * Packet type `event`.\n\t *\n\t * @api public\n\t */\n\t\n\texports.EVENT = 2;\n\t\n\t/**\n\t * Packet type `ack`.\n\t *\n\t * @api public\n\t */\n\t\n\texports.ACK = 3;\n\t\n\t/**\n\t * Packet type `error`.\n\t *\n\t * @api public\n\t */\n\t\n\texports.ERROR = 4;\n\t\n\t/**\n\t * Packet type 'binary event'\n\t *\n\t * @api public\n\t */\n\t\n\texports.BINARY_EVENT = 5;\n\t\n\t/**\n\t * Packet type `binary ack`. For acks with binary arguments.\n\t *\n\t * @api public\n\t */\n\t\n\texports.BINARY_ACK = 6;\n\t\n\t/**\n\t * Encoder constructor.\n\t *\n\t * @api public\n\t */\n\t\n\texports.Encoder = Encoder;\n\t\n\t/**\n\t * Decoder constructor.\n\t *\n\t * @api public\n\t */\n\t\n\texports.Decoder = Decoder;\n\t\n\t/**\n\t * A socket.io Encoder instance\n\t *\n\t * @api public\n\t */\n\t\n\tfunction Encoder() {}\n\t\n\t/**\n\t * Encode a packet as a single string if non-binary, or as a\n\t * buffer sequence, depending on packet type.\n\t *\n\t * @param {Object} obj - packet object\n\t * @param {Function} callback - function to handle encodings (likely engine.write)\n\t * @return Calls callback with Array of encodings\n\t * @api public\n\t */\n\t\n\tEncoder.prototype.encode = function(obj, callback){\n\t  if ((obj.type === exports.EVENT || obj.type === exports.ACK) && hasBin(obj.data)) {\n\t    obj.type = obj.type === exports.EVENT ? exports.BINARY_EVENT : exports.BINARY_ACK;\n\t  }\n\t\n\t  debug('encoding packet %j', obj);\n\t\n\t  if (exports.BINARY_EVENT === obj.type || exports.BINARY_ACK === obj.type) {\n\t    encodeAsBinary(obj, callback);\n\t  }\n\t  else {\n\t    var encoding = encodeAsString(obj);\n\t    callback([encoding]);\n\t  }\n\t};\n\t\n\t/**\n\t * Encode packet as string.\n\t *\n\t * @param {Object} packet\n\t * @return {String} encoded\n\t * @api private\n\t */\n\t\n\tfunction encodeAsString(obj) {\n\t\n\t  // first is type\n\t  var str = '' + obj.type;\n\t\n\t  // attachments if we have them\n\t  if (exports.BINARY_EVENT === obj.type || exports.BINARY_ACK === obj.type) {\n\t    str += obj.attachments + '-';\n\t  }\n\t\n\t  // if we have a namespace other than `/`\n\t  // we append it followed by a comma `,`\n\t  if (obj.nsp && '/' !== obj.nsp) {\n\t    str += obj.nsp + ',';\n\t  }\n\t\n\t  // immediately followed by the id\n\t  if (null != obj.id) {\n\t    str += obj.id;\n\t  }\n\t\n\t  // json data\n\t  if (null != obj.data) {\n\t    str += JSON.stringify(obj.data);\n\t  }\n\t\n\t  debug('encoded %j as %s', obj, str);\n\t  return str;\n\t}\n\t\n\t/**\n\t * Encode packet as 'buffer sequence' by removing blobs, and\n\t * deconstructing packet into object with placeholders and\n\t * a list of buffers.\n\t *\n\t * @param {Object} packet\n\t * @return {Buffer} encoded\n\t * @api private\n\t */\n\t\n\tfunction encodeAsBinary(obj, callback) {\n\t\n\t  function writeEncoding(bloblessData) {\n\t    var deconstruction = binary.deconstructPacket(bloblessData);\n\t    var pack = encodeAsString(deconstruction.packet);\n\t    var buffers = deconstruction.buffers;\n\t\n\t    buffers.unshift(pack); // add packet info to beginning of data list\n\t    callback(buffers); // write all the buffers\n\t  }\n\t\n\t  binary.removeBlobs(obj, writeEncoding);\n\t}\n\t\n\t/**\n\t * A socket.io Decoder instance\n\t *\n\t * @return {Object} decoder\n\t * @api public\n\t */\n\t\n\tfunction Decoder() {\n\t  this.reconstructor = null;\n\t}\n\t\n\t/**\n\t * Mix in `Emitter` with Decoder.\n\t */\n\t\n\tEmitter(Decoder.prototype);\n\t\n\t/**\n\t * Decodes an ecoded packet string into packet JSON.\n\t *\n\t * @param {String} obj - encoded packet\n\t * @return {Object} packet\n\t * @api public\n\t */\n\t\n\tDecoder.prototype.add = function(obj) {\n\t  var packet;\n\t  if (typeof obj === 'string') {\n\t    packet = decodeString(obj);\n\t    if (exports.BINARY_EVENT === packet.type || exports.BINARY_ACK === packet.type) { // binary packet's json\n\t      this.reconstructor = new BinaryReconstructor(packet);\n\t\n\t      // no attachments, labeled binary but no binary data to follow\n\t      if (this.reconstructor.reconPack.attachments === 0) {\n\t        this.emit('decoded', packet);\n\t      }\n\t    } else { // non-binary full packet\n\t      this.emit('decoded', packet);\n\t    }\n\t  }\n\t  else if (isBuf(obj) || obj.base64) { // raw binary data\n\t    if (!this.reconstructor) {\n\t      throw new Error('got binary data when not reconstructing a packet');\n\t    } else {\n\t      packet = this.reconstructor.takeBinaryData(obj);\n\t      if (packet) { // received final buffer\n\t        this.reconstructor = null;\n\t        this.emit('decoded', packet);\n\t      }\n\t    }\n\t  }\n\t  else {\n\t    throw new Error('Unknown type: ' + obj);\n\t  }\n\t};\n\t\n\t/**\n\t * Decode a packet String (JSON data)\n\t *\n\t * @param {String} str\n\t * @return {Object} packet\n\t * @api private\n\t */\n\t\n\tfunction decodeString(str) {\n\t  var i = 0;\n\t  // look up type\n\t  var p = {\n\t    type: Number(str.charAt(0))\n\t  };\n\t\n\t  if (null == exports.types[p.type]) return error();\n\t\n\t  // look up attachments if type binary\n\t  if (exports.BINARY_EVENT === p.type || exports.BINARY_ACK === p.type) {\n\t    var buf = '';\n\t    while (str.charAt(++i) !== '-') {\n\t      buf += str.charAt(i);\n\t      if (i == str.length) break;\n\t    }\n\t    if (buf != Number(buf) || str.charAt(i) !== '-') {\n\t      throw new Error('Illegal attachments');\n\t    }\n\t    p.attachments = Number(buf);\n\t  }\n\t\n\t  // look up namespace (if any)\n\t  if ('/' === str.charAt(i + 1)) {\n\t    p.nsp = '';\n\t    while (++i) {\n\t      var c = str.charAt(i);\n\t      if (',' === c) break;\n\t      p.nsp += c;\n\t      if (i === str.length) break;\n\t    }\n\t  } else {\n\t    p.nsp = '/';\n\t  }\n\t\n\t  // look up id\n\t  var next = str.charAt(i + 1);\n\t  if ('' !== next && Number(next) == next) {\n\t    p.id = '';\n\t    while (++i) {\n\t      var c = str.charAt(i);\n\t      if (null == c || Number(c) != c) {\n\t        --i;\n\t        break;\n\t      }\n\t      p.id += str.charAt(i);\n\t      if (i === str.length) break;\n\t    }\n\t    p.id = Number(p.id);\n\t  }\n\t\n\t  // look up json data\n\t  if (str.charAt(++i)) {\n\t    p = tryParse(p, str.substr(i));\n\t  }\n\t\n\t  debug('decoded %s as %j', str, p);\n\t  return p;\n\t}\n\t\n\tfunction tryParse(p, str) {\n\t  try {\n\t    p.data = JSON.parse(str);\n\t  } catch(e){\n\t    return error();\n\t  }\n\t  return p; \n\t}\n\t\n\t/**\n\t * Deallocates a parser's resources\n\t *\n\t * @api public\n\t */\n\t\n\tDecoder.prototype.destroy = function() {\n\t  if (this.reconstructor) {\n\t    this.reconstructor.finishedReconstruction();\n\t  }\n\t};\n\t\n\t/**\n\t * A manager of a binary event's 'buffer sequence'. Should\n\t * be constructed whenever a packet of type BINARY_EVENT is\n\t * decoded.\n\t *\n\t * @param {Object} packet\n\t * @return {BinaryReconstructor} initialized reconstructor\n\t * @api private\n\t */\n\t\n\tfunction BinaryReconstructor(packet) {\n\t  this.reconPack = packet;\n\t  this.buffers = [];\n\t}\n\t\n\t/**\n\t * Method to be called when binary data received from connection\n\t * after a BINARY_EVENT packet.\n\t *\n\t * @param {Buffer | ArrayBuffer} binData - the raw binary data received\n\t * @return {null | Object} returns null if more binary data is expected or\n\t *   a reconstructed packet object if all buffers have been received.\n\t * @api private\n\t */\n\t\n\tBinaryReconstructor.prototype.takeBinaryData = function(binData) {\n\t  this.buffers.push(binData);\n\t  if (this.buffers.length === this.reconPack.attachments) { // done with buffer list\n\t    var packet = binary.reconstructPacket(this.reconPack, this.buffers);\n\t    this.finishedReconstruction();\n\t    return packet;\n\t  }\n\t  return null;\n\t};\n\t\n\t/**\n\t * Cleans up binary packet reconstruction variables.\n\t *\n\t * @api private\n\t */\n\t\n\tBinaryReconstructor.prototype.finishedReconstruction = function() {\n\t  this.reconPack = null;\n\t  this.buffers = [];\n\t};\n\t\n\tfunction error() {\n\t  return {\n\t    type: exports.ERROR,\n\t    data: 'parser error'\n\t  };\n\t}\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t\r\n\t/**\r\n\t * Expose `Emitter`.\r\n\t */\r\n\t\r\n\tif (true) {\r\n\t  module.exports = Emitter;\r\n\t}\r\n\t\r\n\t/**\r\n\t * Initialize a new `Emitter`.\r\n\t *\r\n\t * @api public\r\n\t */\r\n\t\r\n\tfunction Emitter(obj) {\r\n\t  if (obj) return mixin(obj);\r\n\t};\r\n\t\r\n\t/**\r\n\t * Mixin the emitter properties.\r\n\t *\r\n\t * @param {Object} obj\r\n\t * @return {Object}\r\n\t * @api private\r\n\t */\r\n\t\r\n\tfunction mixin(obj) {\r\n\t  for (var key in Emitter.prototype) {\r\n\t    obj[key] = Emitter.prototype[key];\r\n\t  }\r\n\t  return obj;\r\n\t}\r\n\t\r\n\t/**\r\n\t * Listen on the given `event` with `fn`.\r\n\t *\r\n\t * @param {String} event\r\n\t * @param {Function} fn\r\n\t * @return {Emitter}\r\n\t * @api public\r\n\t */\r\n\t\r\n\tEmitter.prototype.on =\r\n\tEmitter.prototype.addEventListener = function(event, fn){\r\n\t  this._callbacks = this._callbacks || {};\r\n\t  (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\r\n\t    .push(fn);\r\n\t  return this;\r\n\t};\r\n\t\r\n\t/**\r\n\t * Adds an `event` listener that will be invoked a single\r\n\t * time then automatically removed.\r\n\t *\r\n\t * @param {String} event\r\n\t * @param {Function} fn\r\n\t * @return {Emitter}\r\n\t * @api public\r\n\t */\r\n\t\r\n\tEmitter.prototype.once = function(event, fn){\r\n\t  function on() {\r\n\t    this.off(event, on);\r\n\t    fn.apply(this, arguments);\r\n\t  }\r\n\t\r\n\t  on.fn = fn;\r\n\t  this.on(event, on);\r\n\t  return this;\r\n\t};\r\n\t\r\n\t/**\r\n\t * Remove the given callback for `event` or all\r\n\t * registered callbacks.\r\n\t *\r\n\t * @param {String} event\r\n\t * @param {Function} fn\r\n\t * @return {Emitter}\r\n\t * @api public\r\n\t */\r\n\t\r\n\tEmitter.prototype.off =\r\n\tEmitter.prototype.removeListener =\r\n\tEmitter.prototype.removeAllListeners =\r\n\tEmitter.prototype.removeEventListener = function(event, fn){\r\n\t  this._callbacks = this._callbacks || {};\r\n\t\r\n\t  // all\r\n\t  if (0 == arguments.length) {\r\n\t    this._callbacks = {};\r\n\t    return this;\r\n\t  }\r\n\t\r\n\t  // specific event\r\n\t  var callbacks = this._callbacks['$' + event];\r\n\t  if (!callbacks) return this;\r\n\t\r\n\t  // remove all handlers\r\n\t  if (1 == arguments.length) {\r\n\t    delete this._callbacks['$' + event];\r\n\t    return this;\r\n\t  }\r\n\t\r\n\t  // remove specific handler\r\n\t  var cb;\r\n\t  for (var i = 0; i < callbacks.length; i++) {\r\n\t    cb = callbacks[i];\r\n\t    if (cb === fn || cb.fn === fn) {\r\n\t      callbacks.splice(i, 1);\r\n\t      break;\r\n\t    }\r\n\t  }\r\n\t  return this;\r\n\t};\r\n\t\r\n\t/**\r\n\t * Emit `event` with the given args.\r\n\t *\r\n\t * @param {String} event\r\n\t * @param {Mixed} ...\r\n\t * @return {Emitter}\r\n\t */\r\n\t\r\n\tEmitter.prototype.emit = function(event){\r\n\t  this._callbacks = this._callbacks || {};\r\n\t  var args = [].slice.call(arguments, 1)\r\n\t    , callbacks = this._callbacks['$' + event];\r\n\t\r\n\t  if (callbacks) {\r\n\t    callbacks = callbacks.slice(0);\r\n\t    for (var i = 0, len = callbacks.length; i < len; ++i) {\r\n\t      callbacks[i].apply(this, args);\r\n\t    }\r\n\t  }\r\n\t\r\n\t  return this;\r\n\t};\r\n\t\r\n\t/**\r\n\t * Return array of callbacks for `event`.\r\n\t *\r\n\t * @param {String} event\r\n\t * @return {Array}\r\n\t * @api public\r\n\t */\r\n\t\r\n\tEmitter.prototype.listeners = function(event){\r\n\t  this._callbacks = this._callbacks || {};\r\n\t  return this._callbacks['$' + event] || [];\r\n\t};\r\n\t\r\n\t/**\r\n\t * Check if this emitter has `event` handlers.\r\n\t *\r\n\t * @param {String} event\r\n\t * @return {Boolean}\r\n\t * @api public\r\n\t */\r\n\t\r\n\tEmitter.prototype.hasListeners = function(event){\r\n\t  return !! this.listeners(event).length;\r\n\t};\r\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/* global Blob File */\n\t\n\t/*\n\t * Module requirements.\n\t */\n\t\n\tvar isArray = __webpack_require__(10);\n\t\n\tvar toString = Object.prototype.toString;\n\tvar withNativeBlob = typeof global.Blob === 'function' || toString.call(global.Blob) === '[object BlobConstructor]';\n\tvar withNativeFile = typeof global.File === 'function' || toString.call(global.File) === '[object FileConstructor]';\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = hasBinary;\n\t\n\t/**\n\t * Checks for binary data.\n\t *\n\t * Supports Buffer, ArrayBuffer, Blob and File.\n\t *\n\t * @param {Object} anything\n\t * @api public\n\t */\n\t\n\tfunction hasBinary (obj) {\n\t  if (!obj || typeof obj !== 'object') {\n\t    return false;\n\t  }\n\t\n\t  if (isArray(obj)) {\n\t    for (var i = 0, l = obj.length; i < l; i++) {\n\t      if (hasBinary(obj[i])) {\n\t        return true;\n\t      }\n\t    }\n\t    return false;\n\t  }\n\t\n\t  if ((typeof global.Buffer === 'function' && global.Buffer.isBuffer && global.Buffer.isBuffer(obj)) ||\n\t     (typeof global.ArrayBuffer === 'function' && obj instanceof ArrayBuffer) ||\n\t     (withNativeBlob && obj instanceof Blob) ||\n\t     (withNativeFile && obj instanceof File)\n\t    ) {\n\t    return true;\n\t  }\n\t\n\t  // see: https://github.com/Automattic/has-binary/pull/4\n\t  if (obj.toJSON && typeof obj.toJSON === 'function' && arguments.length === 1) {\n\t    return hasBinary(obj.toJSON(), true);\n\t  }\n\t\n\t  for (var key in obj) {\n\t    if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) {\n\t      return true;\n\t    }\n\t  }\n\t\n\t  return false;\n\t}\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports) {\n\n\tvar toString = {}.toString;\n\t\n\tmodule.exports = Array.isArray || function (arr) {\n\t  return toString.call(arr) == '[object Array]';\n\t};\n\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/*global Blob,File*/\n\t\n\t/**\n\t * Module requirements\n\t */\n\t\n\tvar isArray = __webpack_require__(10);\n\tvar isBuf = __webpack_require__(12);\n\tvar toString = Object.prototype.toString;\n\tvar withNativeBlob = typeof global.Blob === 'function' || toString.call(global.Blob) === '[object BlobConstructor]';\n\tvar withNativeFile = typeof global.File === 'function' || toString.call(global.File) === '[object FileConstructor]';\n\t\n\t/**\n\t * Replaces every Buffer | ArrayBuffer in packet with a numbered placeholder.\n\t * Anything with blobs or files should be fed through removeBlobs before coming\n\t * here.\n\t *\n\t * @param {Object} packet - socket.io event packet\n\t * @return {Object} with deconstructed packet and list of buffers\n\t * @api public\n\t */\n\t\n\texports.deconstructPacket = function(packet) {\n\t  var buffers = [];\n\t  var packetData = packet.data;\n\t  var pack = packet;\n\t  pack.data = _deconstructPacket(packetData, buffers);\n\t  pack.attachments = buffers.length; // number of binary 'attachments'\n\t  return {packet: pack, buffers: buffers};\n\t};\n\t\n\tfunction _deconstructPacket(data, buffers) {\n\t  if (!data) return data;\n\t\n\t  if (isBuf(data)) {\n\t    var placeholder = { _placeholder: true, num: buffers.length };\n\t    buffers.push(data);\n\t    return placeholder;\n\t  } else if (isArray(data)) {\n\t    var newData = new Array(data.length);\n\t    for (var i = 0; i < data.length; i++) {\n\t      newData[i] = _deconstructPacket(data[i], buffers);\n\t    }\n\t    return newData;\n\t  } else if (typeof data === 'object' && !(data instanceof Date)) {\n\t    var newData = {};\n\t    for (var key in data) {\n\t      newData[key] = _deconstructPacket(data[key], buffers);\n\t    }\n\t    return newData;\n\t  }\n\t  return data;\n\t}\n\t\n\t/**\n\t * Reconstructs a binary packet from its placeholder packet and buffers\n\t *\n\t * @param {Object} packet - event packet with placeholders\n\t * @param {Array} buffers - binary buffers to put in placeholder positions\n\t * @return {Object} reconstructed packet\n\t * @api public\n\t */\n\t\n\texports.reconstructPacket = function(packet, buffers) {\n\t  packet.data = _reconstructPacket(packet.data, buffers);\n\t  packet.attachments = undefined; // no longer useful\n\t  return packet;\n\t};\n\t\n\tfunction _reconstructPacket(data, buffers) {\n\t  if (!data) return data;\n\t\n\t  if (data && data._placeholder) {\n\t    return buffers[data.num]; // appropriate buffer (should be natural order anyway)\n\t  } else if (isArray(data)) {\n\t    for (var i = 0; i < data.length; i++) {\n\t      data[i] = _reconstructPacket(data[i], buffers);\n\t    }\n\t  } else if (typeof data === 'object') {\n\t    for (var key in data) {\n\t      data[key] = _reconstructPacket(data[key], buffers);\n\t    }\n\t  }\n\t\n\t  return data;\n\t}\n\t\n\t/**\n\t * Asynchronously removes Blobs or Files from data via\n\t * FileReader's readAsArrayBuffer method. Used before encoding\n\t * data as msgpack. Calls callback with the blobless data.\n\t *\n\t * @param {Object} data\n\t * @param {Function} callback\n\t * @api private\n\t */\n\t\n\texports.removeBlobs = function(data, callback) {\n\t  function _removeBlobs(obj, curKey, containingObject) {\n\t    if (!obj) return obj;\n\t\n\t    // convert any blob\n\t    if ((withNativeBlob && obj instanceof Blob) ||\n\t        (withNativeFile && obj instanceof File)) {\n\t      pendingBlobs++;\n\t\n\t      // async filereader\n\t      var fileReader = new FileReader();\n\t      fileReader.onload = function() { // this.result == arraybuffer\n\t        if (containingObject) {\n\t          containingObject[curKey] = this.result;\n\t        }\n\t        else {\n\t          bloblessData = this.result;\n\t        }\n\t\n\t        // if nothing pending its callback time\n\t        if(! --pendingBlobs) {\n\t          callback(bloblessData);\n\t        }\n\t      };\n\t\n\t      fileReader.readAsArrayBuffer(obj); // blob -> arraybuffer\n\t    } else if (isArray(obj)) { // handle array\n\t      for (var i = 0; i < obj.length; i++) {\n\t        _removeBlobs(obj[i], i, obj);\n\t      }\n\t    } else if (typeof obj === 'object' && !isBuf(obj)) { // and object\n\t      for (var key in obj) {\n\t        _removeBlobs(obj[key], key, obj);\n\t      }\n\t    }\n\t  }\n\t\n\t  var pendingBlobs = 0;\n\t  var bloblessData = data;\n\t  _removeBlobs(bloblessData);\n\t  if (!pendingBlobs) {\n\t    callback(bloblessData);\n\t  }\n\t};\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {\n\tmodule.exports = isBuf;\n\t\n\t/**\n\t * Returns true if obj is a buffer or an arraybuffer.\n\t *\n\t * @api private\n\t */\n\t\n\tfunction isBuf(obj) {\n\t  return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t         (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\t\n\t/**\n\t * Module dependencies.\n\t */\n\t\n\tvar eio = __webpack_require__(14);\n\tvar Socket = __webpack_require__(39);\n\tvar Emitter = __webpack_require__(8);\n\tvar parser = __webpack_require__(7);\n\tvar on = __webpack_require__(41);\n\tvar bind = __webpack_require__(42);\n\tvar debug = __webpack_require__(3)('socket.io-client:manager');\n\tvar indexOf = __webpack_require__(37);\n\tvar Backoff = __webpack_require__(43);\n\t\n\t/**\n\t * IE6+ hasOwnProperty\n\t */\n\t\n\tvar has = Object.prototype.hasOwnProperty;\n\t\n\t/**\n\t * Module exports\n\t */\n\t\n\tmodule.exports = Manager;\n\t\n\t/**\n\t * `Manager` constructor.\n\t *\n\t * @param {String} engine instance or engine uri/opts\n\t * @param {Object} options\n\t * @api public\n\t */\n\t\n\tfunction Manager(uri, opts) {\n\t  if (!(this instanceof Manager)) return new Manager(uri, opts);\n\t  if (uri && 'object' === (typeof uri === 'undefined' ? 'undefined' : _typeof(uri))) {\n\t    opts = uri;\n\t    uri = undefined;\n\t  }\n\t  opts = opts || {};\n\t\n\t  opts.path = opts.path || '/socket.io';\n\t  this.nsps = {};\n\t  this.subs = [];\n\t  this.opts = opts;\n\t  this.reconnection(opts.reconnection !== false);\n\t  this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);\n\t  this.reconnectionDelay(opts.reconnectionDelay || 1000);\n\t  this.reconnectionDelayMax(opts.reconnectionDelayMax || 5000);\n\t  this.randomizationFactor(opts.randomizationFactor || 0.5);\n\t  this.backoff = new Backoff({\n\t    min: this.reconnectionDelay(),\n\t    max: this.reconnectionDelayMax(),\n\t    jitter: this.randomizationFactor()\n\t  });\n\t  this.timeout(null == opts.timeout ? 20000 : opts.timeout);\n\t  this.readyState = 'closed';\n\t  this.uri = uri;\n\t  this.connecting = [];\n\t  this.lastPing = null;\n\t  this.encoding = false;\n\t  this.packetBuffer = [];\n\t  var _parser = opts.parser || parser;\n\t  this.encoder = new _parser.Encoder();\n\t  this.decoder = new _parser.Decoder();\n\t  this.autoConnect = opts.autoConnect !== false;\n\t  if (this.autoConnect) this.open();\n\t}\n\t\n\t/**\n\t * Propagate given event to sockets and emit on `this`\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.emitAll = function () {\n\t  this.emit.apply(this, arguments);\n\t  for (var nsp in this.nsps) {\n\t    if (has.call(this.nsps, nsp)) {\n\t      this.nsps[nsp].emit.apply(this.nsps[nsp], arguments);\n\t    }\n\t  }\n\t};\n\t\n\t/**\n\t * Update `socket.id` of all sockets\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.updateSocketIds = function () {\n\t  for (var nsp in this.nsps) {\n\t    if (has.call(this.nsps, nsp)) {\n\t      this.nsps[nsp].id = this.generateId(nsp);\n\t    }\n\t  }\n\t};\n\t\n\t/**\n\t * generate `socket.id` for the given `nsp`\n\t *\n\t * @param {String} nsp\n\t * @return {String}\n\t * @api private\n\t */\n\t\n\tManager.prototype.generateId = function (nsp) {\n\t  return (nsp === '/' ? '' : nsp + '#') + this.engine.id;\n\t};\n\t\n\t/**\n\t * Mix in `Emitter`.\n\t */\n\t\n\tEmitter(Manager.prototype);\n\t\n\t/**\n\t * Sets the `reconnection` config.\n\t *\n\t * @param {Boolean} true/false if it should automatically reconnect\n\t * @return {Manager} self or value\n\t * @api public\n\t */\n\t\n\tManager.prototype.reconnection = function (v) {\n\t  if (!arguments.length) return this._reconnection;\n\t  this._reconnection = !!v;\n\t  return this;\n\t};\n\t\n\t/**\n\t * Sets the reconnection attempts config.\n\t *\n\t * @param {Number} max reconnection attempts before giving up\n\t * @return {Manager} self or value\n\t * @api public\n\t */\n\t\n\tManager.prototype.reconnectionAttempts = function (v) {\n\t  if (!arguments.length) return this._reconnectionAttempts;\n\t  this._reconnectionAttempts = v;\n\t  return this;\n\t};\n\t\n\t/**\n\t * Sets the delay between reconnections.\n\t *\n\t * @param {Number} delay\n\t * @return {Manager} self or value\n\t * @api public\n\t */\n\t\n\tManager.prototype.reconnectionDelay = function (v) {\n\t  if (!arguments.length) return this._reconnectionDelay;\n\t  this._reconnectionDelay = v;\n\t  this.backoff && this.backoff.setMin(v);\n\t  return this;\n\t};\n\t\n\tManager.prototype.randomizationFactor = function (v) {\n\t  if (!arguments.length) return this._randomizationFactor;\n\t  this._randomizationFactor = v;\n\t  this.backoff && this.backoff.setJitter(v);\n\t  return this;\n\t};\n\t\n\t/**\n\t * Sets the maximum delay between reconnections.\n\t *\n\t * @param {Number} delay\n\t * @return {Manager} self or value\n\t * @api public\n\t */\n\t\n\tManager.prototype.reconnectionDelayMax = function (v) {\n\t  if (!arguments.length) return this._reconnectionDelayMax;\n\t  this._reconnectionDelayMax = v;\n\t  this.backoff && this.backoff.setMax(v);\n\t  return this;\n\t};\n\t\n\t/**\n\t * Sets the connection timeout. `false` to disable\n\t *\n\t * @return {Manager} self or value\n\t * @api public\n\t */\n\t\n\tManager.prototype.timeout = function (v) {\n\t  if (!arguments.length) return this._timeout;\n\t  this._timeout = v;\n\t  return this;\n\t};\n\t\n\t/**\n\t * Starts trying to reconnect if reconnection is enabled and we have not\n\t * started reconnecting yet\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.maybeReconnectOnOpen = function () {\n\t  // Only try to reconnect if it's the first time we're connecting\n\t  if (!this.reconnecting && this._reconnection && this.backoff.attempts === 0) {\n\t    // keeps reconnection from firing twice for the same reconnection loop\n\t    this.reconnect();\n\t  }\n\t};\n\t\n\t/**\n\t * Sets the current transport `socket`.\n\t *\n\t * @param {Function} optional, callback\n\t * @return {Manager} self\n\t * @api public\n\t */\n\t\n\tManager.prototype.open = Manager.prototype.connect = function (fn, opts) {\n\t  debug('readyState %s', this.readyState);\n\t  if (~this.readyState.indexOf('open')) return this;\n\t\n\t  debug('opening %s', this.uri);\n\t  this.engine = eio(this.uri, this.opts);\n\t  var socket = this.engine;\n\t  var self = this;\n\t  this.readyState = 'opening';\n\t  this.skipReconnect = false;\n\t\n\t  // emit `open`\n\t  var openSub = on(socket, 'open', function () {\n\t    self.onopen();\n\t    fn && fn();\n\t  });\n\t\n\t  // emit `connect_error`\n\t  var errorSub = on(socket, 'error', function (data) {\n\t    debug('connect_error');\n\t    self.cleanup();\n\t    self.readyState = 'closed';\n\t    self.emitAll('connect_error', data);\n\t    if (fn) {\n\t      var err = new Error('Connection error');\n\t      err.data = data;\n\t      fn(err);\n\t    } else {\n\t      // Only do this if there is no fn to handle the error\n\t      self.maybeReconnectOnOpen();\n\t    }\n\t  });\n\t\n\t  // emit `connect_timeout`\n\t  if (false !== this._timeout) {\n\t    var timeout = this._timeout;\n\t    debug('connect attempt will timeout after %d', timeout);\n\t\n\t    // set timer\n\t    var timer = setTimeout(function () {\n\t      debug('connect attempt timed out after %d', timeout);\n\t      openSub.destroy();\n\t      socket.close();\n\t      socket.emit('error', 'timeout');\n\t      self.emitAll('connect_timeout', timeout);\n\t    }, timeout);\n\t\n\t    this.subs.push({\n\t      destroy: function destroy() {\n\t        clearTimeout(timer);\n\t      }\n\t    });\n\t  }\n\t\n\t  this.subs.push(openSub);\n\t  this.subs.push(errorSub);\n\t\n\t  return this;\n\t};\n\t\n\t/**\n\t * Called upon transport open.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.onopen = function () {\n\t  debug('open');\n\t\n\t  // clear old subs\n\t  this.cleanup();\n\t\n\t  // mark as open\n\t  this.readyState = 'open';\n\t  this.emit('open');\n\t\n\t  // add new subs\n\t  var socket = this.engine;\n\t  this.subs.push(on(socket, 'data', bind(this, 'ondata')));\n\t  this.subs.push(on(socket, 'ping', bind(this, 'onping')));\n\t  this.subs.push(on(socket, 'pong', bind(this, 'onpong')));\n\t  this.subs.push(on(socket, 'error', bind(this, 'onerror')));\n\t  this.subs.push(on(socket, 'close', bind(this, 'onclose')));\n\t  this.subs.push(on(this.decoder, 'decoded', bind(this, 'ondecoded')));\n\t};\n\t\n\t/**\n\t * Called upon a ping.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.onping = function () {\n\t  this.lastPing = new Date();\n\t  this.emitAll('ping');\n\t};\n\t\n\t/**\n\t * Called upon a packet.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.onpong = function () {\n\t  this.emitAll('pong', new Date() - this.lastPing);\n\t};\n\t\n\t/**\n\t * Called with data.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.ondata = function (data) {\n\t  this.decoder.add(data);\n\t};\n\t\n\t/**\n\t * Called when parser fully decodes a packet.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.ondecoded = function (packet) {\n\t  this.emit('packet', packet);\n\t};\n\t\n\t/**\n\t * Called upon socket error.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.onerror = function (err) {\n\t  debug('error', err);\n\t  this.emitAll('error', err);\n\t};\n\t\n\t/**\n\t * Creates a new socket for the given `nsp`.\n\t *\n\t * @return {Socket}\n\t * @api public\n\t */\n\t\n\tManager.prototype.socket = function (nsp, opts) {\n\t  var socket = this.nsps[nsp];\n\t  if (!socket) {\n\t    socket = new Socket(this, nsp, opts);\n\t    this.nsps[nsp] = socket;\n\t    var self = this;\n\t    socket.on('connecting', onConnecting);\n\t    socket.on('connect', function () {\n\t      socket.id = self.generateId(nsp);\n\t    });\n\t\n\t    if (this.autoConnect) {\n\t      // manually call here since connecting event is fired before listening\n\t      onConnecting();\n\t    }\n\t  }\n\t\n\t  function onConnecting() {\n\t    if (!~indexOf(self.connecting, socket)) {\n\t      self.connecting.push(socket);\n\t    }\n\t  }\n\t\n\t  return socket;\n\t};\n\t\n\t/**\n\t * Called upon a socket close.\n\t *\n\t * @param {Socket} socket\n\t */\n\t\n\tManager.prototype.destroy = function (socket) {\n\t  var index = indexOf(this.connecting, socket);\n\t  if (~index) this.connecting.splice(index, 1);\n\t  if (this.connecting.length) return;\n\t\n\t  this.close();\n\t};\n\t\n\t/**\n\t * Writes a packet.\n\t *\n\t * @param {Object} packet\n\t * @api private\n\t */\n\t\n\tManager.prototype.packet = function (packet) {\n\t  debug('writing packet %j', packet);\n\t  var self = this;\n\t  if (packet.query && packet.type === 0) packet.nsp += '?' + packet.query;\n\t\n\t  if (!self.encoding) {\n\t    // encode, then write to engine with result\n\t    self.encoding = true;\n\t    this.encoder.encode(packet, function (encodedPackets) {\n\t      for (var i = 0; i < encodedPackets.length; i++) {\n\t        self.engine.write(encodedPackets[i], packet.options);\n\t      }\n\t      self.encoding = false;\n\t      self.processPacketQueue();\n\t    });\n\t  } else {\n\t    // add packet to the queue\n\t    self.packetBuffer.push(packet);\n\t  }\n\t};\n\t\n\t/**\n\t * If packet buffer is non-empty, begins encoding the\n\t * next packet in line.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.processPacketQueue = function () {\n\t  if (this.packetBuffer.length > 0 && !this.encoding) {\n\t    var pack = this.packetBuffer.shift();\n\t    this.packet(pack);\n\t  }\n\t};\n\t\n\t/**\n\t * Clean up transport subscriptions and packet buffer.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.cleanup = function () {\n\t  debug('cleanup');\n\t\n\t  var subsLength = this.subs.length;\n\t  for (var i = 0; i < subsLength; i++) {\n\t    var sub = this.subs.shift();\n\t    sub.destroy();\n\t  }\n\t\n\t  this.packetBuffer = [];\n\t  this.encoding = false;\n\t  this.lastPing = null;\n\t\n\t  this.decoder.destroy();\n\t};\n\t\n\t/**\n\t * Close the current socket.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.close = Manager.prototype.disconnect = function () {\n\t  debug('disconnect');\n\t  this.skipReconnect = true;\n\t  this.reconnecting = false;\n\t  if ('opening' === this.readyState) {\n\t    // `onclose` will not fire because\n\t    // an open event never happened\n\t    this.cleanup();\n\t  }\n\t  this.backoff.reset();\n\t  this.readyState = 'closed';\n\t  if (this.engine) this.engine.close();\n\t};\n\t\n\t/**\n\t * Called upon engine close.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.onclose = function (reason) {\n\t  debug('onclose');\n\t\n\t  this.cleanup();\n\t  this.backoff.reset();\n\t  this.readyState = 'closed';\n\t  this.emit('close', reason);\n\t\n\t  if (this._reconnection && !this.skipReconnect) {\n\t    this.reconnect();\n\t  }\n\t};\n\t\n\t/**\n\t * Attempt a reconnection.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.reconnect = function () {\n\t  if (this.reconnecting || this.skipReconnect) return this;\n\t\n\t  var self = this;\n\t\n\t  if (this.backoff.attempts >= this._reconnectionAttempts) {\n\t    debug('reconnect failed');\n\t    this.backoff.reset();\n\t    this.emitAll('reconnect_failed');\n\t    this.reconnecting = false;\n\t  } else {\n\t    var delay = this.backoff.duration();\n\t    debug('will wait %dms before reconnect attempt', delay);\n\t\n\t    this.reconnecting = true;\n\t    var timer = setTimeout(function () {\n\t      if (self.skipReconnect) return;\n\t\n\t      debug('attempting reconnect');\n\t      self.emitAll('reconnect_attempt', self.backoff.attempts);\n\t      self.emitAll('reconnecting', self.backoff.attempts);\n\t\n\t      // check again for the case socket closed in above events\n\t      if (self.skipReconnect) return;\n\t\n\t      self.open(function (err) {\n\t        if (err) {\n\t          debug('reconnect attempt error');\n\t          self.reconnecting = false;\n\t          self.reconnect();\n\t          self.emitAll('reconnect_error', err.data);\n\t        } else {\n\t          debug('reconnect success');\n\t          self.onreconnect();\n\t        }\n\t      });\n\t    }, delay);\n\t\n\t    this.subs.push({\n\t      destroy: function destroy() {\n\t        clearTimeout(timer);\n\t      }\n\t    });\n\t  }\n\t};\n\t\n\t/**\n\t * Called upon successful reconnect.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.onreconnect = function () {\n\t  var attempt = this.backoff.attempts;\n\t  this.reconnecting = false;\n\t  this.backoff.reset();\n\t  this.updateSocketIds();\n\t  this.emitAll('reconnect', attempt);\n\t};\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t\n\tmodule.exports = __webpack_require__(15);\n\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t\n\tmodule.exports = __webpack_require__(16);\n\t\n\t/**\n\t * Exports parser\n\t *\n\t * @api public\n\t *\n\t */\n\tmodule.exports.parser = __webpack_require__(23);\n\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/**\n\t * Module dependencies.\n\t */\n\t\n\tvar transports = __webpack_require__(17);\n\tvar Emitter = __webpack_require__(8);\n\tvar debug = __webpack_require__(3)('engine.io-client:socket');\n\tvar index = __webpack_require__(37);\n\tvar parser = __webpack_require__(23);\n\tvar parseuri = __webpack_require__(2);\n\tvar parsejson = __webpack_require__(38);\n\tvar parseqs = __webpack_require__(31);\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = Socket;\n\t\n\t/**\n\t * Socket constructor.\n\t *\n\t * @param {String|Object} uri or options\n\t * @param {Object} options\n\t * @api public\n\t */\n\t\n\tfunction Socket (uri, opts) {\n\t  if (!(this instanceof Socket)) return new Socket(uri, opts);\n\t\n\t  opts = opts || {};\n\t\n\t  if (uri && 'object' === typeof uri) {\n\t    opts = uri;\n\t    uri = null;\n\t  }\n\t\n\t  if (uri) {\n\t    uri = parseuri(uri);\n\t    opts.hostname = uri.host;\n\t    opts.secure = uri.protocol === 'https' || uri.protocol === 'wss';\n\t    opts.port = uri.port;\n\t    if (uri.query) opts.query = uri.query;\n\t  } else if (opts.host) {\n\t    opts.hostname = parseuri(opts.host).host;\n\t  }\n\t\n\t  this.secure = null != opts.secure ? opts.secure\n\t    : (global.location && 'https:' === location.protocol);\n\t\n\t  if (opts.hostname && !opts.port) {\n\t    // if no port is specified manually, use the protocol default\n\t    opts.port = this.secure ? '443' : '80';\n\t  }\n\t\n\t  this.agent = opts.agent || false;\n\t  this.hostname = opts.hostname ||\n\t    (global.location ? location.hostname : 'localhost');\n\t  this.port = opts.port || (global.location && location.port\n\t      ? location.port\n\t      : (this.secure ? 443 : 80));\n\t  this.query = opts.query || {};\n\t  if ('string' === typeof this.query) this.query = parseqs.decode(this.query);\n\t  this.upgrade = false !== opts.upgrade;\n\t  this.path = (opts.path || '/engine.io').replace(/\\/$/, '') + '/';\n\t  this.forceJSONP = !!opts.forceJSONP;\n\t  this.jsonp = false !== opts.jsonp;\n\t  this.forceBase64 = !!opts.forceBase64;\n\t  this.enablesXDR = !!opts.enablesXDR;\n\t  this.timestampParam = opts.timestampParam || 't';\n\t  this.timestampRequests = opts.timestampRequests;\n\t  this.transports = opts.transports || ['polling', 'websocket'];\n\t  this.transportOptions = opts.transportOptions || {};\n\t  this.readyState = '';\n\t  this.writeBuffer = [];\n\t  this.prevBufferLen = 0;\n\t  this.policyPort = opts.policyPort || 843;\n\t  this.rememberUpgrade = opts.rememberUpgrade || false;\n\t  this.binaryType = null;\n\t  this.onlyBinaryUpgrades = opts.onlyBinaryUpgrades;\n\t  this.perMessageDeflate = false !== opts.perMessageDeflate ? (opts.perMessageDeflate || {}) : false;\n\t\n\t  if (true === this.perMessageDeflate) this.perMessageDeflate = {};\n\t  if (this.perMessageDeflate && null == this.perMessageDeflate.threshold) {\n\t    this.perMessageDeflate.threshold = 1024;\n\t  }\n\t\n\t  // SSL options for Node.js client\n\t  this.pfx = opts.pfx || null;\n\t  this.key = opts.key || null;\n\t  this.passphrase = opts.passphrase || null;\n\t  this.cert = opts.cert || null;\n\t  this.ca = opts.ca || null;\n\t  this.ciphers = opts.ciphers || null;\n\t  this.rejectUnauthorized = opts.rejectUnauthorized === undefined ? true : opts.rejectUnauthorized;\n\t  this.forceNode = !!opts.forceNode;\n\t\n\t  // other options for Node.js client\n\t  var freeGlobal = typeof global === 'object' && global;\n\t  if (freeGlobal.global === freeGlobal) {\n\t    if (opts.extraHeaders && Object.keys(opts.extraHeaders).length > 0) {\n\t      this.extraHeaders = opts.extraHeaders;\n\t    }\n\t\n\t    if (opts.localAddress) {\n\t      this.localAddress = opts.localAddress;\n\t    }\n\t  }\n\t\n\t  // set on handshake\n\t  this.id = null;\n\t  this.upgrades = null;\n\t  this.pingInterval = null;\n\t  this.pingTimeout = null;\n\t\n\t  // set on heartbeat\n\t  this.pingIntervalTimer = null;\n\t  this.pingTimeoutTimer = null;\n\t\n\t  this.open();\n\t}\n\t\n\tSocket.priorWebsocketSuccess = false;\n\t\n\t/**\n\t * Mix in `Emitter`.\n\t */\n\t\n\tEmitter(Socket.prototype);\n\t\n\t/**\n\t * Protocol version.\n\t *\n\t * @api public\n\t */\n\t\n\tSocket.protocol = parser.protocol; // this is an int\n\t\n\t/**\n\t * Expose deps for legacy compatibility\n\t * and standalone browser access.\n\t */\n\t\n\tSocket.Socket = Socket;\n\tSocket.Transport = __webpack_require__(22);\n\tSocket.transports = __webpack_require__(17);\n\tSocket.parser = __webpack_require__(23);\n\t\n\t/**\n\t * Creates transport of the given type.\n\t *\n\t * @param {String} transport name\n\t * @return {Transport}\n\t * @api private\n\t */\n\t\n\tSocket.prototype.createTransport = function (name) {\n\t  debug('creating transport \"%s\"', name);\n\t  var query = clone(this.query);\n\t\n\t  // append engine.io protocol identifier\n\t  query.EIO = parser.protocol;\n\t\n\t  // transport name\n\t  query.transport = name;\n\t\n\t  // per-transport options\n\t  var options = this.transportOptions[name] || {};\n\t\n\t  // session id if we already have one\n\t  if (this.id) query.sid = this.id;\n\t\n\t  var transport = new transports[name]({\n\t    query: query,\n\t    socket: this,\n\t    agent: options.agent || this.agent,\n\t    hostname: options.hostname || this.hostname,\n\t    port: options.port || this.port,\n\t    secure: options.secure || this.secure,\n\t    path: options.path || this.path,\n\t    forceJSONP: options.forceJSONP || this.forceJSONP,\n\t    jsonp: options.jsonp || this.jsonp,\n\t    forceBase64: options.forceBase64 || this.forceBase64,\n\t    enablesXDR: options.enablesXDR || this.enablesXDR,\n\t    timestampRequests: options.timestampRequests || this.timestampRequests,\n\t    timestampParam: options.timestampParam || this.timestampParam,\n\t    policyPort: options.policyPort || this.policyPort,\n\t    pfx: options.pfx || this.pfx,\n\t    key: options.key || this.key,\n\t    passphrase: options.passphrase || this.passphrase,\n\t    cert: options.cert || this.cert,\n\t    ca: options.ca || this.ca,\n\t    ciphers: options.ciphers || this.ciphers,\n\t    rejectUnauthorized: options.rejectUnauthorized || this.rejectUnauthorized,\n\t    perMessageDeflate: options.perMessageDeflate || this.perMessageDeflate,\n\t    extraHeaders: options.extraHeaders || this.extraHeaders,\n\t    forceNode: options.forceNode || this.forceNode,\n\t    localAddress: options.localAddress || this.localAddress,\n\t    requestTimeout: options.requestTimeout || this.requestTimeout,\n\t    protocols: options.protocols || void (0)\n\t  });\n\t\n\t  return transport;\n\t};\n\t\n\tfunction clone (obj) {\n\t  var o = {};\n\t  for (var i in obj) {\n\t    if (obj.hasOwnProperty(i)) {\n\t      o[i] = obj[i];\n\t    }\n\t  }\n\t  return o;\n\t}\n\t\n\t/**\n\t * Initializes transport to use and starts probe.\n\t *\n\t * @api private\n\t */\n\tSocket.prototype.open = function () {\n\t  var transport;\n\t  if (this.rememberUpgrade && Socket.priorWebsocketSuccess && this.transports.indexOf('websocket') !== -1) {\n\t    transport = 'websocket';\n\t  } else if (0 === this.transports.length) {\n\t    // Emit error on next tick so it can be listened to\n\t    var self = this;\n\t    setTimeout(function () {\n\t      self.emit('error', 'No transports available');\n\t    }, 0);\n\t    return;\n\t  } else {\n\t    transport = this.transports[0];\n\t  }\n\t  this.readyState = 'opening';\n\t\n\t  // Retry with the next transport if the transport is disabled (jsonp: false)\n\t  try {\n\t    transport = this.createTransport(transport);\n\t  } catch (e) {\n\t    this.transports.shift();\n\t    this.open();\n\t    return;\n\t  }\n\t\n\t  transport.open();\n\t  this.setTransport(transport);\n\t};\n\t\n\t/**\n\t * Sets the current transport. Disables the existing one (if any).\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.setTransport = function (transport) {\n\t  debug('setting transport %s', transport.name);\n\t  var self = this;\n\t\n\t  if (this.transport) {\n\t    debug('clearing existing transport %s', this.transport.name);\n\t    this.transport.removeAllListeners();\n\t  }\n\t\n\t  // set up transport\n\t  this.transport = transport;\n\t\n\t  // set up transport listeners\n\t  transport\n\t  .on('drain', function () {\n\t    self.onDrain();\n\t  })\n\t  .on('packet', function (packet) {\n\t    self.onPacket(packet);\n\t  })\n\t  .on('error', function (e) {\n\t    self.onError(e);\n\t  })\n\t  .on('close', function () {\n\t    self.onClose('transport close');\n\t  });\n\t};\n\t\n\t/**\n\t * Probes a transport.\n\t *\n\t * @param {String} transport name\n\t * @api private\n\t */\n\t\n\tSocket.prototype.probe = function (name) {\n\t  debug('probing transport \"%s\"', name);\n\t  var transport = this.createTransport(name, { probe: 1 });\n\t  var failed = false;\n\t  var self = this;\n\t\n\t  Socket.priorWebsocketSuccess = false;\n\t\n\t  function onTransportOpen () {\n\t    if (self.onlyBinaryUpgrades) {\n\t      var upgradeLosesBinary = !this.supportsBinary && self.transport.supportsBinary;\n\t      failed = failed || upgradeLosesBinary;\n\t    }\n\t    if (failed) return;\n\t\n\t    debug('probe transport \"%s\" opened', name);\n\t    transport.send([{ type: 'ping', data: 'probe' }]);\n\t    transport.once('packet', function (msg) {\n\t      if (failed) return;\n\t      if ('pong' === msg.type && 'probe' === msg.data) {\n\t        debug('probe transport \"%s\" pong', name);\n\t        self.upgrading = true;\n\t        self.emit('upgrading', transport);\n\t        if (!transport) return;\n\t        Socket.priorWebsocketSuccess = 'websocket' === transport.name;\n\t\n\t        debug('pausing current transport \"%s\"', self.transport.name);\n\t        self.transport.pause(function () {\n\t          if (failed) return;\n\t          if ('closed' === self.readyState) return;\n\t          debug('changing transport and sending upgrade packet');\n\t\n\t          cleanup();\n\t\n\t          self.setTransport(transport);\n\t          transport.send([{ type: 'upgrade' }]);\n\t          self.emit('upgrade', transport);\n\t          transport = null;\n\t          self.upgrading = false;\n\t          self.flush();\n\t        });\n\t      } else {\n\t        debug('probe transport \"%s\" failed', name);\n\t        var err = new Error('probe error');\n\t        err.transport = transport.name;\n\t        self.emit('upgradeError', err);\n\t      }\n\t    });\n\t  }\n\t\n\t  function freezeTransport () {\n\t    if (failed) return;\n\t\n\t    // Any callback called by transport should be ignored since now\n\t    failed = true;\n\t\n\t    cleanup();\n\t\n\t    transport.close();\n\t    transport = null;\n\t  }\n\t\n\t  // Handle any error that happens while probing\n\t  function onerror (err) {\n\t    var error = new Error('probe error: ' + err);\n\t    error.transport = transport.name;\n\t\n\t    freezeTransport();\n\t\n\t    debug('probe transport \"%s\" failed because of error: %s', name, err);\n\t\n\t    self.emit('upgradeError', error);\n\t  }\n\t\n\t  function onTransportClose () {\n\t    onerror('transport closed');\n\t  }\n\t\n\t  // When the socket is closed while we're probing\n\t  function onclose () {\n\t    onerror('socket closed');\n\t  }\n\t\n\t  // When the socket is upgraded while we're probing\n\t  function onupgrade (to) {\n\t    if (transport && to.name !== transport.name) {\n\t      debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n\t      freezeTransport();\n\t    }\n\t  }\n\t\n\t  // Remove all listeners on the transport and on self\n\t  function cleanup () {\n\t    transport.removeListener('open', onTransportOpen);\n\t    transport.removeListener('error', onerror);\n\t    transport.removeListener('close', onTransportClose);\n\t    self.removeListener('close', onclose);\n\t    self.removeListener('upgrading', onupgrade);\n\t  }\n\t\n\t  transport.once('open', onTransportOpen);\n\t  transport.once('error', onerror);\n\t  transport.once('close', onTransportClose);\n\t\n\t  this.once('close', onclose);\n\t  this.once('upgrading', onupgrade);\n\t\n\t  transport.open();\n\t};\n\t\n\t/**\n\t * Called when connection is deemed open.\n\t *\n\t * @api public\n\t */\n\t\n\tSocket.prototype.onOpen = function () {\n\t  debug('socket open');\n\t  this.readyState = 'open';\n\t  Socket.priorWebsocketSuccess = 'websocket' === this.transport.name;\n\t  this.emit('open');\n\t  this.flush();\n\t\n\t  // we check for `readyState` in case an `open`\n\t  // listener already closed the socket\n\t  if ('open' === this.readyState && this.upgrade && this.transport.pause) {\n\t    debug('starting upgrade probes');\n\t    for (var i = 0, l = this.upgrades.length; i < l; i++) {\n\t      this.probe(this.upgrades[i]);\n\t    }\n\t  }\n\t};\n\t\n\t/**\n\t * Handles a packet.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onPacket = function (packet) {\n\t  if ('opening' === this.readyState || 'open' === this.readyState ||\n\t      'closing' === this.readyState) {\n\t    debug('socket receive: type \"%s\", data \"%s\"', packet.type, packet.data);\n\t\n\t    this.emit('packet', packet);\n\t\n\t    // Socket is live - any packet counts\n\t    this.emit('heartbeat');\n\t\n\t    switch (packet.type) {\n\t      case 'open':\n\t        this.onHandshake(parsejson(packet.data));\n\t        break;\n\t\n\t      case 'pong':\n\t        this.setPing();\n\t        this.emit('pong');\n\t        break;\n\t\n\t      case 'error':\n\t        var err = new Error('server error');\n\t        err.code = packet.data;\n\t        this.onError(err);\n\t        break;\n\t\n\t      case 'message':\n\t        this.emit('data', packet.data);\n\t        this.emit('message', packet.data);\n\t        break;\n\t    }\n\t  } else {\n\t    debug('packet received with socket readyState \"%s\"', this.readyState);\n\t  }\n\t};\n\t\n\t/**\n\t * Called upon handshake completion.\n\t *\n\t * @param {Object} handshake obj\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onHandshake = function (data) {\n\t  this.emit('handshake', data);\n\t  this.id = data.sid;\n\t  this.transport.query.sid = data.sid;\n\t  this.upgrades = this.filterUpgrades(data.upgrades);\n\t  this.pingInterval = data.pingInterval;\n\t  this.pingTimeout = data.pingTimeout;\n\t  this.onOpen();\n\t  // In case open handler closes socket\n\t  if ('closed' === this.readyState) return;\n\t  this.setPing();\n\t\n\t  // Prolong liveness of socket on heartbeat\n\t  this.removeListener('heartbeat', this.onHeartbeat);\n\t  this.on('heartbeat', this.onHeartbeat);\n\t};\n\t\n\t/**\n\t * Resets ping timeout.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onHeartbeat = function (timeout) {\n\t  clearTimeout(this.pingTimeoutTimer);\n\t  var self = this;\n\t  self.pingTimeoutTimer = setTimeout(function () {\n\t    if ('closed' === self.readyState) return;\n\t    self.onClose('ping timeout');\n\t  }, timeout || (self.pingInterval + self.pingTimeout));\n\t};\n\t\n\t/**\n\t * Pings server every `this.pingInterval` and expects response\n\t * within `this.pingTimeout` or closes connection.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.setPing = function () {\n\t  var self = this;\n\t  clearTimeout(self.pingIntervalTimer);\n\t  self.pingIntervalTimer = setTimeout(function () {\n\t    debug('writing ping packet - expecting pong within %sms', self.pingTimeout);\n\t    self.ping();\n\t    self.onHeartbeat(self.pingTimeout);\n\t  }, self.pingInterval);\n\t};\n\t\n\t/**\n\t* Sends a ping packet.\n\t*\n\t* @api private\n\t*/\n\t\n\tSocket.prototype.ping = function () {\n\t  var self = this;\n\t  this.sendPacket('ping', function () {\n\t    self.emit('ping');\n\t  });\n\t};\n\t\n\t/**\n\t * Called on `drain` event\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onDrain = function () {\n\t  this.writeBuffer.splice(0, this.prevBufferLen);\n\t\n\t  // setting prevBufferLen = 0 is very important\n\t  // for example, when upgrading, upgrade packet is sent over,\n\t  // and a nonzero prevBufferLen could cause problems on `drain`\n\t  this.prevBufferLen = 0;\n\t\n\t  if (0 === this.writeBuffer.length) {\n\t    this.emit('drain');\n\t  } else {\n\t    this.flush();\n\t  }\n\t};\n\t\n\t/**\n\t * Flush write buffers.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.flush = function () {\n\t  if ('closed' !== this.readyState && this.transport.writable &&\n\t    !this.upgrading && this.writeBuffer.length) {\n\t    debug('flushing %d packets in socket', this.writeBuffer.length);\n\t    this.transport.send(this.writeBuffer);\n\t    // keep track of current length of writeBuffer\n\t    // splice writeBuffer and callbackBuffer on `drain`\n\t    this.prevBufferLen = this.writeBuffer.length;\n\t    this.emit('flush');\n\t  }\n\t};\n\t\n\t/**\n\t * Sends a message.\n\t *\n\t * @param {String} message.\n\t * @param {Function} callback function.\n\t * @param {Object} options.\n\t * @return {Socket} for chaining.\n\t * @api public\n\t */\n\t\n\tSocket.prototype.write =\n\tSocket.prototype.send = function (msg, options, fn) {\n\t  this.sendPacket('message', msg, options, fn);\n\t  return this;\n\t};\n\t\n\t/**\n\t * Sends a packet.\n\t *\n\t * @param {String} packet type.\n\t * @param {String} data.\n\t * @param {Object} options.\n\t * @param {Function} callback function.\n\t * @api private\n\t */\n\t\n\tSocket.prototype.sendPacket = function (type, data, options, fn) {\n\t  if ('function' === typeof data) {\n\t    fn = data;\n\t    data = undefined;\n\t  }\n\t\n\t  if ('function' === typeof options) {\n\t    fn = options;\n\t    options = null;\n\t  }\n\t\n\t  if ('closing' === this.readyState || 'closed' === this.readyState) {\n\t    return;\n\t  }\n\t\n\t  options = options || {};\n\t  options.compress = false !== options.compress;\n\t\n\t  var packet = {\n\t    type: type,\n\t    data: data,\n\t    options: options\n\t  };\n\t  this.emit('packetCreate', packet);\n\t  this.writeBuffer.push(packet);\n\t  if (fn) this.once('flush', fn);\n\t  this.flush();\n\t};\n\t\n\t/**\n\t * Closes the connection.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.close = function () {\n\t  if ('opening' === this.readyState || 'open' === this.readyState) {\n\t    this.readyState = 'closing';\n\t\n\t    var self = this;\n\t\n\t    if (this.writeBuffer.length) {\n\t      this.once('drain', function () {\n\t        if (this.upgrading) {\n\t          waitForUpgrade();\n\t        } else {\n\t          close();\n\t        }\n\t      });\n\t    } else if (this.upgrading) {\n\t      waitForUpgrade();\n\t    } else {\n\t      close();\n\t    }\n\t  }\n\t\n\t  function close () {\n\t    self.onClose('forced close');\n\t    debug('socket closing - telling transport to close');\n\t    self.transport.close();\n\t  }\n\t\n\t  function cleanupAndClose () {\n\t    self.removeListener('upgrade', cleanupAndClose);\n\t    self.removeListener('upgradeError', cleanupAndClose);\n\t    close();\n\t  }\n\t\n\t  function waitForUpgrade () {\n\t    // wait for upgrade to finish since we can't send packets while pausing a transport\n\t    self.once('upgrade', cleanupAndClose);\n\t    self.once('upgradeError', cleanupAndClose);\n\t  }\n\t\n\t  return this;\n\t};\n\t\n\t/**\n\t * Called upon transport error\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onError = function (err) {\n\t  debug('socket error %j', err);\n\t  Socket.priorWebsocketSuccess = false;\n\t  this.emit('error', err);\n\t  this.onClose('transport error', err);\n\t};\n\t\n\t/**\n\t * Called upon transport close.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onClose = function (reason, desc) {\n\t  if ('opening' === this.readyState || 'open' === this.readyState || 'closing' === this.readyState) {\n\t    debug('socket close with reason: \"%s\"', reason);\n\t    var self = this;\n\t\n\t    // clear timers\n\t    clearTimeout(this.pingIntervalTimer);\n\t    clearTimeout(this.pingTimeoutTimer);\n\t\n\t    // stop event from firing again for transport\n\t    this.transport.removeAllListeners('close');\n\t\n\t    // ensure transport won't stay open\n\t    this.transport.close();\n\t\n\t    // ignore further transport communication\n\t    this.transport.removeAllListeners();\n\t\n\t    // set ready state\n\t    this.readyState = 'closed';\n\t\n\t    // clear session id\n\t    this.id = null;\n\t\n\t    // emit close event\n\t    this.emit('close', reason, desc);\n\t\n\t    // clean buffers after, so users can still\n\t    // grab the buffers on `close` event\n\t    self.writeBuffer = [];\n\t    self.prevBufferLen = 0;\n\t  }\n\t};\n\t\n\t/**\n\t * Filters upgrades, returning only those matching client transports.\n\t *\n\t * @param {Array} server upgrades\n\t * @api private\n\t *\n\t */\n\t\n\tSocket.prototype.filterUpgrades = function (upgrades) {\n\t  var filteredUpgrades = [];\n\t  for (var i = 0, j = upgrades.length; i < j; i++) {\n\t    if (~index(this.transports, upgrades[i])) filteredUpgrades.push(upgrades[i]);\n\t  }\n\t  return filteredUpgrades;\n\t};\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/**\n\t * Module dependencies\n\t */\n\t\n\tvar XMLHttpRequest = __webpack_require__(18);\n\tvar XHR = __webpack_require__(20);\n\tvar JSONP = __webpack_require__(34);\n\tvar websocket = __webpack_require__(35);\n\t\n\t/**\n\t * Export transports.\n\t */\n\t\n\texports.polling = polling;\n\texports.websocket = websocket;\n\t\n\t/**\n\t * Polling transport polymorphic constructor.\n\t * Decides on xhr vs jsonp based on feature detection.\n\t *\n\t * @api private\n\t */\n\t\n\tfunction polling (opts) {\n\t  var xhr;\n\t  var xd = false;\n\t  var xs = false;\n\t  var jsonp = false !== opts.jsonp;\n\t\n\t  if (global.location) {\n\t    var isSSL = 'https:' === location.protocol;\n\t    var port = location.port;\n\t\n\t    // some user agents have empty `location.port`\n\t    if (!port) {\n\t      port = isSSL ? 443 : 80;\n\t    }\n\t\n\t    xd = opts.hostname !== location.hostname || port !== opts.port;\n\t    xs = opts.secure !== isSSL;\n\t  }\n\t\n\t  opts.xdomain = xd;\n\t  opts.xscheme = xs;\n\t  xhr = new XMLHttpRequest(opts);\n\t\n\t  if ('open' in xhr && !opts.forceJSONP) {\n\t    return new XHR(opts);\n\t  } else {\n\t    if (!jsonp) throw new Error('JSONP disabled');\n\t    return new JSONP(opts);\n\t  }\n\t}\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {// browser shim for xmlhttprequest module\n\t\n\tvar hasCORS = __webpack_require__(19);\n\t\n\tmodule.exports = function (opts) {\n\t  var xdomain = opts.xdomain;\n\t\n\t  // scheme must be same when usign XDomainRequest\n\t  // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx\n\t  var xscheme = opts.xscheme;\n\t\n\t  // XDomainRequest has a flow of not sending cookie, therefore it should be disabled as a default.\n\t  // https://github.com/Automattic/engine.io-client/pull/217\n\t  var enablesXDR = opts.enablesXDR;\n\t\n\t  // XMLHttpRequest can be disabled on IE\n\t  try {\n\t    if ('undefined' !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {\n\t      return new XMLHttpRequest();\n\t    }\n\t  } catch (e) { }\n\t\n\t  // Use XDomainRequest for IE8 if enablesXDR is true\n\t  // because loading bar keeps flashing when using jsonp-polling\n\t  // https://github.com/yujiosaka/socke.io-ie8-loading-example\n\t  try {\n\t    if ('undefined' !== typeof XDomainRequest && !xscheme && enablesXDR) {\n\t      return new XDomainRequest();\n\t    }\n\t  } catch (e) { }\n\t\n\t  if (!xdomain) {\n\t    try {\n\t      return new global[['Active'].concat('Object').join('X')]('Microsoft.XMLHTTP');\n\t    } catch (e) { }\n\t  }\n\t};\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports) {\n\n\t\n\t/**\n\t * Module exports.\n\t *\n\t * Logic borrowed from Modernizr:\n\t *\n\t *   - https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cors.js\n\t */\n\t\n\ttry {\n\t  module.exports = typeof XMLHttpRequest !== 'undefined' &&\n\t    'withCredentials' in new XMLHttpRequest();\n\t} catch (err) {\n\t  // if XMLHttp support is disabled in IE then it will throw\n\t  // when trying to create\n\t  module.exports = false;\n\t}\n\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/**\n\t * Module requirements.\n\t */\n\t\n\tvar XMLHttpRequest = __webpack_require__(18);\n\tvar Polling = __webpack_require__(21);\n\tvar Emitter = __webpack_require__(8);\n\tvar inherit = __webpack_require__(32);\n\tvar debug = __webpack_require__(3)('engine.io-client:polling-xhr');\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = XHR;\n\tmodule.exports.Request = Request;\n\t\n\t/**\n\t * Empty function\n\t */\n\t\n\tfunction empty () {}\n\t\n\t/**\n\t * XHR Polling constructor.\n\t *\n\t * @param {Object} opts\n\t * @api public\n\t */\n\t\n\tfunction XHR (opts) {\n\t  Polling.call(this, opts);\n\t  this.requestTimeout = opts.requestTimeout;\n\t  this.extraHeaders = opts.extraHeaders;\n\t\n\t  if (global.location) {\n\t    var isSSL = 'https:' === location.protocol;\n\t    var port = location.port;\n\t\n\t    // some user agents have empty `location.port`\n\t    if (!port) {\n\t      port = isSSL ? 443 : 80;\n\t    }\n\t\n\t    this.xd = opts.hostname !== global.location.hostname ||\n\t      port !== opts.port;\n\t    this.xs = opts.secure !== isSSL;\n\t  }\n\t}\n\t\n\t/**\n\t * Inherits from Polling.\n\t */\n\t\n\tinherit(XHR, Polling);\n\t\n\t/**\n\t * XHR supports binary\n\t */\n\t\n\tXHR.prototype.supportsBinary = true;\n\t\n\t/**\n\t * Creates a request.\n\t *\n\t * @param {String} method\n\t * @api private\n\t */\n\t\n\tXHR.prototype.request = function (opts) {\n\t  opts = opts || {};\n\t  opts.uri = this.uri();\n\t  opts.xd = this.xd;\n\t  opts.xs = this.xs;\n\t  opts.agent = this.agent || false;\n\t  opts.supportsBinary = this.supportsBinary;\n\t  opts.enablesXDR = this.enablesXDR;\n\t\n\t  // SSL options for Node.js client\n\t  opts.pfx = this.pfx;\n\t  opts.key = this.key;\n\t  opts.passphrase = this.passphrase;\n\t  opts.cert = this.cert;\n\t  opts.ca = this.ca;\n\t  opts.ciphers = this.ciphers;\n\t  opts.rejectUnauthorized = this.rejectUnauthorized;\n\t  opts.requestTimeout = this.requestTimeout;\n\t\n\t  // other options for Node.js client\n\t  opts.extraHeaders = this.extraHeaders;\n\t\n\t  return new Request(opts);\n\t};\n\t\n\t/**\n\t * Sends data.\n\t *\n\t * @param {String} data to send.\n\t * @param {Function} called upon flush.\n\t * @api private\n\t */\n\t\n\tXHR.prototype.doWrite = function (data, fn) {\n\t  var isBinary = typeof data !== 'string' && data !== undefined;\n\t  var req = this.request({ method: 'POST', data: data, isBinary: isBinary });\n\t  var self = this;\n\t  req.on('success', fn);\n\t  req.on('error', function (err) {\n\t    self.onError('xhr post error', err);\n\t  });\n\t  this.sendXhr = req;\n\t};\n\t\n\t/**\n\t * Starts a poll cycle.\n\t *\n\t * @api private\n\t */\n\t\n\tXHR.prototype.doPoll = function () {\n\t  debug('xhr poll');\n\t  var req = this.request();\n\t  var self = this;\n\t  req.on('data', function (data) {\n\t    self.onData(data);\n\t  });\n\t  req.on('error', function (err) {\n\t    self.onError('xhr poll error', err);\n\t  });\n\t  this.pollXhr = req;\n\t};\n\t\n\t/**\n\t * Request constructor\n\t *\n\t * @param {Object} options\n\t * @api public\n\t */\n\t\n\tfunction Request (opts) {\n\t  this.method = opts.method || 'GET';\n\t  this.uri = opts.uri;\n\t  this.xd = !!opts.xd;\n\t  this.xs = !!opts.xs;\n\t  this.async = false !== opts.async;\n\t  this.data = undefined !== opts.data ? opts.data : null;\n\t  this.agent = opts.agent;\n\t  this.isBinary = opts.isBinary;\n\t  this.supportsBinary = opts.supportsBinary;\n\t  this.enablesXDR = opts.enablesXDR;\n\t  this.requestTimeout = opts.requestTimeout;\n\t\n\t  // SSL options for Node.js client\n\t  this.pfx = opts.pfx;\n\t  this.key = opts.key;\n\t  this.passphrase = opts.passphrase;\n\t  this.cert = opts.cert;\n\t  this.ca = opts.ca;\n\t  this.ciphers = opts.ciphers;\n\t  this.rejectUnauthorized = opts.rejectUnauthorized;\n\t\n\t  // other options for Node.js client\n\t  this.extraHeaders = opts.extraHeaders;\n\t\n\t  this.create();\n\t}\n\t\n\t/**\n\t * Mix in `Emitter`.\n\t */\n\t\n\tEmitter(Request.prototype);\n\t\n\t/**\n\t * Creates the XHR object and sends the request.\n\t *\n\t * @api private\n\t */\n\t\n\tRequest.prototype.create = function () {\n\t  var opts = { agent: this.agent, xdomain: this.xd, xscheme: this.xs, enablesXDR: this.enablesXDR };\n\t\n\t  // SSL options for Node.js client\n\t  opts.pfx = this.pfx;\n\t  opts.key = this.key;\n\t  opts.passphrase = this.passphrase;\n\t  opts.cert = this.cert;\n\t  opts.ca = this.ca;\n\t  opts.ciphers = this.ciphers;\n\t  opts.rejectUnauthorized = this.rejectUnauthorized;\n\t\n\t  var xhr = this.xhr = new XMLHttpRequest(opts);\n\t  var self = this;\n\t\n\t  try {\n\t    debug('xhr open %s: %s', this.method, this.uri);\n\t    xhr.open(this.method, this.uri, this.async);\n\t    try {\n\t      if (this.extraHeaders) {\n\t        xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);\n\t        for (var i in this.extraHeaders) {\n\t          if (this.extraHeaders.hasOwnProperty(i)) {\n\t            xhr.setRequestHeader(i, this.extraHeaders[i]);\n\t          }\n\t        }\n\t      }\n\t    } catch (e) {}\n\t\n\t    if ('POST' === this.method) {\n\t      try {\n\t        if (this.isBinary) {\n\t          xhr.setRequestHeader('Content-type', 'application/octet-stream');\n\t        } else {\n\t          xhr.setRequestHeader('Content-type', 'text/plain;charset=UTF-8');\n\t        }\n\t      } catch (e) {}\n\t    }\n\t\n\t    try {\n\t      xhr.setRequestHeader('Accept', '*/*');\n\t    } catch (e) {}\n\t\n\t    // ie6 check\n\t    if ('withCredentials' in xhr) {\n\t      xhr.withCredentials = true;\n\t    }\n\t\n\t    if (this.requestTimeout) {\n\t      xhr.timeout = this.requestTimeout;\n\t    }\n\t\n\t    if (this.hasXDR()) {\n\t      xhr.onload = function () {\n\t        self.onLoad();\n\t      };\n\t      xhr.onerror = function () {\n\t        self.onError(xhr.responseText);\n\t      };\n\t    } else {\n\t      xhr.onreadystatechange = function () {\n\t        if (xhr.readyState === 2) {\n\t          var contentType;\n\t          try {\n\t            contentType = xhr.getResponseHeader('Content-Type');\n\t          } catch (e) {}\n\t          if (contentType === 'application/octet-stream') {\n\t            xhr.responseType = 'arraybuffer';\n\t          }\n\t        }\n\t        if (4 !== xhr.readyState) return;\n\t        if (200 === xhr.status || 1223 === xhr.status) {\n\t          self.onLoad();\n\t        } else {\n\t          // make sure the `error` event handler that's user-set\n\t          // does not throw in the same tick and gets caught here\n\t          setTimeout(function () {\n\t            self.onError(xhr.status);\n\t          }, 0);\n\t        }\n\t      };\n\t    }\n\t\n\t    debug('xhr data %s', this.data);\n\t    xhr.send(this.data);\n\t  } catch (e) {\n\t    // Need to defer since .create() is called directly fhrom the constructor\n\t    // and thus the 'error' event can only be only bound *after* this exception\n\t    // occurs.  Therefore, also, we cannot throw here at all.\n\t    setTimeout(function () {\n\t      self.onError(e);\n\t    }, 0);\n\t    return;\n\t  }\n\t\n\t  if (global.document) {\n\t    this.index = Request.requestsCount++;\n\t    Request.requests[this.index] = this;\n\t  }\n\t};\n\t\n\t/**\n\t * Called upon successful response.\n\t *\n\t * @api private\n\t */\n\t\n\tRequest.prototype.onSuccess = function () {\n\t  this.emit('success');\n\t  this.cleanup();\n\t};\n\t\n\t/**\n\t * Called if we have data.\n\t *\n\t * @api private\n\t */\n\t\n\tRequest.prototype.onData = function (data) {\n\t  this.emit('data', data);\n\t  this.onSuccess();\n\t};\n\t\n\t/**\n\t * Called upon error.\n\t *\n\t * @api private\n\t */\n\t\n\tRequest.prototype.onError = function (err) {\n\t  this.emit('error', err);\n\t  this.cleanup(true);\n\t};\n\t\n\t/**\n\t * Cleans up house.\n\t *\n\t * @api private\n\t */\n\t\n\tRequest.prototype.cleanup = function (fromError) {\n\t  if ('undefined' === typeof this.xhr || null === this.xhr) {\n\t    return;\n\t  }\n\t  // xmlhttprequest\n\t  if (this.hasXDR()) {\n\t    this.xhr.onload = this.xhr.onerror = empty;\n\t  } else {\n\t    this.xhr.onreadystatechange = empty;\n\t  }\n\t\n\t  if (fromError) {\n\t    try {\n\t      this.xhr.abort();\n\t    } catch (e) {}\n\t  }\n\t\n\t  if (global.document) {\n\t    delete Request.requests[this.index];\n\t  }\n\t\n\t  this.xhr = null;\n\t};\n\t\n\t/**\n\t * Called upon load.\n\t *\n\t * @api private\n\t */\n\t\n\tRequest.prototype.onLoad = function () {\n\t  var data;\n\t  try {\n\t    var contentType;\n\t    try {\n\t      contentType = this.xhr.getResponseHeader('Content-Type');\n\t    } catch (e) {}\n\t    if (contentType === 'application/octet-stream') {\n\t      data = this.xhr.response || this.xhr.responseText;\n\t    } else {\n\t      data = this.xhr.responseText;\n\t    }\n\t  } catch (e) {\n\t    this.onError(e);\n\t  }\n\t  if (null != data) {\n\t    this.onData(data);\n\t  }\n\t};\n\t\n\t/**\n\t * Check if it has XDomainRequest.\n\t *\n\t * @api private\n\t */\n\t\n\tRequest.prototype.hasXDR = function () {\n\t  return 'undefined' !== typeof global.XDomainRequest && !this.xs && this.enablesXDR;\n\t};\n\t\n\t/**\n\t * Aborts the request.\n\t *\n\t * @api public\n\t */\n\t\n\tRequest.prototype.abort = function () {\n\t  this.cleanup();\n\t};\n\t\n\t/**\n\t * Aborts pending requests when unloading the window. This is needed to prevent\n\t * memory leaks (e.g. when using IE) and to ensure that no spurious error is\n\t * emitted.\n\t */\n\t\n\tRequest.requestsCount = 0;\n\tRequest.requests = {};\n\t\n\tif (global.document) {\n\t  if (global.attachEvent) {\n\t    global.attachEvent('onunload', unloadHandler);\n\t  } else if (global.addEventListener) {\n\t    global.addEventListener('beforeunload', unloadHandler, false);\n\t  }\n\t}\n\t\n\tfunction unloadHandler () {\n\t  for (var i in Request.requests) {\n\t    if (Request.requests.hasOwnProperty(i)) {\n\t      Request.requests[i].abort();\n\t    }\n\t  }\n\t}\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/**\n\t * Module dependencies.\n\t */\n\t\n\tvar Transport = __webpack_require__(22);\n\tvar parseqs = __webpack_require__(31);\n\tvar parser = __webpack_require__(23);\n\tvar inherit = __webpack_require__(32);\n\tvar yeast = __webpack_require__(33);\n\tvar debug = __webpack_require__(3)('engine.io-client:polling');\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = Polling;\n\t\n\t/**\n\t * Is XHR2 supported?\n\t */\n\t\n\tvar hasXHR2 = (function () {\n\t  var XMLHttpRequest = __webpack_require__(18);\n\t  var xhr = new XMLHttpRequest({ xdomain: false });\n\t  return null != xhr.responseType;\n\t})();\n\t\n\t/**\n\t * Polling interface.\n\t *\n\t * @param {Object} opts\n\t * @api private\n\t */\n\t\n\tfunction Polling (opts) {\n\t  var forceBase64 = (opts && opts.forceBase64);\n\t  if (!hasXHR2 || forceBase64) {\n\t    this.supportsBinary = false;\n\t  }\n\t  Transport.call(this, opts);\n\t}\n\t\n\t/**\n\t * Inherits from Transport.\n\t */\n\t\n\tinherit(Polling, Transport);\n\t\n\t/**\n\t * Transport name.\n\t */\n\t\n\tPolling.prototype.name = 'polling';\n\t\n\t/**\n\t * Opens the socket (triggers polling). We write a PING message to determine\n\t * when the transport is open.\n\t *\n\t * @api private\n\t */\n\t\n\tPolling.prototype.doOpen = function () {\n\t  this.poll();\n\t};\n\t\n\t/**\n\t * Pauses polling.\n\t *\n\t * @param {Function} callback upon buffers are flushed and transport is paused\n\t * @api private\n\t */\n\t\n\tPolling.prototype.pause = function (onPause) {\n\t  var self = this;\n\t\n\t  this.readyState = 'pausing';\n\t\n\t  function pause () {\n\t    debug('paused');\n\t    self.readyState = 'paused';\n\t    onPause();\n\t  }\n\t\n\t  if (this.polling || !this.writable) {\n\t    var total = 0;\n\t\n\t    if (this.polling) {\n\t      debug('we are currently polling - waiting to pause');\n\t      total++;\n\t      this.once('pollComplete', function () {\n\t        debug('pre-pause polling complete');\n\t        --total || pause();\n\t      });\n\t    }\n\t\n\t    if (!this.writable) {\n\t      debug('we are currently writing - waiting to pause');\n\t      total++;\n\t      this.once('drain', function () {\n\t        debug('pre-pause writing complete');\n\t        --total || pause();\n\t      });\n\t    }\n\t  } else {\n\t    pause();\n\t  }\n\t};\n\t\n\t/**\n\t * Starts polling cycle.\n\t *\n\t * @api public\n\t */\n\t\n\tPolling.prototype.poll = function () {\n\t  debug('polling');\n\t  this.polling = true;\n\t  this.doPoll();\n\t  this.emit('poll');\n\t};\n\t\n\t/**\n\t * Overloads onData to detect payloads.\n\t *\n\t * @api private\n\t */\n\t\n\tPolling.prototype.onData = function (data) {\n\t  var self = this;\n\t  debug('polling got data %s', data);\n\t  var callback = function (packet, index, total) {\n\t    // if its the first message we consider the transport open\n\t    if ('opening' === self.readyState) {\n\t      self.onOpen();\n\t    }\n\t\n\t    // if its a close packet, we close the ongoing requests\n\t    if ('close' === packet.type) {\n\t      self.onClose();\n\t      return false;\n\t    }\n\t\n\t    // otherwise bypass onData and handle the message\n\t    self.onPacket(packet);\n\t  };\n\t\n\t  // decode payload\n\t  parser.decodePayload(data, this.socket.binaryType, callback);\n\t\n\t  // if an event did not trigger closing\n\t  if ('closed' !== this.readyState) {\n\t    // if we got data we're not polling\n\t    this.polling = false;\n\t    this.emit('pollComplete');\n\t\n\t    if ('open' === this.readyState) {\n\t      this.poll();\n\t    } else {\n\t      debug('ignoring poll - transport state \"%s\"', this.readyState);\n\t    }\n\t  }\n\t};\n\t\n\t/**\n\t * For polling, send a close packet.\n\t *\n\t * @api private\n\t */\n\t\n\tPolling.prototype.doClose = function () {\n\t  var self = this;\n\t\n\t  function close () {\n\t    debug('writing close packet');\n\t    self.write([{ type: 'close' }]);\n\t  }\n\t\n\t  if ('open' === this.readyState) {\n\t    debug('transport open - closing');\n\t    close();\n\t  } else {\n\t    // in case we're trying to close while\n\t    // handshaking is in progress (GH-164)\n\t    debug('transport not open - deferring close');\n\t    this.once('open', close);\n\t  }\n\t};\n\t\n\t/**\n\t * Writes a packets payload.\n\t *\n\t * @param {Array} data packets\n\t * @param {Function} drain callback\n\t * @api private\n\t */\n\t\n\tPolling.prototype.write = function (packets) {\n\t  var self = this;\n\t  this.writable = false;\n\t  var callbackfn = function () {\n\t    self.writable = true;\n\t    self.emit('drain');\n\t  };\n\t\n\t  parser.encodePayload(packets, this.supportsBinary, function (data) {\n\t    self.doWrite(data, callbackfn);\n\t  });\n\t};\n\t\n\t/**\n\t * Generates uri for connection.\n\t *\n\t * @api private\n\t */\n\t\n\tPolling.prototype.uri = function () {\n\t  var query = this.query || {};\n\t  var schema = this.secure ? 'https' : 'http';\n\t  var port = '';\n\t\n\t  // cache busting is forced\n\t  if (false !== this.timestampRequests) {\n\t    query[this.timestampParam] = yeast();\n\t  }\n\t\n\t  if (!this.supportsBinary && !query.sid) {\n\t    query.b64 = 1;\n\t  }\n\t\n\t  query = parseqs.encode(query);\n\t\n\t  // avoid port if default for schema\n\t  if (this.port && (('https' === schema && Number(this.port) !== 443) ||\n\t     ('http' === schema && Number(this.port) !== 80))) {\n\t    port = ':' + this.port;\n\t  }\n\t\n\t  // prepend ? to query\n\t  if (query.length) {\n\t    query = '?' + query;\n\t  }\n\t\n\t  var ipv6 = this.hostname.indexOf(':') !== -1;\n\t  return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;\n\t};\n\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/**\n\t * Module dependencies.\n\t */\n\t\n\tvar parser = __webpack_require__(23);\n\tvar Emitter = __webpack_require__(8);\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = Transport;\n\t\n\t/**\n\t * Transport abstract constructor.\n\t *\n\t * @param {Object} options.\n\t * @api private\n\t */\n\t\n\tfunction Transport (opts) {\n\t  this.path = opts.path;\n\t  this.hostname = opts.hostname;\n\t  this.port = opts.port;\n\t  this.secure = opts.secure;\n\t  this.query = opts.query;\n\t  this.timestampParam = opts.timestampParam;\n\t  this.timestampRequests = opts.timestampRequests;\n\t  this.readyState = '';\n\t  this.agent = opts.agent || false;\n\t  this.socket = opts.socket;\n\t  this.enablesXDR = opts.enablesXDR;\n\t\n\t  // SSL options for Node.js client\n\t  this.pfx = opts.pfx;\n\t  this.key = opts.key;\n\t  this.passphrase = opts.passphrase;\n\t  this.cert = opts.cert;\n\t  this.ca = opts.ca;\n\t  this.ciphers = opts.ciphers;\n\t  this.rejectUnauthorized = opts.rejectUnauthorized;\n\t  this.forceNode = opts.forceNode;\n\t\n\t  // other options for Node.js client\n\t  this.extraHeaders = opts.extraHeaders;\n\t  this.localAddress = opts.localAddress;\n\t}\n\t\n\t/**\n\t * Mix in `Emitter`.\n\t */\n\t\n\tEmitter(Transport.prototype);\n\t\n\t/**\n\t * Emits an error.\n\t *\n\t * @param {String} str\n\t * @return {Transport} for chaining\n\t * @api public\n\t */\n\t\n\tTransport.prototype.onError = function (msg, desc) {\n\t  var err = new Error(msg);\n\t  err.type = 'TransportError';\n\t  err.description = desc;\n\t  this.emit('error', err);\n\t  return this;\n\t};\n\t\n\t/**\n\t * Opens the transport.\n\t *\n\t * @api public\n\t */\n\t\n\tTransport.prototype.open = function () {\n\t  if ('closed' === this.readyState || '' === this.readyState) {\n\t    this.readyState = 'opening';\n\t    this.doOpen();\n\t  }\n\t\n\t  return this;\n\t};\n\t\n\t/**\n\t * Closes the transport.\n\t *\n\t * @api private\n\t */\n\t\n\tTransport.prototype.close = function () {\n\t  if ('opening' === this.readyState || 'open' === this.readyState) {\n\t    this.doClose();\n\t    this.onClose();\n\t  }\n\t\n\t  return this;\n\t};\n\t\n\t/**\n\t * Sends multiple packets.\n\t *\n\t * @param {Array} packets\n\t * @api private\n\t */\n\t\n\tTransport.prototype.send = function (packets) {\n\t  if ('open' === this.readyState) {\n\t    this.write(packets);\n\t  } else {\n\t    throw new Error('Transport not open');\n\t  }\n\t};\n\t\n\t/**\n\t * Called upon open\n\t *\n\t * @api private\n\t */\n\t\n\tTransport.prototype.onOpen = function () {\n\t  this.readyState = 'open';\n\t  this.writable = true;\n\t  this.emit('open');\n\t};\n\t\n\t/**\n\t * Called with data.\n\t *\n\t * @param {String} data\n\t * @api private\n\t */\n\t\n\tTransport.prototype.onData = function (data) {\n\t  var packet = parser.decodePacket(data, this.socket.binaryType);\n\t  this.onPacket(packet);\n\t};\n\t\n\t/**\n\t * Called with a decoded packet.\n\t */\n\t\n\tTransport.prototype.onPacket = function (packet) {\n\t  this.emit('packet', packet);\n\t};\n\t\n\t/**\n\t * Called upon close.\n\t *\n\t * @api private\n\t */\n\t\n\tTransport.prototype.onClose = function () {\n\t  this.readyState = 'closed';\n\t  this.emit('close');\n\t};\n\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/**\n\t * Module dependencies.\n\t */\n\t\n\tvar keys = __webpack_require__(24);\n\tvar hasBinary = __webpack_require__(9);\n\tvar sliceBuffer = __webpack_require__(25);\n\tvar after = __webpack_require__(26);\n\tvar utf8 = __webpack_require__(27);\n\t\n\tvar base64encoder;\n\tif (global && global.ArrayBuffer) {\n\t  base64encoder = __webpack_require__(29);\n\t}\n\t\n\t/**\n\t * Check if we are running an android browser. That requires us to use\n\t * ArrayBuffer with polling transports...\n\t *\n\t * http://ghinda.net/jpeg-blob-ajax-android/\n\t */\n\t\n\tvar isAndroid = typeof navigator !== 'undefined' && /Android/i.test(navigator.userAgent);\n\t\n\t/**\n\t * Check if we are running in PhantomJS.\n\t * Uploading a Blob with PhantomJS does not work correctly, as reported here:\n\t * https://github.com/ariya/phantomjs/issues/11395\n\t * @type boolean\n\t */\n\tvar isPhantomJS = typeof navigator !== 'undefined' && /PhantomJS/i.test(navigator.userAgent);\n\t\n\t/**\n\t * When true, avoids using Blobs to encode payloads.\n\t * @type boolean\n\t */\n\tvar dontSendBlobs = isAndroid || isPhantomJS;\n\t\n\t/**\n\t * Current protocol version.\n\t */\n\t\n\texports.protocol = 3;\n\t\n\t/**\n\t * Packet types.\n\t */\n\t\n\tvar packets = exports.packets = {\n\t    open:     0    // non-ws\n\t  , close:    1    // non-ws\n\t  , ping:     2\n\t  , pong:     3\n\t  , message:  4\n\t  , upgrade:  5\n\t  , noop:     6\n\t};\n\t\n\tvar packetslist = keys(packets);\n\t\n\t/**\n\t * Premade error packet.\n\t */\n\t\n\tvar err = { type: 'error', data: 'parser error' };\n\t\n\t/**\n\t * Create a blob api even for blob builder when vendor prefixes exist\n\t */\n\t\n\tvar Blob = __webpack_require__(30);\n\t\n\t/**\n\t * Encodes a packet.\n\t *\n\t *     <packet type id> [ <data> ]\n\t *\n\t * Example:\n\t *\n\t *     5hello world\n\t *     3\n\t *     4\n\t *\n\t * Binary is encoded in an identical principle\n\t *\n\t * @api private\n\t */\n\t\n\texports.encodePacket = function (packet, supportsBinary, utf8encode, callback) {\n\t  if (typeof supportsBinary === 'function') {\n\t    callback = supportsBinary;\n\t    supportsBinary = false;\n\t  }\n\t\n\t  if (typeof utf8encode === 'function') {\n\t    callback = utf8encode;\n\t    utf8encode = null;\n\t  }\n\t\n\t  var data = (packet.data === undefined)\n\t    ? undefined\n\t    : packet.data.buffer || packet.data;\n\t\n\t  if (global.ArrayBuffer && data instanceof ArrayBuffer) {\n\t    return encodeArrayBuffer(packet, supportsBinary, callback);\n\t  } else if (Blob && data instanceof global.Blob) {\n\t    return encodeBlob(packet, supportsBinary, callback);\n\t  }\n\t\n\t  // might be an object with { base64: true, data: dataAsBase64String }\n\t  if (data && data.base64) {\n\t    return encodeBase64Object(packet, callback);\n\t  }\n\t\n\t  // Sending data as a utf-8 string\n\t  var encoded = packets[packet.type];\n\t\n\t  // data fragment is optional\n\t  if (undefined !== packet.data) {\n\t    encoded += utf8encode ? utf8.encode(String(packet.data), { strict: false }) : String(packet.data);\n\t  }\n\t\n\t  return callback('' + encoded);\n\t\n\t};\n\t\n\tfunction encodeBase64Object(packet, callback) {\n\t  // packet data is an object { base64: true, data: dataAsBase64String }\n\t  var message = 'b' + exports.packets[packet.type] + packet.data.data;\n\t  return callback(message);\n\t}\n\t\n\t/**\n\t * Encode packet helpers for binary types\n\t */\n\t\n\tfunction encodeArrayBuffer(packet, supportsBinary, callback) {\n\t  if (!supportsBinary) {\n\t    return exports.encodeBase64Packet(packet, callback);\n\t  }\n\t\n\t  var data = packet.data;\n\t  var contentArray = new Uint8Array(data);\n\t  var resultBuffer = new Uint8Array(1 + data.byteLength);\n\t\n\t  resultBuffer[0] = packets[packet.type];\n\t  for (var i = 0; i < contentArray.length; i++) {\n\t    resultBuffer[i+1] = contentArray[i];\n\t  }\n\t\n\t  return callback(resultBuffer.buffer);\n\t}\n\t\n\tfunction encodeBlobAsArrayBuffer(packet, supportsBinary, callback) {\n\t  if (!supportsBinary) {\n\t    return exports.encodeBase64Packet(packet, callback);\n\t  }\n\t\n\t  var fr = new FileReader();\n\t  fr.onload = function() {\n\t    packet.data = fr.result;\n\t    exports.encodePacket(packet, supportsBinary, true, callback);\n\t  };\n\t  return fr.readAsArrayBuffer(packet.data);\n\t}\n\t\n\tfunction encodeBlob(packet, supportsBinary, callback) {\n\t  if (!supportsBinary) {\n\t    return exports.encodeBase64Packet(packet, callback);\n\t  }\n\t\n\t  if (dontSendBlobs) {\n\t    return encodeBlobAsArrayBuffer(packet, supportsBinary, callback);\n\t  }\n\t\n\t  var length = new Uint8Array(1);\n\t  length[0] = packets[packet.type];\n\t  var blob = new Blob([length.buffer, packet.data]);\n\t\n\t  return callback(blob);\n\t}\n\t\n\t/**\n\t * Encodes a packet with binary data in a base64 string\n\t *\n\t * @param {Object} packet, has `type` and `data`\n\t * @return {String} base64 encoded message\n\t */\n\t\n\texports.encodeBase64Packet = function(packet, callback) {\n\t  var message = 'b' + exports.packets[packet.type];\n\t  if (Blob && packet.data instanceof global.Blob) {\n\t    var fr = new FileReader();\n\t    fr.onload = function() {\n\t      var b64 = fr.result.split(',')[1];\n\t      callback(message + b64);\n\t    };\n\t    return fr.readAsDataURL(packet.data);\n\t  }\n\t\n\t  var b64data;\n\t  try {\n\t    b64data = String.fromCharCode.apply(null, new Uint8Array(packet.data));\n\t  } catch (e) {\n\t    // iPhone Safari doesn't let you apply with typed arrays\n\t    var typed = new Uint8Array(packet.data);\n\t    var basic = new Array(typed.length);\n\t    for (var i = 0; i < typed.length; i++) {\n\t      basic[i] = typed[i];\n\t    }\n\t    b64data = String.fromCharCode.apply(null, basic);\n\t  }\n\t  message += global.btoa(b64data);\n\t  return callback(message);\n\t};\n\t\n\t/**\n\t * Decodes a packet. Changes format to Blob if requested.\n\t *\n\t * @return {Object} with `type` and `data` (if any)\n\t * @api private\n\t */\n\t\n\texports.decodePacket = function (data, binaryType, utf8decode) {\n\t  if (data === undefined) {\n\t    return err;\n\t  }\n\t  // String data\n\t  if (typeof data === 'string') {\n\t    if (data.charAt(0) === 'b') {\n\t      return exports.decodeBase64Packet(data.substr(1), binaryType);\n\t    }\n\t\n\t    if (utf8decode) {\n\t      data = tryDecode(data);\n\t      if (data === false) {\n\t        return err;\n\t      }\n\t    }\n\t    var type = data.charAt(0);\n\t\n\t    if (Number(type) != type || !packetslist[type]) {\n\t      return err;\n\t    }\n\t\n\t    if (data.length > 1) {\n\t      return { type: packetslist[type], data: data.substring(1) };\n\t    } else {\n\t      return { type: packetslist[type] };\n\t    }\n\t  }\n\t\n\t  var asArray = new Uint8Array(data);\n\t  var type = asArray[0];\n\t  var rest = sliceBuffer(data, 1);\n\t  if (Blob && binaryType === 'blob') {\n\t    rest = new Blob([rest]);\n\t  }\n\t  return { type: packetslist[type], data: rest };\n\t};\n\t\n\tfunction tryDecode(data) {\n\t  try {\n\t    data = utf8.decode(data, { strict: false });\n\t  } catch (e) {\n\t    return false;\n\t  }\n\t  return data;\n\t}\n\t\n\t/**\n\t * Decodes a packet encoded in a base64 string\n\t *\n\t * @param {String} base64 encoded message\n\t * @return {Object} with `type` and `data` (if any)\n\t */\n\t\n\texports.decodeBase64Packet = function(msg, binaryType) {\n\t  var type = packetslist[msg.charAt(0)];\n\t  if (!base64encoder) {\n\t    return { type: type, data: { base64: true, data: msg.substr(1) } };\n\t  }\n\t\n\t  var data = base64encoder.decode(msg.substr(1));\n\t\n\t  if (binaryType === 'blob' && Blob) {\n\t    data = new Blob([data]);\n\t  }\n\t\n\t  return { type: type, data: data };\n\t};\n\t\n\t/**\n\t * Encodes multiple messages (payload).\n\t *\n\t *     <length>:data\n\t *\n\t * Example:\n\t *\n\t *     11:hello world2:hi\n\t *\n\t * If any contents are binary, they will be encoded as base64 strings. Base64\n\t * encoded strings are marked with a b before the length specifier\n\t *\n\t * @param {Array} packets\n\t * @api private\n\t */\n\t\n\texports.encodePayload = function (packets, supportsBinary, callback) {\n\t  if (typeof supportsBinary === 'function') {\n\t    callback = supportsBinary;\n\t    supportsBinary = null;\n\t  }\n\t\n\t  var isBinary = hasBinary(packets);\n\t\n\t  if (supportsBinary && isBinary) {\n\t    if (Blob && !dontSendBlobs) {\n\t      return exports.encodePayloadAsBlob(packets, callback);\n\t    }\n\t\n\t    return exports.encodePayloadAsArrayBuffer(packets, callback);\n\t  }\n\t\n\t  if (!packets.length) {\n\t    return callback('0:');\n\t  }\n\t\n\t  function setLengthHeader(message) {\n\t    return message.length + ':' + message;\n\t  }\n\t\n\t  function encodeOne(packet, doneCallback) {\n\t    exports.encodePacket(packet, !isBinary ? false : supportsBinary, false, function(message) {\n\t      doneCallback(null, setLengthHeader(message));\n\t    });\n\t  }\n\t\n\t  map(packets, encodeOne, function(err, results) {\n\t    return callback(results.join(''));\n\t  });\n\t};\n\t\n\t/**\n\t * Async array map using after\n\t */\n\t\n\tfunction map(ary, each, done) {\n\t  var result = new Array(ary.length);\n\t  var next = after(ary.length, done);\n\t\n\t  var eachWithIndex = function(i, el, cb) {\n\t    each(el, function(error, msg) {\n\t      result[i] = msg;\n\t      cb(error, result);\n\t    });\n\t  };\n\t\n\t  for (var i = 0; i < ary.length; i++) {\n\t    eachWithIndex(i, ary[i], next);\n\t  }\n\t}\n\t\n\t/*\n\t * Decodes data when a payload is maybe expected. Possible binary contents are\n\t * decoded from their base64 representation\n\t *\n\t * @param {String} data, callback method\n\t * @api public\n\t */\n\t\n\texports.decodePayload = function (data, binaryType, callback) {\n\t  if (typeof data !== 'string') {\n\t    return exports.decodePayloadAsBinary(data, binaryType, callback);\n\t  }\n\t\n\t  if (typeof binaryType === 'function') {\n\t    callback = binaryType;\n\t    binaryType = null;\n\t  }\n\t\n\t  var packet;\n\t  if (data === '') {\n\t    // parser error - ignoring payload\n\t    return callback(err, 0, 1);\n\t  }\n\t\n\t  var length = '', n, msg;\n\t\n\t  for (var i = 0, l = data.length; i < l; i++) {\n\t    var chr = data.charAt(i);\n\t\n\t    if (chr !== ':') {\n\t      length += chr;\n\t      continue;\n\t    }\n\t\n\t    if (length === '' || (length != (n = Number(length)))) {\n\t      // parser error - ignoring payload\n\t      return callback(err, 0, 1);\n\t    }\n\t\n\t    msg = data.substr(i + 1, n);\n\t\n\t    if (length != msg.length) {\n\t      // parser error - ignoring payload\n\t      return callback(err, 0, 1);\n\t    }\n\t\n\t    if (msg.length) {\n\t      packet = exports.decodePacket(msg, binaryType, false);\n\t\n\t      if (err.type === packet.type && err.data === packet.data) {\n\t        // parser error in individual packet - ignoring payload\n\t        return callback(err, 0, 1);\n\t      }\n\t\n\t      var ret = callback(packet, i + n, l);\n\t      if (false === ret) return;\n\t    }\n\t\n\t    // advance cursor\n\t    i += n;\n\t    length = '';\n\t  }\n\t\n\t  if (length !== '') {\n\t    // parser error - ignoring payload\n\t    return callback(err, 0, 1);\n\t  }\n\t\n\t};\n\t\n\t/**\n\t * Encodes multiple messages (payload) as binary.\n\t *\n\t * <1 = binary, 0 = string><number from 0-9><number from 0-9>[...]<number\n\t * 255><data>\n\t *\n\t * Example:\n\t * 1 3 255 1 2 3, if the binary contents are interpreted as 8 bit integers\n\t *\n\t * @param {Array} packets\n\t * @return {ArrayBuffer} encoded payload\n\t * @api private\n\t */\n\t\n\texports.encodePayloadAsArrayBuffer = function(packets, callback) {\n\t  if (!packets.length) {\n\t    return callback(new ArrayBuffer(0));\n\t  }\n\t\n\t  function encodeOne(packet, doneCallback) {\n\t    exports.encodePacket(packet, true, true, function(data) {\n\t      return doneCallback(null, data);\n\t    });\n\t  }\n\t\n\t  map(packets, encodeOne, function(err, encodedPackets) {\n\t    var totalLength = encodedPackets.reduce(function(acc, p) {\n\t      var len;\n\t      if (typeof p === 'string'){\n\t        len = p.length;\n\t      } else {\n\t        len = p.byteLength;\n\t      }\n\t      return acc + len.toString().length + len + 2; // string/binary identifier + separator = 2\n\t    }, 0);\n\t\n\t    var resultArray = new Uint8Array(totalLength);\n\t\n\t    var bufferIndex = 0;\n\t    encodedPackets.forEach(function(p) {\n\t      var isString = typeof p === 'string';\n\t      var ab = p;\n\t      if (isString) {\n\t        var view = new Uint8Array(p.length);\n\t        for (var i = 0; i < p.length; i++) {\n\t          view[i] = p.charCodeAt(i);\n\t        }\n\t        ab = view.buffer;\n\t      }\n\t\n\t      if (isString) { // not true binary\n\t        resultArray[bufferIndex++] = 0;\n\t      } else { // true binary\n\t        resultArray[bufferIndex++] = 1;\n\t      }\n\t\n\t      var lenStr = ab.byteLength.toString();\n\t      for (var i = 0; i < lenStr.length; i++) {\n\t        resultArray[bufferIndex++] = parseInt(lenStr[i]);\n\t      }\n\t      resultArray[bufferIndex++] = 255;\n\t\n\t      var view = new Uint8Array(ab);\n\t      for (var i = 0; i < view.length; i++) {\n\t        resultArray[bufferIndex++] = view[i];\n\t      }\n\t    });\n\t\n\t    return callback(resultArray.buffer);\n\t  });\n\t};\n\t\n\t/**\n\t * Encode as Blob\n\t */\n\t\n\texports.encodePayloadAsBlob = function(packets, callback) {\n\t  function encodeOne(packet, doneCallback) {\n\t    exports.encodePacket(packet, true, true, function(encoded) {\n\t      var binaryIdentifier = new Uint8Array(1);\n\t      binaryIdentifier[0] = 1;\n\t      if (typeof encoded === 'string') {\n\t        var view = new Uint8Array(encoded.length);\n\t        for (var i = 0; i < encoded.length; i++) {\n\t          view[i] = encoded.charCodeAt(i);\n\t        }\n\t        encoded = view.buffer;\n\t        binaryIdentifier[0] = 0;\n\t      }\n\t\n\t      var len = (encoded instanceof ArrayBuffer)\n\t        ? encoded.byteLength\n\t        : encoded.size;\n\t\n\t      var lenStr = len.toString();\n\t      var lengthAry = new Uint8Array(lenStr.length + 1);\n\t      for (var i = 0; i < lenStr.length; i++) {\n\t        lengthAry[i] = parseInt(lenStr[i]);\n\t      }\n\t      lengthAry[lenStr.length] = 255;\n\t\n\t      if (Blob) {\n\t        var blob = new Blob([binaryIdentifier.buffer, lengthAry.buffer, encoded]);\n\t        doneCallback(null, blob);\n\t      }\n\t    });\n\t  }\n\t\n\t  map(packets, encodeOne, function(err, results) {\n\t    return callback(new Blob(results));\n\t  });\n\t};\n\t\n\t/*\n\t * Decodes data when a payload is maybe expected. Strings are decoded by\n\t * interpreting each byte as a key code for entries marked to start with 0. See\n\t * description of encodePayloadAsBinary\n\t *\n\t * @param {ArrayBuffer} data, callback method\n\t * @api public\n\t */\n\t\n\texports.decodePayloadAsBinary = function (data, binaryType, callback) {\n\t  if (typeof binaryType === 'function') {\n\t    callback = binaryType;\n\t    binaryType = null;\n\t  }\n\t\n\t  var bufferTail = data;\n\t  var buffers = [];\n\t\n\t  while (bufferTail.byteLength > 0) {\n\t    var tailArray = new Uint8Array(bufferTail);\n\t    var isString = tailArray[0] === 0;\n\t    var msgLength = '';\n\t\n\t    for (var i = 1; ; i++) {\n\t      if (tailArray[i] === 255) break;\n\t\n\t      // 310 = char length of Number.MAX_VALUE\n\t      if (msgLength.length > 310) {\n\t        return callback(err, 0, 1);\n\t      }\n\t\n\t      msgLength += tailArray[i];\n\t    }\n\t\n\t    bufferTail = sliceBuffer(bufferTail, 2 + msgLength.length);\n\t    msgLength = parseInt(msgLength);\n\t\n\t    var msg = sliceBuffer(bufferTail, 0, msgLength);\n\t    if (isString) {\n\t      try {\n\t        msg = String.fromCharCode.apply(null, new Uint8Array(msg));\n\t      } catch (e) {\n\t        // iPhone Safari doesn't let you apply to typed arrays\n\t        var typed = new Uint8Array(msg);\n\t        msg = '';\n\t        for (var i = 0; i < typed.length; i++) {\n\t          msg += String.fromCharCode(typed[i]);\n\t        }\n\t      }\n\t    }\n\t\n\t    buffers.push(msg);\n\t    bufferTail = sliceBuffer(bufferTail, msgLength);\n\t  }\n\t\n\t  var total = buffers.length;\n\t  buffers.forEach(function(buffer, i) {\n\t    callback(exports.decodePacket(buffer, binaryType, true), i, total);\n\t  });\n\t};\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports) {\n\n\t\n\t/**\n\t * Gets the keys for an object.\n\t *\n\t * @return {Array} keys\n\t * @api private\n\t */\n\t\n\tmodule.exports = Object.keys || function keys (obj){\n\t  var arr = [];\n\t  var has = Object.prototype.hasOwnProperty;\n\t\n\t  for (var i in obj) {\n\t    if (has.call(obj, i)) {\n\t      arr.push(i);\n\t    }\n\t  }\n\t  return arr;\n\t};\n\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports) {\n\n\t/**\n\t * An abstraction for slicing an arraybuffer even when\n\t * ArrayBuffer.prototype.slice is not supported\n\t *\n\t * @api public\n\t */\n\t\n\tmodule.exports = function(arraybuffer, start, end) {\n\t  var bytes = arraybuffer.byteLength;\n\t  start = start || 0;\n\t  end = end || bytes;\n\t\n\t  if (arraybuffer.slice) { return arraybuffer.slice(start, end); }\n\t\n\t  if (start < 0) { start += bytes; }\n\t  if (end < 0) { end += bytes; }\n\t  if (end > bytes) { end = bytes; }\n\t\n\t  if (start >= bytes || start >= end || bytes === 0) {\n\t    return new ArrayBuffer(0);\n\t  }\n\t\n\t  var abv = new Uint8Array(arraybuffer);\n\t  var result = new Uint8Array(end - start);\n\t  for (var i = start, ii = 0; i < end; i++, ii++) {\n\t    result[ii] = abv[i];\n\t  }\n\t  return result.buffer;\n\t};\n\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports) {\n\n\tmodule.exports = after\n\t\n\tfunction after(count, callback, err_cb) {\n\t    var bail = false\n\t    err_cb = err_cb || noop\n\t    proxy.count = count\n\t\n\t    return (count === 0) ? callback() : proxy\n\t\n\t    function proxy(err, result) {\n\t        if (proxy.count <= 0) {\n\t            throw new Error('after called too many times')\n\t        }\n\t        --proxy.count\n\t\n\t        // after first error, rest are passed to err_cb\n\t        if (err) {\n\t            bail = true\n\t            callback(err)\n\t            // future error callbacks will go to error handler\n\t            callback = err_cb\n\t        } else if (proxy.count === 0 && !bail) {\n\t            callback(null, result)\n\t        }\n\t    }\n\t}\n\t\n\tfunction noop() {}\n\n\n/***/ }),\n/* 27 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! https://mths.be/utf8js v2.1.2 by @mathias */\n\t;(function(root) {\n\t\n\t\t// Detect free variables `exports`\n\t\tvar freeExports = typeof exports == 'object' && exports;\n\t\n\t\t// Detect free variable `module`\n\t\tvar freeModule = typeof module == 'object' && module &&\n\t\t\tmodule.exports == freeExports && module;\n\t\n\t\t// Detect free variable `global`, from Node.js or Browserified code,\n\t\t// and use it as `root`\n\t\tvar freeGlobal = typeof global == 'object' && global;\n\t\tif (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {\n\t\t\troot = freeGlobal;\n\t\t}\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\tvar stringFromCharCode = String.fromCharCode;\n\t\n\t\t// Taken from https://mths.be/punycode\n\t\tfunction ucs2decode(string) {\n\t\t\tvar output = [];\n\t\t\tvar counter = 0;\n\t\t\tvar length = string.length;\n\t\t\tvar value;\n\t\t\tvar extra;\n\t\t\twhile (counter < length) {\n\t\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\t\toutput.push(value);\n\t\t\t\t\t\tcounter--;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\toutput.push(value);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn output;\n\t\t}\n\t\n\t\t// Taken from https://mths.be/punycode\n\t\tfunction ucs2encode(array) {\n\t\t\tvar length = array.length;\n\t\t\tvar index = -1;\n\t\t\tvar value;\n\t\t\tvar output = '';\n\t\t\twhile (++index < length) {\n\t\t\t\tvalue = array[index];\n\t\t\t\tif (value > 0xFFFF) {\n\t\t\t\t\tvalue -= 0x10000;\n\t\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t\t}\n\t\t\t\toutput += stringFromCharCode(value);\n\t\t\t}\n\t\t\treturn output;\n\t\t}\n\t\n\t\tfunction checkScalarValue(codePoint, strict) {\n\t\t\tif (codePoint >= 0xD800 && codePoint <= 0xDFFF) {\n\t\t\t\tif (strict) {\n\t\t\t\t\tthrow Error(\n\t\t\t\t\t\t'Lone surrogate U+' + codePoint.toString(16).toUpperCase() +\n\t\t\t\t\t\t' is not a scalar value'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\tfunction createByte(codePoint, shift) {\n\t\t\treturn stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80);\n\t\t}\n\t\n\t\tfunction encodeCodePoint(codePoint, strict) {\n\t\t\tif ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence\n\t\t\t\treturn stringFromCharCode(codePoint);\n\t\t\t}\n\t\t\tvar symbol = '';\n\t\t\tif ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence\n\t\t\t\tsymbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0);\n\t\t\t}\n\t\t\telse if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence\n\t\t\t\tif (!checkScalarValue(codePoint, strict)) {\n\t\t\t\t\tcodePoint = 0xFFFD;\n\t\t\t\t}\n\t\t\t\tsymbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0);\n\t\t\t\tsymbol += createByte(codePoint, 6);\n\t\t\t}\n\t\t\telse if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence\n\t\t\t\tsymbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0);\n\t\t\t\tsymbol += createByte(codePoint, 12);\n\t\t\t\tsymbol += createByte(codePoint, 6);\n\t\t\t}\n\t\t\tsymbol += stringFromCharCode((codePoint & 0x3F) | 0x80);\n\t\t\treturn symbol;\n\t\t}\n\t\n\t\tfunction utf8encode(string, opts) {\n\t\t\topts = opts || {};\n\t\t\tvar strict = false !== opts.strict;\n\t\n\t\t\tvar codePoints = ucs2decode(string);\n\t\t\tvar length = codePoints.length;\n\t\t\tvar index = -1;\n\t\t\tvar codePoint;\n\t\t\tvar byteString = '';\n\t\t\twhile (++index < length) {\n\t\t\t\tcodePoint = codePoints[index];\n\t\t\t\tbyteString += encodeCodePoint(codePoint, strict);\n\t\t\t}\n\t\t\treturn byteString;\n\t\t}\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\tfunction readContinuationByte() {\n\t\t\tif (byteIndex >= byteCount) {\n\t\t\t\tthrow Error('Invalid byte index');\n\t\t\t}\n\t\n\t\t\tvar continuationByte = byteArray[byteIndex] & 0xFF;\n\t\t\tbyteIndex++;\n\t\n\t\t\tif ((continuationByte & 0xC0) == 0x80) {\n\t\t\t\treturn continuationByte & 0x3F;\n\t\t\t}\n\t\n\t\t\t// If we end up here, it’s not a continuation byte\n\t\t\tthrow Error('Invalid continuation byte');\n\t\t}\n\t\n\t\tfunction decodeSymbol(strict) {\n\t\t\tvar byte1;\n\t\t\tvar byte2;\n\t\t\tvar byte3;\n\t\t\tvar byte4;\n\t\t\tvar codePoint;\n\t\n\t\t\tif (byteIndex > byteCount) {\n\t\t\t\tthrow Error('Invalid byte index');\n\t\t\t}\n\t\n\t\t\tif (byteIndex == byteCount) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\n\t\t\t// Read first byte\n\t\t\tbyte1 = byteArray[byteIndex] & 0xFF;\n\t\t\tbyteIndex++;\n\t\n\t\t\t// 1-byte sequence (no continuation bytes)\n\t\t\tif ((byte1 & 0x80) == 0) {\n\t\t\t\treturn byte1;\n\t\t\t}\n\t\n\t\t\t// 2-byte sequence\n\t\t\tif ((byte1 & 0xE0) == 0xC0) {\n\t\t\t\tbyte2 = readContinuationByte();\n\t\t\t\tcodePoint = ((byte1 & 0x1F) << 6) | byte2;\n\t\t\t\tif (codePoint >= 0x80) {\n\t\t\t\t\treturn codePoint;\n\t\t\t\t} else {\n\t\t\t\t\tthrow Error('Invalid continuation byte');\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// 3-byte sequence (may include unpaired surrogates)\n\t\t\tif ((byte1 & 0xF0) == 0xE0) {\n\t\t\t\tbyte2 = readContinuationByte();\n\t\t\t\tbyte3 = readContinuationByte();\n\t\t\t\tcodePoint = ((byte1 & 0x0F) << 12) | (byte2 << 6) | byte3;\n\t\t\t\tif (codePoint >= 0x0800) {\n\t\t\t\t\treturn checkScalarValue(codePoint, strict) ? codePoint : 0xFFFD;\n\t\t\t\t} else {\n\t\t\t\t\tthrow Error('Invalid continuation byte');\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// 4-byte sequence\n\t\t\tif ((byte1 & 0xF8) == 0xF0) {\n\t\t\t\tbyte2 = readContinuationByte();\n\t\t\t\tbyte3 = readContinuationByte();\n\t\t\t\tbyte4 = readContinuationByte();\n\t\t\t\tcodePoint = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0C) |\n\t\t\t\t\t(byte3 << 0x06) | byte4;\n\t\t\t\tif (codePoint >= 0x010000 && codePoint <= 0x10FFFF) {\n\t\t\t\t\treturn codePoint;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\tthrow Error('Invalid UTF-8 detected');\n\t\t}\n\t\n\t\tvar byteArray;\n\t\tvar byteCount;\n\t\tvar byteIndex;\n\t\tfunction utf8decode(byteString, opts) {\n\t\t\topts = opts || {};\n\t\t\tvar strict = false !== opts.strict;\n\t\n\t\t\tbyteArray = ucs2decode(byteString);\n\t\t\tbyteCount = byteArray.length;\n\t\t\tbyteIndex = 0;\n\t\t\tvar codePoints = [];\n\t\t\tvar tmp;\n\t\t\twhile ((tmp = decodeSymbol(strict)) !== false) {\n\t\t\t\tcodePoints.push(tmp);\n\t\t\t}\n\t\t\treturn ucs2encode(codePoints);\n\t\t}\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\tvar utf8 = {\n\t\t\t'version': '2.1.2',\n\t\t\t'encode': utf8encode,\n\t\t\t'decode': utf8decode\n\t\t};\n\t\n\t\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t\t// like the following:\n\t\tif (\n\t\t\ttrue\n\t\t) {\n\t\t\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function() {\n\t\t\t\treturn utf8;\n\t\t\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t\t}\telse if (freeExports && !freeExports.nodeType) {\n\t\t\tif (freeModule) { // in Node.js or RingoJS v0.8.0+\n\t\t\t\tfreeModule.exports = utf8;\n\t\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\t\tvar object = {};\n\t\t\t\tvar hasOwnProperty = object.hasOwnProperty;\n\t\t\t\tfor (var key in utf8) {\n\t\t\t\t\thasOwnProperty.call(utf8, key) && (freeExports[key] = utf8[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // in Rhino or a web browser\n\t\t\troot.utf8 = utf8;\n\t\t}\n\t\n\t}(this));\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(28)(module), (function() { return this; }())))\n\n/***/ }),\n/* 28 */\n/***/ (function(module, exports) {\n\n\tmodule.exports = function(module) {\r\n\t\tif(!module.webpackPolyfill) {\r\n\t\t\tmodule.deprecate = function() {};\r\n\t\t\tmodule.paths = [];\r\n\t\t\t// module.parent = undefined by default\r\n\t\t\tmodule.children = [];\r\n\t\t\tmodule.webpackPolyfill = 1;\r\n\t\t}\r\n\t\treturn module;\r\n\t}\r\n\n\n/***/ }),\n/* 29 */\n/***/ (function(module, exports) {\n\n\t/*\n\t * base64-arraybuffer\n\t * https://github.com/niklasvh/base64-arraybuffer\n\t *\n\t * Copyright (c) 2012 Niklas von Hertzen\n\t * Licensed under the MIT license.\n\t */\n\t(function(){\n\t  \"use strict\";\n\t\n\t  var chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\t\n\t  // Use a lookup table to find the index.\n\t  var lookup = new Uint8Array(256);\n\t  for (var i = 0; i < chars.length; i++) {\n\t    lookup[chars.charCodeAt(i)] = i;\n\t  }\n\t\n\t  exports.encode = function(arraybuffer) {\n\t    var bytes = new Uint8Array(arraybuffer),\n\t    i, len = bytes.length, base64 = \"\";\n\t\n\t    for (i = 0; i < len; i+=3) {\n\t      base64 += chars[bytes[i] >> 2];\n\t      base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n\t      base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n\t      base64 += chars[bytes[i + 2] & 63];\n\t    }\n\t\n\t    if ((len % 3) === 2) {\n\t      base64 = base64.substring(0, base64.length - 1) + \"=\";\n\t    } else if (len % 3 === 1) {\n\t      base64 = base64.substring(0, base64.length - 2) + \"==\";\n\t    }\n\t\n\t    return base64;\n\t  };\n\t\n\t  exports.decode =  function(base64) {\n\t    var bufferLength = base64.length * 0.75,\n\t    len = base64.length, i, p = 0,\n\t    encoded1, encoded2, encoded3, encoded4;\n\t\n\t    if (base64[base64.length - 1] === \"=\") {\n\t      bufferLength--;\n\t      if (base64[base64.length - 2] === \"=\") {\n\t        bufferLength--;\n\t      }\n\t    }\n\t\n\t    var arraybuffer = new ArrayBuffer(bufferLength),\n\t    bytes = new Uint8Array(arraybuffer);\n\t\n\t    for (i = 0; i < len; i+=4) {\n\t      encoded1 = lookup[base64.charCodeAt(i)];\n\t      encoded2 = lookup[base64.charCodeAt(i+1)];\n\t      encoded3 = lookup[base64.charCodeAt(i+2)];\n\t      encoded4 = lookup[base64.charCodeAt(i+3)];\n\t\n\t      bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n\t      bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n\t      bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n\t    }\n\t\n\t    return arraybuffer;\n\t  };\n\t})();\n\n\n/***/ }),\n/* 30 */\n/***/ (function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/**\n\t * Create a blob builder even when vendor prefixes exist\n\t */\n\t\n\tvar BlobBuilder = global.BlobBuilder\n\t  || global.WebKitBlobBuilder\n\t  || global.MSBlobBuilder\n\t  || global.MozBlobBuilder;\n\t\n\t/**\n\t * Check if Blob constructor is supported\n\t */\n\t\n\tvar blobSupported = (function() {\n\t  try {\n\t    var a = new Blob(['hi']);\n\t    return a.size === 2;\n\t  } catch(e) {\n\t    return false;\n\t  }\n\t})();\n\t\n\t/**\n\t * Check if Blob constructor supports ArrayBufferViews\n\t * Fails in Safari 6, so we need to map to ArrayBuffers there.\n\t */\n\t\n\tvar blobSupportsArrayBufferView = blobSupported && (function() {\n\t  try {\n\t    var b = new Blob([new Uint8Array([1,2])]);\n\t    return b.size === 2;\n\t  } catch(e) {\n\t    return false;\n\t  }\n\t})();\n\t\n\t/**\n\t * Check if BlobBuilder is supported\n\t */\n\t\n\tvar blobBuilderSupported = BlobBuilder\n\t  && BlobBuilder.prototype.append\n\t  && BlobBuilder.prototype.getBlob;\n\t\n\t/**\n\t * Helper function that maps ArrayBufferViews to ArrayBuffers\n\t * Used by BlobBuilder constructor and old browsers that didn't\n\t * support it in the Blob constructor.\n\t */\n\t\n\tfunction mapArrayBufferViews(ary) {\n\t  for (var i = 0; i < ary.length; i++) {\n\t    var chunk = ary[i];\n\t    if (chunk.buffer instanceof ArrayBuffer) {\n\t      var buf = chunk.buffer;\n\t\n\t      // if this is a subarray, make a copy so we only\n\t      // include the subarray region from the underlying buffer\n\t      if (chunk.byteLength !== buf.byteLength) {\n\t        var copy = new Uint8Array(chunk.byteLength);\n\t        copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n\t        buf = copy.buffer;\n\t      }\n\t\n\t      ary[i] = buf;\n\t    }\n\t  }\n\t}\n\t\n\tfunction BlobBuilderConstructor(ary, options) {\n\t  options = options || {};\n\t\n\t  var bb = new BlobBuilder();\n\t  mapArrayBufferViews(ary);\n\t\n\t  for (var i = 0; i < ary.length; i++) {\n\t    bb.append(ary[i]);\n\t  }\n\t\n\t  return (options.type) ? bb.getBlob(options.type) : bb.getBlob();\n\t};\n\t\n\tfunction BlobConstructor(ary, options) {\n\t  mapArrayBufferViews(ary);\n\t  return new Blob(ary, options || {});\n\t};\n\t\n\tmodule.exports = (function() {\n\t  if (blobSupported) {\n\t    return blobSupportsArrayBufferView ? global.Blob : BlobConstructor;\n\t  } else if (blobBuilderSupported) {\n\t    return BlobBuilderConstructor;\n\t  } else {\n\t    return undefined;\n\t  }\n\t})();\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 31 */\n/***/ (function(module, exports) {\n\n\t/**\r\n\t * Compiles a querystring\r\n\t * Returns string representation of the object\r\n\t *\r\n\t * @param {Object}\r\n\t * @api private\r\n\t */\r\n\t\r\n\texports.encode = function (obj) {\r\n\t  var str = '';\r\n\t\r\n\t  for (var i in obj) {\r\n\t    if (obj.hasOwnProperty(i)) {\r\n\t      if (str.length) str += '&';\r\n\t      str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]);\r\n\t    }\r\n\t  }\r\n\t\r\n\t  return str;\r\n\t};\r\n\t\r\n\t/**\r\n\t * Parses a simple querystring into an object\r\n\t *\r\n\t * @param {String} qs\r\n\t * @api private\r\n\t */\r\n\t\r\n\texports.decode = function(qs){\r\n\t  var qry = {};\r\n\t  var pairs = qs.split('&');\r\n\t  for (var i = 0, l = pairs.length; i < l; i++) {\r\n\t    var pair = pairs[i].split('=');\r\n\t    qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);\r\n\t  }\r\n\t  return qry;\r\n\t};\r\n\n\n/***/ }),\n/* 32 */\n/***/ (function(module, exports) {\n\n\t\n\tmodule.exports = function(a, b){\n\t  var fn = function(){};\n\t  fn.prototype = b.prototype;\n\t  a.prototype = new fn;\n\t  a.prototype.constructor = a;\n\t};\n\n/***/ }),\n/* 33 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\tvar alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split('')\n\t  , length = 64\n\t  , map = {}\n\t  , seed = 0\n\t  , i = 0\n\t  , prev;\n\t\n\t/**\n\t * Return a string representing the specified number.\n\t *\n\t * @param {Number} num The number to convert.\n\t * @returns {String} The string representation of the number.\n\t * @api public\n\t */\n\tfunction encode(num) {\n\t  var encoded = '';\n\t\n\t  do {\n\t    encoded = alphabet[num % length] + encoded;\n\t    num = Math.floor(num / length);\n\t  } while (num > 0);\n\t\n\t  return encoded;\n\t}\n\t\n\t/**\n\t * Return the integer value specified by the given string.\n\t *\n\t * @param {String} str The string to convert.\n\t * @returns {Number} The integer value represented by the string.\n\t * @api public\n\t */\n\tfunction decode(str) {\n\t  var decoded = 0;\n\t\n\t  for (i = 0; i < str.length; i++) {\n\t    decoded = decoded * length + map[str.charAt(i)];\n\t  }\n\t\n\t  return decoded;\n\t}\n\t\n\t/**\n\t * Yeast: A tiny growing id generator.\n\t *\n\t * @returns {String} A unique id.\n\t * @api public\n\t */\n\tfunction yeast() {\n\t  var now = encode(+new Date());\n\t\n\t  if (now !== prev) return seed = 0, prev = now;\n\t  return now +'.'+ encode(seed++);\n\t}\n\t\n\t//\n\t// Map each character to its index.\n\t//\n\tfor (; i < length; i++) map[alphabet[i]] = i;\n\t\n\t//\n\t// Expose the `yeast`, `encode` and `decode` functions.\n\t//\n\tyeast.encode = encode;\n\tyeast.decode = decode;\n\tmodule.exports = yeast;\n\n\n/***/ }),\n/* 34 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {\n\t/**\n\t * Module requirements.\n\t */\n\t\n\tvar Polling = __webpack_require__(21);\n\tvar inherit = __webpack_require__(32);\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = JSONPPolling;\n\t\n\t/**\n\t * Cached regular expressions.\n\t */\n\t\n\tvar rNewline = /\\n/g;\n\tvar rEscapedNewline = /\\\\n/g;\n\t\n\t/**\n\t * Global JSONP callbacks.\n\t */\n\t\n\tvar callbacks;\n\t\n\t/**\n\t * Noop.\n\t */\n\t\n\tfunction empty () { }\n\t\n\t/**\n\t * JSONP Polling constructor.\n\t *\n\t * @param {Object} opts.\n\t * @api public\n\t */\n\t\n\tfunction JSONPPolling (opts) {\n\t  Polling.call(this, opts);\n\t\n\t  this.query = this.query || {};\n\t\n\t  // define global callbacks array if not present\n\t  // we do this here (lazily) to avoid unneeded global pollution\n\t  if (!callbacks) {\n\t    // we need to consider multiple engines in the same page\n\t    if (!global.___eio) global.___eio = [];\n\t    callbacks = global.___eio;\n\t  }\n\t\n\t  // callback identifier\n\t  this.index = callbacks.length;\n\t\n\t  // add callback to jsonp global\n\t  var self = this;\n\t  callbacks.push(function (msg) {\n\t    self.onData(msg);\n\t  });\n\t\n\t  // append to query string\n\t  this.query.j = this.index;\n\t\n\t  // prevent spurious errors from being emitted when the window is unloaded\n\t  if (global.document && global.addEventListener) {\n\t    global.addEventListener('beforeunload', function () {\n\t      if (self.script) self.script.onerror = empty;\n\t    }, false);\n\t  }\n\t}\n\t\n\t/**\n\t * Inherits from Polling.\n\t */\n\t\n\tinherit(JSONPPolling, Polling);\n\t\n\t/*\n\t * JSONP only supports binary as base64 encoded strings\n\t */\n\t\n\tJSONPPolling.prototype.supportsBinary = false;\n\t\n\t/**\n\t * Closes the socket.\n\t *\n\t * @api private\n\t */\n\t\n\tJSONPPolling.prototype.doClose = function () {\n\t  if (this.script) {\n\t    this.script.parentNode.removeChild(this.script);\n\t    this.script = null;\n\t  }\n\t\n\t  if (this.form) {\n\t    this.form.parentNode.removeChild(this.form);\n\t    this.form = null;\n\t    this.iframe = null;\n\t  }\n\t\n\t  Polling.prototype.doClose.call(this);\n\t};\n\t\n\t/**\n\t * Starts a poll cycle.\n\t *\n\t * @api private\n\t */\n\t\n\tJSONPPolling.prototype.doPoll = function () {\n\t  var self = this;\n\t  var script = document.createElement('script');\n\t\n\t  if (this.script) {\n\t    this.script.parentNode.removeChild(this.script);\n\t    this.script = null;\n\t  }\n\t\n\t  script.async = true;\n\t  script.src = this.uri();\n\t  script.onerror = function (e) {\n\t    self.onError('jsonp poll error', e);\n\t  };\n\t\n\t  var insertAt = document.getElementsByTagName('script')[0];\n\t  if (insertAt) {\n\t    insertAt.parentNode.insertBefore(script, insertAt);\n\t  } else {\n\t    (document.head || document.body).appendChild(script);\n\t  }\n\t  this.script = script;\n\t\n\t  var isUAgecko = 'undefined' !== typeof navigator && /gecko/i.test(navigator.userAgent);\n\t\n\t  if (isUAgecko) {\n\t    setTimeout(function () {\n\t      var iframe = document.createElement('iframe');\n\t      document.body.appendChild(iframe);\n\t      document.body.removeChild(iframe);\n\t    }, 100);\n\t  }\n\t};\n\t\n\t/**\n\t * Writes with a hidden iframe.\n\t *\n\t * @param {String} data to send\n\t * @param {Function} called upon flush.\n\t * @api private\n\t */\n\t\n\tJSONPPolling.prototype.doWrite = function (data, fn) {\n\t  var self = this;\n\t\n\t  if (!this.form) {\n\t    var form = document.createElement('form');\n\t    var area = document.createElement('textarea');\n\t    var id = this.iframeId = 'eio_iframe_' + this.index;\n\t    var iframe;\n\t\n\t    form.className = 'socketio';\n\t    form.style.position = 'absolute';\n\t    form.style.top = '-1000px';\n\t    form.style.left = '-1000px';\n\t    form.target = id;\n\t    form.method = 'POST';\n\t    form.setAttribute('accept-charset', 'utf-8');\n\t    area.name = 'd';\n\t    form.appendChild(area);\n\t    document.body.appendChild(form);\n\t\n\t    this.form = form;\n\t    this.area = area;\n\t  }\n\t\n\t  this.form.action = this.uri();\n\t\n\t  function complete () {\n\t    initIframe();\n\t    fn();\n\t  }\n\t\n\t  function initIframe () {\n\t    if (self.iframe) {\n\t      try {\n\t        self.form.removeChild(self.iframe);\n\t      } catch (e) {\n\t        self.onError('jsonp polling iframe removal error', e);\n\t      }\n\t    }\n\t\n\t    try {\n\t      // ie6 dynamic iframes with target=\"\" support (thanks Chris Lambacher)\n\t      var html = '<iframe src=\"javascript:0\" name=\"' + self.iframeId + '\">';\n\t      iframe = document.createElement(html);\n\t    } catch (e) {\n\t      iframe = document.createElement('iframe');\n\t      iframe.name = self.iframeId;\n\t      iframe.src = 'javascript:0';\n\t    }\n\t\n\t    iframe.id = self.iframeId;\n\t\n\t    self.form.appendChild(iframe);\n\t    self.iframe = iframe;\n\t  }\n\t\n\t  initIframe();\n\t\n\t  // escape \\n to prevent it from being converted into \\r\\n by some UAs\n\t  // double escaping is required for escaped new lines because unescaping of new lines can be done safely on server-side\n\t  data = data.replace(rEscapedNewline, '\\\\\\n');\n\t  this.area.value = data.replace(rNewline, '\\\\n');\n\t\n\t  try {\n\t    this.form.submit();\n\t  } catch (e) {}\n\t\n\t  if (this.iframe.attachEvent) {\n\t    this.iframe.onreadystatechange = function () {\n\t      if (self.iframe.readyState === 'complete') {\n\t        complete();\n\t      }\n\t    };\n\t  } else {\n\t    this.iframe.onload = complete;\n\t  }\n\t};\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 35 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/**\n\t * Module dependencies.\n\t */\n\t\n\tvar Transport = __webpack_require__(22);\n\tvar parser = __webpack_require__(23);\n\tvar parseqs = __webpack_require__(31);\n\tvar inherit = __webpack_require__(32);\n\tvar yeast = __webpack_require__(33);\n\tvar debug = __webpack_require__(3)('engine.io-client:websocket');\n\tvar BrowserWebSocket = global.WebSocket || global.MozWebSocket;\n\tvar NodeWebSocket;\n\tif (typeof window === 'undefined') {\n\t  try {\n\t    NodeWebSocket = __webpack_require__(36);\n\t  } catch (e) { }\n\t}\n\t\n\t/**\n\t * Get either the `WebSocket` or `MozWebSocket` globals\n\t * in the browser or try to resolve WebSocket-compatible\n\t * interface exposed by `ws` for Node-like environment.\n\t */\n\t\n\tvar WebSocket = BrowserWebSocket;\n\tif (!WebSocket && typeof window === 'undefined') {\n\t  WebSocket = NodeWebSocket;\n\t}\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = WS;\n\t\n\t/**\n\t * WebSocket transport constructor.\n\t *\n\t * @api {Object} connection options\n\t * @api public\n\t */\n\t\n\tfunction WS (opts) {\n\t  var forceBase64 = (opts && opts.forceBase64);\n\t  if (forceBase64) {\n\t    this.supportsBinary = false;\n\t  }\n\t  this.perMessageDeflate = opts.perMessageDeflate;\n\t  this.usingBrowserWebSocket = BrowserWebSocket && !opts.forceNode;\n\t  this.protocols = opts.protocols;\n\t  if (!this.usingBrowserWebSocket) {\n\t    WebSocket = NodeWebSocket;\n\t  }\n\t  Transport.call(this, opts);\n\t}\n\t\n\t/**\n\t * Inherits from Transport.\n\t */\n\t\n\tinherit(WS, Transport);\n\t\n\t/**\n\t * Transport name.\n\t *\n\t * @api public\n\t */\n\t\n\tWS.prototype.name = 'websocket';\n\t\n\t/*\n\t * WebSockets support binary\n\t */\n\t\n\tWS.prototype.supportsBinary = true;\n\t\n\t/**\n\t * Opens socket.\n\t *\n\t * @api private\n\t */\n\t\n\tWS.prototype.doOpen = function () {\n\t  if (!this.check()) {\n\t    // let probe timeout\n\t    return;\n\t  }\n\t\n\t  var uri = this.uri();\n\t  var protocols = this.protocols;\n\t  var opts = {\n\t    agent: this.agent,\n\t    perMessageDeflate: this.perMessageDeflate\n\t  };\n\t\n\t  // SSL options for Node.js client\n\t  opts.pfx = this.pfx;\n\t  opts.key = this.key;\n\t  opts.passphrase = this.passphrase;\n\t  opts.cert = this.cert;\n\t  opts.ca = this.ca;\n\t  opts.ciphers = this.ciphers;\n\t  opts.rejectUnauthorized = this.rejectUnauthorized;\n\t  if (this.extraHeaders) {\n\t    opts.headers = this.extraHeaders;\n\t  }\n\t  if (this.localAddress) {\n\t    opts.localAddress = this.localAddress;\n\t  }\n\t\n\t  try {\n\t    this.ws = this.usingBrowserWebSocket ? (protocols ? new WebSocket(uri, protocols) : new WebSocket(uri)) : new WebSocket(uri, protocols, opts);\n\t  } catch (err) {\n\t    return this.emit('error', err);\n\t  }\n\t\n\t  if (this.ws.binaryType === undefined) {\n\t    this.supportsBinary = false;\n\t  }\n\t\n\t  if (this.ws.supports && this.ws.supports.binary) {\n\t    this.supportsBinary = true;\n\t    this.ws.binaryType = 'nodebuffer';\n\t  } else {\n\t    this.ws.binaryType = 'arraybuffer';\n\t  }\n\t\n\t  this.addEventListeners();\n\t};\n\t\n\t/**\n\t * Adds event listeners to the socket\n\t *\n\t * @api private\n\t */\n\t\n\tWS.prototype.addEventListeners = function () {\n\t  var self = this;\n\t\n\t  this.ws.onopen = function () {\n\t    self.onOpen();\n\t  };\n\t  this.ws.onclose = function () {\n\t    self.onClose();\n\t  };\n\t  this.ws.onmessage = function (ev) {\n\t    self.onData(ev.data);\n\t  };\n\t  this.ws.onerror = function (e) {\n\t    self.onError('websocket error', e);\n\t  };\n\t};\n\t\n\t/**\n\t * Writes data to socket.\n\t *\n\t * @param {Array} array of packets.\n\t * @api private\n\t */\n\t\n\tWS.prototype.write = function (packets) {\n\t  var self = this;\n\t  this.writable = false;\n\t\n\t  // encodePacket efficient as it uses WS framing\n\t  // no need for encodePayload\n\t  var total = packets.length;\n\t  for (var i = 0, l = total; i < l; i++) {\n\t    (function (packet) {\n\t      parser.encodePacket(packet, self.supportsBinary, function (data) {\n\t        if (!self.usingBrowserWebSocket) {\n\t          // always create a new object (GH-437)\n\t          var opts = {};\n\t          if (packet.options) {\n\t            opts.compress = packet.options.compress;\n\t          }\n\t\n\t          if (self.perMessageDeflate) {\n\t            var len = 'string' === typeof data ? global.Buffer.byteLength(data) : data.length;\n\t            if (len < self.perMessageDeflate.threshold) {\n\t              opts.compress = false;\n\t            }\n\t          }\n\t        }\n\t\n\t        // Sometimes the websocket has already been closed but the browser didn't\n\t        // have a chance of informing us about it yet, in that case send will\n\t        // throw an error\n\t        try {\n\t          if (self.usingBrowserWebSocket) {\n\t            // TypeError is thrown when passing the second argument on Safari\n\t            self.ws.send(data);\n\t          } else {\n\t            self.ws.send(data, opts);\n\t          }\n\t        } catch (e) {\n\t          debug('websocket closed before onclose event');\n\t        }\n\t\n\t        --total || done();\n\t      });\n\t    })(packets[i]);\n\t  }\n\t\n\t  function done () {\n\t    self.emit('flush');\n\t\n\t    // fake drain\n\t    // defer to next tick to allow Socket to clear writeBuffer\n\t    setTimeout(function () {\n\t      self.writable = true;\n\t      self.emit('drain');\n\t    }, 0);\n\t  }\n\t};\n\t\n\t/**\n\t * Called upon close\n\t *\n\t * @api private\n\t */\n\t\n\tWS.prototype.onClose = function () {\n\t  Transport.prototype.onClose.call(this);\n\t};\n\t\n\t/**\n\t * Closes socket.\n\t *\n\t * @api private\n\t */\n\t\n\tWS.prototype.doClose = function () {\n\t  if (typeof this.ws !== 'undefined') {\n\t    this.ws.close();\n\t  }\n\t};\n\t\n\t/**\n\t * Generates uri for connection.\n\t *\n\t * @api private\n\t */\n\t\n\tWS.prototype.uri = function () {\n\t  var query = this.query || {};\n\t  var schema = this.secure ? 'wss' : 'ws';\n\t  var port = '';\n\t\n\t  // avoid port if default for schema\n\t  if (this.port && (('wss' === schema && Number(this.port) !== 443) ||\n\t    ('ws' === schema && Number(this.port) !== 80))) {\n\t    port = ':' + this.port;\n\t  }\n\t\n\t  // append timestamp to URI\n\t  if (this.timestampRequests) {\n\t    query[this.timestampParam] = yeast();\n\t  }\n\t\n\t  // communicate binary support capabilities\n\t  if (!this.supportsBinary) {\n\t    query.b64 = 1;\n\t  }\n\t\n\t  query = parseqs.encode(query);\n\t\n\t  // prepend ? to query\n\t  if (query.length) {\n\t    query = '?' + query;\n\t  }\n\t\n\t  var ipv6 = this.hostname.indexOf(':') !== -1;\n\t  return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;\n\t};\n\t\n\t/**\n\t * Feature detection for WebSocket.\n\t *\n\t * @return {Boolean} whether this transport is available.\n\t * @api public\n\t */\n\t\n\tWS.prototype.check = function () {\n\t  return !!WebSocket && !('__initialize' in WebSocket && this.name === WS.prototype.name);\n\t};\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 36 */\n/***/ (function(module, exports) {\n\n\t/* (ignored) */\n\n/***/ }),\n/* 37 */\n/***/ (function(module, exports) {\n\n\t\n\tvar indexOf = [].indexOf;\n\t\n\tmodule.exports = function(arr, obj){\n\t  if (indexOf) return arr.indexOf(obj);\n\t  for (var i = 0; i < arr.length; ++i) {\n\t    if (arr[i] === obj) return i;\n\t  }\n\t  return -1;\n\t};\n\n/***/ }),\n/* 38 */\n/***/ (function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/**\r\n\t * JSON parse.\r\n\t *\r\n\t * @see Based on jQuery#parseJSON (MIT) and JSON2\r\n\t * @api private\r\n\t */\r\n\t\r\n\tvar rvalidchars = /^[\\],:{}\\s]*$/;\r\n\tvar rvalidescape = /\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g;\r\n\tvar rvalidtokens = /\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g;\r\n\tvar rvalidbraces = /(?:^|:|,)(?:\\s*\\[)+/g;\r\n\tvar rtrimLeft = /^\\s+/;\r\n\tvar rtrimRight = /\\s+$/;\r\n\t\r\n\tmodule.exports = function parsejson(data) {\r\n\t  if ('string' != typeof data || !data) {\r\n\t    return null;\r\n\t  }\r\n\t\r\n\t  data = data.replace(rtrimLeft, '').replace(rtrimRight, '');\r\n\t\r\n\t  // Attempt to parse using the native JSON parser first\r\n\t  if (global.JSON && JSON.parse) {\r\n\t    return JSON.parse(data);\r\n\t  }\r\n\t\r\n\t  if (rvalidchars.test(data.replace(rvalidescape, '@')\r\n\t      .replace(rvalidtokens, ']')\r\n\t      .replace(rvalidbraces, ''))) {\r\n\t    return (new Function('return ' + data))();\r\n\t  }\r\n\t};\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 39 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\t\n\t/**\n\t * Module dependencies.\n\t */\n\t\n\tvar parser = __webpack_require__(7);\n\tvar Emitter = __webpack_require__(8);\n\tvar toArray = __webpack_require__(40);\n\tvar on = __webpack_require__(41);\n\tvar bind = __webpack_require__(42);\n\tvar debug = __webpack_require__(3)('socket.io-client:socket');\n\tvar parseqs = __webpack_require__(31);\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = exports = Socket;\n\t\n\t/**\n\t * Internal events (blacklisted).\n\t * These events can't be emitted by the user.\n\t *\n\t * @api private\n\t */\n\t\n\tvar events = {\n\t  connect: 1,\n\t  connect_error: 1,\n\t  connect_timeout: 1,\n\t  connecting: 1,\n\t  disconnect: 1,\n\t  error: 1,\n\t  reconnect: 1,\n\t  reconnect_attempt: 1,\n\t  reconnect_failed: 1,\n\t  reconnect_error: 1,\n\t  reconnecting: 1,\n\t  ping: 1,\n\t  pong: 1\n\t};\n\t\n\t/**\n\t * Shortcut to `Emitter#emit`.\n\t */\n\t\n\tvar emit = Emitter.prototype.emit;\n\t\n\t/**\n\t * `Socket` constructor.\n\t *\n\t * @api public\n\t */\n\t\n\tfunction Socket(io, nsp, opts) {\n\t  this.io = io;\n\t  this.nsp = nsp;\n\t  this.json = this; // compat\n\t  this.ids = 0;\n\t  this.acks = {};\n\t  this.receiveBuffer = [];\n\t  this.sendBuffer = [];\n\t  this.connected = false;\n\t  this.disconnected = true;\n\t  if (opts && opts.query) {\n\t    this.query = opts.query;\n\t  }\n\t  if (this.io.autoConnect) this.open();\n\t}\n\t\n\t/**\n\t * Mix in `Emitter`.\n\t */\n\t\n\tEmitter(Socket.prototype);\n\t\n\t/**\n\t * Subscribe to open, close and packet events\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.subEvents = function () {\n\t  if (this.subs) return;\n\t\n\t  var io = this.io;\n\t  this.subs = [on(io, 'open', bind(this, 'onopen')), on(io, 'packet', bind(this, 'onpacket')), on(io, 'close', bind(this, 'onclose'))];\n\t};\n\t\n\t/**\n\t * \"Opens\" the socket.\n\t *\n\t * @api public\n\t */\n\t\n\tSocket.prototype.open = Socket.prototype.connect = function () {\n\t  if (this.connected) return this;\n\t\n\t  this.subEvents();\n\t  this.io.open(); // ensure open\n\t  if ('open' === this.io.readyState) this.onopen();\n\t  this.emit('connecting');\n\t  return this;\n\t};\n\t\n\t/**\n\t * Sends a `message` event.\n\t *\n\t * @return {Socket} self\n\t * @api public\n\t */\n\t\n\tSocket.prototype.send = function () {\n\t  var args = toArray(arguments);\n\t  args.unshift('message');\n\t  this.emit.apply(this, args);\n\t  return this;\n\t};\n\t\n\t/**\n\t * Override `emit`.\n\t * If the event is in `events`, it's emitted normally.\n\t *\n\t * @param {String} event name\n\t * @return {Socket} self\n\t * @api public\n\t */\n\t\n\tSocket.prototype.emit = function (ev) {\n\t  if (events.hasOwnProperty(ev)) {\n\t    emit.apply(this, arguments);\n\t    return this;\n\t  }\n\t\n\t  var args = toArray(arguments);\n\t  var packet = { type: parser.EVENT, data: args };\n\t\n\t  packet.options = {};\n\t  packet.options.compress = !this.flags || false !== this.flags.compress;\n\t\n\t  // event ack callback\n\t  if ('function' === typeof args[args.length - 1]) {\n\t    debug('emitting packet with ack id %d', this.ids);\n\t    this.acks[this.ids] = args.pop();\n\t    packet.id = this.ids++;\n\t  }\n\t\n\t  if (this.connected) {\n\t    this.packet(packet);\n\t  } else {\n\t    this.sendBuffer.push(packet);\n\t  }\n\t\n\t  delete this.flags;\n\t\n\t  return this;\n\t};\n\t\n\t/**\n\t * Sends a packet.\n\t *\n\t * @param {Object} packet\n\t * @api private\n\t */\n\t\n\tSocket.prototype.packet = function (packet) {\n\t  packet.nsp = this.nsp;\n\t  this.io.packet(packet);\n\t};\n\t\n\t/**\n\t * Called upon engine `open`.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onopen = function () {\n\t  debug('transport is open - connecting');\n\t\n\t  // write connect packet if necessary\n\t  if ('/' !== this.nsp) {\n\t    if (this.query) {\n\t      var query = _typeof(this.query) === 'object' ? parseqs.encode(this.query) : this.query;\n\t      debug('sending connect packet with query %s', query);\n\t      this.packet({ type: parser.CONNECT, query: query });\n\t    } else {\n\t      this.packet({ type: parser.CONNECT });\n\t    }\n\t  }\n\t};\n\t\n\t/**\n\t * Called upon engine `close`.\n\t *\n\t * @param {String} reason\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onclose = function (reason) {\n\t  debug('close (%s)', reason);\n\t  this.connected = false;\n\t  this.disconnected = true;\n\t  delete this.id;\n\t  this.emit('disconnect', reason);\n\t};\n\t\n\t/**\n\t * Called with socket packet.\n\t *\n\t * @param {Object} packet\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onpacket = function (packet) {\n\t  if (packet.nsp !== this.nsp) return;\n\t\n\t  switch (packet.type) {\n\t    case parser.CONNECT:\n\t      this.onconnect();\n\t      break;\n\t\n\t    case parser.EVENT:\n\t      this.onevent(packet);\n\t      break;\n\t\n\t    case parser.BINARY_EVENT:\n\t      this.onevent(packet);\n\t      break;\n\t\n\t    case parser.ACK:\n\t      this.onack(packet);\n\t      break;\n\t\n\t    case parser.BINARY_ACK:\n\t      this.onack(packet);\n\t      break;\n\t\n\t    case parser.DISCONNECT:\n\t      this.ondisconnect();\n\t      break;\n\t\n\t    case parser.ERROR:\n\t      this.emit('error', packet.data);\n\t      break;\n\t  }\n\t};\n\t\n\t/**\n\t * Called upon a server event.\n\t *\n\t * @param {Object} packet\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onevent = function (packet) {\n\t  var args = packet.data || [];\n\t  debug('emitting event %j', args);\n\t\n\t  if (null != packet.id) {\n\t    debug('attaching ack callback to event');\n\t    args.push(this.ack(packet.id));\n\t  }\n\t\n\t  if (this.connected) {\n\t    emit.apply(this, args);\n\t  } else {\n\t    this.receiveBuffer.push(args);\n\t  }\n\t};\n\t\n\t/**\n\t * Produces an ack callback to emit with an event.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.ack = function (id) {\n\t  var self = this;\n\t  var sent = false;\n\t  return function () {\n\t    // prevent double callbacks\n\t    if (sent) return;\n\t    sent = true;\n\t    var args = toArray(arguments);\n\t    debug('sending ack %j', args);\n\t\n\t    self.packet({\n\t      type: parser.ACK,\n\t      id: id,\n\t      data: args\n\t    });\n\t  };\n\t};\n\t\n\t/**\n\t * Called upon a server acknowlegement.\n\t *\n\t * @param {Object} packet\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onack = function (packet) {\n\t  var ack = this.acks[packet.id];\n\t  if ('function' === typeof ack) {\n\t    debug('calling ack %s with %j', packet.id, packet.data);\n\t    ack.apply(this, packet.data);\n\t    delete this.acks[packet.id];\n\t  } else {\n\t    debug('bad ack %s', packet.id);\n\t  }\n\t};\n\t\n\t/**\n\t * Called upon server connect.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onconnect = function () {\n\t  this.connected = true;\n\t  this.disconnected = false;\n\t  this.emit('connect');\n\t  this.emitBuffered();\n\t};\n\t\n\t/**\n\t * Emit buffered events (received and emitted).\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.emitBuffered = function () {\n\t  var i;\n\t  for (i = 0; i < this.receiveBuffer.length; i++) {\n\t    emit.apply(this, this.receiveBuffer[i]);\n\t  }\n\t  this.receiveBuffer = [];\n\t\n\t  for (i = 0; i < this.sendBuffer.length; i++) {\n\t    this.packet(this.sendBuffer[i]);\n\t  }\n\t  this.sendBuffer = [];\n\t};\n\t\n\t/**\n\t * Called upon server disconnect.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.ondisconnect = function () {\n\t  debug('server disconnect (%s)', this.nsp);\n\t  this.destroy();\n\t  this.onclose('io server disconnect');\n\t};\n\t\n\t/**\n\t * Called upon forced client/server side disconnections,\n\t * this method ensures the manager stops tracking us and\n\t * that reconnections don't get triggered for this.\n\t *\n\t * @api private.\n\t */\n\t\n\tSocket.prototype.destroy = function () {\n\t  if (this.subs) {\n\t    // clean subscriptions to avoid reconnections\n\t    for (var i = 0; i < this.subs.length; i++) {\n\t      this.subs[i].destroy();\n\t    }\n\t    this.subs = null;\n\t  }\n\t\n\t  this.io.destroy(this);\n\t};\n\t\n\t/**\n\t * Disconnects the socket manually.\n\t *\n\t * @return {Socket} self\n\t * @api public\n\t */\n\t\n\tSocket.prototype.close = Socket.prototype.disconnect = function () {\n\t  if (this.connected) {\n\t    debug('performing disconnect (%s)', this.nsp);\n\t    this.packet({ type: parser.DISCONNECT });\n\t  }\n\t\n\t  // remove socket from pool\n\t  this.destroy();\n\t\n\t  if (this.connected) {\n\t    // fire events\n\t    this.onclose('io client disconnect');\n\t  }\n\t  return this;\n\t};\n\t\n\t/**\n\t * Sets the compress flag.\n\t *\n\t * @param {Boolean} if `true`, compresses the sending data\n\t * @return {Socket} self\n\t * @api public\n\t */\n\t\n\tSocket.prototype.compress = function (compress) {\n\t  this.flags = this.flags || {};\n\t  this.flags.compress = compress;\n\t  return this;\n\t};\n\n/***/ }),\n/* 40 */\n/***/ (function(module, exports) {\n\n\tmodule.exports = toArray\n\t\n\tfunction toArray(list, index) {\n\t    var array = []\n\t\n\t    index = index || 0\n\t\n\t    for (var i = index || 0; i < list.length; i++) {\n\t        array[i - index] = list[i]\n\t    }\n\t\n\t    return array\n\t}\n\n\n/***/ }),\n/* 41 */\n/***/ (function(module, exports) {\n\n\t\"use strict\";\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = on;\n\t\n\t/**\n\t * Helper for subscriptions.\n\t *\n\t * @param {Object|EventEmitter} obj with `Emitter` mixin or `EventEmitter`\n\t * @param {String} event name\n\t * @param {Function} callback\n\t * @api public\n\t */\n\t\n\tfunction on(obj, ev, fn) {\n\t  obj.on(ev, fn);\n\t  return {\n\t    destroy: function destroy() {\n\t      obj.removeListener(ev, fn);\n\t    }\n\t  };\n\t}\n\n/***/ }),\n/* 42 */\n/***/ (function(module, exports) {\n\n\t/**\n\t * Slice reference.\n\t */\n\t\n\tvar slice = [].slice;\n\t\n\t/**\n\t * Bind `obj` to `fn`.\n\t *\n\t * @param {Object} obj\n\t * @param {Function|String} fn or string\n\t * @return {Function}\n\t * @api public\n\t */\n\t\n\tmodule.exports = function(obj, fn){\n\t  if ('string' == typeof fn) fn = obj[fn];\n\t  if ('function' != typeof fn) throw new Error('bind() requires a function');\n\t  var args = slice.call(arguments, 2);\n\t  return function(){\n\t    return fn.apply(obj, args.concat(slice.call(arguments)));\n\t  }\n\t};\n\n\n/***/ }),\n/* 43 */\n/***/ (function(module, exports) {\n\n\t\n\t/**\n\t * Expose `Backoff`.\n\t */\n\t\n\tmodule.exports = Backoff;\n\t\n\t/**\n\t * Initialize backoff timer with `opts`.\n\t *\n\t * - `min` initial timeout in milliseconds [100]\n\t * - `max` max timeout [10000]\n\t * - `jitter` [0]\n\t * - `factor` [2]\n\t *\n\t * @param {Object} opts\n\t * @api public\n\t */\n\t\n\tfunction Backoff(opts) {\n\t  opts = opts || {};\n\t  this.ms = opts.min || 100;\n\t  this.max = opts.max || 10000;\n\t  this.factor = opts.factor || 2;\n\t  this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;\n\t  this.attempts = 0;\n\t}\n\t\n\t/**\n\t * Return the backoff duration.\n\t *\n\t * @return {Number}\n\t * @api public\n\t */\n\t\n\tBackoff.prototype.duration = function(){\n\t  var ms = this.ms * Math.pow(this.factor, this.attempts++);\n\t  if (this.jitter) {\n\t    var rand =  Math.random();\n\t    var deviation = Math.floor(rand * this.jitter * ms);\n\t    ms = (Math.floor(rand * 10) & 1) == 0  ? ms - deviation : ms + deviation;\n\t  }\n\t  return Math.min(ms, this.max) | 0;\n\t};\n\t\n\t/**\n\t * Reset the number of attempts.\n\t *\n\t * @api public\n\t */\n\t\n\tBackoff.prototype.reset = function(){\n\t  this.attempts = 0;\n\t};\n\t\n\t/**\n\t * Set the minimum duration\n\t *\n\t * @api public\n\t */\n\t\n\tBackoff.prototype.setMin = function(min){\n\t  this.ms = min;\n\t};\n\t\n\t/**\n\t * Set the maximum duration\n\t *\n\t * @api public\n\t */\n\t\n\tBackoff.prototype.setMax = function(max){\n\t  this.max = max;\n\t};\n\t\n\t/**\n\t * Set the jitter\n\t *\n\t * @api public\n\t */\n\t\n\tBackoff.prototype.setJitter = function(jitter){\n\t  this.jitter = jitter;\n\t};\n\t\n\n\n/***/ })\n/******/ ])\n});\n;\n\n\n// WEBPACK FOOTER //\n// socket.io.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 959f0ed5f5670676a79e","\n/**\n * Module dependencies.\n */\n\nvar url = require('./url');\nvar parser = require('socket.io-parser');\nvar Manager = require('./manager');\nvar debug = require('debug')('socket.io-client');\n\n/**\n * Module exports.\n */\n\nmodule.exports = exports = lookup;\n\n/**\n * Managers cache.\n */\n\nvar cache = exports.managers = {};\n\n/**\n * Looks up an existing `Manager` for multiplexing.\n * If the user summons:\n *\n *   `io('http://localhost/a');`\n *   `io('http://localhost/b');`\n *\n * We reuse the existing instance based on same scheme/port/host,\n * and we initialize sockets for each namespace.\n *\n * @api public\n */\n\nfunction lookup (uri, opts) {\n  if (typeof uri === 'object') {\n    opts = uri;\n    uri = undefined;\n  }\n\n  opts = opts || {};\n\n  var parsed = url(uri);\n  var source = parsed.source;\n  var id = parsed.id;\n  var path = parsed.path;\n  var sameNamespace = cache[id] && path in cache[id].nsps;\n  var newConnection = opts.forceNew || opts['force new connection'] ||\n                      false === opts.multiplex || sameNamespace;\n\n  var io;\n\n  if (newConnection) {\n    debug('ignoring socket cache for %s', source);\n    io = Manager(source, opts);\n  } else {\n    if (!cache[id]) {\n      debug('new io instance for %s', source);\n      cache[id] = Manager(source, opts);\n    }\n    io = cache[id];\n  }\n  if (parsed.query && !opts.query) {\n    opts.query = parsed.query;\n  }\n  return io.socket(parsed.path, opts);\n}\n\n/**\n * Protocol version.\n *\n * @api public\n */\n\nexports.protocol = parser.protocol;\n\n/**\n * `connect`.\n *\n * @param {String} uri\n * @api public\n */\n\nexports.connect = lookup;\n\n/**\n * Expose constructors for standalone build.\n *\n * @api public\n */\n\nexports.Manager = require('./manager');\nexports.Socket = require('./socket');\n\n\n\n// WEBPACK FOOTER //\n// ./lib/index.js","\n/**\n * Module dependencies.\n */\n\nvar parseuri = require('parseuri');\nvar debug = require('debug')('socket.io-client:url');\n\n/**\n * Module exports.\n */\n\nmodule.exports = url;\n\n/**\n * URL parser.\n *\n * @param {String} url\n * @param {Object} An object meant to mimic window.location.\n *                 Defaults to window.location.\n * @api public\n */\n\nfunction url (uri, loc) {\n  var obj = uri;\n\n  // default to window.location\n  loc = loc || global.location;\n  if (null == uri) uri = loc.protocol + '//' + loc.host;\n\n  // relative path support\n  if ('string' === typeof uri) {\n    if ('/' === uri.charAt(0)) {\n      if ('/' === uri.charAt(1)) {\n        uri = loc.protocol + uri;\n      } else {\n        uri = loc.host + uri;\n      }\n    }\n\n    if (!/^(https?|wss?):\\/\\//.test(uri)) {\n      debug('protocol-less url %s', uri);\n      if ('undefined' !== typeof loc) {\n        uri = loc.protocol + '//' + uri;\n      } else {\n        uri = 'https://' + uri;\n      }\n    }\n\n    // parse\n    debug('parse %s', uri);\n    obj = parseuri(uri);\n  }\n\n  // make sure we treat `localhost:80` and `localhost` equally\n  if (!obj.port) {\n    if (/^(http|ws)$/.test(obj.protocol)) {\n      obj.port = '80';\n    } else if (/^(http|ws)s$/.test(obj.protocol)) {\n      obj.port = '443';\n    }\n  }\n\n  obj.path = obj.path || '/';\n\n  var ipv6 = obj.host.indexOf(':') !== -1;\n  var host = ipv6 ? '[' + obj.host + ']' : obj.host;\n\n  // define unique id\n  obj.id = obj.protocol + '://' + host + ':' + obj.port;\n  // define href\n  obj.href = obj.protocol + '://' + host + (loc && loc.port === obj.port ? '' : (':' + obj.port));\n\n  return obj;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./lib/url.js","/**\r\n * Parses an URI\r\n *\r\n * @author Steven Levithan <stevenlevithan.com> (MIT license)\r\n * @api private\r\n */\r\n\r\nvar re = /^(?:(?![^:@]+:[^:@\\/]*@)(http|https|ws|wss):\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/;\r\n\r\nvar parts = [\r\n    'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'\r\n];\r\n\r\nmodule.exports = function parseuri(str) {\r\n    var src = str,\r\n        b = str.indexOf('['),\r\n        e = str.indexOf(']');\r\n\r\n    if (b != -1 && e != -1) {\r\n        str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length);\r\n    }\r\n\r\n    var m = re.exec(str || ''),\r\n        uri = {},\r\n        i = 14;\r\n\r\n    while (i--) {\r\n        uri[parts[i]] = m[i] || '';\r\n    }\r\n\r\n    if (b != -1 && e != -1) {\r\n        uri.source = src;\r\n        uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':');\r\n        uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':');\r\n        uri.ipv6uri = true;\r\n    }\r\n\r\n    return uri;\r\n};\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parseuri/index.js\n// module id = 2\n// module chunks = 0","/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n               && 'undefined' != typeof chrome.storage\n                  ? chrome.storage.local\n                  : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n  'lightseagreen',\n  'forestgreen',\n  'goldenrod',\n  'dodgerblue',\n  'darkorchid',\n  'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n  // NB: In an Electron preload script, document will be defined but not fully\n  // initialized. Since we know we're in Chrome, we'll just detect this case\n  // explicitly\n  if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n    return true;\n  }\n\n  // is webkit? http://stackoverflow.com/a/16459606/376773\n  // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n  return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n    // is firebug? http://stackoverflow.com/a/398120/376773\n    (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n    // is firefox >= v31?\n    // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n    // double check webkit in userAgent just in case we are in a worker\n    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n  try {\n    return JSON.stringify(v);\n  } catch (err) {\n    return '[UnexpectedJSONParseError]: ' + err.message;\n  }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n  var useColors = this.useColors;\n\n  args[0] = (useColors ? '%c' : '')\n    + this.namespace\n    + (useColors ? ' %c' : ' ')\n    + args[0]\n    + (useColors ? '%c ' : ' ')\n    + '+' + exports.humanize(this.diff);\n\n  if (!useColors) return;\n\n  var c = 'color: ' + this.color;\n  args.splice(1, 0, c, 'color: inherit')\n\n  // the final \"%c\" is somewhat tricky, because there could be other\n  // arguments passed either before or after the %c, so we need to\n  // figure out the correct index to insert the CSS into\n  var index = 0;\n  var lastC = 0;\n  args[0].replace(/%[a-zA-Z%]/g, function(match) {\n    if ('%%' === match) return;\n    index++;\n    if ('%c' === match) {\n      // we only are interested in the *last* %c\n      // (the user may have provided their own)\n      lastC = index;\n    }\n  });\n\n  args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n  // this hackery is required for IE8/9, where\n  // the `console.log` function doesn't have 'apply'\n  return 'object' === typeof console\n    && console.log\n    && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n  try {\n    if (null == namespaces) {\n      exports.storage.removeItem('debug');\n    } else {\n      exports.storage.debug = namespaces;\n    }\n  } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n  var r;\n  try {\n    r = exports.storage.debug;\n  } catch(e) {}\n\n  // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n  if (!r && typeof process !== 'undefined' && 'env' in process) {\n    r = process.env.DEBUG;\n  }\n\n  return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n  try {\n    return window.localStorage;\n  } catch (e) {}\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/debug/src/browser.js\n// module id = 3\n// module chunks = 0","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things.  But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals.  It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n    throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n    throw new Error('clearTimeout has not been defined');\n}\n(function () {\n    try {\n        if (typeof setTimeout === 'function') {\n            cachedSetTimeout = setTimeout;\n        } else {\n            cachedSetTimeout = defaultSetTimout;\n        }\n    } catch (e) {\n        cachedSetTimeout = defaultSetTimout;\n    }\n    try {\n        if (typeof clearTimeout === 'function') {\n            cachedClearTimeout = clearTimeout;\n        } else {\n            cachedClearTimeout = defaultClearTimeout;\n        }\n    } catch (e) {\n        cachedClearTimeout = defaultClearTimeout;\n    }\n} ())\nfunction runTimeout(fun) {\n    if (cachedSetTimeout === setTimeout) {\n        //normal enviroments in sane situations\n        return setTimeout(fun, 0);\n    }\n    // if setTimeout wasn't available but was latter defined\n    if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n        cachedSetTimeout = setTimeout;\n        return setTimeout(fun, 0);\n    }\n    try {\n        // when when somebody has screwed with setTimeout but no I.E. maddness\n        return cachedSetTimeout(fun, 0);\n    } catch(e){\n        try {\n            // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n            return cachedSetTimeout.call(null, fun, 0);\n        } catch(e){\n            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n            return cachedSetTimeout.call(this, fun, 0);\n        }\n    }\n\n\n}\nfunction runClearTimeout(marker) {\n    if (cachedClearTimeout === clearTimeout) {\n        //normal enviroments in sane situations\n        return clearTimeout(marker);\n    }\n    // if clearTimeout wasn't available but was latter defined\n    if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n        cachedClearTimeout = clearTimeout;\n        return clearTimeout(marker);\n    }\n    try {\n        // when when somebody has screwed with setTimeout but no I.E. maddness\n        return cachedClearTimeout(marker);\n    } catch (e){\n        try {\n            // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally\n            return cachedClearTimeout.call(null, marker);\n        } catch (e){\n            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n            // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n            return cachedClearTimeout.call(this, marker);\n        }\n    }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n    if (!draining || !currentQueue) {\n        return;\n    }\n    draining = false;\n    if (currentQueue.length) {\n        queue = currentQueue.concat(queue);\n    } else {\n        queueIndex = -1;\n    }\n    if (queue.length) {\n        drainQueue();\n    }\n}\n\nfunction drainQueue() {\n    if (draining) {\n        return;\n    }\n    var timeout = runTimeout(cleanUpNextTick);\n    draining = true;\n\n    var len = queue.length;\n    while(len) {\n        currentQueue = queue;\n        queue = [];\n        while (++queueIndex < len) {\n            if (currentQueue) {\n                currentQueue[queueIndex].run();\n            }\n        }\n        queueIndex = -1;\n        len = queue.length;\n    }\n    currentQueue = null;\n    draining = false;\n    runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n    var args = new Array(arguments.length - 1);\n    if (arguments.length > 1) {\n        for (var i = 1; i < arguments.length; i++) {\n            args[i - 1] = arguments[i];\n        }\n    }\n    queue.push(new Item(fun, args));\n    if (queue.length === 1 && !draining) {\n        runTimeout(drainQueue);\n    }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n    this.fun = fun;\n    this.array = array;\n}\nItem.prototype.run = function () {\n    this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n    throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n    throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/process/browser.js\n// module id = 4\n// module chunks = 0","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = require('ms');\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n  var hash = 0, i;\n\n  for (i in namespace) {\n    hash  = ((hash << 5) - hash) + namespace.charCodeAt(i);\n    hash |= 0; // Convert to 32bit integer\n  }\n\n  return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n  function debug() {\n    // disabled?\n    if (!debug.enabled) return;\n\n    var self = debug;\n\n    // set `diff` timestamp\n    var curr = +new Date();\n    var ms = curr - (prevTime || curr);\n    self.diff = ms;\n    self.prev = prevTime;\n    self.curr = curr;\n    prevTime = curr;\n\n    // turn the `arguments` into a proper Array\n    var args = new Array(arguments.length);\n    for (var i = 0; i < args.length; i++) {\n      args[i] = arguments[i];\n    }\n\n    args[0] = exports.coerce(args[0]);\n\n    if ('string' !== typeof args[0]) {\n      // anything else let's inspect with %O\n      args.unshift('%O');\n    }\n\n    // apply any `formatters` transformations\n    var index = 0;\n    args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n      // if we encounter an escaped % then don't increase the array index\n      if (match === '%%') return match;\n      index++;\n      var formatter = exports.formatters[format];\n      if ('function' === typeof formatter) {\n        var val = args[index];\n        match = formatter.call(self, val);\n\n        // now we need to remove `args[index]` since it's inlined in the `format`\n        args.splice(index, 1);\n        index--;\n      }\n      return match;\n    });\n\n    // apply env-specific formatting (colors, etc.)\n    exports.formatArgs.call(self, args);\n\n    var logFn = debug.log || exports.log || console.log.bind(console);\n    logFn.apply(self, args);\n  }\n\n  debug.namespace = namespace;\n  debug.enabled = exports.enabled(namespace);\n  debug.useColors = exports.useColors();\n  debug.color = selectColor(namespace);\n\n  // env-specific initialization logic for debug instances\n  if ('function' === typeof exports.init) {\n    exports.init(debug);\n  }\n\n  return debug;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n  exports.save(namespaces);\n\n  exports.names = [];\n  exports.skips = [];\n\n  var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n  var len = split.length;\n\n  for (var i = 0; i < len; i++) {\n    if (!split[i]) continue; // ignore empty strings\n    namespaces = split[i].replace(/\\*/g, '.*?');\n    if (namespaces[0] === '-') {\n      exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n    } else {\n      exports.names.push(new RegExp('^' + namespaces + '$'));\n    }\n  }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n  exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n  var i, len;\n  for (i = 0, len = exports.skips.length; i < len; i++) {\n    if (exports.skips[i].test(name)) {\n      return false;\n    }\n  }\n  for (i = 0, len = exports.names.length; i < len; i++) {\n    if (exports.names[i].test(name)) {\n      return true;\n    }\n  }\n  return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n  if (val instanceof Error) return val.stack || val.message;\n  return val;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/debug/src/debug.js\n// module id = 5\n// module chunks = 0","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n *  - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n  options = options || {};\n  var type = typeof val;\n  if (type === 'string' && val.length > 0) {\n    return parse(val);\n  } else if (type === 'number' && isNaN(val) === false) {\n    return options.long ? fmtLong(val) : fmtShort(val);\n  }\n  throw new Error(\n    'val is not a non-empty string or a valid number. val=' +\n      JSON.stringify(val)\n  );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n  str = String(str);\n  if (str.length > 100) {\n    return;\n  }\n  var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n    str\n  );\n  if (!match) {\n    return;\n  }\n  var n = parseFloat(match[1]);\n  var type = (match[2] || 'ms').toLowerCase();\n  switch (type) {\n    case 'years':\n    case 'year':\n    case 'yrs':\n    case 'yr':\n    case 'y':\n      return n * y;\n    case 'days':\n    case 'day':\n    case 'd':\n      return n * d;\n    case 'hours':\n    case 'hour':\n    case 'hrs':\n    case 'hr':\n    case 'h':\n      return n * h;\n    case 'minutes':\n    case 'minute':\n    case 'mins':\n    case 'min':\n    case 'm':\n      return n * m;\n    case 'seconds':\n    case 'second':\n    case 'secs':\n    case 'sec':\n    case 's':\n      return n * s;\n    case 'milliseconds':\n    case 'millisecond':\n    case 'msecs':\n    case 'msec':\n    case 'ms':\n      return n;\n    default:\n      return undefined;\n  }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n  if (ms >= d) {\n    return Math.round(ms / d) + 'd';\n  }\n  if (ms >= h) {\n    return Math.round(ms / h) + 'h';\n  }\n  if (ms >= m) {\n    return Math.round(ms / m) + 'm';\n  }\n  if (ms >= s) {\n    return Math.round(ms / s) + 's';\n  }\n  return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n  return plural(ms, d, 'day') ||\n    plural(ms, h, 'hour') ||\n    plural(ms, m, 'minute') ||\n    plural(ms, s, 'second') ||\n    ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n  if (ms < n) {\n    return;\n  }\n  if (ms < n * 1.5) {\n    return Math.floor(ms / n) + ' ' + name;\n  }\n  return Math.ceil(ms / n) + ' ' + name + 's';\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ms/index.js\n// module id = 6\n// module chunks = 0","\n/**\n * Module dependencies.\n */\n\nvar debug = require('debug')('socket.io-parser');\nvar Emitter = require('component-emitter');\nvar hasBin = require('has-binary2');\nvar binary = require('./binary');\nvar isBuf = require('./is-buffer');\n\n/**\n * Protocol version.\n *\n * @api public\n */\n\nexports.protocol = 4;\n\n/**\n * Packet types.\n *\n * @api public\n */\n\nexports.types = [\n  'CONNECT',\n  'DISCONNECT',\n  'EVENT',\n  'ACK',\n  'ERROR',\n  'BINARY_EVENT',\n  'BINARY_ACK'\n];\n\n/**\n * Packet type `connect`.\n *\n * @api public\n */\n\nexports.CONNECT = 0;\n\n/**\n * Packet type `disconnect`.\n *\n * @api public\n */\n\nexports.DISCONNECT = 1;\n\n/**\n * Packet type `event`.\n *\n * @api public\n */\n\nexports.EVENT = 2;\n\n/**\n * Packet type `ack`.\n *\n * @api public\n */\n\nexports.ACK = 3;\n\n/**\n * Packet type `error`.\n *\n * @api public\n */\n\nexports.ERROR = 4;\n\n/**\n * Packet type 'binary event'\n *\n * @api public\n */\n\nexports.BINARY_EVENT = 5;\n\n/**\n * Packet type `binary ack`. For acks with binary arguments.\n *\n * @api public\n */\n\nexports.BINARY_ACK = 6;\n\n/**\n * Encoder constructor.\n *\n * @api public\n */\n\nexports.Encoder = Encoder;\n\n/**\n * Decoder constructor.\n *\n * @api public\n */\n\nexports.Decoder = Decoder;\n\n/**\n * A socket.io Encoder instance\n *\n * @api public\n */\n\nfunction Encoder() {}\n\n/**\n * Encode a packet as a single string if non-binary, or as a\n * buffer sequence, depending on packet type.\n *\n * @param {Object} obj - packet object\n * @param {Function} callback - function to handle encodings (likely engine.write)\n * @return Calls callback with Array of encodings\n * @api public\n */\n\nEncoder.prototype.encode = function(obj, callback){\n  if ((obj.type === exports.EVENT || obj.type === exports.ACK) && hasBin(obj.data)) {\n    obj.type = obj.type === exports.EVENT ? exports.BINARY_EVENT : exports.BINARY_ACK;\n  }\n\n  debug('encoding packet %j', obj);\n\n  if (exports.BINARY_EVENT === obj.type || exports.BINARY_ACK === obj.type) {\n    encodeAsBinary(obj, callback);\n  }\n  else {\n    var encoding = encodeAsString(obj);\n    callback([encoding]);\n  }\n};\n\n/**\n * Encode packet as string.\n *\n * @param {Object} packet\n * @return {String} encoded\n * @api private\n */\n\nfunction encodeAsString(obj) {\n\n  // first is type\n  var str = '' + obj.type;\n\n  // attachments if we have them\n  if (exports.BINARY_EVENT === obj.type || exports.BINARY_ACK === obj.type) {\n    str += obj.attachments + '-';\n  }\n\n  // if we have a namespace other than `/`\n  // we append it followed by a comma `,`\n  if (obj.nsp && '/' !== obj.nsp) {\n    str += obj.nsp + ',';\n  }\n\n  // immediately followed by the id\n  if (null != obj.id) {\n    str += obj.id;\n  }\n\n  // json data\n  if (null != obj.data) {\n    str += JSON.stringify(obj.data);\n  }\n\n  debug('encoded %j as %s', obj, str);\n  return str;\n}\n\n/**\n * Encode packet as 'buffer sequence' by removing blobs, and\n * deconstructing packet into object with placeholders and\n * a list of buffers.\n *\n * @param {Object} packet\n * @return {Buffer} encoded\n * @api private\n */\n\nfunction encodeAsBinary(obj, callback) {\n\n  function writeEncoding(bloblessData) {\n    var deconstruction = binary.deconstructPacket(bloblessData);\n    var pack = encodeAsString(deconstruction.packet);\n    var buffers = deconstruction.buffers;\n\n    buffers.unshift(pack); // add packet info to beginning of data list\n    callback(buffers); // write all the buffers\n  }\n\n  binary.removeBlobs(obj, writeEncoding);\n}\n\n/**\n * A socket.io Decoder instance\n *\n * @return {Object} decoder\n * @api public\n */\n\nfunction Decoder() {\n  this.reconstructor = null;\n}\n\n/**\n * Mix in `Emitter` with Decoder.\n */\n\nEmitter(Decoder.prototype);\n\n/**\n * Decodes an ecoded packet string into packet JSON.\n *\n * @param {String} obj - encoded packet\n * @return {Object} packet\n * @api public\n */\n\nDecoder.prototype.add = function(obj) {\n  var packet;\n  if (typeof obj === 'string') {\n    packet = decodeString(obj);\n    if (exports.BINARY_EVENT === packet.type || exports.BINARY_ACK === packet.type) { // binary packet's json\n      this.reconstructor = new BinaryReconstructor(packet);\n\n      // no attachments, labeled binary but no binary data to follow\n      if (this.reconstructor.reconPack.attachments === 0) {\n        this.emit('decoded', packet);\n      }\n    } else { // non-binary full packet\n      this.emit('decoded', packet);\n    }\n  }\n  else if (isBuf(obj) || obj.base64) { // raw binary data\n    if (!this.reconstructor) {\n      throw new Error('got binary data when not reconstructing a packet');\n    } else {\n      packet = this.reconstructor.takeBinaryData(obj);\n      if (packet) { // received final buffer\n        this.reconstructor = null;\n        this.emit('decoded', packet);\n      }\n    }\n  }\n  else {\n    throw new Error('Unknown type: ' + obj);\n  }\n};\n\n/**\n * Decode a packet String (JSON data)\n *\n * @param {String} str\n * @return {Object} packet\n * @api private\n */\n\nfunction decodeString(str) {\n  var i = 0;\n  // look up type\n  var p = {\n    type: Number(str.charAt(0))\n  };\n\n  if (null == exports.types[p.type]) return error();\n\n  // look up attachments if type binary\n  if (exports.BINARY_EVENT === p.type || exports.BINARY_ACK === p.type) {\n    var buf = '';\n    while (str.charAt(++i) !== '-') {\n      buf += str.charAt(i);\n      if (i == str.length) break;\n    }\n    if (buf != Number(buf) || str.charAt(i) !== '-') {\n      throw new Error('Illegal attachments');\n    }\n    p.attachments = Number(buf);\n  }\n\n  // look up namespace (if any)\n  if ('/' === str.charAt(i + 1)) {\n    p.nsp = '';\n    while (++i) {\n      var c = str.charAt(i);\n      if (',' === c) break;\n      p.nsp += c;\n      if (i === str.length) break;\n    }\n  } else {\n    p.nsp = '/';\n  }\n\n  // look up id\n  var next = str.charAt(i + 1);\n  if ('' !== next && Number(next) == next) {\n    p.id = '';\n    while (++i) {\n      var c = str.charAt(i);\n      if (null == c || Number(c) != c) {\n        --i;\n        break;\n      }\n      p.id += str.charAt(i);\n      if (i === str.length) break;\n    }\n    p.id = Number(p.id);\n  }\n\n  // look up json data\n  if (str.charAt(++i)) {\n    p = tryParse(p, str.substr(i));\n  }\n\n  debug('decoded %s as %j', str, p);\n  return p;\n}\n\nfunction tryParse(p, str) {\n  try {\n    p.data = JSON.parse(str);\n  } catch(e){\n    return error();\n  }\n  return p; \n}\n\n/**\n * Deallocates a parser's resources\n *\n * @api public\n */\n\nDecoder.prototype.destroy = function() {\n  if (this.reconstructor) {\n    this.reconstructor.finishedReconstruction();\n  }\n};\n\n/**\n * A manager of a binary event's 'buffer sequence'. Should\n * be constructed whenever a packet of type BINARY_EVENT is\n * decoded.\n *\n * @param {Object} packet\n * @return {BinaryReconstructor} initialized reconstructor\n * @api private\n */\n\nfunction BinaryReconstructor(packet) {\n  this.reconPack = packet;\n  this.buffers = [];\n}\n\n/**\n * Method to be called when binary data received from connection\n * after a BINARY_EVENT packet.\n *\n * @param {Buffer | ArrayBuffer} binData - the raw binary data received\n * @return {null | Object} returns null if more binary data is expected or\n *   a reconstructed packet object if all buffers have been received.\n * @api private\n */\n\nBinaryReconstructor.prototype.takeBinaryData = function(binData) {\n  this.buffers.push(binData);\n  if (this.buffers.length === this.reconPack.attachments) { // done with buffer list\n    var packet = binary.reconstructPacket(this.reconPack, this.buffers);\n    this.finishedReconstruction();\n    return packet;\n  }\n  return null;\n};\n\n/**\n * Cleans up binary packet reconstruction variables.\n *\n * @api private\n */\n\nBinaryReconstructor.prototype.finishedReconstruction = function() {\n  this.reconPack = null;\n  this.buffers = [];\n};\n\nfunction error() {\n  return {\n    type: exports.ERROR,\n    data: 'parser error'\n  };\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/socket.io-parser/index.js\n// module id = 7\n// module chunks = 0","\r\n/**\r\n * Expose `Emitter`.\r\n */\r\n\r\nif (typeof module !== 'undefined') {\r\n  module.exports = Emitter;\r\n}\r\n\r\n/**\r\n * Initialize a new `Emitter`.\r\n *\r\n * @api public\r\n */\r\n\r\nfunction Emitter(obj) {\r\n  if (obj) return mixin(obj);\r\n};\r\n\r\n/**\r\n * Mixin the emitter properties.\r\n *\r\n * @param {Object} obj\r\n * @return {Object}\r\n * @api private\r\n */\r\n\r\nfunction mixin(obj) {\r\n  for (var key in Emitter.prototype) {\r\n    obj[key] = Emitter.prototype[key];\r\n  }\r\n  return obj;\r\n}\r\n\r\n/**\r\n * Listen on the given `event` with `fn`.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.on =\r\nEmitter.prototype.addEventListener = function(event, fn){\r\n  this._callbacks = this._callbacks || {};\r\n  (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\r\n    .push(fn);\r\n  return this;\r\n};\r\n\r\n/**\r\n * Adds an `event` listener that will be invoked a single\r\n * time then automatically removed.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.once = function(event, fn){\r\n  function on() {\r\n    this.off(event, on);\r\n    fn.apply(this, arguments);\r\n  }\r\n\r\n  on.fn = fn;\r\n  this.on(event, on);\r\n  return this;\r\n};\r\n\r\n/**\r\n * Remove the given callback for `event` or all\r\n * registered callbacks.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.off =\r\nEmitter.prototype.removeListener =\r\nEmitter.prototype.removeAllListeners =\r\nEmitter.prototype.removeEventListener = function(event, fn){\r\n  this._callbacks = this._callbacks || {};\r\n\r\n  // all\r\n  if (0 == arguments.length) {\r\n    this._callbacks = {};\r\n    return this;\r\n  }\r\n\r\n  // specific event\r\n  var callbacks = this._callbacks['$' + event];\r\n  if (!callbacks) return this;\r\n\r\n  // remove all handlers\r\n  if (1 == arguments.length) {\r\n    delete this._callbacks['$' + event];\r\n    return this;\r\n  }\r\n\r\n  // remove specific handler\r\n  var cb;\r\n  for (var i = 0; i < callbacks.length; i++) {\r\n    cb = callbacks[i];\r\n    if (cb === fn || cb.fn === fn) {\r\n      callbacks.splice(i, 1);\r\n      break;\r\n    }\r\n  }\r\n  return this;\r\n};\r\n\r\n/**\r\n * Emit `event` with the given args.\r\n *\r\n * @param {String} event\r\n * @param {Mixed} ...\r\n * @return {Emitter}\r\n */\r\n\r\nEmitter.prototype.emit = function(event){\r\n  this._callbacks = this._callbacks || {};\r\n  var args = [].slice.call(arguments, 1)\r\n    , callbacks = this._callbacks['$' + event];\r\n\r\n  if (callbacks) {\r\n    callbacks = callbacks.slice(0);\r\n    for (var i = 0, len = callbacks.length; i < len; ++i) {\r\n      callbacks[i].apply(this, args);\r\n    }\r\n  }\r\n\r\n  return this;\r\n};\r\n\r\n/**\r\n * Return array of callbacks for `event`.\r\n *\r\n * @param {String} event\r\n * @return {Array}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.listeners = function(event){\r\n  this._callbacks = this._callbacks || {};\r\n  return this._callbacks['$' + event] || [];\r\n};\r\n\r\n/**\r\n * Check if this emitter has `event` handlers.\r\n *\r\n * @param {String} event\r\n * @return {Boolean}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.hasListeners = function(event){\r\n  return !! this.listeners(event).length;\r\n};\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/component-emitter/index.js\n// module id = 8\n// module chunks = 0","/* global Blob File */\n\n/*\n * Module requirements.\n */\n\nvar isArray = require('isarray');\n\nvar toString = Object.prototype.toString;\nvar withNativeBlob = typeof global.Blob === 'function' || toString.call(global.Blob) === '[object BlobConstructor]';\nvar withNativeFile = typeof global.File === 'function' || toString.call(global.File) === '[object FileConstructor]';\n\n/**\n * Module exports.\n */\n\nmodule.exports = hasBinary;\n\n/**\n * Checks for binary data.\n *\n * Supports Buffer, ArrayBuffer, Blob and File.\n *\n * @param {Object} anything\n * @api public\n */\n\nfunction hasBinary (obj) {\n  if (!obj || typeof obj !== 'object') {\n    return false;\n  }\n\n  if (isArray(obj)) {\n    for (var i = 0, l = obj.length; i < l; i++) {\n      if (hasBinary(obj[i])) {\n        return true;\n      }\n    }\n    return false;\n  }\n\n  if ((typeof global.Buffer === 'function' && global.Buffer.isBuffer && global.Buffer.isBuffer(obj)) ||\n     (typeof global.ArrayBuffer === 'function' && obj instanceof ArrayBuffer) ||\n     (withNativeBlob && obj instanceof Blob) ||\n     (withNativeFile && obj instanceof File)\n    ) {\n    return true;\n  }\n\n  // see: https://github.com/Automattic/has-binary/pull/4\n  if (obj.toJSON && typeof obj.toJSON === 'function' && arguments.length === 1) {\n    return hasBinary(obj.toJSON(), true);\n  }\n\n  for (var key in obj) {\n    if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) {\n      return true;\n    }\n  }\n\n  return false;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/has-binary2/index.js\n// module id = 9\n// module chunks = 0","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n  return toString.call(arr) == '[object Array]';\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/isarray/index.js\n// module id = 10\n// module chunks = 0","/*global Blob,File*/\n\n/**\n * Module requirements\n */\n\nvar isArray = require('isarray');\nvar isBuf = require('./is-buffer');\nvar toString = Object.prototype.toString;\nvar withNativeBlob = typeof global.Blob === 'function' || toString.call(global.Blob) === '[object BlobConstructor]';\nvar withNativeFile = typeof global.File === 'function' || toString.call(global.File) === '[object FileConstructor]';\n\n/**\n * Replaces every Buffer | ArrayBuffer in packet with a numbered placeholder.\n * Anything with blobs or files should be fed through removeBlobs before coming\n * here.\n *\n * @param {Object} packet - socket.io event packet\n * @return {Object} with deconstructed packet and list of buffers\n * @api public\n */\n\nexports.deconstructPacket = function(packet) {\n  var buffers = [];\n  var packetData = packet.data;\n  var pack = packet;\n  pack.data = _deconstructPacket(packetData, buffers);\n  pack.attachments = buffers.length; // number of binary 'attachments'\n  return {packet: pack, buffers: buffers};\n};\n\nfunction _deconstructPacket(data, buffers) {\n  if (!data) return data;\n\n  if (isBuf(data)) {\n    var placeholder = { _placeholder: true, num: buffers.length };\n    buffers.push(data);\n    return placeholder;\n  } else if (isArray(data)) {\n    var newData = new Array(data.length);\n    for (var i = 0; i < data.length; i++) {\n      newData[i] = _deconstructPacket(data[i], buffers);\n    }\n    return newData;\n  } else if (typeof data === 'object' && !(data instanceof Date)) {\n    var newData = {};\n    for (var key in data) {\n      newData[key] = _deconstructPacket(data[key], buffers);\n    }\n    return newData;\n  }\n  return data;\n}\n\n/**\n * Reconstructs a binary packet from its placeholder packet and buffers\n *\n * @param {Object} packet - event packet with placeholders\n * @param {Array} buffers - binary buffers to put in placeholder positions\n * @return {Object} reconstructed packet\n * @api public\n */\n\nexports.reconstructPacket = function(packet, buffers) {\n  packet.data = _reconstructPacket(packet.data, buffers);\n  packet.attachments = undefined; // no longer useful\n  return packet;\n};\n\nfunction _reconstructPacket(data, buffers) {\n  if (!data) return data;\n\n  if (data && data._placeholder) {\n    return buffers[data.num]; // appropriate buffer (should be natural order anyway)\n  } else if (isArray(data)) {\n    for (var i = 0; i < data.length; i++) {\n      data[i] = _reconstructPacket(data[i], buffers);\n    }\n  } else if (typeof data === 'object') {\n    for (var key in data) {\n      data[key] = _reconstructPacket(data[key], buffers);\n    }\n  }\n\n  return data;\n}\n\n/**\n * Asynchronously removes Blobs or Files from data via\n * FileReader's readAsArrayBuffer method. Used before encoding\n * data as msgpack. Calls callback with the blobless data.\n *\n * @param {Object} data\n * @param {Function} callback\n * @api private\n */\n\nexports.removeBlobs = function(data, callback) {\n  function _removeBlobs(obj, curKey, containingObject) {\n    if (!obj) return obj;\n\n    // convert any blob\n    if ((withNativeBlob && obj instanceof Blob) ||\n        (withNativeFile && obj instanceof File)) {\n      pendingBlobs++;\n\n      // async filereader\n      var fileReader = new FileReader();\n      fileReader.onload = function() { // this.result == arraybuffer\n        if (containingObject) {\n          containingObject[curKey] = this.result;\n        }\n        else {\n          bloblessData = this.result;\n        }\n\n        // if nothing pending its callback time\n        if(! --pendingBlobs) {\n          callback(bloblessData);\n        }\n      };\n\n      fileReader.readAsArrayBuffer(obj); // blob -> arraybuffer\n    } else if (isArray(obj)) { // handle array\n      for (var i = 0; i < obj.length; i++) {\n        _removeBlobs(obj[i], i, obj);\n      }\n    } else if (typeof obj === 'object' && !isBuf(obj)) { // and object\n      for (var key in obj) {\n        _removeBlobs(obj[key], key, obj);\n      }\n    }\n  }\n\n  var pendingBlobs = 0;\n  var bloblessData = data;\n  _removeBlobs(bloblessData);\n  if (!pendingBlobs) {\n    callback(bloblessData);\n  }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/socket.io-parser/binary.js\n// module id = 11\n// module chunks = 0","\nmodule.exports = isBuf;\n\n/**\n * Returns true if obj is a buffer or an arraybuffer.\n *\n * @api private\n */\n\nfunction isBuf(obj) {\n  return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n         (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/socket.io-parser/is-buffer.js\n// module id = 12\n// module chunks = 0","\n/**\n * Module dependencies.\n */\n\nvar eio = require('engine.io-client');\nvar Socket = require('./socket');\nvar Emitter = require('component-emitter');\nvar parser = require('socket.io-parser');\nvar on = require('./on');\nvar bind = require('component-bind');\nvar debug = require('debug')('socket.io-client:manager');\nvar indexOf = require('indexof');\nvar Backoff = require('backo2');\n\n/**\n * IE6+ hasOwnProperty\n */\n\nvar has = Object.prototype.hasOwnProperty;\n\n/**\n * Module exports\n */\n\nmodule.exports = Manager;\n\n/**\n * `Manager` constructor.\n *\n * @param {String} engine instance or engine uri/opts\n * @param {Object} options\n * @api public\n */\n\nfunction Manager (uri, opts) {\n  if (!(this instanceof Manager)) return new Manager(uri, opts);\n  if (uri && ('object' === typeof uri)) {\n    opts = uri;\n    uri = undefined;\n  }\n  opts = opts || {};\n\n  opts.path = opts.path || '/socket.io';\n  this.nsps = {};\n  this.subs = [];\n  this.opts = opts;\n  this.reconnection(opts.reconnection !== false);\n  this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);\n  this.reconnectionDelay(opts.reconnectionDelay || 1000);\n  this.reconnectionDelayMax(opts.reconnectionDelayMax || 5000);\n  this.randomizationFactor(opts.randomizationFactor || 0.5);\n  this.backoff = new Backoff({\n    min: this.reconnectionDelay(),\n    max: this.reconnectionDelayMax(),\n    jitter: this.randomizationFactor()\n  });\n  this.timeout(null == opts.timeout ? 20000 : opts.timeout);\n  this.readyState = 'closed';\n  this.uri = uri;\n  this.connecting = [];\n  this.lastPing = null;\n  this.encoding = false;\n  this.packetBuffer = [];\n  var _parser = opts.parser || parser;\n  this.encoder = new _parser.Encoder();\n  this.decoder = new _parser.Decoder();\n  this.autoConnect = opts.autoConnect !== false;\n  if (this.autoConnect) this.open();\n}\n\n/**\n * Propagate given event to sockets and emit on `this`\n *\n * @api private\n */\n\nManager.prototype.emitAll = function () {\n  this.emit.apply(this, arguments);\n  for (var nsp in this.nsps) {\n    if (has.call(this.nsps, nsp)) {\n      this.nsps[nsp].emit.apply(this.nsps[nsp], arguments);\n    }\n  }\n};\n\n/**\n * Update `socket.id` of all sockets\n *\n * @api private\n */\n\nManager.prototype.updateSocketIds = function () {\n  for (var nsp in this.nsps) {\n    if (has.call(this.nsps, nsp)) {\n      this.nsps[nsp].id = this.generateId(nsp);\n    }\n  }\n};\n\n/**\n * generate `socket.id` for the given `nsp`\n *\n * @param {String} nsp\n * @return {String}\n * @api private\n */\n\nManager.prototype.generateId = function (nsp) {\n  return (nsp === '/' ? '' : (nsp + '#')) + this.engine.id;\n};\n\n/**\n * Mix in `Emitter`.\n */\n\nEmitter(Manager.prototype);\n\n/**\n * Sets the `reconnection` config.\n *\n * @param {Boolean} true/false if it should automatically reconnect\n * @return {Manager} self or value\n * @api public\n */\n\nManager.prototype.reconnection = function (v) {\n  if (!arguments.length) return this._reconnection;\n  this._reconnection = !!v;\n  return this;\n};\n\n/**\n * Sets the reconnection attempts config.\n *\n * @param {Number} max reconnection attempts before giving up\n * @return {Manager} self or value\n * @api public\n */\n\nManager.prototype.reconnectionAttempts = function (v) {\n  if (!arguments.length) return this._reconnectionAttempts;\n  this._reconnectionAttempts = v;\n  return this;\n};\n\n/**\n * Sets the delay between reconnections.\n *\n * @param {Number} delay\n * @return {Manager} self or value\n * @api public\n */\n\nManager.prototype.reconnectionDelay = function (v) {\n  if (!arguments.length) return this._reconnectionDelay;\n  this._reconnectionDelay = v;\n  this.backoff && this.backoff.setMin(v);\n  return this;\n};\n\nManager.prototype.randomizationFactor = function (v) {\n  if (!arguments.length) return this._randomizationFactor;\n  this._randomizationFactor = v;\n  this.backoff && this.backoff.setJitter(v);\n  return this;\n};\n\n/**\n * Sets the maximum delay between reconnections.\n *\n * @param {Number} delay\n * @return {Manager} self or value\n * @api public\n */\n\nManager.prototype.reconnectionDelayMax = function (v) {\n  if (!arguments.length) return this._reconnectionDelayMax;\n  this._reconnectionDelayMax = v;\n  this.backoff && this.backoff.setMax(v);\n  return this;\n};\n\n/**\n * Sets the connection timeout. `false` to disable\n *\n * @return {Manager} self or value\n * @api public\n */\n\nManager.prototype.timeout = function (v) {\n  if (!arguments.length) return this._timeout;\n  this._timeout = v;\n  return this;\n};\n\n/**\n * Starts trying to reconnect if reconnection is enabled and we have not\n * started reconnecting yet\n *\n * @api private\n */\n\nManager.prototype.maybeReconnectOnOpen = function () {\n  // Only try to reconnect if it's the first time we're connecting\n  if (!this.reconnecting && this._reconnection && this.backoff.attempts === 0) {\n    // keeps reconnection from firing twice for the same reconnection loop\n    this.reconnect();\n  }\n};\n\n/**\n * Sets the current transport `socket`.\n *\n * @param {Function} optional, callback\n * @return {Manager} self\n * @api public\n */\n\nManager.prototype.open =\nManager.prototype.connect = function (fn, opts) {\n  debug('readyState %s', this.readyState);\n  if (~this.readyState.indexOf('open')) return this;\n\n  debug('opening %s', this.uri);\n  this.engine = eio(this.uri, this.opts);\n  var socket = this.engine;\n  var self = this;\n  this.readyState = 'opening';\n  this.skipReconnect = false;\n\n  // emit `open`\n  var openSub = on(socket, 'open', function () {\n    self.onopen();\n    fn && fn();\n  });\n\n  // emit `connect_error`\n  var errorSub = on(socket, 'error', function (data) {\n    debug('connect_error');\n    self.cleanup();\n    self.readyState = 'closed';\n    self.emitAll('connect_error', data);\n    if (fn) {\n      var err = new Error('Connection error');\n      err.data = data;\n      fn(err);\n    } else {\n      // Only do this if there is no fn to handle the error\n      self.maybeReconnectOnOpen();\n    }\n  });\n\n  // emit `connect_timeout`\n  if (false !== this._timeout) {\n    var timeout = this._timeout;\n    debug('connect attempt will timeout after %d', timeout);\n\n    // set timer\n    var timer = setTimeout(function () {\n      debug('connect attempt timed out after %d', timeout);\n      openSub.destroy();\n      socket.close();\n      socket.emit('error', 'timeout');\n      self.emitAll('connect_timeout', timeout);\n    }, timeout);\n\n    this.subs.push({\n      destroy: function () {\n        clearTimeout(timer);\n      }\n    });\n  }\n\n  this.subs.push(openSub);\n  this.subs.push(errorSub);\n\n  return this;\n};\n\n/**\n * Called upon transport open.\n *\n * @api private\n */\n\nManager.prototype.onopen = function () {\n  debug('open');\n\n  // clear old subs\n  this.cleanup();\n\n  // mark as open\n  this.readyState = 'open';\n  this.emit('open');\n\n  // add new subs\n  var socket = this.engine;\n  this.subs.push(on(socket, 'data', bind(this, 'ondata')));\n  this.subs.push(on(socket, 'ping', bind(this, 'onping')));\n  this.subs.push(on(socket, 'pong', bind(this, 'onpong')));\n  this.subs.push(on(socket, 'error', bind(this, 'onerror')));\n  this.subs.push(on(socket, 'close', bind(this, 'onclose')));\n  this.subs.push(on(this.decoder, 'decoded', bind(this, 'ondecoded')));\n};\n\n/**\n * Called upon a ping.\n *\n * @api private\n */\n\nManager.prototype.onping = function () {\n  this.lastPing = new Date();\n  this.emitAll('ping');\n};\n\n/**\n * Called upon a packet.\n *\n * @api private\n */\n\nManager.prototype.onpong = function () {\n  this.emitAll('pong', new Date() - this.lastPing);\n};\n\n/**\n * Called with data.\n *\n * @api private\n */\n\nManager.prototype.ondata = function (data) {\n  this.decoder.add(data);\n};\n\n/**\n * Called when parser fully decodes a packet.\n *\n * @api private\n */\n\nManager.prototype.ondecoded = function (packet) {\n  this.emit('packet', packet);\n};\n\n/**\n * Called upon socket error.\n *\n * @api private\n */\n\nManager.prototype.onerror = function (err) {\n  debug('error', err);\n  this.emitAll('error', err);\n};\n\n/**\n * Creates a new socket for the given `nsp`.\n *\n * @return {Socket}\n * @api public\n */\n\nManager.prototype.socket = function (nsp, opts) {\n  var socket = this.nsps[nsp];\n  if (!socket) {\n    socket = new Socket(this, nsp, opts);\n    this.nsps[nsp] = socket;\n    var self = this;\n    socket.on('connecting', onConnecting);\n    socket.on('connect', function () {\n      socket.id = self.generateId(nsp);\n    });\n\n    if (this.autoConnect) {\n      // manually call here since connecting event is fired before listening\n      onConnecting();\n    }\n  }\n\n  function onConnecting () {\n    if (!~indexOf(self.connecting, socket)) {\n      self.connecting.push(socket);\n    }\n  }\n\n  return socket;\n};\n\n/**\n * Called upon a socket close.\n *\n * @param {Socket} socket\n */\n\nManager.prototype.destroy = function (socket) {\n  var index = indexOf(this.connecting, socket);\n  if (~index) this.connecting.splice(index, 1);\n  if (this.connecting.length) return;\n\n  this.close();\n};\n\n/**\n * Writes a packet.\n *\n * @param {Object} packet\n * @api private\n */\n\nManager.prototype.packet = function (packet) {\n  debug('writing packet %j', packet);\n  var self = this;\n  if (packet.query && packet.type === 0) packet.nsp += '?' + packet.query;\n\n  if (!self.encoding) {\n    // encode, then write to engine with result\n    self.encoding = true;\n    this.encoder.encode(packet, function (encodedPackets) {\n      for (var i = 0; i < encodedPackets.length; i++) {\n        self.engine.write(encodedPackets[i], packet.options);\n      }\n      self.encoding = false;\n      self.processPacketQueue();\n    });\n  } else { // add packet to the queue\n    self.packetBuffer.push(packet);\n  }\n};\n\n/**\n * If packet buffer is non-empty, begins encoding the\n * next packet in line.\n *\n * @api private\n */\n\nManager.prototype.processPacketQueue = function () {\n  if (this.packetBuffer.length > 0 && !this.encoding) {\n    var pack = this.packetBuffer.shift();\n    this.packet(pack);\n  }\n};\n\n/**\n * Clean up transport subscriptions and packet buffer.\n *\n * @api private\n */\n\nManager.prototype.cleanup = function () {\n  debug('cleanup');\n\n  var subsLength = this.subs.length;\n  for (var i = 0; i < subsLength; i++) {\n    var sub = this.subs.shift();\n    sub.destroy();\n  }\n\n  this.packetBuffer = [];\n  this.encoding = false;\n  this.lastPing = null;\n\n  this.decoder.destroy();\n};\n\n/**\n * Close the current socket.\n *\n * @api private\n */\n\nManager.prototype.close =\nManager.prototype.disconnect = function () {\n  debug('disconnect');\n  this.skipReconnect = true;\n  this.reconnecting = false;\n  if ('opening' === this.readyState) {\n    // `onclose` will not fire because\n    // an open event never happened\n    this.cleanup();\n  }\n  this.backoff.reset();\n  this.readyState = 'closed';\n  if (this.engine) this.engine.close();\n};\n\n/**\n * Called upon engine close.\n *\n * @api private\n */\n\nManager.prototype.onclose = function (reason) {\n  debug('onclose');\n\n  this.cleanup();\n  this.backoff.reset();\n  this.readyState = 'closed';\n  this.emit('close', reason);\n\n  if (this._reconnection && !this.skipReconnect) {\n    this.reconnect();\n  }\n};\n\n/**\n * Attempt a reconnection.\n *\n * @api private\n */\n\nManager.prototype.reconnect = function () {\n  if (this.reconnecting || this.skipReconnect) return this;\n\n  var self = this;\n\n  if (this.backoff.attempts >= this._reconnectionAttempts) {\n    debug('reconnect failed');\n    this.backoff.reset();\n    this.emitAll('reconnect_failed');\n    this.reconnecting = false;\n  } else {\n    var delay = this.backoff.duration();\n    debug('will wait %dms before reconnect attempt', delay);\n\n    this.reconnecting = true;\n    var timer = setTimeout(function () {\n      if (self.skipReconnect) return;\n\n      debug('attempting reconnect');\n      self.emitAll('reconnect_attempt', self.backoff.attempts);\n      self.emitAll('reconnecting', self.backoff.attempts);\n\n      // check again for the case socket closed in above events\n      if (self.skipReconnect) return;\n\n      self.open(function (err) {\n        if (err) {\n          debug('reconnect attempt error');\n          self.reconnecting = false;\n          self.reconnect();\n          self.emitAll('reconnect_error', err.data);\n        } else {\n          debug('reconnect success');\n          self.onreconnect();\n        }\n      });\n    }, delay);\n\n    this.subs.push({\n      destroy: function () {\n        clearTimeout(timer);\n      }\n    });\n  }\n};\n\n/**\n * Called upon successful reconnect.\n *\n * @api private\n */\n\nManager.prototype.onreconnect = function () {\n  var attempt = this.backoff.attempts;\n  this.reconnecting = false;\n  this.backoff.reset();\n  this.updateSocketIds();\n  this.emitAll('reconnect', attempt);\n};\n\n\n\n// WEBPACK FOOTER //\n// ./lib/manager.js","\nmodule.exports = require('./lib/index');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-client/index.js\n// module id = 14\n// module chunks = 0","\nmodule.exports = require('./socket');\n\n/**\n * Exports parser\n *\n * @api public\n *\n */\nmodule.exports.parser = require('engine.io-parser');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-client/lib/index.js\n// module id = 15\n// module chunks = 0","/**\n * Module dependencies.\n */\n\nvar transports = require('./transports/index');\nvar Emitter = require('component-emitter');\nvar debug = require('debug')('engine.io-client:socket');\nvar index = require('indexof');\nvar parser = require('engine.io-parser');\nvar parseuri = require('parseuri');\nvar parsejson = require('parsejson');\nvar parseqs = require('parseqs');\n\n/**\n * Module exports.\n */\n\nmodule.exports = Socket;\n\n/**\n * Socket constructor.\n *\n * @param {String|Object} uri or options\n * @param {Object} options\n * @api public\n */\n\nfunction Socket (uri, opts) {\n  if (!(this instanceof Socket)) return new Socket(uri, opts);\n\n  opts = opts || {};\n\n  if (uri && 'object' === typeof uri) {\n    opts = uri;\n    uri = null;\n  }\n\n  if (uri) {\n    uri = parseuri(uri);\n    opts.hostname = uri.host;\n    opts.secure = uri.protocol === 'https' || uri.protocol === 'wss';\n    opts.port = uri.port;\n    if (uri.query) opts.query = uri.query;\n  } else if (opts.host) {\n    opts.hostname = parseuri(opts.host).host;\n  }\n\n  this.secure = null != opts.secure ? opts.secure\n    : (global.location && 'https:' === location.protocol);\n\n  if (opts.hostname && !opts.port) {\n    // if no port is specified manually, use the protocol default\n    opts.port = this.secure ? '443' : '80';\n  }\n\n  this.agent = opts.agent || false;\n  this.hostname = opts.hostname ||\n    (global.location ? location.hostname : 'localhost');\n  this.port = opts.port || (global.location && location.port\n      ? location.port\n      : (this.secure ? 443 : 80));\n  this.query = opts.query || {};\n  if ('string' === typeof this.query) this.query = parseqs.decode(this.query);\n  this.upgrade = false !== opts.upgrade;\n  this.path = (opts.path || '/engine.io').replace(/\\/$/, '') + '/';\n  this.forceJSONP = !!opts.forceJSONP;\n  this.jsonp = false !== opts.jsonp;\n  this.forceBase64 = !!opts.forceBase64;\n  this.enablesXDR = !!opts.enablesXDR;\n  this.timestampParam = opts.timestampParam || 't';\n  this.timestampRequests = opts.timestampRequests;\n  this.transports = opts.transports || ['polling', 'websocket'];\n  this.transportOptions = opts.transportOptions || {};\n  this.readyState = '';\n  this.writeBuffer = [];\n  this.prevBufferLen = 0;\n  this.policyPort = opts.policyPort || 843;\n  this.rememberUpgrade = opts.rememberUpgrade || false;\n  this.binaryType = null;\n  this.onlyBinaryUpgrades = opts.onlyBinaryUpgrades;\n  this.perMessageDeflate = false !== opts.perMessageDeflate ? (opts.perMessageDeflate || {}) : false;\n\n  if (true === this.perMessageDeflate) this.perMessageDeflate = {};\n  if (this.perMessageDeflate && null == this.perMessageDeflate.threshold) {\n    this.perMessageDeflate.threshold = 1024;\n  }\n\n  // SSL options for Node.js client\n  this.pfx = opts.pfx || null;\n  this.key = opts.key || null;\n  this.passphrase = opts.passphrase || null;\n  this.cert = opts.cert || null;\n  this.ca = opts.ca || null;\n  this.ciphers = opts.ciphers || null;\n  this.rejectUnauthorized = opts.rejectUnauthorized === undefined ? true : opts.rejectUnauthorized;\n  this.forceNode = !!opts.forceNode;\n\n  // other options for Node.js client\n  var freeGlobal = typeof global === 'object' && global;\n  if (freeGlobal.global === freeGlobal) {\n    if (opts.extraHeaders && Object.keys(opts.extraHeaders).length > 0) {\n      this.extraHeaders = opts.extraHeaders;\n    }\n\n    if (opts.localAddress) {\n      this.localAddress = opts.localAddress;\n    }\n  }\n\n  // set on handshake\n  this.id = null;\n  this.upgrades = null;\n  this.pingInterval = null;\n  this.pingTimeout = null;\n\n  // set on heartbeat\n  this.pingIntervalTimer = null;\n  this.pingTimeoutTimer = null;\n\n  this.open();\n}\n\nSocket.priorWebsocketSuccess = false;\n\n/**\n * Mix in `Emitter`.\n */\n\nEmitter(Socket.prototype);\n\n/**\n * Protocol version.\n *\n * @api public\n */\n\nSocket.protocol = parser.protocol; // this is an int\n\n/**\n * Expose deps for legacy compatibility\n * and standalone browser access.\n */\n\nSocket.Socket = Socket;\nSocket.Transport = require('./transport');\nSocket.transports = require('./transports/index');\nSocket.parser = require('engine.io-parser');\n\n/**\n * Creates transport of the given type.\n *\n * @param {String} transport name\n * @return {Transport}\n * @api private\n */\n\nSocket.prototype.createTransport = function (name) {\n  debug('creating transport \"%s\"', name);\n  var query = clone(this.query);\n\n  // append engine.io protocol identifier\n  query.EIO = parser.protocol;\n\n  // transport name\n  query.transport = name;\n\n  // per-transport options\n  var options = this.transportOptions[name] || {};\n\n  // session id if we already have one\n  if (this.id) query.sid = this.id;\n\n  var transport = new transports[name]({\n    query: query,\n    socket: this,\n    agent: options.agent || this.agent,\n    hostname: options.hostname || this.hostname,\n    port: options.port || this.port,\n    secure: options.secure || this.secure,\n    path: options.path || this.path,\n    forceJSONP: options.forceJSONP || this.forceJSONP,\n    jsonp: options.jsonp || this.jsonp,\n    forceBase64: options.forceBase64 || this.forceBase64,\n    enablesXDR: options.enablesXDR || this.enablesXDR,\n    timestampRequests: options.timestampRequests || this.timestampRequests,\n    timestampParam: options.timestampParam || this.timestampParam,\n    policyPort: options.policyPort || this.policyPort,\n    pfx: options.pfx || this.pfx,\n    key: options.key || this.key,\n    passphrase: options.passphrase || this.passphrase,\n    cert: options.cert || this.cert,\n    ca: options.ca || this.ca,\n    ciphers: options.ciphers || this.ciphers,\n    rejectUnauthorized: options.rejectUnauthorized || this.rejectUnauthorized,\n    perMessageDeflate: options.perMessageDeflate || this.perMessageDeflate,\n    extraHeaders: options.extraHeaders || this.extraHeaders,\n    forceNode: options.forceNode || this.forceNode,\n    localAddress: options.localAddress || this.localAddress,\n    requestTimeout: options.requestTimeout || this.requestTimeout,\n    protocols: options.protocols || void (0)\n  });\n\n  return transport;\n};\n\nfunction clone (obj) {\n  var o = {};\n  for (var i in obj) {\n    if (obj.hasOwnProperty(i)) {\n      o[i] = obj[i];\n    }\n  }\n  return o;\n}\n\n/**\n * Initializes transport to use and starts probe.\n *\n * @api private\n */\nSocket.prototype.open = function () {\n  var transport;\n  if (this.rememberUpgrade && Socket.priorWebsocketSuccess && this.transports.indexOf('websocket') !== -1) {\n    transport = 'websocket';\n  } else if (0 === this.transports.length) {\n    // Emit error on next tick so it can be listened to\n    var self = this;\n    setTimeout(function () {\n      self.emit('error', 'No transports available');\n    }, 0);\n    return;\n  } else {\n    transport = this.transports[0];\n  }\n  this.readyState = 'opening';\n\n  // Retry with the next transport if the transport is disabled (jsonp: false)\n  try {\n    transport = this.createTransport(transport);\n  } catch (e) {\n    this.transports.shift();\n    this.open();\n    return;\n  }\n\n  transport.open();\n  this.setTransport(transport);\n};\n\n/**\n * Sets the current transport. Disables the existing one (if any).\n *\n * @api private\n */\n\nSocket.prototype.setTransport = function (transport) {\n  debug('setting transport %s', transport.name);\n  var self = this;\n\n  if (this.transport) {\n    debug('clearing existing transport %s', this.transport.name);\n    this.transport.removeAllListeners();\n  }\n\n  // set up transport\n  this.transport = transport;\n\n  // set up transport listeners\n  transport\n  .on('drain', function () {\n    self.onDrain();\n  })\n  .on('packet', function (packet) {\n    self.onPacket(packet);\n  })\n  .on('error', function (e) {\n    self.onError(e);\n  })\n  .on('close', function () {\n    self.onClose('transport close');\n  });\n};\n\n/**\n * Probes a transport.\n *\n * @param {String} transport name\n * @api private\n */\n\nSocket.prototype.probe = function (name) {\n  debug('probing transport \"%s\"', name);\n  var transport = this.createTransport(name, { probe: 1 });\n  var failed = false;\n  var self = this;\n\n  Socket.priorWebsocketSuccess = false;\n\n  function onTransportOpen () {\n    if (self.onlyBinaryUpgrades) {\n      var upgradeLosesBinary = !this.supportsBinary && self.transport.supportsBinary;\n      failed = failed || upgradeLosesBinary;\n    }\n    if (failed) return;\n\n    debug('probe transport \"%s\" opened', name);\n    transport.send([{ type: 'ping', data: 'probe' }]);\n    transport.once('packet', function (msg) {\n      if (failed) return;\n      if ('pong' === msg.type && 'probe' === msg.data) {\n        debug('probe transport \"%s\" pong', name);\n        self.upgrading = true;\n        self.emit('upgrading', transport);\n        if (!transport) return;\n        Socket.priorWebsocketSuccess = 'websocket' === transport.name;\n\n        debug('pausing current transport \"%s\"', self.transport.name);\n        self.transport.pause(function () {\n          if (failed) return;\n          if ('closed' === self.readyState) return;\n          debug('changing transport and sending upgrade packet');\n\n          cleanup();\n\n          self.setTransport(transport);\n          transport.send([{ type: 'upgrade' }]);\n          self.emit('upgrade', transport);\n          transport = null;\n          self.upgrading = false;\n          self.flush();\n        });\n      } else {\n        debug('probe transport \"%s\" failed', name);\n        var err = new Error('probe error');\n        err.transport = transport.name;\n        self.emit('upgradeError', err);\n      }\n    });\n  }\n\n  function freezeTransport () {\n    if (failed) return;\n\n    // Any callback called by transport should be ignored since now\n    failed = true;\n\n    cleanup();\n\n    transport.close();\n    transport = null;\n  }\n\n  // Handle any error that happens while probing\n  function onerror (err) {\n    var error = new Error('probe error: ' + err);\n    error.transport = transport.name;\n\n    freezeTransport();\n\n    debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n    self.emit('upgradeError', error);\n  }\n\n  function onTransportClose () {\n    onerror('transport closed');\n  }\n\n  // When the socket is closed while we're probing\n  function onclose () {\n    onerror('socket closed');\n  }\n\n  // When the socket is upgraded while we're probing\n  function onupgrade (to) {\n    if (transport && to.name !== transport.name) {\n      debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n      freezeTransport();\n    }\n  }\n\n  // Remove all listeners on the transport and on self\n  function cleanup () {\n    transport.removeListener('open', onTransportOpen);\n    transport.removeListener('error', onerror);\n    transport.removeListener('close', onTransportClose);\n    self.removeListener('close', onclose);\n    self.removeListener('upgrading', onupgrade);\n  }\n\n  transport.once('open', onTransportOpen);\n  transport.once('error', onerror);\n  transport.once('close', onTransportClose);\n\n  this.once('close', onclose);\n  this.once('upgrading', onupgrade);\n\n  transport.open();\n};\n\n/**\n * Called when connection is deemed open.\n *\n * @api public\n */\n\nSocket.prototype.onOpen = function () {\n  debug('socket open');\n  this.readyState = 'open';\n  Socket.priorWebsocketSuccess = 'websocket' === this.transport.name;\n  this.emit('open');\n  this.flush();\n\n  // we check for `readyState` in case an `open`\n  // listener already closed the socket\n  if ('open' === this.readyState && this.upgrade && this.transport.pause) {\n    debug('starting upgrade probes');\n    for (var i = 0, l = this.upgrades.length; i < l; i++) {\n      this.probe(this.upgrades[i]);\n    }\n  }\n};\n\n/**\n * Handles a packet.\n *\n * @api private\n */\n\nSocket.prototype.onPacket = function (packet) {\n  if ('opening' === this.readyState || 'open' === this.readyState ||\n      'closing' === this.readyState) {\n    debug('socket receive: type \"%s\", data \"%s\"', packet.type, packet.data);\n\n    this.emit('packet', packet);\n\n    // Socket is live - any packet counts\n    this.emit('heartbeat');\n\n    switch (packet.type) {\n      case 'open':\n        this.onHandshake(parsejson(packet.data));\n        break;\n\n      case 'pong':\n        this.setPing();\n        this.emit('pong');\n        break;\n\n      case 'error':\n        var err = new Error('server error');\n        err.code = packet.data;\n        this.onError(err);\n        break;\n\n      case 'message':\n        this.emit('data', packet.data);\n        this.emit('message', packet.data);\n        break;\n    }\n  } else {\n    debug('packet received with socket readyState \"%s\"', this.readyState);\n  }\n};\n\n/**\n * Called upon handshake completion.\n *\n * @param {Object} handshake obj\n * @api private\n */\n\nSocket.prototype.onHandshake = function (data) {\n  this.emit('handshake', data);\n  this.id = data.sid;\n  this.transport.query.sid = data.sid;\n  this.upgrades = this.filterUpgrades(data.upgrades);\n  this.pingInterval = data.pingInterval;\n  this.pingTimeout = data.pingTimeout;\n  this.onOpen();\n  // In case open handler closes socket\n  if ('closed' === this.readyState) return;\n  this.setPing();\n\n  // Prolong liveness of socket on heartbeat\n  this.removeListener('heartbeat', this.onHeartbeat);\n  this.on('heartbeat', this.onHeartbeat);\n};\n\n/**\n * Resets ping timeout.\n *\n * @api private\n */\n\nSocket.prototype.onHeartbeat = function (timeout) {\n  clearTimeout(this.pingTimeoutTimer);\n  var self = this;\n  self.pingTimeoutTimer = setTimeout(function () {\n    if ('closed' === self.readyState) return;\n    self.onClose('ping timeout');\n  }, timeout || (self.pingInterval + self.pingTimeout));\n};\n\n/**\n * Pings server every `this.pingInterval` and expects response\n * within `this.pingTimeout` or closes connection.\n *\n * @api private\n */\n\nSocket.prototype.setPing = function () {\n  var self = this;\n  clearTimeout(self.pingIntervalTimer);\n  self.pingIntervalTimer = setTimeout(function () {\n    debug('writing ping packet - expecting pong within %sms', self.pingTimeout);\n    self.ping();\n    self.onHeartbeat(self.pingTimeout);\n  }, self.pingInterval);\n};\n\n/**\n* Sends a ping packet.\n*\n* @api private\n*/\n\nSocket.prototype.ping = function () {\n  var self = this;\n  this.sendPacket('ping', function () {\n    self.emit('ping');\n  });\n};\n\n/**\n * Called on `drain` event\n *\n * @api private\n */\n\nSocket.prototype.onDrain = function () {\n  this.writeBuffer.splice(0, this.prevBufferLen);\n\n  // setting prevBufferLen = 0 is very important\n  // for example, when upgrading, upgrade packet is sent over,\n  // and a nonzero prevBufferLen could cause problems on `drain`\n  this.prevBufferLen = 0;\n\n  if (0 === this.writeBuffer.length) {\n    this.emit('drain');\n  } else {\n    this.flush();\n  }\n};\n\n/**\n * Flush write buffers.\n *\n * @api private\n */\n\nSocket.prototype.flush = function () {\n  if ('closed' !== this.readyState && this.transport.writable &&\n    !this.upgrading && this.writeBuffer.length) {\n    debug('flushing %d packets in socket', this.writeBuffer.length);\n    this.transport.send(this.writeBuffer);\n    // keep track of current length of writeBuffer\n    // splice writeBuffer and callbackBuffer on `drain`\n    this.prevBufferLen = this.writeBuffer.length;\n    this.emit('flush');\n  }\n};\n\n/**\n * Sends a message.\n *\n * @param {String} message.\n * @param {Function} callback function.\n * @param {Object} options.\n * @return {Socket} for chaining.\n * @api public\n */\n\nSocket.prototype.write =\nSocket.prototype.send = function (msg, options, fn) {\n  this.sendPacket('message', msg, options, fn);\n  return this;\n};\n\n/**\n * Sends a packet.\n *\n * @param {String} packet type.\n * @param {String} data.\n * @param {Object} options.\n * @param {Function} callback function.\n * @api private\n */\n\nSocket.prototype.sendPacket = function (type, data, options, fn) {\n  if ('function' === typeof data) {\n    fn = data;\n    data = undefined;\n  }\n\n  if ('function' === typeof options) {\n    fn = options;\n    options = null;\n  }\n\n  if ('closing' === this.readyState || 'closed' === this.readyState) {\n    return;\n  }\n\n  options = options || {};\n  options.compress = false !== options.compress;\n\n  var packet = {\n    type: type,\n    data: data,\n    options: options\n  };\n  this.emit('packetCreate', packet);\n  this.writeBuffer.push(packet);\n  if (fn) this.once('flush', fn);\n  this.flush();\n};\n\n/**\n * Closes the connection.\n *\n * @api private\n */\n\nSocket.prototype.close = function () {\n  if ('opening' === this.readyState || 'open' === this.readyState) {\n    this.readyState = 'closing';\n\n    var self = this;\n\n    if (this.writeBuffer.length) {\n      this.once('drain', function () {\n        if (this.upgrading) {\n          waitForUpgrade();\n        } else {\n          close();\n        }\n      });\n    } else if (this.upgrading) {\n      waitForUpgrade();\n    } else {\n      close();\n    }\n  }\n\n  function close () {\n    self.onClose('forced close');\n    debug('socket closing - telling transport to close');\n    self.transport.close();\n  }\n\n  function cleanupAndClose () {\n    self.removeListener('upgrade', cleanupAndClose);\n    self.removeListener('upgradeError', cleanupAndClose);\n    close();\n  }\n\n  function waitForUpgrade () {\n    // wait for upgrade to finish since we can't send packets while pausing a transport\n    self.once('upgrade', cleanupAndClose);\n    self.once('upgradeError', cleanupAndClose);\n  }\n\n  return this;\n};\n\n/**\n * Called upon transport error\n *\n * @api private\n */\n\nSocket.prototype.onError = function (err) {\n  debug('socket error %j', err);\n  Socket.priorWebsocketSuccess = false;\n  this.emit('error', err);\n  this.onClose('transport error', err);\n};\n\n/**\n * Called upon transport close.\n *\n * @api private\n */\n\nSocket.prototype.onClose = function (reason, desc) {\n  if ('opening' === this.readyState || 'open' === this.readyState || 'closing' === this.readyState) {\n    debug('socket close with reason: \"%s\"', reason);\n    var self = this;\n\n    // clear timers\n    clearTimeout(this.pingIntervalTimer);\n    clearTimeout(this.pingTimeoutTimer);\n\n    // stop event from firing again for transport\n    this.transport.removeAllListeners('close');\n\n    // ensure transport won't stay open\n    this.transport.close();\n\n    // ignore further transport communication\n    this.transport.removeAllListeners();\n\n    // set ready state\n    this.readyState = 'closed';\n\n    // clear session id\n    this.id = null;\n\n    // emit close event\n    this.emit('close', reason, desc);\n\n    // clean buffers after, so users can still\n    // grab the buffers on `close` event\n    self.writeBuffer = [];\n    self.prevBufferLen = 0;\n  }\n};\n\n/**\n * Filters upgrades, returning only those matching client transports.\n *\n * @param {Array} server upgrades\n * @api private\n *\n */\n\nSocket.prototype.filterUpgrades = function (upgrades) {\n  var filteredUpgrades = [];\n  for (var i = 0, j = upgrades.length; i < j; i++) {\n    if (~index(this.transports, upgrades[i])) filteredUpgrades.push(upgrades[i]);\n  }\n  return filteredUpgrades;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-client/lib/socket.js\n// module id = 16\n// module chunks = 0","/**\n * Module dependencies\n */\n\nvar XMLHttpRequest = require('xmlhttprequest-ssl');\nvar XHR = require('./polling-xhr');\nvar JSONP = require('./polling-jsonp');\nvar websocket = require('./websocket');\n\n/**\n * Export transports.\n */\n\nexports.polling = polling;\nexports.websocket = websocket;\n\n/**\n * Polling transport polymorphic constructor.\n * Decides on xhr vs jsonp based on feature detection.\n *\n * @api private\n */\n\nfunction polling (opts) {\n  var xhr;\n  var xd = false;\n  var xs = false;\n  var jsonp = false !== opts.jsonp;\n\n  if (global.location) {\n    var isSSL = 'https:' === location.protocol;\n    var port = location.port;\n\n    // some user agents have empty `location.port`\n    if (!port) {\n      port = isSSL ? 443 : 80;\n    }\n\n    xd = opts.hostname !== location.hostname || port !== opts.port;\n    xs = opts.secure !== isSSL;\n  }\n\n  opts.xdomain = xd;\n  opts.xscheme = xs;\n  xhr = new XMLHttpRequest(opts);\n\n  if ('open' in xhr && !opts.forceJSONP) {\n    return new XHR(opts);\n  } else {\n    if (!jsonp) throw new Error('JSONP disabled');\n    return new JSONP(opts);\n  }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-client/lib/transports/index.js\n// module id = 17\n// module chunks = 0","// browser shim for xmlhttprequest module\n\nvar hasCORS = require('has-cors');\n\nmodule.exports = function (opts) {\n  var xdomain = opts.xdomain;\n\n  // scheme must be same when usign XDomainRequest\n  // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx\n  var xscheme = opts.xscheme;\n\n  // XDomainRequest has a flow of not sending cookie, therefore it should be disabled as a default.\n  // https://github.com/Automattic/engine.io-client/pull/217\n  var enablesXDR = opts.enablesXDR;\n\n  // XMLHttpRequest can be disabled on IE\n  try {\n    if ('undefined' !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {\n      return new XMLHttpRequest();\n    }\n  } catch (e) { }\n\n  // Use XDomainRequest for IE8 if enablesXDR is true\n  // because loading bar keeps flashing when using jsonp-polling\n  // https://github.com/yujiosaka/socke.io-ie8-loading-example\n  try {\n    if ('undefined' !== typeof XDomainRequest && !xscheme && enablesXDR) {\n      return new XDomainRequest();\n    }\n  } catch (e) { }\n\n  if (!xdomain) {\n    try {\n      return new global[['Active'].concat('Object').join('X')]('Microsoft.XMLHTTP');\n    } catch (e) { }\n  }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-client/lib/xmlhttprequest.js\n// module id = 18\n// module chunks = 0","\n/**\n * Module exports.\n *\n * Logic borrowed from Modernizr:\n *\n *   - https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cors.js\n */\n\ntry {\n  module.exports = typeof XMLHttpRequest !== 'undefined' &&\n    'withCredentials' in new XMLHttpRequest();\n} catch (err) {\n  // if XMLHttp support is disabled in IE then it will throw\n  // when trying to create\n  module.exports = false;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/has-cors/index.js\n// module id = 19\n// module chunks = 0","/**\n * Module requirements.\n */\n\nvar XMLHttpRequest = require('xmlhttprequest-ssl');\nvar Polling = require('./polling');\nvar Emitter = require('component-emitter');\nvar inherit = require('component-inherit');\nvar debug = require('debug')('engine.io-client:polling-xhr');\n\n/**\n * Module exports.\n */\n\nmodule.exports = XHR;\nmodule.exports.Request = Request;\n\n/**\n * Empty function\n */\n\nfunction empty () {}\n\n/**\n * XHR Polling constructor.\n *\n * @param {Object} opts\n * @api public\n */\n\nfunction XHR (opts) {\n  Polling.call(this, opts);\n  this.requestTimeout = opts.requestTimeout;\n  this.extraHeaders = opts.extraHeaders;\n\n  if (global.location) {\n    var isSSL = 'https:' === location.protocol;\n    var port = location.port;\n\n    // some user agents have empty `location.port`\n    if (!port) {\n      port = isSSL ? 443 : 80;\n    }\n\n    this.xd = opts.hostname !== global.location.hostname ||\n      port !== opts.port;\n    this.xs = opts.secure !== isSSL;\n  }\n}\n\n/**\n * Inherits from Polling.\n */\n\ninherit(XHR, Polling);\n\n/**\n * XHR supports binary\n */\n\nXHR.prototype.supportsBinary = true;\n\n/**\n * Creates a request.\n *\n * @param {String} method\n * @api private\n */\n\nXHR.prototype.request = function (opts) {\n  opts = opts || {};\n  opts.uri = this.uri();\n  opts.xd = this.xd;\n  opts.xs = this.xs;\n  opts.agent = this.agent || false;\n  opts.supportsBinary = this.supportsBinary;\n  opts.enablesXDR = this.enablesXDR;\n\n  // SSL options for Node.js client\n  opts.pfx = this.pfx;\n  opts.key = this.key;\n  opts.passphrase = this.passphrase;\n  opts.cert = this.cert;\n  opts.ca = this.ca;\n  opts.ciphers = this.ciphers;\n  opts.rejectUnauthorized = this.rejectUnauthorized;\n  opts.requestTimeout = this.requestTimeout;\n\n  // other options for Node.js client\n  opts.extraHeaders = this.extraHeaders;\n\n  return new Request(opts);\n};\n\n/**\n * Sends data.\n *\n * @param {String} data to send.\n * @param {Function} called upon flush.\n * @api private\n */\n\nXHR.prototype.doWrite = function (data, fn) {\n  var isBinary = typeof data !== 'string' && data !== undefined;\n  var req = this.request({ method: 'POST', data: data, isBinary: isBinary });\n  var self = this;\n  req.on('success', fn);\n  req.on('error', function (err) {\n    self.onError('xhr post error', err);\n  });\n  this.sendXhr = req;\n};\n\n/**\n * Starts a poll cycle.\n *\n * @api private\n */\n\nXHR.prototype.doPoll = function () {\n  debug('xhr poll');\n  var req = this.request();\n  var self = this;\n  req.on('data', function (data) {\n    self.onData(data);\n  });\n  req.on('error', function (err) {\n    self.onError('xhr poll error', err);\n  });\n  this.pollXhr = req;\n};\n\n/**\n * Request constructor\n *\n * @param {Object} options\n * @api public\n */\n\nfunction Request (opts) {\n  this.method = opts.method || 'GET';\n  this.uri = opts.uri;\n  this.xd = !!opts.xd;\n  this.xs = !!opts.xs;\n  this.async = false !== opts.async;\n  this.data = undefined !== opts.data ? opts.data : null;\n  this.agent = opts.agent;\n  this.isBinary = opts.isBinary;\n  this.supportsBinary = opts.supportsBinary;\n  this.enablesXDR = opts.enablesXDR;\n  this.requestTimeout = opts.requestTimeout;\n\n  // SSL options for Node.js client\n  this.pfx = opts.pfx;\n  this.key = opts.key;\n  this.passphrase = opts.passphrase;\n  this.cert = opts.cert;\n  this.ca = opts.ca;\n  this.ciphers = opts.ciphers;\n  this.rejectUnauthorized = opts.rejectUnauthorized;\n\n  // other options for Node.js client\n  this.extraHeaders = opts.extraHeaders;\n\n  this.create();\n}\n\n/**\n * Mix in `Emitter`.\n */\n\nEmitter(Request.prototype);\n\n/**\n * Creates the XHR object and sends the request.\n *\n * @api private\n */\n\nRequest.prototype.create = function () {\n  var opts = { agent: this.agent, xdomain: this.xd, xscheme: this.xs, enablesXDR: this.enablesXDR };\n\n  // SSL options for Node.js client\n  opts.pfx = this.pfx;\n  opts.key = this.key;\n  opts.passphrase = this.passphrase;\n  opts.cert = this.cert;\n  opts.ca = this.ca;\n  opts.ciphers = this.ciphers;\n  opts.rejectUnauthorized = this.rejectUnauthorized;\n\n  var xhr = this.xhr = new XMLHttpRequest(opts);\n  var self = this;\n\n  try {\n    debug('xhr open %s: %s', this.method, this.uri);\n    xhr.open(this.method, this.uri, this.async);\n    try {\n      if (this.extraHeaders) {\n        xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);\n        for (var i in this.extraHeaders) {\n          if (this.extraHeaders.hasOwnProperty(i)) {\n            xhr.setRequestHeader(i, this.extraHeaders[i]);\n          }\n        }\n      }\n    } catch (e) {}\n\n    if ('POST' === this.method) {\n      try {\n        if (this.isBinary) {\n          xhr.setRequestHeader('Content-type', 'application/octet-stream');\n        } else {\n          xhr.setRequestHeader('Content-type', 'text/plain;charset=UTF-8');\n        }\n      } catch (e) {}\n    }\n\n    try {\n      xhr.setRequestHeader('Accept', '*/*');\n    } catch (e) {}\n\n    // ie6 check\n    if ('withCredentials' in xhr) {\n      xhr.withCredentials = true;\n    }\n\n    if (this.requestTimeout) {\n      xhr.timeout = this.requestTimeout;\n    }\n\n    if (this.hasXDR()) {\n      xhr.onload = function () {\n        self.onLoad();\n      };\n      xhr.onerror = function () {\n        self.onError(xhr.responseText);\n      };\n    } else {\n      xhr.onreadystatechange = function () {\n        if (xhr.readyState === 2) {\n          var contentType;\n          try {\n            contentType = xhr.getResponseHeader('Content-Type');\n          } catch (e) {}\n          if (contentType === 'application/octet-stream') {\n            xhr.responseType = 'arraybuffer';\n          }\n        }\n        if (4 !== xhr.readyState) return;\n        if (200 === xhr.status || 1223 === xhr.status) {\n          self.onLoad();\n        } else {\n          // make sure the `error` event handler that's user-set\n          // does not throw in the same tick and gets caught here\n          setTimeout(function () {\n            self.onError(xhr.status);\n          }, 0);\n        }\n      };\n    }\n\n    debug('xhr data %s', this.data);\n    xhr.send(this.data);\n  } catch (e) {\n    // Need to defer since .create() is called directly fhrom the constructor\n    // and thus the 'error' event can only be only bound *after* this exception\n    // occurs.  Therefore, also, we cannot throw here at all.\n    setTimeout(function () {\n      self.onError(e);\n    }, 0);\n    return;\n  }\n\n  if (global.document) {\n    this.index = Request.requestsCount++;\n    Request.requests[this.index] = this;\n  }\n};\n\n/**\n * Called upon successful response.\n *\n * @api private\n */\n\nRequest.prototype.onSuccess = function () {\n  this.emit('success');\n  this.cleanup();\n};\n\n/**\n * Called if we have data.\n *\n * @api private\n */\n\nRequest.prototype.onData = function (data) {\n  this.emit('data', data);\n  this.onSuccess();\n};\n\n/**\n * Called upon error.\n *\n * @api private\n */\n\nRequest.prototype.onError = function (err) {\n  this.emit('error', err);\n  this.cleanup(true);\n};\n\n/**\n * Cleans up house.\n *\n * @api private\n */\n\nRequest.prototype.cleanup = function (fromError) {\n  if ('undefined' === typeof this.xhr || null === this.xhr) {\n    return;\n  }\n  // xmlhttprequest\n  if (this.hasXDR()) {\n    this.xhr.onload = this.xhr.onerror = empty;\n  } else {\n    this.xhr.onreadystatechange = empty;\n  }\n\n  if (fromError) {\n    try {\n      this.xhr.abort();\n    } catch (e) {}\n  }\n\n  if (global.document) {\n    delete Request.requests[this.index];\n  }\n\n  this.xhr = null;\n};\n\n/**\n * Called upon load.\n *\n * @api private\n */\n\nRequest.prototype.onLoad = function () {\n  var data;\n  try {\n    var contentType;\n    try {\n      contentType = this.xhr.getResponseHeader('Content-Type');\n    } catch (e) {}\n    if (contentType === 'application/octet-stream') {\n      data = this.xhr.response || this.xhr.responseText;\n    } else {\n      data = this.xhr.responseText;\n    }\n  } catch (e) {\n    this.onError(e);\n  }\n  if (null != data) {\n    this.onData(data);\n  }\n};\n\n/**\n * Check if it has XDomainRequest.\n *\n * @api private\n */\n\nRequest.prototype.hasXDR = function () {\n  return 'undefined' !== typeof global.XDomainRequest && !this.xs && this.enablesXDR;\n};\n\n/**\n * Aborts the request.\n *\n * @api public\n */\n\nRequest.prototype.abort = function () {\n  this.cleanup();\n};\n\n/**\n * Aborts pending requests when unloading the window. This is needed to prevent\n * memory leaks (e.g. when using IE) and to ensure that no spurious error is\n * emitted.\n */\n\nRequest.requestsCount = 0;\nRequest.requests = {};\n\nif (global.document) {\n  if (global.attachEvent) {\n    global.attachEvent('onunload', unloadHandler);\n  } else if (global.addEventListener) {\n    global.addEventListener('beforeunload', unloadHandler, false);\n  }\n}\n\nfunction unloadHandler () {\n  for (var i in Request.requests) {\n    if (Request.requests.hasOwnProperty(i)) {\n      Request.requests[i].abort();\n    }\n  }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-client/lib/transports/polling-xhr.js\n// module id = 20\n// module chunks = 0","/**\n * Module dependencies.\n */\n\nvar Transport = require('../transport');\nvar parseqs = require('parseqs');\nvar parser = require('engine.io-parser');\nvar inherit = require('component-inherit');\nvar yeast = require('yeast');\nvar debug = require('debug')('engine.io-client:polling');\n\n/**\n * Module exports.\n */\n\nmodule.exports = Polling;\n\n/**\n * Is XHR2 supported?\n */\n\nvar hasXHR2 = (function () {\n  var XMLHttpRequest = require('xmlhttprequest-ssl');\n  var xhr = new XMLHttpRequest({ xdomain: false });\n  return null != xhr.responseType;\n})();\n\n/**\n * Polling interface.\n *\n * @param {Object} opts\n * @api private\n */\n\nfunction Polling (opts) {\n  var forceBase64 = (opts && opts.forceBase64);\n  if (!hasXHR2 || forceBase64) {\n    this.supportsBinary = false;\n  }\n  Transport.call(this, opts);\n}\n\n/**\n * Inherits from Transport.\n */\n\ninherit(Polling, Transport);\n\n/**\n * Transport name.\n */\n\nPolling.prototype.name = 'polling';\n\n/**\n * Opens the socket (triggers polling). We write a PING message to determine\n * when the transport is open.\n *\n * @api private\n */\n\nPolling.prototype.doOpen = function () {\n  this.poll();\n};\n\n/**\n * Pauses polling.\n *\n * @param {Function} callback upon buffers are flushed and transport is paused\n * @api private\n */\n\nPolling.prototype.pause = function (onPause) {\n  var self = this;\n\n  this.readyState = 'pausing';\n\n  function pause () {\n    debug('paused');\n    self.readyState = 'paused';\n    onPause();\n  }\n\n  if (this.polling || !this.writable) {\n    var total = 0;\n\n    if (this.polling) {\n      debug('we are currently polling - waiting to pause');\n      total++;\n      this.once('pollComplete', function () {\n        debug('pre-pause polling complete');\n        --total || pause();\n      });\n    }\n\n    if (!this.writable) {\n      debug('we are currently writing - waiting to pause');\n      total++;\n      this.once('drain', function () {\n        debug('pre-pause writing complete');\n        --total || pause();\n      });\n    }\n  } else {\n    pause();\n  }\n};\n\n/**\n * Starts polling cycle.\n *\n * @api public\n */\n\nPolling.prototype.poll = function () {\n  debug('polling');\n  this.polling = true;\n  this.doPoll();\n  this.emit('poll');\n};\n\n/**\n * Overloads onData to detect payloads.\n *\n * @api private\n */\n\nPolling.prototype.onData = function (data) {\n  var self = this;\n  debug('polling got data %s', data);\n  var callback = function (packet, index, total) {\n    // if its the first message we consider the transport open\n    if ('opening' === self.readyState) {\n      self.onOpen();\n    }\n\n    // if its a close packet, we close the ongoing requests\n    if ('close' === packet.type) {\n      self.onClose();\n      return false;\n    }\n\n    // otherwise bypass onData and handle the message\n    self.onPacket(packet);\n  };\n\n  // decode payload\n  parser.decodePayload(data, this.socket.binaryType, callback);\n\n  // if an event did not trigger closing\n  if ('closed' !== this.readyState) {\n    // if we got data we're not polling\n    this.polling = false;\n    this.emit('pollComplete');\n\n    if ('open' === this.readyState) {\n      this.poll();\n    } else {\n      debug('ignoring poll - transport state \"%s\"', this.readyState);\n    }\n  }\n};\n\n/**\n * For polling, send a close packet.\n *\n * @api private\n */\n\nPolling.prototype.doClose = function () {\n  var self = this;\n\n  function close () {\n    debug('writing close packet');\n    self.write([{ type: 'close' }]);\n  }\n\n  if ('open' === this.readyState) {\n    debug('transport open - closing');\n    close();\n  } else {\n    // in case we're trying to close while\n    // handshaking is in progress (GH-164)\n    debug('transport not open - deferring close');\n    this.once('open', close);\n  }\n};\n\n/**\n * Writes a packets payload.\n *\n * @param {Array} data packets\n * @param {Function} drain callback\n * @api private\n */\n\nPolling.prototype.write = function (packets) {\n  var self = this;\n  this.writable = false;\n  var callbackfn = function () {\n    self.writable = true;\n    self.emit('drain');\n  };\n\n  parser.encodePayload(packets, this.supportsBinary, function (data) {\n    self.doWrite(data, callbackfn);\n  });\n};\n\n/**\n * Generates uri for connection.\n *\n * @api private\n */\n\nPolling.prototype.uri = function () {\n  var query = this.query || {};\n  var schema = this.secure ? 'https' : 'http';\n  var port = '';\n\n  // cache busting is forced\n  if (false !== this.timestampRequests) {\n    query[this.timestampParam] = yeast();\n  }\n\n  if (!this.supportsBinary && !query.sid) {\n    query.b64 = 1;\n  }\n\n  query = parseqs.encode(query);\n\n  // avoid port if default for schema\n  if (this.port && (('https' === schema && Number(this.port) !== 443) ||\n     ('http' === schema && Number(this.port) !== 80))) {\n    port = ':' + this.port;\n  }\n\n  // prepend ? to query\n  if (query.length) {\n    query = '?' + query;\n  }\n\n  var ipv6 = this.hostname.indexOf(':') !== -1;\n  return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-client/lib/transports/polling.js\n// module id = 21\n// module chunks = 0","/**\n * Module dependencies.\n */\n\nvar parser = require('engine.io-parser');\nvar Emitter = require('component-emitter');\n\n/**\n * Module exports.\n */\n\nmodule.exports = Transport;\n\n/**\n * Transport abstract constructor.\n *\n * @param {Object} options.\n * @api private\n */\n\nfunction Transport (opts) {\n  this.path = opts.path;\n  this.hostname = opts.hostname;\n  this.port = opts.port;\n  this.secure = opts.secure;\n  this.query = opts.query;\n  this.timestampParam = opts.timestampParam;\n  this.timestampRequests = opts.timestampRequests;\n  this.readyState = '';\n  this.agent = opts.agent || false;\n  this.socket = opts.socket;\n  this.enablesXDR = opts.enablesXDR;\n\n  // SSL options for Node.js client\n  this.pfx = opts.pfx;\n  this.key = opts.key;\n  this.passphrase = opts.passphrase;\n  this.cert = opts.cert;\n  this.ca = opts.ca;\n  this.ciphers = opts.ciphers;\n  this.rejectUnauthorized = opts.rejectUnauthorized;\n  this.forceNode = opts.forceNode;\n\n  // other options for Node.js client\n  this.extraHeaders = opts.extraHeaders;\n  this.localAddress = opts.localAddress;\n}\n\n/**\n * Mix in `Emitter`.\n */\n\nEmitter(Transport.prototype);\n\n/**\n * Emits an error.\n *\n * @param {String} str\n * @return {Transport} for chaining\n * @api public\n */\n\nTransport.prototype.onError = function (msg, desc) {\n  var err = new Error(msg);\n  err.type = 'TransportError';\n  err.description = desc;\n  this.emit('error', err);\n  return this;\n};\n\n/**\n * Opens the transport.\n *\n * @api public\n */\n\nTransport.prototype.open = function () {\n  if ('closed' === this.readyState || '' === this.readyState) {\n    this.readyState = 'opening';\n    this.doOpen();\n  }\n\n  return this;\n};\n\n/**\n * Closes the transport.\n *\n * @api private\n */\n\nTransport.prototype.close = function () {\n  if ('opening' === this.readyState || 'open' === this.readyState) {\n    this.doClose();\n    this.onClose();\n  }\n\n  return this;\n};\n\n/**\n * Sends multiple packets.\n *\n * @param {Array} packets\n * @api private\n */\n\nTransport.prototype.send = function (packets) {\n  if ('open' === this.readyState) {\n    this.write(packets);\n  } else {\n    throw new Error('Transport not open');\n  }\n};\n\n/**\n * Called upon open\n *\n * @api private\n */\n\nTransport.prototype.onOpen = function () {\n  this.readyState = 'open';\n  this.writable = true;\n  this.emit('open');\n};\n\n/**\n * Called with data.\n *\n * @param {String} data\n * @api private\n */\n\nTransport.prototype.onData = function (data) {\n  var packet = parser.decodePacket(data, this.socket.binaryType);\n  this.onPacket(packet);\n};\n\n/**\n * Called with a decoded packet.\n */\n\nTransport.prototype.onPacket = function (packet) {\n  this.emit('packet', packet);\n};\n\n/**\n * Called upon close.\n *\n * @api private\n */\n\nTransport.prototype.onClose = function () {\n  this.readyState = 'closed';\n  this.emit('close');\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-client/lib/transport.js\n// module id = 22\n// module chunks = 0","/**\n * Module dependencies.\n */\n\nvar keys = require('./keys');\nvar hasBinary = require('has-binary2');\nvar sliceBuffer = require('arraybuffer.slice');\nvar after = require('after');\nvar utf8 = require('./utf8');\n\nvar base64encoder;\nif (global && global.ArrayBuffer) {\n  base64encoder = require('base64-arraybuffer');\n}\n\n/**\n * Check if we are running an android browser. That requires us to use\n * ArrayBuffer with polling transports...\n *\n * http://ghinda.net/jpeg-blob-ajax-android/\n */\n\nvar isAndroid = typeof navigator !== 'undefined' && /Android/i.test(navigator.userAgent);\n\n/**\n * Check if we are running in PhantomJS.\n * Uploading a Blob with PhantomJS does not work correctly, as reported here:\n * https://github.com/ariya/phantomjs/issues/11395\n * @type boolean\n */\nvar isPhantomJS = typeof navigator !== 'undefined' && /PhantomJS/i.test(navigator.userAgent);\n\n/**\n * When true, avoids using Blobs to encode payloads.\n * @type boolean\n */\nvar dontSendBlobs = isAndroid || isPhantomJS;\n\n/**\n * Current protocol version.\n */\n\nexports.protocol = 3;\n\n/**\n * Packet types.\n */\n\nvar packets = exports.packets = {\n    open:     0    // non-ws\n  , close:    1    // non-ws\n  , ping:     2\n  , pong:     3\n  , message:  4\n  , upgrade:  5\n  , noop:     6\n};\n\nvar packetslist = keys(packets);\n\n/**\n * Premade error packet.\n */\n\nvar err = { type: 'error', data: 'parser error' };\n\n/**\n * Create a blob api even for blob builder when vendor prefixes exist\n */\n\nvar Blob = require('blob');\n\n/**\n * Encodes a packet.\n *\n *     <packet type id> [ <data> ]\n *\n * Example:\n *\n *     5hello world\n *     3\n *     4\n *\n * Binary is encoded in an identical principle\n *\n * @api private\n */\n\nexports.encodePacket = function (packet, supportsBinary, utf8encode, callback) {\n  if (typeof supportsBinary === 'function') {\n    callback = supportsBinary;\n    supportsBinary = false;\n  }\n\n  if (typeof utf8encode === 'function') {\n    callback = utf8encode;\n    utf8encode = null;\n  }\n\n  var data = (packet.data === undefined)\n    ? undefined\n    : packet.data.buffer || packet.data;\n\n  if (global.ArrayBuffer && data instanceof ArrayBuffer) {\n    return encodeArrayBuffer(packet, supportsBinary, callback);\n  } else if (Blob && data instanceof global.Blob) {\n    return encodeBlob(packet, supportsBinary, callback);\n  }\n\n  // might be an object with { base64: true, data: dataAsBase64String }\n  if (data && data.base64) {\n    return encodeBase64Object(packet, callback);\n  }\n\n  // Sending data as a utf-8 string\n  var encoded = packets[packet.type];\n\n  // data fragment is optional\n  if (undefined !== packet.data) {\n    encoded += utf8encode ? utf8.encode(String(packet.data), { strict: false }) : String(packet.data);\n  }\n\n  return callback('' + encoded);\n\n};\n\nfunction encodeBase64Object(packet, callback) {\n  // packet data is an object { base64: true, data: dataAsBase64String }\n  var message = 'b' + exports.packets[packet.type] + packet.data.data;\n  return callback(message);\n}\n\n/**\n * Encode packet helpers for binary types\n */\n\nfunction encodeArrayBuffer(packet, supportsBinary, callback) {\n  if (!supportsBinary) {\n    return exports.encodeBase64Packet(packet, callback);\n  }\n\n  var data = packet.data;\n  var contentArray = new Uint8Array(data);\n  var resultBuffer = new Uint8Array(1 + data.byteLength);\n\n  resultBuffer[0] = packets[packet.type];\n  for (var i = 0; i < contentArray.length; i++) {\n    resultBuffer[i+1] = contentArray[i];\n  }\n\n  return callback(resultBuffer.buffer);\n}\n\nfunction encodeBlobAsArrayBuffer(packet, supportsBinary, callback) {\n  if (!supportsBinary) {\n    return exports.encodeBase64Packet(packet, callback);\n  }\n\n  var fr = new FileReader();\n  fr.onload = function() {\n    packet.data = fr.result;\n    exports.encodePacket(packet, supportsBinary, true, callback);\n  };\n  return fr.readAsArrayBuffer(packet.data);\n}\n\nfunction encodeBlob(packet, supportsBinary, callback) {\n  if (!supportsBinary) {\n    return exports.encodeBase64Packet(packet, callback);\n  }\n\n  if (dontSendBlobs) {\n    return encodeBlobAsArrayBuffer(packet, supportsBinary, callback);\n  }\n\n  var length = new Uint8Array(1);\n  length[0] = packets[packet.type];\n  var blob = new Blob([length.buffer, packet.data]);\n\n  return callback(blob);\n}\n\n/**\n * Encodes a packet with binary data in a base64 string\n *\n * @param {Object} packet, has `type` and `data`\n * @return {String} base64 encoded message\n */\n\nexports.encodeBase64Packet = function(packet, callback) {\n  var message = 'b' + exports.packets[packet.type];\n  if (Blob && packet.data instanceof global.Blob) {\n    var fr = new FileReader();\n    fr.onload = function() {\n      var b64 = fr.result.split(',')[1];\n      callback(message + b64);\n    };\n    return fr.readAsDataURL(packet.data);\n  }\n\n  var b64data;\n  try {\n    b64data = String.fromCharCode.apply(null, new Uint8Array(packet.data));\n  } catch (e) {\n    // iPhone Safari doesn't let you apply with typed arrays\n    var typed = new Uint8Array(packet.data);\n    var basic = new Array(typed.length);\n    for (var i = 0; i < typed.length; i++) {\n      basic[i] = typed[i];\n    }\n    b64data = String.fromCharCode.apply(null, basic);\n  }\n  message += global.btoa(b64data);\n  return callback(message);\n};\n\n/**\n * Decodes a packet. Changes format to Blob if requested.\n *\n * @return {Object} with `type` and `data` (if any)\n * @api private\n */\n\nexports.decodePacket = function (data, binaryType, utf8decode) {\n  if (data === undefined) {\n    return err;\n  }\n  // String data\n  if (typeof data === 'string') {\n    if (data.charAt(0) === 'b') {\n      return exports.decodeBase64Packet(data.substr(1), binaryType);\n    }\n\n    if (utf8decode) {\n      data = tryDecode(data);\n      if (data === false) {\n        return err;\n      }\n    }\n    var type = data.charAt(0);\n\n    if (Number(type) != type || !packetslist[type]) {\n      return err;\n    }\n\n    if (data.length > 1) {\n      return { type: packetslist[type], data: data.substring(1) };\n    } else {\n      return { type: packetslist[type] };\n    }\n  }\n\n  var asArray = new Uint8Array(data);\n  var type = asArray[0];\n  var rest = sliceBuffer(data, 1);\n  if (Blob && binaryType === 'blob') {\n    rest = new Blob([rest]);\n  }\n  return { type: packetslist[type], data: rest };\n};\n\nfunction tryDecode(data) {\n  try {\n    data = utf8.decode(data, { strict: false });\n  } catch (e) {\n    return false;\n  }\n  return data;\n}\n\n/**\n * Decodes a packet encoded in a base64 string\n *\n * @param {String} base64 encoded message\n * @return {Object} with `type` and `data` (if any)\n */\n\nexports.decodeBase64Packet = function(msg, binaryType) {\n  var type = packetslist[msg.charAt(0)];\n  if (!base64encoder) {\n    return { type: type, data: { base64: true, data: msg.substr(1) } };\n  }\n\n  var data = base64encoder.decode(msg.substr(1));\n\n  if (binaryType === 'blob' && Blob) {\n    data = new Blob([data]);\n  }\n\n  return { type: type, data: data };\n};\n\n/**\n * Encodes multiple messages (payload).\n *\n *     <length>:data\n *\n * Example:\n *\n *     11:hello world2:hi\n *\n * If any contents are binary, they will be encoded as base64 strings. Base64\n * encoded strings are marked with a b before the length specifier\n *\n * @param {Array} packets\n * @api private\n */\n\nexports.encodePayload = function (packets, supportsBinary, callback) {\n  if (typeof supportsBinary === 'function') {\n    callback = supportsBinary;\n    supportsBinary = null;\n  }\n\n  var isBinary = hasBinary(packets);\n\n  if (supportsBinary && isBinary) {\n    if (Blob && !dontSendBlobs) {\n      return exports.encodePayloadAsBlob(packets, callback);\n    }\n\n    return exports.encodePayloadAsArrayBuffer(packets, callback);\n  }\n\n  if (!packets.length) {\n    return callback('0:');\n  }\n\n  function setLengthHeader(message) {\n    return message.length + ':' + message;\n  }\n\n  function encodeOne(packet, doneCallback) {\n    exports.encodePacket(packet, !isBinary ? false : supportsBinary, false, function(message) {\n      doneCallback(null, setLengthHeader(message));\n    });\n  }\n\n  map(packets, encodeOne, function(err, results) {\n    return callback(results.join(''));\n  });\n};\n\n/**\n * Async array map using after\n */\n\nfunction map(ary, each, done) {\n  var result = new Array(ary.length);\n  var next = after(ary.length, done);\n\n  var eachWithIndex = function(i, el, cb) {\n    each(el, function(error, msg) {\n      result[i] = msg;\n      cb(error, result);\n    });\n  };\n\n  for (var i = 0; i < ary.length; i++) {\n    eachWithIndex(i, ary[i], next);\n  }\n}\n\n/*\n * Decodes data when a payload is maybe expected. Possible binary contents are\n * decoded from their base64 representation\n *\n * @param {String} data, callback method\n * @api public\n */\n\nexports.decodePayload = function (data, binaryType, callback) {\n  if (typeof data !== 'string') {\n    return exports.decodePayloadAsBinary(data, binaryType, callback);\n  }\n\n  if (typeof binaryType === 'function') {\n    callback = binaryType;\n    binaryType = null;\n  }\n\n  var packet;\n  if (data === '') {\n    // parser error - ignoring payload\n    return callback(err, 0, 1);\n  }\n\n  var length = '', n, msg;\n\n  for (var i = 0, l = data.length; i < l; i++) {\n    var chr = data.charAt(i);\n\n    if (chr !== ':') {\n      length += chr;\n      continue;\n    }\n\n    if (length === '' || (length != (n = Number(length)))) {\n      // parser error - ignoring payload\n      return callback(err, 0, 1);\n    }\n\n    msg = data.substr(i + 1, n);\n\n    if (length != msg.length) {\n      // parser error - ignoring payload\n      return callback(err, 0, 1);\n    }\n\n    if (msg.length) {\n      packet = exports.decodePacket(msg, binaryType, false);\n\n      if (err.type === packet.type && err.data === packet.data) {\n        // parser error in individual packet - ignoring payload\n        return callback(err, 0, 1);\n      }\n\n      var ret = callback(packet, i + n, l);\n      if (false === ret) return;\n    }\n\n    // advance cursor\n    i += n;\n    length = '';\n  }\n\n  if (length !== '') {\n    // parser error - ignoring payload\n    return callback(err, 0, 1);\n  }\n\n};\n\n/**\n * Encodes multiple messages (payload) as binary.\n *\n * <1 = binary, 0 = string><number from 0-9><number from 0-9>[...]<number\n * 255><data>\n *\n * Example:\n * 1 3 255 1 2 3, if the binary contents are interpreted as 8 bit integers\n *\n * @param {Array} packets\n * @return {ArrayBuffer} encoded payload\n * @api private\n */\n\nexports.encodePayloadAsArrayBuffer = function(packets, callback) {\n  if (!packets.length) {\n    return callback(new ArrayBuffer(0));\n  }\n\n  function encodeOne(packet, doneCallback) {\n    exports.encodePacket(packet, true, true, function(data) {\n      return doneCallback(null, data);\n    });\n  }\n\n  map(packets, encodeOne, function(err, encodedPackets) {\n    var totalLength = encodedPackets.reduce(function(acc, p) {\n      var len;\n      if (typeof p === 'string'){\n        len = p.length;\n      } else {\n        len = p.byteLength;\n      }\n      return acc + len.toString().length + len + 2; // string/binary identifier + separator = 2\n    }, 0);\n\n    var resultArray = new Uint8Array(totalLength);\n\n    var bufferIndex = 0;\n    encodedPackets.forEach(function(p) {\n      var isString = typeof p === 'string';\n      var ab = p;\n      if (isString) {\n        var view = new Uint8Array(p.length);\n        for (var i = 0; i < p.length; i++) {\n          view[i] = p.charCodeAt(i);\n        }\n        ab = view.buffer;\n      }\n\n      if (isString) { // not true binary\n        resultArray[bufferIndex++] = 0;\n      } else { // true binary\n        resultArray[bufferIndex++] = 1;\n      }\n\n      var lenStr = ab.byteLength.toString();\n      for (var i = 0; i < lenStr.length; i++) {\n        resultArray[bufferIndex++] = parseInt(lenStr[i]);\n      }\n      resultArray[bufferIndex++] = 255;\n\n      var view = new Uint8Array(ab);\n      for (var i = 0; i < view.length; i++) {\n        resultArray[bufferIndex++] = view[i];\n      }\n    });\n\n    return callback(resultArray.buffer);\n  });\n};\n\n/**\n * Encode as Blob\n */\n\nexports.encodePayloadAsBlob = function(packets, callback) {\n  function encodeOne(packet, doneCallback) {\n    exports.encodePacket(packet, true, true, function(encoded) {\n      var binaryIdentifier = new Uint8Array(1);\n      binaryIdentifier[0] = 1;\n      if (typeof encoded === 'string') {\n        var view = new Uint8Array(encoded.length);\n        for (var i = 0; i < encoded.length; i++) {\n          view[i] = encoded.charCodeAt(i);\n        }\n        encoded = view.buffer;\n        binaryIdentifier[0] = 0;\n      }\n\n      var len = (encoded instanceof ArrayBuffer)\n        ? encoded.byteLength\n        : encoded.size;\n\n      var lenStr = len.toString();\n      var lengthAry = new Uint8Array(lenStr.length + 1);\n      for (var i = 0; i < lenStr.length; i++) {\n        lengthAry[i] = parseInt(lenStr[i]);\n      }\n      lengthAry[lenStr.length] = 255;\n\n      if (Blob) {\n        var blob = new Blob([binaryIdentifier.buffer, lengthAry.buffer, encoded]);\n        doneCallback(null, blob);\n      }\n    });\n  }\n\n  map(packets, encodeOne, function(err, results) {\n    return callback(new Blob(results));\n  });\n};\n\n/*\n * Decodes data when a payload is maybe expected. Strings are decoded by\n * interpreting each byte as a key code for entries marked to start with 0. See\n * description of encodePayloadAsBinary\n *\n * @param {ArrayBuffer} data, callback method\n * @api public\n */\n\nexports.decodePayloadAsBinary = function (data, binaryType, callback) {\n  if (typeof binaryType === 'function') {\n    callback = binaryType;\n    binaryType = null;\n  }\n\n  var bufferTail = data;\n  var buffers = [];\n\n  while (bufferTail.byteLength > 0) {\n    var tailArray = new Uint8Array(bufferTail);\n    var isString = tailArray[0] === 0;\n    var msgLength = '';\n\n    for (var i = 1; ; i++) {\n      if (tailArray[i] === 255) break;\n\n      // 310 = char length of Number.MAX_VALUE\n      if (msgLength.length > 310) {\n        return callback(err, 0, 1);\n      }\n\n      msgLength += tailArray[i];\n    }\n\n    bufferTail = sliceBuffer(bufferTail, 2 + msgLength.length);\n    msgLength = parseInt(msgLength);\n\n    var msg = sliceBuffer(bufferTail, 0, msgLength);\n    if (isString) {\n      try {\n        msg = String.fromCharCode.apply(null, new Uint8Array(msg));\n      } catch (e) {\n        // iPhone Safari doesn't let you apply to typed arrays\n        var typed = new Uint8Array(msg);\n        msg = '';\n        for (var i = 0; i < typed.length; i++) {\n          msg += String.fromCharCode(typed[i]);\n        }\n      }\n    }\n\n    buffers.push(msg);\n    bufferTail = sliceBuffer(bufferTail, msgLength);\n  }\n\n  var total = buffers.length;\n  buffers.forEach(function(buffer, i) {\n    callback(exports.decodePacket(buffer, binaryType, true), i, total);\n  });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-parser/lib/browser.js\n// module id = 23\n// module chunks = 0","\n/**\n * Gets the keys for an object.\n *\n * @return {Array} keys\n * @api private\n */\n\nmodule.exports = Object.keys || function keys (obj){\n  var arr = [];\n  var has = Object.prototype.hasOwnProperty;\n\n  for (var i in obj) {\n    if (has.call(obj, i)) {\n      arr.push(i);\n    }\n  }\n  return arr;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-parser/lib/keys.js\n// module id = 24\n// module chunks = 0","/**\n * An abstraction for slicing an arraybuffer even when\n * ArrayBuffer.prototype.slice is not supported\n *\n * @api public\n */\n\nmodule.exports = function(arraybuffer, start, end) {\n  var bytes = arraybuffer.byteLength;\n  start = start || 0;\n  end = end || bytes;\n\n  if (arraybuffer.slice) { return arraybuffer.slice(start, end); }\n\n  if (start < 0) { start += bytes; }\n  if (end < 0) { end += bytes; }\n  if (end > bytes) { end = bytes; }\n\n  if (start >= bytes || start >= end || bytes === 0) {\n    return new ArrayBuffer(0);\n  }\n\n  var abv = new Uint8Array(arraybuffer);\n  var result = new Uint8Array(end - start);\n  for (var i = start, ii = 0; i < end; i++, ii++) {\n    result[ii] = abv[i];\n  }\n  return result.buffer;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/arraybuffer.slice/index.js\n// module id = 25\n// module chunks = 0","module.exports = after\n\nfunction after(count, callback, err_cb) {\n    var bail = false\n    err_cb = err_cb || noop\n    proxy.count = count\n\n    return (count === 0) ? callback() : proxy\n\n    function proxy(err, result) {\n        if (proxy.count <= 0) {\n            throw new Error('after called too many times')\n        }\n        --proxy.count\n\n        // after first error, rest are passed to err_cb\n        if (err) {\n            bail = true\n            callback(err)\n            // future error callbacks will go to error handler\n            callback = err_cb\n        } else if (proxy.count === 0 && !bail) {\n            callback(null, result)\n        }\n    }\n}\n\nfunction noop() {}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/after/index.js\n// module id = 26\n// module chunks = 0","/*! https://mths.be/utf8js v2.1.2 by @mathias */\n;(function(root) {\n\n\t// Detect free variables `exports`\n\tvar freeExports = typeof exports == 'object' && exports;\n\n\t// Detect free variable `module`\n\tvar freeModule = typeof module == 'object' && module &&\n\t\tmodule.exports == freeExports && module;\n\n\t// Detect free variable `global`, from Node.js or Browserified code,\n\t// and use it as `root`\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {\n\t\troot = freeGlobal;\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tvar stringFromCharCode = String.fromCharCode;\n\n\t// Taken from https://mths.be/punycode\n\tfunction ucs2decode(string) {\n\t\tvar output = [];\n\t\tvar counter = 0;\n\t\tvar length = string.length;\n\t\tvar value;\n\t\tvar extra;\n\t\twhile (counter < length) {\n\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t} else {\n\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\toutput.push(value);\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toutput.push(value);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}\n\n\t// Taken from https://mths.be/punycode\n\tfunction ucs2encode(array) {\n\t\tvar length = array.length;\n\t\tvar index = -1;\n\t\tvar value;\n\t\tvar output = '';\n\t\twhile (++index < length) {\n\t\t\tvalue = array[index];\n\t\t\tif (value > 0xFFFF) {\n\t\t\t\tvalue -= 0x10000;\n\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t}\n\t\t\toutput += stringFromCharCode(value);\n\t\t}\n\t\treturn output;\n\t}\n\n\tfunction checkScalarValue(codePoint, strict) {\n\t\tif (codePoint >= 0xD800 && codePoint <= 0xDFFF) {\n\t\t\tif (strict) {\n\t\t\t\tthrow Error(\n\t\t\t\t\t'Lone surrogate U+' + codePoint.toString(16).toUpperCase() +\n\t\t\t\t\t' is not a scalar value'\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\t/*--------------------------------------------------------------------------*/\n\n\tfunction createByte(codePoint, shift) {\n\t\treturn stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80);\n\t}\n\n\tfunction encodeCodePoint(codePoint, strict) {\n\t\tif ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence\n\t\t\treturn stringFromCharCode(codePoint);\n\t\t}\n\t\tvar symbol = '';\n\t\tif ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0);\n\t\t}\n\t\telse if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence\n\t\t\tif (!checkScalarValue(codePoint, strict)) {\n\t\t\t\tcodePoint = 0xFFFD;\n\t\t\t}\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0);\n\t\t\tsymbol += createByte(codePoint, 6);\n\t\t}\n\t\telse if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0);\n\t\t\tsymbol += createByte(codePoint, 12);\n\t\t\tsymbol += createByte(codePoint, 6);\n\t\t}\n\t\tsymbol += stringFromCharCode((codePoint & 0x3F) | 0x80);\n\t\treturn symbol;\n\t}\n\n\tfunction utf8encode(string, opts) {\n\t\topts = opts || {};\n\t\tvar strict = false !== opts.strict;\n\n\t\tvar codePoints = ucs2decode(string);\n\t\tvar length = codePoints.length;\n\t\tvar index = -1;\n\t\tvar codePoint;\n\t\tvar byteString = '';\n\t\twhile (++index < length) {\n\t\t\tcodePoint = codePoints[index];\n\t\t\tbyteString += encodeCodePoint(codePoint, strict);\n\t\t}\n\t\treturn byteString;\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tfunction readContinuationByte() {\n\t\tif (byteIndex >= byteCount) {\n\t\t\tthrow Error('Invalid byte index');\n\t\t}\n\n\t\tvar continuationByte = byteArray[byteIndex] & 0xFF;\n\t\tbyteIndex++;\n\n\t\tif ((continuationByte & 0xC0) == 0x80) {\n\t\t\treturn continuationByte & 0x3F;\n\t\t}\n\n\t\t// If we end up here, it’s not a continuation byte\n\t\tthrow Error('Invalid continuation byte');\n\t}\n\n\tfunction decodeSymbol(strict) {\n\t\tvar byte1;\n\t\tvar byte2;\n\t\tvar byte3;\n\t\tvar byte4;\n\t\tvar codePoint;\n\n\t\tif (byteIndex > byteCount) {\n\t\t\tthrow Error('Invalid byte index');\n\t\t}\n\n\t\tif (byteIndex == byteCount) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Read first byte\n\t\tbyte1 = byteArray[byteIndex] & 0xFF;\n\t\tbyteIndex++;\n\n\t\t// 1-byte sequence (no continuation bytes)\n\t\tif ((byte1 & 0x80) == 0) {\n\t\t\treturn byte1;\n\t\t}\n\n\t\t// 2-byte sequence\n\t\tif ((byte1 & 0xE0) == 0xC0) {\n\t\t\tbyte2 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x1F) << 6) | byte2;\n\t\t\tif (codePoint >= 0x80) {\n\t\t\t\treturn codePoint;\n\t\t\t} else {\n\t\t\t\tthrow Error('Invalid continuation byte');\n\t\t\t}\n\t\t}\n\n\t\t// 3-byte sequence (may include unpaired surrogates)\n\t\tif ((byte1 & 0xF0) == 0xE0) {\n\t\t\tbyte2 = readContinuationByte();\n\t\t\tbyte3 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x0F) << 12) | (byte2 << 6) | byte3;\n\t\t\tif (codePoint >= 0x0800) {\n\t\t\t\treturn checkScalarValue(codePoint, strict) ? codePoint : 0xFFFD;\n\t\t\t} else {\n\t\t\t\tthrow Error('Invalid continuation byte');\n\t\t\t}\n\t\t}\n\n\t\t// 4-byte sequence\n\t\tif ((byte1 & 0xF8) == 0xF0) {\n\t\t\tbyte2 = readContinuationByte();\n\t\t\tbyte3 = readContinuationByte();\n\t\t\tbyte4 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0C) |\n\t\t\t\t(byte3 << 0x06) | byte4;\n\t\t\tif (codePoint >= 0x010000 && codePoint <= 0x10FFFF) {\n\t\t\t\treturn codePoint;\n\t\t\t}\n\t\t}\n\n\t\tthrow Error('Invalid UTF-8 detected');\n\t}\n\n\tvar byteArray;\n\tvar byteCount;\n\tvar byteIndex;\n\tfunction utf8decode(byteString, opts) {\n\t\topts = opts || {};\n\t\tvar strict = false !== opts.strict;\n\n\t\tbyteArray = ucs2decode(byteString);\n\t\tbyteCount = byteArray.length;\n\t\tbyteIndex = 0;\n\t\tvar codePoints = [];\n\t\tvar tmp;\n\t\twhile ((tmp = decodeSymbol(strict)) !== false) {\n\t\t\tcodePoints.push(tmp);\n\t\t}\n\t\treturn ucs2encode(codePoints);\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tvar utf8 = {\n\t\t'version': '2.1.2',\n\t\t'encode': utf8encode,\n\t\t'decode': utf8decode\n\t};\n\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttypeof define == 'function' &&\n\t\ttypeof define.amd == 'object' &&\n\t\tdefine.amd\n\t) {\n\t\tdefine(function() {\n\t\t\treturn utf8;\n\t\t});\n\t}\telse if (freeExports && !freeExports.nodeType) {\n\t\tif (freeModule) { // in Node.js or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = utf8;\n\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\tvar object = {};\n\t\t\tvar hasOwnProperty = object.hasOwnProperty;\n\t\t\tfor (var key in utf8) {\n\t\t\t\thasOwnProperty.call(utf8, key) && (freeExports[key] = utf8[key]);\n\t\t\t}\n\t\t}\n\t} else { // in Rhino or a web browser\n\t\troot.utf8 = utf8;\n\t}\n\n}(this));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-parser/lib/utf8.js\n// module id = 27\n// module chunks = 0","module.exports = function(module) {\r\n\tif(!module.webpackPolyfill) {\r\n\t\tmodule.deprecate = function() {};\r\n\t\tmodule.paths = [];\r\n\t\t// module.parent = undefined by default\r\n\t\tmodule.children = [];\r\n\t\tmodule.webpackPolyfill = 1;\r\n\t}\r\n\treturn module;\r\n}\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)/buildin/module.js\n// module id = 28\n// module chunks = 0","/*\n * base64-arraybuffer\n * https://github.com/niklasvh/base64-arraybuffer\n *\n * Copyright (c) 2012 Niklas von Hertzen\n * Licensed under the MIT license.\n */\n(function(){\n  \"use strict\";\n\n  var chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\n  // Use a lookup table to find the index.\n  var lookup = new Uint8Array(256);\n  for (var i = 0; i < chars.length; i++) {\n    lookup[chars.charCodeAt(i)] = i;\n  }\n\n  exports.encode = function(arraybuffer) {\n    var bytes = new Uint8Array(arraybuffer),\n    i, len = bytes.length, base64 = \"\";\n\n    for (i = 0; i < len; i+=3) {\n      base64 += chars[bytes[i] >> 2];\n      base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n      base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n      base64 += chars[bytes[i + 2] & 63];\n    }\n\n    if ((len % 3) === 2) {\n      base64 = base64.substring(0, base64.length - 1) + \"=\";\n    } else if (len % 3 === 1) {\n      base64 = base64.substring(0, base64.length - 2) + \"==\";\n    }\n\n    return base64;\n  };\n\n  exports.decode =  function(base64) {\n    var bufferLength = base64.length * 0.75,\n    len = base64.length, i, p = 0,\n    encoded1, encoded2, encoded3, encoded4;\n\n    if (base64[base64.length - 1] === \"=\") {\n      bufferLength--;\n      if (base64[base64.length - 2] === \"=\") {\n        bufferLength--;\n      }\n    }\n\n    var arraybuffer = new ArrayBuffer(bufferLength),\n    bytes = new Uint8Array(arraybuffer);\n\n    for (i = 0; i < len; i+=4) {\n      encoded1 = lookup[base64.charCodeAt(i)];\n      encoded2 = lookup[base64.charCodeAt(i+1)];\n      encoded3 = lookup[base64.charCodeAt(i+2)];\n      encoded4 = lookup[base64.charCodeAt(i+3)];\n\n      bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n      bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n      bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n    }\n\n    return arraybuffer;\n  };\n})();\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/base64-arraybuffer/lib/base64-arraybuffer.js\n// module id = 29\n// module chunks = 0","/**\n * Create a blob builder even when vendor prefixes exist\n */\n\nvar BlobBuilder = global.BlobBuilder\n  || global.WebKitBlobBuilder\n  || global.MSBlobBuilder\n  || global.MozBlobBuilder;\n\n/**\n * Check if Blob constructor is supported\n */\n\nvar blobSupported = (function() {\n  try {\n    var a = new Blob(['hi']);\n    return a.size === 2;\n  } catch(e) {\n    return false;\n  }\n})();\n\n/**\n * Check if Blob constructor supports ArrayBufferViews\n * Fails in Safari 6, so we need to map to ArrayBuffers there.\n */\n\nvar blobSupportsArrayBufferView = blobSupported && (function() {\n  try {\n    var b = new Blob([new Uint8Array([1,2])]);\n    return b.size === 2;\n  } catch(e) {\n    return false;\n  }\n})();\n\n/**\n * Check if BlobBuilder is supported\n */\n\nvar blobBuilderSupported = BlobBuilder\n  && BlobBuilder.prototype.append\n  && BlobBuilder.prototype.getBlob;\n\n/**\n * Helper function that maps ArrayBufferViews to ArrayBuffers\n * Used by BlobBuilder constructor and old browsers that didn't\n * support it in the Blob constructor.\n */\n\nfunction mapArrayBufferViews(ary) {\n  for (var i = 0; i < ary.length; i++) {\n    var chunk = ary[i];\n    if (chunk.buffer instanceof ArrayBuffer) {\n      var buf = chunk.buffer;\n\n      // if this is a subarray, make a copy so we only\n      // include the subarray region from the underlying buffer\n      if (chunk.byteLength !== buf.byteLength) {\n        var copy = new Uint8Array(chunk.byteLength);\n        copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n        buf = copy.buffer;\n      }\n\n      ary[i] = buf;\n    }\n  }\n}\n\nfunction BlobBuilderConstructor(ary, options) {\n  options = options || {};\n\n  var bb = new BlobBuilder();\n  mapArrayBufferViews(ary);\n\n  for (var i = 0; i < ary.length; i++) {\n    bb.append(ary[i]);\n  }\n\n  return (options.type) ? bb.getBlob(options.type) : bb.getBlob();\n};\n\nfunction BlobConstructor(ary, options) {\n  mapArrayBufferViews(ary);\n  return new Blob(ary, options || {});\n};\n\nmodule.exports = (function() {\n  if (blobSupported) {\n    return blobSupportsArrayBufferView ? global.Blob : BlobConstructor;\n  } else if (blobBuilderSupported) {\n    return BlobBuilderConstructor;\n  } else {\n    return undefined;\n  }\n})();\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/blob/index.js\n// module id = 30\n// module chunks = 0","/**\r\n * Compiles a querystring\r\n * Returns string representation of the object\r\n *\r\n * @param {Object}\r\n * @api private\r\n */\r\n\r\nexports.encode = function (obj) {\r\n  var str = '';\r\n\r\n  for (var i in obj) {\r\n    if (obj.hasOwnProperty(i)) {\r\n      if (str.length) str += '&';\r\n      str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]);\r\n    }\r\n  }\r\n\r\n  return str;\r\n};\r\n\r\n/**\r\n * Parses a simple querystring into an object\r\n *\r\n * @param {String} qs\r\n * @api private\r\n */\r\n\r\nexports.decode = function(qs){\r\n  var qry = {};\r\n  var pairs = qs.split('&');\r\n  for (var i = 0, l = pairs.length; i < l; i++) {\r\n    var pair = pairs[i].split('=');\r\n    qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);\r\n  }\r\n  return qry;\r\n};\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parseqs/index.js\n// module id = 31\n// module chunks = 0","\nmodule.exports = function(a, b){\n  var fn = function(){};\n  fn.prototype = b.prototype;\n  a.prototype = new fn;\n  a.prototype.constructor = a;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/component-inherit/index.js\n// module id = 32\n// module chunks = 0","'use strict';\n\nvar alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split('')\n  , length = 64\n  , map = {}\n  , seed = 0\n  , i = 0\n  , prev;\n\n/**\n * Return a string representing the specified number.\n *\n * @param {Number} num The number to convert.\n * @returns {String} The string representation of the number.\n * @api public\n */\nfunction encode(num) {\n  var encoded = '';\n\n  do {\n    encoded = alphabet[num % length] + encoded;\n    num = Math.floor(num / length);\n  } while (num > 0);\n\n  return encoded;\n}\n\n/**\n * Return the integer value specified by the given string.\n *\n * @param {String} str The string to convert.\n * @returns {Number} The integer value represented by the string.\n * @api public\n */\nfunction decode(str) {\n  var decoded = 0;\n\n  for (i = 0; i < str.length; i++) {\n    decoded = decoded * length + map[str.charAt(i)];\n  }\n\n  return decoded;\n}\n\n/**\n * Yeast: A tiny growing id generator.\n *\n * @returns {String} A unique id.\n * @api public\n */\nfunction yeast() {\n  var now = encode(+new Date());\n\n  if (now !== prev) return seed = 0, prev = now;\n  return now +'.'+ encode(seed++);\n}\n\n//\n// Map each character to its index.\n//\nfor (; i < length; i++) map[alphabet[i]] = i;\n\n//\n// Expose the `yeast`, `encode` and `decode` functions.\n//\nyeast.encode = encode;\nyeast.decode = decode;\nmodule.exports = yeast;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/yeast/index.js\n// module id = 33\n// module chunks = 0","\n/**\n * Module requirements.\n */\n\nvar Polling = require('./polling');\nvar inherit = require('component-inherit');\n\n/**\n * Module exports.\n */\n\nmodule.exports = JSONPPolling;\n\n/**\n * Cached regular expressions.\n */\n\nvar rNewline = /\\n/g;\nvar rEscapedNewline = /\\\\n/g;\n\n/**\n * Global JSONP callbacks.\n */\n\nvar callbacks;\n\n/**\n * Noop.\n */\n\nfunction empty () { }\n\n/**\n * JSONP Polling constructor.\n *\n * @param {Object} opts.\n * @api public\n */\n\nfunction JSONPPolling (opts) {\n  Polling.call(this, opts);\n\n  this.query = this.query || {};\n\n  // define global callbacks array if not present\n  // we do this here (lazily) to avoid unneeded global pollution\n  if (!callbacks) {\n    // we need to consider multiple engines in the same page\n    if (!global.___eio) global.___eio = [];\n    callbacks = global.___eio;\n  }\n\n  // callback identifier\n  this.index = callbacks.length;\n\n  // add callback to jsonp global\n  var self = this;\n  callbacks.push(function (msg) {\n    self.onData(msg);\n  });\n\n  // append to query string\n  this.query.j = this.index;\n\n  // prevent spurious errors from being emitted when the window is unloaded\n  if (global.document && global.addEventListener) {\n    global.addEventListener('beforeunload', function () {\n      if (self.script) self.script.onerror = empty;\n    }, false);\n  }\n}\n\n/**\n * Inherits from Polling.\n */\n\ninherit(JSONPPolling, Polling);\n\n/*\n * JSONP only supports binary as base64 encoded strings\n */\n\nJSONPPolling.prototype.supportsBinary = false;\n\n/**\n * Closes the socket.\n *\n * @api private\n */\n\nJSONPPolling.prototype.doClose = function () {\n  if (this.script) {\n    this.script.parentNode.removeChild(this.script);\n    this.script = null;\n  }\n\n  if (this.form) {\n    this.form.parentNode.removeChild(this.form);\n    this.form = null;\n    this.iframe = null;\n  }\n\n  Polling.prototype.doClose.call(this);\n};\n\n/**\n * Starts a poll cycle.\n *\n * @api private\n */\n\nJSONPPolling.prototype.doPoll = function () {\n  var self = this;\n  var script = document.createElement('script');\n\n  if (this.script) {\n    this.script.parentNode.removeChild(this.script);\n    this.script = null;\n  }\n\n  script.async = true;\n  script.src = this.uri();\n  script.onerror = function (e) {\n    self.onError('jsonp poll error', e);\n  };\n\n  var insertAt = document.getElementsByTagName('script')[0];\n  if (insertAt) {\n    insertAt.parentNode.insertBefore(script, insertAt);\n  } else {\n    (document.head || document.body).appendChild(script);\n  }\n  this.script = script;\n\n  var isUAgecko = 'undefined' !== typeof navigator && /gecko/i.test(navigator.userAgent);\n\n  if (isUAgecko) {\n    setTimeout(function () {\n      var iframe = document.createElement('iframe');\n      document.body.appendChild(iframe);\n      document.body.removeChild(iframe);\n    }, 100);\n  }\n};\n\n/**\n * Writes with a hidden iframe.\n *\n * @param {String} data to send\n * @param {Function} called upon flush.\n * @api private\n */\n\nJSONPPolling.prototype.doWrite = function (data, fn) {\n  var self = this;\n\n  if (!this.form) {\n    var form = document.createElement('form');\n    var area = document.createElement('textarea');\n    var id = this.iframeId = 'eio_iframe_' + this.index;\n    var iframe;\n\n    form.className = 'socketio';\n    form.style.position = 'absolute';\n    form.style.top = '-1000px';\n    form.style.left = '-1000px';\n    form.target = id;\n    form.method = 'POST';\n    form.setAttribute('accept-charset', 'utf-8');\n    area.name = 'd';\n    form.appendChild(area);\n    document.body.appendChild(form);\n\n    this.form = form;\n    this.area = area;\n  }\n\n  this.form.action = this.uri();\n\n  function complete () {\n    initIframe();\n    fn();\n  }\n\n  function initIframe () {\n    if (self.iframe) {\n      try {\n        self.form.removeChild(self.iframe);\n      } catch (e) {\n        self.onError('jsonp polling iframe removal error', e);\n      }\n    }\n\n    try {\n      // ie6 dynamic iframes with target=\"\" support (thanks Chris Lambacher)\n      var html = '<iframe src=\"javascript:0\" name=\"' + self.iframeId + '\">';\n      iframe = document.createElement(html);\n    } catch (e) {\n      iframe = document.createElement('iframe');\n      iframe.name = self.iframeId;\n      iframe.src = 'javascript:0';\n    }\n\n    iframe.id = self.iframeId;\n\n    self.form.appendChild(iframe);\n    self.iframe = iframe;\n  }\n\n  initIframe();\n\n  // escape \\n to prevent it from being converted into \\r\\n by some UAs\n  // double escaping is required for escaped new lines because unescaping of new lines can be done safely on server-side\n  data = data.replace(rEscapedNewline, '\\\\\\n');\n  this.area.value = data.replace(rNewline, '\\\\n');\n\n  try {\n    this.form.submit();\n  } catch (e) {}\n\n  if (this.iframe.attachEvent) {\n    this.iframe.onreadystatechange = function () {\n      if (self.iframe.readyState === 'complete') {\n        complete();\n      }\n    };\n  } else {\n    this.iframe.onload = complete;\n  }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-client/lib/transports/polling-jsonp.js\n// module id = 34\n// module chunks = 0","/**\n * Module dependencies.\n */\n\nvar Transport = require('../transport');\nvar parser = require('engine.io-parser');\nvar parseqs = require('parseqs');\nvar inherit = require('component-inherit');\nvar yeast = require('yeast');\nvar debug = require('debug')('engine.io-client:websocket');\nvar BrowserWebSocket = global.WebSocket || global.MozWebSocket;\nvar NodeWebSocket;\nif (typeof window === 'undefined') {\n  try {\n    NodeWebSocket = require('ws');\n  } catch (e) { }\n}\n\n/**\n * Get either the `WebSocket` or `MozWebSocket` globals\n * in the browser or try to resolve WebSocket-compatible\n * interface exposed by `ws` for Node-like environment.\n */\n\nvar WebSocket = BrowserWebSocket;\nif (!WebSocket && typeof window === 'undefined') {\n  WebSocket = NodeWebSocket;\n}\n\n/**\n * Module exports.\n */\n\nmodule.exports = WS;\n\n/**\n * WebSocket transport constructor.\n *\n * @api {Object} connection options\n * @api public\n */\n\nfunction WS (opts) {\n  var forceBase64 = (opts && opts.forceBase64);\n  if (forceBase64) {\n    this.supportsBinary = false;\n  }\n  this.perMessageDeflate = opts.perMessageDeflate;\n  this.usingBrowserWebSocket = BrowserWebSocket && !opts.forceNode;\n  this.protocols = opts.protocols;\n  if (!this.usingBrowserWebSocket) {\n    WebSocket = NodeWebSocket;\n  }\n  Transport.call(this, opts);\n}\n\n/**\n * Inherits from Transport.\n */\n\ninherit(WS, Transport);\n\n/**\n * Transport name.\n *\n * @api public\n */\n\nWS.prototype.name = 'websocket';\n\n/*\n * WebSockets support binary\n */\n\nWS.prototype.supportsBinary = true;\n\n/**\n * Opens socket.\n *\n * @api private\n */\n\nWS.prototype.doOpen = function () {\n  if (!this.check()) {\n    // let probe timeout\n    return;\n  }\n\n  var uri = this.uri();\n  var protocols = this.protocols;\n  var opts = {\n    agent: this.agent,\n    perMessageDeflate: this.perMessageDeflate\n  };\n\n  // SSL options for Node.js client\n  opts.pfx = this.pfx;\n  opts.key = this.key;\n  opts.passphrase = this.passphrase;\n  opts.cert = this.cert;\n  opts.ca = this.ca;\n  opts.ciphers = this.ciphers;\n  opts.rejectUnauthorized = this.rejectUnauthorized;\n  if (this.extraHeaders) {\n    opts.headers = this.extraHeaders;\n  }\n  if (this.localAddress) {\n    opts.localAddress = this.localAddress;\n  }\n\n  try {\n    this.ws = this.usingBrowserWebSocket ? (protocols ? new WebSocket(uri, protocols) : new WebSocket(uri)) : new WebSocket(uri, protocols, opts);\n  } catch (err) {\n    return this.emit('error', err);\n  }\n\n  if (this.ws.binaryType === undefined) {\n    this.supportsBinary = false;\n  }\n\n  if (this.ws.supports && this.ws.supports.binary) {\n    this.supportsBinary = true;\n    this.ws.binaryType = 'nodebuffer';\n  } else {\n    this.ws.binaryType = 'arraybuffer';\n  }\n\n  this.addEventListeners();\n};\n\n/**\n * Adds event listeners to the socket\n *\n * @api private\n */\n\nWS.prototype.addEventListeners = function () {\n  var self = this;\n\n  this.ws.onopen = function () {\n    self.onOpen();\n  };\n  this.ws.onclose = function () {\n    self.onClose();\n  };\n  this.ws.onmessage = function (ev) {\n    self.onData(ev.data);\n  };\n  this.ws.onerror = function (e) {\n    self.onError('websocket error', e);\n  };\n};\n\n/**\n * Writes data to socket.\n *\n * @param {Array} array of packets.\n * @api private\n */\n\nWS.prototype.write = function (packets) {\n  var self = this;\n  this.writable = false;\n\n  // encodePacket efficient as it uses WS framing\n  // no need for encodePayload\n  var total = packets.length;\n  for (var i = 0, l = total; i < l; i++) {\n    (function (packet) {\n      parser.encodePacket(packet, self.supportsBinary, function (data) {\n        if (!self.usingBrowserWebSocket) {\n          // always create a new object (GH-437)\n          var opts = {};\n          if (packet.options) {\n            opts.compress = packet.options.compress;\n          }\n\n          if (self.perMessageDeflate) {\n            var len = 'string' === typeof data ? global.Buffer.byteLength(data) : data.length;\n            if (len < self.perMessageDeflate.threshold) {\n              opts.compress = false;\n            }\n          }\n        }\n\n        // Sometimes the websocket has already been closed but the browser didn't\n        // have a chance of informing us about it yet, in that case send will\n        // throw an error\n        try {\n          if (self.usingBrowserWebSocket) {\n            // TypeError is thrown when passing the second argument on Safari\n            self.ws.send(data);\n          } else {\n            self.ws.send(data, opts);\n          }\n        } catch (e) {\n          debug('websocket closed before onclose event');\n        }\n\n        --total || done();\n      });\n    })(packets[i]);\n  }\n\n  function done () {\n    self.emit('flush');\n\n    // fake drain\n    // defer to next tick to allow Socket to clear writeBuffer\n    setTimeout(function () {\n      self.writable = true;\n      self.emit('drain');\n    }, 0);\n  }\n};\n\n/**\n * Called upon close\n *\n * @api private\n */\n\nWS.prototype.onClose = function () {\n  Transport.prototype.onClose.call(this);\n};\n\n/**\n * Closes socket.\n *\n * @api private\n */\n\nWS.prototype.doClose = function () {\n  if (typeof this.ws !== 'undefined') {\n    this.ws.close();\n  }\n};\n\n/**\n * Generates uri for connection.\n *\n * @api private\n */\n\nWS.prototype.uri = function () {\n  var query = this.query || {};\n  var schema = this.secure ? 'wss' : 'ws';\n  var port = '';\n\n  // avoid port if default for schema\n  if (this.port && (('wss' === schema && Number(this.port) !== 443) ||\n    ('ws' === schema && Number(this.port) !== 80))) {\n    port = ':' + this.port;\n  }\n\n  // append timestamp to URI\n  if (this.timestampRequests) {\n    query[this.timestampParam] = yeast();\n  }\n\n  // communicate binary support capabilities\n  if (!this.supportsBinary) {\n    query.b64 = 1;\n  }\n\n  query = parseqs.encode(query);\n\n  // prepend ? to query\n  if (query.length) {\n    query = '?' + query;\n  }\n\n  var ipv6 = this.hostname.indexOf(':') !== -1;\n  return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;\n};\n\n/**\n * Feature detection for WebSocket.\n *\n * @return {Boolean} whether this transport is available.\n * @api public\n */\n\nWS.prototype.check = function () {\n  return !!WebSocket && !('__initialize' in WebSocket && this.name === WS.prototype.name);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-client/lib/transports/websocket.js\n// module id = 35\n// module chunks = 0","\nvar indexOf = [].indexOf;\n\nmodule.exports = function(arr, obj){\n  if (indexOf) return arr.indexOf(obj);\n  for (var i = 0; i < arr.length; ++i) {\n    if (arr[i] === obj) return i;\n  }\n  return -1;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/indexof/index.js\n// module id = 37\n// module chunks = 0","/**\r\n * JSON parse.\r\n *\r\n * @see Based on jQuery#parseJSON (MIT) and JSON2\r\n * @api private\r\n */\r\n\r\nvar rvalidchars = /^[\\],:{}\\s]*$/;\r\nvar rvalidescape = /\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g;\r\nvar rvalidtokens = /\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g;\r\nvar rvalidbraces = /(?:^|:|,)(?:\\s*\\[)+/g;\r\nvar rtrimLeft = /^\\s+/;\r\nvar rtrimRight = /\\s+$/;\r\n\r\nmodule.exports = function parsejson(data) {\r\n  if ('string' != typeof data || !data) {\r\n    return null;\r\n  }\r\n\r\n  data = data.replace(rtrimLeft, '').replace(rtrimRight, '');\r\n\r\n  // Attempt to parse using the native JSON parser first\r\n  if (global.JSON && JSON.parse) {\r\n    return JSON.parse(data);\r\n  }\r\n\r\n  if (rvalidchars.test(data.replace(rvalidescape, '@')\r\n      .replace(rvalidtokens, ']')\r\n      .replace(rvalidbraces, ''))) {\r\n    return (new Function('return ' + data))();\r\n  }\r\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parsejson/index.js\n// module id = 38\n// module chunks = 0","\n/**\n * Module dependencies.\n */\n\nvar parser = require('socket.io-parser');\nvar Emitter = require('component-emitter');\nvar toArray = require('to-array');\nvar on = require('./on');\nvar bind = require('component-bind');\nvar debug = require('debug')('socket.io-client:socket');\nvar parseqs = require('parseqs');\n\n/**\n * Module exports.\n */\n\nmodule.exports = exports = Socket;\n\n/**\n * Internal events (blacklisted).\n * These events can't be emitted by the user.\n *\n * @api private\n */\n\nvar events = {\n  connect: 1,\n  connect_error: 1,\n  connect_timeout: 1,\n  connecting: 1,\n  disconnect: 1,\n  error: 1,\n  reconnect: 1,\n  reconnect_attempt: 1,\n  reconnect_failed: 1,\n  reconnect_error: 1,\n  reconnecting: 1,\n  ping: 1,\n  pong: 1\n};\n\n/**\n * Shortcut to `Emitter#emit`.\n */\n\nvar emit = Emitter.prototype.emit;\n\n/**\n * `Socket` constructor.\n *\n * @api public\n */\n\nfunction Socket (io, nsp, opts) {\n  this.io = io;\n  this.nsp = nsp;\n  this.json = this; // compat\n  this.ids = 0;\n  this.acks = {};\n  this.receiveBuffer = [];\n  this.sendBuffer = [];\n  this.connected = false;\n  this.disconnected = true;\n  if (opts && opts.query) {\n    this.query = opts.query;\n  }\n  if (this.io.autoConnect) this.open();\n}\n\n/**\n * Mix in `Emitter`.\n */\n\nEmitter(Socket.prototype);\n\n/**\n * Subscribe to open, close and packet events\n *\n * @api private\n */\n\nSocket.prototype.subEvents = function () {\n  if (this.subs) return;\n\n  var io = this.io;\n  this.subs = [\n    on(io, 'open', bind(this, 'onopen')),\n    on(io, 'packet', bind(this, 'onpacket')),\n    on(io, 'close', bind(this, 'onclose'))\n  ];\n};\n\n/**\n * \"Opens\" the socket.\n *\n * @api public\n */\n\nSocket.prototype.open =\nSocket.prototype.connect = function () {\n  if (this.connected) return this;\n\n  this.subEvents();\n  this.io.open(); // ensure open\n  if ('open' === this.io.readyState) this.onopen();\n  this.emit('connecting');\n  return this;\n};\n\n/**\n * Sends a `message` event.\n *\n * @return {Socket} self\n * @api public\n */\n\nSocket.prototype.send = function () {\n  var args = toArray(arguments);\n  args.unshift('message');\n  this.emit.apply(this, args);\n  return this;\n};\n\n/**\n * Override `emit`.\n * If the event is in `events`, it's emitted normally.\n *\n * @param {String} event name\n * @return {Socket} self\n * @api public\n */\n\nSocket.prototype.emit = function (ev) {\n  if (events.hasOwnProperty(ev)) {\n    emit.apply(this, arguments);\n    return this;\n  }\n\n  var args = toArray(arguments);\n  var packet = { type: parser.EVENT, data: args };\n\n  packet.options = {};\n  packet.options.compress = !this.flags || false !== this.flags.compress;\n\n  // event ack callback\n  if ('function' === typeof args[args.length - 1]) {\n    debug('emitting packet with ack id %d', this.ids);\n    this.acks[this.ids] = args.pop();\n    packet.id = this.ids++;\n  }\n\n  if (this.connected) {\n    this.packet(packet);\n  } else {\n    this.sendBuffer.push(packet);\n  }\n\n  delete this.flags;\n\n  return this;\n};\n\n/**\n * Sends a packet.\n *\n * @param {Object} packet\n * @api private\n */\n\nSocket.prototype.packet = function (packet) {\n  packet.nsp = this.nsp;\n  this.io.packet(packet);\n};\n\n/**\n * Called upon engine `open`.\n *\n * @api private\n */\n\nSocket.prototype.onopen = function () {\n  debug('transport is open - connecting');\n\n  // write connect packet if necessary\n  if ('/' !== this.nsp) {\n    if (this.query) {\n      var query = typeof this.query === 'object' ? parseqs.encode(this.query) : this.query;\n      debug('sending connect packet with query %s', query);\n      this.packet({type: parser.CONNECT, query: query});\n    } else {\n      this.packet({type: parser.CONNECT});\n    }\n  }\n};\n\n/**\n * Called upon engine `close`.\n *\n * @param {String} reason\n * @api private\n */\n\nSocket.prototype.onclose = function (reason) {\n  debug('close (%s)', reason);\n  this.connected = false;\n  this.disconnected = true;\n  delete this.id;\n  this.emit('disconnect', reason);\n};\n\n/**\n * Called with socket packet.\n *\n * @param {Object} packet\n * @api private\n */\n\nSocket.prototype.onpacket = function (packet) {\n  if (packet.nsp !== this.nsp) return;\n\n  switch (packet.type) {\n    case parser.CONNECT:\n      this.onconnect();\n      break;\n\n    case parser.EVENT:\n      this.onevent(packet);\n      break;\n\n    case parser.BINARY_EVENT:\n      this.onevent(packet);\n      break;\n\n    case parser.ACK:\n      this.onack(packet);\n      break;\n\n    case parser.BINARY_ACK:\n      this.onack(packet);\n      break;\n\n    case parser.DISCONNECT:\n      this.ondisconnect();\n      break;\n\n    case parser.ERROR:\n      this.emit('error', packet.data);\n      break;\n  }\n};\n\n/**\n * Called upon a server event.\n *\n * @param {Object} packet\n * @api private\n */\n\nSocket.prototype.onevent = function (packet) {\n  var args = packet.data || [];\n  debug('emitting event %j', args);\n\n  if (null != packet.id) {\n    debug('attaching ack callback to event');\n    args.push(this.ack(packet.id));\n  }\n\n  if (this.connected) {\n    emit.apply(this, args);\n  } else {\n    this.receiveBuffer.push(args);\n  }\n};\n\n/**\n * Produces an ack callback to emit with an event.\n *\n * @api private\n */\n\nSocket.prototype.ack = function (id) {\n  var self = this;\n  var sent = false;\n  return function () {\n    // prevent double callbacks\n    if (sent) return;\n    sent = true;\n    var args = toArray(arguments);\n    debug('sending ack %j', args);\n\n    self.packet({\n      type: parser.ACK,\n      id: id,\n      data: args\n    });\n  };\n};\n\n/**\n * Called upon a server acknowlegement.\n *\n * @param {Object} packet\n * @api private\n */\n\nSocket.prototype.onack = function (packet) {\n  var ack = this.acks[packet.id];\n  if ('function' === typeof ack) {\n    debug('calling ack %s with %j', packet.id, packet.data);\n    ack.apply(this, packet.data);\n    delete this.acks[packet.id];\n  } else {\n    debug('bad ack %s', packet.id);\n  }\n};\n\n/**\n * Called upon server connect.\n *\n * @api private\n */\n\nSocket.prototype.onconnect = function () {\n  this.connected = true;\n  this.disconnected = false;\n  this.emit('connect');\n  this.emitBuffered();\n};\n\n/**\n * Emit buffered events (received and emitted).\n *\n * @api private\n */\n\nSocket.prototype.emitBuffered = function () {\n  var i;\n  for (i = 0; i < this.receiveBuffer.length; i++) {\n    emit.apply(this, this.receiveBuffer[i]);\n  }\n  this.receiveBuffer = [];\n\n  for (i = 0; i < this.sendBuffer.length; i++) {\n    this.packet(this.sendBuffer[i]);\n  }\n  this.sendBuffer = [];\n};\n\n/**\n * Called upon server disconnect.\n *\n * @api private\n */\n\nSocket.prototype.ondisconnect = function () {\n  debug('server disconnect (%s)', this.nsp);\n  this.destroy();\n  this.onclose('io server disconnect');\n};\n\n/**\n * Called upon forced client/server side disconnections,\n * this method ensures the manager stops tracking us and\n * that reconnections don't get triggered for this.\n *\n * @api private.\n */\n\nSocket.prototype.destroy = function () {\n  if (this.subs) {\n    // clean subscriptions to avoid reconnections\n    for (var i = 0; i < this.subs.length; i++) {\n      this.subs[i].destroy();\n    }\n    this.subs = null;\n  }\n\n  this.io.destroy(this);\n};\n\n/**\n * Disconnects the socket manually.\n *\n * @return {Socket} self\n * @api public\n */\n\nSocket.prototype.close =\nSocket.prototype.disconnect = function () {\n  if (this.connected) {\n    debug('performing disconnect (%s)', this.nsp);\n    this.packet({ type: parser.DISCONNECT });\n  }\n\n  // remove socket from pool\n  this.destroy();\n\n  if (this.connected) {\n    // fire events\n    this.onclose('io client disconnect');\n  }\n  return this;\n};\n\n/**\n * Sets the compress flag.\n *\n * @param {Boolean} if `true`, compresses the sending data\n * @return {Socket} self\n * @api public\n */\n\nSocket.prototype.compress = function (compress) {\n  this.flags = this.flags || {};\n  this.flags.compress = compress;\n  return this;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./lib/socket.js","module.exports = toArray\n\nfunction toArray(list, index) {\n    var array = []\n\n    index = index || 0\n\n    for (var i = index || 0; i < list.length; i++) {\n        array[i - index] = list[i]\n    }\n\n    return array\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/to-array/index.js\n// module id = 40\n// module chunks = 0","\n/**\n * Module exports.\n */\n\nmodule.exports = on;\n\n/**\n * Helper for subscriptions.\n *\n * @param {Object|EventEmitter} obj with `Emitter` mixin or `EventEmitter`\n * @param {String} event name\n * @param {Function} callback\n * @api public\n */\n\nfunction on (obj, ev, fn) {\n  obj.on(ev, fn);\n  return {\n    destroy: function () {\n      obj.removeListener(ev, fn);\n    }\n  };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./lib/on.js","/**\n * Slice reference.\n */\n\nvar slice = [].slice;\n\n/**\n * Bind `obj` to `fn`.\n *\n * @param {Object} obj\n * @param {Function|String} fn or string\n * @return {Function}\n * @api public\n */\n\nmodule.exports = function(obj, fn){\n  if ('string' == typeof fn) fn = obj[fn];\n  if ('function' != typeof fn) throw new Error('bind() requires a function');\n  var args = slice.call(arguments, 2);\n  return function(){\n    return fn.apply(obj, args.concat(slice.call(arguments)));\n  }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/component-bind/index.js\n// module id = 42\n// module chunks = 0","\n/**\n * Expose `Backoff`.\n */\n\nmodule.exports = Backoff;\n\n/**\n * Initialize backoff timer with `opts`.\n *\n * - `min` initial timeout in milliseconds [100]\n * - `max` max timeout [10000]\n * - `jitter` [0]\n * - `factor` [2]\n *\n * @param {Object} opts\n * @api public\n */\n\nfunction Backoff(opts) {\n  opts = opts || {};\n  this.ms = opts.min || 100;\n  this.max = opts.max || 10000;\n  this.factor = opts.factor || 2;\n  this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;\n  this.attempts = 0;\n}\n\n/**\n * Return the backoff duration.\n *\n * @return {Number}\n * @api public\n */\n\nBackoff.prototype.duration = function(){\n  var ms = this.ms * Math.pow(this.factor, this.attempts++);\n  if (this.jitter) {\n    var rand =  Math.random();\n    var deviation = Math.floor(rand * this.jitter * ms);\n    ms = (Math.floor(rand * 10) & 1) == 0  ? ms - deviation : ms + deviation;\n  }\n  return Math.min(ms, this.max) | 0;\n};\n\n/**\n * Reset the number of attempts.\n *\n * @api public\n */\n\nBackoff.prototype.reset = function(){\n  this.attempts = 0;\n};\n\n/**\n * Set the minimum duration\n *\n * @api public\n */\n\nBackoff.prototype.setMin = function(min){\n  this.ms = min;\n};\n\n/**\n * Set the maximum duration\n *\n * @api public\n */\n\nBackoff.prototype.setMax = function(max){\n  this.max = max;\n};\n\n/**\n * Set the jitter\n *\n * @api public\n */\n\nBackoff.prototype.setJitter = function(jitter){\n  this.jitter = jitter;\n};\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/backo2/index.js\n// module id = 43\n// module chunks = 0"],"sourceRoot":""}
\ No newline at end of file
diff --git a/wrt/node_modules/socket.io-client/dist/socket.io.slim.js b/wrt/node_modules/socket.io-client/dist/socket.io.slim.js
new file mode 100644 (file)
index 0000000..7936cd9
--- /dev/null
@@ -0,0 +1,3 @@
+!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.io=e():t.io=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";function n(t,e){"object"===("undefined"==typeof t?"undefined":o(t))&&(e=t,t=void 0),e=e||{};var r,n=i(t),s=n.source,h=n.id,p=n.path,u=c[h]&&p in c[h].nsps,f=e.forceNew||e["force new connection"]||!1===e.multiplex||u;return f?r=a(s,e):(c[h]||(c[h]=a(s,e)),r=c[h]),n.query&&!e.query&&(e.query=n.query),r.socket(n.path,e)}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=r(1),s=r(4),a=r(10);r(3)("socket.io-client");t.exports=e=n;var c=e.managers={};e.protocol=s.protocol,e.connect=n,e.Manager=r(10),e.Socket=r(36)},function(t,e,r){(function(e){"use strict";function n(t,r){var n=t;r=r||e.location,null==t&&(t=r.protocol+"//"+r.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?r.protocol+t:r.host+t),/^(https?|wss?):\/\//.test(t)||(t="undefined"!=typeof r?r.protocol+"//"+t:"https://"+t),n=o(t)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";var i=n.host.indexOf(":")!==-1,s=i?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+s+":"+n.port,n.href=n.protocol+"://"+s+(r&&r.port===n.port?"":":"+n.port),n}var o=r(2);r(3)("socket.io-client:url");t.exports=n}).call(e,function(){return this}())},function(t,e){var r=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,n=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.exports=function(t){var e=t,o=t.indexOf("["),i=t.indexOf("]");o!=-1&&i!=-1&&(t=t.substring(0,o)+t.substring(o,i).replace(/:/g,";")+t.substring(i,t.length));for(var s=r.exec(t||""),a={},c=14;c--;)a[n[c]]=s[c]||"";return o!=-1&&i!=-1&&(a.source=e,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a}},function(t,e){"use strict";t.exports=function(){return function(){}}},function(t,e,r){function n(){}function o(t){var r=""+t.type;return e.BINARY_EVENT!==t.type&&e.BINARY_ACK!==t.type||(r+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(r+=t.nsp+","),null!=t.id&&(r+=t.id),null!=t.data&&(r+=JSON.stringify(t.data)),r}function i(t,e){function r(t){var r=l.deconstructPacket(t),n=o(r.packet),i=r.buffers;i.unshift(n),e(i)}l.removeBlobs(t,r)}function s(){this.reconstructor=null}function a(t){var r=0,n={type:Number(t.charAt(0))};if(null==e.types[n.type])return p();if(e.BINARY_EVENT===n.type||e.BINARY_ACK===n.type){for(var o="";"-"!==t.charAt(++r)&&(o+=t.charAt(r),r!=t.length););if(o!=Number(o)||"-"!==t.charAt(r))throw new Error("Illegal attachments");n.attachments=Number(o)}if("/"===t.charAt(r+1))for(n.nsp="";++r;){var i=t.charAt(r);if(","===i)break;if(n.nsp+=i,r===t.length)break}else n.nsp="/";var s=t.charAt(r+1);if(""!==s&&Number(s)==s){for(n.id="";++r;){var i=t.charAt(r);if(null==i||Number(i)!=i){--r;break}if(n.id+=t.charAt(r),r===t.length)break}n.id=Number(n.id)}return t.charAt(++r)&&(n=c(n,t.substr(r))),n}function c(t,e){try{t.data=JSON.parse(e)}catch(t){return p()}return t}function h(t){this.reconPack=t,this.buffers=[]}function p(){return{type:e.ERROR,data:"parser error"}}var u=(r(3)("socket.io-parser"),r(5)),f=r(6),l=r(8),d=r(9);e.protocol=4,e.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],e.CONNECT=0,e.DISCONNECT=1,e.EVENT=2,e.ACK=3,e.ERROR=4,e.BINARY_EVENT=5,e.BINARY_ACK=6,e.Encoder=n,e.Decoder=s,n.prototype.encode=function(t,r){if(t.type!==e.EVENT&&t.type!==e.ACK||!f(t.data)||(t.type=t.type===e.EVENT?e.BINARY_EVENT:e.BINARY_ACK),e.BINARY_EVENT===t.type||e.BINARY_ACK===t.type)i(t,r);else{var n=o(t);r([n])}},u(s.prototype),s.prototype.add=function(t){var r;if("string"==typeof t)r=a(t),e.BINARY_EVENT===r.type||e.BINARY_ACK===r.type?(this.reconstructor=new h(r),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",r)):this.emit("decoded",r);else{if(!d(t)&&!t.base64)throw new Error("Unknown type: "+t);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");r=this.reconstructor.takeBinaryData(t),r&&(this.reconstructor=null,this.emit("decoded",r))}},s.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},h.prototype.takeBinaryData=function(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){var e=l.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null},h.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]}},function(t,e,r){function n(t){if(t)return o(t)}function o(t){for(var e in n.prototype)t[e]=n.prototype[e];return t}t.exports=n,n.prototype.on=n.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},n.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r=this._callbacks["$"+t];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var n,o=0;o<r.length;o++)if(n=r[o],n===e||n.fn===e){r.splice(o,1);break}return this},n.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),r=this._callbacks["$"+t];if(r){r=r.slice(0);for(var n=0,o=r.length;n<o;++n)r[n].apply(this,e)}return this},n.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},n.prototype.hasListeners=function(t){return!!this.listeners(t).length}},function(t,e,r){(function(e){function n(t){if(!t||"object"!=typeof t)return!1;if(o(t)){for(var r=0,i=t.length;r<i;r++)if(n(t[r]))return!0;return!1}if("function"==typeof e.Buffer&&e.Buffer.isBuffer&&e.Buffer.isBuffer(t)||"function"==typeof e.ArrayBuffer&&t instanceof ArrayBuffer||s&&t instanceof Blob||a&&t instanceof File)return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return n(t.toJSON(),!0);for(var c in t)if(Object.prototype.hasOwnProperty.call(t,c)&&n(t[c]))return!0;return!1}var o=r(7),i=Object.prototype.toString,s="function"==typeof e.Blob||"[object BlobConstructor]"===i.call(e.Blob),a="function"==typeof e.File||"[object FileConstructor]"===i.call(e.File);t.exports=n}).call(e,function(){return this}())},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){(function(t){function n(t,e){if(!t)return t;if(s(t)){var r={_placeholder:!0,num:e.length};return e.push(t),r}if(i(t)){for(var o=new Array(t.length),a=0;a<t.length;a++)o[a]=n(t[a],e);return o}if("object"==typeof t&&!(t instanceof Date)){var o={};for(var c in t)o[c]=n(t[c],e);return o}return t}function o(t,e){if(!t)return t;if(t&&t._placeholder)return e[t.num];if(i(t))for(var r=0;r<t.length;r++)t[r]=o(t[r],e);else if("object"==typeof t)for(var n in t)t[n]=o(t[n],e);return t}var i=r(7),s=r(9),a=Object.prototype.toString,c="function"==typeof t.Blob||"[object BlobConstructor]"===a.call(t.Blob),h="function"==typeof t.File||"[object FileConstructor]"===a.call(t.File);e.deconstructPacket=function(t){var e=[],r=t.data,o=t;return o.data=n(r,e),o.attachments=e.length,{packet:o,buffers:e}},e.reconstructPacket=function(t,e){return t.data=o(t.data,e),t.attachments=void 0,t},e.removeBlobs=function(t,e){function r(t,a,p){if(!t)return t;if(c&&t instanceof Blob||h&&t instanceof File){n++;var u=new FileReader;u.onload=function(){p?p[a]=this.result:o=this.result,--n||e(o)},u.readAsArrayBuffer(t)}else if(i(t))for(var f=0;f<t.length;f++)r(t[f],f,t);else if("object"==typeof t&&!s(t))for(var l in t)r(t[l],l,t)}var n=0,o=t;r(o),n||e(o)}}).call(e,function(){return this}())},function(t,e){(function(e){function r(t){return e.Buffer&&e.Buffer.isBuffer(t)||e.ArrayBuffer&&t instanceof ArrayBuffer}t.exports=r}).call(e,function(){return this}())},function(t,e,r){"use strict";function n(t,e){if(!(this instanceof n))return new n(t,e);t&&"object"===("undefined"==typeof t?"undefined":o(t))&&(e=t,t=void 0),e=e||{},e.path=e.path||"/socket.io",this.nsps={},this.subs=[],this.opts=e,this.reconnection(e.reconnection!==!1),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor(e.randomizationFactor||.5),this.backoff=new f({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==e.timeout?2e4:e.timeout),this.readyState="closed",this.uri=t,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var r=e.parser||c;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this.autoConnect=e.autoConnect!==!1,this.autoConnect&&this.open()}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=r(11),s=r(36),a=r(5),c=r(4),h=r(38),p=r(39),u=(r(3)("socket.io-client:manager"),r(34)),f=r(40),l=Object.prototype.hasOwnProperty;t.exports=n,n.prototype.emitAll=function(){this.emit.apply(this,arguments);for(var t in this.nsps)l.call(this.nsps,t)&&this.nsps[t].emit.apply(this.nsps[t],arguments)},n.prototype.updateSocketIds=function(){for(var t in this.nsps)l.call(this.nsps,t)&&(this.nsps[t].id=this.generateId(t))},n.prototype.generateId=function(t){return("/"===t?"":t+"#")+this.engine.id},a(n.prototype),n.prototype.reconnection=function(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection},n.prototype.reconnectionAttempts=function(t){return arguments.length?(this._reconnectionAttempts=t,this):this._reconnectionAttempts},n.prototype.reconnectionDelay=function(t){return arguments.length?(this._reconnectionDelay=t,this.backoff&&this.backoff.setMin(t),this):this._reconnectionDelay},n.prototype.randomizationFactor=function(t){return arguments.length?(this._randomizationFactor=t,this.backoff&&this.backoff.setJitter(t),this):this._randomizationFactor},n.prototype.reconnectionDelayMax=function(t){return arguments.length?(this._reconnectionDelayMax=t,this.backoff&&this.backoff.setMax(t),this):this._reconnectionDelayMax},n.prototype.timeout=function(t){return arguments.length?(this._timeout=t,this):this._timeout},n.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},n.prototype.open=n.prototype.connect=function(t,e){if(~this.readyState.indexOf("open"))return this;this.engine=i(this.uri,this.opts);var r=this.engine,n=this;this.readyState="opening",this.skipReconnect=!1;var o=h(r,"open",function(){n.onopen(),t&&t()}),s=h(r,"error",function(e){if(n.cleanup(),n.readyState="closed",n.emitAll("connect_error",e),t){var r=new Error("Connection error");r.data=e,t(r)}else n.maybeReconnectOnOpen()});if(!1!==this._timeout){var a=this._timeout,c=setTimeout(function(){o.destroy(),r.close(),r.emit("error","timeout"),n.emitAll("connect_timeout",a)},a);this.subs.push({destroy:function(){clearTimeout(c)}})}return this.subs.push(o),this.subs.push(s),this},n.prototype.onopen=function(){this.cleanup(),this.readyState="open",this.emit("open");var t=this.engine;this.subs.push(h(t,"data",p(this,"ondata"))),this.subs.push(h(t,"ping",p(this,"onping"))),this.subs.push(h(t,"pong",p(this,"onpong"))),this.subs.push(h(t,"error",p(this,"onerror"))),this.subs.push(h(t,"close",p(this,"onclose"))),this.subs.push(h(this.decoder,"decoded",p(this,"ondecoded")))},n.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},n.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},n.prototype.ondata=function(t){this.decoder.add(t)},n.prototype.ondecoded=function(t){this.emit("packet",t)},n.prototype.onerror=function(t){this.emitAll("error",t)},n.prototype.socket=function(t,e){function r(){~u(o.connecting,n)||o.connecting.push(n)}var n=this.nsps[t];if(!n){n=new s(this,t,e),this.nsps[t]=n;var o=this;n.on("connecting",r),n.on("connect",function(){n.id=o.generateId(t)}),this.autoConnect&&r()}return n},n.prototype.destroy=function(t){var e=u(this.connecting,t);~e&&this.connecting.splice(e,1),this.connecting.length||this.close()},n.prototype.packet=function(t){var e=this;t.query&&0===t.type&&(t.nsp+="?"+t.query),e.encoding?e.packetBuffer.push(t):(e.encoding=!0,this.encoder.encode(t,function(r){for(var n=0;n<r.length;n++)e.engine.write(r[n],t.options);e.encoding=!1,e.processPacketQueue()}))},n.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var t=this.packetBuffer.shift();this.packet(t)}},n.prototype.cleanup=function(){for(var t=this.subs.length,e=0;e<t;e++){var r=this.subs.shift();r.destroy()}this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},n.prototype.close=n.prototype.disconnect=function(){this.skipReconnect=!0,this.reconnecting=!1,"opening"===this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},n.prototype.onclose=function(t){this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",t),this._reconnection&&!this.skipReconnect&&this.reconnect()},n.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var e=this.backoff.duration();this.reconnecting=!0;var r=setTimeout(function(){t.skipReconnect||(t.emitAll("reconnect_attempt",t.backoff.attempts),t.emitAll("reconnecting",t.backoff.attempts),t.skipReconnect||t.open(function(e){e?(t.reconnecting=!1,t.reconnect(),t.emitAll("reconnect_error",e.data)):t.onreconnect()}))},e);this.subs.push({destroy:function(){clearTimeout(r)}})}},n.prototype.onreconnect=function(){var t=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",t)}},function(t,e,r){t.exports=r(12)},function(t,e,r){t.exports=r(13),t.exports.parser=r(20)},function(t,e,r){(function(e){function n(t,r){if(!(this instanceof n))return new n(t,r);r=r||{},t&&"object"==typeof t&&(r=t,t=null),t?(t=h(t),r.hostname=t.host,r.secure="https"===t.protocol||"wss"===t.protocol,r.port=t.port,t.query&&(r.query=t.query)):r.host&&(r.hostname=h(r.host).host),this.secure=null!=r.secure?r.secure:e.location&&"https:"===location.protocol,r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.agent=r.agent||!1,this.hostname=r.hostname||(e.location?location.hostname:"localhost"),this.port=r.port||(e.location&&location.port?location.port:this.secure?443:80),this.query=r.query||{},"string"==typeof this.query&&(this.query=u.decode(this.query)),this.upgrade=!1!==r.upgrade,this.path=(r.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!r.forceJSONP,this.jsonp=!1!==r.jsonp,this.forceBase64=!!r.forceBase64,this.enablesXDR=!!r.enablesXDR,this.timestampParam=r.timestampParam||"t",this.timestampRequests=r.timestampRequests,this.transports=r.transports||["polling","websocket"],this.transportOptions=r.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=r.policyPort||843,this.rememberUpgrade=r.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=r.onlyBinaryUpgrades,this.perMessageDeflate=!1!==r.perMessageDeflate&&(r.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=r.pfx||null,this.key=r.key||null,this.passphrase=r.passphrase||null,this.cert=r.cert||null,this.ca=r.ca||null,this.ciphers=r.ciphers||null,this.rejectUnauthorized=void 0===r.rejectUnauthorized||r.rejectUnauthorized,this.forceNode=!!r.forceNode;var o="object"==typeof e&&e;o.global===o&&(r.extraHeaders&&Object.keys(r.extraHeaders).length>0&&(this.extraHeaders=r.extraHeaders),r.localAddress&&(this.localAddress=r.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}function o(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}var i=r(14),s=r(5),a=(r(3)("engine.io-client:socket"),r(34)),c=r(20),h=r(2),p=r(35),u=r(28);t.exports=n,n.priorWebsocketSuccess=!1,s(n.prototype),n.protocol=c.protocol,n.Socket=n,n.Transport=r(19),n.transports=r(14),n.parser=r(20),n.prototype.createTransport=function(t){var e=o(this.query);e.EIO=c.protocol,e.transport=t;var r=this.transportOptions[t]||{};this.id&&(e.sid=this.id);var n=new i[t]({query:e,socket:this,agent:r.agent||this.agent,hostname:r.hostname||this.hostname,port:r.port||this.port,secure:r.secure||this.secure,path:r.path||this.path,forceJSONP:r.forceJSONP||this.forceJSONP,jsonp:r.jsonp||this.jsonp,forceBase64:r.forceBase64||this.forceBase64,enablesXDR:r.enablesXDR||this.enablesXDR,timestampRequests:r.timestampRequests||this.timestampRequests,timestampParam:r.timestampParam||this.timestampParam,policyPort:r.policyPort||this.policyPort,pfx:r.pfx||this.pfx,key:r.key||this.key,passphrase:r.passphrase||this.passphrase,cert:r.cert||this.cert,ca:r.ca||this.ca,ciphers:r.ciphers||this.ciphers,rejectUnauthorized:r.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:r.perMessageDeflate||this.perMessageDeflate,extraHeaders:r.extraHeaders||this.extraHeaders,forceNode:r.forceNode||this.forceNode,localAddress:r.localAddress||this.localAddress,requestTimeout:r.requestTimeout||this.requestTimeout,protocols:r.protocols||void 0});return n},n.prototype.open=function(){var t;if(this.rememberUpgrade&&n.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else{if(0===this.transports.length){var e=this;return void setTimeout(function(){e.emit("error","No transports available")},0)}t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(t){return this.transports.shift(),void this.open()}t.open(),this.setTransport(t)},n.prototype.setTransport=function(t){var e=this;this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",function(){e.onDrain()}).on("packet",function(t){e.onPacket(t)}).on("error",function(t){e.onError(t)}).on("close",function(){e.onClose("transport close")})},n.prototype.probe=function(t){function e(){if(u.onlyBinaryUpgrades){var t=!this.supportsBinary&&u.transport.supportsBinary;p=p||t}p||(h.send([{type:"ping",data:"probe"}]),h.once("packet",function(t){if(!p)if("pong"===t.type&&"probe"===t.data){if(u.upgrading=!0,u.emit("upgrading",h),!h)return;n.priorWebsocketSuccess="websocket"===h.name,u.transport.pause(function(){p||"closed"!==u.readyState&&(c(),u.setTransport(h),h.send([{type:"upgrade"}]),u.emit("upgrade",h),h=null,u.upgrading=!1,u.flush())})}else{var e=new Error("probe error");e.transport=h.name,u.emit("upgradeError",e)}}))}function r(){p||(p=!0,c(),h.close(),h=null)}function o(t){var e=new Error("probe error: "+t);e.transport=h.name,r(),u.emit("upgradeError",e)}function i(){o("transport closed")}function s(){o("socket closed")}function a(t){h&&t.name!==h.name&&r()}function c(){h.removeListener("open",e),h.removeListener("error",o),h.removeListener("close",i),u.removeListener("close",s),u.removeListener("upgrading",a)}var h=this.createTransport(t,{probe:1}),p=!1,u=this;n.priorWebsocketSuccess=!1,h.once("open",e),h.once("error",o),h.once("close",i),this.once("close",s),this.once("upgrading",a),h.open()},n.prototype.onOpen=function(){if(this.readyState="open",n.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause)for(var t=0,e=this.upgrades.length;t<e;t++)this.probe(this.upgrades[t])},n.prototype.onPacket=function(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emit("packet",t),this.emit("heartbeat"),t.type){case"open":this.onHandshake(p(t.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var e=new Error("server error");e.code=t.data,this.onError(e);break;case"message":this.emit("data",t.data),this.emit("message",t.data)}},n.prototype.onHandshake=function(t){this.emit("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.onOpen(),"closed"!==this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},n.prototype.onHeartbeat=function(t){clearTimeout(this.pingTimeoutTimer);var e=this;e.pingTimeoutTimer=setTimeout(function(){"closed"!==e.readyState&&e.onClose("ping timeout")},t||e.pingInterval+e.pingTimeout)},n.prototype.setPing=function(){var t=this;clearTimeout(t.pingIntervalTimer),t.pingIntervalTimer=setTimeout(function(){t.ping(),t.onHeartbeat(t.pingTimeout)},t.pingInterval)},n.prototype.ping=function(){var t=this;this.sendPacket("ping",function(){t.emit("ping")})},n.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()},n.prototype.flush=function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},n.prototype.write=n.prototype.send=function(t,e,r){return this.sendPacket("message",t,e,r),this},n.prototype.sendPacket=function(t,e,r,n){if("function"==typeof e&&(n=e,e=void 0),"function"==typeof r&&(n=r,r=null),"closing"!==this.readyState&&"closed"!==this.readyState){r=r||{},r.compress=!1!==r.compress;var o={type:t,data:e,options:r};this.emit("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}},n.prototype.close=function(){function t(){n.onClose("forced close"),n.transport.close()}function e(){n.removeListener("upgrade",e),n.removeListener("upgradeError",e),t()}function r(){n.once("upgrade",e),n.once("upgradeError",e)}if("opening"===this.readyState||"open"===this.readyState){this.readyState="closing";var n=this;this.writeBuffer.length?this.once("drain",function(){this.upgrading?r():t()}):this.upgrading?r():t()}return this},n.prototype.onError=function(t){n.priorWebsocketSuccess=!1,this.emit("error",t),this.onClose("transport error",t)},n.prototype.onClose=function(t,e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState){var r=this;clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",t,e),r.writeBuffer=[],r.prevBufferLen=0}},n.prototype.filterUpgrades=function(t){for(var e=[],r=0,n=t.length;r<n;r++)~a(this.transports,t[r])&&e.push(t[r]);return e}}).call(e,function(){return this}())},function(t,e,r){(function(t){function n(e){var r,n=!1,a=!1,c=!1!==e.jsonp;if(t.location){var h="https:"===location.protocol,p=location.port;p||(p=h?443:80),n=e.hostname!==location.hostname||p!==e.port,a=e.secure!==h}if(e.xdomain=n,e.xscheme=a,r=new o(e),"open"in r&&!e.forceJSONP)return new i(e);if(!c)throw new Error("JSONP disabled");return new s(e)}var o=r(15),i=r(17),s=r(31),a=r(32);e.polling=n,e.websocket=a}).call(e,function(){return this}())},function(t,e,r){(function(e){var n=r(16);t.exports=function(t){var r=t.xdomain,o=t.xscheme,i=t.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!r||n))return new XMLHttpRequest}catch(t){}try{if("undefined"!=typeof XDomainRequest&&!o&&i)return new XDomainRequest}catch(t){}if(!r)try{return new(e[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}}).call(e,function(){return this}())},function(t,e){try{t.exports="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(e){t.exports=!1}},function(t,e,r){(function(e){function n(){}function o(t){if(c.call(this,t),this.requestTimeout=t.requestTimeout,this.extraHeaders=t.extraHeaders,e.location){var r="https:"===location.protocol,n=location.port;n||(n=r?443:80),this.xd=t.hostname!==e.location.hostname||n!==t.port,this.xs=t.secure!==r}}function i(t){this.method=t.method||"GET",this.uri=t.uri,this.xd=!!t.xd,this.xs=!!t.xs,this.async=!1!==t.async,this.data=void 0!==t.data?t.data:null,this.agent=t.agent,this.isBinary=t.isBinary,this.supportsBinary=t.supportsBinary,this.enablesXDR=t.enablesXDR,this.requestTimeout=t.requestTimeout,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.extraHeaders=t.extraHeaders,this.create()}function s(){for(var t in i.requests)i.requests.hasOwnProperty(t)&&i.requests[t].abort()}var a=r(15),c=r(18),h=r(5),p=r(29);r(3)("engine.io-client:polling-xhr");t.exports=o,t.exports.Request=i,p(o,c),o.prototype.supportsBinary=!0,o.prototype.request=function(t){return t=t||{},t.uri=this.uri(),t.xd=this.xd,t.xs=this.xs,t.agent=this.agent||!1,t.supportsBinary=this.supportsBinary,t.enablesXDR=this.enablesXDR,t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized,t.requestTimeout=this.requestTimeout,t.extraHeaders=this.extraHeaders,new i(t)},o.prototype.doWrite=function(t,e){var r="string"!=typeof t&&void 0!==t,n=this.request({method:"POST",data:t,isBinary:r}),o=this;n.on("success",e),n.on("error",function(t){o.onError("xhr post error",t)}),this.sendXhr=n},o.prototype.doPoll=function(){var t=this.request(),e=this;t.on("data",function(t){e.onData(t)}),t.on("error",function(t){e.onError("xhr poll error",t)}),this.pollXhr=t},h(i.prototype),i.prototype.create=function(){var t={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};t.pfx=this.pfx,t.key=this.key,t.passphrase=this.passphrase,t.cert=this.cert,t.ca=this.ca,t.ciphers=this.ciphers,t.rejectUnauthorized=this.rejectUnauthorized;var r=this.xhr=new a(t),n=this;try{r.open(this.method,this.uri,this.async);try{if(this.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(var o in this.extraHeaders)this.extraHeaders.hasOwnProperty(o)&&r.setRequestHeader(o,this.extraHeaders[o])}}catch(t){}if("POST"===this.method)try{this.isBinary?r.setRequestHeader("Content-type","application/octet-stream"):r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{r.setRequestHeader("Accept","*/*")}catch(t){}"withCredentials"in r&&(r.withCredentials=!0),this.requestTimeout&&(r.timeout=this.requestTimeout),this.hasXDR()?(r.onload=function(){n.onLoad()},r.onerror=function(){n.onError(r.responseText)}):r.onreadystatechange=function(){if(2===r.readyState){var t;try{t=r.getResponseHeader("Content-Type")}catch(t){}"application/octet-stream"===t&&(r.responseType="arraybuffer")}4===r.readyState&&(200===r.status||1223===r.status?n.onLoad():setTimeout(function(){n.onError(r.status)},0))},r.send(this.data)}catch(t){return void setTimeout(function(){n.onError(t)},0)}e.document&&(this.index=i.requestsCount++,i.requests[this.index]=this)},i.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},i.prototype.onData=function(t){this.emit("data",t),this.onSuccess()},i.prototype.onError=function(t){this.emit("error",t),this.cleanup(!0)},i.prototype.cleanup=function(t){if("undefined"!=typeof this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=n:this.xhr.onreadystatechange=n,t)try{this.xhr.abort()}catch(t){}e.document&&delete i.requests[this.index],this.xhr=null}},i.prototype.onLoad=function(){var t;try{var e;try{e=this.xhr.getResponseHeader("Content-Type")}catch(t){}t="application/octet-stream"===e?this.xhr.response||this.xhr.responseText:this.xhr.responseText}catch(t){this.onError(t)}null!=t&&this.onData(t)},i.prototype.hasXDR=function(){return"undefined"!=typeof e.XDomainRequest&&!this.xs&&this.enablesXDR},i.prototype.abort=function(){this.cleanup()},i.requestsCount=0,i.requests={},e.document&&(e.attachEvent?e.attachEvent("onunload",s):e.addEventListener&&e.addEventListener("beforeunload",s,!1))}).call(e,function(){return this}())},function(t,e,r){function n(t){var e=t&&t.forceBase64;h&&!e||(this.supportsBinary=!1),o.call(this,t)}var o=r(19),i=r(28),s=r(20),a=r(29),c=r(30);r(3)("engine.io-client:polling");t.exports=n;var h=function(){var t=r(15),e=new t({xdomain:!1});return null!=e.responseType}();a(n,o),n.prototype.name="polling",n.prototype.doOpen=function(){this.poll()},n.prototype.pause=function(t){function e(){r.readyState="paused",t()}var r=this;if(this.readyState="pausing",this.polling||!this.writable){var n=0;this.polling&&(n++,this.once("pollComplete",function(){--n||e()})),this.writable||(n++,this.once("drain",function(){--n||e()}))}else e()},n.prototype.poll=function(){this.polling=!0,this.doPoll(),this.emit("poll")},n.prototype.onData=function(t){var e=this,r=function(t,r,n){return"opening"===e.readyState&&e.onOpen(),"close"===t.type?(e.onClose(),!1):void e.onPacket(t)};s.decodePayload(t,this.socket.binaryType,r),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState&&this.poll())},n.prototype.doClose=function(){function t(){e.write([{type:"close"}])}var e=this;"open"===this.readyState?t():this.once("open",t)},n.prototype.write=function(t){var e=this;this.writable=!1;var r=function(){e.writable=!0,e.emit("drain")};s.encodePayload(t,this.supportsBinary,function(t){e.doWrite(t,r)})},n.prototype.uri=function(){var t=this.query||{},e=this.secure?"https":"http",r="";!1!==this.timestampRequests&&(t[this.timestampParam]=c()),this.supportsBinary||t.sid||(t.b64=1),t=i.encode(t),this.port&&("https"===e&&443!==Number(this.port)||"http"===e&&80!==Number(this.port))&&(r=":"+this.port),t.length&&(t="?"+t);var n=this.hostname.indexOf(":")!==-1;return e+"://"+(n?"["+this.hostname+"]":this.hostname)+r+this.path+t}},function(t,e,r){function n(t){this.path=t.path,this.hostname=t.hostname,this.port=t.port,this.secure=t.secure,this.query=t.query,this.timestampParam=t.timestampParam,this.timestampRequests=t.timestampRequests,this.readyState="",this.agent=t.agent||!1,this.socket=t.socket,this.enablesXDR=t.enablesXDR,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.forceNode=t.forceNode,this.extraHeaders=t.extraHeaders,this.localAddress=t.localAddress}var o=r(20),i=r(5);t.exports=n,i(n.prototype),n.prototype.onError=function(t,e){var r=new Error(t);return r.type="TransportError",r.description=e,this.emit("error",r),this},n.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},n.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},n.prototype.send=function(t){if("open"!==this.readyState)throw new Error("Transport not open");this.write(t)},n.prototype.onOpen=function(){this.readyState="open",
+this.writable=!0,this.emit("open")},n.prototype.onData=function(t){var e=o.decodePacket(t,this.socket.binaryType);this.onPacket(e)},n.prototype.onPacket=function(t){this.emit("packet",t)},n.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},function(t,e,r){(function(t){function n(t,r){var n="b"+e.packets[t.type]+t.data.data;return r(n)}function o(t,r,n){if(!r)return e.encodeBase64Packet(t,n);var o=t.data,i=new Uint8Array(o),s=new Uint8Array(1+o.byteLength);s[0]=v[t.type];for(var a=0;a<i.length;a++)s[a+1]=i[a];return n(s.buffer)}function i(t,r,n){if(!r)return e.encodeBase64Packet(t,n);var o=new FileReader;return o.onload=function(){t.data=o.result,e.encodePacket(t,r,!0,n)},o.readAsArrayBuffer(t.data)}function s(t,r,n){if(!r)return e.encodeBase64Packet(t,n);if(g)return i(t,r,n);var o=new Uint8Array(1);o[0]=v[t.type];var s=new w([o.buffer,t.data]);return n(s)}function a(t){try{t=d.decode(t,{strict:!1})}catch(t){return!1}return t}function c(t,e,r){for(var n=new Array(t.length),o=l(t.length,r),i=function(t,r,o){e(r,function(e,r){n[t]=r,o(e,n)})},s=0;s<t.length;s++)i(s,t[s],o)}var h,p=r(21),u=r(6),f=r(22),l=r(23),d=r(24);t&&t.ArrayBuffer&&(h=r(26));var y="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),m="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),g=y||m;e.protocol=3;var v=e.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},b=p(v),k={type:"error",data:"parser error"},w=r(27);e.encodePacket=function(e,r,i,a){"function"==typeof r&&(a=r,r=!1),"function"==typeof i&&(a=i,i=null);var c=void 0===e.data?void 0:e.data.buffer||e.data;if(t.ArrayBuffer&&c instanceof ArrayBuffer)return o(e,r,a);if(w&&c instanceof t.Blob)return s(e,r,a);if(c&&c.base64)return n(e,a);var h=v[e.type];return void 0!==e.data&&(h+=i?d.encode(String(e.data),{strict:!1}):String(e.data)),a(""+h)},e.encodeBase64Packet=function(r,n){var o="b"+e.packets[r.type];if(w&&r.data instanceof t.Blob){var i=new FileReader;return i.onload=function(){var t=i.result.split(",")[1];n(o+t)},i.readAsDataURL(r.data)}var s;try{s=String.fromCharCode.apply(null,new Uint8Array(r.data))}catch(t){for(var a=new Uint8Array(r.data),c=new Array(a.length),h=0;h<a.length;h++)c[h]=a[h];s=String.fromCharCode.apply(null,c)}return o+=t.btoa(s),n(o)},e.decodePacket=function(t,r,n){if(void 0===t)return k;if("string"==typeof t){if("b"===t.charAt(0))return e.decodeBase64Packet(t.substr(1),r);if(n&&(t=a(t),t===!1))return k;var o=t.charAt(0);return Number(o)==o&&b[o]?t.length>1?{type:b[o],data:t.substring(1)}:{type:b[o]}:k}var i=new Uint8Array(t),o=i[0],s=f(t,1);return w&&"blob"===r&&(s=new w([s])),{type:b[o],data:s}},e.decodeBase64Packet=function(t,e){var r=b[t.charAt(0)];if(!h)return{type:r,data:{base64:!0,data:t.substr(1)}};var n=h.decode(t.substr(1));return"blob"===e&&w&&(n=new w([n])),{type:r,data:n}},e.encodePayload=function(t,r,n){function o(t){return t.length+":"+t}function i(t,n){e.encodePacket(t,!!s&&r,!1,function(t){n(null,o(t))})}"function"==typeof r&&(n=r,r=null);var s=u(t);return r&&s?w&&!g?e.encodePayloadAsBlob(t,n):e.encodePayloadAsArrayBuffer(t,n):t.length?void c(t,i,function(t,e){return n(e.join(""))}):n("0:")},e.decodePayload=function(t,r,n){if("string"!=typeof t)return e.decodePayloadAsBinary(t,r,n);"function"==typeof r&&(n=r,r=null);var o;if(""===t)return n(k,0,1);for(var i,s,a="",c=0,h=t.length;c<h;c++){var p=t.charAt(c);if(":"===p){if(""===a||a!=(i=Number(a)))return n(k,0,1);if(s=t.substr(c+1,i),a!=s.length)return n(k,0,1);if(s.length){if(o=e.decodePacket(s,r,!1),k.type===o.type&&k.data===o.data)return n(k,0,1);var u=n(o,c+i,h);if(!1===u)return}c+=i,a=""}else a+=p}return""!==a?n(k,0,1):void 0},e.encodePayloadAsArrayBuffer=function(t,r){function n(t,r){e.encodePacket(t,!0,!0,function(t){return r(null,t)})}return t.length?void c(t,n,function(t,e){var n=e.reduce(function(t,e){var r;return r="string"==typeof e?e.length:e.byteLength,t+r.toString().length+r+2},0),o=new Uint8Array(n),i=0;return e.forEach(function(t){var e="string"==typeof t,r=t;if(e){for(var n=new Uint8Array(t.length),s=0;s<t.length;s++)n[s]=t.charCodeAt(s);r=n.buffer}e?o[i++]=0:o[i++]=1;for(var a=r.byteLength.toString(),s=0;s<a.length;s++)o[i++]=parseInt(a[s]);o[i++]=255;for(var n=new Uint8Array(r),s=0;s<n.length;s++)o[i++]=n[s]}),r(o.buffer)}):r(new ArrayBuffer(0))},e.encodePayloadAsBlob=function(t,r){function n(t,r){e.encodePacket(t,!0,!0,function(t){var e=new Uint8Array(1);if(e[0]=1,"string"==typeof t){for(var n=new Uint8Array(t.length),o=0;o<t.length;o++)n[o]=t.charCodeAt(o);t=n.buffer,e[0]=0}for(var i=t instanceof ArrayBuffer?t.byteLength:t.size,s=i.toString(),a=new Uint8Array(s.length+1),o=0;o<s.length;o++)a[o]=parseInt(s[o]);if(a[s.length]=255,w){var c=new w([e.buffer,a.buffer,t]);r(null,c)}})}c(t,n,function(t,e){return r(new w(e))})},e.decodePayloadAsBinary=function(t,r,n){"function"==typeof r&&(n=r,r=null);for(var o=t,i=[];o.byteLength>0;){for(var s=new Uint8Array(o),a=0===s[0],c="",h=1;255!==s[h];h++){if(c.length>310)return n(k,0,1);c+=s[h]}o=f(o,2+c.length),c=parseInt(c);var p=f(o,0,c);if(a)try{p=String.fromCharCode.apply(null,new Uint8Array(p))}catch(t){var u=new Uint8Array(p);p="";for(var h=0;h<u.length;h++)p+=String.fromCharCode(u[h])}i.push(p),o=f(o,c)}var l=i.length;i.forEach(function(t,o){n(e.decodePacket(t,r,!0),o,l)})}}).call(e,function(){return this}())},function(t,e){t.exports=Object.keys||function(t){var e=[],r=Object.prototype.hasOwnProperty;for(var n in t)r.call(t,n)&&e.push(n);return e}},function(t,e){t.exports=function(t,e,r){var n=t.byteLength;if(e=e||0,r=r||n,t.slice)return t.slice(e,r);if(e<0&&(e+=n),r<0&&(r+=n),r>n&&(r=n),e>=n||e>=r||0===n)return new ArrayBuffer(0);for(var o=new Uint8Array(t),i=new Uint8Array(r-e),s=e,a=0;s<r;s++,a++)i[a]=o[s];return i.buffer}},function(t,e){function r(t,e,r){function o(t,n){if(o.count<=0)throw new Error("after called too many times");--o.count,t?(i=!0,e(t),e=r):0!==o.count||i||e(null,n)}var i=!1;return r=r||n,o.count=t,0===t?e():o}function n(){}t.exports=r},function(t,e,r){var n;(function(t,o){!function(i){function s(t){for(var e,r,n=[],o=0,i=t.length;o<i;)e=t.charCodeAt(o++),e>=55296&&e<=56319&&o<i?(r=t.charCodeAt(o++),56320==(64512&r)?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),o--)):n.push(e);return n}function a(t){for(var e,r=t.length,n=-1,o="";++n<r;)e=t[n],e>65535&&(e-=65536,o+=k(e>>>10&1023|55296),e=56320|1023&e),o+=k(e);return o}function c(t,e){if(t>=55296&&t<=57343){if(e)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function h(t,e){return k(t>>e&63|128)}function p(t,e){if(0==(4294967168&t))return k(t);var r="";return 0==(4294965248&t)?r=k(t>>6&31|192):0==(4294901760&t)?(c(t,e)||(t=65533),r=k(t>>12&15|224),r+=h(t,6)):0==(4292870144&t)&&(r=k(t>>18&7|240),r+=h(t,12),r+=h(t,6)),r+=k(63&t|128)}function u(t,e){e=e||{};for(var r,n=!1!==e.strict,o=s(t),i=o.length,a=-1,c="";++a<i;)r=o[a],c+=p(r,n);return c}function f(){if(b>=v)throw Error("Invalid byte index");var t=255&g[b];if(b++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function l(t){var e,r,n,o,i;if(b>v)throw Error("Invalid byte index");if(b==v)return!1;if(e=255&g[b],b++,0==(128&e))return e;if(192==(224&e)){if(r=f(),i=(31&e)<<6|r,i>=128)return i;throw Error("Invalid continuation byte")}if(224==(240&e)){if(r=f(),n=f(),i=(15&e)<<12|r<<6|n,i>=2048)return c(i,t)?i:65533;throw Error("Invalid continuation byte")}if(240==(248&e)&&(r=f(),n=f(),o=f(),i=(7&e)<<18|r<<12|n<<6|o,i>=65536&&i<=1114111))return i;throw Error("Invalid UTF-8 detected")}function d(t,e){e=e||{};var r=!1!==e.strict;g=s(t),v=g.length,b=0;for(var n,o=[];(n=l(r))!==!1;)o.push(n);return a(o)}var y="object"==typeof e&&e,m=("object"==typeof t&&t&&t.exports==y&&t,"object"==typeof o&&o);m.global!==m&&m.window!==m||(i=m);var g,v,b,k=String.fromCharCode,w={version:"2.1.2",encode:u,decode:d};n=function(){return w}.call(e,r,e,t),!(void 0!==n&&(t.exports=n))}(this)}).call(e,r(25)(t),function(){return this}())},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children=[],t.webpackPolyfill=1),t}},function(t,e){!function(){"use strict";for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=new Uint8Array(256),n=0;n<t.length;n++)r[t.charCodeAt(n)]=n;e.encode=function(e){var r,n=new Uint8Array(e),o=n.length,i="";for(r=0;r<o;r+=3)i+=t[n[r]>>2],i+=t[(3&n[r])<<4|n[r+1]>>4],i+=t[(15&n[r+1])<<2|n[r+2]>>6],i+=t[63&n[r+2]];return o%3===2?i=i.substring(0,i.length-1)+"=":o%3===1&&(i=i.substring(0,i.length-2)+"=="),i},e.decode=function(t){var e,n,o,i,s,a=.75*t.length,c=t.length,h=0;"="===t[t.length-1]&&(a--,"="===t[t.length-2]&&a--);var p=new ArrayBuffer(a),u=new Uint8Array(p);for(e=0;e<c;e+=4)n=r[t.charCodeAt(e)],o=r[t.charCodeAt(e+1)],i=r[t.charCodeAt(e+2)],s=r[t.charCodeAt(e+3)],u[h++]=n<<2|o>>4,u[h++]=(15&o)<<4|i>>2,u[h++]=(3&i)<<6|63&s;return p}}()},function(t,e){(function(e){function r(t){for(var e=0;e<t.length;e++){var r=t[e];if(r.buffer instanceof ArrayBuffer){var n=r.buffer;if(r.byteLength!==n.byteLength){var o=new Uint8Array(r.byteLength);o.set(new Uint8Array(n,r.byteOffset,r.byteLength)),n=o.buffer}t[e]=n}}}function n(t,e){e=e||{};var n=new i;r(t);for(var o=0;o<t.length;o++)n.append(t[o]);return e.type?n.getBlob(e.type):n.getBlob()}function o(t,e){return r(t),new Blob(t,e||{})}var i=e.BlobBuilder||e.WebKitBlobBuilder||e.MSBlobBuilder||e.MozBlobBuilder,s=function(){try{var t=new Blob(["hi"]);return 2===t.size}catch(t){return!1}}(),a=s&&function(){try{var t=new Blob([new Uint8Array([1,2])]);return 2===t.size}catch(t){return!1}}(),c=i&&i.prototype.append&&i.prototype.getBlob;t.exports=function(){return s?a?e.Blob:o:c?n:void 0}()}).call(e,function(){return this}())},function(t,e){e.encode=function(t){var e="";for(var r in t)t.hasOwnProperty(r)&&(e.length&&(e+="&"),e+=encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e},e.decode=function(t){for(var e={},r=t.split("&"),n=0,o=r.length;n<o;n++){var i=r[n].split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e}},function(t,e){t.exports=function(t,e){var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},function(t,e){"use strict";function r(t){var e="";do e=s[t%a]+e,t=Math.floor(t/a);while(t>0);return e}function n(t){var e=0;for(p=0;p<t.length;p++)e=e*a+c[t.charAt(p)];return e}function o(){var t=r(+new Date);return t!==i?(h=0,i=t):t+"."+r(h++)}for(var i,s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),a=64,c={},h=0,p=0;p<a;p++)c[s[p]]=p;o.encode=r,o.decode=n,t.exports=o},function(t,e,r){(function(e){function n(){}function o(t){i.call(this,t),this.query=this.query||{},a||(e.___eio||(e.___eio=[]),a=e.___eio),this.index=a.length;var r=this;a.push(function(t){r.onData(t)}),this.query.j=this.index,e.document&&e.addEventListener&&e.addEventListener("beforeunload",function(){r.script&&(r.script.onerror=n)},!1)}var i=r(18),s=r(29);t.exports=o;var a,c=/\n/g,h=/\\n/g;s(o,i),o.prototype.supportsBinary=!1,o.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),i.prototype.doClose.call(this)},o.prototype.doPoll=function(){var t=this,e=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),e.async=!0,e.src=this.uri(),e.onerror=function(e){t.onError("jsonp poll error",e)};var r=document.getElementsByTagName("script")[0];r?r.parentNode.insertBefore(e,r):(document.head||document.body).appendChild(e),this.script=e;var n="undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent);n&&setTimeout(function(){var t=document.createElement("iframe");document.body.appendChild(t),document.body.removeChild(t)},100)},o.prototype.doWrite=function(t,e){function r(){n(),e()}function n(){if(o.iframe)try{o.form.removeChild(o.iframe)}catch(t){o.onError("jsonp polling iframe removal error",t)}try{var t='<iframe src="javascript:0" name="'+o.iframeId+'">';i=document.createElement(t)}catch(t){i=document.createElement("iframe"),i.name=o.iframeId,i.src="javascript:0"}i.id=o.iframeId,o.form.appendChild(i),o.iframe=i}var o=this;if(!this.form){var i,s=document.createElement("form"),a=document.createElement("textarea"),p=this.iframeId="eio_iframe_"+this.index;s.className="socketio",s.style.position="absolute",s.style.top="-1000px",s.style.left="-1000px",s.target=p,s.method="POST",s.setAttribute("accept-charset","utf-8"),a.name="d",s.appendChild(a),document.body.appendChild(s),this.form=s,this.area=a}this.form.action=this.uri(),n(),t=t.replace(h,"\\\n"),this.area.value=t.replace(c,"\\n");try{this.form.submit()}catch(t){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===o.iframe.readyState&&r()}:this.iframe.onload=r}}).call(e,function(){return this}())},function(t,e,r){(function(e){function n(t){var e=t&&t.forceBase64;e&&(this.supportsBinary=!1),this.perMessageDeflate=t.perMessageDeflate,this.usingBrowserWebSocket=p&&!t.forceNode,this.protocols=t.protocols,this.usingBrowserWebSocket||(u=o),i.call(this,t)}var o,i=r(19),s=r(20),a=r(28),c=r(29),h=r(30),p=(r(3)("engine.io-client:websocket"),e.WebSocket||e.MozWebSocket);if("undefined"==typeof window)try{o=r(33)}catch(t){}var u=p;u||"undefined"!=typeof window||(u=o),t.exports=n,c(n,i),n.prototype.name="websocket",n.prototype.supportsBinary=!0,n.prototype.doOpen=function(){if(this.check()){var t=this.uri(),e=this.protocols,r={agent:this.agent,perMessageDeflate:this.perMessageDeflate};r.pfx=this.pfx,r.key=this.key,r.passphrase=this.passphrase,r.cert=this.cert,r.ca=this.ca,r.ciphers=this.ciphers,r.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(r.headers=this.extraHeaders),this.localAddress&&(r.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket?e?new u(t,e):new u(t):new u(t,e,r)}catch(t){return this.emit("error",t)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},n.prototype.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.onOpen()},this.ws.onclose=function(){t.onClose()},this.ws.onmessage=function(e){t.onData(e.data)},this.ws.onerror=function(e){t.onError("websocket error",e)}},n.prototype.write=function(t){function r(){n.emit("flush"),setTimeout(function(){n.writable=!0,n.emit("drain")},0)}var n=this;this.writable=!1;for(var o=t.length,i=0,a=o;i<a;i++)!function(t){s.encodePacket(t,n.supportsBinary,function(i){if(!n.usingBrowserWebSocket){var s={};if(t.options&&(s.compress=t.options.compress),n.perMessageDeflate){var a="string"==typeof i?e.Buffer.byteLength(i):i.length;a<n.perMessageDeflate.threshold&&(s.compress=!1)}}try{n.usingBrowserWebSocket?n.ws.send(i):n.ws.send(i,s)}catch(t){}--o||r()})}(t[i])},n.prototype.onClose=function(){i.prototype.onClose.call(this)},n.prototype.doClose=function(){"undefined"!=typeof this.ws&&this.ws.close()},n.prototype.uri=function(){var t=this.query||{},e=this.secure?"wss":"ws",r="";this.port&&("wss"===e&&443!==Number(this.port)||"ws"===e&&80!==Number(this.port))&&(r=":"+this.port),this.timestampRequests&&(t[this.timestampParam]=h()),this.supportsBinary||(t.b64=1),t=a.encode(t),t.length&&(t="?"+t);var n=this.hostname.indexOf(":")!==-1;return e+"://"+(n?"["+this.hostname+"]":this.hostname)+r+this.path+t},n.prototype.check=function(){return!(!u||"__initialize"in u&&this.name===n.prototype.name)}}).call(e,function(){return this}())},function(t,e){},function(t,e){var r=[].indexOf;t.exports=function(t,e){if(r)return t.indexOf(e);for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1}},function(t,e){(function(e){var r=/^[\],:{}\s]*$/,n=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,o=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,i=/(?:^|:|,)(?:\s*\[)+/g,s=/^\s+/,a=/\s+$/;t.exports=function(t){return"string"==typeof t&&t?(t=t.replace(s,"").replace(a,""),e.JSON&&JSON.parse?JSON.parse(t):r.test(t.replace(n,"@").replace(o,"]").replace(i,""))?new Function("return "+t)():void 0):null}}).call(e,function(){return this}())},function(t,e,r){"use strict";function n(t,e,r){this.io=t,this.nsp=e,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,r&&r.query&&(this.query=r.query),this.io.autoConnect&&this.open()}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i=r(4),s=r(5),a=r(37),c=r(38),h=r(39),p=(r(3)("socket.io-client:socket"),r(28));t.exports=e=n;var u={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},f=s.prototype.emit;s(n.prototype),n.prototype.subEvents=function(){if(!this.subs){var t=this.io;this.subs=[c(t,"open",h(this,"onopen")),c(t,"packet",h(this,"onpacket")),c(t,"close",h(this,"onclose"))]}},n.prototype.open=n.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting"),this)},n.prototype.send=function(){var t=a(arguments);return t.unshift("message"),this.emit.apply(this,t),this},n.prototype.emit=function(t){if(u.hasOwnProperty(t))return f.apply(this,arguments),this;var e=a(arguments),r={type:i.EVENT,data:e};return r.options={},r.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof e[e.length-1]&&(this.acks[this.ids]=e.pop(),r.id=this.ids++),this.connected?this.packet(r):this.sendBuffer.push(r),delete this.flags,this},n.prototype.packet=function(t){t.nsp=this.nsp,this.io.packet(t)},n.prototype.onopen=function(){if("/"!==this.nsp)if(this.query){var t="object"===o(this.query)?p.encode(this.query):this.query;this.packet({type:i.CONNECT,query:t})}else this.packet({type:i.CONNECT})},n.prototype.onclose=function(t){this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",t)},n.prototype.onpacket=function(t){if(t.nsp===this.nsp)switch(t.type){case i.CONNECT:this.onconnect();break;case i.EVENT:this.onevent(t);break;case i.BINARY_EVENT:this.onevent(t);break;case i.ACK:this.onack(t);break;case i.BINARY_ACK:this.onack(t);break;case i.DISCONNECT:this.ondisconnect();break;case i.ERROR:this.emit("error",t.data)}},n.prototype.onevent=function(t){var e=t.data||[];null!=t.id&&e.push(this.ack(t.id)),this.connected?f.apply(this,e):this.receiveBuffer.push(e)},n.prototype.ack=function(t){var e=this,r=!1;return function(){if(!r){r=!0;var n=a(arguments);e.packet({type:i.ACK,id:t,data:n})}}},n.prototype.onack=function(t){var e=this.acks[t.id];"function"==typeof e&&(e.apply(this,t.data),delete this.acks[t.id])},n.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},n.prototype.emitBuffered=function(){var t;for(t=0;t<this.receiveBuffer.length;t++)f.apply(this,this.receiveBuffer[t]);for(this.receiveBuffer=[],t=0;t<this.sendBuffer.length;t++)this.packet(this.sendBuffer[t]);this.sendBuffer=[]},n.prototype.ondisconnect=function(){this.destroy(),this.onclose("io server disconnect")},n.prototype.destroy=function(){if(this.subs){for(var t=0;t<this.subs.length;t++)this.subs[t].destroy();this.subs=null}this.io.destroy(this)},n.prototype.close=n.prototype.disconnect=function(){return this.connected&&this.packet({type:i.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},n.prototype.compress=function(t){return this.flags=this.flags||{},this.flags.compress=t,this}},function(t,e){function r(t,e){var r=[];e=e||0;for(var n=e||0;n<t.length;n++)r[n-e]=t[n];return r}t.exports=r},function(t,e){"use strict";function r(t,e,r){return t.on(e,r),{destroy:function(){t.removeListener(e,r)}}}t.exports=r},function(t,e){var r=[].slice;t.exports=function(t,e){if("string"==typeof e&&(e=t[e]),"function"!=typeof e)throw new Error("bind() requires a function");var n=r.call(arguments,2);return function(){return e.apply(t,n.concat(r.call(arguments)))}}},function(t,e){function r(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}t.exports=r,r.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),r=Math.floor(e*this.jitter*t);t=0==(1&Math.floor(10*e))?t-r:t+r}return 0|Math.min(t,this.max)},r.prototype.reset=function(){this.attempts=0},r.prototype.setMin=function(t){this.ms=t},r.prototype.setMax=function(t){this.max=t},r.prototype.setJitter=function(t){this.jitter=t}}])});
+//# sourceMappingURL=socket.io.slim.js.map
\ No newline at end of file
diff --git a/wrt/node_modules/socket.io-client/dist/socket.io.slim.js.map b/wrt/node_modules/socket.io-client/dist/socket.io.slim.js.map
new file mode 100644 (file)
index 0000000..35c3844
--- /dev/null
@@ -0,0 +1 @@
+{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///socket.io.slim.js","webpack:///webpack/bootstrap 6efc33f456691f458a90","webpack:///./lib/index.js","webpack:///./lib/url.js","webpack:///./~/parseuri/index.js","webpack:///./support/noop.js","webpack:///./~/socket.io-parser/index.js","webpack:///./~/component-emitter/index.js","webpack:///./~/has-binary2/index.js","webpack:///./~/isarray/index.js","webpack:///./~/socket.io-parser/binary.js","webpack:///./~/socket.io-parser/is-buffer.js","webpack:///./lib/manager.js","webpack:///./~/engine.io-client/index.js","webpack:///./~/engine.io-client/lib/index.js","webpack:///./~/engine.io-client/lib/socket.js","webpack:///./~/engine.io-client/lib/transports/index.js","webpack:///./~/engine.io-client/lib/xmlhttprequest.js","webpack:///./~/has-cors/index.js","webpack:///./~/engine.io-client/lib/transports/polling-xhr.js","webpack:///./~/engine.io-client/lib/transports/polling.js","webpack:///./~/engine.io-client/lib/transport.js","webpack:///./~/engine.io-parser/lib/browser.js","webpack:///./~/engine.io-parser/lib/keys.js","webpack:///./~/arraybuffer.slice/index.js","webpack:///./~/after/index.js","webpack:///./~/engine.io-parser/lib/utf8.js","webpack:///(webpack)/buildin/module.js","webpack:///./~/base64-arraybuffer/lib/base64-arraybuffer.js","webpack:///./~/blob/index.js","webpack:///./~/parseqs/index.js","webpack:///./~/component-inherit/index.js","webpack:///./~/yeast/index.js","webpack:///./~/engine.io-client/lib/transports/polling-jsonp.js","webpack:///./~/engine.io-client/lib/transports/websocket.js","webpack:///./~/indexof/index.js","webpack:///./~/parsejson/index.js","webpack:///./lib/socket.js","webpack:///./~/to-array/index.js","webpack:///./lib/on.js","webpack:///./~/component-bind/index.js","webpack:///./~/backo2/index.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","lookup","uri","opts","_typeof","undefined","io","parsed","url","source","path","sameNamespace","cache","nsps","newConnection","forceNew","multiplex","Manager","query","socket","Symbol","iterator","obj","constructor","prototype","parser","managers","protocol","connect","Socket","global","loc","location","host","charAt","test","parseuri","port","ipv6","indexOf","href","re","parts","str","src","b","e","substring","replace","length","exec","i","authority","ipv6uri","Encoder","encodeAsString","type","BINARY_EVENT","BINARY_ACK","attachments","nsp","data","JSON","stringify","encodeAsBinary","callback","writeEncoding","bloblessData","deconstruction","binary","deconstructPacket","pack","packet","buffers","unshift","removeBlobs","Decoder","reconstructor","decodeString","Number","types","error","buf","Error","next","tryParse","substr","parse","BinaryReconstructor","reconPack","ERROR","Emitter","hasBin","isBuf","CONNECT","DISCONNECT","EVENT","ACK","encode","encoding","add","emit","base64","takeBinaryData","destroy","finishedReconstruction","binData","push","reconstructPacket","mixin","key","on","addEventListener","event","fn","_callbacks","once","off","apply","arguments","removeListener","removeAllListeners","removeEventListener","callbacks","cb","splice","args","slice","len","listeners","hasListeners","hasBinary","isArray","l","Buffer","isBuffer","ArrayBuffer","withNativeBlob","Blob","withNativeFile","File","toJSON","Object","hasOwnProperty","toString","Array","arr","_deconstructPacket","placeholder","_placeholder","num","newData","Date","_reconstructPacket","packetData","_removeBlobs","curKey","containingObject","pendingBlobs","fileReader","FileReader","onload","result","readAsArrayBuffer","subs","reconnection","reconnectionAttempts","Infinity","reconnectionDelay","reconnectionDelayMax","randomizationFactor","backoff","Backoff","min","max","jitter","timeout","readyState","connecting","lastPing","packetBuffer","_parser","encoder","decoder","autoConnect","open","eio","bind","has","emitAll","updateSocketIds","generateId","engine","v","_reconnection","_reconnectionAttempts","_reconnectionDelay","setMin","_randomizationFactor","setJitter","_reconnectionDelayMax","setMax","_timeout","maybeReconnectOnOpen","reconnecting","attempts","reconnect","self","skipReconnect","openSub","onopen","errorSub","cleanup","err","timer","setTimeout","close","clearTimeout","onping","onpong","ondata","ondecoded","onerror","onConnecting","index","encodedPackets","write","options","processPacketQueue","shift","subsLength","sub","disconnect","reset","onclose","reason","delay","duration","onreconnect","attempt","hostname","secure","agent","parseqs","decode","upgrade","forceJSONP","jsonp","forceBase64","enablesXDR","timestampParam","timestampRequests","transports","transportOptions","writeBuffer","prevBufferLen","policyPort","rememberUpgrade","binaryType","onlyBinaryUpgrades","perMessageDeflate","threshold","pfx","passphrase","cert","ca","ciphers","rejectUnauthorized","forceNode","freeGlobal","extraHeaders","keys","localAddress","upgrades","pingInterval","pingTimeout","pingIntervalTimer","pingTimeoutTimer","clone","o","parsejson","priorWebsocketSuccess","Transport","createTransport","name","EIO","transport","sid","requestTimeout","protocols","setTransport","onDrain","onPacket","onError","onClose","probe","onTransportOpen","upgradeLosesBinary","supportsBinary","failed","send","msg","upgrading","pause","flush","freezeTransport","onTransportClose","onupgrade","to","onOpen","onHandshake","setPing","code","filterUpgrades","onHeartbeat","ping","sendPacket","writable","compress","cleanupAndClose","waitForUpgrade","desc","filteredUpgrades","j","polling","xhr","xd","xs","isSSL","xdomain","xscheme","XMLHttpRequest","XHR","JSONP","websocket","hasCORS","XDomainRequest","concat","join","empty","Polling","Request","method","async","isBinary","create","unloadHandler","requests","abort","inherit","request","doWrite","req","sendXhr","doPoll","onData","pollXhr","setDisableHeaderCheck","setRequestHeader","withCredentials","hasXDR","onLoad","responseText","onreadystatechange","contentType","getResponseHeader","responseType","status","document","requestsCount","onSuccess","fromError","response","attachEvent","hasXHR2","yeast","doOpen","poll","onPause","total","decodePayload","doClose","packets","callbackfn","encodePayload","schema","b64","description","decodePacket","encodeBase64Object","message","encodeArrayBuffer","encodeBase64Packet","contentArray","Uint8Array","resultBuffer","byteLength","buffer","encodeBlobAsArrayBuffer","fr","encodePacket","encodeBlob","dontSendBlobs","blob","tryDecode","utf8","strict","map","ary","each","done","after","eachWithIndex","el","base64encoder","sliceBuffer","isAndroid","navigator","userAgent","isPhantomJS","pong","noop","packetslist","utf8encode","encoded","String","split","readAsDataURL","b64data","fromCharCode","typed","basic","btoa","utf8decode","decodeBase64Packet","asArray","rest","setLengthHeader","encodeOne","doneCallback","encodePayloadAsBlob","encodePayloadAsArrayBuffer","results","decodePayloadAsBinary","n","chr","ret","totalLength","reduce","acc","resultArray","bufferIndex","forEach","isString","ab","view","charCodeAt","lenStr","parseInt","binaryIdentifier","size","lengthAry","bufferTail","tailArray","msgLength","arraybuffer","start","end","bytes","abv","ii","count","err_cb","proxy","bail","__WEBPACK_AMD_DEFINE_RESULT__","ucs2decode","string","value","extra","output","counter","ucs2encode","array","stringFromCharCode","checkScalarValue","codePoint","toUpperCase","createByte","encodeCodePoint","symbol","codePoints","byteString","readContinuationByte","byteIndex","byteCount","continuationByte","byteArray","decodeSymbol","byte1","byte2","byte3","byte4","tmp","freeExports","window","version","webpackPolyfill","deprecate","paths","children","chars","encoded1","encoded2","encoded3","encoded4","bufferLength","mapArrayBufferViews","chunk","copy","set","byteOffset","BlobBuilderConstructor","bb","BlobBuilder","append","getBlob","BlobConstructor","WebKitBlobBuilder","MSBlobBuilder","MozBlobBuilder","blobSupported","a","blobSupportsArrayBufferView","blobBuilderSupported","encodeURIComponent","qs","qry","pairs","pair","decodeURIComponent","alphabet","Math","floor","decoded","now","prev","seed","JSONPPolling","___eio","script","rNewline","rEscapedNewline","parentNode","removeChild","form","iframe","createElement","insertAt","getElementsByTagName","insertBefore","head","body","appendChild","isUAgecko","complete","initIframe","html","iframeId","area","className","style","position","top","left","target","setAttribute","action","submit","WS","usingBrowserWebSocket","BrowserWebSocket","WebSocket","NodeWebSocket","MozWebSocket","check","headers","ws","supports","addEventListeners","onmessage","ev","rvalidchars","rvalidescape","rvalidtokens","rvalidbraces","rtrimLeft","rtrimRight","Function","json","ids","acks","receiveBuffer","sendBuffer","connected","disconnected","toArray","events","connect_error","connect_timeout","reconnect_attempt","reconnect_failed","reconnect_error","subEvents","flags","pop","onpacket","onconnect","onevent","onack","ondisconnect","ack","sent","emitBuffered","list","ms","factor","pow","rand","random","deviation"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,GAAAD,IAEAD,EAAA,GAAAC,KACCK,KAAA,WACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAP,WACAS,GAAAF,EACAG,QAAA,EAUA,OANAL,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,QAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KAqCA,OATAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,GAGAR,EAAA,KDgBM,SAAUL,EAAQD,EAASM,GAEhC,YErBD,SAASS,GAAQC,EAAKC,GACD,YAAf,mBAAOD,GAAP,YAAAE,EAAOF,MACTC,EAAOD,EACPA,EAAMG,QAGRF,EAAOA,KAEP,IAQIG,GARAC,EAASC,EAAIN,GACbO,EAASF,EAAOE,OAChBd,EAAKY,EAAOZ,GACZe,EAAOH,EAAOG,KACdC,EAAgBC,EAAMjB,IAAOe,IAAQE,GAAMjB,GAAIkB,KAC/CC,EAAgBX,EAAKY,UAAYZ,EAAK,0BACtB,IAAUA,EAAKa,WAAaL,CAiBhD,OAbIG,GAEFR,EAAKW,EAAQR,EAAQN,IAEhBS,EAAMjB,KAETiB,EAAMjB,GAAMsB,EAAQR,EAAQN,IAE9BG,EAAKM,EAAMjB,IAETY,EAAOW,QAAUf,EAAKe,QACxBf,EAAKe,MAAQX,EAAOW,OAEfZ,EAAGa,OAAOZ,EAAOG,KAAMP,GFR/B,GAAIC,GAA4B,kBAAXgB,SAAoD,gBAApBA,QAAOC,SAAwB,SAAUC,GAAO,aAAcA,IAAS,SAAUA,GAAO,MAAOA,IAAyB,kBAAXF,SAAyBE,EAAIC,cAAgBH,QAAUE,IAAQF,OAAOI,UAAY,eAAkBF,IErDnQd,EAAMhB,EAAQ,GACdiC,EAASjC,EAAQ,GACjByB,EAAUzB,EAAQ,GACVA,GAAQ,GAAS,mBAM7BL,GAAOD,QAAUA,EAAUe,CAM3B,IAAIW,GAAQ1B,EAAQwC,WAuDpBxC,GAAQyC,SAAWF,EAAOE,SAS1BzC,EAAQ0C,QAAU3B,EAQlBf,EAAQ+B,QAAUzB,EAAQ,IAC1BN,EAAQ2C,OAASrC,EAAQ,KF8DnB,SAAUL,EAAQD,EAASM,IAEJ,SAASsC,GAAS,YGtI/C,SAAStB,GAAKN,EAAK6B,GACjB,GAAIT,GAAMpB,CAGV6B,GAAMA,GAAOD,EAAOE,SAChB,MAAQ9B,IAAKA,EAAM6B,EAAIJ,SAAW,KAAOI,EAAIE,MAG7C,gBAAoB/B,KAClB,MAAQA,EAAIgC,OAAO,KAEnBhC,EADE,MAAQA,EAAIgC,OAAO,GACfH,EAAIJ,SAAWzB,EAEf6B,EAAIE,KAAO/B,GAIhB,sBAAsBiC,KAAKjC,KAG5BA,EADE,mBAAuB6B,GACnBA,EAAIJ,SAAW,KAAOzB,EAEtB,WAAaA,GAMvBoB,EAAMc,EAASlC,IAIZoB,EAAIe,OACH,cAAcF,KAAKb,EAAIK,UACzBL,EAAIe,KAAO,KACF,eAAeF,KAAKb,EAAIK,YACjCL,EAAIe,KAAO,QAIff,EAAIZ,KAAOY,EAAIZ,MAAQ,GAEvB,IAAI4B,GAAOhB,EAAIW,KAAKM,QAAQ,QAAS,EACjCN,EAAOK,EAAO,IAAMhB,EAAIW,KAAO,IAAMX,EAAIW,IAO7C,OAJAX,GAAI3B,GAAK2B,EAAIK,SAAW,MAAQM,EAAO,IAAMX,EAAIe,KAEjDf,EAAIkB,KAAOlB,EAAIK,SAAW,MAAQM,GAAQF,GAAOA,EAAIM,OAASf,EAAIe,KAAO,GAAM,IAAMf,EAAIe,MAElFf,EApET,GAAIc,GAAW5C,EAAQ,EACXA,GAAQ,GAAS,uBAM7BL,GAAOD,QAAUsB,IH6NaX,KAAKX,EAAU,WAAa,MAAOI,WAI3D,SAAUH,EAAQD,GItOxB,GAAAuD,GAAA,0OAEAC,GACA,iIAGAvD,GAAAD,QAAA,SAAAyD,GACA,GAAAC,GAAAD,EACAE,EAAAF,EAAAJ,QAAA,KACAO,EAAAH,EAAAJ,QAAA,IAEAM,KAAA,GAAAC,IAAA,IACAH,IAAAI,UAAA,EAAAF,GAAAF,EAAAI,UAAAF,EAAAC,GAAAE,QAAA,UAAwEL,EAAAI,UAAAD,EAAAH,EAAAM,QAOxE,KAJA,GAAAnD,GAAA2C,EAAAS,KAAAP,GAAA,IACAzC,KACAiD,EAAA,GAEAA,KACAjD,EAAAwC,EAAAS,IAAArD,EAAAqD,IAAA,EAUA,OAPAN,KAAA,GAAAC,IAAA,IACA5C,EAAAO,OAAAmC,EACA1C,EAAA+B,KAAA/B,EAAA+B,KAAAc,UAAA,EAAA7C,EAAA+B,KAAAgB,OAAA,GAAAD,QAAA,KAAwE,KACxE9C,EAAAkD,UAAAlD,EAAAkD,UAAAJ,QAAA,QAAAA,QAAA,QAAAA,QAAA,KAAkF,KAClF9C,EAAAmD,SAAA,GAGAnD,IJqPM,SAAUf,EAAQD,GAEvB,YK3RDC,GAAOD,QAAU,WAAc,MAAO,gBLmShC,SAAUC,EAAQD,EAASM,GMnLjC,QAAA8D,MAoCA,QAAAC,GAAAjC,GAGA,GAAAqB,GAAA,GAAArB,EAAAkC,IAwBA,OArBAtE,GAAAuE,eAAAnC,EAAAkC,MAAAtE,EAAAwE,aAAApC,EAAAkC,OACAb,GAAArB,EAAAqC,YAAA,KAKArC,EAAAsC,KAAA,MAAAtC,EAAAsC,MACAjB,GAAArB,EAAAsC,IAAA,KAIA,MAAAtC,EAAA3B,KACAgD,GAAArB,EAAA3B,IAIA,MAAA2B,EAAAuC,OACAlB,GAAAmB,KAAAC,UAAAzC,EAAAuC,OAIAlB,EAaA,QAAAqB,GAAA1C,EAAA2C,GAEA,QAAAC,GAAAC,GACA,GAAAC,GAAAC,EAAAC,kBAAAH,GACAI,EAAAhB,EAAAa,EAAAI,QACAC,EAAAL,EAAAK,OAEAA,GAAAC,QAAAH,GACAN,EAAAQ,GAGAJ,EAAAM,YAAArD,EAAA4C,GAUA,QAAAU,KACAtF,KAAAuF,cAAA,KAwDA,QAAAC,GAAAnC,GACA,GAAAQ,GAAA,EAEAnD,GACAwD,KAAAuB,OAAApC,EAAAT,OAAA,IAGA,UAAAhD,EAAA8F,MAAAhF,EAAAwD,MAAA,MAAAyB,IAGA,IAAA/F,EAAAuE,eAAAzD,EAAAwD,MAAAtE,EAAAwE,aAAA1D,EAAAwD,KAAA,CAEA,IADA,GAAA0B,GAAA,GACA,MAAAvC,EAAAT,SAAAiB,KACA+B,GAAAvC,EAAAT,OAAAiB,GACAA,GAAAR,EAAAM,UAEA,GAAAiC,GAAAH,OAAAG,IAAA,MAAAvC,EAAAT,OAAAiB,GACA,SAAAgC,OAAA,sBAEAnF,GAAA2D,YAAAoB,OAAAG,GAIA,SAAAvC,EAAAT,OAAAiB,EAAA,GAEA,IADAnD,EAAA4D,IAAA,KACAT,GAAA,CACA,GAAApD,GAAA4C,EAAAT,OAAAiB,EACA,UAAApD,EAAA,KAEA,IADAC,EAAA4D,KAAA7D,EACAoD,IAAAR,EAAAM,OAAA,UAGAjD,GAAA4D,IAAA,GAIA,IAAAwB,GAAAzC,EAAAT,OAAAiB,EAAA,EACA,SAAAiC,GAAAL,OAAAK,MAAA,CAEA,IADApF,EAAAL,GAAA,KACAwD,GAAA,CACA,GAAApD,GAAA4C,EAAAT,OAAAiB,EACA,UAAApD,GAAAgF,OAAAhF,MAAA,GACAoD,CACA,OAGA,GADAnD,EAAAL,IAAAgD,EAAAT,OAAAiB,GACAA,IAAAR,EAAAM,OAAA,MAEAjD,EAAAL,GAAAoF,OAAA/E,EAAAL,IASA,MALAgD,GAAAT,SAAAiB,KACAnD,EAAAqF,EAAArF,EAAA2C,EAAA2C,OAAAnC,KAIAnD,EAGA,QAAAqF,GAAArF,EAAA2C,GACA,IACA3C,EAAA6D,KAAAC,KAAAyB,MAAA5C,GACG,MAAAG,GACH,MAAAmC,KAEA,MAAAjF,GAyBA,QAAAwF,GAAAhB,GACAlF,KAAAmG,UAAAjB,EACAlF,KAAAmF,WAkCA,QAAAQ,KACA,OACAzB,KAAAtE,EAAAwG,MACA7B,KAAA,gBAxYA,GACA8B,IADAnG,EAAA,uBACAA,EAAA,IACAoG,EAAApG,EAAA,GACA6E,EAAA7E,EAAA,GACAqG,EAAArG,EAAA,EAQAN,GAAAyC,SAAA,EAQAzC,EAAA8F,OACA,UACA,aACA,QACA,MACA,QACA,eACA,cASA9F,EAAA4G,QAAA,EAQA5G,EAAA6G,WAAA,EAQA7G,EAAA8G,MAAA,EAQA9G,EAAA+G,IAAA,EAQA/G,EAAAwG,MAAA,EAQAxG,EAAAuE,aAAA,EAQAvE,EAAAwE,WAAA,EAQAxE,EAAAoE,UAQApE,EAAA0F,UAoBAtB,EAAA9B,UAAA0E,OAAA,SAAA5E,EAAA2C,GAOA,GANA3C,EAAAkC,OAAAtE,EAAA8G,OAAA1E,EAAAkC,OAAAtE,EAAA+G,MAAAL,EAAAtE,EAAAuC,QACAvC,EAAAkC,KAAAlC,EAAAkC,OAAAtE,EAAA8G,MAAA9G,EAAAuE,aAAAvE,EAAAwE,YAKAxE,EAAAuE,eAAAnC,EAAAkC,MAAAtE,EAAAwE,aAAApC,EAAAkC,KACAQ,EAAA1C,EAAA2C,OAEA,CACA,GAAAkC,GAAA5C,EAAAjC,EACA2C,IAAAkC,MAiFAR,EAAAf,EAAApD,WAUAoD,EAAApD,UAAA4E,IAAA,SAAA9E,GACA,GAAAkD,EACA,oBAAAlD,GACAkD,EAAAM,EAAAxD,GACApC,EAAAuE,eAAAe,EAAAhB,MAAAtE,EAAAwE,aAAAc,EAAAhB,MACAlE,KAAAuF,cAAA,GAAAW,GAAAhB,GAGA,IAAAlF,KAAAuF,cAAAY,UAAA9B,aACArE,KAAA+G,KAAA,UAAA7B,IAGAlF,KAAA+G,KAAA,UAAA7B,OAGA,KAAAqB,EAAAvE,OAAAgF,OAYA,SAAAnB,OAAA,iBAAA7D,EAXA,KAAAhC,KAAAuF,cACA,SAAAM,OAAA,mDAEAX,GAAAlF,KAAAuF,cAAA0B,eAAAjF,GACAkD,IACAlF,KAAAuF,cAAA,KACAvF,KAAA+G,KAAA,UAAA7B,MA4FAI,EAAApD,UAAAgF,QAAA,WACAlH,KAAAuF,eACAvF,KAAAuF,cAAA4B,0BA6BAjB,EAAAhE,UAAA+E,eAAA,SAAAG,GAEA,GADApH,KAAAmF,QAAAkC,KAAAD,GACApH,KAAAmF,QAAAxB,SAAA3D,KAAAmG,UAAA9B,YAAA,CACA,GAAAa,GAAAH,EAAAuC,kBAAAtH,KAAAmG,UAAAnG,KAAAmF,QAEA,OADAnF,MAAAmH,yBACAjC,EAEA,aASAgB,EAAAhE,UAAAiF,uBAAA,WACAnH,KAAAmG,UAAA,KACAnG,KAAAmF,aNmTM,SAAUtF,EAAQD,EAASM,GO3qBjC,QAAAmG,GAAArE,GACA,GAAAA,EAAA,MAAAuF,GAAAvF,GAWA,QAAAuF,GAAAvF,GACA,OAAAwF,KAAAnB,GAAAnE,UACAF,EAAAwF,GAAAnB,EAAAnE,UAAAsF,EAEA,OAAAxF,GAzBAnC,EAAAD,QAAAyG,EAqCAA,EAAAnE,UAAAuF,GACApB,EAAAnE,UAAAwF,iBAAA,SAAAC,EAAAC,GAIA,MAHA5H,MAAA6H,WAAA7H,KAAA6H,gBACA7H,KAAA6H,WAAA,IAAAF,GAAA3H,KAAA6H,WAAA,IAAAF,QACAN,KAAAO,GACA5H,MAaAqG,EAAAnE,UAAA4F,KAAA,SAAAH,EAAAC,GACA,QAAAH,KACAzH,KAAA+H,IAAAJ,EAAAF,GACAG,EAAAI,MAAAhI,KAAAiI,WAKA,MAFAR,GAAAG,KACA5H,KAAAyH,GAAAE,EAAAF,GACAzH,MAaAqG,EAAAnE,UAAA6F,IACA1B,EAAAnE,UAAAgG,eACA7B,EAAAnE,UAAAiG,mBACA9B,EAAAnE,UAAAkG,oBAAA,SAAAT,EAAAC,GAIA,GAHA5H,KAAA6H,WAAA7H,KAAA6H,eAGA,GAAAI,UAAAtE,OAEA,MADA3D,MAAA6H,cACA7H,IAIA,IAAAqI,GAAArI,KAAA6H,WAAA,IAAAF,EACA,KAAAU,EAAA,MAAArI,KAGA,OAAAiI,UAAAtE,OAEA,aADA3D,MAAA6H,WAAA,IAAAF,GACA3H,IAKA,QADAsI,GACAzE,EAAA,EAAiBA,EAAAwE,EAAA1E,OAAsBE,IAEvC,GADAyE,EAAAD,EAAAxE,GACAyE,IAAAV,GAAAU,EAAAV,OAAA,CACAS,EAAAE,OAAA1E,EAAA,EACA,OAGA,MAAA7D,OAWAqG,EAAAnE,UAAA6E,KAAA,SAAAY,GACA3H,KAAA6H,WAAA7H,KAAA6H,cACA,IAAAW,MAAAC,MAAAlI,KAAA0H,UAAA,GACAI,EAAArI,KAAA6H,WAAA,IAAAF,EAEA,IAAAU,EAAA,CACAA,IAAAI,MAAA,EACA,QAAA5E,GAAA,EAAA6E,EAAAL,EAAA1E,OAA2CE,EAAA6E,IAAS7E,EACpDwE,EAAAxE,GAAAmE,MAAAhI,KAAAwI,GAIA,MAAAxI,OAWAqG,EAAAnE,UAAAyG,UAAA,SAAAhB,GAEA,MADA3H,MAAA6H,WAAA7H,KAAA6H,eACA7H,KAAA6H,WAAA,IAAAF,QAWAtB,EAAAnE,UAAA0G,aAAA,SAAAjB,GACA,QAAA3H,KAAA2I,UAAAhB,GAAAhE,SPksBM,SAAU9D,EAAQD,EAASM,IQn2BjC,SAAAsC,GA2BA,QAAAqG,GAAA7G,GACA,IAAAA,GAAA,gBAAAA,GACA,QAGA,IAAA8G,EAAA9G,GAAA,CACA,OAAA6B,GAAA,EAAAkF,EAAA/G,EAAA2B,OAAmCE,EAAAkF,EAAOlF,IAC1C,GAAAgF,EAAA7G,EAAA6B,IACA,QAGA,UAGA,qBAAArB,GAAAwG,QAAAxG,EAAAwG,OAAAC,UAAAzG,EAAAwG,OAAAC,SAAAjH,IACA,kBAAAQ,GAAA0G,aAAAlH,YAAAkH,cACAC,GAAAnH,YAAAoH,OACAC,GAAArH,YAAAsH,MAEA,QAIA,IAAAtH,EAAAuH,QAAA,kBAAAvH,GAAAuH,QAAA,IAAAtB,UAAAtE,OACA,MAAAkF,GAAA7G,EAAAuH,UAAA,EAGA,QAAA/B,KAAAxF,GACA,GAAAwH,OAAAtH,UAAAuH,eAAAlJ,KAAAyB,EAAAwF,IAAAqB,EAAA7G,EAAAwF,IACA,QAIA,UAtDA,GAAAsB,GAAA5I,EAAA,GAEAwJ,EAAAF,OAAAtH,UAAAwH,SACAP,EAAA,kBAAA3G,GAAA4G,MAAA,6BAAAM,EAAAnJ,KAAAiC,EAAA4G,MACAC,EAAA,kBAAA7G,GAAA8G,MAAA,6BAAAI,EAAAnJ,KAAAiC,EAAA8G,KAMAzJ,GAAAD,QAAAiJ,IRo5B8BtI,KAAKX,EAAU,WAAa,MAAOI,WAI3D,SAAUH,EAAQD,GSx6BxB,GAAA8J,MAAiBA,QAEjB7J,GAAAD,QAAA+J,MAAAb,SAAA,SAAAc,GACA,wBAAAF,EAAAnJ,KAAAqJ,KTg7BM,SAAU/J,EAAQD,EAASM,IUn7BjC,SAAAsC,GA+BA,QAAAqH,GAAAtF,EAAAY,GACA,IAAAZ,EAAA,MAAAA,EAEA,IAAAgC,EAAAhC,GAAA,CACA,GAAAuF,IAAuBC,cAAA,EAAAC,IAAA7E,EAAAxB,OAEvB,OADAwB,GAAAkC,KAAA9C,GACAuF,EACG,GAAAhB,EAAAvE,GAAA,CAEH,OADA0F,GAAA,GAAAN,OAAApF,EAAAZ,QACAE,EAAA,EAAmBA,EAAAU,EAAAZ,OAAiBE,IACpCoG,EAAApG,GAAAgG,EAAAtF,EAAAV,GAAAsB,EAEA,OAAA8E,GACG,mBAAA1F,kBAAA2F,OAAA,CACH,GAAAD,KACA,QAAAzC,KAAAjD,GACA0F,EAAAzC,GAAAqC,EAAAtF,EAAAiD,GAAArC,EAEA,OAAA8E,GAEA,MAAA1F,GAkBA,QAAA4F,GAAA5F,EAAAY,GACA,IAAAZ,EAAA,MAAAA,EAEA,IAAAA,KAAAwF,aACA,MAAA5E,GAAAZ,EAAAyF,IACG,IAAAlB,EAAAvE,GACH,OAAAV,GAAA,EAAmBA,EAAAU,EAAAZ,OAAiBE,IACpCU,EAAAV,GAAAsG,EAAA5F,EAAAV,GAAAsB,OAEG,oBAAAZ,GACH,OAAAiD,KAAAjD,GACAA,EAAAiD,GAAA2C,EAAA5F,EAAAiD,GAAArC,EAIA,OAAAZ,GA9EA,GAAAuE,GAAA5I,EAAA,GACAqG,EAAArG,EAAA,GACAwJ,EAAAF,OAAAtH,UAAAwH,SACAP,EAAA,kBAAA3G,GAAA4G,MAAA,6BAAAM,EAAAnJ,KAAAiC,EAAA4G,MACAC,EAAA,kBAAA7G,GAAA8G,MAAA,6BAAAI,EAAAnJ,KAAAiC,EAAA8G,KAYA1J,GAAAoF,kBAAA,SAAAE,GACA,GAAAC,MACAiF,EAAAlF,EAAAX,KACAU,EAAAC,CAGA,OAFAD,GAAAV,KAAAsF,EAAAO,EAAAjF,GACAF,EAAAZ,YAAAc,EAAAxB,QACUuB,OAAAD,EAAAE,YAmCVvF,EAAA0H,kBAAA,SAAApC,EAAAC,GAGA,MAFAD,GAAAX,KAAA4F,EAAAjF,EAAAX,KAAAY,GACAD,EAAAb,YAAAtD,OACAmE,GA+BAtF,EAAAyF,YAAA,SAAAd,EAAAI,GACA,QAAA0F,GAAArI,EAAAsI,EAAAC,GACA,IAAAvI,EAAA,MAAAA,EAGA,IAAAmH,GAAAnH,YAAAoH,OACAC,GAAArH,YAAAsH,MAAA,CACAkB,GAGA,IAAAC,GAAA,GAAAC,WACAD,GAAAE,OAAA,WACAJ,EACAA,EAAAD,GAAAtK,KAAA4K,OAGA/F,EAAA7E,KAAA4K,SAIAJ,GACA7F,EAAAE,IAIA4F,EAAAI,kBAAA7I,OACK,IAAA8G,EAAA9G,GACL,OAAA6B,GAAA,EAAqBA,EAAA7B,EAAA2B,OAAgBE,IACrCwG,EAAArI,EAAA6B,KAAA7B,OAEK,oBAAAA,KAAAuE,EAAAvE,GACL,OAAAwF,KAAAxF,GACAqI,EAAArI,EAAAwF,KAAAxF,GAKA,GAAAwI,GAAA,EACA3F,EAAAN,CACA8F,GAAAxF,GACA2F,GACA7F,EAAAE,MVy7B8BtE,KAAKX,EAAU,WAAa,MAAOI,WAI3D,SAAUH,EAAQD,IAEK,SAAS4C,GWhkCtC,QAAA+D,GAAAvE,GACA,MAAAQ,GAAAwG,QAAAxG,EAAAwG,OAAAC,SAAAjH,IACAQ,EAAA0G,aAAAlH,YAAAkH,aAVArJ,EAAAD,QAAA2G,IXslC8BhG,KAAKX,EAAU,WAAa,MAAOI,WAI3D,SAAUH,EAAQD,EAASM,GAEhC,YY1jCD,SAASyB,GAASf,EAAKC,GACrB,KAAMb,eAAgB2B,IAAU,MAAO,IAAIA,GAAQf,EAAKC,EACpDD,IAAQ,+BAAoBA,GAApB,YAAAE,EAAoBF,MAC9BC,EAAOD,EACPA,EAAMG,QAERF,EAAOA,MAEPA,EAAKO,KAAOP,EAAKO,MAAQ,aACzBpB,KAAKuB,QACLvB,KAAK8K,QACL9K,KAAKa,KAAOA,EACZb,KAAK+K,aAAalK,EAAKkK,gBAAiB,GACxC/K,KAAKgL,qBAAqBnK,EAAKmK,sBAAwBC,KACvDjL,KAAKkL,kBAAkBrK,EAAKqK,mBAAqB,KACjDlL,KAAKmL,qBAAqBtK,EAAKsK,sBAAwB,KACvDnL,KAAKoL,oBAAoBvK,EAAKuK,qBAAuB,IACrDpL,KAAKqL,QAAU,GAAIC,IACjBC,IAAKvL,KAAKkL,oBACVM,IAAKxL,KAAKmL,uBACVM,OAAQzL,KAAKoL,wBAEfpL,KAAK0L,QAAQ,MAAQ7K,EAAK6K,QAAU,IAAQ7K,EAAK6K,SACjD1L,KAAK2L,WAAa,SAClB3L,KAAKY,IAAMA,EACXZ,KAAK4L,cACL5L,KAAK6L,SAAW,KAChB7L,KAAK6G,UAAW,EAChB7G,KAAK8L,eACL,IAAIC,GAAUlL,EAAKsB,QAAUA,CAC7BnC,MAAKgM,QAAU,GAAID,GAAQ/H,QAC3BhE,KAAKiM,QAAU,GAAIF,GAAQzG,QAC3BtF,KAAKkM,YAAcrL,EAAKqL,eAAgB,EACpClM,KAAKkM,aAAalM,KAAKmM,OZ2hC5B,GAAIrL,GAA4B,kBAAXgB,SAAoD,gBAApBA,QAAOC,SAAwB,SAAUC,GAAO,aAAcA,IAAS,SAAUA,GAAO,MAAOA,IAAyB,kBAAXF,SAAyBE,EAAIC,cAAgBH,QAAUE,IAAQF,OAAOI,UAAY,eAAkBF,IY1lCnQoK,EAAMlM,EAAQ,IACdqC,EAASrC,EAAQ,IACjBmG,EAAUnG,EAAQ,GAClBiC,EAASjC,EAAQ,GACjBuH,EAAKvH,EAAQ,IACbmM,EAAOnM,EAAQ,IAEf+C,GADQ/C,EAAQ,GAAS,4BACfA,EAAQ,KAClBoL,EAAUpL,EAAQ,IAMlBoM,EAAM9C,OAAOtH,UAAUuH,cAM3B5J,GAAOD,QAAU+B,EAoDjBA,EAAQO,UAAUqK,QAAU,WAC1BvM,KAAK+G,KAAKiB,MAAMhI,KAAMiI,UACtB,KAAK,GAAI3D,KAAOtE,MAAKuB,KACf+K,EAAI/L,KAAKP,KAAKuB,KAAM+C,IACtBtE,KAAKuB,KAAK+C,GAAKyC,KAAKiB,MAAMhI,KAAKuB,KAAK+C,GAAM2D,YAWhDtG,EAAQO,UAAUsK,gBAAkB,WAClC,IAAK,GAAIlI,KAAOtE,MAAKuB,KACf+K,EAAI/L,KAAKP,KAAKuB,KAAM+C,KACtBtE,KAAKuB,KAAK+C,GAAKjE,GAAKL,KAAKyM,WAAWnI,KAa1C3C,EAAQO,UAAUuK,WAAa,SAAUnI,GACvC,OAAgB,MAARA,EAAc,GAAMA,EAAM,KAAQtE,KAAK0M,OAAOrM,IAOxDgG,EAAQ1E,EAAQO,WAUhBP,EAAQO,UAAU6I,aAAe,SAAU4B,GACzC,MAAK1E,WAAUtE,QACf3D,KAAK4M,gBAAkBD,EAChB3M,MAFuBA,KAAK4M,eAarCjL,EAAQO,UAAU8I,qBAAuB,SAAU2B,GACjD,MAAK1E,WAAUtE,QACf3D,KAAK6M,sBAAwBF,EACtB3M,MAFuBA,KAAK6M,uBAarClL,EAAQO,UAAUgJ,kBAAoB,SAAUyB,GAC9C,MAAK1E,WAAUtE,QACf3D,KAAK8M,mBAAqBH,EAC1B3M,KAAKqL,SAAWrL,KAAKqL,QAAQ0B,OAAOJ,GAC7B3M,MAHuBA,KAAK8M,oBAMrCnL,EAAQO,UAAUkJ,oBAAsB,SAAUuB,GAChD,MAAK1E,WAAUtE,QACf3D,KAAKgN,qBAAuBL,EAC5B3M,KAAKqL,SAAWrL,KAAKqL,QAAQ4B,UAAUN,GAChC3M,MAHuBA,KAAKgN,sBAcrCrL,EAAQO,UAAUiJ,qBAAuB,SAAUwB,GACjD,MAAK1E,WAAUtE,QACf3D,KAAKkN,sBAAwBP,EAC7B3M,KAAKqL,SAAWrL,KAAKqL,QAAQ8B,OAAOR,GAC7B3M,MAHuBA,KAAKkN,uBAarCvL,EAAQO,UAAUwJ,QAAU,SAAUiB,GACpC,MAAK1E,WAAUtE,QACf3D,KAAKoN,SAAWT,EACT3M,MAFuBA,KAAKoN,UAYrCzL,EAAQO,UAAUmL,qBAAuB,YAElCrN,KAAKsN,cAAgBtN,KAAK4M,eAA2C,IAA1B5M,KAAKqL,QAAQkC,UAE3DvN,KAAKwN,aAYT7L,EAAQO,UAAUiK,KAClBxK,EAAQO,UAAUI,QAAU,SAAUsF,EAAI/G,GAExC,IAAKb,KAAK2L,WAAW1I,QAAQ,QAAS,MAAOjD,KAG7CA,MAAK0M,OAASN,EAAIpM,KAAKY,IAAKZ,KAAKa,KACjC,IAAIgB,GAAS7B,KAAK0M,OACde,EAAOzN,IACXA,MAAK2L,WAAa,UAClB3L,KAAK0N,eAAgB,CAGrB,IAAIC,GAAUlG,EAAG5F,EAAQ,OAAQ,WAC/B4L,EAAKG,SACLhG,GAAMA,MAIJiG,EAAWpG,EAAG5F,EAAQ,QAAS,SAAU0C,GAK3C,GAHAkJ,EAAKK,UACLL,EAAK9B,WAAa,SAClB8B,EAAKlB,QAAQ,gBAAiBhI,GAC1BqD,EAAI,CACN,GAAImG,GAAM,GAAIlI,OAAM,mBACpBkI,GAAIxJ,KAAOA,EACXqD,EAAGmG,OAGHN,GAAKJ,wBAKT,KAAI,IAAUrN,KAAKoN,SAAU,CAC3B,GAAI1B,GAAU1L,KAAKoN,SAIfY,EAAQC,WAAW,WAErBN,EAAQzG,UACRrF,EAAOqM,QACPrM,EAAOkF,KAAK,QAAS,WACrB0G,EAAKlB,QAAQ,kBAAmBb,IAC/BA,EAEH1L,MAAK8K,KAAKzD,MACRH,QAAS,WACPiH,aAAaH,MAQnB,MAHAhO,MAAK8K,KAAKzD,KAAKsG,GACf3N,KAAK8K,KAAKzD,KAAKwG,GAER7N,MAST2B,EAAQO,UAAU0L,OAAS,WAIzB5N,KAAK8N,UAGL9N,KAAK2L,WAAa,OAClB3L,KAAK+G,KAAK,OAGV,IAAIlF,GAAS7B,KAAK0M,MAClB1M,MAAK8K,KAAKzD,KAAKI,EAAG5F,EAAQ,OAAQwK,EAAKrM,KAAM,YAC7CA,KAAK8K,KAAKzD,KAAKI,EAAG5F,EAAQ,OAAQwK,EAAKrM,KAAM,YAC7CA,KAAK8K,KAAKzD,KAAKI,EAAG5F,EAAQ,OAAQwK,EAAKrM,KAAM,YAC7CA,KAAK8K,KAAKzD,KAAKI,EAAG5F,EAAQ,QAASwK,EAAKrM,KAAM,aAC9CA,KAAK8K,KAAKzD,KAAKI,EAAG5F,EAAQ,QAASwK,EAAKrM,KAAM,aAC9CA,KAAK8K,KAAKzD,KAAKI,EAAGzH,KAAKiM,QAAS,UAAWI,EAAKrM,KAAM,gBASxD2B,EAAQO,UAAUkM,OAAS,WACzBpO,KAAK6L,SAAW,GAAI3B,MACpBlK,KAAKuM,QAAQ,SASf5K,EAAQO,UAAUmM,OAAS,WACzBrO,KAAKuM,QAAQ,OAAQ,GAAIrC,MAASlK,KAAK6L,WASzClK,EAAQO,UAAUoM,OAAS,SAAU/J,GACnCvE,KAAKiM,QAAQnF,IAAIvC,IASnB5C,EAAQO,UAAUqM,UAAY,SAAUrJ,GACtClF,KAAK+G,KAAK,SAAU7B,IAStBvD,EAAQO,UAAUsM,QAAU,SAAUT,GAEpC/N,KAAKuM,QAAQ,QAASwB,IAUxBpM,EAAQO,UAAUL,OAAS,SAAUyC,EAAKzD,GAiBxC,QAAS4N,MACDxL,EAAQwK,EAAK7B,WAAY/J,IAC7B4L,EAAK7B,WAAWvE,KAAKxF,GAlBzB,GAAIA,GAAS7B,KAAKuB,KAAK+C,EACvB,KAAKzC,EAAQ,CACXA,EAAS,GAAIU,GAAOvC,KAAMsE,EAAKzD,GAC/Bb,KAAKuB,KAAK+C,GAAOzC,CACjB,IAAI4L,GAAOzN,IACX6B,GAAO4F,GAAG,aAAcgH,GACxB5M,EAAO4F,GAAG,UAAW,WACnB5F,EAAOxB,GAAKoN,EAAKhB,WAAWnI,KAG1BtE,KAAKkM,aAEPuC,IAUJ,MAAO5M,IASTF,EAAQO,UAAUgF,QAAU,SAAUrF,GACpC,GAAI6M,GAAQzL,EAAQjD,KAAK4L,WAAY/J,IAChC6M,GAAO1O,KAAK4L,WAAWrD,OAAOmG,EAAO,GACtC1O,KAAK4L,WAAWjI,QAEpB3D,KAAKkO,SAUPvM,EAAQO,UAAUgD,OAAS,SAAUA,GAEnC,GAAIuI,GAAOzN,IACPkF,GAAOtD,OAAyB,IAAhBsD,EAAOhB,OAAYgB,EAAOZ,KAAO,IAAMY,EAAOtD,OAE7D6L,EAAK5G,SAWR4G,EAAK3B,aAAazE,KAAKnC,IATvBuI,EAAK5G,UAAW,EAChB7G,KAAKgM,QAAQpF,OAAO1B,EAAQ,SAAUyJ,GACpC,IAAK,GAAI9K,GAAI,EAAGA,EAAI8K,EAAehL,OAAQE,IACzC4J,EAAKf,OAAOkC,MAAMD,EAAe9K,GAAIqB,EAAO2J,QAE9CpB,GAAK5G,UAAW,EAChB4G,EAAKqB,yBAcXnN,EAAQO,UAAU4M,mBAAqB,WACrC,GAAI9O,KAAK8L,aAAanI,OAAS,IAAM3D,KAAK6G,SAAU,CAClD,GAAI5B,GAAOjF,KAAK8L,aAAaiD,OAC7B/O,MAAKkF,OAAOD,KAUhBtD,EAAQO,UAAU4L,QAAU,WAI1B,IAAK,GADDkB,GAAahP,KAAK8K,KAAKnH,OAClBE,EAAI,EAAGA,EAAImL,EAAYnL,IAAK,CACnC,GAAIoL,GAAMjP,KAAK8K,KAAKiE,OACpBE,GAAI/H,UAGNlH,KAAK8L,gBACL9L,KAAK6G,UAAW,EAChB7G,KAAK6L,SAAW,KAEhB7L,KAAKiM,QAAQ/E,WASfvF,EAAQO,UAAUgM,MAClBvM,EAAQO,UAAUgN,WAAa,WAE7BlP,KAAK0N,eAAgB,EACrB1N,KAAKsN,cAAe,EAChB,YAActN,KAAK2L,YAGrB3L,KAAK8N,UAEP9N,KAAKqL,QAAQ8D,QACbnP,KAAK2L,WAAa,SACd3L,KAAK0M,QAAQ1M,KAAK0M,OAAOwB,SAS/BvM,EAAQO,UAAUkN,QAAU,SAAUC,GAGpCrP,KAAK8N,UACL9N,KAAKqL,QAAQ8D,QACbnP,KAAK2L,WAAa,SAClB3L,KAAK+G,KAAK,QAASsI,GAEfrP,KAAK4M,gBAAkB5M,KAAK0N,eAC9B1N,KAAKwN,aAUT7L,EAAQO,UAAUsL,UAAY,WAC5B,GAAIxN,KAAKsN,cAAgBtN,KAAK0N,cAAe,MAAO1N,KAEpD,IAAIyN,GAAOzN,IAEX,IAAIA,KAAKqL,QAAQkC,UAAYvN,KAAK6M,sBAEhC7M,KAAKqL,QAAQ8D,QACbnP,KAAKuM,QAAQ,oBACbvM,KAAKsN,cAAe,MACf,CACL,GAAIgC,GAAQtP,KAAKqL,QAAQkE,UAGzBvP,MAAKsN,cAAe,CACpB,IAAIU,GAAQC,WAAW,WACjBR,EAAKC,gBAGTD,EAAKlB,QAAQ,oBAAqBkB,EAAKpC,QAAQkC,UAC/CE,EAAKlB,QAAQ,eAAgBkB,EAAKpC,QAAQkC,UAGtCE,EAAKC,eAETD,EAAKtB,KAAK,SAAU4B,GACdA,GAEFN,EAAKH,cAAe,EACpBG,EAAKD,YACLC,EAAKlB,QAAQ,kBAAmBwB,EAAIxJ,OAGpCkJ,EAAK+B,kBAGRF,EAEHtP,MAAK8K,KAAKzD,MACRH,QAAS,WACPiH,aAAaH,QAYrBrM,EAAQO,UAAUsN,YAAc,WAC9B,GAAIC,GAAUzP,KAAKqL,QAAQkC,QAC3BvN,MAAKsN,cAAe,EACpBtN,KAAKqL,QAAQ8D,QACbnP,KAAKwM,kBACLxM,KAAKuM,QAAQ,YAAakD,KZ6lCtB,SAAU5P,EAAQD,EAASM,GavpDjCL,EAAAD,QAAAM,EAAA,Kb+pDM,SAAUL,EAAQD,EAASM,Gc/pDjCL,EAAAD,QAAAM,EAAA,IAQAL,EAAAD,QAAAuC,OAAAjC,EAAA,KduqDM,SAAUL,EAAQD,EAASM,IehrDjC,SAAAsC,GA2BA,QAAAD,GAAA3B,EAAAC,GACA,KAAAb,eAAAuC,IAAA,UAAAA,GAAA3B,EAAAC,EAEAA,SAEAD,GAAA,gBAAAA,KACAC,EAAAD,EACAA,EAAA,MAGAA,GACAA,EAAAkC,EAAAlC,GACAC,EAAA6O,SAAA9O,EAAA+B,KACA9B,EAAA8O,OAAA,UAAA/O,EAAAyB,UAAA,QAAAzB,EAAAyB,SACAxB,EAAAkC,KAAAnC,EAAAmC,KACAnC,EAAAgB,QAAAf,EAAAe,MAAAhB,EAAAgB,QACGf,EAAA8B,OACH9B,EAAA6O,SAAA5M,EAAAjC,EAAA8B,YAGA3C,KAAA2P,OAAA,MAAA9O,EAAA8O,OAAA9O,EAAA8O,OACAnN,EAAAE,UAAA,WAAAA,SAAAL,SAEAxB,EAAA6O,WAAA7O,EAAAkC,OAEAlC,EAAAkC,KAAA/C,KAAA2P,OAAA,YAGA3P,KAAA4P,MAAA/O,EAAA+O,QAAA,EACA5P,KAAA0P,SAAA7O,EAAA6O,WACAlN,EAAAE,kBAAAgN,SAAA,aACA1P,KAAA+C,KAAAlC,EAAAkC,OAAAP,EAAAE,mBAAAK,KACAL,SAAAK,KACA/C,KAAA2P,OAAA,QACA3P,KAAA4B,MAAAf,EAAAe,UACA,gBAAA5B,MAAA4B,QAAA5B,KAAA4B,MAAAiO,EAAAC,OAAA9P,KAAA4B,QACA5B,KAAA+P,SAAA,IAAAlP,EAAAkP,QACA/P,KAAAoB,MAAAP,EAAAO,MAAA,cAAAsC,QAAA,cACA1D,KAAAgQ,aAAAnP,EAAAmP,WACAhQ,KAAAiQ,OAAA,IAAApP,EAAAoP,MACAjQ,KAAAkQ,cAAArP,EAAAqP,YACAlQ,KAAAmQ,aAAAtP,EAAAsP,WACAnQ,KAAAoQ,eAAAvP,EAAAuP,gBAAA,IACApQ,KAAAqQ,kBAAAxP,EAAAwP,kBACArQ,KAAAsQ,WAAAzP,EAAAyP,aAAA,uBACAtQ,KAAAuQ,iBAAA1P,EAAA0P,qBACAvQ,KAAA2L,WAAA,GACA3L,KAAAwQ,eACAxQ,KAAAyQ,cAAA,EACAzQ,KAAA0Q,WAAA7P,EAAA6P,YAAA,IACA1Q,KAAA2Q,gBAAA9P,EAAA8P,kBAAA,EACA3Q,KAAA4Q,WAAA,KACA5Q,KAAA6Q,mBAAAhQ,EAAAgQ,mBACA7Q,KAAA8Q,mBAAA,IAAAjQ,EAAAiQ,oBAAAjQ,EAAAiQ,wBAEA,IAAA9Q,KAAA8Q,oBAAA9Q,KAAA8Q,sBACA9Q,KAAA8Q,mBAAA,MAAA9Q,KAAA8Q,kBAAAC,YACA/Q,KAAA8Q,kBAAAC,UAAA,MAIA/Q,KAAAgR,IAAAnQ,EAAAmQ,KAAA,KACAhR,KAAAwH,IAAA3G,EAAA2G,KAAA,KACAxH,KAAAiR,WAAApQ,EAAAoQ,YAAA,KACAjR,KAAAkR,KAAArQ,EAAAqQ,MAAA,KACAlR,KAAAmR,GAAAtQ,EAAAsQ,IAAA,KACAnR,KAAAoR,QAAAvQ,EAAAuQ,SAAA,KACApR,KAAAqR,mBAAAtQ,SAAAF,EAAAwQ,oBAAAxQ,EAAAwQ,mBACArR,KAAAsR,YAAAzQ,EAAAyQ,SAGA,IAAAC,GAAA,gBAAA/O,KACA+O,GAAA/O,SAAA+O,IACA1Q,EAAA2Q,cAAAhI,OAAAiI,KAAA5Q,EAAA2Q,cAAA7N,OAAA,IACA3D,KAAAwR,aAAA3Q,EAAA2Q,cAGA3Q,EAAA6Q,eACA1R,KAAA0R,aAAA7Q,EAAA6Q,eAKA1R,KAAAK,GAAA,KACAL,KAAA2R,SAAA,KACA3R,KAAA4R,aAAA,KACA5R,KAAA6R,YAAA,KAGA7R,KAAA8R,kBAAA,KACA9R,KAAA+R,iBAAA,KAEA/R,KAAAmM,OAsFA,QAAA6F,GAAAhQ,GACA,GAAAiQ,KACA,QAAApO,KAAA7B,GACAA,EAAAyH,eAAA5F,KACAoO,EAAApO,GAAA7B,EAAA6B,GAGA,OAAAoO,GAhNA,GAAA3B,GAAApQ,EAAA,IACAmG,EAAAnG,EAAA,GAEAwO,GADAxO,EAAA,8BACAA,EAAA,KACAiC,EAAAjC,EAAA,IACA4C,EAAA5C,EAAA,GACAgS,EAAAhS,EAAA,IACA2P,EAAA3P,EAAA,GAMAL,GAAAD,QAAA2C,EAyGAA,EAAA4P,uBAAA,EAMA9L,EAAA9D,EAAAL,WAQAK,EAAAF,SAAAF,EAAAE,SAOAE,WACAA,EAAA6P,UAAAlS,EAAA,IACAqC,EAAA+N,WAAApQ,EAAA,IACAqC,EAAAJ,OAAAjC,EAAA,IAUAqC,EAAAL,UAAAmQ,gBAAA,SAAAC,GAEA,GAAA1Q,GAAAoQ,EAAAhS,KAAA4B,MAGAA,GAAA2Q,IAAApQ,EAAAE,SAGAT,EAAA4Q,UAAAF,CAGA,IAAAzD,GAAA7O,KAAAuQ,iBAAA+B,MAGAtS,MAAAK,KAAAuB,EAAA6Q,IAAAzS,KAAAK,GAEA,IAAAmS,GAAA,GAAAlC,GAAAgC,IACA1Q,QACAC,OAAA7B,KACA4P,MAAAf,EAAAe,OAAA5P,KAAA4P,MACAF,SAAAb,EAAAa,UAAA1P,KAAA0P,SACA3M,KAAA8L,EAAA9L,MAAA/C,KAAA+C,KACA4M,OAAAd,EAAAc,QAAA3P,KAAA2P,OACAvO,KAAAyN,EAAAzN,MAAApB,KAAAoB,KACA4O,WAAAnB,EAAAmB,YAAAhQ,KAAAgQ,WACAC,MAAApB,EAAAoB,OAAAjQ,KAAAiQ,MACAC,YAAArB,EAAAqB,aAAAlQ,KAAAkQ,YACAC,WAAAtB,EAAAsB,YAAAnQ,KAAAmQ,WACAE,kBAAAxB,EAAAwB,mBAAArQ,KAAAqQ,kBACAD,eAAAvB,EAAAuB,gBAAApQ,KAAAoQ,eACAM,WAAA7B,EAAA6B,YAAA1Q,KAAA0Q,WACAM,IAAAnC,EAAAmC,KAAAhR,KAAAgR,IACAxJ,IAAAqH,EAAArH,KAAAxH,KAAAwH,IACAyJ,WAAApC,EAAAoC,YAAAjR,KAAAiR,WACAC,KAAArC,EAAAqC,MAAAlR,KAAAkR,KACAC,GAAAtC,EAAAsC,IAAAnR,KAAAmR,GACAC,QAAAvC,EAAAuC,SAAApR,KAAAoR,QACAC,mBAAAxC,EAAAwC,oBAAArR,KAAAqR,mBACAP,kBAAAjC,EAAAiC,mBAAA9Q,KAAA8Q,kBACAU,aAAA3C,EAAA2C,cAAAxR,KAAAwR,aACAF,UAAAzC,EAAAyC,WAAAtR,KAAAsR,UACAI,aAAA7C,EAAA6C,cAAA1R,KAAA0R,aACAgB,eAAA7D,EAAA6D,gBAAA1S,KAAA0S,eACAC,UAAA9D,EAAA8D,WAAA,QAGA,OAAAH,IAkBAjQ,EAAAL,UAAAiK,KAAA,WACA,GAAAqG,EACA,IAAAxS,KAAA2Q,iBAAApO,EAAA4P,uBAAAnS,KAAAsQ,WAAArN,QAAA,kBACAuP,EAAA,gBACG,QAAAxS,KAAAsQ,WAAA3M,OAAA,CAEH,GAAA8J,GAAAzN,IAIA,YAHAiO,YAAA,WACAR,EAAA1G,KAAA,oCACK,GAGLyL,EAAAxS,KAAAsQ,WAAA,GAEAtQ,KAAA2L,WAAA,SAGA,KACA6G,EAAAxS,KAAAqS,gBAAAG,GACG,MAAAhP,GAGH,MAFAxD,MAAAsQ,WAAAvB,YACA/O,MAAAmM,OAIAqG,EAAArG,OACAnM,KAAA4S,aAAAJ,IASAjQ,EAAAL,UAAA0Q,aAAA,SAAAJ,GAEA,GAAA/E,GAAAzN,IAEAA,MAAAwS,WAEAxS,KAAAwS,UAAArK,qBAIAnI,KAAAwS,YAGAA,EACA/K,GAAA,mBACAgG,EAAAoF,YAEApL,GAAA,kBAAAvC,GACAuI,EAAAqF,SAAA5N,KAEAuC,GAAA,iBAAAjE,GACAiK,EAAAsF,QAAAvP,KAEAiE,GAAA,mBACAgG,EAAAuF,QAAA,sBAWAzQ,EAAAL,UAAA+Q,MAAA,SAAAX,GAQA,QAAAY,KACA,GAAAzF,EAAAoD,mBAAA,CACA,GAAAsC,IAAAnT,KAAAoT,gBAAA3F,EAAA+E,UAAAY,cACAC,MAAAF,EAEAE,IAGAb,EAAAc,OAAqBpP,KAAA,OAAAK,KAAA,WACrBiO,EAAA1K,KAAA,kBAAAyL,GACA,IAAAF,EACA,YAAAE,EAAArP,MAAA,UAAAqP,EAAAhP,KAAA,CAIA,GAFAkJ,EAAA+F,WAAA,EACA/F,EAAA1G,KAAA,YAAAyL,IACAA,EAAA,MACAjQ,GAAA4P,sBAAA,cAAAK,EAAAF,KAGA7E,EAAA+E,UAAAiB,MAAA,WACAJ,GACA,WAAA5F,EAAA9B,aAGAmC,IAEAL,EAAAmF,aAAAJ,GACAA,EAAAc,OAA2BpP,KAAA,aAC3BuJ,EAAA1G,KAAA,UAAAyL,GACAA,EAAA,KACA/E,EAAA+F,WAAA,EACA/F,EAAAiG,eAEO,CAEP,GAAA3F,GAAA,GAAAlI,OAAA,cACAkI,GAAAyE,YAAAF,KACA7E,EAAA1G,KAAA,eAAAgH,OAKA,QAAA4F,KACAN,IAGAA,GAAA,EAEAvF,IAEA0E,EAAAtE,QACAsE,EAAA,MAIA,QAAAhE,GAAAT,GACA,GAAApI,GAAA,GAAAE,OAAA,gBAAAkI,EACApI,GAAA6M,YAAAF,KAEAqB,IAIAlG,EAAA1G,KAAA,eAAApB,GAGA,QAAAiO,KACApF,EAAA,oBAIA,QAAAY,KACAZ,EAAA,iBAIA,QAAAqF,GAAAC,GACAtB,GAAAsB,EAAAxB,OAAAE,EAAAF,MAEAqB,IAKA,QAAA7F,KACA0E,EAAAtK,eAAA,OAAAgL,GACAV,EAAAtK,eAAA,QAAAsG,GACAgE,EAAAtK,eAAA,QAAA0L,GACAnG,EAAAvF,eAAA,QAAAkH,GACA3B,EAAAvF,eAAA,YAAA2L,GA/FA,GAAArB,GAAAxS,KAAAqS,gBAAAC,GAA8CW,MAAA,IAC9CI,GAAA,EACA5F,EAAAzN,IAEAuC,GAAA4P,uBAAA,EA8FAK,EAAA1K,KAAA,OAAAoL,GACAV,EAAA1K,KAAA,QAAA0G,GACAgE,EAAA1K,KAAA,QAAA8L,GAEA5T,KAAA8H,KAAA,QAAAsH,GACApP,KAAA8H,KAAA,YAAA+L,GAEArB,EAAArG,QASA5J,EAAAL,UAAA6R,OAAA,WASA,GAPA/T,KAAA2L,WAAA,OACApJ,EAAA4P,sBAAA,cAAAnS,KAAAwS,UAAAF,KACAtS,KAAA+G,KAAA,QACA/G,KAAA0T,QAIA,SAAA1T,KAAA2L,YAAA3L,KAAA+P,SAAA/P,KAAAwS,UAAAiB,MAEA,OAAA5P,GAAA,EAAAkF,EAAA/I,KAAA2R,SAAAhO,OAA6CE,EAAAkF,EAAOlF,IACpD7D,KAAAiT,MAAAjT,KAAA2R,SAAA9N,KAWAtB,EAAAL,UAAA4Q,SAAA,SAAA5N,GACA,eAAAlF,KAAA2L,YAAA,SAAA3L,KAAA2L,YACA,YAAA3L,KAAA2L,WAQA,OALA3L,KAAA+G,KAAA,SAAA7B,GAGAlF,KAAA+G,KAAA,aAEA7B,EAAAhB,MACA,WACAlE,KAAAgU,YAAA9B,EAAAhN,EAAAX,MACA,MAEA,YACAvE,KAAAiU,UACAjU,KAAA+G,KAAA,OACA,MAEA,aACA,GAAAgH,GAAA,GAAAlI,OAAA,eACAkI,GAAAmG,KAAAhP,EAAAX,KACAvE,KAAA+S,QAAAhF,EACA,MAEA,eACA/N,KAAA+G,KAAA,OAAA7B,EAAAX,MACAvE,KAAA+G,KAAA,UAAA7B,EAAAX,QAeAhC,EAAAL,UAAA8R,YAAA,SAAAzP,GACAvE,KAAA+G,KAAA,YAAAxC,GACAvE,KAAAK,GAAAkE,EAAAkO,IACAzS,KAAAwS,UAAA5Q,MAAA6Q,IAAAlO,EAAAkO,IACAzS,KAAA2R,SAAA3R,KAAAmU,eAAA5P,EAAAoN,UACA3R,KAAA4R,aAAArN,EAAAqN,aACA5R,KAAA6R,YAAAtN,EAAAsN,YACA7R,KAAA+T,SAEA,WAAA/T,KAAA2L,aACA3L,KAAAiU,UAGAjU,KAAAkI,eAAA,YAAAlI,KAAAoU,aACApU,KAAAyH,GAAA,YAAAzH,KAAAoU,eASA7R,EAAAL,UAAAkS,YAAA,SAAA1I,GACAyC,aAAAnO,KAAA+R,iBACA,IAAAtE,GAAAzN,IACAyN,GAAAsE,iBAAA9D,WAAA,WACA,WAAAR,EAAA9B,YACA8B,EAAAuF,QAAA,iBACGtH,GAAA+B,EAAAmE,aAAAnE,EAAAoE,cAUHtP,EAAAL,UAAA+R,QAAA,WACA,GAAAxG,GAAAzN,IACAmO,cAAAV,EAAAqE,mBACArE,EAAAqE,kBAAA7D,WAAA,WAEAR,EAAA4G,OACA5G,EAAA2G,YAAA3G,EAAAoE,cACGpE,EAAAmE,eASHrP,EAAAL,UAAAmS,KAAA,WACA,GAAA5G,GAAAzN,IACAA,MAAAsU,WAAA,kBACA7G,EAAA1G,KAAA,WAUAxE,EAAAL,UAAA2Q,QAAA,WACA7S,KAAAwQ,YAAAjI,OAAA,EAAAvI,KAAAyQ,eAKAzQ,KAAAyQ,cAAA,EAEA,IAAAzQ,KAAAwQ,YAAA7M,OACA3D,KAAA+G,KAAA,SAEA/G,KAAA0T,SAUAnR,EAAAL,UAAAwR,MAAA,WACA,WAAA1T,KAAA2L,YAAA3L,KAAAwS,UAAA+B,WACAvU,KAAAwT,WAAAxT,KAAAwQ,YAAA7M,SAEA3D,KAAAwS,UAAAc,KAAAtT,KAAAwQ,aAGAxQ,KAAAyQ,cAAAzQ,KAAAwQ,YAAA7M,OACA3D,KAAA+G,KAAA,WAcAxE,EAAAL,UAAA0M,MACArM,EAAAL,UAAAoR,KAAA,SAAAC,EAAA1E,EAAAjH,GAEA,MADA5H,MAAAsU,WAAA,UAAAf,EAAA1E,EAAAjH,GACA5H,MAaAuC,EAAAL,UAAAoS,WAAA,SAAApQ,EAAAK,EAAAsK,EAAAjH,GAWA,GAVA,kBAAArD,KACAqD,EAAArD,EACAA,EAAAxD,QAGA,kBAAA8N,KACAjH,EAAAiH,EACAA,EAAA,MAGA,YAAA7O,KAAA2L,YAAA,WAAA3L,KAAA2L,WAAA,CAIAkD,QACAA,EAAA2F,UAAA,IAAA3F,EAAA2F,QAEA,IAAAtP,IACAhB,OACAK,OACAsK,UAEA7O,MAAA+G,KAAA,eAAA7B,GACAlF,KAAAwQ,YAAAnJ,KAAAnC,GACA0C,GAAA5H,KAAA8H,KAAA,QAAAF,GACA5H,KAAA0T,UASAnR,EAAAL,UAAAgM,MAAA,WAqBA,QAAAA,KACAT,EAAAuF,QAAA,gBAEAvF,EAAA+E,UAAAtE,QAGA,QAAAuG,KACAhH,EAAAvF,eAAA,UAAAuM,GACAhH,EAAAvF,eAAA,eAAAuM,GACAvG,IAGA,QAAAwG,KAEAjH,EAAA3F,KAAA,UAAA2M,GACAhH,EAAA3F,KAAA,eAAA2M,GAnCA,eAAAzU,KAAA2L,YAAA,SAAA3L,KAAA2L,WAAA,CACA3L,KAAA2L,WAAA,SAEA,IAAA8B,GAAAzN,IAEAA,MAAAwQ,YAAA7M,OACA3D,KAAA8H,KAAA,mBACA9H,KAAAwT,UACAkB,IAEAxG,MAGKlO,KAAAwT,UACLkB,IAEAxG,IAsBA,MAAAlO,OASAuC,EAAAL,UAAA6Q,QAAA,SAAAhF,GAEAxL,EAAA4P,uBAAA,EACAnS,KAAA+G,KAAA,QAAAgH,GACA/N,KAAAgT,QAAA,kBAAAjF,IASAxL,EAAAL,UAAA8Q,QAAA,SAAA3D,EAAAsF,GACA,eAAA3U,KAAA2L,YAAA,SAAA3L,KAAA2L,YAAA,YAAA3L,KAAA2L,WAAA,CAEA,GAAA8B,GAAAzN,IAGAmO,cAAAnO,KAAA8R,mBACA3D,aAAAnO,KAAA+R,kBAGA/R,KAAAwS,UAAArK,mBAAA,SAGAnI,KAAAwS,UAAAtE,QAGAlO,KAAAwS,UAAArK,qBAGAnI,KAAA2L,WAAA,SAGA3L,KAAAK,GAAA,KAGAL,KAAA+G,KAAA,QAAAsI,EAAAsF,GAIAlH,EAAA+C,eACA/C,EAAAgD,cAAA,IAYAlO,EAAAL,UAAAiS,eAAA,SAAAxC,GAEA,OADAiD,MACA/Q,EAAA,EAAAgR,EAAAlD,EAAAhO,OAAsCE,EAAAgR,EAAOhR,KAC7C6K,EAAA1O,KAAAsQ,WAAAqB,EAAA9N,KAAA+Q,EAAAvN,KAAAsK,EAAA9N,GAEA,OAAA+Q,MfqrD8BrU,KAAKX,EAAU,WAAa,MAAOI,WAI3D,SAAUH,EAAQD,EAASM,IgB/5EjC,SAAAsC,GAuBA,QAAAsS,GAAAjU,GACA,GAAAkU,GACAC,GAAA,EACAC,GAAA,EACAhF,GAAA,IAAApP,EAAAoP,KAEA,IAAAzN,EAAAE,SAAA,CACA,GAAAwS,GAAA,WAAAxS,SAAAL,SACAU,EAAAL,SAAAK,IAGAA,KACAA,EAAAmS,EAAA,QAGAF,EAAAnU,EAAA6O,WAAAhN,SAAAgN,UAAA3M,IAAAlC,EAAAkC,KACAkS,EAAApU,EAAA8O,SAAAuF,EAOA,GAJArU,EAAAsU,QAAAH,EACAnU,EAAAuU,QAAAH,EACAF,EAAA,GAAAM,GAAAxU,GAEA,QAAAkU,KAAAlU,EAAAmP,WACA,UAAAsF,GAAAzU,EAEA,KAAAoP,EAAA,SAAApK,OAAA,iBACA,WAAA0P,GAAA1U,GA9CA,GAAAwU,GAAAnV,EAAA,IACAoV,EAAApV,EAAA,IACAqV,EAAArV,EAAA,IACAsV,EAAAtV,EAAA,GAMAN,GAAAkV,UACAlV,EAAA4V,chBy8E8BjV,KAAKX,EAAU,WAAa,MAAOI,WAI3D,SAAUH,EAAQD,EAASM,IiB39EjC,SAAAsC,GAEA,GAAAiT,GAAAvV,EAAA,GAEAL,GAAAD,QAAA,SAAAiB,GACA,GAAAsU,GAAAtU,EAAAsU,QAIAC,EAAAvU,EAAAuU,QAIAjF,EAAAtP,EAAAsP,UAGA,KACA,sBAAAkF,mBAAAF,GAAAM,GACA,UAAAJ,gBAEG,MAAA7R,IAKH,IACA,sBAAAkS,kBAAAN,GAAAjF,EACA,UAAAuF,gBAEG,MAAAlS,IAEH,IAAA2R,EACA,IACA,WAAA3S,GAAA,UAAAmT,OAAA,UAAAC,KAAA,4BACK,MAAApS,QjBi+EyBjD,KAAKX,EAAU,WAAa,MAAOI,WAI3D,SAAUH,EAAQD,GkB9/ExB,IACAC,EAAAD,QAAA,mBAAAyV,iBACA,uBAAAA,gBACC,MAAAtH,GAGDlO,EAAAD,SAAA,IlB+gFM,SAAUC,EAAQD,EAASM,ImB9hFjC,SAAAsC,GAqBA,QAAAqT,MASA,QAAAP,GAAAzU,GAKA,GAJAiV,EAAAvV,KAAAP,KAAAa,GACAb,KAAA0S,eAAA7R,EAAA6R,eACA1S,KAAAwR,aAAA3Q,EAAA2Q,aAEAhP,EAAAE,SAAA,CACA,GAAAwS,GAAA,WAAAxS,SAAAL,SACAU,EAAAL,SAAAK,IAGAA,KACAA,EAAAmS,EAAA,QAGAlV,KAAAgV,GAAAnU,EAAA6O,WAAAlN,EAAAE,SAAAgN,UACA3M,IAAAlC,EAAAkC,KACA/C,KAAAiV,GAAApU,EAAA8O,SAAAuF,GA6FA,QAAAa,GAAAlV,GACAb,KAAAgW,OAAAnV,EAAAmV,QAAA,MACAhW,KAAAY,IAAAC,EAAAD,IACAZ,KAAAgV,KAAAnU,EAAAmU,GACAhV,KAAAiV,KAAApU,EAAAoU,GACAjV,KAAAiW,OAAA,IAAApV,EAAAoV,MACAjW,KAAAuE,KAAAxD,SAAAF,EAAA0D,KAAA1D,EAAA0D,KAAA,KACAvE,KAAA4P,MAAA/O,EAAA+O,MACA5P,KAAAkW,SAAArV,EAAAqV,SACAlW,KAAAoT,eAAAvS,EAAAuS,eACApT,KAAAmQ,WAAAtP,EAAAsP,WACAnQ,KAAA0S,eAAA7R,EAAA6R,eAGA1S,KAAAgR,IAAAnQ,EAAAmQ,IACAhR,KAAAwH,IAAA3G,EAAA2G,IACAxH,KAAAiR,WAAApQ,EAAAoQ,WACAjR,KAAAkR,KAAArQ,EAAAqQ,KACAlR,KAAAmR,GAAAtQ,EAAAsQ,GACAnR,KAAAoR,QAAAvQ,EAAAuQ,QACApR,KAAAqR,mBAAAxQ,EAAAwQ,mBAGArR,KAAAwR,aAAA3Q,EAAA2Q,aAEAxR,KAAAmW,SAkPA,QAAAC,KACA,OAAAvS,KAAAkS,GAAAM,SACAN,EAAAM,SAAA5M,eAAA5F,IACAkS,EAAAM,SAAAxS,GAAAyS,QArZA,GAAAjB,GAAAnV,EAAA,IACA4V,EAAA5V,EAAA,IACAmG,EAAAnG,EAAA,GACAqW,EAAArW,EAAA,GACAA,GAAA,kCAMAL,GAAAD,QAAA0V,EACAzV,EAAAD,QAAAmW,UAuCAQ,EAAAjB,EAAAQ,GAMAR,EAAApT,UAAAkR,gBAAA,EASAkC,EAAApT,UAAAsU,QAAA,SAAA3V,GAsBA,MArBAA,SACAA,EAAAD,IAAAZ,KAAAY,MACAC,EAAAmU,GAAAhV,KAAAgV,GACAnU,EAAAoU,GAAAjV,KAAAiV,GACApU,EAAA+O,MAAA5P,KAAA4P,QAAA,EACA/O,EAAAuS,eAAApT,KAAAoT,eACAvS,EAAAsP,WAAAnQ,KAAAmQ,WAGAtP,EAAAmQ,IAAAhR,KAAAgR,IACAnQ,EAAA2G,IAAAxH,KAAAwH,IACA3G,EAAAoQ,WAAAjR,KAAAiR,WACApQ,EAAAqQ,KAAAlR,KAAAkR,KACArQ,EAAAsQ,GAAAnR,KAAAmR,GACAtQ,EAAAuQ,QAAApR,KAAAoR,QACAvQ,EAAAwQ,mBAAArR,KAAAqR,mBACAxQ,EAAA6R,eAAA1S,KAAA0S,eAGA7R,EAAA2Q,aAAAxR,KAAAwR,aAEA,GAAAuE,GAAAlV,IAWAyU,EAAApT,UAAAuU,QAAA,SAAAlS,EAAAqD,GACA,GAAAsO,GAAA,gBAAA3R,IAAAxD,SAAAwD,EACAmS,EAAA1W,KAAAwW,SAA0BR,OAAA,OAAAzR,OAAA2R,aAC1BzI,EAAAzN,IACA0W,GAAAjP,GAAA,UAAAG,GACA8O,EAAAjP,GAAA,iBAAAsG,GACAN,EAAAsF,QAAA,iBAAAhF,KAEA/N,KAAA2W,QAAAD,GASApB,EAAApT,UAAA0U,OAAA,WAEA,GAAAF,GAAA1W,KAAAwW,UACA/I,EAAAzN,IACA0W,GAAAjP,GAAA,gBAAAlD,GACAkJ,EAAAoJ,OAAAtS,KAEAmS,EAAAjP,GAAA,iBAAAsG,GACAN,EAAAsF,QAAA,iBAAAhF,KAEA/N,KAAA8W,QAAAJ,GA0CArQ,EAAA0P,EAAA7T,WAQA6T,EAAA7T,UAAAiU,OAAA,WACA,GAAAtV,IAAc+O,MAAA5P,KAAA4P,MAAAuF,QAAAnV,KAAAgV,GAAAI,QAAApV,KAAAiV,GAAA9E,WAAAnQ,KAAAmQ,WAGdtP,GAAAmQ,IAAAhR,KAAAgR,IACAnQ,EAAA2G,IAAAxH,KAAAwH,IACA3G,EAAAoQ,WAAAjR,KAAAiR,WACApQ,EAAAqQ,KAAAlR,KAAAkR,KACArQ,EAAAsQ,GAAAnR,KAAAmR,GACAtQ,EAAAuQ,QAAApR,KAAAoR,QACAvQ,EAAAwQ,mBAAArR,KAAAqR,kBAEA,IAAA0D,GAAA/U,KAAA+U,IAAA,GAAAM,GAAAxU,GACA4M,EAAAzN,IAEA,KAEA+U,EAAA5I,KAAAnM,KAAAgW,OAAAhW,KAAAY,IAAAZ,KAAAiW,MACA,KACA,GAAAjW,KAAAwR,aAAA,CACAuD,EAAAgC,uBAAAhC,EAAAgC,uBAAA,EACA,QAAAlT,KAAA7D,MAAAwR,aACAxR,KAAAwR,aAAA/H,eAAA5F,IACAkR,EAAAiC,iBAAAnT,EAAA7D,KAAAwR,aAAA3N,KAIK,MAAAL,IAEL,YAAAxD,KAAAgW,OACA,IACAhW,KAAAkW,SACAnB,EAAAiC,iBAAA,2CAEAjC,EAAAiC,iBAAA,2CAEO,MAAAxT,IAGP,IACAuR,EAAAiC,iBAAA,gBACK,MAAAxT,IAGL,mBAAAuR,KACAA,EAAAkC,iBAAA,GAGAjX,KAAA0S,iBACAqC,EAAArJ,QAAA1L,KAAA0S,gBAGA1S,KAAAkX,UACAnC,EAAApK,OAAA,WACA8C,EAAA0J,UAEApC,EAAAvG,QAAA,WACAf,EAAAsF,QAAAgC,EAAAqC,gBAGArC,EAAAsC,mBAAA,WACA,OAAAtC,EAAApJ,WAAA,CACA,GAAA2L,EACA,KACAA,EAAAvC,EAAAwC,kBAAA,gBACW,MAAA/T,IACX,6BAAA8T,IACAvC,EAAAyC,aAAA,eAGA,IAAAzC,EAAApJ,aACA,MAAAoJ,EAAA0C,QAAA,OAAA1C,EAAA0C,OACAhK,EAAA0J,SAIAlJ,WAAA,WACAR,EAAAsF,QAAAgC,EAAA0C,SACW,KAMX1C,EAAAzB,KAAAtT,KAAAuE,MACG,MAAAf,GAOH,WAHAyK,YAAA,WACAR,EAAAsF,QAAAvP,IACK,GAILhB,EAAAkV,WACA1X,KAAA0O,MAAAqH,EAAA4B,gBACA5B,EAAAM,SAAArW,KAAA0O,OAAA1O,OAUA+V,EAAA7T,UAAA0V,UAAA,WACA5X,KAAA+G,KAAA,WACA/G,KAAA8N,WASAiI,EAAA7T,UAAA2U,OAAA,SAAAtS,GACAvE,KAAA+G,KAAA,OAAAxC,GACAvE,KAAA4X,aASA7B,EAAA7T,UAAA6Q,QAAA,SAAAhF,GACA/N,KAAA+G,KAAA,QAAAgH,GACA/N,KAAA8N,SAAA,IASAiI,EAAA7T,UAAA4L,QAAA,SAAA+J,GACA,sBAAA7X,MAAA+U,KAAA,OAAA/U,KAAA+U,IAAA,CAUA,GANA/U,KAAAkX,SACAlX,KAAA+U,IAAApK,OAAA3K,KAAA+U,IAAAvG,QAAAqH,EAEA7V,KAAA+U,IAAAsC,mBAAAxB,EAGAgC,EACA,IACA7X,KAAA+U,IAAAuB,QACK,MAAA9S,IAGLhB,EAAAkV,gBACA3B,GAAAM,SAAArW,KAAA0O,OAGA1O,KAAA+U,IAAA,OASAgB,EAAA7T,UAAAiV,OAAA,WACA,GAAA5S,EACA,KACA,GAAA+S,EACA,KACAA,EAAAtX,KAAA+U,IAAAwC,kBAAA,gBACK,MAAA/T,IAELe,EADA,6BAAA+S,EACAtX,KAAA+U,IAAA+C,UAAA9X,KAAA+U,IAAAqC,aAEApX,KAAA+U,IAAAqC,aAEG,MAAA5T,GACHxD,KAAA+S,QAAAvP,GAEA,MAAAe,GACAvE,KAAA6W,OAAAtS,IAUAwR,EAAA7T,UAAAgV,OAAA,WACA,yBAAA1U,GAAAkT,iBAAA1V,KAAAiV,IAAAjV,KAAAmQ,YASA4F,EAAA7T,UAAAoU,MAAA,WACAtW,KAAA8N,WASAiI,EAAA4B,cAAA,EACA5B,EAAAM,YAEA7T,EAAAkV,WACAlV,EAAAuV,YACAvV,EAAAuV,YAAA,WAAA3B,GACG5T,EAAAkF,kBACHlF,EAAAkF,iBAAA,eAAA0O,GAAA,MnB4iF8B7V,KAAKX,EAAU,WAAa,MAAOI,WAI3D,SAAUH,EAAQD,EAASM,GoBh6FjC,QAAA4V,GAAAjV,GACA,GAAAqP,GAAArP,KAAAqP,WACA8H,KAAA9H,IACAlQ,KAAAoT,gBAAA,GAEAhB,EAAA7R,KAAAP,KAAAa,GAnCA,GAAAuR,GAAAlS,EAAA,IACA2P,EAAA3P,EAAA,IACAiC,EAAAjC,EAAA,IACAqW,EAAArW,EAAA,IACA+X,EAAA/X,EAAA,GACAA,GAAA,8BAMAL,GAAAD,QAAAkW,CAMA,IAAAkC,GAAA,WACA,GAAA3C,GAAAnV,EAAA,IACA6U,EAAA,GAAAM,IAAgCF,SAAA,GAChC,cAAAJ,EAAAyC,eAsBAjB,GAAAT,EAAA1D,GAMA0D,EAAA5T,UAAAoQ,KAAA,UASAwD,EAAA5T,UAAAgW,OAAA,WACAlY,KAAAmY,QAUArC,EAAA5T,UAAAuR,MAAA,SAAA2E,GAKA,QAAA3E,KAEAhG,EAAA9B,WAAA,SACAyM,IAPA,GAAA3K,GAAAzN,IAUA,IARAA,KAAA2L,WAAA,UAQA3L,KAAA8U,UAAA9U,KAAAuU,SAAA,CACA,GAAA8D,GAAA,CAEArY,MAAA8U,UAEAuD,IACArY,KAAA8H,KAAA,4BAEAuQ,GAAA5E,OAIAzT,KAAAuU,WAEA8D,IACArY,KAAA8H,KAAA,qBAEAuQ,GAAA5E,WAIAA,MAUAqC,EAAA5T,UAAAiW,KAAA,WAEAnY,KAAA8U,SAAA,EACA9U,KAAA4W,SACA5W,KAAA+G,KAAA,SASA+O,EAAA5T,UAAA2U,OAAA,SAAAtS,GACA,GAAAkJ,GAAAzN,KAEA2E,EAAA,SAAAO,EAAAwJ,EAAA2J,GAOA,MALA,YAAA5K,EAAA9B,YACA8B,EAAAsG,SAIA,UAAA7O,EAAAhB,MACAuJ,EAAAuF,WACA,OAIAvF,GAAAqF,SAAA5N,GAIA/C,GAAAmW,cAAA/T,EAAAvE,KAAA6B,OAAA+O,WAAAjM,GAGA,WAAA3E,KAAA2L,aAEA3L,KAAA8U,SAAA,EACA9U,KAAA+G,KAAA,gBAEA,SAAA/G,KAAA2L,YACA3L,KAAAmY,SAaArC,EAAA5T,UAAAqW,QAAA,WAGA,QAAArK,KAEAT,EAAAmB,QAAiB1K,KAAA,WAJjB,GAAAuJ,GAAAzN,IAOA,UAAAA,KAAA2L,WAEAuC,IAKAlO,KAAA8H,KAAA,OAAAoG,IAYA4H,EAAA5T,UAAA0M,MAAA,SAAA4J,GACA,GAAA/K,GAAAzN,IACAA,MAAAuU,UAAA,CACA,IAAAkE,GAAA,WACAhL,EAAA8G,UAAA,EACA9G,EAAA1G,KAAA,SAGA5E,GAAAuW,cAAAF,EAAAxY,KAAAoT,eAAA,SAAA7O,GACAkJ,EAAAgJ,QAAAlS,EAAAkU,MAUA3C,EAAA5T,UAAAtB,IAAA,WACA,GAAAgB,GAAA5B,KAAA4B,UACA+W,EAAA3Y,KAAA2P,OAAA,eACA5M,EAAA,IAGA,IAAA/C,KAAAqQ,oBACAzO,EAAA5B,KAAAoQ,gBAAA6H,KAGAjY,KAAAoT,gBAAAxR,EAAA6Q,MACA7Q,EAAAgX,IAAA,GAGAhX,EAAAiO,EAAAjJ,OAAAhF,GAGA5B,KAAA+C,OAAA,UAAA4V,GAAA,MAAAlT,OAAAzF,KAAA+C,OACA,SAAA4V,GAAA,KAAAlT,OAAAzF,KAAA+C,SACAA,EAAA,IAAA/C,KAAA+C,MAIAnB,EAAA+B,SACA/B,EAAA,IAAAA,EAGA,IAAAoB,GAAAhD,KAAA0P,SAAAzM,QAAA,SACA,OAAA0V,GAAA,OAAA3V,EAAA,IAAAhD,KAAA0P,SAAA,IAAA1P,KAAA0P,UAAA3M,EAAA/C,KAAAoB,KAAAQ,IpB08FM,SAAU/B,EAAQD,EAASM,GqBzqGjC,QAAAkS,GAAAvR,GACAb,KAAAoB,KAAAP,EAAAO,KACApB,KAAA0P,SAAA7O,EAAA6O,SACA1P,KAAA+C,KAAAlC,EAAAkC,KACA/C,KAAA2P,OAAA9O,EAAA8O,OACA3P,KAAA4B,MAAAf,EAAAe,MACA5B,KAAAoQ,eAAAvP,EAAAuP,eACApQ,KAAAqQ,kBAAAxP,EAAAwP,kBACArQ,KAAA2L,WAAA,GACA3L,KAAA4P,MAAA/O,EAAA+O,QAAA,EACA5P,KAAA6B,OAAAhB,EAAAgB,OACA7B,KAAAmQ,WAAAtP,EAAAsP,WAGAnQ,KAAAgR,IAAAnQ,EAAAmQ,IACAhR,KAAAwH,IAAA3G,EAAA2G,IACAxH,KAAAiR,WAAApQ,EAAAoQ,WACAjR,KAAAkR,KAAArQ,EAAAqQ,KACAlR,KAAAmR,GAAAtQ,EAAAsQ,GACAnR,KAAAoR,QAAAvQ,EAAAuQ,QACApR,KAAAqR,mBAAAxQ,EAAAwQ,mBACArR,KAAAsR,UAAAzQ,EAAAyQ,UAGAtR,KAAAwR,aAAA3Q,EAAA2Q,aACAxR,KAAA0R,aAAA7Q,EAAA6Q,aAzCA,GAAAvP,GAAAjC,EAAA,IACAmG,EAAAnG,EAAA,EAMAL,GAAAD,QAAAwS,EAyCA/L,EAAA+L,EAAAlQ,WAUAkQ,EAAAlQ,UAAA6Q,QAAA,SAAAQ,EAAAoB,GACA,GAAA5G,GAAA,GAAAlI,OAAA0N,EAIA,OAHAxF,GAAA7J,KAAA,iBACA6J,EAAA8K,YAAAlE,EACA3U,KAAA+G,KAAA,QAAAgH,GACA/N,MASAoS,EAAAlQ,UAAAiK,KAAA,WAMA,MALA,WAAAnM,KAAA2L,YAAA,KAAA3L,KAAA2L,aACA3L,KAAA2L,WAAA,UACA3L,KAAAkY,UAGAlY,MASAoS,EAAAlQ,UAAAgM,MAAA,WAMA,MALA,YAAAlO,KAAA2L,YAAA,SAAA3L,KAAA2L,aACA3L,KAAAuY,UACAvY,KAAAgT,WAGAhT,MAUAoS,EAAAlQ,UAAAoR,KAAA,SAAAkF,GACA,YAAAxY,KAAA2L,WAGA,SAAA9F,OAAA,qBAFA7F,MAAA4O,MAAA4J,IAYApG,EAAAlQ,UAAA6R,OAAA,WACA/T,KAAA2L,WAAA;AACA3L,KAAAuU,UAAA,EACAvU,KAAA+G,KAAA,SAUAqL,EAAAlQ,UAAA2U,OAAA,SAAAtS,GACA,GAAAW,GAAA/C,EAAA2W,aAAAvU,EAAAvE,KAAA6B,OAAA+O,WACA5Q,MAAA8S,SAAA5N,IAOAkN,EAAAlQ,UAAA4Q,SAAA,SAAA5N,GACAlF,KAAA+G,KAAA,SAAA7B,IASAkN,EAAAlQ,UAAA8Q,QAAA,WACAhT,KAAA2L,WAAA,SACA3L,KAAA+G,KAAA,WrBqsGM,SAAUlH,EAAQD,EAASM,IsBh2GjC,SAAAsC,GA8HA,QAAAuW,GAAA7T,EAAAP,GAEA,GAAAqU,GAAA,IAAApZ,EAAA4Y,QAAAtT,EAAAhB,MAAAgB,EAAAX,SACA,OAAAI,GAAAqU,GAOA,QAAAC,GAAA/T,EAAAkO,EAAAzO,GACA,IAAAyO,EACA,MAAAxT,GAAAsZ,mBAAAhU,EAAAP,EAGA,IAAAJ,GAAAW,EAAAX,KACA4U,EAAA,GAAAC,YAAA7U,GACA8U,EAAA,GAAAD,YAAA,EAAA7U,EAAA+U,WAEAD,GAAA,GAAAb,EAAAtT,EAAAhB,KACA,QAAAL,GAAA,EAAiBA,EAAAsV,EAAAxV,OAAyBE,IAC1CwV,EAAAxV,EAAA,GAAAsV,EAAAtV,EAGA,OAAAc,GAAA0U,EAAAE,QAGA,QAAAC,GAAAtU,EAAAkO,EAAAzO,GACA,IAAAyO,EACA,MAAAxT,GAAAsZ,mBAAAhU,EAAAP,EAGA,IAAA8U,GAAA,GAAA/O,WAKA,OAJA+O,GAAA9O,OAAA,WACAzF,EAAAX,KAAAkV,EAAA7O,OACAhL,EAAA8Z,aAAAxU,EAAAkO,GAAA,EAAAzO,IAEA8U,EAAA5O,kBAAA3F,EAAAX,MAGA,QAAAoV,GAAAzU,EAAAkO,EAAAzO,GACA,IAAAyO,EACA,MAAAxT,GAAAsZ,mBAAAhU,EAAAP,EAGA,IAAAiV,EACA,MAAAJ,GAAAtU,EAAAkO,EAAAzO,EAGA,IAAAhB,GAAA,GAAAyV,YAAA,EACAzV,GAAA,GAAA6U,EAAAtT,EAAAhB,KACA,IAAA2V,GAAA,GAAAzQ,IAAAzF,EAAA4V,OAAArU,EAAAX,MAEA,OAAAI,GAAAkV,GAkFA,QAAAC,GAAAvV,GACA,IACAA,EAAAwV,EAAAjK,OAAAvL,GAA8ByV,QAAA,IAC3B,MAAAxW,GACH,SAEA,MAAAe,GAgFA,QAAA0V,GAAAC,EAAAC,EAAAC,GAWA,OAVAxP,GAAA,GAAAjB,OAAAuQ,EAAAvW,QACAmC,EAAAuU,EAAAH,EAAAvW,OAAAyW,GAEAE,EAAA,SAAAzW,EAAA0W,EAAAjS,GACA6R,EAAAI,EAAA,SAAA5U,EAAA4N,GACA3I,EAAA/G,GAAA0P,EACAjL,EAAA3C,EAAAiF,MAIA/G,EAAA,EAAiBA,EAAAqW,EAAAvW,OAAgBE,IACjCyW,EAAAzW,EAAAqW,EAAArW,GAAAiC,GAnWA,GAMA0U,GANA/I,EAAAvR,EAAA,IACA2I,EAAA3I,EAAA,GACAua,EAAAva,EAAA,IACAma,EAAAna,EAAA,IACA6Z,EAAA7Z,EAAA,GAGAsC,MAAA0G,cACAsR,EAAAta,EAAA,IAUA,IAAAwa,GAAA,mBAAAC,YAAA,WAAA9X,KAAA8X,UAAAC,WAQAC,EAAA,mBAAAF,YAAA,aAAA9X,KAAA8X,UAAAC,WAMAhB,EAAAc,GAAAG,CAMAjb,GAAAyC,SAAA,CAMA,IAAAmW,GAAA5Y,EAAA4Y,SACArM,KAAA,EACA+B,MAAA,EACAmG,KAAA,EACAyG,KAAA,EACA9B,QAAA,EACAjJ,QAAA,EACAgL,KAAA,GAGAC,EAAAvJ,EAAA+G,GAMAzK,GAAW7J,KAAA,QAAAK,KAAA,gBAMX6E,EAAAlJ,EAAA,GAkBAN,GAAA8Z,aAAA,SAAAxU,EAAAkO,EAAA6H,EAAAtW,GACA,kBAAAyO,KACAzO,EAAAyO,EACAA,GAAA,GAGA,kBAAA6H,KACAtW,EAAAsW,EACAA,EAAA,KAGA,IAAA1W,GAAAxD,SAAAmE,EAAAX,KACAxD,OACAmE,EAAAX,KAAAgV,QAAArU,EAAAX,IAEA,IAAA/B,EAAA0G,aAAA3E,YAAA2E,aACA,MAAA+P,GAAA/T,EAAAkO,EAAAzO,EACG,IAAAyE,GAAA7E,YAAA/B,GAAA4G,KACH,MAAAuQ,GAAAzU,EAAAkO,EAAAzO,EAIA,IAAAJ,KAAAyC,OACA,MAAA+R,GAAA7T,EAAAP,EAIA,IAAAuW,GAAA1C,EAAAtT,EAAAhB,KAOA,OAJAnD,UAAAmE,EAAAX,OACA2W,GAAAD,EAAAlB,EAAAnT,OAAAuU,OAAAjW,EAAAX,OAA8DyV,QAAA,IAAgBmB,OAAAjW,EAAAX,OAG9EI,EAAA,GAAAuW,IAmEAtb,EAAAsZ,mBAAA,SAAAhU,EAAAP,GACA,GAAAqU,GAAA,IAAApZ,EAAA4Y,QAAAtT,EAAAhB,KACA,IAAAkF,GAAAlE,EAAAX,eAAA/B,GAAA4G,KAAA,CACA,GAAAqQ,GAAA,GAAA/O,WAKA,OAJA+O,GAAA9O,OAAA,WACA,GAAAiO,GAAAa,EAAA7O,OAAAwQ,MAAA,OACAzW,GAAAqU,EAAAJ,IAEAa,EAAA4B,cAAAnW,EAAAX,MAGA,GAAA+W,EACA,KACAA,EAAAH,OAAAI,aAAAvT,MAAA,QAAAoR,YAAAlU,EAAAX,OACG,MAAAf,GAIH,OAFAgY,GAAA,GAAApC,YAAAlU,EAAAX,MACAkX,EAAA,GAAA9R,OAAA6R,EAAA7X,QACAE,EAAA,EAAmBA,EAAA2X,EAAA7X,OAAkBE,IACrC4X,EAAA5X,GAAA2X,EAAA3X,EAEAyX,GAAAH,OAAAI,aAAAvT,MAAA,KAAAyT,GAGA,MADAzC,IAAAxW,EAAAkZ,KAAAJ,GACA3W,EAAAqU,IAUApZ,EAAAkZ,aAAA,SAAAvU,EAAAqM,EAAA+K,GACA,GAAA5a,SAAAwD,EACA,MAAAwJ,EAGA,oBAAAxJ,GAAA,CACA,SAAAA,EAAA3B,OAAA,GACA,MAAAhD,GAAAgc,mBAAArX,EAAAyB,OAAA,GAAA4K,EAGA,IAAA+K,IACApX,EAAAuV,EAAAvV,GACAA,KAAA,GACA,MAAAwJ,EAGA,IAAA7J,GAAAK,EAAA3B,OAAA,EAEA,OAAA6C,QAAAvB,OAAA8W,EAAA9W,GAIAK,EAAAZ,OAAA,GACcO,KAAA8W,EAAA9W,GAAAK,OAAAd,UAAA,KAEAS,KAAA8W,EAAA9W,IANd6J,EAUA,GAAA8N,GAAA,GAAAzC,YAAA7U,GACAL,EAAA2X,EAAA,GACAC,EAAArB,EAAAlW,EAAA,EAIA,OAHA6E,IAAA,SAAAwH,IACAkL,EAAA,GAAA1S,IAAA0S,MAEU5X,KAAA8W,EAAA9W,GAAAK,KAAAuX,IAmBVlc,EAAAgc,mBAAA,SAAArI,EAAA3C,GACA,GAAA1M,GAAA8W,EAAAzH,EAAA3Q,OAAA,GACA,KAAA4X,EACA,OAAYtW,OAAAK,MAAoByC,QAAA,EAAAzC,KAAAgP,EAAAvN,OAAA,IAGhC,IAAAzB,GAAAiW,EAAA1K,OAAAyD,EAAAvN,OAAA,GAMA,OAJA,SAAA4K,GAAAxH,IACA7E,EAAA,GAAA6E,IAAA7E,MAGUL,OAAAK,SAmBV3E,EAAA8Y,cAAA,SAAAF,EAAApF,EAAAzO,GAoBA,QAAAoX,GAAA/C,GACA,MAAAA,GAAArV,OAAA,IAAAqV,EAGA,QAAAgD,GAAA9W,EAAA+W,GACArc,EAAA8Z,aAAAxU,IAAAgR,GAAA9C,GAAA,WAAA4F,GACAiD,EAAA,KAAAF,EAAA/C,MAzBA,kBAAA5F,KACAzO,EAAAyO,EACAA,EAAA,KAGA,IAAA8C,GAAArN,EAAA2P,EAEA,OAAApF,IAAA8C,EACA9M,IAAAwQ,EACAha,EAAAsc,oBAAA1D,EAAA7T,GAGA/E,EAAAuc,2BAAA3D,EAAA7T,GAGA6T,EAAA7U,WAcAsW,GAAAzB,EAAAwD,EAAA,SAAAjO,EAAAqO,GACA,MAAAzX,GAAAyX,EAAAxG,KAAA,OAdAjR,EAAA,OA8CA/E,EAAA0Y,cAAA,SAAA/T,EAAAqM,EAAAjM,GACA,mBAAAJ,GACA,MAAA3E,GAAAyc,sBAAA9X,EAAAqM,EAAAjM,EAGA,mBAAAiM,KACAjM,EAAAiM,EACAA,EAAA,KAGA,IAAA1L,EACA,SAAAX,EAEA,MAAAI,GAAAoJ,EAAA,IAKA,QAFAuO,GAAA/I,EAAA5P,EAAA,GAEAE,EAAA,EAAAkF,EAAAxE,EAAAZ,OAAkCE,EAAAkF,EAAOlF,IAAA,CACzC,GAAA0Y,GAAAhY,EAAA3B,OAAAiB,EAEA,UAAA0Y,EAAA,CAKA,QAAA5Y,OAAA2Y,EAAA7W,OAAA9B,IAEA,MAAAgB,GAAAoJ,EAAA,IAKA,IAFAwF,EAAAhP,EAAAyB,OAAAnC,EAAA,EAAAyY,GAEA3Y,GAAA4P,EAAA5P,OAEA,MAAAgB,GAAAoJ,EAAA,IAGA,IAAAwF,EAAA5P,OAAA,CAGA,GAFAuB,EAAAtF,EAAAkZ,aAAAvF,EAAA3C,GAAA,GAEA7C,EAAA7J,OAAAgB,EAAAhB,MAAA6J,EAAAxJ,OAAAW,EAAAX,KAEA,MAAAI,GAAAoJ,EAAA,IAGA,IAAAyO,GAAA7X,EAAAO,EAAArB,EAAAyY,EAAAvT,EACA,SAAAyT,EAAA,OAIA3Y,GAAAyY,EACA3Y,EAAA,OA9BAA,IAAA4Y,EAiCA,WAAA5Y,EAEAgB,EAAAoJ,EAAA,KAFA,QAqBAnO,EAAAuc,2BAAA,SAAA3D,EAAA7T,GAKA,QAAAqX,GAAA9W,EAAA+W,GACArc,EAAA8Z,aAAAxU,GAAA,cAAAX,GACA,MAAA0X,GAAA,KAAA1X,KANA,MAAAiU,GAAA7U,WAUAsW,GAAAzB,EAAAwD,EAAA,SAAAjO,EAAAY,GACA,GAAA8N,GAAA9N,EAAA+N,OAAA,SAAAC,EAAAjc,GACA,GAAAgI,EAMA,OAJAA,GADA,gBAAAhI,GACAA,EAAAiD,OAEAjD,EAAA4Y,WAEAqD,EAAAjU,EAAAgB,WAAA/F,OAAA+E,EAAA,GACK,GAELkU,EAAA,GAAAxD,YAAAqD,GAEAI,EAAA,CA8BA,OA7BAlO,GAAAmO,QAAA,SAAApc,GACA,GAAAqc,GAAA,gBAAArc,GACAsc,EAAAtc,CACA,IAAAqc,EAAA,CAEA,OADAE,GAAA,GAAA7D,YAAA1Y,EAAAiD,QACAE,EAAA,EAAuBA,EAAAnD,EAAAiD,OAAcE,IACrCoZ,EAAApZ,GAAAnD,EAAAwc,WAAArZ,EAEAmZ,GAAAC,EAAA1D,OAGAwD,EACAH,EAAAC,KAAA,EAEAD,EAAAC,KAAA,CAIA,QADAM,GAAAH,EAAA1D,WAAA5P,WACA7F,EAAA,EAAqBA,EAAAsZ,EAAAxZ,OAAmBE,IACxC+Y,EAAAC,KAAAO,SAAAD,EAAAtZ,GAEA+Y,GAAAC,KAAA,GAGA,QADAI,GAAA,GAAA7D,YAAA4D,GACAnZ,EAAA,EAAqBA,EAAAoZ,EAAAtZ,OAAiBE,IACtC+Y,EAAAC,KAAAI,EAAApZ,KAIAc,EAAAiY,EAAArD,UApDA5U,EAAA,GAAAuE,aAAA,KA4DAtJ,EAAAsc,oBAAA,SAAA1D,EAAA7T,GACA,QAAAqX,GAAA9W,EAAA+W,GACArc,EAAA8Z,aAAAxU,GAAA,cAAAgW,GACA,GAAAmC,GAAA,GAAAjE,YAAA,EAEA,IADAiE,EAAA,KACA,gBAAAnC,GAAA,CAEA,OADA+B,GAAA,GAAA7D,YAAA8B,EAAAvX,QACAE,EAAA,EAAuBA,EAAAqX,EAAAvX,OAAoBE,IAC3CoZ,EAAApZ,GAAAqX,EAAAgC,WAAArZ,EAEAqX,GAAA+B,EAAA1D,OACA8D,EAAA,KASA,OANA3U,GAAAwS,YAAAhS,aACAgS,EAAA5B,WACA4B,EAAAoC,KAEAH,EAAAzU,EAAAgB,WACA6T,EAAA,GAAAnE,YAAA+D,EAAAxZ,OAAA,GACAE,EAAA,EAAqBA,EAAAsZ,EAAAxZ,OAAmBE,IACxC0Z,EAAA1Z,GAAAuZ,SAAAD,EAAAtZ,GAIA,IAFA0Z,EAAAJ,EAAAxZ,QAAA,IAEAyF,EAAA,CACA,GAAAyQ,GAAA,GAAAzQ,IAAAiU,EAAA9D,OAAAgE,EAAAhE,OAAA2B,GACAe,GAAA,KAAApC,MAKAI,EAAAzB,EAAAwD,EAAA,SAAAjO,EAAAqO,GACA,MAAAzX,GAAA,GAAAyE,GAAAgT,OAaAxc,EAAAyc,sBAAA,SAAA9X,EAAAqM,EAAAjM,GACA,kBAAAiM,KACAjM,EAAAiM,EACAA,EAAA,KAMA,KAHA,GAAA4M,GAAAjZ,EACAY,KAEAqY,EAAAlE,WAAA,IAKA,OAJAmE,GAAA,GAAArE,YAAAoE,GACAT,EAAA,IAAAU,EAAA,GACAC,EAAA,GAEA7Z,EAAA,EACA,MAAA4Z,EAAA5Z,GADqBA,IAAA,CAIrB,GAAA6Z,EAAA/Z,OAAA,IACA,MAAAgB,GAAAoJ,EAAA,IAGA2P,IAAAD,EAAA5Z,GAGA2Z,EAAA/C,EAAA+C,EAAA,EAAAE,EAAA/Z,QACA+Z,EAAAN,SAAAM,EAEA,IAAAnK,GAAAkH,EAAA+C,EAAA,EAAAE,EACA,IAAAX,EACA,IACAxJ,EAAA4H,OAAAI,aAAAvT,MAAA,QAAAoR,YAAA7F,IACO,MAAA/P,GAEP,GAAAgY,GAAA,GAAApC,YAAA7F,EACAA,GAAA,EACA,QAAA1P,GAAA,EAAuBA,EAAA2X,EAAA7X,OAAkBE,IACzC0P,GAAA4H,OAAAI,aAAAC,EAAA3X,IAKAsB,EAAAkC,KAAAkM,GACAiK,EAAA/C,EAAA+C,EAAAE,GAGA,GAAArF,GAAAlT,EAAAxB,MACAwB,GAAA2X,QAAA,SAAAvD,EAAA1V,GACAc,EAAA/E,EAAAkZ,aAAAS,EAAA3I,GAAA,GAAA/M,EAAAwU,QtBs2G8B9X,KAAKX,EAAU,WAAa,MAAOI,WAI3D,SAAUH,EAAQD,GuB77HxBC,EAAAD,QAAA4J,OAAAiI,MAAA,SAAAzP,GACA,GAAA4H,MACA0C,EAAA9C,OAAAtH,UAAAuH,cAEA,QAAA5F,KAAA7B,GACAsK,EAAA/L,KAAAyB,EAAA6B,IACA+F,EAAAvC,KAAAxD,EAGA,OAAA+F,KvB68HM,SAAU/J,EAAQD,GwBv9HxBC,EAAAD,QAAA,SAAA+d,EAAAC,EAAAC,GACA,GAAAC,GAAAH,EAAArE,UAIA,IAHAsE,KAAA,EACAC,KAAAC,EAEAH,EAAAlV,MAA0B,MAAAkV,GAAAlV,MAAAmV,EAAAC,EAM1B,IAJAD,EAAA,IAAkBA,GAAAE,GAClBD,EAAA,IAAgBA,GAAAC,GAChBD,EAAAC,IAAoBD,EAAAC,GAEpBF,GAAAE,GAAAF,GAAAC,GAAA,IAAAC,EACA,UAAA5U,aAAA,EAKA,QAFA6U,GAAA,GAAA3E,YAAAuE,GACA/S,EAAA,GAAAwO,YAAAyE,EAAAD,GACA/Z,EAAA+Z,EAAAI,EAAA,EAA6Bna,EAAAga,EAASha,IAAAma,IACtCpT,EAAAoT,GAAAD,EAAAla,EAEA,OAAA+G,GAAA2O,SxBs+HM,SAAU1Z,EAAQD,GyB//HxB,QAAAya,GAAA4D,EAAAtZ,EAAAuZ,GAOA,QAAAC,GAAApQ,EAAAnD,GACA,GAAAuT,EAAAF,OAAA,EACA,SAAApY,OAAA,iCAEAsY,EAAAF,MAGAlQ,GACAqQ,GAAA,EACAzZ,EAAAoJ,GAEApJ,EAAAuZ,GACS,IAAAC,EAAAF,OAAAG,GACTzZ,EAAA,KAAAiG,GAnBA,GAAAwT,IAAA,CAIA,OAHAF,MAAAnD,EACAoD,EAAAF,QAEA,IAAAA,EAAAtZ,IAAAwZ,EAoBA,QAAApD,MA3BAlb,EAAAD,QAAAya,GzBmiIM,SAAUxa,EAAQD,EAASM,GAEhC,GAAIme,I0BriIL,SAAAxe,EAAA2C,IACC,SAAA9C,GAqBD,QAAA4e,GAAAC,GAMA,IALA,GAGAC,GACAC,EAJAC,KACAC,EAAA,EACAhb,EAAA4a,EAAA5a,OAGAgb,EAAAhb,GACA6a,EAAAD,EAAArB,WAAAyB,KACAH,GAAA,OAAAA,GAAA,OAAAG,EAAAhb,GAEA8a,EAAAF,EAAArB,WAAAyB,KACA,cAAAF,GACAC,EAAArX,OAAA,KAAAmX,IAAA,UAAAC,GAAA,QAIAC,EAAArX,KAAAmX,GACAG,MAGAD,EAAArX,KAAAmX,EAGA,OAAAE,GAIA,QAAAE,GAAAC,GAKA,IAJA,GAEAL,GAFA7a,EAAAkb,EAAAlb,OACA+K,GAAA,EAEAgQ,EAAA,KACAhQ,EAAA/K,GACA6a,EAAAK,EAAAnQ,GACA8P,EAAA,QACAA,GAAA,MACAE,GAAAI,EAAAN,IAAA,eACAA,EAAA,WAAAA,GAEAE,GAAAI,EAAAN,EAEA,OAAAE,GAGA,QAAAK,GAAAC,EAAAhF,GACA,GAAAgF,GAAA,OAAAA,GAAA,OACA,GAAAhF,EACA,KAAAnU,OACA,oBAAAmZ,EAAAtV,SAAA,IAAAuV,cACA,yBAGA,UAEA,SAIA,QAAAC,GAAAF,EAAAjQ,GACA,MAAA+P,GAAAE,GAAAjQ,EAAA,QAGA,QAAAoQ,GAAAH,EAAAhF,GACA,kBAAAgF,GACA,MAAAF,GAAAE,EAEA,IAAAI,GAAA,EAiBA,OAhBA,gBAAAJ,GACAI,EAAAN,EAAAE,GAAA,UAEA,eAAAA,IACAD,EAAAC,EAAAhF,KACAgF,EAAA,OAEAI,EAAAN,EAAAE,GAAA,WACAI,GAAAF,EAAAF,EAAA,IAEA,eAAAA,KACAI,EAAAN,EAAAE,GAAA,UACAI,GAAAF,EAAAF,EAAA,IACAI,GAAAF,EAAAF,EAAA,IAEAI,GAAAN,EAAA,GAAAE,EAAA,KAIA,QAAA/D,GAAAsD,EAAA1d,GACAA,OAQA,KAPA,GAKAme,GALAhF,GAAA,IAAAnZ,EAAAmZ,OAEAqF,EAAAf,EAAAC,GACA5a,EAAA0b,EAAA1b,OACA+K,GAAA,EAEA4Q,EAAA,KACA5Q,EAAA/K,GACAqb,EAAAK,EAAA3Q,GACA4Q,GAAAH,EAAAH,EAAAhF,EAEA,OAAAsF,GAKA,QAAAC,KACA,GAAAC,GAAAC,EACA,KAAA5Z,OAAA,qBAGA,IAAA6Z,GAAA,IAAAC,EAAAH,EAGA,IAFAA,IAEA,UAAAE,GACA,UAAAA,CAIA,MAAA7Z,OAAA,6BAGA,QAAA+Z,GAAA5F,GACA,GAAA6F,GACAC,EACAC,EACAC,EACAhB,CAEA,IAAAQ,EAAAC,EACA,KAAA5Z,OAAA,qBAGA,IAAA2Z,GAAAC,EACA,QAQA,IAJAI,EAAA,IAAAF,EAAAH,GACAA,IAGA,QAAAK,GACA,MAAAA,EAIA,cAAAA,GAAA,CAGA,GAFAC,EAAAP,IACAP,GAAA,GAAAa,IAAA,EAAAC,EACAd,GAAA,IACA,MAAAA,EAEA,MAAAnZ,OAAA,6BAKA,aAAAga,GAAA,CAIA,GAHAC,EAAAP,IACAQ,EAAAR,IACAP,GAAA,GAAAa,IAAA,GAAAC,GAAA,EAAAC,EACAf,GAAA,KACA,MAAAD,GAAAC,EAAAhF,GAAAgF,EAAA,KAEA,MAAAnZ,OAAA,6BAKA,aAAAga,KACAC,EAAAP,IACAQ,EAAAR,IACAS,EAAAT,IACAP,GAAA,EAAAa,IAAA,GAAAC,GAAA,GACAC,GAAA,EAAAC,EACAhB,GAAA,OAAAA,GAAA,SACA,MAAAA,EAIA,MAAAnZ,OAAA,0BAMA,QAAA8V,GAAA2D,EAAAze,GACAA,OACA,IAAAmZ,IAAA,IAAAnZ,EAAAmZ,MAEA2F,GAAArB,EAAAgB,GACAG,EAAAE,EAAAhc,OACA6b,EAAA,CAGA,KAFA,GACAS,GADAZ,MAEAY,EAAAL,EAAA5F,OAAA,GACAqF,EAAAhY,KAAA4Y,EAEA,OAAArB,GAAAS,GAvNA,GAAAa,GAAA,gBAAAtgB,MAQA2R,GALA,gBAAA1R,OACAA,EAAAD,SAAAsgB,GAAArgB,EAIA,gBAAA2C,MACA+O,GAAA/O,SAAA+O,KAAA4O,SAAA5O,IACA7R,EAAA6R,EAKA,IAyLAoO,GACAF,EACAD,EA3LAV,EAAA3D,OAAAI,aA6MAxB,GACAqG,QAAA,QACAxZ,OAAAqU,EACAnL,OAAA6L,EAUA0C,GAAA,WACA,MAAAtE,IACGxZ,KAAAX,EAAAM,EAAAN,EAAAC,KAAAkB,SAAAsd,IAAAxe,EAAAD,QAAAye,KAeFre,Q1BqiI6BO,KAAKX,EAASM,EAAoB,IAAIL,GAAU,WAAa,MAAOG,WAI5F,SAAUH,EAAQD,G2BvyIxBC,EAAAD,QAAA,SAAAC,GAQA,MAPAA,GAAAwgB,kBACAxgB,EAAAygB,UAAA,aACAzgB,EAAA0gB,SAEA1gB,EAAA2gB,YACA3gB,EAAAwgB,gBAAA,GAEAxgB,I3B+yIM,SAAUA,EAAQD,I4BhzIxB,WACA,YAMA,QAJA6gB,GAAA,mEAGA9f,EAAA,GAAAyY,YAAA,KACAvV,EAAA,EAAiBA,EAAA4c,EAAA9c,OAAkBE,IACnClD,EAAA8f,EAAAvD,WAAArZ,KAGAjE,GAAAgH,OAAA,SAAA+W,GACA,GACA9Z,GADAia,EAAA,GAAA1E,YAAAuE,GACAjV,EAAAoV,EAAAna,OAAAqD,EAAA,EAEA,KAAAnD,EAAA,EAAeA,EAAA6E,EAAS7E,GAAA,EACxBmD,GAAAyZ,EAAA3C,EAAAja,IAAA,GACAmD,GAAAyZ,GAAA,EAAA3C,EAAAja,KAAA,EAAAia,EAAAja,EAAA,OACAmD,GAAAyZ,GAAA,GAAA3C,EAAAja,EAAA,OAAAia,EAAAja,EAAA,OACAmD,GAAAyZ,EAAA,GAAA3C,EAAAja,EAAA,GASA,OANA6E,GAAA,MACA1B,IAAAvD,UAAA,EAAAuD,EAAArD,OAAA,OACK+E,EAAA,QACL1B,IAAAvD,UAAA,EAAAuD,EAAArD,OAAA,SAGAqD,GAGApH,EAAAkQ,OAAA,SAAA9I,GACA,GACAnD,GACA6c,EAAAC,EAAAC,EAAAC,EAFAC,EAAA,IAAA9Z,EAAArD,OACA+E,EAAA1B,EAAArD,OAAAjD,EAAA,CAGA,OAAAsG,IAAArD,OAAA,KACAmd,IACA,MAAA9Z,IAAArD,OAAA,IACAmd,IAIA,IAAAnD,GAAA,GAAAzU,aAAA4X,GACAhD,EAAA,GAAA1E,YAAAuE,EAEA,KAAA9Z,EAAA,EAAeA,EAAA6E,EAAS7E,GAAA,EACxB6c,EAAA/f,EAAAqG,EAAAkW,WAAArZ,IACA8c,EAAAhgB,EAAAqG,EAAAkW,WAAArZ,EAAA,IACA+c,EAAAjgB,EAAAqG,EAAAkW,WAAArZ,EAAA,IACAgd,EAAAlgB,EAAAqG,EAAAkW,WAAArZ,EAAA,IAEAia,EAAApd,KAAAggB,GAAA,EAAAC,GAAA,EACA7C,EAAApd,MAAA,GAAAigB,IAAA,EAAAC,GAAA,EACA9C,EAAApd,MAAA,EAAAkgB,IAAA,KAAAC,CAGA,OAAAlD,Q5Bg0IM,SAAU9d,EAAQD,I6Bh4IxB,SAAA4C,GAkDA,QAAAue,GAAA7G,GACA,OAAArW,GAAA,EAAiBA,EAAAqW,EAAAvW,OAAgBE,IAAA,CACjC,GAAAmd,GAAA9G,EAAArW,EACA,IAAAmd,EAAAzH,iBAAArQ,aAAA,CACA,GAAAtD,GAAAob,EAAAzH,MAIA,IAAAyH,EAAA1H,aAAA1T,EAAA0T,WAAA,CACA,GAAA2H,GAAA,GAAA7H,YAAA4H,EAAA1H,WACA2H,GAAAC,IAAA,GAAA9H,YAAAxT,EAAAob,EAAAG,WAAAH,EAAA1H,aACA1T,EAAAqb,EAAA1H,OAGAW,EAAArW,GAAA+B,IAKA,QAAAwb,GAAAlH,EAAArL,GACAA,OAEA,IAAAwS,GAAA,GAAAC,EACAP,GAAA7G,EAEA,QAAArW,GAAA,EAAiBA,EAAAqW,EAAAvW,OAAgBE,IACjCwd,EAAAE,OAAArH,EAAArW,GAGA,OAAAgL,GAAA,KAAAwS,EAAAG,QAAA3S,EAAA3K,MAAAmd,EAAAG,UAGA,QAAAC,GAAAvH,EAAArL,GAEA,MADAkS,GAAA7G,GACA,GAAA9Q,MAAA8Q,EAAArL,OAhFA,GAAAyS,GAAA9e,EAAA8e,aACA9e,EAAAkf,mBACAlf,EAAAmf,eACAnf,EAAAof,eAMAC,EAAA,WACA,IACA,GAAAC,GAAA,GAAA1Y,OAAA,MACA,YAAA0Y,EAAAxE,KACG,MAAA9Z,GACH,aASAue,EAAAF,GAAA,WACA,IACA,GAAAte,GAAA,GAAA6F,OAAA,GAAAgQ,aAAA,OACA,YAAA7V,EAAA+Z,KACG,MAAA9Z,GACH,aAQAwe,EAAAV,GACAA,EAAApf,UAAAqf,QACAD,EAAApf,UAAAsf,OA6CA3hB,GAAAD,QAAA,WACA,MAAAiiB,GACAE,EAAAvf,EAAA4G,KAAAqY,EACGO,EACHZ,EAEA,Y7Bs4I8B7gB,KAAKX,EAAU,WAAa,MAAOI,WAI3D,SAAUH,EAAQD,G8B/9IxBA,EAAAgH,OAAA,SAAA5E,GACA,GAAAqB,GAAA,EAEA,QAAAQ,KAAA7B,GACAA,EAAAyH,eAAA5F,KACAR,EAAAM,SAAAN,GAAA,KACAA,GAAA4e,mBAAApe,GAAA,IAAAoe,mBAAAjgB,EAAA6B,IAIA,OAAAR,IAUAzD,EAAAkQ,OAAA,SAAAoS,GAGA,OAFAC,MACAC,EAAAF,EAAA9G,MAAA,KACAvX,EAAA,EAAAkF,EAAAqZ,EAAAze,OAAmCE,EAAAkF,EAAOlF,IAAA,CAC1C,GAAAwe,GAAAD,EAAAve,GAAAuX,MAAA,IACA+G,GAAAG,mBAAAD,EAAA,KAAAC,mBAAAD,EAAA,IAEA,MAAAF,K9B++IM,SAAUtiB,EAAQD,G+BjhJxBC,EAAAD,QAAA,SAAAkiB,EAAAve,GACA,GAAAqE,GAAA,YACAA,GAAA1F,UAAAqB,EAAArB,UACA4f,EAAA5f,UAAA,GAAA0F,GACAka,EAAA5f,UAAAD,YAAA6f,I/ByhJM,SAAUjiB,EAAQD,GgC9hJxB,YAgBA,SAAAgH,GAAAoD,GACA,GAAAkR,GAAA,EAEA,GACAA,GAAAqH,EAAAvY,EAAArG,GAAAuX,EACAlR,EAAAwY,KAAAC,MAAAzY,EAAArG,SACGqG,EAAA,EAEH,OAAAkR,GAUA,QAAApL,GAAAzM,GACA,GAAAqf,GAAA,CAEA,KAAA7e,EAAA,EAAaA,EAAAR,EAAAM,OAAgBE,IAC7B6e,IAAA/e,EAAAsW,EAAA5W,EAAAT,OAAAiB,GAGA,OAAA6e,GASA,QAAAzK,KACA,GAAA0K,GAAA/b,GAAA,GAAAsD,MAEA,OAAAyY,KAAAC,GAAAC,EAAA,EAAAD,EAAAD,GACAA,EAAA,IAAA/b,EAAAic,KAMA,IA1DA,GAKAD,GALAL,EAAA,mEAAAnH,MAAA,IACAzX,EAAA,GACAsW,KACA4I,EAAA,EACAhf,EAAA,EAsDMA,EAAAF,EAAYE,IAAAoW,EAAAsI,EAAA1e,KAKlBoU,GAAArR,SACAqR,EAAAnI,SACAjQ,EAAAD,QAAAqY,GhCqiJM,SAAUpY,EAAQD,EAASM,IAEJ,SAASsC,GiC3kJtC,QAAAqT,MASA,QAAAiN,GAAAjiB,GACAiV,EAAAvV,KAAAP,KAAAa,GAEAb,KAAA4B,MAAA5B,KAAA4B,UAIAyG,IAEA7F,EAAAugB,SAAAvgB,EAAAugB,WACA1a,EAAA7F,EAAAugB,QAIA/iB,KAAA0O,MAAArG,EAAA1E,MAGA,IAAA8J,GAAAzN,IACAqI,GAAAhB,KAAA,SAAAkM,GACA9F,EAAAoJ,OAAAtD,KAIAvT,KAAA4B,MAAAiT,EAAA7U,KAAA0O,MAGAlM,EAAAkV,UAAAlV,EAAAkF,kBACAlF,EAAAkF,iBAAA,0BACA+F,EAAAuV,SAAAvV,EAAAuV,OAAAxU,QAAAqH,KACK,GAhEL,GAAAC,GAAA5V,EAAA,IACAqW,EAAArW,EAAA,GAMAL,GAAAD,QAAAkjB,CAMA,IAOAza,GAPA4a,EAAA,MACAC,EAAA,MA0DA3M,GAAAuM,EAAAhN,GAMAgN,EAAA5gB,UAAAkR,gBAAA,EAQA0P,EAAA5gB,UAAAqW,QAAA,WACAvY,KAAAgjB,SACAhjB,KAAAgjB,OAAAG,WAAAC,YAAApjB,KAAAgjB,QACAhjB,KAAAgjB,OAAA,MAGAhjB,KAAAqjB,OACArjB,KAAAqjB,KAAAF,WAAAC,YAAApjB,KAAAqjB,MACArjB,KAAAqjB,KAAA,KACArjB,KAAAsjB,OAAA,MAGAxN,EAAA5T,UAAAqW,QAAAhY,KAAAP,OASA8iB,EAAA5gB,UAAA0U,OAAA,WACA,GAAAnJ,GAAAzN,KACAgjB,EAAAtL,SAAA6L,cAAA,SAEAvjB,MAAAgjB,SACAhjB,KAAAgjB,OAAAG,WAAAC,YAAApjB,KAAAgjB,QACAhjB,KAAAgjB,OAAA,MAGAA,EAAA/M,OAAA,EACA+M,EAAA1f,IAAAtD,KAAAY,MACAoiB,EAAAxU,QAAA,SAAAhL,GACAiK,EAAAsF,QAAA,mBAAAvP,GAGA,IAAAggB,GAAA9L,SAAA+L,qBAAA,YACAD,GACAA,EAAAL,WAAAO,aAAAV,EAAAQ,IAEA9L,SAAAiM,MAAAjM,SAAAkM,MAAAC,YAAAb,GAEAhjB,KAAAgjB,QAEA,IAAAc,GAAA,mBAAAnJ,YAAA,SAAA9X,KAAA8X,UAAAC,UAEAkJ,IACA7V,WAAA,WACA,GAAAqV,GAAA5L,SAAA6L,cAAA,SACA7L,UAAAkM,KAAAC,YAAAP,GACA5L,SAAAkM,KAAAR,YAAAE,IACK,MAYLR,EAAA5gB,UAAAuU,QAAA,SAAAlS,EAAAqD,GA0BA,QAAAmc,KACAC,IACApc,IAGA,QAAAoc,KACA,GAAAvW,EAAA6V,OACA,IACA7V,EAAA4V,KAAAD,YAAA3V,EAAA6V,QACO,MAAA9f,GACPiK,EAAAsF,QAAA,qCAAAvP,GAIA,IAEA,GAAAygB,GAAA,oCAAAxW,EAAAyW,SAAA,IACAZ,GAAA5L,SAAA6L,cAAAU,GACK,MAAAzgB,GACL8f,EAAA5L,SAAA6L,cAAA,UACAD,EAAAhR,KAAA7E,EAAAyW,SACAZ,EAAAhgB,IAAA,eAGAggB,EAAAjjB,GAAAoN,EAAAyW,SAEAzW,EAAA4V,KAAAQ,YAAAP,GACA7V,EAAA6V,SApDA,GAAA7V,GAAAzN,IAEA,KAAAA,KAAAqjB,KAAA,CACA,GAGAC,GAHAD,EAAA3L,SAAA6L,cAAA,QACAY,EAAAzM,SAAA6L,cAAA,YACAljB,EAAAL,KAAAkkB,SAAA,cAAAlkB,KAAA0O,KAGA2U,GAAAe,UAAA,WACAf,EAAAgB,MAAAC,SAAA,WACAjB,EAAAgB,MAAAE,IAAA,UACAlB,EAAAgB,MAAAG,KAAA,UACAnB,EAAAoB,OAAApkB,EACAgjB,EAAArN,OAAA,OACAqN,EAAAqB,aAAA,0BACAP,EAAA7R,KAAA,IACA+Q,EAAAQ,YAAAM,GACAzM,SAAAkM,KAAAC,YAAAR,GAEArjB,KAAAqjB,OACArjB,KAAAmkB,OAGAnkB,KAAAqjB,KAAAsB,OAAA3kB,KAAAY,MAgCAojB,IAIAzf,IAAAb,QAAAwf,EAAA,QACAljB,KAAAmkB,KAAA3F,MAAAja,EAAAb,QAAAuf,EAAA,MAEA,KACAjjB,KAAAqjB,KAAAuB,SACG,MAAAphB,IAEHxD,KAAAsjB,OAAAvL,YACA/X,KAAAsjB,OAAAjM,mBAAA,WACA,aAAA5J,EAAA6V,OAAA3X,YACAoY,KAIA/jB,KAAAsjB,OAAA3Y,OAAAoZ,KjC8mJ8BxjB,KAAKX,EAAU,WAAa,MAAOI,WAI3D,SAAUH,EAAQD,EAASM,IkCt1JjC,SAAAsC,GA0CA,QAAAqiB,GAAAhkB,GACA,GAAAqP,GAAArP,KAAAqP,WACAA,KACAlQ,KAAAoT,gBAAA,GAEApT,KAAA8Q,kBAAAjQ,EAAAiQ,kBACA9Q,KAAA8kB,sBAAAC,IAAAlkB,EAAAyQ,UACAtR,KAAA2S,UAAA9R,EAAA8R,UACA3S,KAAA8kB,wBACAE,EAAAC,GAEA7S,EAAA7R,KAAAP,KAAAa,GAjDA,GAOAokB,GAPA7S,EAAAlS,EAAA,IACAiC,EAAAjC,EAAA,IACA2P,EAAA3P,EAAA,IACAqW,EAAArW,EAAA,IACA+X,EAAA/X,EAAA,IAEA6kB,GADA7kB,EAAA,iCACAsC,EAAAwiB,WAAAxiB,EAAA0iB,aAEA,uBAAA/E,QACA,IACA8E,EAAA/kB,EAAA,IACG,MAAAsD,IASH,GAAAwhB,GAAAD,CACAC,IAAA,mBAAA7E,UACA6E,EAAAC,GAOAplB,EAAAD,QAAAilB,EA2BAtO,EAAAsO,EAAAzS,GAQAyS,EAAA3iB,UAAAoQ,KAAA,YAMAuS,EAAA3iB,UAAAkR,gBAAA,EAQAyR,EAAA3iB,UAAAgW,OAAA,WACA,GAAAlY,KAAAmlB,QAAA,CAKA,GAAAvkB,GAAAZ,KAAAY,MACA+R,EAAA3S,KAAA2S,UACA9R,GACA+O,MAAA5P,KAAA4P,MACAkB,kBAAA9Q,KAAA8Q,kBAIAjQ,GAAAmQ,IAAAhR,KAAAgR,IACAnQ,EAAA2G,IAAAxH,KAAAwH,IACA3G,EAAAoQ,WAAAjR,KAAAiR,WACApQ,EAAAqQ,KAAAlR,KAAAkR,KACArQ,EAAAsQ,GAAAnR,KAAAmR,GACAtQ,EAAAuQ,QAAApR,KAAAoR,QACAvQ,EAAAwQ,mBAAArR,KAAAqR,mBACArR,KAAAwR,eACA3Q,EAAAukB,QAAAplB,KAAAwR,cAEAxR,KAAA0R,eACA7Q,EAAA6Q,aAAA1R,KAAA0R,aAGA,KACA1R,KAAAqlB,GAAArlB,KAAA8kB,sBAAAnS,EAAA,GAAAqS,GAAApkB,EAAA+R,GAAA,GAAAqS,GAAApkB,GAAA,GAAAokB,GAAApkB,EAAA+R,EAAA9R,GACG,MAAAkN,GACH,MAAA/N,MAAA+G,KAAA,QAAAgH,GAGAhN,SAAAf,KAAAqlB,GAAAzU,aACA5Q,KAAAoT,gBAAA,GAGApT,KAAAqlB,GAAAC,UAAAtlB,KAAAqlB,GAAAC,SAAAvgB,QACA/E,KAAAoT,gBAAA,EACApT,KAAAqlB,GAAAzU,WAAA,cAEA5Q,KAAAqlB,GAAAzU,WAAA,cAGA5Q,KAAAulB,sBASAV,EAAA3iB,UAAAqjB,kBAAA,WACA,GAAA9X,GAAAzN,IAEAA,MAAAqlB,GAAAzX,OAAA,WACAH,EAAAsG,UAEA/T,KAAAqlB,GAAAjW,QAAA,WACA3B,EAAAuF,WAEAhT,KAAAqlB,GAAAG,UAAA,SAAAC,GACAhY,EAAAoJ,OAAA4O,EAAAlhB,OAEAvE,KAAAqlB,GAAA7W,QAAA,SAAAhL,GACAiK,EAAAsF,QAAA,kBAAAvP,KAWAqhB,EAAA3iB,UAAA0M,MAAA,SAAA4J,GA4CA,QAAA4B,KACA3M,EAAA1G,KAAA,SAIAkH,WAAA,WACAR,EAAA8G,UAAA,EACA9G,EAAA1G,KAAA,UACK,GAnDL,GAAA0G,GAAAzN,IACAA,MAAAuU,UAAA,CAKA,QADA8D,GAAAG,EAAA7U,OACAE,EAAA,EAAAkF,EAAAsP,EAA4BxU,EAAAkF,EAAOlF,KACnC,SAAAqB,GACA/C,EAAAuX,aAAAxU,EAAAuI,EAAA2F,eAAA,SAAA7O,GACA,IAAAkJ,EAAAqX,sBAAA,CAEA,GAAAjkB,KAKA,IAJAqE,EAAA2J,UACAhO,EAAA2T,SAAAtP,EAAA2J,QAAA2F,UAGA/G,EAAAqD,kBAAA,CACA,GAAApI,GAAA,gBAAAnE,GAAA/B,EAAAwG,OAAAsQ,WAAA/U,KAAAZ,MACA+E,GAAA+E,EAAAqD,kBAAAC,YACAlQ,EAAA2T,UAAA,IAQA,IACA/G,EAAAqX,sBAEArX,EAAA4X,GAAA/R,KAAA/O,GAEAkJ,EAAA4X,GAAA/R,KAAA/O,EAAA1D,GAES,MAAA2C,MAIT6U,GAAA+B,OAEK5B,EAAA3U,KAqBLghB,EAAA3iB,UAAA8Q,QAAA,WACAZ,EAAAlQ,UAAA8Q,QAAAzS,KAAAP,OASA6kB,EAAA3iB,UAAAqW,QAAA,WACA,mBAAAvY,MAAAqlB,IACArlB,KAAAqlB,GAAAnX,SAUA2W,EAAA3iB,UAAAtB,IAAA,WACA,GAAAgB,GAAA5B,KAAA4B,UACA+W,EAAA3Y,KAAA2P,OAAA,WACA5M,EAAA,EAGA/C,MAAA+C,OAAA,QAAA4V,GAAA,MAAAlT,OAAAzF,KAAA+C,OACA,OAAA4V,GAAA,KAAAlT,OAAAzF,KAAA+C,SACAA,EAAA,IAAA/C,KAAA+C,MAIA/C,KAAAqQ,oBACAzO,EAAA5B,KAAAoQ,gBAAA6H,KAIAjY,KAAAoT,iBACAxR,EAAAgX,IAAA,GAGAhX,EAAAiO,EAAAjJ,OAAAhF,GAGAA,EAAA+B,SACA/B,EAAA,IAAAA,EAGA,IAAAoB,GAAAhD,KAAA0P,SAAAzM,QAAA,SACA,OAAA0V,GAAA,OAAA3V,EAAA,IAAAhD,KAAA0P,SAAA,IAAA1P,KAAA0P,UAAA3M,EAAA/C,KAAAoB,KAAAQ,GAUAijB,EAAA3iB,UAAAijB,MAAA,WACA,SAAAH,GAAA,gBAAAA,IAAAhlB,KAAAsS,OAAAuS,EAAA3iB,UAAAoQ,SlC21J8B/R,KAAKX,EAAU,WAAa,MAAOI,WAI3D,SAAUH,EAAQD,KAMlB,SAAUC,EAAQD,GmChoKxB,GAAAqD,aAEApD,GAAAD,QAAA,SAAAgK,EAAA5H,GACA,GAAAiB,EAAA,MAAA2G,GAAA3G,QAAAjB,EACA,QAAA6B,GAAA,EAAiBA,EAAA+F,EAAAjG,SAAgBE,EACjC,GAAA+F,EAAA/F,KAAA7B,EAAA,MAAA6B,EAEA,YnCwoKM,SAAUhE,EAAQD,IoChpKxB,SAAA4C,GAOA,GAAAkjB,GAAA,gBACAC,EAAA,sCACAC,EAAA,mEACAC,EAAA,uBACAC,EAAA,OACAC,EAAA,MAEAlmB,GAAAD,QAAA,SAAA2E,GACA,sBAAAA,OAIAA,IAAAb,QAAAoiB,EAAA,IAAApiB,QAAAqiB,EAAA,IAGAvjB,EAAAgC,WAAAyB,MACAzB,KAAAyB,MAAA1B,GAGAmhB,EAAA7iB,KAAA0B,EAAAb,QAAAiiB,EAAA,KACAjiB,QAAAkiB,EAAA,KACAliB,QAAAmiB,EAAA,KACA,GAAAG,UAAA,UAAAzhB,KAHA,QAVA,QpCkqK8BhE,KAAKX,EAAU,WAAa,MAAOI,WAI3D,SAAUH,EAAQD,EAASM,GAEhC,YqCloKD,SAASqC,GAAQvB,EAAIsD,EAAKzD,GACxBb,KAAKgB,GAAKA,EACVhB,KAAKsE,IAAMA,EACXtE,KAAKimB,KAAOjmB,KACZA,KAAKkmB,IAAM,EACXlmB,KAAKmmB,QACLnmB,KAAKomB,iBACLpmB,KAAKqmB,cACLrmB,KAAKsmB,WAAY,EACjBtmB,KAAKumB,cAAe,EAChB1lB,GAAQA,EAAKe,QACf5B,KAAK4B,MAAQf,EAAKe,OAEhB5B,KAAKgB,GAAGkL,aAAalM,KAAKmM,OrCunK/B,GAAIrL,GAA4B,kBAAXgB,SAAoD,gBAApBA,QAAOC,SAAwB,SAAUC,GAAO,aAAcA,IAAS,SAAUA,GAAO,MAAOA,IAAyB,kBAAXF,SAAyBE,EAAIC,cAAgBH,QAAUE,IAAQF,OAAOI,UAAY,eAAkBF,IqCrrKnQG,EAASjC,EAAQ,GACjBmG,EAAUnG,EAAQ,GAClBsmB,EAAUtmB,EAAQ,IAClBuH,EAAKvH,EAAQ,IACbmM,EAAOnM,EAAQ,IAEf2P,GADQ3P,EAAQ,GAAS,2BACfA,EAAQ,IAMtBL,GAAOD,QAAUA,EAAU2C,CAS3B,IAAIkkB,IACFnkB,QAAS,EACTokB,cAAe,EACfC,gBAAiB,EACjB/a,WAAY,EACZsD,WAAY,EACZvJ,MAAO,EACP6H,UAAW,EACXoZ,kBAAmB,EACnBC,iBAAkB,EAClBC,gBAAiB,EACjBxZ,aAAc,EACd+G,KAAM,EACNyG,KAAM,GAOJ/T,EAAOV,EAAQnE,UAAU6E,IA4B7BV,GAAQ9D,EAAOL,WAQfK,EAAOL,UAAU6kB,UAAY,WAC3B,IAAI/mB,KAAK8K,KAAT,CAEA,GAAI9J,GAAKhB,KAAKgB,EACdhB,MAAK8K,MACHrD,EAAGzG,EAAI,OAAQqL,EAAKrM,KAAM,WAC1ByH,EAAGzG,EAAI,SAAUqL,EAAKrM,KAAM,aAC5ByH,EAAGzG,EAAI,QAASqL,EAAKrM,KAAM,eAU/BuC,EAAOL,UAAUiK,KACjB5J,EAAOL,UAAUI,QAAU,WACzB,MAAItC,MAAKsmB,UAAkBtmB,MAE3BA,KAAK+mB,YACL/mB,KAAKgB,GAAGmL,OACJ,SAAWnM,KAAKgB,GAAG2K,YAAY3L,KAAK4N,SACxC5N,KAAK+G,KAAK,cACH/G,OAUTuC,EAAOL,UAAUoR,KAAO,WACtB,GAAI9K,GAAOge,EAAQve,UAGnB,OAFAO,GAAKpD,QAAQ,WACbpF,KAAK+G,KAAKiB,MAAMhI,KAAMwI,GACfxI,MAYTuC,EAAOL,UAAU6E,KAAO,SAAU0e,GAChC,GAAIgB,EAAOhd,eAAegc,GAExB,MADA1e,GAAKiB,MAAMhI,KAAMiI,WACVjI,IAGT,IAAIwI,GAAOge,EAAQve,WACf/C,GAAWhB,KAAM/B,EAAOuE,MAAOnC,KAAMiE,EAoBzC,OAlBAtD,GAAO2J,WACP3J,EAAO2J,QAAQ2F,UAAYxU,KAAKgnB,QAAS,IAAUhnB,KAAKgnB,MAAMxS,SAG1D,kBAAsBhM,GAAKA,EAAK7E,OAAS,KAE3C3D,KAAKmmB,KAAKnmB,KAAKkmB,KAAO1d,EAAKye,MAC3B/hB,EAAO7E,GAAKL,KAAKkmB,OAGflmB,KAAKsmB,UACPtmB,KAAKkF,OAAOA,GAEZlF,KAAKqmB,WAAWhf,KAAKnC,SAGhBlF,MAAKgnB,MAELhnB,MAUTuC,EAAOL,UAAUgD,OAAS,SAAUA,GAClCA,EAAOZ,IAAMtE,KAAKsE,IAClBtE,KAAKgB,GAAGkE,OAAOA,IASjB3C,EAAOL,UAAU0L,OAAS,WAIxB,GAAI,MAAQ5N,KAAKsE,IACf,GAAItE,KAAK4B,MAAO,CACd,GAAIA,GAA8B,WAAtBd,EAAOd,KAAK4B,OAAqBiO,EAAQjJ,OAAO5G,KAAK4B,OAAS5B,KAAK4B,KAE/E5B,MAAKkF,QAAQhB,KAAM/B,EAAOqE,QAAS5E,MAAOA,QAE1C5B,MAAKkF,QAAQhB,KAAM/B,EAAOqE,WAYhCjE,EAAOL,UAAUkN,QAAU,SAAUC,GAEnCrP,KAAKsmB,WAAY,EACjBtmB,KAAKumB,cAAe,QACbvmB,MAAKK,GACZL,KAAK+G,KAAK,aAAcsI,IAU1B9M,EAAOL,UAAUglB,SAAW,SAAUhiB,GACpC,GAAIA,EAAOZ,MAAQtE,KAAKsE,IAExB,OAAQY,EAAOhB,MACb,IAAK/B,GAAOqE,QACVxG,KAAKmnB,WACL,MAEF,KAAKhlB,GAAOuE,MACV1G,KAAKonB,QAAQliB,EACb,MAEF,KAAK/C,GAAOgC,aACVnE,KAAKonB,QAAQliB,EACb,MAEF,KAAK/C,GAAOwE,IACV3G,KAAKqnB,MAAMniB,EACX,MAEF,KAAK/C,GAAOiC,WACVpE,KAAKqnB,MAAMniB,EACX,MAEF,KAAK/C,GAAOsE,WACVzG,KAAKsnB,cACL,MAEF,KAAKnlB,GAAOiE,MACVpG,KAAK+G,KAAK,QAAS7B,EAAOX,QAYhChC,EAAOL,UAAUklB,QAAU,SAAUliB,GACnC,GAAIsD,GAAOtD,EAAOX,QAGd,OAAQW,EAAO7E,IAEjBmI,EAAKnB,KAAKrH,KAAKunB,IAAIriB,EAAO7E,KAGxBL,KAAKsmB,UACPvf,EAAKiB,MAAMhI,KAAMwI,GAEjBxI,KAAKomB,cAAc/e,KAAKmB,IAU5BjG,EAAOL,UAAUqlB,IAAM,SAAUlnB,GAC/B,GAAIoN,GAAOzN,KACPwnB,GAAO,CACX,OAAO,YAEL,IAAIA,EAAJ,CACAA,GAAO,CACP,IAAIhf,GAAOge,EAAQve,UAGnBwF,GAAKvI,QACHhB,KAAM/B,EAAOwE,IACbtG,GAAIA,EACJkE,KAAMiE,OAYZjG,EAAOL,UAAUmlB,MAAQ,SAAUniB,GACjC,GAAIqiB,GAAMvnB,KAAKmmB,KAAKjhB,EAAO7E,GACvB,mBAAsBknB,KAExBA,EAAIvf,MAAMhI,KAAMkF,EAAOX,YAChBvE,MAAKmmB,KAAKjhB,EAAO7E,MAY5BkC,EAAOL,UAAUilB,UAAY,WAC3BnnB,KAAKsmB,WAAY,EACjBtmB,KAAKumB,cAAe,EACpBvmB,KAAK+G,KAAK,WACV/G,KAAKynB,gBASPllB,EAAOL,UAAUulB,aAAe,WAC9B,GAAI5jB,EACJ,KAAKA,EAAI,EAAGA,EAAI7D,KAAKomB,cAAcziB,OAAQE,IACzCkD,EAAKiB,MAAMhI,KAAMA,KAAKomB,cAAcviB,GAItC,KAFA7D,KAAKomB,iBAEAviB,EAAI,EAAGA,EAAI7D,KAAKqmB,WAAW1iB,OAAQE,IACtC7D,KAAKkF,OAAOlF,KAAKqmB,WAAWxiB,GAE9B7D,MAAKqmB,eASP9jB,EAAOL,UAAUolB,aAAe,WAE9BtnB,KAAKkH,UACLlH,KAAKoP,QAAQ,yBAWf7M,EAAOL,UAAUgF,QAAU,WACzB,GAAIlH,KAAK8K,KAAM,CAEb,IAAK,GAAIjH,GAAI,EAAGA,EAAI7D,KAAK8K,KAAKnH,OAAQE,IACpC7D,KAAK8K,KAAKjH,GAAGqD,SAEflH,MAAK8K,KAAO,KAGd9K,KAAKgB,GAAGkG,QAAQlH,OAUlBuC,EAAOL,UAAUgM,MACjB3L,EAAOL,UAAUgN,WAAa,WAa5B,MAZIlP,MAAKsmB,WAEPtmB,KAAKkF,QAAShB,KAAM/B,EAAOsE,aAI7BzG,KAAKkH,UAEDlH,KAAKsmB,WAEPtmB,KAAKoP,QAAQ,wBAERpP,MAWTuC,EAAOL,UAAUsS,SAAW,SAAUA,GAGpC,MAFAxU,MAAKgnB,MAAQhnB,KAAKgnB,UAClBhnB,KAAKgnB,MAAMxS,SAAWA,EACfxU,OrCqrKH,SAAUH,EAAQD,GsCnlLxB,QAAA4mB,GAAAkB,EAAAhZ,GACA,GAAAmQ,KAEAnQ,MAAA,CAEA,QAAA7K,GAAA6K,GAAA,EAA4B7K,EAAA6jB,EAAA/jB,OAAiBE,IAC7Cgb,EAAAhb,EAAA6K,GAAAgZ,EAAA7jB,EAGA,OAAAgb,GAXAhf,EAAAD,QAAA4mB,GtCwmLM,SAAU3mB,EAAQD,GAEvB,YuC1lLD,SAAS6H,GAAIzF,EAAKyjB,EAAI7d,GAEpB,MADA5F,GAAIyF,GAAGge,EAAI7d,IAETV,QAAS,WACPlF,EAAIkG,eAAeud,EAAI7d,KAf7B/H,EAAOD,QAAU6H,GvCioLX,SAAU5H,EAAQD,GwCloLxB,GAAA6I,WAWA5I,GAAAD,QAAA,SAAAoC,EAAA4F,GAEA,GADA,gBAAAA,OAAA5F,EAAA4F,IACA,kBAAAA,GAAA,SAAA/B,OAAA,6BACA,IAAA2C,GAAAC,EAAAlI,KAAA0H,UAAA,EACA,mBACA,MAAAL,GAAAI,MAAAhG,EAAAwG,EAAAmN,OAAAlN,EAAAlI,KAAA0H,gBxC+oLM,SAAUpI,EAAQD,GyChpLxB,QAAA0L,GAAAzK,GACAA,QACAb,KAAA2nB,GAAA9mB,EAAA0K,KAAA,IACAvL,KAAAwL,IAAA3K,EAAA2K,KAAA,IACAxL,KAAA4nB,OAAA/mB,EAAA+mB,QAAA,EACA5nB,KAAAyL,OAAA5K,EAAA4K,OAAA,GAAA5K,EAAA4K,QAAA,EAAA5K,EAAA4K,OAAA,EACAzL,KAAAuN,SAAA,EApBA1N,EAAAD,QAAA0L,EA8BAA,EAAApJ,UAAAqN,SAAA,WACA,GAAAoY,GAAA3nB,KAAA2nB,GAAAnF,KAAAqF,IAAA7nB,KAAA4nB,OAAA5nB,KAAAuN,WACA,IAAAvN,KAAAyL,OAAA,CACA,GAAAqc,GAAAtF,KAAAuF,SACAC,EAAAxF,KAAAC,MAAAqF,EAAA9nB,KAAAyL,OAAAkc,EACAA,GAAA,MAAAnF,KAAAC,MAAA,GAAAqF,IAAAH,EAAAK,EAAAL,EAAAK,EAEA,SAAAxF,KAAAjX,IAAAoc,EAAA3nB,KAAAwL,MASAF,EAAApJ,UAAAiN,MAAA,WACAnP,KAAAuN,SAAA,GASAjC,EAAApJ,UAAA6K,OAAA,SAAAxB,GACAvL,KAAA2nB,GAAApc,GASAD,EAAApJ,UAAAiL,OAAA,SAAA3B,GACAxL,KAAAwL,OASAF,EAAApJ,UAAA+K,UAAA,SAAAxB,GACAzL,KAAAyL","file":"socket.io.slim.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"io\"] = factory();\n\telse\n\t\troot[\"io\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"io\"] = factory();\n\telse\n\t\troot[\"io\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\t\n\t/**\n\t * Module dependencies.\n\t */\n\t\n\tvar url = __webpack_require__(1);\n\tvar parser = __webpack_require__(4);\n\tvar Manager = __webpack_require__(10);\n\tvar debug = __webpack_require__(3)('socket.io-client');\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = exports = lookup;\n\t\n\t/**\n\t * Managers cache.\n\t */\n\t\n\tvar cache = exports.managers = {};\n\t\n\t/**\n\t * Looks up an existing `Manager` for multiplexing.\n\t * If the user summons:\n\t *\n\t *   `io('http://localhost/a');`\n\t *   `io('http://localhost/b');`\n\t *\n\t * We reuse the existing instance based on same scheme/port/host,\n\t * and we initialize sockets for each namespace.\n\t *\n\t * @api public\n\t */\n\t\n\tfunction lookup(uri, opts) {\n\t  if ((typeof uri === 'undefined' ? 'undefined' : _typeof(uri)) === 'object') {\n\t    opts = uri;\n\t    uri = undefined;\n\t  }\n\t\n\t  opts = opts || {};\n\t\n\t  var parsed = url(uri);\n\t  var source = parsed.source;\n\t  var id = parsed.id;\n\t  var path = parsed.path;\n\t  var sameNamespace = cache[id] && path in cache[id].nsps;\n\t  var newConnection = opts.forceNew || opts['force new connection'] || false === opts.multiplex || sameNamespace;\n\t\n\t  var io;\n\t\n\t  if (newConnection) {\n\t\n\t    io = Manager(source, opts);\n\t  } else {\n\t    if (!cache[id]) {\n\t\n\t      cache[id] = Manager(source, opts);\n\t    }\n\t    io = cache[id];\n\t  }\n\t  if (parsed.query && !opts.query) {\n\t    opts.query = parsed.query;\n\t  }\n\t  return io.socket(parsed.path, opts);\n\t}\n\t\n\t/**\n\t * Protocol version.\n\t *\n\t * @api public\n\t */\n\t\n\texports.protocol = parser.protocol;\n\t\n\t/**\n\t * `connect`.\n\t *\n\t * @param {String} uri\n\t * @api public\n\t */\n\t\n\texports.connect = lookup;\n\t\n\t/**\n\t * Expose constructors for standalone build.\n\t *\n\t * @api public\n\t */\n\t\n\texports.Manager = __webpack_require__(10);\n\texports.Socket = __webpack_require__(36);\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {'use strict';\n\t\n\t/**\n\t * Module dependencies.\n\t */\n\t\n\tvar parseuri = __webpack_require__(2);\n\tvar debug = __webpack_require__(3)('socket.io-client:url');\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = url;\n\t\n\t/**\n\t * URL parser.\n\t *\n\t * @param {String} url\n\t * @param {Object} An object meant to mimic window.location.\n\t *                 Defaults to window.location.\n\t * @api public\n\t */\n\t\n\tfunction url(uri, loc) {\n\t  var obj = uri;\n\t\n\t  // default to window.location\n\t  loc = loc || global.location;\n\t  if (null == uri) uri = loc.protocol + '//' + loc.host;\n\t\n\t  // relative path support\n\t  if ('string' === typeof uri) {\n\t    if ('/' === uri.charAt(0)) {\n\t      if ('/' === uri.charAt(1)) {\n\t        uri = loc.protocol + uri;\n\t      } else {\n\t        uri = loc.host + uri;\n\t      }\n\t    }\n\t\n\t    if (!/^(https?|wss?):\\/\\//.test(uri)) {\n\t\n\t      if ('undefined' !== typeof loc) {\n\t        uri = loc.protocol + '//' + uri;\n\t      } else {\n\t        uri = 'https://' + uri;\n\t      }\n\t    }\n\t\n\t    // parse\n\t\n\t    obj = parseuri(uri);\n\t  }\n\t\n\t  // make sure we treat `localhost:80` and `localhost` equally\n\t  if (!obj.port) {\n\t    if (/^(http|ws)$/.test(obj.protocol)) {\n\t      obj.port = '80';\n\t    } else if (/^(http|ws)s$/.test(obj.protocol)) {\n\t      obj.port = '443';\n\t    }\n\t  }\n\t\n\t  obj.path = obj.path || '/';\n\t\n\t  var ipv6 = obj.host.indexOf(':') !== -1;\n\t  var host = ipv6 ? '[' + obj.host + ']' : obj.host;\n\t\n\t  // define unique id\n\t  obj.id = obj.protocol + '://' + host + ':' + obj.port;\n\t  // define href\n\t  obj.href = obj.protocol + '://' + host + (loc && loc.port === obj.port ? '' : ':' + obj.port);\n\t\n\t  return obj;\n\t}\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\n\t/**\r\n\t * Parses an URI\r\n\t *\r\n\t * @author Steven Levithan <stevenlevithan.com> (MIT license)\r\n\t * @api private\r\n\t */\r\n\t\r\n\tvar re = /^(?:(?![^:@]+:[^:@\\/]*@)(http|https|ws|wss):\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/;\r\n\t\r\n\tvar parts = [\r\n\t    'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'\r\n\t];\r\n\t\r\n\tmodule.exports = function parseuri(str) {\r\n\t    var src = str,\r\n\t        b = str.indexOf('['),\r\n\t        e = str.indexOf(']');\r\n\t\r\n\t    if (b != -1 && e != -1) {\r\n\t        str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length);\r\n\t    }\r\n\t\r\n\t    var m = re.exec(str || ''),\r\n\t        uri = {},\r\n\t        i = 14;\r\n\t\r\n\t    while (i--) {\r\n\t        uri[parts[i]] = m[i] || '';\r\n\t    }\r\n\t\r\n\t    if (b != -1 && e != -1) {\r\n\t        uri.source = src;\r\n\t        uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':');\r\n\t        uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':');\r\n\t        uri.ipv6uri = true;\r\n\t    }\r\n\t\r\n\t    return uri;\r\n\t};\r\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\n\t\"use strict\";\n\t\n\tmodule.exports = function () {\n\t  return function () {};\n\t};\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t\n\t/**\n\t * Module dependencies.\n\t */\n\t\n\tvar debug = __webpack_require__(3)('socket.io-parser');\n\tvar Emitter = __webpack_require__(5);\n\tvar hasBin = __webpack_require__(6);\n\tvar binary = __webpack_require__(8);\n\tvar isBuf = __webpack_require__(9);\n\t\n\t/**\n\t * Protocol version.\n\t *\n\t * @api public\n\t */\n\t\n\texports.protocol = 4;\n\t\n\t/**\n\t * Packet types.\n\t *\n\t * @api public\n\t */\n\t\n\texports.types = [\n\t  'CONNECT',\n\t  'DISCONNECT',\n\t  'EVENT',\n\t  'ACK',\n\t  'ERROR',\n\t  'BINARY_EVENT',\n\t  'BINARY_ACK'\n\t];\n\t\n\t/**\n\t * Packet type `connect`.\n\t *\n\t * @api public\n\t */\n\t\n\texports.CONNECT = 0;\n\t\n\t/**\n\t * Packet type `disconnect`.\n\t *\n\t * @api public\n\t */\n\t\n\texports.DISCONNECT = 1;\n\t\n\t/**\n\t * Packet type `event`.\n\t *\n\t * @api public\n\t */\n\t\n\texports.EVENT = 2;\n\t\n\t/**\n\t * Packet type `ack`.\n\t *\n\t * @api public\n\t */\n\t\n\texports.ACK = 3;\n\t\n\t/**\n\t * Packet type `error`.\n\t *\n\t * @api public\n\t */\n\t\n\texports.ERROR = 4;\n\t\n\t/**\n\t * Packet type 'binary event'\n\t *\n\t * @api public\n\t */\n\t\n\texports.BINARY_EVENT = 5;\n\t\n\t/**\n\t * Packet type `binary ack`. For acks with binary arguments.\n\t *\n\t * @api public\n\t */\n\t\n\texports.BINARY_ACK = 6;\n\t\n\t/**\n\t * Encoder constructor.\n\t *\n\t * @api public\n\t */\n\t\n\texports.Encoder = Encoder;\n\t\n\t/**\n\t * Decoder constructor.\n\t *\n\t * @api public\n\t */\n\t\n\texports.Decoder = Decoder;\n\t\n\t/**\n\t * A socket.io Encoder instance\n\t *\n\t * @api public\n\t */\n\t\n\tfunction Encoder() {}\n\t\n\t/**\n\t * Encode a packet as a single string if non-binary, or as a\n\t * buffer sequence, depending on packet type.\n\t *\n\t * @param {Object} obj - packet object\n\t * @param {Function} callback - function to handle encodings (likely engine.write)\n\t * @return Calls callback with Array of encodings\n\t * @api public\n\t */\n\t\n\tEncoder.prototype.encode = function(obj, callback){\n\t  if ((obj.type === exports.EVENT || obj.type === exports.ACK) && hasBin(obj.data)) {\n\t    obj.type = obj.type === exports.EVENT ? exports.BINARY_EVENT : exports.BINARY_ACK;\n\t  }\n\t\n\t\n\t\n\t  if (exports.BINARY_EVENT === obj.type || exports.BINARY_ACK === obj.type) {\n\t    encodeAsBinary(obj, callback);\n\t  }\n\t  else {\n\t    var encoding = encodeAsString(obj);\n\t    callback([encoding]);\n\t  }\n\t};\n\t\n\t/**\n\t * Encode packet as string.\n\t *\n\t * @param {Object} packet\n\t * @return {String} encoded\n\t * @api private\n\t */\n\t\n\tfunction encodeAsString(obj) {\n\t\n\t  // first is type\n\t  var str = '' + obj.type;\n\t\n\t  // attachments if we have them\n\t  if (exports.BINARY_EVENT === obj.type || exports.BINARY_ACK === obj.type) {\n\t    str += obj.attachments + '-';\n\t  }\n\t\n\t  // if we have a namespace other than `/`\n\t  // we append it followed by a comma `,`\n\t  if (obj.nsp && '/' !== obj.nsp) {\n\t    str += obj.nsp + ',';\n\t  }\n\t\n\t  // immediately followed by the id\n\t  if (null != obj.id) {\n\t    str += obj.id;\n\t  }\n\t\n\t  // json data\n\t  if (null != obj.data) {\n\t    str += JSON.stringify(obj.data);\n\t  }\n\t\n\t\n\t  return str;\n\t}\n\t\n\t/**\n\t * Encode packet as 'buffer sequence' by removing blobs, and\n\t * deconstructing packet into object with placeholders and\n\t * a list of buffers.\n\t *\n\t * @param {Object} packet\n\t * @return {Buffer} encoded\n\t * @api private\n\t */\n\t\n\tfunction encodeAsBinary(obj, callback) {\n\t\n\t  function writeEncoding(bloblessData) {\n\t    var deconstruction = binary.deconstructPacket(bloblessData);\n\t    var pack = encodeAsString(deconstruction.packet);\n\t    var buffers = deconstruction.buffers;\n\t\n\t    buffers.unshift(pack); // add packet info to beginning of data list\n\t    callback(buffers); // write all the buffers\n\t  }\n\t\n\t  binary.removeBlobs(obj, writeEncoding);\n\t}\n\t\n\t/**\n\t * A socket.io Decoder instance\n\t *\n\t * @return {Object} decoder\n\t * @api public\n\t */\n\t\n\tfunction Decoder() {\n\t  this.reconstructor = null;\n\t}\n\t\n\t/**\n\t * Mix in `Emitter` with Decoder.\n\t */\n\t\n\tEmitter(Decoder.prototype);\n\t\n\t/**\n\t * Decodes an ecoded packet string into packet JSON.\n\t *\n\t * @param {String} obj - encoded packet\n\t * @return {Object} packet\n\t * @api public\n\t */\n\t\n\tDecoder.prototype.add = function(obj) {\n\t  var packet;\n\t  if (typeof obj === 'string') {\n\t    packet = decodeString(obj);\n\t    if (exports.BINARY_EVENT === packet.type || exports.BINARY_ACK === packet.type) { // binary packet's json\n\t      this.reconstructor = new BinaryReconstructor(packet);\n\t\n\t      // no attachments, labeled binary but no binary data to follow\n\t      if (this.reconstructor.reconPack.attachments === 0) {\n\t        this.emit('decoded', packet);\n\t      }\n\t    } else { // non-binary full packet\n\t      this.emit('decoded', packet);\n\t    }\n\t  }\n\t  else if (isBuf(obj) || obj.base64) { // raw binary data\n\t    if (!this.reconstructor) {\n\t      throw new Error('got binary data when not reconstructing a packet');\n\t    } else {\n\t      packet = this.reconstructor.takeBinaryData(obj);\n\t      if (packet) { // received final buffer\n\t        this.reconstructor = null;\n\t        this.emit('decoded', packet);\n\t      }\n\t    }\n\t  }\n\t  else {\n\t    throw new Error('Unknown type: ' + obj);\n\t  }\n\t};\n\t\n\t/**\n\t * Decode a packet String (JSON data)\n\t *\n\t * @param {String} str\n\t * @return {Object} packet\n\t * @api private\n\t */\n\t\n\tfunction decodeString(str) {\n\t  var i = 0;\n\t  // look up type\n\t  var p = {\n\t    type: Number(str.charAt(0))\n\t  };\n\t\n\t  if (null == exports.types[p.type]) return error();\n\t\n\t  // look up attachments if type binary\n\t  if (exports.BINARY_EVENT === p.type || exports.BINARY_ACK === p.type) {\n\t    var buf = '';\n\t    while (str.charAt(++i) !== '-') {\n\t      buf += str.charAt(i);\n\t      if (i == str.length) break;\n\t    }\n\t    if (buf != Number(buf) || str.charAt(i) !== '-') {\n\t      throw new Error('Illegal attachments');\n\t    }\n\t    p.attachments = Number(buf);\n\t  }\n\t\n\t  // look up namespace (if any)\n\t  if ('/' === str.charAt(i + 1)) {\n\t    p.nsp = '';\n\t    while (++i) {\n\t      var c = str.charAt(i);\n\t      if (',' === c) break;\n\t      p.nsp += c;\n\t      if (i === str.length) break;\n\t    }\n\t  } else {\n\t    p.nsp = '/';\n\t  }\n\t\n\t  // look up id\n\t  var next = str.charAt(i + 1);\n\t  if ('' !== next && Number(next) == next) {\n\t    p.id = '';\n\t    while (++i) {\n\t      var c = str.charAt(i);\n\t      if (null == c || Number(c) != c) {\n\t        --i;\n\t        break;\n\t      }\n\t      p.id += str.charAt(i);\n\t      if (i === str.length) break;\n\t    }\n\t    p.id = Number(p.id);\n\t  }\n\t\n\t  // look up json data\n\t  if (str.charAt(++i)) {\n\t    p = tryParse(p, str.substr(i));\n\t  }\n\t\n\t\n\t  return p;\n\t}\n\t\n\tfunction tryParse(p, str) {\n\t  try {\n\t    p.data = JSON.parse(str);\n\t  } catch(e){\n\t    return error();\n\t  }\n\t  return p; \n\t}\n\t\n\t/**\n\t * Deallocates a parser's resources\n\t *\n\t * @api public\n\t */\n\t\n\tDecoder.prototype.destroy = function() {\n\t  if (this.reconstructor) {\n\t    this.reconstructor.finishedReconstruction();\n\t  }\n\t};\n\t\n\t/**\n\t * A manager of a binary event's 'buffer sequence'. Should\n\t * be constructed whenever a packet of type BINARY_EVENT is\n\t * decoded.\n\t *\n\t * @param {Object} packet\n\t * @return {BinaryReconstructor} initialized reconstructor\n\t * @api private\n\t */\n\t\n\tfunction BinaryReconstructor(packet) {\n\t  this.reconPack = packet;\n\t  this.buffers = [];\n\t}\n\t\n\t/**\n\t * Method to be called when binary data received from connection\n\t * after a BINARY_EVENT packet.\n\t *\n\t * @param {Buffer | ArrayBuffer} binData - the raw binary data received\n\t * @return {null | Object} returns null if more binary data is expected or\n\t *   a reconstructed packet object if all buffers have been received.\n\t * @api private\n\t */\n\t\n\tBinaryReconstructor.prototype.takeBinaryData = function(binData) {\n\t  this.buffers.push(binData);\n\t  if (this.buffers.length === this.reconPack.attachments) { // done with buffer list\n\t    var packet = binary.reconstructPacket(this.reconPack, this.buffers);\n\t    this.finishedReconstruction();\n\t    return packet;\n\t  }\n\t  return null;\n\t};\n\t\n\t/**\n\t * Cleans up binary packet reconstruction variables.\n\t *\n\t * @api private\n\t */\n\t\n\tBinaryReconstructor.prototype.finishedReconstruction = function() {\n\t  this.reconPack = null;\n\t  this.buffers = [];\n\t};\n\t\n\tfunction error() {\n\t  return {\n\t    type: exports.ERROR,\n\t    data: 'parser error'\n\t  };\n\t}\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t\r\n\t/**\r\n\t * Expose `Emitter`.\r\n\t */\r\n\t\r\n\tif (true) {\r\n\t  module.exports = Emitter;\r\n\t}\r\n\t\r\n\t/**\r\n\t * Initialize a new `Emitter`.\r\n\t *\r\n\t * @api public\r\n\t */\r\n\t\r\n\tfunction Emitter(obj) {\r\n\t  if (obj) return mixin(obj);\r\n\t};\r\n\t\r\n\t/**\r\n\t * Mixin the emitter properties.\r\n\t *\r\n\t * @param {Object} obj\r\n\t * @return {Object}\r\n\t * @api private\r\n\t */\r\n\t\r\n\tfunction mixin(obj) {\r\n\t  for (var key in Emitter.prototype) {\r\n\t    obj[key] = Emitter.prototype[key];\r\n\t  }\r\n\t  return obj;\r\n\t}\r\n\t\r\n\t/**\r\n\t * Listen on the given `event` with `fn`.\r\n\t *\r\n\t * @param {String} event\r\n\t * @param {Function} fn\r\n\t * @return {Emitter}\r\n\t * @api public\r\n\t */\r\n\t\r\n\tEmitter.prototype.on =\r\n\tEmitter.prototype.addEventListener = function(event, fn){\r\n\t  this._callbacks = this._callbacks || {};\r\n\t  (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\r\n\t    .push(fn);\r\n\t  return this;\r\n\t};\r\n\t\r\n\t/**\r\n\t * Adds an `event` listener that will be invoked a single\r\n\t * time then automatically removed.\r\n\t *\r\n\t * @param {String} event\r\n\t * @param {Function} fn\r\n\t * @return {Emitter}\r\n\t * @api public\r\n\t */\r\n\t\r\n\tEmitter.prototype.once = function(event, fn){\r\n\t  function on() {\r\n\t    this.off(event, on);\r\n\t    fn.apply(this, arguments);\r\n\t  }\r\n\t\r\n\t  on.fn = fn;\r\n\t  this.on(event, on);\r\n\t  return this;\r\n\t};\r\n\t\r\n\t/**\r\n\t * Remove the given callback for `event` or all\r\n\t * registered callbacks.\r\n\t *\r\n\t * @param {String} event\r\n\t * @param {Function} fn\r\n\t * @return {Emitter}\r\n\t * @api public\r\n\t */\r\n\t\r\n\tEmitter.prototype.off =\r\n\tEmitter.prototype.removeListener =\r\n\tEmitter.prototype.removeAllListeners =\r\n\tEmitter.prototype.removeEventListener = function(event, fn){\r\n\t  this._callbacks = this._callbacks || {};\r\n\t\r\n\t  // all\r\n\t  if (0 == arguments.length) {\r\n\t    this._callbacks = {};\r\n\t    return this;\r\n\t  }\r\n\t\r\n\t  // specific event\r\n\t  var callbacks = this._callbacks['$' + event];\r\n\t  if (!callbacks) return this;\r\n\t\r\n\t  // remove all handlers\r\n\t  if (1 == arguments.length) {\r\n\t    delete this._callbacks['$' + event];\r\n\t    return this;\r\n\t  }\r\n\t\r\n\t  // remove specific handler\r\n\t  var cb;\r\n\t  for (var i = 0; i < callbacks.length; i++) {\r\n\t    cb = callbacks[i];\r\n\t    if (cb === fn || cb.fn === fn) {\r\n\t      callbacks.splice(i, 1);\r\n\t      break;\r\n\t    }\r\n\t  }\r\n\t  return this;\r\n\t};\r\n\t\r\n\t/**\r\n\t * Emit `event` with the given args.\r\n\t *\r\n\t * @param {String} event\r\n\t * @param {Mixed} ...\r\n\t * @return {Emitter}\r\n\t */\r\n\t\r\n\tEmitter.prototype.emit = function(event){\r\n\t  this._callbacks = this._callbacks || {};\r\n\t  var args = [].slice.call(arguments, 1)\r\n\t    , callbacks = this._callbacks['$' + event];\r\n\t\r\n\t  if (callbacks) {\r\n\t    callbacks = callbacks.slice(0);\r\n\t    for (var i = 0, len = callbacks.length; i < len; ++i) {\r\n\t      callbacks[i].apply(this, args);\r\n\t    }\r\n\t  }\r\n\t\r\n\t  return this;\r\n\t};\r\n\t\r\n\t/**\r\n\t * Return array of callbacks for `event`.\r\n\t *\r\n\t * @param {String} event\r\n\t * @return {Array}\r\n\t * @api public\r\n\t */\r\n\t\r\n\tEmitter.prototype.listeners = function(event){\r\n\t  this._callbacks = this._callbacks || {};\r\n\t  return this._callbacks['$' + event] || [];\r\n\t};\r\n\t\r\n\t/**\r\n\t * Check if this emitter has `event` handlers.\r\n\t *\r\n\t * @param {String} event\r\n\t * @return {Boolean}\r\n\t * @api public\r\n\t */\r\n\t\r\n\tEmitter.prototype.hasListeners = function(event){\r\n\t  return !! this.listeners(event).length;\r\n\t};\r\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/* global Blob File */\n\t\n\t/*\n\t * Module requirements.\n\t */\n\t\n\tvar isArray = __webpack_require__(7);\n\t\n\tvar toString = Object.prototype.toString;\n\tvar withNativeBlob = typeof global.Blob === 'function' || toString.call(global.Blob) === '[object BlobConstructor]';\n\tvar withNativeFile = typeof global.File === 'function' || toString.call(global.File) === '[object FileConstructor]';\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = hasBinary;\n\t\n\t/**\n\t * Checks for binary data.\n\t *\n\t * Supports Buffer, ArrayBuffer, Blob and File.\n\t *\n\t * @param {Object} anything\n\t * @api public\n\t */\n\t\n\tfunction hasBinary (obj) {\n\t  if (!obj || typeof obj !== 'object') {\n\t    return false;\n\t  }\n\t\n\t  if (isArray(obj)) {\n\t    for (var i = 0, l = obj.length; i < l; i++) {\n\t      if (hasBinary(obj[i])) {\n\t        return true;\n\t      }\n\t    }\n\t    return false;\n\t  }\n\t\n\t  if ((typeof global.Buffer === 'function' && global.Buffer.isBuffer && global.Buffer.isBuffer(obj)) ||\n\t     (typeof global.ArrayBuffer === 'function' && obj instanceof ArrayBuffer) ||\n\t     (withNativeBlob && obj instanceof Blob) ||\n\t     (withNativeFile && obj instanceof File)\n\t    ) {\n\t    return true;\n\t  }\n\t\n\t  // see: https://github.com/Automattic/has-binary/pull/4\n\t  if (obj.toJSON && typeof obj.toJSON === 'function' && arguments.length === 1) {\n\t    return hasBinary(obj.toJSON(), true);\n\t  }\n\t\n\t  for (var key in obj) {\n\t    if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) {\n\t      return true;\n\t    }\n\t  }\n\t\n\t  return false;\n\t}\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports) {\n\n\tvar toString = {}.toString;\n\t\n\tmodule.exports = Array.isArray || function (arr) {\n\t  return toString.call(arr) == '[object Array]';\n\t};\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/*global Blob,File*/\n\t\n\t/**\n\t * Module requirements\n\t */\n\t\n\tvar isArray = __webpack_require__(7);\n\tvar isBuf = __webpack_require__(9);\n\tvar toString = Object.prototype.toString;\n\tvar withNativeBlob = typeof global.Blob === 'function' || toString.call(global.Blob) === '[object BlobConstructor]';\n\tvar withNativeFile = typeof global.File === 'function' || toString.call(global.File) === '[object FileConstructor]';\n\t\n\t/**\n\t * Replaces every Buffer | ArrayBuffer in packet with a numbered placeholder.\n\t * Anything with blobs or files should be fed through removeBlobs before coming\n\t * here.\n\t *\n\t * @param {Object} packet - socket.io event packet\n\t * @return {Object} with deconstructed packet and list of buffers\n\t * @api public\n\t */\n\t\n\texports.deconstructPacket = function(packet) {\n\t  var buffers = [];\n\t  var packetData = packet.data;\n\t  var pack = packet;\n\t  pack.data = _deconstructPacket(packetData, buffers);\n\t  pack.attachments = buffers.length; // number of binary 'attachments'\n\t  return {packet: pack, buffers: buffers};\n\t};\n\t\n\tfunction _deconstructPacket(data, buffers) {\n\t  if (!data) return data;\n\t\n\t  if (isBuf(data)) {\n\t    var placeholder = { _placeholder: true, num: buffers.length };\n\t    buffers.push(data);\n\t    return placeholder;\n\t  } else if (isArray(data)) {\n\t    var newData = new Array(data.length);\n\t    for (var i = 0; i < data.length; i++) {\n\t      newData[i] = _deconstructPacket(data[i], buffers);\n\t    }\n\t    return newData;\n\t  } else if (typeof data === 'object' && !(data instanceof Date)) {\n\t    var newData = {};\n\t    for (var key in data) {\n\t      newData[key] = _deconstructPacket(data[key], buffers);\n\t    }\n\t    return newData;\n\t  }\n\t  return data;\n\t}\n\t\n\t/**\n\t * Reconstructs a binary packet from its placeholder packet and buffers\n\t *\n\t * @param {Object} packet - event packet with placeholders\n\t * @param {Array} buffers - binary buffers to put in placeholder positions\n\t * @return {Object} reconstructed packet\n\t * @api public\n\t */\n\t\n\texports.reconstructPacket = function(packet, buffers) {\n\t  packet.data = _reconstructPacket(packet.data, buffers);\n\t  packet.attachments = undefined; // no longer useful\n\t  return packet;\n\t};\n\t\n\tfunction _reconstructPacket(data, buffers) {\n\t  if (!data) return data;\n\t\n\t  if (data && data._placeholder) {\n\t    return buffers[data.num]; // appropriate buffer (should be natural order anyway)\n\t  } else if (isArray(data)) {\n\t    for (var i = 0; i < data.length; i++) {\n\t      data[i] = _reconstructPacket(data[i], buffers);\n\t    }\n\t  } else if (typeof data === 'object') {\n\t    for (var key in data) {\n\t      data[key] = _reconstructPacket(data[key], buffers);\n\t    }\n\t  }\n\t\n\t  return data;\n\t}\n\t\n\t/**\n\t * Asynchronously removes Blobs or Files from data via\n\t * FileReader's readAsArrayBuffer method. Used before encoding\n\t * data as msgpack. Calls callback with the blobless data.\n\t *\n\t * @param {Object} data\n\t * @param {Function} callback\n\t * @api private\n\t */\n\t\n\texports.removeBlobs = function(data, callback) {\n\t  function _removeBlobs(obj, curKey, containingObject) {\n\t    if (!obj) return obj;\n\t\n\t    // convert any blob\n\t    if ((withNativeBlob && obj instanceof Blob) ||\n\t        (withNativeFile && obj instanceof File)) {\n\t      pendingBlobs++;\n\t\n\t      // async filereader\n\t      var fileReader = new FileReader();\n\t      fileReader.onload = function() { // this.result == arraybuffer\n\t        if (containingObject) {\n\t          containingObject[curKey] = this.result;\n\t        }\n\t        else {\n\t          bloblessData = this.result;\n\t        }\n\t\n\t        // if nothing pending its callback time\n\t        if(! --pendingBlobs) {\n\t          callback(bloblessData);\n\t        }\n\t      };\n\t\n\t      fileReader.readAsArrayBuffer(obj); // blob -> arraybuffer\n\t    } else if (isArray(obj)) { // handle array\n\t      for (var i = 0; i < obj.length; i++) {\n\t        _removeBlobs(obj[i], i, obj);\n\t      }\n\t    } else if (typeof obj === 'object' && !isBuf(obj)) { // and object\n\t      for (var key in obj) {\n\t        _removeBlobs(obj[key], key, obj);\n\t      }\n\t    }\n\t  }\n\t\n\t  var pendingBlobs = 0;\n\t  var bloblessData = data;\n\t  _removeBlobs(bloblessData);\n\t  if (!pendingBlobs) {\n\t    callback(bloblessData);\n\t  }\n\t};\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {\n\tmodule.exports = isBuf;\n\t\n\t/**\n\t * Returns true if obj is a buffer or an arraybuffer.\n\t *\n\t * @api private\n\t */\n\t\n\tfunction isBuf(obj) {\n\t  return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t         (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\t\n\t/**\n\t * Module dependencies.\n\t */\n\t\n\tvar eio = __webpack_require__(11);\n\tvar Socket = __webpack_require__(36);\n\tvar Emitter = __webpack_require__(5);\n\tvar parser = __webpack_require__(4);\n\tvar on = __webpack_require__(38);\n\tvar bind = __webpack_require__(39);\n\tvar debug = __webpack_require__(3)('socket.io-client:manager');\n\tvar indexOf = __webpack_require__(34);\n\tvar Backoff = __webpack_require__(40);\n\t\n\t/**\n\t * IE6+ hasOwnProperty\n\t */\n\t\n\tvar has = Object.prototype.hasOwnProperty;\n\t\n\t/**\n\t * Module exports\n\t */\n\t\n\tmodule.exports = Manager;\n\t\n\t/**\n\t * `Manager` constructor.\n\t *\n\t * @param {String} engine instance or engine uri/opts\n\t * @param {Object} options\n\t * @api public\n\t */\n\t\n\tfunction Manager(uri, opts) {\n\t  if (!(this instanceof Manager)) return new Manager(uri, opts);\n\t  if (uri && 'object' === (typeof uri === 'undefined' ? 'undefined' : _typeof(uri))) {\n\t    opts = uri;\n\t    uri = undefined;\n\t  }\n\t  opts = opts || {};\n\t\n\t  opts.path = opts.path || '/socket.io';\n\t  this.nsps = {};\n\t  this.subs = [];\n\t  this.opts = opts;\n\t  this.reconnection(opts.reconnection !== false);\n\t  this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);\n\t  this.reconnectionDelay(opts.reconnectionDelay || 1000);\n\t  this.reconnectionDelayMax(opts.reconnectionDelayMax || 5000);\n\t  this.randomizationFactor(opts.randomizationFactor || 0.5);\n\t  this.backoff = new Backoff({\n\t    min: this.reconnectionDelay(),\n\t    max: this.reconnectionDelayMax(),\n\t    jitter: this.randomizationFactor()\n\t  });\n\t  this.timeout(null == opts.timeout ? 20000 : opts.timeout);\n\t  this.readyState = 'closed';\n\t  this.uri = uri;\n\t  this.connecting = [];\n\t  this.lastPing = null;\n\t  this.encoding = false;\n\t  this.packetBuffer = [];\n\t  var _parser = opts.parser || parser;\n\t  this.encoder = new _parser.Encoder();\n\t  this.decoder = new _parser.Decoder();\n\t  this.autoConnect = opts.autoConnect !== false;\n\t  if (this.autoConnect) this.open();\n\t}\n\t\n\t/**\n\t * Propagate given event to sockets and emit on `this`\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.emitAll = function () {\n\t  this.emit.apply(this, arguments);\n\t  for (var nsp in this.nsps) {\n\t    if (has.call(this.nsps, nsp)) {\n\t      this.nsps[nsp].emit.apply(this.nsps[nsp], arguments);\n\t    }\n\t  }\n\t};\n\t\n\t/**\n\t * Update `socket.id` of all sockets\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.updateSocketIds = function () {\n\t  for (var nsp in this.nsps) {\n\t    if (has.call(this.nsps, nsp)) {\n\t      this.nsps[nsp].id = this.generateId(nsp);\n\t    }\n\t  }\n\t};\n\t\n\t/**\n\t * generate `socket.id` for the given `nsp`\n\t *\n\t * @param {String} nsp\n\t * @return {String}\n\t * @api private\n\t */\n\t\n\tManager.prototype.generateId = function (nsp) {\n\t  return (nsp === '/' ? '' : nsp + '#') + this.engine.id;\n\t};\n\t\n\t/**\n\t * Mix in `Emitter`.\n\t */\n\t\n\tEmitter(Manager.prototype);\n\t\n\t/**\n\t * Sets the `reconnection` config.\n\t *\n\t * @param {Boolean} true/false if it should automatically reconnect\n\t * @return {Manager} self or value\n\t * @api public\n\t */\n\t\n\tManager.prototype.reconnection = function (v) {\n\t  if (!arguments.length) return this._reconnection;\n\t  this._reconnection = !!v;\n\t  return this;\n\t};\n\t\n\t/**\n\t * Sets the reconnection attempts config.\n\t *\n\t * @param {Number} max reconnection attempts before giving up\n\t * @return {Manager} self or value\n\t * @api public\n\t */\n\t\n\tManager.prototype.reconnectionAttempts = function (v) {\n\t  if (!arguments.length) return this._reconnectionAttempts;\n\t  this._reconnectionAttempts = v;\n\t  return this;\n\t};\n\t\n\t/**\n\t * Sets the delay between reconnections.\n\t *\n\t * @param {Number} delay\n\t * @return {Manager} self or value\n\t * @api public\n\t */\n\t\n\tManager.prototype.reconnectionDelay = function (v) {\n\t  if (!arguments.length) return this._reconnectionDelay;\n\t  this._reconnectionDelay = v;\n\t  this.backoff && this.backoff.setMin(v);\n\t  return this;\n\t};\n\t\n\tManager.prototype.randomizationFactor = function (v) {\n\t  if (!arguments.length) return this._randomizationFactor;\n\t  this._randomizationFactor = v;\n\t  this.backoff && this.backoff.setJitter(v);\n\t  return this;\n\t};\n\t\n\t/**\n\t * Sets the maximum delay between reconnections.\n\t *\n\t * @param {Number} delay\n\t * @return {Manager} self or value\n\t * @api public\n\t */\n\t\n\tManager.prototype.reconnectionDelayMax = function (v) {\n\t  if (!arguments.length) return this._reconnectionDelayMax;\n\t  this._reconnectionDelayMax = v;\n\t  this.backoff && this.backoff.setMax(v);\n\t  return this;\n\t};\n\t\n\t/**\n\t * Sets the connection timeout. `false` to disable\n\t *\n\t * @return {Manager} self or value\n\t * @api public\n\t */\n\t\n\tManager.prototype.timeout = function (v) {\n\t  if (!arguments.length) return this._timeout;\n\t  this._timeout = v;\n\t  return this;\n\t};\n\t\n\t/**\n\t * Starts trying to reconnect if reconnection is enabled and we have not\n\t * started reconnecting yet\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.maybeReconnectOnOpen = function () {\n\t  // Only try to reconnect if it's the first time we're connecting\n\t  if (!this.reconnecting && this._reconnection && this.backoff.attempts === 0) {\n\t    // keeps reconnection from firing twice for the same reconnection loop\n\t    this.reconnect();\n\t  }\n\t};\n\t\n\t/**\n\t * Sets the current transport `socket`.\n\t *\n\t * @param {Function} optional, callback\n\t * @return {Manager} self\n\t * @api public\n\t */\n\t\n\tManager.prototype.open = Manager.prototype.connect = function (fn, opts) {\n\t\n\t  if (~this.readyState.indexOf('open')) return this;\n\t\n\t  this.engine = eio(this.uri, this.opts);\n\t  var socket = this.engine;\n\t  var self = this;\n\t  this.readyState = 'opening';\n\t  this.skipReconnect = false;\n\t\n\t  // emit `open`\n\t  var openSub = on(socket, 'open', function () {\n\t    self.onopen();\n\t    fn && fn();\n\t  });\n\t\n\t  // emit `connect_error`\n\t  var errorSub = on(socket, 'error', function (data) {\n\t\n\t    self.cleanup();\n\t    self.readyState = 'closed';\n\t    self.emitAll('connect_error', data);\n\t    if (fn) {\n\t      var err = new Error('Connection error');\n\t      err.data = data;\n\t      fn(err);\n\t    } else {\n\t      // Only do this if there is no fn to handle the error\n\t      self.maybeReconnectOnOpen();\n\t    }\n\t  });\n\t\n\t  // emit `connect_timeout`\n\t  if (false !== this._timeout) {\n\t    var timeout = this._timeout;\n\t\n\t    // set timer\n\t    var timer = setTimeout(function () {\n\t\n\t      openSub.destroy();\n\t      socket.close();\n\t      socket.emit('error', 'timeout');\n\t      self.emitAll('connect_timeout', timeout);\n\t    }, timeout);\n\t\n\t    this.subs.push({\n\t      destroy: function destroy() {\n\t        clearTimeout(timer);\n\t      }\n\t    });\n\t  }\n\t\n\t  this.subs.push(openSub);\n\t  this.subs.push(errorSub);\n\t\n\t  return this;\n\t};\n\t\n\t/**\n\t * Called upon transport open.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.onopen = function () {\n\t\n\t  // clear old subs\n\t  this.cleanup();\n\t\n\t  // mark as open\n\t  this.readyState = 'open';\n\t  this.emit('open');\n\t\n\t  // add new subs\n\t  var socket = this.engine;\n\t  this.subs.push(on(socket, 'data', bind(this, 'ondata')));\n\t  this.subs.push(on(socket, 'ping', bind(this, 'onping')));\n\t  this.subs.push(on(socket, 'pong', bind(this, 'onpong')));\n\t  this.subs.push(on(socket, 'error', bind(this, 'onerror')));\n\t  this.subs.push(on(socket, 'close', bind(this, 'onclose')));\n\t  this.subs.push(on(this.decoder, 'decoded', bind(this, 'ondecoded')));\n\t};\n\t\n\t/**\n\t * Called upon a ping.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.onping = function () {\n\t  this.lastPing = new Date();\n\t  this.emitAll('ping');\n\t};\n\t\n\t/**\n\t * Called upon a packet.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.onpong = function () {\n\t  this.emitAll('pong', new Date() - this.lastPing);\n\t};\n\t\n\t/**\n\t * Called with data.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.ondata = function (data) {\n\t  this.decoder.add(data);\n\t};\n\t\n\t/**\n\t * Called when parser fully decodes a packet.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.ondecoded = function (packet) {\n\t  this.emit('packet', packet);\n\t};\n\t\n\t/**\n\t * Called upon socket error.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.onerror = function (err) {\n\t\n\t  this.emitAll('error', err);\n\t};\n\t\n\t/**\n\t * Creates a new socket for the given `nsp`.\n\t *\n\t * @return {Socket}\n\t * @api public\n\t */\n\t\n\tManager.prototype.socket = function (nsp, opts) {\n\t  var socket = this.nsps[nsp];\n\t  if (!socket) {\n\t    socket = new Socket(this, nsp, opts);\n\t    this.nsps[nsp] = socket;\n\t    var self = this;\n\t    socket.on('connecting', onConnecting);\n\t    socket.on('connect', function () {\n\t      socket.id = self.generateId(nsp);\n\t    });\n\t\n\t    if (this.autoConnect) {\n\t      // manually call here since connecting event is fired before listening\n\t      onConnecting();\n\t    }\n\t  }\n\t\n\t  function onConnecting() {\n\t    if (!~indexOf(self.connecting, socket)) {\n\t      self.connecting.push(socket);\n\t    }\n\t  }\n\t\n\t  return socket;\n\t};\n\t\n\t/**\n\t * Called upon a socket close.\n\t *\n\t * @param {Socket} socket\n\t */\n\t\n\tManager.prototype.destroy = function (socket) {\n\t  var index = indexOf(this.connecting, socket);\n\t  if (~index) this.connecting.splice(index, 1);\n\t  if (this.connecting.length) return;\n\t\n\t  this.close();\n\t};\n\t\n\t/**\n\t * Writes a packet.\n\t *\n\t * @param {Object} packet\n\t * @api private\n\t */\n\t\n\tManager.prototype.packet = function (packet) {\n\t\n\t  var self = this;\n\t  if (packet.query && packet.type === 0) packet.nsp += '?' + packet.query;\n\t\n\t  if (!self.encoding) {\n\t    // encode, then write to engine with result\n\t    self.encoding = true;\n\t    this.encoder.encode(packet, function (encodedPackets) {\n\t      for (var i = 0; i < encodedPackets.length; i++) {\n\t        self.engine.write(encodedPackets[i], packet.options);\n\t      }\n\t      self.encoding = false;\n\t      self.processPacketQueue();\n\t    });\n\t  } else {\n\t    // add packet to the queue\n\t    self.packetBuffer.push(packet);\n\t  }\n\t};\n\t\n\t/**\n\t * If packet buffer is non-empty, begins encoding the\n\t * next packet in line.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.processPacketQueue = function () {\n\t  if (this.packetBuffer.length > 0 && !this.encoding) {\n\t    var pack = this.packetBuffer.shift();\n\t    this.packet(pack);\n\t  }\n\t};\n\t\n\t/**\n\t * Clean up transport subscriptions and packet buffer.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.cleanup = function () {\n\t\n\t  var subsLength = this.subs.length;\n\t  for (var i = 0; i < subsLength; i++) {\n\t    var sub = this.subs.shift();\n\t    sub.destroy();\n\t  }\n\t\n\t  this.packetBuffer = [];\n\t  this.encoding = false;\n\t  this.lastPing = null;\n\t\n\t  this.decoder.destroy();\n\t};\n\t\n\t/**\n\t * Close the current socket.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.close = Manager.prototype.disconnect = function () {\n\t\n\t  this.skipReconnect = true;\n\t  this.reconnecting = false;\n\t  if ('opening' === this.readyState) {\n\t    // `onclose` will not fire because\n\t    // an open event never happened\n\t    this.cleanup();\n\t  }\n\t  this.backoff.reset();\n\t  this.readyState = 'closed';\n\t  if (this.engine) this.engine.close();\n\t};\n\t\n\t/**\n\t * Called upon engine close.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.onclose = function (reason) {\n\t\n\t  this.cleanup();\n\t  this.backoff.reset();\n\t  this.readyState = 'closed';\n\t  this.emit('close', reason);\n\t\n\t  if (this._reconnection && !this.skipReconnect) {\n\t    this.reconnect();\n\t  }\n\t};\n\t\n\t/**\n\t * Attempt a reconnection.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.reconnect = function () {\n\t  if (this.reconnecting || this.skipReconnect) return this;\n\t\n\t  var self = this;\n\t\n\t  if (this.backoff.attempts >= this._reconnectionAttempts) {\n\t\n\t    this.backoff.reset();\n\t    this.emitAll('reconnect_failed');\n\t    this.reconnecting = false;\n\t  } else {\n\t    var delay = this.backoff.duration();\n\t\n\t    this.reconnecting = true;\n\t    var timer = setTimeout(function () {\n\t      if (self.skipReconnect) return;\n\t\n\t      self.emitAll('reconnect_attempt', self.backoff.attempts);\n\t      self.emitAll('reconnecting', self.backoff.attempts);\n\t\n\t      // check again for the case socket closed in above events\n\t      if (self.skipReconnect) return;\n\t\n\t      self.open(function (err) {\n\t        if (err) {\n\t\n\t          self.reconnecting = false;\n\t          self.reconnect();\n\t          self.emitAll('reconnect_error', err.data);\n\t        } else {\n\t\n\t          self.onreconnect();\n\t        }\n\t      });\n\t    }, delay);\n\t\n\t    this.subs.push({\n\t      destroy: function destroy() {\n\t        clearTimeout(timer);\n\t      }\n\t    });\n\t  }\n\t};\n\t\n\t/**\n\t * Called upon successful reconnect.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.onreconnect = function () {\n\t  var attempt = this.backoff.attempts;\n\t  this.reconnecting = false;\n\t  this.backoff.reset();\n\t  this.updateSocketIds();\n\t  this.emitAll('reconnect', attempt);\n\t};\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t\n\tmodule.exports = __webpack_require__(12);\n\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t\n\tmodule.exports = __webpack_require__(13);\n\t\n\t/**\n\t * Exports parser\n\t *\n\t * @api public\n\t *\n\t */\n\tmodule.exports.parser = __webpack_require__(20);\n\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/**\n\t * Module dependencies.\n\t */\n\t\n\tvar transports = __webpack_require__(14);\n\tvar Emitter = __webpack_require__(5);\n\tvar debug = __webpack_require__(3)('engine.io-client:socket');\n\tvar index = __webpack_require__(34);\n\tvar parser = __webpack_require__(20);\n\tvar parseuri = __webpack_require__(2);\n\tvar parsejson = __webpack_require__(35);\n\tvar parseqs = __webpack_require__(28);\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = Socket;\n\t\n\t/**\n\t * Socket constructor.\n\t *\n\t * @param {String|Object} uri or options\n\t * @param {Object} options\n\t * @api public\n\t */\n\t\n\tfunction Socket (uri, opts) {\n\t  if (!(this instanceof Socket)) return new Socket(uri, opts);\n\t\n\t  opts = opts || {};\n\t\n\t  if (uri && 'object' === typeof uri) {\n\t    opts = uri;\n\t    uri = null;\n\t  }\n\t\n\t  if (uri) {\n\t    uri = parseuri(uri);\n\t    opts.hostname = uri.host;\n\t    opts.secure = uri.protocol === 'https' || uri.protocol === 'wss';\n\t    opts.port = uri.port;\n\t    if (uri.query) opts.query = uri.query;\n\t  } else if (opts.host) {\n\t    opts.hostname = parseuri(opts.host).host;\n\t  }\n\t\n\t  this.secure = null != opts.secure ? opts.secure\n\t    : (global.location && 'https:' === location.protocol);\n\t\n\t  if (opts.hostname && !opts.port) {\n\t    // if no port is specified manually, use the protocol default\n\t    opts.port = this.secure ? '443' : '80';\n\t  }\n\t\n\t  this.agent = opts.agent || false;\n\t  this.hostname = opts.hostname ||\n\t    (global.location ? location.hostname : 'localhost');\n\t  this.port = opts.port || (global.location && location.port\n\t      ? location.port\n\t      : (this.secure ? 443 : 80));\n\t  this.query = opts.query || {};\n\t  if ('string' === typeof this.query) this.query = parseqs.decode(this.query);\n\t  this.upgrade = false !== opts.upgrade;\n\t  this.path = (opts.path || '/engine.io').replace(/\\/$/, '') + '/';\n\t  this.forceJSONP = !!opts.forceJSONP;\n\t  this.jsonp = false !== opts.jsonp;\n\t  this.forceBase64 = !!opts.forceBase64;\n\t  this.enablesXDR = !!opts.enablesXDR;\n\t  this.timestampParam = opts.timestampParam || 't';\n\t  this.timestampRequests = opts.timestampRequests;\n\t  this.transports = opts.transports || ['polling', 'websocket'];\n\t  this.transportOptions = opts.transportOptions || {};\n\t  this.readyState = '';\n\t  this.writeBuffer = [];\n\t  this.prevBufferLen = 0;\n\t  this.policyPort = opts.policyPort || 843;\n\t  this.rememberUpgrade = opts.rememberUpgrade || false;\n\t  this.binaryType = null;\n\t  this.onlyBinaryUpgrades = opts.onlyBinaryUpgrades;\n\t  this.perMessageDeflate = false !== opts.perMessageDeflate ? (opts.perMessageDeflate || {}) : false;\n\t\n\t  if (true === this.perMessageDeflate) this.perMessageDeflate = {};\n\t  if (this.perMessageDeflate && null == this.perMessageDeflate.threshold) {\n\t    this.perMessageDeflate.threshold = 1024;\n\t  }\n\t\n\t  // SSL options for Node.js client\n\t  this.pfx = opts.pfx || null;\n\t  this.key = opts.key || null;\n\t  this.passphrase = opts.passphrase || null;\n\t  this.cert = opts.cert || null;\n\t  this.ca = opts.ca || null;\n\t  this.ciphers = opts.ciphers || null;\n\t  this.rejectUnauthorized = opts.rejectUnauthorized === undefined ? true : opts.rejectUnauthorized;\n\t  this.forceNode = !!opts.forceNode;\n\t\n\t  // other options for Node.js client\n\t  var freeGlobal = typeof global === 'object' && global;\n\t  if (freeGlobal.global === freeGlobal) {\n\t    if (opts.extraHeaders && Object.keys(opts.extraHeaders).length > 0) {\n\t      this.extraHeaders = opts.extraHeaders;\n\t    }\n\t\n\t    if (opts.localAddress) {\n\t      this.localAddress = opts.localAddress;\n\t    }\n\t  }\n\t\n\t  // set on handshake\n\t  this.id = null;\n\t  this.upgrades = null;\n\t  this.pingInterval = null;\n\t  this.pingTimeout = null;\n\t\n\t  // set on heartbeat\n\t  this.pingIntervalTimer = null;\n\t  this.pingTimeoutTimer = null;\n\t\n\t  this.open();\n\t}\n\t\n\tSocket.priorWebsocketSuccess = false;\n\t\n\t/**\n\t * Mix in `Emitter`.\n\t */\n\t\n\tEmitter(Socket.prototype);\n\t\n\t/**\n\t * Protocol version.\n\t *\n\t * @api public\n\t */\n\t\n\tSocket.protocol = parser.protocol; // this is an int\n\t\n\t/**\n\t * Expose deps for legacy compatibility\n\t * and standalone browser access.\n\t */\n\t\n\tSocket.Socket = Socket;\n\tSocket.Transport = __webpack_require__(19);\n\tSocket.transports = __webpack_require__(14);\n\tSocket.parser = __webpack_require__(20);\n\t\n\t/**\n\t * Creates transport of the given type.\n\t *\n\t * @param {String} transport name\n\t * @return {Transport}\n\t * @api private\n\t */\n\t\n\tSocket.prototype.createTransport = function (name) {\n\t\n\t  var query = clone(this.query);\n\t\n\t  // append engine.io protocol identifier\n\t  query.EIO = parser.protocol;\n\t\n\t  // transport name\n\t  query.transport = name;\n\t\n\t  // per-transport options\n\t  var options = this.transportOptions[name] || {};\n\t\n\t  // session id if we already have one\n\t  if (this.id) query.sid = this.id;\n\t\n\t  var transport = new transports[name]({\n\t    query: query,\n\t    socket: this,\n\t    agent: options.agent || this.agent,\n\t    hostname: options.hostname || this.hostname,\n\t    port: options.port || this.port,\n\t    secure: options.secure || this.secure,\n\t    path: options.path || this.path,\n\t    forceJSONP: options.forceJSONP || this.forceJSONP,\n\t    jsonp: options.jsonp || this.jsonp,\n\t    forceBase64: options.forceBase64 || this.forceBase64,\n\t    enablesXDR: options.enablesXDR || this.enablesXDR,\n\t    timestampRequests: options.timestampRequests || this.timestampRequests,\n\t    timestampParam: options.timestampParam || this.timestampParam,\n\t    policyPort: options.policyPort || this.policyPort,\n\t    pfx: options.pfx || this.pfx,\n\t    key: options.key || this.key,\n\t    passphrase: options.passphrase || this.passphrase,\n\t    cert: options.cert || this.cert,\n\t    ca: options.ca || this.ca,\n\t    ciphers: options.ciphers || this.ciphers,\n\t    rejectUnauthorized: options.rejectUnauthorized || this.rejectUnauthorized,\n\t    perMessageDeflate: options.perMessageDeflate || this.perMessageDeflate,\n\t    extraHeaders: options.extraHeaders || this.extraHeaders,\n\t    forceNode: options.forceNode || this.forceNode,\n\t    localAddress: options.localAddress || this.localAddress,\n\t    requestTimeout: options.requestTimeout || this.requestTimeout,\n\t    protocols: options.protocols || void (0)\n\t  });\n\t\n\t  return transport;\n\t};\n\t\n\tfunction clone (obj) {\n\t  var o = {};\n\t  for (var i in obj) {\n\t    if (obj.hasOwnProperty(i)) {\n\t      o[i] = obj[i];\n\t    }\n\t  }\n\t  return o;\n\t}\n\t\n\t/**\n\t * Initializes transport to use and starts probe.\n\t *\n\t * @api private\n\t */\n\tSocket.prototype.open = function () {\n\t  var transport;\n\t  if (this.rememberUpgrade && Socket.priorWebsocketSuccess && this.transports.indexOf('websocket') !== -1) {\n\t    transport = 'websocket';\n\t  } else if (0 === this.transports.length) {\n\t    // Emit error on next tick so it can be listened to\n\t    var self = this;\n\t    setTimeout(function () {\n\t      self.emit('error', 'No transports available');\n\t    }, 0);\n\t    return;\n\t  } else {\n\t    transport = this.transports[0];\n\t  }\n\t  this.readyState = 'opening';\n\t\n\t  // Retry with the next transport if the transport is disabled (jsonp: false)\n\t  try {\n\t    transport = this.createTransport(transport);\n\t  } catch (e) {\n\t    this.transports.shift();\n\t    this.open();\n\t    return;\n\t  }\n\t\n\t  transport.open();\n\t  this.setTransport(transport);\n\t};\n\t\n\t/**\n\t * Sets the current transport. Disables the existing one (if any).\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.setTransport = function (transport) {\n\t\n\t  var self = this;\n\t\n\t  if (this.transport) {\n\t\n\t    this.transport.removeAllListeners();\n\t  }\n\t\n\t  // set up transport\n\t  this.transport = transport;\n\t\n\t  // set up transport listeners\n\t  transport\n\t  .on('drain', function () {\n\t    self.onDrain();\n\t  })\n\t  .on('packet', function (packet) {\n\t    self.onPacket(packet);\n\t  })\n\t  .on('error', function (e) {\n\t    self.onError(e);\n\t  })\n\t  .on('close', function () {\n\t    self.onClose('transport close');\n\t  });\n\t};\n\t\n\t/**\n\t * Probes a transport.\n\t *\n\t * @param {String} transport name\n\t * @api private\n\t */\n\t\n\tSocket.prototype.probe = function (name) {\n\t\n\t  var transport = this.createTransport(name, { probe: 1 });\n\t  var failed = false;\n\t  var self = this;\n\t\n\t  Socket.priorWebsocketSuccess = false;\n\t\n\t  function onTransportOpen () {\n\t    if (self.onlyBinaryUpgrades) {\n\t      var upgradeLosesBinary = !this.supportsBinary && self.transport.supportsBinary;\n\t      failed = failed || upgradeLosesBinary;\n\t    }\n\t    if (failed) return;\n\t\n\t\n\t    transport.send([{ type: 'ping', data: 'probe' }]);\n\t    transport.once('packet', function (msg) {\n\t      if (failed) return;\n\t      if ('pong' === msg.type && 'probe' === msg.data) {\n\t\n\t        self.upgrading = true;\n\t        self.emit('upgrading', transport);\n\t        if (!transport) return;\n\t        Socket.priorWebsocketSuccess = 'websocket' === transport.name;\n\t\n\t\n\t        self.transport.pause(function () {\n\t          if (failed) return;\n\t          if ('closed' === self.readyState) return;\n\t\n\t\n\t          cleanup();\n\t\n\t          self.setTransport(transport);\n\t          transport.send([{ type: 'upgrade' }]);\n\t          self.emit('upgrade', transport);\n\t          transport = null;\n\t          self.upgrading = false;\n\t          self.flush();\n\t        });\n\t      } else {\n\t\n\t        var err = new Error('probe error');\n\t        err.transport = transport.name;\n\t        self.emit('upgradeError', err);\n\t      }\n\t    });\n\t  }\n\t\n\t  function freezeTransport () {\n\t    if (failed) return;\n\t\n\t    // Any callback called by transport should be ignored since now\n\t    failed = true;\n\t\n\t    cleanup();\n\t\n\t    transport.close();\n\t    transport = null;\n\t  }\n\t\n\t  // Handle any error that happens while probing\n\t  function onerror (err) {\n\t    var error = new Error('probe error: ' + err);\n\t    error.transport = transport.name;\n\t\n\t    freezeTransport();\n\t\n\t\n\t\n\t    self.emit('upgradeError', error);\n\t  }\n\t\n\t  function onTransportClose () {\n\t    onerror('transport closed');\n\t  }\n\t\n\t  // When the socket is closed while we're probing\n\t  function onclose () {\n\t    onerror('socket closed');\n\t  }\n\t\n\t  // When the socket is upgraded while we're probing\n\t  function onupgrade (to) {\n\t    if (transport && to.name !== transport.name) {\n\t\n\t      freezeTransport();\n\t    }\n\t  }\n\t\n\t  // Remove all listeners on the transport and on self\n\t  function cleanup () {\n\t    transport.removeListener('open', onTransportOpen);\n\t    transport.removeListener('error', onerror);\n\t    transport.removeListener('close', onTransportClose);\n\t    self.removeListener('close', onclose);\n\t    self.removeListener('upgrading', onupgrade);\n\t  }\n\t\n\t  transport.once('open', onTransportOpen);\n\t  transport.once('error', onerror);\n\t  transport.once('close', onTransportClose);\n\t\n\t  this.once('close', onclose);\n\t  this.once('upgrading', onupgrade);\n\t\n\t  transport.open();\n\t};\n\t\n\t/**\n\t * Called when connection is deemed open.\n\t *\n\t * @api public\n\t */\n\t\n\tSocket.prototype.onOpen = function () {\n\t\n\t  this.readyState = 'open';\n\t  Socket.priorWebsocketSuccess = 'websocket' === this.transport.name;\n\t  this.emit('open');\n\t  this.flush();\n\t\n\t  // we check for `readyState` in case an `open`\n\t  // listener already closed the socket\n\t  if ('open' === this.readyState && this.upgrade && this.transport.pause) {\n\t\n\t    for (var i = 0, l = this.upgrades.length; i < l; i++) {\n\t      this.probe(this.upgrades[i]);\n\t    }\n\t  }\n\t};\n\t\n\t/**\n\t * Handles a packet.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onPacket = function (packet) {\n\t  if ('opening' === this.readyState || 'open' === this.readyState ||\n\t      'closing' === this.readyState) {\n\t\n\t\n\t    this.emit('packet', packet);\n\t\n\t    // Socket is live - any packet counts\n\t    this.emit('heartbeat');\n\t\n\t    switch (packet.type) {\n\t      case 'open':\n\t        this.onHandshake(parsejson(packet.data));\n\t        break;\n\t\n\t      case 'pong':\n\t        this.setPing();\n\t        this.emit('pong');\n\t        break;\n\t\n\t      case 'error':\n\t        var err = new Error('server error');\n\t        err.code = packet.data;\n\t        this.onError(err);\n\t        break;\n\t\n\t      case 'message':\n\t        this.emit('data', packet.data);\n\t        this.emit('message', packet.data);\n\t        break;\n\t    }\n\t  } else {\n\t\n\t  }\n\t};\n\t\n\t/**\n\t * Called upon handshake completion.\n\t *\n\t * @param {Object} handshake obj\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onHandshake = function (data) {\n\t  this.emit('handshake', data);\n\t  this.id = data.sid;\n\t  this.transport.query.sid = data.sid;\n\t  this.upgrades = this.filterUpgrades(data.upgrades);\n\t  this.pingInterval = data.pingInterval;\n\t  this.pingTimeout = data.pingTimeout;\n\t  this.onOpen();\n\t  // In case open handler closes socket\n\t  if ('closed' === this.readyState) return;\n\t  this.setPing();\n\t\n\t  // Prolong liveness of socket on heartbeat\n\t  this.removeListener('heartbeat', this.onHeartbeat);\n\t  this.on('heartbeat', this.onHeartbeat);\n\t};\n\t\n\t/**\n\t * Resets ping timeout.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onHeartbeat = function (timeout) {\n\t  clearTimeout(this.pingTimeoutTimer);\n\t  var self = this;\n\t  self.pingTimeoutTimer = setTimeout(function () {\n\t    if ('closed' === self.readyState) return;\n\t    self.onClose('ping timeout');\n\t  }, timeout || (self.pingInterval + self.pingTimeout));\n\t};\n\t\n\t/**\n\t * Pings server every `this.pingInterval` and expects response\n\t * within `this.pingTimeout` or closes connection.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.setPing = function () {\n\t  var self = this;\n\t  clearTimeout(self.pingIntervalTimer);\n\t  self.pingIntervalTimer = setTimeout(function () {\n\t\n\t    self.ping();\n\t    self.onHeartbeat(self.pingTimeout);\n\t  }, self.pingInterval);\n\t};\n\t\n\t/**\n\t* Sends a ping packet.\n\t*\n\t* @api private\n\t*/\n\t\n\tSocket.prototype.ping = function () {\n\t  var self = this;\n\t  this.sendPacket('ping', function () {\n\t    self.emit('ping');\n\t  });\n\t};\n\t\n\t/**\n\t * Called on `drain` event\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onDrain = function () {\n\t  this.writeBuffer.splice(0, this.prevBufferLen);\n\t\n\t  // setting prevBufferLen = 0 is very important\n\t  // for example, when upgrading, upgrade packet is sent over,\n\t  // and a nonzero prevBufferLen could cause problems on `drain`\n\t  this.prevBufferLen = 0;\n\t\n\t  if (0 === this.writeBuffer.length) {\n\t    this.emit('drain');\n\t  } else {\n\t    this.flush();\n\t  }\n\t};\n\t\n\t/**\n\t * Flush write buffers.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.flush = function () {\n\t  if ('closed' !== this.readyState && this.transport.writable &&\n\t    !this.upgrading && this.writeBuffer.length) {\n\t\n\t    this.transport.send(this.writeBuffer);\n\t    // keep track of current length of writeBuffer\n\t    // splice writeBuffer and callbackBuffer on `drain`\n\t    this.prevBufferLen = this.writeBuffer.length;\n\t    this.emit('flush');\n\t  }\n\t};\n\t\n\t/**\n\t * Sends a message.\n\t *\n\t * @param {String} message.\n\t * @param {Function} callback function.\n\t * @param {Object} options.\n\t * @return {Socket} for chaining.\n\t * @api public\n\t */\n\t\n\tSocket.prototype.write =\n\tSocket.prototype.send = function (msg, options, fn) {\n\t  this.sendPacket('message', msg, options, fn);\n\t  return this;\n\t};\n\t\n\t/**\n\t * Sends a packet.\n\t *\n\t * @param {String} packet type.\n\t * @param {String} data.\n\t * @param {Object} options.\n\t * @param {Function} callback function.\n\t * @api private\n\t */\n\t\n\tSocket.prototype.sendPacket = function (type, data, options, fn) {\n\t  if ('function' === typeof data) {\n\t    fn = data;\n\t    data = undefined;\n\t  }\n\t\n\t  if ('function' === typeof options) {\n\t    fn = options;\n\t    options = null;\n\t  }\n\t\n\t  if ('closing' === this.readyState || 'closed' === this.readyState) {\n\t    return;\n\t  }\n\t\n\t  options = options || {};\n\t  options.compress = false !== options.compress;\n\t\n\t  var packet = {\n\t    type: type,\n\t    data: data,\n\t    options: options\n\t  };\n\t  this.emit('packetCreate', packet);\n\t  this.writeBuffer.push(packet);\n\t  if (fn) this.once('flush', fn);\n\t  this.flush();\n\t};\n\t\n\t/**\n\t * Closes the connection.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.close = function () {\n\t  if ('opening' === this.readyState || 'open' === this.readyState) {\n\t    this.readyState = 'closing';\n\t\n\t    var self = this;\n\t\n\t    if (this.writeBuffer.length) {\n\t      this.once('drain', function () {\n\t        if (this.upgrading) {\n\t          waitForUpgrade();\n\t        } else {\n\t          close();\n\t        }\n\t      });\n\t    } else if (this.upgrading) {\n\t      waitForUpgrade();\n\t    } else {\n\t      close();\n\t    }\n\t  }\n\t\n\t  function close () {\n\t    self.onClose('forced close');\n\t\n\t    self.transport.close();\n\t  }\n\t\n\t  function cleanupAndClose () {\n\t    self.removeListener('upgrade', cleanupAndClose);\n\t    self.removeListener('upgradeError', cleanupAndClose);\n\t    close();\n\t  }\n\t\n\t  function waitForUpgrade () {\n\t    // wait for upgrade to finish since we can't send packets while pausing a transport\n\t    self.once('upgrade', cleanupAndClose);\n\t    self.once('upgradeError', cleanupAndClose);\n\t  }\n\t\n\t  return this;\n\t};\n\t\n\t/**\n\t * Called upon transport error\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onError = function (err) {\n\t\n\t  Socket.priorWebsocketSuccess = false;\n\t  this.emit('error', err);\n\t  this.onClose('transport error', err);\n\t};\n\t\n\t/**\n\t * Called upon transport close.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onClose = function (reason, desc) {\n\t  if ('opening' === this.readyState || 'open' === this.readyState || 'closing' === this.readyState) {\n\t\n\t    var self = this;\n\t\n\t    // clear timers\n\t    clearTimeout(this.pingIntervalTimer);\n\t    clearTimeout(this.pingTimeoutTimer);\n\t\n\t    // stop event from firing again for transport\n\t    this.transport.removeAllListeners('close');\n\t\n\t    // ensure transport won't stay open\n\t    this.transport.close();\n\t\n\t    // ignore further transport communication\n\t    this.transport.removeAllListeners();\n\t\n\t    // set ready state\n\t    this.readyState = 'closed';\n\t\n\t    // clear session id\n\t    this.id = null;\n\t\n\t    // emit close event\n\t    this.emit('close', reason, desc);\n\t\n\t    // clean buffers after, so users can still\n\t    // grab the buffers on `close` event\n\t    self.writeBuffer = [];\n\t    self.prevBufferLen = 0;\n\t  }\n\t};\n\t\n\t/**\n\t * Filters upgrades, returning only those matching client transports.\n\t *\n\t * @param {Array} server upgrades\n\t * @api private\n\t *\n\t */\n\t\n\tSocket.prototype.filterUpgrades = function (upgrades) {\n\t  var filteredUpgrades = [];\n\t  for (var i = 0, j = upgrades.length; i < j; i++) {\n\t    if (~index(this.transports, upgrades[i])) filteredUpgrades.push(upgrades[i]);\n\t  }\n\t  return filteredUpgrades;\n\t};\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/**\n\t * Module dependencies\n\t */\n\t\n\tvar XMLHttpRequest = __webpack_require__(15);\n\tvar XHR = __webpack_require__(17);\n\tvar JSONP = __webpack_require__(31);\n\tvar websocket = __webpack_require__(32);\n\t\n\t/**\n\t * Export transports.\n\t */\n\t\n\texports.polling = polling;\n\texports.websocket = websocket;\n\t\n\t/**\n\t * Polling transport polymorphic constructor.\n\t * Decides on xhr vs jsonp based on feature detection.\n\t *\n\t * @api private\n\t */\n\t\n\tfunction polling (opts) {\n\t  var xhr;\n\t  var xd = false;\n\t  var xs = false;\n\t  var jsonp = false !== opts.jsonp;\n\t\n\t  if (global.location) {\n\t    var isSSL = 'https:' === location.protocol;\n\t    var port = location.port;\n\t\n\t    // some user agents have empty `location.port`\n\t    if (!port) {\n\t      port = isSSL ? 443 : 80;\n\t    }\n\t\n\t    xd = opts.hostname !== location.hostname || port !== opts.port;\n\t    xs = opts.secure !== isSSL;\n\t  }\n\t\n\t  opts.xdomain = xd;\n\t  opts.xscheme = xs;\n\t  xhr = new XMLHttpRequest(opts);\n\t\n\t  if ('open' in xhr && !opts.forceJSONP) {\n\t    return new XHR(opts);\n\t  } else {\n\t    if (!jsonp) throw new Error('JSONP disabled');\n\t    return new JSONP(opts);\n\t  }\n\t}\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {// browser shim for xmlhttprequest module\n\t\n\tvar hasCORS = __webpack_require__(16);\n\t\n\tmodule.exports = function (opts) {\n\t  var xdomain = opts.xdomain;\n\t\n\t  // scheme must be same when usign XDomainRequest\n\t  // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx\n\t  var xscheme = opts.xscheme;\n\t\n\t  // XDomainRequest has a flow of not sending cookie, therefore it should be disabled as a default.\n\t  // https://github.com/Automattic/engine.io-client/pull/217\n\t  var enablesXDR = opts.enablesXDR;\n\t\n\t  // XMLHttpRequest can be disabled on IE\n\t  try {\n\t    if ('undefined' !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {\n\t      return new XMLHttpRequest();\n\t    }\n\t  } catch (e) { }\n\t\n\t  // Use XDomainRequest for IE8 if enablesXDR is true\n\t  // because loading bar keeps flashing when using jsonp-polling\n\t  // https://github.com/yujiosaka/socke.io-ie8-loading-example\n\t  try {\n\t    if ('undefined' !== typeof XDomainRequest && !xscheme && enablesXDR) {\n\t      return new XDomainRequest();\n\t    }\n\t  } catch (e) { }\n\t\n\t  if (!xdomain) {\n\t    try {\n\t      return new global[['Active'].concat('Object').join('X')]('Microsoft.XMLHTTP');\n\t    } catch (e) { }\n\t  }\n\t};\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports) {\n\n\t\n\t/**\n\t * Module exports.\n\t *\n\t * Logic borrowed from Modernizr:\n\t *\n\t *   - https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cors.js\n\t */\n\t\n\ttry {\n\t  module.exports = typeof XMLHttpRequest !== 'undefined' &&\n\t    'withCredentials' in new XMLHttpRequest();\n\t} catch (err) {\n\t  // if XMLHttp support is disabled in IE then it will throw\n\t  // when trying to create\n\t  module.exports = false;\n\t}\n\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/**\n\t * Module requirements.\n\t */\n\t\n\tvar XMLHttpRequest = __webpack_require__(15);\n\tvar Polling = __webpack_require__(18);\n\tvar Emitter = __webpack_require__(5);\n\tvar inherit = __webpack_require__(29);\n\tvar debug = __webpack_require__(3)('engine.io-client:polling-xhr');\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = XHR;\n\tmodule.exports.Request = Request;\n\t\n\t/**\n\t * Empty function\n\t */\n\t\n\tfunction empty () {}\n\t\n\t/**\n\t * XHR Polling constructor.\n\t *\n\t * @param {Object} opts\n\t * @api public\n\t */\n\t\n\tfunction XHR (opts) {\n\t  Polling.call(this, opts);\n\t  this.requestTimeout = opts.requestTimeout;\n\t  this.extraHeaders = opts.extraHeaders;\n\t\n\t  if (global.location) {\n\t    var isSSL = 'https:' === location.protocol;\n\t    var port = location.port;\n\t\n\t    // some user agents have empty `location.port`\n\t    if (!port) {\n\t      port = isSSL ? 443 : 80;\n\t    }\n\t\n\t    this.xd = opts.hostname !== global.location.hostname ||\n\t      port !== opts.port;\n\t    this.xs = opts.secure !== isSSL;\n\t  }\n\t}\n\t\n\t/**\n\t * Inherits from Polling.\n\t */\n\t\n\tinherit(XHR, Polling);\n\t\n\t/**\n\t * XHR supports binary\n\t */\n\t\n\tXHR.prototype.supportsBinary = true;\n\t\n\t/**\n\t * Creates a request.\n\t *\n\t * @param {String} method\n\t * @api private\n\t */\n\t\n\tXHR.prototype.request = function (opts) {\n\t  opts = opts || {};\n\t  opts.uri = this.uri();\n\t  opts.xd = this.xd;\n\t  opts.xs = this.xs;\n\t  opts.agent = this.agent || false;\n\t  opts.supportsBinary = this.supportsBinary;\n\t  opts.enablesXDR = this.enablesXDR;\n\t\n\t  // SSL options for Node.js client\n\t  opts.pfx = this.pfx;\n\t  opts.key = this.key;\n\t  opts.passphrase = this.passphrase;\n\t  opts.cert = this.cert;\n\t  opts.ca = this.ca;\n\t  opts.ciphers = this.ciphers;\n\t  opts.rejectUnauthorized = this.rejectUnauthorized;\n\t  opts.requestTimeout = this.requestTimeout;\n\t\n\t  // other options for Node.js client\n\t  opts.extraHeaders = this.extraHeaders;\n\t\n\t  return new Request(opts);\n\t};\n\t\n\t/**\n\t * Sends data.\n\t *\n\t * @param {String} data to send.\n\t * @param {Function} called upon flush.\n\t * @api private\n\t */\n\t\n\tXHR.prototype.doWrite = function (data, fn) {\n\t  var isBinary = typeof data !== 'string' && data !== undefined;\n\t  var req = this.request({ method: 'POST', data: data, isBinary: isBinary });\n\t  var self = this;\n\t  req.on('success', fn);\n\t  req.on('error', function (err) {\n\t    self.onError('xhr post error', err);\n\t  });\n\t  this.sendXhr = req;\n\t};\n\t\n\t/**\n\t * Starts a poll cycle.\n\t *\n\t * @api private\n\t */\n\t\n\tXHR.prototype.doPoll = function () {\n\t\n\t  var req = this.request();\n\t  var self = this;\n\t  req.on('data', function (data) {\n\t    self.onData(data);\n\t  });\n\t  req.on('error', function (err) {\n\t    self.onError('xhr poll error', err);\n\t  });\n\t  this.pollXhr = req;\n\t};\n\t\n\t/**\n\t * Request constructor\n\t *\n\t * @param {Object} options\n\t * @api public\n\t */\n\t\n\tfunction Request (opts) {\n\t  this.method = opts.method || 'GET';\n\t  this.uri = opts.uri;\n\t  this.xd = !!opts.xd;\n\t  this.xs = !!opts.xs;\n\t  this.async = false !== opts.async;\n\t  this.data = undefined !== opts.data ? opts.data : null;\n\t  this.agent = opts.agent;\n\t  this.isBinary = opts.isBinary;\n\t  this.supportsBinary = opts.supportsBinary;\n\t  this.enablesXDR = opts.enablesXDR;\n\t  this.requestTimeout = opts.requestTimeout;\n\t\n\t  // SSL options for Node.js client\n\t  this.pfx = opts.pfx;\n\t  this.key = opts.key;\n\t  this.passphrase = opts.passphrase;\n\t  this.cert = opts.cert;\n\t  this.ca = opts.ca;\n\t  this.ciphers = opts.ciphers;\n\t  this.rejectUnauthorized = opts.rejectUnauthorized;\n\t\n\t  // other options for Node.js client\n\t  this.extraHeaders = opts.extraHeaders;\n\t\n\t  this.create();\n\t}\n\t\n\t/**\n\t * Mix in `Emitter`.\n\t */\n\t\n\tEmitter(Request.prototype);\n\t\n\t/**\n\t * Creates the XHR object and sends the request.\n\t *\n\t * @api private\n\t */\n\t\n\tRequest.prototype.create = function () {\n\t  var opts = { agent: this.agent, xdomain: this.xd, xscheme: this.xs, enablesXDR: this.enablesXDR };\n\t\n\t  // SSL options for Node.js client\n\t  opts.pfx = this.pfx;\n\t  opts.key = this.key;\n\t  opts.passphrase = this.passphrase;\n\t  opts.cert = this.cert;\n\t  opts.ca = this.ca;\n\t  opts.ciphers = this.ciphers;\n\t  opts.rejectUnauthorized = this.rejectUnauthorized;\n\t\n\t  var xhr = this.xhr = new XMLHttpRequest(opts);\n\t  var self = this;\n\t\n\t  try {\n\t\n\t    xhr.open(this.method, this.uri, this.async);\n\t    try {\n\t      if (this.extraHeaders) {\n\t        xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);\n\t        for (var i in this.extraHeaders) {\n\t          if (this.extraHeaders.hasOwnProperty(i)) {\n\t            xhr.setRequestHeader(i, this.extraHeaders[i]);\n\t          }\n\t        }\n\t      }\n\t    } catch (e) {}\n\t\n\t    if ('POST' === this.method) {\n\t      try {\n\t        if (this.isBinary) {\n\t          xhr.setRequestHeader('Content-type', 'application/octet-stream');\n\t        } else {\n\t          xhr.setRequestHeader('Content-type', 'text/plain;charset=UTF-8');\n\t        }\n\t      } catch (e) {}\n\t    }\n\t\n\t    try {\n\t      xhr.setRequestHeader('Accept', '*/*');\n\t    } catch (e) {}\n\t\n\t    // ie6 check\n\t    if ('withCredentials' in xhr) {\n\t      xhr.withCredentials = true;\n\t    }\n\t\n\t    if (this.requestTimeout) {\n\t      xhr.timeout = this.requestTimeout;\n\t    }\n\t\n\t    if (this.hasXDR()) {\n\t      xhr.onload = function () {\n\t        self.onLoad();\n\t      };\n\t      xhr.onerror = function () {\n\t        self.onError(xhr.responseText);\n\t      };\n\t    } else {\n\t      xhr.onreadystatechange = function () {\n\t        if (xhr.readyState === 2) {\n\t          var contentType;\n\t          try {\n\t            contentType = xhr.getResponseHeader('Content-Type');\n\t          } catch (e) {}\n\t          if (contentType === 'application/octet-stream') {\n\t            xhr.responseType = 'arraybuffer';\n\t          }\n\t        }\n\t        if (4 !== xhr.readyState) return;\n\t        if (200 === xhr.status || 1223 === xhr.status) {\n\t          self.onLoad();\n\t        } else {\n\t          // make sure the `error` event handler that's user-set\n\t          // does not throw in the same tick and gets caught here\n\t          setTimeout(function () {\n\t            self.onError(xhr.status);\n\t          }, 0);\n\t        }\n\t      };\n\t    }\n\t\n\t\n\t    xhr.send(this.data);\n\t  } catch (e) {\n\t    // Need to defer since .create() is called directly fhrom the constructor\n\t    // and thus the 'error' event can only be only bound *after* this exception\n\t    // occurs.  Therefore, also, we cannot throw here at all.\n\t    setTimeout(function () {\n\t      self.onError(e);\n\t    }, 0);\n\t    return;\n\t  }\n\t\n\t  if (global.document) {\n\t    this.index = Request.requestsCount++;\n\t    Request.requests[this.index] = this;\n\t  }\n\t};\n\t\n\t/**\n\t * Called upon successful response.\n\t *\n\t * @api private\n\t */\n\t\n\tRequest.prototype.onSuccess = function () {\n\t  this.emit('success');\n\t  this.cleanup();\n\t};\n\t\n\t/**\n\t * Called if we have data.\n\t *\n\t * @api private\n\t */\n\t\n\tRequest.prototype.onData = function (data) {\n\t  this.emit('data', data);\n\t  this.onSuccess();\n\t};\n\t\n\t/**\n\t * Called upon error.\n\t *\n\t * @api private\n\t */\n\t\n\tRequest.prototype.onError = function (err) {\n\t  this.emit('error', err);\n\t  this.cleanup(true);\n\t};\n\t\n\t/**\n\t * Cleans up house.\n\t *\n\t * @api private\n\t */\n\t\n\tRequest.prototype.cleanup = function (fromError) {\n\t  if ('undefined' === typeof this.xhr || null === this.xhr) {\n\t    return;\n\t  }\n\t  // xmlhttprequest\n\t  if (this.hasXDR()) {\n\t    this.xhr.onload = this.xhr.onerror = empty;\n\t  } else {\n\t    this.xhr.onreadystatechange = empty;\n\t  }\n\t\n\t  if (fromError) {\n\t    try {\n\t      this.xhr.abort();\n\t    } catch (e) {}\n\t  }\n\t\n\t  if (global.document) {\n\t    delete Request.requests[this.index];\n\t  }\n\t\n\t  this.xhr = null;\n\t};\n\t\n\t/**\n\t * Called upon load.\n\t *\n\t * @api private\n\t */\n\t\n\tRequest.prototype.onLoad = function () {\n\t  var data;\n\t  try {\n\t    var contentType;\n\t    try {\n\t      contentType = this.xhr.getResponseHeader('Content-Type');\n\t    } catch (e) {}\n\t    if (contentType === 'application/octet-stream') {\n\t      data = this.xhr.response || this.xhr.responseText;\n\t    } else {\n\t      data = this.xhr.responseText;\n\t    }\n\t  } catch (e) {\n\t    this.onError(e);\n\t  }\n\t  if (null != data) {\n\t    this.onData(data);\n\t  }\n\t};\n\t\n\t/**\n\t * Check if it has XDomainRequest.\n\t *\n\t * @api private\n\t */\n\t\n\tRequest.prototype.hasXDR = function () {\n\t  return 'undefined' !== typeof global.XDomainRequest && !this.xs && this.enablesXDR;\n\t};\n\t\n\t/**\n\t * Aborts the request.\n\t *\n\t * @api public\n\t */\n\t\n\tRequest.prototype.abort = function () {\n\t  this.cleanup();\n\t};\n\t\n\t/**\n\t * Aborts pending requests when unloading the window. This is needed to prevent\n\t * memory leaks (e.g. when using IE) and to ensure that no spurious error is\n\t * emitted.\n\t */\n\t\n\tRequest.requestsCount = 0;\n\tRequest.requests = {};\n\t\n\tif (global.document) {\n\t  if (global.attachEvent) {\n\t    global.attachEvent('onunload', unloadHandler);\n\t  } else if (global.addEventListener) {\n\t    global.addEventListener('beforeunload', unloadHandler, false);\n\t  }\n\t}\n\t\n\tfunction unloadHandler () {\n\t  for (var i in Request.requests) {\n\t    if (Request.requests.hasOwnProperty(i)) {\n\t      Request.requests[i].abort();\n\t    }\n\t  }\n\t}\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/**\n\t * Module dependencies.\n\t */\n\t\n\tvar Transport = __webpack_require__(19);\n\tvar parseqs = __webpack_require__(28);\n\tvar parser = __webpack_require__(20);\n\tvar inherit = __webpack_require__(29);\n\tvar yeast = __webpack_require__(30);\n\tvar debug = __webpack_require__(3)('engine.io-client:polling');\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = Polling;\n\t\n\t/**\n\t * Is XHR2 supported?\n\t */\n\t\n\tvar hasXHR2 = (function () {\n\t  var XMLHttpRequest = __webpack_require__(15);\n\t  var xhr = new XMLHttpRequest({ xdomain: false });\n\t  return null != xhr.responseType;\n\t})();\n\t\n\t/**\n\t * Polling interface.\n\t *\n\t * @param {Object} opts\n\t * @api private\n\t */\n\t\n\tfunction Polling (opts) {\n\t  var forceBase64 = (opts && opts.forceBase64);\n\t  if (!hasXHR2 || forceBase64) {\n\t    this.supportsBinary = false;\n\t  }\n\t  Transport.call(this, opts);\n\t}\n\t\n\t/**\n\t * Inherits from Transport.\n\t */\n\t\n\tinherit(Polling, Transport);\n\t\n\t/**\n\t * Transport name.\n\t */\n\t\n\tPolling.prototype.name = 'polling';\n\t\n\t/**\n\t * Opens the socket (triggers polling). We write a PING message to determine\n\t * when the transport is open.\n\t *\n\t * @api private\n\t */\n\t\n\tPolling.prototype.doOpen = function () {\n\t  this.poll();\n\t};\n\t\n\t/**\n\t * Pauses polling.\n\t *\n\t * @param {Function} callback upon buffers are flushed and transport is paused\n\t * @api private\n\t */\n\t\n\tPolling.prototype.pause = function (onPause) {\n\t  var self = this;\n\t\n\t  this.readyState = 'pausing';\n\t\n\t  function pause () {\n\t\n\t    self.readyState = 'paused';\n\t    onPause();\n\t  }\n\t\n\t  if (this.polling || !this.writable) {\n\t    var total = 0;\n\t\n\t    if (this.polling) {\n\t\n\t      total++;\n\t      this.once('pollComplete', function () {\n\t\n\t        --total || pause();\n\t      });\n\t    }\n\t\n\t    if (!this.writable) {\n\t\n\t      total++;\n\t      this.once('drain', function () {\n\t\n\t        --total || pause();\n\t      });\n\t    }\n\t  } else {\n\t    pause();\n\t  }\n\t};\n\t\n\t/**\n\t * Starts polling cycle.\n\t *\n\t * @api public\n\t */\n\t\n\tPolling.prototype.poll = function () {\n\t\n\t  this.polling = true;\n\t  this.doPoll();\n\t  this.emit('poll');\n\t};\n\t\n\t/**\n\t * Overloads onData to detect payloads.\n\t *\n\t * @api private\n\t */\n\t\n\tPolling.prototype.onData = function (data) {\n\t  var self = this;\n\t\n\t  var callback = function (packet, index, total) {\n\t    // if its the first message we consider the transport open\n\t    if ('opening' === self.readyState) {\n\t      self.onOpen();\n\t    }\n\t\n\t    // if its a close packet, we close the ongoing requests\n\t    if ('close' === packet.type) {\n\t      self.onClose();\n\t      return false;\n\t    }\n\t\n\t    // otherwise bypass onData and handle the message\n\t    self.onPacket(packet);\n\t  };\n\t\n\t  // decode payload\n\t  parser.decodePayload(data, this.socket.binaryType, callback);\n\t\n\t  // if an event did not trigger closing\n\t  if ('closed' !== this.readyState) {\n\t    // if we got data we're not polling\n\t    this.polling = false;\n\t    this.emit('pollComplete');\n\t\n\t    if ('open' === this.readyState) {\n\t      this.poll();\n\t    } else {\n\t\n\t    }\n\t  }\n\t};\n\t\n\t/**\n\t * For polling, send a close packet.\n\t *\n\t * @api private\n\t */\n\t\n\tPolling.prototype.doClose = function () {\n\t  var self = this;\n\t\n\t  function close () {\n\t\n\t    self.write([{ type: 'close' }]);\n\t  }\n\t\n\t  if ('open' === this.readyState) {\n\t\n\t    close();\n\t  } else {\n\t    // in case we're trying to close while\n\t    // handshaking is in progress (GH-164)\n\t\n\t    this.once('open', close);\n\t  }\n\t};\n\t\n\t/**\n\t * Writes a packets payload.\n\t *\n\t * @param {Array} data packets\n\t * @param {Function} drain callback\n\t * @api private\n\t */\n\t\n\tPolling.prototype.write = function (packets) {\n\t  var self = this;\n\t  this.writable = false;\n\t  var callbackfn = function () {\n\t    self.writable = true;\n\t    self.emit('drain');\n\t  };\n\t\n\t  parser.encodePayload(packets, this.supportsBinary, function (data) {\n\t    self.doWrite(data, callbackfn);\n\t  });\n\t};\n\t\n\t/**\n\t * Generates uri for connection.\n\t *\n\t * @api private\n\t */\n\t\n\tPolling.prototype.uri = function () {\n\t  var query = this.query || {};\n\t  var schema = this.secure ? 'https' : 'http';\n\t  var port = '';\n\t\n\t  // cache busting is forced\n\t  if (false !== this.timestampRequests) {\n\t    query[this.timestampParam] = yeast();\n\t  }\n\t\n\t  if (!this.supportsBinary && !query.sid) {\n\t    query.b64 = 1;\n\t  }\n\t\n\t  query = parseqs.encode(query);\n\t\n\t  // avoid port if default for schema\n\t  if (this.port && (('https' === schema && Number(this.port) !== 443) ||\n\t     ('http' === schema && Number(this.port) !== 80))) {\n\t    port = ':' + this.port;\n\t  }\n\t\n\t  // prepend ? to query\n\t  if (query.length) {\n\t    query = '?' + query;\n\t  }\n\t\n\t  var ipv6 = this.hostname.indexOf(':') !== -1;\n\t  return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;\n\t};\n\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/**\n\t * Module dependencies.\n\t */\n\t\n\tvar parser = __webpack_require__(20);\n\tvar Emitter = __webpack_require__(5);\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = Transport;\n\t\n\t/**\n\t * Transport abstract constructor.\n\t *\n\t * @param {Object} options.\n\t * @api private\n\t */\n\t\n\tfunction Transport (opts) {\n\t  this.path = opts.path;\n\t  this.hostname = opts.hostname;\n\t  this.port = opts.port;\n\t  this.secure = opts.secure;\n\t  this.query = opts.query;\n\t  this.timestampParam = opts.timestampParam;\n\t  this.timestampRequests = opts.timestampRequests;\n\t  this.readyState = '';\n\t  this.agent = opts.agent || false;\n\t  this.socket = opts.socket;\n\t  this.enablesXDR = opts.enablesXDR;\n\t\n\t  // SSL options for Node.js client\n\t  this.pfx = opts.pfx;\n\t  this.key = opts.key;\n\t  this.passphrase = opts.passphrase;\n\t  this.cert = opts.cert;\n\t  this.ca = opts.ca;\n\t  this.ciphers = opts.ciphers;\n\t  this.rejectUnauthorized = opts.rejectUnauthorized;\n\t  this.forceNode = opts.forceNode;\n\t\n\t  // other options for Node.js client\n\t  this.extraHeaders = opts.extraHeaders;\n\t  this.localAddress = opts.localAddress;\n\t}\n\t\n\t/**\n\t * Mix in `Emitter`.\n\t */\n\t\n\tEmitter(Transport.prototype);\n\t\n\t/**\n\t * Emits an error.\n\t *\n\t * @param {String} str\n\t * @return {Transport} for chaining\n\t * @api public\n\t */\n\t\n\tTransport.prototype.onError = function (msg, desc) {\n\t  var err = new Error(msg);\n\t  err.type = 'TransportError';\n\t  err.description = desc;\n\t  this.emit('error', err);\n\t  return this;\n\t};\n\t\n\t/**\n\t * Opens the transport.\n\t *\n\t * @api public\n\t */\n\t\n\tTransport.prototype.open = function () {\n\t  if ('closed' === this.readyState || '' === this.readyState) {\n\t    this.readyState = 'opening';\n\t    this.doOpen();\n\t  }\n\t\n\t  return this;\n\t};\n\t\n\t/**\n\t * Closes the transport.\n\t *\n\t * @api private\n\t */\n\t\n\tTransport.prototype.close = function () {\n\t  if ('opening' === this.readyState || 'open' === this.readyState) {\n\t    this.doClose();\n\t    this.onClose();\n\t  }\n\t\n\t  return this;\n\t};\n\t\n\t/**\n\t * Sends multiple packets.\n\t *\n\t * @param {Array} packets\n\t * @api private\n\t */\n\t\n\tTransport.prototype.send = function (packets) {\n\t  if ('open' === this.readyState) {\n\t    this.write(packets);\n\t  } else {\n\t    throw new Error('Transport not open');\n\t  }\n\t};\n\t\n\t/**\n\t * Called upon open\n\t *\n\t * @api private\n\t */\n\t\n\tTransport.prototype.onOpen = function () {\n\t  this.readyState = 'open';\n\t  this.writable = true;\n\t  this.emit('open');\n\t};\n\t\n\t/**\n\t * Called with data.\n\t *\n\t * @param {String} data\n\t * @api private\n\t */\n\t\n\tTransport.prototype.onData = function (data) {\n\t  var packet = parser.decodePacket(data, this.socket.binaryType);\n\t  this.onPacket(packet);\n\t};\n\t\n\t/**\n\t * Called with a decoded packet.\n\t */\n\t\n\tTransport.prototype.onPacket = function (packet) {\n\t  this.emit('packet', packet);\n\t};\n\t\n\t/**\n\t * Called upon close.\n\t *\n\t * @api private\n\t */\n\t\n\tTransport.prototype.onClose = function () {\n\t  this.readyState = 'closed';\n\t  this.emit('close');\n\t};\n\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/**\n\t * Module dependencies.\n\t */\n\t\n\tvar keys = __webpack_require__(21);\n\tvar hasBinary = __webpack_require__(6);\n\tvar sliceBuffer = __webpack_require__(22);\n\tvar after = __webpack_require__(23);\n\tvar utf8 = __webpack_require__(24);\n\t\n\tvar base64encoder;\n\tif (global && global.ArrayBuffer) {\n\t  base64encoder = __webpack_require__(26);\n\t}\n\t\n\t/**\n\t * Check if we are running an android browser. That requires us to use\n\t * ArrayBuffer with polling transports...\n\t *\n\t * http://ghinda.net/jpeg-blob-ajax-android/\n\t */\n\t\n\tvar isAndroid = typeof navigator !== 'undefined' && /Android/i.test(navigator.userAgent);\n\t\n\t/**\n\t * Check if we are running in PhantomJS.\n\t * Uploading a Blob with PhantomJS does not work correctly, as reported here:\n\t * https://github.com/ariya/phantomjs/issues/11395\n\t * @type boolean\n\t */\n\tvar isPhantomJS = typeof navigator !== 'undefined' && /PhantomJS/i.test(navigator.userAgent);\n\t\n\t/**\n\t * When true, avoids using Blobs to encode payloads.\n\t * @type boolean\n\t */\n\tvar dontSendBlobs = isAndroid || isPhantomJS;\n\t\n\t/**\n\t * Current protocol version.\n\t */\n\t\n\texports.protocol = 3;\n\t\n\t/**\n\t * Packet types.\n\t */\n\t\n\tvar packets = exports.packets = {\n\t    open:     0    // non-ws\n\t  , close:    1    // non-ws\n\t  , ping:     2\n\t  , pong:     3\n\t  , message:  4\n\t  , upgrade:  5\n\t  , noop:     6\n\t};\n\t\n\tvar packetslist = keys(packets);\n\t\n\t/**\n\t * Premade error packet.\n\t */\n\t\n\tvar err = { type: 'error', data: 'parser error' };\n\t\n\t/**\n\t * Create a blob api even for blob builder when vendor prefixes exist\n\t */\n\t\n\tvar Blob = __webpack_require__(27);\n\t\n\t/**\n\t * Encodes a packet.\n\t *\n\t *     <packet type id> [ <data> ]\n\t *\n\t * Example:\n\t *\n\t *     5hello world\n\t *     3\n\t *     4\n\t *\n\t * Binary is encoded in an identical principle\n\t *\n\t * @api private\n\t */\n\t\n\texports.encodePacket = function (packet, supportsBinary, utf8encode, callback) {\n\t  if (typeof supportsBinary === 'function') {\n\t    callback = supportsBinary;\n\t    supportsBinary = false;\n\t  }\n\t\n\t  if (typeof utf8encode === 'function') {\n\t    callback = utf8encode;\n\t    utf8encode = null;\n\t  }\n\t\n\t  var data = (packet.data === undefined)\n\t    ? undefined\n\t    : packet.data.buffer || packet.data;\n\t\n\t  if (global.ArrayBuffer && data instanceof ArrayBuffer) {\n\t    return encodeArrayBuffer(packet, supportsBinary, callback);\n\t  } else if (Blob && data instanceof global.Blob) {\n\t    return encodeBlob(packet, supportsBinary, callback);\n\t  }\n\t\n\t  // might be an object with { base64: true, data: dataAsBase64String }\n\t  if (data && data.base64) {\n\t    return encodeBase64Object(packet, callback);\n\t  }\n\t\n\t  // Sending data as a utf-8 string\n\t  var encoded = packets[packet.type];\n\t\n\t  // data fragment is optional\n\t  if (undefined !== packet.data) {\n\t    encoded += utf8encode ? utf8.encode(String(packet.data), { strict: false }) : String(packet.data);\n\t  }\n\t\n\t  return callback('' + encoded);\n\t\n\t};\n\t\n\tfunction encodeBase64Object(packet, callback) {\n\t  // packet data is an object { base64: true, data: dataAsBase64String }\n\t  var message = 'b' + exports.packets[packet.type] + packet.data.data;\n\t  return callback(message);\n\t}\n\t\n\t/**\n\t * Encode packet helpers for binary types\n\t */\n\t\n\tfunction encodeArrayBuffer(packet, supportsBinary, callback) {\n\t  if (!supportsBinary) {\n\t    return exports.encodeBase64Packet(packet, callback);\n\t  }\n\t\n\t  var data = packet.data;\n\t  var contentArray = new Uint8Array(data);\n\t  var resultBuffer = new Uint8Array(1 + data.byteLength);\n\t\n\t  resultBuffer[0] = packets[packet.type];\n\t  for (var i = 0; i < contentArray.length; i++) {\n\t    resultBuffer[i+1] = contentArray[i];\n\t  }\n\t\n\t  return callback(resultBuffer.buffer);\n\t}\n\t\n\tfunction encodeBlobAsArrayBuffer(packet, supportsBinary, callback) {\n\t  if (!supportsBinary) {\n\t    return exports.encodeBase64Packet(packet, callback);\n\t  }\n\t\n\t  var fr = new FileReader();\n\t  fr.onload = function() {\n\t    packet.data = fr.result;\n\t    exports.encodePacket(packet, supportsBinary, true, callback);\n\t  };\n\t  return fr.readAsArrayBuffer(packet.data);\n\t}\n\t\n\tfunction encodeBlob(packet, supportsBinary, callback) {\n\t  if (!supportsBinary) {\n\t    return exports.encodeBase64Packet(packet, callback);\n\t  }\n\t\n\t  if (dontSendBlobs) {\n\t    return encodeBlobAsArrayBuffer(packet, supportsBinary, callback);\n\t  }\n\t\n\t  var length = new Uint8Array(1);\n\t  length[0] = packets[packet.type];\n\t  var blob = new Blob([length.buffer, packet.data]);\n\t\n\t  return callback(blob);\n\t}\n\t\n\t/**\n\t * Encodes a packet with binary data in a base64 string\n\t *\n\t * @param {Object} packet, has `type` and `data`\n\t * @return {String} base64 encoded message\n\t */\n\t\n\texports.encodeBase64Packet = function(packet, callback) {\n\t  var message = 'b' + exports.packets[packet.type];\n\t  if (Blob && packet.data instanceof global.Blob) {\n\t    var fr = new FileReader();\n\t    fr.onload = function() {\n\t      var b64 = fr.result.split(',')[1];\n\t      callback(message + b64);\n\t    };\n\t    return fr.readAsDataURL(packet.data);\n\t  }\n\t\n\t  var b64data;\n\t  try {\n\t    b64data = String.fromCharCode.apply(null, new Uint8Array(packet.data));\n\t  } catch (e) {\n\t    // iPhone Safari doesn't let you apply with typed arrays\n\t    var typed = new Uint8Array(packet.data);\n\t    var basic = new Array(typed.length);\n\t    for (var i = 0; i < typed.length; i++) {\n\t      basic[i] = typed[i];\n\t    }\n\t    b64data = String.fromCharCode.apply(null, basic);\n\t  }\n\t  message += global.btoa(b64data);\n\t  return callback(message);\n\t};\n\t\n\t/**\n\t * Decodes a packet. Changes format to Blob if requested.\n\t *\n\t * @return {Object} with `type` and `data` (if any)\n\t * @api private\n\t */\n\t\n\texports.decodePacket = function (data, binaryType, utf8decode) {\n\t  if (data === undefined) {\n\t    return err;\n\t  }\n\t  // String data\n\t  if (typeof data === 'string') {\n\t    if (data.charAt(0) === 'b') {\n\t      return exports.decodeBase64Packet(data.substr(1), binaryType);\n\t    }\n\t\n\t    if (utf8decode) {\n\t      data = tryDecode(data);\n\t      if (data === false) {\n\t        return err;\n\t      }\n\t    }\n\t    var type = data.charAt(0);\n\t\n\t    if (Number(type) != type || !packetslist[type]) {\n\t      return err;\n\t    }\n\t\n\t    if (data.length > 1) {\n\t      return { type: packetslist[type], data: data.substring(1) };\n\t    } else {\n\t      return { type: packetslist[type] };\n\t    }\n\t  }\n\t\n\t  var asArray = new Uint8Array(data);\n\t  var type = asArray[0];\n\t  var rest = sliceBuffer(data, 1);\n\t  if (Blob && binaryType === 'blob') {\n\t    rest = new Blob([rest]);\n\t  }\n\t  return { type: packetslist[type], data: rest };\n\t};\n\t\n\tfunction tryDecode(data) {\n\t  try {\n\t    data = utf8.decode(data, { strict: false });\n\t  } catch (e) {\n\t    return false;\n\t  }\n\t  return data;\n\t}\n\t\n\t/**\n\t * Decodes a packet encoded in a base64 string\n\t *\n\t * @param {String} base64 encoded message\n\t * @return {Object} with `type` and `data` (if any)\n\t */\n\t\n\texports.decodeBase64Packet = function(msg, binaryType) {\n\t  var type = packetslist[msg.charAt(0)];\n\t  if (!base64encoder) {\n\t    return { type: type, data: { base64: true, data: msg.substr(1) } };\n\t  }\n\t\n\t  var data = base64encoder.decode(msg.substr(1));\n\t\n\t  if (binaryType === 'blob' && Blob) {\n\t    data = new Blob([data]);\n\t  }\n\t\n\t  return { type: type, data: data };\n\t};\n\t\n\t/**\n\t * Encodes multiple messages (payload).\n\t *\n\t *     <length>:data\n\t *\n\t * Example:\n\t *\n\t *     11:hello world2:hi\n\t *\n\t * If any contents are binary, they will be encoded as base64 strings. Base64\n\t * encoded strings are marked with a b before the length specifier\n\t *\n\t * @param {Array} packets\n\t * @api private\n\t */\n\t\n\texports.encodePayload = function (packets, supportsBinary, callback) {\n\t  if (typeof supportsBinary === 'function') {\n\t    callback = supportsBinary;\n\t    supportsBinary = null;\n\t  }\n\t\n\t  var isBinary = hasBinary(packets);\n\t\n\t  if (supportsBinary && isBinary) {\n\t    if (Blob && !dontSendBlobs) {\n\t      return exports.encodePayloadAsBlob(packets, callback);\n\t    }\n\t\n\t    return exports.encodePayloadAsArrayBuffer(packets, callback);\n\t  }\n\t\n\t  if (!packets.length) {\n\t    return callback('0:');\n\t  }\n\t\n\t  function setLengthHeader(message) {\n\t    return message.length + ':' + message;\n\t  }\n\t\n\t  function encodeOne(packet, doneCallback) {\n\t    exports.encodePacket(packet, !isBinary ? false : supportsBinary, false, function(message) {\n\t      doneCallback(null, setLengthHeader(message));\n\t    });\n\t  }\n\t\n\t  map(packets, encodeOne, function(err, results) {\n\t    return callback(results.join(''));\n\t  });\n\t};\n\t\n\t/**\n\t * Async array map using after\n\t */\n\t\n\tfunction map(ary, each, done) {\n\t  var result = new Array(ary.length);\n\t  var next = after(ary.length, done);\n\t\n\t  var eachWithIndex = function(i, el, cb) {\n\t    each(el, function(error, msg) {\n\t      result[i] = msg;\n\t      cb(error, result);\n\t    });\n\t  };\n\t\n\t  for (var i = 0; i < ary.length; i++) {\n\t    eachWithIndex(i, ary[i], next);\n\t  }\n\t}\n\t\n\t/*\n\t * Decodes data when a payload is maybe expected. Possible binary contents are\n\t * decoded from their base64 representation\n\t *\n\t * @param {String} data, callback method\n\t * @api public\n\t */\n\t\n\texports.decodePayload = function (data, binaryType, callback) {\n\t  if (typeof data !== 'string') {\n\t    return exports.decodePayloadAsBinary(data, binaryType, callback);\n\t  }\n\t\n\t  if (typeof binaryType === 'function') {\n\t    callback = binaryType;\n\t    binaryType = null;\n\t  }\n\t\n\t  var packet;\n\t  if (data === '') {\n\t    // parser error - ignoring payload\n\t    return callback(err, 0, 1);\n\t  }\n\t\n\t  var length = '', n, msg;\n\t\n\t  for (var i = 0, l = data.length; i < l; i++) {\n\t    var chr = data.charAt(i);\n\t\n\t    if (chr !== ':') {\n\t      length += chr;\n\t      continue;\n\t    }\n\t\n\t    if (length === '' || (length != (n = Number(length)))) {\n\t      // parser error - ignoring payload\n\t      return callback(err, 0, 1);\n\t    }\n\t\n\t    msg = data.substr(i + 1, n);\n\t\n\t    if (length != msg.length) {\n\t      // parser error - ignoring payload\n\t      return callback(err, 0, 1);\n\t    }\n\t\n\t    if (msg.length) {\n\t      packet = exports.decodePacket(msg, binaryType, false);\n\t\n\t      if (err.type === packet.type && err.data === packet.data) {\n\t        // parser error in individual packet - ignoring payload\n\t        return callback(err, 0, 1);\n\t      }\n\t\n\t      var ret = callback(packet, i + n, l);\n\t      if (false === ret) return;\n\t    }\n\t\n\t    // advance cursor\n\t    i += n;\n\t    length = '';\n\t  }\n\t\n\t  if (length !== '') {\n\t    // parser error - ignoring payload\n\t    return callback(err, 0, 1);\n\t  }\n\t\n\t};\n\t\n\t/**\n\t * Encodes multiple messages (payload) as binary.\n\t *\n\t * <1 = binary, 0 = string><number from 0-9><number from 0-9>[...]<number\n\t * 255><data>\n\t *\n\t * Example:\n\t * 1 3 255 1 2 3, if the binary contents are interpreted as 8 bit integers\n\t *\n\t * @param {Array} packets\n\t * @return {ArrayBuffer} encoded payload\n\t * @api private\n\t */\n\t\n\texports.encodePayloadAsArrayBuffer = function(packets, callback) {\n\t  if (!packets.length) {\n\t    return callback(new ArrayBuffer(0));\n\t  }\n\t\n\t  function encodeOne(packet, doneCallback) {\n\t    exports.encodePacket(packet, true, true, function(data) {\n\t      return doneCallback(null, data);\n\t    });\n\t  }\n\t\n\t  map(packets, encodeOne, function(err, encodedPackets) {\n\t    var totalLength = encodedPackets.reduce(function(acc, p) {\n\t      var len;\n\t      if (typeof p === 'string'){\n\t        len = p.length;\n\t      } else {\n\t        len = p.byteLength;\n\t      }\n\t      return acc + len.toString().length + len + 2; // string/binary identifier + separator = 2\n\t    }, 0);\n\t\n\t    var resultArray = new Uint8Array(totalLength);\n\t\n\t    var bufferIndex = 0;\n\t    encodedPackets.forEach(function(p) {\n\t      var isString = typeof p === 'string';\n\t      var ab = p;\n\t      if (isString) {\n\t        var view = new Uint8Array(p.length);\n\t        for (var i = 0; i < p.length; i++) {\n\t          view[i] = p.charCodeAt(i);\n\t        }\n\t        ab = view.buffer;\n\t      }\n\t\n\t      if (isString) { // not true binary\n\t        resultArray[bufferIndex++] = 0;\n\t      } else { // true binary\n\t        resultArray[bufferIndex++] = 1;\n\t      }\n\t\n\t      var lenStr = ab.byteLength.toString();\n\t      for (var i = 0; i < lenStr.length; i++) {\n\t        resultArray[bufferIndex++] = parseInt(lenStr[i]);\n\t      }\n\t      resultArray[bufferIndex++] = 255;\n\t\n\t      var view = new Uint8Array(ab);\n\t      for (var i = 0; i < view.length; i++) {\n\t        resultArray[bufferIndex++] = view[i];\n\t      }\n\t    });\n\t\n\t    return callback(resultArray.buffer);\n\t  });\n\t};\n\t\n\t/**\n\t * Encode as Blob\n\t */\n\t\n\texports.encodePayloadAsBlob = function(packets, callback) {\n\t  function encodeOne(packet, doneCallback) {\n\t    exports.encodePacket(packet, true, true, function(encoded) {\n\t      var binaryIdentifier = new Uint8Array(1);\n\t      binaryIdentifier[0] = 1;\n\t      if (typeof encoded === 'string') {\n\t        var view = new Uint8Array(encoded.length);\n\t        for (var i = 0; i < encoded.length; i++) {\n\t          view[i] = encoded.charCodeAt(i);\n\t        }\n\t        encoded = view.buffer;\n\t        binaryIdentifier[0] = 0;\n\t      }\n\t\n\t      var len = (encoded instanceof ArrayBuffer)\n\t        ? encoded.byteLength\n\t        : encoded.size;\n\t\n\t      var lenStr = len.toString();\n\t      var lengthAry = new Uint8Array(lenStr.length + 1);\n\t      for (var i = 0; i < lenStr.length; i++) {\n\t        lengthAry[i] = parseInt(lenStr[i]);\n\t      }\n\t      lengthAry[lenStr.length] = 255;\n\t\n\t      if (Blob) {\n\t        var blob = new Blob([binaryIdentifier.buffer, lengthAry.buffer, encoded]);\n\t        doneCallback(null, blob);\n\t      }\n\t    });\n\t  }\n\t\n\t  map(packets, encodeOne, function(err, results) {\n\t    return callback(new Blob(results));\n\t  });\n\t};\n\t\n\t/*\n\t * Decodes data when a payload is maybe expected. Strings are decoded by\n\t * interpreting each byte as a key code for entries marked to start with 0. See\n\t * description of encodePayloadAsBinary\n\t *\n\t * @param {ArrayBuffer} data, callback method\n\t * @api public\n\t */\n\t\n\texports.decodePayloadAsBinary = function (data, binaryType, callback) {\n\t  if (typeof binaryType === 'function') {\n\t    callback = binaryType;\n\t    binaryType = null;\n\t  }\n\t\n\t  var bufferTail = data;\n\t  var buffers = [];\n\t\n\t  while (bufferTail.byteLength > 0) {\n\t    var tailArray = new Uint8Array(bufferTail);\n\t    var isString = tailArray[0] === 0;\n\t    var msgLength = '';\n\t\n\t    for (var i = 1; ; i++) {\n\t      if (tailArray[i] === 255) break;\n\t\n\t      // 310 = char length of Number.MAX_VALUE\n\t      if (msgLength.length > 310) {\n\t        return callback(err, 0, 1);\n\t      }\n\t\n\t      msgLength += tailArray[i];\n\t    }\n\t\n\t    bufferTail = sliceBuffer(bufferTail, 2 + msgLength.length);\n\t    msgLength = parseInt(msgLength);\n\t\n\t    var msg = sliceBuffer(bufferTail, 0, msgLength);\n\t    if (isString) {\n\t      try {\n\t        msg = String.fromCharCode.apply(null, new Uint8Array(msg));\n\t      } catch (e) {\n\t        // iPhone Safari doesn't let you apply to typed arrays\n\t        var typed = new Uint8Array(msg);\n\t        msg = '';\n\t        for (var i = 0; i < typed.length; i++) {\n\t          msg += String.fromCharCode(typed[i]);\n\t        }\n\t      }\n\t    }\n\t\n\t    buffers.push(msg);\n\t    bufferTail = sliceBuffer(bufferTail, msgLength);\n\t  }\n\t\n\t  var total = buffers.length;\n\t  buffers.forEach(function(buffer, i) {\n\t    callback(exports.decodePacket(buffer, binaryType, true), i, total);\n\t  });\n\t};\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports) {\n\n\t\n\t/**\n\t * Gets the keys for an object.\n\t *\n\t * @return {Array} keys\n\t * @api private\n\t */\n\t\n\tmodule.exports = Object.keys || function keys (obj){\n\t  var arr = [];\n\t  var has = Object.prototype.hasOwnProperty;\n\t\n\t  for (var i in obj) {\n\t    if (has.call(obj, i)) {\n\t      arr.push(i);\n\t    }\n\t  }\n\t  return arr;\n\t};\n\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports) {\n\n\t/**\n\t * An abstraction for slicing an arraybuffer even when\n\t * ArrayBuffer.prototype.slice is not supported\n\t *\n\t * @api public\n\t */\n\t\n\tmodule.exports = function(arraybuffer, start, end) {\n\t  var bytes = arraybuffer.byteLength;\n\t  start = start || 0;\n\t  end = end || bytes;\n\t\n\t  if (arraybuffer.slice) { return arraybuffer.slice(start, end); }\n\t\n\t  if (start < 0) { start += bytes; }\n\t  if (end < 0) { end += bytes; }\n\t  if (end > bytes) { end = bytes; }\n\t\n\t  if (start >= bytes || start >= end || bytes === 0) {\n\t    return new ArrayBuffer(0);\n\t  }\n\t\n\t  var abv = new Uint8Array(arraybuffer);\n\t  var result = new Uint8Array(end - start);\n\t  for (var i = start, ii = 0; i < end; i++, ii++) {\n\t    result[ii] = abv[i];\n\t  }\n\t  return result.buffer;\n\t};\n\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports) {\n\n\tmodule.exports = after\n\t\n\tfunction after(count, callback, err_cb) {\n\t    var bail = false\n\t    err_cb = err_cb || noop\n\t    proxy.count = count\n\t\n\t    return (count === 0) ? callback() : proxy\n\t\n\t    function proxy(err, result) {\n\t        if (proxy.count <= 0) {\n\t            throw new Error('after called too many times')\n\t        }\n\t        --proxy.count\n\t\n\t        // after first error, rest are passed to err_cb\n\t        if (err) {\n\t            bail = true\n\t            callback(err)\n\t            // future error callbacks will go to error handler\n\t            callback = err_cb\n\t        } else if (proxy.count === 0 && !bail) {\n\t            callback(null, result)\n\t        }\n\t    }\n\t}\n\t\n\tfunction noop() {}\n\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! https://mths.be/utf8js v2.1.2 by @mathias */\n\t;(function(root) {\n\t\n\t\t// Detect free variables `exports`\n\t\tvar freeExports = typeof exports == 'object' && exports;\n\t\n\t\t// Detect free variable `module`\n\t\tvar freeModule = typeof module == 'object' && module &&\n\t\t\tmodule.exports == freeExports && module;\n\t\n\t\t// Detect free variable `global`, from Node.js or Browserified code,\n\t\t// and use it as `root`\n\t\tvar freeGlobal = typeof global == 'object' && global;\n\t\tif (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {\n\t\t\troot = freeGlobal;\n\t\t}\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\tvar stringFromCharCode = String.fromCharCode;\n\t\n\t\t// Taken from https://mths.be/punycode\n\t\tfunction ucs2decode(string) {\n\t\t\tvar output = [];\n\t\t\tvar counter = 0;\n\t\t\tvar length = string.length;\n\t\t\tvar value;\n\t\t\tvar extra;\n\t\t\twhile (counter < length) {\n\t\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\t\toutput.push(value);\n\t\t\t\t\t\tcounter--;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\toutput.push(value);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn output;\n\t\t}\n\t\n\t\t// Taken from https://mths.be/punycode\n\t\tfunction ucs2encode(array) {\n\t\t\tvar length = array.length;\n\t\t\tvar index = -1;\n\t\t\tvar value;\n\t\t\tvar output = '';\n\t\t\twhile (++index < length) {\n\t\t\t\tvalue = array[index];\n\t\t\t\tif (value > 0xFFFF) {\n\t\t\t\t\tvalue -= 0x10000;\n\t\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t\t}\n\t\t\t\toutput += stringFromCharCode(value);\n\t\t\t}\n\t\t\treturn output;\n\t\t}\n\t\n\t\tfunction checkScalarValue(codePoint, strict) {\n\t\t\tif (codePoint >= 0xD800 && codePoint <= 0xDFFF) {\n\t\t\t\tif (strict) {\n\t\t\t\t\tthrow Error(\n\t\t\t\t\t\t'Lone surrogate U+' + codePoint.toString(16).toUpperCase() +\n\t\t\t\t\t\t' is not a scalar value'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\tfunction createByte(codePoint, shift) {\n\t\t\treturn stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80);\n\t\t}\n\t\n\t\tfunction encodeCodePoint(codePoint, strict) {\n\t\t\tif ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence\n\t\t\t\treturn stringFromCharCode(codePoint);\n\t\t\t}\n\t\t\tvar symbol = '';\n\t\t\tif ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence\n\t\t\t\tsymbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0);\n\t\t\t}\n\t\t\telse if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence\n\t\t\t\tif (!checkScalarValue(codePoint, strict)) {\n\t\t\t\t\tcodePoint = 0xFFFD;\n\t\t\t\t}\n\t\t\t\tsymbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0);\n\t\t\t\tsymbol += createByte(codePoint, 6);\n\t\t\t}\n\t\t\telse if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence\n\t\t\t\tsymbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0);\n\t\t\t\tsymbol += createByte(codePoint, 12);\n\t\t\t\tsymbol += createByte(codePoint, 6);\n\t\t\t}\n\t\t\tsymbol += stringFromCharCode((codePoint & 0x3F) | 0x80);\n\t\t\treturn symbol;\n\t\t}\n\t\n\t\tfunction utf8encode(string, opts) {\n\t\t\topts = opts || {};\n\t\t\tvar strict = false !== opts.strict;\n\t\n\t\t\tvar codePoints = ucs2decode(string);\n\t\t\tvar length = codePoints.length;\n\t\t\tvar index = -1;\n\t\t\tvar codePoint;\n\t\t\tvar byteString = '';\n\t\t\twhile (++index < length) {\n\t\t\t\tcodePoint = codePoints[index];\n\t\t\t\tbyteString += encodeCodePoint(codePoint, strict);\n\t\t\t}\n\t\t\treturn byteString;\n\t\t}\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\tfunction readContinuationByte() {\n\t\t\tif (byteIndex >= byteCount) {\n\t\t\t\tthrow Error('Invalid byte index');\n\t\t\t}\n\t\n\t\t\tvar continuationByte = byteArray[byteIndex] & 0xFF;\n\t\t\tbyteIndex++;\n\t\n\t\t\tif ((continuationByte & 0xC0) == 0x80) {\n\t\t\t\treturn continuationByte & 0x3F;\n\t\t\t}\n\t\n\t\t\t// If we end up here, it’s not a continuation byte\n\t\t\tthrow Error('Invalid continuation byte');\n\t\t}\n\t\n\t\tfunction decodeSymbol(strict) {\n\t\t\tvar byte1;\n\t\t\tvar byte2;\n\t\t\tvar byte3;\n\t\t\tvar byte4;\n\t\t\tvar codePoint;\n\t\n\t\t\tif (byteIndex > byteCount) {\n\t\t\t\tthrow Error('Invalid byte index');\n\t\t\t}\n\t\n\t\t\tif (byteIndex == byteCount) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\n\t\t\t// Read first byte\n\t\t\tbyte1 = byteArray[byteIndex] & 0xFF;\n\t\t\tbyteIndex++;\n\t\n\t\t\t// 1-byte sequence (no continuation bytes)\n\t\t\tif ((byte1 & 0x80) == 0) {\n\t\t\t\treturn byte1;\n\t\t\t}\n\t\n\t\t\t// 2-byte sequence\n\t\t\tif ((byte1 & 0xE0) == 0xC0) {\n\t\t\t\tbyte2 = readContinuationByte();\n\t\t\t\tcodePoint = ((byte1 & 0x1F) << 6) | byte2;\n\t\t\t\tif (codePoint >= 0x80) {\n\t\t\t\t\treturn codePoint;\n\t\t\t\t} else {\n\t\t\t\t\tthrow Error('Invalid continuation byte');\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// 3-byte sequence (may include unpaired surrogates)\n\t\t\tif ((byte1 & 0xF0) == 0xE0) {\n\t\t\t\tbyte2 = readContinuationByte();\n\t\t\t\tbyte3 = readContinuationByte();\n\t\t\t\tcodePoint = ((byte1 & 0x0F) << 12) | (byte2 << 6) | byte3;\n\t\t\t\tif (codePoint >= 0x0800) {\n\t\t\t\t\treturn checkScalarValue(codePoint, strict) ? codePoint : 0xFFFD;\n\t\t\t\t} else {\n\t\t\t\t\tthrow Error('Invalid continuation byte');\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// 4-byte sequence\n\t\t\tif ((byte1 & 0xF8) == 0xF0) {\n\t\t\t\tbyte2 = readContinuationByte();\n\t\t\t\tbyte3 = readContinuationByte();\n\t\t\t\tbyte4 = readContinuationByte();\n\t\t\t\tcodePoint = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0C) |\n\t\t\t\t\t(byte3 << 0x06) | byte4;\n\t\t\t\tif (codePoint >= 0x010000 && codePoint <= 0x10FFFF) {\n\t\t\t\t\treturn codePoint;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\tthrow Error('Invalid UTF-8 detected');\n\t\t}\n\t\n\t\tvar byteArray;\n\t\tvar byteCount;\n\t\tvar byteIndex;\n\t\tfunction utf8decode(byteString, opts) {\n\t\t\topts = opts || {};\n\t\t\tvar strict = false !== opts.strict;\n\t\n\t\t\tbyteArray = ucs2decode(byteString);\n\t\t\tbyteCount = byteArray.length;\n\t\t\tbyteIndex = 0;\n\t\t\tvar codePoints = [];\n\t\t\tvar tmp;\n\t\t\twhile ((tmp = decodeSymbol(strict)) !== false) {\n\t\t\t\tcodePoints.push(tmp);\n\t\t\t}\n\t\t\treturn ucs2encode(codePoints);\n\t\t}\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\tvar utf8 = {\n\t\t\t'version': '2.1.2',\n\t\t\t'encode': utf8encode,\n\t\t\t'decode': utf8decode\n\t\t};\n\t\n\t\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t\t// like the following:\n\t\tif (\n\t\t\ttrue\n\t\t) {\n\t\t\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function() {\n\t\t\t\treturn utf8;\n\t\t\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t\t}\telse if (freeExports && !freeExports.nodeType) {\n\t\t\tif (freeModule) { // in Node.js or RingoJS v0.8.0+\n\t\t\t\tfreeModule.exports = utf8;\n\t\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\t\tvar object = {};\n\t\t\t\tvar hasOwnProperty = object.hasOwnProperty;\n\t\t\t\tfor (var key in utf8) {\n\t\t\t\t\thasOwnProperty.call(utf8, key) && (freeExports[key] = utf8[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // in Rhino or a web browser\n\t\t\troot.utf8 = utf8;\n\t\t}\n\t\n\t}(this));\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(25)(module), (function() { return this; }())))\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports) {\n\n\tmodule.exports = function(module) {\r\n\t\tif(!module.webpackPolyfill) {\r\n\t\t\tmodule.deprecate = function() {};\r\n\t\t\tmodule.paths = [];\r\n\t\t\t// module.parent = undefined by default\r\n\t\t\tmodule.children = [];\r\n\t\t\tmodule.webpackPolyfill = 1;\r\n\t\t}\r\n\t\treturn module;\r\n\t}\r\n\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports) {\n\n\t/*\n\t * base64-arraybuffer\n\t * https://github.com/niklasvh/base64-arraybuffer\n\t *\n\t * Copyright (c) 2012 Niklas von Hertzen\n\t * Licensed under the MIT license.\n\t */\n\t(function(){\n\t  \"use strict\";\n\t\n\t  var chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\t\n\t  // Use a lookup table to find the index.\n\t  var lookup = new Uint8Array(256);\n\t  for (var i = 0; i < chars.length; i++) {\n\t    lookup[chars.charCodeAt(i)] = i;\n\t  }\n\t\n\t  exports.encode = function(arraybuffer) {\n\t    var bytes = new Uint8Array(arraybuffer),\n\t    i, len = bytes.length, base64 = \"\";\n\t\n\t    for (i = 0; i < len; i+=3) {\n\t      base64 += chars[bytes[i] >> 2];\n\t      base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n\t      base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n\t      base64 += chars[bytes[i + 2] & 63];\n\t    }\n\t\n\t    if ((len % 3) === 2) {\n\t      base64 = base64.substring(0, base64.length - 1) + \"=\";\n\t    } else if (len % 3 === 1) {\n\t      base64 = base64.substring(0, base64.length - 2) + \"==\";\n\t    }\n\t\n\t    return base64;\n\t  };\n\t\n\t  exports.decode =  function(base64) {\n\t    var bufferLength = base64.length * 0.75,\n\t    len = base64.length, i, p = 0,\n\t    encoded1, encoded2, encoded3, encoded4;\n\t\n\t    if (base64[base64.length - 1] === \"=\") {\n\t      bufferLength--;\n\t      if (base64[base64.length - 2] === \"=\") {\n\t        bufferLength--;\n\t      }\n\t    }\n\t\n\t    var arraybuffer = new ArrayBuffer(bufferLength),\n\t    bytes = new Uint8Array(arraybuffer);\n\t\n\t    for (i = 0; i < len; i+=4) {\n\t      encoded1 = lookup[base64.charCodeAt(i)];\n\t      encoded2 = lookup[base64.charCodeAt(i+1)];\n\t      encoded3 = lookup[base64.charCodeAt(i+2)];\n\t      encoded4 = lookup[base64.charCodeAt(i+3)];\n\t\n\t      bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n\t      bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n\t      bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n\t    }\n\t\n\t    return arraybuffer;\n\t  };\n\t})();\n\n\n/***/ }),\n/* 27 */\n/***/ (function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/**\n\t * Create a blob builder even when vendor prefixes exist\n\t */\n\t\n\tvar BlobBuilder = global.BlobBuilder\n\t  || global.WebKitBlobBuilder\n\t  || global.MSBlobBuilder\n\t  || global.MozBlobBuilder;\n\t\n\t/**\n\t * Check if Blob constructor is supported\n\t */\n\t\n\tvar blobSupported = (function() {\n\t  try {\n\t    var a = new Blob(['hi']);\n\t    return a.size === 2;\n\t  } catch(e) {\n\t    return false;\n\t  }\n\t})();\n\t\n\t/**\n\t * Check if Blob constructor supports ArrayBufferViews\n\t * Fails in Safari 6, so we need to map to ArrayBuffers there.\n\t */\n\t\n\tvar blobSupportsArrayBufferView = blobSupported && (function() {\n\t  try {\n\t    var b = new Blob([new Uint8Array([1,2])]);\n\t    return b.size === 2;\n\t  } catch(e) {\n\t    return false;\n\t  }\n\t})();\n\t\n\t/**\n\t * Check if BlobBuilder is supported\n\t */\n\t\n\tvar blobBuilderSupported = BlobBuilder\n\t  && BlobBuilder.prototype.append\n\t  && BlobBuilder.prototype.getBlob;\n\t\n\t/**\n\t * Helper function that maps ArrayBufferViews to ArrayBuffers\n\t * Used by BlobBuilder constructor and old browsers that didn't\n\t * support it in the Blob constructor.\n\t */\n\t\n\tfunction mapArrayBufferViews(ary) {\n\t  for (var i = 0; i < ary.length; i++) {\n\t    var chunk = ary[i];\n\t    if (chunk.buffer instanceof ArrayBuffer) {\n\t      var buf = chunk.buffer;\n\t\n\t      // if this is a subarray, make a copy so we only\n\t      // include the subarray region from the underlying buffer\n\t      if (chunk.byteLength !== buf.byteLength) {\n\t        var copy = new Uint8Array(chunk.byteLength);\n\t        copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n\t        buf = copy.buffer;\n\t      }\n\t\n\t      ary[i] = buf;\n\t    }\n\t  }\n\t}\n\t\n\tfunction BlobBuilderConstructor(ary, options) {\n\t  options = options || {};\n\t\n\t  var bb = new BlobBuilder();\n\t  mapArrayBufferViews(ary);\n\t\n\t  for (var i = 0; i < ary.length; i++) {\n\t    bb.append(ary[i]);\n\t  }\n\t\n\t  return (options.type) ? bb.getBlob(options.type) : bb.getBlob();\n\t};\n\t\n\tfunction BlobConstructor(ary, options) {\n\t  mapArrayBufferViews(ary);\n\t  return new Blob(ary, options || {});\n\t};\n\t\n\tmodule.exports = (function() {\n\t  if (blobSupported) {\n\t    return blobSupportsArrayBufferView ? global.Blob : BlobConstructor;\n\t  } else if (blobBuilderSupported) {\n\t    return BlobBuilderConstructor;\n\t  } else {\n\t    return undefined;\n\t  }\n\t})();\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 28 */\n/***/ (function(module, exports) {\n\n\t/**\r\n\t * Compiles a querystring\r\n\t * Returns string representation of the object\r\n\t *\r\n\t * @param {Object}\r\n\t * @api private\r\n\t */\r\n\t\r\n\texports.encode = function (obj) {\r\n\t  var str = '';\r\n\t\r\n\t  for (var i in obj) {\r\n\t    if (obj.hasOwnProperty(i)) {\r\n\t      if (str.length) str += '&';\r\n\t      str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]);\r\n\t    }\r\n\t  }\r\n\t\r\n\t  return str;\r\n\t};\r\n\t\r\n\t/**\r\n\t * Parses a simple querystring into an object\r\n\t *\r\n\t * @param {String} qs\r\n\t * @api private\r\n\t */\r\n\t\r\n\texports.decode = function(qs){\r\n\t  var qry = {};\r\n\t  var pairs = qs.split('&');\r\n\t  for (var i = 0, l = pairs.length; i < l; i++) {\r\n\t    var pair = pairs[i].split('=');\r\n\t    qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);\r\n\t  }\r\n\t  return qry;\r\n\t};\r\n\n\n/***/ }),\n/* 29 */\n/***/ (function(module, exports) {\n\n\t\n\tmodule.exports = function(a, b){\n\t  var fn = function(){};\n\t  fn.prototype = b.prototype;\n\t  a.prototype = new fn;\n\t  a.prototype.constructor = a;\n\t};\n\n/***/ }),\n/* 30 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\tvar alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split('')\n\t  , length = 64\n\t  , map = {}\n\t  , seed = 0\n\t  , i = 0\n\t  , prev;\n\t\n\t/**\n\t * Return a string representing the specified number.\n\t *\n\t * @param {Number} num The number to convert.\n\t * @returns {String} The string representation of the number.\n\t * @api public\n\t */\n\tfunction encode(num) {\n\t  var encoded = '';\n\t\n\t  do {\n\t    encoded = alphabet[num % length] + encoded;\n\t    num = Math.floor(num / length);\n\t  } while (num > 0);\n\t\n\t  return encoded;\n\t}\n\t\n\t/**\n\t * Return the integer value specified by the given string.\n\t *\n\t * @param {String} str The string to convert.\n\t * @returns {Number} The integer value represented by the string.\n\t * @api public\n\t */\n\tfunction decode(str) {\n\t  var decoded = 0;\n\t\n\t  for (i = 0; i < str.length; i++) {\n\t    decoded = decoded * length + map[str.charAt(i)];\n\t  }\n\t\n\t  return decoded;\n\t}\n\t\n\t/**\n\t * Yeast: A tiny growing id generator.\n\t *\n\t * @returns {String} A unique id.\n\t * @api public\n\t */\n\tfunction yeast() {\n\t  var now = encode(+new Date());\n\t\n\t  if (now !== prev) return seed = 0, prev = now;\n\t  return now +'.'+ encode(seed++);\n\t}\n\t\n\t//\n\t// Map each character to its index.\n\t//\n\tfor (; i < length; i++) map[alphabet[i]] = i;\n\t\n\t//\n\t// Expose the `yeast`, `encode` and `decode` functions.\n\t//\n\tyeast.encode = encode;\n\tyeast.decode = decode;\n\tmodule.exports = yeast;\n\n\n/***/ }),\n/* 31 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {\n\t/**\n\t * Module requirements.\n\t */\n\t\n\tvar Polling = __webpack_require__(18);\n\tvar inherit = __webpack_require__(29);\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = JSONPPolling;\n\t\n\t/**\n\t * Cached regular expressions.\n\t */\n\t\n\tvar rNewline = /\\n/g;\n\tvar rEscapedNewline = /\\\\n/g;\n\t\n\t/**\n\t * Global JSONP callbacks.\n\t */\n\t\n\tvar callbacks;\n\t\n\t/**\n\t * Noop.\n\t */\n\t\n\tfunction empty () { }\n\t\n\t/**\n\t * JSONP Polling constructor.\n\t *\n\t * @param {Object} opts.\n\t * @api public\n\t */\n\t\n\tfunction JSONPPolling (opts) {\n\t  Polling.call(this, opts);\n\t\n\t  this.query = this.query || {};\n\t\n\t  // define global callbacks array if not present\n\t  // we do this here (lazily) to avoid unneeded global pollution\n\t  if (!callbacks) {\n\t    // we need to consider multiple engines in the same page\n\t    if (!global.___eio) global.___eio = [];\n\t    callbacks = global.___eio;\n\t  }\n\t\n\t  // callback identifier\n\t  this.index = callbacks.length;\n\t\n\t  // add callback to jsonp global\n\t  var self = this;\n\t  callbacks.push(function (msg) {\n\t    self.onData(msg);\n\t  });\n\t\n\t  // append to query string\n\t  this.query.j = this.index;\n\t\n\t  // prevent spurious errors from being emitted when the window is unloaded\n\t  if (global.document && global.addEventListener) {\n\t    global.addEventListener('beforeunload', function () {\n\t      if (self.script) self.script.onerror = empty;\n\t    }, false);\n\t  }\n\t}\n\t\n\t/**\n\t * Inherits from Polling.\n\t */\n\t\n\tinherit(JSONPPolling, Polling);\n\t\n\t/*\n\t * JSONP only supports binary as base64 encoded strings\n\t */\n\t\n\tJSONPPolling.prototype.supportsBinary = false;\n\t\n\t/**\n\t * Closes the socket.\n\t *\n\t * @api private\n\t */\n\t\n\tJSONPPolling.prototype.doClose = function () {\n\t  if (this.script) {\n\t    this.script.parentNode.removeChild(this.script);\n\t    this.script = null;\n\t  }\n\t\n\t  if (this.form) {\n\t    this.form.parentNode.removeChild(this.form);\n\t    this.form = null;\n\t    this.iframe = null;\n\t  }\n\t\n\t  Polling.prototype.doClose.call(this);\n\t};\n\t\n\t/**\n\t * Starts a poll cycle.\n\t *\n\t * @api private\n\t */\n\t\n\tJSONPPolling.prototype.doPoll = function () {\n\t  var self = this;\n\t  var script = document.createElement('script');\n\t\n\t  if (this.script) {\n\t    this.script.parentNode.removeChild(this.script);\n\t    this.script = null;\n\t  }\n\t\n\t  script.async = true;\n\t  script.src = this.uri();\n\t  script.onerror = function (e) {\n\t    self.onError('jsonp poll error', e);\n\t  };\n\t\n\t  var insertAt = document.getElementsByTagName('script')[0];\n\t  if (insertAt) {\n\t    insertAt.parentNode.insertBefore(script, insertAt);\n\t  } else {\n\t    (document.head || document.body).appendChild(script);\n\t  }\n\t  this.script = script;\n\t\n\t  var isUAgecko = 'undefined' !== typeof navigator && /gecko/i.test(navigator.userAgent);\n\t\n\t  if (isUAgecko) {\n\t    setTimeout(function () {\n\t      var iframe = document.createElement('iframe');\n\t      document.body.appendChild(iframe);\n\t      document.body.removeChild(iframe);\n\t    }, 100);\n\t  }\n\t};\n\t\n\t/**\n\t * Writes with a hidden iframe.\n\t *\n\t * @param {String} data to send\n\t * @param {Function} called upon flush.\n\t * @api private\n\t */\n\t\n\tJSONPPolling.prototype.doWrite = function (data, fn) {\n\t  var self = this;\n\t\n\t  if (!this.form) {\n\t    var form = document.createElement('form');\n\t    var area = document.createElement('textarea');\n\t    var id = this.iframeId = 'eio_iframe_' + this.index;\n\t    var iframe;\n\t\n\t    form.className = 'socketio';\n\t    form.style.position = 'absolute';\n\t    form.style.top = '-1000px';\n\t    form.style.left = '-1000px';\n\t    form.target = id;\n\t    form.method = 'POST';\n\t    form.setAttribute('accept-charset', 'utf-8');\n\t    area.name = 'd';\n\t    form.appendChild(area);\n\t    document.body.appendChild(form);\n\t\n\t    this.form = form;\n\t    this.area = area;\n\t  }\n\t\n\t  this.form.action = this.uri();\n\t\n\t  function complete () {\n\t    initIframe();\n\t    fn();\n\t  }\n\t\n\t  function initIframe () {\n\t    if (self.iframe) {\n\t      try {\n\t        self.form.removeChild(self.iframe);\n\t      } catch (e) {\n\t        self.onError('jsonp polling iframe removal error', e);\n\t      }\n\t    }\n\t\n\t    try {\n\t      // ie6 dynamic iframes with target=\"\" support (thanks Chris Lambacher)\n\t      var html = '<iframe src=\"javascript:0\" name=\"' + self.iframeId + '\">';\n\t      iframe = document.createElement(html);\n\t    } catch (e) {\n\t      iframe = document.createElement('iframe');\n\t      iframe.name = self.iframeId;\n\t      iframe.src = 'javascript:0';\n\t    }\n\t\n\t    iframe.id = self.iframeId;\n\t\n\t    self.form.appendChild(iframe);\n\t    self.iframe = iframe;\n\t  }\n\t\n\t  initIframe();\n\t\n\t  // escape \\n to prevent it from being converted into \\r\\n by some UAs\n\t  // double escaping is required for escaped new lines because unescaping of new lines can be done safely on server-side\n\t  data = data.replace(rEscapedNewline, '\\\\\\n');\n\t  this.area.value = data.replace(rNewline, '\\\\n');\n\t\n\t  try {\n\t    this.form.submit();\n\t  } catch (e) {}\n\t\n\t  if (this.iframe.attachEvent) {\n\t    this.iframe.onreadystatechange = function () {\n\t      if (self.iframe.readyState === 'complete') {\n\t        complete();\n\t      }\n\t    };\n\t  } else {\n\t    this.iframe.onload = complete;\n\t  }\n\t};\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 32 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/**\n\t * Module dependencies.\n\t */\n\t\n\tvar Transport = __webpack_require__(19);\n\tvar parser = __webpack_require__(20);\n\tvar parseqs = __webpack_require__(28);\n\tvar inherit = __webpack_require__(29);\n\tvar yeast = __webpack_require__(30);\n\tvar debug = __webpack_require__(3)('engine.io-client:websocket');\n\tvar BrowserWebSocket = global.WebSocket || global.MozWebSocket;\n\tvar NodeWebSocket;\n\tif (typeof window === 'undefined') {\n\t  try {\n\t    NodeWebSocket = __webpack_require__(33);\n\t  } catch (e) { }\n\t}\n\t\n\t/**\n\t * Get either the `WebSocket` or `MozWebSocket` globals\n\t * in the browser or try to resolve WebSocket-compatible\n\t * interface exposed by `ws` for Node-like environment.\n\t */\n\t\n\tvar WebSocket = BrowserWebSocket;\n\tif (!WebSocket && typeof window === 'undefined') {\n\t  WebSocket = NodeWebSocket;\n\t}\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = WS;\n\t\n\t/**\n\t * WebSocket transport constructor.\n\t *\n\t * @api {Object} connection options\n\t * @api public\n\t */\n\t\n\tfunction WS (opts) {\n\t  var forceBase64 = (opts && opts.forceBase64);\n\t  if (forceBase64) {\n\t    this.supportsBinary = false;\n\t  }\n\t  this.perMessageDeflate = opts.perMessageDeflate;\n\t  this.usingBrowserWebSocket = BrowserWebSocket && !opts.forceNode;\n\t  this.protocols = opts.protocols;\n\t  if (!this.usingBrowserWebSocket) {\n\t    WebSocket = NodeWebSocket;\n\t  }\n\t  Transport.call(this, opts);\n\t}\n\t\n\t/**\n\t * Inherits from Transport.\n\t */\n\t\n\tinherit(WS, Transport);\n\t\n\t/**\n\t * Transport name.\n\t *\n\t * @api public\n\t */\n\t\n\tWS.prototype.name = 'websocket';\n\t\n\t/*\n\t * WebSockets support binary\n\t */\n\t\n\tWS.prototype.supportsBinary = true;\n\t\n\t/**\n\t * Opens socket.\n\t *\n\t * @api private\n\t */\n\t\n\tWS.prototype.doOpen = function () {\n\t  if (!this.check()) {\n\t    // let probe timeout\n\t    return;\n\t  }\n\t\n\t  var uri = this.uri();\n\t  var protocols = this.protocols;\n\t  var opts = {\n\t    agent: this.agent,\n\t    perMessageDeflate: this.perMessageDeflate\n\t  };\n\t\n\t  // SSL options for Node.js client\n\t  opts.pfx = this.pfx;\n\t  opts.key = this.key;\n\t  opts.passphrase = this.passphrase;\n\t  opts.cert = this.cert;\n\t  opts.ca = this.ca;\n\t  opts.ciphers = this.ciphers;\n\t  opts.rejectUnauthorized = this.rejectUnauthorized;\n\t  if (this.extraHeaders) {\n\t    opts.headers = this.extraHeaders;\n\t  }\n\t  if (this.localAddress) {\n\t    opts.localAddress = this.localAddress;\n\t  }\n\t\n\t  try {\n\t    this.ws = this.usingBrowserWebSocket ? (protocols ? new WebSocket(uri, protocols) : new WebSocket(uri)) : new WebSocket(uri, protocols, opts);\n\t  } catch (err) {\n\t    return this.emit('error', err);\n\t  }\n\t\n\t  if (this.ws.binaryType === undefined) {\n\t    this.supportsBinary = false;\n\t  }\n\t\n\t  if (this.ws.supports && this.ws.supports.binary) {\n\t    this.supportsBinary = true;\n\t    this.ws.binaryType = 'nodebuffer';\n\t  } else {\n\t    this.ws.binaryType = 'arraybuffer';\n\t  }\n\t\n\t  this.addEventListeners();\n\t};\n\t\n\t/**\n\t * Adds event listeners to the socket\n\t *\n\t * @api private\n\t */\n\t\n\tWS.prototype.addEventListeners = function () {\n\t  var self = this;\n\t\n\t  this.ws.onopen = function () {\n\t    self.onOpen();\n\t  };\n\t  this.ws.onclose = function () {\n\t    self.onClose();\n\t  };\n\t  this.ws.onmessage = function (ev) {\n\t    self.onData(ev.data);\n\t  };\n\t  this.ws.onerror = function (e) {\n\t    self.onError('websocket error', e);\n\t  };\n\t};\n\t\n\t/**\n\t * Writes data to socket.\n\t *\n\t * @param {Array} array of packets.\n\t * @api private\n\t */\n\t\n\tWS.prototype.write = function (packets) {\n\t  var self = this;\n\t  this.writable = false;\n\t\n\t  // encodePacket efficient as it uses WS framing\n\t  // no need for encodePayload\n\t  var total = packets.length;\n\t  for (var i = 0, l = total; i < l; i++) {\n\t    (function (packet) {\n\t      parser.encodePacket(packet, self.supportsBinary, function (data) {\n\t        if (!self.usingBrowserWebSocket) {\n\t          // always create a new object (GH-437)\n\t          var opts = {};\n\t          if (packet.options) {\n\t            opts.compress = packet.options.compress;\n\t          }\n\t\n\t          if (self.perMessageDeflate) {\n\t            var len = 'string' === typeof data ? global.Buffer.byteLength(data) : data.length;\n\t            if (len < self.perMessageDeflate.threshold) {\n\t              opts.compress = false;\n\t            }\n\t          }\n\t        }\n\t\n\t        // Sometimes the websocket has already been closed but the browser didn't\n\t        // have a chance of informing us about it yet, in that case send will\n\t        // throw an error\n\t        try {\n\t          if (self.usingBrowserWebSocket) {\n\t            // TypeError is thrown when passing the second argument on Safari\n\t            self.ws.send(data);\n\t          } else {\n\t            self.ws.send(data, opts);\n\t          }\n\t        } catch (e) {\n\t\n\t        }\n\t\n\t        --total || done();\n\t      });\n\t    })(packets[i]);\n\t  }\n\t\n\t  function done () {\n\t    self.emit('flush');\n\t\n\t    // fake drain\n\t    // defer to next tick to allow Socket to clear writeBuffer\n\t    setTimeout(function () {\n\t      self.writable = true;\n\t      self.emit('drain');\n\t    }, 0);\n\t  }\n\t};\n\t\n\t/**\n\t * Called upon close\n\t *\n\t * @api private\n\t */\n\t\n\tWS.prototype.onClose = function () {\n\t  Transport.prototype.onClose.call(this);\n\t};\n\t\n\t/**\n\t * Closes socket.\n\t *\n\t * @api private\n\t */\n\t\n\tWS.prototype.doClose = function () {\n\t  if (typeof this.ws !== 'undefined') {\n\t    this.ws.close();\n\t  }\n\t};\n\t\n\t/**\n\t * Generates uri for connection.\n\t *\n\t * @api private\n\t */\n\t\n\tWS.prototype.uri = function () {\n\t  var query = this.query || {};\n\t  var schema = this.secure ? 'wss' : 'ws';\n\t  var port = '';\n\t\n\t  // avoid port if default for schema\n\t  if (this.port && (('wss' === schema && Number(this.port) !== 443) ||\n\t    ('ws' === schema && Number(this.port) !== 80))) {\n\t    port = ':' + this.port;\n\t  }\n\t\n\t  // append timestamp to URI\n\t  if (this.timestampRequests) {\n\t    query[this.timestampParam] = yeast();\n\t  }\n\t\n\t  // communicate binary support capabilities\n\t  if (!this.supportsBinary) {\n\t    query.b64 = 1;\n\t  }\n\t\n\t  query = parseqs.encode(query);\n\t\n\t  // prepend ? to query\n\t  if (query.length) {\n\t    query = '?' + query;\n\t  }\n\t\n\t  var ipv6 = this.hostname.indexOf(':') !== -1;\n\t  return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;\n\t};\n\t\n\t/**\n\t * Feature detection for WebSocket.\n\t *\n\t * @return {Boolean} whether this transport is available.\n\t * @api public\n\t */\n\t\n\tWS.prototype.check = function () {\n\t  return !!WebSocket && !('__initialize' in WebSocket && this.name === WS.prototype.name);\n\t};\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 33 */\n/***/ (function(module, exports) {\n\n\t/* (ignored) */\n\n/***/ }),\n/* 34 */\n/***/ (function(module, exports) {\n\n\t\n\tvar indexOf = [].indexOf;\n\t\n\tmodule.exports = function(arr, obj){\n\t  if (indexOf) return arr.indexOf(obj);\n\t  for (var i = 0; i < arr.length; ++i) {\n\t    if (arr[i] === obj) return i;\n\t  }\n\t  return -1;\n\t};\n\n/***/ }),\n/* 35 */\n/***/ (function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/**\r\n\t * JSON parse.\r\n\t *\r\n\t * @see Based on jQuery#parseJSON (MIT) and JSON2\r\n\t * @api private\r\n\t */\r\n\t\r\n\tvar rvalidchars = /^[\\],:{}\\s]*$/;\r\n\tvar rvalidescape = /\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g;\r\n\tvar rvalidtokens = /\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g;\r\n\tvar rvalidbraces = /(?:^|:|,)(?:\\s*\\[)+/g;\r\n\tvar rtrimLeft = /^\\s+/;\r\n\tvar rtrimRight = /\\s+$/;\r\n\t\r\n\tmodule.exports = function parsejson(data) {\r\n\t  if ('string' != typeof data || !data) {\r\n\t    return null;\r\n\t  }\r\n\t\r\n\t  data = data.replace(rtrimLeft, '').replace(rtrimRight, '');\r\n\t\r\n\t  // Attempt to parse using the native JSON parser first\r\n\t  if (global.JSON && JSON.parse) {\r\n\t    return JSON.parse(data);\r\n\t  }\r\n\t\r\n\t  if (rvalidchars.test(data.replace(rvalidescape, '@')\r\n\t      .replace(rvalidtokens, ']')\r\n\t      .replace(rvalidbraces, ''))) {\r\n\t    return (new Function('return ' + data))();\r\n\t  }\r\n\t};\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ }),\n/* 36 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\t\n\t/**\n\t * Module dependencies.\n\t */\n\t\n\tvar parser = __webpack_require__(4);\n\tvar Emitter = __webpack_require__(5);\n\tvar toArray = __webpack_require__(37);\n\tvar on = __webpack_require__(38);\n\tvar bind = __webpack_require__(39);\n\tvar debug = __webpack_require__(3)('socket.io-client:socket');\n\tvar parseqs = __webpack_require__(28);\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = exports = Socket;\n\t\n\t/**\n\t * Internal events (blacklisted).\n\t * These events can't be emitted by the user.\n\t *\n\t * @api private\n\t */\n\t\n\tvar events = {\n\t  connect: 1,\n\t  connect_error: 1,\n\t  connect_timeout: 1,\n\t  connecting: 1,\n\t  disconnect: 1,\n\t  error: 1,\n\t  reconnect: 1,\n\t  reconnect_attempt: 1,\n\t  reconnect_failed: 1,\n\t  reconnect_error: 1,\n\t  reconnecting: 1,\n\t  ping: 1,\n\t  pong: 1\n\t};\n\t\n\t/**\n\t * Shortcut to `Emitter#emit`.\n\t */\n\t\n\tvar emit = Emitter.prototype.emit;\n\t\n\t/**\n\t * `Socket` constructor.\n\t *\n\t * @api public\n\t */\n\t\n\tfunction Socket(io, nsp, opts) {\n\t  this.io = io;\n\t  this.nsp = nsp;\n\t  this.json = this; // compat\n\t  this.ids = 0;\n\t  this.acks = {};\n\t  this.receiveBuffer = [];\n\t  this.sendBuffer = [];\n\t  this.connected = false;\n\t  this.disconnected = true;\n\t  if (opts && opts.query) {\n\t    this.query = opts.query;\n\t  }\n\t  if (this.io.autoConnect) this.open();\n\t}\n\t\n\t/**\n\t * Mix in `Emitter`.\n\t */\n\t\n\tEmitter(Socket.prototype);\n\t\n\t/**\n\t * Subscribe to open, close and packet events\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.subEvents = function () {\n\t  if (this.subs) return;\n\t\n\t  var io = this.io;\n\t  this.subs = [on(io, 'open', bind(this, 'onopen')), on(io, 'packet', bind(this, 'onpacket')), on(io, 'close', bind(this, 'onclose'))];\n\t};\n\t\n\t/**\n\t * \"Opens\" the socket.\n\t *\n\t * @api public\n\t */\n\t\n\tSocket.prototype.open = Socket.prototype.connect = function () {\n\t  if (this.connected) return this;\n\t\n\t  this.subEvents();\n\t  this.io.open(); // ensure open\n\t  if ('open' === this.io.readyState) this.onopen();\n\t  this.emit('connecting');\n\t  return this;\n\t};\n\t\n\t/**\n\t * Sends a `message` event.\n\t *\n\t * @return {Socket} self\n\t * @api public\n\t */\n\t\n\tSocket.prototype.send = function () {\n\t  var args = toArray(arguments);\n\t  args.unshift('message');\n\t  this.emit.apply(this, args);\n\t  return this;\n\t};\n\t\n\t/**\n\t * Override `emit`.\n\t * If the event is in `events`, it's emitted normally.\n\t *\n\t * @param {String} event name\n\t * @return {Socket} self\n\t * @api public\n\t */\n\t\n\tSocket.prototype.emit = function (ev) {\n\t  if (events.hasOwnProperty(ev)) {\n\t    emit.apply(this, arguments);\n\t    return this;\n\t  }\n\t\n\t  var args = toArray(arguments);\n\t  var packet = { type: parser.EVENT, data: args };\n\t\n\t  packet.options = {};\n\t  packet.options.compress = !this.flags || false !== this.flags.compress;\n\t\n\t  // event ack callback\n\t  if ('function' === typeof args[args.length - 1]) {\n\t\n\t    this.acks[this.ids] = args.pop();\n\t    packet.id = this.ids++;\n\t  }\n\t\n\t  if (this.connected) {\n\t    this.packet(packet);\n\t  } else {\n\t    this.sendBuffer.push(packet);\n\t  }\n\t\n\t  delete this.flags;\n\t\n\t  return this;\n\t};\n\t\n\t/**\n\t * Sends a packet.\n\t *\n\t * @param {Object} packet\n\t * @api private\n\t */\n\t\n\tSocket.prototype.packet = function (packet) {\n\t  packet.nsp = this.nsp;\n\t  this.io.packet(packet);\n\t};\n\t\n\t/**\n\t * Called upon engine `open`.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onopen = function () {\n\t\n\t  // write connect packet if necessary\n\t  if ('/' !== this.nsp) {\n\t    if (this.query) {\n\t      var query = _typeof(this.query) === 'object' ? parseqs.encode(this.query) : this.query;\n\t\n\t      this.packet({ type: parser.CONNECT, query: query });\n\t    } else {\n\t      this.packet({ type: parser.CONNECT });\n\t    }\n\t  }\n\t};\n\t\n\t/**\n\t * Called upon engine `close`.\n\t *\n\t * @param {String} reason\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onclose = function (reason) {\n\t\n\t  this.connected = false;\n\t  this.disconnected = true;\n\t  delete this.id;\n\t  this.emit('disconnect', reason);\n\t};\n\t\n\t/**\n\t * Called with socket packet.\n\t *\n\t * @param {Object} packet\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onpacket = function (packet) {\n\t  if (packet.nsp !== this.nsp) return;\n\t\n\t  switch (packet.type) {\n\t    case parser.CONNECT:\n\t      this.onconnect();\n\t      break;\n\t\n\t    case parser.EVENT:\n\t      this.onevent(packet);\n\t      break;\n\t\n\t    case parser.BINARY_EVENT:\n\t      this.onevent(packet);\n\t      break;\n\t\n\t    case parser.ACK:\n\t      this.onack(packet);\n\t      break;\n\t\n\t    case parser.BINARY_ACK:\n\t      this.onack(packet);\n\t      break;\n\t\n\t    case parser.DISCONNECT:\n\t      this.ondisconnect();\n\t      break;\n\t\n\t    case parser.ERROR:\n\t      this.emit('error', packet.data);\n\t      break;\n\t  }\n\t};\n\t\n\t/**\n\t * Called upon a server event.\n\t *\n\t * @param {Object} packet\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onevent = function (packet) {\n\t  var args = packet.data || [];\n\t\n\t  if (null != packet.id) {\n\t\n\t    args.push(this.ack(packet.id));\n\t  }\n\t\n\t  if (this.connected) {\n\t    emit.apply(this, args);\n\t  } else {\n\t    this.receiveBuffer.push(args);\n\t  }\n\t};\n\t\n\t/**\n\t * Produces an ack callback to emit with an event.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.ack = function (id) {\n\t  var self = this;\n\t  var sent = false;\n\t  return function () {\n\t    // prevent double callbacks\n\t    if (sent) return;\n\t    sent = true;\n\t    var args = toArray(arguments);\n\t\n\t    self.packet({\n\t      type: parser.ACK,\n\t      id: id,\n\t      data: args\n\t    });\n\t  };\n\t};\n\t\n\t/**\n\t * Called upon a server acknowlegement.\n\t *\n\t * @param {Object} packet\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onack = function (packet) {\n\t  var ack = this.acks[packet.id];\n\t  if ('function' === typeof ack) {\n\t\n\t    ack.apply(this, packet.data);\n\t    delete this.acks[packet.id];\n\t  } else {}\n\t};\n\t\n\t/**\n\t * Called upon server connect.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onconnect = function () {\n\t  this.connected = true;\n\t  this.disconnected = false;\n\t  this.emit('connect');\n\t  this.emitBuffered();\n\t};\n\t\n\t/**\n\t * Emit buffered events (received and emitted).\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.emitBuffered = function () {\n\t  var i;\n\t  for (i = 0; i < this.receiveBuffer.length; i++) {\n\t    emit.apply(this, this.receiveBuffer[i]);\n\t  }\n\t  this.receiveBuffer = [];\n\t\n\t  for (i = 0; i < this.sendBuffer.length; i++) {\n\t    this.packet(this.sendBuffer[i]);\n\t  }\n\t  this.sendBuffer = [];\n\t};\n\t\n\t/**\n\t * Called upon server disconnect.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.ondisconnect = function () {\n\t\n\t  this.destroy();\n\t  this.onclose('io server disconnect');\n\t};\n\t\n\t/**\n\t * Called upon forced client/server side disconnections,\n\t * this method ensures the manager stops tracking us and\n\t * that reconnections don't get triggered for this.\n\t *\n\t * @api private.\n\t */\n\t\n\tSocket.prototype.destroy = function () {\n\t  if (this.subs) {\n\t    // clean subscriptions to avoid reconnections\n\t    for (var i = 0; i < this.subs.length; i++) {\n\t      this.subs[i].destroy();\n\t    }\n\t    this.subs = null;\n\t  }\n\t\n\t  this.io.destroy(this);\n\t};\n\t\n\t/**\n\t * Disconnects the socket manually.\n\t *\n\t * @return {Socket} self\n\t * @api public\n\t */\n\t\n\tSocket.prototype.close = Socket.prototype.disconnect = function () {\n\t  if (this.connected) {\n\t\n\t    this.packet({ type: parser.DISCONNECT });\n\t  }\n\t\n\t  // remove socket from pool\n\t  this.destroy();\n\t\n\t  if (this.connected) {\n\t    // fire events\n\t    this.onclose('io client disconnect');\n\t  }\n\t  return this;\n\t};\n\t\n\t/**\n\t * Sets the compress flag.\n\t *\n\t * @param {Boolean} if `true`, compresses the sending data\n\t * @return {Socket} self\n\t * @api public\n\t */\n\t\n\tSocket.prototype.compress = function (compress) {\n\t  this.flags = this.flags || {};\n\t  this.flags.compress = compress;\n\t  return this;\n\t};\n\n/***/ }),\n/* 37 */\n/***/ (function(module, exports) {\n\n\tmodule.exports = toArray\n\t\n\tfunction toArray(list, index) {\n\t    var array = []\n\t\n\t    index = index || 0\n\t\n\t    for (var i = index || 0; i < list.length; i++) {\n\t        array[i - index] = list[i]\n\t    }\n\t\n\t    return array\n\t}\n\n\n/***/ }),\n/* 38 */\n/***/ (function(module, exports) {\n\n\t\"use strict\";\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = on;\n\t\n\t/**\n\t * Helper for subscriptions.\n\t *\n\t * @param {Object|EventEmitter} obj with `Emitter` mixin or `EventEmitter`\n\t * @param {String} event name\n\t * @param {Function} callback\n\t * @api public\n\t */\n\t\n\tfunction on(obj, ev, fn) {\n\t  obj.on(ev, fn);\n\t  return {\n\t    destroy: function destroy() {\n\t      obj.removeListener(ev, fn);\n\t    }\n\t  };\n\t}\n\n/***/ }),\n/* 39 */\n/***/ (function(module, exports) {\n\n\t/**\n\t * Slice reference.\n\t */\n\t\n\tvar slice = [].slice;\n\t\n\t/**\n\t * Bind `obj` to `fn`.\n\t *\n\t * @param {Object} obj\n\t * @param {Function|String} fn or string\n\t * @return {Function}\n\t * @api public\n\t */\n\t\n\tmodule.exports = function(obj, fn){\n\t  if ('string' == typeof fn) fn = obj[fn];\n\t  if ('function' != typeof fn) throw new Error('bind() requires a function');\n\t  var args = slice.call(arguments, 2);\n\t  return function(){\n\t    return fn.apply(obj, args.concat(slice.call(arguments)));\n\t  }\n\t};\n\n\n/***/ }),\n/* 40 */\n/***/ (function(module, exports) {\n\n\t\n\t/**\n\t * Expose `Backoff`.\n\t */\n\t\n\tmodule.exports = Backoff;\n\t\n\t/**\n\t * Initialize backoff timer with `opts`.\n\t *\n\t * - `min` initial timeout in milliseconds [100]\n\t * - `max` max timeout [10000]\n\t * - `jitter` [0]\n\t * - `factor` [2]\n\t *\n\t * @param {Object} opts\n\t * @api public\n\t */\n\t\n\tfunction Backoff(opts) {\n\t  opts = opts || {};\n\t  this.ms = opts.min || 100;\n\t  this.max = opts.max || 10000;\n\t  this.factor = opts.factor || 2;\n\t  this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;\n\t  this.attempts = 0;\n\t}\n\t\n\t/**\n\t * Return the backoff duration.\n\t *\n\t * @return {Number}\n\t * @api public\n\t */\n\t\n\tBackoff.prototype.duration = function(){\n\t  var ms = this.ms * Math.pow(this.factor, this.attempts++);\n\t  if (this.jitter) {\n\t    var rand =  Math.random();\n\t    var deviation = Math.floor(rand * this.jitter * ms);\n\t    ms = (Math.floor(rand * 10) & 1) == 0  ? ms - deviation : ms + deviation;\n\t  }\n\t  return Math.min(ms, this.max) | 0;\n\t};\n\t\n\t/**\n\t * Reset the number of attempts.\n\t *\n\t * @api public\n\t */\n\t\n\tBackoff.prototype.reset = function(){\n\t  this.attempts = 0;\n\t};\n\t\n\t/**\n\t * Set the minimum duration\n\t *\n\t * @api public\n\t */\n\t\n\tBackoff.prototype.setMin = function(min){\n\t  this.ms = min;\n\t};\n\t\n\t/**\n\t * Set the maximum duration\n\t *\n\t * @api public\n\t */\n\t\n\tBackoff.prototype.setMax = function(max){\n\t  this.max = max;\n\t};\n\t\n\t/**\n\t * Set the jitter\n\t *\n\t * @api public\n\t */\n\t\n\tBackoff.prototype.setJitter = function(jitter){\n\t  this.jitter = jitter;\n\t};\n\t\n\n\n/***/ })\n/******/ ])\n});\n;\n\n\n// WEBPACK FOOTER //\n// socket.io.slim.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 6efc33f456691f458a90","\n/**\n * Module dependencies.\n */\n\nvar url = require('./url');\nvar parser = require('socket.io-parser');\nvar Manager = require('./manager');\nvar debug = require('debug')('socket.io-client');\n\n/**\n * Module exports.\n */\n\nmodule.exports = exports = lookup;\n\n/**\n * Managers cache.\n */\n\nvar cache = exports.managers = {};\n\n/**\n * Looks up an existing `Manager` for multiplexing.\n * If the user summons:\n *\n *   `io('http://localhost/a');`\n *   `io('http://localhost/b');`\n *\n * We reuse the existing instance based on same scheme/port/host,\n * and we initialize sockets for each namespace.\n *\n * @api public\n */\n\nfunction lookup (uri, opts) {\n  if (typeof uri === 'object') {\n    opts = uri;\n    uri = undefined;\n  }\n\n  opts = opts || {};\n\n  var parsed = url(uri);\n  var source = parsed.source;\n  var id = parsed.id;\n  var path = parsed.path;\n  var sameNamespace = cache[id] && path in cache[id].nsps;\n  var newConnection = opts.forceNew || opts['force new connection'] ||\n                      false === opts.multiplex || sameNamespace;\n\n  var io;\n\n  if (newConnection) {\n\n    io = Manager(source, opts);\n  } else {\n    if (!cache[id]) {\n\n      cache[id] = Manager(source, opts);\n    }\n    io = cache[id];\n  }\n  if (parsed.query && !opts.query) {\n    opts.query = parsed.query;\n  }\n  return io.socket(parsed.path, opts);\n}\n\n/**\n * Protocol version.\n *\n * @api public\n */\n\nexports.protocol = parser.protocol;\n\n/**\n * `connect`.\n *\n * @param {String} uri\n * @api public\n */\n\nexports.connect = lookup;\n\n/**\n * Expose constructors for standalone build.\n *\n * @api public\n */\n\nexports.Manager = require('./manager');\nexports.Socket = require('./socket');\n\n\n\n// WEBPACK FOOTER //\n// ./lib/index.js","\n/**\n * Module dependencies.\n */\n\nvar parseuri = require('parseuri');\nvar debug = require('debug')('socket.io-client:url');\n\n/**\n * Module exports.\n */\n\nmodule.exports = url;\n\n/**\n * URL parser.\n *\n * @param {String} url\n * @param {Object} An object meant to mimic window.location.\n *                 Defaults to window.location.\n * @api public\n */\n\nfunction url (uri, loc) {\n  var obj = uri;\n\n  // default to window.location\n  loc = loc || global.location;\n  if (null == uri) uri = loc.protocol + '//' + loc.host;\n\n  // relative path support\n  if ('string' === typeof uri) {\n    if ('/' === uri.charAt(0)) {\n      if ('/' === uri.charAt(1)) {\n        uri = loc.protocol + uri;\n      } else {\n        uri = loc.host + uri;\n      }\n    }\n\n    if (!/^(https?|wss?):\\/\\//.test(uri)) {\n\n      if ('undefined' !== typeof loc) {\n        uri = loc.protocol + '//' + uri;\n      } else {\n        uri = 'https://' + uri;\n      }\n    }\n\n    // parse\n\n    obj = parseuri(uri);\n  }\n\n  // make sure we treat `localhost:80` and `localhost` equally\n  if (!obj.port) {\n    if (/^(http|ws)$/.test(obj.protocol)) {\n      obj.port = '80';\n    } else if (/^(http|ws)s$/.test(obj.protocol)) {\n      obj.port = '443';\n    }\n  }\n\n  obj.path = obj.path || '/';\n\n  var ipv6 = obj.host.indexOf(':') !== -1;\n  var host = ipv6 ? '[' + obj.host + ']' : obj.host;\n\n  // define unique id\n  obj.id = obj.protocol + '://' + host + ':' + obj.port;\n  // define href\n  obj.href = obj.protocol + '://' + host + (loc && loc.port === obj.port ? '' : (':' + obj.port));\n\n  return obj;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./lib/url.js","/**\r\n * Parses an URI\r\n *\r\n * @author Steven Levithan <stevenlevithan.com> (MIT license)\r\n * @api private\r\n */\r\n\r\nvar re = /^(?:(?![^:@]+:[^:@\\/]*@)(http|https|ws|wss):\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/;\r\n\r\nvar parts = [\r\n    'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'\r\n];\r\n\r\nmodule.exports = function parseuri(str) {\r\n    var src = str,\r\n        b = str.indexOf('['),\r\n        e = str.indexOf(']');\r\n\r\n    if (b != -1 && e != -1) {\r\n        str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length);\r\n    }\r\n\r\n    var m = re.exec(str || ''),\r\n        uri = {},\r\n        i = 14;\r\n\r\n    while (i--) {\r\n        uri[parts[i]] = m[i] || '';\r\n    }\r\n\r\n    if (b != -1 && e != -1) {\r\n        uri.source = src;\r\n        uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':');\r\n        uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':');\r\n        uri.ipv6uri = true;\r\n    }\r\n\r\n    return uri;\r\n};\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parseuri/index.js\n// module id = 2\n// module chunks = 0","\nmodule.exports = function () { return function () {}; };\n\n\n\n// WEBPACK FOOTER //\n// ./support/noop.js","\n/**\n * Module dependencies.\n */\n\nvar debug = require('debug')('socket.io-parser');\nvar Emitter = require('component-emitter');\nvar hasBin = require('has-binary2');\nvar binary = require('./binary');\nvar isBuf = require('./is-buffer');\n\n/**\n * Protocol version.\n *\n * @api public\n */\n\nexports.protocol = 4;\n\n/**\n * Packet types.\n *\n * @api public\n */\n\nexports.types = [\n  'CONNECT',\n  'DISCONNECT',\n  'EVENT',\n  'ACK',\n  'ERROR',\n  'BINARY_EVENT',\n  'BINARY_ACK'\n];\n\n/**\n * Packet type `connect`.\n *\n * @api public\n */\n\nexports.CONNECT = 0;\n\n/**\n * Packet type `disconnect`.\n *\n * @api public\n */\n\nexports.DISCONNECT = 1;\n\n/**\n * Packet type `event`.\n *\n * @api public\n */\n\nexports.EVENT = 2;\n\n/**\n * Packet type `ack`.\n *\n * @api public\n */\n\nexports.ACK = 3;\n\n/**\n * Packet type `error`.\n *\n * @api public\n */\n\nexports.ERROR = 4;\n\n/**\n * Packet type 'binary event'\n *\n * @api public\n */\n\nexports.BINARY_EVENT = 5;\n\n/**\n * Packet type `binary ack`. For acks with binary arguments.\n *\n * @api public\n */\n\nexports.BINARY_ACK = 6;\n\n/**\n * Encoder constructor.\n *\n * @api public\n */\n\nexports.Encoder = Encoder;\n\n/**\n * Decoder constructor.\n *\n * @api public\n */\n\nexports.Decoder = Decoder;\n\n/**\n * A socket.io Encoder instance\n *\n * @api public\n */\n\nfunction Encoder() {}\n\n/**\n * Encode a packet as a single string if non-binary, or as a\n * buffer sequence, depending on packet type.\n *\n * @param {Object} obj - packet object\n * @param {Function} callback - function to handle encodings (likely engine.write)\n * @return Calls callback with Array of encodings\n * @api public\n */\n\nEncoder.prototype.encode = function(obj, callback){\n  if ((obj.type === exports.EVENT || obj.type === exports.ACK) && hasBin(obj.data)) {\n    obj.type = obj.type === exports.EVENT ? exports.BINARY_EVENT : exports.BINARY_ACK;\n  }\n\n\n\n  if (exports.BINARY_EVENT === obj.type || exports.BINARY_ACK === obj.type) {\n    encodeAsBinary(obj, callback);\n  }\n  else {\n    var encoding = encodeAsString(obj);\n    callback([encoding]);\n  }\n};\n\n/**\n * Encode packet as string.\n *\n * @param {Object} packet\n * @return {String} encoded\n * @api private\n */\n\nfunction encodeAsString(obj) {\n\n  // first is type\n  var str = '' + obj.type;\n\n  // attachments if we have them\n  if (exports.BINARY_EVENT === obj.type || exports.BINARY_ACK === obj.type) {\n    str += obj.attachments + '-';\n  }\n\n  // if we have a namespace other than `/`\n  // we append it followed by a comma `,`\n  if (obj.nsp && '/' !== obj.nsp) {\n    str += obj.nsp + ',';\n  }\n\n  // immediately followed by the id\n  if (null != obj.id) {\n    str += obj.id;\n  }\n\n  // json data\n  if (null != obj.data) {\n    str += JSON.stringify(obj.data);\n  }\n\n\n  return str;\n}\n\n/**\n * Encode packet as 'buffer sequence' by removing blobs, and\n * deconstructing packet into object with placeholders and\n * a list of buffers.\n *\n * @param {Object} packet\n * @return {Buffer} encoded\n * @api private\n */\n\nfunction encodeAsBinary(obj, callback) {\n\n  function writeEncoding(bloblessData) {\n    var deconstruction = binary.deconstructPacket(bloblessData);\n    var pack = encodeAsString(deconstruction.packet);\n    var buffers = deconstruction.buffers;\n\n    buffers.unshift(pack); // add packet info to beginning of data list\n    callback(buffers); // write all the buffers\n  }\n\n  binary.removeBlobs(obj, writeEncoding);\n}\n\n/**\n * A socket.io Decoder instance\n *\n * @return {Object} decoder\n * @api public\n */\n\nfunction Decoder() {\n  this.reconstructor = null;\n}\n\n/**\n * Mix in `Emitter` with Decoder.\n */\n\nEmitter(Decoder.prototype);\n\n/**\n * Decodes an ecoded packet string into packet JSON.\n *\n * @param {String} obj - encoded packet\n * @return {Object} packet\n * @api public\n */\n\nDecoder.prototype.add = function(obj) {\n  var packet;\n  if (typeof obj === 'string') {\n    packet = decodeString(obj);\n    if (exports.BINARY_EVENT === packet.type || exports.BINARY_ACK === packet.type) { // binary packet's json\n      this.reconstructor = new BinaryReconstructor(packet);\n\n      // no attachments, labeled binary but no binary data to follow\n      if (this.reconstructor.reconPack.attachments === 0) {\n        this.emit('decoded', packet);\n      }\n    } else { // non-binary full packet\n      this.emit('decoded', packet);\n    }\n  }\n  else if (isBuf(obj) || obj.base64) { // raw binary data\n    if (!this.reconstructor) {\n      throw new Error('got binary data when not reconstructing a packet');\n    } else {\n      packet = this.reconstructor.takeBinaryData(obj);\n      if (packet) { // received final buffer\n        this.reconstructor = null;\n        this.emit('decoded', packet);\n      }\n    }\n  }\n  else {\n    throw new Error('Unknown type: ' + obj);\n  }\n};\n\n/**\n * Decode a packet String (JSON data)\n *\n * @param {String} str\n * @return {Object} packet\n * @api private\n */\n\nfunction decodeString(str) {\n  var i = 0;\n  // look up type\n  var p = {\n    type: Number(str.charAt(0))\n  };\n\n  if (null == exports.types[p.type]) return error();\n\n  // look up attachments if type binary\n  if (exports.BINARY_EVENT === p.type || exports.BINARY_ACK === p.type) {\n    var buf = '';\n    while (str.charAt(++i) !== '-') {\n      buf += str.charAt(i);\n      if (i == str.length) break;\n    }\n    if (buf != Number(buf) || str.charAt(i) !== '-') {\n      throw new Error('Illegal attachments');\n    }\n    p.attachments = Number(buf);\n  }\n\n  // look up namespace (if any)\n  if ('/' === str.charAt(i + 1)) {\n    p.nsp = '';\n    while (++i) {\n      var c = str.charAt(i);\n      if (',' === c) break;\n      p.nsp += c;\n      if (i === str.length) break;\n    }\n  } else {\n    p.nsp = '/';\n  }\n\n  // look up id\n  var next = str.charAt(i + 1);\n  if ('' !== next && Number(next) == next) {\n    p.id = '';\n    while (++i) {\n      var c = str.charAt(i);\n      if (null == c || Number(c) != c) {\n        --i;\n        break;\n      }\n      p.id += str.charAt(i);\n      if (i === str.length) break;\n    }\n    p.id = Number(p.id);\n  }\n\n  // look up json data\n  if (str.charAt(++i)) {\n    p = tryParse(p, str.substr(i));\n  }\n\n\n  return p;\n}\n\nfunction tryParse(p, str) {\n  try {\n    p.data = JSON.parse(str);\n  } catch(e){\n    return error();\n  }\n  return p; \n}\n\n/**\n * Deallocates a parser's resources\n *\n * @api public\n */\n\nDecoder.prototype.destroy = function() {\n  if (this.reconstructor) {\n    this.reconstructor.finishedReconstruction();\n  }\n};\n\n/**\n * A manager of a binary event's 'buffer sequence'. Should\n * be constructed whenever a packet of type BINARY_EVENT is\n * decoded.\n *\n * @param {Object} packet\n * @return {BinaryReconstructor} initialized reconstructor\n * @api private\n */\n\nfunction BinaryReconstructor(packet) {\n  this.reconPack = packet;\n  this.buffers = [];\n}\n\n/**\n * Method to be called when binary data received from connection\n * after a BINARY_EVENT packet.\n *\n * @param {Buffer | ArrayBuffer} binData - the raw binary data received\n * @return {null | Object} returns null if more binary data is expected or\n *   a reconstructed packet object if all buffers have been received.\n * @api private\n */\n\nBinaryReconstructor.prototype.takeBinaryData = function(binData) {\n  this.buffers.push(binData);\n  if (this.buffers.length === this.reconPack.attachments) { // done with buffer list\n    var packet = binary.reconstructPacket(this.reconPack, this.buffers);\n    this.finishedReconstruction();\n    return packet;\n  }\n  return null;\n};\n\n/**\n * Cleans up binary packet reconstruction variables.\n *\n * @api private\n */\n\nBinaryReconstructor.prototype.finishedReconstruction = function() {\n  this.reconPack = null;\n  this.buffers = [];\n};\n\nfunction error() {\n  return {\n    type: exports.ERROR,\n    data: 'parser error'\n  };\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/socket.io-parser/index.js\n// module id = 4\n// module chunks = 0","\r\n/**\r\n * Expose `Emitter`.\r\n */\r\n\r\nif (typeof module !== 'undefined') {\r\n  module.exports = Emitter;\r\n}\r\n\r\n/**\r\n * Initialize a new `Emitter`.\r\n *\r\n * @api public\r\n */\r\n\r\nfunction Emitter(obj) {\r\n  if (obj) return mixin(obj);\r\n};\r\n\r\n/**\r\n * Mixin the emitter properties.\r\n *\r\n * @param {Object} obj\r\n * @return {Object}\r\n * @api private\r\n */\r\n\r\nfunction mixin(obj) {\r\n  for (var key in Emitter.prototype) {\r\n    obj[key] = Emitter.prototype[key];\r\n  }\r\n  return obj;\r\n}\r\n\r\n/**\r\n * Listen on the given `event` with `fn`.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.on =\r\nEmitter.prototype.addEventListener = function(event, fn){\r\n  this._callbacks = this._callbacks || {};\r\n  (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\r\n    .push(fn);\r\n  return this;\r\n};\r\n\r\n/**\r\n * Adds an `event` listener that will be invoked a single\r\n * time then automatically removed.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.once = function(event, fn){\r\n  function on() {\r\n    this.off(event, on);\r\n    fn.apply(this, arguments);\r\n  }\r\n\r\n  on.fn = fn;\r\n  this.on(event, on);\r\n  return this;\r\n};\r\n\r\n/**\r\n * Remove the given callback for `event` or all\r\n * registered callbacks.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.off =\r\nEmitter.prototype.removeListener =\r\nEmitter.prototype.removeAllListeners =\r\nEmitter.prototype.removeEventListener = function(event, fn){\r\n  this._callbacks = this._callbacks || {};\r\n\r\n  // all\r\n  if (0 == arguments.length) {\r\n    this._callbacks = {};\r\n    return this;\r\n  }\r\n\r\n  // specific event\r\n  var callbacks = this._callbacks['$' + event];\r\n  if (!callbacks) return this;\r\n\r\n  // remove all handlers\r\n  if (1 == arguments.length) {\r\n    delete this._callbacks['$' + event];\r\n    return this;\r\n  }\r\n\r\n  // remove specific handler\r\n  var cb;\r\n  for (var i = 0; i < callbacks.length; i++) {\r\n    cb = callbacks[i];\r\n    if (cb === fn || cb.fn === fn) {\r\n      callbacks.splice(i, 1);\r\n      break;\r\n    }\r\n  }\r\n  return this;\r\n};\r\n\r\n/**\r\n * Emit `event` with the given args.\r\n *\r\n * @param {String} event\r\n * @param {Mixed} ...\r\n * @return {Emitter}\r\n */\r\n\r\nEmitter.prototype.emit = function(event){\r\n  this._callbacks = this._callbacks || {};\r\n  var args = [].slice.call(arguments, 1)\r\n    , callbacks = this._callbacks['$' + event];\r\n\r\n  if (callbacks) {\r\n    callbacks = callbacks.slice(0);\r\n    for (var i = 0, len = callbacks.length; i < len; ++i) {\r\n      callbacks[i].apply(this, args);\r\n    }\r\n  }\r\n\r\n  return this;\r\n};\r\n\r\n/**\r\n * Return array of callbacks for `event`.\r\n *\r\n * @param {String} event\r\n * @return {Array}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.listeners = function(event){\r\n  this._callbacks = this._callbacks || {};\r\n  return this._callbacks['$' + event] || [];\r\n};\r\n\r\n/**\r\n * Check if this emitter has `event` handlers.\r\n *\r\n * @param {String} event\r\n * @return {Boolean}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.hasListeners = function(event){\r\n  return !! this.listeners(event).length;\r\n};\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/component-emitter/index.js\n// module id = 5\n// module chunks = 0","/* global Blob File */\n\n/*\n * Module requirements.\n */\n\nvar isArray = require('isarray');\n\nvar toString = Object.prototype.toString;\nvar withNativeBlob = typeof global.Blob === 'function' || toString.call(global.Blob) === '[object BlobConstructor]';\nvar withNativeFile = typeof global.File === 'function' || toString.call(global.File) === '[object FileConstructor]';\n\n/**\n * Module exports.\n */\n\nmodule.exports = hasBinary;\n\n/**\n * Checks for binary data.\n *\n * Supports Buffer, ArrayBuffer, Blob and File.\n *\n * @param {Object} anything\n * @api public\n */\n\nfunction hasBinary (obj) {\n  if (!obj || typeof obj !== 'object') {\n    return false;\n  }\n\n  if (isArray(obj)) {\n    for (var i = 0, l = obj.length; i < l; i++) {\n      if (hasBinary(obj[i])) {\n        return true;\n      }\n    }\n    return false;\n  }\n\n  if ((typeof global.Buffer === 'function' && global.Buffer.isBuffer && global.Buffer.isBuffer(obj)) ||\n     (typeof global.ArrayBuffer === 'function' && obj instanceof ArrayBuffer) ||\n     (withNativeBlob && obj instanceof Blob) ||\n     (withNativeFile && obj instanceof File)\n    ) {\n    return true;\n  }\n\n  // see: https://github.com/Automattic/has-binary/pull/4\n  if (obj.toJSON && typeof obj.toJSON === 'function' && arguments.length === 1) {\n    return hasBinary(obj.toJSON(), true);\n  }\n\n  for (var key in obj) {\n    if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) {\n      return true;\n    }\n  }\n\n  return false;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/has-binary2/index.js\n// module id = 6\n// module chunks = 0","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n  return toString.call(arr) == '[object Array]';\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/isarray/index.js\n// module id = 7\n// module chunks = 0","/*global Blob,File*/\n\n/**\n * Module requirements\n */\n\nvar isArray = require('isarray');\nvar isBuf = require('./is-buffer');\nvar toString = Object.prototype.toString;\nvar withNativeBlob = typeof global.Blob === 'function' || toString.call(global.Blob) === '[object BlobConstructor]';\nvar withNativeFile = typeof global.File === 'function' || toString.call(global.File) === '[object FileConstructor]';\n\n/**\n * Replaces every Buffer | ArrayBuffer in packet with a numbered placeholder.\n * Anything with blobs or files should be fed through removeBlobs before coming\n * here.\n *\n * @param {Object} packet - socket.io event packet\n * @return {Object} with deconstructed packet and list of buffers\n * @api public\n */\n\nexports.deconstructPacket = function(packet) {\n  var buffers = [];\n  var packetData = packet.data;\n  var pack = packet;\n  pack.data = _deconstructPacket(packetData, buffers);\n  pack.attachments = buffers.length; // number of binary 'attachments'\n  return {packet: pack, buffers: buffers};\n};\n\nfunction _deconstructPacket(data, buffers) {\n  if (!data) return data;\n\n  if (isBuf(data)) {\n    var placeholder = { _placeholder: true, num: buffers.length };\n    buffers.push(data);\n    return placeholder;\n  } else if (isArray(data)) {\n    var newData = new Array(data.length);\n    for (var i = 0; i < data.length; i++) {\n      newData[i] = _deconstructPacket(data[i], buffers);\n    }\n    return newData;\n  } else if (typeof data === 'object' && !(data instanceof Date)) {\n    var newData = {};\n    for (var key in data) {\n      newData[key] = _deconstructPacket(data[key], buffers);\n    }\n    return newData;\n  }\n  return data;\n}\n\n/**\n * Reconstructs a binary packet from its placeholder packet and buffers\n *\n * @param {Object} packet - event packet with placeholders\n * @param {Array} buffers - binary buffers to put in placeholder positions\n * @return {Object} reconstructed packet\n * @api public\n */\n\nexports.reconstructPacket = function(packet, buffers) {\n  packet.data = _reconstructPacket(packet.data, buffers);\n  packet.attachments = undefined; // no longer useful\n  return packet;\n};\n\nfunction _reconstructPacket(data, buffers) {\n  if (!data) return data;\n\n  if (data && data._placeholder) {\n    return buffers[data.num]; // appropriate buffer (should be natural order anyway)\n  } else if (isArray(data)) {\n    for (var i = 0; i < data.length; i++) {\n      data[i] = _reconstructPacket(data[i], buffers);\n    }\n  } else if (typeof data === 'object') {\n    for (var key in data) {\n      data[key] = _reconstructPacket(data[key], buffers);\n    }\n  }\n\n  return data;\n}\n\n/**\n * Asynchronously removes Blobs or Files from data via\n * FileReader's readAsArrayBuffer method. Used before encoding\n * data as msgpack. Calls callback with the blobless data.\n *\n * @param {Object} data\n * @param {Function} callback\n * @api private\n */\n\nexports.removeBlobs = function(data, callback) {\n  function _removeBlobs(obj, curKey, containingObject) {\n    if (!obj) return obj;\n\n    // convert any blob\n    if ((withNativeBlob && obj instanceof Blob) ||\n        (withNativeFile && obj instanceof File)) {\n      pendingBlobs++;\n\n      // async filereader\n      var fileReader = new FileReader();\n      fileReader.onload = function() { // this.result == arraybuffer\n        if (containingObject) {\n          containingObject[curKey] = this.result;\n        }\n        else {\n          bloblessData = this.result;\n        }\n\n        // if nothing pending its callback time\n        if(! --pendingBlobs) {\n          callback(bloblessData);\n        }\n      };\n\n      fileReader.readAsArrayBuffer(obj); // blob -> arraybuffer\n    } else if (isArray(obj)) { // handle array\n      for (var i = 0; i < obj.length; i++) {\n        _removeBlobs(obj[i], i, obj);\n      }\n    } else if (typeof obj === 'object' && !isBuf(obj)) { // and object\n      for (var key in obj) {\n        _removeBlobs(obj[key], key, obj);\n      }\n    }\n  }\n\n  var pendingBlobs = 0;\n  var bloblessData = data;\n  _removeBlobs(bloblessData);\n  if (!pendingBlobs) {\n    callback(bloblessData);\n  }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/socket.io-parser/binary.js\n// module id = 8\n// module chunks = 0","\nmodule.exports = isBuf;\n\n/**\n * Returns true if obj is a buffer or an arraybuffer.\n *\n * @api private\n */\n\nfunction isBuf(obj) {\n  return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n         (global.ArrayBuffer && obj instanceof ArrayBuffer);\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/socket.io-parser/is-buffer.js\n// module id = 9\n// module chunks = 0","\n/**\n * Module dependencies.\n */\n\nvar eio = require('engine.io-client');\nvar Socket = require('./socket');\nvar Emitter = require('component-emitter');\nvar parser = require('socket.io-parser');\nvar on = require('./on');\nvar bind = require('component-bind');\nvar debug = require('debug')('socket.io-client:manager');\nvar indexOf = require('indexof');\nvar Backoff = require('backo2');\n\n/**\n * IE6+ hasOwnProperty\n */\n\nvar has = Object.prototype.hasOwnProperty;\n\n/**\n * Module exports\n */\n\nmodule.exports = Manager;\n\n/**\n * `Manager` constructor.\n *\n * @param {String} engine instance or engine uri/opts\n * @param {Object} options\n * @api public\n */\n\nfunction Manager (uri, opts) {\n  if (!(this instanceof Manager)) return new Manager(uri, opts);\n  if (uri && ('object' === typeof uri)) {\n    opts = uri;\n    uri = undefined;\n  }\n  opts = opts || {};\n\n  opts.path = opts.path || '/socket.io';\n  this.nsps = {};\n  this.subs = [];\n  this.opts = opts;\n  this.reconnection(opts.reconnection !== false);\n  this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);\n  this.reconnectionDelay(opts.reconnectionDelay || 1000);\n  this.reconnectionDelayMax(opts.reconnectionDelayMax || 5000);\n  this.randomizationFactor(opts.randomizationFactor || 0.5);\n  this.backoff = new Backoff({\n    min: this.reconnectionDelay(),\n    max: this.reconnectionDelayMax(),\n    jitter: this.randomizationFactor()\n  });\n  this.timeout(null == opts.timeout ? 20000 : opts.timeout);\n  this.readyState = 'closed';\n  this.uri = uri;\n  this.connecting = [];\n  this.lastPing = null;\n  this.encoding = false;\n  this.packetBuffer = [];\n  var _parser = opts.parser || parser;\n  this.encoder = new _parser.Encoder();\n  this.decoder = new _parser.Decoder();\n  this.autoConnect = opts.autoConnect !== false;\n  if (this.autoConnect) this.open();\n}\n\n/**\n * Propagate given event to sockets and emit on `this`\n *\n * @api private\n */\n\nManager.prototype.emitAll = function () {\n  this.emit.apply(this, arguments);\n  for (var nsp in this.nsps) {\n    if (has.call(this.nsps, nsp)) {\n      this.nsps[nsp].emit.apply(this.nsps[nsp], arguments);\n    }\n  }\n};\n\n/**\n * Update `socket.id` of all sockets\n *\n * @api private\n */\n\nManager.prototype.updateSocketIds = function () {\n  for (var nsp in this.nsps) {\n    if (has.call(this.nsps, nsp)) {\n      this.nsps[nsp].id = this.generateId(nsp);\n    }\n  }\n};\n\n/**\n * generate `socket.id` for the given `nsp`\n *\n * @param {String} nsp\n * @return {String}\n * @api private\n */\n\nManager.prototype.generateId = function (nsp) {\n  return (nsp === '/' ? '' : (nsp + '#')) + this.engine.id;\n};\n\n/**\n * Mix in `Emitter`.\n */\n\nEmitter(Manager.prototype);\n\n/**\n * Sets the `reconnection` config.\n *\n * @param {Boolean} true/false if it should automatically reconnect\n * @return {Manager} self or value\n * @api public\n */\n\nManager.prototype.reconnection = function (v) {\n  if (!arguments.length) return this._reconnection;\n  this._reconnection = !!v;\n  return this;\n};\n\n/**\n * Sets the reconnection attempts config.\n *\n * @param {Number} max reconnection attempts before giving up\n * @return {Manager} self or value\n * @api public\n */\n\nManager.prototype.reconnectionAttempts = function (v) {\n  if (!arguments.length) return this._reconnectionAttempts;\n  this._reconnectionAttempts = v;\n  return this;\n};\n\n/**\n * Sets the delay between reconnections.\n *\n * @param {Number} delay\n * @return {Manager} self or value\n * @api public\n */\n\nManager.prototype.reconnectionDelay = function (v) {\n  if (!arguments.length) return this._reconnectionDelay;\n  this._reconnectionDelay = v;\n  this.backoff && this.backoff.setMin(v);\n  return this;\n};\n\nManager.prototype.randomizationFactor = function (v) {\n  if (!arguments.length) return this._randomizationFactor;\n  this._randomizationFactor = v;\n  this.backoff && this.backoff.setJitter(v);\n  return this;\n};\n\n/**\n * Sets the maximum delay between reconnections.\n *\n * @param {Number} delay\n * @return {Manager} self or value\n * @api public\n */\n\nManager.prototype.reconnectionDelayMax = function (v) {\n  if (!arguments.length) return this._reconnectionDelayMax;\n  this._reconnectionDelayMax = v;\n  this.backoff && this.backoff.setMax(v);\n  return this;\n};\n\n/**\n * Sets the connection timeout. `false` to disable\n *\n * @return {Manager} self or value\n * @api public\n */\n\nManager.prototype.timeout = function (v) {\n  if (!arguments.length) return this._timeout;\n  this._timeout = v;\n  return this;\n};\n\n/**\n * Starts trying to reconnect if reconnection is enabled and we have not\n * started reconnecting yet\n *\n * @api private\n */\n\nManager.prototype.maybeReconnectOnOpen = function () {\n  // Only try to reconnect if it's the first time we're connecting\n  if (!this.reconnecting && this._reconnection && this.backoff.attempts === 0) {\n    // keeps reconnection from firing twice for the same reconnection loop\n    this.reconnect();\n  }\n};\n\n/**\n * Sets the current transport `socket`.\n *\n * @param {Function} optional, callback\n * @return {Manager} self\n * @api public\n */\n\nManager.prototype.open =\nManager.prototype.connect = function (fn, opts) {\n\n  if (~this.readyState.indexOf('open')) return this;\n\n\n  this.engine = eio(this.uri, this.opts);\n  var socket = this.engine;\n  var self = this;\n  this.readyState = 'opening';\n  this.skipReconnect = false;\n\n  // emit `open`\n  var openSub = on(socket, 'open', function () {\n    self.onopen();\n    fn && fn();\n  });\n\n  // emit `connect_error`\n  var errorSub = on(socket, 'error', function (data) {\n\n    self.cleanup();\n    self.readyState = 'closed';\n    self.emitAll('connect_error', data);\n    if (fn) {\n      var err = new Error('Connection error');\n      err.data = data;\n      fn(err);\n    } else {\n      // Only do this if there is no fn to handle the error\n      self.maybeReconnectOnOpen();\n    }\n  });\n\n  // emit `connect_timeout`\n  if (false !== this._timeout) {\n    var timeout = this._timeout;\n\n\n    // set timer\n    var timer = setTimeout(function () {\n\n      openSub.destroy();\n      socket.close();\n      socket.emit('error', 'timeout');\n      self.emitAll('connect_timeout', timeout);\n    }, timeout);\n\n    this.subs.push({\n      destroy: function () {\n        clearTimeout(timer);\n      }\n    });\n  }\n\n  this.subs.push(openSub);\n  this.subs.push(errorSub);\n\n  return this;\n};\n\n/**\n * Called upon transport open.\n *\n * @api private\n */\n\nManager.prototype.onopen = function () {\n\n\n  // clear old subs\n  this.cleanup();\n\n  // mark as open\n  this.readyState = 'open';\n  this.emit('open');\n\n  // add new subs\n  var socket = this.engine;\n  this.subs.push(on(socket, 'data', bind(this, 'ondata')));\n  this.subs.push(on(socket, 'ping', bind(this, 'onping')));\n  this.subs.push(on(socket, 'pong', bind(this, 'onpong')));\n  this.subs.push(on(socket, 'error', bind(this, 'onerror')));\n  this.subs.push(on(socket, 'close', bind(this, 'onclose')));\n  this.subs.push(on(this.decoder, 'decoded', bind(this, 'ondecoded')));\n};\n\n/**\n * Called upon a ping.\n *\n * @api private\n */\n\nManager.prototype.onping = function () {\n  this.lastPing = new Date();\n  this.emitAll('ping');\n};\n\n/**\n * Called upon a packet.\n *\n * @api private\n */\n\nManager.prototype.onpong = function () {\n  this.emitAll('pong', new Date() - this.lastPing);\n};\n\n/**\n * Called with data.\n *\n * @api private\n */\n\nManager.prototype.ondata = function (data) {\n  this.decoder.add(data);\n};\n\n/**\n * Called when parser fully decodes a packet.\n *\n * @api private\n */\n\nManager.prototype.ondecoded = function (packet) {\n  this.emit('packet', packet);\n};\n\n/**\n * Called upon socket error.\n *\n * @api private\n */\n\nManager.prototype.onerror = function (err) {\n\n  this.emitAll('error', err);\n};\n\n/**\n * Creates a new socket for the given `nsp`.\n *\n * @return {Socket}\n * @api public\n */\n\nManager.prototype.socket = function (nsp, opts) {\n  var socket = this.nsps[nsp];\n  if (!socket) {\n    socket = new Socket(this, nsp, opts);\n    this.nsps[nsp] = socket;\n    var self = this;\n    socket.on('connecting', onConnecting);\n    socket.on('connect', function () {\n      socket.id = self.generateId(nsp);\n    });\n\n    if (this.autoConnect) {\n      // manually call here since connecting event is fired before listening\n      onConnecting();\n    }\n  }\n\n  function onConnecting () {\n    if (!~indexOf(self.connecting, socket)) {\n      self.connecting.push(socket);\n    }\n  }\n\n  return socket;\n};\n\n/**\n * Called upon a socket close.\n *\n * @param {Socket} socket\n */\n\nManager.prototype.destroy = function (socket) {\n  var index = indexOf(this.connecting, socket);\n  if (~index) this.connecting.splice(index, 1);\n  if (this.connecting.length) return;\n\n  this.close();\n};\n\n/**\n * Writes a packet.\n *\n * @param {Object} packet\n * @api private\n */\n\nManager.prototype.packet = function (packet) {\n\n  var self = this;\n  if (packet.query && packet.type === 0) packet.nsp += '?' + packet.query;\n\n  if (!self.encoding) {\n    // encode, then write to engine with result\n    self.encoding = true;\n    this.encoder.encode(packet, function (encodedPackets) {\n      for (var i = 0; i < encodedPackets.length; i++) {\n        self.engine.write(encodedPackets[i], packet.options);\n      }\n      self.encoding = false;\n      self.processPacketQueue();\n    });\n  } else { // add packet to the queue\n    self.packetBuffer.push(packet);\n  }\n};\n\n/**\n * If packet buffer is non-empty, begins encoding the\n * next packet in line.\n *\n * @api private\n */\n\nManager.prototype.processPacketQueue = function () {\n  if (this.packetBuffer.length > 0 && !this.encoding) {\n    var pack = this.packetBuffer.shift();\n    this.packet(pack);\n  }\n};\n\n/**\n * Clean up transport subscriptions and packet buffer.\n *\n * @api private\n */\n\nManager.prototype.cleanup = function () {\n\n\n  var subsLength = this.subs.length;\n  for (var i = 0; i < subsLength; i++) {\n    var sub = this.subs.shift();\n    sub.destroy();\n  }\n\n  this.packetBuffer = [];\n  this.encoding = false;\n  this.lastPing = null;\n\n  this.decoder.destroy();\n};\n\n/**\n * Close the current socket.\n *\n * @api private\n */\n\nManager.prototype.close =\nManager.prototype.disconnect = function () {\n\n  this.skipReconnect = true;\n  this.reconnecting = false;\n  if ('opening' === this.readyState) {\n    // `onclose` will not fire because\n    // an open event never happened\n    this.cleanup();\n  }\n  this.backoff.reset();\n  this.readyState = 'closed';\n  if (this.engine) this.engine.close();\n};\n\n/**\n * Called upon engine close.\n *\n * @api private\n */\n\nManager.prototype.onclose = function (reason) {\n\n\n  this.cleanup();\n  this.backoff.reset();\n  this.readyState = 'closed';\n  this.emit('close', reason);\n\n  if (this._reconnection && !this.skipReconnect) {\n    this.reconnect();\n  }\n};\n\n/**\n * Attempt a reconnection.\n *\n * @api private\n */\n\nManager.prototype.reconnect = function () {\n  if (this.reconnecting || this.skipReconnect) return this;\n\n  var self = this;\n\n  if (this.backoff.attempts >= this._reconnectionAttempts) {\n\n    this.backoff.reset();\n    this.emitAll('reconnect_failed');\n    this.reconnecting = false;\n  } else {\n    var delay = this.backoff.duration();\n\n\n    this.reconnecting = true;\n    var timer = setTimeout(function () {\n      if (self.skipReconnect) return;\n\n\n      self.emitAll('reconnect_attempt', self.backoff.attempts);\n      self.emitAll('reconnecting', self.backoff.attempts);\n\n      // check again for the case socket closed in above events\n      if (self.skipReconnect) return;\n\n      self.open(function (err) {\n        if (err) {\n\n          self.reconnecting = false;\n          self.reconnect();\n          self.emitAll('reconnect_error', err.data);\n        } else {\n\n          self.onreconnect();\n        }\n      });\n    }, delay);\n\n    this.subs.push({\n      destroy: function () {\n        clearTimeout(timer);\n      }\n    });\n  }\n};\n\n/**\n * Called upon successful reconnect.\n *\n * @api private\n */\n\nManager.prototype.onreconnect = function () {\n  var attempt = this.backoff.attempts;\n  this.reconnecting = false;\n  this.backoff.reset();\n  this.updateSocketIds();\n  this.emitAll('reconnect', attempt);\n};\n\n\n\n// WEBPACK FOOTER //\n// ./lib/manager.js","\nmodule.exports = require('./lib/index');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-client/index.js\n// module id = 11\n// module chunks = 0","\nmodule.exports = require('./socket');\n\n/**\n * Exports parser\n *\n * @api public\n *\n */\nmodule.exports.parser = require('engine.io-parser');\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-client/lib/index.js\n// module id = 12\n// module chunks = 0","/**\n * Module dependencies.\n */\n\nvar transports = require('./transports/index');\nvar Emitter = require('component-emitter');\nvar debug = require('debug')('engine.io-client:socket');\nvar index = require('indexof');\nvar parser = require('engine.io-parser');\nvar parseuri = require('parseuri');\nvar parsejson = require('parsejson');\nvar parseqs = require('parseqs');\n\n/**\n * Module exports.\n */\n\nmodule.exports = Socket;\n\n/**\n * Socket constructor.\n *\n * @param {String|Object} uri or options\n * @param {Object} options\n * @api public\n */\n\nfunction Socket (uri, opts) {\n  if (!(this instanceof Socket)) return new Socket(uri, opts);\n\n  opts = opts || {};\n\n  if (uri && 'object' === typeof uri) {\n    opts = uri;\n    uri = null;\n  }\n\n  if (uri) {\n    uri = parseuri(uri);\n    opts.hostname = uri.host;\n    opts.secure = uri.protocol === 'https' || uri.protocol === 'wss';\n    opts.port = uri.port;\n    if (uri.query) opts.query = uri.query;\n  } else if (opts.host) {\n    opts.hostname = parseuri(opts.host).host;\n  }\n\n  this.secure = null != opts.secure ? opts.secure\n    : (global.location && 'https:' === location.protocol);\n\n  if (opts.hostname && !opts.port) {\n    // if no port is specified manually, use the protocol default\n    opts.port = this.secure ? '443' : '80';\n  }\n\n  this.agent = opts.agent || false;\n  this.hostname = opts.hostname ||\n    (global.location ? location.hostname : 'localhost');\n  this.port = opts.port || (global.location && location.port\n      ? location.port\n      : (this.secure ? 443 : 80));\n  this.query = opts.query || {};\n  if ('string' === typeof this.query) this.query = parseqs.decode(this.query);\n  this.upgrade = false !== opts.upgrade;\n  this.path = (opts.path || '/engine.io').replace(/\\/$/, '') + '/';\n  this.forceJSONP = !!opts.forceJSONP;\n  this.jsonp = false !== opts.jsonp;\n  this.forceBase64 = !!opts.forceBase64;\n  this.enablesXDR = !!opts.enablesXDR;\n  this.timestampParam = opts.timestampParam || 't';\n  this.timestampRequests = opts.timestampRequests;\n  this.transports = opts.transports || ['polling', 'websocket'];\n  this.transportOptions = opts.transportOptions || {};\n  this.readyState = '';\n  this.writeBuffer = [];\n  this.prevBufferLen = 0;\n  this.policyPort = opts.policyPort || 843;\n  this.rememberUpgrade = opts.rememberUpgrade || false;\n  this.binaryType = null;\n  this.onlyBinaryUpgrades = opts.onlyBinaryUpgrades;\n  this.perMessageDeflate = false !== opts.perMessageDeflate ? (opts.perMessageDeflate || {}) : false;\n\n  if (true === this.perMessageDeflate) this.perMessageDeflate = {};\n  if (this.perMessageDeflate && null == this.perMessageDeflate.threshold) {\n    this.perMessageDeflate.threshold = 1024;\n  }\n\n  // SSL options for Node.js client\n  this.pfx = opts.pfx || null;\n  this.key = opts.key || null;\n  this.passphrase = opts.passphrase || null;\n  this.cert = opts.cert || null;\n  this.ca = opts.ca || null;\n  this.ciphers = opts.ciphers || null;\n  this.rejectUnauthorized = opts.rejectUnauthorized === undefined ? true : opts.rejectUnauthorized;\n  this.forceNode = !!opts.forceNode;\n\n  // other options for Node.js client\n  var freeGlobal = typeof global === 'object' && global;\n  if (freeGlobal.global === freeGlobal) {\n    if (opts.extraHeaders && Object.keys(opts.extraHeaders).length > 0) {\n      this.extraHeaders = opts.extraHeaders;\n    }\n\n    if (opts.localAddress) {\n      this.localAddress = opts.localAddress;\n    }\n  }\n\n  // set on handshake\n  this.id = null;\n  this.upgrades = null;\n  this.pingInterval = null;\n  this.pingTimeout = null;\n\n  // set on heartbeat\n  this.pingIntervalTimer = null;\n  this.pingTimeoutTimer = null;\n\n  this.open();\n}\n\nSocket.priorWebsocketSuccess = false;\n\n/**\n * Mix in `Emitter`.\n */\n\nEmitter(Socket.prototype);\n\n/**\n * Protocol version.\n *\n * @api public\n */\n\nSocket.protocol = parser.protocol; // this is an int\n\n/**\n * Expose deps for legacy compatibility\n * and standalone browser access.\n */\n\nSocket.Socket = Socket;\nSocket.Transport = require('./transport');\nSocket.transports = require('./transports/index');\nSocket.parser = require('engine.io-parser');\n\n/**\n * Creates transport of the given type.\n *\n * @param {String} transport name\n * @return {Transport}\n * @api private\n */\n\nSocket.prototype.createTransport = function (name) {\n\n  var query = clone(this.query);\n\n  // append engine.io protocol identifier\n  query.EIO = parser.protocol;\n\n  // transport name\n  query.transport = name;\n\n  // per-transport options\n  var options = this.transportOptions[name] || {};\n\n  // session id if we already have one\n  if (this.id) query.sid = this.id;\n\n  var transport = new transports[name]({\n    query: query,\n    socket: this,\n    agent: options.agent || this.agent,\n    hostname: options.hostname || this.hostname,\n    port: options.port || this.port,\n    secure: options.secure || this.secure,\n    path: options.path || this.path,\n    forceJSONP: options.forceJSONP || this.forceJSONP,\n    jsonp: options.jsonp || this.jsonp,\n    forceBase64: options.forceBase64 || this.forceBase64,\n    enablesXDR: options.enablesXDR || this.enablesXDR,\n    timestampRequests: options.timestampRequests || this.timestampRequests,\n    timestampParam: options.timestampParam || this.timestampParam,\n    policyPort: options.policyPort || this.policyPort,\n    pfx: options.pfx || this.pfx,\n    key: options.key || this.key,\n    passphrase: options.passphrase || this.passphrase,\n    cert: options.cert || this.cert,\n    ca: options.ca || this.ca,\n    ciphers: options.ciphers || this.ciphers,\n    rejectUnauthorized: options.rejectUnauthorized || this.rejectUnauthorized,\n    perMessageDeflate: options.perMessageDeflate || this.perMessageDeflate,\n    extraHeaders: options.extraHeaders || this.extraHeaders,\n    forceNode: options.forceNode || this.forceNode,\n    localAddress: options.localAddress || this.localAddress,\n    requestTimeout: options.requestTimeout || this.requestTimeout,\n    protocols: options.protocols || void (0)\n  });\n\n  return transport;\n};\n\nfunction clone (obj) {\n  var o = {};\n  for (var i in obj) {\n    if (obj.hasOwnProperty(i)) {\n      o[i] = obj[i];\n    }\n  }\n  return o;\n}\n\n/**\n * Initializes transport to use and starts probe.\n *\n * @api private\n */\nSocket.prototype.open = function () {\n  var transport;\n  if (this.rememberUpgrade && Socket.priorWebsocketSuccess && this.transports.indexOf('websocket') !== -1) {\n    transport = 'websocket';\n  } else if (0 === this.transports.length) {\n    // Emit error on next tick so it can be listened to\n    var self = this;\n    setTimeout(function () {\n      self.emit('error', 'No transports available');\n    }, 0);\n    return;\n  } else {\n    transport = this.transports[0];\n  }\n  this.readyState = 'opening';\n\n  // Retry with the next transport if the transport is disabled (jsonp: false)\n  try {\n    transport = this.createTransport(transport);\n  } catch (e) {\n    this.transports.shift();\n    this.open();\n    return;\n  }\n\n  transport.open();\n  this.setTransport(transport);\n};\n\n/**\n * Sets the current transport. Disables the existing one (if any).\n *\n * @api private\n */\n\nSocket.prototype.setTransport = function (transport) {\n\n  var self = this;\n\n  if (this.transport) {\n\n    this.transport.removeAllListeners();\n  }\n\n  // set up transport\n  this.transport = transport;\n\n  // set up transport listeners\n  transport\n  .on('drain', function () {\n    self.onDrain();\n  })\n  .on('packet', function (packet) {\n    self.onPacket(packet);\n  })\n  .on('error', function (e) {\n    self.onError(e);\n  })\n  .on('close', function () {\n    self.onClose('transport close');\n  });\n};\n\n/**\n * Probes a transport.\n *\n * @param {String} transport name\n * @api private\n */\n\nSocket.prototype.probe = function (name) {\n\n  var transport = this.createTransport(name, { probe: 1 });\n  var failed = false;\n  var self = this;\n\n  Socket.priorWebsocketSuccess = false;\n\n  function onTransportOpen () {\n    if (self.onlyBinaryUpgrades) {\n      var upgradeLosesBinary = !this.supportsBinary && self.transport.supportsBinary;\n      failed = failed || upgradeLosesBinary;\n    }\n    if (failed) return;\n\n\n    transport.send([{ type: 'ping', data: 'probe' }]);\n    transport.once('packet', function (msg) {\n      if (failed) return;\n      if ('pong' === msg.type && 'probe' === msg.data) {\n\n        self.upgrading = true;\n        self.emit('upgrading', transport);\n        if (!transport) return;\n        Socket.priorWebsocketSuccess = 'websocket' === transport.name;\n\n\n        self.transport.pause(function () {\n          if (failed) return;\n          if ('closed' === self.readyState) return;\n\n\n          cleanup();\n\n          self.setTransport(transport);\n          transport.send([{ type: 'upgrade' }]);\n          self.emit('upgrade', transport);\n          transport = null;\n          self.upgrading = false;\n          self.flush();\n        });\n      } else {\n\n        var err = new Error('probe error');\n        err.transport = transport.name;\n        self.emit('upgradeError', err);\n      }\n    });\n  }\n\n  function freezeTransport () {\n    if (failed) return;\n\n    // Any callback called by transport should be ignored since now\n    failed = true;\n\n    cleanup();\n\n    transport.close();\n    transport = null;\n  }\n\n  // Handle any error that happens while probing\n  function onerror (err) {\n    var error = new Error('probe error: ' + err);\n    error.transport = transport.name;\n\n    freezeTransport();\n\n\n\n    self.emit('upgradeError', error);\n  }\n\n  function onTransportClose () {\n    onerror('transport closed');\n  }\n\n  // When the socket is closed while we're probing\n  function onclose () {\n    onerror('socket closed');\n  }\n\n  // When the socket is upgraded while we're probing\n  function onupgrade (to) {\n    if (transport && to.name !== transport.name) {\n\n      freezeTransport();\n    }\n  }\n\n  // Remove all listeners on the transport and on self\n  function cleanup () {\n    transport.removeListener('open', onTransportOpen);\n    transport.removeListener('error', onerror);\n    transport.removeListener('close', onTransportClose);\n    self.removeListener('close', onclose);\n    self.removeListener('upgrading', onupgrade);\n  }\n\n  transport.once('open', onTransportOpen);\n  transport.once('error', onerror);\n  transport.once('close', onTransportClose);\n\n  this.once('close', onclose);\n  this.once('upgrading', onupgrade);\n\n  transport.open();\n};\n\n/**\n * Called when connection is deemed open.\n *\n * @api public\n */\n\nSocket.prototype.onOpen = function () {\n\n  this.readyState = 'open';\n  Socket.priorWebsocketSuccess = 'websocket' === this.transport.name;\n  this.emit('open');\n  this.flush();\n\n  // we check for `readyState` in case an `open`\n  // listener already closed the socket\n  if ('open' === this.readyState && this.upgrade && this.transport.pause) {\n\n    for (var i = 0, l = this.upgrades.length; i < l; i++) {\n      this.probe(this.upgrades[i]);\n    }\n  }\n};\n\n/**\n * Handles a packet.\n *\n * @api private\n */\n\nSocket.prototype.onPacket = function (packet) {\n  if ('opening' === this.readyState || 'open' === this.readyState ||\n      'closing' === this.readyState) {\n\n\n    this.emit('packet', packet);\n\n    // Socket is live - any packet counts\n    this.emit('heartbeat');\n\n    switch (packet.type) {\n      case 'open':\n        this.onHandshake(parsejson(packet.data));\n        break;\n\n      case 'pong':\n        this.setPing();\n        this.emit('pong');\n        break;\n\n      case 'error':\n        var err = new Error('server error');\n        err.code = packet.data;\n        this.onError(err);\n        break;\n\n      case 'message':\n        this.emit('data', packet.data);\n        this.emit('message', packet.data);\n        break;\n    }\n  } else {\n\n  }\n};\n\n/**\n * Called upon handshake completion.\n *\n * @param {Object} handshake obj\n * @api private\n */\n\nSocket.prototype.onHandshake = function (data) {\n  this.emit('handshake', data);\n  this.id = data.sid;\n  this.transport.query.sid = data.sid;\n  this.upgrades = this.filterUpgrades(data.upgrades);\n  this.pingInterval = data.pingInterval;\n  this.pingTimeout = data.pingTimeout;\n  this.onOpen();\n  // In case open handler closes socket\n  if ('closed' === this.readyState) return;\n  this.setPing();\n\n  // Prolong liveness of socket on heartbeat\n  this.removeListener('heartbeat', this.onHeartbeat);\n  this.on('heartbeat', this.onHeartbeat);\n};\n\n/**\n * Resets ping timeout.\n *\n * @api private\n */\n\nSocket.prototype.onHeartbeat = function (timeout) {\n  clearTimeout(this.pingTimeoutTimer);\n  var self = this;\n  self.pingTimeoutTimer = setTimeout(function () {\n    if ('closed' === self.readyState) return;\n    self.onClose('ping timeout');\n  }, timeout || (self.pingInterval + self.pingTimeout));\n};\n\n/**\n * Pings server every `this.pingInterval` and expects response\n * within `this.pingTimeout` or closes connection.\n *\n * @api private\n */\n\nSocket.prototype.setPing = function () {\n  var self = this;\n  clearTimeout(self.pingIntervalTimer);\n  self.pingIntervalTimer = setTimeout(function () {\n\n    self.ping();\n    self.onHeartbeat(self.pingTimeout);\n  }, self.pingInterval);\n};\n\n/**\n* Sends a ping packet.\n*\n* @api private\n*/\n\nSocket.prototype.ping = function () {\n  var self = this;\n  this.sendPacket('ping', function () {\n    self.emit('ping');\n  });\n};\n\n/**\n * Called on `drain` event\n *\n * @api private\n */\n\nSocket.prototype.onDrain = function () {\n  this.writeBuffer.splice(0, this.prevBufferLen);\n\n  // setting prevBufferLen = 0 is very important\n  // for example, when upgrading, upgrade packet is sent over,\n  // and a nonzero prevBufferLen could cause problems on `drain`\n  this.prevBufferLen = 0;\n\n  if (0 === this.writeBuffer.length) {\n    this.emit('drain');\n  } else {\n    this.flush();\n  }\n};\n\n/**\n * Flush write buffers.\n *\n * @api private\n */\n\nSocket.prototype.flush = function () {\n  if ('closed' !== this.readyState && this.transport.writable &&\n    !this.upgrading && this.writeBuffer.length) {\n\n    this.transport.send(this.writeBuffer);\n    // keep track of current length of writeBuffer\n    // splice writeBuffer and callbackBuffer on `drain`\n    this.prevBufferLen = this.writeBuffer.length;\n    this.emit('flush');\n  }\n};\n\n/**\n * Sends a message.\n *\n * @param {String} message.\n * @param {Function} callback function.\n * @param {Object} options.\n * @return {Socket} for chaining.\n * @api public\n */\n\nSocket.prototype.write =\nSocket.prototype.send = function (msg, options, fn) {\n  this.sendPacket('message', msg, options, fn);\n  return this;\n};\n\n/**\n * Sends a packet.\n *\n * @param {String} packet type.\n * @param {String} data.\n * @param {Object} options.\n * @param {Function} callback function.\n * @api private\n */\n\nSocket.prototype.sendPacket = function (type, data, options, fn) {\n  if ('function' === typeof data) {\n    fn = data;\n    data = undefined;\n  }\n\n  if ('function' === typeof options) {\n    fn = options;\n    options = null;\n  }\n\n  if ('closing' === this.readyState || 'closed' === this.readyState) {\n    return;\n  }\n\n  options = options || {};\n  options.compress = false !== options.compress;\n\n  var packet = {\n    type: type,\n    data: data,\n    options: options\n  };\n  this.emit('packetCreate', packet);\n  this.writeBuffer.push(packet);\n  if (fn) this.once('flush', fn);\n  this.flush();\n};\n\n/**\n * Closes the connection.\n *\n * @api private\n */\n\nSocket.prototype.close = function () {\n  if ('opening' === this.readyState || 'open' === this.readyState) {\n    this.readyState = 'closing';\n\n    var self = this;\n\n    if (this.writeBuffer.length) {\n      this.once('drain', function () {\n        if (this.upgrading) {\n          waitForUpgrade();\n        } else {\n          close();\n        }\n      });\n    } else if (this.upgrading) {\n      waitForUpgrade();\n    } else {\n      close();\n    }\n  }\n\n  function close () {\n    self.onClose('forced close');\n\n    self.transport.close();\n  }\n\n  function cleanupAndClose () {\n    self.removeListener('upgrade', cleanupAndClose);\n    self.removeListener('upgradeError', cleanupAndClose);\n    close();\n  }\n\n  function waitForUpgrade () {\n    // wait for upgrade to finish since we can't send packets while pausing a transport\n    self.once('upgrade', cleanupAndClose);\n    self.once('upgradeError', cleanupAndClose);\n  }\n\n  return this;\n};\n\n/**\n * Called upon transport error\n *\n * @api private\n */\n\nSocket.prototype.onError = function (err) {\n\n  Socket.priorWebsocketSuccess = false;\n  this.emit('error', err);\n  this.onClose('transport error', err);\n};\n\n/**\n * Called upon transport close.\n *\n * @api private\n */\n\nSocket.prototype.onClose = function (reason, desc) {\n  if ('opening' === this.readyState || 'open' === this.readyState || 'closing' === this.readyState) {\n\n    var self = this;\n\n    // clear timers\n    clearTimeout(this.pingIntervalTimer);\n    clearTimeout(this.pingTimeoutTimer);\n\n    // stop event from firing again for transport\n    this.transport.removeAllListeners('close');\n\n    // ensure transport won't stay open\n    this.transport.close();\n\n    // ignore further transport communication\n    this.transport.removeAllListeners();\n\n    // set ready state\n    this.readyState = 'closed';\n\n    // clear session id\n    this.id = null;\n\n    // emit close event\n    this.emit('close', reason, desc);\n\n    // clean buffers after, so users can still\n    // grab the buffers on `close` event\n    self.writeBuffer = [];\n    self.prevBufferLen = 0;\n  }\n};\n\n/**\n * Filters upgrades, returning only those matching client transports.\n *\n * @param {Array} server upgrades\n * @api private\n *\n */\n\nSocket.prototype.filterUpgrades = function (upgrades) {\n  var filteredUpgrades = [];\n  for (var i = 0, j = upgrades.length; i < j; i++) {\n    if (~index(this.transports, upgrades[i])) filteredUpgrades.push(upgrades[i]);\n  }\n  return filteredUpgrades;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-client/lib/socket.js\n// module id = 13\n// module chunks = 0","/**\n * Module dependencies\n */\n\nvar XMLHttpRequest = require('xmlhttprequest-ssl');\nvar XHR = require('./polling-xhr');\nvar JSONP = require('./polling-jsonp');\nvar websocket = require('./websocket');\n\n/**\n * Export transports.\n */\n\nexports.polling = polling;\nexports.websocket = websocket;\n\n/**\n * Polling transport polymorphic constructor.\n * Decides on xhr vs jsonp based on feature detection.\n *\n * @api private\n */\n\nfunction polling (opts) {\n  var xhr;\n  var xd = false;\n  var xs = false;\n  var jsonp = false !== opts.jsonp;\n\n  if (global.location) {\n    var isSSL = 'https:' === location.protocol;\n    var port = location.port;\n\n    // some user agents have empty `location.port`\n    if (!port) {\n      port = isSSL ? 443 : 80;\n    }\n\n    xd = opts.hostname !== location.hostname || port !== opts.port;\n    xs = opts.secure !== isSSL;\n  }\n\n  opts.xdomain = xd;\n  opts.xscheme = xs;\n  xhr = new XMLHttpRequest(opts);\n\n  if ('open' in xhr && !opts.forceJSONP) {\n    return new XHR(opts);\n  } else {\n    if (!jsonp) throw new Error('JSONP disabled');\n    return new JSONP(opts);\n  }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-client/lib/transports/index.js\n// module id = 14\n// module chunks = 0","// browser shim for xmlhttprequest module\n\nvar hasCORS = require('has-cors');\n\nmodule.exports = function (opts) {\n  var xdomain = opts.xdomain;\n\n  // scheme must be same when usign XDomainRequest\n  // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx\n  var xscheme = opts.xscheme;\n\n  // XDomainRequest has a flow of not sending cookie, therefore it should be disabled as a default.\n  // https://github.com/Automattic/engine.io-client/pull/217\n  var enablesXDR = opts.enablesXDR;\n\n  // XMLHttpRequest can be disabled on IE\n  try {\n    if ('undefined' !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {\n      return new XMLHttpRequest();\n    }\n  } catch (e) { }\n\n  // Use XDomainRequest for IE8 if enablesXDR is true\n  // because loading bar keeps flashing when using jsonp-polling\n  // https://github.com/yujiosaka/socke.io-ie8-loading-example\n  try {\n    if ('undefined' !== typeof XDomainRequest && !xscheme && enablesXDR) {\n      return new XDomainRequest();\n    }\n  } catch (e) { }\n\n  if (!xdomain) {\n    try {\n      return new global[['Active'].concat('Object').join('X')]('Microsoft.XMLHTTP');\n    } catch (e) { }\n  }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-client/lib/xmlhttprequest.js\n// module id = 15\n// module chunks = 0","\n/**\n * Module exports.\n *\n * Logic borrowed from Modernizr:\n *\n *   - https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cors.js\n */\n\ntry {\n  module.exports = typeof XMLHttpRequest !== 'undefined' &&\n    'withCredentials' in new XMLHttpRequest();\n} catch (err) {\n  // if XMLHttp support is disabled in IE then it will throw\n  // when trying to create\n  module.exports = false;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/has-cors/index.js\n// module id = 16\n// module chunks = 0","/**\n * Module requirements.\n */\n\nvar XMLHttpRequest = require('xmlhttprequest-ssl');\nvar Polling = require('./polling');\nvar Emitter = require('component-emitter');\nvar inherit = require('component-inherit');\nvar debug = require('debug')('engine.io-client:polling-xhr');\n\n/**\n * Module exports.\n */\n\nmodule.exports = XHR;\nmodule.exports.Request = Request;\n\n/**\n * Empty function\n */\n\nfunction empty () {}\n\n/**\n * XHR Polling constructor.\n *\n * @param {Object} opts\n * @api public\n */\n\nfunction XHR (opts) {\n  Polling.call(this, opts);\n  this.requestTimeout = opts.requestTimeout;\n  this.extraHeaders = opts.extraHeaders;\n\n  if (global.location) {\n    var isSSL = 'https:' === location.protocol;\n    var port = location.port;\n\n    // some user agents have empty `location.port`\n    if (!port) {\n      port = isSSL ? 443 : 80;\n    }\n\n    this.xd = opts.hostname !== global.location.hostname ||\n      port !== opts.port;\n    this.xs = opts.secure !== isSSL;\n  }\n}\n\n/**\n * Inherits from Polling.\n */\n\ninherit(XHR, Polling);\n\n/**\n * XHR supports binary\n */\n\nXHR.prototype.supportsBinary = true;\n\n/**\n * Creates a request.\n *\n * @param {String} method\n * @api private\n */\n\nXHR.prototype.request = function (opts) {\n  opts = opts || {};\n  opts.uri = this.uri();\n  opts.xd = this.xd;\n  opts.xs = this.xs;\n  opts.agent = this.agent || false;\n  opts.supportsBinary = this.supportsBinary;\n  opts.enablesXDR = this.enablesXDR;\n\n  // SSL options for Node.js client\n  opts.pfx = this.pfx;\n  opts.key = this.key;\n  opts.passphrase = this.passphrase;\n  opts.cert = this.cert;\n  opts.ca = this.ca;\n  opts.ciphers = this.ciphers;\n  opts.rejectUnauthorized = this.rejectUnauthorized;\n  opts.requestTimeout = this.requestTimeout;\n\n  // other options for Node.js client\n  opts.extraHeaders = this.extraHeaders;\n\n  return new Request(opts);\n};\n\n/**\n * Sends data.\n *\n * @param {String} data to send.\n * @param {Function} called upon flush.\n * @api private\n */\n\nXHR.prototype.doWrite = function (data, fn) {\n  var isBinary = typeof data !== 'string' && data !== undefined;\n  var req = this.request({ method: 'POST', data: data, isBinary: isBinary });\n  var self = this;\n  req.on('success', fn);\n  req.on('error', function (err) {\n    self.onError('xhr post error', err);\n  });\n  this.sendXhr = req;\n};\n\n/**\n * Starts a poll cycle.\n *\n * @api private\n */\n\nXHR.prototype.doPoll = function () {\n\n  var req = this.request();\n  var self = this;\n  req.on('data', function (data) {\n    self.onData(data);\n  });\n  req.on('error', function (err) {\n    self.onError('xhr poll error', err);\n  });\n  this.pollXhr = req;\n};\n\n/**\n * Request constructor\n *\n * @param {Object} options\n * @api public\n */\n\nfunction Request (opts) {\n  this.method = opts.method || 'GET';\n  this.uri = opts.uri;\n  this.xd = !!opts.xd;\n  this.xs = !!opts.xs;\n  this.async = false !== opts.async;\n  this.data = undefined !== opts.data ? opts.data : null;\n  this.agent = opts.agent;\n  this.isBinary = opts.isBinary;\n  this.supportsBinary = opts.supportsBinary;\n  this.enablesXDR = opts.enablesXDR;\n  this.requestTimeout = opts.requestTimeout;\n\n  // SSL options for Node.js client\n  this.pfx = opts.pfx;\n  this.key = opts.key;\n  this.passphrase = opts.passphrase;\n  this.cert = opts.cert;\n  this.ca = opts.ca;\n  this.ciphers = opts.ciphers;\n  this.rejectUnauthorized = opts.rejectUnauthorized;\n\n  // other options for Node.js client\n  this.extraHeaders = opts.extraHeaders;\n\n  this.create();\n}\n\n/**\n * Mix in `Emitter`.\n */\n\nEmitter(Request.prototype);\n\n/**\n * Creates the XHR object and sends the request.\n *\n * @api private\n */\n\nRequest.prototype.create = function () {\n  var opts = { agent: this.agent, xdomain: this.xd, xscheme: this.xs, enablesXDR: this.enablesXDR };\n\n  // SSL options for Node.js client\n  opts.pfx = this.pfx;\n  opts.key = this.key;\n  opts.passphrase = this.passphrase;\n  opts.cert = this.cert;\n  opts.ca = this.ca;\n  opts.ciphers = this.ciphers;\n  opts.rejectUnauthorized = this.rejectUnauthorized;\n\n  var xhr = this.xhr = new XMLHttpRequest(opts);\n  var self = this;\n\n  try {\n\n    xhr.open(this.method, this.uri, this.async);\n    try {\n      if (this.extraHeaders) {\n        xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);\n        for (var i in this.extraHeaders) {\n          if (this.extraHeaders.hasOwnProperty(i)) {\n            xhr.setRequestHeader(i, this.extraHeaders[i]);\n          }\n        }\n      }\n    } catch (e) {}\n\n    if ('POST' === this.method) {\n      try {\n        if (this.isBinary) {\n          xhr.setRequestHeader('Content-type', 'application/octet-stream');\n        } else {\n          xhr.setRequestHeader('Content-type', 'text/plain;charset=UTF-8');\n        }\n      } catch (e) {}\n    }\n\n    try {\n      xhr.setRequestHeader('Accept', '*/*');\n    } catch (e) {}\n\n    // ie6 check\n    if ('withCredentials' in xhr) {\n      xhr.withCredentials = true;\n    }\n\n    if (this.requestTimeout) {\n      xhr.timeout = this.requestTimeout;\n    }\n\n    if (this.hasXDR()) {\n      xhr.onload = function () {\n        self.onLoad();\n      };\n      xhr.onerror = function () {\n        self.onError(xhr.responseText);\n      };\n    } else {\n      xhr.onreadystatechange = function () {\n        if (xhr.readyState === 2) {\n          var contentType;\n          try {\n            contentType = xhr.getResponseHeader('Content-Type');\n          } catch (e) {}\n          if (contentType === 'application/octet-stream') {\n            xhr.responseType = 'arraybuffer';\n          }\n        }\n        if (4 !== xhr.readyState) return;\n        if (200 === xhr.status || 1223 === xhr.status) {\n          self.onLoad();\n        } else {\n          // make sure the `error` event handler that's user-set\n          // does not throw in the same tick and gets caught here\n          setTimeout(function () {\n            self.onError(xhr.status);\n          }, 0);\n        }\n      };\n    }\n\n\n    xhr.send(this.data);\n  } catch (e) {\n    // Need to defer since .create() is called directly fhrom the constructor\n    // and thus the 'error' event can only be only bound *after* this exception\n    // occurs.  Therefore, also, we cannot throw here at all.\n    setTimeout(function () {\n      self.onError(e);\n    }, 0);\n    return;\n  }\n\n  if (global.document) {\n    this.index = Request.requestsCount++;\n    Request.requests[this.index] = this;\n  }\n};\n\n/**\n * Called upon successful response.\n *\n * @api private\n */\n\nRequest.prototype.onSuccess = function () {\n  this.emit('success');\n  this.cleanup();\n};\n\n/**\n * Called if we have data.\n *\n * @api private\n */\n\nRequest.prototype.onData = function (data) {\n  this.emit('data', data);\n  this.onSuccess();\n};\n\n/**\n * Called upon error.\n *\n * @api private\n */\n\nRequest.prototype.onError = function (err) {\n  this.emit('error', err);\n  this.cleanup(true);\n};\n\n/**\n * Cleans up house.\n *\n * @api private\n */\n\nRequest.prototype.cleanup = function (fromError) {\n  if ('undefined' === typeof this.xhr || null === this.xhr) {\n    return;\n  }\n  // xmlhttprequest\n  if (this.hasXDR()) {\n    this.xhr.onload = this.xhr.onerror = empty;\n  } else {\n    this.xhr.onreadystatechange = empty;\n  }\n\n  if (fromError) {\n    try {\n      this.xhr.abort();\n    } catch (e) {}\n  }\n\n  if (global.document) {\n    delete Request.requests[this.index];\n  }\n\n  this.xhr = null;\n};\n\n/**\n * Called upon load.\n *\n * @api private\n */\n\nRequest.prototype.onLoad = function () {\n  var data;\n  try {\n    var contentType;\n    try {\n      contentType = this.xhr.getResponseHeader('Content-Type');\n    } catch (e) {}\n    if (contentType === 'application/octet-stream') {\n      data = this.xhr.response || this.xhr.responseText;\n    } else {\n      data = this.xhr.responseText;\n    }\n  } catch (e) {\n    this.onError(e);\n  }\n  if (null != data) {\n    this.onData(data);\n  }\n};\n\n/**\n * Check if it has XDomainRequest.\n *\n * @api private\n */\n\nRequest.prototype.hasXDR = function () {\n  return 'undefined' !== typeof global.XDomainRequest && !this.xs && this.enablesXDR;\n};\n\n/**\n * Aborts the request.\n *\n * @api public\n */\n\nRequest.prototype.abort = function () {\n  this.cleanup();\n};\n\n/**\n * Aborts pending requests when unloading the window. This is needed to prevent\n * memory leaks (e.g. when using IE) and to ensure that no spurious error is\n * emitted.\n */\n\nRequest.requestsCount = 0;\nRequest.requests = {};\n\nif (global.document) {\n  if (global.attachEvent) {\n    global.attachEvent('onunload', unloadHandler);\n  } else if (global.addEventListener) {\n    global.addEventListener('beforeunload', unloadHandler, false);\n  }\n}\n\nfunction unloadHandler () {\n  for (var i in Request.requests) {\n    if (Request.requests.hasOwnProperty(i)) {\n      Request.requests[i].abort();\n    }\n  }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-client/lib/transports/polling-xhr.js\n// module id = 17\n// module chunks = 0","/**\n * Module dependencies.\n */\n\nvar Transport = require('../transport');\nvar parseqs = require('parseqs');\nvar parser = require('engine.io-parser');\nvar inherit = require('component-inherit');\nvar yeast = require('yeast');\nvar debug = require('debug')('engine.io-client:polling');\n\n/**\n * Module exports.\n */\n\nmodule.exports = Polling;\n\n/**\n * Is XHR2 supported?\n */\n\nvar hasXHR2 = (function () {\n  var XMLHttpRequest = require('xmlhttprequest-ssl');\n  var xhr = new XMLHttpRequest({ xdomain: false });\n  return null != xhr.responseType;\n})();\n\n/**\n * Polling interface.\n *\n * @param {Object} opts\n * @api private\n */\n\nfunction Polling (opts) {\n  var forceBase64 = (opts && opts.forceBase64);\n  if (!hasXHR2 || forceBase64) {\n    this.supportsBinary = false;\n  }\n  Transport.call(this, opts);\n}\n\n/**\n * Inherits from Transport.\n */\n\ninherit(Polling, Transport);\n\n/**\n * Transport name.\n */\n\nPolling.prototype.name = 'polling';\n\n/**\n * Opens the socket (triggers polling). We write a PING message to determine\n * when the transport is open.\n *\n * @api private\n */\n\nPolling.prototype.doOpen = function () {\n  this.poll();\n};\n\n/**\n * Pauses polling.\n *\n * @param {Function} callback upon buffers are flushed and transport is paused\n * @api private\n */\n\nPolling.prototype.pause = function (onPause) {\n  var self = this;\n\n  this.readyState = 'pausing';\n\n  function pause () {\n\n    self.readyState = 'paused';\n    onPause();\n  }\n\n  if (this.polling || !this.writable) {\n    var total = 0;\n\n    if (this.polling) {\n\n      total++;\n      this.once('pollComplete', function () {\n\n        --total || pause();\n      });\n    }\n\n    if (!this.writable) {\n\n      total++;\n      this.once('drain', function () {\n\n        --total || pause();\n      });\n    }\n  } else {\n    pause();\n  }\n};\n\n/**\n * Starts polling cycle.\n *\n * @api public\n */\n\nPolling.prototype.poll = function () {\n\n  this.polling = true;\n  this.doPoll();\n  this.emit('poll');\n};\n\n/**\n * Overloads onData to detect payloads.\n *\n * @api private\n */\n\nPolling.prototype.onData = function (data) {\n  var self = this;\n\n  var callback = function (packet, index, total) {\n    // if its the first message we consider the transport open\n    if ('opening' === self.readyState) {\n      self.onOpen();\n    }\n\n    // if its a close packet, we close the ongoing requests\n    if ('close' === packet.type) {\n      self.onClose();\n      return false;\n    }\n\n    // otherwise bypass onData and handle the message\n    self.onPacket(packet);\n  };\n\n  // decode payload\n  parser.decodePayload(data, this.socket.binaryType, callback);\n\n  // if an event did not trigger closing\n  if ('closed' !== this.readyState) {\n    // if we got data we're not polling\n    this.polling = false;\n    this.emit('pollComplete');\n\n    if ('open' === this.readyState) {\n      this.poll();\n    } else {\n\n    }\n  }\n};\n\n/**\n * For polling, send a close packet.\n *\n * @api private\n */\n\nPolling.prototype.doClose = function () {\n  var self = this;\n\n  function close () {\n\n    self.write([{ type: 'close' }]);\n  }\n\n  if ('open' === this.readyState) {\n\n    close();\n  } else {\n    // in case we're trying to close while\n    // handshaking is in progress (GH-164)\n\n    this.once('open', close);\n  }\n};\n\n/**\n * Writes a packets payload.\n *\n * @param {Array} data packets\n * @param {Function} drain callback\n * @api private\n */\n\nPolling.prototype.write = function (packets) {\n  var self = this;\n  this.writable = false;\n  var callbackfn = function () {\n    self.writable = true;\n    self.emit('drain');\n  };\n\n  parser.encodePayload(packets, this.supportsBinary, function (data) {\n    self.doWrite(data, callbackfn);\n  });\n};\n\n/**\n * Generates uri for connection.\n *\n * @api private\n */\n\nPolling.prototype.uri = function () {\n  var query = this.query || {};\n  var schema = this.secure ? 'https' : 'http';\n  var port = '';\n\n  // cache busting is forced\n  if (false !== this.timestampRequests) {\n    query[this.timestampParam] = yeast();\n  }\n\n  if (!this.supportsBinary && !query.sid) {\n    query.b64 = 1;\n  }\n\n  query = parseqs.encode(query);\n\n  // avoid port if default for schema\n  if (this.port && (('https' === schema && Number(this.port) !== 443) ||\n     ('http' === schema && Number(this.port) !== 80))) {\n    port = ':' + this.port;\n  }\n\n  // prepend ? to query\n  if (query.length) {\n    query = '?' + query;\n  }\n\n  var ipv6 = this.hostname.indexOf(':') !== -1;\n  return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-client/lib/transports/polling.js\n// module id = 18\n// module chunks = 0","/**\n * Module dependencies.\n */\n\nvar parser = require('engine.io-parser');\nvar Emitter = require('component-emitter');\n\n/**\n * Module exports.\n */\n\nmodule.exports = Transport;\n\n/**\n * Transport abstract constructor.\n *\n * @param {Object} options.\n * @api private\n */\n\nfunction Transport (opts) {\n  this.path = opts.path;\n  this.hostname = opts.hostname;\n  this.port = opts.port;\n  this.secure = opts.secure;\n  this.query = opts.query;\n  this.timestampParam = opts.timestampParam;\n  this.timestampRequests = opts.timestampRequests;\n  this.readyState = '';\n  this.agent = opts.agent || false;\n  this.socket = opts.socket;\n  this.enablesXDR = opts.enablesXDR;\n\n  // SSL options for Node.js client\n  this.pfx = opts.pfx;\n  this.key = opts.key;\n  this.passphrase = opts.passphrase;\n  this.cert = opts.cert;\n  this.ca = opts.ca;\n  this.ciphers = opts.ciphers;\n  this.rejectUnauthorized = opts.rejectUnauthorized;\n  this.forceNode = opts.forceNode;\n\n  // other options for Node.js client\n  this.extraHeaders = opts.extraHeaders;\n  this.localAddress = opts.localAddress;\n}\n\n/**\n * Mix in `Emitter`.\n */\n\nEmitter(Transport.prototype);\n\n/**\n * Emits an error.\n *\n * @param {String} str\n * @return {Transport} for chaining\n * @api public\n */\n\nTransport.prototype.onError = function (msg, desc) {\n  var err = new Error(msg);\n  err.type = 'TransportError';\n  err.description = desc;\n  this.emit('error', err);\n  return this;\n};\n\n/**\n * Opens the transport.\n *\n * @api public\n */\n\nTransport.prototype.open = function () {\n  if ('closed' === this.readyState || '' === this.readyState) {\n    this.readyState = 'opening';\n    this.doOpen();\n  }\n\n  return this;\n};\n\n/**\n * Closes the transport.\n *\n * @api private\n */\n\nTransport.prototype.close = function () {\n  if ('opening' === this.readyState || 'open' === this.readyState) {\n    this.doClose();\n    this.onClose();\n  }\n\n  return this;\n};\n\n/**\n * Sends multiple packets.\n *\n * @param {Array} packets\n * @api private\n */\n\nTransport.prototype.send = function (packets) {\n  if ('open' === this.readyState) {\n    this.write(packets);\n  } else {\n    throw new Error('Transport not open');\n  }\n};\n\n/**\n * Called upon open\n *\n * @api private\n */\n\nTransport.prototype.onOpen = function () {\n  this.readyState = 'open';\n  this.writable = true;\n  this.emit('open');\n};\n\n/**\n * Called with data.\n *\n * @param {String} data\n * @api private\n */\n\nTransport.prototype.onData = function (data) {\n  var packet = parser.decodePacket(data, this.socket.binaryType);\n  this.onPacket(packet);\n};\n\n/**\n * Called with a decoded packet.\n */\n\nTransport.prototype.onPacket = function (packet) {\n  this.emit('packet', packet);\n};\n\n/**\n * Called upon close.\n *\n * @api private\n */\n\nTransport.prototype.onClose = function () {\n  this.readyState = 'closed';\n  this.emit('close');\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-client/lib/transport.js\n// module id = 19\n// module chunks = 0","/**\n * Module dependencies.\n */\n\nvar keys = require('./keys');\nvar hasBinary = require('has-binary2');\nvar sliceBuffer = require('arraybuffer.slice');\nvar after = require('after');\nvar utf8 = require('./utf8');\n\nvar base64encoder;\nif (global && global.ArrayBuffer) {\n  base64encoder = require('base64-arraybuffer');\n}\n\n/**\n * Check if we are running an android browser. That requires us to use\n * ArrayBuffer with polling transports...\n *\n * http://ghinda.net/jpeg-blob-ajax-android/\n */\n\nvar isAndroid = typeof navigator !== 'undefined' && /Android/i.test(navigator.userAgent);\n\n/**\n * Check if we are running in PhantomJS.\n * Uploading a Blob with PhantomJS does not work correctly, as reported here:\n * https://github.com/ariya/phantomjs/issues/11395\n * @type boolean\n */\nvar isPhantomJS = typeof navigator !== 'undefined' && /PhantomJS/i.test(navigator.userAgent);\n\n/**\n * When true, avoids using Blobs to encode payloads.\n * @type boolean\n */\nvar dontSendBlobs = isAndroid || isPhantomJS;\n\n/**\n * Current protocol version.\n */\n\nexports.protocol = 3;\n\n/**\n * Packet types.\n */\n\nvar packets = exports.packets = {\n    open:     0    // non-ws\n  , close:    1    // non-ws\n  , ping:     2\n  , pong:     3\n  , message:  4\n  , upgrade:  5\n  , noop:     6\n};\n\nvar packetslist = keys(packets);\n\n/**\n * Premade error packet.\n */\n\nvar err = { type: 'error', data: 'parser error' };\n\n/**\n * Create a blob api even for blob builder when vendor prefixes exist\n */\n\nvar Blob = require('blob');\n\n/**\n * Encodes a packet.\n *\n *     <packet type id> [ <data> ]\n *\n * Example:\n *\n *     5hello world\n *     3\n *     4\n *\n * Binary is encoded in an identical principle\n *\n * @api private\n */\n\nexports.encodePacket = function (packet, supportsBinary, utf8encode, callback) {\n  if (typeof supportsBinary === 'function') {\n    callback = supportsBinary;\n    supportsBinary = false;\n  }\n\n  if (typeof utf8encode === 'function') {\n    callback = utf8encode;\n    utf8encode = null;\n  }\n\n  var data = (packet.data === undefined)\n    ? undefined\n    : packet.data.buffer || packet.data;\n\n  if (global.ArrayBuffer && data instanceof ArrayBuffer) {\n    return encodeArrayBuffer(packet, supportsBinary, callback);\n  } else if (Blob && data instanceof global.Blob) {\n    return encodeBlob(packet, supportsBinary, callback);\n  }\n\n  // might be an object with { base64: true, data: dataAsBase64String }\n  if (data && data.base64) {\n    return encodeBase64Object(packet, callback);\n  }\n\n  // Sending data as a utf-8 string\n  var encoded = packets[packet.type];\n\n  // data fragment is optional\n  if (undefined !== packet.data) {\n    encoded += utf8encode ? utf8.encode(String(packet.data), { strict: false }) : String(packet.data);\n  }\n\n  return callback('' + encoded);\n\n};\n\nfunction encodeBase64Object(packet, callback) {\n  // packet data is an object { base64: true, data: dataAsBase64String }\n  var message = 'b' + exports.packets[packet.type] + packet.data.data;\n  return callback(message);\n}\n\n/**\n * Encode packet helpers for binary types\n */\n\nfunction encodeArrayBuffer(packet, supportsBinary, callback) {\n  if (!supportsBinary) {\n    return exports.encodeBase64Packet(packet, callback);\n  }\n\n  var data = packet.data;\n  var contentArray = new Uint8Array(data);\n  var resultBuffer = new Uint8Array(1 + data.byteLength);\n\n  resultBuffer[0] = packets[packet.type];\n  for (var i = 0; i < contentArray.length; i++) {\n    resultBuffer[i+1] = contentArray[i];\n  }\n\n  return callback(resultBuffer.buffer);\n}\n\nfunction encodeBlobAsArrayBuffer(packet, supportsBinary, callback) {\n  if (!supportsBinary) {\n    return exports.encodeBase64Packet(packet, callback);\n  }\n\n  var fr = new FileReader();\n  fr.onload = function() {\n    packet.data = fr.result;\n    exports.encodePacket(packet, supportsBinary, true, callback);\n  };\n  return fr.readAsArrayBuffer(packet.data);\n}\n\nfunction encodeBlob(packet, supportsBinary, callback) {\n  if (!supportsBinary) {\n    return exports.encodeBase64Packet(packet, callback);\n  }\n\n  if (dontSendBlobs) {\n    return encodeBlobAsArrayBuffer(packet, supportsBinary, callback);\n  }\n\n  var length = new Uint8Array(1);\n  length[0] = packets[packet.type];\n  var blob = new Blob([length.buffer, packet.data]);\n\n  return callback(blob);\n}\n\n/**\n * Encodes a packet with binary data in a base64 string\n *\n * @param {Object} packet, has `type` and `data`\n * @return {String} base64 encoded message\n */\n\nexports.encodeBase64Packet = function(packet, callback) {\n  var message = 'b' + exports.packets[packet.type];\n  if (Blob && packet.data instanceof global.Blob) {\n    var fr = new FileReader();\n    fr.onload = function() {\n      var b64 = fr.result.split(',')[1];\n      callback(message + b64);\n    };\n    return fr.readAsDataURL(packet.data);\n  }\n\n  var b64data;\n  try {\n    b64data = String.fromCharCode.apply(null, new Uint8Array(packet.data));\n  } catch (e) {\n    // iPhone Safari doesn't let you apply with typed arrays\n    var typed = new Uint8Array(packet.data);\n    var basic = new Array(typed.length);\n    for (var i = 0; i < typed.length; i++) {\n      basic[i] = typed[i];\n    }\n    b64data = String.fromCharCode.apply(null, basic);\n  }\n  message += global.btoa(b64data);\n  return callback(message);\n};\n\n/**\n * Decodes a packet. Changes format to Blob if requested.\n *\n * @return {Object} with `type` and `data` (if any)\n * @api private\n */\n\nexports.decodePacket = function (data, binaryType, utf8decode) {\n  if (data === undefined) {\n    return err;\n  }\n  // String data\n  if (typeof data === 'string') {\n    if (data.charAt(0) === 'b') {\n      return exports.decodeBase64Packet(data.substr(1), binaryType);\n    }\n\n    if (utf8decode) {\n      data = tryDecode(data);\n      if (data === false) {\n        return err;\n      }\n    }\n    var type = data.charAt(0);\n\n    if (Number(type) != type || !packetslist[type]) {\n      return err;\n    }\n\n    if (data.length > 1) {\n      return { type: packetslist[type], data: data.substring(1) };\n    } else {\n      return { type: packetslist[type] };\n    }\n  }\n\n  var asArray = new Uint8Array(data);\n  var type = asArray[0];\n  var rest = sliceBuffer(data, 1);\n  if (Blob && binaryType === 'blob') {\n    rest = new Blob([rest]);\n  }\n  return { type: packetslist[type], data: rest };\n};\n\nfunction tryDecode(data) {\n  try {\n    data = utf8.decode(data, { strict: false });\n  } catch (e) {\n    return false;\n  }\n  return data;\n}\n\n/**\n * Decodes a packet encoded in a base64 string\n *\n * @param {String} base64 encoded message\n * @return {Object} with `type` and `data` (if any)\n */\n\nexports.decodeBase64Packet = function(msg, binaryType) {\n  var type = packetslist[msg.charAt(0)];\n  if (!base64encoder) {\n    return { type: type, data: { base64: true, data: msg.substr(1) } };\n  }\n\n  var data = base64encoder.decode(msg.substr(1));\n\n  if (binaryType === 'blob' && Blob) {\n    data = new Blob([data]);\n  }\n\n  return { type: type, data: data };\n};\n\n/**\n * Encodes multiple messages (payload).\n *\n *     <length>:data\n *\n * Example:\n *\n *     11:hello world2:hi\n *\n * If any contents are binary, they will be encoded as base64 strings. Base64\n * encoded strings are marked with a b before the length specifier\n *\n * @param {Array} packets\n * @api private\n */\n\nexports.encodePayload = function (packets, supportsBinary, callback) {\n  if (typeof supportsBinary === 'function') {\n    callback = supportsBinary;\n    supportsBinary = null;\n  }\n\n  var isBinary = hasBinary(packets);\n\n  if (supportsBinary && isBinary) {\n    if (Blob && !dontSendBlobs) {\n      return exports.encodePayloadAsBlob(packets, callback);\n    }\n\n    return exports.encodePayloadAsArrayBuffer(packets, callback);\n  }\n\n  if (!packets.length) {\n    return callback('0:');\n  }\n\n  function setLengthHeader(message) {\n    return message.length + ':' + message;\n  }\n\n  function encodeOne(packet, doneCallback) {\n    exports.encodePacket(packet, !isBinary ? false : supportsBinary, false, function(message) {\n      doneCallback(null, setLengthHeader(message));\n    });\n  }\n\n  map(packets, encodeOne, function(err, results) {\n    return callback(results.join(''));\n  });\n};\n\n/**\n * Async array map using after\n */\n\nfunction map(ary, each, done) {\n  var result = new Array(ary.length);\n  var next = after(ary.length, done);\n\n  var eachWithIndex = function(i, el, cb) {\n    each(el, function(error, msg) {\n      result[i] = msg;\n      cb(error, result);\n    });\n  };\n\n  for (var i = 0; i < ary.length; i++) {\n    eachWithIndex(i, ary[i], next);\n  }\n}\n\n/*\n * Decodes data when a payload is maybe expected. Possible binary contents are\n * decoded from their base64 representation\n *\n * @param {String} data, callback method\n * @api public\n */\n\nexports.decodePayload = function (data, binaryType, callback) {\n  if (typeof data !== 'string') {\n    return exports.decodePayloadAsBinary(data, binaryType, callback);\n  }\n\n  if (typeof binaryType === 'function') {\n    callback = binaryType;\n    binaryType = null;\n  }\n\n  var packet;\n  if (data === '') {\n    // parser error - ignoring payload\n    return callback(err, 0, 1);\n  }\n\n  var length = '', n, msg;\n\n  for (var i = 0, l = data.length; i < l; i++) {\n    var chr = data.charAt(i);\n\n    if (chr !== ':') {\n      length += chr;\n      continue;\n    }\n\n    if (length === '' || (length != (n = Number(length)))) {\n      // parser error - ignoring payload\n      return callback(err, 0, 1);\n    }\n\n    msg = data.substr(i + 1, n);\n\n    if (length != msg.length) {\n      // parser error - ignoring payload\n      return callback(err, 0, 1);\n    }\n\n    if (msg.length) {\n      packet = exports.decodePacket(msg, binaryType, false);\n\n      if (err.type === packet.type && err.data === packet.data) {\n        // parser error in individual packet - ignoring payload\n        return callback(err, 0, 1);\n      }\n\n      var ret = callback(packet, i + n, l);\n      if (false === ret) return;\n    }\n\n    // advance cursor\n    i += n;\n    length = '';\n  }\n\n  if (length !== '') {\n    // parser error - ignoring payload\n    return callback(err, 0, 1);\n  }\n\n};\n\n/**\n * Encodes multiple messages (payload) as binary.\n *\n * <1 = binary, 0 = string><number from 0-9><number from 0-9>[...]<number\n * 255><data>\n *\n * Example:\n * 1 3 255 1 2 3, if the binary contents are interpreted as 8 bit integers\n *\n * @param {Array} packets\n * @return {ArrayBuffer} encoded payload\n * @api private\n */\n\nexports.encodePayloadAsArrayBuffer = function(packets, callback) {\n  if (!packets.length) {\n    return callback(new ArrayBuffer(0));\n  }\n\n  function encodeOne(packet, doneCallback) {\n    exports.encodePacket(packet, true, true, function(data) {\n      return doneCallback(null, data);\n    });\n  }\n\n  map(packets, encodeOne, function(err, encodedPackets) {\n    var totalLength = encodedPackets.reduce(function(acc, p) {\n      var len;\n      if (typeof p === 'string'){\n        len = p.length;\n      } else {\n        len = p.byteLength;\n      }\n      return acc + len.toString().length + len + 2; // string/binary identifier + separator = 2\n    }, 0);\n\n    var resultArray = new Uint8Array(totalLength);\n\n    var bufferIndex = 0;\n    encodedPackets.forEach(function(p) {\n      var isString = typeof p === 'string';\n      var ab = p;\n      if (isString) {\n        var view = new Uint8Array(p.length);\n        for (var i = 0; i < p.length; i++) {\n          view[i] = p.charCodeAt(i);\n        }\n        ab = view.buffer;\n      }\n\n      if (isString) { // not true binary\n        resultArray[bufferIndex++] = 0;\n      } else { // true binary\n        resultArray[bufferIndex++] = 1;\n      }\n\n      var lenStr = ab.byteLength.toString();\n      for (var i = 0; i < lenStr.length; i++) {\n        resultArray[bufferIndex++] = parseInt(lenStr[i]);\n      }\n      resultArray[bufferIndex++] = 255;\n\n      var view = new Uint8Array(ab);\n      for (var i = 0; i < view.length; i++) {\n        resultArray[bufferIndex++] = view[i];\n      }\n    });\n\n    return callback(resultArray.buffer);\n  });\n};\n\n/**\n * Encode as Blob\n */\n\nexports.encodePayloadAsBlob = function(packets, callback) {\n  function encodeOne(packet, doneCallback) {\n    exports.encodePacket(packet, true, true, function(encoded) {\n      var binaryIdentifier = new Uint8Array(1);\n      binaryIdentifier[0] = 1;\n      if (typeof encoded === 'string') {\n        var view = new Uint8Array(encoded.length);\n        for (var i = 0; i < encoded.length; i++) {\n          view[i] = encoded.charCodeAt(i);\n        }\n        encoded = view.buffer;\n        binaryIdentifier[0] = 0;\n      }\n\n      var len = (encoded instanceof ArrayBuffer)\n        ? encoded.byteLength\n        : encoded.size;\n\n      var lenStr = len.toString();\n      var lengthAry = new Uint8Array(lenStr.length + 1);\n      for (var i = 0; i < lenStr.length; i++) {\n        lengthAry[i] = parseInt(lenStr[i]);\n      }\n      lengthAry[lenStr.length] = 255;\n\n      if (Blob) {\n        var blob = new Blob([binaryIdentifier.buffer, lengthAry.buffer, encoded]);\n        doneCallback(null, blob);\n      }\n    });\n  }\n\n  map(packets, encodeOne, function(err, results) {\n    return callback(new Blob(results));\n  });\n};\n\n/*\n * Decodes data when a payload is maybe expected. Strings are decoded by\n * interpreting each byte as a key code for entries marked to start with 0. See\n * description of encodePayloadAsBinary\n *\n * @param {ArrayBuffer} data, callback method\n * @api public\n */\n\nexports.decodePayloadAsBinary = function (data, binaryType, callback) {\n  if (typeof binaryType === 'function') {\n    callback = binaryType;\n    binaryType = null;\n  }\n\n  var bufferTail = data;\n  var buffers = [];\n\n  while (bufferTail.byteLength > 0) {\n    var tailArray = new Uint8Array(bufferTail);\n    var isString = tailArray[0] === 0;\n    var msgLength = '';\n\n    for (var i = 1; ; i++) {\n      if (tailArray[i] === 255) break;\n\n      // 310 = char length of Number.MAX_VALUE\n      if (msgLength.length > 310) {\n        return callback(err, 0, 1);\n      }\n\n      msgLength += tailArray[i];\n    }\n\n    bufferTail = sliceBuffer(bufferTail, 2 + msgLength.length);\n    msgLength = parseInt(msgLength);\n\n    var msg = sliceBuffer(bufferTail, 0, msgLength);\n    if (isString) {\n      try {\n        msg = String.fromCharCode.apply(null, new Uint8Array(msg));\n      } catch (e) {\n        // iPhone Safari doesn't let you apply to typed arrays\n        var typed = new Uint8Array(msg);\n        msg = '';\n        for (var i = 0; i < typed.length; i++) {\n          msg += String.fromCharCode(typed[i]);\n        }\n      }\n    }\n\n    buffers.push(msg);\n    bufferTail = sliceBuffer(bufferTail, msgLength);\n  }\n\n  var total = buffers.length;\n  buffers.forEach(function(buffer, i) {\n    callback(exports.decodePacket(buffer, binaryType, true), i, total);\n  });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-parser/lib/browser.js\n// module id = 20\n// module chunks = 0","\n/**\n * Gets the keys for an object.\n *\n * @return {Array} keys\n * @api private\n */\n\nmodule.exports = Object.keys || function keys (obj){\n  var arr = [];\n  var has = Object.prototype.hasOwnProperty;\n\n  for (var i in obj) {\n    if (has.call(obj, i)) {\n      arr.push(i);\n    }\n  }\n  return arr;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-parser/lib/keys.js\n// module id = 21\n// module chunks = 0","/**\n * An abstraction for slicing an arraybuffer even when\n * ArrayBuffer.prototype.slice is not supported\n *\n * @api public\n */\n\nmodule.exports = function(arraybuffer, start, end) {\n  var bytes = arraybuffer.byteLength;\n  start = start || 0;\n  end = end || bytes;\n\n  if (arraybuffer.slice) { return arraybuffer.slice(start, end); }\n\n  if (start < 0) { start += bytes; }\n  if (end < 0) { end += bytes; }\n  if (end > bytes) { end = bytes; }\n\n  if (start >= bytes || start >= end || bytes === 0) {\n    return new ArrayBuffer(0);\n  }\n\n  var abv = new Uint8Array(arraybuffer);\n  var result = new Uint8Array(end - start);\n  for (var i = start, ii = 0; i < end; i++, ii++) {\n    result[ii] = abv[i];\n  }\n  return result.buffer;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/arraybuffer.slice/index.js\n// module id = 22\n// module chunks = 0","module.exports = after\n\nfunction after(count, callback, err_cb) {\n    var bail = false\n    err_cb = err_cb || noop\n    proxy.count = count\n\n    return (count === 0) ? callback() : proxy\n\n    function proxy(err, result) {\n        if (proxy.count <= 0) {\n            throw new Error('after called too many times')\n        }\n        --proxy.count\n\n        // after first error, rest are passed to err_cb\n        if (err) {\n            bail = true\n            callback(err)\n            // future error callbacks will go to error handler\n            callback = err_cb\n        } else if (proxy.count === 0 && !bail) {\n            callback(null, result)\n        }\n    }\n}\n\nfunction noop() {}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/after/index.js\n// module id = 23\n// module chunks = 0","/*! https://mths.be/utf8js v2.1.2 by @mathias */\n;(function(root) {\n\n\t// Detect free variables `exports`\n\tvar freeExports = typeof exports == 'object' && exports;\n\n\t// Detect free variable `module`\n\tvar freeModule = typeof module == 'object' && module &&\n\t\tmodule.exports == freeExports && module;\n\n\t// Detect free variable `global`, from Node.js or Browserified code,\n\t// and use it as `root`\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {\n\t\troot = freeGlobal;\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tvar stringFromCharCode = String.fromCharCode;\n\n\t// Taken from https://mths.be/punycode\n\tfunction ucs2decode(string) {\n\t\tvar output = [];\n\t\tvar counter = 0;\n\t\tvar length = string.length;\n\t\tvar value;\n\t\tvar extra;\n\t\twhile (counter < length) {\n\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t} else {\n\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\toutput.push(value);\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toutput.push(value);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}\n\n\t// Taken from https://mths.be/punycode\n\tfunction ucs2encode(array) {\n\t\tvar length = array.length;\n\t\tvar index = -1;\n\t\tvar value;\n\t\tvar output = '';\n\t\twhile (++index < length) {\n\t\t\tvalue = array[index];\n\t\t\tif (value > 0xFFFF) {\n\t\t\t\tvalue -= 0x10000;\n\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t}\n\t\t\toutput += stringFromCharCode(value);\n\t\t}\n\t\treturn output;\n\t}\n\n\tfunction checkScalarValue(codePoint, strict) {\n\t\tif (codePoint >= 0xD800 && codePoint <= 0xDFFF) {\n\t\t\tif (strict) {\n\t\t\t\tthrow Error(\n\t\t\t\t\t'Lone surrogate U+' + codePoint.toString(16).toUpperCase() +\n\t\t\t\t\t' is not a scalar value'\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\t/*--------------------------------------------------------------------------*/\n\n\tfunction createByte(codePoint, shift) {\n\t\treturn stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80);\n\t}\n\n\tfunction encodeCodePoint(codePoint, strict) {\n\t\tif ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence\n\t\t\treturn stringFromCharCode(codePoint);\n\t\t}\n\t\tvar symbol = '';\n\t\tif ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0);\n\t\t}\n\t\telse if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence\n\t\t\tif (!checkScalarValue(codePoint, strict)) {\n\t\t\t\tcodePoint = 0xFFFD;\n\t\t\t}\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0);\n\t\t\tsymbol += createByte(codePoint, 6);\n\t\t}\n\t\telse if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0);\n\t\t\tsymbol += createByte(codePoint, 12);\n\t\t\tsymbol += createByte(codePoint, 6);\n\t\t}\n\t\tsymbol += stringFromCharCode((codePoint & 0x3F) | 0x80);\n\t\treturn symbol;\n\t}\n\n\tfunction utf8encode(string, opts) {\n\t\topts = opts || {};\n\t\tvar strict = false !== opts.strict;\n\n\t\tvar codePoints = ucs2decode(string);\n\t\tvar length = codePoints.length;\n\t\tvar index = -1;\n\t\tvar codePoint;\n\t\tvar byteString = '';\n\t\twhile (++index < length) {\n\t\t\tcodePoint = codePoints[index];\n\t\t\tbyteString += encodeCodePoint(codePoint, strict);\n\t\t}\n\t\treturn byteString;\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tfunction readContinuationByte() {\n\t\tif (byteIndex >= byteCount) {\n\t\t\tthrow Error('Invalid byte index');\n\t\t}\n\n\t\tvar continuationByte = byteArray[byteIndex] & 0xFF;\n\t\tbyteIndex++;\n\n\t\tif ((continuationByte & 0xC0) == 0x80) {\n\t\t\treturn continuationByte & 0x3F;\n\t\t}\n\n\t\t// If we end up here, it’s not a continuation byte\n\t\tthrow Error('Invalid continuation byte');\n\t}\n\n\tfunction decodeSymbol(strict) {\n\t\tvar byte1;\n\t\tvar byte2;\n\t\tvar byte3;\n\t\tvar byte4;\n\t\tvar codePoint;\n\n\t\tif (byteIndex > byteCount) {\n\t\t\tthrow Error('Invalid byte index');\n\t\t}\n\n\t\tif (byteIndex == byteCount) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Read first byte\n\t\tbyte1 = byteArray[byteIndex] & 0xFF;\n\t\tbyteIndex++;\n\n\t\t// 1-byte sequence (no continuation bytes)\n\t\tif ((byte1 & 0x80) == 0) {\n\t\t\treturn byte1;\n\t\t}\n\n\t\t// 2-byte sequence\n\t\tif ((byte1 & 0xE0) == 0xC0) {\n\t\t\tbyte2 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x1F) << 6) | byte2;\n\t\t\tif (codePoint >= 0x80) {\n\t\t\t\treturn codePoint;\n\t\t\t} else {\n\t\t\t\tthrow Error('Invalid continuation byte');\n\t\t\t}\n\t\t}\n\n\t\t// 3-byte sequence (may include unpaired surrogates)\n\t\tif ((byte1 & 0xF0) == 0xE0) {\n\t\t\tbyte2 = readContinuationByte();\n\t\t\tbyte3 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x0F) << 12) | (byte2 << 6) | byte3;\n\t\t\tif (codePoint >= 0x0800) {\n\t\t\t\treturn checkScalarValue(codePoint, strict) ? codePoint : 0xFFFD;\n\t\t\t} else {\n\t\t\t\tthrow Error('Invalid continuation byte');\n\t\t\t}\n\t\t}\n\n\t\t// 4-byte sequence\n\t\tif ((byte1 & 0xF8) == 0xF0) {\n\t\t\tbyte2 = readContinuationByte();\n\t\t\tbyte3 = readContinuationByte();\n\t\t\tbyte4 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0C) |\n\t\t\t\t(byte3 << 0x06) | byte4;\n\t\t\tif (codePoint >= 0x010000 && codePoint <= 0x10FFFF) {\n\t\t\t\treturn codePoint;\n\t\t\t}\n\t\t}\n\n\t\tthrow Error('Invalid UTF-8 detected');\n\t}\n\n\tvar byteArray;\n\tvar byteCount;\n\tvar byteIndex;\n\tfunction utf8decode(byteString, opts) {\n\t\topts = opts || {};\n\t\tvar strict = false !== opts.strict;\n\n\t\tbyteArray = ucs2decode(byteString);\n\t\tbyteCount = byteArray.length;\n\t\tbyteIndex = 0;\n\t\tvar codePoints = [];\n\t\tvar tmp;\n\t\twhile ((tmp = decodeSymbol(strict)) !== false) {\n\t\t\tcodePoints.push(tmp);\n\t\t}\n\t\treturn ucs2encode(codePoints);\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tvar utf8 = {\n\t\t'version': '2.1.2',\n\t\t'encode': utf8encode,\n\t\t'decode': utf8decode\n\t};\n\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttypeof define == 'function' &&\n\t\ttypeof define.amd == 'object' &&\n\t\tdefine.amd\n\t) {\n\t\tdefine(function() {\n\t\t\treturn utf8;\n\t\t});\n\t}\telse if (freeExports && !freeExports.nodeType) {\n\t\tif (freeModule) { // in Node.js or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = utf8;\n\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\tvar object = {};\n\t\t\tvar hasOwnProperty = object.hasOwnProperty;\n\t\t\tfor (var key in utf8) {\n\t\t\t\thasOwnProperty.call(utf8, key) && (freeExports[key] = utf8[key]);\n\t\t\t}\n\t\t}\n\t} else { // in Rhino or a web browser\n\t\troot.utf8 = utf8;\n\t}\n\n}(this));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-parser/lib/utf8.js\n// module id = 24\n// module chunks = 0","module.exports = function(module) {\r\n\tif(!module.webpackPolyfill) {\r\n\t\tmodule.deprecate = function() {};\r\n\t\tmodule.paths = [];\r\n\t\t// module.parent = undefined by default\r\n\t\tmodule.children = [];\r\n\t\tmodule.webpackPolyfill = 1;\r\n\t}\r\n\treturn module;\r\n}\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)/buildin/module.js\n// module id = 25\n// module chunks = 0","/*\n * base64-arraybuffer\n * https://github.com/niklasvh/base64-arraybuffer\n *\n * Copyright (c) 2012 Niklas von Hertzen\n * Licensed under the MIT license.\n */\n(function(){\n  \"use strict\";\n\n  var chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\n  // Use a lookup table to find the index.\n  var lookup = new Uint8Array(256);\n  for (var i = 0; i < chars.length; i++) {\n    lookup[chars.charCodeAt(i)] = i;\n  }\n\n  exports.encode = function(arraybuffer) {\n    var bytes = new Uint8Array(arraybuffer),\n    i, len = bytes.length, base64 = \"\";\n\n    for (i = 0; i < len; i+=3) {\n      base64 += chars[bytes[i] >> 2];\n      base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n      base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n      base64 += chars[bytes[i + 2] & 63];\n    }\n\n    if ((len % 3) === 2) {\n      base64 = base64.substring(0, base64.length - 1) + \"=\";\n    } else if (len % 3 === 1) {\n      base64 = base64.substring(0, base64.length - 2) + \"==\";\n    }\n\n    return base64;\n  };\n\n  exports.decode =  function(base64) {\n    var bufferLength = base64.length * 0.75,\n    len = base64.length, i, p = 0,\n    encoded1, encoded2, encoded3, encoded4;\n\n    if (base64[base64.length - 1] === \"=\") {\n      bufferLength--;\n      if (base64[base64.length - 2] === \"=\") {\n        bufferLength--;\n      }\n    }\n\n    var arraybuffer = new ArrayBuffer(bufferLength),\n    bytes = new Uint8Array(arraybuffer);\n\n    for (i = 0; i < len; i+=4) {\n      encoded1 = lookup[base64.charCodeAt(i)];\n      encoded2 = lookup[base64.charCodeAt(i+1)];\n      encoded3 = lookup[base64.charCodeAt(i+2)];\n      encoded4 = lookup[base64.charCodeAt(i+3)];\n\n      bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n      bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n      bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n    }\n\n    return arraybuffer;\n  };\n})();\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/base64-arraybuffer/lib/base64-arraybuffer.js\n// module id = 26\n// module chunks = 0","/**\n * Create a blob builder even when vendor prefixes exist\n */\n\nvar BlobBuilder = global.BlobBuilder\n  || global.WebKitBlobBuilder\n  || global.MSBlobBuilder\n  || global.MozBlobBuilder;\n\n/**\n * Check if Blob constructor is supported\n */\n\nvar blobSupported = (function() {\n  try {\n    var a = new Blob(['hi']);\n    return a.size === 2;\n  } catch(e) {\n    return false;\n  }\n})();\n\n/**\n * Check if Blob constructor supports ArrayBufferViews\n * Fails in Safari 6, so we need to map to ArrayBuffers there.\n */\n\nvar blobSupportsArrayBufferView = blobSupported && (function() {\n  try {\n    var b = new Blob([new Uint8Array([1,2])]);\n    return b.size === 2;\n  } catch(e) {\n    return false;\n  }\n})();\n\n/**\n * Check if BlobBuilder is supported\n */\n\nvar blobBuilderSupported = BlobBuilder\n  && BlobBuilder.prototype.append\n  && BlobBuilder.prototype.getBlob;\n\n/**\n * Helper function that maps ArrayBufferViews to ArrayBuffers\n * Used by BlobBuilder constructor and old browsers that didn't\n * support it in the Blob constructor.\n */\n\nfunction mapArrayBufferViews(ary) {\n  for (var i = 0; i < ary.length; i++) {\n    var chunk = ary[i];\n    if (chunk.buffer instanceof ArrayBuffer) {\n      var buf = chunk.buffer;\n\n      // if this is a subarray, make a copy so we only\n      // include the subarray region from the underlying buffer\n      if (chunk.byteLength !== buf.byteLength) {\n        var copy = new Uint8Array(chunk.byteLength);\n        copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n        buf = copy.buffer;\n      }\n\n      ary[i] = buf;\n    }\n  }\n}\n\nfunction BlobBuilderConstructor(ary, options) {\n  options = options || {};\n\n  var bb = new BlobBuilder();\n  mapArrayBufferViews(ary);\n\n  for (var i = 0; i < ary.length; i++) {\n    bb.append(ary[i]);\n  }\n\n  return (options.type) ? bb.getBlob(options.type) : bb.getBlob();\n};\n\nfunction BlobConstructor(ary, options) {\n  mapArrayBufferViews(ary);\n  return new Blob(ary, options || {});\n};\n\nmodule.exports = (function() {\n  if (blobSupported) {\n    return blobSupportsArrayBufferView ? global.Blob : BlobConstructor;\n  } else if (blobBuilderSupported) {\n    return BlobBuilderConstructor;\n  } else {\n    return undefined;\n  }\n})();\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/blob/index.js\n// module id = 27\n// module chunks = 0","/**\r\n * Compiles a querystring\r\n * Returns string representation of the object\r\n *\r\n * @param {Object}\r\n * @api private\r\n */\r\n\r\nexports.encode = function (obj) {\r\n  var str = '';\r\n\r\n  for (var i in obj) {\r\n    if (obj.hasOwnProperty(i)) {\r\n      if (str.length) str += '&';\r\n      str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]);\r\n    }\r\n  }\r\n\r\n  return str;\r\n};\r\n\r\n/**\r\n * Parses a simple querystring into an object\r\n *\r\n * @param {String} qs\r\n * @api private\r\n */\r\n\r\nexports.decode = function(qs){\r\n  var qry = {};\r\n  var pairs = qs.split('&');\r\n  for (var i = 0, l = pairs.length; i < l; i++) {\r\n    var pair = pairs[i].split('=');\r\n    qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);\r\n  }\r\n  return qry;\r\n};\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parseqs/index.js\n// module id = 28\n// module chunks = 0","\nmodule.exports = function(a, b){\n  var fn = function(){};\n  fn.prototype = b.prototype;\n  a.prototype = new fn;\n  a.prototype.constructor = a;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/component-inherit/index.js\n// module id = 29\n// module chunks = 0","'use strict';\n\nvar alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split('')\n  , length = 64\n  , map = {}\n  , seed = 0\n  , i = 0\n  , prev;\n\n/**\n * Return a string representing the specified number.\n *\n * @param {Number} num The number to convert.\n * @returns {String} The string representation of the number.\n * @api public\n */\nfunction encode(num) {\n  var encoded = '';\n\n  do {\n    encoded = alphabet[num % length] + encoded;\n    num = Math.floor(num / length);\n  } while (num > 0);\n\n  return encoded;\n}\n\n/**\n * Return the integer value specified by the given string.\n *\n * @param {String} str The string to convert.\n * @returns {Number} The integer value represented by the string.\n * @api public\n */\nfunction decode(str) {\n  var decoded = 0;\n\n  for (i = 0; i < str.length; i++) {\n    decoded = decoded * length + map[str.charAt(i)];\n  }\n\n  return decoded;\n}\n\n/**\n * Yeast: A tiny growing id generator.\n *\n * @returns {String} A unique id.\n * @api public\n */\nfunction yeast() {\n  var now = encode(+new Date());\n\n  if (now !== prev) return seed = 0, prev = now;\n  return now +'.'+ encode(seed++);\n}\n\n//\n// Map each character to its index.\n//\nfor (; i < length; i++) map[alphabet[i]] = i;\n\n//\n// Expose the `yeast`, `encode` and `decode` functions.\n//\nyeast.encode = encode;\nyeast.decode = decode;\nmodule.exports = yeast;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/yeast/index.js\n// module id = 30\n// module chunks = 0","\n/**\n * Module requirements.\n */\n\nvar Polling = require('./polling');\nvar inherit = require('component-inherit');\n\n/**\n * Module exports.\n */\n\nmodule.exports = JSONPPolling;\n\n/**\n * Cached regular expressions.\n */\n\nvar rNewline = /\\n/g;\nvar rEscapedNewline = /\\\\n/g;\n\n/**\n * Global JSONP callbacks.\n */\n\nvar callbacks;\n\n/**\n * Noop.\n */\n\nfunction empty () { }\n\n/**\n * JSONP Polling constructor.\n *\n * @param {Object} opts.\n * @api public\n */\n\nfunction JSONPPolling (opts) {\n  Polling.call(this, opts);\n\n  this.query = this.query || {};\n\n  // define global callbacks array if not present\n  // we do this here (lazily) to avoid unneeded global pollution\n  if (!callbacks) {\n    // we need to consider multiple engines in the same page\n    if (!global.___eio) global.___eio = [];\n    callbacks = global.___eio;\n  }\n\n  // callback identifier\n  this.index = callbacks.length;\n\n  // add callback to jsonp global\n  var self = this;\n  callbacks.push(function (msg) {\n    self.onData(msg);\n  });\n\n  // append to query string\n  this.query.j = this.index;\n\n  // prevent spurious errors from being emitted when the window is unloaded\n  if (global.document && global.addEventListener) {\n    global.addEventListener('beforeunload', function () {\n      if (self.script) self.script.onerror = empty;\n    }, false);\n  }\n}\n\n/**\n * Inherits from Polling.\n */\n\ninherit(JSONPPolling, Polling);\n\n/*\n * JSONP only supports binary as base64 encoded strings\n */\n\nJSONPPolling.prototype.supportsBinary = false;\n\n/**\n * Closes the socket.\n *\n * @api private\n */\n\nJSONPPolling.prototype.doClose = function () {\n  if (this.script) {\n    this.script.parentNode.removeChild(this.script);\n    this.script = null;\n  }\n\n  if (this.form) {\n    this.form.parentNode.removeChild(this.form);\n    this.form = null;\n    this.iframe = null;\n  }\n\n  Polling.prototype.doClose.call(this);\n};\n\n/**\n * Starts a poll cycle.\n *\n * @api private\n */\n\nJSONPPolling.prototype.doPoll = function () {\n  var self = this;\n  var script = document.createElement('script');\n\n  if (this.script) {\n    this.script.parentNode.removeChild(this.script);\n    this.script = null;\n  }\n\n  script.async = true;\n  script.src = this.uri();\n  script.onerror = function (e) {\n    self.onError('jsonp poll error', e);\n  };\n\n  var insertAt = document.getElementsByTagName('script')[0];\n  if (insertAt) {\n    insertAt.parentNode.insertBefore(script, insertAt);\n  } else {\n    (document.head || document.body).appendChild(script);\n  }\n  this.script = script;\n\n  var isUAgecko = 'undefined' !== typeof navigator && /gecko/i.test(navigator.userAgent);\n\n  if (isUAgecko) {\n    setTimeout(function () {\n      var iframe = document.createElement('iframe');\n      document.body.appendChild(iframe);\n      document.body.removeChild(iframe);\n    }, 100);\n  }\n};\n\n/**\n * Writes with a hidden iframe.\n *\n * @param {String} data to send\n * @param {Function} called upon flush.\n * @api private\n */\n\nJSONPPolling.prototype.doWrite = function (data, fn) {\n  var self = this;\n\n  if (!this.form) {\n    var form = document.createElement('form');\n    var area = document.createElement('textarea');\n    var id = this.iframeId = 'eio_iframe_' + this.index;\n    var iframe;\n\n    form.className = 'socketio';\n    form.style.position = 'absolute';\n    form.style.top = '-1000px';\n    form.style.left = '-1000px';\n    form.target = id;\n    form.method = 'POST';\n    form.setAttribute('accept-charset', 'utf-8');\n    area.name = 'd';\n    form.appendChild(area);\n    document.body.appendChild(form);\n\n    this.form = form;\n    this.area = area;\n  }\n\n  this.form.action = this.uri();\n\n  function complete () {\n    initIframe();\n    fn();\n  }\n\n  function initIframe () {\n    if (self.iframe) {\n      try {\n        self.form.removeChild(self.iframe);\n      } catch (e) {\n        self.onError('jsonp polling iframe removal error', e);\n      }\n    }\n\n    try {\n      // ie6 dynamic iframes with target=\"\" support (thanks Chris Lambacher)\n      var html = '<iframe src=\"javascript:0\" name=\"' + self.iframeId + '\">';\n      iframe = document.createElement(html);\n    } catch (e) {\n      iframe = document.createElement('iframe');\n      iframe.name = self.iframeId;\n      iframe.src = 'javascript:0';\n    }\n\n    iframe.id = self.iframeId;\n\n    self.form.appendChild(iframe);\n    self.iframe = iframe;\n  }\n\n  initIframe();\n\n  // escape \\n to prevent it from being converted into \\r\\n by some UAs\n  // double escaping is required for escaped new lines because unescaping of new lines can be done safely on server-side\n  data = data.replace(rEscapedNewline, '\\\\\\n');\n  this.area.value = data.replace(rNewline, '\\\\n');\n\n  try {\n    this.form.submit();\n  } catch (e) {}\n\n  if (this.iframe.attachEvent) {\n    this.iframe.onreadystatechange = function () {\n      if (self.iframe.readyState === 'complete') {\n        complete();\n      }\n    };\n  } else {\n    this.iframe.onload = complete;\n  }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-client/lib/transports/polling-jsonp.js\n// module id = 31\n// module chunks = 0","/**\n * Module dependencies.\n */\n\nvar Transport = require('../transport');\nvar parser = require('engine.io-parser');\nvar parseqs = require('parseqs');\nvar inherit = require('component-inherit');\nvar yeast = require('yeast');\nvar debug = require('debug')('engine.io-client:websocket');\nvar BrowserWebSocket = global.WebSocket || global.MozWebSocket;\nvar NodeWebSocket;\nif (typeof window === 'undefined') {\n  try {\n    NodeWebSocket = require('ws');\n  } catch (e) { }\n}\n\n/**\n * Get either the `WebSocket` or `MozWebSocket` globals\n * in the browser or try to resolve WebSocket-compatible\n * interface exposed by `ws` for Node-like environment.\n */\n\nvar WebSocket = BrowserWebSocket;\nif (!WebSocket && typeof window === 'undefined') {\n  WebSocket = NodeWebSocket;\n}\n\n/**\n * Module exports.\n */\n\nmodule.exports = WS;\n\n/**\n * WebSocket transport constructor.\n *\n * @api {Object} connection options\n * @api public\n */\n\nfunction WS (opts) {\n  var forceBase64 = (opts && opts.forceBase64);\n  if (forceBase64) {\n    this.supportsBinary = false;\n  }\n  this.perMessageDeflate = opts.perMessageDeflate;\n  this.usingBrowserWebSocket = BrowserWebSocket && !opts.forceNode;\n  this.protocols = opts.protocols;\n  if (!this.usingBrowserWebSocket) {\n    WebSocket = NodeWebSocket;\n  }\n  Transport.call(this, opts);\n}\n\n/**\n * Inherits from Transport.\n */\n\ninherit(WS, Transport);\n\n/**\n * Transport name.\n *\n * @api public\n */\n\nWS.prototype.name = 'websocket';\n\n/*\n * WebSockets support binary\n */\n\nWS.prototype.supportsBinary = true;\n\n/**\n * Opens socket.\n *\n * @api private\n */\n\nWS.prototype.doOpen = function () {\n  if (!this.check()) {\n    // let probe timeout\n    return;\n  }\n\n  var uri = this.uri();\n  var protocols = this.protocols;\n  var opts = {\n    agent: this.agent,\n    perMessageDeflate: this.perMessageDeflate\n  };\n\n  // SSL options for Node.js client\n  opts.pfx = this.pfx;\n  opts.key = this.key;\n  opts.passphrase = this.passphrase;\n  opts.cert = this.cert;\n  opts.ca = this.ca;\n  opts.ciphers = this.ciphers;\n  opts.rejectUnauthorized = this.rejectUnauthorized;\n  if (this.extraHeaders) {\n    opts.headers = this.extraHeaders;\n  }\n  if (this.localAddress) {\n    opts.localAddress = this.localAddress;\n  }\n\n  try {\n    this.ws = this.usingBrowserWebSocket ? (protocols ? new WebSocket(uri, protocols) : new WebSocket(uri)) : new WebSocket(uri, protocols, opts);\n  } catch (err) {\n    return this.emit('error', err);\n  }\n\n  if (this.ws.binaryType === undefined) {\n    this.supportsBinary = false;\n  }\n\n  if (this.ws.supports && this.ws.supports.binary) {\n    this.supportsBinary = true;\n    this.ws.binaryType = 'nodebuffer';\n  } else {\n    this.ws.binaryType = 'arraybuffer';\n  }\n\n  this.addEventListeners();\n};\n\n/**\n * Adds event listeners to the socket\n *\n * @api private\n */\n\nWS.prototype.addEventListeners = function () {\n  var self = this;\n\n  this.ws.onopen = function () {\n    self.onOpen();\n  };\n  this.ws.onclose = function () {\n    self.onClose();\n  };\n  this.ws.onmessage = function (ev) {\n    self.onData(ev.data);\n  };\n  this.ws.onerror = function (e) {\n    self.onError('websocket error', e);\n  };\n};\n\n/**\n * Writes data to socket.\n *\n * @param {Array} array of packets.\n * @api private\n */\n\nWS.prototype.write = function (packets) {\n  var self = this;\n  this.writable = false;\n\n  // encodePacket efficient as it uses WS framing\n  // no need for encodePayload\n  var total = packets.length;\n  for (var i = 0, l = total; i < l; i++) {\n    (function (packet) {\n      parser.encodePacket(packet, self.supportsBinary, function (data) {\n        if (!self.usingBrowserWebSocket) {\n          // always create a new object (GH-437)\n          var opts = {};\n          if (packet.options) {\n            opts.compress = packet.options.compress;\n          }\n\n          if (self.perMessageDeflate) {\n            var len = 'string' === typeof data ? global.Buffer.byteLength(data) : data.length;\n            if (len < self.perMessageDeflate.threshold) {\n              opts.compress = false;\n            }\n          }\n        }\n\n        // Sometimes the websocket has already been closed but the browser didn't\n        // have a chance of informing us about it yet, in that case send will\n        // throw an error\n        try {\n          if (self.usingBrowserWebSocket) {\n            // TypeError is thrown when passing the second argument on Safari\n            self.ws.send(data);\n          } else {\n            self.ws.send(data, opts);\n          }\n        } catch (e) {\n\n        }\n\n        --total || done();\n      });\n    })(packets[i]);\n  }\n\n  function done () {\n    self.emit('flush');\n\n    // fake drain\n    // defer to next tick to allow Socket to clear writeBuffer\n    setTimeout(function () {\n      self.writable = true;\n      self.emit('drain');\n    }, 0);\n  }\n};\n\n/**\n * Called upon close\n *\n * @api private\n */\n\nWS.prototype.onClose = function () {\n  Transport.prototype.onClose.call(this);\n};\n\n/**\n * Closes socket.\n *\n * @api private\n */\n\nWS.prototype.doClose = function () {\n  if (typeof this.ws !== 'undefined') {\n    this.ws.close();\n  }\n};\n\n/**\n * Generates uri for connection.\n *\n * @api private\n */\n\nWS.prototype.uri = function () {\n  var query = this.query || {};\n  var schema = this.secure ? 'wss' : 'ws';\n  var port = '';\n\n  // avoid port if default for schema\n  if (this.port && (('wss' === schema && Number(this.port) !== 443) ||\n    ('ws' === schema && Number(this.port) !== 80))) {\n    port = ':' + this.port;\n  }\n\n  // append timestamp to URI\n  if (this.timestampRequests) {\n    query[this.timestampParam] = yeast();\n  }\n\n  // communicate binary support capabilities\n  if (!this.supportsBinary) {\n    query.b64 = 1;\n  }\n\n  query = parseqs.encode(query);\n\n  // prepend ? to query\n  if (query.length) {\n    query = '?' + query;\n  }\n\n  var ipv6 = this.hostname.indexOf(':') !== -1;\n  return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;\n};\n\n/**\n * Feature detection for WebSocket.\n *\n * @return {Boolean} whether this transport is available.\n * @api public\n */\n\nWS.prototype.check = function () {\n  return !!WebSocket && !('__initialize' in WebSocket && this.name === WS.prototype.name);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-client/lib/transports/websocket.js\n// module id = 32\n// module chunks = 0","\nvar indexOf = [].indexOf;\n\nmodule.exports = function(arr, obj){\n  if (indexOf) return arr.indexOf(obj);\n  for (var i = 0; i < arr.length; ++i) {\n    if (arr[i] === obj) return i;\n  }\n  return -1;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/indexof/index.js\n// module id = 34\n// module chunks = 0","/**\r\n * JSON parse.\r\n *\r\n * @see Based on jQuery#parseJSON (MIT) and JSON2\r\n * @api private\r\n */\r\n\r\nvar rvalidchars = /^[\\],:{}\\s]*$/;\r\nvar rvalidescape = /\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g;\r\nvar rvalidtokens = /\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g;\r\nvar rvalidbraces = /(?:^|:|,)(?:\\s*\\[)+/g;\r\nvar rtrimLeft = /^\\s+/;\r\nvar rtrimRight = /\\s+$/;\r\n\r\nmodule.exports = function parsejson(data) {\r\n  if ('string' != typeof data || !data) {\r\n    return null;\r\n  }\r\n\r\n  data = data.replace(rtrimLeft, '').replace(rtrimRight, '');\r\n\r\n  // Attempt to parse using the native JSON parser first\r\n  if (global.JSON && JSON.parse) {\r\n    return JSON.parse(data);\r\n  }\r\n\r\n  if (rvalidchars.test(data.replace(rvalidescape, '@')\r\n      .replace(rvalidtokens, ']')\r\n      .replace(rvalidbraces, ''))) {\r\n    return (new Function('return ' + data))();\r\n  }\r\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parsejson/index.js\n// module id = 35\n// module chunks = 0","\n/**\n * Module dependencies.\n */\n\nvar parser = require('socket.io-parser');\nvar Emitter = require('component-emitter');\nvar toArray = require('to-array');\nvar on = require('./on');\nvar bind = require('component-bind');\nvar debug = require('debug')('socket.io-client:socket');\nvar parseqs = require('parseqs');\n\n/**\n * Module exports.\n */\n\nmodule.exports = exports = Socket;\n\n/**\n * Internal events (blacklisted).\n * These events can't be emitted by the user.\n *\n * @api private\n */\n\nvar events = {\n  connect: 1,\n  connect_error: 1,\n  connect_timeout: 1,\n  connecting: 1,\n  disconnect: 1,\n  error: 1,\n  reconnect: 1,\n  reconnect_attempt: 1,\n  reconnect_failed: 1,\n  reconnect_error: 1,\n  reconnecting: 1,\n  ping: 1,\n  pong: 1\n};\n\n/**\n * Shortcut to `Emitter#emit`.\n */\n\nvar emit = Emitter.prototype.emit;\n\n/**\n * `Socket` constructor.\n *\n * @api public\n */\n\nfunction Socket (io, nsp, opts) {\n  this.io = io;\n  this.nsp = nsp;\n  this.json = this; // compat\n  this.ids = 0;\n  this.acks = {};\n  this.receiveBuffer = [];\n  this.sendBuffer = [];\n  this.connected = false;\n  this.disconnected = true;\n  if (opts && opts.query) {\n    this.query = opts.query;\n  }\n  if (this.io.autoConnect) this.open();\n}\n\n/**\n * Mix in `Emitter`.\n */\n\nEmitter(Socket.prototype);\n\n/**\n * Subscribe to open, close and packet events\n *\n * @api private\n */\n\nSocket.prototype.subEvents = function () {\n  if (this.subs) return;\n\n  var io = this.io;\n  this.subs = [\n    on(io, 'open', bind(this, 'onopen')),\n    on(io, 'packet', bind(this, 'onpacket')),\n    on(io, 'close', bind(this, 'onclose'))\n  ];\n};\n\n/**\n * \"Opens\" the socket.\n *\n * @api public\n */\n\nSocket.prototype.open =\nSocket.prototype.connect = function () {\n  if (this.connected) return this;\n\n  this.subEvents();\n  this.io.open(); // ensure open\n  if ('open' === this.io.readyState) this.onopen();\n  this.emit('connecting');\n  return this;\n};\n\n/**\n * Sends a `message` event.\n *\n * @return {Socket} self\n * @api public\n */\n\nSocket.prototype.send = function () {\n  var args = toArray(arguments);\n  args.unshift('message');\n  this.emit.apply(this, args);\n  return this;\n};\n\n/**\n * Override `emit`.\n * If the event is in `events`, it's emitted normally.\n *\n * @param {String} event name\n * @return {Socket} self\n * @api public\n */\n\nSocket.prototype.emit = function (ev) {\n  if (events.hasOwnProperty(ev)) {\n    emit.apply(this, arguments);\n    return this;\n  }\n\n  var args = toArray(arguments);\n  var packet = { type: parser.EVENT, data: args };\n\n  packet.options = {};\n  packet.options.compress = !this.flags || false !== this.flags.compress;\n\n  // event ack callback\n  if ('function' === typeof args[args.length - 1]) {\n\n    this.acks[this.ids] = args.pop();\n    packet.id = this.ids++;\n  }\n\n  if (this.connected) {\n    this.packet(packet);\n  } else {\n    this.sendBuffer.push(packet);\n  }\n\n  delete this.flags;\n\n  return this;\n};\n\n/**\n * Sends a packet.\n *\n * @param {Object} packet\n * @api private\n */\n\nSocket.prototype.packet = function (packet) {\n  packet.nsp = this.nsp;\n  this.io.packet(packet);\n};\n\n/**\n * Called upon engine `open`.\n *\n * @api private\n */\n\nSocket.prototype.onopen = function () {\n\n\n  // write connect packet if necessary\n  if ('/' !== this.nsp) {\n    if (this.query) {\n      var query = typeof this.query === 'object' ? parseqs.encode(this.query) : this.query;\n\n      this.packet({type: parser.CONNECT, query: query});\n    } else {\n      this.packet({type: parser.CONNECT});\n    }\n  }\n};\n\n/**\n * Called upon engine `close`.\n *\n * @param {String} reason\n * @api private\n */\n\nSocket.prototype.onclose = function (reason) {\n\n  this.connected = false;\n  this.disconnected = true;\n  delete this.id;\n  this.emit('disconnect', reason);\n};\n\n/**\n * Called with socket packet.\n *\n * @param {Object} packet\n * @api private\n */\n\nSocket.prototype.onpacket = function (packet) {\n  if (packet.nsp !== this.nsp) return;\n\n  switch (packet.type) {\n    case parser.CONNECT:\n      this.onconnect();\n      break;\n\n    case parser.EVENT:\n      this.onevent(packet);\n      break;\n\n    case parser.BINARY_EVENT:\n      this.onevent(packet);\n      break;\n\n    case parser.ACK:\n      this.onack(packet);\n      break;\n\n    case parser.BINARY_ACK:\n      this.onack(packet);\n      break;\n\n    case parser.DISCONNECT:\n      this.ondisconnect();\n      break;\n\n    case parser.ERROR:\n      this.emit('error', packet.data);\n      break;\n  }\n};\n\n/**\n * Called upon a server event.\n *\n * @param {Object} packet\n * @api private\n */\n\nSocket.prototype.onevent = function (packet) {\n  var args = packet.data || [];\n\n\n  if (null != packet.id) {\n\n    args.push(this.ack(packet.id));\n  }\n\n  if (this.connected) {\n    emit.apply(this, args);\n  } else {\n    this.receiveBuffer.push(args);\n  }\n};\n\n/**\n * Produces an ack callback to emit with an event.\n *\n * @api private\n */\n\nSocket.prototype.ack = function (id) {\n  var self = this;\n  var sent = false;\n  return function () {\n    // prevent double callbacks\n    if (sent) return;\n    sent = true;\n    var args = toArray(arguments);\n\n\n    self.packet({\n      type: parser.ACK,\n      id: id,\n      data: args\n    });\n  };\n};\n\n/**\n * Called upon a server acknowlegement.\n *\n * @param {Object} packet\n * @api private\n */\n\nSocket.prototype.onack = function (packet) {\n  var ack = this.acks[packet.id];\n  if ('function' === typeof ack) {\n\n    ack.apply(this, packet.data);\n    delete this.acks[packet.id];\n  } else {\n\n  }\n};\n\n/**\n * Called upon server connect.\n *\n * @api private\n */\n\nSocket.prototype.onconnect = function () {\n  this.connected = true;\n  this.disconnected = false;\n  this.emit('connect');\n  this.emitBuffered();\n};\n\n/**\n * Emit buffered events (received and emitted).\n *\n * @api private\n */\n\nSocket.prototype.emitBuffered = function () {\n  var i;\n  for (i = 0; i < this.receiveBuffer.length; i++) {\n    emit.apply(this, this.receiveBuffer[i]);\n  }\n  this.receiveBuffer = [];\n\n  for (i = 0; i < this.sendBuffer.length; i++) {\n    this.packet(this.sendBuffer[i]);\n  }\n  this.sendBuffer = [];\n};\n\n/**\n * Called upon server disconnect.\n *\n * @api private\n */\n\nSocket.prototype.ondisconnect = function () {\n\n  this.destroy();\n  this.onclose('io server disconnect');\n};\n\n/**\n * Called upon forced client/server side disconnections,\n * this method ensures the manager stops tracking us and\n * that reconnections don't get triggered for this.\n *\n * @api private.\n */\n\nSocket.prototype.destroy = function () {\n  if (this.subs) {\n    // clean subscriptions to avoid reconnections\n    for (var i = 0; i < this.subs.length; i++) {\n      this.subs[i].destroy();\n    }\n    this.subs = null;\n  }\n\n  this.io.destroy(this);\n};\n\n/**\n * Disconnects the socket manually.\n *\n * @return {Socket} self\n * @api public\n */\n\nSocket.prototype.close =\nSocket.prototype.disconnect = function () {\n  if (this.connected) {\n\n    this.packet({ type: parser.DISCONNECT });\n  }\n\n  // remove socket from pool\n  this.destroy();\n\n  if (this.connected) {\n    // fire events\n    this.onclose('io client disconnect');\n  }\n  return this;\n};\n\n/**\n * Sets the compress flag.\n *\n * @param {Boolean} if `true`, compresses the sending data\n * @return {Socket} self\n * @api public\n */\n\nSocket.prototype.compress = function (compress) {\n  this.flags = this.flags || {};\n  this.flags.compress = compress;\n  return this;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./lib/socket.js","module.exports = toArray\n\nfunction toArray(list, index) {\n    var array = []\n\n    index = index || 0\n\n    for (var i = index || 0; i < list.length; i++) {\n        array[i - index] = list[i]\n    }\n\n    return array\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/to-array/index.js\n// module id = 37\n// module chunks = 0","\n/**\n * Module exports.\n */\n\nmodule.exports = on;\n\n/**\n * Helper for subscriptions.\n *\n * @param {Object|EventEmitter} obj with `Emitter` mixin or `EventEmitter`\n * @param {String} event name\n * @param {Function} callback\n * @api public\n */\n\nfunction on (obj, ev, fn) {\n  obj.on(ev, fn);\n  return {\n    destroy: function () {\n      obj.removeListener(ev, fn);\n    }\n  };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./lib/on.js","/**\n * Slice reference.\n */\n\nvar slice = [].slice;\n\n/**\n * Bind `obj` to `fn`.\n *\n * @param {Object} obj\n * @param {Function|String} fn or string\n * @return {Function}\n * @api public\n */\n\nmodule.exports = function(obj, fn){\n  if ('string' == typeof fn) fn = obj[fn];\n  if ('function' != typeof fn) throw new Error('bind() requires a function');\n  var args = slice.call(arguments, 2);\n  return function(){\n    return fn.apply(obj, args.concat(slice.call(arguments)));\n  }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/component-bind/index.js\n// module id = 39\n// module chunks = 0","\n/**\n * Expose `Backoff`.\n */\n\nmodule.exports = Backoff;\n\n/**\n * Initialize backoff timer with `opts`.\n *\n * - `min` initial timeout in milliseconds [100]\n * - `max` max timeout [10000]\n * - `jitter` [0]\n * - `factor` [2]\n *\n * @param {Object} opts\n * @api public\n */\n\nfunction Backoff(opts) {\n  opts = opts || {};\n  this.ms = opts.min || 100;\n  this.max = opts.max || 10000;\n  this.factor = opts.factor || 2;\n  this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;\n  this.attempts = 0;\n}\n\n/**\n * Return the backoff duration.\n *\n * @return {Number}\n * @api public\n */\n\nBackoff.prototype.duration = function(){\n  var ms = this.ms * Math.pow(this.factor, this.attempts++);\n  if (this.jitter) {\n    var rand =  Math.random();\n    var deviation = Math.floor(rand * this.jitter * ms);\n    ms = (Math.floor(rand * 10) & 1) == 0  ? ms - deviation : ms + deviation;\n  }\n  return Math.min(ms, this.max) | 0;\n};\n\n/**\n * Reset the number of attempts.\n *\n * @api public\n */\n\nBackoff.prototype.reset = function(){\n  this.attempts = 0;\n};\n\n/**\n * Set the minimum duration\n *\n * @api public\n */\n\nBackoff.prototype.setMin = function(min){\n  this.ms = min;\n};\n\n/**\n * Set the maximum duration\n *\n * @api public\n */\n\nBackoff.prototype.setMax = function(max){\n  this.max = max;\n};\n\n/**\n * Set the jitter\n *\n * @api public\n */\n\nBackoff.prototype.setJitter = function(jitter){\n  this.jitter = jitter;\n};\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/backo2/index.js\n// module id = 40\n// module chunks = 0"],"sourceRoot":""}
\ No newline at end of file
diff --git a/wrt/node_modules/socket.io-client/lib/index.js b/wrt/node_modules/socket.io-client/lib/index.js
new file mode 100644 (file)
index 0000000..6bc993c
--- /dev/null
@@ -0,0 +1,94 @@
+
+/**
+ * Module dependencies.
+ */
+
+var url = require('./url');
+var parser = require('socket.io-parser');
+var Manager = require('./manager');
+var debug = require('debug')('socket.io-client');
+
+/**
+ * Module exports.
+ */
+
+module.exports = exports = lookup;
+
+/**
+ * Managers cache.
+ */
+
+var cache = exports.managers = {};
+
+/**
+ * Looks up an existing `Manager` for multiplexing.
+ * If the user summons:
+ *
+ *   `io('http://localhost/a');`
+ *   `io('http://localhost/b');`
+ *
+ * We reuse the existing instance based on same scheme/port/host,
+ * and we initialize sockets for each namespace.
+ *
+ * @api public
+ */
+
+function lookup (uri, opts) {
+  if (typeof uri === 'object') {
+    opts = uri;
+    uri = undefined;
+  }
+
+  opts = opts || {};
+
+  var parsed = url(uri);
+  var source = parsed.source;
+  var id = parsed.id;
+  var path = parsed.path;
+  var sameNamespace = cache[id] && path in cache[id].nsps;
+  var newConnection = opts.forceNew || opts['force new connection'] ||
+                      false === opts.multiplex || sameNamespace;
+
+  var io;
+
+  if (newConnection) {
+    debug('ignoring socket cache for %s', source);
+    io = Manager(source, opts);
+  } else {
+    if (!cache[id]) {
+      debug('new io instance for %s', source);
+      cache[id] = Manager(source, opts);
+    }
+    io = cache[id];
+  }
+  if (parsed.query && !opts.query) {
+    opts.query = parsed.query;
+  }
+  return io.socket(parsed.path, opts);
+}
+
+/**
+ * Protocol version.
+ *
+ * @api public
+ */
+
+exports.protocol = parser.protocol;
+
+/**
+ * `connect`.
+ *
+ * @param {String} uri
+ * @api public
+ */
+
+exports.connect = lookup;
+
+/**
+ * Expose constructors for standalone build.
+ *
+ * @api public
+ */
+
+exports.Manager = require('./manager');
+exports.Socket = require('./socket');
diff --git a/wrt/node_modules/socket.io-client/lib/manager.js b/wrt/node_modules/socket.io-client/lib/manager.js
new file mode 100644 (file)
index 0000000..e44bd6c
--- /dev/null
@@ -0,0 +1,573 @@
+
+/**
+ * Module dependencies.
+ */
+
+var eio = require('engine.io-client');
+var Socket = require('./socket');
+var Emitter = require('component-emitter');
+var parser = require('socket.io-parser');
+var on = require('./on');
+var bind = require('component-bind');
+var debug = require('debug')('socket.io-client:manager');
+var indexOf = require('indexof');
+var Backoff = require('backo2');
+
+/**
+ * IE6+ hasOwnProperty
+ */
+
+var has = Object.prototype.hasOwnProperty;
+
+/**
+ * Module exports
+ */
+
+module.exports = Manager;
+
+/**
+ * `Manager` constructor.
+ *
+ * @param {String} engine instance or engine uri/opts
+ * @param {Object} options
+ * @api public
+ */
+
+function Manager (uri, opts) {
+  if (!(this instanceof Manager)) return new Manager(uri, opts);
+  if (uri && ('object' === typeof uri)) {
+    opts = uri;
+    uri = undefined;
+  }
+  opts = opts || {};
+
+  opts.path = opts.path || '/socket.io';
+  this.nsps = {};
+  this.subs = [];
+  this.opts = opts;
+  this.reconnection(opts.reconnection !== false);
+  this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);
+  this.reconnectionDelay(opts.reconnectionDelay || 1000);
+  this.reconnectionDelayMax(opts.reconnectionDelayMax || 5000);
+  this.randomizationFactor(opts.randomizationFactor || 0.5);
+  this.backoff = new Backoff({
+    min: this.reconnectionDelay(),
+    max: this.reconnectionDelayMax(),
+    jitter: this.randomizationFactor()
+  });
+  this.timeout(null == opts.timeout ? 20000 : opts.timeout);
+  this.readyState = 'closed';
+  this.uri = uri;
+  this.connecting = [];
+  this.lastPing = null;
+  this.encoding = false;
+  this.packetBuffer = [];
+  var _parser = opts.parser || parser;
+  this.encoder = new _parser.Encoder();
+  this.decoder = new _parser.Decoder();
+  this.autoConnect = opts.autoConnect !== false;
+  if (this.autoConnect) this.open();
+}
+
+/**
+ * Propagate given event to sockets and emit on `this`
+ *
+ * @api private
+ */
+
+Manager.prototype.emitAll = function () {
+  this.emit.apply(this, arguments);
+  for (var nsp in this.nsps) {
+    if (has.call(this.nsps, nsp)) {
+      this.nsps[nsp].emit.apply(this.nsps[nsp], arguments);
+    }
+  }
+};
+
+/**
+ * Update `socket.id` of all sockets
+ *
+ * @api private
+ */
+
+Manager.prototype.updateSocketIds = function () {
+  for (var nsp in this.nsps) {
+    if (has.call(this.nsps, nsp)) {
+      this.nsps[nsp].id = this.generateId(nsp);
+    }
+  }
+};
+
+/**
+ * generate `socket.id` for the given `nsp`
+ *
+ * @param {String} nsp
+ * @return {String}
+ * @api private
+ */
+
+Manager.prototype.generateId = function (nsp) {
+  return (nsp === '/' ? '' : (nsp + '#')) + this.engine.id;
+};
+
+/**
+ * Mix in `Emitter`.
+ */
+
+Emitter(Manager.prototype);
+
+/**
+ * Sets the `reconnection` config.
+ *
+ * @param {Boolean} true/false if it should automatically reconnect
+ * @return {Manager} self or value
+ * @api public
+ */
+
+Manager.prototype.reconnection = function (v) {
+  if (!arguments.length) return this._reconnection;
+  this._reconnection = !!v;
+  return this;
+};
+
+/**
+ * Sets the reconnection attempts config.
+ *
+ * @param {Number} max reconnection attempts before giving up
+ * @return {Manager} self or value
+ * @api public
+ */
+
+Manager.prototype.reconnectionAttempts = function (v) {
+  if (!arguments.length) return this._reconnectionAttempts;
+  this._reconnectionAttempts = v;
+  return this;
+};
+
+/**
+ * Sets the delay between reconnections.
+ *
+ * @param {Number} delay
+ * @return {Manager} self or value
+ * @api public
+ */
+
+Manager.prototype.reconnectionDelay = function (v) {
+  if (!arguments.length) return this._reconnectionDelay;
+  this._reconnectionDelay = v;
+  this.backoff && this.backoff.setMin(v);
+  return this;
+};
+
+Manager.prototype.randomizationFactor = function (v) {
+  if (!arguments.length) return this._randomizationFactor;
+  this._randomizationFactor = v;
+  this.backoff && this.backoff.setJitter(v);
+  return this;
+};
+
+/**
+ * Sets the maximum delay between reconnections.
+ *
+ * @param {Number} delay
+ * @return {Manager} self or value
+ * @api public
+ */
+
+Manager.prototype.reconnectionDelayMax = function (v) {
+  if (!arguments.length) return this._reconnectionDelayMax;
+  this._reconnectionDelayMax = v;
+  this.backoff && this.backoff.setMax(v);
+  return this;
+};
+
+/**
+ * Sets the connection timeout. `false` to disable
+ *
+ * @return {Manager} self or value
+ * @api public
+ */
+
+Manager.prototype.timeout = function (v) {
+  if (!arguments.length) return this._timeout;
+  this._timeout = v;
+  return this;
+};
+
+/**
+ * Starts trying to reconnect if reconnection is enabled and we have not
+ * started reconnecting yet
+ *
+ * @api private
+ */
+
+Manager.prototype.maybeReconnectOnOpen = function () {
+  // Only try to reconnect if it's the first time we're connecting
+  if (!this.reconnecting && this._reconnection && this.backoff.attempts === 0) {
+    // keeps reconnection from firing twice for the same reconnection loop
+    this.reconnect();
+  }
+};
+
+/**
+ * Sets the current transport `socket`.
+ *
+ * @param {Function} optional, callback
+ * @return {Manager} self
+ * @api public
+ */
+
+Manager.prototype.open =
+Manager.prototype.connect = function (fn, opts) {
+  debug('readyState %s', this.readyState);
+  if (~this.readyState.indexOf('open')) return this;
+
+  debug('opening %s', this.uri);
+  this.engine = eio(this.uri, this.opts);
+  var socket = this.engine;
+  var self = this;
+  this.readyState = 'opening';
+  this.skipReconnect = false;
+
+  // emit `open`
+  var openSub = on(socket, 'open', function () {
+    self.onopen();
+    fn && fn();
+  });
+
+  // emit `connect_error`
+  var errorSub = on(socket, 'error', function (data) {
+    debug('connect_error');
+    self.cleanup();
+    self.readyState = 'closed';
+    self.emitAll('connect_error', data);
+    if (fn) {
+      var err = new Error('Connection error');
+      err.data = data;
+      fn(err);
+    } else {
+      // Only do this if there is no fn to handle the error
+      self.maybeReconnectOnOpen();
+    }
+  });
+
+  // emit `connect_timeout`
+  if (false !== this._timeout) {
+    var timeout = this._timeout;
+    debug('connect attempt will timeout after %d', timeout);
+
+    // set timer
+    var timer = setTimeout(function () {
+      debug('connect attempt timed out after %d', timeout);
+      openSub.destroy();
+      socket.close();
+      socket.emit('error', 'timeout');
+      self.emitAll('connect_timeout', timeout);
+    }, timeout);
+
+    this.subs.push({
+      destroy: function () {
+        clearTimeout(timer);
+      }
+    });
+  }
+
+  this.subs.push(openSub);
+  this.subs.push(errorSub);
+
+  return this;
+};
+
+/**
+ * Called upon transport open.
+ *
+ * @api private
+ */
+
+Manager.prototype.onopen = function () {
+  debug('open');
+
+  // clear old subs
+  this.cleanup();
+
+  // mark as open
+  this.readyState = 'open';
+  this.emit('open');
+
+  // add new subs
+  var socket = this.engine;
+  this.subs.push(on(socket, 'data', bind(this, 'ondata')));
+  this.subs.push(on(socket, 'ping', bind(this, 'onping')));
+  this.subs.push(on(socket, 'pong', bind(this, 'onpong')));
+  this.subs.push(on(socket, 'error', bind(this, 'onerror')));
+  this.subs.push(on(socket, 'close', bind(this, 'onclose')));
+  this.subs.push(on(this.decoder, 'decoded', bind(this, 'ondecoded')));
+};
+
+/**
+ * Called upon a ping.
+ *
+ * @api private
+ */
+
+Manager.prototype.onping = function () {
+  this.lastPing = new Date();
+  this.emitAll('ping');
+};
+
+/**
+ * Called upon a packet.
+ *
+ * @api private
+ */
+
+Manager.prototype.onpong = function () {
+  this.emitAll('pong', new Date() - this.lastPing);
+};
+
+/**
+ * Called with data.
+ *
+ * @api private
+ */
+
+Manager.prototype.ondata = function (data) {
+  this.decoder.add(data);
+};
+
+/**
+ * Called when parser fully decodes a packet.
+ *
+ * @api private
+ */
+
+Manager.prototype.ondecoded = function (packet) {
+  this.emit('packet', packet);
+};
+
+/**
+ * Called upon socket error.
+ *
+ * @api private
+ */
+
+Manager.prototype.onerror = function (err) {
+  debug('error', err);
+  this.emitAll('error', err);
+};
+
+/**
+ * Creates a new socket for the given `nsp`.
+ *
+ * @return {Socket}
+ * @api public
+ */
+
+Manager.prototype.socket = function (nsp, opts) {
+  var socket = this.nsps[nsp];
+  if (!socket) {
+    socket = new Socket(this, nsp, opts);
+    this.nsps[nsp] = socket;
+    var self = this;
+    socket.on('connecting', onConnecting);
+    socket.on('connect', function () {
+      socket.id = self.generateId(nsp);
+    });
+
+    if (this.autoConnect) {
+      // manually call here since connecting event is fired before listening
+      onConnecting();
+    }
+  }
+
+  function onConnecting () {
+    if (!~indexOf(self.connecting, socket)) {
+      self.connecting.push(socket);
+    }
+  }
+
+  return socket;
+};
+
+/**
+ * Called upon a socket close.
+ *
+ * @param {Socket} socket
+ */
+
+Manager.prototype.destroy = function (socket) {
+  var index = indexOf(this.connecting, socket);
+  if (~index) this.connecting.splice(index, 1);
+  if (this.connecting.length) return;
+
+  this.close();
+};
+
+/**
+ * Writes a packet.
+ *
+ * @param {Object} packet
+ * @api private
+ */
+
+Manager.prototype.packet = function (packet) {
+  debug('writing packet %j', packet);
+  var self = this;
+  if (packet.query && packet.type === 0) packet.nsp += '?' + packet.query;
+
+  if (!self.encoding) {
+    // encode, then write to engine with result
+    self.encoding = true;
+    this.encoder.encode(packet, function (encodedPackets) {
+      for (var i = 0; i < encodedPackets.length; i++) {
+        self.engine.write(encodedPackets[i], packet.options);
+      }
+      self.encoding = false;
+      self.processPacketQueue();
+    });
+  } else { // add packet to the queue
+    self.packetBuffer.push(packet);
+  }
+};
+
+/**
+ * If packet buffer is non-empty, begins encoding the
+ * next packet in line.
+ *
+ * @api private
+ */
+
+Manager.prototype.processPacketQueue = function () {
+  if (this.packetBuffer.length > 0 && !this.encoding) {
+    var pack = this.packetBuffer.shift();
+    this.packet(pack);
+  }
+};
+
+/**
+ * Clean up transport subscriptions and packet buffer.
+ *
+ * @api private
+ */
+
+Manager.prototype.cleanup = function () {
+  debug('cleanup');
+
+  var subsLength = this.subs.length;
+  for (var i = 0; i < subsLength; i++) {
+    var sub = this.subs.shift();
+    sub.destroy();
+  }
+
+  this.packetBuffer = [];
+  this.encoding = false;
+  this.lastPing = null;
+
+  this.decoder.destroy();
+};
+
+/**
+ * Close the current socket.
+ *
+ * @api private
+ */
+
+Manager.prototype.close =
+Manager.prototype.disconnect = function () {
+  debug('disconnect');
+  this.skipReconnect = true;
+  this.reconnecting = false;
+  if ('opening' === this.readyState) {
+    // `onclose` will not fire because
+    // an open event never happened
+    this.cleanup();
+  }
+  this.backoff.reset();
+  this.readyState = 'closed';
+  if (this.engine) this.engine.close();
+};
+
+/**
+ * Called upon engine close.
+ *
+ * @api private
+ */
+
+Manager.prototype.onclose = function (reason) {
+  debug('onclose');
+
+  this.cleanup();
+  this.backoff.reset();
+  this.readyState = 'closed';
+  this.emit('close', reason);
+
+  if (this._reconnection && !this.skipReconnect) {
+    this.reconnect();
+  }
+};
+
+/**
+ * Attempt a reconnection.
+ *
+ * @api private
+ */
+
+Manager.prototype.reconnect = function () {
+  if (this.reconnecting || this.skipReconnect) return this;
+
+  var self = this;
+
+  if (this.backoff.attempts >= this._reconnectionAttempts) {
+    debug('reconnect failed');
+    this.backoff.reset();
+    this.emitAll('reconnect_failed');
+    this.reconnecting = false;
+  } else {
+    var delay = this.backoff.duration();
+    debug('will wait %dms before reconnect attempt', delay);
+
+    this.reconnecting = true;
+    var timer = setTimeout(function () {
+      if (self.skipReconnect) return;
+
+      debug('attempting reconnect');
+      self.emitAll('reconnect_attempt', self.backoff.attempts);
+      self.emitAll('reconnecting', self.backoff.attempts);
+
+      // check again for the case socket closed in above events
+      if (self.skipReconnect) return;
+
+      self.open(function (err) {
+        if (err) {
+          debug('reconnect attempt error');
+          self.reconnecting = false;
+          self.reconnect();
+          self.emitAll('reconnect_error', err.data);
+        } else {
+          debug('reconnect success');
+          self.onreconnect();
+        }
+      });
+    }, delay);
+
+    this.subs.push({
+      destroy: function () {
+        clearTimeout(timer);
+      }
+    });
+  }
+};
+
+/**
+ * Called upon successful reconnect.
+ *
+ * @api private
+ */
+
+Manager.prototype.onreconnect = function () {
+  var attempt = this.backoff.attempts;
+  this.reconnecting = false;
+  this.backoff.reset();
+  this.updateSocketIds();
+  this.emitAll('reconnect', attempt);
+};
diff --git a/wrt/node_modules/socket.io-client/lib/on.js b/wrt/node_modules/socket.io-client/lib/on.js
new file mode 100644 (file)
index 0000000..fad9264
--- /dev/null
@@ -0,0 +1,24 @@
+
+/**
+ * Module exports.
+ */
+
+module.exports = on;
+
+/**
+ * Helper for subscriptions.
+ *
+ * @param {Object|EventEmitter} obj with `Emitter` mixin or `EventEmitter`
+ * @param {String} event name
+ * @param {Function} callback
+ * @api public
+ */
+
+function on (obj, ev, fn) {
+  obj.on(ev, fn);
+  return {
+    destroy: function () {
+      obj.removeListener(ev, fn);
+    }
+  };
+}
diff --git a/wrt/node_modules/socket.io-client/lib/socket.js b/wrt/node_modules/socket.io-client/lib/socket.js
new file mode 100644 (file)
index 0000000..702c602
--- /dev/null
@@ -0,0 +1,418 @@
+
+/**
+ * Module dependencies.
+ */
+
+var parser = require('socket.io-parser');
+var Emitter = require('component-emitter');
+var toArray = require('to-array');
+var on = require('./on');
+var bind = require('component-bind');
+var debug = require('debug')('socket.io-client:socket');
+var parseqs = require('parseqs');
+
+/**
+ * Module exports.
+ */
+
+module.exports = exports = Socket;
+
+/**
+ * Internal events (blacklisted).
+ * These events can't be emitted by the user.
+ *
+ * @api private
+ */
+
+var events = {
+  connect: 1,
+  connect_error: 1,
+  connect_timeout: 1,
+  connecting: 1,
+  disconnect: 1,
+  error: 1,
+  reconnect: 1,
+  reconnect_attempt: 1,
+  reconnect_failed: 1,
+  reconnect_error: 1,
+  reconnecting: 1,
+  ping: 1,
+  pong: 1
+};
+
+/**
+ * Shortcut to `Emitter#emit`.
+ */
+
+var emit = Emitter.prototype.emit;
+
+/**
+ * `Socket` constructor.
+ *
+ * @api public
+ */
+
+function Socket (io, nsp, opts) {
+  this.io = io;
+  this.nsp = nsp;
+  this.json = this; // compat
+  this.ids = 0;
+  this.acks = {};
+  this.receiveBuffer = [];
+  this.sendBuffer = [];
+  this.connected = false;
+  this.disconnected = true;
+  if (opts && opts.query) {
+    this.query = opts.query;
+  }
+  if (this.io.autoConnect) this.open();
+}
+
+/**
+ * Mix in `Emitter`.
+ */
+
+Emitter(Socket.prototype);
+
+/**
+ * Subscribe to open, close and packet events
+ *
+ * @api private
+ */
+
+Socket.prototype.subEvents = function () {
+  if (this.subs) return;
+
+  var io = this.io;
+  this.subs = [
+    on(io, 'open', bind(this, 'onopen')),
+    on(io, 'packet', bind(this, 'onpacket')),
+    on(io, 'close', bind(this, 'onclose'))
+  ];
+};
+
+/**
+ * "Opens" the socket.
+ *
+ * @api public
+ */
+
+Socket.prototype.open =
+Socket.prototype.connect = function () {
+  if (this.connected) return this;
+
+  this.subEvents();
+  this.io.open(); // ensure open
+  if ('open' === this.io.readyState) this.onopen();
+  this.emit('connecting');
+  return this;
+};
+
+/**
+ * Sends a `message` event.
+ *
+ * @return {Socket} self
+ * @api public
+ */
+
+Socket.prototype.send = function () {
+  var args = toArray(arguments);
+  args.unshift('message');
+  this.emit.apply(this, args);
+  return this;
+};
+
+/**
+ * Override `emit`.
+ * If the event is in `events`, it's emitted normally.
+ *
+ * @param {String} event name
+ * @return {Socket} self
+ * @api public
+ */
+
+Socket.prototype.emit = function (ev) {
+  if (events.hasOwnProperty(ev)) {
+    emit.apply(this, arguments);
+    return this;
+  }
+
+  var args = toArray(arguments);
+  var packet = { type: parser.EVENT, data: args };
+
+  packet.options = {};
+  packet.options.compress = !this.flags || false !== this.flags.compress;
+
+  // event ack callback
+  if ('function' === typeof args[args.length - 1]) {
+    debug('emitting packet with ack id %d', this.ids);
+    this.acks[this.ids] = args.pop();
+    packet.id = this.ids++;
+  }
+
+  if (this.connected) {
+    this.packet(packet);
+  } else {
+    this.sendBuffer.push(packet);
+  }
+
+  delete this.flags;
+
+  return this;
+};
+
+/**
+ * Sends a packet.
+ *
+ * @param {Object} packet
+ * @api private
+ */
+
+Socket.prototype.packet = function (packet) {
+  packet.nsp = this.nsp;
+  this.io.packet(packet);
+};
+
+/**
+ * Called upon engine `open`.
+ *
+ * @api private
+ */
+
+Socket.prototype.onopen = function () {
+  debug('transport is open - connecting');
+
+  // write connect packet if necessary
+  if ('/' !== this.nsp) {
+    if (this.query) {
+      var query = typeof this.query === 'object' ? parseqs.encode(this.query) : this.query;
+      debug('sending connect packet with query %s', query);
+      this.packet({type: parser.CONNECT, query: query});
+    } else {
+      this.packet({type: parser.CONNECT});
+    }
+  }
+};
+
+/**
+ * Called upon engine `close`.
+ *
+ * @param {String} reason
+ * @api private
+ */
+
+Socket.prototype.onclose = function (reason) {
+  debug('close (%s)', reason);
+  this.connected = false;
+  this.disconnected = true;
+  delete this.id;
+  this.emit('disconnect', reason);
+};
+
+/**
+ * Called with socket packet.
+ *
+ * @param {Object} packet
+ * @api private
+ */
+
+Socket.prototype.onpacket = function (packet) {
+  if (packet.nsp !== this.nsp) return;
+
+  switch (packet.type) {
+    case parser.CONNECT:
+      this.onconnect();
+      break;
+
+    case parser.EVENT:
+      this.onevent(packet);
+      break;
+
+    case parser.BINARY_EVENT:
+      this.onevent(packet);
+      break;
+
+    case parser.ACK:
+      this.onack(packet);
+      break;
+
+    case parser.BINARY_ACK:
+      this.onack(packet);
+      break;
+
+    case parser.DISCONNECT:
+      this.ondisconnect();
+      break;
+
+    case parser.ERROR:
+      this.emit('error', packet.data);
+      break;
+  }
+};
+
+/**
+ * Called upon a server event.
+ *
+ * @param {Object} packet
+ * @api private
+ */
+
+Socket.prototype.onevent = function (packet) {
+  var args = packet.data || [];
+  debug('emitting event %j', args);
+
+  if (null != packet.id) {
+    debug('attaching ack callback to event');
+    args.push(this.ack(packet.id));
+  }
+
+  if (this.connected) {
+    emit.apply(this, args);
+  } else {
+    this.receiveBuffer.push(args);
+  }
+};
+
+/**
+ * Produces an ack callback to emit with an event.
+ *
+ * @api private
+ */
+
+Socket.prototype.ack = function (id) {
+  var self = this;
+  var sent = false;
+  return function () {
+    // prevent double callbacks
+    if (sent) return;
+    sent = true;
+    var args = toArray(arguments);
+    debug('sending ack %j', args);
+
+    self.packet({
+      type: parser.ACK,
+      id: id,
+      data: args
+    });
+  };
+};
+
+/**
+ * Called upon a server acknowlegement.
+ *
+ * @param {Object} packet
+ * @api private
+ */
+
+Socket.prototype.onack = function (packet) {
+  var ack = this.acks[packet.id];
+  if ('function' === typeof ack) {
+    debug('calling ack %s with %j', packet.id, packet.data);
+    ack.apply(this, packet.data);
+    delete this.acks[packet.id];
+  } else {
+    debug('bad ack %s', packet.id);
+  }
+};
+
+/**
+ * Called upon server connect.
+ *
+ * @api private
+ */
+
+Socket.prototype.onconnect = function () {
+  this.connected = true;
+  this.disconnected = false;
+  this.emit('connect');
+  this.emitBuffered();
+};
+
+/**
+ * Emit buffered events (received and emitted).
+ *
+ * @api private
+ */
+
+Socket.prototype.emitBuffered = function () {
+  var i;
+  for (i = 0; i < this.receiveBuffer.length; i++) {
+    emit.apply(this, this.receiveBuffer[i]);
+  }
+  this.receiveBuffer = [];
+
+  for (i = 0; i < this.sendBuffer.length; i++) {
+    this.packet(this.sendBuffer[i]);
+  }
+  this.sendBuffer = [];
+};
+
+/**
+ * Called upon server disconnect.
+ *
+ * @api private
+ */
+
+Socket.prototype.ondisconnect = function () {
+  debug('server disconnect (%s)', this.nsp);
+  this.destroy();
+  this.onclose('io server disconnect');
+};
+
+/**
+ * Called upon forced client/server side disconnections,
+ * this method ensures the manager stops tracking us and
+ * that reconnections don't get triggered for this.
+ *
+ * @api private.
+ */
+
+Socket.prototype.destroy = function () {
+  if (this.subs) {
+    // clean subscriptions to avoid reconnections
+    for (var i = 0; i < this.subs.length; i++) {
+      this.subs[i].destroy();
+    }
+    this.subs = null;
+  }
+
+  this.io.destroy(this);
+};
+
+/**
+ * Disconnects the socket manually.
+ *
+ * @return {Socket} self
+ * @api public
+ */
+
+Socket.prototype.close =
+Socket.prototype.disconnect = function () {
+  if (this.connected) {
+    debug('performing disconnect (%s)', this.nsp);
+    this.packet({ type: parser.DISCONNECT });
+  }
+
+  // remove socket from pool
+  this.destroy();
+
+  if (this.connected) {
+    // fire events
+    this.onclose('io client disconnect');
+  }
+  return this;
+};
+
+/**
+ * Sets the compress flag.
+ *
+ * @param {Boolean} if `true`, compresses the sending data
+ * @return {Socket} self
+ * @api public
+ */
+
+Socket.prototype.compress = function (compress) {
+  this.flags = this.flags || {};
+  this.flags.compress = compress;
+  return this;
+};
diff --git a/wrt/node_modules/socket.io-client/lib/url.js b/wrt/node_modules/socket.io-client/lib/url.js
new file mode 100644 (file)
index 0000000..8bac542
--- /dev/null
@@ -0,0 +1,75 @@
+
+/**
+ * Module dependencies.
+ */
+
+var parseuri = require('parseuri');
+var debug = require('debug')('socket.io-client:url');
+
+/**
+ * Module exports.
+ */
+
+module.exports = url;
+
+/**
+ * URL parser.
+ *
+ * @param {String} url
+ * @param {Object} An object meant to mimic window.location.
+ *                 Defaults to window.location.
+ * @api public
+ */
+
+function url (uri, loc) {
+  var obj = uri;
+
+  // default to window.location
+  loc = loc || global.location;
+  if (null == uri) uri = loc.protocol + '//' + loc.host;
+
+  // relative path support
+  if ('string' === typeof uri) {
+    if ('/' === uri.charAt(0)) {
+      if ('/' === uri.charAt(1)) {
+        uri = loc.protocol + uri;
+      } else {
+        uri = loc.host + uri;
+      }
+    }
+
+    if (!/^(https?|wss?):\/\//.test(uri)) {
+      debug('protocol-less url %s', uri);
+      if ('undefined' !== typeof loc) {
+        uri = loc.protocol + '//' + uri;
+      } else {
+        uri = 'https://' + uri;
+      }
+    }
+
+    // parse
+    debug('parse %s', uri);
+    obj = parseuri(uri);
+  }
+
+  // make sure we treat `localhost:80` and `localhost` equally
+  if (!obj.port) {
+    if (/^(http|ws)$/.test(obj.protocol)) {
+      obj.port = '80';
+    } else if (/^(http|ws)s$/.test(obj.protocol)) {
+      obj.port = '443';
+    }
+  }
+
+  obj.path = obj.path || '/';
+
+  var ipv6 = obj.host.indexOf(':') !== -1;
+  var host = ipv6 ? '[' + obj.host + ']' : obj.host;
+
+  // define unique id
+  obj.id = obj.protocol + '://' + host + ':' + obj.port;
+  // define href
+  obj.href = obj.protocol + '://' + host + (loc && loc.port === obj.port ? '' : (':' + obj.port));
+
+  return obj;
+}
diff --git a/wrt/node_modules/socket.io-client/node_modules/debug/.coveralls.yml b/wrt/node_modules/socket.io-client/node_modules/debug/.coveralls.yml
new file mode 100644 (file)
index 0000000..20a7068
--- /dev/null
@@ -0,0 +1 @@
+repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve
diff --git a/wrt/node_modules/socket.io-client/node_modules/debug/.eslintrc b/wrt/node_modules/socket.io-client/node_modules/debug/.eslintrc
new file mode 100644 (file)
index 0000000..8a37ae2
--- /dev/null
@@ -0,0 +1,11 @@
+{
+  "env": {
+    "browser": true,
+    "node": true
+  },
+  "rules": {
+    "no-console": 0,
+    "no-empty": [1, { "allowEmptyCatch": true }]
+  },
+  "extends": "eslint:recommended"
+}
diff --git a/wrt/node_modules/socket.io-client/node_modules/debug/.npmignore b/wrt/node_modules/socket.io-client/node_modules/debug/.npmignore
new file mode 100644 (file)
index 0000000..5f60eec
--- /dev/null
@@ -0,0 +1,9 @@
+support
+test
+examples
+example
+*.sock
+dist
+yarn.lock
+coverage
+bower.json
diff --git a/wrt/node_modules/socket.io-client/node_modules/debug/.travis.yml b/wrt/node_modules/socket.io-client/node_modules/debug/.travis.yml
new file mode 100644 (file)
index 0000000..6c6090c
--- /dev/null
@@ -0,0 +1,14 @@
+
+language: node_js
+node_js:
+  - "6"
+  - "5"
+  - "4"
+
+install:
+  - make node_modules
+
+script:
+  - make lint
+  - make test
+  - make coveralls
diff --git a/wrt/node_modules/socket.io-client/node_modules/debug/CHANGELOG.md b/wrt/node_modules/socket.io-client/node_modules/debug/CHANGELOG.md
new file mode 100644 (file)
index 0000000..eadaa18
--- /dev/null
@@ -0,0 +1,362 @@
+
+2.6.9 / 2017-09-22
+==================
+
+  * remove ReDoS regexp in %o formatter (#504)
+
+2.6.8 / 2017-05-18
+==================
+
+  * Fix: Check for undefined on browser globals (#462, @marbemac)
+
+2.6.7 / 2017-05-16
+==================
+
+  * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom)
+  * Fix: Inline extend function in node implementation (#452, @dougwilson)
+  * Docs: Fix typo (#455, @msasad)
+
+2.6.5 / 2017-04-27
+==================
+  
+  * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek)
+  * Misc: clean up browser reference checks (#447, @thebigredgeek)
+  * Misc: add npm-debug.log to .gitignore (@thebigredgeek)
+
+
+2.6.4 / 2017-04-20
+==================
+
+  * Fix: bug that would occure if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo)
+  * Chore: ignore bower.json in npm installations. (#437, @joaovieira)
+  * Misc: update "ms" to v0.7.3 (@tootallnate)
+
+2.6.3 / 2017-03-13
+==================
+
+  * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts)
+  * Docs: Changelog fix (@thebigredgeek)
+
+2.6.2 / 2017-03-10
+==================
+
+  * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin)
+  * Docs: Add backers and sponsors from Open Collective (#422, @piamancini)
+  * Docs: Add Slackin invite badge (@tootallnate)
+
+2.6.1 / 2017-02-10
+==================
+
+  * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error
+  * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0)
+  * Fix: IE8 "Expected identifier" error (#414, @vgoma)
+  * Fix: Namespaces would not disable once enabled (#409, @musikov)
+
+2.6.0 / 2016-12-28
+==================
+
+  * Fix: added better null pointer checks for browser useColors (@thebigredgeek)
+  * Improvement: removed explicit `window.debug` export (#404, @tootallnate)
+  * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate)
+
+2.5.2 / 2016-12-25
+==================
+
+  * Fix: reference error on window within webworkers (#393, @KlausTrainer)
+  * Docs: fixed README typo (#391, @lurch)
+  * Docs: added notice about v3 api discussion (@thebigredgeek)
+
+2.5.1 / 2016-12-20
+==================
+
+  * Fix: babel-core compatibility
+
+2.5.0 / 2016-12-20
+==================
+
+  * Fix: wrong reference in bower file (@thebigredgeek)
+  * Fix: webworker compatibility (@thebigredgeek)
+  * Fix: output formatting issue (#388, @kribblo)
+  * Fix: babel-loader compatibility (#383, @escwald)
+  * Misc: removed built asset from repo and publications (@thebigredgeek)
+  * Misc: moved source files to /src (#378, @yamikuronue)
+  * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue)
+  * Test: coveralls integration (#378, @yamikuronue)
+  * Docs: simplified language in the opening paragraph (#373, @yamikuronue)
+
+2.4.5 / 2016-12-17
+==================
+
+  * Fix: `navigator` undefined in Rhino (#376, @jochenberger)
+  * Fix: custom log function (#379, @hsiliev)
+  * Improvement: bit of cleanup + linting fixes (@thebigredgeek)
+  * Improvement: rm non-maintainted `dist/` dir (#375, @freewil)
+  * Docs: simplified language in the opening paragraph. (#373, @yamikuronue)
+
+2.4.4 / 2016-12-14
+==================
+
+  * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts)
+
+2.4.3 / 2016-12-14
+==================
+
+  * Fix: navigation.userAgent error for react native (#364, @escwald)
+
+2.4.2 / 2016-12-14
+==================
+
+  * Fix: browser colors (#367, @tootallnate)
+  * Misc: travis ci integration (@thebigredgeek)
+  * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek)
+
+2.4.1 / 2016-12-13
+==================
+
+  * Fix: typo that broke the package (#356)
+
+2.4.0 / 2016-12-13
+==================
+
+  * Fix: bower.json references unbuilt src entry point (#342, @justmatt)
+  * Fix: revert "handle regex special characters" (@tootallnate)
+  * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate)
+  * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate)
+  * Improvement: allow colors in workers (#335, @botverse)
+  * Improvement: use same color for same namespace. (#338, @lchenay)
+
+2.3.3 / 2016-11-09
+==================
+
+  * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne)
+  * Fix: Returning `localStorage` saved values (#331, Levi Thomason)
+  * Improvement: Don't create an empty object when no `process` (Nathan Rajlich)
+
+2.3.2 / 2016-11-09
+==================
+
+  * Fix: be super-safe in index.js as well (@TooTallNate)
+  * Fix: should check whether process exists (Tom Newby)
+
+2.3.1 / 2016-11-09
+==================
+
+  * Fix: Added electron compatibility (#324, @paulcbetts)
+  * Improvement: Added performance optimizations (@tootallnate)
+  * Readme: Corrected PowerShell environment variable example (#252, @gimre)
+  * Misc: Removed yarn lock file from source control (#321, @fengmk2)
+
+2.3.0 / 2016-11-07
+==================
+
+  * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic)
+  * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos)
+  * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15)
+  * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran)
+  * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom)
+  * Package: Update "ms" to 0.7.2 (#315, @DevSide)
+  * Package: removed superfluous version property from bower.json (#207 @kkirsche)
+  * Readme: fix USE_COLORS to DEBUG_COLORS
+  * Readme: Doc fixes for format string sugar (#269, @mlucool)
+  * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0)
+  * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable)
+  * Readme: better docs for browser support (#224, @matthewmueller)
+  * Tooling: Added yarn integration for development (#317, @thebigredgeek)
+  * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek)
+  * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman)
+  * Misc: Updated contributors (@thebigredgeek)
+
+2.2.0 / 2015-05-09
+==================
+
+  * package: update "ms" to v0.7.1 (#202, @dougwilson)
+  * README: add logging to file example (#193, @DanielOchoa)
+  * README: fixed a typo (#191, @amir-s)
+  * browser: expose `storage` (#190, @stephenmathieson)
+  * Makefile: add a `distclean` target (#189, @stephenmathieson)
+
+2.1.3 / 2015-03-13
+==================
+
+  * Updated stdout/stderr example (#186)
+  * Updated example/stdout.js to match debug current behaviour
+  * Renamed example/stderr.js to stdout.js
+  * Update Readme.md (#184)
+  * replace high intensity foreground color for bold (#182, #183)
+
+2.1.2 / 2015-03-01
+==================
+
+  * dist: recompile
+  * update "ms" to v0.7.0
+  * package: update "browserify" to v9.0.3
+  * component: fix "ms.js" repo location
+  * changed bower package name
+  * updated documentation about using debug in a browser
+  * fix: security error on safari (#167, #168, @yields)
+
+2.1.1 / 2014-12-29
+==================
+
+  * browser: use `typeof` to check for `console` existence
+  * browser: check for `console.log` truthiness (fix IE 8/9)
+  * browser: add support for Chrome apps
+  * Readme: added Windows usage remarks
+  * Add `bower.json` to properly support bower install
+
+2.1.0 / 2014-10-15
+==================
+
+  * node: implement `DEBUG_FD` env variable support
+  * package: update "browserify" to v6.1.0
+  * package: add "license" field to package.json (#135, @panuhorsmalahti)
+
+2.0.0 / 2014-09-01
+==================
+
+  * package: update "browserify" to v5.11.0
+  * node: use stderr rather than stdout for logging (#29, @stephenmathieson)
+
+1.0.4 / 2014-07-15
+==================
+
+  * dist: recompile
+  * example: remove `console.info()` log usage
+  * example: add "Content-Type" UTF-8 header to browser example
+  * browser: place %c marker after the space character
+  * browser: reset the "content" color via `color: inherit`
+  * browser: add colors support for Firefox >= v31
+  * debug: prefer an instance `log()` function over the global one (#119)
+  * Readme: update documentation about styled console logs for FF v31 (#116, @wryk)
+
+1.0.3 / 2014-07-09
+==================
+
+  * Add support for multiple wildcards in namespaces (#122, @seegno)
+  * browser: fix lint
+
+1.0.2 / 2014-06-10
+==================
+
+  * browser: update color palette (#113, @gscottolson)
+  * common: make console logging function configurable (#108, @timoxley)
+  * node: fix %o colors on old node <= 0.8.x
+  * Makefile: find node path using shell/which (#109, @timoxley)
+
+1.0.1 / 2014-06-06
+==================
+
+  * browser: use `removeItem()` to clear localStorage
+  * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777)
+  * package: add "contributors" section
+  * node: fix comment typo
+  * README: list authors
+
+1.0.0 / 2014-06-04
+==================
+
+  * make ms diff be global, not be scope
+  * debug: ignore empty strings in enable()
+  * node: make DEBUG_COLORS able to disable coloring
+  * *: export the `colors` array
+  * npmignore: don't publish the `dist` dir
+  * Makefile: refactor to use browserify
+  * package: add "browserify" as a dev dependency
+  * Readme: add Web Inspector Colors section
+  * node: reset terminal color for the debug content
+  * node: map "%o" to `util.inspect()`
+  * browser: map "%j" to `JSON.stringify()`
+  * debug: add custom "formatters"
+  * debug: use "ms" module for humanizing the diff
+  * Readme: add "bash" syntax highlighting
+  * browser: add Firebug color support
+  * browser: add colors for WebKit browsers
+  * node: apply log to `console`
+  * rewrite: abstract common logic for Node & browsers
+  * add .jshintrc file
+
+0.8.1 / 2014-04-14
+==================
+
+  * package: re-add the "component" section
+
+0.8.0 / 2014-03-30
+==================
+
+  * add `enable()` method for nodejs. Closes #27
+  * change from stderr to stdout
+  * remove unnecessary index.js file
+
+0.7.4 / 2013-11-13
+==================
+
+  * remove "browserify" key from package.json (fixes something in browserify)
+
+0.7.3 / 2013-10-30
+==================
+
+  * fix: catch localStorage security error when cookies are blocked (Chrome)
+  * add debug(err) support. Closes #46
+  * add .browser prop to package.json. Closes #42
+
+0.7.2 / 2013-02-06
+==================
+
+  * fix package.json
+  * fix: Mobile Safari (private mode) is broken with debug
+  * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript
+
+0.7.1 / 2013-02-05
+==================
+
+  * add repository URL to package.json
+  * add DEBUG_COLORED to force colored output
+  * add browserify support
+  * fix component. Closes #24
+
+0.7.0 / 2012-05-04
+==================
+
+  * Added .component to package.json
+  * Added debug.component.js build
+
+0.6.0 / 2012-03-16
+==================
+
+  * Added support for "-" prefix in DEBUG [Vinay Pulim]
+  * Added `.enabled` flag to the node version [TooTallNate]
+
+0.5.0 / 2012-02-02
+==================
+
+  * Added: humanize diffs. Closes #8
+  * Added `debug.disable()` to the CS variant
+  * Removed padding. Closes #10
+  * Fixed: persist client-side variant again. Closes #9
+
+0.4.0 / 2012-02-01
+==================
+
+  * Added browser variant support for older browsers [TooTallNate]
+  * Added `debug.enable('project:*')` to browser variant [TooTallNate]
+  * Added padding to diff (moved it to the right)
+
+0.3.0 / 2012-01-26
+==================
+
+  * Added millisecond diff when isatty, otherwise UTC string
+
+0.2.0 / 2012-01-22
+==================
+
+  * Added wildcard support
+
+0.1.0 / 2011-12-02
+==================
+
+  * Added: remove colors unless stderr isatty [TooTallNate]
+
+0.0.1 / 2010-01-03
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/socket.io-client/node_modules/debug/LICENSE b/wrt/node_modules/socket.io-client/node_modules/debug/LICENSE
new file mode 100644 (file)
index 0000000..658c933
--- /dev/null
@@ -0,0 +1,19 @@
+(The MIT License)
+
+Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software 
+and associated documentation files (the 'Software'), to deal in the Software without restriction, 
+including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial 
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 
+LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/wrt/node_modules/socket.io-client/node_modules/debug/Makefile b/wrt/node_modules/socket.io-client/node_modules/debug/Makefile
new file mode 100644 (file)
index 0000000..584da8b
--- /dev/null
@@ -0,0 +1,50 @@
+# get Makefile directory name: http://stackoverflow.com/a/5982798/376773
+THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
+THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)
+
+# BIN directory
+BIN := $(THIS_DIR)/node_modules/.bin
+
+# Path
+PATH := node_modules/.bin:$(PATH)
+SHELL := /bin/bash
+
+# applications
+NODE ?= $(shell which node)
+YARN ?= $(shell which yarn)
+PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm))
+BROWSERIFY ?= $(NODE) $(BIN)/browserify
+
+.FORCE:
+
+install: node_modules
+
+node_modules: package.json
+       @NODE_ENV= $(PKG) install
+       @touch node_modules
+
+lint: .FORCE
+       eslint browser.js debug.js index.js node.js
+
+test-node: .FORCE
+       istanbul cover node_modules/mocha/bin/_mocha -- test/**.js
+
+test-browser: .FORCE
+       mkdir -p dist
+
+       @$(BROWSERIFY) \
+               --standalone debug \
+               . > dist/debug.js
+
+       karma start --single-run
+       rimraf dist
+
+test: .FORCE
+       concurrently \
+               "make test-node" \
+               "make test-browser"
+
+coveralls:
+       cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
+
+.PHONY: all install clean distclean
diff --git a/wrt/node_modules/socket.io-client/node_modules/debug/README.md b/wrt/node_modules/socket.io-client/node_modules/debug/README.md
new file mode 100644 (file)
index 0000000..f67be6b
--- /dev/null
@@ -0,0 +1,312 @@
+# debug
+[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug)  [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master)  [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) 
+[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors)
+
+
+
+A tiny node.js debugging utility modelled after node core's debugging technique.
+
+**Discussion around the V3 API is under way [here](https://github.com/visionmedia/debug/issues/370)**
+
+## Installation
+
+```bash
+$ npm install debug
+```
+
+## Usage
+
+`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole.
+
+Example _app.js_:
+
+```js
+var debug = require('debug')('http')
+  , http = require('http')
+  , name = 'My App';
+
+// fake app
+
+debug('booting %s', name);
+
+http.createServer(function(req, res){
+  debug(req.method + ' ' + req.url);
+  res.end('hello\n');
+}).listen(3000, function(){
+  debug('listening');
+});
+
+// fake worker of some kind
+
+require('./worker');
+```
+
+Example _worker.js_:
+
+```js
+var debug = require('debug')('worker');
+
+setInterval(function(){
+  debug('doing some work');
+}, 1000);
+```
+
+ The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:
+
+  ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png)
+
+  ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png)
+
+#### Windows note
+
+ On Windows the environment variable is set using the `set` command.
+
+ ```cmd
+ set DEBUG=*,-not_this
+ ```
+
+ Note that PowerShell uses different syntax to set environment variables.
+
+ ```cmd
+ $env:DEBUG = "*,-not_this"
+  ```
+
+Then, run the program to be debugged as usual.
+
+## Millisecond diff
+
+  When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.
+
+  ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png)
+
+  When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:
+
+  ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png)
+
+## Conventions
+
+  If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser".
+
+## Wildcards
+
+  The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.
+
+  You can also exclude specific debuggers by prefixing them with a "-" character.  For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:".
+
+## Environment Variables
+
+  When running through Node.js, you can set a few environment variables that will
+  change the behavior of the debug logging:
+
+| Name      | Purpose                                         |
+|-----------|-------------------------------------------------|
+| `DEBUG`   | Enables/disables specific debugging namespaces. |
+| `DEBUG_COLORS`| Whether or not to use colors in the debug output. |
+| `DEBUG_DEPTH` | Object inspection depth. |
+| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. |
+
+
+  __Note:__ The environment variables beginning with `DEBUG_` end up being
+  converted into an Options object that gets used with `%o`/`%O` formatters.
+  See the Node.js documentation for
+  [`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options)
+  for the complete list.
+
+## Formatters
+
+
+  Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. Below are the officially supported formatters:
+
+| Formatter | Representation |
+|-----------|----------------|
+| `%O`      | Pretty-print an Object on multiple lines. |
+| `%o`      | Pretty-print an Object all on a single line. |
+| `%s`      | String. |
+| `%d`      | Number (both integer and float). |
+| `%j`      | JSON. Replaced with the string '[Circular]' if the argument contains circular references. |
+| `%%`      | Single percent sign ('%'). This does not consume an argument. |
+
+### Custom formatters
+
+  You can add custom formatters by extending the `debug.formatters` object. For example, if you wanted to add support for rendering a Buffer as hex with `%h`, you could do something like:
+
+```js
+const createDebug = require('debug')
+createDebug.formatters.h = (v) => {
+  return v.toString('hex')
+}
+
+// …elsewhere
+const debug = createDebug('foo')
+debug('this is hex: %h', new Buffer('hello world'))
+//   foo this is hex: 68656c6c6f20776f726c6421 +0ms
+```
+
+## Browser support
+  You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify),
+  or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest),
+  if you don't want to build it yourself.
+
+  Debug's enable state is currently persisted by `localStorage`.
+  Consider the situation shown below where you have `worker:a` and `worker:b`,
+  and wish to debug both. You can enable this using `localStorage.debug`:
+
+```js
+localStorage.debug = 'worker:*'
+```
+
+And then refresh the page.
+
+```js
+a = debug('worker:a');
+b = debug('worker:b');
+
+setInterval(function(){
+  a('doing some work');
+}, 1000);
+
+setInterval(function(){
+  b('doing some work');
+}, 1200);
+```
+
+#### Web Inspector Colors
+
+  Colors are also enabled on "Web Inspectors" that understand the `%c` formatting
+  option. These are WebKit web inspectors, Firefox ([since version
+  31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))
+  and the Firebug plugin for Firefox (any version).
+
+  Colored output looks something like:
+
+  ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png)
+
+
+## Output streams
+
+  By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method:
+
+Example _stdout.js_:
+
+```js
+var debug = require('debug');
+var error = debug('app:error');
+
+// by default stderr is used
+error('goes to stderr!');
+
+var log = debug('app:log');
+// set this namespace to log via console.log
+log.log = console.log.bind(console); // don't forget to bind to console!
+log('goes to stdout');
+error('still goes to stderr!');
+
+// set all output to go via console.info
+// overrides all per-namespace log settings
+debug.log = console.info.bind(console);
+error('now goes to stdout via console.info');
+log('still goes to stdout, but via console.info now');
+```
+
+
+## Authors
+
+ - TJ Holowaychuk
+ - Nathan Rajlich
+ - Andrew Rhyne
+## Backers
+
+Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)]
+
+<a href="https://opencollective.com/debug/backer/0/website" target="_blank"><img src="https://opencollective.com/debug/backer/0/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/1/website" target="_blank"><img src="https://opencollective.com/debug/backer/1/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/2/website" target="_blank"><img src="https://opencollective.com/debug/backer/2/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/3/website" target="_blank"><img src="https://opencollective.com/debug/backer/3/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/4/website" target="_blank"><img src="https://opencollective.com/debug/backer/4/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/5/website" target="_blank"><img src="https://opencollective.com/debug/backer/5/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/6/website" target="_blank"><img src="https://opencollective.com/debug/backer/6/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/7/website" target="_blank"><img src="https://opencollective.com/debug/backer/7/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/8/website" target="_blank"><img src="https://opencollective.com/debug/backer/8/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/9/website" target="_blank"><img src="https://opencollective.com/debug/backer/9/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/10/website" target="_blank"><img src="https://opencollective.com/debug/backer/10/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/11/website" target="_blank"><img src="https://opencollective.com/debug/backer/11/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/12/website" target="_blank"><img src="https://opencollective.com/debug/backer/12/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/13/website" target="_blank"><img src="https://opencollective.com/debug/backer/13/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/14/website" target="_blank"><img src="https://opencollective.com/debug/backer/14/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/15/website" target="_blank"><img src="https://opencollective.com/debug/backer/15/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/16/website" target="_blank"><img src="https://opencollective.com/debug/backer/16/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/17/website" target="_blank"><img src="https://opencollective.com/debug/backer/17/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/18/website" target="_blank"><img src="https://opencollective.com/debug/backer/18/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/19/website" target="_blank"><img src="https://opencollective.com/debug/backer/19/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/20/website" target="_blank"><img src="https://opencollective.com/debug/backer/20/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/21/website" target="_blank"><img src="https://opencollective.com/debug/backer/21/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/22/website" target="_blank"><img src="https://opencollective.com/debug/backer/22/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/23/website" target="_blank"><img src="https://opencollective.com/debug/backer/23/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/24/website" target="_blank"><img src="https://opencollective.com/debug/backer/24/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/25/website" target="_blank"><img src="https://opencollective.com/debug/backer/25/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/26/website" target="_blank"><img src="https://opencollective.com/debug/backer/26/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/27/website" target="_blank"><img src="https://opencollective.com/debug/backer/27/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/28/website" target="_blank"><img src="https://opencollective.com/debug/backer/28/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/29/website" target="_blank"><img src="https://opencollective.com/debug/backer/29/avatar.svg"></a>
+
+
+## Sponsors
+
+Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)]
+
+<a href="https://opencollective.com/debug/sponsor/0/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/0/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/1/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/1/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/2/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/2/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/3/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/3/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/4/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/4/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/5/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/5/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/6/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/6/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/7/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/7/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/8/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/8/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/9/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/9/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/10/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/10/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/11/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/11/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/12/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/12/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/13/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/13/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/14/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/14/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/15/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/15/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/16/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/16/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/17/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/17/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/18/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/18/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/19/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/19/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/20/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/20/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/21/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/21/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/22/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/22/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/23/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/23/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/24/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/24/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/25/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/25/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/26/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/26/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/27/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/27/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/28/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/28/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/29/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/29/avatar.svg"></a>
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2014-2016 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/socket.io-client/node_modules/debug/component.json b/wrt/node_modules/socket.io-client/node_modules/debug/component.json
new file mode 100644 (file)
index 0000000..9de2641
--- /dev/null
@@ -0,0 +1,19 @@
+{
+  "name": "debug",
+  "repo": "visionmedia/debug",
+  "description": "small debugging utility",
+  "version": "2.6.9",
+  "keywords": [
+    "debug",
+    "log",
+    "debugger"
+  ],
+  "main": "src/browser.js",
+  "scripts": [
+    "src/browser.js",
+    "src/debug.js"
+  ],
+  "dependencies": {
+    "rauchg/ms.js": "0.7.1"
+  }
+}
diff --git a/wrt/node_modules/socket.io-client/node_modules/debug/karma.conf.js b/wrt/node_modules/socket.io-client/node_modules/debug/karma.conf.js
new file mode 100644 (file)
index 0000000..103a82d
--- /dev/null
@@ -0,0 +1,70 @@
+// Karma configuration
+// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC)
+
+module.exports = function(config) {
+  config.set({
+
+    // base path that will be used to resolve all patterns (eg. files, exclude)
+    basePath: '',
+
+
+    // frameworks to use
+    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
+    frameworks: ['mocha', 'chai', 'sinon'],
+
+
+    // list of files / patterns to load in the browser
+    files: [
+      'dist/debug.js',
+      'test/*spec.js'
+    ],
+
+
+    // list of files to exclude
+    exclude: [
+      'src/node.js'
+    ],
+
+
+    // preprocess matching files before serving them to the browser
+    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
+    preprocessors: {
+    },
+
+    // test results reporter to use
+    // possible values: 'dots', 'progress'
+    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
+    reporters: ['progress'],
+
+
+    // web server port
+    port: 9876,
+
+
+    // enable / disable colors in the output (reporters and logs)
+    colors: true,
+
+
+    // level of logging
+    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
+    logLevel: config.LOG_INFO,
+
+
+    // enable / disable watching file and executing tests whenever any file changes
+    autoWatch: true,
+
+
+    // start these browsers
+    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
+    browsers: ['PhantomJS'],
+
+
+    // Continuous Integration mode
+    // if true, Karma captures browsers, runs the tests and exits
+    singleRun: false,
+
+    // Concurrency level
+    // how many browser should be started simultaneous
+    concurrency: Infinity
+  })
+}
diff --git a/wrt/node_modules/socket.io-client/node_modules/debug/node.js b/wrt/node_modules/socket.io-client/node_modules/debug/node.js
new file mode 100644 (file)
index 0000000..7fc36fe
--- /dev/null
@@ -0,0 +1 @@
+module.exports = require('./src/node');
diff --git a/wrt/node_modules/socket.io-client/node_modules/debug/package.json b/wrt/node_modules/socket.io-client/node_modules/debug/package.json
new file mode 100644 (file)
index 0000000..0138b70
--- /dev/null
@@ -0,0 +1,148 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "debug@~2.6.6",
+        "scope": null,
+        "escapedName": "debug",
+        "name": "debug",
+        "rawSpec": "~2.6.6",
+        "spec": ">=2.6.6 <2.7.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io"
+    ],
+    [
+      {
+        "raw": "debug@~2.6.4",
+        "scope": null,
+        "escapedName": "debug",
+        "name": "debug",
+        "rawSpec": "~2.6.4",
+        "spec": ">=2.6.4 <2.7.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io-client"
+    ]
+  ],
+  "_from": "debug@~2.6.4",
+  "_id": "debug@2.6.9",
+  "_inCache": true,
+  "_location": "/socket.io-client/debug",
+  "_nodeVersion": "8.4.0",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/debug-2.6.9.tgz_1506087154503_0.5196126794908196"
+  },
+  "_npmUser": {
+    "name": "tootallnate",
+    "email": "nathan@tootallnate.net"
+  },
+  "_npmVersion": "5.3.0",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "debug@~2.6.4",
+    "scope": null,
+    "escapedName": "debug",
+    "name": "debug",
+    "rawSpec": "~2.6.4",
+    "spec": ">=2.6.4 <2.7.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/socket.io-client"
+  ],
+  "_resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+  "_shasum": "5d128515df134ff327e90a4c93f4e077a536341f",
+  "_shrinkwrap": null,
+  "_spec": "debug@~2.6.4",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io-client",
+  "author": {
+    "name": "TJ Holowaychuk",
+    "email": "tj@vision-media.ca"
+  },
+  "browser": "./src/browser.js",
+  "bugs": {
+    "url": "https://github.com/visionmedia/debug/issues"
+  },
+  "component": {
+    "scripts": {
+      "debug/index.js": "browser.js",
+      "debug/debug.js": "debug.js"
+    }
+  },
+  "contributors": [
+    {
+      "name": "Nathan Rajlich",
+      "email": "nathan@tootallnate.net",
+      "url": "http://n8.io"
+    },
+    {
+      "name": "Andrew Rhyne",
+      "email": "rhyneandrew@gmail.com"
+    }
+  ],
+  "dependencies": {
+    "ms": "2.0.0"
+  },
+  "description": "small debugging utility",
+  "devDependencies": {
+    "browserify": "9.0.3",
+    "chai": "^3.5.0",
+    "concurrently": "^3.1.0",
+    "coveralls": "^2.11.15",
+    "eslint": "^3.12.1",
+    "istanbul": "^0.4.5",
+    "karma": "^1.3.0",
+    "karma-chai": "^0.1.0",
+    "karma-mocha": "^1.3.0",
+    "karma-phantomjs-launcher": "^1.0.2",
+    "karma-sinon": "^1.0.5",
+    "mocha": "^3.2.0",
+    "mocha-lcov-reporter": "^1.2.0",
+    "rimraf": "^2.5.4",
+    "sinon": "^1.17.6",
+    "sinon-chai": "^2.8.0"
+  },
+  "directories": {},
+  "dist": {
+    "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+    "shasum": "5d128515df134ff327e90a4c93f4e077a536341f",
+    "tarball": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz"
+  },
+  "gitHead": "13abeae468fea297d0dccc50bc55590809241083",
+  "homepage": "https://github.com/visionmedia/debug#readme",
+  "keywords": [
+    "debug",
+    "log",
+    "debugger"
+  ],
+  "license": "MIT",
+  "main": "./src/index.js",
+  "maintainers": [
+    {
+      "name": "thebigredgeek",
+      "email": "rhyneandrew@gmail.com"
+    },
+    {
+      "name": "kolban",
+      "email": "kolban1@kolban.com"
+    },
+    {
+      "name": "tootallnate",
+      "email": "nathan@tootallnate.net"
+    },
+    {
+      "name": "tjholowaychuk",
+      "email": "tj@vision-media.ca"
+    }
+  ],
+  "name": "debug",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/visionmedia/debug.git"
+  },
+  "version": "2.6.9"
+}
diff --git a/wrt/node_modules/socket.io-client/node_modules/debug/src/browser.js b/wrt/node_modules/socket.io-client/node_modules/debug/src/browser.js
new file mode 100644 (file)
index 0000000..7106924
--- /dev/null
@@ -0,0 +1,185 @@
+/**
+ * This is the web browser implementation of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = require('./debug');
+exports.log = log;
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+exports.storage = 'undefined' != typeof chrome
+               && 'undefined' != typeof chrome.storage
+                  ? chrome.storage.local
+                  : localstorage();
+
+/**
+ * Colors.
+ */
+
+exports.colors = [
+  'lightseagreen',
+  'forestgreen',
+  'goldenrod',
+  'dodgerblue',
+  'darkorchid',
+  'crimson'
+];
+
+/**
+ * Currently only WebKit-based Web Inspectors, Firefox >= v31,
+ * and the Firebug extension (any Firefox version) are known
+ * to support "%c" CSS customizations.
+ *
+ * TODO: add a `localStorage` variable to explicitly enable/disable colors
+ */
+
+function useColors() {
+  // NB: In an Electron preload script, document will be defined but not fully
+  // initialized. Since we know we're in Chrome, we'll just detect this case
+  // explicitly
+  if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
+    return true;
+  }
+
+  // is webkit? http://stackoverflow.com/a/16459606/376773
+  // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
+  return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
+    // is firebug? http://stackoverflow.com/a/398120/376773
+    (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
+    // is firefox >= v31?
+    // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
+    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
+    // double check webkit in userAgent just in case we are in a worker
+    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
+}
+
+/**
+ * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
+ */
+
+exports.formatters.j = function(v) {
+  try {
+    return JSON.stringify(v);
+  } catch (err) {
+    return '[UnexpectedJSONParseError]: ' + err.message;
+  }
+};
+
+
+/**
+ * Colorize log arguments if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+  var useColors = this.useColors;
+
+  args[0] = (useColors ? '%c' : '')
+    + this.namespace
+    + (useColors ? ' %c' : ' ')
+    + args[0]
+    + (useColors ? '%c ' : ' ')
+    + '+' + exports.humanize(this.diff);
+
+  if (!useColors) return;
+
+  var c = 'color: ' + this.color;
+  args.splice(1, 0, c, 'color: inherit')
+
+  // the final "%c" is somewhat tricky, because there could be other
+  // arguments passed either before or after the %c, so we need to
+  // figure out the correct index to insert the CSS into
+  var index = 0;
+  var lastC = 0;
+  args[0].replace(/%[a-zA-Z%]/g, function(match) {
+    if ('%%' === match) return;
+    index++;
+    if ('%c' === match) {
+      // we only are interested in the *last* %c
+      // (the user may have provided their own)
+      lastC = index;
+    }
+  });
+
+  args.splice(lastC, 0, c);
+}
+
+/**
+ * Invokes `console.log()` when available.
+ * No-op when `console.log` is not a "function".
+ *
+ * @api public
+ */
+
+function log() {
+  // this hackery is required for IE8/9, where
+  // the `console.log` function doesn't have 'apply'
+  return 'object' === typeof console
+    && console.log
+    && Function.prototype.apply.call(console.log, console, arguments);
+}
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+
+function save(namespaces) {
+  try {
+    if (null == namespaces) {
+      exports.storage.removeItem('debug');
+    } else {
+      exports.storage.debug = namespaces;
+    }
+  } catch(e) {}
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+
+function load() {
+  var r;
+  try {
+    r = exports.storage.debug;
+  } catch(e) {}
+
+  // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
+  if (!r && typeof process !== 'undefined' && 'env' in process) {
+    r = process.env.DEBUG;
+  }
+
+  return r;
+}
+
+/**
+ * Enable namespaces listed in `localStorage.debug` initially.
+ */
+
+exports.enable(load());
+
+/**
+ * Localstorage attempts to return the localstorage.
+ *
+ * This is necessary because safari throws
+ * when a user disables cookies/localstorage
+ * and you attempt to access it.
+ *
+ * @return {LocalStorage}
+ * @api private
+ */
+
+function localstorage() {
+  try {
+    return window.localStorage;
+  } catch (e) {}
+}
diff --git a/wrt/node_modules/socket.io-client/node_modules/debug/src/debug.js b/wrt/node_modules/socket.io-client/node_modules/debug/src/debug.js
new file mode 100644 (file)
index 0000000..6a5e3fc
--- /dev/null
@@ -0,0 +1,202 @@
+
+/**
+ * This is the common logic for both the Node.js and web browser
+ * implementations of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
+exports.coerce = coerce;
+exports.disable = disable;
+exports.enable = enable;
+exports.enabled = enabled;
+exports.humanize = require('ms');
+
+/**
+ * The currently active debug mode names, and names to skip.
+ */
+
+exports.names = [];
+exports.skips = [];
+
+/**
+ * Map of special "%n" handling functions, for the debug "format" argument.
+ *
+ * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
+ */
+
+exports.formatters = {};
+
+/**
+ * Previous log timestamp.
+ */
+
+var prevTime;
+
+/**
+ * Select a color.
+ * @param {String} namespace
+ * @return {Number}
+ * @api private
+ */
+
+function selectColor(namespace) {
+  var hash = 0, i;
+
+  for (i in namespace) {
+    hash  = ((hash << 5) - hash) + namespace.charCodeAt(i);
+    hash |= 0; // Convert to 32bit integer
+  }
+
+  return exports.colors[Math.abs(hash) % exports.colors.length];
+}
+
+/**
+ * Create a debugger with the given `namespace`.
+ *
+ * @param {String} namespace
+ * @return {Function}
+ * @api public
+ */
+
+function createDebug(namespace) {
+
+  function debug() {
+    // disabled?
+    if (!debug.enabled) return;
+
+    var self = debug;
+
+    // set `diff` timestamp
+    var curr = +new Date();
+    var ms = curr - (prevTime || curr);
+    self.diff = ms;
+    self.prev = prevTime;
+    self.curr = curr;
+    prevTime = curr;
+
+    // turn the `arguments` into a proper Array
+    var args = new Array(arguments.length);
+    for (var i = 0; i < args.length; i++) {
+      args[i] = arguments[i];
+    }
+
+    args[0] = exports.coerce(args[0]);
+
+    if ('string' !== typeof args[0]) {
+      // anything else let's inspect with %O
+      args.unshift('%O');
+    }
+
+    // apply any `formatters` transformations
+    var index = 0;
+    args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
+      // if we encounter an escaped % then don't increase the array index
+      if (match === '%%') return match;
+      index++;
+      var formatter = exports.formatters[format];
+      if ('function' === typeof formatter) {
+        var val = args[index];
+        match = formatter.call(self, val);
+
+        // now we need to remove `args[index]` since it's inlined in the `format`
+        args.splice(index, 1);
+        index--;
+      }
+      return match;
+    });
+
+    // apply env-specific formatting (colors, etc.)
+    exports.formatArgs.call(self, args);
+
+    var logFn = debug.log || exports.log || console.log.bind(console);
+    logFn.apply(self, args);
+  }
+
+  debug.namespace = namespace;
+  debug.enabled = exports.enabled(namespace);
+  debug.useColors = exports.useColors();
+  debug.color = selectColor(namespace);
+
+  // env-specific initialization logic for debug instances
+  if ('function' === typeof exports.init) {
+    exports.init(debug);
+  }
+
+  return debug;
+}
+
+/**
+ * Enables a debug mode by namespaces. This can include modes
+ * separated by a colon and wildcards.
+ *
+ * @param {String} namespaces
+ * @api public
+ */
+
+function enable(namespaces) {
+  exports.save(namespaces);
+
+  exports.names = [];
+  exports.skips = [];
+
+  var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
+  var len = split.length;
+
+  for (var i = 0; i < len; i++) {
+    if (!split[i]) continue; // ignore empty strings
+    namespaces = split[i].replace(/\*/g, '.*?');
+    if (namespaces[0] === '-') {
+      exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
+    } else {
+      exports.names.push(new RegExp('^' + namespaces + '$'));
+    }
+  }
+}
+
+/**
+ * Disable debug output.
+ *
+ * @api public
+ */
+
+function disable() {
+  exports.enable('');
+}
+
+/**
+ * Returns true if the given mode name is enabled, false otherwise.
+ *
+ * @param {String} name
+ * @return {Boolean}
+ * @api public
+ */
+
+function enabled(name) {
+  var i, len;
+  for (i = 0, len = exports.skips.length; i < len; i++) {
+    if (exports.skips[i].test(name)) {
+      return false;
+    }
+  }
+  for (i = 0, len = exports.names.length; i < len; i++) {
+    if (exports.names[i].test(name)) {
+      return true;
+    }
+  }
+  return false;
+}
+
+/**
+ * Coerce `val`.
+ *
+ * @param {Mixed} val
+ * @return {Mixed}
+ * @api private
+ */
+
+function coerce(val) {
+  if (val instanceof Error) return val.stack || val.message;
+  return val;
+}
diff --git a/wrt/node_modules/socket.io-client/node_modules/debug/src/index.js b/wrt/node_modules/socket.io-client/node_modules/debug/src/index.js
new file mode 100644 (file)
index 0000000..e12cf4d
--- /dev/null
@@ -0,0 +1,10 @@
+/**
+ * Detect Electron renderer process, which is node, but we should
+ * treat as a browser.
+ */
+
+if (typeof process !== 'undefined' && process.type === 'renderer') {
+  module.exports = require('./browser.js');
+} else {
+  module.exports = require('./node.js');
+}
diff --git a/wrt/node_modules/socket.io-client/node_modules/debug/src/inspector-log.js b/wrt/node_modules/socket.io-client/node_modules/debug/src/inspector-log.js
new file mode 100644 (file)
index 0000000..60ea6c0
--- /dev/null
@@ -0,0 +1,15 @@
+module.exports = inspectorLog;
+
+// black hole
+const nullStream = new (require('stream').Writable)();
+nullStream._write = () => {};
+
+/**
+ * Outputs a `console.log()` to the Node.js Inspector console *only*.
+ */
+function inspectorLog() {
+  const stdout = console._stdout;
+  console._stdout = nullStream;
+  console.log.apply(console, arguments);
+  console._stdout = stdout;
+}
diff --git a/wrt/node_modules/socket.io-client/node_modules/debug/src/node.js b/wrt/node_modules/socket.io-client/node_modules/debug/src/node.js
new file mode 100644 (file)
index 0000000..b15109c
--- /dev/null
@@ -0,0 +1,248 @@
+/**
+ * Module dependencies.
+ */
+
+var tty = require('tty');
+var util = require('util');
+
+/**
+ * This is the Node.js implementation of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = require('./debug');
+exports.init = init;
+exports.log = log;
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+
+/**
+ * Colors.
+ */
+
+exports.colors = [6, 2, 3, 4, 5, 1];
+
+/**
+ * Build up the default `inspectOpts` object from the environment variables.
+ *
+ *   $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
+ */
+
+exports.inspectOpts = Object.keys(process.env).filter(function (key) {
+  return /^debug_/i.test(key);
+}).reduce(function (obj, key) {
+  // camel-case
+  var prop = key
+    .substring(6)
+    .toLowerCase()
+    .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });
+
+  // coerce string value into JS value
+  var val = process.env[key];
+  if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
+  else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
+  else if (val === 'null') val = null;
+  else val = Number(val);
+
+  obj[prop] = val;
+  return obj;
+}, {});
+
+/**
+ * The file descriptor to write the `debug()` calls to.
+ * Set the `DEBUG_FD` env variable to override with another value. i.e.:
+ *
+ *   $ DEBUG_FD=3 node script.js 3>debug.log
+ */
+
+var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
+
+if (1 !== fd && 2 !== fd) {
+  util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')()
+}
+
+var stream = 1 === fd ? process.stdout :
+             2 === fd ? process.stderr :
+             createWritableStdioStream(fd);
+
+/**
+ * Is stdout a TTY? Colored output is enabled when `true`.
+ */
+
+function useColors() {
+  return 'colors' in exports.inspectOpts
+    ? Boolean(exports.inspectOpts.colors)
+    : tty.isatty(fd);
+}
+
+/**
+ * Map %o to `util.inspect()`, all on a single line.
+ */
+
+exports.formatters.o = function(v) {
+  this.inspectOpts.colors = this.useColors;
+  return util.inspect(v, this.inspectOpts)
+    .split('\n').map(function(str) {
+      return str.trim()
+    }).join(' ');
+};
+
+/**
+ * Map %o to `util.inspect()`, allowing multiple lines if needed.
+ */
+
+exports.formatters.O = function(v) {
+  this.inspectOpts.colors = this.useColors;
+  return util.inspect(v, this.inspectOpts);
+};
+
+/**
+ * Adds ANSI color escape codes if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+  var name = this.namespace;
+  var useColors = this.useColors;
+
+  if (useColors) {
+    var c = this.color;
+    var prefix = '  \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m';
+
+    args[0] = prefix + args[0].split('\n').join('\n' + prefix);
+    args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m');
+  } else {
+    args[0] = new Date().toUTCString()
+      + ' ' + name + ' ' + args[0];
+  }
+}
+
+/**
+ * Invokes `util.format()` with the specified arguments and writes to `stream`.
+ */
+
+function log() {
+  return stream.write(util.format.apply(util, arguments) + '\n');
+}
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+
+function save(namespaces) {
+  if (null == namespaces) {
+    // If you set a process.env field to null or undefined, it gets cast to the
+    // string 'null' or 'undefined'. Just delete instead.
+    delete process.env.DEBUG;
+  } else {
+    process.env.DEBUG = namespaces;
+  }
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+
+function load() {
+  return process.env.DEBUG;
+}
+
+/**
+ * Copied from `node/src/node.js`.
+ *
+ * XXX: It's lame that node doesn't expose this API out-of-the-box. It also
+ * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.
+ */
+
+function createWritableStdioStream (fd) {
+  var stream;
+  var tty_wrap = process.binding('tty_wrap');
+
+  // Note stream._type is used for test-module-load-list.js
+
+  switch (tty_wrap.guessHandleType(fd)) {
+    case 'TTY':
+      stream = new tty.WriteStream(fd);
+      stream._type = 'tty';
+
+      // Hack to have stream not keep the event loop alive.
+      // See https://github.com/joyent/node/issues/1726
+      if (stream._handle && stream._handle.unref) {
+        stream._handle.unref();
+      }
+      break;
+
+    case 'FILE':
+      var fs = require('fs');
+      stream = new fs.SyncWriteStream(fd, { autoClose: false });
+      stream._type = 'fs';
+      break;
+
+    case 'PIPE':
+    case 'TCP':
+      var net = require('net');
+      stream = new net.Socket({
+        fd: fd,
+        readable: false,
+        writable: true
+      });
+
+      // FIXME Should probably have an option in net.Socket to create a
+      // stream from an existing fd which is writable only. But for now
+      // we'll just add this hack and set the `readable` member to false.
+      // Test: ./node test/fixtures/echo.js < /etc/passwd
+      stream.readable = false;
+      stream.read = null;
+      stream._type = 'pipe';
+
+      // FIXME Hack to have stream not keep the event loop alive.
+      // See https://github.com/joyent/node/issues/1726
+      if (stream._handle && stream._handle.unref) {
+        stream._handle.unref();
+      }
+      break;
+
+    default:
+      // Probably an error on in uv_guess_handle()
+      throw new Error('Implement me. Unknown stream file type!');
+  }
+
+  // For supporting legacy API we put the FD here.
+  stream.fd = fd;
+
+  stream._isStdio = true;
+
+  return stream;
+}
+
+/**
+ * Init logic for `debug` instances.
+ *
+ * Create a new `inspectOpts` object in case `useColors` is set
+ * differently for a particular `debug` instance.
+ */
+
+function init (debug) {
+  debug.inspectOpts = {};
+
+  var keys = Object.keys(exports.inspectOpts);
+  for (var i = 0; i < keys.length; i++) {
+    debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
+  }
+}
+
+/**
+ * Enable namespaces listed in `process.env.DEBUG` initially.
+ */
+
+exports.enable(load());
diff --git a/wrt/node_modules/socket.io-client/package.json b/wrt/node_modules/socket.io-client/package.json
new file mode 100644 (file)
index 0000000..b7e911b
--- /dev/null
@@ -0,0 +1,156 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "socket.io-client@~2.0.2",
+        "scope": null,
+        "escapedName": "socket.io-client",
+        "name": "socket.io-client",
+        "rawSpec": "~2.0.2",
+        "spec": ">=2.0.2 <2.1.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io"
+    ]
+  ],
+  "_from": "socket.io-client@>=2.0.2 <2.1.0",
+  "_id": "socket.io-client@2.0.3",
+  "_inCache": true,
+  "_location": "/socket.io-client",
+  "_nodeVersion": "6.9.4",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/socket.io-client-2.0.3.tgz_1497269241170_0.7307047063950449"
+  },
+  "_npmUser": {
+    "name": "darrachequesne",
+    "email": "damien.arrachequesne@gmail.com"
+  },
+  "_npmVersion": "3.10.10",
+  "_phantomChildren": {
+    "ms": "2.0.0"
+  },
+  "_requested": {
+    "raw": "socket.io-client@~2.0.2",
+    "scope": null,
+    "escapedName": "socket.io-client",
+    "name": "socket.io-client",
+    "rawSpec": "~2.0.2",
+    "spec": ">=2.0.2 <2.1.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/socket.io"
+  ],
+  "_resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.0.3.tgz",
+  "_shasum": "6caf4aff9f85b19fd91b6ce13d69adb564f8873b",
+  "_shrinkwrap": null,
+  "_spec": "socket.io-client@~2.0.2",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io",
+  "bugs": {
+    "url": "https://github.com/Automattic/socket.io-client/issues"
+  },
+  "contributors": [
+    {
+      "name": "Guillermo Rauch",
+      "email": "rauchg@gmail.com"
+    },
+    {
+      "name": "Arnout Kazemier",
+      "email": "info@3rd-eden.com"
+    },
+    {
+      "name": "Vladimir Dronnikov",
+      "email": "dronnikov@gmail.com"
+    },
+    {
+      "name": "Einar Otto Stangvik",
+      "email": "einaros@gmail.com"
+    }
+  ],
+  "dependencies": {
+    "backo2": "1.0.2",
+    "base64-arraybuffer": "0.1.5",
+    "component-bind": "1.0.0",
+    "component-emitter": "1.2.1",
+    "debug": "~2.6.4",
+    "engine.io-client": "~3.1.0",
+    "has-cors": "1.1.0",
+    "indexof": "0.0.1",
+    "object-component": "0.0.3",
+    "parseqs": "0.0.5",
+    "parseuri": "0.0.5",
+    "socket.io-parser": "~3.1.1",
+    "to-array": "0.1.4"
+  },
+  "description": "[![Build Status](https://secure.travis-ci.org/socketio/socket.io-client.svg?branch=master)](http://travis-ci.org/socketio/socket.io-client) [![Dependency Status](https://david-dm.org/socketio/socket.io-client.svg)](https://david-dm.org/socketio/socket.io-",
+  "devDependencies": {
+    "babel-core": "^6.24.1",
+    "babel-eslint": "4.1.7",
+    "babel-loader": "7.0.0",
+    "babel-preset-es2015": "6.24.1",
+    "concat-stream": "^1.6.0",
+    "derequire": "^2.0.6",
+    "eslint-config-standard": "4.4.0",
+    "eslint-plugin-standard": "1.3.1",
+    "expect.js": "0.3.1",
+    "gulp": "^3.9.1",
+    "gulp-eslint": "1.1.1",
+    "gulp-file": "^0.3.0",
+    "gulp-istanbul": "^1.1.1",
+    "gulp-mocha": "^4.3.1",
+    "gulp-task-listing": "1.0.1",
+    "imports-loader": "^0.7.1",
+    "istanbul": "^0.4.5",
+    "mocha": "^3.3.0",
+    "socket.io": "^2.0.2",
+    "strip-loader": "0.1.2",
+    "text-blob-builder": "0.0.1",
+    "webpack-stream": "3.2.0",
+    "zuul": "^3.11.1  ",
+    "zuul-builder-webpack": "^1.2.0",
+    "zuul-ngrok": "4.0.0"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "6caf4aff9f85b19fd91b6ce13d69adb564f8873b",
+    "tarball": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.0.3.tgz"
+  },
+  "files": [
+    "lib/",
+    "dist/"
+  ],
+  "gitHead": "19f2b1990079f7bc206186490fffd8fda1a01e8c",
+  "homepage": "https://github.com/Automattic/socket.io-client#readme",
+  "keywords": [
+    "realtime",
+    "framework",
+    "websocket",
+    "tcp",
+    "events",
+    "client"
+  ],
+  "license": "MIT",
+  "main": "./lib/index",
+  "maintainers": [
+    {
+      "name": "darrachequesne",
+      "email": "damien.arrachequesne@gmail.com"
+    },
+    {
+      "name": "rauchg",
+      "email": "rauchg@gmail.com"
+    }
+  ],
+  "name": "socket.io-client",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/Automattic/socket.io-client.git"
+  },
+  "scripts": {
+    "test": "gulp test"
+  },
+  "version": "2.0.3"
+}
diff --git a/wrt/node_modules/socket.io-parser/History.md b/wrt/node_modules/socket.io-parser/History.md
new file mode 100644 (file)
index 0000000..17e16a9
--- /dev/null
@@ -0,0 +1,160 @@
+
+3.1.2 / 2017-04-27
+==================
+
+  * [chore] Bump has-binary2 to version 1.0.2 (#70)
+  * [fix] Fix Blob detection for iOS 8/9 (#69)
+
+3.1.1 / 2017-04-25
+==================
+
+  * [fix] Ensure globals are functions before running `instanceof` (#68)
+
+3.1.0 / 2017-04-24
+==================
+
+  * [chore] Bump debug to version 2.6.4 (#67)
+  * [feat] Move binary detection to the parser (#66)
+
+3.0.0 / 2017-04-04
+==================
+
+  * [chore] Bump isarray to version 2.0.1 (#65)
+  * [chore] Use native JSON and drop support for older nodejs versions (#64)
+
+2.3.2 / 2016-12-30
+==================
+
+  * [perf] Small optimisations (#57)
+  * [chore] Update zuul config to speed up tests in browser (#58)
+  * [refactor] Remove useless variable (#55)
+  * [chore] Bump dependencies (#56)
+  * [refactor] Remove unused var (#53)
+  * [refactor] Use strict equality when possible (#52)
+
+2.3.1 / 2016-10-24
+==================
+
+* [chore] Revert "Remove deprecated isarray dependency" (#50)
+
+2.3.0 / 2016-10-21
+==================
+
+  * [perf] Split try catch into separate function (#40)
+  * [chore] remove browsers setting from .zuul.yml (#34)
+  * [chore] bump zuul (#37)
+  * [chore] Bump zuul to 3.11.0 & zuul-ngrok to 4.0.0 (#41)
+  * [chore] Update zuul browser settings following EOL notices (#42)
+  * [chore] Restrict files included in npm package (#45)
+  * [chore] Update zuul browser settings (#44)
+  * [chore] Remove deprecated isarray dependency (#46)
+  * [chore] Make the build status badge point towards master (#47)
+  * [chore] Move benchmark to dev dependencies (#48)
+
+2.2.6 / 2015-11-25
+==================
+
+  * fix the order of exported events [chylli]
+
+2.2.5 / 2015-11-21
+==================
+
+  * package: bump debug
+  * update JSON3 to 3.3.2
+
+2.2.4 / 2015-03-03
+==================
+
+ * index: fix off-by-one bound checks
+
+2.2.3 / 2015-02-03
+==================
+
+ * index: fix potential infinite loop with malicious binary packet
+
+2.2.2 / 2014-09-04
+==================
+
+ * prevent direct `Buffer` reference that breaks browserify
+ * binary: reuse `isBuf` helper
+
+2.2.1 / 2014-06-20
+==================
+
+ * added benchmarking [kevin-roark]
+ * upgrade component-emitter to 1.1.2 [kevin-roark]
+ * update protocol version [kevin-roark]
+ * less indentation and a small optimization [kevin-roark]
+
+2.2.0 / 2014-05-30
+==================
+
+ * added a BINARY_ACK type [kevin-roark]
+
+2.1.5 / 2014-05-24
+==================
+
+ * don't iterate keys of `Date` objects [Rase-]
+
+2.1.4 / 2014-05-17
+==================
+
+ * fix null reconstruction bug [kevin-roark]
+
+2.1.3 / 2014-04-27
+==================
+
+ * bump zuul version
+ * updated protocol version
+
+2.1.2 / 2014-03-06
+==================
+
+ * added support for binary in ACK packets
+
+2.1.1 / 2014-03-04
+==================
+
+ * removed has-binary-data dependency
+ * fixed the object check in binary.removeBlobs
+
+2.1.0 / 2014-03-01
+==================
+
+ * faster and smaller binary parser and protocol [kevin-roark]
+
+2.0.0 / 2014-02-19
+==================
+
+ * binary support [kevin-roark]
+
+1.1.2 / 2014-02-11
+==================
+
+ * package: bump `json3` to fix IE6-7
+
+1.1.1 / 2014-02-10
+==================
+
+ * package: bump debug to fix browserify issues
+
+1.1.0 / 2013-12-25
+==================
+
+ * index: use `json3`
+
+1.0.3 / 2012-12-18
+==================
+
+  * index: added instrumentation through `debug`
+  * index: make sure decoded `id` is a `Number`
+
+1.0.2 / 2012-12-18
+==================
+
+  * index: allow for falsy values in `id` and `data`
+
+1.0.1 / 2012-12-10
+==================
+
+  * Revision 1
diff --git a/wrt/node_modules/socket.io-parser/LICENSE b/wrt/node_modules/socket.io-parser/LICENSE
new file mode 100644 (file)
index 0000000..7e43606
--- /dev/null
@@ -0,0 +1,20 @@
+(The MIT License)
+
+Copyright (c) 2014 Guillermo Rauch <guillermo@learnboost.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the 'Software'), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/socket.io-parser/Readme.md b/wrt/node_modules/socket.io-parser/Readme.md
new file mode 100644 (file)
index 0000000..2463bc7
--- /dev/null
@@ -0,0 +1,73 @@
+
+# socket.io-parser
+
+[![Build Status](https://secure.travis-ci.org/socketio/socket.io-parser.svg?branch=master)](http://travis-ci.org/socketio/socket.io-parser)
+[![NPM version](https://badge.fury.io/js/socket.io-parser.svg)](http://badge.fury.io/js/socket.io-parser)
+
+A socket.io encoder and decoder written in JavaScript complying with version `3`
+of [socket.io-protocol](https://github.com/socketio/socket.io-protocol).
+Used by [socket.io](https://github.com/automattic/socket.io) and
+[socket.io-client](https://github.com/automattic/socket.io-client).
+
+## Parser API
+
+  socket.io-parser is the reference implementation of socket.io-protocol. Read
+  the full API here:
+  [socket.io-protocol](https://github.com/learnboost/socket.io-protocol).
+
+## Example Usage
+
+### Encoding and decoding a packet
+
+```js
+var parser = require('socket.io-parser');
+var encoder = new parser.Encoder();
+var packet = {
+  type: parser.EVENT,
+  data: 'test-packet',
+  id: 13
+};
+encoder.encode(packet, function(encodedPackets) {
+  var decoder = new parser.Decoder();
+  decoder.on('decoded', function(decodedPacket) {
+    // decodedPacket.type == parser.EVENT
+    // decodedPacket.data == 'test-packet'
+    // decodedPacket.id == 13
+  });
+
+  for (var i = 0; i < encodedPackets.length; i++) {
+    decoder.add(encodedPackets[i]);
+  }
+});
+```
+
+### Encoding and decoding a packet with binary data
+
+```js
+var parser = require('socket.io-parser');
+var encoder = new parser.Encoder();
+var packet = {
+  type: parser.BINARY_EVENT,
+  data: {i: new Buffer(1234), j: new Blob([new ArrayBuffer(2)])}
+  id: 15
+};
+encoder.encode(packet, function(encodedPackets) {
+  var decoder = new parser.Decoder();
+  decoder.on('decoded', function(decodedPacket) {
+    // decodedPacket.type == parser.BINARY_EVENTEVENT
+    // Buffer.isBuffer(decodedPacket.data.i) == true
+    // Buffer.isBuffer(decodedPacket.data.j) == true
+    // decodedPacket.id == 15
+  });
+
+  for (var i = 0; i < encodedPackets.length; i++) {
+    decoder.add(encodedPackets[i]);
+  }
+});
+```
+See the test suite for more examples of how socket.io-parser is used.
+
+
+## License
+
+MIT
diff --git a/wrt/node_modules/socket.io-parser/binary.js b/wrt/node_modules/socket.io-parser/binary.js
new file mode 100644 (file)
index 0000000..1a530c7
--- /dev/null
@@ -0,0 +1,141 @@
+/*global Blob,File*/
+
+/**
+ * Module requirements
+ */
+
+var isArray = require('isarray');
+var isBuf = require('./is-buffer');
+var toString = Object.prototype.toString;
+var withNativeBlob = typeof global.Blob === 'function' || toString.call(global.Blob) === '[object BlobConstructor]';
+var withNativeFile = typeof global.File === 'function' || toString.call(global.File) === '[object FileConstructor]';
+
+/**
+ * Replaces every Buffer | ArrayBuffer in packet with a numbered placeholder.
+ * Anything with blobs or files should be fed through removeBlobs before coming
+ * here.
+ *
+ * @param {Object} packet - socket.io event packet
+ * @return {Object} with deconstructed packet and list of buffers
+ * @api public
+ */
+
+exports.deconstructPacket = function(packet) {
+  var buffers = [];
+  var packetData = packet.data;
+  var pack = packet;
+  pack.data = _deconstructPacket(packetData, buffers);
+  pack.attachments = buffers.length; // number of binary 'attachments'
+  return {packet: pack, buffers: buffers};
+};
+
+function _deconstructPacket(data, buffers) {
+  if (!data) return data;
+
+  if (isBuf(data)) {
+    var placeholder = { _placeholder: true, num: buffers.length };
+    buffers.push(data);
+    return placeholder;
+  } else if (isArray(data)) {
+    var newData = new Array(data.length);
+    for (var i = 0; i < data.length; i++) {
+      newData[i] = _deconstructPacket(data[i], buffers);
+    }
+    return newData;
+  } else if (typeof data === 'object' && !(data instanceof Date)) {
+    var newData = {};
+    for (var key in data) {
+      newData[key] = _deconstructPacket(data[key], buffers);
+    }
+    return newData;
+  }
+  return data;
+}
+
+/**
+ * Reconstructs a binary packet from its placeholder packet and buffers
+ *
+ * @param {Object} packet - event packet with placeholders
+ * @param {Array} buffers - binary buffers to put in placeholder positions
+ * @return {Object} reconstructed packet
+ * @api public
+ */
+
+exports.reconstructPacket = function(packet, buffers) {
+  packet.data = _reconstructPacket(packet.data, buffers);
+  packet.attachments = undefined; // no longer useful
+  return packet;
+};
+
+function _reconstructPacket(data, buffers) {
+  if (!data) return data;
+
+  if (data && data._placeholder) {
+    return buffers[data.num]; // appropriate buffer (should be natural order anyway)
+  } else if (isArray(data)) {
+    for (var i = 0; i < data.length; i++) {
+      data[i] = _reconstructPacket(data[i], buffers);
+    }
+  } else if (typeof data === 'object') {
+    for (var key in data) {
+      data[key] = _reconstructPacket(data[key], buffers);
+    }
+  }
+
+  return data;
+}
+
+/**
+ * Asynchronously removes Blobs or Files from data via
+ * FileReader's readAsArrayBuffer method. Used before encoding
+ * data as msgpack. Calls callback with the blobless data.
+ *
+ * @param {Object} data
+ * @param {Function} callback
+ * @api private
+ */
+
+exports.removeBlobs = function(data, callback) {
+  function _removeBlobs(obj, curKey, containingObject) {
+    if (!obj) return obj;
+
+    // convert any blob
+    if ((withNativeBlob && obj instanceof Blob) ||
+        (withNativeFile && obj instanceof File)) {
+      pendingBlobs++;
+
+      // async filereader
+      var fileReader = new FileReader();
+      fileReader.onload = function() { // this.result == arraybuffer
+        if (containingObject) {
+          containingObject[curKey] = this.result;
+        }
+        else {
+          bloblessData = this.result;
+        }
+
+        // if nothing pending its callback time
+        if(! --pendingBlobs) {
+          callback(bloblessData);
+        }
+      };
+
+      fileReader.readAsArrayBuffer(obj); // blob -> arraybuffer
+    } else if (isArray(obj)) { // handle array
+      for (var i = 0; i < obj.length; i++) {
+        _removeBlobs(obj[i], i, obj);
+      }
+    } else if (typeof obj === 'object' && !isBuf(obj)) { // and object
+      for (var key in obj) {
+        _removeBlobs(obj[key], key, obj);
+      }
+    }
+  }
+
+  var pendingBlobs = 0;
+  var bloblessData = data;
+  _removeBlobs(bloblessData);
+  if (!pendingBlobs) {
+    callback(bloblessData);
+  }
+};
diff --git a/wrt/node_modules/socket.io-parser/index.js b/wrt/node_modules/socket.io-parser/index.js
new file mode 100644 (file)
index 0000000..ea206ea
--- /dev/null
@@ -0,0 +1,400 @@
+
+/**
+ * Module dependencies.
+ */
+
+var debug = require('debug')('socket.io-parser');
+var Emitter = require('component-emitter');
+var hasBin = require('has-binary2');
+var binary = require('./binary');
+var isBuf = require('./is-buffer');
+
+/**
+ * Protocol version.
+ *
+ * @api public
+ */
+
+exports.protocol = 4;
+
+/**
+ * Packet types.
+ *
+ * @api public
+ */
+
+exports.types = [
+  'CONNECT',
+  'DISCONNECT',
+  'EVENT',
+  'ACK',
+  'ERROR',
+  'BINARY_EVENT',
+  'BINARY_ACK'
+];
+
+/**
+ * Packet type `connect`.
+ *
+ * @api public
+ */
+
+exports.CONNECT = 0;
+
+/**
+ * Packet type `disconnect`.
+ *
+ * @api public
+ */
+
+exports.DISCONNECT = 1;
+
+/**
+ * Packet type `event`.
+ *
+ * @api public
+ */
+
+exports.EVENT = 2;
+
+/**
+ * Packet type `ack`.
+ *
+ * @api public
+ */
+
+exports.ACK = 3;
+
+/**
+ * Packet type `error`.
+ *
+ * @api public
+ */
+
+exports.ERROR = 4;
+
+/**
+ * Packet type 'binary event'
+ *
+ * @api public
+ */
+
+exports.BINARY_EVENT = 5;
+
+/**
+ * Packet type `binary ack`. For acks with binary arguments.
+ *
+ * @api public
+ */
+
+exports.BINARY_ACK = 6;
+
+/**
+ * Encoder constructor.
+ *
+ * @api public
+ */
+
+exports.Encoder = Encoder;
+
+/**
+ * Decoder constructor.
+ *
+ * @api public
+ */
+
+exports.Decoder = Decoder;
+
+/**
+ * A socket.io Encoder instance
+ *
+ * @api public
+ */
+
+function Encoder() {}
+
+/**
+ * Encode a packet as a single string if non-binary, or as a
+ * buffer sequence, depending on packet type.
+ *
+ * @param {Object} obj - packet object
+ * @param {Function} callback - function to handle encodings (likely engine.write)
+ * @return Calls callback with Array of encodings
+ * @api public
+ */
+
+Encoder.prototype.encode = function(obj, callback){
+  if ((obj.type === exports.EVENT || obj.type === exports.ACK) && hasBin(obj.data)) {
+    obj.type = obj.type === exports.EVENT ? exports.BINARY_EVENT : exports.BINARY_ACK;
+  }
+
+  debug('encoding packet %j', obj);
+
+  if (exports.BINARY_EVENT === obj.type || exports.BINARY_ACK === obj.type) {
+    encodeAsBinary(obj, callback);
+  }
+  else {
+    var encoding = encodeAsString(obj);
+    callback([encoding]);
+  }
+};
+
+/**
+ * Encode packet as string.
+ *
+ * @param {Object} packet
+ * @return {String} encoded
+ * @api private
+ */
+
+function encodeAsString(obj) {
+
+  // first is type
+  var str = '' + obj.type;
+
+  // attachments if we have them
+  if (exports.BINARY_EVENT === obj.type || exports.BINARY_ACK === obj.type) {
+    str += obj.attachments + '-';
+  }
+
+  // if we have a namespace other than `/`
+  // we append it followed by a comma `,`
+  if (obj.nsp && '/' !== obj.nsp) {
+    str += obj.nsp + ',';
+  }
+
+  // immediately followed by the id
+  if (null != obj.id) {
+    str += obj.id;
+  }
+
+  // json data
+  if (null != obj.data) {
+    str += JSON.stringify(obj.data);
+  }
+
+  debug('encoded %j as %s', obj, str);
+  return str;
+}
+
+/**
+ * Encode packet as 'buffer sequence' by removing blobs, and
+ * deconstructing packet into object with placeholders and
+ * a list of buffers.
+ *
+ * @param {Object} packet
+ * @return {Buffer} encoded
+ * @api private
+ */
+
+function encodeAsBinary(obj, callback) {
+
+  function writeEncoding(bloblessData) {
+    var deconstruction = binary.deconstructPacket(bloblessData);
+    var pack = encodeAsString(deconstruction.packet);
+    var buffers = deconstruction.buffers;
+
+    buffers.unshift(pack); // add packet info to beginning of data list
+    callback(buffers); // write all the buffers
+  }
+
+  binary.removeBlobs(obj, writeEncoding);
+}
+
+/**
+ * A socket.io Decoder instance
+ *
+ * @return {Object} decoder
+ * @api public
+ */
+
+function Decoder() {
+  this.reconstructor = null;
+}
+
+/**
+ * Mix in `Emitter` with Decoder.
+ */
+
+Emitter(Decoder.prototype);
+
+/**
+ * Decodes an ecoded packet string into packet JSON.
+ *
+ * @param {String} obj - encoded packet
+ * @return {Object} packet
+ * @api public
+ */
+
+Decoder.prototype.add = function(obj) {
+  var packet;
+  if (typeof obj === 'string') {
+    packet = decodeString(obj);
+    if (exports.BINARY_EVENT === packet.type || exports.BINARY_ACK === packet.type) { // binary packet's json
+      this.reconstructor = new BinaryReconstructor(packet);
+
+      // no attachments, labeled binary but no binary data to follow
+      if (this.reconstructor.reconPack.attachments === 0) {
+        this.emit('decoded', packet);
+      }
+    } else { // non-binary full packet
+      this.emit('decoded', packet);
+    }
+  }
+  else if (isBuf(obj) || obj.base64) { // raw binary data
+    if (!this.reconstructor) {
+      throw new Error('got binary data when not reconstructing a packet');
+    } else {
+      packet = this.reconstructor.takeBinaryData(obj);
+      if (packet) { // received final buffer
+        this.reconstructor = null;
+        this.emit('decoded', packet);
+      }
+    }
+  }
+  else {
+    throw new Error('Unknown type: ' + obj);
+  }
+};
+
+/**
+ * Decode a packet String (JSON data)
+ *
+ * @param {String} str
+ * @return {Object} packet
+ * @api private
+ */
+
+function decodeString(str) {
+  var i = 0;
+  // look up type
+  var p = {
+    type: Number(str.charAt(0))
+  };
+
+  if (null == exports.types[p.type]) return error();
+
+  // look up attachments if type binary
+  if (exports.BINARY_EVENT === p.type || exports.BINARY_ACK === p.type) {
+    var buf = '';
+    while (str.charAt(++i) !== '-') {
+      buf += str.charAt(i);
+      if (i == str.length) break;
+    }
+    if (buf != Number(buf) || str.charAt(i) !== '-') {
+      throw new Error('Illegal attachments');
+    }
+    p.attachments = Number(buf);
+  }
+
+  // look up namespace (if any)
+  if ('/' === str.charAt(i + 1)) {
+    p.nsp = '';
+    while (++i) {
+      var c = str.charAt(i);
+      if (',' === c) break;
+      p.nsp += c;
+      if (i === str.length) break;
+    }
+  } else {
+    p.nsp = '/';
+  }
+
+  // look up id
+  var next = str.charAt(i + 1);
+  if ('' !== next && Number(next) == next) {
+    p.id = '';
+    while (++i) {
+      var c = str.charAt(i);
+      if (null == c || Number(c) != c) {
+        --i;
+        break;
+      }
+      p.id += str.charAt(i);
+      if (i === str.length) break;
+    }
+    p.id = Number(p.id);
+  }
+
+  // look up json data
+  if (str.charAt(++i)) {
+    p = tryParse(p, str.substr(i));
+  }
+
+  debug('decoded %s as %j', str, p);
+  return p;
+}
+
+function tryParse(p, str) {
+  try {
+    p.data = JSON.parse(str);
+  } catch(e){
+    return error();
+  }
+  return p; 
+}
+
+/**
+ * Deallocates a parser's resources
+ *
+ * @api public
+ */
+
+Decoder.prototype.destroy = function() {
+  if (this.reconstructor) {
+    this.reconstructor.finishedReconstruction();
+  }
+};
+
+/**
+ * A manager of a binary event's 'buffer sequence'. Should
+ * be constructed whenever a packet of type BINARY_EVENT is
+ * decoded.
+ *
+ * @param {Object} packet
+ * @return {BinaryReconstructor} initialized reconstructor
+ * @api private
+ */
+
+function BinaryReconstructor(packet) {
+  this.reconPack = packet;
+  this.buffers = [];
+}
+
+/**
+ * Method to be called when binary data received from connection
+ * after a BINARY_EVENT packet.
+ *
+ * @param {Buffer | ArrayBuffer} binData - the raw binary data received
+ * @return {null | Object} returns null if more binary data is expected or
+ *   a reconstructed packet object if all buffers have been received.
+ * @api private
+ */
+
+BinaryReconstructor.prototype.takeBinaryData = function(binData) {
+  this.buffers.push(binData);
+  if (this.buffers.length === this.reconPack.attachments) { // done with buffer list
+    var packet = binary.reconstructPacket(this.reconPack, this.buffers);
+    this.finishedReconstruction();
+    return packet;
+  }
+  return null;
+};
+
+/**
+ * Cleans up binary packet reconstruction variables.
+ *
+ * @api private
+ */
+
+BinaryReconstructor.prototype.finishedReconstruction = function() {
+  this.reconPack = null;
+  this.buffers = [];
+};
+
+function error() {
+  return {
+    type: exports.ERROR,
+    data: 'parser error'
+  };
+}
diff --git a/wrt/node_modules/socket.io-parser/is-buffer.js b/wrt/node_modules/socket.io-parser/is-buffer.js
new file mode 100644 (file)
index 0000000..977df88
--- /dev/null
@@ -0,0 +1,13 @@
+
+module.exports = isBuf;
+
+/**
+ * Returns true if obj is a buffer or an arraybuffer.
+ *
+ * @api private
+ */
+
+function isBuf(obj) {
+  return (global.Buffer && global.Buffer.isBuffer(obj)) ||
+         (global.ArrayBuffer && obj instanceof ArrayBuffer);
+}
diff --git a/wrt/node_modules/socket.io-parser/node_modules/debug/.coveralls.yml b/wrt/node_modules/socket.io-parser/node_modules/debug/.coveralls.yml
new file mode 100644 (file)
index 0000000..20a7068
--- /dev/null
@@ -0,0 +1 @@
+repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve
diff --git a/wrt/node_modules/socket.io-parser/node_modules/debug/.eslintrc b/wrt/node_modules/socket.io-parser/node_modules/debug/.eslintrc
new file mode 100644 (file)
index 0000000..8a37ae2
--- /dev/null
@@ -0,0 +1,11 @@
+{
+  "env": {
+    "browser": true,
+    "node": true
+  },
+  "rules": {
+    "no-console": 0,
+    "no-empty": [1, { "allowEmptyCatch": true }]
+  },
+  "extends": "eslint:recommended"
+}
diff --git a/wrt/node_modules/socket.io-parser/node_modules/debug/.npmignore b/wrt/node_modules/socket.io-parser/node_modules/debug/.npmignore
new file mode 100644 (file)
index 0000000..5f60eec
--- /dev/null
@@ -0,0 +1,9 @@
+support
+test
+examples
+example
+*.sock
+dist
+yarn.lock
+coverage
+bower.json
diff --git a/wrt/node_modules/socket.io-parser/node_modules/debug/.travis.yml b/wrt/node_modules/socket.io-parser/node_modules/debug/.travis.yml
new file mode 100644 (file)
index 0000000..6c6090c
--- /dev/null
@@ -0,0 +1,14 @@
+
+language: node_js
+node_js:
+  - "6"
+  - "5"
+  - "4"
+
+install:
+  - make node_modules
+
+script:
+  - make lint
+  - make test
+  - make coveralls
diff --git a/wrt/node_modules/socket.io-parser/node_modules/debug/CHANGELOG.md b/wrt/node_modules/socket.io-parser/node_modules/debug/CHANGELOG.md
new file mode 100644 (file)
index 0000000..eadaa18
--- /dev/null
@@ -0,0 +1,362 @@
+
+2.6.9 / 2017-09-22
+==================
+
+  * remove ReDoS regexp in %o formatter (#504)
+
+2.6.8 / 2017-05-18
+==================
+
+  * Fix: Check for undefined on browser globals (#462, @marbemac)
+
+2.6.7 / 2017-05-16
+==================
+
+  * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom)
+  * Fix: Inline extend function in node implementation (#452, @dougwilson)
+  * Docs: Fix typo (#455, @msasad)
+
+2.6.5 / 2017-04-27
+==================
+  
+  * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek)
+  * Misc: clean up browser reference checks (#447, @thebigredgeek)
+  * Misc: add npm-debug.log to .gitignore (@thebigredgeek)
+
+
+2.6.4 / 2017-04-20
+==================
+
+  * Fix: bug that would occure if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo)
+  * Chore: ignore bower.json in npm installations. (#437, @joaovieira)
+  * Misc: update "ms" to v0.7.3 (@tootallnate)
+
+2.6.3 / 2017-03-13
+==================
+
+  * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts)
+  * Docs: Changelog fix (@thebigredgeek)
+
+2.6.2 / 2017-03-10
+==================
+
+  * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin)
+  * Docs: Add backers and sponsors from Open Collective (#422, @piamancini)
+  * Docs: Add Slackin invite badge (@tootallnate)
+
+2.6.1 / 2017-02-10
+==================
+
+  * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error
+  * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0)
+  * Fix: IE8 "Expected identifier" error (#414, @vgoma)
+  * Fix: Namespaces would not disable once enabled (#409, @musikov)
+
+2.6.0 / 2016-12-28
+==================
+
+  * Fix: added better null pointer checks for browser useColors (@thebigredgeek)
+  * Improvement: removed explicit `window.debug` export (#404, @tootallnate)
+  * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate)
+
+2.5.2 / 2016-12-25
+==================
+
+  * Fix: reference error on window within webworkers (#393, @KlausTrainer)
+  * Docs: fixed README typo (#391, @lurch)
+  * Docs: added notice about v3 api discussion (@thebigredgeek)
+
+2.5.1 / 2016-12-20
+==================
+
+  * Fix: babel-core compatibility
+
+2.5.0 / 2016-12-20
+==================
+
+  * Fix: wrong reference in bower file (@thebigredgeek)
+  * Fix: webworker compatibility (@thebigredgeek)
+  * Fix: output formatting issue (#388, @kribblo)
+  * Fix: babel-loader compatibility (#383, @escwald)
+  * Misc: removed built asset from repo and publications (@thebigredgeek)
+  * Misc: moved source files to /src (#378, @yamikuronue)
+  * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue)
+  * Test: coveralls integration (#378, @yamikuronue)
+  * Docs: simplified language in the opening paragraph (#373, @yamikuronue)
+
+2.4.5 / 2016-12-17
+==================
+
+  * Fix: `navigator` undefined in Rhino (#376, @jochenberger)
+  * Fix: custom log function (#379, @hsiliev)
+  * Improvement: bit of cleanup + linting fixes (@thebigredgeek)
+  * Improvement: rm non-maintainted `dist/` dir (#375, @freewil)
+  * Docs: simplified language in the opening paragraph. (#373, @yamikuronue)
+
+2.4.4 / 2016-12-14
+==================
+
+  * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts)
+
+2.4.3 / 2016-12-14
+==================
+
+  * Fix: navigation.userAgent error for react native (#364, @escwald)
+
+2.4.2 / 2016-12-14
+==================
+
+  * Fix: browser colors (#367, @tootallnate)
+  * Misc: travis ci integration (@thebigredgeek)
+  * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek)
+
+2.4.1 / 2016-12-13
+==================
+
+  * Fix: typo that broke the package (#356)
+
+2.4.0 / 2016-12-13
+==================
+
+  * Fix: bower.json references unbuilt src entry point (#342, @justmatt)
+  * Fix: revert "handle regex special characters" (@tootallnate)
+  * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate)
+  * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate)
+  * Improvement: allow colors in workers (#335, @botverse)
+  * Improvement: use same color for same namespace. (#338, @lchenay)
+
+2.3.3 / 2016-11-09
+==================
+
+  * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne)
+  * Fix: Returning `localStorage` saved values (#331, Levi Thomason)
+  * Improvement: Don't create an empty object when no `process` (Nathan Rajlich)
+
+2.3.2 / 2016-11-09
+==================
+
+  * Fix: be super-safe in index.js as well (@TooTallNate)
+  * Fix: should check whether process exists (Tom Newby)
+
+2.3.1 / 2016-11-09
+==================
+
+  * Fix: Added electron compatibility (#324, @paulcbetts)
+  * Improvement: Added performance optimizations (@tootallnate)
+  * Readme: Corrected PowerShell environment variable example (#252, @gimre)
+  * Misc: Removed yarn lock file from source control (#321, @fengmk2)
+
+2.3.0 / 2016-11-07
+==================
+
+  * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic)
+  * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos)
+  * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15)
+  * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran)
+  * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom)
+  * Package: Update "ms" to 0.7.2 (#315, @DevSide)
+  * Package: removed superfluous version property from bower.json (#207 @kkirsche)
+  * Readme: fix USE_COLORS to DEBUG_COLORS
+  * Readme: Doc fixes for format string sugar (#269, @mlucool)
+  * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0)
+  * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable)
+  * Readme: better docs for browser support (#224, @matthewmueller)
+  * Tooling: Added yarn integration for development (#317, @thebigredgeek)
+  * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek)
+  * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman)
+  * Misc: Updated contributors (@thebigredgeek)
+
+2.2.0 / 2015-05-09
+==================
+
+  * package: update "ms" to v0.7.1 (#202, @dougwilson)
+  * README: add logging to file example (#193, @DanielOchoa)
+  * README: fixed a typo (#191, @amir-s)
+  * browser: expose `storage` (#190, @stephenmathieson)
+  * Makefile: add a `distclean` target (#189, @stephenmathieson)
+
+2.1.3 / 2015-03-13
+==================
+
+  * Updated stdout/stderr example (#186)
+  * Updated example/stdout.js to match debug current behaviour
+  * Renamed example/stderr.js to stdout.js
+  * Update Readme.md (#184)
+  * replace high intensity foreground color for bold (#182, #183)
+
+2.1.2 / 2015-03-01
+==================
+
+  * dist: recompile
+  * update "ms" to v0.7.0
+  * package: update "browserify" to v9.0.3
+  * component: fix "ms.js" repo location
+  * changed bower package name
+  * updated documentation about using debug in a browser
+  * fix: security error on safari (#167, #168, @yields)
+
+2.1.1 / 2014-12-29
+==================
+
+  * browser: use `typeof` to check for `console` existence
+  * browser: check for `console.log` truthiness (fix IE 8/9)
+  * browser: add support for Chrome apps
+  * Readme: added Windows usage remarks
+  * Add `bower.json` to properly support bower install
+
+2.1.0 / 2014-10-15
+==================
+
+  * node: implement `DEBUG_FD` env variable support
+  * package: update "browserify" to v6.1.0
+  * package: add "license" field to package.json (#135, @panuhorsmalahti)
+
+2.0.0 / 2014-09-01
+==================
+
+  * package: update "browserify" to v5.11.0
+  * node: use stderr rather than stdout for logging (#29, @stephenmathieson)
+
+1.0.4 / 2014-07-15
+==================
+
+  * dist: recompile
+  * example: remove `console.info()` log usage
+  * example: add "Content-Type" UTF-8 header to browser example
+  * browser: place %c marker after the space character
+  * browser: reset the "content" color via `color: inherit`
+  * browser: add colors support for Firefox >= v31
+  * debug: prefer an instance `log()` function over the global one (#119)
+  * Readme: update documentation about styled console logs for FF v31 (#116, @wryk)
+
+1.0.3 / 2014-07-09
+==================
+
+  * Add support for multiple wildcards in namespaces (#122, @seegno)
+  * browser: fix lint
+
+1.0.2 / 2014-06-10
+==================
+
+  * browser: update color palette (#113, @gscottolson)
+  * common: make console logging function configurable (#108, @timoxley)
+  * node: fix %o colors on old node <= 0.8.x
+  * Makefile: find node path using shell/which (#109, @timoxley)
+
+1.0.1 / 2014-06-06
+==================
+
+  * browser: use `removeItem()` to clear localStorage
+  * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777)
+  * package: add "contributors" section
+  * node: fix comment typo
+  * README: list authors
+
+1.0.0 / 2014-06-04
+==================
+
+  * make ms diff be global, not be scope
+  * debug: ignore empty strings in enable()
+  * node: make DEBUG_COLORS able to disable coloring
+  * *: export the `colors` array
+  * npmignore: don't publish the `dist` dir
+  * Makefile: refactor to use browserify
+  * package: add "browserify" as a dev dependency
+  * Readme: add Web Inspector Colors section
+  * node: reset terminal color for the debug content
+  * node: map "%o" to `util.inspect()`
+  * browser: map "%j" to `JSON.stringify()`
+  * debug: add custom "formatters"
+  * debug: use "ms" module for humanizing the diff
+  * Readme: add "bash" syntax highlighting
+  * browser: add Firebug color support
+  * browser: add colors for WebKit browsers
+  * node: apply log to `console`
+  * rewrite: abstract common logic for Node & browsers
+  * add .jshintrc file
+
+0.8.1 / 2014-04-14
+==================
+
+  * package: re-add the "component" section
+
+0.8.0 / 2014-03-30
+==================
+
+  * add `enable()` method for nodejs. Closes #27
+  * change from stderr to stdout
+  * remove unnecessary index.js file
+
+0.7.4 / 2013-11-13
+==================
+
+  * remove "browserify" key from package.json (fixes something in browserify)
+
+0.7.3 / 2013-10-30
+==================
+
+  * fix: catch localStorage security error when cookies are blocked (Chrome)
+  * add debug(err) support. Closes #46
+  * add .browser prop to package.json. Closes #42
+
+0.7.2 / 2013-02-06
+==================
+
+  * fix package.json
+  * fix: Mobile Safari (private mode) is broken with debug
+  * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript
+
+0.7.1 / 2013-02-05
+==================
+
+  * add repository URL to package.json
+  * add DEBUG_COLORED to force colored output
+  * add browserify support
+  * fix component. Closes #24
+
+0.7.0 / 2012-05-04
+==================
+
+  * Added .component to package.json
+  * Added debug.component.js build
+
+0.6.0 / 2012-03-16
+==================
+
+  * Added support for "-" prefix in DEBUG [Vinay Pulim]
+  * Added `.enabled` flag to the node version [TooTallNate]
+
+0.5.0 / 2012-02-02
+==================
+
+  * Added: humanize diffs. Closes #8
+  * Added `debug.disable()` to the CS variant
+  * Removed padding. Closes #10
+  * Fixed: persist client-side variant again. Closes #9
+
+0.4.0 / 2012-02-01
+==================
+
+  * Added browser variant support for older browsers [TooTallNate]
+  * Added `debug.enable('project:*')` to browser variant [TooTallNate]
+  * Added padding to diff (moved it to the right)
+
+0.3.0 / 2012-01-26
+==================
+
+  * Added millisecond diff when isatty, otherwise UTC string
+
+0.2.0 / 2012-01-22
+==================
+
+  * Added wildcard support
+
+0.1.0 / 2011-12-02
+==================
+
+  * Added: remove colors unless stderr isatty [TooTallNate]
+
+0.0.1 / 2010-01-03
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/socket.io-parser/node_modules/debug/LICENSE b/wrt/node_modules/socket.io-parser/node_modules/debug/LICENSE
new file mode 100644 (file)
index 0000000..658c933
--- /dev/null
@@ -0,0 +1,19 @@
+(The MIT License)
+
+Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software 
+and associated documentation files (the 'Software'), to deal in the Software without restriction, 
+including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial 
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 
+LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/wrt/node_modules/socket.io-parser/node_modules/debug/Makefile b/wrt/node_modules/socket.io-parser/node_modules/debug/Makefile
new file mode 100644 (file)
index 0000000..584da8b
--- /dev/null
@@ -0,0 +1,50 @@
+# get Makefile directory name: http://stackoverflow.com/a/5982798/376773
+THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
+THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)
+
+# BIN directory
+BIN := $(THIS_DIR)/node_modules/.bin
+
+# Path
+PATH := node_modules/.bin:$(PATH)
+SHELL := /bin/bash
+
+# applications
+NODE ?= $(shell which node)
+YARN ?= $(shell which yarn)
+PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm))
+BROWSERIFY ?= $(NODE) $(BIN)/browserify
+
+.FORCE:
+
+install: node_modules
+
+node_modules: package.json
+       @NODE_ENV= $(PKG) install
+       @touch node_modules
+
+lint: .FORCE
+       eslint browser.js debug.js index.js node.js
+
+test-node: .FORCE
+       istanbul cover node_modules/mocha/bin/_mocha -- test/**.js
+
+test-browser: .FORCE
+       mkdir -p dist
+
+       @$(BROWSERIFY) \
+               --standalone debug \
+               . > dist/debug.js
+
+       karma start --single-run
+       rimraf dist
+
+test: .FORCE
+       concurrently \
+               "make test-node" \
+               "make test-browser"
+
+coveralls:
+       cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
+
+.PHONY: all install clean distclean
diff --git a/wrt/node_modules/socket.io-parser/node_modules/debug/README.md b/wrt/node_modules/socket.io-parser/node_modules/debug/README.md
new file mode 100644 (file)
index 0000000..f67be6b
--- /dev/null
@@ -0,0 +1,312 @@
+# debug
+[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug)  [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master)  [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) 
+[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors)
+
+
+
+A tiny node.js debugging utility modelled after node core's debugging technique.
+
+**Discussion around the V3 API is under way [here](https://github.com/visionmedia/debug/issues/370)**
+
+## Installation
+
+```bash
+$ npm install debug
+```
+
+## Usage
+
+`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole.
+
+Example _app.js_:
+
+```js
+var debug = require('debug')('http')
+  , http = require('http')
+  , name = 'My App';
+
+// fake app
+
+debug('booting %s', name);
+
+http.createServer(function(req, res){
+  debug(req.method + ' ' + req.url);
+  res.end('hello\n');
+}).listen(3000, function(){
+  debug('listening');
+});
+
+// fake worker of some kind
+
+require('./worker');
+```
+
+Example _worker.js_:
+
+```js
+var debug = require('debug')('worker');
+
+setInterval(function(){
+  debug('doing some work');
+}, 1000);
+```
+
+ The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:
+
+  ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png)
+
+  ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png)
+
+#### Windows note
+
+ On Windows the environment variable is set using the `set` command.
+
+ ```cmd
+ set DEBUG=*,-not_this
+ ```
+
+ Note that PowerShell uses different syntax to set environment variables.
+
+ ```cmd
+ $env:DEBUG = "*,-not_this"
+  ```
+
+Then, run the program to be debugged as usual.
+
+## Millisecond diff
+
+  When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.
+
+  ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png)
+
+  When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:
+
+  ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png)
+
+## Conventions
+
+  If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser".
+
+## Wildcards
+
+  The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.
+
+  You can also exclude specific debuggers by prefixing them with a "-" character.  For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:".
+
+## Environment Variables
+
+  When running through Node.js, you can set a few environment variables that will
+  change the behavior of the debug logging:
+
+| Name      | Purpose                                         |
+|-----------|-------------------------------------------------|
+| `DEBUG`   | Enables/disables specific debugging namespaces. |
+| `DEBUG_COLORS`| Whether or not to use colors in the debug output. |
+| `DEBUG_DEPTH` | Object inspection depth. |
+| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. |
+
+
+  __Note:__ The environment variables beginning with `DEBUG_` end up being
+  converted into an Options object that gets used with `%o`/`%O` formatters.
+  See the Node.js documentation for
+  [`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options)
+  for the complete list.
+
+## Formatters
+
+
+  Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. Below are the officially supported formatters:
+
+| Formatter | Representation |
+|-----------|----------------|
+| `%O`      | Pretty-print an Object on multiple lines. |
+| `%o`      | Pretty-print an Object all on a single line. |
+| `%s`      | String. |
+| `%d`      | Number (both integer and float). |
+| `%j`      | JSON. Replaced with the string '[Circular]' if the argument contains circular references. |
+| `%%`      | Single percent sign ('%'). This does not consume an argument. |
+
+### Custom formatters
+
+  You can add custom formatters by extending the `debug.formatters` object. For example, if you wanted to add support for rendering a Buffer as hex with `%h`, you could do something like:
+
+```js
+const createDebug = require('debug')
+createDebug.formatters.h = (v) => {
+  return v.toString('hex')
+}
+
+// …elsewhere
+const debug = createDebug('foo')
+debug('this is hex: %h', new Buffer('hello world'))
+//   foo this is hex: 68656c6c6f20776f726c6421 +0ms
+```
+
+## Browser support
+  You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify),
+  or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest),
+  if you don't want to build it yourself.
+
+  Debug's enable state is currently persisted by `localStorage`.
+  Consider the situation shown below where you have `worker:a` and `worker:b`,
+  and wish to debug both. You can enable this using `localStorage.debug`:
+
+```js
+localStorage.debug = 'worker:*'
+```
+
+And then refresh the page.
+
+```js
+a = debug('worker:a');
+b = debug('worker:b');
+
+setInterval(function(){
+  a('doing some work');
+}, 1000);
+
+setInterval(function(){
+  b('doing some work');
+}, 1200);
+```
+
+#### Web Inspector Colors
+
+  Colors are also enabled on "Web Inspectors" that understand the `%c` formatting
+  option. These are WebKit web inspectors, Firefox ([since version
+  31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))
+  and the Firebug plugin for Firefox (any version).
+
+  Colored output looks something like:
+
+  ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png)
+
+
+## Output streams
+
+  By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method:
+
+Example _stdout.js_:
+
+```js
+var debug = require('debug');
+var error = debug('app:error');
+
+// by default stderr is used
+error('goes to stderr!');
+
+var log = debug('app:log');
+// set this namespace to log via console.log
+log.log = console.log.bind(console); // don't forget to bind to console!
+log('goes to stdout');
+error('still goes to stderr!');
+
+// set all output to go via console.info
+// overrides all per-namespace log settings
+debug.log = console.info.bind(console);
+error('now goes to stdout via console.info');
+log('still goes to stdout, but via console.info now');
+```
+
+
+## Authors
+
+ - TJ Holowaychuk
+ - Nathan Rajlich
+ - Andrew Rhyne
+## Backers
+
+Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)]
+
+<a href="https://opencollective.com/debug/backer/0/website" target="_blank"><img src="https://opencollective.com/debug/backer/0/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/1/website" target="_blank"><img src="https://opencollective.com/debug/backer/1/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/2/website" target="_blank"><img src="https://opencollective.com/debug/backer/2/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/3/website" target="_blank"><img src="https://opencollective.com/debug/backer/3/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/4/website" target="_blank"><img src="https://opencollective.com/debug/backer/4/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/5/website" target="_blank"><img src="https://opencollective.com/debug/backer/5/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/6/website" target="_blank"><img src="https://opencollective.com/debug/backer/6/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/7/website" target="_blank"><img src="https://opencollective.com/debug/backer/7/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/8/website" target="_blank"><img src="https://opencollective.com/debug/backer/8/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/9/website" target="_blank"><img src="https://opencollective.com/debug/backer/9/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/10/website" target="_blank"><img src="https://opencollective.com/debug/backer/10/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/11/website" target="_blank"><img src="https://opencollective.com/debug/backer/11/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/12/website" target="_blank"><img src="https://opencollective.com/debug/backer/12/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/13/website" target="_blank"><img src="https://opencollective.com/debug/backer/13/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/14/website" target="_blank"><img src="https://opencollective.com/debug/backer/14/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/15/website" target="_blank"><img src="https://opencollective.com/debug/backer/15/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/16/website" target="_blank"><img src="https://opencollective.com/debug/backer/16/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/17/website" target="_blank"><img src="https://opencollective.com/debug/backer/17/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/18/website" target="_blank"><img src="https://opencollective.com/debug/backer/18/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/19/website" target="_blank"><img src="https://opencollective.com/debug/backer/19/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/20/website" target="_blank"><img src="https://opencollective.com/debug/backer/20/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/21/website" target="_blank"><img src="https://opencollective.com/debug/backer/21/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/22/website" target="_blank"><img src="https://opencollective.com/debug/backer/22/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/23/website" target="_blank"><img src="https://opencollective.com/debug/backer/23/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/24/website" target="_blank"><img src="https://opencollective.com/debug/backer/24/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/25/website" target="_blank"><img src="https://opencollective.com/debug/backer/25/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/26/website" target="_blank"><img src="https://opencollective.com/debug/backer/26/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/27/website" target="_blank"><img src="https://opencollective.com/debug/backer/27/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/28/website" target="_blank"><img src="https://opencollective.com/debug/backer/28/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/29/website" target="_blank"><img src="https://opencollective.com/debug/backer/29/avatar.svg"></a>
+
+
+## Sponsors
+
+Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)]
+
+<a href="https://opencollective.com/debug/sponsor/0/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/0/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/1/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/1/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/2/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/2/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/3/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/3/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/4/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/4/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/5/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/5/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/6/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/6/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/7/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/7/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/8/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/8/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/9/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/9/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/10/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/10/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/11/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/11/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/12/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/12/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/13/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/13/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/14/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/14/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/15/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/15/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/16/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/16/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/17/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/17/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/18/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/18/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/19/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/19/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/20/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/20/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/21/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/21/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/22/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/22/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/23/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/23/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/24/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/24/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/25/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/25/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/26/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/26/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/27/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/27/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/28/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/28/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/29/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/29/avatar.svg"></a>
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2014-2016 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/socket.io-parser/node_modules/debug/component.json b/wrt/node_modules/socket.io-parser/node_modules/debug/component.json
new file mode 100644 (file)
index 0000000..9de2641
--- /dev/null
@@ -0,0 +1,19 @@
+{
+  "name": "debug",
+  "repo": "visionmedia/debug",
+  "description": "small debugging utility",
+  "version": "2.6.9",
+  "keywords": [
+    "debug",
+    "log",
+    "debugger"
+  ],
+  "main": "src/browser.js",
+  "scripts": [
+    "src/browser.js",
+    "src/debug.js"
+  ],
+  "dependencies": {
+    "rauchg/ms.js": "0.7.1"
+  }
+}
diff --git a/wrt/node_modules/socket.io-parser/node_modules/debug/karma.conf.js b/wrt/node_modules/socket.io-parser/node_modules/debug/karma.conf.js
new file mode 100644 (file)
index 0000000..103a82d
--- /dev/null
@@ -0,0 +1,70 @@
+// Karma configuration
+// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC)
+
+module.exports = function(config) {
+  config.set({
+
+    // base path that will be used to resolve all patterns (eg. files, exclude)
+    basePath: '',
+
+
+    // frameworks to use
+    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
+    frameworks: ['mocha', 'chai', 'sinon'],
+
+
+    // list of files / patterns to load in the browser
+    files: [
+      'dist/debug.js',
+      'test/*spec.js'
+    ],
+
+
+    // list of files to exclude
+    exclude: [
+      'src/node.js'
+    ],
+
+
+    // preprocess matching files before serving them to the browser
+    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
+    preprocessors: {
+    },
+
+    // test results reporter to use
+    // possible values: 'dots', 'progress'
+    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
+    reporters: ['progress'],
+
+
+    // web server port
+    port: 9876,
+
+
+    // enable / disable colors in the output (reporters and logs)
+    colors: true,
+
+
+    // level of logging
+    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
+    logLevel: config.LOG_INFO,
+
+
+    // enable / disable watching file and executing tests whenever any file changes
+    autoWatch: true,
+
+
+    // start these browsers
+    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
+    browsers: ['PhantomJS'],
+
+
+    // Continuous Integration mode
+    // if true, Karma captures browsers, runs the tests and exits
+    singleRun: false,
+
+    // Concurrency level
+    // how many browser should be started simultaneous
+    concurrency: Infinity
+  })
+}
diff --git a/wrt/node_modules/socket.io-parser/node_modules/debug/node.js b/wrt/node_modules/socket.io-parser/node_modules/debug/node.js
new file mode 100644 (file)
index 0000000..7fc36fe
--- /dev/null
@@ -0,0 +1 @@
+module.exports = require('./src/node');
diff --git a/wrt/node_modules/socket.io-parser/node_modules/debug/package.json b/wrt/node_modules/socket.io-parser/node_modules/debug/package.json
new file mode 100644 (file)
index 0000000..d5743c5
--- /dev/null
@@ -0,0 +1,148 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "debug@~2.6.6",
+        "scope": null,
+        "escapedName": "debug",
+        "name": "debug",
+        "rawSpec": "~2.6.6",
+        "spec": ">=2.6.6 <2.7.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io"
+    ],
+    [
+      {
+        "raw": "debug@~2.6.4",
+        "scope": null,
+        "escapedName": "debug",
+        "name": "debug",
+        "rawSpec": "~2.6.4",
+        "spec": ">=2.6.4 <2.7.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io-parser"
+    ]
+  ],
+  "_from": "debug@~2.6.4",
+  "_id": "debug@2.6.9",
+  "_inCache": true,
+  "_location": "/socket.io-parser/debug",
+  "_nodeVersion": "8.4.0",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/debug-2.6.9.tgz_1506087154503_0.5196126794908196"
+  },
+  "_npmUser": {
+    "name": "tootallnate",
+    "email": "nathan@tootallnate.net"
+  },
+  "_npmVersion": "5.3.0",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "debug@~2.6.4",
+    "scope": null,
+    "escapedName": "debug",
+    "name": "debug",
+    "rawSpec": "~2.6.4",
+    "spec": ">=2.6.4 <2.7.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/socket.io-parser"
+  ],
+  "_resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+  "_shasum": "5d128515df134ff327e90a4c93f4e077a536341f",
+  "_shrinkwrap": null,
+  "_spec": "debug@~2.6.4",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io-parser",
+  "author": {
+    "name": "TJ Holowaychuk",
+    "email": "tj@vision-media.ca"
+  },
+  "browser": "./src/browser.js",
+  "bugs": {
+    "url": "https://github.com/visionmedia/debug/issues"
+  },
+  "component": {
+    "scripts": {
+      "debug/index.js": "browser.js",
+      "debug/debug.js": "debug.js"
+    }
+  },
+  "contributors": [
+    {
+      "name": "Nathan Rajlich",
+      "email": "nathan@tootallnate.net",
+      "url": "http://n8.io"
+    },
+    {
+      "name": "Andrew Rhyne",
+      "email": "rhyneandrew@gmail.com"
+    }
+  ],
+  "dependencies": {
+    "ms": "2.0.0"
+  },
+  "description": "small debugging utility",
+  "devDependencies": {
+    "browserify": "9.0.3",
+    "chai": "^3.5.0",
+    "concurrently": "^3.1.0",
+    "coveralls": "^2.11.15",
+    "eslint": "^3.12.1",
+    "istanbul": "^0.4.5",
+    "karma": "^1.3.0",
+    "karma-chai": "^0.1.0",
+    "karma-mocha": "^1.3.0",
+    "karma-phantomjs-launcher": "^1.0.2",
+    "karma-sinon": "^1.0.5",
+    "mocha": "^3.2.0",
+    "mocha-lcov-reporter": "^1.2.0",
+    "rimraf": "^2.5.4",
+    "sinon": "^1.17.6",
+    "sinon-chai": "^2.8.0"
+  },
+  "directories": {},
+  "dist": {
+    "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+    "shasum": "5d128515df134ff327e90a4c93f4e077a536341f",
+    "tarball": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz"
+  },
+  "gitHead": "13abeae468fea297d0dccc50bc55590809241083",
+  "homepage": "https://github.com/visionmedia/debug#readme",
+  "keywords": [
+    "debug",
+    "log",
+    "debugger"
+  ],
+  "license": "MIT",
+  "main": "./src/index.js",
+  "maintainers": [
+    {
+      "name": "thebigredgeek",
+      "email": "rhyneandrew@gmail.com"
+    },
+    {
+      "name": "kolban",
+      "email": "kolban1@kolban.com"
+    },
+    {
+      "name": "tootallnate",
+      "email": "nathan@tootallnate.net"
+    },
+    {
+      "name": "tjholowaychuk",
+      "email": "tj@vision-media.ca"
+    }
+  ],
+  "name": "debug",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/visionmedia/debug.git"
+  },
+  "version": "2.6.9"
+}
diff --git a/wrt/node_modules/socket.io-parser/node_modules/debug/src/browser.js b/wrt/node_modules/socket.io-parser/node_modules/debug/src/browser.js
new file mode 100644 (file)
index 0000000..7106924
--- /dev/null
@@ -0,0 +1,185 @@
+/**
+ * This is the web browser implementation of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = require('./debug');
+exports.log = log;
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+exports.storage = 'undefined' != typeof chrome
+               && 'undefined' != typeof chrome.storage
+                  ? chrome.storage.local
+                  : localstorage();
+
+/**
+ * Colors.
+ */
+
+exports.colors = [
+  'lightseagreen',
+  'forestgreen',
+  'goldenrod',
+  'dodgerblue',
+  'darkorchid',
+  'crimson'
+];
+
+/**
+ * Currently only WebKit-based Web Inspectors, Firefox >= v31,
+ * and the Firebug extension (any Firefox version) are known
+ * to support "%c" CSS customizations.
+ *
+ * TODO: add a `localStorage` variable to explicitly enable/disable colors
+ */
+
+function useColors() {
+  // NB: In an Electron preload script, document will be defined but not fully
+  // initialized. Since we know we're in Chrome, we'll just detect this case
+  // explicitly
+  if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
+    return true;
+  }
+
+  // is webkit? http://stackoverflow.com/a/16459606/376773
+  // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
+  return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
+    // is firebug? http://stackoverflow.com/a/398120/376773
+    (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
+    // is firefox >= v31?
+    // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
+    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
+    // double check webkit in userAgent just in case we are in a worker
+    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
+}
+
+/**
+ * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
+ */
+
+exports.formatters.j = function(v) {
+  try {
+    return JSON.stringify(v);
+  } catch (err) {
+    return '[UnexpectedJSONParseError]: ' + err.message;
+  }
+};
+
+
+/**
+ * Colorize log arguments if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+  var useColors = this.useColors;
+
+  args[0] = (useColors ? '%c' : '')
+    + this.namespace
+    + (useColors ? ' %c' : ' ')
+    + args[0]
+    + (useColors ? '%c ' : ' ')
+    + '+' + exports.humanize(this.diff);
+
+  if (!useColors) return;
+
+  var c = 'color: ' + this.color;
+  args.splice(1, 0, c, 'color: inherit')
+
+  // the final "%c" is somewhat tricky, because there could be other
+  // arguments passed either before or after the %c, so we need to
+  // figure out the correct index to insert the CSS into
+  var index = 0;
+  var lastC = 0;
+  args[0].replace(/%[a-zA-Z%]/g, function(match) {
+    if ('%%' === match) return;
+    index++;
+    if ('%c' === match) {
+      // we only are interested in the *last* %c
+      // (the user may have provided their own)
+      lastC = index;
+    }
+  });
+
+  args.splice(lastC, 0, c);
+}
+
+/**
+ * Invokes `console.log()` when available.
+ * No-op when `console.log` is not a "function".
+ *
+ * @api public
+ */
+
+function log() {
+  // this hackery is required for IE8/9, where
+  // the `console.log` function doesn't have 'apply'
+  return 'object' === typeof console
+    && console.log
+    && Function.prototype.apply.call(console.log, console, arguments);
+}
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+
+function save(namespaces) {
+  try {
+    if (null == namespaces) {
+      exports.storage.removeItem('debug');
+    } else {
+      exports.storage.debug = namespaces;
+    }
+  } catch(e) {}
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+
+function load() {
+  var r;
+  try {
+    r = exports.storage.debug;
+  } catch(e) {}
+
+  // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
+  if (!r && typeof process !== 'undefined' && 'env' in process) {
+    r = process.env.DEBUG;
+  }
+
+  return r;
+}
+
+/**
+ * Enable namespaces listed in `localStorage.debug` initially.
+ */
+
+exports.enable(load());
+
+/**
+ * Localstorage attempts to return the localstorage.
+ *
+ * This is necessary because safari throws
+ * when a user disables cookies/localstorage
+ * and you attempt to access it.
+ *
+ * @return {LocalStorage}
+ * @api private
+ */
+
+function localstorage() {
+  try {
+    return window.localStorage;
+  } catch (e) {}
+}
diff --git a/wrt/node_modules/socket.io-parser/node_modules/debug/src/debug.js b/wrt/node_modules/socket.io-parser/node_modules/debug/src/debug.js
new file mode 100644 (file)
index 0000000..6a5e3fc
--- /dev/null
@@ -0,0 +1,202 @@
+
+/**
+ * This is the common logic for both the Node.js and web browser
+ * implementations of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
+exports.coerce = coerce;
+exports.disable = disable;
+exports.enable = enable;
+exports.enabled = enabled;
+exports.humanize = require('ms');
+
+/**
+ * The currently active debug mode names, and names to skip.
+ */
+
+exports.names = [];
+exports.skips = [];
+
+/**
+ * Map of special "%n" handling functions, for the debug "format" argument.
+ *
+ * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
+ */
+
+exports.formatters = {};
+
+/**
+ * Previous log timestamp.
+ */
+
+var prevTime;
+
+/**
+ * Select a color.
+ * @param {String} namespace
+ * @return {Number}
+ * @api private
+ */
+
+function selectColor(namespace) {
+  var hash = 0, i;
+
+  for (i in namespace) {
+    hash  = ((hash << 5) - hash) + namespace.charCodeAt(i);
+    hash |= 0; // Convert to 32bit integer
+  }
+
+  return exports.colors[Math.abs(hash) % exports.colors.length];
+}
+
+/**
+ * Create a debugger with the given `namespace`.
+ *
+ * @param {String} namespace
+ * @return {Function}
+ * @api public
+ */
+
+function createDebug(namespace) {
+
+  function debug() {
+    // disabled?
+    if (!debug.enabled) return;
+
+    var self = debug;
+
+    // set `diff` timestamp
+    var curr = +new Date();
+    var ms = curr - (prevTime || curr);
+    self.diff = ms;
+    self.prev = prevTime;
+    self.curr = curr;
+    prevTime = curr;
+
+    // turn the `arguments` into a proper Array
+    var args = new Array(arguments.length);
+    for (var i = 0; i < args.length; i++) {
+      args[i] = arguments[i];
+    }
+
+    args[0] = exports.coerce(args[0]);
+
+    if ('string' !== typeof args[0]) {
+      // anything else let's inspect with %O
+      args.unshift('%O');
+    }
+
+    // apply any `formatters` transformations
+    var index = 0;
+    args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
+      // if we encounter an escaped % then don't increase the array index
+      if (match === '%%') return match;
+      index++;
+      var formatter = exports.formatters[format];
+      if ('function' === typeof formatter) {
+        var val = args[index];
+        match = formatter.call(self, val);
+
+        // now we need to remove `args[index]` since it's inlined in the `format`
+        args.splice(index, 1);
+        index--;
+      }
+      return match;
+    });
+
+    // apply env-specific formatting (colors, etc.)
+    exports.formatArgs.call(self, args);
+
+    var logFn = debug.log || exports.log || console.log.bind(console);
+    logFn.apply(self, args);
+  }
+
+  debug.namespace = namespace;
+  debug.enabled = exports.enabled(namespace);
+  debug.useColors = exports.useColors();
+  debug.color = selectColor(namespace);
+
+  // env-specific initialization logic for debug instances
+  if ('function' === typeof exports.init) {
+    exports.init(debug);
+  }
+
+  return debug;
+}
+
+/**
+ * Enables a debug mode by namespaces. This can include modes
+ * separated by a colon and wildcards.
+ *
+ * @param {String} namespaces
+ * @api public
+ */
+
+function enable(namespaces) {
+  exports.save(namespaces);
+
+  exports.names = [];
+  exports.skips = [];
+
+  var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
+  var len = split.length;
+
+  for (var i = 0; i < len; i++) {
+    if (!split[i]) continue; // ignore empty strings
+    namespaces = split[i].replace(/\*/g, '.*?');
+    if (namespaces[0] === '-') {
+      exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
+    } else {
+      exports.names.push(new RegExp('^' + namespaces + '$'));
+    }
+  }
+}
+
+/**
+ * Disable debug output.
+ *
+ * @api public
+ */
+
+function disable() {
+  exports.enable('');
+}
+
+/**
+ * Returns true if the given mode name is enabled, false otherwise.
+ *
+ * @param {String} name
+ * @return {Boolean}
+ * @api public
+ */
+
+function enabled(name) {
+  var i, len;
+  for (i = 0, len = exports.skips.length; i < len; i++) {
+    if (exports.skips[i].test(name)) {
+      return false;
+    }
+  }
+  for (i = 0, len = exports.names.length; i < len; i++) {
+    if (exports.names[i].test(name)) {
+      return true;
+    }
+  }
+  return false;
+}
+
+/**
+ * Coerce `val`.
+ *
+ * @param {Mixed} val
+ * @return {Mixed}
+ * @api private
+ */
+
+function coerce(val) {
+  if (val instanceof Error) return val.stack || val.message;
+  return val;
+}
diff --git a/wrt/node_modules/socket.io-parser/node_modules/debug/src/index.js b/wrt/node_modules/socket.io-parser/node_modules/debug/src/index.js
new file mode 100644 (file)
index 0000000..e12cf4d
--- /dev/null
@@ -0,0 +1,10 @@
+/**
+ * Detect Electron renderer process, which is node, but we should
+ * treat as a browser.
+ */
+
+if (typeof process !== 'undefined' && process.type === 'renderer') {
+  module.exports = require('./browser.js');
+} else {
+  module.exports = require('./node.js');
+}
diff --git a/wrt/node_modules/socket.io-parser/node_modules/debug/src/inspector-log.js b/wrt/node_modules/socket.io-parser/node_modules/debug/src/inspector-log.js
new file mode 100644 (file)
index 0000000..60ea6c0
--- /dev/null
@@ -0,0 +1,15 @@
+module.exports = inspectorLog;
+
+// black hole
+const nullStream = new (require('stream').Writable)();
+nullStream._write = () => {};
+
+/**
+ * Outputs a `console.log()` to the Node.js Inspector console *only*.
+ */
+function inspectorLog() {
+  const stdout = console._stdout;
+  console._stdout = nullStream;
+  console.log.apply(console, arguments);
+  console._stdout = stdout;
+}
diff --git a/wrt/node_modules/socket.io-parser/node_modules/debug/src/node.js b/wrt/node_modules/socket.io-parser/node_modules/debug/src/node.js
new file mode 100644 (file)
index 0000000..b15109c
--- /dev/null
@@ -0,0 +1,248 @@
+/**
+ * Module dependencies.
+ */
+
+var tty = require('tty');
+var util = require('util');
+
+/**
+ * This is the Node.js implementation of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = require('./debug');
+exports.init = init;
+exports.log = log;
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+
+/**
+ * Colors.
+ */
+
+exports.colors = [6, 2, 3, 4, 5, 1];
+
+/**
+ * Build up the default `inspectOpts` object from the environment variables.
+ *
+ *   $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
+ */
+
+exports.inspectOpts = Object.keys(process.env).filter(function (key) {
+  return /^debug_/i.test(key);
+}).reduce(function (obj, key) {
+  // camel-case
+  var prop = key
+    .substring(6)
+    .toLowerCase()
+    .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });
+
+  // coerce string value into JS value
+  var val = process.env[key];
+  if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
+  else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
+  else if (val === 'null') val = null;
+  else val = Number(val);
+
+  obj[prop] = val;
+  return obj;
+}, {});
+
+/**
+ * The file descriptor to write the `debug()` calls to.
+ * Set the `DEBUG_FD` env variable to override with another value. i.e.:
+ *
+ *   $ DEBUG_FD=3 node script.js 3>debug.log
+ */
+
+var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
+
+if (1 !== fd && 2 !== fd) {
+  util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')()
+}
+
+var stream = 1 === fd ? process.stdout :
+             2 === fd ? process.stderr :
+             createWritableStdioStream(fd);
+
+/**
+ * Is stdout a TTY? Colored output is enabled when `true`.
+ */
+
+function useColors() {
+  return 'colors' in exports.inspectOpts
+    ? Boolean(exports.inspectOpts.colors)
+    : tty.isatty(fd);
+}
+
+/**
+ * Map %o to `util.inspect()`, all on a single line.
+ */
+
+exports.formatters.o = function(v) {
+  this.inspectOpts.colors = this.useColors;
+  return util.inspect(v, this.inspectOpts)
+    .split('\n').map(function(str) {
+      return str.trim()
+    }).join(' ');
+};
+
+/**
+ * Map %o to `util.inspect()`, allowing multiple lines if needed.
+ */
+
+exports.formatters.O = function(v) {
+  this.inspectOpts.colors = this.useColors;
+  return util.inspect(v, this.inspectOpts);
+};
+
+/**
+ * Adds ANSI color escape codes if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+  var name = this.namespace;
+  var useColors = this.useColors;
+
+  if (useColors) {
+    var c = this.color;
+    var prefix = '  \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m';
+
+    args[0] = prefix + args[0].split('\n').join('\n' + prefix);
+    args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m');
+  } else {
+    args[0] = new Date().toUTCString()
+      + ' ' + name + ' ' + args[0];
+  }
+}
+
+/**
+ * Invokes `util.format()` with the specified arguments and writes to `stream`.
+ */
+
+function log() {
+  return stream.write(util.format.apply(util, arguments) + '\n');
+}
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+
+function save(namespaces) {
+  if (null == namespaces) {
+    // If you set a process.env field to null or undefined, it gets cast to the
+    // string 'null' or 'undefined'. Just delete instead.
+    delete process.env.DEBUG;
+  } else {
+    process.env.DEBUG = namespaces;
+  }
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+
+function load() {
+  return process.env.DEBUG;
+}
+
+/**
+ * Copied from `node/src/node.js`.
+ *
+ * XXX: It's lame that node doesn't expose this API out-of-the-box. It also
+ * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.
+ */
+
+function createWritableStdioStream (fd) {
+  var stream;
+  var tty_wrap = process.binding('tty_wrap');
+
+  // Note stream._type is used for test-module-load-list.js
+
+  switch (tty_wrap.guessHandleType(fd)) {
+    case 'TTY':
+      stream = new tty.WriteStream(fd);
+      stream._type = 'tty';
+
+      // Hack to have stream not keep the event loop alive.
+      // See https://github.com/joyent/node/issues/1726
+      if (stream._handle && stream._handle.unref) {
+        stream._handle.unref();
+      }
+      break;
+
+    case 'FILE':
+      var fs = require('fs');
+      stream = new fs.SyncWriteStream(fd, { autoClose: false });
+      stream._type = 'fs';
+      break;
+
+    case 'PIPE':
+    case 'TCP':
+      var net = require('net');
+      stream = new net.Socket({
+        fd: fd,
+        readable: false,
+        writable: true
+      });
+
+      // FIXME Should probably have an option in net.Socket to create a
+      // stream from an existing fd which is writable only. But for now
+      // we'll just add this hack and set the `readable` member to false.
+      // Test: ./node test/fixtures/echo.js < /etc/passwd
+      stream.readable = false;
+      stream.read = null;
+      stream._type = 'pipe';
+
+      // FIXME Hack to have stream not keep the event loop alive.
+      // See https://github.com/joyent/node/issues/1726
+      if (stream._handle && stream._handle.unref) {
+        stream._handle.unref();
+      }
+      break;
+
+    default:
+      // Probably an error on in uv_guess_handle()
+      throw new Error('Implement me. Unknown stream file type!');
+  }
+
+  // For supporting legacy API we put the FD here.
+  stream.fd = fd;
+
+  stream._isStdio = true;
+
+  return stream;
+}
+
+/**
+ * Init logic for `debug` instances.
+ *
+ * Create a new `inspectOpts` object in case `useColors` is set
+ * differently for a particular `debug` instance.
+ */
+
+function init (debug) {
+  debug.inspectOpts = {};
+
+  var keys = Object.keys(exports.inspectOpts);
+  for (var i = 0; i < keys.length; i++) {
+    debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
+  }
+}
+
+/**
+ * Enable namespaces listed in `process.env.DEBUG` initially.
+ */
+
+exports.enable(load());
diff --git a/wrt/node_modules/socket.io-parser/node_modules/isarray/README.md b/wrt/node_modules/socket.io-parser/node_modules/isarray/README.md
new file mode 100644 (file)
index 0000000..38a91f6
--- /dev/null
@@ -0,0 +1,54 @@
+
+# isarray
+
+`Array#isArray` for older browsers.
+
+[![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray)
+[![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray)
+
+[![browser support](https://ci.testling.com/juliangruber/isarray.png)
+](https://ci.testling.com/juliangruber/isarray)
+
+## Usage
+
+```js
+var isArray = require('isarray');
+
+console.log(isArray([])); // => true
+console.log(isArray({})); // => false
+```
+
+## Installation
+
+With [npm](https://npmjs.org) do
+
+```bash
+$ npm install isarray
+```
+
+Then bundle for the browser with
+[browserify](https://github.com/substack/node-browserify).
+
+## License
+
+(MIT)
+
+Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/wrt/node_modules/socket.io-parser/node_modules/isarray/index.js b/wrt/node_modules/socket.io-parser/node_modules/isarray/index.js
new file mode 100644 (file)
index 0000000..a57f634
--- /dev/null
@@ -0,0 +1,5 @@
+var toString = {}.toString;
+
+module.exports = Array.isArray || function (arr) {
+  return toString.call(arr) == '[object Array]';
+};
diff --git a/wrt/node_modules/socket.io-parser/node_modules/isarray/package.json b/wrt/node_modules/socket.io-parser/node_modules/isarray/package.json
new file mode 100644 (file)
index 0000000..11e33df
--- /dev/null
@@ -0,0 +1,123 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "isarray@2.0.1",
+        "scope": null,
+        "escapedName": "isarray",
+        "name": "isarray",
+        "rawSpec": "2.0.1",
+        "spec": "2.0.1",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/has-binary2"
+    ],
+    [
+      {
+        "raw": "isarray@2.0.1",
+        "scope": null,
+        "escapedName": "isarray",
+        "name": "isarray",
+        "rawSpec": "2.0.1",
+        "spec": "2.0.1",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io-parser"
+    ]
+  ],
+  "_from": "isarray@2.0.1",
+  "_id": "isarray@2.0.1",
+  "_inCache": true,
+  "_location": "/socket.io-parser/isarray",
+  "_nodeVersion": "4.4.7",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/isarray-2.0.1.tgz_1475080038422_0.2867460672277957"
+  },
+  "_npmUser": {
+    "name": "juliangruber",
+    "email": "julian@juliangruber.com"
+  },
+  "_npmVersion": "2.15.8",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "isarray@2.0.1",
+    "scope": null,
+    "escapedName": "isarray",
+    "name": "isarray",
+    "rawSpec": "2.0.1",
+    "spec": "2.0.1",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/socket.io-parser"
+  ],
+  "_resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz",
+  "_shasum": "a37d94ed9cda2d59865c9f76fe596ee1f338741e",
+  "_shrinkwrap": null,
+  "_spec": "isarray@2.0.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io-parser",
+  "author": {
+    "name": "Julian Gruber",
+    "email": "mail@juliangruber.com",
+    "url": "http://juliangruber.com"
+  },
+  "bugs": {
+    "url": "https://github.com/juliangruber/isarray/issues"
+  },
+  "dependencies": {},
+  "description": "Array#isArray for older browsers",
+  "devDependencies": {
+    "tape": "~2.13.4"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "a37d94ed9cda2d59865c9f76fe596ee1f338741e",
+    "tarball": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz"
+  },
+  "files": [
+    "index.js"
+  ],
+  "gitHead": "d7f00583d8f58215cea94a81de85c6b4d33bead2",
+  "homepage": "https://github.com/juliangruber/isarray",
+  "keywords": [
+    "browser",
+    "isarray",
+    "array"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "juliangruber",
+      "email": "julian@juliangruber.com"
+    }
+  ],
+  "name": "isarray",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/juliangruber/isarray.git"
+  },
+  "scripts": {
+    "test": "tape test.js"
+  },
+  "testling": {
+    "files": "test.js",
+    "browsers": [
+      "ie/8..latest",
+      "firefox/17..latest",
+      "firefox/nightly",
+      "chrome/22..latest",
+      "chrome/canary",
+      "opera/12..latest",
+      "opera/next",
+      "safari/5.1..latest",
+      "ipad/6.0..latest",
+      "iphone/6.0..latest",
+      "android-browser/4.2..latest"
+    ]
+  },
+  "version": "2.0.1"
+}
diff --git a/wrt/node_modules/socket.io-parser/package.json b/wrt/node_modules/socket.io-parser/package.json
new file mode 100644 (file)
index 0000000..4dbba45
--- /dev/null
@@ -0,0 +1,103 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "socket.io-parser@~3.1.1",
+        "scope": null,
+        "escapedName": "socket.io-parser",
+        "name": "socket.io-parser",
+        "rawSpec": "~3.1.1",
+        "spec": ">=3.1.1 <3.2.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io"
+    ]
+  ],
+  "_from": "socket.io-parser@>=3.1.1 <3.2.0",
+  "_id": "socket.io-parser@3.1.2",
+  "_inCache": true,
+  "_location": "/socket.io-parser",
+  "_nodeVersion": "6.9.4",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/socket.io-parser-3.1.2.tgz_1493329580053_0.09636084409430623"
+  },
+  "_npmUser": {
+    "name": "darrachequesne",
+    "email": "damien.arrachequesne@gmail.com"
+  },
+  "_npmVersion": "3.10.10",
+  "_phantomChildren": {
+    "ms": "2.0.0"
+  },
+  "_requested": {
+    "raw": "socket.io-parser@~3.1.1",
+    "scope": null,
+    "escapedName": "socket.io-parser",
+    "name": "socket.io-parser",
+    "rawSpec": "~3.1.1",
+    "spec": ">=3.1.1 <3.2.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/socket.io",
+    "/socket.io-client"
+  ],
+  "_resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.1.2.tgz",
+  "_shasum": "dbc2282151fc4faebbe40aeedc0772eba619f7f2",
+  "_shrinkwrap": null,
+  "_spec": "socket.io-parser@~3.1.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io",
+  "bugs": {
+    "url": "https://github.com/Automattic/socket.io-parser/issues"
+  },
+  "dependencies": {
+    "component-emitter": "1.2.1",
+    "debug": "~2.6.4",
+    "has-binary2": "~1.0.2",
+    "isarray": "2.0.1"
+  },
+  "description": "socket.io protocol parser",
+  "devDependencies": {
+    "benchmark": "2.1.2",
+    "expect.js": "0.3.1",
+    "mocha": "3.2.0",
+    "socket.io-browsers": "^1.0.0",
+    "zuul": "3.11.1",
+    "zuul-ngrok": "4.0.0"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "dbc2282151fc4faebbe40aeedc0772eba619f7f2",
+    "tarball": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.1.2.tgz"
+  },
+  "files": [
+    "binary.js",
+    "index.js",
+    "is-buffer.js"
+  ],
+  "gitHead": "f9c3549dd17df095b0806086df3f4834ddc98d45",
+  "homepage": "https://github.com/Automattic/socket.io-parser#readme",
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "darrachequesne",
+      "email": "damien.arrachequesne@gmail.com"
+    },
+    {
+      "name": "rauchg",
+      "email": "rauchg@gmail.com"
+    }
+  ],
+  "name": "socket.io-parser",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/Automattic/socket.io-parser.git"
+  },
+  "scripts": {
+    "test": "make test"
+  },
+  "version": "3.1.2"
+}
diff --git a/wrt/node_modules/socket.io/History.md b/wrt/node_modules/socket.io/History.md
new file mode 100644 (file)
index 0000000..e750230
--- /dev/null
@@ -0,0 +1,720 @@
+
+2.0.3 / 2017-06-12
+===================
+
+  * [fix] Reset rooms object before broadcasting (#2970)
+  * [fix] Fix middleware initialization (#2969)
+  * [docs] Update slack badge (#2961)
+  * [docs] Update webpack example (#2960)
+
+2.0.2 / 2017-06-01
+===================
+
+  * [fix] Fix timing issues with middleware (#2948)
+
+2.0.1 / 2017-05-09
+===================
+
+  * [fix] Update path of client file (#2934)
+
+2.0.0 / 2017-05-09
+===================
+
+  * [feat] Move binary detection to the parser (#2923)
+  * [feat] Allow to join several rooms at once (#2879)
+  * [feat] Merge Engine.IO and Socket.IO handshake packets (#2833)
+  * [feat] Allow the use of custom parsers (#2829)
+
+  * [fix] Use path.resolve by default and require.resolve as a fallback (#2797)
+  * [fix] Properly close the connection on error (#2681)
+  * [fix] Prevent null from being accepted as argument (#2606)
+
+  * [perf] Use shared instance of the encoder (#2825)
+  * [perf] Reset properties instead of deleting them (#2826)
+  * [perf] micro-optimisations (#2793)
+
+  * [chore] Merge history of 1.7.x and 0.9.x branches (#2930)
+  * [chore] Added backers and sponsors on the README (#2933)
+  * [chore] Bump dependencies (#2926)
+  * [chore] Bump socket.io-adapter to version 1.0.0 (#2867)
+  * [chore] Bump engine.io to version 2.0.2 (#2864)
+  * [chore] Bump engine.io to version 2.0.0 (#2832)
+  * [chore] Update issue template with fiddle (#2811)
+  * [chore] Update copyright year LICENSE to 2017 (#2803)
+
+  * [docs] Add an example of custom parser (#2929)
+  * [docs] Replace non-breaking space with proper whitespace (#2913)
+  * [docs] Update emit cheatsheet (#2906)
+  * [docs] Explicitly document that Server extends EventEmitter (#2874)
+  * [docs] Add server.engine.generateId attribute (#2880)
+  * [docs] Fix wrong space character in README (#2900)
+  * [docs] Fix documentation for 'connect' event (#2898)
+  * [docs] Add webpack build example (#2828)
+  * [docs] Update the wording to match the code example (#2853)
+  * [docs] Small addition to the Express Readme Part (#2846)
+  * [docs] Add a 'Features' section in the README (#2824)
+  * [docs] Add httpd cluster example (#2819)
+  * [docs] Add haproxy cluster example (#2818)
+  * [docs] Add nginx cluster example (#2817)
+  * [docs] Implement whiteboard example (#2810)
+  * [docs] Fix documentation for `local` flag (#2816)
+  * [docs] Add emit cheatsheet (#2815)
+  * [docs] Add pingInterval/pingTimeout/transports options in the API documentation (#2814)
+  * [docs] Add an example for socket.join() method (#2813)
+  * [docs] Fix a typo on `clients` method in the API documentation (#2812)
+  * [docs] Fix wrong argument name in API.md (#2802)
+  * [docs] Add install script on Readme.md (#2780)
+  * [docs] API documentation (#2784)
+
+1.7.4 / 2017-05-07
+===================
+
+  * [chore] Bump engine.io to version 1.8.4
+
+0.9.18 / 2017-05-07
+===================
+
+  * Remove process.EventEmitter usage for Node 7.x
+
+1.7.3 / 2017-02-17
+===================
+
+  * [chore] Bump engine.io to version 1.8.3
+
+1.7.2 / 2016-12-11
+===================
+
+  * [chore] Bump engine.io to version 1.8.2 (#2782)
+  * [fix] Fixes socket.use error packet (#2772)
+
+1.7.1 / 2016-11-28
+===================
+
+1.7.0 / 2016-11-27
+===================
+
+  * [docs] Comment connected socket availability for adapters (#2081)
+  * [docs] Fixed grammar issues in the README.md (#2159)
+  * [feature] serve sourcemap for socket.io-client (#2482)
+  * [feature] Add a `local` flag (#2628)
+  * [chore] Bump engine.io to version 1.8.1 (#2765)
+  * [chore] Update client location and serve minified file (#2766)
+
+1.6.0 / 2016-11-20
+==================
+
+  * [fix] Make ETag header comply with standard. (#2603)
+  * [feature] Loading client script on demand. (#2567)
+  * [test] Fix leaking clientSocket (#2721)
+  * [feature] Add support for all event emitter methods (#2601)
+  * [chore] Update year to 2016 (#2456)
+  * [feature] Add support for socket middleware (#2306)
+  * [feature] add support for Server#close(callback) (#2748)
+  * [fix] Don't drop query variables on handshake (#2745)
+  * [example] Add disconnection/reconnection logs to the chat example (#2675)
+  * [perf] Minor code optimizations (#2219)
+  * [chore] Bump debug to version 2.3.3 (#2754)
+  * [chore] Bump engine.io to version 1.8.0 (#2755)
+  * [chore] Bump socket.io-adapter to version 0.5.0 (#2756)
+
+1.5.1 / 2016-10-24
+==================
+
+  * [fix] Avoid swallowing exceptions thrown by user event handlers (#2682)
+  * [test] Use client function to unify `client` in test script (#2731)
+  * [docs] Add link to LICENSE (#2221)
+  * [docs] Fix JSDoc of optional parameters (#2465)
+  * [docs] Fix typo (#2724)
+  * [docs] Link readme npm package badge to npm registry page (#2612)
+  * [docs] Minor fixes (#2526)
+  * [chore] Bump socket.io-parser to 2.3.0 (#2730)
+  * [chore] Add Github issue and PR templates (#2733)
+  * [chore] Bump engine.io to 1.7.2 (#2729)
+  * [chore] Bump socket.io-parser to 2.3.1 (#2734)
+
+1.5.0 / 2016-10-06
+==================
+
+  * [feature] stop append /# before id when no namespace (#2508)
+  * [feature] Add a 'disconnecting' event to access to socket.rooms upon disconnection (#2332)
+  * [fix] Fix query string management (#2422)
+  * [fix] add quote to exec paths, prevent error when spaces in path (#2508)
+  * [docs] Prevent mixup for new programmers (#2599)
+  * [example] Fix chat display in Firefox (#2477)
+  * [chore] Add gulp & babel in the build process (#2471)
+  * [chore] Bump engine.io to 1.7.0 (#2707)
+  * [chore] Remove unused zuul-ngrok dependency (#2708)
+  * [chore] Point towards current master of socket.io-client (#2710)
+  * [chore] Restrict files included in npm package (#2709)
+  * [chore] Link build badge to master branch (#2549)
+
+1.4.8 / 2016-06-23
+==================
+
+  * package: bump `engine.io`
+
+1.4.7 / 2016-06-23
+==================
+
+  * package: bump `engine.io`
+
+1.4.6 / 2016-05-02
+==================
+
+  * package: bump engine.io
+
+1.4.5 / 2016-01-26
+==================
+
+  * fix closing the underlying `http.Server`
+
+1.4.4 / 2016-01-10
+==================
+
+  * package: bump `engine.io`
+
+1.4.3 / 2016-01-08
+==================
+
+  * bump `socket.io-client`
+
+1.4.2 / 2016-01-07
+==================
+
+  * bump `engine.io`
+
+1.4.1 / 2016-01-07
+==================
+
+  * version bump
+
+1.4.0 / 2015-11-28
+==================
+
+  * socket.io: increase large binary data test timeout
+  * package: bump `engine.io` for release
+  * trigger callback even when joining an already joined room
+  * package: bump parser
+  * namespace: clear rooms flag after a clients call (fixes #1978)
+  * package: bump `socket.io-parser`
+  * fixed tests with large data
+  * fixed a typo in the example code
+  * package: bump mocha
+  * package: bump `has-binary` and `zuul-ngrok`
+  * package: bump `engine.io` and `socket.io-client`
+  * README: clarified documentation of Socket.in
+  * README: fixed up legacy repo links
+  * test: better timeout for stress test
+  * socket: don't set request property which has a getter
+  * removed proxy index file
+  * support flags on namespace
+  * improve Socket#packet and Client#packet
+  * socket: warn node_redis-style about missing `error`
+  * test: added failing test
+  * test: increase timeout for large binary data test
+  * package: bump `has-binary` to work with all objects (fixes #1955)
+  * fix origin verification default https port [evanlucas]
+  * support compression [nkzawa]
+  * changed type of `Client#sockets`, `Namespace#sockets` and `Socket#rooms` to maps (instead of arrays)
+
+1.3.7 / 2015-09-21
+==================
+
+  * package: bump `socket.io-client` for node4 compatibility
+  * package: bump `engine.io` for node4 compatibility
+
+1.3.6 / 2015-07-14
+==================
+
+  * package: bump `engine.io` to fix build on windows
+
+1.3.5 / 2015-03-03
+==================
+
+ * package: bump `socket.io-parser`
+
+1.3.4 / 2015-02-14
+==================
+
+ * package: bump `socket.io-client`
+
+1.3.3 / 2015-02-03
+==================
+
+ * socket: warn node_redis-style about missing `error`
+ * package: bump parser to better handle bad binary packets
+
+1.3.2 / 2015-01-19
+==================
+
+ * no change on this release
+
+1.3.1 / 2015-01-19
+==================
+
+ * no change on this release
+ * package: bump `engine.io`
+
+1.3.0 / 2015-01-19
+==================
+
+ * package: bump `engine.io`
+ * add test for reconnection after server restarts [rase-]
+ * update license with up-to-date year range [fay-jai]
+ * fix leaving unknown rooms [defunctzombie]
+ * allow null origins when allowed origins is a function [drewblaisdell]
+ * fix tests on node 0.11
+ * package: fix `npm test` to run on windows
+ * package: bump `debug` v2.1.0 [coderaiser]
+ * added tests for volatile [rase-]
+
+1.2.1 / 2014-11-21
+==================
+
+ * fix protocol violations and improve error handling (GH-1880)
+ * package: bump `engine.io` for websocket leak fix [3rd-Eden]
+ * style tweaks
+
+1.2.0 / 2014-10-27
+==================
+
+ * package: bump `engine.io`
+ * downloads badge
+ * add test to check that empty rooms are autopruned
+ * added Server#origins(v:Function) description for dynamic CORS
+ * added test coverage for Server#origins(function) for dynamic CORS
+ * added optional Server#origins(function) for dynamic CORS
+ * fix usage example for Server#close
+ * package: fix main file for example application 'chat'
+ * package: bump `socket.io-parser`
+ * update README http ctor to createServer()
+ * bump adapter with a lot of fixes for room bookkeeping
+
+1.1.0 / 2014-09-04
+==================
+
+ * examples: minor fix of escaping
+ * testing for equivalence of namespaces starting with / or without
+ * update index.js
+ * added relevant tests
+ * take "" and "/" as equivalent namespaces on server
+ * use svg instead of png to get better image quality in readme
+ * make CI build faster
+ * fix splice arguments and `socket.rooms` value update in `socket.leaveAll`.
+ * client cannot connect to non-existing namespaces
+ * bump engine.io version to get the cached IP address
+ * fixed handshake object address property and made the test case more strict.
+ * package: bump `engine.io`
+ * fixed the failing test where server crashes on disconnect involving connectBuffer
+ * npmignore: ignore `.gitignore` (fixes #1607)
+ * test: added failing case for `socket.disconnect` and nsps
+ * fix repo in package.json
+ * improve Close documentation
+ * use ephemeral ports
+ * fix: We should use the standard http protocol to handler the etag header.
+ * override default browser font-family for inputs
+ * update has-binary-data to 1.0.3
+ * add close specs
+ * add ability to stop the http server even if not created inside socket.io
+ * make sure server gets close
+ * Add test case for checking that reconnect_failed is fired only once upon failure
+ * package: bump `socket.io-parser` for `component-emitter` dep fix
+
+1.0.6 / 2014-06-19
+==================
+
+ * package: bump `socket.io-client`
+
+1.0.5 / 2014-06-16
+==================
+
+ * package: bump `engine.io` to fix jsonp `\n` bug and CORS warnings
+ * index: fix typo [yanatan16]
+ * add `removeListener` to blacklisted events
+ * examples: clearer instructions to install chat example
+ * index: fix namespace `connectBuffer` issue
+
+1.0.4 / 2014-06-02
+==================
+
+ * package: bump socket.io-client
+
+1.0.3 / 2014-05-31
+==================
+
+ * package: bump `socket.io-client`
+ * package: bump `socket.io-parser` for binary ACK fix
+ * package: bump `engine.io` for binary UTF8 fix
+ * example: fix XSS in chat example
+
+1.0.2 / 2014-05-28
+==================
+
+ * package: bump `socket.io-parser` for windows fix
+
+1.0.1 / 2014-05-28
+==================
+
+ * bump due to bad npm tag
+
+1.0.0 / 2014-05-28
+==================
+
+ * stable release
+
+1.0.0-pre5 / 2014-05-22
+=======================
+
+ * package: bump `socket.io-client` for parser fixes
+ * package: bump `engine.io`
+
+1.0.0-pre4 / 2014-05-19
+=======================
+
+ * package: bump client
+
+1.0.0-pre3 / 2014-05-17
+=======================
+
+ * package: bump parser
+ * package: bump engine.io
+
+1.0.0-pre2 / 2014-04-27
+=======================
+
+ * package: bump `engine.io`
+ * added backwards compatible of engine.io maxHttpBufferSize
+ * added test that server and client using same protocol
+ * added support for setting allowed origins
+ * added information about logging
+ * the set function in server can be used to set some attributes for BC
+ * fix error in callback call 'done' instead of 'next' in docs
+ * package: bump `socket.io-parser`
+ * package: bump `expect.js`
+ * added some new tests, including binary with acks
+
+1.0.0-pre / 2014-03-14
+======================
+
+ * implemented `engine.io`
+ * implemented `socket.io-adapter`
+ * implemented `socket.io-protocol`
+ * implemented `debug` and improved instrumentation
+ * added binary support
+ * added new `require('io')(srv)` signature
+ * simplified `socket.io-client` serving
+
+0.9.14 / 2013-03-29
+===================
+
+  * manager: fix memory leak with SSL [jpallen]
+
+0.9.13 / 2012-12-13
+===================
+
+  * package: fixed `base64id` requirement
+
+0.9.12 / 2012-12-13
+===================
+
+  * manager: fix for latest node which is returning a clone with `listeners` [viirya]
+
+0.9.11 / 2012-11-02
+===================
+
+  * package: move redis to optionalDependenices [3rd-Eden]
+  * bumped client
+
+0.9.10 / 2012-08-10
+===================
+
+  * Don't lowercase log messages
+  * Always set the HTTP response in case an error should be returned to the client
+  * Create or destroy the flash policy server on configuration change
+  * Honour configuration to disable flash policy server
+  * Add express 3.0 instructions on Readme.md
+  * Bump client
+
+0.9.9 / 2012-08-01
+==================
+
+  * Fixed sync disconnect xhrs handling
+  * Put license text in its own file (#965)
+  * Add warning to .listen() to ease the migration to Express 3.x
+  * Restored compatibility with node 0.4.x
+
+0.9.8 / 2012-07-24
+==================
+
+  * Bumped client.
+
+0.9.7 / 2012-07-24
+==================
+
+  * Prevent crash when socket leaves a room twice.
+  * Corrects unsafe usage of for..in
+  * Fix for node 0.8 with `gzip compression` [vadimi]
+  * Update redis to support Node 0.8.x
+  * Made ID generation securely random
+  * Fix Redis Store race condition in manager onOpen unsubscribe callback
+  * Fix for EventEmitters always reusing the same Array instance for listeners
+
+0.9.6 / 2012-04-17
+==================
+
+  * Fixed XSS in jsonp-polling.
+
+0.9.5 / 2012-04-05
+==================
+
+  * Added test for polling and socket close.
+  * Ensure close upon request close.
+  * Fix disconnection reason being lost for polling transports.
+  * Ensure that polling transports work with Connection: close.
+  * Log disconnection reason.
+
+0.9.4 / 2012-04-01
+==================
+
+  * Disconnecting from namespace improvement (#795) [DanielBaulig]
+  * Bumped client with polling reconnection loop (#438)
+
+0.9.3 / 2012-03-28
+==================
+
+  * Fix "Syntax error" on FF Web Console with XHR Polling [mikito]
+
+0.9.2 / 2012-03-13
+==================
+
+  * More sensible close `timeout default` (fixes disconnect issue)
+
+0.9.1-1 / 2012-03-02
+====================
+
+  * Bumped client with NPM dependency fix.
+
+0.9.1 / 2012-03-02
+==================
+
+  * Changed heartbeat timeout and interval defaults (60 and 25 seconds)
+  * Make tests work both on 0.4 and 0.6
+  * Updated client (improvements + bug fixes).
+
+0.9.0 / 2012-02-26
+==================
+
+  * Make it possible to use a regexp to match the socket.io resource URL.
+    We need this because we have to prefix the socket.io URL with a variable ID.
+  * Supplemental fix to gavinuhma/authfix, it looks like the same Access-Control-Origin logic is needed in the http and xhr-polling transports
+  * Updated express dep for windows compatibility.
+  * Combine two substr calls into one in decodePayload to improve performance
+  * Minor documentation fix
+  * Minor. Conform to style of other files.
+  * Switching setting to 'match origin protocol'
+  * Revert "Fixes leaking Redis subscriptions for #663. The local flag was not getting passed through onClientDisconnect()."
+  * Revert "Handle leaked dispatch:[id] subscription."
+  * Merge pull request #667 from dshaw/patch/redis-disconnect
+  * Handle leaked dispatch:[id] subscription.
+  * Fixes leaking Redis subscriptions for #663. The local flag was not getting passed through onClientDisconnect().
+  * Prevent memory leaking on uncompleted requests & add max post size limitation
+  * Fix for testcase
+  * Set Access-Control-Allow-Credentials true, regardless of cookie
+  * Remove assertvarnish from package as it breaks on 0.6
+  * Correct irc channel
+  * Added proper return after reserved field error
+  * Fixes manager.js failure to close connection after transport error has happened
+  * Added implicit port 80 for origin checks. fixes #638
+  * Fixed bug #432 in 0.8.7
+  * Set Access-Control-Allow-Origin header to origin to enable withCredentials
+  * Adding configuration variable matchOriginProtocol
+  * Fixes location mismatch error in Safari.
+  * Use tty to detect if we should add colors or not by default.
+  * Updated the package location.
+
+0.8.7 / 2011-11-05
+==================
+
+  * Fixed memory leaks in closed clients.
+  * Fixed memory leaks in namespaces.
+  * Fixed websocket handling for malformed requests from proxies. [einaros]
+  * Node 0.6 compatibility. [einaros] [3rd-Eden]
+  * Adapted tests and examples.
+
+0.8.6 / 2011-10-27 
+==================
+
+  * Added JSON decoding on jsonp-polling transport.
+  * Fixed README example.
+  * Major speed optimizations [3rd-Eden] [einaros] [visionmedia]
+  * Added decode/encode benchmarks [visionmedia]
+  * Added support for black-listing client sent events.
+  * Fixed logging options, closes #540 [3rd-Eden]
+  * Added vary header for gzip [3rd-Eden]
+  * Properly cleaned up async websocket / flashsocket tests, after patching node-websocket-client
+  * Patched to properly shut down when a finishClose call is made during connection establishment
+  * Added support for socket.io version on url and far-future Expires [3rd-Eden] [getify]
+  * Began IE10 compatibility [einaros] [tbranyen]
+  * Misc WebSocket fixes [einaros]
+  * Added UTF8 to respone headers for htmlfile [3rd-Eden]
+
+0.8.5 / 2011-10-07
+==================
+
+  * Added websocket draft HyBi-16 support. [einaros]
+  * Fixed websocket continuation bugs. [einaros]
+  * Fixed flashsocket transport name.
+  * Fixed websocket tests.
+  * Ensured `parser#decodePayload` doesn't choke.
+  * Added http referrer verification to manager verifyOrigin.
+  * Added access control for cross domain xhr handshakes [3rd-Eden]
+  * Added support for automatic generation of socket.io files [3rd-Eden]
+  * Added websocket binary support [einaros]
+  * Added gzip support for socket.io.js [3rd-Eden]
+  * Expose socket.transport [3rd-Eden]
+  * Updated client.
+
+0.8.4 / 2011-09-06
+==================
+
+  * Client build
+
+0.8.3 / 2011-09-03
+==================
+
+  * Fixed `\n` parsing for non-JSON packets (fixes #479).
+  * Fixed parsing of certain unicode characters (fixes #451).
+  * Fixed transport message packet logging.
+  * Fixed emission of `error` event resulting in an uncaught exception if unhandled (fixes #476).
+  * Fixed; allow for falsy values as the configuration value of `log level` (fixes #491).
+  * Fixed repository URI in `package.json`. Fixes #504.
+  * Added text/plain content-type to handshake responses [einaros]
+  * Improved single byte writes [einaros]
+  * Updated socket.io-flashsocket default port from 843 to 10843 [3rd-Eden]
+  * Updated client.
+
+0.8.2 / 2011-08-29
+==================
+
+  * Updated client.
+
+0.8.1 / 2011-08-29
+==================
+
+  * Fixed utf8 bug in send framing in websocket [einaros]
+  * Fixed typo in docs [Znarkus]
+  * Fixed bug in send framing for over 64kB of data in websocket [einaros]
+  * Corrected ping handling in websocket transport [einaros]
+
+0.8.0 / 2011-08-28
+==================
+
+  * Updated to work with two-level websocket versioning. [einaros]
+  * Added hybi07 support. [einaros]
+  * Added hybi10 support. [einaros]
+  * Added http referrer verification to manager.js verifyOrigin. [einaors]
+
+0.7.11 / 2011-08-27
+===================
+
+  * Updated socket.io-client.
+
+0.7.10 / 2011-08-27
+===================
+
+  * Updated socket.io-client.
+
+0.7.9 / 2011-08-12
+==================
+
+  * Updated socket.io-client.
+  * Make sure we only do garbage collection when the server we receive is actually run.
+
+0.7.8 / 2011-08-08
+==================
+
+  * Changed; make sure sio#listen passes options to both HTTP server and socket.io manager.
+  * Added docs for sio#listen.
+  * Added options parameter support for Manager constructor.
+  * Added memory leaks tests and test-leaks Makefile task.
+  * Removed auto npm-linking from make test.
+  * Make sure that you can disable heartbeats. [3rd-Eden]
+  * Fixed rooms memory leak [3rd-Eden]
+  * Send response once we got all POST data, not immediately [Pita]
+  * Fixed onLeave behavior with missing clientsk [3rd-Eden]
+  * Prevent duplicate references in rooms.
+  * Added alias for `to` to `in` and `in` to `to`.
+  * Fixed roomClients definition.
+  * Removed dependency on redis for installation without npm [3rd-Eden]
+  * Expose path and querystring in handshakeData [3rd-Eden]
+
+0.7.7 / 2011-07-12
+==================
+
+  * Fixed double dispatch handling with emit to closed clients.
+  * Added test for emitting to closed clients to prevent regression.
+  * Fixed race condition in redis test.
+  * Changed Transport#end instrumentation.
+  * Leveraged $emit instead of emit internally.
+  * Made tests faster.
+  * Fixed double disconnect events.
+  * Fixed disconnect logic
+  * Simplified remote events handling in Socket.
+  * Increased testcase timeout.
+  * Fixed unknown room emitting (GH-291). [3rd-Eden]
+  * Fixed `address` in handshakeData. [3rd-Eden]
+  * Removed transports definition in chat example.
+  * Fixed room cleanup
+  * Fixed; make sure the client is cleaned up after booting.
+  * Make sure to mark the client as non-open if the connection is closed.
+  * Removed unneeded `buffer` declarations.
+  * Fixed; make sure to clear socket handlers and subscriptions upon transport close.
+
+0.7.6 / 2011-06-30
+==================
+
+  * Fixed general dispatching when a client has closed.
+
+0.7.5 / 2011-06-30
+==================
+
+  * Fixed dispatching to clients that are disconnected.
+
+0.7.4 / 2011-06-30
+==================
+
+  * Fixed; only clear handlers if they were set. [level09]
+
+0.7.3 / 2011-06-30
+==================
+
+  * Exposed handshake data to clients.
+  * Refactored dispatcher interface.
+  * Changed; Moved id generation method into the manager.
+  * Added sub-namespace authorization. [3rd-Eden]
+  * Changed; normalized SocketNamespace local eventing [dvv]
+  * Changed; Use packet.reason or default to 'packet' [3rd-Eden]
+  * Changed console.error to console.log.
+  * Fixed; bind both servers at the same time do that the test never times out.
+  * Added 304 support.
+  * Removed `Transport#name` for abstract interface.
+  * Changed; lazily require http and https module only when needed. [3rd-Eden]
+
+0.7.2 / 2011-06-22
+==================
+
+  * Make sure to write a packet (of type `noop`) when closing a poll.
+    This solves a problem with cross-domain requests being flagged as aborted and
+    reconnection being triggered.
+  * Added `noop` message type.
+
+0.7.1 / 2011-06-21 
+==================
+
+  * Fixed cross-domain XHR.
+  * Added CORS test to xhr-polling suite.
+
+0.7.0 / 2010-06-21
+==================
+
+  * http://socket.io/announcement.html
diff --git a/wrt/node_modules/socket.io/LICENSE b/wrt/node_modules/socket.io/LICENSE
new file mode 100644 (file)
index 0000000..aea53a7
--- /dev/null
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2014-2017 Automattic <dev@cloudup.com>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/socket.io/Readme.md b/wrt/node_modules/socket.io/Readme.md
new file mode 100644 (file)
index 0000000..5df48ab
--- /dev/null
@@ -0,0 +1,242 @@
+
+# socket.io
+
+[![Backers on Open Collective](https://opencollective.com/socketio/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/socketio/sponsors/badge.svg)](#sponsors)
+[![Build Status](https://secure.travis-ci.org/socketio/socket.io.svg?branch=master)](https://travis-ci.org/socketio/socket.io)
+[![Dependency Status](https://david-dm.org/socketio/socket.io.svg)](https://david-dm.org/socketio/socket.io)
+[![devDependency Status](https://david-dm.org/socketio/socket.io/dev-status.svg)](https://david-dm.org/socketio/socket.io#info=devDependencies)
+[![NPM version](https://badge.fury.io/js/socket.io.svg)](https://www.npmjs.com/package/socket.io)
+![Downloads](https://img.shields.io/npm/dm/socket.io.svg?style=flat)
+[![](https://slackin-socketio.now.sh/badge.svg)](https://slackin-socketio.now.sh)
+
+## Features
+
+Socket.IO enables real-time bidirectional event-based communication. It consists in:
+
+- a Node.js server (this repository)
+- a [Javascript client library](https://github.com/socketio/socket.io-client) for the browser (or a Node.js client)
+
+Some implementations in other languages are also available:
+
+- [Java](https://github.com/socketio/socket.io-client-java)
+- [C++](https://github.com/socketio/socket.io-client-cpp)
+- [Swift](https://github.com/socketio/socket.io-client-swift)
+
+Its main features are:
+
+#### Reliability
+
+Connections are established even in the presence of:
+  - proxies and load balancers.
+  - personal firewall and antivirus software.
+
+For this purpose, it relies on [Engine.IO](https://github.com/socketio/engine.io), which first establishes a long-polling connection, then tries to upgrade to better transports that are "tested" on the side, like WebSocket. Please see the [Goals](https://github.com/socketio/engine.io#goals) section for more information.
+
+#### Auto-reconnection support
+
+Unless instructed otherwise a disconnected client will try to reconnect forever, until the server is available again. Please see the available reconnection options [here](https://github.com/socketio/socket.io-client/blob/master/docs/API.md#new-managerurl-options).
+
+#### Disconnection detection
+
+An heartbeat mechanism is implemented at the Engine.IO level, allowing both the server and the client to know when the other one is not responding anymore.
+
+That functionality is achieved with timers set on both the server and the client, with timeout values (the `pingInterval` and `pingTimeout` parameters) shared during the connection handshake. Those timers require any subsequent client calls to be directed to the same server, hence the `sticky-session` requirement when using multiples nodes.
+
+#### Binary support
+
+Any serializable data structures can be emitted, including:
+
+- [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) and [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) in the browser
+- [ArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) and [Buffer](https://nodejs.org/api/buffer.html) in Node.js
+
+#### Simple and convenient API
+
+Sample code:
+
+```js
+io.on('connection', function(socket){
+  socket.emit('request', /* */); // emit an event to the socket
+  io.emit('broadcast', /* */); // emit an event to all connected sockets
+  socket.on('reply', function(){ /* */ }); // listen to the event
+});
+```
+
+#### Cross-browser
+
+Browser support is tested in Saucelabs:
+
+[![Sauce Test Status](https://saucelabs.com/browser-matrix/socket.svg)](https://saucelabs.com/u/socket)
+
+#### Multiplexing support
+
+In order to create separation of concerns within your application (for example per module, or based on permissions), Socket.IO allows you to create several `Namespaces`, which will act as separate communication channels but will share the same underlying connection.
+
+#### Room support
+
+Within each `Namespace`, you can define arbitrary channels, called `Rooms`, that sockets can join and leave. You can then broadcast to any given room, reaching every socket that has joined it.
+
+This is a useful feature to send notifications to a group of users, or to a given user connected on several devices for example.
+
+
+**Note:** Socket.IO is not a WebSocket implementation. Although Socket.IO indeed uses WebSocket as a transport when possible, it adds some metadata to each packet: the packet type, the namespace and the ack id when a message acknowledgement is needed. That is why a WebSocket client will not be able to successfully connect to a Socket.IO server, and a Socket.IO client will not be able to connect to a WebSocket server (like `ws://echo.websocket.org`) either. Please see the protocol specification [here](https://github.com/socketio/socket.io-protocol).
+
+## Installation
+
+```bash
+npm install socket.io --save
+```
+
+## How to use
+
+The following example attaches socket.io to a plain Node.JS
+HTTP server listening on port `3000`.
+
+```js
+var server = require('http').createServer();
+var io = require('socket.io')(server);
+io.on('connection', function(client){
+  client.on('event', function(data){});
+  client.on('disconnect', function(){});
+});
+server.listen(3000);
+```
+
+### Standalone
+
+```js
+var io = require('socket.io')();
+io.on('connection', function(client){});
+io.listen(3000);
+```
+
+### In conjunction with Express
+
+Starting with **3.0**, express applications have become request handler
+functions that you pass to `http` or `http` `Server` instances. You need
+to pass the `Server` to `socket.io`, and not the express application
+function. Also make sure to call `.listen` on the `server`, not the `app`.
+
+```js
+var app = require('express')();
+var server = require('http').createServer(app);
+var io = require('socket.io')(server);
+io.on('connection', function(){ /* … */ });
+server.listen(3000);
+```
+
+### In conjunction with Koa
+
+Like Express.JS, Koa works by exposing an application as a request
+handler function, but only by calling the `callback` method.
+
+```js
+var app = require('koa')();
+var server = require('http').createServer(app.callback());
+var io = require('socket.io')(server);
+io.on('connection', function(){ /* … */ });
+server.listen(3000);
+```
+
+## Documentation
+
+Please see the documentation [here](/docs/README.md). Contributions are welcome!
+
+## Debug / logging
+
+Socket.IO is powered by [debug](https://github.com/visionmedia/debug).
+In order to see all the debug output, run your app with the environment variable
+`DEBUG` including the desired scope.
+
+To see the output from all of Socket.IO's debugging scopes you can use:
+
+```
+DEBUG=socket.io* node myapp
+```
+
+## Testing
+
+```
+npm test
+```
+This runs the `gulp` task `test`. By default the test will be run with the source code in `lib` directory.
+
+Set the environmental variable `TEST_VERSION` to `compat` to test the transpiled es5-compat version of the code.
+
+The `gulp` task `test` will always transpile the source code into es5 and export to `dist` first before running the test.
+
+
+## Backers
+
+Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/socketio#backer)]
+
+<a href="https://opencollective.com/socketio/backer/0/website" target="_blank"><img src="https://opencollective.com/socketio/backer/0/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/backer/1/website" target="_blank"><img src="https://opencollective.com/socketio/backer/1/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/backer/2/website" target="_blank"><img src="https://opencollective.com/socketio/backer/2/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/backer/3/website" target="_blank"><img src="https://opencollective.com/socketio/backer/3/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/backer/4/website" target="_blank"><img src="https://opencollective.com/socketio/backer/4/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/backer/5/website" target="_blank"><img src="https://opencollective.com/socketio/backer/5/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/backer/6/website" target="_blank"><img src="https://opencollective.com/socketio/backer/6/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/backer/7/website" target="_blank"><img src="https://opencollective.com/socketio/backer/7/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/backer/8/website" target="_blank"><img src="https://opencollective.com/socketio/backer/8/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/backer/9/website" target="_blank"><img src="https://opencollective.com/socketio/backer/9/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/backer/10/website" target="_blank"><img src="https://opencollective.com/socketio/backer/10/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/backer/11/website" target="_blank"><img src="https://opencollective.com/socketio/backer/11/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/backer/12/website" target="_blank"><img src="https://opencollective.com/socketio/backer/12/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/backer/13/website" target="_blank"><img src="https://opencollective.com/socketio/backer/13/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/backer/14/website" target="_blank"><img src="https://opencollective.com/socketio/backer/14/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/backer/15/website" target="_blank"><img src="https://opencollective.com/socketio/backer/15/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/backer/16/website" target="_blank"><img src="https://opencollective.com/socketio/backer/16/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/backer/17/website" target="_blank"><img src="https://opencollective.com/socketio/backer/17/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/backer/18/website" target="_blank"><img src="https://opencollective.com/socketio/backer/18/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/backer/19/website" target="_blank"><img src="https://opencollective.com/socketio/backer/19/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/backer/20/website" target="_blank"><img src="https://opencollective.com/socketio/backer/20/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/backer/21/website" target="_blank"><img src="https://opencollective.com/socketio/backer/21/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/backer/22/website" target="_blank"><img src="https://opencollective.com/socketio/backer/22/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/backer/23/website" target="_blank"><img src="https://opencollective.com/socketio/backer/23/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/backer/24/website" target="_blank"><img src="https://opencollective.com/socketio/backer/24/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/backer/25/website" target="_blank"><img src="https://opencollective.com/socketio/backer/25/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/backer/26/website" target="_blank"><img src="https://opencollective.com/socketio/backer/26/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/backer/27/website" target="_blank"><img src="https://opencollective.com/socketio/backer/27/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/backer/28/website" target="_blank"><img src="https://opencollective.com/socketio/backer/28/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/backer/29/website" target="_blank"><img src="https://opencollective.com/socketio/backer/29/avatar.svg"></a>
+
+
+## Sponsors
+
+Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/socketio#sponsor)]
+
+<a href="https://opencollective.com/socketio/sponsor/0/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/0/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/sponsor/1/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/1/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/sponsor/2/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/2/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/sponsor/3/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/3/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/sponsor/4/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/4/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/sponsor/5/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/5/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/sponsor/6/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/6/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/sponsor/7/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/7/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/sponsor/8/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/8/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/sponsor/9/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/9/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/sponsor/10/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/10/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/sponsor/11/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/11/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/sponsor/12/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/12/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/sponsor/13/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/13/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/sponsor/14/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/14/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/sponsor/15/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/15/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/sponsor/16/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/16/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/sponsor/17/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/17/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/sponsor/18/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/18/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/sponsor/19/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/19/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/sponsor/20/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/20/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/sponsor/21/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/21/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/sponsor/22/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/22/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/sponsor/23/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/23/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/sponsor/24/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/24/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/sponsor/25/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/25/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/sponsor/26/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/26/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/sponsor/27/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/27/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/sponsor/28/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/28/avatar.svg"></a>
+<a href="https://opencollective.com/socketio/sponsor/29/website" target="_blank"><img src="https://opencollective.com/socketio/sponsor/29/avatar.svg"></a>
+
+
+## License
+
+[MIT](LICENSE)
diff --git a/wrt/node_modules/socket.io/lib/client.js b/wrt/node_modules/socket.io/lib/client.js
new file mode 100644 (file)
index 0000000..0b5f044
--- /dev/null
@@ -0,0 +1,252 @@
+
+/**
+ * Module dependencies.
+ */
+
+var parser = require('socket.io-parser');
+var debug = require('debug')('socket.io:client');
+var url = require('url');
+
+/**
+ * Module exports.
+ */
+
+module.exports = Client;
+
+/**
+ * Client constructor.
+ *
+ * @param {Server} server instance
+ * @param {Socket} conn
+ * @api private
+ */
+
+function Client(server, conn){
+  this.server = server;
+  this.conn = conn;
+  this.encoder = server.encoder;
+  this.decoder = new server.parser.Decoder();
+  this.id = conn.id;
+  this.request = conn.request;
+  this.setup();
+  this.sockets = {};
+  this.nsps = {};
+  this.connectBuffer = [];
+}
+
+/**
+ * Sets up event listeners.
+ *
+ * @api private
+ */
+
+Client.prototype.setup = function(){
+  this.onclose = this.onclose.bind(this);
+  this.ondata = this.ondata.bind(this);
+  this.onerror = this.onerror.bind(this);
+  this.ondecoded = this.ondecoded.bind(this);
+
+  this.decoder.on('decoded', this.ondecoded);
+  this.conn.on('data', this.ondata);
+  this.conn.on('error', this.onerror);
+  this.conn.on('close', this.onclose);
+};
+
+/**
+ * Connects a client to a namespace.
+ *
+ * @param {String} name namespace
+ * @api private
+ */
+
+Client.prototype.connect = function(name, query){
+  debug('connecting to namespace %s', name);
+  var nsp = this.server.nsps[name];
+  if (!nsp) {
+    this.packet({ type: parser.ERROR, nsp: name, data : 'Invalid namespace'});
+    return;
+  }
+
+  if ('/' != name && !this.nsps['/']) {
+    this.connectBuffer.push(name);
+    return;
+  }
+
+  var self = this;
+  var socket = nsp.add(this, query, function(){
+    self.sockets[socket.id] = socket;
+    self.nsps[nsp.name] = socket;
+
+    if ('/' == nsp.name && self.connectBuffer.length > 0) {
+      self.connectBuffer.forEach(self.connect, self);
+      self.connectBuffer = [];
+    }
+  });
+};
+
+/**
+ * Disconnects from all namespaces and closes transport.
+ *
+ * @api private
+ */
+
+Client.prototype.disconnect = function(){
+  for (var id in this.sockets) {
+    if (this.sockets.hasOwnProperty(id)) {
+      this.sockets[id].disconnect();
+    }
+  }
+  this.sockets = {};
+  this.close();
+};
+
+/**
+ * Removes a socket. Called by each `Socket`.
+ *
+ * @api private
+ */
+
+Client.prototype.remove = function(socket){
+  if (this.sockets.hasOwnProperty(socket.id)) {
+    var nsp = this.sockets[socket.id].nsp.name;
+    delete this.sockets[socket.id];
+    delete this.nsps[nsp];
+  } else {
+    debug('ignoring remove for %s', socket.id);
+  }
+};
+
+/**
+ * Closes the underlying connection.
+ *
+ * @api private
+ */
+
+Client.prototype.close = function(){
+  if ('open' == this.conn.readyState) {
+    debug('forcing transport close');
+    this.conn.close();
+    this.onclose('forced server close');
+  }
+};
+
+/**
+ * Writes a packet to the transport.
+ *
+ * @param {Object} packet object
+ * @param {Object} opts
+ * @api private
+ */
+
+Client.prototype.packet = function(packet, opts){
+  opts = opts || {};
+  var self = this;
+
+  // this writes to the actual connection
+  function writeToEngine(encodedPackets) {
+    if (opts.volatile && !self.conn.transport.writable) return;
+    for (var i = 0; i < encodedPackets.length; i++) {
+      self.conn.write(encodedPackets[i], { compress: opts.compress });
+    }
+  }
+
+  if ('open' == this.conn.readyState) {
+    debug('writing packet %j', packet);
+    if (!opts.preEncoded) { // not broadcasting, need to encode
+      this.encoder.encode(packet, writeToEngine); // encode, then write results to engine
+    } else { // a broadcast pre-encodes a packet
+      writeToEngine(packet);
+    }
+  } else {
+    debug('ignoring packet write %j', packet);
+  }
+};
+
+/**
+ * Called with incoming transport data.
+ *
+ * @api private
+ */
+
+Client.prototype.ondata = function(data){
+  // try/catch is needed for protocol violations (GH-1880)
+  try {
+    this.decoder.add(data);
+  } catch(e) {
+    this.onerror(e);
+  }
+};
+
+/**
+ * Called when parser fully decodes a packet.
+ *
+ * @api private
+ */
+
+Client.prototype.ondecoded = function(packet) {
+  if (parser.CONNECT == packet.type) {
+    this.connect(url.parse(packet.nsp).pathname, url.parse(packet.nsp, true).query);
+  } else {
+    var socket = this.nsps[packet.nsp];
+    if (socket) {
+      process.nextTick(function() {
+        socket.onpacket(packet);
+      });
+    } else {
+      debug('no socket for namespace %s', packet.nsp);
+    }
+  }
+};
+
+/**
+ * Handles an error.
+ *
+ * @param {Object} err object
+ * @api private
+ */
+
+Client.prototype.onerror = function(err){
+  for (var id in this.sockets) {
+    if (this.sockets.hasOwnProperty(id)) {
+      this.sockets[id].onerror(err);
+    }
+  }
+  this.conn.close();
+};
+
+/**
+ * Called upon transport close.
+ *
+ * @param {String} reason
+ * @api private
+ */
+
+Client.prototype.onclose = function(reason){
+  debug('client close with reason %s', reason);
+
+  // ignore a potential subsequent `close` event
+  this.destroy();
+
+  // `nsps` and `sockets` are cleaned up seamlessly
+  for (var id in this.sockets) {
+    if (this.sockets.hasOwnProperty(id)) {
+      this.sockets[id].onclose(reason);
+    }
+  }
+  this.sockets = {};
+
+  this.decoder.destroy(); // clean up decoder
+};
+
+/**
+ * Cleans up event listeners.
+ *
+ * @api private
+ */
+
+Client.prototype.destroy = function(){
+  this.conn.removeListener('data', this.ondata);
+  this.conn.removeListener('error', this.onerror);
+  this.conn.removeListener('close', this.onclose);
+  this.decoder.removeListener('decoded', this.ondecoded);
+};
diff --git a/wrt/node_modules/socket.io/lib/index.js b/wrt/node_modules/socket.io/lib/index.js
new file mode 100644 (file)
index 0000000..e16133a
--- /dev/null
@@ -0,0 +1,474 @@
+
+/**
+ * Module dependencies.
+ */
+
+var http = require('http');
+var read = require('fs').readFileSync;
+var path = require('path');
+var exists = require('fs').existsSync;
+var engine = require('engine.io');
+var clientVersion = require('socket.io-client/package.json').version;
+var Client = require('./client');
+var Emitter = require('events').EventEmitter;
+var Namespace = require('./namespace');
+var Adapter = require('socket.io-adapter');
+var parser = require('socket.io-parser');
+var debug = require('debug')('socket.io:server');
+var url = require('url');
+
+/**
+ * Module exports.
+ */
+
+module.exports = Server;
+
+/**
+ * Socket.IO client source.
+ */
+
+var clientSource = undefined;
+var clientSourceMap = undefined;
+
+/**
+ * Server constructor.
+ *
+ * @param {http.Server|Number|Object} srv http server, port or options
+ * @param {Object} [opts]
+ * @api public
+ */
+
+function Server(srv, opts){
+  if (!(this instanceof Server)) return new Server(srv, opts);
+  if ('object' == typeof srv && srv instanceof Object && !srv.listen) {
+    opts = srv;
+    srv = null;
+  }
+  opts = opts || {};
+  this.nsps = {};
+  this.path(opts.path || '/socket.io');
+  this.serveClient(false !== opts.serveClient);
+  this.parser = opts.parser || parser;
+  this.encoder = new this.parser.Encoder();
+  this.adapter(opts.adapter || Adapter);
+  this.origins(opts.origins || '*:*');
+  this.sockets = this.of('/');
+  if (srv) this.attach(srv, opts);
+}
+
+/**
+ * Server request verification function, that checks for allowed origins
+ *
+ * @param {http.IncomingMessage} req request
+ * @param {Function} fn callback to be called with the result: `fn(err, success)`
+ */
+
+Server.prototype.checkRequest = function(req, fn) {
+  var origin = req.headers.origin || req.headers.referer;
+
+  // file:// URLs produce a null Origin which can't be authorized via echo-back
+  if ('null' == origin || null == origin) origin = '*';
+
+  if (!!origin && typeof(this._origins) == 'function') return this._origins(origin, fn);
+  if (this._origins.indexOf('*:*') !== -1) return fn(null, true);
+  if (origin) {
+    try {
+      var parts = url.parse(origin);
+      var defaultPort = 'https:' == parts.protocol ? 443 : 80;
+      parts.port = parts.port != null
+        ? parts.port
+        : defaultPort;
+      var ok =
+        ~this._origins.indexOf(parts.hostname + ':' + parts.port) ||
+        ~this._origins.indexOf(parts.hostname + ':*') ||
+        ~this._origins.indexOf('*:' + parts.port);
+      return fn(null, !!ok);
+    } catch (ex) {
+    }
+  }
+  fn(null, false);
+};
+
+/**
+ * Sets/gets whether client code is being served.
+ *
+ * @param {Boolean} v whether to serve client code
+ * @return {Server|Boolean} self when setting or value when getting
+ * @api public
+ */
+
+Server.prototype.serveClient = function(v){
+  if (!arguments.length) return this._serveClient;
+  this._serveClient = v;
+  var resolvePath = function(file){
+    var filepath = path.resolve(__dirname, './../../', file);
+    if (exists(filepath)) {
+      return filepath;
+    }
+    return require.resolve(file);
+  };
+  if (v && !clientSource) {
+    clientSource = read(resolvePath( 'socket.io-client/dist/socket.io.js'), 'utf-8');
+    try {
+      clientSourceMap = read(resolvePath( 'socket.io-client/dist/socket.io.js.map'), 'utf-8');
+    } catch(err) {
+      debug('could not load sourcemap file');
+    }
+  }
+  return this;
+};
+
+/**
+ * Old settings for backwards compatibility
+ */
+
+var oldSettings = {
+  "transports": "transports",
+  "heartbeat timeout": "pingTimeout",
+  "heartbeat interval": "pingInterval",
+  "destroy buffer size": "maxHttpBufferSize"
+};
+
+/**
+ * Backwards compatibility.
+ *
+ * @api public
+ */
+
+Server.prototype.set = function(key, val){
+  if ('authorization' == key && val) {
+    this.use(function(socket, next) {
+      val(socket.request, function(err, authorized) {
+        if (err) return next(new Error(err));
+        if (!authorized) return next(new Error('Not authorized'));
+        next();
+      });
+    });
+  } else if ('origins' == key && val) {
+    this.origins(val);
+  } else if ('resource' == key) {
+    this.path(val);
+  } else if (oldSettings[key] && this.eio[oldSettings[key]]) {
+    this.eio[oldSettings[key]] = val;
+  } else {
+    console.error('Option %s is not valid. Please refer to the README.', key);
+  }
+
+  return this;
+};
+
+/**
+ * Sets the client serving path.
+ *
+ * @param {String} v pathname
+ * @return {Server|String} self when setting or value when getting
+ * @api public
+ */
+
+Server.prototype.path = function(v){
+  if (!arguments.length) return this._path;
+  this._path = v.replace(/\/$/, '');
+  return this;
+};
+
+/**
+ * Sets the adapter for rooms.
+ *
+ * @param {Adapter} v pathname
+ * @return {Server|Adapter} self when setting or value when getting
+ * @api public
+ */
+
+Server.prototype.adapter = function(v){
+  if (!arguments.length) return this._adapter;
+  this._adapter = v;
+  for (var i in this.nsps) {
+    if (this.nsps.hasOwnProperty(i)) {
+      this.nsps[i].initAdapter();
+    }
+  }
+  return this;
+};
+
+/**
+ * Sets the allowed origins for requests.
+ *
+ * @param {String} v origins
+ * @return {Server|Adapter} self when setting or value when getting
+ * @api public
+ */
+
+Server.prototype.origins = function(v){
+  if (!arguments.length) return this._origins;
+
+  this._origins = v;
+  return this;
+};
+
+/**
+ * Attaches socket.io to a server or port.
+ *
+ * @param {http.Server|Number} server or port
+ * @param {Object} options passed to engine.io
+ * @return {Server} self
+ * @api public
+ */
+
+Server.prototype.listen =
+Server.prototype.attach = function(srv, opts){
+  if ('function' == typeof srv) {
+    var msg = 'You are trying to attach socket.io to an express ' +
+    'request handler function. Please pass a http.Server instance.';
+    throw new Error(msg);
+  }
+
+  // handle a port as a string
+  if (Number(srv) == srv) {
+    srv = Number(srv);
+  }
+
+  if ('number' == typeof srv) {
+    debug('creating http server and binding to %d', srv);
+    var port = srv;
+    srv = http.Server(function(req, res){
+      res.writeHead(404);
+      res.end();
+    });
+    srv.listen(port);
+
+  }
+
+  // set engine.io path to `/socket.io`
+  opts = opts || {};
+  opts.path = opts.path || this.path();
+  // set origins verification
+  opts.allowRequest = opts.allowRequest || this.checkRequest.bind(this);
+
+  if (this.sockets.fns.length > 0) {
+    this.initEngine(srv, opts);
+    return this;
+  }
+
+  var self = this;
+  var connectPacket = { type: parser.CONNECT, nsp: '/' };
+  this.encoder.encode(connectPacket, function (encodedPacket){
+    // the CONNECT packet will be merged with Engine.IO handshake,
+    // to reduce the number of round trips
+    opts.initialPacket = encodedPacket;
+
+    self.initEngine(srv, opts);
+  });
+  return this;
+};
+
+/**
+ * Initialize engine
+ *
+ * @param {Object} options passed to engine.io
+ * @api private
+ */
+
+Server.prototype.initEngine = function(srv, opts){
+  // initialize engine
+  debug('creating engine.io instance with opts %j', opts);
+  this.eio = engine.attach(srv, opts);
+
+  // attach static file serving
+  if (this._serveClient) this.attachServe(srv);
+
+  // Export http server
+  this.httpServer = srv;
+
+  // bind to engine events
+  this.bind(this.eio);
+};
+
+/**
+ * Attaches the static file serving.
+ *
+ * @param {Function|http.Server} srv http server
+ * @api private
+ */
+
+Server.prototype.attachServe = function(srv){
+  debug('attaching client serving req handler');
+  var url = this._path + '/socket.io.js';
+  var urlMap = this._path + '/socket.io.js.map';
+  var evs = srv.listeners('request').slice(0);
+  var self = this;
+  srv.removeAllListeners('request');
+  srv.on('request', function(req, res) {
+    if (0 === req.url.indexOf(urlMap)) {
+      self.serveMap(req, res);
+    } else if (0 === req.url.indexOf(url)) {
+      self.serve(req, res);
+    } else {
+      for (var i = 0; i < evs.length; i++) {
+        evs[i].call(srv, req, res);
+      }
+    }
+  });
+};
+
+/**
+ * Handles a request serving `/socket.io.js`
+ *
+ * @param {http.Request} req
+ * @param {http.Response} res
+ * @api private
+ */
+
+Server.prototype.serve = function(req, res){
+  // Per the standard, ETags must be quoted:
+  // https://tools.ietf.org/html/rfc7232#section-2.3
+  var expectedEtag = '"' + clientVersion + '"';
+
+  var etag = req.headers['if-none-match'];
+  if (etag) {
+    if (expectedEtag == etag) {
+      debug('serve client 304');
+      res.writeHead(304);
+      res.end();
+      return;
+    }
+  }
+
+  debug('serve client source');
+  res.setHeader('Content-Type', 'application/javascript');
+  res.setHeader('ETag', expectedEtag);
+  res.writeHead(200);
+  res.end(clientSource);
+};
+
+/**
+ * Handles a request serving `/socket.io.js.map`
+ *
+ * @param {http.Request} req
+ * @param {http.Response} res
+ * @api private
+ */
+
+Server.prototype.serveMap = function(req, res){
+  // Per the standard, ETags must be quoted:
+  // https://tools.ietf.org/html/rfc7232#section-2.3
+  var expectedEtag = '"' + clientVersion + '"';
+
+  var etag = req.headers['if-none-match'];
+  if (etag) {
+    if (expectedEtag == etag) {
+      debug('serve client 304');
+      res.writeHead(304);
+      res.end();
+      return;
+    }
+  }
+
+  debug('serve client sourcemap');
+  res.setHeader('Content-Type', 'application/json');
+  res.setHeader('ETag', expectedEtag);
+  res.writeHead(200);
+  res.end(clientSourceMap);
+};
+
+/**
+ * Binds socket.io to an engine.io instance.
+ *
+ * @param {engine.Server} engine engine.io (or compatible) server
+ * @return {Server} self
+ * @api public
+ */
+
+Server.prototype.bind = function(engine){
+  this.engine = engine;
+  this.engine.on('connection', this.onconnection.bind(this));
+  return this;
+};
+
+/**
+ * Called with each incoming transport connection.
+ *
+ * @param {engine.Socket} conn
+ * @return {Server} self
+ * @api public
+ */
+
+Server.prototype.onconnection = function(conn){
+  debug('incoming connection with id %s', conn.id);
+  var client = new Client(this, conn);
+  client.connect('/');
+  return this;
+};
+
+/**
+ * Looks up a namespace.
+ *
+ * @param {String} name nsp name
+ * @param {Function} [fn] optional, nsp `connection` ev handler
+ * @api public
+ */
+
+Server.prototype.of = function(name, fn){
+  if (String(name)[0] !== '/') name = '/' + name;
+
+  var nsp = this.nsps[name];
+  if (!nsp) {
+    debug('initializing namespace %s', name);
+    nsp = new Namespace(this, name);
+    this.nsps[name] = nsp;
+  }
+  if (fn) nsp.on('connect', fn);
+  return nsp;
+};
+
+/**
+ * Closes server connection
+ *
+ * @param {Function} [fn] optional, called as `fn([err])` on error OR all conns closed
+ * @api public
+ */
+
+Server.prototype.close = function(fn){
+  for (var id in this.nsps['/'].sockets) {
+    if (this.nsps['/'].sockets.hasOwnProperty(id)) {
+      this.nsps['/'].sockets[id].onclose();
+    }
+  }
+
+  this.engine.close();
+
+  if (this.httpServer) {
+    this.httpServer.close(fn);
+  } else {
+    fn && fn();
+  }
+};
+
+/**
+ * Expose main namespace (/).
+ */
+
+var emitterMethods = Object.keys(Emitter.prototype).filter(function(key){
+  return typeof Emitter.prototype[key] === 'function';
+});
+
+emitterMethods.concat(['to', 'in', 'use', 'send', 'write', 'clients', 'compress']).forEach(function(fn){
+  Server.prototype[fn] = function(){
+    return this.sockets[fn].apply(this.sockets, arguments);
+  };
+});
+
+Namespace.flags.forEach(function(flag){
+  Object.defineProperty(Server.prototype, flag, {
+    get: function() {
+      this.sockets.flags = this.sockets.flags || {};
+      this.sockets.flags[flag] = true;
+      return this;
+    }
+  });
+});
+
+/**
+ * BC with `io.listen`
+ */
+
+Server.listen = Server;
diff --git a/wrt/node_modules/socket.io/lib/namespace.js b/wrt/node_modules/socket.io/lib/namespace.js
new file mode 100644 (file)
index 0000000..3c6b65c
--- /dev/null
@@ -0,0 +1,274 @@
+
+/**
+ * Module dependencies.
+ */
+
+var Socket = require('./socket');
+var Emitter = require('events').EventEmitter;
+var parser = require('socket.io-parser');
+var debug = require('debug')('socket.io:namespace');
+
+/**
+ * Module exports.
+ */
+
+module.exports = exports = Namespace;
+
+/**
+ * Blacklisted events.
+ */
+
+exports.events = [
+  'connect',    // for symmetry with client
+  'connection',
+  'newListener'
+];
+
+/**
+ * Flags.
+ */
+
+exports.flags = [
+  'json',
+  'volatile',
+  'local'
+];
+
+/**
+ * `EventEmitter#emit` reference.
+ */
+
+var emit = Emitter.prototype.emit;
+
+/**
+ * Namespace constructor.
+ *
+ * @param {Server} server instance
+ * @param {Socket} name
+ * @api private
+ */
+
+function Namespace(server, name){
+  this.name = name;
+  this.server = server;
+  this.sockets = {};
+  this.connected = {};
+  this.fns = [];
+  this.ids = 0;
+  this.rooms = [];
+  this.flags = {};
+  this.initAdapter();
+}
+
+/**
+ * Inherits from `EventEmitter`.
+ */
+
+Namespace.prototype.__proto__ = Emitter.prototype;
+
+/**
+ * Apply flags from `Socket`.
+ */
+
+exports.flags.forEach(function(flag){
+  Object.defineProperty(Namespace.prototype, flag, {
+    get: function() {
+      this.flags[flag] = true;
+      return this;
+    }
+  });
+});
+
+/**
+ * Initializes the `Adapter` for this nsp.
+ * Run upon changing adapter by `Server#adapter`
+ * in addition to the constructor.
+ *
+ * @api private
+ */
+
+Namespace.prototype.initAdapter = function(){
+  this.adapter = new (this.server.adapter())(this);
+};
+
+/**
+ * Sets up namespace middleware.
+ *
+ * @return {Namespace} self
+ * @api public
+ */
+
+Namespace.prototype.use = function(fn){
+  if (this.server.eio) {
+    debug('removing initial packet');
+    delete this.server.eio.initialPacket;
+  }
+  this.fns.push(fn);
+  return this;
+};
+
+/**
+ * Executes the middleware for an incoming client.
+ *
+ * @param {Socket} socket that will get added
+ * @param {Function} fn last fn call in the middleware
+ * @api private
+ */
+
+Namespace.prototype.run = function(socket, fn){
+  var fns = this.fns.slice(0);
+  if (!fns.length) return fn(null);
+
+  function run(i){
+    fns[i](socket, function(err){
+      // upon error, short-circuit
+      if (err) return fn(err);
+
+      // if no middleware left, summon callback
+      if (!fns[i + 1]) return fn(null);
+
+      // go on to next
+      run(i + 1);
+    });
+  }
+
+  run(0);
+};
+
+/**
+ * Targets a room when emitting.
+ *
+ * @param {String} name
+ * @return {Namespace} self
+ * @api public
+ */
+
+Namespace.prototype.to =
+Namespace.prototype.in = function(name){
+  if (!~this.rooms.indexOf(name)) this.rooms.push(name);
+  return this;
+};
+
+/**
+ * Adds a new client.
+ *
+ * @return {Socket}
+ * @api private
+ */
+
+Namespace.prototype.add = function(client, query, fn){
+  debug('adding socket to nsp %s', this.name);
+  var socket = new Socket(this, client, query);
+  var self = this;
+  this.run(socket, function(err){
+    process.nextTick(function(){
+      if ('open' == client.conn.readyState) {
+        if (err) return socket.error(err.data || err.message);
+
+        // track socket
+        self.sockets[socket.id] = socket;
+
+        // it's paramount that the internal `onconnect` logic
+        // fires before user-set events to prevent state order
+        // violations (such as a disconnection before the connection
+        // logic is complete)
+        socket.onconnect();
+        if (fn) fn();
+
+        // fire user-set events
+        self.emit('connect', socket);
+        self.emit('connection', socket);
+      } else {
+        debug('next called after client was closed - ignoring socket');
+      }
+    });
+  });
+  return socket;
+};
+
+/**
+ * Removes a client. Called by each `Socket`.
+ *
+ * @api private
+ */
+
+Namespace.prototype.remove = function(socket){
+  if (this.sockets.hasOwnProperty(socket.id)) {
+    delete this.sockets[socket.id];
+  } else {
+    debug('ignoring remove for %s', socket.id);
+  }
+};
+
+/**
+ * Emits to all clients.
+ *
+ * @return {Namespace} self
+ * @api public
+ */
+
+Namespace.prototype.emit = function(ev){
+  if (~exports.events.indexOf(ev)) {
+    emit.apply(this, arguments);
+  } else {
+    // set up packet object
+    var args = Array.prototype.slice.call(arguments);
+    var packet = { type: parser.EVENT, data: args };
+
+    if ('function' == typeof args[args.length - 1]) {
+      throw new Error('Callbacks are not supported when broadcasting');
+    }
+
+    this.adapter.broadcast(packet, {
+      rooms: this.rooms,
+      flags: this.flags
+    });
+
+    this.rooms = [];
+    this.flags = {};
+  }
+  return this;
+};
+
+/**
+ * Sends a `message` event to all clients.
+ *
+ * @return {Namespace} self
+ * @api public
+ */
+
+Namespace.prototype.send =
+Namespace.prototype.write = function(){
+  var args = Array.prototype.slice.call(arguments);
+  args.unshift('message');
+  this.emit.apply(this, args);
+  return this;
+};
+
+/**
+ * Gets a list of clients.
+ *
+ * @return {Namespace} self
+ * @api public
+ */
+
+Namespace.prototype.clients = function(fn){
+  this.adapter.clients(this.rooms, fn);
+  // reset rooms for scenario:
+  // .in('room').clients() (GH-1978)
+  this.rooms = [];
+  return this;
+};
+
+/**
+ * Sets the compress flag.
+ *
+ * @param {Boolean} compress if `true`, compresses the sending data
+ * @return {Socket} self
+ * @api public
+ */
+
+Namespace.prototype.compress = function(compress){
+  this.flags.compress = compress;
+  return this;
+};
diff --git a/wrt/node_modules/socket.io/lib/socket.js b/wrt/node_modules/socket.io/lib/socket.js
new file mode 100644 (file)
index 0000000..a907bf3
--- /dev/null
@@ -0,0 +1,558 @@
+
+/**
+ * Module dependencies.
+ */
+
+var Emitter = require('events').EventEmitter;
+var parser = require('socket.io-parser');
+var url = require('url');
+var debug = require('debug')('socket.io:socket');
+var assign = require('object-assign');
+
+/**
+ * Module exports.
+ */
+
+module.exports = exports = Socket;
+
+/**
+ * Blacklisted events.
+ *
+ * @api public
+ */
+
+exports.events = [
+  'error',
+  'connect',
+  'disconnect',
+  'disconnecting',
+  'newListener',
+  'removeListener'
+];
+
+/**
+ * Flags.
+ *
+ * @api private
+ */
+
+var flags = [
+  'json',
+  'volatile',
+  'broadcast'
+];
+
+/**
+ * `EventEmitter#emit` reference.
+ */
+
+var emit = Emitter.prototype.emit;
+
+/**
+ * Interface to a `Client` for a given `Namespace`.
+ *
+ * @param {Namespace} nsp
+ * @param {Client} client
+ * @api public
+ */
+
+function Socket(nsp, client, query){
+  this.nsp = nsp;
+  this.server = nsp.server;
+  this.adapter = this.nsp.adapter;
+  this.id = nsp.name !== '/' ? nsp.name + '#' + client.id : client.id;
+  this.client = client;
+  this.conn = client.conn;
+  this.rooms = {};
+  this.acks = {};
+  this.connected = true;
+  this.disconnected = false;
+  this.handshake = this.buildHandshake(query);
+  this.fns = [];
+  this.flags = {};
+  this._rooms = [];
+}
+
+/**
+ * Inherits from `EventEmitter`.
+ */
+
+Socket.prototype.__proto__ = Emitter.prototype;
+
+/**
+ * Apply flags from `Socket`.
+ */
+
+flags.forEach(function(flag){
+  Object.defineProperty(Socket.prototype, flag, {
+    get: function() {
+      this.flags[flag] = true;
+      return this;
+    }
+  });
+});
+
+/**
+ * `request` engine.io shortcut.
+ *
+ * @api public
+ */
+
+Object.defineProperty(Socket.prototype, 'request', {
+  get: function() {
+    return this.conn.request;
+  }
+});
+
+/**
+ * Builds the `handshake` BC object
+ *
+ * @api private
+ */
+
+Socket.prototype.buildHandshake = function(query){
+  var self = this;
+  function buildQuery(){
+    var requestQuery = url.parse(self.request.url, true).query;
+    //if socket-specific query exist, replace query strings in requestQuery
+    return assign({}, query, requestQuery);
+  }
+  return {
+    headers: this.request.headers,
+    time: (new Date) + '',
+    address: this.conn.remoteAddress,
+    xdomain: !!this.request.headers.origin,
+    secure: !!this.request.connection.encrypted,
+    issued: +(new Date),
+    url: this.request.url,
+    query: buildQuery()
+  };
+};
+
+/**
+ * Emits to this client.
+ *
+ * @return {Socket} self
+ * @api public
+ */
+
+Socket.prototype.emit = function(ev){
+  if (~exports.events.indexOf(ev)) {
+    emit.apply(this, arguments);
+    return this;
+  }
+
+  var args = Array.prototype.slice.call(arguments);
+  var packet = {
+    type: parser.EVENT,
+    data: args
+  };
+
+  // access last argument to see if it's an ACK callback
+  if (typeof args[args.length - 1] === 'function') {
+    if (this._rooms.length || this.flags.broadcast) {
+      throw new Error('Callbacks are not supported when broadcasting');
+    }
+
+    debug('emitting packet with ack id %d', this.nsp.ids);
+    this.acks[this.nsp.ids] = args.pop();
+    packet.id = this.nsp.ids++;
+  }
+
+  var rooms = this._rooms.slice(0);
+  var flags = assign({}, this.flags);
+
+  // reset flags
+  this._rooms = [];
+  this.flags = {};
+
+  if (rooms.length || flags.broadcast) {
+    this.adapter.broadcast(packet, {
+      except: [this.id],
+      rooms: rooms,
+      flags: flags
+    });
+  } else {
+    // dispatch packet
+    this.packet(packet, flags);
+  }
+  return this;
+};
+
+/**
+ * Targets a room when broadcasting.
+ *
+ * @param {String} name
+ * @return {Socket} self
+ * @api public
+ */
+
+Socket.prototype.to =
+Socket.prototype.in = function(name){
+  if (!~this._rooms.indexOf(name)) this._rooms.push(name);
+  return this;
+};
+
+/**
+ * Sends a `message` event.
+ *
+ * @return {Socket} self
+ * @api public
+ */
+
+Socket.prototype.send =
+Socket.prototype.write = function(){
+  var args = Array.prototype.slice.call(arguments);
+  args.unshift('message');
+  this.emit.apply(this, args);
+  return this;
+};
+
+/**
+ * Writes a packet.
+ *
+ * @param {Object} packet object
+ * @param {Object} opts options
+ * @api private
+ */
+
+Socket.prototype.packet = function(packet, opts){
+  packet.nsp = this.nsp.name;
+  opts = opts || {};
+  opts.compress = false !== opts.compress;
+  this.client.packet(packet, opts);
+};
+
+/**
+ * Joins a room.
+ *
+ * @param {String|Array} room or array of rooms
+ * @param {Function} fn optional, callback
+ * @return {Socket} self
+ * @api private
+ */
+
+Socket.prototype.join = function(rooms, fn){
+  debug('joining room %s', rooms);
+  var self = this;
+  if (!Array.isArray(rooms)) {
+    rooms = [rooms];
+  }
+  rooms = rooms.filter(function (room) {
+    return !self.rooms.hasOwnProperty(room);
+  });
+  if (!rooms.length) {
+    fn && fn(null);
+    return this;
+  }
+  this.adapter.addAll(this.id, rooms, function(err){
+    if (err) return fn && fn(err);
+    debug('joined room %s', rooms);
+    rooms.forEach(function (room) {
+      self.rooms[room] = room;
+    });
+    fn && fn(null);
+  });
+  return this;
+};
+
+/**
+ * Leaves a room.
+ *
+ * @param {String} room
+ * @param {Function} fn optional, callback
+ * @return {Socket} self
+ * @api private
+ */
+
+Socket.prototype.leave = function(room, fn){
+  debug('leave room %s', room);
+  var self = this;
+  this.adapter.del(this.id, room, function(err){
+    if (err) return fn && fn(err);
+    debug('left room %s', room);
+    delete self.rooms[room];
+    fn && fn(null);
+  });
+  return this;
+};
+
+/**
+ * Leave all rooms.
+ *
+ * @api private
+ */
+
+Socket.prototype.leaveAll = function(){
+  this.adapter.delAll(this.id);
+  this.rooms = {};
+};
+
+/**
+ * Called by `Namespace` upon successful
+ * middleware execution (ie: authorization).
+ * Socket is added to namespace array before
+ * call to join, so adapters can access it.
+ *
+ * @api private
+ */
+
+Socket.prototype.onconnect = function(){
+  debug('socket connected - writing packet');
+  this.nsp.connected[this.id] = this;
+  this.join(this.id);
+  var skip = this.nsp.name === '/' && this.nsp.fns.length === 0;
+  if (skip) {
+    debug('packet already sent in initial handshake');
+  } else {
+    this.packet({ type: parser.CONNECT });
+  }
+};
+
+/**
+ * Called with each packet. Called by `Client`.
+ *
+ * @param {Object} packet
+ * @api private
+ */
+
+Socket.prototype.onpacket = function(packet){
+  debug('got packet %j', packet);
+  switch (packet.type) {
+    case parser.EVENT:
+      this.onevent(packet);
+      break;
+
+    case parser.BINARY_EVENT:
+      this.onevent(packet);
+      break;
+
+    case parser.ACK:
+      this.onack(packet);
+      break;
+
+    case parser.BINARY_ACK:
+      this.onack(packet);
+      break;
+
+    case parser.DISCONNECT:
+      this.ondisconnect();
+      break;
+
+    case parser.ERROR:
+      this.emit('error', packet.data);
+  }
+};
+
+/**
+ * Called upon event packet.
+ *
+ * @param {Object} packet object
+ * @api private
+ */
+
+Socket.prototype.onevent = function(packet){
+  var args = packet.data || [];
+  debug('emitting event %j', args);
+
+  if (null != packet.id) {
+    debug('attaching ack callback to event');
+    args.push(this.ack(packet.id));
+  }
+
+  this.dispatch(args);
+};
+
+/**
+ * Produces an ack callback to emit with an event.
+ *
+ * @param {Number} id packet id
+ * @api private
+ */
+
+Socket.prototype.ack = function(id){
+  var self = this;
+  var sent = false;
+  return function(){
+    // prevent double callbacks
+    if (sent) return;
+    var args = Array.prototype.slice.call(arguments);
+    debug('sending ack %j', args);
+
+    self.packet({
+      id: id,
+      type: parser.ACK,
+      data: args
+    });
+
+    sent = true;
+  };
+};
+
+/**
+ * Called upon ack packet.
+ *
+ * @api private
+ */
+
+Socket.prototype.onack = function(packet){
+  var ack = this.acks[packet.id];
+  if ('function' == typeof ack) {
+    debug('calling ack %s with %j', packet.id, packet.data);
+    ack.apply(this, packet.data);
+    delete this.acks[packet.id];
+  } else {
+    debug('bad ack %s', packet.id);
+  }
+};
+
+/**
+ * Called upon client disconnect packet.
+ *
+ * @api private
+ */
+
+Socket.prototype.ondisconnect = function(){
+  debug('got disconnect packet');
+  this.onclose('client namespace disconnect');
+};
+
+/**
+ * Handles a client error.
+ *
+ * @api private
+ */
+
+Socket.prototype.onerror = function(err){
+  if (this.listeners('error').length) {
+    this.emit('error', err);
+  } else {
+    console.error('Missing error handler on `socket`.');
+    console.error(err.stack);
+  }
+};
+
+/**
+ * Called upon closing. Called by `Client`.
+ *
+ * @param {String} reason
+ * @throw {Error} optional error object
+ * @api private
+ */
+
+Socket.prototype.onclose = function(reason){
+  if (!this.connected) return this;
+  debug('closing socket - reason %s', reason);
+  this.emit('disconnecting', reason);
+  this.leaveAll();
+  this.nsp.remove(this);
+  this.client.remove(this);
+  this.connected = false;
+  this.disconnected = true;
+  delete this.nsp.connected[this.id];
+  this.emit('disconnect', reason);
+};
+
+/**
+ * Produces an `error` packet.
+ *
+ * @param {Object} err error object
+ * @api private
+ */
+
+Socket.prototype.error = function(err){
+  this.packet({ type: parser.ERROR, data: err });
+};
+
+/**
+ * Disconnects this client.
+ *
+ * @param {Boolean} close if `true`, closes the underlying connection
+ * @return {Socket} self
+ * @api public
+ */
+
+Socket.prototype.disconnect = function(close){
+  if (!this.connected) return this;
+  if (close) {
+    this.client.disconnect();
+  } else {
+    this.packet({ type: parser.DISCONNECT });
+    this.onclose('server namespace disconnect');
+  }
+  return this;
+};
+
+/**
+ * Sets the compress flag.
+ *
+ * @param {Boolean} compress if `true`, compresses the sending data
+ * @return {Socket} self
+ * @api public
+ */
+
+Socket.prototype.compress = function(compress){
+  this.flags.compress = compress;
+  return this;
+};
+
+/**
+ * Dispatch incoming event to socket listeners.
+ *
+ * @param {Array} event that will get emitted
+ * @api private
+ */
+
+Socket.prototype.dispatch = function(event){
+  debug('dispatching an event %j', event);
+  var self = this;
+  function dispatchSocket(err) {
+    process.nextTick(function(){
+      if (err) {
+        return self.error(err.data || err.message);
+      }
+      emit.apply(self, event);
+    });
+  }
+  this.run(event, dispatchSocket);
+};
+
+/**
+ * Sets up socket middleware.
+ *
+ * @param {Function} middleware function (event, next)
+ * @return {Socket} self
+ * @api public
+ */
+
+Socket.prototype.use = function(fn){
+  this.fns.push(fn);
+  return this;
+};
+
+/**
+ * Executes the middleware for an incoming event.
+ *
+ * @param {Array} event that will get emitted
+ * @param {Function} last fn call in the middleware
+ * @api private
+ */
+Socket.prototype.run = function(event, fn){
+  var fns = this.fns.slice(0);
+  if (!fns.length) return fn(null);
+
+  function run(i){
+    fns[i](event, function(err){
+      // upon error, short-circuit
+      if (err) return fn(err);
+
+      // if no middleware left, summon callback
+      if (!fns[i + 1]) return fn(null);
+
+      // go on to next
+      run(i + 1);
+    });
+  }
+
+  run(0);
+};
diff --git a/wrt/node_modules/socket.io/node_modules/debug/.coveralls.yml b/wrt/node_modules/socket.io/node_modules/debug/.coveralls.yml
new file mode 100644 (file)
index 0000000..20a7068
--- /dev/null
@@ -0,0 +1 @@
+repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve
diff --git a/wrt/node_modules/socket.io/node_modules/debug/.eslintrc b/wrt/node_modules/socket.io/node_modules/debug/.eslintrc
new file mode 100644 (file)
index 0000000..8a37ae2
--- /dev/null
@@ -0,0 +1,11 @@
+{
+  "env": {
+    "browser": true,
+    "node": true
+  },
+  "rules": {
+    "no-console": 0,
+    "no-empty": [1, { "allowEmptyCatch": true }]
+  },
+  "extends": "eslint:recommended"
+}
diff --git a/wrt/node_modules/socket.io/node_modules/debug/.npmignore b/wrt/node_modules/socket.io/node_modules/debug/.npmignore
new file mode 100644 (file)
index 0000000..5f60eec
--- /dev/null
@@ -0,0 +1,9 @@
+support
+test
+examples
+example
+*.sock
+dist
+yarn.lock
+coverage
+bower.json
diff --git a/wrt/node_modules/socket.io/node_modules/debug/.travis.yml b/wrt/node_modules/socket.io/node_modules/debug/.travis.yml
new file mode 100644 (file)
index 0000000..6c6090c
--- /dev/null
@@ -0,0 +1,14 @@
+
+language: node_js
+node_js:
+  - "6"
+  - "5"
+  - "4"
+
+install:
+  - make node_modules
+
+script:
+  - make lint
+  - make test
+  - make coveralls
diff --git a/wrt/node_modules/socket.io/node_modules/debug/CHANGELOG.md b/wrt/node_modules/socket.io/node_modules/debug/CHANGELOG.md
new file mode 100644 (file)
index 0000000..eadaa18
--- /dev/null
@@ -0,0 +1,362 @@
+
+2.6.9 / 2017-09-22
+==================
+
+  * remove ReDoS regexp in %o formatter (#504)
+
+2.6.8 / 2017-05-18
+==================
+
+  * Fix: Check for undefined on browser globals (#462, @marbemac)
+
+2.6.7 / 2017-05-16
+==================
+
+  * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom)
+  * Fix: Inline extend function in node implementation (#452, @dougwilson)
+  * Docs: Fix typo (#455, @msasad)
+
+2.6.5 / 2017-04-27
+==================
+  
+  * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek)
+  * Misc: clean up browser reference checks (#447, @thebigredgeek)
+  * Misc: add npm-debug.log to .gitignore (@thebigredgeek)
+
+
+2.6.4 / 2017-04-20
+==================
+
+  * Fix: bug that would occure if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo)
+  * Chore: ignore bower.json in npm installations. (#437, @joaovieira)
+  * Misc: update "ms" to v0.7.3 (@tootallnate)
+
+2.6.3 / 2017-03-13
+==================
+
+  * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts)
+  * Docs: Changelog fix (@thebigredgeek)
+
+2.6.2 / 2017-03-10
+==================
+
+  * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin)
+  * Docs: Add backers and sponsors from Open Collective (#422, @piamancini)
+  * Docs: Add Slackin invite badge (@tootallnate)
+
+2.6.1 / 2017-02-10
+==================
+
+  * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error
+  * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0)
+  * Fix: IE8 "Expected identifier" error (#414, @vgoma)
+  * Fix: Namespaces would not disable once enabled (#409, @musikov)
+
+2.6.0 / 2016-12-28
+==================
+
+  * Fix: added better null pointer checks for browser useColors (@thebigredgeek)
+  * Improvement: removed explicit `window.debug` export (#404, @tootallnate)
+  * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate)
+
+2.5.2 / 2016-12-25
+==================
+
+  * Fix: reference error on window within webworkers (#393, @KlausTrainer)
+  * Docs: fixed README typo (#391, @lurch)
+  * Docs: added notice about v3 api discussion (@thebigredgeek)
+
+2.5.1 / 2016-12-20
+==================
+
+  * Fix: babel-core compatibility
+
+2.5.0 / 2016-12-20
+==================
+
+  * Fix: wrong reference in bower file (@thebigredgeek)
+  * Fix: webworker compatibility (@thebigredgeek)
+  * Fix: output formatting issue (#388, @kribblo)
+  * Fix: babel-loader compatibility (#383, @escwald)
+  * Misc: removed built asset from repo and publications (@thebigredgeek)
+  * Misc: moved source files to /src (#378, @yamikuronue)
+  * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue)
+  * Test: coveralls integration (#378, @yamikuronue)
+  * Docs: simplified language in the opening paragraph (#373, @yamikuronue)
+
+2.4.5 / 2016-12-17
+==================
+
+  * Fix: `navigator` undefined in Rhino (#376, @jochenberger)
+  * Fix: custom log function (#379, @hsiliev)
+  * Improvement: bit of cleanup + linting fixes (@thebigredgeek)
+  * Improvement: rm non-maintainted `dist/` dir (#375, @freewil)
+  * Docs: simplified language in the opening paragraph. (#373, @yamikuronue)
+
+2.4.4 / 2016-12-14
+==================
+
+  * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts)
+
+2.4.3 / 2016-12-14
+==================
+
+  * Fix: navigation.userAgent error for react native (#364, @escwald)
+
+2.4.2 / 2016-12-14
+==================
+
+  * Fix: browser colors (#367, @tootallnate)
+  * Misc: travis ci integration (@thebigredgeek)
+  * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek)
+
+2.4.1 / 2016-12-13
+==================
+
+  * Fix: typo that broke the package (#356)
+
+2.4.0 / 2016-12-13
+==================
+
+  * Fix: bower.json references unbuilt src entry point (#342, @justmatt)
+  * Fix: revert "handle regex special characters" (@tootallnate)
+  * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate)
+  * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate)
+  * Improvement: allow colors in workers (#335, @botverse)
+  * Improvement: use same color for same namespace. (#338, @lchenay)
+
+2.3.3 / 2016-11-09
+==================
+
+  * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne)
+  * Fix: Returning `localStorage` saved values (#331, Levi Thomason)
+  * Improvement: Don't create an empty object when no `process` (Nathan Rajlich)
+
+2.3.2 / 2016-11-09
+==================
+
+  * Fix: be super-safe in index.js as well (@TooTallNate)
+  * Fix: should check whether process exists (Tom Newby)
+
+2.3.1 / 2016-11-09
+==================
+
+  * Fix: Added electron compatibility (#324, @paulcbetts)
+  * Improvement: Added performance optimizations (@tootallnate)
+  * Readme: Corrected PowerShell environment variable example (#252, @gimre)
+  * Misc: Removed yarn lock file from source control (#321, @fengmk2)
+
+2.3.0 / 2016-11-07
+==================
+
+  * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic)
+  * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos)
+  * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15)
+  * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran)
+  * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom)
+  * Package: Update "ms" to 0.7.2 (#315, @DevSide)
+  * Package: removed superfluous version property from bower.json (#207 @kkirsche)
+  * Readme: fix USE_COLORS to DEBUG_COLORS
+  * Readme: Doc fixes for format string sugar (#269, @mlucool)
+  * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0)
+  * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable)
+  * Readme: better docs for browser support (#224, @matthewmueller)
+  * Tooling: Added yarn integration for development (#317, @thebigredgeek)
+  * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek)
+  * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman)
+  * Misc: Updated contributors (@thebigredgeek)
+
+2.2.0 / 2015-05-09
+==================
+
+  * package: update "ms" to v0.7.1 (#202, @dougwilson)
+  * README: add logging to file example (#193, @DanielOchoa)
+  * README: fixed a typo (#191, @amir-s)
+  * browser: expose `storage` (#190, @stephenmathieson)
+  * Makefile: add a `distclean` target (#189, @stephenmathieson)
+
+2.1.3 / 2015-03-13
+==================
+
+  * Updated stdout/stderr example (#186)
+  * Updated example/stdout.js to match debug current behaviour
+  * Renamed example/stderr.js to stdout.js
+  * Update Readme.md (#184)
+  * replace high intensity foreground color for bold (#182, #183)
+
+2.1.2 / 2015-03-01
+==================
+
+  * dist: recompile
+  * update "ms" to v0.7.0
+  * package: update "browserify" to v9.0.3
+  * component: fix "ms.js" repo location
+  * changed bower package name
+  * updated documentation about using debug in a browser
+  * fix: security error on safari (#167, #168, @yields)
+
+2.1.1 / 2014-12-29
+==================
+
+  * browser: use `typeof` to check for `console` existence
+  * browser: check for `console.log` truthiness (fix IE 8/9)
+  * browser: add support for Chrome apps
+  * Readme: added Windows usage remarks
+  * Add `bower.json` to properly support bower install
+
+2.1.0 / 2014-10-15
+==================
+
+  * node: implement `DEBUG_FD` env variable support
+  * package: update "browserify" to v6.1.0
+  * package: add "license" field to package.json (#135, @panuhorsmalahti)
+
+2.0.0 / 2014-09-01
+==================
+
+  * package: update "browserify" to v5.11.0
+  * node: use stderr rather than stdout for logging (#29, @stephenmathieson)
+
+1.0.4 / 2014-07-15
+==================
+
+  * dist: recompile
+  * example: remove `console.info()` log usage
+  * example: add "Content-Type" UTF-8 header to browser example
+  * browser: place %c marker after the space character
+  * browser: reset the "content" color via `color: inherit`
+  * browser: add colors support for Firefox >= v31
+  * debug: prefer an instance `log()` function over the global one (#119)
+  * Readme: update documentation about styled console logs for FF v31 (#116, @wryk)
+
+1.0.3 / 2014-07-09
+==================
+
+  * Add support for multiple wildcards in namespaces (#122, @seegno)
+  * browser: fix lint
+
+1.0.2 / 2014-06-10
+==================
+
+  * browser: update color palette (#113, @gscottolson)
+  * common: make console logging function configurable (#108, @timoxley)
+  * node: fix %o colors on old node <= 0.8.x
+  * Makefile: find node path using shell/which (#109, @timoxley)
+
+1.0.1 / 2014-06-06
+==================
+
+  * browser: use `removeItem()` to clear localStorage
+  * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777)
+  * package: add "contributors" section
+  * node: fix comment typo
+  * README: list authors
+
+1.0.0 / 2014-06-04
+==================
+
+  * make ms diff be global, not be scope
+  * debug: ignore empty strings in enable()
+  * node: make DEBUG_COLORS able to disable coloring
+  * *: export the `colors` array
+  * npmignore: don't publish the `dist` dir
+  * Makefile: refactor to use browserify
+  * package: add "browserify" as a dev dependency
+  * Readme: add Web Inspector Colors section
+  * node: reset terminal color for the debug content
+  * node: map "%o" to `util.inspect()`
+  * browser: map "%j" to `JSON.stringify()`
+  * debug: add custom "formatters"
+  * debug: use "ms" module for humanizing the diff
+  * Readme: add "bash" syntax highlighting
+  * browser: add Firebug color support
+  * browser: add colors for WebKit browsers
+  * node: apply log to `console`
+  * rewrite: abstract common logic for Node & browsers
+  * add .jshintrc file
+
+0.8.1 / 2014-04-14
+==================
+
+  * package: re-add the "component" section
+
+0.8.0 / 2014-03-30
+==================
+
+  * add `enable()` method for nodejs. Closes #27
+  * change from stderr to stdout
+  * remove unnecessary index.js file
+
+0.7.4 / 2013-11-13
+==================
+
+  * remove "browserify" key from package.json (fixes something in browserify)
+
+0.7.3 / 2013-10-30
+==================
+
+  * fix: catch localStorage security error when cookies are blocked (Chrome)
+  * add debug(err) support. Closes #46
+  * add .browser prop to package.json. Closes #42
+
+0.7.2 / 2013-02-06
+==================
+
+  * fix package.json
+  * fix: Mobile Safari (private mode) is broken with debug
+  * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript
+
+0.7.1 / 2013-02-05
+==================
+
+  * add repository URL to package.json
+  * add DEBUG_COLORED to force colored output
+  * add browserify support
+  * fix component. Closes #24
+
+0.7.0 / 2012-05-04
+==================
+
+  * Added .component to package.json
+  * Added debug.component.js build
+
+0.6.0 / 2012-03-16
+==================
+
+  * Added support for "-" prefix in DEBUG [Vinay Pulim]
+  * Added `.enabled` flag to the node version [TooTallNate]
+
+0.5.0 / 2012-02-02
+==================
+
+  * Added: humanize diffs. Closes #8
+  * Added `debug.disable()` to the CS variant
+  * Removed padding. Closes #10
+  * Fixed: persist client-side variant again. Closes #9
+
+0.4.0 / 2012-02-01
+==================
+
+  * Added browser variant support for older browsers [TooTallNate]
+  * Added `debug.enable('project:*')` to browser variant [TooTallNate]
+  * Added padding to diff (moved it to the right)
+
+0.3.0 / 2012-01-26
+==================
+
+  * Added millisecond diff when isatty, otherwise UTC string
+
+0.2.0 / 2012-01-22
+==================
+
+  * Added wildcard support
+
+0.1.0 / 2011-12-02
+==================
+
+  * Added: remove colors unless stderr isatty [TooTallNate]
+
+0.0.1 / 2010-01-03
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/socket.io/node_modules/debug/LICENSE b/wrt/node_modules/socket.io/node_modules/debug/LICENSE
new file mode 100644 (file)
index 0000000..658c933
--- /dev/null
@@ -0,0 +1,19 @@
+(The MIT License)
+
+Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software 
+and associated documentation files (the 'Software'), to deal in the Software without restriction, 
+including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial 
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 
+LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/wrt/node_modules/socket.io/node_modules/debug/Makefile b/wrt/node_modules/socket.io/node_modules/debug/Makefile
new file mode 100644 (file)
index 0000000..584da8b
--- /dev/null
@@ -0,0 +1,50 @@
+# get Makefile directory name: http://stackoverflow.com/a/5982798/376773
+THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
+THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)
+
+# BIN directory
+BIN := $(THIS_DIR)/node_modules/.bin
+
+# Path
+PATH := node_modules/.bin:$(PATH)
+SHELL := /bin/bash
+
+# applications
+NODE ?= $(shell which node)
+YARN ?= $(shell which yarn)
+PKG ?= $(if $(YARN),$(YARN),$(NODE) $(shell which npm))
+BROWSERIFY ?= $(NODE) $(BIN)/browserify
+
+.FORCE:
+
+install: node_modules
+
+node_modules: package.json
+       @NODE_ENV= $(PKG) install
+       @touch node_modules
+
+lint: .FORCE
+       eslint browser.js debug.js index.js node.js
+
+test-node: .FORCE
+       istanbul cover node_modules/mocha/bin/_mocha -- test/**.js
+
+test-browser: .FORCE
+       mkdir -p dist
+
+       @$(BROWSERIFY) \
+               --standalone debug \
+               . > dist/debug.js
+
+       karma start --single-run
+       rimraf dist
+
+test: .FORCE
+       concurrently \
+               "make test-node" \
+               "make test-browser"
+
+coveralls:
+       cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
+
+.PHONY: all install clean distclean
diff --git a/wrt/node_modules/socket.io/node_modules/debug/README.md b/wrt/node_modules/socket.io/node_modules/debug/README.md
new file mode 100644 (file)
index 0000000..f67be6b
--- /dev/null
@@ -0,0 +1,312 @@
+# debug
+[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug)  [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master)  [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers) 
+[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors)
+
+
+
+A tiny node.js debugging utility modelled after node core's debugging technique.
+
+**Discussion around the V3 API is under way [here](https://github.com/visionmedia/debug/issues/370)**
+
+## Installation
+
+```bash
+$ npm install debug
+```
+
+## Usage
+
+`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole.
+
+Example _app.js_:
+
+```js
+var debug = require('debug')('http')
+  , http = require('http')
+  , name = 'My App';
+
+// fake app
+
+debug('booting %s', name);
+
+http.createServer(function(req, res){
+  debug(req.method + ' ' + req.url);
+  res.end('hello\n');
+}).listen(3000, function(){
+  debug('listening');
+});
+
+// fake worker of some kind
+
+require('./worker');
+```
+
+Example _worker.js_:
+
+```js
+var debug = require('debug')('worker');
+
+setInterval(function(){
+  debug('doing some work');
+}, 1000);
+```
+
+ The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:
+
+  ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png)
+
+  ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png)
+
+#### Windows note
+
+ On Windows the environment variable is set using the `set` command.
+
+ ```cmd
+ set DEBUG=*,-not_this
+ ```
+
+ Note that PowerShell uses different syntax to set environment variables.
+
+ ```cmd
+ $env:DEBUG = "*,-not_this"
+  ```
+
+Then, run the program to be debugged as usual.
+
+## Millisecond diff
+
+  When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.
+
+  ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png)
+
+  When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:
+
+  ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png)
+
+## Conventions
+
+  If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser".
+
+## Wildcards
+
+  The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.
+
+  You can also exclude specific debuggers by prefixing them with a "-" character.  For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:".
+
+## Environment Variables
+
+  When running through Node.js, you can set a few environment variables that will
+  change the behavior of the debug logging:
+
+| Name      | Purpose                                         |
+|-----------|-------------------------------------------------|
+| `DEBUG`   | Enables/disables specific debugging namespaces. |
+| `DEBUG_COLORS`| Whether or not to use colors in the debug output. |
+| `DEBUG_DEPTH` | Object inspection depth. |
+| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. |
+
+
+  __Note:__ The environment variables beginning with `DEBUG_` end up being
+  converted into an Options object that gets used with `%o`/`%O` formatters.
+  See the Node.js documentation for
+  [`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options)
+  for the complete list.
+
+## Formatters
+
+
+  Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting. Below are the officially supported formatters:
+
+| Formatter | Representation |
+|-----------|----------------|
+| `%O`      | Pretty-print an Object on multiple lines. |
+| `%o`      | Pretty-print an Object all on a single line. |
+| `%s`      | String. |
+| `%d`      | Number (both integer and float). |
+| `%j`      | JSON. Replaced with the string '[Circular]' if the argument contains circular references. |
+| `%%`      | Single percent sign ('%'). This does not consume an argument. |
+
+### Custom formatters
+
+  You can add custom formatters by extending the `debug.formatters` object. For example, if you wanted to add support for rendering a Buffer as hex with `%h`, you could do something like:
+
+```js
+const createDebug = require('debug')
+createDebug.formatters.h = (v) => {
+  return v.toString('hex')
+}
+
+// …elsewhere
+const debug = createDebug('foo')
+debug('this is hex: %h', new Buffer('hello world'))
+//   foo this is hex: 68656c6c6f20776f726c6421 +0ms
+```
+
+## Browser support
+  You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify),
+  or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest),
+  if you don't want to build it yourself.
+
+  Debug's enable state is currently persisted by `localStorage`.
+  Consider the situation shown below where you have `worker:a` and `worker:b`,
+  and wish to debug both. You can enable this using `localStorage.debug`:
+
+```js
+localStorage.debug = 'worker:*'
+```
+
+And then refresh the page.
+
+```js
+a = debug('worker:a');
+b = debug('worker:b');
+
+setInterval(function(){
+  a('doing some work');
+}, 1000);
+
+setInterval(function(){
+  b('doing some work');
+}, 1200);
+```
+
+#### Web Inspector Colors
+
+  Colors are also enabled on "Web Inspectors" that understand the `%c` formatting
+  option. These are WebKit web inspectors, Firefox ([since version
+  31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))
+  and the Firebug plugin for Firefox (any version).
+
+  Colored output looks something like:
+
+  ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png)
+
+
+## Output streams
+
+  By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method:
+
+Example _stdout.js_:
+
+```js
+var debug = require('debug');
+var error = debug('app:error');
+
+// by default stderr is used
+error('goes to stderr!');
+
+var log = debug('app:log');
+// set this namespace to log via console.log
+log.log = console.log.bind(console); // don't forget to bind to console!
+log('goes to stdout');
+error('still goes to stderr!');
+
+// set all output to go via console.info
+// overrides all per-namespace log settings
+debug.log = console.info.bind(console);
+error('now goes to stdout via console.info');
+log('still goes to stdout, but via console.info now');
+```
+
+
+## Authors
+
+ - TJ Holowaychuk
+ - Nathan Rajlich
+ - Andrew Rhyne
+## Backers
+
+Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)]
+
+<a href="https://opencollective.com/debug/backer/0/website" target="_blank"><img src="https://opencollective.com/debug/backer/0/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/1/website" target="_blank"><img src="https://opencollective.com/debug/backer/1/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/2/website" target="_blank"><img src="https://opencollective.com/debug/backer/2/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/3/website" target="_blank"><img src="https://opencollective.com/debug/backer/3/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/4/website" target="_blank"><img src="https://opencollective.com/debug/backer/4/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/5/website" target="_blank"><img src="https://opencollective.com/debug/backer/5/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/6/website" target="_blank"><img src="https://opencollective.com/debug/backer/6/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/7/website" target="_blank"><img src="https://opencollective.com/debug/backer/7/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/8/website" target="_blank"><img src="https://opencollective.com/debug/backer/8/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/9/website" target="_blank"><img src="https://opencollective.com/debug/backer/9/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/10/website" target="_blank"><img src="https://opencollective.com/debug/backer/10/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/11/website" target="_blank"><img src="https://opencollective.com/debug/backer/11/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/12/website" target="_blank"><img src="https://opencollective.com/debug/backer/12/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/13/website" target="_blank"><img src="https://opencollective.com/debug/backer/13/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/14/website" target="_blank"><img src="https://opencollective.com/debug/backer/14/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/15/website" target="_blank"><img src="https://opencollective.com/debug/backer/15/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/16/website" target="_blank"><img src="https://opencollective.com/debug/backer/16/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/17/website" target="_blank"><img src="https://opencollective.com/debug/backer/17/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/18/website" target="_blank"><img src="https://opencollective.com/debug/backer/18/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/19/website" target="_blank"><img src="https://opencollective.com/debug/backer/19/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/20/website" target="_blank"><img src="https://opencollective.com/debug/backer/20/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/21/website" target="_blank"><img src="https://opencollective.com/debug/backer/21/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/22/website" target="_blank"><img src="https://opencollective.com/debug/backer/22/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/23/website" target="_blank"><img src="https://opencollective.com/debug/backer/23/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/24/website" target="_blank"><img src="https://opencollective.com/debug/backer/24/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/25/website" target="_blank"><img src="https://opencollective.com/debug/backer/25/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/26/website" target="_blank"><img src="https://opencollective.com/debug/backer/26/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/27/website" target="_blank"><img src="https://opencollective.com/debug/backer/27/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/28/website" target="_blank"><img src="https://opencollective.com/debug/backer/28/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/29/website" target="_blank"><img src="https://opencollective.com/debug/backer/29/avatar.svg"></a>
+
+
+## Sponsors
+
+Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)]
+
+<a href="https://opencollective.com/debug/sponsor/0/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/0/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/1/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/1/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/2/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/2/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/3/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/3/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/4/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/4/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/5/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/5/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/6/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/6/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/7/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/7/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/8/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/8/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/9/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/9/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/10/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/10/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/11/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/11/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/12/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/12/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/13/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/13/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/14/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/14/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/15/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/15/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/16/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/16/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/17/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/17/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/18/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/18/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/19/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/19/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/20/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/20/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/21/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/21/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/22/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/22/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/23/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/23/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/24/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/24/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/25/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/25/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/26/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/26/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/27/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/27/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/28/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/28/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/29/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/29/avatar.svg"></a>
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2014-2016 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/socket.io/node_modules/debug/component.json b/wrt/node_modules/socket.io/node_modules/debug/component.json
new file mode 100644 (file)
index 0000000..9de2641
--- /dev/null
@@ -0,0 +1,19 @@
+{
+  "name": "debug",
+  "repo": "visionmedia/debug",
+  "description": "small debugging utility",
+  "version": "2.6.9",
+  "keywords": [
+    "debug",
+    "log",
+    "debugger"
+  ],
+  "main": "src/browser.js",
+  "scripts": [
+    "src/browser.js",
+    "src/debug.js"
+  ],
+  "dependencies": {
+    "rauchg/ms.js": "0.7.1"
+  }
+}
diff --git a/wrt/node_modules/socket.io/node_modules/debug/karma.conf.js b/wrt/node_modules/socket.io/node_modules/debug/karma.conf.js
new file mode 100644 (file)
index 0000000..103a82d
--- /dev/null
@@ -0,0 +1,70 @@
+// Karma configuration
+// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC)
+
+module.exports = function(config) {
+  config.set({
+
+    // base path that will be used to resolve all patterns (eg. files, exclude)
+    basePath: '',
+
+
+    // frameworks to use
+    // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
+    frameworks: ['mocha', 'chai', 'sinon'],
+
+
+    // list of files / patterns to load in the browser
+    files: [
+      'dist/debug.js',
+      'test/*spec.js'
+    ],
+
+
+    // list of files to exclude
+    exclude: [
+      'src/node.js'
+    ],
+
+
+    // preprocess matching files before serving them to the browser
+    // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
+    preprocessors: {
+    },
+
+    // test results reporter to use
+    // possible values: 'dots', 'progress'
+    // available reporters: https://npmjs.org/browse/keyword/karma-reporter
+    reporters: ['progress'],
+
+
+    // web server port
+    port: 9876,
+
+
+    // enable / disable colors in the output (reporters and logs)
+    colors: true,
+
+
+    // level of logging
+    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
+    logLevel: config.LOG_INFO,
+
+
+    // enable / disable watching file and executing tests whenever any file changes
+    autoWatch: true,
+
+
+    // start these browsers
+    // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
+    browsers: ['PhantomJS'],
+
+
+    // Continuous Integration mode
+    // if true, Karma captures browsers, runs the tests and exits
+    singleRun: false,
+
+    // Concurrency level
+    // how many browser should be started simultaneous
+    concurrency: Infinity
+  })
+}
diff --git a/wrt/node_modules/socket.io/node_modules/debug/node.js b/wrt/node_modules/socket.io/node_modules/debug/node.js
new file mode 100644 (file)
index 0000000..7fc36fe
--- /dev/null
@@ -0,0 +1 @@
+module.exports = require('./src/node');
diff --git a/wrt/node_modules/socket.io/node_modules/debug/package.json b/wrt/node_modules/socket.io/node_modules/debug/package.json
new file mode 100644 (file)
index 0000000..59caec1
--- /dev/null
@@ -0,0 +1,136 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "debug@~2.6.6",
+        "scope": null,
+        "escapedName": "debug",
+        "name": "debug",
+        "rawSpec": "~2.6.6",
+        "spec": ">=2.6.6 <2.7.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io"
+    ]
+  ],
+  "_from": "debug@>=2.6.6 <2.7.0",
+  "_id": "debug@2.6.9",
+  "_inCache": true,
+  "_location": "/socket.io/debug",
+  "_nodeVersion": "8.4.0",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/debug-2.6.9.tgz_1506087154503_0.5196126794908196"
+  },
+  "_npmUser": {
+    "name": "tootallnate",
+    "email": "nathan@tootallnate.net"
+  },
+  "_npmVersion": "5.3.0",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "debug@~2.6.6",
+    "scope": null,
+    "escapedName": "debug",
+    "name": "debug",
+    "rawSpec": "~2.6.6",
+    "spec": ">=2.6.6 <2.7.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/socket.io"
+  ],
+  "_resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+  "_shasum": "5d128515df134ff327e90a4c93f4e077a536341f",
+  "_shrinkwrap": null,
+  "_spec": "debug@~2.6.6",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io",
+  "author": {
+    "name": "TJ Holowaychuk",
+    "email": "tj@vision-media.ca"
+  },
+  "browser": "./src/browser.js",
+  "bugs": {
+    "url": "https://github.com/visionmedia/debug/issues"
+  },
+  "component": {
+    "scripts": {
+      "debug/index.js": "browser.js",
+      "debug/debug.js": "debug.js"
+    }
+  },
+  "contributors": [
+    {
+      "name": "Nathan Rajlich",
+      "email": "nathan@tootallnate.net",
+      "url": "http://n8.io"
+    },
+    {
+      "name": "Andrew Rhyne",
+      "email": "rhyneandrew@gmail.com"
+    }
+  ],
+  "dependencies": {
+    "ms": "2.0.0"
+  },
+  "description": "small debugging utility",
+  "devDependencies": {
+    "browserify": "9.0.3",
+    "chai": "^3.5.0",
+    "concurrently": "^3.1.0",
+    "coveralls": "^2.11.15",
+    "eslint": "^3.12.1",
+    "istanbul": "^0.4.5",
+    "karma": "^1.3.0",
+    "karma-chai": "^0.1.0",
+    "karma-mocha": "^1.3.0",
+    "karma-phantomjs-launcher": "^1.0.2",
+    "karma-sinon": "^1.0.5",
+    "mocha": "^3.2.0",
+    "mocha-lcov-reporter": "^1.2.0",
+    "rimraf": "^2.5.4",
+    "sinon": "^1.17.6",
+    "sinon-chai": "^2.8.0"
+  },
+  "directories": {},
+  "dist": {
+    "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+    "shasum": "5d128515df134ff327e90a4c93f4e077a536341f",
+    "tarball": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz"
+  },
+  "gitHead": "13abeae468fea297d0dccc50bc55590809241083",
+  "homepage": "https://github.com/visionmedia/debug#readme",
+  "keywords": [
+    "debug",
+    "log",
+    "debugger"
+  ],
+  "license": "MIT",
+  "main": "./src/index.js",
+  "maintainers": [
+    {
+      "name": "thebigredgeek",
+      "email": "rhyneandrew@gmail.com"
+    },
+    {
+      "name": "kolban",
+      "email": "kolban1@kolban.com"
+    },
+    {
+      "name": "tootallnate",
+      "email": "nathan@tootallnate.net"
+    },
+    {
+      "name": "tjholowaychuk",
+      "email": "tj@vision-media.ca"
+    }
+  ],
+  "name": "debug",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/visionmedia/debug.git"
+  },
+  "version": "2.6.9"
+}
diff --git a/wrt/node_modules/socket.io/node_modules/debug/src/browser.js b/wrt/node_modules/socket.io/node_modules/debug/src/browser.js
new file mode 100644 (file)
index 0000000..7106924
--- /dev/null
@@ -0,0 +1,185 @@
+/**
+ * This is the web browser implementation of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = require('./debug');
+exports.log = log;
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+exports.storage = 'undefined' != typeof chrome
+               && 'undefined' != typeof chrome.storage
+                  ? chrome.storage.local
+                  : localstorage();
+
+/**
+ * Colors.
+ */
+
+exports.colors = [
+  'lightseagreen',
+  'forestgreen',
+  'goldenrod',
+  'dodgerblue',
+  'darkorchid',
+  'crimson'
+];
+
+/**
+ * Currently only WebKit-based Web Inspectors, Firefox >= v31,
+ * and the Firebug extension (any Firefox version) are known
+ * to support "%c" CSS customizations.
+ *
+ * TODO: add a `localStorage` variable to explicitly enable/disable colors
+ */
+
+function useColors() {
+  // NB: In an Electron preload script, document will be defined but not fully
+  // initialized. Since we know we're in Chrome, we'll just detect this case
+  // explicitly
+  if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
+    return true;
+  }
+
+  // is webkit? http://stackoverflow.com/a/16459606/376773
+  // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
+  return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
+    // is firebug? http://stackoverflow.com/a/398120/376773
+    (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
+    // is firefox >= v31?
+    // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
+    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
+    // double check webkit in userAgent just in case we are in a worker
+    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
+}
+
+/**
+ * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
+ */
+
+exports.formatters.j = function(v) {
+  try {
+    return JSON.stringify(v);
+  } catch (err) {
+    return '[UnexpectedJSONParseError]: ' + err.message;
+  }
+};
+
+
+/**
+ * Colorize log arguments if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+  var useColors = this.useColors;
+
+  args[0] = (useColors ? '%c' : '')
+    + this.namespace
+    + (useColors ? ' %c' : ' ')
+    + args[0]
+    + (useColors ? '%c ' : ' ')
+    + '+' + exports.humanize(this.diff);
+
+  if (!useColors) return;
+
+  var c = 'color: ' + this.color;
+  args.splice(1, 0, c, 'color: inherit')
+
+  // the final "%c" is somewhat tricky, because there could be other
+  // arguments passed either before or after the %c, so we need to
+  // figure out the correct index to insert the CSS into
+  var index = 0;
+  var lastC = 0;
+  args[0].replace(/%[a-zA-Z%]/g, function(match) {
+    if ('%%' === match) return;
+    index++;
+    if ('%c' === match) {
+      // we only are interested in the *last* %c
+      // (the user may have provided their own)
+      lastC = index;
+    }
+  });
+
+  args.splice(lastC, 0, c);
+}
+
+/**
+ * Invokes `console.log()` when available.
+ * No-op when `console.log` is not a "function".
+ *
+ * @api public
+ */
+
+function log() {
+  // this hackery is required for IE8/9, where
+  // the `console.log` function doesn't have 'apply'
+  return 'object' === typeof console
+    && console.log
+    && Function.prototype.apply.call(console.log, console, arguments);
+}
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+
+function save(namespaces) {
+  try {
+    if (null == namespaces) {
+      exports.storage.removeItem('debug');
+    } else {
+      exports.storage.debug = namespaces;
+    }
+  } catch(e) {}
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+
+function load() {
+  var r;
+  try {
+    r = exports.storage.debug;
+  } catch(e) {}
+
+  // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
+  if (!r && typeof process !== 'undefined' && 'env' in process) {
+    r = process.env.DEBUG;
+  }
+
+  return r;
+}
+
+/**
+ * Enable namespaces listed in `localStorage.debug` initially.
+ */
+
+exports.enable(load());
+
+/**
+ * Localstorage attempts to return the localstorage.
+ *
+ * This is necessary because safari throws
+ * when a user disables cookies/localstorage
+ * and you attempt to access it.
+ *
+ * @return {LocalStorage}
+ * @api private
+ */
+
+function localstorage() {
+  try {
+    return window.localStorage;
+  } catch (e) {}
+}
diff --git a/wrt/node_modules/socket.io/node_modules/debug/src/debug.js b/wrt/node_modules/socket.io/node_modules/debug/src/debug.js
new file mode 100644 (file)
index 0000000..6a5e3fc
--- /dev/null
@@ -0,0 +1,202 @@
+
+/**
+ * This is the common logic for both the Node.js and web browser
+ * implementations of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
+exports.coerce = coerce;
+exports.disable = disable;
+exports.enable = enable;
+exports.enabled = enabled;
+exports.humanize = require('ms');
+
+/**
+ * The currently active debug mode names, and names to skip.
+ */
+
+exports.names = [];
+exports.skips = [];
+
+/**
+ * Map of special "%n" handling functions, for the debug "format" argument.
+ *
+ * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
+ */
+
+exports.formatters = {};
+
+/**
+ * Previous log timestamp.
+ */
+
+var prevTime;
+
+/**
+ * Select a color.
+ * @param {String} namespace
+ * @return {Number}
+ * @api private
+ */
+
+function selectColor(namespace) {
+  var hash = 0, i;
+
+  for (i in namespace) {
+    hash  = ((hash << 5) - hash) + namespace.charCodeAt(i);
+    hash |= 0; // Convert to 32bit integer
+  }
+
+  return exports.colors[Math.abs(hash) % exports.colors.length];
+}
+
+/**
+ * Create a debugger with the given `namespace`.
+ *
+ * @param {String} namespace
+ * @return {Function}
+ * @api public
+ */
+
+function createDebug(namespace) {
+
+  function debug() {
+    // disabled?
+    if (!debug.enabled) return;
+
+    var self = debug;
+
+    // set `diff` timestamp
+    var curr = +new Date();
+    var ms = curr - (prevTime || curr);
+    self.diff = ms;
+    self.prev = prevTime;
+    self.curr = curr;
+    prevTime = curr;
+
+    // turn the `arguments` into a proper Array
+    var args = new Array(arguments.length);
+    for (var i = 0; i < args.length; i++) {
+      args[i] = arguments[i];
+    }
+
+    args[0] = exports.coerce(args[0]);
+
+    if ('string' !== typeof args[0]) {
+      // anything else let's inspect with %O
+      args.unshift('%O');
+    }
+
+    // apply any `formatters` transformations
+    var index = 0;
+    args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
+      // if we encounter an escaped % then don't increase the array index
+      if (match === '%%') return match;
+      index++;
+      var formatter = exports.formatters[format];
+      if ('function' === typeof formatter) {
+        var val = args[index];
+        match = formatter.call(self, val);
+
+        // now we need to remove `args[index]` since it's inlined in the `format`
+        args.splice(index, 1);
+        index--;
+      }
+      return match;
+    });
+
+    // apply env-specific formatting (colors, etc.)
+    exports.formatArgs.call(self, args);
+
+    var logFn = debug.log || exports.log || console.log.bind(console);
+    logFn.apply(self, args);
+  }
+
+  debug.namespace = namespace;
+  debug.enabled = exports.enabled(namespace);
+  debug.useColors = exports.useColors();
+  debug.color = selectColor(namespace);
+
+  // env-specific initialization logic for debug instances
+  if ('function' === typeof exports.init) {
+    exports.init(debug);
+  }
+
+  return debug;
+}
+
+/**
+ * Enables a debug mode by namespaces. This can include modes
+ * separated by a colon and wildcards.
+ *
+ * @param {String} namespaces
+ * @api public
+ */
+
+function enable(namespaces) {
+  exports.save(namespaces);
+
+  exports.names = [];
+  exports.skips = [];
+
+  var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
+  var len = split.length;
+
+  for (var i = 0; i < len; i++) {
+    if (!split[i]) continue; // ignore empty strings
+    namespaces = split[i].replace(/\*/g, '.*?');
+    if (namespaces[0] === '-') {
+      exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
+    } else {
+      exports.names.push(new RegExp('^' + namespaces + '$'));
+    }
+  }
+}
+
+/**
+ * Disable debug output.
+ *
+ * @api public
+ */
+
+function disable() {
+  exports.enable('');
+}
+
+/**
+ * Returns true if the given mode name is enabled, false otherwise.
+ *
+ * @param {String} name
+ * @return {Boolean}
+ * @api public
+ */
+
+function enabled(name) {
+  var i, len;
+  for (i = 0, len = exports.skips.length; i < len; i++) {
+    if (exports.skips[i].test(name)) {
+      return false;
+    }
+  }
+  for (i = 0, len = exports.names.length; i < len; i++) {
+    if (exports.names[i].test(name)) {
+      return true;
+    }
+  }
+  return false;
+}
+
+/**
+ * Coerce `val`.
+ *
+ * @param {Mixed} val
+ * @return {Mixed}
+ * @api private
+ */
+
+function coerce(val) {
+  if (val instanceof Error) return val.stack || val.message;
+  return val;
+}
diff --git a/wrt/node_modules/socket.io/node_modules/debug/src/index.js b/wrt/node_modules/socket.io/node_modules/debug/src/index.js
new file mode 100644 (file)
index 0000000..e12cf4d
--- /dev/null
@@ -0,0 +1,10 @@
+/**
+ * Detect Electron renderer process, which is node, but we should
+ * treat as a browser.
+ */
+
+if (typeof process !== 'undefined' && process.type === 'renderer') {
+  module.exports = require('./browser.js');
+} else {
+  module.exports = require('./node.js');
+}
diff --git a/wrt/node_modules/socket.io/node_modules/debug/src/inspector-log.js b/wrt/node_modules/socket.io/node_modules/debug/src/inspector-log.js
new file mode 100644 (file)
index 0000000..60ea6c0
--- /dev/null
@@ -0,0 +1,15 @@
+module.exports = inspectorLog;
+
+// black hole
+const nullStream = new (require('stream').Writable)();
+nullStream._write = () => {};
+
+/**
+ * Outputs a `console.log()` to the Node.js Inspector console *only*.
+ */
+function inspectorLog() {
+  const stdout = console._stdout;
+  console._stdout = nullStream;
+  console.log.apply(console, arguments);
+  console._stdout = stdout;
+}
diff --git a/wrt/node_modules/socket.io/node_modules/debug/src/node.js b/wrt/node_modules/socket.io/node_modules/debug/src/node.js
new file mode 100644 (file)
index 0000000..b15109c
--- /dev/null
@@ -0,0 +1,248 @@
+/**
+ * Module dependencies.
+ */
+
+var tty = require('tty');
+var util = require('util');
+
+/**
+ * This is the Node.js implementation of `debug()`.
+ *
+ * Expose `debug()` as the module.
+ */
+
+exports = module.exports = require('./debug');
+exports.init = init;
+exports.log = log;
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+
+/**
+ * Colors.
+ */
+
+exports.colors = [6, 2, 3, 4, 5, 1];
+
+/**
+ * Build up the default `inspectOpts` object from the environment variables.
+ *
+ *   $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
+ */
+
+exports.inspectOpts = Object.keys(process.env).filter(function (key) {
+  return /^debug_/i.test(key);
+}).reduce(function (obj, key) {
+  // camel-case
+  var prop = key
+    .substring(6)
+    .toLowerCase()
+    .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });
+
+  // coerce string value into JS value
+  var val = process.env[key];
+  if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
+  else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
+  else if (val === 'null') val = null;
+  else val = Number(val);
+
+  obj[prop] = val;
+  return obj;
+}, {});
+
+/**
+ * The file descriptor to write the `debug()` calls to.
+ * Set the `DEBUG_FD` env variable to override with another value. i.e.:
+ *
+ *   $ DEBUG_FD=3 node script.js 3>debug.log
+ */
+
+var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
+
+if (1 !== fd && 2 !== fd) {
+  util.deprecate(function(){}, 'except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)')()
+}
+
+var stream = 1 === fd ? process.stdout :
+             2 === fd ? process.stderr :
+             createWritableStdioStream(fd);
+
+/**
+ * Is stdout a TTY? Colored output is enabled when `true`.
+ */
+
+function useColors() {
+  return 'colors' in exports.inspectOpts
+    ? Boolean(exports.inspectOpts.colors)
+    : tty.isatty(fd);
+}
+
+/**
+ * Map %o to `util.inspect()`, all on a single line.
+ */
+
+exports.formatters.o = function(v) {
+  this.inspectOpts.colors = this.useColors;
+  return util.inspect(v, this.inspectOpts)
+    .split('\n').map(function(str) {
+      return str.trim()
+    }).join(' ');
+};
+
+/**
+ * Map %o to `util.inspect()`, allowing multiple lines if needed.
+ */
+
+exports.formatters.O = function(v) {
+  this.inspectOpts.colors = this.useColors;
+  return util.inspect(v, this.inspectOpts);
+};
+
+/**
+ * Adds ANSI color escape codes if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+  var name = this.namespace;
+  var useColors = this.useColors;
+
+  if (useColors) {
+    var c = this.color;
+    var prefix = '  \u001b[3' + c + ';1m' + name + ' ' + '\u001b[0m';
+
+    args[0] = prefix + args[0].split('\n').join('\n' + prefix);
+    args.push('\u001b[3' + c + 'm+' + exports.humanize(this.diff) + '\u001b[0m');
+  } else {
+    args[0] = new Date().toUTCString()
+      + ' ' + name + ' ' + args[0];
+  }
+}
+
+/**
+ * Invokes `util.format()` with the specified arguments and writes to `stream`.
+ */
+
+function log() {
+  return stream.write(util.format.apply(util, arguments) + '\n');
+}
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+
+function save(namespaces) {
+  if (null == namespaces) {
+    // If you set a process.env field to null or undefined, it gets cast to the
+    // string 'null' or 'undefined'. Just delete instead.
+    delete process.env.DEBUG;
+  } else {
+    process.env.DEBUG = namespaces;
+  }
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+
+function load() {
+  return process.env.DEBUG;
+}
+
+/**
+ * Copied from `node/src/node.js`.
+ *
+ * XXX: It's lame that node doesn't expose this API out-of-the-box. It also
+ * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.
+ */
+
+function createWritableStdioStream (fd) {
+  var stream;
+  var tty_wrap = process.binding('tty_wrap');
+
+  // Note stream._type is used for test-module-load-list.js
+
+  switch (tty_wrap.guessHandleType(fd)) {
+    case 'TTY':
+      stream = new tty.WriteStream(fd);
+      stream._type = 'tty';
+
+      // Hack to have stream not keep the event loop alive.
+      // See https://github.com/joyent/node/issues/1726
+      if (stream._handle && stream._handle.unref) {
+        stream._handle.unref();
+      }
+      break;
+
+    case 'FILE':
+      var fs = require('fs');
+      stream = new fs.SyncWriteStream(fd, { autoClose: false });
+      stream._type = 'fs';
+      break;
+
+    case 'PIPE':
+    case 'TCP':
+      var net = require('net');
+      stream = new net.Socket({
+        fd: fd,
+        readable: false,
+        writable: true
+      });
+
+      // FIXME Should probably have an option in net.Socket to create a
+      // stream from an existing fd which is writable only. But for now
+      // we'll just add this hack and set the `readable` member to false.
+      // Test: ./node test/fixtures/echo.js < /etc/passwd
+      stream.readable = false;
+      stream.read = null;
+      stream._type = 'pipe';
+
+      // FIXME Hack to have stream not keep the event loop alive.
+      // See https://github.com/joyent/node/issues/1726
+      if (stream._handle && stream._handle.unref) {
+        stream._handle.unref();
+      }
+      break;
+
+    default:
+      // Probably an error on in uv_guess_handle()
+      throw new Error('Implement me. Unknown stream file type!');
+  }
+
+  // For supporting legacy API we put the FD here.
+  stream.fd = fd;
+
+  stream._isStdio = true;
+
+  return stream;
+}
+
+/**
+ * Init logic for `debug` instances.
+ *
+ * Create a new `inspectOpts` object in case `useColors` is set
+ * differently for a particular `debug` instance.
+ */
+
+function init (debug) {
+  debug.inspectOpts = {};
+
+  var keys = Object.keys(exports.inspectOpts);
+  for (var i = 0; i < keys.length; i++) {
+    debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
+  }
+}
+
+/**
+ * Enable namespaces listed in `process.env.DEBUG` initially.
+ */
+
+exports.enable(load());
diff --git a/wrt/node_modules/socket.io/package.json b/wrt/node_modules/socket.io/package.json
new file mode 100644 (file)
index 0000000..dedd495
--- /dev/null
@@ -0,0 +1,136 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "socket.io",
+        "scope": null,
+        "escapedName": "socket.io",
+        "name": "socket.io",
+        "rawSpec": "",
+        "spec": "latest",
+        "type": "tag"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt"
+    ]
+  ],
+  "_from": "socket.io@latest",
+  "_id": "socket.io@2.0.3",
+  "_inCache": true,
+  "_location": "/socket.io",
+  "_nodeVersion": "6.9.4",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/socket.io-2.0.3.tgz_1497269178944_0.7451606099493802"
+  },
+  "_npmUser": {
+    "name": "darrachequesne",
+    "email": "damien.arrachequesne@gmail.com"
+  },
+  "_npmVersion": "3.10.10",
+  "_phantomChildren": {
+    "ms": "2.0.0"
+  },
+  "_requested": {
+    "raw": "socket.io",
+    "scope": null,
+    "escapedName": "socket.io",
+    "name": "socket.io",
+    "rawSpec": "",
+    "spec": "latest",
+    "type": "tag"
+  },
+  "_requiredBy": [
+    "#USER"
+  ],
+  "_resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.0.3.tgz",
+  "_shasum": "4359f06a24933ae6bd087798af78c680eae345e3",
+  "_shrinkwrap": null,
+  "_spec": "socket.io",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt",
+  "bugs": {
+    "url": "https://github.com/socketio/socket.io/issues"
+  },
+  "contributors": [
+    {
+      "name": "Guillermo Rauch",
+      "email": "rauchg@gmail.com"
+    },
+    {
+      "name": "Arnout Kazemier",
+      "email": "info@3rd-eden.com"
+    },
+    {
+      "name": "Vladimir Dronnikov",
+      "email": "dronnikov@gmail.com"
+    },
+    {
+      "name": "Einar Otto Stangvik",
+      "email": "einaros@gmail.com"
+    }
+  ],
+  "dependencies": {
+    "debug": "~2.6.6",
+    "engine.io": "~3.1.0",
+    "object-assign": "~4.1.1",
+    "socket.io-adapter": "~1.1.0",
+    "socket.io-client": "~2.0.2",
+    "socket.io-parser": "~3.1.1"
+  },
+  "description": "node.js realtime framework server",
+  "devDependencies": {
+    "babel-preset-es2015": "^6.24.1",
+    "del": "^2.2.2",
+    "expect.js": "0.3.1",
+    "gulp": "^3.9.1",
+    "gulp-babel": "^6.1.2",
+    "gulp-istanbul": "^1.1.1",
+    "gulp-mocha": "^4.3.1",
+    "gulp-task-listing": "1.0.1",
+    "istanbul": "^0.4.5",
+    "mocha": "^3.3.0",
+    "superagent": "1.6.1",
+    "supertest": "1.1.0"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "4359f06a24933ae6bd087798af78c680eae345e3",
+    "tarball": "https://registry.npmjs.org/socket.io/-/socket.io-2.0.3.tgz"
+  },
+  "files": [
+    "lib/"
+  ],
+  "gitHead": "65ece01135e1a3a4b517ed5c599eb5a7a3401f1a",
+  "homepage": "https://github.com/socketio/socket.io#readme",
+  "keywords": [
+    "realtime",
+    "framework",
+    "websocket",
+    "tcp",
+    "events",
+    "socket",
+    "io"
+  ],
+  "license": "MIT",
+  "main": "./lib/index",
+  "maintainers": [
+    {
+      "name": "darrachequesne",
+      "email": "damien.arrachequesne@gmail.com"
+    },
+    {
+      "name": "rauchg",
+      "email": "rauchg@gmail.com"
+    }
+  ],
+  "name": "socket.io",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/socketio/socket.io.git"
+  },
+  "scripts": {
+    "test": "gulp test"
+  },
+  "version": "2.0.3"
+}
diff --git a/wrt/node_modules/sprintf-js/.editorconfig b/wrt/node_modules/sprintf-js/.editorconfig
new file mode 100644 (file)
index 0000000..3551114
--- /dev/null
@@ -0,0 +1,14 @@
+# EditorConfig defines and maintains consistent coding styles between different
+# editors and IDEs: http://EditorConfig.org/
+
+# Top-most EditorConfig file
+root = true
+
+# All files 
+[*]
+charset = utf-8
+end_of_line = lf
+insert_final_newline = true
+indent_style = space
+indent_size = 4
+trim_trailing_whitespace = true
diff --git a/wrt/node_modules/sprintf-js/.eslintignore b/wrt/node_modules/sprintf-js/.eslintignore
new file mode 100644 (file)
index 0000000..3dddf3f
--- /dev/null
@@ -0,0 +1,2 @@
+dist/*
+node_modules/*
diff --git a/wrt/node_modules/sprintf-js/.eslintrc.js b/wrt/node_modules/sprintf-js/.eslintrc.js
new file mode 100644 (file)
index 0000000..decb502
--- /dev/null
@@ -0,0 +1,17 @@
+module.exports = {
+    extends: 'eslint:recommended',
+    env: {
+        node: true,
+        es6: true
+    },
+    rules: {
+        indent: ['error', 4, {SwitchCase: 1}],
+        'quote-props': ['error', 'as-needed'],
+        'no-cond-assign': 0,
+        'no-console': 0,
+        'no-control-regex': 0,
+        'no-undef': 'error',
+        'no-unused-vars': 'error',
+        semi: ['error', 'never']
+    }
+}
diff --git a/wrt/node_modules/sprintf-js/.npmignore b/wrt/node_modules/sprintf-js/.npmignore
new file mode 100644 (file)
index 0000000..096746c
--- /dev/null
@@ -0,0 +1 @@
+/node_modules/
\ No newline at end of file
diff --git a/wrt/node_modules/sprintf-js/.travis.yml b/wrt/node_modules/sprintf-js/.travis.yml
new file mode 100644 (file)
index 0000000..2197832
--- /dev/null
@@ -0,0 +1,3 @@
+language: node_js
+node_js:
+  - "node"
diff --git a/wrt/node_modules/sprintf-js/CHANGELOG.md b/wrt/node_modules/sprintf-js/CHANGELOG.md
new file mode 100644 (file)
index 0000000..2bcfd45
--- /dev/null
@@ -0,0 +1,7 @@
+## 1.1.1 (2017-05-29)
+
+* This CHANGELOG
+* Various optimizations for modern browsers
+* Fix %g, %o, %x and %X specifiers
+* Use ESLint instead of JSHint
+* Add CONTRIBUTORS file
diff --git a/wrt/node_modules/sprintf-js/CONTRIBUTORS b/wrt/node_modules/sprintf-js/CONTRIBUTORS
new file mode 100644 (file)
index 0000000..6840ea6
--- /dev/null
@@ -0,0 +1,24 @@
+Alexander Rose <alexander.rose@weirdbyte.de>
+Alexandru Mărășteanu <hello@alexei.ro>
+Andras @andrasq
+Benoit Giannangeli https://github.com/giann
+Branden Visser <mrvisser@gmail.com>
+David Baird
+daurnimator <quae@daurnimator.com>
+Doug Beck https://github.com/beck
+Dzmitry Litskalau https://github.com/litmit
+Hans Pufal
+Henry https://github.com/alograg
+Johnny Shields <johnny.shields@gmail.com>
+Kamal Abdali
+Matt Simerson https://github.com/msimerson
+Maxime Robert https://github.com/marob
+MeriemKhelifi https://github.com/MeriemKhelifi
+Michael Schramm <michael.schramm@gmail.com>
+Nazar Mokrynskyi <nazar@mokrynskyi.com>
+Oliver Salzburg <oliver.salzburg@gmail.com>
+Pablo <ppollono@gmail.com>
+Rabehaja Stevens https://github.com/RABEHAJA-STEVENS
+Raphael Pigulla https://github.com/pigulla
+rebeccapeltz https://github.com/rebeccapeltz
+Stefan Tingström https://github.com/stingstrom
diff --git a/wrt/node_modules/sprintf-js/LICENSE b/wrt/node_modules/sprintf-js/LICENSE
new file mode 100644 (file)
index 0000000..83f832a
--- /dev/null
@@ -0,0 +1,24 @@
+Copyright (c) 2007-present, Alexandru Mărășteanu <hello@alexei.ro>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+* Redistributions of source code must retain the above copyright
+  notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+  notice, this list of conditions and the following disclaimer in the
+  documentation and/or other materials provided with the distribution.
+* Neither the name of this software nor the names of its contributors may be
+  used to endorse or promote products derived from this software without
+  specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/wrt/node_modules/sprintf-js/README.md b/wrt/node_modules/sprintf-js/README.md
new file mode 100644 (file)
index 0000000..43d4971
--- /dev/null
@@ -0,0 +1,109 @@
+# sprintf.js [![Build Status][travisci-image]][travisci-url] [![NPM Version][npm-image]][npm-url] [![Dependency Status][dependencies-image]][dependencies-url] [![devDependency Status][dev-dependencies-image]][dev-dependencies-url]
+
+[travisci-image]: https://travis-ci.org/alexei/sprintf.js.svg?branch=master
+[travisci-url]: https://travis-ci.org/alexei/sprintf.js
+
+[npm-image]: https://badge.fury.io/js/sprintf-js.svg
+[npm-url]: https://badge.fury.io/js/sprintf-js
+
+[dependencies-image]: https://david-dm.org/alexei/sprintf.js.svg
+[dependencies-url]: https://david-dm.org/alexei/sprintf.js
+
+[dev-dependencies-image]: https://david-dm.org/alexei/sprintf.js/dev-status.svg
+[dev-dependencies-url]: https://david-dm.org/alexei/sprintf.js#info=devDependencies
+
+**sprintf.js** is a complete open source JavaScript sprintf implementation for the *browser* and *node.js*.
+
+Its prototype is simple:
+
+    string sprintf(string format , [mixed arg1 [, mixed arg2 [ ,...]]])
+
+The placeholders in the format string are marked by `%` and are followed by one or more of these elements, in this order:
+
+* An optional number followed by a `$` sign that selects which argument index to use for the value. If not specified, arguments will be placed in the same order as the placeholders in the input string.
+* An optional `+` sign that forces to preceed the result with a plus or minus sign on numeric values. By default, only the `-` sign is used on negative numbers.
+* An optional padding specifier that says what character to use for padding (if specified). Possible values are `0` or any other character precedeed by a `'` (single quote). The default is to pad with *spaces*.
+* An optional `-` sign, that causes sprintf to left-align the result of this placeholder. The default is to right-align the result.
+* An optional number, that says how many characters the result should have. If the value to be returned is shorter than this number, the result will be padded. When used with the `j` (JSON) type specifier, the padding length specifies the tab size used for indentation.
+* An optional precision modifier, consisting of a `.` (dot) followed by a number, that says how many digits should be displayed for floating point numbers. When used with the `g` type specifier, it specifies the number of significant digits. When used on a string, it causes the result to be truncated.
+* A type specifier that can be any of:
+    * `%` — yields a literal `%` character
+    * `b` — yields an integer as a binary number
+    * `c` — yields an integer as the character with that ASCII value
+    * `d` or `i` — yields an integer as a signed decimal number
+    * `e` — yields a float using scientific notation
+    * `u` — yields an integer as an unsigned decimal number
+    * `f` — yields a float as is; see notes on precision above
+    * `g` — yields a float as is; see notes on precision above
+    * `o` — yields an integer as an octal number
+    * `s` — yields a string as is
+    * `t` — yields `true` or `false`
+    * `T` — yields the type of the argument<sup><a href="#fn-1" name="fn-ref-1">1</a></sup>
+    * `v` — yields the primitive value of the specified argument
+    * `x` — yields an integer as a hexadecimal number (lower-case)
+    * `X` — yields an integer as a hexadecimal number (upper-case)
+    * `j` — yields a JavaScript object or array as a JSON encoded string
+
+
+## JavaScript `vsprintf`
+`vsprintf` is the same as `sprintf` except that it accepts an array of arguments, rather than a variable number of arguments:
+
+    vsprintf("The first 4 letters of the english alphabet are: %s, %s, %s and %s", ["a", "b", "c", "d"])
+
+## Argument swapping
+You can also swap the arguments. That is, the order of the placeholders doesn't have to match the order of the arguments. You can do that by simply indicating in the format string which arguments the placeholders refer to:
+
+    sprintf("%2$s %3$s a %1$s", "cracker", "Polly", "wants")
+And, of course, you can repeat the placeholders without having to increase the number of arguments.
+
+## Named arguments
+Format strings may contain replacement fields rather than positional placeholders. Instead of referring to a certain argument, you can now refer to a certain key within an object. Replacement fields are surrounded by rounded parentheses - `(` and `)` - and begin with a keyword that refers to a key:
+
+    var user = {
+        name: "Dolly"
+    }
+    sprintf("Hello %(name)s", user) // Hello Dolly
+Keywords in replacement fields can be optionally followed by any number of keywords or indexes:
+
+    var users = [
+        {name: "Dolly"},
+        {name: "Molly"},
+        {name: "Polly"}
+    ]
+    sprintf("Hello %(users[0].name)s, %(users[1].name)s and %(users[2].name)s", {users: users}) // Hello Dolly, Molly and Polly
+Note: mixing positional and named placeholders is not (yet) supported
+
+## Computed values
+You can pass in a function as a dynamic value and it will be invoked (with no arguments) in order to compute the value on-the-fly.
+
+    sprintf("Current timestamp: %d", Date.now) // Current timestamp: 1398005382890
+    sprintf("Current date and time: %s", function() { return new Date().toString() })
+
+# AngularJS
+You can now use `sprintf` and `vsprintf` (also aliased as `fmt` and `vfmt` respectively) in your AngularJS projects. See `demo/`.
+
+# Installation
+
+## Via Bower
+
+    bower install sprintf
+
+## Or as a node.js module
+
+    npm install sprintf-js
+
+### Usage
+
+    var sprintf = require("sprintf-js").sprintf,
+        vsprintf = require("sprintf-js").vsprintf
+
+    sprintf("%2$s %3$s a %1$s", "cracker", "Polly", "wants")
+    vsprintf("The first 4 letters of the english alphabet are: %s, %s, %s and %s", ["a", "b", "c", "d"])
+
+# License
+
+**sprintf.js** is licensed under the terms of the 3-clause BSD license.
+
+# Notes
+
+<small><sup><a href="#fn-ref-1" name="fn-1">1</a></sup> `sprintf` doesn't use the `typeof` operator. As such, the value `null` is a `null`, an array is an `array` (not an `object`), a date value is a `date` etc.</small>
diff --git a/wrt/node_modules/sprintf-js/benchmark/benchmark.js b/wrt/node_modules/sprintf-js/benchmark/benchmark.js
new file mode 100644 (file)
index 0000000..b99e42e
--- /dev/null
@@ -0,0 +1,23 @@
+var Benchmark   = require('benchmark'),
+    suite       = new Benchmark.Suite,
+    sprintfjs   = require('../src/sprintf.js'),
+    sprintf     = sprintfjs.sprintf
+
+suite
+    .add('%8d', function() {
+        sprintf('%8d', 12345)
+    })
+    .add('%08d', function() {
+        sprintf('%08d', 12345)
+    })
+    .add('%2d', function() {
+        sprintf('%2d', 12345)
+    })
+    .add('%8s', function() {
+        sprintf('%8s', 'abcde')
+    })
+    .add('%+010d', function() {
+        sprintf('%+010d', 12345)
+    })
+
+module.exports = suite
diff --git a/wrt/node_modules/sprintf-js/bower.json b/wrt/node_modules/sprintf-js/bower.json
new file mode 100644 (file)
index 0000000..8410350
--- /dev/null
@@ -0,0 +1,18 @@
+{
+  "name": "sprintf",
+  "description": "JavaScript sprintf implementation",
+  "version": "1.1.1",
+  "main": [
+    "dist/sprintf.min.js",
+    "dist/angular-sprintf.min.js"
+  ],
+  "license": "BSD-3-Clause-Clear",
+  "keywords": ["sprintf", "string", "formatting"],
+  "authors": ["Alexandru Marasteanu <hello@alexei.ro> (http://alexei.ro/)"],
+  "homepage": "https://github.com/alexei/sprintf.js",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/alexei/sprintf.js.git"
+  },
+  "ignore": []
+}
diff --git a/wrt/node_modules/sprintf-js/demo/angular.html b/wrt/node_modules/sprintf-js/demo/angular.html
new file mode 100644 (file)
index 0000000..17f30de
--- /dev/null
@@ -0,0 +1,20 @@
+<!doctype html>
+<html ng-app="app">
+<head>
+    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.3/angular.min.js"></script>
+    <script src="../src/sprintf.js"></script>
+    <script src="../src/angular-sprintf.js"></script>
+</head>
+<body>
+    <pre>{{ "%+010d"|sprintf:-123 }}</pre>
+    <pre>{{ "%+010d"|vsprintf:[-123] }}</pre>
+    <pre>{{ "%+010d"|fmt:-123 }}</pre>
+    <pre>{{ "%+010d"|vfmt:[-123] }}</pre>
+    <pre>{{ "I've got %2$d apples and %1$d oranges."|fmt:4:2 }}</pre>
+    <pre>{{ "I've got %(apples)d apples and %(oranges)d oranges."|fmt:{apples: 2, oranges: 4} }}</pre>
+
+    <script>
+        angular.module('app', ['sprintf'])
+    </script>
+</body>
+</html>
diff --git a/wrt/node_modules/sprintf-js/dist/.gitattributes b/wrt/node_modules/sprintf-js/dist/.gitattributes
new file mode 100644 (file)
index 0000000..d35bca0
--- /dev/null
@@ -0,0 +1,4 @@
+#ignore all generated files from diff\r
+#also skip line ending check\r
+*.js -diff -text\r
+*.map -diff -text\r
diff --git a/wrt/node_modules/sprintf-js/dist/angular-sprintf.min.js b/wrt/node_modules/sprintf-js/dist/angular-sprintf.min.js
new file mode 100644 (file)
index 0000000..320834c
--- /dev/null
@@ -0,0 +1,3 @@
+/*! sprintf-js v1.1.1 | Copyright (c) 2007-present, Alexandru Mărășteanu <hello@alexei.ro> | BSD-3-Clause */
+!function(){"use strict";angular.module("sprintf",[]).filter("sprintf",function(){return function(){return sprintf.apply(null,arguments)}}).filter("fmt",["$filter",function(t){return t("sprintf")}]).filter("vsprintf",function(){return function(t,n){return vsprintf(t,n)}}).filter("vfmt",["$filter",function(t){return t("vsprintf")}])}();
+//# sourceMappingURL=angular-sprintf.min.js.map
diff --git a/wrt/node_modules/sprintf-js/dist/angular-sprintf.min.js.map b/wrt/node_modules/sprintf-js/dist/angular-sprintf.min.js.map
new file mode 100644 (file)
index 0000000..e3ff8c7
--- /dev/null
@@ -0,0 +1 @@
+{"version":3,"sources":["angular-sprintf.js"],"names":["angular","module","filter","sprintf","apply","arguments","$filter","format","argv","vsprintf"],"mappings":";CAEC,WACG,aAEAA,QACIC,OAAO,cACPC,OAAO,UAAW,WACd,OAAO,WACH,OAAOC,QAAQC,MAAM,KAAMC,cAGnCH,OAAO,OAAQ,UAAW,SAASI,GAC/B,OAAOA,EAAQ,cAEnBJ,OAAO,WAAY,WACf,OAAO,SAASK,EAAQC,GACpB,OAAOC,SAASF,EAAQC,MAGhCN,OAAO,QAAS,UAAW,SAASI,GAChC,OAAOA,EAAQ","file":"angular-sprintf.min.js","sourcesContent":["/* global angular, sprintf, vsprintf */\n\n!function () {\n    'use strict'\n\n    angular.\n        module('sprintf', []).\n        filter('sprintf', function() {\n            return function() {\n                return sprintf.apply(null, arguments)\n            }\n        }).\n        filter('fmt', ['$filter', function($filter) {\n            return $filter('sprintf')\n        }]).\n        filter('vsprintf', function() {\n            return function(format, argv) {\n                return vsprintf(format, argv)\n            }\n        }).\n        filter('vfmt', ['$filter', function($filter) {\n            return $filter('vsprintf')\n        }])\n}()\n"]}
\ No newline at end of file
diff --git a/wrt/node_modules/sprintf-js/dist/sprintf.min.js b/wrt/node_modules/sprintf-js/dist/sprintf.min.js
new file mode 100644 (file)
index 0000000..0f396a1
--- /dev/null
@@ -0,0 +1,3 @@
+/*! sprintf-js v1.1.1 | Copyright (c) 2007-present, Alexandru Mărășteanu <hello@alexei.ro> | BSD-3-Clause */
+!function(){"use strict";function e(e){return r(n(e),arguments)}function t(t,r){return e.apply(null,[t].concat(r||[]))}function r(t,r){var n,i,a,o,p,c,u,f,l,d=1,g=t.length,b="";for(i=0;i<g;i++)if("string"==typeof t[i])b+=t[i];else if(Array.isArray(t[i])){if((o=t[i])[2])for(n=r[d],a=0;a<o[2].length;a++){if(!n.hasOwnProperty(o[2][a]))throw new Error(e('[sprintf] property "%s" does not exist',o[2][a]));n=n[o[2][a]]}else n=o[1]?r[o[1]]:r[d++];if(s.not_type.test(o[8])&&s.not_primitive.test(o[8])&&n instanceof Function&&(n=n()),s.numeric_arg.test(o[8])&&"number"!=typeof n&&isNaN(n))throw new TypeError(e("[sprintf] expecting number but found %T",n));switch(s.number.test(o[8])&&(f=n>=0),o[8]){case"b":n=parseInt(n,10).toString(2);break;case"c":n=String.fromCharCode(parseInt(n,10));break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,o[6]?parseInt(o[6]):0);break;case"e":n=o[7]?parseFloat(n).toExponential(o[7]):parseFloat(n).toExponential();break;case"f":n=o[7]?parseFloat(n).toFixed(o[7]):parseFloat(n);break;case"g":n=o[7]?String(Number(n.toPrecision(o[7]))):parseFloat(n);break;case"o":n=(parseInt(n,10)>>>0).toString(8);break;case"s":n=String(n),n=o[7]?n.substring(0,o[7]):n;break;case"t":n=String(!!n),n=o[7]?n.substring(0,o[7]):n;break;case"T":n=Object.prototype.toString.call(n).slice(8,-1).toLowerCase(),n=o[7]?n.substring(0,o[7]):n;break;case"u":n=parseInt(n,10)>>>0;break;case"v":n=n.valueOf(),n=o[7]?n.substring(0,o[7]):n;break;case"x":n=(parseInt(n,10)>>>0).toString(16);break;case"X":n=(parseInt(n,10)>>>0).toString(16).toUpperCase()}s.json.test(o[8])?b+=n:(!s.number.test(o[8])||f&&!o[3]?l="":(l=f?"+":"-",n=n.toString().replace(s.sign,"")),c=o[4]?"0"===o[4]?"0":o[4].charAt(1):" ",u=o[6]-(l+n).length,p=o[6]&&u>0?c.repeat(u):"",b+=o[5]?l+n+p:"0"===c?l+p+n:p+l+n)}return b}function n(e){if(i[e])return i[e];for(var t,r=e,n=[],a=0;r;){if(null!==(t=s.text.exec(r)))n.push(t[0]);else if(null!==(t=s.modulo.exec(r)))n.push("%");else{if(null===(t=s.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){a|=1;var o=[],p=t[2],c=[];if(null===(c=s.key.exec(p)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o.push(c[1]);""!==(p=p.substring(c[0].length));)if(null!==(c=s.key_access.exec(p)))o.push(c[1]);else{if(null===(c=s.index_access.exec(p)))throw new SyntaxError("[sprintf] failed to parse named argument key");o.push(c[1])}t[2]=o}else a|=2;if(3===a)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push(t)}r=r.substring(t[0].length)}return i[e]=n}var s={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/},i=Object.create(null);"undefined"!=typeof exports&&(exports.sprintf=e,exports.vsprintf=t),"undefined"!=typeof window&&(window.sprintf=e,window.vsprintf=t,"function"==typeof define&&define.amd&&define(function(){return{sprintf:e,vsprintf:t}}))}();
+//# sourceMappingURL=sprintf.min.js.map
diff --git a/wrt/node_modules/sprintf-js/dist/sprintf.min.js.map b/wrt/node_modules/sprintf-js/dist/sprintf.min.js.map
new file mode 100644 (file)
index 0000000..7cd7357
--- /dev/null
@@ -0,0 +1 @@
+{"version":3,"sources":["sprintf.js"],"names":["sprintf","key","sprintf_format","sprintf_parse","arguments","vsprintf","fmt","argv","apply","concat","parse_tree","arg","i","k","match","pad","pad_character","pad_length","is_positive","sign","cursor","tree_length","length","output","Array","isArray","hasOwnProperty","Error","re","not_type","test","not_primitive","Function","numeric_arg","isNaN","TypeError","number","parseInt","toString","String","fromCharCode","JSON","stringify","parseFloat","toExponential","toFixed","Number","toPrecision","substring","Object","prototype","call","slice","toLowerCase","valueOf","toUpperCase","json","replace","charAt","repeat","sprintf_cache","_fmt","arg_names","text","exec","push","modulo","placeholder","SyntaxError","field_list","replacement_field","field_match","key_access","index_access","not_string","not_bool","not_json","create","exports","window","define"],"mappings":";CAEC,WACG,aAoBA,SAASA,EAAQC,GAEb,OAAOC,EAAeC,EAAcF,GAAMG,WAG9C,SAASC,EAASC,EAAKC,GACnB,OAAOP,EAAQQ,MAAM,MAAOF,GAAKG,OAAOF,QAG5C,SAASL,EAAeQ,EAAYH,GAChC,IAAiDI,EAAkBC,EAAGC,EAAGC,EAAOC,EAAKC,EAAeC,EAAYC,EAAaC,EAAzHC,EAAS,EAAGC,EAAcX,EAAWY,OAAaC,EAAS,GAC/D,IAAKX,EAAI,EAAGA,EAAIS,EAAaT,IACzB,GAA6B,iBAAlBF,EAAWE,GAClBW,GAAUb,EAAWE,QAEpB,GAAIY,MAAMC,QAAQf,EAAWE,IAAK,CAEnC,IADAE,EAAQJ,EAAWE,IACT,GAEN,IADAD,EAAMJ,EAAKa,GACNP,EAAI,EAAGA,EAAIC,EAAM,GAAGQ,OAAQT,IAAK,CAClC,IAAKF,EAAIe,eAAeZ,EAAM,GAAGD,IAC7B,MAAM,IAAIc,MAAM3B,EAAQ,yCAA0Cc,EAAM,GAAGD,KAE/EF,EAAMA,EAAIG,EAAM,GAAGD,SAIvBF,EADKG,EAAM,GACLP,EAAKO,EAAM,IAGXP,EAAKa,KAOf,GAJIQ,EAAGC,SAASC,KAAKhB,EAAM,KAAOc,EAAGG,cAAcD,KAAKhB,EAAM,KAAOH,aAAeqB,WAChFrB,EAAMA,KAGNiB,EAAGK,YAAYH,KAAKhB,EAAM,KAAuB,iBAARH,GAAoBuB,MAAMvB,GACnE,MAAM,IAAIwB,UAAUnC,EAAQ,0CAA2CW,IAO3E,OAJIiB,EAAGQ,OAAON,KAAKhB,EAAM,MACrBI,EAAcP,GAAO,GAGjBG,EAAM,IACV,IAAK,IACDH,EAAM0B,SAAS1B,EAAK,IAAI2B,SAAS,GACjC,MACJ,IAAK,IACD3B,EAAM4B,OAAOC,aAAaH,SAAS1B,EAAK,KACxC,MACJ,IAAK,IACL,IAAK,IACDA,EAAM0B,SAAS1B,EAAK,IACpB,MACJ,IAAK,IACDA,EAAM8B,KAAKC,UAAU/B,EAAK,KAAMG,EAAM,GAAKuB,SAASvB,EAAM,IAAM,GAChE,MACJ,IAAK,IACDH,EAAMG,EAAM,GAAK6B,WAAWhC,GAAKiC,cAAc9B,EAAM,IAAM6B,WAAWhC,GAAKiC,gBAC3E,MACJ,IAAK,IACDjC,EAAMG,EAAM,GAAK6B,WAAWhC,GAAKkC,QAAQ/B,EAAM,IAAM6B,WAAWhC,GAChE,MACJ,IAAK,IACDA,EAAMG,EAAM,GAAKyB,OAAOO,OAAOnC,EAAIoC,YAAYjC,EAAM,MAAQ6B,WAAWhC,GACxE,MACJ,IAAK,IACDA,GAAO0B,SAAS1B,EAAK,MAAQ,GAAG2B,SAAS,GACzC,MACJ,IAAK,IACD3B,EAAM4B,OAAO5B,GACbA,EAAOG,EAAM,GAAKH,EAAIqC,UAAU,EAAGlC,EAAM,IAAMH,EAC/C,MACJ,IAAK,IACDA,EAAM4B,SAAS5B,GACfA,EAAOG,EAAM,GAAKH,EAAIqC,UAAU,EAAGlC,EAAM,IAAMH,EAC/C,MACJ,IAAK,IACDA,EAAMsC,OAAOC,UAAUZ,SAASa,KAAKxC,GAAKyC,MAAM,GAAI,GAAGC,cACvD1C,EAAOG,EAAM,GAAKH,EAAIqC,UAAU,EAAGlC,EAAM,IAAMH,EAC/C,MACJ,IAAK,IACDA,EAAM0B,SAAS1B,EAAK,MAAQ,EAC5B,MACJ,IAAK,IACDA,EAAMA,EAAI2C,UACV3C,EAAOG,EAAM,GAAKH,EAAIqC,UAAU,EAAGlC,EAAM,IAAMH,EAC/C,MACJ,IAAK,IACDA,GAAO0B,SAAS1B,EAAK,MAAQ,GAAG2B,SAAS,IACzC,MACJ,IAAK,IACD3B,GAAO0B,SAAS1B,EAAK,MAAQ,GAAG2B,SAAS,IAAIiB,cAGjD3B,EAAG4B,KAAK1B,KAAKhB,EAAM,IACnBS,GAAUZ,IAGNiB,EAAGQ,OAAON,KAAKhB,EAAM,KAASI,IAAeJ,EAAM,GAKnDK,EAAO,IAJPA,EAAOD,EAAc,IAAM,IAC3BP,EAAMA,EAAI2B,WAAWmB,QAAQ7B,EAAGT,KAAM,KAK1CH,EAAgBF,EAAM,GAAkB,MAAbA,EAAM,GAAa,IAAMA,EAAM,GAAG4C,OAAO,GAAK,IACzEzC,EAAaH,EAAM,IAAMK,EAAOR,GAAKW,OACrCP,EAAMD,EAAM,IAAMG,EAAa,EAAID,EAAc2C,OAAO1C,GAAoB,GAC5EM,GAAUT,EAAM,GAAKK,EAAOR,EAAMI,EAAyB,MAAlBC,EAAwBG,EAAOJ,EAAMJ,EAAMI,EAAMI,EAAOR,GAI7G,OAAOY,EAKX,SAASpB,EAAcG,GACnB,GAAIsD,EAActD,GACd,OAAOsD,EAActD,GAIzB,IADA,IAAgBQ,EAAZ+C,EAAOvD,EAAYI,KAAiBoD,EAAY,EAC7CD,GAAM,CACT,GAAqC,QAAhC/C,EAAQc,EAAGmC,KAAKC,KAAKH,IACtBnD,EAAWuD,KAAKnD,EAAM,SAErB,GAAuC,QAAlCA,EAAQc,EAAGsC,OAAOF,KAAKH,IAC7BnD,EAAWuD,KAAK,SAEf,CAAA,GAA4C,QAAvCnD,EAAQc,EAAGuC,YAAYH,KAAKH,IAgClC,MAAM,IAAIO,YAAY,oCA/BtB,GAAItD,EAAM,GAAI,CACVgD,GAAa,EACb,IAAIO,KAAiBC,EAAoBxD,EAAM,GAAIyD,KACnD,GAAuD,QAAlDA,EAAc3C,EAAG3B,IAAI+D,KAAKM,IAe3B,MAAM,IAAIF,YAAY,gDAbtB,IADAC,EAAWJ,KAAKM,EAAY,IACwD,MAA5ED,EAAoBA,EAAkBtB,UAAUuB,EAAY,GAAGjD,UACnE,GAA8D,QAAzDiD,EAAc3C,EAAG4C,WAAWR,KAAKM,IAClCD,EAAWJ,KAAKM,EAAY,QAE3B,CAAA,GAAgE,QAA3DA,EAAc3C,EAAG6C,aAAaT,KAAKM,IAIzC,MAAM,IAAIF,YAAY,gDAHtBC,EAAWJ,KAAKM,EAAY,IAUxCzD,EAAM,GAAKuD,OAGXP,GAAa,EAEjB,GAAkB,IAAdA,EACA,MAAM,IAAInC,MAAM,6EAEpBjB,EAAWuD,KAAKnD,GAKpB+C,EAAOA,EAAKb,UAAUlC,EAAM,GAAGQ,QAEnC,OAAOsC,EAActD,GAAOI,EA3LhC,IAAIkB,GACA8C,WAAY,OACZC,SAAU,OACV9C,SAAU,OACVE,cAAe,OACfK,OAAQ,UACRH,YAAa,eACbuB,KAAM,MACNoB,SAAU,OACVb,KAAM,YACNG,OAAQ,WACRC,YAAa,4FACblE,IAAK,sBACLuE,WAAY,wBACZC,aAAc,aACdtD,KAAM,WAyHNyC,EAAgBX,OAAO4B,OAAO,MA0DX,oBAAZC,UACPA,QAAiB,QAAI9E,EACrB8E,QAAkB,SAAIzE,GAEJ,oBAAX0E,SACPA,OAAgB,QAAI/E,EACpB+E,OAAiB,SAAI1E,EAEC,mBAAX2E,QAAyBA,OAAY,KAC5CA,OAAO,WACH,OACIhF,QAAWA,EACXK,SAAYA","file":"sprintf.min.js","sourcesContent":["/* global window, exports, define */\n\n!function() {\n    'use strict'\n\n    var re = {\n        not_string: /[^s]/,\n        not_bool: /[^t]/,\n        not_type: /[^T]/,\n        not_primitive: /[^v]/,\n        number: /[diefg]/,\n        numeric_arg: /[bcdiefguxX]/,\n        json: /[j]/,\n        not_json: /[^j]/,\n        text: /^[^\\x25]+/,\n        modulo: /^\\x25{2}/,\n        placeholder: /^\\x25(?:([1-9]\\d*)\\$|\\(([^\\)]+)\\))?(\\+)?(0|'[^$])?(-)?(\\d+)?(?:\\.(\\d+))?([b-gijostTuvxX])/,\n        key: /^([a-z_][a-z_\\d]*)/i,\n        key_access: /^\\.([a-z_][a-z_\\d]*)/i,\n        index_access: /^\\[(\\d+)\\]/,\n        sign: /^[\\+\\-]/\n    }\n\n    function sprintf(key) {\n        // `arguments` is not an array, but should be fine for this call\n        return sprintf_format(sprintf_parse(key), arguments)\n    }\n\n    function vsprintf(fmt, argv) {\n        return sprintf.apply(null, [fmt].concat(argv || []))\n    }\n\n    function sprintf_format(parse_tree, argv) {\n        var cursor = 1, tree_length = parse_tree.length, arg, output = '', i, k, match, pad, pad_character, pad_length, is_positive, sign\n        for (i = 0; i < tree_length; i++) {\n            if (typeof parse_tree[i] === 'string') {\n                output += parse_tree[i]\n            }\n            else if (Array.isArray(parse_tree[i])) {\n                match = parse_tree[i] // convenience purposes only\n                if (match[2]) { // keyword argument\n                    arg = argv[cursor]\n                    for (k = 0; k < match[2].length; k++) {\n                        if (!arg.hasOwnProperty(match[2][k])) {\n                            throw new Error(sprintf('[sprintf] property \"%s\" does not exist', match[2][k]))\n                        }\n                        arg = arg[match[2][k]]\n                    }\n                }\n                else if (match[1]) { // positional argument (explicit)\n                    arg = argv[match[1]]\n                }\n                else { // positional argument (implicit)\n                    arg = argv[cursor++]\n                }\n\n                if (re.not_type.test(match[8]) && re.not_primitive.test(match[8]) && arg instanceof Function) {\n                    arg = arg()\n                }\n\n                if (re.numeric_arg.test(match[8]) && (typeof arg !== 'number' && isNaN(arg))) {\n                    throw new TypeError(sprintf('[sprintf] expecting number but found %T', arg))\n                }\n\n                if (re.number.test(match[8])) {\n                    is_positive = arg >= 0\n                }\n\n                switch (match[8]) {\n                    case 'b':\n                        arg = parseInt(arg, 10).toString(2)\n                        break\n                    case 'c':\n                        arg = String.fromCharCode(parseInt(arg, 10))\n                        break\n                    case 'd':\n                    case 'i':\n                        arg = parseInt(arg, 10)\n                        break\n                    case 'j':\n                        arg = JSON.stringify(arg, null, match[6] ? parseInt(match[6]) : 0)\n                        break\n                    case 'e':\n                        arg = match[7] ? parseFloat(arg).toExponential(match[7]) : parseFloat(arg).toExponential()\n                        break\n                    case 'f':\n                        arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg)\n                        break\n                    case 'g':\n                        arg = match[7] ? String(Number(arg.toPrecision(match[7]))) : parseFloat(arg)\n                        break\n                    case 'o':\n                        arg = (parseInt(arg, 10) >>> 0).toString(8)\n                        break\n                    case 's':\n                        arg = String(arg)\n                        arg = (match[7] ? arg.substring(0, match[7]) : arg)\n                        break\n                    case 't':\n                        arg = String(!!arg)\n                        arg = (match[7] ? arg.substring(0, match[7]) : arg)\n                        break\n                    case 'T':\n                        arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase()\n                        arg = (match[7] ? arg.substring(0, match[7]) : arg)\n                        break\n                    case 'u':\n                        arg = parseInt(arg, 10) >>> 0\n                        break\n                    case 'v':\n                        arg = arg.valueOf()\n                        arg = (match[7] ? arg.substring(0, match[7]) : arg)\n                        break\n                    case 'x':\n                        arg = (parseInt(arg, 10) >>> 0).toString(16)\n                        break\n                    case 'X':\n                        arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase()\n                        break\n                }\n                if (re.json.test(match[8])) {\n                    output += arg\n                }\n                else {\n                    if (re.number.test(match[8]) && (!is_positive || match[3])) {\n                        sign = is_positive ? '+' : '-'\n                        arg = arg.toString().replace(re.sign, '')\n                    }\n                    else {\n                        sign = ''\n                    }\n                    pad_character = match[4] ? match[4] === '0' ? '0' : match[4].charAt(1) : ' '\n                    pad_length = match[6] - (sign + arg).length\n                    pad = match[6] ? (pad_length > 0 ? pad_character.repeat(pad_length) : '') : ''\n                    output += match[5] ? sign + arg + pad : (pad_character === '0' ? sign + pad + arg : pad + sign + arg)\n                }\n            }\n        }\n        return output\n    }\n\n    var sprintf_cache = Object.create(null)\n\n    function sprintf_parse(fmt) {\n        if (sprintf_cache[fmt]) {\n            return sprintf_cache[fmt]\n        }\n\n        var _fmt = fmt, match, parse_tree = [], arg_names = 0\n        while (_fmt) {\n            if ((match = re.text.exec(_fmt)) !== null) {\n                parse_tree.push(match[0])\n            }\n            else if ((match = re.modulo.exec(_fmt)) !== null) {\n                parse_tree.push('%')\n            }\n            else if ((match = re.placeholder.exec(_fmt)) !== null) {\n                if (match[2]) {\n                    arg_names |= 1\n                    var field_list = [], replacement_field = match[2], field_match = []\n                    if ((field_match = re.key.exec(replacement_field)) !== null) {\n                        field_list.push(field_match[1])\n                        while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {\n                            if ((field_match = re.key_access.exec(replacement_field)) !== null) {\n                                field_list.push(field_match[1])\n                            }\n                            else if ((field_match = re.index_access.exec(replacement_field)) !== null) {\n                                field_list.push(field_match[1])\n                            }\n                            else {\n                                throw new SyntaxError('[sprintf] failed to parse named argument key')\n                            }\n                        }\n                    }\n                    else {\n                        throw new SyntaxError('[sprintf] failed to parse named argument key')\n                    }\n                    match[2] = field_list\n                }\n                else {\n                    arg_names |= 2\n                }\n                if (arg_names === 3) {\n                    throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported')\n                }\n                parse_tree.push(match)\n            }\n            else {\n                throw new SyntaxError('[sprintf] unexpected placeholder')\n            }\n            _fmt = _fmt.substring(match[0].length)\n        }\n        return sprintf_cache[fmt] = parse_tree\n    }\n\n    /**\n     * export to either browser or node.js\n     */\n    /* eslint-disable quote-props */\n    if (typeof exports !== 'undefined') {\n        exports['sprintf'] = sprintf\n        exports['vsprintf'] = vsprintf\n    }\n    if (typeof window !== 'undefined') {\n        window['sprintf'] = sprintf\n        window['vsprintf'] = vsprintf\n\n        if (typeof define === 'function' && define['amd']) {\n            define(function() {\n                return {\n                    'sprintf': sprintf,\n                    'vsprintf': vsprintf\n                }\n            })\n        }\n    }\n    /* eslint-enable quote-props */\n}()\n"]}
\ No newline at end of file
diff --git a/wrt/node_modules/sprintf-js/gulpfile.js b/wrt/node_modules/sprintf-js/gulpfile.js
new file mode 100644 (file)
index 0000000..28542b7
--- /dev/null
@@ -0,0 +1,45 @@
+'use strict'
+
+var pkg         = require('./package.json'),
+    gulp        = require('gulp'),
+    uglify      = require('gulp-uglify'),
+    rename      = require('gulp-rename'),
+    sourcemaps  = require('gulp-sourcemaps'),
+    header      = require('gulp-header'),
+    eslint      = require('gulp-eslint'),
+    mocha       = require('gulp-mocha'),
+    benchmark   = require('gulp-benchmark'),
+    banner      = '/*! <%= pkg.name %> v<%= pkg.version %> | Copyright (c) 2007-present, <%= pkg.author %> | <%= pkg.license %> */\n'
+
+gulp.task('benchmark', function () {
+    return gulp
+        .src('benchmark/*.js', {read: false})
+        .pipe(benchmark())
+})
+
+gulp.task('lint', function() {
+    return gulp
+        .src('src/*.js')
+        .pipe(eslint())
+        .pipe(eslint.format())
+})
+
+gulp.task('test', ['lint'], function() {
+    return gulp
+        .src('test/*.js', {read: false})
+        .pipe(mocha({reporter: 'nyan'}))
+})
+
+gulp.task('dist', ['test'], function() {
+    return gulp.src([
+        'src/*.js'
+    ])
+        .pipe(sourcemaps.init())
+        .pipe(uglify())
+        .pipe(rename({ suffix: '.min' }))
+        .pipe(header(banner, {pkg: pkg}))
+        .pipe(sourcemaps.write('.'))
+        .pipe(gulp.dest('dist'))
+})
+
+gulp.task('default', ['dist'])
diff --git a/wrt/node_modules/sprintf-js/package.json b/wrt/node_modules/sprintf-js/package.json
new file mode 100644 (file)
index 0000000..5c556df
--- /dev/null
@@ -0,0 +1,99 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "sprintf-js@^1.0.3",
+        "scope": null,
+        "escapedName": "sprintf-js",
+        "name": "sprintf-js",
+        "rawSpec": "^1.0.3",
+        "spec": ">=1.0.3 <2.0.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/underscore.string"
+    ]
+  ],
+  "_from": "sprintf-js@>=1.0.3 <2.0.0",
+  "_id": "sprintf-js@1.1.1",
+  "_inCache": true,
+  "_location": "/sprintf-js",
+  "_nodeVersion": "7.8.0",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/sprintf-js-1.1.1.tgz_1496074852444_0.6851142619270831"
+  },
+  "_npmUser": {
+    "name": "alexei",
+    "email": "hello@alexei.ro"
+  },
+  "_npmVersion": "4.2.0",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "sprintf-js@^1.0.3",
+    "scope": null,
+    "escapedName": "sprintf-js",
+    "name": "sprintf-js",
+    "rawSpec": "^1.0.3",
+    "spec": ">=1.0.3 <2.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/underscore.string"
+  ],
+  "_resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.1.tgz",
+  "_shasum": "36be78320afe5801f6cea3ee78b6e5aab940ea0c",
+  "_shrinkwrap": null,
+  "_spec": "sprintf-js@^1.0.3",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/underscore.string",
+  "author": {
+    "name": "Alexandru Mărășteanu",
+    "email": "hello@alexei.ro"
+  },
+  "bugs": {
+    "url": "https://github.com/alexei/sprintf.js/issues"
+  },
+  "dependencies": {},
+  "description": "JavaScript sprintf implementation",
+  "devDependencies": {
+    "benchmark": "^2.1.4",
+    "eslint": "3.19.0",
+    "gulp": "^3.9.1",
+    "gulp-benchmark": "^1.1.1",
+    "gulp-eslint": "^3.0.1",
+    "gulp-header": "^1.8.8",
+    "gulp-mocha": "^4.3.1",
+    "gulp-rename": "^1.2.2",
+    "gulp-sourcemaps": "^2.6.0",
+    "gulp-uglify": "^3.0.0",
+    "mocha": "^3.4.2"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "36be78320afe5801f6cea3ee78b6e5aab940ea0c",
+    "tarball": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.1.tgz"
+  },
+  "gitHead": "6bfe81840e560d675a9de3d79c06354a47ac9236",
+  "homepage": "https://github.com/alexei/sprintf.js#readme",
+  "license": "BSD-3-Clause",
+  "main": "src/sprintf.js",
+  "maintainers": [
+    {
+      "name": "alexei",
+      "email": "hello@alexei.ro"
+    }
+  ],
+  "name": "sprintf-js",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/alexei/sprintf.js.git"
+  },
+  "scripts": {
+    "lint": "eslint .",
+    "lint:fix": "eslint --fix .",
+    "posttest": "npm run lint",
+    "test": "mocha test/test.js"
+  },
+  "version": "1.1.1"
+}
diff --git a/wrt/node_modules/sprintf-js/src/angular-sprintf.js b/wrt/node_modules/sprintf-js/src/angular-sprintf.js
new file mode 100644 (file)
index 0000000..4519b4e
--- /dev/null
@@ -0,0 +1,24 @@
+/* global angular, sprintf, vsprintf */
+
+!function () {
+    'use strict'
+
+    angular.
+        module('sprintf', []).
+        filter('sprintf', function() {
+            return function() {
+                return sprintf.apply(null, arguments)
+            }
+        }).
+        filter('fmt', ['$filter', function($filter) {
+            return $filter('sprintf')
+        }]).
+        filter('vsprintf', function() {
+            return function(format, argv) {
+                return vsprintf(format, argv)
+            }
+        }).
+        filter('vfmt', ['$filter', function($filter) {
+            return $filter('vsprintf')
+        }])
+}()
diff --git a/wrt/node_modules/sprintf-js/src/sprintf.js b/wrt/node_modules/sprintf-js/src/sprintf.js
new file mode 100644 (file)
index 0000000..edddc82
--- /dev/null
@@ -0,0 +1,218 @@
+/* global window, exports, define */
+
+!function() {
+    'use strict'
+
+    var re = {
+        not_string: /[^s]/,
+        not_bool: /[^t]/,
+        not_type: /[^T]/,
+        not_primitive: /[^v]/,
+        number: /[diefg]/,
+        numeric_arg: /[bcdiefguxX]/,
+        json: /[j]/,
+        not_json: /[^j]/,
+        text: /^[^\x25]+/,
+        modulo: /^\x25{2}/,
+        placeholder: /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,
+        key: /^([a-z_][a-z_\d]*)/i,
+        key_access: /^\.([a-z_][a-z_\d]*)/i,
+        index_access: /^\[(\d+)\]/,
+        sign: /^[\+\-]/
+    }
+
+    function sprintf(key) {
+        // `arguments` is not an array, but should be fine for this call
+        return sprintf_format(sprintf_parse(key), arguments)
+    }
+
+    function vsprintf(fmt, argv) {
+        return sprintf.apply(null, [fmt].concat(argv || []))
+    }
+
+    function sprintf_format(parse_tree, argv) {
+        var cursor = 1, tree_length = parse_tree.length, arg, output = '', i, k, match, pad, pad_character, pad_length, is_positive, sign
+        for (i = 0; i < tree_length; i++) {
+            if (typeof parse_tree[i] === 'string') {
+                output += parse_tree[i]
+            }
+            else if (Array.isArray(parse_tree[i])) {
+                match = parse_tree[i] // convenience purposes only
+                if (match[2]) { // keyword argument
+                    arg = argv[cursor]
+                    for (k = 0; k < match[2].length; k++) {
+                        if (!arg.hasOwnProperty(match[2][k])) {
+                            throw new Error(sprintf('[sprintf] property "%s" does not exist', match[2][k]))
+                        }
+                        arg = arg[match[2][k]]
+                    }
+                }
+                else if (match[1]) { // positional argument (explicit)
+                    arg = argv[match[1]]
+                }
+                else { // positional argument (implicit)
+                    arg = argv[cursor++]
+                }
+
+                if (re.not_type.test(match[8]) && re.not_primitive.test(match[8]) && arg instanceof Function) {
+                    arg = arg()
+                }
+
+                if (re.numeric_arg.test(match[8]) && (typeof arg !== 'number' && isNaN(arg))) {
+                    throw new TypeError(sprintf('[sprintf] expecting number but found %T', arg))
+                }
+
+                if (re.number.test(match[8])) {
+                    is_positive = arg >= 0
+                }
+
+                switch (match[8]) {
+                    case 'b':
+                        arg = parseInt(arg, 10).toString(2)
+                        break
+                    case 'c':
+                        arg = String.fromCharCode(parseInt(arg, 10))
+                        break
+                    case 'd':
+                    case 'i':
+                        arg = parseInt(arg, 10)
+                        break
+                    case 'j':
+                        arg = JSON.stringify(arg, null, match[6] ? parseInt(match[6]) : 0)
+                        break
+                    case 'e':
+                        arg = match[7] ? parseFloat(arg).toExponential(match[7]) : parseFloat(arg).toExponential()
+                        break
+                    case 'f':
+                        arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg)
+                        break
+                    case 'g':
+                        arg = match[7] ? String(Number(arg.toPrecision(match[7]))) : parseFloat(arg)
+                        break
+                    case 'o':
+                        arg = (parseInt(arg, 10) >>> 0).toString(8)
+                        break
+                    case 's':
+                        arg = String(arg)
+                        arg = (match[7] ? arg.substring(0, match[7]) : arg)
+                        break
+                    case 't':
+                        arg = String(!!arg)
+                        arg = (match[7] ? arg.substring(0, match[7]) : arg)
+                        break
+                    case 'T':
+                        arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase()
+                        arg = (match[7] ? arg.substring(0, match[7]) : arg)
+                        break
+                    case 'u':
+                        arg = parseInt(arg, 10) >>> 0
+                        break
+                    case 'v':
+                        arg = arg.valueOf()
+                        arg = (match[7] ? arg.substring(0, match[7]) : arg)
+                        break
+                    case 'x':
+                        arg = (parseInt(arg, 10) >>> 0).toString(16)
+                        break
+                    case 'X':
+                        arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase()
+                        break
+                }
+                if (re.json.test(match[8])) {
+                    output += arg
+                }
+                else {
+                    if (re.number.test(match[8]) && (!is_positive || match[3])) {
+                        sign = is_positive ? '+' : '-'
+                        arg = arg.toString().replace(re.sign, '')
+                    }
+                    else {
+                        sign = ''
+                    }
+                    pad_character = match[4] ? match[4] === '0' ? '0' : match[4].charAt(1) : ' '
+                    pad_length = match[6] - (sign + arg).length
+                    pad = match[6] ? (pad_length > 0 ? pad_character.repeat(pad_length) : '') : ''
+                    output += match[5] ? sign + arg + pad : (pad_character === '0' ? sign + pad + arg : pad + sign + arg)
+                }
+            }
+        }
+        return output
+    }
+
+    var sprintf_cache = Object.create(null)
+
+    function sprintf_parse(fmt) {
+        if (sprintf_cache[fmt]) {
+            return sprintf_cache[fmt]
+        }
+
+        var _fmt = fmt, match, parse_tree = [], arg_names = 0
+        while (_fmt) {
+            if ((match = re.text.exec(_fmt)) !== null) {
+                parse_tree.push(match[0])
+            }
+            else if ((match = re.modulo.exec(_fmt)) !== null) {
+                parse_tree.push('%')
+            }
+            else if ((match = re.placeholder.exec(_fmt)) !== null) {
+                if (match[2]) {
+                    arg_names |= 1
+                    var field_list = [], replacement_field = match[2], field_match = []
+                    if ((field_match = re.key.exec(replacement_field)) !== null) {
+                        field_list.push(field_match[1])
+                        while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {
+                            if ((field_match = re.key_access.exec(replacement_field)) !== null) {
+                                field_list.push(field_match[1])
+                            }
+                            else if ((field_match = re.index_access.exec(replacement_field)) !== null) {
+                                field_list.push(field_match[1])
+                            }
+                            else {
+                                throw new SyntaxError('[sprintf] failed to parse named argument key')
+                            }
+                        }
+                    }
+                    else {
+                        throw new SyntaxError('[sprintf] failed to parse named argument key')
+                    }
+                    match[2] = field_list
+                }
+                else {
+                    arg_names |= 2
+                }
+                if (arg_names === 3) {
+                    throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported')
+                }
+                parse_tree.push(match)
+            }
+            else {
+                throw new SyntaxError('[sprintf] unexpected placeholder')
+            }
+            _fmt = _fmt.substring(match[0].length)
+        }
+        return sprintf_cache[fmt] = parse_tree
+    }
+
+    /**
+     * export to either browser or node.js
+     */
+    /* eslint-disable quote-props */
+    if (typeof exports !== 'undefined') {
+        exports['sprintf'] = sprintf
+        exports['vsprintf'] = vsprintf
+    }
+    if (typeof window !== 'undefined') {
+        window['sprintf'] = sprintf
+        window['vsprintf'] = vsprintf
+
+        if (typeof define === 'function' && define['amd']) {
+            define(function() {
+                return {
+                    'sprintf': sprintf,
+                    'vsprintf': vsprintf
+                }
+            })
+        }
+    }
+    /* eslint-enable quote-props */
+}()
diff --git a/wrt/node_modules/sprintf-js/test/test.js b/wrt/node_modules/sprintf-js/test/test.js
new file mode 100644 (file)
index 0000000..9588da6
--- /dev/null
@@ -0,0 +1,112 @@
+/* global describe, it */
+
+'use strict'
+
+var assert = require('assert'),
+    sprintfjs = require('../src/sprintf.js'),
+    sprintf = sprintfjs.sprintf
+
+describe('sprintfjs', function() {
+    var pi = 3.141592653589793
+
+    it('should return formated strings for simple placeholders', function() {
+        assert.equal('%', sprintf('%%'))
+        assert.equal('10', sprintf('%b', 2))
+        assert.equal('A', sprintf('%c', 65))
+        assert.equal('2', sprintf('%d', 2))
+        assert.equal('2', sprintf('%i', 2))
+        assert.equal('2', sprintf('%d', '2'))
+        assert.equal('2', sprintf('%i', '2'))
+        assert.equal('{"foo":"bar"}', sprintf('%j', {foo: 'bar'}))
+        assert.equal('["foo","bar"]', sprintf('%j', ['foo', 'bar']))
+        assert.equal('2e+0', sprintf('%e', 2))
+        assert.equal('2', sprintf('%u', 2))
+        assert.equal('4294967294', sprintf('%u', -2))
+        assert.equal('2.2', sprintf('%f', 2.2))
+        assert.equal('3.141592653589793', sprintf('%g', pi))
+        assert.equal('10', sprintf('%o', 8))
+        assert.equal('37777777770', sprintf('%o', -8))
+        assert.equal('%s', sprintf('%s', '%s'))
+        assert.equal('ff', sprintf('%x', 255))
+        assert.equal('ffffff01', sprintf('%x', -255))
+        assert.equal('FF', sprintf('%X', 255))
+        assert.equal('FFFFFF01', sprintf('%X', -255))
+        assert.equal('Polly wants a cracker', sprintf('%2$s %3$s a %1$s', 'cracker', 'Polly', 'wants'))
+        assert.equal('Hello world!', sprintf('Hello %(who)s!', {who: 'world'}))
+        assert.equal('true', sprintf('%t', true))
+        assert.equal('t', sprintf('%.1t', true))
+        assert.equal('true', sprintf('%t', 'true'))
+        assert.equal('true', sprintf('%t', 1))
+        assert.equal('false', sprintf('%t', false))
+        assert.equal('f', sprintf('%.1t', false))
+        assert.equal('false', sprintf('%t', ''))
+        assert.equal('false', sprintf('%t', 0))
+
+        assert.equal('undefined', sprintf('%T', undefined))
+        assert.equal('null', sprintf('%T', null))
+        assert.equal('boolean', sprintf('%T', true))
+        assert.equal('number', sprintf('%T', 42))
+        assert.equal('string', sprintf('%T', 'This is a string'))
+        assert.equal('function', sprintf('%T', Math.log))
+        assert.equal('array', sprintf('%T', [1, 2, 3]))
+        assert.equal('object', sprintf('%T', {foo: 'bar'}))
+        assert.equal('regexp', sprintf('%T', /<('[^']*'|'[^']*'|[^''>])*>/))
+
+        assert.equal('true', sprintf('%v', true))
+        assert.equal('42', sprintf('%v', 42))
+        assert.equal('This is a string', sprintf('%v', 'This is a string'))
+        assert.equal('1,2,3', sprintf('%v', [1, 2, 3]))
+        assert.equal('[object Object]', sprintf('%v', {foo: 'bar'}))
+        assert.equal('/<("[^"]*"|\'[^\']*\'|[^\'">])*>/', sprintf('%v', /<("[^"]*"|'[^']*'|[^'">])*>/))
+    })
+
+    it('should return formated strings for complex placeholders', function() {
+        // sign
+        assert.equal('2', sprintf('%d', 2))
+        assert.equal('-2', sprintf('%d', -2))
+        assert.equal('+2', sprintf('%+d', 2))
+        assert.equal('-2', sprintf('%+d', -2))
+        assert.equal('2', sprintf('%i', 2))
+        assert.equal('-2', sprintf('%i', -2))
+        assert.equal('+2', sprintf('%+i', 2))
+        assert.equal('-2', sprintf('%+i', -2))
+        assert.equal('2.2', sprintf('%f', 2.2))
+        assert.equal('-2.2', sprintf('%f', -2.2))
+        assert.equal('+2.2', sprintf('%+f', 2.2))
+        assert.equal('-2.2', sprintf('%+f', -2.2))
+        assert.equal('-2.3', sprintf('%+.1f', -2.34))
+        assert.equal('-0.0', sprintf('%+.1f', -0.01))
+        assert.equal('3.14159', sprintf('%.6g', pi))
+        assert.equal('3.14', sprintf('%.3g', pi))
+        assert.equal('3', sprintf('%.1g', pi))
+        assert.equal('-000000123', sprintf('%+010d', -123))
+        assert.equal('______-123', sprintf("%+'_10d", -123))
+        assert.equal('-234.34 123.2', sprintf('%f %f', -234.34, 123.2))
+
+        // padding
+        assert.equal('-0002', sprintf('%05d', -2))
+        assert.equal('-0002', sprintf('%05i', -2))
+        assert.equal('    <', sprintf('%5s', '<'))
+        assert.equal('0000<', sprintf('%05s', '<'))
+        assert.equal('____<', sprintf("%'_5s", '<'))
+        assert.equal('>    ', sprintf('%-5s', '>'))
+        assert.equal('>0000', sprintf('%0-5s', '>'))
+        assert.equal('>____', sprintf("%'_-5s", '>'))
+        assert.equal('xxxxxx', sprintf('%5s', 'xxxxxx'))
+        assert.equal('1234', sprintf('%02u', 1234))
+        assert.equal(' -10.235', sprintf('%8.3f', -10.23456))
+        assert.equal('-12.34 xxx', sprintf('%f %s', -12.34, 'xxx'))
+        assert.equal('{\n  "foo": "bar"\n}', sprintf('%2j', {foo: 'bar'}))
+        assert.equal('[\n  "foo",\n  "bar"\n]', sprintf('%2j', ['foo', 'bar']))
+
+        // precision
+        assert.equal('2.3', sprintf('%.1f', 2.345))
+        assert.equal('xxxxx', sprintf('%5.5s', 'xxxxxx'))
+        assert.equal('    x', sprintf('%5.1s', 'xxxxxx'))
+
+    })
+
+    it('should return formated strings for callbacks', function() {
+        assert.equal('foobar', sprintf('%s', function() { return 'foobar' }))
+    })
+})
diff --git a/wrt/node_modules/sprintf-js/test/test_validation.js b/wrt/node_modules/sprintf-js/test/test_validation.js
new file mode 100644 (file)
index 0000000..9da33ed
--- /dev/null
@@ -0,0 +1,60 @@
+/* global describe, it */
+
+'use strict'
+
+var assert = require('assert'),
+    sprintfjs = require('../src/sprintf.js'),
+    sprintf = sprintfjs.sprintf,
+    vsprintf = sprintfjs.vsprintf
+
+function should_throw(format,args,err) {
+    assert.throws(function() { vsprintf(format,args) }, err)
+}
+
+function should_not_throw(format,args) {
+    assert.doesNotThrow(function() { vsprintf(format,args) })
+}
+
+describe('sprintfjs cache', function() {
+
+    it('should not throw Error (cache consistency)', function() {
+        // redefine object properties to ensure that is not affect to the cache
+        sprintf('hasOwnProperty')
+        sprintf('constructor')
+        should_not_throw('%s', ['caching...'])
+        should_not_throw('%s', ['crash?'])
+    })
+})
+
+describe('sprintfjs', function() {
+
+    it('should throw SyntaxError for placeholders', function() {
+        should_throw('%', [], SyntaxError)
+        should_throw('%A', [], SyntaxError)
+        should_throw('%s%', [], SyntaxError)
+        should_throw('%(s', [], SyntaxError)
+        should_throw('%)s', [], SyntaxError)
+        should_throw('%$s', [], SyntaxError)
+        should_throw('%()s', [], SyntaxError)
+        should_throw('%(12)s', [], SyntaxError)
+    })
+
+    var numeric = 'bcdiefguxX'.split('')
+    numeric.forEach(function(specifier) {
+        var fmt = sprintf('%%%s',specifier)
+        it(fmt + ' should throw TypeError for invalid numbers', function() {
+            should_throw(fmt, [], TypeError)
+            should_throw(fmt, ['str'], TypeError)
+            should_throw(fmt, [{}], TypeError)
+            should_throw(fmt, ['s'], TypeError)
+        })
+
+        it(fmt + ' should not throw TypeError for something implicitly castable to number', function() {
+            should_not_throw(fmt, [1/0])
+            should_not_throw(fmt, [true])
+            should_not_throw(fmt, [[1]])
+            should_not_throw(fmt, ['200'])
+            should_not_throw(fmt, [null])
+        })
+    })
+})
diff --git a/wrt/node_modules/statuses/HISTORY.md b/wrt/node_modules/statuses/HISTORY.md
new file mode 100644 (file)
index 0000000..3015a5f
--- /dev/null
@@ -0,0 +1,55 @@
+1.3.1 / 2016-11-11
+==================
+
+  * Fix return type in JSDoc
+
+1.3.0 / 2016-05-17
+==================
+
+  * Add `421 Misdirected Request`
+  * perf: enable strict mode
+
+1.2.1 / 2015-02-01
+==================
+
+  * Fix message for status 451
+    - `451 Unavailable For Legal Reasons`
+
+1.2.0 / 2014-09-28
+==================
+
+  * Add `208 Already Repored`
+  * Add `226 IM Used`
+  * Add `306 (Unused)`
+  * Add `415 Unable For Legal Reasons`
+  * Add `508 Loop Detected`
+
+1.1.1 / 2014-09-24
+==================
+
+  * Add missing 308 to `codes.json`
+
+1.1.0 / 2014-09-21
+==================
+
+  * Add `codes.json` for universal support
+
+1.0.4 / 2014-08-20
+==================
+
+  * Package cleanup
+
+1.0.3 / 2014-06-08
+==================
+
+  * Add 308 to `.redirect` category
+
+1.0.2 / 2014-03-13
+==================
+
+  * Add `.retry` category
+
+1.0.1 / 2014-03-12
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/statuses/LICENSE b/wrt/node_modules/statuses/LICENSE
new file mode 100644 (file)
index 0000000..82af4df
--- /dev/null
@@ -0,0 +1,23 @@
+
+The MIT License (MIT)
+
+Copyright (c) 2014 Jonathan Ong me@jongleberry.com
+Copyright (c) 2016 Douglas Christopher Wilson doug@somethingdoug.com
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/statuses/README.md b/wrt/node_modules/statuses/README.md
new file mode 100644 (file)
index 0000000..2bf0756
--- /dev/null
@@ -0,0 +1,103 @@
+# Statuses
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+HTTP status utility for node.
+
+## API
+
+```js
+var status = require('statuses')
+```
+
+### var code = status(Integer || String)
+
+If `Integer` or `String` is a valid HTTP code or status message, then the appropriate `code` will be returned. Otherwise, an error will be thrown.
+
+```js
+status(403) // => 403
+status('403') // => 403
+status('forbidden') // => 403
+status('Forbidden') // => 403
+status(306) // throws, as it's not supported by node.js
+```
+
+### status.codes
+
+Returns an array of all the status codes as `Integer`s.
+
+### var msg = status[code]
+
+Map of `code` to `status message`. `undefined` for invalid `code`s.
+
+```js
+status[404] // => 'Not Found'
+```
+
+### var code = status[msg]
+
+Map of `status message` to `code`. `msg` can either be title-cased or lower-cased. `undefined` for invalid `status message`s.
+
+```js
+status['not found'] // => 404
+status['Not Found'] // => 404
+```
+
+### status.redirect[code]
+
+Returns `true` if a status code is a valid redirect status.
+
+```js
+status.redirect[200] // => undefined
+status.redirect[301] // => true
+```
+
+### status.empty[code]
+
+Returns `true` if a status code expects an empty body.
+
+```js
+status.empty[200] // => undefined
+status.empty[204] // => true
+status.empty[304] // => true
+```
+
+### status.retry[code]
+
+Returns `true` if you should retry the rest.
+
+```js
+status.retry[501] // => undefined
+status.retry[503] // => true
+```
+
+## Adding Status Codes
+
+The status codes are primarily sourced from http://www.iana.org/assignments/http-status-codes/http-status-codes-1.csv.
+Additionally, custom codes are added from http://en.wikipedia.org/wiki/List_of_HTTP_status_codes.
+These are added manually in the `lib/*.json` files.
+If you would like to add a status code, add it to the appropriate JSON file.
+
+To rebuild `codes.json`, run the following:
+
+```bash
+# update src/iana.json
+npm run fetch
+# build codes.json
+npm run build
+```
+
+[npm-image]: https://img.shields.io/npm/v/statuses.svg
+[npm-url]: https://npmjs.org/package/statuses
+[node-version-image]: https://img.shields.io/badge/node.js-%3E%3D_0.6-brightgreen.svg
+[node-version-url]: https://nodejs.org/en/download
+[travis-image]: https://img.shields.io/travis/jshttp/statuses.svg
+[travis-url]: https://travis-ci.org/jshttp/statuses
+[coveralls-image]: https://img.shields.io/coveralls/jshttp/statuses.svg
+[coveralls-url]: https://coveralls.io/r/jshttp/statuses?branch=master
+[downloads-image]: https://img.shields.io/npm/dm/statuses.svg
+[downloads-url]: https://npmjs.org/package/statuses
diff --git a/wrt/node_modules/statuses/codes.json b/wrt/node_modules/statuses/codes.json
new file mode 100644 (file)
index 0000000..e765123
--- /dev/null
@@ -0,0 +1,65 @@
+{
+  "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",
+  "208": "Already Reported",
+  "226": "IM Used",
+  "300": "Multiple Choices",
+  "301": "Moved Permanently",
+  "302": "Found",
+  "303": "See Other",
+  "304": "Not Modified",
+  "305": "Use Proxy",
+  "306": "(Unused)",
+  "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 Timeout",
+  "409": "Conflict",
+  "410": "Gone",
+  "411": "Length Required",
+  "412": "Precondition Failed",
+  "413": "Payload Too Large",
+  "414": "URI Too Long",
+  "415": "Unsupported Media Type",
+  "416": "Range Not Satisfiable",
+  "417": "Expectation Failed",
+  "418": "I'm a teapot",
+  "421": "Misdirected Request",
+  "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",
+  "451": "Unavailable For Legal Reasons",
+  "500": "Internal Server Error",
+  "501": "Not Implemented",
+  "502": "Bad Gateway",
+  "503": "Service Unavailable",
+  "504": "Gateway Timeout",
+  "505": "HTTP Version Not Supported",
+  "506": "Variant Also Negotiates",
+  "507": "Insufficient Storage",
+  "508": "Loop Detected",
+  "509": "Bandwidth Limit Exceeded",
+  "510": "Not Extended",
+  "511": "Network Authentication Required"
+}
\ No newline at end of file
diff --git a/wrt/node_modules/statuses/index.js b/wrt/node_modules/statuses/index.js
new file mode 100644 (file)
index 0000000..9f955c6
--- /dev/null
@@ -0,0 +1,110 @@
+/*!
+ * statuses
+ * Copyright(c) 2014 Jonathan Ong
+ * Copyright(c) 2016 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var codes = require('./codes.json')
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = status
+
+// array of status codes
+status.codes = populateStatusesMap(status, codes)
+
+// status codes for redirects
+status.redirect = {
+  300: true,
+  301: true,
+  302: true,
+  303: true,
+  305: true,
+  307: true,
+  308: true
+}
+
+// status codes for empty bodies
+status.empty = {
+  204: true,
+  205: true,
+  304: true
+}
+
+// status codes for when you should retry the request
+status.retry = {
+  502: true,
+  503: true,
+  504: true
+}
+
+/**
+ * Populate the statuses map for given codes.
+ * @private
+ */
+
+function populateStatusesMap (statuses, codes) {
+  var arr = []
+
+  Object.keys(codes).forEach(function forEachCode (code) {
+    var message = codes[code]
+    var status = Number(code)
+
+    // Populate properties
+    statuses[status] = message
+    statuses[message] = status
+    statuses[message.toLowerCase()] = status
+
+    // Add to array
+    arr.push(status)
+  })
+
+  return arr
+}
+
+/**
+ * Get the status code.
+ *
+ * Given a number, this will throw if it is not a known status
+ * code, otherwise the code will be returned. Given a string,
+ * the string will be parsed for a number and return the code
+ * if valid, otherwise will lookup the code assuming this is
+ * the status message.
+ *
+ * @param {string|number} code
+ * @returns {number}
+ * @public
+ */
+
+function status (code) {
+  if (typeof code === 'number') {
+    if (!status[code]) throw new Error('invalid status code: ' + code)
+    return code
+  }
+
+  if (typeof code !== 'string') {
+    throw new TypeError('code must be a number or string')
+  }
+
+  // '403'
+  var n = parseInt(code, 10)
+  if (!isNaN(n)) {
+    if (!status[n]) throw new Error('invalid status code: ' + n)
+    return n
+  }
+
+  n = status[code.toLowerCase()]
+  if (!n) throw new Error('invalid status message: "' + code + '"')
+  return n
+}
diff --git a/wrt/node_modules/statuses/package.json b/wrt/node_modules/statuses/package.json
new file mode 100644 (file)
index 0000000..388b682
--- /dev/null
@@ -0,0 +1,141 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "statuses@~1.3.1",
+        "scope": null,
+        "escapedName": "statuses",
+        "name": "statuses",
+        "rawSpec": "~1.3.1",
+        "spec": ">=1.3.1 <1.4.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express"
+    ]
+  ],
+  "_from": "statuses@>=1.3.1 <1.4.0",
+  "_id": "statuses@1.3.1",
+  "_inCache": true,
+  "_location": "/statuses",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/statuses-1.3.1.tgz_1478923281491_0.5574048184789717"
+  },
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "1.4.28",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "statuses@~1.3.1",
+    "scope": null,
+    "escapedName": "statuses",
+    "name": "statuses",
+    "rawSpec": "~1.3.1",
+    "spec": ">=1.3.1 <1.4.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/express",
+    "/finalhandler",
+    "/http-errors",
+    "/send"
+  ],
+  "_resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz",
+  "_shasum": "faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e",
+  "_shrinkwrap": null,
+  "_spec": "statuses@~1.3.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express",
+  "bugs": {
+    "url": "https://github.com/jshttp/statuses/issues"
+  },
+  "contributors": [
+    {
+      "name": "Douglas Christopher Wilson",
+      "email": "doug@somethingdoug.com"
+    },
+    {
+      "name": "Jonathan Ong",
+      "email": "me@jongleberry.com",
+      "url": "http://jongleberry.com"
+    }
+  ],
+  "dependencies": {},
+  "description": "HTTP status utility",
+  "devDependencies": {
+    "csv-parse": "1.1.7",
+    "eslint": "3.10.0",
+    "eslint-config-standard": "6.2.1",
+    "eslint-plugin-promise": "3.3.2",
+    "eslint-plugin-standard": "2.0.1",
+    "istanbul": "0.4.5",
+    "mocha": "1.21.5",
+    "stream-to-array": "2.3.0"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "faf51b9eb74aaef3b3acf4ad5f61abf24cb7b93e",
+    "tarball": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz"
+  },
+  "engines": {
+    "node": ">= 0.6"
+  },
+  "files": [
+    "HISTORY.md",
+    "index.js",
+    "codes.json",
+    "LICENSE"
+  ],
+  "gitHead": "28a619be77f5b4741e6578a5764c5b06ec6d4aea",
+  "homepage": "https://github.com/jshttp/statuses",
+  "keywords": [
+    "http",
+    "status",
+    "code"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "defunctzombie",
+      "email": "shtylman@gmail.com"
+    },
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    },
+    {
+      "name": "fishrock123",
+      "email": "fishrock123@rocketmail.com"
+    },
+    {
+      "name": "jongleberry",
+      "email": "jonathanrichardong@gmail.com"
+    },
+    {
+      "name": "mscdex",
+      "email": "mscdex@mscdex.net"
+    },
+    {
+      "name": "tjholowaychuk",
+      "email": "tj@vision-media.ca"
+    }
+  ],
+  "name": "statuses",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/jshttp/statuses.git"
+  },
+  "scripts": {
+    "build": "node scripts/build.js",
+    "fetch": "node scripts/fetch.js",
+    "lint": "eslint .",
+    "test": "mocha --reporter spec --check-leaks --bail test/",
+    "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
+    "update": "npm run fetch && npm run build"
+  },
+  "version": "1.3.1"
+}
diff --git a/wrt/node_modules/string_decoder/.npmignore b/wrt/node_modules/string_decoder/.npmignore
new file mode 100644 (file)
index 0000000..206320c
--- /dev/null
@@ -0,0 +1,2 @@
+build
+test
diff --git a/wrt/node_modules/string_decoder/LICENSE b/wrt/node_modules/string_decoder/LICENSE
new file mode 100644 (file)
index 0000000..6de584a
--- /dev/null
@@ -0,0 +1,20 @@
+Copyright Joyent, Inc. and other Node contributors.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to permit
+persons to whom the Software is furnished to do so, subject to the
+following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/string_decoder/README.md b/wrt/node_modules/string_decoder/README.md
new file mode 100644 (file)
index 0000000..4d2aa00
--- /dev/null
@@ -0,0 +1,7 @@
+**string_decoder.js** (`require('string_decoder')`) from Node.js core
+
+Copyright Joyent, Inc. and other Node contributors. See LICENCE file for details.
+
+Version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.**
+
+The *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version.
\ No newline at end of file
diff --git a/wrt/node_modules/string_decoder/index.js b/wrt/node_modules/string_decoder/index.js
new file mode 100644 (file)
index 0000000..b00e54f
--- /dev/null
@@ -0,0 +1,221 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+var Buffer = require('buffer').Buffer;
+
+var isBufferEncoding = Buffer.isEncoding
+  || function(encoding) {
+       switch (encoding && encoding.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 assertEncoding(encoding) {
+  if (encoding && !isBufferEncoding(encoding)) {
+    throw new Error('Unknown encoding: ' + encoding);
+  }
+}
+
+// StringDecoder provides an interface for efficiently splitting a series of
+// buffers into a series of JS strings without breaking apart multi-byte
+// characters. CESU-8 is handled as part of the UTF-8 encoding.
+//
+// @TODO Handling all encodings inside a single object makes it very difficult
+// to reason about this code, so it should be split up in the future.
+// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code
+// points as used by CESU-8.
+var StringDecoder = exports.StringDecoder = function(encoding) {
+  this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, '');
+  assertEncoding(encoding);
+  switch (this.encoding) {
+    case 'utf8':
+      // CESU-8 represents each of Surrogate Pair by 3-bytes
+      this.surrogateSize = 3;
+      break;
+    case 'ucs2':
+    case 'utf16le':
+      // UTF-16 represents each of Surrogate Pair by 2-bytes
+      this.surrogateSize = 2;
+      this.detectIncompleteChar = utf16DetectIncompleteChar;
+      break;
+    case 'base64':
+      // Base-64 stores 3 bytes in 4 chars, and pads the remainder.
+      this.surrogateSize = 3;
+      this.detectIncompleteChar = base64DetectIncompleteChar;
+      break;
+    default:
+      this.write = passThroughWrite;
+      return;
+  }
+
+  // Enough space to store all bytes of a single character. UTF-8 needs 4
+  // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate).
+  this.charBuffer = new Buffer(6);
+  // Number of bytes received for the current incomplete multi-byte character.
+  this.charReceived = 0;
+  // Number of bytes expected for the current incomplete multi-byte character.
+  this.charLength = 0;
+};
+
+
+// write decodes the given buffer and returns it as JS string that is
+// guaranteed to not contain any partial multi-byte characters. Any partial
+// character found at the end of the buffer is buffered up, and will be
+// returned when calling write again with the remaining bytes.
+//
+// Note: Converting a Buffer containing an orphan surrogate to a String
+// currently works, but converting a String to a Buffer (via `new Buffer`, or
+// Buffer#write) will replace incomplete surrogates with the unicode
+// replacement character. See https://codereview.chromium.org/121173009/ .
+StringDecoder.prototype.write = function(buffer) {
+  var charStr = '';
+  // if our last write ended with an incomplete multibyte character
+  while (this.charLength) {
+    // determine how many remaining bytes this buffer has to offer for this char
+    var available = (buffer.length >= this.charLength - this.charReceived) ?
+        this.charLength - this.charReceived :
+        buffer.length;
+
+    // add the new bytes to the char buffer
+    buffer.copy(this.charBuffer, this.charReceived, 0, available);
+    this.charReceived += available;
+
+    if (this.charReceived < this.charLength) {
+      // still not enough chars in this buffer? wait for more ...
+      return '';
+    }
+
+    // remove bytes belonging to the current character from the buffer
+    buffer = buffer.slice(available, buffer.length);
+
+    // get the character that was split
+    charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding);
+
+    // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
+    var charCode = charStr.charCodeAt(charStr.length - 1);
+    if (charCode >= 0xD800 && charCode <= 0xDBFF) {
+      this.charLength += this.surrogateSize;
+      charStr = '';
+      continue;
+    }
+    this.charReceived = this.charLength = 0;
+
+    // if there are no more bytes in this buffer, just emit our char
+    if (buffer.length === 0) {
+      return charStr;
+    }
+    break;
+  }
+
+  // determine and set charLength / charReceived
+  this.detectIncompleteChar(buffer);
+
+  var end = buffer.length;
+  if (this.charLength) {
+    // buffer the incomplete character bytes we got
+    buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end);
+    end -= this.charReceived;
+  }
+
+  charStr += buffer.toString(this.encoding, 0, end);
+
+  var end = charStr.length - 1;
+  var charCode = charStr.charCodeAt(end);
+  // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
+  if (charCode >= 0xD800 && charCode <= 0xDBFF) {
+    var size = this.surrogateSize;
+    this.charLength += size;
+    this.charReceived += size;
+    this.charBuffer.copy(this.charBuffer, size, 0, size);
+    buffer.copy(this.charBuffer, 0, 0, size);
+    return charStr.substring(0, end);
+  }
+
+  // or just emit the charStr
+  return charStr;
+};
+
+// detectIncompleteChar determines if there is an incomplete UTF-8 character at
+// the end of the given buffer. If so, it sets this.charLength to the byte
+// length that character, and sets this.charReceived to the number of bytes
+// that are available for this character.
+StringDecoder.prototype.detectIncompleteChar = function(buffer) {
+  // determine how many bytes we have to check at the end of this buffer
+  var i = (buffer.length >= 3) ? 3 : buffer.length;
+
+  // Figure out if one of the last i bytes of our buffer announces an
+  // incomplete char.
+  for (; i > 0; i--) {
+    var c = buffer[buffer.length - i];
+
+    // See http://en.wikipedia.org/wiki/UTF-8#Description
+
+    // 110XXXXX
+    if (i == 1 && c >> 5 == 0x06) {
+      this.charLength = 2;
+      break;
+    }
+
+    // 1110XXXX
+    if (i <= 2 && c >> 4 == 0x0E) {
+      this.charLength = 3;
+      break;
+    }
+
+    // 11110XXX
+    if (i <= 3 && c >> 3 == 0x1E) {
+      this.charLength = 4;
+      break;
+    }
+  }
+  this.charReceived = i;
+};
+
+StringDecoder.prototype.end = function(buffer) {
+  var res = '';
+  if (buffer && buffer.length)
+    res = this.write(buffer);
+
+  if (this.charReceived) {
+    var cr = this.charReceived;
+    var buf = this.charBuffer;
+    var enc = this.encoding;
+    res += buf.slice(0, cr).toString(enc);
+  }
+
+  return res;
+};
+
+function passThroughWrite(buffer) {
+  return buffer.toString(this.encoding);
+}
+
+function utf16DetectIncompleteChar(buffer) {
+  this.charReceived = buffer.length % 2;
+  this.charLength = this.charReceived ? 2 : 0;
+}
+
+function base64DetectIncompleteChar(buffer) {
+  this.charReceived = buffer.length % 3;
+  this.charLength = this.charReceived ? 3 : 0;
+}
diff --git a/wrt/node_modules/string_decoder/package.json b/wrt/node_modules/string_decoder/package.json
new file mode 100644 (file)
index 0000000..f3e787b
--- /dev/null
@@ -0,0 +1,87 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "string_decoder@~0.10.x",
+        "scope": null,
+        "escapedName": "string_decoder",
+        "name": "string_decoder",
+        "rawSpec": "~0.10.x",
+        "spec": ">=0.10.0 <0.11.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/readable-stream"
+    ]
+  ],
+  "_from": "string_decoder@>=0.10.0 <0.11.0",
+  "_id": "string_decoder@0.10.31",
+  "_inCache": true,
+  "_location": "/string_decoder",
+  "_npmUser": {
+    "name": "rvagg",
+    "email": "rod@vagg.org"
+  },
+  "_npmVersion": "1.4.23",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "string_decoder@~0.10.x",
+    "scope": null,
+    "escapedName": "string_decoder",
+    "name": "string_decoder",
+    "rawSpec": "~0.10.x",
+    "spec": ">=0.10.0 <0.11.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/readable-stream"
+  ],
+  "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
+  "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94",
+  "_shrinkwrap": null,
+  "_spec": "string_decoder@~0.10.x",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/readable-stream",
+  "bugs": {
+    "url": "https://github.com/rvagg/string_decoder/issues"
+  },
+  "dependencies": {},
+  "description": "The string_decoder module from Node core",
+  "devDependencies": {
+    "tap": "~0.4.8"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94",
+    "tarball": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
+  },
+  "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0",
+  "homepage": "https://github.com/rvagg/string_decoder",
+  "keywords": [
+    "string",
+    "decoder",
+    "browser",
+    "browserify"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "substack",
+      "email": "mail@substack.net"
+    },
+    {
+      "name": "rvagg",
+      "email": "rod@vagg.org"
+    }
+  ],
+  "name": "string_decoder",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/rvagg/string_decoder.git"
+  },
+  "scripts": {
+    "test": "tap test/simple/*.js"
+  },
+  "version": "0.10.31"
+}
diff --git a/wrt/node_modules/strip-ansi/cli.js b/wrt/node_modules/strip-ansi/cli.js
new file mode 100755 (executable)
index 0000000..f8019cd
--- /dev/null
@@ -0,0 +1,27 @@
+#!/usr/bin/env node
+'use strict';
+var fs = require('fs');
+var strip = require('./index');
+var input = process.argv[2];
+
+if (process.argv.indexOf('-h') !== -1 || process.argv.indexOf('--help') !== -1) {
+       console.log('strip-ansi <input file> > <output file>');
+       console.log('or');
+       console.log('cat <input file> | strip-ansi > <output file>');
+       return;
+}
+
+if (process.argv.indexOf('-v') !== -1 || process.argv.indexOf('--version') !== -1) {
+       console.log(require('./package').version);
+       return;
+}
+
+if (input) {
+       process.stdout.write(strip(fs.readFileSync(input, 'utf8')));
+       return;
+}
+
+process.stdin.setEncoding('utf8');
+process.stdin.on('data', function (data) {
+       process.stdout.write(strip(data));
+});
diff --git a/wrt/node_modules/strip-ansi/index.js b/wrt/node_modules/strip-ansi/index.js
new file mode 100644 (file)
index 0000000..62320c5
--- /dev/null
@@ -0,0 +1,4 @@
+'use strict';
+module.exports = function (str) {
+       return typeof str === 'string' ? str.replace(/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]/g, '') : str;
+};
diff --git a/wrt/node_modules/strip-ansi/package.json b/wrt/node_modules/strip-ansi/package.json
new file mode 100644 (file)
index 0000000..551961b
--- /dev/null
@@ -0,0 +1,115 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "strip-ansi@~0.1.0",
+        "scope": null,
+        "escapedName": "strip-ansi",
+        "name": "strip-ansi",
+        "rawSpec": "~0.1.0",
+        "spec": ">=0.1.0 <0.2.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/diskdb/node_modules/chalk"
+    ]
+  ],
+  "_from": "strip-ansi@>=0.1.0 <0.2.0",
+  "_id": "strip-ansi@0.1.1",
+  "_inCache": true,
+  "_location": "/strip-ansi",
+  "_npmUser": {
+    "name": "sindresorhus",
+    "email": "sindresorhus@gmail.com"
+  },
+  "_npmVersion": "1.3.15",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "strip-ansi@~0.1.0",
+    "scope": null,
+    "escapedName": "strip-ansi",
+    "name": "strip-ansi",
+    "rawSpec": "~0.1.0",
+    "spec": ">=0.1.0 <0.2.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/diskdb/chalk"
+  ],
+  "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz",
+  "_shasum": "39e8a98d044d150660abe4a6808acf70bb7bc991",
+  "_shrinkwrap": null,
+  "_spec": "strip-ansi@~0.1.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/diskdb/node_modules/chalk",
+  "author": {
+    "name": "Sindre Sorhus",
+    "email": "sindresorhus@gmail.com",
+    "url": "http://sindresorhus.com"
+  },
+  "bin": {
+    "strip-ansi": "cli.js"
+  },
+  "bugs": {
+    "url": "https://github.com/sindresorhus/strip-ansi/issues"
+  },
+  "dependencies": {},
+  "description": "Strip ANSI escape codes (used for colorizing strings in the terminal)",
+  "devDependencies": {
+    "mocha": "~1.x"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "39e8a98d044d150660abe4a6808acf70bb7bc991",
+    "tarball": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz"
+  },
+  "engines": {
+    "node": ">=0.8.0"
+  },
+  "files": [
+    "index.js",
+    "cli.js"
+  ],
+  "homepage": "https://github.com/sindresorhus/strip-ansi",
+  "keywords": [
+    "strip",
+    "trim",
+    "remove",
+    "ansi",
+    "styles",
+    "color",
+    "colour",
+    "colors",
+    "terminal",
+    "console",
+    "cli",
+    "string",
+    "tty",
+    "escape",
+    "formatting",
+    "rgb",
+    "256",
+    "shell",
+    "xterm",
+    "log",
+    "logging",
+    "command-line",
+    "text"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "sindresorhus",
+      "email": "sindresorhus@gmail.com"
+    }
+  ],
+  "name": "strip-ansi",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/sindresorhus/strip-ansi.git"
+  },
+  "scripts": {
+    "test": "mocha"
+  },
+  "version": "0.1.1"
+}
diff --git a/wrt/node_modules/strip-ansi/readme.md b/wrt/node_modules/strip-ansi/readme.md
new file mode 100644 (file)
index 0000000..eb661b3
--- /dev/null
@@ -0,0 +1,46 @@
+# strip-ansi [![Build Status](https://secure.travis-ci.org/sindresorhus/strip-ansi.png?branch=master)](http://travis-ci.org/sindresorhus/strip-ansi)
+
+> Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) (used for colorizing strings in the terminal)
+
+Used in the terminal color module [chalk](https://github.com/sindresorhus/chalk).
+
+
+## Install
+
+Install locally with [npm](https://npmjs.org/package/strip-ansi):
+
+```
+npm install --save strip-ansi
+```
+
+Or globally if you want to use it as a CLI app:
+
+```
+npm install --global strip-ansi
+```
+
+You can then use it in your Terminal like:
+
+```
+strip-ansi file-with-color-codes
+```
+
+Or pipe something to it:
+
+```
+ls | strip-ansi
+```
+
+
+## Example
+
+```js
+var stripAnsi = require('strip-ansi');
+stripAnsi('\x1b[4mcake\x1b[0m');
+//=> cake
+```
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/wrt/node_modules/supports-color/browser.js b/wrt/node_modules/supports-color/browser.js
new file mode 100644 (file)
index 0000000..ae7c87b
--- /dev/null
@@ -0,0 +1,2 @@
+'use strict';
+module.exports = false;
diff --git a/wrt/node_modules/supports-color/index.js b/wrt/node_modules/supports-color/index.js
new file mode 100644 (file)
index 0000000..a5d9331
--- /dev/null
@@ -0,0 +1,115 @@
+'use strict';
+const os = require('os');
+const hasFlag = require('has-flag');
+
+const env = process.env;
+
+const support = level => {
+       if (level === 0) {
+               return false;
+       }
+
+       return {
+               level,
+               hasBasic: true,
+               has256: level >= 2,
+               has16m: level >= 3
+       };
+};
+
+let supportLevel = (() => {
+       if (hasFlag('no-color') ||
+               hasFlag('no-colors') ||
+               hasFlag('color=false')) {
+               return 0;
+       }
+
+       if (hasFlag('color=16m') ||
+               hasFlag('color=full') ||
+               hasFlag('color=truecolor')) {
+               return 3;
+       }
+
+       if (hasFlag('color=256')) {
+               return 2;
+       }
+
+       if (hasFlag('color') ||
+               hasFlag('colors') ||
+               hasFlag('color=true') ||
+               hasFlag('color=always')) {
+               return 1;
+       }
+
+       if (process.stdout && !process.stdout.isTTY) {
+               return 0;
+       }
+
+       if (process.platform === 'win32') {
+               // Node.js 7.5.0 is the first version of Node.js to include a patch to
+               // libuv that enables 256 color output on Windows. Anything earlier and it
+               // won't work. However, here we target Node.js 8 at minimum as it is an LTS
+               // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows
+               // release that supports 256 colors.
+               const osRelease = os.release().split('.');
+               if (
+                       Number(process.versions.node.split('.')[0]) >= 8 &&
+                       Number(osRelease[0]) >= 10 &&
+                       Number(osRelease[2]) >= 10586
+               ) {
+                       return 2;
+               }
+
+               return 1;
+       }
+
+       if ('CI' in env) {
+               if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
+                       return 1;
+               }
+
+               return 0;
+       }
+
+       if ('TEAMCITY_VERSION' in env) {
+               return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
+       }
+
+       if ('TERM_PROGRAM' in env) {
+               const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
+
+               switch (env.TERM_PROGRAM) {
+                       case 'iTerm.app':
+                               return version >= 3 ? 3 : 2;
+                       case 'Hyper':
+                               return 3;
+                       case 'Apple_Terminal':
+                               return 2;
+                       // No default
+               }
+       }
+
+       if (/-256(color)?$/i.test(env.TERM)) {
+               return 2;
+       }
+
+       if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(env.TERM)) {
+               return 1;
+       }
+
+       if ('COLORTERM' in env) {
+               return 1;
+       }
+
+       if (env.TERM === 'dumb') {
+               return 0;
+       }
+
+       return 0;
+})();
+
+if ('FORCE_COLOR' in env) {
+       supportLevel = parseInt(env.FORCE_COLOR, 10) === 0 ? 0 : (supportLevel || 1);
+}
+
+module.exports = process && support(supportLevel);
diff --git a/wrt/node_modules/supports-color/license b/wrt/node_modules/supports-color/license
new file mode 100644 (file)
index 0000000..e7af2f7
--- /dev/null
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/supports-color/package.json b/wrt/node_modules/supports-color/package.json
new file mode 100644 (file)
index 0000000..7a6d4b8
--- /dev/null
@@ -0,0 +1,125 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "supports-color@^4.0.0",
+        "scope": null,
+        "escapedName": "supports-color",
+        "name": "supports-color",
+        "rawSpec": "^4.0.0",
+        "spec": ">=4.0.0 <5.0.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/chalk"
+    ]
+  ],
+  "_from": "supports-color@>=4.0.0 <5.0.0",
+  "_id": "supports-color@4.4.0",
+  "_inCache": true,
+  "_location": "/supports-color",
+  "_nodeVersion": "8.2.1",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/supports-color-4.4.0.tgz_1504162477210_0.36436482798308134"
+  },
+  "_npmUser": {
+    "name": "sindresorhus",
+    "email": "sindresorhus@gmail.com"
+  },
+  "_npmVersion": "5.3.0",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "supports-color@^4.0.0",
+    "scope": null,
+    "escapedName": "supports-color",
+    "name": "supports-color",
+    "rawSpec": "^4.0.0",
+    "spec": ">=4.0.0 <5.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/chalk"
+  ],
+  "_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz",
+  "_shasum": "883f7ddabc165142b2a61427f3352ded195d1a3e",
+  "_shrinkwrap": null,
+  "_spec": "supports-color@^4.0.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/chalk",
+  "author": {
+    "name": "Sindre Sorhus",
+    "email": "sindresorhus@gmail.com",
+    "url": "sindresorhus.com"
+  },
+  "browser": "browser.js",
+  "bugs": {
+    "url": "https://github.com/chalk/supports-color/issues"
+  },
+  "dependencies": {
+    "has-flag": "^2.0.0"
+  },
+  "description": "Detect whether a terminal supports color",
+  "devDependencies": {
+    "ava": "*",
+    "import-fresh": "^2.0.0",
+    "xo": "*"
+  },
+  "directories": {},
+  "dist": {
+    "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==",
+    "shasum": "883f7ddabc165142b2a61427f3352ded195d1a3e",
+    "tarball": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz"
+  },
+  "engines": {
+    "node": ">=4"
+  },
+  "files": [
+    "index.js",
+    "browser.js"
+  ],
+  "gitHead": "d2e32f77030ddf583b95b79bc3f6417241472980",
+  "homepage": "https://github.com/chalk/supports-color#readme",
+  "keywords": [
+    "color",
+    "colour",
+    "colors",
+    "terminal",
+    "console",
+    "cli",
+    "ansi",
+    "styles",
+    "tty",
+    "rgb",
+    "256",
+    "shell",
+    "xterm",
+    "command-line",
+    "support",
+    "supports",
+    "capability",
+    "detect",
+    "truecolor",
+    "16m"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "qix",
+      "email": "i.am.qix@gmail.com"
+    },
+    {
+      "name": "sindresorhus",
+      "email": "sindresorhus@gmail.com"
+    }
+  ],
+  "name": "supports-color",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/chalk/supports-color.git"
+  },
+  "scripts": {
+    "test": "xo && ava"
+  },
+  "version": "4.4.0"
+}
diff --git a/wrt/node_modules/supports-color/readme.md b/wrt/node_modules/supports-color/readme.md
new file mode 100644 (file)
index 0000000..3bef57d
--- /dev/null
@@ -0,0 +1,66 @@
+# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color)
+
+> Detect whether a terminal supports color
+
+
+## Install
+
+```
+$ npm install supports-color
+```
+
+
+## Usage
+
+```js
+const supportsColor = require('supports-color');
+
+if (supportsColor) {
+       console.log('Terminal supports color');
+}
+
+if (supportsColor.has256) {
+       console.log('Terminal supports 256 colors');
+}
+
+if (supportsColor.has16m) {
+       console.log('Terminal supports 16 million colors (truecolor)');
+}
+```
+
+
+## API
+
+Returns an `Object`, or `false` if color is not supported.
+
+The returned object specifies a level of support for color through a `.level` property and a corresponding flag:
+
+- `.level = 1` and `.hasBasic = true`: Basic color support (16 colors)
+- `.level = 2` and `.has256 = true`: 256 color support
+- `.level = 3` and `.has16m = true`: Truecolor support (16 million colors)
+
+
+## Info
+
+It obeys the `--color` and `--no-color` CLI flags.
+
+Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add the environment variable `FORCE_COLOR=1` to forcefully enable color or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks.
+
+Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively.
+
+
+## Related
+
+- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module
+- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
+
+
+## Maintainers
+
+- [Sindre Sorhus](https://github.com/sindresorhus)
+- [Josh Junon](https://github.com/qix-)
+
+
+## License
+
+MIT
diff --git a/wrt/node_modules/to-array/.npmignore b/wrt/node_modules/to-array/.npmignore
new file mode 100644 (file)
index 0000000..062c11e
--- /dev/null
@@ -0,0 +1,3 @@
+node_modules
+*.log
+*.err
\ No newline at end of file
diff --git a/wrt/node_modules/to-array/LICENCE b/wrt/node_modules/to-array/LICENCE
new file mode 100644 (file)
index 0000000..a23e08a
--- /dev/null
@@ -0,0 +1,19 @@
+Copyright (c) 2012 Raynos.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
\ No newline at end of file
diff --git a/wrt/node_modules/to-array/README.md b/wrt/node_modules/to-array/README.md
new file mode 100644 (file)
index 0000000..0f35286
--- /dev/null
@@ -0,0 +1,22 @@
+# to-array
+
+Turn an array like into an array
+
+## Example
+
+``` js
+var toArray = require("to-array")
+    , elems = document.links
+
+var array = toArray(elems)
+```
+
+## Installation
+
+`npm install to-array`
+
+## Contributors
+
+ - Raynos
+
+## MIT Licenced
diff --git a/wrt/node_modules/to-array/index.js b/wrt/node_modules/to-array/index.js
new file mode 100644 (file)
index 0000000..6a38a69
--- /dev/null
@@ -0,0 +1,13 @@
+module.exports = toArray
+
+function toArray(list, index) {
+    var array = []
+
+    index = index || 0
+
+    for (var i = index || 0; i < list.length; i++) {
+        array[i - index] = list[i]
+    }
+
+    return array
+}
diff --git a/wrt/node_modules/to-array/package.json b/wrt/node_modules/to-array/package.json
new file mode 100644 (file)
index 0000000..1b79cd7
--- /dev/null
@@ -0,0 +1,98 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "to-array@0.1.4",
+        "scope": null,
+        "escapedName": "to-array",
+        "name": "to-array",
+        "rawSpec": "0.1.4",
+        "spec": "0.1.4",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io-client"
+    ]
+  ],
+  "_from": "to-array@0.1.4",
+  "_id": "to-array@0.1.4",
+  "_inCache": true,
+  "_location": "/to-array",
+  "_npmUser": {
+    "name": "raynos",
+    "email": "raynos2@gmail.com"
+  },
+  "_npmVersion": "1.3.1",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "to-array@0.1.4",
+    "scope": null,
+    "escapedName": "to-array",
+    "name": "to-array",
+    "rawSpec": "0.1.4",
+    "spec": "0.1.4",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/socket.io-client"
+  ],
+  "_resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz",
+  "_shasum": "17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890",
+  "_shrinkwrap": null,
+  "_spec": "to-array@0.1.4",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/socket.io-client",
+  "author": {
+    "name": "Raynos",
+    "email": "raynos2@gmail.com"
+  },
+  "bugs": {
+    "url": "https://github.com/Raynos/to-array/issues",
+    "email": "raynos2@gmail.com"
+  },
+  "component": {
+    "scripts": {
+      "to-array/index.js": "index.js"
+    }
+  },
+  "contributors": [
+    {
+      "name": "Jake Verbaten"
+    }
+  ],
+  "dependencies": {},
+  "description": "Turn an array like into an array",
+  "devDependencies": {
+    "tap": "~0.3.1"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890",
+    "tarball": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz"
+  },
+  "homepage": "https://github.com/Raynos/to-array",
+  "keywords": [],
+  "licenses": [
+    {
+      "type": "MIT",
+      "url": "http://github.com/Raynos/to-array/raw/master/LICENSE"
+    }
+  ],
+  "main": "index",
+  "maintainers": [
+    {
+      "name": "raynos",
+      "email": "raynos2@gmail.com"
+    }
+  ],
+  "name": "to-array",
+  "optionalDependencies": {},
+  "readme": "# to-array\n\nTurn an array like into an array\n\n## Example\n\n``` js\nvar toArray = require(\"to-array\")\n    , elems = document.links\n\nvar array = toArray(elems)\n```\n\n## Installation\n\n`npm install to-array`\n\n## Contributors\n\n - Raynos\n\n## MIT Licenced\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/Raynos/to-array.git"
+  },
+  "scripts": {
+    "test": "tap --stderr --tap ./test"
+  },
+  "version": "0.1.4"
+}
diff --git a/wrt/node_modules/traverse/.npmignore b/wrt/node_modules/traverse/.npmignore
new file mode 100644 (file)
index 0000000..3c3629e
--- /dev/null
@@ -0,0 +1 @@
+node_modules
diff --git a/wrt/node_modules/traverse/LICENSE b/wrt/node_modules/traverse/LICENSE
new file mode 100644 (file)
index 0000000..7b75500
--- /dev/null
@@ -0,0 +1,24 @@
+Copyright 2010 James Halliday (mail@substack.net)
+
+This project is free software released under the MIT/X11 license:
+http://www.opensource.org/licenses/mit-license.php 
+
+Copyright 2010 James Halliday (mail@substack.net)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/traverse/README.markdown b/wrt/node_modules/traverse/README.markdown
new file mode 100644 (file)
index 0000000..5728639
--- /dev/null
@@ -0,0 +1,247 @@
+traverse
+========
+
+Traverse and transform objects by visiting every node on a recursive walk.
+
+examples
+========
+
+transform negative numbers in-place
+-----------------------------------
+
+negative.js
+
+````javascript
+var traverse = require('traverse');
+var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ];
+
+traverse(obj).forEach(function (x) {
+    if (x < 0) this.update(x + 128);
+});
+
+console.dir(obj);
+````
+
+Output:
+
+    [ 5, 6, 125, [ 7, 8, 126, 1 ], { f: 10, g: 115 } ]
+
+collect leaf nodes
+------------------
+
+leaves.js
+
+````javascript
+var traverse = require('traverse');
+
+var obj = {
+    a : [1,2,3],
+    b : 4,
+    c : [5,6],
+    d : { e : [7,8], f : 9 },
+};
+
+var leaves = traverse(obj).reduce(function (acc, x) {
+    if (this.isLeaf) acc.push(x);
+    return acc;
+}, []);
+
+console.dir(leaves);
+````
+
+Output:
+
+    [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
+
+context
+=======
+
+Each method that takes a callback has a context (its `this` object) with these
+attributes:
+
+this.node
+---------
+
+The present node on the recursive walk
+
+this.path
+---------
+
+An array of string keys from the root to the present node
+
+this.parent
+-----------
+
+The context of the node's parent.
+This is `undefined` for the root node.
+
+this.key
+--------
+
+The name of the key of the present node in its parent.
+This is `undefined` for the root node.
+
+this.isRoot, this.notRoot
+-------------------------
+
+Whether the present node is the root node
+
+this.isLeaf, this.notLeaf
+-------------------------
+
+Whether or not the present node is a leaf node (has no children)
+
+this.level
+----------
+
+Depth of the node within the traversal
+
+this.circular
+-------------
+
+If the node equals one of its parents, the `circular` attribute is set to the
+context of that parent and the traversal progresses no deeper.
+
+this.update(value)
+------------------
+
+Set a new value for the present node.
+
+this.remove()
+-------------
+
+Remove the current element from the output. If the node is in an Array it will
+be spliced off. Otherwise it will be deleted from its parent.
+
+this.delete()
+-------------
+
+Delete the current element from its parent in the output. Calls `delete` even on
+Arrays.
+
+this.before(fn)
+---------------
+
+Call this function before any of the children are traversed.
+
+this.after(fn)
+--------------
+
+Call this function after any of the children are traversed.
+
+this.pre(fn)
+------------
+
+Call this function before each of the children are traversed.
+
+this.post(fn)
+-------------
+
+Call this function after each of the children are traversed.
+
+methods
+=======
+
+.map(fn)
+--------
+
+Execute `fn` for each node in the object and return a new object with the
+results of the walk. To update nodes in the result use `this.update(value)`.
+
+.forEach(fn)
+------------
+
+Execute `fn` for each node in the object but unlike `.map()`, when
+`this.update()` is called it updates the object in-place.
+
+.reduce(fn, acc)
+----------------
+
+For each node in the object, perform a
+[left-fold](http://en.wikipedia.org/wiki/Fold_(higher-order_function))
+with the return value of `fn(acc, node)`.
+
+If `acc` isn't specified, `acc` is set to the root object for the first step
+and the root element is skipped.
+
+.deepEqual(obj)
+---------------
+
+Returns a boolean, whether the instance value is equal to the supplied object
+along a deep traversal using some opinionated choices.
+
+Some notes:
+
+* RegExps are equal if their .toString()s match, but not functions since
+functions can close over different variables.
+
+* Date instances are compared using `.getTime()` just like `assert.deepEqual()`.
+
+* Circular references must refer to the same paths within the data structure for
+both objects. For instance, in this snippet:
+
+````javascript
+var a = [1];
+a.push(a); // a = [ 1, *a ]
+
+var b = [1];
+b.push(a); // b = [ 1, [ 1, *a ] ]
+````
+
+`a` is not the same as `b` since even though the expansion is the same, the
+circular references in each refer to different paths into the data structure.
+
+However, in:
+
+````javascript
+var c = [1];
+c.push(c); // c = [ 1, *c ];
+````
+
+`c` is equal to `a` in a `deepEqual()` because they have the same terminal node
+structure.
+
+* Arguments objects are not arrays and neither are they the same as regular
+objects.
+
+* Instances created with `new` of String, Boolean, and Number types are never
+equal to the native versions.
+
+.paths()
+--------
+
+Return an `Array` of every possible non-cyclic path in the object.
+Paths are `Array`s of string keys.
+
+.nodes()
+--------
+
+Return an `Array` of every node in the object.
+
+.clone()
+--------
+
+Create a deep clone of the object.
+
+installation
+============
+
+Using npm:
+    npm install traverse
+
+Or check out the repository and link your development copy:
+    git clone http://github.com/substack/js-traverse.git
+    cd js-traverse
+    npm link .
+
+You can test traverse with "expresso":http://github.com/visionmedia/expresso
+(`npm install expresso`):
+    js-traverse $ expresso
+    
+    100% wahoo, your stuff is not broken!
+
+hash transforms
+===============
+
+This library formerly had a hash transformation component. It has been
+[moved to the hashish package](https://github.com/substack/node-hashish).
diff --git a/wrt/node_modules/traverse/examples/json.js b/wrt/node_modules/traverse/examples/json.js
new file mode 100755 (executable)
index 0000000..f3bd989
--- /dev/null
@@ -0,0 +1,16 @@
+var Traverse = require('traverse');
+
+var id = 54;
+var callbacks = {};
+var obj = { moo : function () {}, foo : [2,3,4, function () {}] };
+
+var scrubbed = Traverse(obj).map(function (x) {
+    if (typeof x === 'function') {
+        callbacks[id] = { id : id, f : x, path : this.path };
+        this.update('[Function]');
+        id++;
+    }
+});
+
+console.dir(scrubbed);
+console.dir(callbacks);
diff --git a/wrt/node_modules/traverse/examples/leaves.js b/wrt/node_modules/traverse/examples/leaves.js
new file mode 100755 (executable)
index 0000000..ef5325f
--- /dev/null
@@ -0,0 +1,15 @@
+var Traverse = require('traverse');
+
+var obj = {
+    a : [1,2,3],
+    b : 4,
+    c : [5,6],
+    d : { e : [7,8], f : 9 },
+};
+
+var leaves = Traverse(obj).reduce(function (acc, x) {
+    if (this.isLeaf) acc.push(x);
+    return acc;
+}, []);
+
+console.dir(leaves);
diff --git a/wrt/node_modules/traverse/examples/negative.js b/wrt/node_modules/traverse/examples/negative.js
new file mode 100755 (executable)
index 0000000..a3996c5
--- /dev/null
@@ -0,0 +1,8 @@
+var Traverse = require('traverse');
+var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ];
+
+Traverse(obj).forEach(function (x) {
+    if (x < 0) this.update(x + 128);
+});
+
+console.dir(obj);
diff --git a/wrt/node_modules/traverse/examples/stringify.js b/wrt/node_modules/traverse/examples/stringify.js
new file mode 100755 (executable)
index 0000000..0cef7ec
--- /dev/null
@@ -0,0 +1,38 @@
+#!/usr/bin/env node
+var Traverse = require('traverse');
+
+var obj = [ 'five', 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ];
+
+var s = '';
+Traverse(obj).forEach(function to_s (node) {
+    if (Array.isArray(node)) {
+        this.before(function () { s += '[' });
+        this.post(function (child) {
+            if (!child.isLast) s += ',';
+        });
+        this.after(function () { s += ']' });
+    }
+    else if (typeof node == 'object') {
+        this.before(function () { s += '{' });
+        this.pre(function (x, key) {
+            to_s(key);
+            s += ':';
+        });
+        this.post(function (child) {
+            if (!child.isLast) s += ',';
+        });
+        this.after(function () { s += '}' });
+    }
+    else if (typeof node == 'string') {
+        s += '"' + node.toString().replace(/"/g, '\\"') + '"';
+    }
+    else if (typeof node == 'function') {
+        s += 'null';
+    }
+    else {
+        s += node.toString();
+    }
+});
+
+console.log('JSON.stringify: ' + JSON.stringify(obj));
+console.log('this stringify: ' + s);
diff --git a/wrt/node_modules/traverse/index.js b/wrt/node_modules/traverse/index.js
new file mode 100755 (executable)
index 0000000..7a34c8a
--- /dev/null
@@ -0,0 +1,322 @@
+module.exports = Traverse;
+function Traverse (obj) {
+    if (!(this instanceof Traverse)) return new Traverse(obj);
+    this.value = obj;
+}
+
+Traverse.prototype.get = function (ps) {
+    var node = this.value;
+    for (var i = 0; i < ps.length; i ++) {
+        var key = ps[i];
+        if (!Object.hasOwnProperty.call(node, key)) {
+            node = undefined;
+            break;
+        }
+        node = node[key];
+    }
+    return node;
+};
+
+Traverse.prototype.set = function (ps, value) {
+    var node = this.value;
+    for (var i = 0; i < ps.length - 1; i ++) {
+        var key = ps[i];
+        if (!Object.hasOwnProperty.call(node, key)) node[key] = {};
+        node = node[key];
+    }
+    node[ps[i]] = value;
+    return value;
+};
+
+Traverse.prototype.map = function (cb) {
+    return walk(this.value, cb, true);
+};
+
+Traverse.prototype.forEach = function (cb) {
+    this.value = walk(this.value, cb, false);
+    return this.value;
+};
+
+Traverse.prototype.reduce = function (cb, init) {
+    var skip = arguments.length === 1;
+    var acc = skip ? this.value : init;
+    this.forEach(function (x) {
+        if (!this.isRoot || !skip) {
+            acc = cb.call(this, acc, x);
+        }
+    });
+    return acc;
+};
+
+Traverse.prototype.deepEqual = function (obj) {
+    if (arguments.length !== 1) {
+        throw new Error(
+            'deepEqual requires exactly one object to compare against'
+        );
+    }
+    
+    var equal = true;
+    var node = obj;
+    
+    this.forEach(function (y) {
+        var notEqual = (function () {
+            equal = false;
+            //this.stop();
+            return undefined;
+        }).bind(this);
+        
+        //if (node === undefined || node === null) return notEqual();
+        
+        if (!this.isRoot) {
+        /*
+            if (!Object.hasOwnProperty.call(node, this.key)) {
+                return notEqual();
+            }
+        */
+            if (typeof node !== 'object') return notEqual();
+            node = node[this.key];
+        }
+        
+        var x = node;
+        
+        this.post(function () {
+            node = x;
+        });
+        
+        var toS = function (o) {
+            return Object.prototype.toString.call(o);
+        };
+        
+        if (this.circular) {
+            if (Traverse(obj).get(this.circular.path) !== x) notEqual();
+        }
+        else if (typeof x !== typeof y) {
+            notEqual();
+        }
+        else if (x === null || y === null || x === undefined || y === undefined) {
+            if (x !== y) notEqual();
+        }
+        else if (x.__proto__ !== y.__proto__) {
+            notEqual();
+        }
+        else if (x === y) {
+            // nop
+        }
+        else if (typeof x === 'function') {
+            if (x instanceof RegExp) {
+                // both regexps on account of the __proto__ check
+                if (x.toString() != y.toString()) notEqual();
+            }
+            else if (x !== y) notEqual();
+        }
+        else if (typeof x === 'object') {
+            if (toS(y) === '[object Arguments]'
+            || toS(x) === '[object Arguments]') {
+                if (toS(x) !== toS(y)) {
+                    notEqual();
+                }
+            }
+            else if (x instanceof Date || y instanceof Date) {
+                if (!(x instanceof Date) || !(y instanceof Date)
+                || x.getTime() !== y.getTime()) {
+                    notEqual();
+                }
+            }
+            else {
+                var kx = Object.keys(x);
+                var ky = Object.keys(y);
+                if (kx.length !== ky.length) return notEqual();
+                for (var i = 0; i < kx.length; i++) {
+                    var k = kx[i];
+                    if (!Object.hasOwnProperty.call(y, k)) {
+                        notEqual();
+                    }
+                }
+            }
+        }
+    });
+    
+    return equal;
+};
+
+Traverse.prototype.paths = function () {
+    var acc = [];
+    this.forEach(function (x) {
+        acc.push(this.path); 
+    });
+    return acc;
+};
+
+Traverse.prototype.nodes = function () {
+    var acc = [];
+    this.forEach(function (x) {
+        acc.push(this.node);
+    });
+    return acc;
+};
+
+Traverse.prototype.clone = function () {
+    var parents = [], nodes = [];
+    
+    return (function clone (src) {
+        for (var i = 0; i < parents.length; i++) {
+            if (parents[i] === src) {
+                return nodes[i];
+            }
+        }
+        
+        if (typeof src === 'object' && src !== null) {
+            var dst = copy(src);
+            
+            parents.push(src);
+            nodes.push(dst);
+            
+            Object.keys(src).forEach(function (key) {
+                dst[key] = clone(src[key]);
+            });
+            
+            parents.pop();
+            nodes.pop();
+            return dst;
+        }
+        else {
+            return src;
+        }
+    })(this.value);
+};
+
+function walk (root, cb, immutable) {
+    var path = [];
+    var parents = [];
+    var alive = true;
+    
+    return (function walker (node_) {
+        var node = immutable ? copy(node_) : node_;
+        var modifiers = {};
+        
+        var state = {
+            node : node,
+            node_ : node_,
+            path : [].concat(path),
+            parent : parents.slice(-1)[0],
+            key : path.slice(-1)[0],
+            isRoot : path.length === 0,
+            level : path.length,
+            circular : null,
+            update : function (x) {
+                if (!state.isRoot) {
+                    state.parent.node[state.key] = x;
+                }
+                state.node = x;
+            },
+            'delete' : function () {
+                delete state.parent.node[state.key];
+            },
+            remove : function () {
+                if (Array.isArray(state.parent.node)) {
+                    state.parent.node.splice(state.key, 1);
+                }
+                else {
+                    delete state.parent.node[state.key];
+                }
+            },
+            before : function (f) { modifiers.before = f },
+            after : function (f) { modifiers.after = f },
+            pre : function (f) { modifiers.pre = f },
+            post : function (f) { modifiers.post = f },
+            stop : function () { alive = false }
+        };
+        
+        if (!alive) return state;
+        
+        if (typeof node === 'object' && node !== null) {
+            state.isLeaf = Object.keys(node).length == 0;
+            
+            for (var i = 0; i < parents.length; i++) {
+                if (parents[i].node_ === node_) {
+                    state.circular = parents[i];
+                    break;
+                }
+            }
+        }
+        else {
+            state.isLeaf = true;
+        }
+        
+        state.notLeaf = !state.isLeaf;
+        state.notRoot = !state.isRoot;
+        
+        // use return values to update if defined
+        var ret = cb.call(state, state.node);
+        if (ret !== undefined && state.update) state.update(ret);
+        if (modifiers.before) modifiers.before.call(state, state.node);
+        
+        if (typeof state.node == 'object'
+        && state.node !== null && !state.circular) {
+            parents.push(state);
+            
+            var keys = Object.keys(state.node);
+            keys.forEach(function (key, i) {
+                path.push(key);
+                
+                if (modifiers.pre) modifiers.pre.call(state, state.node[key], key);
+                
+                var child = walker(state.node[key]);
+                if (immutable && Object.hasOwnProperty.call(state.node, key)) {
+                    state.node[key] = child.node;
+                }
+                
+                child.isLast = i == keys.length - 1;
+                child.isFirst = i == 0;
+                
+                if (modifiers.post) modifiers.post.call(state, child);
+                
+                path.pop();
+            });
+            parents.pop();
+        }
+        
+        if (modifiers.after) modifiers.after.call(state, state.node);
+        
+        return state;
+    })(root).node;
+}
+
+Object.keys(Traverse.prototype).forEach(function (key) {
+    Traverse[key] = function (obj) {
+        var args = [].slice.call(arguments, 1);
+        var t = Traverse(obj);
+        return t[key].apply(t, args);
+    };
+});
+
+function copy (src) {
+    if (typeof src === 'object' && src !== null) {
+        var dst;
+        
+        if (Array.isArray(src)) {
+            dst = [];
+        }
+        else if (src instanceof Date) {
+            dst = new Date(src);
+        }
+        else if (src instanceof Boolean) {
+            dst = new Boolean(src);
+        }
+        else if (src instanceof Number) {
+            dst = new Number(src);
+        }
+        else if (src instanceof String) {
+            dst = new String(src);
+        }
+        else {
+            dst = Object.create(Object.getPrototypeOf(src));
+        }
+        
+        Object.keys(src).forEach(function (key) {
+            dst[key] = src[key];
+        });
+        return dst;
+    }
+    else return src;
+}
diff --git a/wrt/node_modules/traverse/package.json b/wrt/node_modules/traverse/package.json
new file mode 100644 (file)
index 0000000..80eef41
--- /dev/null
@@ -0,0 +1,75 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "traverse@>=0.3.0 <0.4",
+        "scope": null,
+        "escapedName": "traverse",
+        "name": "traverse",
+        "rawSpec": ">=0.3.0 <0.4",
+        "spec": ">=0.3.0 <0.4.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/chainsaw"
+    ]
+  ],
+  "_defaultsLoaded": true,
+  "_engineSupported": true,
+  "_from": "traverse@>=0.3.0 <0.4.0",
+  "_id": "traverse@0.3.9",
+  "_inCache": true,
+  "_location": "/traverse",
+  "_nodeVersion": "v0.5.0-pre",
+  "_npmVersion": "1.0.10",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "traverse@>=0.3.0 <0.4",
+    "scope": null,
+    "escapedName": "traverse",
+    "name": "traverse",
+    "rawSpec": ">=0.3.0 <0.4",
+    "spec": ">=0.3.0 <0.4.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/chainsaw"
+  ],
+  "_resolved": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz",
+  "_shasum": "717b8f220cc0bb7b44e40514c22b2e8bbc70d8b9",
+  "_shrinkwrap": null,
+  "_spec": "traverse@>=0.3.0 <0.4",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/chainsaw",
+  "author": {
+    "name": "James Halliday"
+  },
+  "bugs": {
+    "url": "https://github.com/substack/js-traverse/issues"
+  },
+  "dependencies": {},
+  "description": "Traverse and transform objects by visiting every node on a recursive walk",
+  "devDependencies": {
+    "expresso": "0.7.x"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "717b8f220cc0bb7b44e40514c22b2e8bbc70d8b9",
+    "tarball": "https://registry.npmjs.org/traverse/-/traverse-0.3.9.tgz"
+  },
+  "engines": {
+    "node": "*"
+  },
+  "homepage": "https://github.com/substack/js-traverse#readme",
+  "license": "MIT/X11",
+  "main": "./index",
+  "name": "traverse",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/substack/js-traverse.git"
+  },
+  "scripts": {
+    "test": "expresso"
+  },
+  "version": "0.3.9"
+}
diff --git a/wrt/node_modules/traverse/test/circular.js b/wrt/node_modules/traverse/test/circular.js
new file mode 100644 (file)
index 0000000..e1eef3f
--- /dev/null
@@ -0,0 +1,114 @@
+var assert = require('assert');
+var Traverse = require('traverse');
+var util = require('util');
+
+exports.circular = function () {
+    var obj = { x : 3 };
+    obj.y = obj;
+    var foundY = false;
+    Traverse(obj).forEach(function (x) {
+        if (this.path.join('') == 'y') {
+            assert.equal(
+                util.inspect(this.circular.node),
+                util.inspect(obj)
+            );
+            foundY = true;
+        }
+    });
+    assert.ok(foundY);
+};
+
+exports.deepCirc = function () {
+    var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] };
+    obj.y[2] = obj;
+    
+    var times = 0;
+    Traverse(obj).forEach(function (x) {
+        if (this.circular) {
+            assert.deepEqual(this.circular.path, []);
+            assert.deepEqual(this.path, [ 'y', 2 ]);
+            times ++;
+        }
+    });
+    
+    assert.deepEqual(times, 1);
+};
+
+exports.doubleCirc = function () {
+    var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] };
+    obj.y[2] = obj;
+    obj.x.push(obj.y);
+    
+    var circs = [];
+    Traverse(obj).forEach(function (x) {
+        if (this.circular) {
+            circs.push({ circ : this.circular, self : this, node : x });
+        }
+    });
+    
+    assert.deepEqual(circs[0].self.path, [ 'x', 3, 2 ]);
+    assert.deepEqual(circs[0].circ.path, []);
+     
+    assert.deepEqual(circs[1].self.path, [ 'y', 2 ]);
+    assert.deepEqual(circs[1].circ.path, []);
+    
+    assert.deepEqual(circs.length, 2);
+};
+
+exports.circDubForEach = function () {
+    var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] };
+    obj.y[2] = obj;
+    obj.x.push(obj.y);
+    
+    Traverse(obj).forEach(function (x) {
+        if (this.circular) this.update('...');
+    });
+    
+    assert.deepEqual(obj, { x : [ 1, 2, 3, [ 4, 5, '...' ] ], y : [ 4, 5, '...' ] });
+};
+
+exports.circDubMap = function () {
+    var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] };
+    obj.y[2] = obj;
+    obj.x.push(obj.y);
+    
+    var c = Traverse(obj).map(function (x) {
+        if (this.circular) {
+            this.update('...');
+        }
+    });
+    
+    assert.deepEqual(c, { x : [ 1, 2, 3, [ 4, 5, '...' ] ], y : [ 4, 5, '...' ] });
+};
+
+exports.circClone = function () {
+    var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] };
+    obj.y[2] = obj;
+    obj.x.push(obj.y);
+    
+    var clone = Traverse.clone(obj);
+    assert.ok(obj !== clone);
+    
+    assert.ok(clone.y[2] === clone);
+    assert.ok(clone.y[2] !== obj);
+    assert.ok(clone.x[3][2] === clone);
+    assert.ok(clone.x[3][2] !== obj);
+    assert.deepEqual(clone.x.slice(0,3), [1,2,3]);
+    assert.deepEqual(clone.y.slice(0,2), [4,5]);
+};
+
+exports.circMapScrub = function () {
+    var obj = { a : 1, b : 2 };
+    obj.c = obj;
+    
+    var scrubbed = Traverse(obj).map(function (node) {
+        if (this.circular) this.remove();
+    });
+    assert.deepEqual(
+        Object.keys(scrubbed).sort(),
+        [ 'a', 'b' ]
+    );
+    assert.ok(Traverse.deepEqual(scrubbed, { a : 1, b : 2 }));
+    
+    assert.equal(obj.c, obj);
+};
diff --git a/wrt/node_modules/traverse/test/date.js b/wrt/node_modules/traverse/test/date.js
new file mode 100644 (file)
index 0000000..2cb8252
--- /dev/null
@@ -0,0 +1,35 @@
+var assert = require('assert');
+var Traverse = require('traverse');
+
+exports.dateEach = function () {
+    var obj = { x : new Date, y : 10, z : 5 };
+    
+    var counts = {};
+    
+    Traverse(obj).forEach(function (node) {
+        var t = (node instanceof Date && 'Date') || typeof node;
+        counts[t] = (counts[t] || 0) + 1;
+    });
+    
+    assert.deepEqual(counts, {
+        object : 1,
+        Date : 1,
+        number : 2,
+    });
+};
+
+exports.dateMap = function () {
+    var obj = { x : new Date, y : 10, z : 5 };
+    
+    var res = Traverse(obj).map(function (node) {
+        if (typeof node === 'number') this.update(node + 100);
+    });
+    
+    assert.ok(obj.x !== res.x);
+    assert.deepEqual(res, {
+        x : obj.x,
+        y : 110,
+        z : 105,
+    });
+};
+
diff --git a/wrt/node_modules/traverse/test/equal.js b/wrt/node_modules/traverse/test/equal.js
new file mode 100644 (file)
index 0000000..4d732fa
--- /dev/null
@@ -0,0 +1,219 @@
+var assert = require('assert');
+var traverse = require('traverse');
+
+exports.deepDates = function () {
+    assert.ok(
+        traverse.deepEqual(
+            { d : new Date, x : [ 1, 2, 3 ] },
+            { d : new Date, x : [ 1, 2, 3 ] }
+        ),
+        'dates should be equal'
+    );
+    
+    var d0 = new Date;
+    setTimeout(function () {
+        assert.ok(
+            !traverse.deepEqual(
+                { d : d0, x : [ 1, 2, 3 ], },
+                { d : new Date, x : [ 1, 2, 3 ] }
+            ),
+            'microseconds should count in date equality'
+        );
+    }, 5);
+};
+
+exports.deepCircular = function () {
+    var a = [1];
+    a.push(a); // a = [ 1, *a ]
+    
+    var b = [1];
+    b.push(a); // b = [ 1, [ 1, *a ] ]
+    
+    assert.ok(
+        !traverse.deepEqual(a, b),
+        'circular ref mount points count towards equality'
+    );
+    
+    var c = [1];
+    c.push(c); // c = [ 1, *c ]
+    assert.ok(
+        traverse.deepEqual(a, c),
+        'circular refs are structurally the same here'
+    );
+    
+    var d = [1];
+    d.push(a); // c = [ 1, [ 1, *d ] ]
+    assert.ok(
+        traverse.deepEqual(b, d),
+        'non-root circular ref structural comparison'
+    );
+};
+
+exports.deepInstances = function () {
+    assert.ok(
+        !traverse.deepEqual([ new Boolean(false) ], [ false ]),
+        'boolean instances are not real booleans'
+    );
+    
+    assert.ok(
+        !traverse.deepEqual([ new String('x') ], [ 'x' ]),
+        'string instances are not real strings'
+    );
+    
+    assert.ok(
+        !traverse.deepEqual([ new Number(4) ], [ 4 ]),
+        'number instances are not real numbers'
+    );
+    
+    assert.ok(
+        traverse.deepEqual([ new RegExp('x') ], [ /x/ ]),
+        'regexp instances are real regexps'
+    );
+    
+    assert.ok(
+        !traverse.deepEqual([ new RegExp(/./) ], [ /../ ]),
+        'these regexps aren\'t the same'
+    );
+    
+    assert.ok(
+        !traverse.deepEqual(
+            [ function (x) { return x * 2 } ],
+            [ function (x) { return x * 2 } ]
+        ),
+        'functions with the same .toString() aren\'t necessarily the same'
+    );
+    
+    var f = function (x) { return x * 2 };
+    assert.ok(
+        traverse.deepEqual([ f ], [ f ]),
+        'these functions are actually equal'
+    );
+};
+
+exports.deepEqual = function () {
+    assert.ok(
+        !traverse.deepEqual([ 1, 2, 3 ], { 0 : 1, 1 : 2, 2 : 3 }),
+        'arrays are not objects'
+    );
+};
+
+exports.falsy = function () {
+    assert.ok(
+        !traverse.deepEqual([ undefined ], [ null ]),
+        'null is not undefined!'
+    );
+    
+    assert.ok(
+        !traverse.deepEqual([ null ], [ undefined ]),
+        'undefined is not null!'
+    );
+    
+    assert.ok(
+        !traverse.deepEqual(
+            { a : 1, b : 2, c : [ 3, undefined, 5 ] },
+            { a : 1, b : 2, c : [ 3, null, 5 ] }
+        ),
+        'undefined is not null, however deeply!'
+    );
+    
+    assert.ok(
+        !traverse.deepEqual(
+            { a : 1, b : 2, c : [ 3, undefined, 5 ] },
+            { a : 1, b : 2, c : [ 3, null, 5 ] }
+        ),
+        'null is not undefined, however deeply!'
+    );
+    
+    assert.ok(
+        !traverse.deepEqual(
+            { a : 1, b : 2, c : [ 3, undefined, 5 ] },
+            { a : 1, b : 2, c : [ 3, null, 5 ] }
+        ),
+        'null is not undefined, however deeply!'
+    );
+};
+
+exports.deletedArrayEqual = function () {
+    var xs = [ 1, 2, 3, 4 ];
+    delete xs[2];
+    
+    var ys = Object.create(Array.prototype);
+    ys[0] = 1;
+    ys[1] = 2;
+    ys[3] = 4;
+    
+    assert.ok(
+        traverse.deepEqual(xs, ys),
+        'arrays with deleted elements are only equal to'
+        + ' arrays with similarly deleted elements'
+    );
+    
+    assert.ok(
+        !traverse.deepEqual(xs, [ 1, 2, undefined, 4 ]),
+        'deleted array elements cannot be undefined'
+    );
+    
+    assert.ok(
+        !traverse.deepEqual(xs, [ 1, 2, null, 4 ]),
+        'deleted array elements cannot be null'
+    );
+};
+
+exports.deletedObjectEqual = function () {
+    var obj = { a : 1, b : 2, c : 3 };
+    delete obj.c;
+    
+    assert.ok(
+        traverse.deepEqual(obj, { a : 1, b : 2 }),
+        'deleted object elements should not show up'
+    );
+    
+    assert.ok(
+        !traverse.deepEqual(obj, { a : 1, b : 2, c : undefined }),
+        'deleted object elements are not undefined'
+    );
+    
+    assert.ok(
+        !traverse.deepEqual(obj, { a : 1, b : 2, c : null }),
+        'deleted object elements are not null'
+    );
+};
+
+exports.emptyKeyEqual = function () {
+    assert.ok(!traverse.deepEqual(
+        { a : 1 }, { a : 1, '' : 55 }
+    ));
+};
+
+exports.deepArguments = function () {
+    assert.ok(
+        !traverse.deepEqual(
+            [ 4, 5, 6 ],
+            (function () { return arguments })(4, 5, 6)
+        ),
+        'arguments are not arrays'
+    );
+    
+    assert.ok(
+        traverse.deepEqual(
+            (function () { return arguments })(4, 5, 6),
+            (function () { return arguments })(4, 5, 6)
+        ),
+        'arguments should equal'
+    );
+};
+
+exports.deepUn = function () {
+    assert.ok(!traverse.deepEqual({ a : 1, b : 2 }, undefined));
+    assert.ok(!traverse.deepEqual({ a : 1, b : 2 }, {}));
+    assert.ok(!traverse.deepEqual(undefined, { a : 1, b : 2 }));
+    assert.ok(!traverse.deepEqual({}, { a : 1, b : 2 }));
+    assert.ok(traverse.deepEqual(undefined, undefined));
+    assert.ok(traverse.deepEqual(null, null));
+    assert.ok(!traverse.deepEqual(undefined, null));
+};
+
+exports.deepLevels = function () {
+    var xs = [ 1, 2, [ 3, 4, [ 5, 6 ] ] ];
+    assert.ok(!traverse.deepEqual(xs, []));
+};
diff --git a/wrt/node_modules/traverse/test/instance.js b/wrt/node_modules/traverse/test/instance.js
new file mode 100644 (file)
index 0000000..501981f
--- /dev/null
@@ -0,0 +1,17 @@
+var assert = require('assert');
+var Traverse = require('traverse');
+var EventEmitter = require('events').EventEmitter;
+
+exports['check instanceof on node elems'] = function () {
+    
+    var counts = { emitter : 0 };
+    
+    Traverse([ new EventEmitter, 3, 4, { ev : new EventEmitter }])
+        .forEach(function (node) {
+            if (node instanceof EventEmitter) counts.emitter ++;
+        })
+    ;
+    
+    assert.equal(counts.emitter, 2);
+};
+
diff --git a/wrt/node_modules/traverse/test/interface.js b/wrt/node_modules/traverse/test/interface.js
new file mode 100644 (file)
index 0000000..df5b037
--- /dev/null
@@ -0,0 +1,42 @@
+var assert = require('assert');
+var Traverse = require('traverse');
+
+exports['interface map'] = function () {
+    var obj = { a : [ 5,6,7 ], b : { c : [8] } };
+    
+    assert.deepEqual(
+        Traverse.paths(obj)
+            .sort()
+            .map(function (path) { return path.join('/') })
+            .slice(1)
+            .join(' ')
+         ,
+         'a a/0 a/1 a/2 b b/c b/c/0'
+    );
+    
+    assert.deepEqual(
+        Traverse.nodes(obj),
+        [
+            { a: [ 5, 6, 7 ], b: { c: [ 8 ] } },
+            [ 5, 6, 7 ], 5, 6, 7,
+            { c: [ 8 ] }, [ 8 ], 8
+        ]
+    );
+    
+    assert.deepEqual(
+        Traverse.map(obj, function (node) {
+            if (typeof node == 'number') {
+                return node + 1000;
+            }
+            else if (Array.isArray(node)) {
+                return node.join(' ');
+            }
+        }),
+        { a: '5 6 7', b: { c: '8' } }
+    );
+    
+    var nodes = 0;
+    Traverse.forEach(obj, function (node) { nodes ++ });
+    assert.deepEqual(nodes, 8);
+};
+
diff --git a/wrt/node_modules/traverse/test/json.js b/wrt/node_modules/traverse/test/json.js
new file mode 100644 (file)
index 0000000..bf36620
--- /dev/null
@@ -0,0 +1,47 @@
+var assert = require('assert');
+var Traverse = require('traverse');
+
+exports['json test'] = function () {
+    var id = 54;
+    var callbacks = {};
+    var obj = { moo : function () {}, foo : [2,3,4, function () {}] };
+    
+    var scrubbed = Traverse(obj).map(function (x) {
+        if (typeof x === 'function') {
+            callbacks[id] = { id : id, f : x, path : this.path };
+            this.update('[Function]');
+            id++;
+        }
+    });
+    
+    assert.equal(
+        scrubbed.moo, '[Function]',
+        'obj.moo replaced with "[Function]"'
+    );
+    
+    assert.equal(
+        scrubbed.foo[3], '[Function]',
+        'obj.foo[3] replaced with "[Function]"'
+    );
+    
+    assert.deepEqual(scrubbed, {
+        moo : '[Function]',
+        foo : [ 2, 3, 4, "[Function]" ]
+    }, 'Full JSON string matches');
+    
+    assert.deepEqual(
+        typeof obj.moo, 'function',
+        'Original obj.moo still a function'
+    );
+    
+    assert.deepEqual(
+        typeof obj.foo[3], 'function',
+        'Original obj.foo[3] still a function'
+    );
+    
+    assert.deepEqual(callbacks, {
+        54: { id: 54, f : obj.moo, path: [ 'moo' ] },
+        55: { id: 55, f : obj.foo[3], path: [ 'foo', '3' ] },
+    }, 'Check the generated callbacks list');
+};
+
diff --git a/wrt/node_modules/traverse/test/leaves.js b/wrt/node_modules/traverse/test/leaves.js
new file mode 100644 (file)
index 0000000..4e8d280
--- /dev/null
@@ -0,0 +1,21 @@
+var assert = require('assert');
+var Traverse = require('traverse');
+
+exports['leaves test'] = function () {
+    var acc = [];
+    Traverse({
+        a : [1,2,3],
+        b : 4,
+        c : [5,6],
+        d : { e : [7,8], f : 9 }
+    }).forEach(function (x) {
+        if (this.isLeaf) acc.push(x);
+    });
+    
+    assert.equal(
+        acc.join(' '),
+        '1 2 3 4 5 6 7 8 9',
+        'Traversal in the right(?) order'
+    );
+};
+
diff --git a/wrt/node_modules/traverse/test/mutability.js b/wrt/node_modules/traverse/test/mutability.js
new file mode 100644 (file)
index 0000000..5a4d6dd
--- /dev/null
@@ -0,0 +1,203 @@
+var assert = require('assert');
+var Traverse = require('traverse');
+
+exports.mutate = function () {
+    var obj = { a : 1, b : 2, c : [ 3, 4 ] };
+    var res = Traverse(obj).forEach(function (x) {
+        if (typeof x === 'number' && x % 2 === 0) {
+            this.update(x * 10);
+        }
+    });
+    assert.deepEqual(obj, res);
+    assert.deepEqual(obj, { a : 1, b : 20, c : [ 3, 40 ] });
+};
+
+exports.mutateT = function () {
+    var obj = { a : 1, b : 2, c : [ 3, 4 ] };
+    var res = Traverse.forEach(obj, function (x) {
+        if (typeof x === 'number' && x % 2 === 0) {
+            this.update(x * 10);
+        }
+    });
+    assert.deepEqual(obj, res);
+    assert.deepEqual(obj, { a : 1, b : 20, c : [ 3, 40 ] });
+};
+
+exports.map = function () {
+    var obj = { a : 1, b : 2, c : [ 3, 4 ] };
+    var res = Traverse(obj).map(function (x) {
+        if (typeof x === 'number' && x % 2 === 0) {
+            this.update(x * 10);
+        }
+    });
+    assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] });
+    assert.deepEqual(res, { a : 1, b : 20, c : [ 3, 40 ] });
+};
+
+exports.mapT = function () {
+    var obj = { a : 1, b : 2, c : [ 3, 4 ] };
+    var res = Traverse.map(obj, function (x) {
+        if (typeof x === 'number' && x % 2 === 0) {
+            this.update(x * 10);
+        }
+    });
+    assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] });
+    assert.deepEqual(res, { a : 1, b : 20, c : [ 3, 40 ] });
+};
+
+exports.clone = function () {
+    var obj = { a : 1, b : 2, c : [ 3, 4 ] };
+    var res = Traverse(obj).clone();
+    assert.deepEqual(obj, res);
+    assert.ok(obj !== res);
+    obj.a ++;
+    assert.deepEqual(res.a, 1);
+    obj.c.push(5);
+    assert.deepEqual(res.c, [ 3, 4 ]);
+};
+
+exports.cloneT = function () {
+    var obj = { a : 1, b : 2, c : [ 3, 4 ] };
+    var res = Traverse.clone(obj);
+    assert.deepEqual(obj, res);
+    assert.ok(obj !== res);
+    obj.a ++;
+    assert.deepEqual(res.a, 1);
+    obj.c.push(5);
+    assert.deepEqual(res.c, [ 3, 4 ]);
+};
+
+exports.reduce = function () {
+    var obj = { a : 1, b : 2, c : [ 3, 4 ] };
+    var res = Traverse(obj).reduce(function (acc, x) {
+        if (this.isLeaf) acc.push(x);
+        return acc;
+    }, []);
+    assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] });
+    assert.deepEqual(res, [ 1, 2, 3, 4 ]);
+};
+
+exports.reduceInit = function () {
+    var obj = { a : 1, b : 2, c : [ 3, 4 ] };
+    var res = Traverse(obj).reduce(function (acc, x) {
+        if (this.isRoot) assert.fail('got root');
+        return acc;
+    });
+    assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] });
+    assert.deepEqual(res, obj);
+};
+
+exports.remove = function () {
+    var obj = { a : 1, b : 2, c : [ 3, 4 ] };
+    Traverse(obj).forEach(function (x) {
+        if (this.isLeaf && x % 2 == 0) this.remove();
+    });
+    
+    assert.deepEqual(obj, { a : 1, c : [ 3 ] });
+};
+
+exports.removeMap = function () {
+    var obj = { a : 1, b : 2, c : [ 3, 4 ] };
+    var res = Traverse(obj).map(function (x) {
+        if (this.isLeaf && x % 2 == 0) this.remove();
+    });
+    
+    assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] });
+    assert.deepEqual(res, { a : 1, c : [ 3 ] });
+};
+
+exports.delete = function () {
+    var obj = { a : 1, b : 2, c : [ 3, 4 ] };
+    Traverse(obj).forEach(function (x) {
+        if (this.isLeaf && x % 2 == 0) this.delete();
+    });
+    
+    assert.ok(!Traverse.deepEqual(
+        obj, { a : 1, c : [ 3, undefined ] }
+    ));
+    
+    assert.ok(Traverse.deepEqual(
+        obj, { a : 1, c : [ 3 ] }
+    ));
+    
+    assert.ok(!Traverse.deepEqual(
+        obj, { a : 1, c : [ 3, null ] }
+    ));
+};
+
+exports.deleteRedux = function () {
+    var obj = { a : 1, b : 2, c : [ 3, 4, 5 ] };
+    Traverse(obj).forEach(function (x) {
+        if (this.isLeaf && x % 2 == 0) this.delete();
+    });
+    
+    assert.ok(!Traverse.deepEqual(
+        obj, { a : 1, c : [ 3, undefined, 5 ] }
+    ));
+    
+    assert.ok(Traverse.deepEqual(
+        obj, { a : 1, c : [ 3 ,, 5 ] }
+    ));
+    
+    assert.ok(!Traverse.deepEqual(
+        obj, { a : 1, c : [ 3, null, 5 ] }
+    ));
+    
+    assert.ok(!Traverse.deepEqual(
+        obj, { a : 1, c : [ 3, 5 ] }
+    ));
+};
+
+exports.deleteMap = function () {
+    var obj = { a : 1, b : 2, c : [ 3, 4 ] };
+    var res = Traverse(obj).map(function (x) {
+        if (this.isLeaf && x % 2 == 0) this.delete();
+    });
+    
+    assert.ok(Traverse.deepEqual(
+        obj,
+        { a : 1, b : 2, c : [ 3, 4 ] }
+    ));
+    
+    var xs = [ 3, 4 ];
+    delete xs[1];
+    
+    assert.ok(Traverse.deepEqual(
+        res, { a : 1, c : xs }
+    ));
+    
+    assert.ok(Traverse.deepEqual(
+        res, { a : 1, c : [ 3, ] }
+    ));
+    
+    assert.ok(Traverse.deepEqual(
+        res, { a : 1, c : [ 3 ] }
+    ));
+};
+
+exports.deleteMapRedux = function () {
+    var obj = { a : 1, b : 2, c : [ 3, 4, 5 ] };
+    var res = Traverse(obj).map(function (x) {
+        if (this.isLeaf && x % 2 == 0) this.delete();
+    });
+    
+    assert.ok(Traverse.deepEqual(
+        obj,
+        { a : 1, b : 2, c : [ 3, 4, 5 ] }
+    ));
+    
+    var xs = [ 3, 4, 5 ];
+    delete xs[1];
+    
+    assert.ok(Traverse.deepEqual(
+        res, { a : 1, c : xs }
+    ));
+    
+    assert.ok(!Traverse.deepEqual(
+        res, { a : 1, c : [ 3, 5 ] }
+    ));
+    
+    assert.ok(Traverse.deepEqual(
+        res, { a : 1, c : [ 3 ,, 5 ] }
+    ));
+};
diff --git a/wrt/node_modules/traverse/test/negative.js b/wrt/node_modules/traverse/test/negative.js
new file mode 100644 (file)
index 0000000..6cf287d
--- /dev/null
@@ -0,0 +1,20 @@
+var Traverse = require('traverse');
+var assert = require('assert');
+
+exports['negative update test'] = function () {
+    var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ];
+    var fixed = Traverse.map(obj, function (x) {
+        if (x < 0) this.update(x + 128);
+    });
+    
+    assert.deepEqual(fixed,
+        [ 5, 6, 125, [ 7, 8, 126, 1 ], { f: 10, g: 115 } ],
+        'Negative values += 128'
+    );
+    
+    assert.deepEqual(obj,
+        [ 5, 6, -3, [ 7, 8, -2, 1 ], { f: 10, g: -13 } ],
+        'Original references not modified'
+    );
+}
+
diff --git a/wrt/node_modules/traverse/test/obj.js b/wrt/node_modules/traverse/test/obj.js
new file mode 100644 (file)
index 0000000..9c3b0db
--- /dev/null
@@ -0,0 +1,15 @@
+var assert = require('assert');
+var Traverse = require('traverse');
+
+exports['traverse an object with nested functions'] = function () {
+    var to = setTimeout(function () {
+        assert.fail('never ran');
+    }, 1000);
+    
+    function Cons (x) {
+        clearTimeout(to);
+        assert.equal(x, 10);
+    };
+    Traverse(new Cons(10));
+};
+
diff --git a/wrt/node_modules/traverse/test/stop.js b/wrt/node_modules/traverse/test/stop.js
new file mode 100644 (file)
index 0000000..ef6b36e
--- /dev/null
@@ -0,0 +1,41 @@
+var assert = require('assert');
+var traverse = require('traverse');
+
+exports.stop = function () {
+    var visits = 0;
+    traverse('abcdefghij'.split('')).forEach(function (node) {
+        if (typeof node === 'string') {
+            visits ++;
+            if (node === 'e') this.stop()
+        }
+    });
+    
+    assert.equal(visits, 5);
+};
+
+exports.stopMap = function () {
+    var s = traverse('abcdefghij'.split('')).map(function (node) {
+        if (typeof node === 'string') {
+            if (node === 'e') this.stop()
+            return node.toUpperCase();
+        }
+    }).join('');
+    
+    assert.equal(s, 'ABCDEfghij');
+};
+
+exports.stopReduce = function () {
+    var obj = {
+        a : [ 4, 5 ],
+        b : [ 6, [ 7, 8, 9 ] ]
+    };
+    var xs = traverse(obj).reduce(function (acc, node) {
+        if (this.isLeaf) {
+            if (node === 7) this.stop();
+            else acc.push(node)
+        }
+        return acc;
+    }, []);
+    
+    assert.deepEqual(xs, [ 4, 5, 6 ]);
+};
diff --git a/wrt/node_modules/traverse/test/stringify.js b/wrt/node_modules/traverse/test/stringify.js
new file mode 100644 (file)
index 0000000..bf36f63
--- /dev/null
@@ -0,0 +1,36 @@
+var assert = require('assert');
+var Traverse = require('traverse');
+
+exports.stringify = function () {
+    var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ];
+    
+    var s = '';
+    Traverse(obj).forEach(function (node) {
+        if (Array.isArray(node)) {
+            this.before(function () { s += '[' });
+            this.post(function (child) {
+                if (!child.isLast) s += ',';
+            });
+            this.after(function () { s += ']' });
+        }
+        else if (typeof node == 'object') {
+            this.before(function () { s += '{' });
+            this.pre(function (x, key) {
+                s += '"' + key + '"' + ':';
+            });
+            this.post(function (child) {
+                if (!child.isLast) s += ',';
+            });
+            this.after(function () { s += '}' });
+        }
+        else if (typeof node == 'function') {
+            s += 'null';
+        }
+        else {
+            s += node.toString();
+        }
+    });
+    
+    assert.equal(s, JSON.stringify(obj));
+}
+
diff --git a/wrt/node_modules/traverse/test/super_deep.js b/wrt/node_modules/traverse/test/super_deep.js
new file mode 100644 (file)
index 0000000..974181e
--- /dev/null
@@ -0,0 +1,54 @@
+var assert = require('assert');
+var traverse = require('traverse');
+
+exports.super_deep = function () {
+    var util = require('util');
+    var a0 = make();
+    var a1 = make();
+    assert.ok(traverse.deepEqual(a0, a1));
+    
+    a0.c.d.moo = true;
+    assert.ok(!traverse.deepEqual(a0, a1));
+    
+    a1.c.d.moo = true;
+    assert.ok(traverse.deepEqual(a0, a1));
+    
+    // TODO: this one
+    //a0.c.a = a1;
+    //assert.ok(!traverse.deepEqual(a0, a1));
+};
+
+function make () {
+    var a = { self : 'a' };
+    var b = { self : 'b' };
+    var c = { self : 'c' };
+    var d = { self : 'd' };
+    var e = { self : 'e' };
+    
+    a.a = a;
+    a.b = b;
+    a.c = c;
+    
+    b.a = a;
+    b.b = b;
+    b.c = c;
+    
+    c.a = a;
+    c.b = b;
+    c.c = c;
+    c.d = d;
+    
+    d.a = a;
+    d.b = b;
+    d.c = c;
+    d.d = d;
+    d.e = e;
+    
+    e.a = a;
+    e.b = b;
+    e.c = c;
+    e.d = d;
+    e.e = e;
+    
+    return a;
+}
diff --git a/wrt/node_modules/type-is/HISTORY.md b/wrt/node_modules/type-is/HISTORY.md
new file mode 100644 (file)
index 0000000..96bc93e
--- /dev/null
@@ -0,0 +1,218 @@
+1.6.15 / 2017-03-31
+===================
+
+  * deps: mime-types@~2.1.15
+    - Add new mime types
+
+1.6.14 / 2016-11-18
+===================
+
+  * deps: mime-types@~2.1.13
+    - Add new mime types
+
+1.6.13 / 2016-05-18
+===================
+
+  * deps: mime-types@~2.1.11
+    - Add new mime types
+
+1.6.12 / 2016-02-28
+===================
+
+  * deps: mime-types@~2.1.10
+    - Add new mime types
+    - Fix extension of `application/dash+xml`
+    - Update primary extension for `audio/mp4`
+
+1.6.11 / 2016-01-29
+===================
+
+  * deps: mime-types@~2.1.9
+    - Add new mime types
+
+1.6.10 / 2015-12-01
+===================
+
+  * deps: mime-types@~2.1.8
+    - Add new mime types
+
+1.6.9 / 2015-09-27
+==================
+
+  * deps: mime-types@~2.1.7
+    - Add new mime types
+
+1.6.8 / 2015-09-04
+==================
+
+  * deps: mime-types@~2.1.6
+    - Add new mime types
+
+1.6.7 / 2015-08-20
+==================
+
+  * Fix type error when given invalid type to match against
+  * deps: mime-types@~2.1.5
+    - Add new mime types
+
+1.6.6 / 2015-07-31
+==================
+
+  * deps: mime-types@~2.1.4
+    - Add new mime types
+
+1.6.5 / 2015-07-16
+==================
+
+  * deps: mime-types@~2.1.3
+    - Add new mime types
+
+1.6.4 / 2015-07-01
+==================
+
+  * deps: mime-types@~2.1.2
+    - Add new mime types
+  * perf: enable strict mode
+  * perf: remove argument reassignment
+
+1.6.3 / 2015-06-08
+==================
+
+  * deps: mime-types@~2.1.1
+    - Add new mime types
+  * perf: reduce try block size
+  * perf: remove bitwise operations
+
+1.6.2 / 2015-05-10
+==================
+
+  * deps: mime-types@~2.0.11
+    - Add new mime types
+
+1.6.1 / 2015-03-13
+==================
+
+  * deps: mime-types@~2.0.10
+    - Add new mime types
+
+1.6.0 / 2015-02-12
+==================
+
+  * fix false-positives in `hasBody` `Transfer-Encoding` check
+  * support wildcard for both type and subtype (`*/*`)
+
+1.5.7 / 2015-02-09
+==================
+
+  * fix argument reassignment
+  * deps: mime-types@~2.0.9
+    - Add new mime types
+
+1.5.6 / 2015-01-29
+==================
+
+  * deps: mime-types@~2.0.8
+    - Add new mime types
+
+1.5.5 / 2014-12-30
+==================
+
+  * deps: mime-types@~2.0.7
+    - Add new mime types
+    - Fix missing extensions
+    - Fix various invalid MIME type entries
+    - Remove example template MIME types
+    - deps: mime-db@~1.5.0
+
+1.5.4 / 2014-12-10
+==================
+
+  * deps: mime-types@~2.0.4
+    - Add new mime types
+    - deps: mime-db@~1.3.0
+
+1.5.3 / 2014-11-09
+==================
+
+  * deps: mime-types@~2.0.3
+    - Add new mime types
+    - deps: mime-db@~1.2.0
+
+1.5.2 / 2014-09-28
+==================
+
+  * deps: mime-types@~2.0.2
+    - Add new mime types
+    - deps: mime-db@~1.1.0
+
+1.5.1 / 2014-09-07
+==================
+
+  * Support Node.js 0.6
+  * deps: media-typer@0.3.0
+  * deps: mime-types@~2.0.1
+    - Support Node.js 0.6
+
+1.5.0 / 2014-09-05
+==================
+
+ * fix `hasbody` to be true for `content-length: 0`
+
+1.4.0 / 2014-09-02
+==================
+
+ * update mime-types
+
+1.3.2 / 2014-06-24
+==================
+
+ * use `~` range on mime-types
+
+1.3.1 / 2014-06-19
+==================
+
+ * fix global variable leak
+
+1.3.0 / 2014-06-19
+==================
+
+ * improve type parsing
+
+   - invalid media type never matches
+   - media type not case-sensitive
+   - extra LWS does not affect results
+
+1.2.2 / 2014-06-19
+==================
+
+ * fix behavior on unknown type argument
+
+1.2.1 / 2014-06-03
+==================
+
+ * switch dependency from `mime` to `mime-types@1.0.0`
+
+1.2.0 / 2014-05-11
+==================
+
+ * support suffix matching:
+
+   - `+json` matches `application/vnd+json`
+   - `*/vnd+json` matches `application/vnd+json`
+   - `application/*+json` matches `application/vnd+json`
+
+1.1.0 / 2014-04-12
+==================
+
+ * add non-array values support
+ * expose internal utilities:
+
+   - `.is()`
+   - `.hasBody()`
+   - `.normalize()`
+   - `.match()`
+
+1.0.1 / 2014-03-30
+==================
+
+ * add `multipart` as a shorthand
diff --git a/wrt/node_modules/type-is/LICENSE b/wrt/node_modules/type-is/LICENSE
new file mode 100644 (file)
index 0000000..386b7b6
--- /dev/null
@@ -0,0 +1,23 @@
+(The MIT License)
+
+Copyright (c) 2014 Jonathan Ong <me@jongleberry.com>
+Copyright (c) 2014-2015 Douglas Christopher Wilson <doug@somethingdoug.com>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/type-is/README.md b/wrt/node_modules/type-is/README.md
new file mode 100644 (file)
index 0000000..70c47da
--- /dev/null
@@ -0,0 +1,146 @@
+# type-is
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+Infer the content-type of a request.
+
+### Install
+
+This is a [Node.js](https://nodejs.org/en/) module available through the
+[npm registry](https://www.npmjs.com/). Installation is done using the
+[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
+
+```sh
+$ npm install type-is
+```
+
+## API
+
+```js
+var http = require('http')
+var typeis = require('type-is')
+
+http.createServer(function (req, res) {
+  var istext = typeis(req, ['text/*'])
+  res.end('you ' + (istext ? 'sent' : 'did not send') + ' me text')
+})
+```
+
+### type = typeis(request, types)
+
+`request` is the node HTTP request. `types` is an array of types.
+
+<!-- eslint-disable no-undef -->
+
+```js
+// req.headers.content-type = 'application/json'
+
+typeis(req, ['json'])             // 'json'
+typeis(req, ['html', 'json'])     // 'json'
+typeis(req, ['application/*'])    // 'application/json'
+typeis(req, ['application/json']) // 'application/json'
+
+typeis(req, ['html']) // false
+```
+
+### typeis.hasBody(request)
+
+Returns a Boolean if the given `request` has a body, regardless of the
+`Content-Type` header.
+
+Having a body has no relation to how large the body is (it may be 0 bytes).
+This is similar to how file existence works. If a body does exist, then this
+indicates that there is data to read from the Node.js request stream.
+
+<!-- eslint-disable no-undef -->
+
+```js
+if (typeis.hasBody(req)) {
+  // read the body, since there is one
+
+  req.on('data', function (chunk) {
+    // ...
+  })
+}
+```
+
+### type = typeis.is(mediaType, types)
+
+`mediaType` is the [media type](https://tools.ietf.org/html/rfc6838) string. `types` is an array of types.
+
+<!-- eslint-disable no-undef -->
+
+```js
+var mediaType = 'application/json'
+
+typeis.is(mediaType, ['json'])             // 'json'
+typeis.is(mediaType, ['html', 'json'])     // 'json'
+typeis.is(mediaType, ['application/*'])    // 'application/json'
+typeis.is(mediaType, ['application/json']) // 'application/json'
+
+typeis.is(mediaType, ['html']) // false
+```
+
+### Each type can be:
+
+- An extension name such as `json`. This name will be returned if matched.
+- A mime type such as `application/json`.
+- A mime type with a wildcard such as `*/*` or `*/json` or `application/*`. The full mime type will be returned if matched.
+- A suffix such as `+json`. This can be combined with a wildcard such as `*/vnd+json` or `application/*+json`. The full mime type will be returned if matched.
+
+`false` will be returned if no type matches or the content type is invalid.
+
+`null` will be returned if the request does not have a body.
+
+## Examples
+
+### Example body parser
+
+```js
+var express = require('express')
+var typeis = require('type-is')
+
+var app = express()
+
+app.use(function bodyParser (req, res, next) {
+  if (!typeis.hasBody(req)) {
+    return next()
+  }
+
+  switch (typeis(req, ['urlencoded', 'json', 'multipart'])) {
+    case 'urlencoded':
+      // parse urlencoded body
+      throw new Error('implement urlencoded body parsing')
+    case 'json':
+      // parse json body
+      throw new Error('implement json body parsing')
+    case 'multipart':
+      // parse multipart body
+      throw new Error('implement multipart body parsing')
+    default:
+      // 415 error code
+      res.statusCode = 415
+      res.end()
+      break
+  }
+})
+```
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/type-is.svg
+[npm-url]: https://npmjs.org/package/type-is
+[node-version-image]: https://img.shields.io/node/v/type-is.svg
+[node-version-url]: https://nodejs.org/en/download/
+[travis-image]: https://img.shields.io/travis/jshttp/type-is/master.svg
+[travis-url]: https://travis-ci.org/jshttp/type-is
+[coveralls-image]: https://img.shields.io/coveralls/jshttp/type-is/master.svg
+[coveralls-url]: https://coveralls.io/r/jshttp/type-is?branch=master
+[downloads-image]: https://img.shields.io/npm/dm/type-is.svg
+[downloads-url]: https://npmjs.org/package/type-is
diff --git a/wrt/node_modules/type-is/index.js b/wrt/node_modules/type-is/index.js
new file mode 100644 (file)
index 0000000..4da7301
--- /dev/null
@@ -0,0 +1,262 @@
+/*!
+ * type-is
+ * Copyright(c) 2014 Jonathan Ong
+ * Copyright(c) 2014-2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module dependencies.
+ * @private
+ */
+
+var typer = require('media-typer')
+var mime = require('mime-types')
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = typeofrequest
+module.exports.is = typeis
+module.exports.hasBody = hasbody
+module.exports.normalize = normalize
+module.exports.match = mimeMatch
+
+/**
+ * Compare a `value` content-type with `types`.
+ * Each `type` can be an extension like `html`,
+ * a special shortcut like `multipart` or `urlencoded`,
+ * or a mime type.
+ *
+ * If no types match, `false` is returned.
+ * Otherwise, the first `type` that matches is returned.
+ *
+ * @param {String} value
+ * @param {Array} types
+ * @public
+ */
+
+function typeis (value, types_) {
+  var i
+  var types = types_
+
+  // remove parameters and normalize
+  var val = tryNormalizeType(value)
+
+  // no type or invalid
+  if (!val) {
+    return false
+  }
+
+  // support flattened arguments
+  if (types && !Array.isArray(types)) {
+    types = new Array(arguments.length - 1)
+    for (i = 0; i < types.length; i++) {
+      types[i] = arguments[i + 1]
+    }
+  }
+
+  // no types, return the content type
+  if (!types || !types.length) {
+    return val
+  }
+
+  var type
+  for (i = 0; i < types.length; i++) {
+    if (mimeMatch(normalize(type = types[i]), val)) {
+      return type[0] === '+' || type.indexOf('*') !== -1
+        ? val
+        : type
+    }
+  }
+
+  // no matches
+  return false
+}
+
+/**
+ * Check if a request has a request body.
+ * A request with a body __must__ either have `transfer-encoding`
+ * or `content-length` headers set.
+ * http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.3
+ *
+ * @param {Object} request
+ * @return {Boolean}
+ * @public
+ */
+
+function hasbody (req) {
+  return req.headers['transfer-encoding'] !== undefined ||
+    !isNaN(req.headers['content-length'])
+}
+
+/**
+ * Check if the incoming request contains the "Content-Type"
+ * header field, and it contains any of the give mime `type`s.
+ * If there is no request body, `null` is returned.
+ * If there is no content type, `false` is returned.
+ * Otherwise, it returns the first `type` that matches.
+ *
+ * Examples:
+ *
+ *     // With Content-Type: text/html; charset=utf-8
+ *     this.is('html'); // => 'html'
+ *     this.is('text/html'); // => 'text/html'
+ *     this.is('text/*', 'application/json'); // => 'text/html'
+ *
+ *     // When Content-Type is application/json
+ *     this.is('json', 'urlencoded'); // => 'json'
+ *     this.is('application/json'); // => 'application/json'
+ *     this.is('html', 'application/*'); // => 'application/json'
+ *
+ *     this.is('html'); // => false
+ *
+ * @param {String|Array} types...
+ * @return {String|false|null}
+ * @public
+ */
+
+function typeofrequest (req, types_) {
+  var types = types_
+
+  // no body
+  if (!hasbody(req)) {
+    return null
+  }
+
+  // support flattened arguments
+  if (arguments.length > 2) {
+    types = new Array(arguments.length - 1)
+    for (var i = 0; i < types.length; i++) {
+      types[i] = arguments[i + 1]
+    }
+  }
+
+  // request content type
+  var value = req.headers['content-type']
+
+  return typeis(value, types)
+}
+
+/**
+ * Normalize a mime type.
+ * If it's a shorthand, expand it to a valid mime type.
+ *
+ * In general, you probably want:
+ *
+ *   var type = is(req, ['urlencoded', 'json', 'multipart']);
+ *
+ * Then use the appropriate body parsers.
+ * These three are the most common request body types
+ * and are thus ensured to work.
+ *
+ * @param {String} type
+ * @private
+ */
+
+function normalize (type) {
+  if (typeof type !== 'string') {
+    // invalid type
+    return false
+  }
+
+  switch (type) {
+    case 'urlencoded':
+      return 'application/x-www-form-urlencoded'
+    case 'multipart':
+      return 'multipart/*'
+  }
+
+  if (type[0] === '+') {
+    // "+json" -> "*/*+json" expando
+    return '*/*' + type
+  }
+
+  return type.indexOf('/') === -1
+    ? mime.lookup(type)
+    : type
+}
+
+/**
+ * Check if `expected` mime type
+ * matches `actual` mime type with
+ * wildcard and +suffix support.
+ *
+ * @param {String} expected
+ * @param {String} actual
+ * @return {Boolean}
+ * @private
+ */
+
+function mimeMatch (expected, actual) {
+  // invalid type
+  if (expected === false) {
+    return false
+  }
+
+  // split types
+  var actualParts = actual.split('/')
+  var expectedParts = expected.split('/')
+
+  // invalid format
+  if (actualParts.length !== 2 || expectedParts.length !== 2) {
+    return false
+  }
+
+  // validate type
+  if (expectedParts[0] !== '*' && expectedParts[0] !== actualParts[0]) {
+    return false
+  }
+
+  // validate suffix wildcard
+  if (expectedParts[1].substr(0, 2) === '*+') {
+    return expectedParts[1].length <= actualParts[1].length + 1 &&
+      expectedParts[1].substr(1) === actualParts[1].substr(1 - expectedParts[1].length)
+  }
+
+  // validate subtype
+  if (expectedParts[1] !== '*' && expectedParts[1] !== actualParts[1]) {
+    return false
+  }
+
+  return true
+}
+
+/**
+ * Normalize a type and remove parameters.
+ *
+ * @param {string} value
+ * @return {string}
+ * @private
+ */
+
+function normalizeType (value) {
+  // parse the type
+  var type = typer.parse(value)
+
+  // remove the parameters
+  type.parameters = undefined
+
+  // reformat it
+  return typer.format(type)
+}
+
+/**
+ * Try to normalize a type and remove parameters.
+ *
+ * @param {string} value
+ * @return {string}
+ * @private
+ */
+
+function tryNormalizeType (value) {
+  try {
+    return normalizeType(value)
+  } catch (err) {
+    return null
+  }
+}
diff --git a/wrt/node_modules/type-is/package.json b/wrt/node_modules/type-is/package.json
new file mode 100644 (file)
index 0000000..9f62f8d
--- /dev/null
@@ -0,0 +1,121 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "type-is@~1.6.15",
+        "scope": null,
+        "escapedName": "type-is",
+        "name": "type-is",
+        "rawSpec": "~1.6.15",
+        "spec": ">=1.6.15 <1.7.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express"
+    ]
+  ],
+  "_from": "type-is@>=1.6.15 <1.7.0",
+  "_id": "type-is@1.6.15",
+  "_inCache": true,
+  "_location": "/type-is",
+  "_nodeVersion": "4.7.3",
+  "_npmOperationalInternal": {
+    "host": "packages-18-east.internal.npmjs.com",
+    "tmp": "tmp/type-is-1.6.15.tgz_1491016789014_0.6958203655667603"
+  },
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "2.15.11",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "type-is@~1.6.15",
+    "scope": null,
+    "escapedName": "type-is",
+    "name": "type-is",
+    "rawSpec": "~1.6.15",
+    "spec": ">=1.6.15 <1.7.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/express"
+  ],
+  "_resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.15.tgz",
+  "_shasum": "cab10fb4909e441c82842eafe1ad646c81804410",
+  "_shrinkwrap": null,
+  "_spec": "type-is@~1.6.15",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express",
+  "bugs": {
+    "url": "https://github.com/jshttp/type-is/issues"
+  },
+  "contributors": [
+    {
+      "name": "Douglas Christopher Wilson",
+      "email": "doug@somethingdoug.com"
+    },
+    {
+      "name": "Jonathan Ong",
+      "email": "me@jongleberry.com",
+      "url": "http://jongleberry.com"
+    }
+  ],
+  "dependencies": {
+    "media-typer": "0.3.0",
+    "mime-types": "~2.1.15"
+  },
+  "description": "Infer the content-type of a request.",
+  "devDependencies": {
+    "eslint": "3.19.0",
+    "eslint-config-standard": "7.1.0",
+    "eslint-plugin-markdown": "1.0.0-beta.4",
+    "eslint-plugin-promise": "3.5.0",
+    "eslint-plugin-standard": "2.1.1",
+    "istanbul": "0.4.5",
+    "mocha": "1.21.5"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "cab10fb4909e441c82842eafe1ad646c81804410",
+    "tarball": "https://registry.npmjs.org/type-is/-/type-is-1.6.15.tgz"
+  },
+  "engines": {
+    "node": ">= 0.6"
+  },
+  "files": [
+    "LICENSE",
+    "HISTORY.md",
+    "index.js"
+  ],
+  "gitHead": "9e88be851cc628364ad8842433dce32437ea4e73",
+  "homepage": "https://github.com/jshttp/type-is#readme",
+  "keywords": [
+    "content",
+    "type",
+    "checking"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    },
+    {
+      "name": "jongleberry",
+      "email": "jonathanrichardong@gmail.com"
+    }
+  ],
+  "name": "type-is",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/jshttp/type-is.git"
+  },
+  "scripts": {
+    "lint": "eslint --plugin markdown --ext js,md .",
+    "test": "mocha --reporter spec --check-leaks --bail test/",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
+    "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
+  },
+  "version": "1.6.15"
+}
diff --git a/wrt/node_modules/ultron/LICENSE b/wrt/node_modules/ultron/LICENSE
new file mode 100644 (file)
index 0000000..6dc9316
--- /dev/null
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Unshift.io, Arnout Kazemier,  the Contributors.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/wrt/node_modules/ultron/index.js b/wrt/node_modules/ultron/index.js
new file mode 100644 (file)
index 0000000..9e0677a
--- /dev/null
@@ -0,0 +1,138 @@
+'use strict';
+
+var has = Object.prototype.hasOwnProperty;
+
+/**
+ * An auto incrementing id which we can use to create "unique" Ultron instances
+ * so we can track the event emitters that are added through the Ultron
+ * interface.
+ *
+ * @type {Number}
+ * @private
+ */
+var id = 0;
+
+/**
+ * Ultron is high-intelligence robot. It gathers intelligence so it can start improving
+ * upon his rudimentary design. It will learn from your EventEmitting patterns
+ * and exterminate them.
+ *
+ * @constructor
+ * @param {EventEmitter} ee EventEmitter instance we need to wrap.
+ * @api public
+ */
+function Ultron(ee) {
+  if (!(this instanceof Ultron)) return new Ultron(ee);
+
+  this.id = id++;
+  this.ee = ee;
+}
+
+/**
+ * Register a new EventListener for the given event.
+ *
+ * @param {String} event Name of the event.
+ * @param {Functon} fn Callback function.
+ * @param {Mixed} context The context of the function.
+ * @returns {Ultron}
+ * @api public
+ */
+Ultron.prototype.on = function on(event, fn, context) {
+  fn.__ultron = this.id;
+  this.ee.on(event, fn, context);
+
+  return this;
+};
+/**
+ * Add an EventListener that's only called once.
+ *
+ * @param {String} event Name of the event.
+ * @param {Function} fn Callback function.
+ * @param {Mixed} context The context of the function.
+ * @returns {Ultron}
+ * @api public
+ */
+Ultron.prototype.once = function once(event, fn, context) {
+  fn.__ultron = this.id;
+  this.ee.once(event, fn, context);
+
+  return this;
+};
+
+/**
+ * Remove the listeners we assigned for the given event.
+ *
+ * @returns {Ultron}
+ * @api public
+ */
+Ultron.prototype.remove = function remove() {
+  var args = arguments
+    , ee = this.ee
+    , event;
+
+  //
+  // When no event names are provided we assume that we need to clear all the
+  // events that were assigned through us.
+  //
+  if (args.length === 1 && 'string' === typeof args[0]) {
+    args = args[0].split(/[, ]+/);
+  } else if (!args.length) {
+    if (ee.eventNames) {
+      args = ee.eventNames();
+    } else if (ee._events) {
+      args = [];
+
+      for (event in ee._events) {
+        if (has.call(ee._events, event)) args.push(event);
+      }
+
+      if (Object.getOwnPropertySymbols) {
+        args = args.concat(Object.getOwnPropertySymbols(ee._events));
+      }
+    }
+  }
+
+  for (var i = 0; i < args.length; i++) {
+    var listeners = ee.listeners(args[i]);
+
+    for (var j = 0; j < listeners.length; j++) {
+      event = listeners[j];
+
+      //
+      // Once listeners have a `listener` property that stores the real listener
+      // in the EventEmitter that ships with Node.js.
+      //
+      if (event.listener) {
+        if (event.listener.__ultron !== this.id) continue;
+        delete event.listener.__ultron;
+      } else {
+        if (event.__ultron !== this.id) continue;
+        delete event.__ultron;
+      }
+
+      ee.removeListener(args[i], event);
+    }
+  }
+
+  return this;
+};
+
+/**
+ * Destroy the Ultron instance, remove all listeners and release all references.
+ *
+ * @returns {Boolean}
+ * @api public
+ */
+Ultron.prototype.destroy = function destroy() {
+  if (!this.ee) return false;
+
+  this.remove();
+  this.ee = null;
+
+  return true;
+};
+
+//
+// Expose the module.
+//
+module.exports = Ultron;
diff --git a/wrt/node_modules/ultron/package.json b/wrt/node_modules/ultron/package.json
new file mode 100644 (file)
index 0000000..5ffccae
--- /dev/null
@@ -0,0 +1,112 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "ultron@~1.1.0",
+        "scope": null,
+        "escapedName": "ultron",
+        "name": "ultron",
+        "rawSpec": "~1.1.0",
+        "spec": ">=1.1.0 <1.2.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/ws"
+    ]
+  ],
+  "_from": "ultron@>=1.1.0 <1.2.0",
+  "_id": "ultron@1.1.0",
+  "_inCache": true,
+  "_location": "/ultron",
+  "_nodeVersion": "6.2.1",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/ultron-1.1.0.tgz_1483969751660_0.8877595944795758"
+  },
+  "_npmUser": {
+    "name": "3rdeden",
+    "email": "npm@3rd-Eden.com"
+  },
+  "_npmVersion": "3.9.3",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "ultron@~1.1.0",
+    "scope": null,
+    "escapedName": "ultron",
+    "name": "ultron",
+    "rawSpec": "~1.1.0",
+    "spec": ">=1.1.0 <1.2.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/ws"
+  ],
+  "_resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.0.tgz",
+  "_shasum": "b07a2e6a541a815fc6a34ccd4533baec307ca864",
+  "_shrinkwrap": null,
+  "_spec": "ultron@~1.1.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/ws",
+  "author": {
+    "name": "Arnout Kazemier"
+  },
+  "bugs": {
+    "url": "https://github.com/unshiftio/ultron/issues"
+  },
+  "dependencies": {},
+  "description": "Ultron is high-intelligence robot. It gathers intel so it can start improving upon his rudimentary design",
+  "devDependencies": {
+    "assume": "1.4.x",
+    "eventemitter3": "2.0.x",
+    "istanbul": "0.4.x",
+    "mocha": "~3.2.0",
+    "pre-commit": "~1.2.0"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "b07a2e6a541a815fc6a34ccd4533baec307ca864",
+    "tarball": "https://registry.npmjs.org/ultron/-/ultron-1.1.0.tgz"
+  },
+  "gitHead": "6eb97b74402978aebda4a9d497cb6243ec80c9f1",
+  "homepage": "https://github.com/unshiftio/ultron",
+  "keywords": [
+    "Ultron",
+    "robot",
+    "gather",
+    "intelligence",
+    "event",
+    "events",
+    "eventemitter",
+    "emitter",
+    "cleanup"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "unshift",
+      "email": "npm@unshift.io"
+    },
+    {
+      "name": "v1",
+      "email": "info@3rd-Eden.com"
+    },
+    {
+      "name": "3rdeden",
+      "email": "npm@3rd-Eden.com"
+    }
+  ],
+  "name": "ultron",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/unshiftio/ultron.git"
+  },
+  "scripts": {
+    "100%": "istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100",
+    "coverage": "istanbul cover _mocha -- test.js",
+    "test": "mocha test.js",
+    "test-travis": "istanbul cover _mocha --report lcovonly -- test.js",
+    "watch": "mocha --watch test.js"
+  },
+  "version": "1.1.0"
+}
diff --git a/wrt/node_modules/underscore-plus/LICENSE.md b/wrt/node_modules/underscore-plus/LICENSE.md
new file mode 100644 (file)
index 0000000..493db50
--- /dev/null
@@ -0,0 +1,20 @@
+Copyright (c) 2013 GitHub Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/underscore-plus/README.md b/wrt/node_modules/underscore-plus/README.md
new file mode 100644 (file)
index 0000000..dd7b4c0
--- /dev/null
@@ -0,0 +1,14 @@
+# underscore-plus [![Build Status](https://travis-ci.org/atom/underscore-plus.svg?branch=master)](https://travis-ci.org/atom/underscore-plus)
+
+Takes the great [underscore](http://underscorejs.org/) library and adds a few
+more things.
+
+## Using
+
+```sh
+npm install underscore-plus
+```
+
+```coffeescript
+_ = require 'underscore-plus' # Has all underscore methods and more
+```
diff --git a/wrt/node_modules/underscore-plus/lib/underscore-plus.js b/wrt/node_modules/underscore-plus/lib/underscore-plus.js
new file mode 100644 (file)
index 0000000..32eb482
--- /dev/null
@@ -0,0 +1,522 @@
+(function() {
+  var isEqual, isPlainObject, macModifierKeyMap, nonMacModifierKeyMap, plus, shiftKeyMap, splitKeyPath, _,
+    __slice = [].slice;
+
+  _ = require('underscore');
+
+  macModifierKeyMap = {
+    cmd: '\u2318',
+    ctrl: '\u2303',
+    alt: '\u2325',
+    option: '\u2325',
+    shift: '\u21e7',
+    enter: '\u23ce',
+    left: '\u2190',
+    right: '\u2192',
+    up: '\u2191',
+    down: '\u2193'
+  };
+
+  nonMacModifierKeyMap = {
+    cmd: 'Cmd',
+    ctrl: 'Ctrl',
+    alt: 'Alt',
+    option: 'Alt',
+    shift: 'Shift',
+    enter: 'Enter',
+    left: 'Left',
+    right: 'Right',
+    up: 'Up',
+    down: 'Down'
+  };
+
+  shiftKeyMap = {
+    '~': '`',
+    '_': '-',
+    '+': '=',
+    '|': '\\',
+    '{': '[',
+    '}': ']',
+    ':': ';',
+    '"': '\'',
+    '<': ',',
+    '>': '.',
+    '?': '/'
+  };
+
+  splitKeyPath = function(keyPath) {
+    var char, i, keyPathArray, startIndex, _i, _len;
+    startIndex = 0;
+    keyPathArray = [];
+    if (keyPath == null) {
+      return keyPathArray;
+    }
+    for (i = _i = 0, _len = keyPath.length; _i < _len; i = ++_i) {
+      char = keyPath[i];
+      if (char === '.' && (i === 0 || keyPath[i - 1] !== '\\')) {
+        keyPathArray.push(keyPath.substring(startIndex, i));
+        startIndex = i + 1;
+      }
+    }
+    keyPathArray.push(keyPath.substr(startIndex, keyPath.length));
+    return keyPathArray;
+  };
+
+  isPlainObject = function(value) {
+    return _.isObject(value) && !_.isArray(value);
+  };
+
+  plus = {
+    adviseBefore: function(object, methodName, advice) {
+      var original;
+      original = object[methodName];
+      return object[methodName] = function() {
+        var args;
+        args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+        if (advice.apply(this, args) !== false) {
+          return original.apply(this, args);
+        }
+      };
+    },
+    camelize: function(string) {
+      if (string) {
+        return string.replace(/[_-]+(\w)/g, function(m) {
+          return m[1].toUpperCase();
+        });
+      } else {
+        return '';
+      }
+    },
+    capitalize: function(word) {
+      if (!word) {
+        return '';
+      }
+      if (word.toLowerCase() === 'github') {
+        return 'GitHub';
+      } else {
+        return word[0].toUpperCase() + word.slice(1);
+      }
+    },
+    compactObject: function(object) {
+      var key, newObject, value;
+      newObject = {};
+      for (key in object) {
+        value = object[key];
+        if (value != null) {
+          newObject[key] = value;
+        }
+      }
+      return newObject;
+    },
+    dasherize: function(string) {
+      if (!string) {
+        return '';
+      }
+      string = string[0].toLowerCase() + string.slice(1);
+      return string.replace(/([A-Z])|(_)/g, function(m, letter) {
+        if (letter) {
+          return "-" + letter.toLowerCase();
+        } else {
+          return "-";
+        }
+      });
+    },
+    deepClone: function(object) {
+      if (_.isArray(object)) {
+        return object.map(function(value) {
+          return plus.deepClone(value);
+        });
+      } else if (_.isObject(object) && !_.isFunction(object)) {
+        return plus.mapObject(object, (function(_this) {
+          return function(key, value) {
+            return [key, plus.deepClone(value)];
+          };
+        })(this));
+      } else {
+        return object;
+      }
+    },
+    deepExtend: function(target) {
+      var i, key, object, result, _i, _len, _ref;
+      result = target;
+      i = 0;
+      while (++i < arguments.length) {
+        object = arguments[i];
+        if (isPlainObject(result) && isPlainObject(object)) {
+          _ref = Object.keys(object);
+          for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+            key = _ref[_i];
+            result[key] = plus.deepExtend(result[key], object[key]);
+          }
+        } else {
+          result = plus.deepClone(object);
+        }
+      }
+      return result;
+    },
+    deepContains: function(array, target) {
+      var object, _i, _len;
+      if (array == null) {
+        return false;
+      }
+      for (_i = 0, _len = array.length; _i < _len; _i++) {
+        object = array[_i];
+        if (_.isEqual(object, target)) {
+          return true;
+        }
+      }
+      return false;
+    },
+    endsWith: function(string, suffix) {
+      if (suffix == null) {
+        suffix = '';
+      }
+      if (string) {
+        return string.indexOf(suffix, string.length - suffix.length) !== -1;
+      } else {
+        return false;
+      }
+    },
+    escapeAttribute: function(string) {
+      if (string) {
+        return string.replace(/"/g, '&quot;').replace(/\n/g, '').replace(/\\/g, '-');
+      } else {
+        return '';
+      }
+    },
+    escapeRegExp: function(string) {
+      if (string) {
+        return string.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
+      } else {
+        return '';
+      }
+    },
+    humanizeEventName: function(eventName, eventDoc) {
+      var event, namespace, namespaceDoc, _ref;
+      _ref = eventName.split(':'), namespace = _ref[0], event = _ref[1];
+      if (event == null) {
+        return plus.undasherize(namespace);
+      }
+      namespaceDoc = plus.undasherize(namespace);
+      if (eventDoc == null) {
+        eventDoc = plus.undasherize(event);
+      }
+      return "" + namespaceDoc + ": " + eventDoc;
+    },
+    humanizeKey: function(key, platform) {
+      var modifierKeyMap;
+      if (platform == null) {
+        platform = process.platform;
+      }
+      if (!key) {
+        return key;
+      }
+      modifierKeyMap = platform === 'darwin' ? macModifierKeyMap : nonMacModifierKeyMap;
+      if (modifierKeyMap[key]) {
+        return modifierKeyMap[key];
+      } else if (key.length === 1 && (shiftKeyMap[key] != null)) {
+        return [modifierKeyMap.shift, shiftKeyMap[key]];
+      } else if (key.length === 1 && key === key.toUpperCase() && key.toUpperCase() !== key.toLowerCase()) {
+        return [modifierKeyMap.shift, key.toUpperCase()];
+      } else if (key.length === 1 || /f[0-9]{1,2}/.test(key)) {
+        return key.toUpperCase();
+      } else {
+        if (platform === 'darwin') {
+          return key;
+        } else {
+          return plus.capitalize(key);
+        }
+      }
+    },
+    humanizeKeystroke: function(keystroke, platform) {
+      var humanizedKeystrokes, index, key, keys, keystrokes, splitKeystroke, _i, _j, _len, _len1;
+      if (platform == null) {
+        platform = process.platform;
+      }
+      if (!keystroke) {
+        return keystroke;
+      }
+      keystrokes = keystroke.split(' ');
+      humanizedKeystrokes = [];
+      for (_i = 0, _len = keystrokes.length; _i < _len; _i++) {
+        keystroke = keystrokes[_i];
+        keys = [];
+        splitKeystroke = keystroke.split('-');
+        for (index = _j = 0, _len1 = splitKeystroke.length; _j < _len1; index = ++_j) {
+          key = splitKeystroke[index];
+          if (key === '' && splitKeystroke[index - 1] === '') {
+            key = '-';
+          }
+          if (key) {
+            keys.push(plus.humanizeKey(key, platform));
+          }
+        }
+        keys = _.uniq(_.flatten(keys));
+        if (platform === 'darwin') {
+          keys = keys.join('');
+        } else {
+          keys = keys.join('+');
+        }
+        humanizedKeystrokes.push(keys);
+      }
+      return humanizedKeystrokes.join(' ');
+    },
+    isSubset: function(potentialSubset, potentialSuperset) {
+      return _.every(potentialSubset, function(element) {
+        return _.include(potentialSuperset, element);
+      });
+    },
+    losslessInvert: function(hash) {
+      var inverted, key, value;
+      inverted = {};
+      for (key in hash) {
+        value = hash[key];
+        if (inverted[value] == null) {
+          inverted[value] = [];
+        }
+        inverted[value].push(key);
+      }
+      return inverted;
+    },
+    mapObject: function(object, iterator) {
+      var key, newObject, value, _i, _len, _ref, _ref1;
+      newObject = {};
+      _ref = Object.keys(object);
+      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+        key = _ref[_i];
+        _ref1 = iterator(key, object[key]), key = _ref1[0], value = _ref1[1];
+        newObject[key] = value;
+      }
+      return newObject;
+    },
+    multiplyString: function(string, n) {
+      var finalString, i;
+      finalString = "";
+      i = 0;
+      while (i < n) {
+        finalString += string;
+        i++;
+      }
+      return finalString;
+    },
+    pluralize: function(count, singular, plural) {
+      if (count == null) {
+        count = 0;
+      }
+      if (plural == null) {
+        plural = singular + 's';
+      }
+      if (count === 1) {
+        return "" + count + " " + singular;
+      } else {
+        return "" + count + " " + plural;
+      }
+    },
+    remove: function(array, element) {
+      var index;
+      index = array.indexOf(element);
+      if (index >= 0) {
+        array.splice(index, 1);
+      }
+      return array;
+    },
+    setValueForKeyPath: function(object, keyPath, value) {
+      var key, keys;
+      keys = splitKeyPath(keyPath);
+      while (keys.length > 1) {
+        key = keys.shift();
+        if (object[key] == null) {
+          object[key] = {};
+        }
+        object = object[key];
+      }
+      if (value != null) {
+        return object[keys.shift()] = value;
+      } else {
+        return delete object[keys.shift()];
+      }
+    },
+    hasKeyPath: function(object, keyPath) {
+      var key, keys, _i, _len;
+      keys = splitKeyPath(keyPath);
+      for (_i = 0, _len = keys.length; _i < _len; _i++) {
+        key = keys[_i];
+        if (!object.hasOwnProperty(key)) {
+          return false;
+        }
+        object = object[key];
+      }
+      return true;
+    },
+    spliceWithArray: function(originalArray, start, length, insertedArray, chunkSize) {
+      var chunkStart, _i, _ref, _results;
+      if (chunkSize == null) {
+        chunkSize = 100000;
+      }
+      if (insertedArray.length < chunkSize) {
+        return originalArray.splice.apply(originalArray, [start, length].concat(__slice.call(insertedArray)));
+      } else {
+        originalArray.splice(start, length);
+        _results = [];
+        for (chunkStart = _i = 0, _ref = insertedArray.length; chunkSize > 0 ? _i <= _ref : _i >= _ref; chunkStart = _i += chunkSize) {
+          _results.push(originalArray.splice.apply(originalArray, [start + chunkStart, 0].concat(__slice.call(insertedArray.slice(chunkStart, chunkStart + chunkSize)))));
+        }
+        return _results;
+      }
+    },
+    sum: function(array) {
+      var elt, sum, _i, _len;
+      sum = 0;
+      for (_i = 0, _len = array.length; _i < _len; _i++) {
+        elt = array[_i];
+        sum += elt;
+      }
+      return sum;
+    },
+    uncamelcase: function(string) {
+      var result;
+      if (!string) {
+        return '';
+      }
+      result = string.replace(/([A-Z])|_+/g, function(match, letter) {
+        if (letter == null) {
+          letter = '';
+        }
+        return " " + letter;
+      });
+      return plus.capitalize(result.trim());
+    },
+    undasherize: function(string) {
+      if (string) {
+        return string.split('-').map(plus.capitalize).join(' ');
+      } else {
+        return '';
+      }
+    },
+    underscore: function(string) {
+      if (!string) {
+        return '';
+      }
+      string = string[0].toLowerCase() + string.slice(1);
+      return string.replace(/([A-Z])|-+/g, function(match, letter) {
+        if (letter == null) {
+          letter = '';
+        }
+        return "_" + (letter.toLowerCase());
+      });
+    },
+    valueForKeyPath: function(object, keyPath) {
+      var key, keys, _i, _len;
+      keys = splitKeyPath(keyPath);
+      for (_i = 0, _len = keys.length; _i < _len; _i++) {
+        key = keys[_i];
+        object = object[key];
+        if (object == null) {
+          return;
+        }
+      }
+      return object;
+    },
+    isEqual: function(a, b, aStack, bStack) {
+      if (_.isArray(aStack) && _.isArray(bStack)) {
+        return isEqual(a, b, aStack, bStack);
+      } else {
+        return isEqual(a, b);
+      }
+    },
+    isEqualForProperties: function() {
+      var a, b, properties, property, _i, _len;
+      a = arguments[0], b = arguments[1], properties = 3 <= arguments.length ? __slice.call(arguments, 2) : [];
+      for (_i = 0, _len = properties.length; _i < _len; _i++) {
+        property = properties[_i];
+        if (!_.isEqual(a[property], b[property])) {
+          return false;
+        }
+      }
+      return true;
+    }
+  };
+
+  isEqual = function(a, b, aStack, bStack) {
+    var aCtor, aCtorValid, aElement, aKeyCount, aValue, bCtor, bCtorValid, bKeyCount, bValue, equal, i, key, stackIndex, _i, _len;
+    if (aStack == null) {
+      aStack = [];
+    }
+    if (bStack == null) {
+      bStack = [];
+    }
+    if (a === b) {
+      return _.isEqual(a, b);
+    }
+    if (_.isFunction(a) || _.isFunction(b)) {
+      return _.isEqual(a, b);
+    }
+    stackIndex = aStack.length;
+    while (stackIndex--) {
+      if (aStack[stackIndex] === a) {
+        return bStack[stackIndex] === b;
+      }
+    }
+    aStack.push(a);
+    bStack.push(b);
+    equal = false;
+    if (_.isFunction(a != null ? a.isEqual : void 0)) {
+      equal = a.isEqual(b, aStack, bStack);
+    } else if (_.isFunction(b != null ? b.isEqual : void 0)) {
+      equal = b.isEqual(a, bStack, aStack);
+    } else if (_.isArray(a) && _.isArray(b) && a.length === b.length) {
+      equal = true;
+      for (i = _i = 0, _len = a.length; _i < _len; i = ++_i) {
+        aElement = a[i];
+        if (!isEqual(aElement, b[i], aStack, bStack)) {
+          equal = false;
+          break;
+        }
+      }
+    } else if (_.isRegExp(a) && _.isRegExp(b)) {
+      equal = _.isEqual(a, b);
+    } else if (_.isElement(a) && _.isElement(b)) {
+      equal = a === b;
+    } else if (_.isObject(a) && _.isObject(b)) {
+      aCtor = a.constructor;
+      bCtor = b.constructor;
+      aCtorValid = _.isFunction(aCtor) && aCtor instanceof aCtor;
+      bCtorValid = _.isFunction(bCtor) && bCtor instanceof bCtor;
+      if (aCtor !== bCtor && !(aCtorValid && bCtorValid)) {
+        equal = false;
+      } else {
+        aKeyCount = 0;
+        equal = true;
+        for (key in a) {
+          aValue = a[key];
+          if (!_.has(a, key)) {
+            continue;
+          }
+          aKeyCount++;
+          if (!(_.has(b, key) && isEqual(aValue, b[key], aStack, bStack))) {
+            equal = false;
+            break;
+          }
+        }
+        if (equal) {
+          bKeyCount = 0;
+          for (key in b) {
+            bValue = b[key];
+            if (_.has(b, key)) {
+              bKeyCount++;
+            }
+          }
+          equal = aKeyCount === bKeyCount;
+        }
+      }
+    } else {
+      equal = _.isEqual(a, b);
+    }
+    aStack.pop();
+    bStack.pop();
+    return equal;
+  };
+
+  module.exports = _.extend({}, _, plus);
+
+}).call(this);
diff --git a/wrt/node_modules/underscore-plus/package.json b/wrt/node_modules/underscore-plus/package.json
new file mode 100644 (file)
index 0000000..db06c78
--- /dev/null
@@ -0,0 +1,66 @@
+{
+  "_from": "underscore-plus@^1.6.6",
+  "_id": "underscore-plus@1.6.6",
+  "_inBundle": false,
+  "_integrity": "sha1-ZezeG9xEGjXYnmUP1w3PE65Dmn0=",
+  "_location": "/underscore-plus",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "underscore-plus@^1.6.6",
+    "name": "underscore-plus",
+    "escapedName": "underscore-plus",
+    "rawSpec": "^1.6.6",
+    "saveSpec": null,
+    "fetchSpec": "^1.6.6"
+  },
+  "_requiredBy": [
+    "#DEV:/",
+    "/fs-plus"
+  ],
+  "_resolved": "https://registry.npmjs.org/underscore-plus/-/underscore-plus-1.6.6.tgz",
+  "_shasum": "65ecde1bdc441a35d89e650fd70dcf13ae439a7d",
+  "_spec": "underscore-plus@^1.6.6",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was",
+  "bugs": {
+    "url": "https://github.com/atom/underscore-plus/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {
+    "underscore": "~1.6.0"
+  },
+  "deprecated": false,
+  "description": "Underscore plus additional utilities",
+  "devDependencies": {
+    "grunt": "~0.4.1",
+    "grunt-cli": "~0.1.8",
+    "grunt-coffeelint": "0.0.6",
+    "grunt-contrib-coffee": "~0.9.0",
+    "grunt-shell": "~0.2.2",
+    "jasmine-focused": "1.x",
+    "rimraf": "~2.1.4",
+    "temp": "~0.5.0"
+  },
+  "homepage": "http://atom.github.io/underscore-plus",
+  "keywords": [
+    "underscore"
+  ],
+  "licenses": [
+    {
+      "type": "MIT",
+      "url": "http://github.com/atom/underscore-plus/raw/master/LICENSE.md"
+    }
+  ],
+  "main": "./lib/underscore-plus.js",
+  "name": "underscore-plus",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/atom/underscore-plus.git"
+  },
+  "scripts": {
+    "prepublish": "grunt clean coffee lint",
+    "test": "grunt test"
+  },
+  "version": "1.6.6"
+}
diff --git a/wrt/node_modules/underscore.string/.editorconfig b/wrt/node_modules/underscore.string/.editorconfig
new file mode 100644 (file)
index 0000000..84b480f
--- /dev/null
@@ -0,0 +1,9 @@
+# EditorConfig is awesome: http://EditorConfig.org
+root = true
+
+[*]
+end_of_line = lf
+insert_final_newline = true
+indent_style = space
+indent_size = 2
+charset = utf-8
diff --git a/wrt/node_modules/underscore.string/.eslintignore b/wrt/node_modules/underscore.string/.eslintignore
new file mode 100644 (file)
index 0000000..519bcdb
--- /dev/null
@@ -0,0 +1,8 @@
+.eslintrc.js
+gulpfile.js
+meteor-*.js
+package.js
+dist/**
+scripts/**
+coverage/**
+node_modules/**
diff --git a/wrt/node_modules/underscore.string/.eslintrc b/wrt/node_modules/underscore.string/.eslintrc
new file mode 100644 (file)
index 0000000..5bc7d1a
--- /dev/null
@@ -0,0 +1,26 @@
+{
+    "rules": {
+        "indent": [
+            2,
+            2
+        ],
+        "quotes": [
+            2,
+            "single"
+        ],
+        "linebreak-style": [
+            2,
+            "unix"
+        ],
+        "semi": [
+            2,
+            "always"
+        ]
+    },
+    "env": {
+        "mocha": true,
+        "node": true,
+        "browser": true
+    },
+    "extends": "eslint:recommended"
+}
diff --git a/wrt/node_modules/underscore.string/.npmignore b/wrt/node_modules/underscore.string/.npmignore
new file mode 100644 (file)
index 0000000..d6d0555
--- /dev/null
@@ -0,0 +1,4 @@
+tests
+bench
+coverage
+scripts
diff --git a/wrt/node_modules/underscore.string/.travis.yml b/wrt/node_modules/underscore.string/.travis.yml
new file mode 100644 (file)
index 0000000..42f90e8
--- /dev/null
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+  - "0.12"
+  - "stable"
diff --git a/wrt/node_modules/underscore.string/CHANGELOG.markdown b/wrt/node_modules/underscore.string/CHANGELOG.markdown
new file mode 100644 (file)
index 0000000..24e7fd3
--- /dev/null
@@ -0,0 +1,200 @@
+
+# Changelog
+
+### 3.3.4
+* set standalone in browserify `s`
+
+### 3.3.1 / 3.3.2 / 3.3.3
+* fix release script
+
+### 3.3.0
+
+* `sprintf` and `vsprintf` is now marked as deprecated [#479](https://github.com/epeli/underscore.string/pull/479)
+* `wrap` is added to `exports` [#489](https://github.com/epeli/underscore.string/pull/489)
+* new build chain without gulp
+* [Full changelog](https://github.com/epeli/underscore.string/compare/3.2.3...3.3.0)
+
+### 3.2.3
+
+* Add romanian characters to `cleanDiacritics` [#470](https://github.com/epeli/underscore.string/pull/470)
+* Fix global leaks
+* [Full changelog](https://github.com/epeli/underscore.string/compare/3.2.2...3.2.3)
+
+### 3.2.2
+
+* Fix `slugify`regression [#448](https://github.com/epeli/underscore.string/pull/448)
+* [Full changelog](https://github.com/epeli/underscore.string/compare/3.2.1...3.2.2)
+
+### 3.2.1
+
+* Export `cleanDiacritics` in index.js
+* [Full changelog](https://github.com/epeli/underscore.string/compare/3.2.0...3.2.1)
+
+### 3.2.0
+
+* Add `cleanDiacritics` [#444](https://github.com/epeli/underscore.string/pull/444)
+* Add `wrap` [#410](https://github.com/epeli/underscore.string/pull/410)
+* `lines`: add support to CR ending lines [#440](https://github.com/epeli/underscore.string/pull/440)
+* Documentation improvements
+* Small performance improvements
+* [Full changelog](https://github.com/epeli/underscore.string/compare/3.1.1...3.2.0)
+
+
+### 3.1.1
+
+* Add coverage folder to npmignore
+* [Full changelog](https://github.com/epeli/underscore.string/compare/3.1.0...3.1.1)
+
+### 3.1.0
+
+* Meteor integration [baeb0da](https://github.com/epeli/underscore.string/commit/baeb0da0053549e5346184630a7e0c5007b8be4f)
+* Add flag to capitalize to lowercase remaining characters [#408](https://github.com/epeli/underscore.string/pull/408)
+* Move to mocha [#409](https://github.com/epeli/underscore.string/pull/409)
+* Add support for more htmlEntites in escapeHTML and unescapeHTML [#417](https://github.com/epeli/underscore.string/pull/417)
+* Performance improvement in levenshtein [#427](https://github.com/epeli/underscore.string/pull/427)
+* [Full changelog](https://github.com/epeli/underscore.string/compare/3.0.3...3.1.0)
+
+### 3.0.3
+
+* Provide `dist` in npm package [#402](https://github.com/epeli/underscore.string/pull/402)
+* [Full changelog](https://github.com/epeli/underscore.string/compare/3.0.2...3.0.3)
+
+### 3.0.2
+
+* Fix .gitignore for bower [#400](https://github.com/epeli/underscore.string/issues/400)
+* Some docs cleanup
+* [Full changelog](https://github.com/epeli/underscore.string/compare/3.0.1...3.0.2)
+
+### 3.0.1
+
+* Minor fixes in the documentation [#390](https://github.com/epeli/underscore.string/pull/390) and [5135cb9](https://github.com/epeli/underscore.string/commit/5135cb9026034e9ea206c2ed8588db1eeb3ce95a)
+* Fix bower warnings [#393](https://github.com/epeli/underscore.string/pull/393)
+* `humanize` now uses `trim` [#392](https://github.com/epeli/underscore.string/pull/392)
+* [Full changelog](https://github.com/epeli/underscore.string/compare/3.0.0...3.0.1)
+
+### 3.0.0
+
+* Each function is now extracted to individual CommonJS modules
+  * Browserify users can now load only the functions they actually use
+* Usage as Underscore.js or Lo-Dash mixin is now discouraged as there is too many colliding methods
+* The prebuild library now exports a `s` global instead of `_s` and trying to
+  stick itself to existing underscore instances
+* New gh-pages with documentation
+* Implement chaining without Underscore.js
+* String.prototype methods can be chained with underscore.string functions [#383](https://github.com/epeli/underscore.string/pull/383)
+* Don't compare lowercase versions of strings in naturalCmp [#326](https://github.com/epeli/underscore.string/issues/326)
+* Always return +-1 or 0 in naturalCmp [#324](https://github.com/epeli/underscore.string/pull/324)
+* Align [starts|ends]With with the ES6 spec [#345](https://github.com/epeli/underscore.string/pull/345)
+* New functions `decapitalize`, `pred`, `dedent` and `replaceAll`
+* `slugify` now actually replaces all special chars with a dash
+* `slugify` supports Easter E languages [#340](https://github.com/epeli/underscore.string/pull/340)
+* `join` is now a conflicting function [#320](https://github.com/epeli/underscore.string/pull/320)
+* New decapitalize flag for `camelize` [#370](https://github.com/epeli/underscore.string/pull/370)
+* `toNumber` allows negative decimal precision [#332](https://github.com/epeli/underscore.string/pull/332)
+* [Full changelog](https://github.com/epeli/underscore.string/compare/2.4.0...3.0.0)
+
+## 2.4.0
+
+* Move from rake to gulp
+* Add support form classify camelcase strings
+* Fix bower.json
+* [Full changelog](https://github.com/epeli/underscore.string/compare/v2.3.3...2.4.0)
+
+## 2.3.3
+
+* Add `toBoolean`
+* Add `unquote`
+* Add quote char option to `quote`
+* Support dash-separated words in `titleize`
+* [Full changelog](https://github.com/epeli/underscore.string/compare/v2.3.2...2.3.3)
+
+## 2.3.2
+
+* Add `naturalCmp`
+* Bug fix to `camelize`
+* Add ă, ș, ț and ś to `slugify`
+* Doc updates
+* Add support for [component](http://component.io/)
+* [Full changelog](https://github.com/epeli/underscore.string/compare/v2.3.1...v2.3.2)
+
+## 2.3.1
+
+* Bug fixes to `escapeHTML`, `classify`, `substr`
+* Faster `count`
+* Documentation fixes
+* [Full changelog](https://github.com/epeli/underscore.string/compare/v2.3.0...v2.3.1)
+
+## 2.3.0
+
+* Added `numberformat` method
+* Added `levenshtein` method (Levenshtein distance calculation)
+* Added `swapCase` method
+* Changed default behavior of `words` method
+* Added `toSentenceSerial` method
+* Added `surround` and `quote` methods
+
+## 2.2.1
+
+* Same as 2.2.0 (2.2.0rc on npm) to fix some npm drama
+
+## 2.2.0
+
+* Capitalize method behavior changed
+* Various performance tweaks
+
+## 2.1.1
+
+* Fixed words method bug
+* Added classify method
+
+## 2.1.0
+
+* AMD support
+* Added toSentence method
+* Added slugify method
+* Lots of speed optimizations
+
+## 2.0.0
+
+* Added prune, humanize functions
+* Added _.string (_.str) namespace for Underscore.string library
+* Removed includes function
+
+For upgrading to this version you need to mix in Underscore.string library to Underscore object:
+
+```javascript
+_.mixin(_.string.exports());
+```
+
+and all non-conflict Underscore.string functions will be available through Underscore object.
+Also function `includes` has been removed, you should replace this function by `_.str.include`
+or create alias `_.includes = _.str.include` and all your code will work fine.
+
+## 1.1.6
+
+* Fixed reverse and truncate
+* Added isBlank, stripTags, inlude(alias for includes)
+* Added uglifier compression
+
+## 1.1.5
+
+* Added strRight, strRightBack, strLeft, strLeftBack
+
+## 1.1.4
+
+* Added pad, lpad, rpad, lrpad methods and aliases center, ljust, rjust
+* Integration with Underscore 1.1.6
+
+## 1.1.3
+
+* Added methods: underscored, camelize, dasherize
+* Support newer version of npm
+
+## 1.1.2
+
+* Created functions: lines, chars, words functions
+
+## 1.0.2
+
+* Created integration test suite with underscore.js 1.1.4 (now it's absolutely compatible)
+* Removed 'reverse' function, because this function override underscore.js 'reverse'
diff --git a/wrt/node_modules/underscore.string/CONTRIBUTING.markdown b/wrt/node_modules/underscore.string/CONTRIBUTING.markdown
new file mode 100644 (file)
index 0000000..b97eae0
--- /dev/null
@@ -0,0 +1,32 @@
+
+# Contributing
+
+- Always add tests
+- Update documentation if needed
+- Do not commit build artifacts in the `dist` directory
+
+## Bug fixes
+
+Always add a test for the bug in a separate commit so we can easily cherry pick
+it for verification.
+
+## New features
+
+It's recommended to open an issue before sending a pull request to avoid
+unnecessary work. There are quite few areas we consider to be out of scope for
+this library. Idea is to add few generic string helpers for Javascript. For
+example anything related to internationalization or is too language specific
+is out of scope.
+
+## Release checklist
+
+(for maintainers)
+
+  - Write a changelog entry to `CHANGELOG.markdown`
+    - Use Github compare to see what has changed from previous tag. Ex https://github.com/epeli/underscore.string/compare/3.0.0...master 
+  - Update the version in the `package.json`
+  - Publish a new version of _.string `npm run release`
+  - Update the [gh-pages][ghp] branch `npm run bump`
+
+[d]: https://github.com/epeli/underscore.string/releases
+[ghp]: https://github.com/epeli/underscore.string/tree/gh-pages
diff --git a/wrt/node_modules/underscore.string/README.markdown b/wrt/node_modules/underscore.string/README.markdown
new file mode 100644 (file)
index 0000000..4882548
--- /dev/null
@@ -0,0 +1,888 @@
+<span class="github-only">
+
+The stable release documentation can be found here https://epeli.github.io/underscore.string/
+
+</span>
+
+# Underscore.string [![Build Status](https://secure.travis-ci.org/epeli/underscore.string.png?branch=master)](http://travis-ci.org/epeli/underscore.string) #
+
+Javascript lacks complete string manipulation operations.
+This is an attempt to fill that gap. List of build-in methods can be found
+for example from [Dive Into JavaScript][d].
+Originally started as an Underscore.js extension but is a full standalone
+library nowadays.
+
+Upgrading from 2.x to 3.x? Please read the [changelog][c].
+
+[c]: https://github.com/epeli/underscore.string/blob/master/CHANGELOG.markdown#300
+
+## Usage
+
+### For Node.js, Browserify and Webpack
+
+Install from npm
+
+    npm install underscore.string
+
+Require individual functions
+
+```javascript
+var slugify = require("underscore.string/slugify");
+
+slugify("Hello world!");
+// => hello-world
+```
+
+or load the full library to enable chaining
+
+```javascript
+var s = require("underscore.string");
+
+s("   epeli  ").trim().capitalize().value();
+// => "Epeli"
+```
+
+but especially when using with [Browserify][] the individual function approach
+is recommended because using it you only add those functions to your bundle you
+use.
+
+[Browserify]: http://browserify.org/
+
+### In Meteor
+
+From your [Meteor][] project folder
+
+```shell
+    meteor add underscorestring:underscore.string
+```
+
+and you'll be able to access the library with the ***s*** global from both the server and the client.
+
+```javascript
+s.slugify("Hello world!");
+// => hello-world
+
+s("   epeli  ").trim().capitalize().value();
+// => "Epeli"
+```
+
+[Meteor]: http://www.meteor.com/
+
+### Others
+
+The `dist/underscore.string.js` file is an [UMD][] build. You can load it using
+an AMD loader such as [RequireJS][] or just stick it to a web page and access
+the library from the ***s*** global.
+
+[UMD]: https://github.com/umdjs/umd
+[RequireJS]: http://requirejs.org/
+
+### Underscore.js/Lo-Dash integration
+
+It is still possible use as Underscore.js/Lo-Dash extension
+
+```javascript
+_.mixin(s.exports());
+```
+But it's not recommended since `include`, `contains`, `reverse` and `join`
+are dropped because they collide with the functions already defined by Underscore.js.
+
+### Lo-Dash-FP/Ramda integration
+
+If you want to use underscore.string with [ramdajs](http://ramdajs.com/) or [Lo-Dash-FP](https://github.com/lodash/lodash-fp) you can use [underscore.string.fp](https://github.com/stoeffel/underscore.string.fp).
+
+    npm install underscore.string.fp
+
+```javascript
+var S = require('underscore.string.fp');
+var filter = require('lodash-fp').filter;
+var filter = require('ramda').filter;
+
+filter(S.startsWith('.'), [
+  '.vimrc',
+  'foo.md',
+  '.zshrc'
+]);
+// => ['.vimrc', '.zshrc']
+```
+
+## Download
+  
+  * [Development version](https://npmcdn.com/underscore.string/dist/underscore.string.js) *Uncompressed with Comments*
+  * [Production version](https://npmcdn.com/underscore.string/dist/underscore.string.min.js) *Minified*
+
+## API
+
+### Individual functions
+
+#### numberFormat(number, [ decimals=0, decimalSeparator='.', orderSeparator=',']) => string
+
+Formats the numbers.
+
+```javascript
+numberFormat(1000, 2);
+// => "1,000.00"
+
+numberFormat(123456789.123, 5, ".", ",");
+// => "123,456,789.12300"
+```
+
+
+#### levenshtein(string1, string2) => number
+
+Calculates [Levenshtein distance][ld] between two strings.
+[ld]: http://en.wikipedia.org/wiki/Levenshtein_distance
+
+```javascript
+levenshtein("kitten", "kittah");
+// => 2
+```
+
+#### capitalize(string, [lowercaseRest=false]) => string
+
+Converts first letter of the string to uppercase. If `true` is passed as second argument the rest
+of the string will be converted to lower case.
+
+```javascript
+capitalize("foo Bar");
+// => "Foo Bar"
+
+capitalize("FOO Bar", true);
+// => "Foo bar"
+```
+
+#### decapitalize(string) => string
+
+Converts first letter of the string to lowercase.
+
+```javascript
+decapitalize("Foo Bar");
+// => "foo Bar"
+```
+
+#### chop(string, step) => array
+
+```javascript
+chop("whitespace", 3);
+// => ["whi", "tes", "pac", "e"]
+```
+
+#### clean(string) => string
+
+Trim and replace multiple spaces with a single space.
+
+```javascript
+clean(" foo    bar   ");
+// => "foo bar"
+```
+
+#### cleanDiacritics(string) => string
+
+Replace [diacritic][dc] characters with closest ASCII equivalents. Check the
+[source][s] for supported characters. [Pull requests][p] welcome for missing
+characters!
+
+[dc]: https://en.wikipedia.org/wiki/Diacritic
+[s]: https://github.com/epeli/underscore.string/blob/master/cleanDiacritics.js
+[p]: https://github.com/epeli/underscore.string/blob/master/CONTRIBUTING.markdown
+
+```javascript
+cleanDiacritics("ääkkönen");
+// => "aakkonen"
+```
+
+#### chars(string) => array
+
+```javascript
+chars("Hello");
+// => ["H", "e", "l", "l", "o"]
+```
+
+#### swapCase(string) => string
+
+Returns a copy of the string in which all the case-based characters have had their case swapped.
+
+```javascript
+swapCase("hELLO");
+// => "Hello"
+```
+
+#### include(string, substring) => boolean
+
+Tests if string contains a substring.
+
+```javascript
+include("foobar", "ob");
+// => true
+```
+
+#### count(string, substring) => number
+
+Returns number of occurrences of substring in string.
+
+```javascript
+count("Hello world", "l");
+// => 3
+```
+
+#### escapeHTML(string) => string
+
+Converts HTML special characters to their entity equivalents.
+This function supports cent, yen, euro, pound, lt, gt, copy, reg, quote, amp, apos.
+
+```javascript
+escapeHTML("<div>Blah blah blah</div>");
+// => "&lt;div&gt;Blah blah blah&lt;/div&gt;"
+```
+
+#### unescapeHTML(string) => string
+
+Converts entity characters to HTML equivalents.
+This function supports cent, yen, euro, pound, lt, gt, copy, reg, quote, amp, apos, nbsp.
+
+```javascript
+unescapeHTML("&lt;div&gt;Blah&nbsp;blah blah&lt;/div&gt;");
+// => "<div>Blah blah blah</div>"
+```
+
+#### insert(string, index, substring) => string
+
+```javascript
+insert("Hellworld", 4, "o ");
+// => "Hello world"
+```
+
+#### replaceAll(string, find, replace, [ignorecase=false]) => string
+
+```javascript
+replaceAll("foo", "o", "a");
+// => "faa"
+```
+
+#### isBlank(string) => boolean
+
+```javascript
+isBlank(""); // => true
+isBlank("\n"); // => true
+isBlank(" "); // => true
+isBlank("a"); // => false
+```
+
+#### join(separator, ...strings) => string
+
+Joins strings together with given separator
+
+```javascript
+join(" ", "foo", "bar");
+// => "foo bar"
+```
+
+#### lines(str) => array
+
+Split lines to an array
+
+```javascript
+lines("Hello\nWorld");
+// => ["Hello", "World"]
+```
+
+#### wrap(str, options) => string
+
+Splits a line `str` (default '') into several lines of size `options.width` (default 75) using a `options.seperator` (default '\n'). If `options.trailingSpaces` is true, make each line at least `width` long using trailing spaces. If `options.cut` is true, create new lines in the middle of words. If `options.preserveSpaces` is true, preserve the space that should be there at the end of a line (only works if options.cut is false).
+
+```javascript
+wrap("Hello World", { width:5 })
+// => "Hello\nWorld"
+
+wrap("Hello World", { width:6, seperator:'.', trailingSpaces: true })
+// => "Hello .World "
+
+wrap("Hello World", { width:5, seperator:'.', cut:true, trailingSpaces: true })
+// => "Hello. Worl.d    "
+
+wrap("Hello World", { width:5, seperator:'.', preserveSpaces: true })
+// => "Hello .World"
+
+```
+
+#### dedent(str, [pattern]) => string
+
+Dedent unnecessary indentation or dedent by a pattern.
+
+Credits go to @sindresorhus.
+This implementation is similar to https://github.com/sindresorhus/strip-indent
+
+```javascript
+dedent("  Hello\n    World");
+// => "Hello\n  World"
+
+dedent("\t\tHello\n\t\t\t\tWorld");
+// => "Hello\n\t\tWorld"
+
+dedent("    Hello\n    World", "  "); // Dedent by 2 spaces
+// => "  Hello\n  World"
+```
+
+#### reverse(string) => string
+
+Return reversed string:
+
+```javascript
+reverse("foobar");
+// => "raboof"
+```
+
+#### splice(string, index, howmany, substring) => string
+
+Like an array splice.
+
+```javascript
+splice("https://edtsech@bitbucket.org/edtsech/underscore.strings", 30, 7, "epeli");
+// => "https://edtsech@bitbucket.org/epeli/underscore.strings"
+```
+
+#### startsWith(string, starts, [position]) => boolean
+
+This method checks whether the string begins with `starts` at `position` (default: 0).
+
+```javascript
+startsWith("image.gif", "image");
+// => true
+
+startsWith(".vimrc", "vim", 1);
+// => true
+```
+
+#### endsWith(string, ends, [position]) => boolean
+
+This method checks whether the string ends with `ends` at `position` (default: string.length).
+
+```javascript
+endsWith("image.gif", "gif");
+// => true
+
+endsWith("image.old.gif", "old", 9);
+// => true
+```
+
+#### pred(string) => string
+
+Returns the predecessor to str.
+
+```javascript
+pred("b");
+// => "a"
+
+pred("B");
+// => "A"
+```
+
+#### succ(string) => string
+
+Returns the successor to str.
+
+```javascript
+succ("a");
+// => "b"
+
+succ("A");
+// => "B"
+```
+
+
+#### titleize(string) => string
+
+```javascript
+titleize("my name is epeli");
+// => "My Name Is Epeli"
+```
+
+#### camelize(string, [decapitalize=false]) => string
+
+Converts underscored or dasherized string to a camelized one. Begins with
+a lower case letter unless it starts with an underscore, dash or an upper case letter.
+
+```javascript
+camelize("moz-transform");
+// => "mozTransform"
+
+camelize("-moz-transform");
+// => "MozTransform"
+
+camelize("_moz_transform");
+// => "MozTransform"
+
+camelize("Moz-transform");
+// => "MozTransform"
+
+camelize("-moz-transform", true);
+// => "mozTransform"
+```
+
+#### classify(string) => string
+
+Converts string to camelized class name. First letter is always upper case
+
+```javascript
+classify("some_class_name");
+// => "SomeClassName"
+```
+
+#### underscored(string) => string
+
+Converts a camelized or dasherized string into an underscored one
+
+```javascript
+underscored("MozTransform");
+// => "moz_transform"
+```
+
+#### dasherize(string) => string
+
+Converts a underscored or camelized string into an dasherized one
+
+```javascript
+dasherize("MozTransform");
+// => "-moz-transform"
+```
+
+#### humanize(string) => string
+
+Converts an underscored, camelized, or dasherized string into a humanized one.
+Also removes beginning and ending whitespace, and removes the postfix '_id'.
+
+```javascript
+humanize("  capitalize dash-CamelCase_underscore trim  ");
+// => "Capitalize dash camel case underscore trim"
+```
+
+#### trim(string, [characters]) => string
+
+Trims defined characters from begining and ending of the string.
+Defaults to whitespace characters.
+
+```javascript
+trim("  foobar   ");
+// => "foobar"
+
+trim("_-foobar-_", "_-");
+// => "foobar"
+```
+
+
+#### ltrim(string, [characters]) => string
+
+Left trim. Similar to trim, but only for left side.
+
+#### rtrim(string, [characters]) => string
+
+Right trim. Similar to trim, but only for right side.
+
+#### truncate(string, length, [truncateString = '...']) => string
+
+```javascript
+truncate("Hello world", 5);
+// => "Hello..."
+
+truncate("Hello", 10);
+// => "Hello"
+```
+
+#### prune(string, length, pruneString) => string
+
+Elegant version of truncate.  Makes sure the pruned string does not exceed the
+original length.  Avoid half-chopped words when truncating.
+
+```javascript
+prune("Hello, world", 5);
+// => "Hello..."
+
+prune("Hello, world", 8);
+// => "Hello..."
+
+prune("Hello, world", 5, " (read a lot more)");
+// => "Hello, world" (as adding "(read a lot more)" would be longer than the original string)
+
+prune("Hello, cruel world", 15);
+// => "Hello, cruel..."
+
+prune("Hello", 10);
+// => "Hello"
+```
+
+#### words(str, delimiter=/\s+/) => array
+
+Split string by delimiter (String or RegExp), /\s+/ by default.
+
+```javascript
+words("   I   love   you   ");
+// => ["I", "love", "you"]
+
+words("I_love_you", "_");
+// => ["I", "love", "you"]
+
+words("I-love-you", /-/);
+// => ["I", "love", "you"]
+
+words("   ")
+// => []
+```
+
+#### sprintf(string format, ...arguments) => string
+
+C like string formatting. Makes use of the [sprintf-js](https://npmjs.org/package/sprintf-js) package.
+
+**This function will be removed in the next major release, use the [sprintf-js](https://npmjs.org/package/sprintf-js) package instead.**
+
+```javascript
+sprintf("%.1f", 1.17);
+// => "1.2"
+```
+
+#### pad(str, length, [padStr, type]) => string
+
+pads the `str` with characters until the total string length is equal to the passed `length` parameter. By default, pads on the **left** with the space char (`" "`). `padStr` is truncated to a single character if necessary.
+
+```javascript
+pad("1", 8);
+// => "       1"
+
+pad("1", 8, "0");
+// => "00000001"
+
+pad("1", 8, "0", "right");
+// => "10000000"
+
+pad("1", 8, "0", "both");
+// => "00001000"
+
+pad("1", 8, "bleepblorp", "both");
+// => "bbbb1bbb"
+```
+
+#### lpad(str, length, [padStr]) => string
+
+left-pad a string. Alias for `pad(str, length, padStr, "left")`
+
+```javascript
+lpad("1", 8, "0");
+// => "00000001"
+```
+
+#### rpad(str, length, [padStr]) => string
+
+right-pad a string. Alias for `pad(str, length, padStr, "right")`
+
+```javascript
+rpad("1", 8, "0");
+// => "10000000"
+```
+
+#### lrpad(str, length, [padStr]) => string
+
+left/right-pad a string. Alias for `pad(str, length, padStr, "both")`
+
+```javascript
+lrpad("1", 8, '0');
+// => "00001000"
+```
+
+
+#### toNumber(string, [decimals]) => number
+
+Parse string to number. Returns NaN if string can't be parsed to number.
+
+```javascript
+toNumber("2.556");
+// => 3
+
+toNumber("2.556", 1);
+// => 2.6
+
+toNumber("999.999", -1);
+// => 990
+```
+
+#### strRight(string, pattern) => string
+
+Searches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found.
+
+```javascript
+strRight("This_is_a_test_string", "_");
+// => "is_a_test_string"
+```
+
+#### strRightBack(string, pattern) => string
+
+Searches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the right of the pattern or all string if no match found.
+
+```javascript
+strRightBack("This_is_a_test_string", "_");
+// => "string"
+```
+
+#### strLeft(string, pattern) => string
+
+Searches a string from left to right for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found.
+
+```javascript
+strLeft("This_is_a_test_string", "_");
+// => "This";
+```
+
+#### strLeftBack(string, pattern) => string
+
+Searches a string from right to left for a pattern and returns a substring consisting of the characters in the string that are to the left of the pattern or all string if no match found.
+
+```javascript
+strLeftBack("This_is_a_test_string", "_");
+// => "This_is_a_test";
+```
+
+#### stripTags(string) => string
+
+Removes all html tags from string.
+
+```javascript
+stripTags("a <a href=\"#\">link</a>");
+// => "a link"
+
+stripTags("a <a href=\"#\">link</a><script>alert(\"hello world!\")</script>");
+// => "a linkalert("hello world!")"
+```
+
+#### toSentence(array, [delimiter, lastDelimiter]) => string
+
+Join an array into a human readable sentence.
+
+```javascript
+toSentence(["jQuery", "Mootools", "Prototype"]);
+// => "jQuery, Mootools and Prototype";
+
+toSentence(["jQuery", "Mootools", "Prototype"], ", ", " unt ");
+// => "jQuery, Mootools unt Prototype";
+```
+
+#### toSentenceSerial(array, [delimiter, lastDelimiter]) => string
+
+The same as `toSentence`, but adjusts delimeters to use [Serial comma](http://en.wikipedia.org/wiki/Serial_comma).
+
+```javascript
+toSentenceSerial(["jQuery", "Mootools"]);
+// => "jQuery and Mootools"
+
+toSentenceSerial(["jQuery", "Mootools", "Prototype"]);
+// => "jQuery, Mootools, and Prototype"
+
+toSentenceSerial(["jQuery", "Mootools", "Prototype"], ", ", " unt ");
+// => "jQuery, Mootools, unt Prototype"
+```
+
+#### repeat(string, count, [separator]) => string
+
+Repeats a string count times.
+
+```javascript
+repeat("foo", 3);
+// => "foofoofoo"
+
+repeat("foo", 3, "bar");
+// => "foobarfoobarfoo"
+```
+
+#### surround(string, wrap) => string
+
+Surround a string with another string.
+
+```javascript
+surround("foo", "ab");
+// => "abfooab"
+```
+
+#### quote(string, quoteChar) or q(string, quoteChar) => string
+
+Quotes a string. `quoteChar` defaults to `"`.
+
+```javascript
+quote("foo", '"');
+// => '"foo"';
+```
+#### unquote(string, quoteChar) => string
+
+Unquotes a string. `quoteChar` defaults to `"`.
+
+```javascript
+unquote('"foo"');
+// => "foo"
+
+unquote("'foo'", "'");
+// => "foo"
+```
+
+
+#### slugify(string) => string
+
+Transform text into an ascii slug which can be used in safely in URLs. Replaces whitespaces, accentuated, and special characters with a dash. Limited set of non-ascii characters are transformed to similar versions in the ascii character set such as `ä` to `a`.
+
+```javascript
+slugify("Un éléphant à l\'orée du bois");
+// => "un-elephant-a-l-oree-du-bois"
+```
+
+***Caution: this function is charset dependent***
+
+#### naturalCmp(string1, string2) => number
+
+Naturally sort strings like humans would do. None numbers are compared by their [ASCII values](http://www.asciitable.com/). Note: this means "a" > "A". Use `.toLowerCase` if this isn't to be desired.
+
+Just past it to `Array#sort`.
+
+```javascript
+["foo20", "foo5"].sort(naturalCmp);
+// => ["foo5", "foo20"]
+```
+
+#### toBoolean(string) => boolean
+
+Turn strings that can be commonly considered as booleas to real booleans. Such as "true", "false", "1" and "0". This function is case insensitive.
+
+```javascript
+toBoolean("true");
+// => true
+
+toBoolean("FALSE");
+// => false
+
+toBoolean("random");
+// => undefined
+```
+
+It can be customized by giving arrays of truth and falsy value matcher as parameters. Matchers can be also RegExp objects.
+
+```javascript
+toBoolean("truthy", ["truthy"], ["falsy"]);
+// => true
+
+toBoolean("true only at start", [/^true/]);
+// => true
+```
+
+#### map(string, function) => string
+
+Creates a new string with the results of calling a provided function on every character of the given string.
+
+```javascript
+map("Hello world", function(x) {
+  return x;
+});
+// => "Hello world"
+
+map(12345, function(x) {
+  return x;
+});
+// => "12345"
+
+map("Hello world", function(x) {
+  if (x === 'o') x = 'O';
+  return x;
+});
+// => "HellO wOrld"
+```
+
+### Library functions
+
+If you require the full library you can use chaining and aliases
+
+#### s(string) => chain
+
+Start a chain. Returns an immutable chain object with the string functions as
+methods which return a new chain object instead of the plain string value.
+
+The chain object includes also following native Javascript string methods:
+
+  - [toUpperCase](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase)
+  - [toLowerCase](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase)
+  - [split](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split)
+  - [replace](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace)
+  - [slice](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice)
+  - [substring](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/substring)
+  - [substr](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr)
+  - [concat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat)
+
+#### chain.value()
+
+Return the string value from the chain
+
+```javascript
+s("  foo  ").trim().capitalize().value();
+// => "Foo"
+```
+
+When calling a method which does not return a string the resulting value is
+immediately returned
+
+```javascript
+s(" foobar ").trim().startsWith("foo");
+// => true
+```
+
+#### chain.tap(function) => chain
+
+Tap into the chain with a custom function
+
+```javascript
+s("foo").tap(function(value){
+  return value + "bar";
+}).value();
+// => "foobar"
+```
+
+
+#### Aliases
+
+```javascript
+strip     = trim
+lstrip    = ltrim
+rstrip    = rtrim
+center    = lrpad
+rjust     = lpad
+ljust     = rpad
+contains  = include
+q         = quote
+toBool    = toBoolean
+camelcase = camelize
+```
+
+## Maintainers ##
+
+This library is maintained by
+
+  - Esa-Matti Suuronen – ***[@epeli](https://github.com/epeli)***
+  - Christoph Hermann – ***[@stoeffel](https://github.com/stoeffel)***
+
+## Licence ##
+
+The MIT License
+
+Copyright (c) 2011 Esa-Matti Suuronen esa-matti@suuronen.org
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+
+[d]: http://www.diveintojavascript.com/core-javascript-reference/the-string-object
diff --git a/wrt/node_modules/underscore.string/bower.json b/wrt/node_modules/underscore.string/bower.json
new file mode 100644 (file)
index 0000000..3c7c510
--- /dev/null
@@ -0,0 +1,34 @@
+{
+  "name": "underscore.string",
+  "version": "3.3.4",
+  "description": "String manipulation extensions for Underscore.js javascript library.",
+  "homepage": "http://epeli.github.com/underscore.string/",
+  "contributors": [
+    "Esa-Matti Suuronen <esa-matti@suuronen.org> (http://esa-matti.suuronen.org/)",
+    "Edward Tsech <edtsech@gmail.com>",
+    "Pavel Pravosud <pavel@pravosud.com> (<https://github.com/rwz>)",
+    "Sasha Koss <kossnocorp@gmail.com> (http://koss.nocorp.me/)",
+    "Vladimir Dronnikov <dronnikov@gmail.com>",
+    "Pete Kruckenberg (<https://github.com/kruckenb>)",
+    "Paul Chavard <paul@chavard.net> (<http://tchak.net>)",
+    "Ed Finkler <coj@funkatron.com> (<http://funkatron.com>)"
+  ],
+  "keywords": [
+    "underscore",
+    "string"
+  ],
+  "main": "./dist/underscore.string.js",
+  "ignore": [],
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/epeli/underscore.string.git"
+  },
+  "bugs": {
+    "url": "https://github.com/epeli/underscore.string/issues"
+  },
+  "licenses": [
+    {
+      "type": "MIT"
+    }
+  ]
+}
diff --git a/wrt/node_modules/underscore.string/camelize.js b/wrt/node_modules/underscore.string/camelize.js
new file mode 100644 (file)
index 0000000..f7c40e2
--- /dev/null
@@ -0,0 +1,14 @@
+var trim = require('./trim');
+var decap = require('./decapitalize');
+
+module.exports = function camelize(str, decapitalize) {
+  str = trim(str).replace(/[-_\s]+(.)?/g, function(match, c) {
+    return c ? c.toUpperCase() : '';
+  });
+
+  if (decapitalize === true) {
+    return decap(str);
+  } else {
+    return str;
+  }
+};
diff --git a/wrt/node_modules/underscore.string/capitalize.js b/wrt/node_modules/underscore.string/capitalize.js
new file mode 100644 (file)
index 0000000..2693376
--- /dev/null
@@ -0,0 +1,8 @@
+var makeString = require('./helper/makeString');
+
+module.exports = function capitalize(str, lowercaseRest) {
+  str = makeString(str);
+  var remainingChars = !lowercaseRest ? str.slice(1) : str.slice(1).toLowerCase();
+
+  return str.charAt(0).toUpperCase() + remainingChars;
+};
diff --git a/wrt/node_modules/underscore.string/chars.js b/wrt/node_modules/underscore.string/chars.js
new file mode 100644 (file)
index 0000000..d94a901
--- /dev/null
@@ -0,0 +1,5 @@
+var makeString = require('./helper/makeString');
+
+module.exports = function chars(str) {
+  return makeString(str).split('');
+};
diff --git a/wrt/node_modules/underscore.string/chop.js b/wrt/node_modules/underscore.string/chop.js
new file mode 100644 (file)
index 0000000..73e17eb
--- /dev/null
@@ -0,0 +1,6 @@
+module.exports = function chop(str, step) {
+  if (str == null) return [];
+  str = String(str);
+  step = ~~step;
+  return step > 0 ? str.match(new RegExp('.{1,' + step + '}', 'g')) : [str];
+};
diff --git a/wrt/node_modules/underscore.string/classify.js b/wrt/node_modules/underscore.string/classify.js
new file mode 100644 (file)
index 0000000..08547e0
--- /dev/null
@@ -0,0 +1,8 @@
+var capitalize = require('./capitalize');
+var camelize = require('./camelize');
+var makeString = require('./helper/makeString');
+
+module.exports = function classify(str) {
+  str = makeString(str);
+  return capitalize(camelize(str.replace(/[\W_]/g, ' ')).replace(/\s/g, ''));
+};
diff --git a/wrt/node_modules/underscore.string/clean.js b/wrt/node_modules/underscore.string/clean.js
new file mode 100644 (file)
index 0000000..16a09d0
--- /dev/null
@@ -0,0 +1,5 @@
+var trim = require('./trim');
+
+module.exports = function clean(str) {
+  return trim(str).replace(/\s\s+/g, ' ');
+};
diff --git a/wrt/node_modules/underscore.string/cleanDiacritics.js b/wrt/node_modules/underscore.string/cleanDiacritics.js
new file mode 100644 (file)
index 0000000..d877006
--- /dev/null
@@ -0,0 +1,22 @@
+
+var makeString = require('./helper/makeString');
+
+var from  = 'ąàáäâãåæăćčĉęèéëêĝĥìíïîĵłľńňòóöőôõðøśșşšŝťțţŭùúüűûñÿýçżźž',
+  to    = 'aaaaaaaaaccceeeeeghiiiijllnnoooooooossssstttuuuuuunyyczzz';
+
+from += from.toUpperCase();
+to += to.toUpperCase();
+
+to = to.split('');
+
+// for tokens requireing multitoken output
+from += 'ß';
+to.push('ss');
+
+
+module.exports = function cleanDiacritics(str) {
+  return makeString(str).replace(/.{1}/g, function(c){
+    var index = from.indexOf(c);
+    return index === -1 ? c : to[index];
+  });
+};
diff --git a/wrt/node_modules/underscore.string/component.json b/wrt/node_modules/underscore.string/component.json
new file mode 100644 (file)
index 0000000..badca5b
--- /dev/null
@@ -0,0 +1,16 @@
+{
+  "name": "underscore.string",
+  "repo": "epeli/underscore.string",
+  "description": "String manipulation extensions for Underscore.js javascript library",
+  "version": "3.3.4",
+  "keywords": [
+    "underscore",
+    "string"
+  ],
+  "dependencies": {},
+  "development": {},
+  "main": "index.js",
+  "scripts": [
+    "*.js"
+  ]
+}
diff --git a/wrt/node_modules/underscore.string/count.js b/wrt/node_modules/underscore.string/count.js
new file mode 100644 (file)
index 0000000..2207d70
--- /dev/null
@@ -0,0 +1,10 @@
+var makeString = require('./helper/makeString');
+
+module.exports = function(str, substr) {
+  str = makeString(str);
+  substr = makeString(substr);
+
+  if (str.length === 0 || substr.length === 0) return 0;
+  
+  return str.split(substr).length - 1;
+};
diff --git a/wrt/node_modules/underscore.string/dasherize.js b/wrt/node_modules/underscore.string/dasherize.js
new file mode 100644 (file)
index 0000000..544ae0c
--- /dev/null
@@ -0,0 +1,5 @@
+var trim = require('./trim');
+
+module.exports = function dasherize(str) {
+  return trim(str).replace(/([A-Z])/g, '-$1').replace(/[-_\s]+/g, '-').toLowerCase();
+};
diff --git a/wrt/node_modules/underscore.string/decapitalize.js b/wrt/node_modules/underscore.string/decapitalize.js
new file mode 100644 (file)
index 0000000..6aa2673
--- /dev/null
@@ -0,0 +1,6 @@
+var makeString = require('./helper/makeString');
+
+module.exports = function decapitalize(str) {
+  str = makeString(str);
+  return str.charAt(0).toLowerCase() + str.slice(1);
+};
diff --git a/wrt/node_modules/underscore.string/dedent.js b/wrt/node_modules/underscore.string/dedent.js
new file mode 100644 (file)
index 0000000..41b4f07
--- /dev/null
@@ -0,0 +1,28 @@
+var makeString = require('./helper/makeString');
+
+function getIndent(str) {
+  var matches = str.match(/^[\s\\t]*/gm);
+  var indent = matches[0].length;
+  
+  for (var i = 1; i < matches.length; i++) {
+    indent = Math.min(matches[i].length, indent);
+  }
+
+  return indent;
+}
+
+module.exports = function dedent(str, pattern) {
+  str = makeString(str);
+  var indent = getIndent(str);
+  var reg;
+
+  if (indent === 0) return str;
+
+  if (typeof pattern === 'string') {
+    reg = new RegExp('^' + pattern, 'gm');
+  } else {
+    reg = new RegExp('^[ \\t]{' + indent + '}', 'gm');
+  }
+
+  return str.replace(reg, '');
+};
diff --git a/wrt/node_modules/underscore.string/dist/underscore.string.js b/wrt/node_modules/underscore.string/dist/underscore.string.js
new file mode 100644 (file)
index 0000000..884ccc3
--- /dev/null
@@ -0,0 +1,1369 @@
+/*
+* Underscore.string
+* (c) 2010 Esa-Matti Suuronen <esa-matti aet suuronen dot org>
+* Underscore.string is freely distributable under the terms of the MIT license.
+* Documentation: https://github.com/epeli/underscore.string
+* Some code is borrowed from MooTools and Alexandru Marasteanu.
+* Version '3.3.4'
+* @preserve
+*/
+
+(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.s = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
+var trim = require('./trim');
+var decap = require('./decapitalize');
+
+module.exports = function camelize(str, decapitalize) {
+  str = trim(str).replace(/[-_\s]+(.)?/g, function(match, c) {
+    return c ? c.toUpperCase() : '';
+  });
+
+  if (decapitalize === true) {
+    return decap(str);
+  } else {
+    return str;
+  }
+};
+
+},{"./decapitalize":10,"./trim":65}],2:[function(require,module,exports){
+var makeString = require('./helper/makeString');
+
+module.exports = function capitalize(str, lowercaseRest) {
+  str = makeString(str);
+  var remainingChars = !lowercaseRest ? str.slice(1) : str.slice(1).toLowerCase();
+
+  return str.charAt(0).toUpperCase() + remainingChars;
+};
+
+},{"./helper/makeString":20}],3:[function(require,module,exports){
+var makeString = require('./helper/makeString');
+
+module.exports = function chars(str) {
+  return makeString(str).split('');
+};
+
+},{"./helper/makeString":20}],4:[function(require,module,exports){
+module.exports = function chop(str, step) {
+  if (str == null) return [];
+  str = String(str);
+  step = ~~step;
+  return step > 0 ? str.match(new RegExp('.{1,' + step + '}', 'g')) : [str];
+};
+
+},{}],5:[function(require,module,exports){
+var capitalize = require('./capitalize');
+var camelize = require('./camelize');
+var makeString = require('./helper/makeString');
+
+module.exports = function classify(str) {
+  str = makeString(str);
+  return capitalize(camelize(str.replace(/[\W_]/g, ' ')).replace(/\s/g, ''));
+};
+
+},{"./camelize":1,"./capitalize":2,"./helper/makeString":20}],6:[function(require,module,exports){
+var trim = require('./trim');
+
+module.exports = function clean(str) {
+  return trim(str).replace(/\s\s+/g, ' ');
+};
+
+},{"./trim":65}],7:[function(require,module,exports){
+
+var makeString = require('./helper/makeString');
+
+var from  = 'ąàáäâãåæăćčĉęèéëêĝĥìíïîĵłľńňòóöőôõðøśșşšŝťțţŭùúüűûñÿýçżźž',
+  to    = 'aaaaaaaaaccceeeeeghiiiijllnnoooooooossssstttuuuuuunyyczzz';
+
+from += from.toUpperCase();
+to += to.toUpperCase();
+
+to = to.split('');
+
+// for tokens requireing multitoken output
+from += 'ß';
+to.push('ss');
+
+
+module.exports = function cleanDiacritics(str) {
+  return makeString(str).replace(/.{1}/g, function(c){
+    var index = from.indexOf(c);
+    return index === -1 ? c : to[index];
+  });
+};
+
+},{"./helper/makeString":20}],8:[function(require,module,exports){
+var makeString = require('./helper/makeString');
+
+module.exports = function(str, substr) {
+  str = makeString(str);
+  substr = makeString(substr);
+
+  if (str.length === 0 || substr.length === 0) return 0;
+  
+  return str.split(substr).length - 1;
+};
+
+},{"./helper/makeString":20}],9:[function(require,module,exports){
+var trim = require('./trim');
+
+module.exports = function dasherize(str) {
+  return trim(str).replace(/([A-Z])/g, '-$1').replace(/[-_\s]+/g, '-').toLowerCase();
+};
+
+},{"./trim":65}],10:[function(require,module,exports){
+var makeString = require('./helper/makeString');
+
+module.exports = function decapitalize(str) {
+  str = makeString(str);
+  return str.charAt(0).toLowerCase() + str.slice(1);
+};
+
+},{"./helper/makeString":20}],11:[function(require,module,exports){
+var makeString = require('./helper/makeString');
+
+function getIndent(str) {
+  var matches = str.match(/^[\s\\t]*/gm);
+  var indent = matches[0].length;
+  
+  for (var i = 1; i < matches.length; i++) {
+    indent = Math.min(matches[i].length, indent);
+  }
+
+  return indent;
+}
+
+module.exports = function dedent(str, pattern) {
+  str = makeString(str);
+  var indent = getIndent(str);
+  var reg;
+
+  if (indent === 0) return str;
+
+  if (typeof pattern === 'string') {
+    reg = new RegExp('^' + pattern, 'gm');
+  } else {
+    reg = new RegExp('^[ \\t]{' + indent + '}', 'gm');
+  }
+
+  return str.replace(reg, '');
+};
+
+},{"./helper/makeString":20}],12:[function(require,module,exports){
+var makeString = require('./helper/makeString');
+var toPositive = require('./helper/toPositive');
+
+module.exports = function endsWith(str, ends, position) {
+  str = makeString(str);
+  ends = '' + ends;
+  if (typeof position == 'undefined') {
+    position = str.length - ends.length;
+  } else {
+    position = Math.min(toPositive(position), str.length) - ends.length;
+  }
+  return position >= 0 && str.indexOf(ends, position) === position;
+};
+
+},{"./helper/makeString":20,"./helper/toPositive":22}],13:[function(require,module,exports){
+var makeString = require('./helper/makeString');
+var escapeChars = require('./helper/escapeChars');
+
+var regexString = '[';
+for(var key in escapeChars) {
+  regexString += key;
+}
+regexString += ']';
+
+var regex = new RegExp( regexString, 'g');
+
+module.exports = function escapeHTML(str) {
+
+  return makeString(str).replace(regex, function(m) {
+    return '&' + escapeChars[m] + ';';
+  });
+};
+
+},{"./helper/escapeChars":17,"./helper/makeString":20}],14:[function(require,module,exports){
+module.exports = function() {
+  var result = {};
+
+  for (var prop in this) {
+    if (!this.hasOwnProperty(prop) || prop.match(/^(?:include|contains|reverse|join|map|wrap)$/)) continue;
+    result[prop] = this[prop];
+  }
+
+  return result;
+};
+
+},{}],15:[function(require,module,exports){
+var makeString = require('./makeString');
+
+module.exports = function adjacent(str, direction) {
+  str = makeString(str);
+  if (str.length === 0) {
+    return '';
+  }
+  return str.slice(0, -1) + String.fromCharCode(str.charCodeAt(str.length - 1) + direction);
+};
+
+},{"./makeString":20}],16:[function(require,module,exports){
+var escapeRegExp = require('./escapeRegExp');
+
+module.exports = function defaultToWhiteSpace(characters) {
+  if (characters == null)
+    return '\\s';
+  else if (characters.source)
+    return characters.source;
+  else
+    return '[' + escapeRegExp(characters) + ']';
+};
+
+},{"./escapeRegExp":18}],17:[function(require,module,exports){
+/* We're explicitly defining the list of entities we want to escape.
+nbsp is an HTML entity, but we don't want to escape all space characters in a string, hence its omission in this map.
+
+*/
+var escapeChars = {
+  '¢' : 'cent',
+  '£' : 'pound',
+  '¥' : 'yen',
+  '€': 'euro',
+  '©' :'copy',
+  '®' : 'reg',
+  '<' : 'lt',
+  '>' : 'gt',
+  '"' : 'quot',
+  '&' : 'amp',
+  '\'' : '#39'
+};
+
+module.exports = escapeChars;
+
+},{}],18:[function(require,module,exports){
+var makeString = require('./makeString');
+
+module.exports = function escapeRegExp(str) {
+  return makeString(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
+};
+
+},{"./makeString":20}],19:[function(require,module,exports){
+/*
+We're explicitly defining the list of entities that might see in escape HTML strings
+*/
+var htmlEntities = {
+  nbsp: ' ',
+  cent: '¢',
+  pound: '£',
+  yen: '¥',
+  euro: '€',
+  copy: '©',
+  reg: '®',
+  lt: '<',
+  gt: '>',
+  quot: '"',
+  amp: '&',
+  apos: '\''
+};
+
+module.exports = htmlEntities;
+
+},{}],20:[function(require,module,exports){
+/**
+ * Ensure some object is a coerced to a string
+ **/
+module.exports = function makeString(object) {
+  if (object == null) return '';
+  return '' + object;
+};
+
+},{}],21:[function(require,module,exports){
+module.exports = function strRepeat(str, qty){
+  if (qty < 1) return '';
+  var result = '';
+  while (qty > 0) {
+    if (qty & 1) result += str;
+    qty >>= 1, str += str;
+  }
+  return result;
+};
+
+},{}],22:[function(require,module,exports){
+module.exports = function toPositive(number) {
+  return number < 0 ? 0 : (+number || 0);
+};
+
+},{}],23:[function(require,module,exports){
+var capitalize = require('./capitalize');
+var underscored = require('./underscored');
+var trim = require('./trim');
+
+module.exports = function humanize(str) {
+  return capitalize(trim(underscored(str).replace(/_id$/, '').replace(/_/g, ' ')));
+};
+
+},{"./capitalize":2,"./trim":65,"./underscored":67}],24:[function(require,module,exports){
+var makeString = require('./helper/makeString');
+
+module.exports = function include(str, needle) {
+  if (needle === '') return true;
+  return makeString(str).indexOf(needle) !== -1;
+};
+
+},{"./helper/makeString":20}],25:[function(require,module,exports){
+/*
+* Underscore.string
+* (c) 2010 Esa-Matti Suuronen <esa-matti aet suuronen dot org>
+* Underscore.string is freely distributable under the terms of the MIT license.
+* Documentation: https://github.com/epeli/underscore.string
+* Some code is borrowed from MooTools and Alexandru Marasteanu.
+* Version '3.3.4'
+* @preserve
+*/
+
+'use strict';
+
+function s(value) {
+  /* jshint validthis: true */
+  if (!(this instanceof s)) return new s(value);
+  this._wrapped = value;
+}
+
+s.VERSION = '3.3.4';
+
+s.isBlank          = require('./isBlank');
+s.stripTags        = require('./stripTags');
+s.capitalize       = require('./capitalize');
+s.decapitalize     = require('./decapitalize');
+s.chop             = require('./chop');
+s.trim             = require('./trim');
+s.clean            = require('./clean');
+s.cleanDiacritics  = require('./cleanDiacritics');
+s.count            = require('./count');
+s.chars            = require('./chars');
+s.swapCase         = require('./swapCase');
+s.escapeHTML       = require('./escapeHTML');
+s.unescapeHTML     = require('./unescapeHTML');
+s.splice           = require('./splice');
+s.insert           = require('./insert');
+s.replaceAll       = require('./replaceAll');
+s.include          = require('./include');
+s.join             = require('./join');
+s.lines            = require('./lines');
+s.dedent           = require('./dedent');
+s.reverse          = require('./reverse');
+s.startsWith       = require('./startsWith');
+s.endsWith         = require('./endsWith');
+s.pred             = require('./pred');
+s.succ             = require('./succ');
+s.titleize         = require('./titleize');
+s.camelize         = require('./camelize');
+s.underscored      = require('./underscored');
+s.dasherize        = require('./dasherize');
+s.classify         = require('./classify');
+s.humanize         = require('./humanize');
+s.ltrim            = require('./ltrim');
+s.rtrim            = require('./rtrim');
+s.truncate         = require('./truncate');
+s.prune            = require('./prune');
+s.words            = require('./words');
+s.pad              = require('./pad');
+s.lpad             = require('./lpad');
+s.rpad             = require('./rpad');
+s.lrpad            = require('./lrpad');
+s.sprintf          = require('./sprintf');
+s.vsprintf         = require('./vsprintf');
+s.toNumber         = require('./toNumber');
+s.numberFormat     = require('./numberFormat');
+s.strRight         = require('./strRight');
+s.strRightBack     = require('./strRightBack');
+s.strLeft          = require('./strLeft');
+s.strLeftBack      = require('./strLeftBack');
+s.toSentence       = require('./toSentence');
+s.toSentenceSerial = require('./toSentenceSerial');
+s.slugify          = require('./slugify');
+s.surround         = require('./surround');
+s.quote            = require('./quote');
+s.unquote          = require('./unquote');
+s.repeat           = require('./repeat');
+s.naturalCmp       = require('./naturalCmp');
+s.levenshtein      = require('./levenshtein');
+s.toBoolean        = require('./toBoolean');
+s.exports          = require('./exports');
+s.escapeRegExp     = require('./helper/escapeRegExp');
+s.wrap             = require('./wrap');
+s.map              = require('./map');
+
+// Aliases
+s.strip     = s.trim;
+s.lstrip    = s.ltrim;
+s.rstrip    = s.rtrim;
+s.center    = s.lrpad;
+s.rjust     = s.lpad;
+s.ljust     = s.rpad;
+s.contains  = s.include;
+s.q         = s.quote;
+s.toBool    = s.toBoolean;
+s.camelcase = s.camelize;
+s.mapChars  = s.map;
+
+
+// Implement chaining
+s.prototype = {
+  value: function value() {
+    return this._wrapped;
+  }
+};
+
+function fn2method(key, fn) {
+  if (typeof fn !== 'function') return;
+  s.prototype[key] = function() {
+    var args = [this._wrapped].concat(Array.prototype.slice.call(arguments));
+    var res = fn.apply(null, args);
+    // if the result is non-string stop the chain and return the value
+    return typeof res === 'string' ? new s(res) : res;
+  };
+}
+
+// Copy functions to instance methods for chaining
+for (var key in s) fn2method(key, s[key]);
+
+fn2method('tap', function tap(string, fn) {
+  return fn(string);
+});
+
+function prototype2method(methodName) {
+  fn2method(methodName, function(context) {
+    var args = Array.prototype.slice.call(arguments, 1);
+    return String.prototype[methodName].apply(context, args);
+  });
+}
+
+var prototypeMethods = [
+  'toUpperCase',
+  'toLowerCase',
+  'split',
+  'replace',
+  'slice',
+  'substring',
+  'substr',
+  'concat'
+];
+
+for (var method in prototypeMethods) prototype2method(prototypeMethods[method]);
+
+
+module.exports = s;
+
+},{"./camelize":1,"./capitalize":2,"./chars":3,"./chop":4,"./classify":5,"./clean":6,"./cleanDiacritics":7,"./count":8,"./dasherize":9,"./decapitalize":10,"./dedent":11,"./endsWith":12,"./escapeHTML":13,"./exports":14,"./helper/escapeRegExp":18,"./humanize":23,"./include":24,"./insert":26,"./isBlank":27,"./join":28,"./levenshtein":29,"./lines":30,"./lpad":31,"./lrpad":32,"./ltrim":33,"./map":34,"./naturalCmp":35,"./numberFormat":38,"./pad":39,"./pred":40,"./prune":41,"./quote":42,"./repeat":43,"./replaceAll":44,"./reverse":45,"./rpad":46,"./rtrim":47,"./slugify":48,"./splice":49,"./sprintf":50,"./startsWith":51,"./strLeft":52,"./strLeftBack":53,"./strRight":54,"./strRightBack":55,"./stripTags":56,"./succ":57,"./surround":58,"./swapCase":59,"./titleize":60,"./toBoolean":61,"./toNumber":62,"./toSentence":63,"./toSentenceSerial":64,"./trim":65,"./truncate":66,"./underscored":67,"./unescapeHTML":68,"./unquote":69,"./vsprintf":70,"./words":71,"./wrap":72}],26:[function(require,module,exports){
+var splice = require('./splice');
+
+module.exports = function insert(str, i, substr) {
+  return splice(str, i, 0, substr);
+};
+
+},{"./splice":49}],27:[function(require,module,exports){
+var makeString = require('./helper/makeString');
+
+module.exports = function isBlank(str) {
+  return (/^\s*$/).test(makeString(str));
+};
+
+},{"./helper/makeString":20}],28:[function(require,module,exports){
+var makeString = require('./helper/makeString');
+var slice = [].slice;
+
+module.exports = function join() {
+  var args = slice.call(arguments),
+    separator = args.shift();
+
+  return args.join(makeString(separator));
+};
+
+},{"./helper/makeString":20}],29:[function(require,module,exports){
+var makeString = require('./helper/makeString');
+
+/**
+ * Based on the implementation here: https://github.com/hiddentao/fast-levenshtein
+ */
+module.exports = function levenshtein(str1, str2) {
+  'use strict';
+  str1 = makeString(str1);
+  str2 = makeString(str2);
+
+  // Short cut cases  
+  if (str1 === str2) return 0;
+  if (!str1 || !str2) return Math.max(str1.length, str2.length);
+
+  // two rows
+  var prevRow = new Array(str2.length + 1);
+
+  // initialise previous row
+  for (var i = 0; i < prevRow.length; ++i) {
+    prevRow[i] = i;
+  }
+
+  // calculate current row distance from previous row
+  for (i = 0; i < str1.length; ++i) {
+    var nextCol = i + 1;
+
+    for (var j = 0; j < str2.length; ++j) {
+      var curCol = nextCol;
+
+      // substution
+      nextCol = prevRow[j] + ( (str1.charAt(i) === str2.charAt(j)) ? 0 : 1 );
+      // insertion
+      var tmp = curCol + 1;
+      if (nextCol > tmp) {
+        nextCol = tmp;
+      }
+      // deletion
+      tmp = prevRow[j + 1] + 1;
+      if (nextCol > tmp) {
+        nextCol = tmp;
+      }
+
+      // copy current col value into previous (in preparation for next iteration)
+      prevRow[j] = curCol;
+    }
+
+    // copy last col value into previous (in preparation for next iteration)
+    prevRow[j] = nextCol;
+  }
+
+  return nextCol;
+};
+
+},{"./helper/makeString":20}],30:[function(require,module,exports){
+module.exports = function lines(str) {
+  if (str == null) return [];
+  return String(str).split(/\r\n?|\n/);
+};
+
+},{}],31:[function(require,module,exports){
+var pad = require('./pad');
+
+module.exports = function lpad(str, length, padStr) {
+  return pad(str, length, padStr);
+};
+
+},{"./pad":39}],32:[function(require,module,exports){
+var pad = require('./pad');
+
+module.exports = function lrpad(str, length, padStr) {
+  return pad(str, length, padStr, 'both');
+};
+
+},{"./pad":39}],33:[function(require,module,exports){
+var makeString = require('./helper/makeString');
+var defaultToWhiteSpace = require('./helper/defaultToWhiteSpace');
+var nativeTrimLeft = String.prototype.trimLeft;
+
+module.exports = function ltrim(str, characters) {
+  str = makeString(str);
+  if (!characters && nativeTrimLeft) return nativeTrimLeft.call(str);
+  characters = defaultToWhiteSpace(characters);
+  return str.replace(new RegExp('^' + characters + '+'), '');
+};
+
+},{"./helper/defaultToWhiteSpace":16,"./helper/makeString":20}],34:[function(require,module,exports){
+var makeString = require('./helper/makeString');
+
+module.exports = function(str, callback) {
+  str = makeString(str);
+
+  if (str.length === 0 || typeof callback !== 'function') return str;
+
+  return str.replace(/./g, callback);
+};
+
+},{"./helper/makeString":20}],35:[function(require,module,exports){
+module.exports = function naturalCmp(str1, str2) {
+  if (str1 == str2) return 0;
+  if (!str1) return -1;
+  if (!str2) return 1;
+
+  var cmpRegex = /(\.\d+|\d+|\D+)/g,
+    tokens1 = String(str1).match(cmpRegex),
+    tokens2 = String(str2).match(cmpRegex),
+    count = Math.min(tokens1.length, tokens2.length);
+
+  for (var i = 0; i < count; i++) {
+    var a = tokens1[i],
+      b = tokens2[i];
+
+    if (a !== b) {
+      var num1 = +a;
+      var num2 = +b;
+      if (num1 === num1 && num2 === num2) {
+        return num1 > num2 ? 1 : -1;
+      }
+      return a < b ? -1 : 1;
+    }
+  }
+
+  if (tokens1.length != tokens2.length)
+    return tokens1.length - tokens2.length;
+
+  return str1 < str2 ? -1 : 1;
+};
+
+},{}],36:[function(require,module,exports){
+(function(window) {
+    var re = {
+        not_string: /[^s]/,
+        number: /[diefg]/,
+        json: /[j]/,
+        not_json: /[^j]/,
+        text: /^[^\x25]+/,
+        modulo: /^\x25{2}/,
+        placeholder: /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,
+        key: /^([a-z_][a-z_\d]*)/i,
+        key_access: /^\.([a-z_][a-z_\d]*)/i,
+        index_access: /^\[(\d+)\]/,
+        sign: /^[\+\-]/
+    }
+
+    function sprintf() {
+        var key = arguments[0], cache = sprintf.cache
+        if (!(cache[key] && cache.hasOwnProperty(key))) {
+            cache[key] = sprintf.parse(key)
+        }
+        return sprintf.format.call(null, cache[key], arguments)
+    }
+
+    sprintf.format = function(parse_tree, argv) {
+        var cursor = 1, tree_length = parse_tree.length, node_type = "", arg, output = [], i, k, match, pad, pad_character, pad_length, is_positive = true, sign = ""
+        for (i = 0; i < tree_length; i++) {
+            node_type = get_type(parse_tree[i])
+            if (node_type === "string") {
+                output[output.length] = parse_tree[i]
+            }
+            else if (node_type === "array") {
+                match = parse_tree[i] // convenience purposes only
+                if (match[2]) { // keyword argument
+                    arg = argv[cursor]
+                    for (k = 0; k < match[2].length; k++) {
+                        if (!arg.hasOwnProperty(match[2][k])) {
+                            throw new Error(sprintf("[sprintf] property '%s' does not exist", match[2][k]))
+                        }
+                        arg = arg[match[2][k]]
+                    }
+                }
+                else if (match[1]) { // positional argument (explicit)
+                    arg = argv[match[1]]
+                }
+                else { // positional argument (implicit)
+                    arg = argv[cursor++]
+                }
+
+                if (get_type(arg) == "function") {
+                    arg = arg()
+                }
+
+                if (re.not_string.test(match[8]) && re.not_json.test(match[8]) && (get_type(arg) != "number" && isNaN(arg))) {
+                    throw new TypeError(sprintf("[sprintf] expecting number but found %s", get_type(arg)))
+                }
+
+                if (re.number.test(match[8])) {
+                    is_positive = arg >= 0
+                }
+
+                switch (match[8]) {
+                    case "b":
+                        arg = arg.toString(2)
+                    break
+                    case "c":
+                        arg = String.fromCharCode(arg)
+                    break
+                    case "d":
+                    case "i":
+                        arg = parseInt(arg, 10)
+                    break
+                    case "j":
+                        arg = JSON.stringify(arg, null, match[6] ? parseInt(match[6]) : 0)
+                    break
+                    case "e":
+                        arg = match[7] ? arg.toExponential(match[7]) : arg.toExponential()
+                    break
+                    case "f":
+                        arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg)
+                    break
+                    case "g":
+                        arg = match[7] ? parseFloat(arg).toPrecision(match[7]) : parseFloat(arg)
+                    break
+                    case "o":
+                        arg = arg.toString(8)
+                    break
+                    case "s":
+                        arg = ((arg = String(arg)) && match[7] ? arg.substring(0, match[7]) : arg)
+                    break
+                    case "u":
+                        arg = arg >>> 0
+                    break
+                    case "x":
+                        arg = arg.toString(16)
+                    break
+                    case "X":
+                        arg = arg.toString(16).toUpperCase()
+                    break
+                }
+                if (re.json.test(match[8])) {
+                    output[output.length] = arg
+                }
+                else {
+                    if (re.number.test(match[8]) && (!is_positive || match[3])) {
+                        sign = is_positive ? "+" : "-"
+                        arg = arg.toString().replace(re.sign, "")
+                    }
+                    else {
+                        sign = ""
+                    }
+                    pad_character = match[4] ? match[4] === "0" ? "0" : match[4].charAt(1) : " "
+                    pad_length = match[6] - (sign + arg).length
+                    pad = match[6] ? (pad_length > 0 ? str_repeat(pad_character, pad_length) : "") : ""
+                    output[output.length] = match[5] ? sign + arg + pad : (pad_character === "0" ? sign + pad + arg : pad + sign + arg)
+                }
+            }
+        }
+        return output.join("")
+    }
+
+    sprintf.cache = {}
+
+    sprintf.parse = function(fmt) {
+        var _fmt = fmt, match = [], parse_tree = [], arg_names = 0
+        while (_fmt) {
+            if ((match = re.text.exec(_fmt)) !== null) {
+                parse_tree[parse_tree.length] = match[0]
+            }
+            else if ((match = re.modulo.exec(_fmt)) !== null) {
+                parse_tree[parse_tree.length] = "%"
+            }
+            else if ((match = re.placeholder.exec(_fmt)) !== null) {
+                if (match[2]) {
+                    arg_names |= 1
+                    var field_list = [], replacement_field = match[2], field_match = []
+                    if ((field_match = re.key.exec(replacement_field)) !== null) {
+                        field_list[field_list.length] = field_match[1]
+                        while ((replacement_field = replacement_field.substring(field_match[0].length)) !== "") {
+                            if ((field_match = re.key_access.exec(replacement_field)) !== null) {
+                                field_list[field_list.length] = field_match[1]
+                            }
+                            else if ((field_match = re.index_access.exec(replacement_field)) !== null) {
+                                field_list[field_list.length] = field_match[1]
+                            }
+                            else {
+                                throw new SyntaxError("[sprintf] failed to parse named argument key")
+                            }
+                        }
+                    }
+                    else {
+                        throw new SyntaxError("[sprintf] failed to parse named argument key")
+                    }
+                    match[2] = field_list
+                }
+                else {
+                    arg_names |= 2
+                }
+                if (arg_names === 3) {
+                    throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported")
+                }
+                parse_tree[parse_tree.length] = match
+            }
+            else {
+                throw new SyntaxError("[sprintf] unexpected placeholder")
+            }
+            _fmt = _fmt.substring(match[0].length)
+        }
+        return parse_tree
+    }
+
+    var vsprintf = function(fmt, argv, _argv) {
+        _argv = (argv || []).slice(0)
+        _argv.splice(0, 0, fmt)
+        return sprintf.apply(null, _argv)
+    }
+
+    /**
+     * helpers
+     */
+    function get_type(variable) {
+        return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase()
+    }
+
+    function str_repeat(input, multiplier) {
+        return Array(multiplier + 1).join(input)
+    }
+
+    /**
+     * export to either browser or node.js
+     */
+    if (typeof exports !== "undefined") {
+        exports.sprintf = sprintf
+        exports.vsprintf = vsprintf
+    }
+    else {
+        window.sprintf = sprintf
+        window.vsprintf = vsprintf
+
+        if (typeof define === "function" && define.amd) {
+            define(function() {
+                return {
+                    sprintf: sprintf,
+                    vsprintf: vsprintf
+                }
+            })
+        }
+    }
+})(typeof window === "undefined" ? this : window);
+
+},{}],37:[function(require,module,exports){
+(function (global){
+
+/**
+ * Module exports.
+ */
+
+module.exports = deprecate;
+
+/**
+ * Mark that a method should not be used.
+ * Returns a modified function which warns once by default.
+ *
+ * If `localStorage.noDeprecation = true` is set, then it is a no-op.
+ *
+ * If `localStorage.throwDeprecation = true` is set, then deprecated functions
+ * will throw an Error when invoked.
+ *
+ * If `localStorage.traceDeprecation = true` is set, then deprecated functions
+ * will invoke `console.trace()` instead of `console.error()`.
+ *
+ * @param {Function} fn - the function to deprecate
+ * @param {String} msg - the string to print to the console when `fn` is invoked
+ * @returns {Function} a new "deprecated" version of `fn`
+ * @api public
+ */
+
+function deprecate (fn, msg) {
+  if (config('noDeprecation')) {
+    return fn;
+  }
+
+  var warned = false;
+  function deprecated() {
+    if (!warned) {
+      if (config('throwDeprecation')) {
+        throw new Error(msg);
+      } else if (config('traceDeprecation')) {
+        console.trace(msg);
+      } else {
+        console.warn(msg);
+      }
+      warned = true;
+    }
+    return fn.apply(this, arguments);
+  }
+
+  return deprecated;
+}
+
+/**
+ * Checks `localStorage` for boolean values for the given `name`.
+ *
+ * @param {String} name
+ * @returns {Boolean}
+ * @api private
+ */
+
+function config (name) {
+  // accessing global.localStorage can trigger a DOMException in sandboxed iframes
+  try {
+    if (!global.localStorage) return false;
+  } catch (_) {
+    return false;
+  }
+  var val = global.localStorage[name];
+  if (null == val) return false;
+  return String(val).toLowerCase() === 'true';
+}
+
+}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
+},{}],38:[function(require,module,exports){
+module.exports = function numberFormat(number, dec, dsep, tsep) {
+  if (isNaN(number) || number == null) return '';
+
+  number = number.toFixed(~~dec);
+  tsep = typeof tsep == 'string' ? tsep : ',';
+
+  var parts = number.split('.'),
+    fnums = parts[0],
+    decimals = parts[1] ? (dsep || '.') + parts[1] : '';
+
+  return fnums.replace(/(\d)(?=(?:\d{3})+$)/g, '$1' + tsep) + decimals;
+};
+
+},{}],39:[function(require,module,exports){
+var makeString = require('./helper/makeString');
+var strRepeat = require('./helper/strRepeat');
+
+module.exports = function pad(str, length, padStr, type) {
+  str = makeString(str);
+  length = ~~length;
+
+  var padlen = 0;
+
+  if (!padStr)
+    padStr = ' ';
+  else if (padStr.length > 1)
+    padStr = padStr.charAt(0);
+
+  switch (type) {
+  case 'right':
+    padlen = length - str.length;
+    return str + strRepeat(padStr, padlen);
+  case 'both':
+    padlen = length - str.length;
+    return strRepeat(padStr, Math.ceil(padlen / 2)) + str + strRepeat(padStr, Math.floor(padlen / 2));
+  default: // 'left'
+    padlen = length - str.length;
+    return strRepeat(padStr, padlen) + str;
+  }
+};
+
+},{"./helper/makeString":20,"./helper/strRepeat":21}],40:[function(require,module,exports){
+var adjacent = require('./helper/adjacent');
+
+module.exports = function succ(str) {
+  return adjacent(str, -1);
+};
+
+},{"./helper/adjacent":15}],41:[function(require,module,exports){
+/**
+ * _s.prune: a more elegant version of truncate
+ * prune extra chars, never leaving a half-chopped word.
+ * @author github.com/rwz
+ */
+var makeString = require('./helper/makeString');
+var rtrim = require('./rtrim');
+
+module.exports = function prune(str, length, pruneStr) {
+  str = makeString(str);
+  length = ~~length;
+  pruneStr = pruneStr != null ? String(pruneStr) : '...';
+
+  if (str.length <= length) return str;
+
+  var tmpl = function(c) {
+      return c.toUpperCase() !== c.toLowerCase() ? 'A' : ' ';
+    },
+    template = str.slice(0, length + 1).replace(/.(?=\W*\w*$)/g, tmpl); // 'Hello, world' -> 'HellAA AAAAA'
+
+  if (template.slice(template.length - 2).match(/\w\w/))
+    template = template.replace(/\s*\S+$/, '');
+  else
+    template = rtrim(template.slice(0, template.length - 1));
+
+  return (template + pruneStr).length > str.length ? str : str.slice(0, template.length) + pruneStr;
+};
+
+},{"./helper/makeString":20,"./rtrim":47}],42:[function(require,module,exports){
+var surround = require('./surround');
+
+module.exports = function quote(str, quoteChar) {
+  return surround(str, quoteChar || '"');
+};
+
+},{"./surround":58}],43:[function(require,module,exports){
+var makeString = require('./helper/makeString');
+var strRepeat = require('./helper/strRepeat');
+
+module.exports = function repeat(str, qty, separator) {
+  str = makeString(str);
+
+  qty = ~~qty;
+
+  // using faster implementation if separator is not needed;
+  if (separator == null) return strRepeat(str, qty);
+
+  // this one is about 300x slower in Google Chrome
+  /*eslint no-empty: 0*/
+  for (var repeat = []; qty > 0; repeat[--qty] = str) {}
+  return repeat.join(separator);
+};
+
+},{"./helper/makeString":20,"./helper/strRepeat":21}],44:[function(require,module,exports){
+var makeString = require('./helper/makeString');
+
+module.exports = function replaceAll(str, find, replace, ignorecase) {
+  var flags = (ignorecase === true)?'gi':'g';
+  var reg = new RegExp(find, flags);
+
+  return makeString(str).replace(reg, replace);
+};
+
+},{"./helper/makeString":20}],45:[function(require,module,exports){
+var chars = require('./chars');
+
+module.exports = function reverse(str) {
+  return chars(str).reverse().join('');
+};
+
+},{"./chars":3}],46:[function(require,module,exports){
+var pad = require('./pad');
+
+module.exports = function rpad(str, length, padStr) {
+  return pad(str, length, padStr, 'right');
+};
+
+},{"./pad":39}],47:[function(require,module,exports){
+var makeString = require('./helper/makeString');
+var defaultToWhiteSpace = require('./helper/defaultToWhiteSpace');
+var nativeTrimRight = String.prototype.trimRight;
+
+module.exports = function rtrim(str, characters) {
+  str = makeString(str);
+  if (!characters && nativeTrimRight) return nativeTrimRight.call(str);
+  characters = defaultToWhiteSpace(characters);
+  return str.replace(new RegExp(characters + '+$'), '');
+};
+
+},{"./helper/defaultToWhiteSpace":16,"./helper/makeString":20}],48:[function(require,module,exports){
+var trim = require('./trim');
+var dasherize = require('./dasherize');
+var cleanDiacritics = require('./cleanDiacritics');
+
+module.exports = function slugify(str) {
+  return trim(dasherize(cleanDiacritics(str).replace(/[^\w\s-]/g, '-').toLowerCase()), '-');
+};
+
+},{"./cleanDiacritics":7,"./dasherize":9,"./trim":65}],49:[function(require,module,exports){
+var chars = require('./chars');
+
+module.exports = function splice(str, i, howmany, substr) {
+  var arr = chars(str);
+  arr.splice(~~i, ~~howmany, substr);
+  return arr.join('');
+};
+
+},{"./chars":3}],50:[function(require,module,exports){
+var deprecate = require('util-deprecate');
+
+module.exports = deprecate(require('sprintf-js').sprintf,
+  'sprintf() will be removed in the next major release, use the sprintf-js package instead.');
+
+},{"sprintf-js":36,"util-deprecate":37}],51:[function(require,module,exports){
+var makeString = require('./helper/makeString');
+var toPositive = require('./helper/toPositive');
+
+module.exports = function startsWith(str, starts, position) {
+  str = makeString(str);
+  starts = '' + starts;
+  position = position == null ? 0 : Math.min(toPositive(position), str.length);
+  return str.lastIndexOf(starts, position) === position;
+};
+
+},{"./helper/makeString":20,"./helper/toPositive":22}],52:[function(require,module,exports){
+var makeString = require('./helper/makeString');
+
+module.exports = function strLeft(str, sep) {
+  str = makeString(str);
+  sep = makeString(sep);
+  var pos = !sep ? -1 : str.indexOf(sep);
+  return~ pos ? str.slice(0, pos) : str;
+};
+
+},{"./helper/makeString":20}],53:[function(require,module,exports){
+var makeString = require('./helper/makeString');
+
+module.exports = function strLeftBack(str, sep) {
+  str = makeString(str);
+  sep = makeString(sep);
+  var pos = str.lastIndexOf(sep);
+  return~ pos ? str.slice(0, pos) : str;
+};
+
+},{"./helper/makeString":20}],54:[function(require,module,exports){
+var makeString = require('./helper/makeString');
+
+module.exports = function strRight(str, sep) {
+  str = makeString(str);
+  sep = makeString(sep);
+  var pos = !sep ? -1 : str.indexOf(sep);
+  return~ pos ? str.slice(pos + sep.length, str.length) : str;
+};
+
+},{"./helper/makeString":20}],55:[function(require,module,exports){
+var makeString = require('./helper/makeString');
+
+module.exports = function strRightBack(str, sep) {
+  str = makeString(str);
+  sep = makeString(sep);
+  var pos = !sep ? -1 : str.lastIndexOf(sep);
+  return~ pos ? str.slice(pos + sep.length, str.length) : str;
+};
+
+},{"./helper/makeString":20}],56:[function(require,module,exports){
+var makeString = require('./helper/makeString');
+
+module.exports = function stripTags(str) {
+  return makeString(str).replace(/<\/?[^>]+>/g, '');
+};
+
+},{"./helper/makeString":20}],57:[function(require,module,exports){
+var adjacent = require('./helper/adjacent');
+
+module.exports = function succ(str) {
+  return adjacent(str, 1);
+};
+
+},{"./helper/adjacent":15}],58:[function(require,module,exports){
+module.exports = function surround(str, wrapper) {
+  return [wrapper, str, wrapper].join('');
+};
+
+},{}],59:[function(require,module,exports){
+var makeString = require('./helper/makeString');
+
+module.exports = function swapCase(str) {
+  return makeString(str).replace(/\S/g, function(c) {
+    return c === c.toUpperCase() ? c.toLowerCase() : c.toUpperCase();
+  });
+};
+
+},{"./helper/makeString":20}],60:[function(require,module,exports){
+var makeString = require('./helper/makeString');
+
+module.exports = function titleize(str) {
+  return makeString(str).toLowerCase().replace(/(?:^|\s|-)\S/g, function(c) {
+    return c.toUpperCase();
+  });
+};
+
+},{"./helper/makeString":20}],61:[function(require,module,exports){
+var trim = require('./trim');
+
+function boolMatch(s, matchers) {
+  var i, matcher, down = s.toLowerCase();
+  matchers = [].concat(matchers);
+  for (i = 0; i < matchers.length; i += 1) {
+    matcher = matchers[i];
+    if (!matcher) continue;
+    if (matcher.test && matcher.test(s)) return true;
+    if (matcher.toLowerCase() === down) return true;
+  }
+}
+
+module.exports = function toBoolean(str, trueValues, falseValues) {
+  if (typeof str === 'number') str = '' + str;
+  if (typeof str !== 'string') return !!str;
+  str = trim(str);
+  if (boolMatch(str, trueValues || ['true', '1'])) return true;
+  if (boolMatch(str, falseValues || ['false', '0'])) return false;
+};
+
+},{"./trim":65}],62:[function(require,module,exports){
+module.exports = function toNumber(num, precision) {
+  if (num == null) return 0;
+  var factor = Math.pow(10, isFinite(precision) ? precision : 0);
+  return Math.round(num * factor) / factor;
+};
+
+},{}],63:[function(require,module,exports){
+var rtrim = require('./rtrim');
+
+module.exports = function toSentence(array, separator, lastSeparator, serial) {
+  separator = separator || ', ';
+  lastSeparator = lastSeparator || ' and ';
+  var a = array.slice(),
+    lastMember = a.pop();
+
+  if (array.length > 2 && serial) lastSeparator = rtrim(separator) + lastSeparator;
+
+  return a.length ? a.join(separator) + lastSeparator + lastMember : lastMember;
+};
+
+},{"./rtrim":47}],64:[function(require,module,exports){
+var toSentence = require('./toSentence');
+
+module.exports = function toSentenceSerial(array, sep, lastSep) {
+  return toSentence(array, sep, lastSep, true);
+};
+
+},{"./toSentence":63}],65:[function(require,module,exports){
+var makeString = require('./helper/makeString');
+var defaultToWhiteSpace = require('./helper/defaultToWhiteSpace');
+var nativeTrim = String.prototype.trim;
+
+module.exports = function trim(str, characters) {
+  str = makeString(str);
+  if (!characters && nativeTrim) return nativeTrim.call(str);
+  characters = defaultToWhiteSpace(characters);
+  return str.replace(new RegExp('^' + characters + '+|' + characters + '+$', 'g'), '');
+};
+
+},{"./helper/defaultToWhiteSpace":16,"./helper/makeString":20}],66:[function(require,module,exports){
+var makeString = require('./helper/makeString');
+
+module.exports = function truncate(str, length, truncateStr) {
+  str = makeString(str);
+  truncateStr = truncateStr || '...';
+  length = ~~length;
+  return str.length > length ? str.slice(0, length) + truncateStr : str;
+};
+
+},{"./helper/makeString":20}],67:[function(require,module,exports){
+var trim = require('./trim');
+
+module.exports = function underscored(str) {
+  return trim(str).replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/[-\s]+/g, '_').toLowerCase();
+};
+
+},{"./trim":65}],68:[function(require,module,exports){
+var makeString = require('./helper/makeString');
+var htmlEntities = require('./helper/htmlEntities');
+
+module.exports = function unescapeHTML(str) {
+  return makeString(str).replace(/\&([^;]+);/g, function(entity, entityCode) {
+    var match;
+
+    if (entityCode in htmlEntities) {
+      return htmlEntities[entityCode];
+    /*eslint no-cond-assign: 0*/
+    } else if (match = entityCode.match(/^#x([\da-fA-F]+)$/)) {
+      return String.fromCharCode(parseInt(match[1], 16));
+    /*eslint no-cond-assign: 0*/
+    } else if (match = entityCode.match(/^#(\d+)$/)) {
+      return String.fromCharCode(~~match[1]);
+    } else {
+      return entity;
+    }
+  });
+};
+
+},{"./helper/htmlEntities":19,"./helper/makeString":20}],69:[function(require,module,exports){
+module.exports = function unquote(str, quoteChar) {
+  quoteChar = quoteChar || '"';
+  if (str[0] === quoteChar && str[str.length - 1] === quoteChar)
+    return str.slice(1, str.length - 1);
+  else return str;
+};
+
+},{}],70:[function(require,module,exports){
+var deprecate = require('util-deprecate');
+
+module.exports = deprecate(require('sprintf-js').vsprintf,
+  'vsprintf() will be removed in the next major release, use the sprintf-js package instead.');
+
+},{"sprintf-js":36,"util-deprecate":37}],71:[function(require,module,exports){
+var isBlank = require('./isBlank');
+var trim = require('./trim');
+
+module.exports = function words(str, delimiter) {
+  if (isBlank(str)) return [];
+  return trim(str, delimiter).split(delimiter || /\s+/);
+};
+
+},{"./isBlank":27,"./trim":65}],72:[function(require,module,exports){
+// Wrap
+// wraps a string by a certain width
+
+var makeString = require('./helper/makeString');
+
+module.exports = function wrap(str, options){
+  str = makeString(str);
+  
+  options = options || {};
+  
+  var width = options.width || 75;
+  var seperator = options.seperator || '\n';
+  var cut = options.cut || false;
+  var preserveSpaces = options.preserveSpaces || false;
+  var trailingSpaces = options.trailingSpaces || false;
+  
+  var result;
+  
+  if(width <= 0){
+    return str;
+  }
+  
+  else if(!cut){
+  
+    var words = str.split(' ');
+    var current_column = 0;
+    result = '';
+  
+    while(words.length > 0){
+      
+      // if adding a space and the next word would cause this line to be longer than width...
+      if(1 + words[0].length + current_column > width){
+        //start a new line if this line is not already empty
+        if(current_column > 0){
+          // add a space at the end of the line is preserveSpaces is true
+          if (preserveSpaces){
+            result += ' ';
+            current_column++;
+          }
+          // fill the rest of the line with spaces if trailingSpaces option is true
+          else if(trailingSpaces){
+            while(current_column < width){
+              result += ' ';
+              current_column++;
+            }            
+          }
+          //start new line
+          result += seperator;
+          current_column = 0;
+        }
+      }
+  
+      // if not at the begining of the line, add a space in front of the word
+      if(current_column > 0){
+        result += ' ';
+        current_column++;
+      }
+  
+      // tack on the next word, update current column, a pop words array
+      result += words[0];
+      current_column += words[0].length;
+      words.shift();
+  
+    }
+  
+    // fill the rest of the line with spaces if trailingSpaces option is true
+    if(trailingSpaces){
+      while(current_column < width){
+        result += ' ';
+        current_column++;
+      }            
+    }
+  
+    return result;
+  
+  }
+  
+  else {
+  
+    var index = 0;
+    result = '';
+  
+    // walk through each character and add seperators where appropriate
+    while(index < str.length){
+      if(index % width == 0 && index > 0){
+        result += seperator;
+      }
+      result += str.charAt(index);
+      index++;
+    }
+  
+    // fill the rest of the line with spaces if trailingSpaces option is true
+    if(trailingSpaces){
+      while(index % width > 0){
+        result += ' ';
+        index++;
+      }            
+    }
+    
+    return result;
+  }
+};
+
+},{"./helper/makeString":20}]},{},[25])(25)
+});
\ No newline at end of file
diff --git a/wrt/node_modules/underscore.string/dist/underscore.string.min.js b/wrt/node_modules/underscore.string/dist/underscore.string.min.js
new file mode 100644 (file)
index 0000000..785c03d
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+* Underscore.string
+* (c) 2010 Esa-Matti Suuronen <esa-matti aet suuronen dot org>
+* Underscore.string is freely distributable under the terms of the MIT license.
+* Documentation: https://github.com/epeli/underscore.string
+* Some code is borrowed from MooTools and Alexandru Marasteanu.
+* Version '3.3.4'
+* @preserve
+*/
+(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.s=f()}})(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){var trim=require("./trim");var decap=require("./decapitalize");module.exports=function camelize(str,decapitalize){str=trim(str).replace(/[-_\s]+(.)?/g,function(match,c){return c?c.toUpperCase():""});if(decapitalize===true){return decap(str)}else{return str}}},{"./decapitalize":10,"./trim":65}],2:[function(require,module,exports){var makeString=require("./helper/makeString");module.exports=function capitalize(str,lowercaseRest){str=makeString(str);var remainingChars=!lowercaseRest?str.slice(1):str.slice(1).toLowerCase();return str.charAt(0).toUpperCase()+remainingChars}},{"./helper/makeString":20}],3:[function(require,module,exports){var makeString=require("./helper/makeString");module.exports=function chars(str){return makeString(str).split("")}},{"./helper/makeString":20}],4:[function(require,module,exports){module.exports=function chop(str,step){if(str==null)return[];str=String(str);step=~~step;return step>0?str.match(new RegExp(".{1,"+step+"}","g")):[str]}},{}],5:[function(require,module,exports){var capitalize=require("./capitalize");var camelize=require("./camelize");var makeString=require("./helper/makeString");module.exports=function classify(str){str=makeString(str);return capitalize(camelize(str.replace(/[\W_]/g," ")).replace(/\s/g,""))}},{"./camelize":1,"./capitalize":2,"./helper/makeString":20}],6:[function(require,module,exports){var trim=require("./trim");module.exports=function clean(str){return trim(str).replace(/\s\s+/g," ")}},{"./trim":65}],7:[function(require,module,exports){var makeString=require("./helper/makeString");var from="ąàáäâãåæăćčĉęèéëêĝĥìíïîĵłľńňòóöőôõðøśșşšŝťțţŭùúüűûñÿýçżźž",to="aaaaaaaaaccceeeeeghiiiijllnnoooooooossssstttuuuuuunyyczzz";from+=from.toUpperCase();to+=to.toUpperCase();to=to.split("");from+="ß";to.push("ss");module.exports=function cleanDiacritics(str){return makeString(str).replace(/.{1}/g,function(c){var index=from.indexOf(c);return index===-1?c:to[index]})}},{"./helper/makeString":20}],8:[function(require,module,exports){var makeString=require("./helper/makeString");module.exports=function(str,substr){str=makeString(str);substr=makeString(substr);if(str.length===0||substr.length===0)return 0;return str.split(substr).length-1}},{"./helper/makeString":20}],9:[function(require,module,exports){var trim=require("./trim");module.exports=function dasherize(str){return trim(str).replace(/([A-Z])/g,"-$1").replace(/[-_\s]+/g,"-").toLowerCase()}},{"./trim":65}],10:[function(require,module,exports){var makeString=require("./helper/makeString");module.exports=function decapitalize(str){str=makeString(str);return str.charAt(0).toLowerCase()+str.slice(1)}},{"./helper/makeString":20}],11:[function(require,module,exports){var makeString=require("./helper/makeString");function getIndent(str){var matches=str.match(/^[\s\\t]*/gm);var indent=matches[0].length;for(var i=1;i<matches.length;i++){indent=Math.min(matches[i].length,indent)}return indent}module.exports=function dedent(str,pattern){str=makeString(str);var indent=getIndent(str);var reg;if(indent===0)return str;if(typeof pattern==="string"){reg=new RegExp("^"+pattern,"gm")}else{reg=new RegExp("^[ \\t]{"+indent+"}","gm")}return str.replace(reg,"")}},{"./helper/makeString":20}],12:[function(require,module,exports){var makeString=require("./helper/makeString");var toPositive=require("./helper/toPositive");module.exports=function endsWith(str,ends,position){str=makeString(str);ends=""+ends;if(typeof position=="undefined"){position=str.length-ends.length}else{position=Math.min(toPositive(position),str.length)-ends.length}return position>=0&&str.indexOf(ends,position)===position}},{"./helper/makeString":20,"./helper/toPositive":22}],13:[function(require,module,exports){var makeString=require("./helper/makeString");var escapeChars=require("./helper/escapeChars");var regexString="[";for(var key in escapeChars){regexString+=key}regexString+="]";var regex=new RegExp(regexString,"g");module.exports=function escapeHTML(str){return makeString(str).replace(regex,function(m){return"&"+escapeChars[m]+";"})}},{"./helper/escapeChars":17,"./helper/makeString":20}],14:[function(require,module,exports){module.exports=function(){var result={};for(var prop in this){if(!this.hasOwnProperty(prop)||prop.match(/^(?:include|contains|reverse|join|map|wrap)$/))continue;result[prop]=this[prop]}return result}},{}],15:[function(require,module,exports){var makeString=require("./makeString");module.exports=function adjacent(str,direction){str=makeString(str);if(str.length===0){return""}return str.slice(0,-1)+String.fromCharCode(str.charCodeAt(str.length-1)+direction)}},{"./makeString":20}],16:[function(require,module,exports){var escapeRegExp=require("./escapeRegExp");module.exports=function defaultToWhiteSpace(characters){if(characters==null)return"\\s";else if(characters.source)return characters.source;else return"["+escapeRegExp(characters)+"]"}},{"./escapeRegExp":18}],17:[function(require,module,exports){var escapeChars={"¢":"cent","£":"pound","¥":"yen","€":"euro","©":"copy","®":"reg","<":"lt",">":"gt",'"':"quot","&":"amp","'":"#39"};module.exports=escapeChars},{}],18:[function(require,module,exports){var makeString=require("./makeString");module.exports=function escapeRegExp(str){return makeString(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}},{"./makeString":20}],19:[function(require,module,exports){var htmlEntities={nbsp:" ",cent:"¢",pound:"£",yen:"¥",euro:"€",copy:"©",reg:"®",lt:"<",gt:">",quot:'"',amp:"&",apos:"'"};module.exports=htmlEntities},{}],20:[function(require,module,exports){module.exports=function makeString(object){if(object==null)return"";return""+object}},{}],21:[function(require,module,exports){module.exports=function strRepeat(str,qty){if(qty<1)return"";var result="";while(qty>0){if(qty&1)result+=str;qty>>=1,str+=str}return result}},{}],22:[function(require,module,exports){module.exports=function toPositive(number){return number<0?0:+number||0}},{}],23:[function(require,module,exports){var capitalize=require("./capitalize");var underscored=require("./underscored");var trim=require("./trim");module.exports=function humanize(str){return capitalize(trim(underscored(str).replace(/_id$/,"").replace(/_/g," ")))}},{"./capitalize":2,"./trim":65,"./underscored":67}],24:[function(require,module,exports){var makeString=require("./helper/makeString");module.exports=function include(str,needle){if(needle==="")return true;return makeString(str).indexOf(needle)!==-1}},{"./helper/makeString":20}],25:[function(require,module,exports){/*
+* Underscore.string
+* (c) 2010 Esa-Matti Suuronen <esa-matti aet suuronen dot org>
+* Underscore.string is freely distributable under the terms of the MIT license.
+* Documentation: https://github.com/epeli/underscore.string
+* Some code is borrowed from MooTools and Alexandru Marasteanu.
+* Version '3.3.4'
+* @preserve
+*/
+"use strict";function s(value){if(!(this instanceof s))return new s(value);this._wrapped=value}s.VERSION="3.3.4";s.isBlank=require("./isBlank");s.stripTags=require("./stripTags");s.capitalize=require("./capitalize");s.decapitalize=require("./decapitalize");s.chop=require("./chop");s.trim=require("./trim");s.clean=require("./clean");s.cleanDiacritics=require("./cleanDiacritics");s.count=require("./count");s.chars=require("./chars");s.swapCase=require("./swapCase");s.escapeHTML=require("./escapeHTML");s.unescapeHTML=require("./unescapeHTML");s.splice=require("./splice");s.insert=require("./insert");s.replaceAll=require("./replaceAll");s.include=require("./include");s.join=require("./join");s.lines=require("./lines");s.dedent=require("./dedent");s.reverse=require("./reverse");s.startsWith=require("./startsWith");s.endsWith=require("./endsWith");s.pred=require("./pred");s.succ=require("./succ");s.titleize=require("./titleize");s.camelize=require("./camelize");s.underscored=require("./underscored");s.dasherize=require("./dasherize");s.classify=require("./classify");s.humanize=require("./humanize");s.ltrim=require("./ltrim");s.rtrim=require("./rtrim");s.truncate=require("./truncate");s.prune=require("./prune");s.words=require("./words");s.pad=require("./pad");s.lpad=require("./lpad");s.rpad=require("./rpad");s.lrpad=require("./lrpad");s.sprintf=require("./sprintf");s.vsprintf=require("./vsprintf");s.toNumber=require("./toNumber");s.numberFormat=require("./numberFormat");s.strRight=require("./strRight");s.strRightBack=require("./strRightBack");s.strLeft=require("./strLeft");s.strLeftBack=require("./strLeftBack");s.toSentence=require("./toSentence");s.toSentenceSerial=require("./toSentenceSerial");s.slugify=require("./slugify");s.surround=require("./surround");s.quote=require("./quote");s.unquote=require("./unquote");s.repeat=require("./repeat");s.naturalCmp=require("./naturalCmp");s.levenshtein=require("./levenshtein");s.toBoolean=require("./toBoolean");s.exports=require("./exports");s.escapeRegExp=require("./helper/escapeRegExp");s.wrap=require("./wrap");s.map=require("./map");s.strip=s.trim;s.lstrip=s.ltrim;s.rstrip=s.rtrim;s.center=s.lrpad;s.rjust=s.lpad;s.ljust=s.rpad;s.contains=s.include;s.q=s.quote;s.toBool=s.toBoolean;s.camelcase=s.camelize;s.mapChars=s.map;s.prototype={value:function value(){return this._wrapped}};function fn2method(key,fn){if(typeof fn!=="function")return;s.prototype[key]=function(){var args=[this._wrapped].concat(Array.prototype.slice.call(arguments));var res=fn.apply(null,args);return typeof res==="string"?new s(res):res}}for(var key in s)fn2method(key,s[key]);fn2method("tap",function tap(string,fn){return fn(string)});function prototype2method(methodName){fn2method(methodName,function(context){var args=Array.prototype.slice.call(arguments,1);return String.prototype[methodName].apply(context,args)})}var prototypeMethods=["toUpperCase","toLowerCase","split","replace","slice","substring","substr","concat"];for(var method in prototypeMethods)prototype2method(prototypeMethods[method]);module.exports=s},{"./camelize":1,"./capitalize":2,"./chars":3,"./chop":4,"./classify":5,"./clean":6,"./cleanDiacritics":7,"./count":8,"./dasherize":9,"./decapitalize":10,"./dedent":11,"./endsWith":12,"./escapeHTML":13,"./exports":14,"./helper/escapeRegExp":18,"./humanize":23,"./include":24,"./insert":26,"./isBlank":27,"./join":28,"./levenshtein":29,"./lines":30,"./lpad":31,"./lrpad":32,"./ltrim":33,"./map":34,"./naturalCmp":35,"./numberFormat":38,"./pad":39,"./pred":40,"./prune":41,"./quote":42,"./repeat":43,"./replaceAll":44,"./reverse":45,"./rpad":46,"./rtrim":47,"./slugify":48,"./splice":49,"./sprintf":50,"./startsWith":51,"./strLeft":52,"./strLeftBack":53,"./strRight":54,"./strRightBack":55,"./stripTags":56,"./succ":57,"./surround":58,"./swapCase":59,"./titleize":60,"./toBoolean":61,"./toNumber":62,"./toSentence":63,"./toSentenceSerial":64,"./trim":65,"./truncate":66,"./underscored":67,"./unescapeHTML":68,"./unquote":69,"./vsprintf":70,"./words":71,"./wrap":72}],26:[function(require,module,exports){var splice=require("./splice");module.exports=function insert(str,i,substr){return splice(str,i,0,substr)}},{"./splice":49}],27:[function(require,module,exports){var makeString=require("./helper/makeString");module.exports=function isBlank(str){return/^\s*$/.test(makeString(str))}},{"./helper/makeString":20}],28:[function(require,module,exports){var makeString=require("./helper/makeString");var slice=[].slice;module.exports=function join(){var args=slice.call(arguments),separator=args.shift();return args.join(makeString(separator))}},{"./helper/makeString":20}],29:[function(require,module,exports){var makeString=require("./helper/makeString");module.exports=function levenshtein(str1,str2){"use strict";str1=makeString(str1);str2=makeString(str2);if(str1===str2)return 0;if(!str1||!str2)return Math.max(str1.length,str2.length);var prevRow=new Array(str2.length+1);for(var i=0;i<prevRow.length;++i){prevRow[i]=i}for(i=0;i<str1.length;++i){var nextCol=i+1;for(var j=0;j<str2.length;++j){var curCol=nextCol;nextCol=prevRow[j]+(str1.charAt(i)===str2.charAt(j)?0:1);var tmp=curCol+1;if(nextCol>tmp){nextCol=tmp}tmp=prevRow[j+1]+1;if(nextCol>tmp){nextCol=tmp}prevRow[j]=curCol}prevRow[j]=nextCol}return nextCol}},{"./helper/makeString":20}],30:[function(require,module,exports){module.exports=function lines(str){if(str==null)return[];return String(str).split(/\r\n?|\n/)}},{}],31:[function(require,module,exports){var pad=require("./pad");module.exports=function lpad(str,length,padStr){return pad(str,length,padStr)}},{"./pad":39}],32:[function(require,module,exports){var pad=require("./pad");module.exports=function lrpad(str,length,padStr){return pad(str,length,padStr,"both")}},{"./pad":39}],33:[function(require,module,exports){var makeString=require("./helper/makeString");var defaultToWhiteSpace=require("./helper/defaultToWhiteSpace");var nativeTrimLeft=String.prototype.trimLeft;module.exports=function ltrim(str,characters){str=makeString(str);if(!characters&&nativeTrimLeft)return nativeTrimLeft.call(str);characters=defaultToWhiteSpace(characters);return str.replace(new RegExp("^"+characters+"+"),"")}},{"./helper/defaultToWhiteSpace":16,"./helper/makeString":20}],34:[function(require,module,exports){var makeString=require("./helper/makeString");module.exports=function(str,callback){str=makeString(str);if(str.length===0||typeof callback!=="function")return str;return str.replace(/./g,callback)}},{"./helper/makeString":20}],35:[function(require,module,exports){module.exports=function naturalCmp(str1,str2){if(str1==str2)return 0;if(!str1)return-1;if(!str2)return 1;var cmpRegex=/(\.\d+|\d+|\D+)/g,tokens1=String(str1).match(cmpRegex),tokens2=String(str2).match(cmpRegex),count=Math.min(tokens1.length,tokens2.length);for(var i=0;i<count;i++){var a=tokens1[i],b=tokens2[i];if(a!==b){var num1=+a;var num2=+b;if(num1===num1&&num2===num2){return num1>num2?1:-1}return a<b?-1:1}}if(tokens1.length!=tokens2.length)return tokens1.length-tokens2.length;return str1<str2?-1:1}},{}],36:[function(require,module,exports){(function(window){var re={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};function sprintf(){var key=arguments[0],cache=sprintf.cache;if(!(cache[key]&&cache.hasOwnProperty(key))){cache[key]=sprintf.parse(key)}return sprintf.format.call(null,cache[key],arguments)}sprintf.format=function(parse_tree,argv){var cursor=1,tree_length=parse_tree.length,node_type="",arg,output=[],i,k,match,pad,pad_character,pad_length,is_positive=true,sign="";for(i=0;i<tree_length;i++){node_type=get_type(parse_tree[i]);if(node_type==="string"){output[output.length]=parse_tree[i]}else if(node_type==="array"){match=parse_tree[i];if(match[2]){arg=argv[cursor];for(k=0;k<match[2].length;k++){if(!arg.hasOwnProperty(match[2][k])){throw new Error(sprintf("[sprintf] property '%s' does not exist",match[2][k]))}arg=arg[match[2][k]]}}else if(match[1]){arg=argv[match[1]]}else{arg=argv[cursor++]}if(get_type(arg)=="function"){arg=arg()}if(re.not_string.test(match[8])&&re.not_json.test(match[8])&&(get_type(arg)!="number"&&isNaN(arg))){throw new TypeError(sprintf("[sprintf] expecting number but found %s",get_type(arg)))}if(re.number.test(match[8])){is_positive=arg>=0}switch(match[8]){case"b":arg=arg.toString(2);break;case"c":arg=String.fromCharCode(arg);break;case"d":case"i":arg=parseInt(arg,10);break;case"j":arg=JSON.stringify(arg,null,match[6]?parseInt(match[6]):0);break;case"e":arg=match[7]?arg.toExponential(match[7]):arg.toExponential();break;case"f":arg=match[7]?parseFloat(arg).toFixed(match[7]):parseFloat(arg);break;case"g":arg=match[7]?parseFloat(arg).toPrecision(match[7]):parseFloat(arg);break;case"o":arg=arg.toString(8);break;case"s":arg=(arg=String(arg))&&match[7]?arg.substring(0,match[7]):arg;break;case"u":arg=arg>>>0;break;case"x":arg=arg.toString(16);break;case"X":arg=arg.toString(16).toUpperCase();break}if(re.json.test(match[8])){output[output.length]=arg}else{if(re.number.test(match[8])&&(!is_positive||match[3])){sign=is_positive?"+":"-";arg=arg.toString().replace(re.sign,"")}else{sign=""}pad_character=match[4]?match[4]==="0"?"0":match[4].charAt(1):" ";pad_length=match[6]-(sign+arg).length;pad=match[6]?pad_length>0?str_repeat(pad_character,pad_length):"":"";output[output.length]=match[5]?sign+arg+pad:pad_character==="0"?sign+pad+arg:pad+sign+arg}}}return output.join("")};sprintf.cache={};sprintf.parse=function(fmt){var _fmt=fmt,match=[],parse_tree=[],arg_names=0;while(_fmt){if((match=re.text.exec(_fmt))!==null){parse_tree[parse_tree.length]=match[0]}else if((match=re.modulo.exec(_fmt))!==null){parse_tree[parse_tree.length]="%"}else if((match=re.placeholder.exec(_fmt))!==null){if(match[2]){arg_names|=1;var field_list=[],replacement_field=match[2],field_match=[];if((field_match=re.key.exec(replacement_field))!==null){field_list[field_list.length]=field_match[1];while((replacement_field=replacement_field.substring(field_match[0].length))!==""){if((field_match=re.key_access.exec(replacement_field))!==null){field_list[field_list.length]=field_match[1]}else if((field_match=re.index_access.exec(replacement_field))!==null){field_list[field_list.length]=field_match[1]}else{throw new SyntaxError("[sprintf] failed to parse named argument key")}}}else{throw new SyntaxError("[sprintf] failed to parse named argument key")}match[2]=field_list}else{arg_names|=2}if(arg_names===3){throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported")}parse_tree[parse_tree.length]=match}else{throw new SyntaxError("[sprintf] unexpected placeholder")}_fmt=_fmt.substring(match[0].length)}return parse_tree};var vsprintf=function(fmt,argv,_argv){_argv=(argv||[]).slice(0);_argv.splice(0,0,fmt);return sprintf.apply(null,_argv)};function get_type(variable){return Object.prototype.toString.call(variable).slice(8,-1).toLowerCase()}function str_repeat(input,multiplier){return Array(multiplier+1).join(input)}if(typeof exports!=="undefined"){exports.sprintf=sprintf;exports.vsprintf=vsprintf}else{window.sprintf=sprintf;window.vsprintf=vsprintf;if(typeof define==="function"&&define.amd){define(function(){return{sprintf:sprintf,vsprintf:vsprintf}})}}})(typeof window==="undefined"?this:window)},{}],37:[function(require,module,exports){(function(global){module.exports=deprecate;function deprecate(fn,msg){if(config("noDeprecation")){return fn}var warned=false;function deprecated(){if(!warned){if(config("throwDeprecation")){throw new Error(msg)}else if(config("traceDeprecation")){console.trace(msg)}else{console.warn(msg)}warned=true}return fn.apply(this,arguments)}return deprecated}function config(name){try{if(!global.localStorage)return false}catch(_){return false}var val=global.localStorage[name];if(null==val)return false;return String(val).toLowerCase()==="true"}}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{})},{}],38:[function(require,module,exports){module.exports=function numberFormat(number,dec,dsep,tsep){if(isNaN(number)||number==null)return"";number=number.toFixed(~~dec);tsep=typeof tsep=="string"?tsep:",";var parts=number.split("."),fnums=parts[0],decimals=parts[1]?(dsep||".")+parts[1]:"";return fnums.replace(/(\d)(?=(?:\d{3})+$)/g,"$1"+tsep)+decimals}},{}],39:[function(require,module,exports){var makeString=require("./helper/makeString");var strRepeat=require("./helper/strRepeat");module.exports=function pad(str,length,padStr,type){str=makeString(str);length=~~length;var padlen=0;if(!padStr)padStr=" ";else if(padStr.length>1)padStr=padStr.charAt(0);switch(type){case"right":padlen=length-str.length;return str+strRepeat(padStr,padlen);case"both":padlen=length-str.length;return strRepeat(padStr,Math.ceil(padlen/2))+str+strRepeat(padStr,Math.floor(padlen/2));default:padlen=length-str.length;return strRepeat(padStr,padlen)+str}}},{"./helper/makeString":20,"./helper/strRepeat":21}],40:[function(require,module,exports){var adjacent=require("./helper/adjacent");module.exports=function succ(str){return adjacent(str,-1)}},{"./helper/adjacent":15}],41:[function(require,module,exports){var makeString=require("./helper/makeString");var rtrim=require("./rtrim");module.exports=function prune(str,length,pruneStr){str=makeString(str);length=~~length;pruneStr=pruneStr!=null?String(pruneStr):"...";if(str.length<=length)return str;var tmpl=function(c){return c.toUpperCase()!==c.toLowerCase()?"A":" "},template=str.slice(0,length+1).replace(/.(?=\W*\w*$)/g,tmpl);if(template.slice(template.length-2).match(/\w\w/))template=template.replace(/\s*\S+$/,"");else template=rtrim(template.slice(0,template.length-1));return(template+pruneStr).length>str.length?str:str.slice(0,template.length)+pruneStr}},{"./helper/makeString":20,"./rtrim":47}],42:[function(require,module,exports){var surround=require("./surround");module.exports=function quote(str,quoteChar){return surround(str,quoteChar||'"')}},{"./surround":58}],43:[function(require,module,exports){var makeString=require("./helper/makeString");var strRepeat=require("./helper/strRepeat");module.exports=function repeat(str,qty,separator){str=makeString(str);qty=~~qty;if(separator==null)return strRepeat(str,qty);for(var repeat=[];qty>0;repeat[--qty]=str){}return repeat.join(separator)}},{"./helper/makeString":20,"./helper/strRepeat":21}],44:[function(require,module,exports){var makeString=require("./helper/makeString");module.exports=function replaceAll(str,find,replace,ignorecase){var flags=ignorecase===true?"gi":"g";var reg=new RegExp(find,flags);return makeString(str).replace(reg,replace)}},{"./helper/makeString":20}],45:[function(require,module,exports){var chars=require("./chars");module.exports=function reverse(str){return chars(str).reverse().join("")}},{"./chars":3}],46:[function(require,module,exports){var pad=require("./pad");module.exports=function rpad(str,length,padStr){return pad(str,length,padStr,"right")}},{"./pad":39}],47:[function(require,module,exports){var makeString=require("./helper/makeString");var defaultToWhiteSpace=require("./helper/defaultToWhiteSpace");var nativeTrimRight=String.prototype.trimRight;module.exports=function rtrim(str,characters){str=makeString(str);if(!characters&&nativeTrimRight)return nativeTrimRight.call(str);characters=defaultToWhiteSpace(characters);return str.replace(new RegExp(characters+"+$"),"")}},{"./helper/defaultToWhiteSpace":16,"./helper/makeString":20}],48:[function(require,module,exports){var trim=require("./trim");var dasherize=require("./dasherize");var cleanDiacritics=require("./cleanDiacritics");module.exports=function slugify(str){return trim(dasherize(cleanDiacritics(str).replace(/[^\w\s-]/g,"-").toLowerCase()),"-")}},{"./cleanDiacritics":7,"./dasherize":9,"./trim":65}],49:[function(require,module,exports){var chars=require("./chars");module.exports=function splice(str,i,howmany,substr){var arr=chars(str);arr.splice(~~i,~~howmany,substr);return arr.join("")}},{"./chars":3}],50:[function(require,module,exports){var deprecate=require("util-deprecate");module.exports=deprecate(require("sprintf-js").sprintf,"sprintf() will be removed in the next major release, use the sprintf-js package instead.")},{"sprintf-js":36,"util-deprecate":37}],51:[function(require,module,exports){var makeString=require("./helper/makeString");var toPositive=require("./helper/toPositive");module.exports=function startsWith(str,starts,position){str=makeString(str);starts=""+starts;position=position==null?0:Math.min(toPositive(position),str.length);return str.lastIndexOf(starts,position)===position}},{"./helper/makeString":20,"./helper/toPositive":22}],52:[function(require,module,exports){var makeString=require("./helper/makeString");module.exports=function strLeft(str,sep){str=makeString(str);sep=makeString(sep);var pos=!sep?-1:str.indexOf(sep);return~pos?str.slice(0,pos):str}},{"./helper/makeString":20}],53:[function(require,module,exports){var makeString=require("./helper/makeString");module.exports=function strLeftBack(str,sep){str=makeString(str);sep=makeString(sep);var pos=str.lastIndexOf(sep);return~pos?str.slice(0,pos):str}},{"./helper/makeString":20}],54:[function(require,module,exports){var makeString=require("./helper/makeString");module.exports=function strRight(str,sep){str=makeString(str);sep=makeString(sep);var pos=!sep?-1:str.indexOf(sep);return~pos?str.slice(pos+sep.length,str.length):str}},{"./helper/makeString":20}],55:[function(require,module,exports){var makeString=require("./helper/makeString");module.exports=function strRightBack(str,sep){str=makeString(str);sep=makeString(sep);var pos=!sep?-1:str.lastIndexOf(sep);return~pos?str.slice(pos+sep.length,str.length):str}},{"./helper/makeString":20}],56:[function(require,module,exports){var makeString=require("./helper/makeString");module.exports=function stripTags(str){return makeString(str).replace(/<\/?[^>]+>/g,"")}},{"./helper/makeString":20}],57:[function(require,module,exports){var adjacent=require("./helper/adjacent");module.exports=function succ(str){return adjacent(str,1)}},{"./helper/adjacent":15}],58:[function(require,module,exports){module.exports=function surround(str,wrapper){return[wrapper,str,wrapper].join("")}},{}],59:[function(require,module,exports){var makeString=require("./helper/makeString");module.exports=function swapCase(str){return makeString(str).replace(/\S/g,function(c){return c===c.toUpperCase()?c.toLowerCase():c.toUpperCase()})}},{"./helper/makeString":20}],60:[function(require,module,exports){var makeString=require("./helper/makeString");module.exports=function titleize(str){return makeString(str).toLowerCase().replace(/(?:^|\s|-)\S/g,function(c){return c.toUpperCase()})}},{"./helper/makeString":20}],61:[function(require,module,exports){var trim=require("./trim");function boolMatch(s,matchers){var i,matcher,down=s.toLowerCase();matchers=[].concat(matchers);for(i=0;i<matchers.length;i+=1){matcher=matchers[i];if(!matcher)continue;if(matcher.test&&matcher.test(s))return true;if(matcher.toLowerCase()===down)return true}}module.exports=function toBoolean(str,trueValues,falseValues){if(typeof str==="number")str=""+str;if(typeof str!=="string")return!!str;str=trim(str);if(boolMatch(str,trueValues||["true","1"]))return true;if(boolMatch(str,falseValues||["false","0"]))return false}},{"./trim":65}],62:[function(require,module,exports){module.exports=function toNumber(num,precision){if(num==null)return 0;var factor=Math.pow(10,isFinite(precision)?precision:0);return Math.round(num*factor)/factor}},{}],63:[function(require,module,exports){var rtrim=require("./rtrim");module.exports=function toSentence(array,separator,lastSeparator,serial){separator=separator||", ";lastSeparator=lastSeparator||" and ";var a=array.slice(),lastMember=a.pop();if(array.length>2&&serial)lastSeparator=rtrim(separator)+lastSeparator;return a.length?a.join(separator)+lastSeparator+lastMember:lastMember}},{"./rtrim":47}],64:[function(require,module,exports){var toSentence=require("./toSentence");module.exports=function toSentenceSerial(array,sep,lastSep){return toSentence(array,sep,lastSep,true)}},{"./toSentence":63}],65:[function(require,module,exports){var makeString=require("./helper/makeString");var defaultToWhiteSpace=require("./helper/defaultToWhiteSpace");var nativeTrim=String.prototype.trim;module.exports=function trim(str,characters){str=makeString(str);if(!characters&&nativeTrim)return nativeTrim.call(str);characters=defaultToWhiteSpace(characters);return str.replace(new RegExp("^"+characters+"+|"+characters+"+$","g"),"")}},{"./helper/defaultToWhiteSpace":16,"./helper/makeString":20}],66:[function(require,module,exports){var makeString=require("./helper/makeString");module.exports=function truncate(str,length,truncateStr){str=makeString(str);truncateStr=truncateStr||"...";length=~~length;return str.length>length?str.slice(0,length)+truncateStr:str}},{"./helper/makeString":20}],67:[function(require,module,exports){var trim=require("./trim");module.exports=function underscored(str){return trim(str).replace(/([a-z\d])([A-Z]+)/g,"$1_$2").replace(/[-\s]+/g,"_").toLowerCase()}},{"./trim":65}],68:[function(require,module,exports){var makeString=require("./helper/makeString");var htmlEntities=require("./helper/htmlEntities");module.exports=function unescapeHTML(str){return makeString(str).replace(/\&([^;]+);/g,function(entity,entityCode){var match;if(entityCode in htmlEntities){return htmlEntities[entityCode]}else if(match=entityCode.match(/^#x([\da-fA-F]+)$/)){return String.fromCharCode(parseInt(match[1],16))}else if(match=entityCode.match(/^#(\d+)$/)){return String.fromCharCode(~~match[1])}else{return entity}})}},{"./helper/htmlEntities":19,"./helper/makeString":20}],69:[function(require,module,exports){module.exports=function unquote(str,quoteChar){quoteChar=quoteChar||'"';if(str[0]===quoteChar&&str[str.length-1]===quoteChar)return str.slice(1,str.length-1);else return str}},{}],70:[function(require,module,exports){var deprecate=require("util-deprecate");module.exports=deprecate(require("sprintf-js").vsprintf,"vsprintf() will be removed in the next major release, use the sprintf-js package instead.")},{"sprintf-js":36,"util-deprecate":37}],71:[function(require,module,exports){var isBlank=require("./isBlank");var trim=require("./trim");module.exports=function words(str,delimiter){if(isBlank(str))return[];return trim(str,delimiter).split(delimiter||/\s+/)}},{"./isBlank":27,"./trim":65}],72:[function(require,module,exports){var makeString=require("./helper/makeString");module.exports=function wrap(str,options){str=makeString(str);options=options||{};var width=options.width||75;var seperator=options.seperator||"\n";var cut=options.cut||false;var preserveSpaces=options.preserveSpaces||false;var trailingSpaces=options.trailingSpaces||false;var result;if(width<=0){return str}else if(!cut){var words=str.split(" ");var current_column=0;result="";while(words.length>0){if(1+words[0].length+current_column>width){if(current_column>0){if(preserveSpaces){result+=" ";current_column++}else if(trailingSpaces){while(current_column<width){result+=" ";current_column++}}result+=seperator;current_column=0}}if(current_column>0){result+=" ";current_column++}result+=words[0];current_column+=words[0].length;words.shift()}if(trailingSpaces){while(current_column<width){result+=" ";current_column++}}return result}else{var index=0;result="";while(index<str.length){if(index%width==0&&index>0){result+=seperator}result+=str.charAt(index);index++}if(trailingSpaces){while(index%width>0){result+=" ";index++}}return result}}},{"./helper/makeString":20}]},{},[25])(25)});
\ No newline at end of file
diff --git a/wrt/node_modules/underscore.string/endsWith.js b/wrt/node_modules/underscore.string/endsWith.js
new file mode 100644 (file)
index 0000000..c452603
--- /dev/null
@@ -0,0 +1,13 @@
+var makeString = require('./helper/makeString');
+var toPositive = require('./helper/toPositive');
+
+module.exports = function endsWith(str, ends, position) {
+  str = makeString(str);
+  ends = '' + ends;
+  if (typeof position == 'undefined') {
+    position = str.length - ends.length;
+  } else {
+    position = Math.min(toPositive(position), str.length) - ends.length;
+  }
+  return position >= 0 && str.indexOf(ends, position) === position;
+};
diff --git a/wrt/node_modules/underscore.string/escapeHTML.js b/wrt/node_modules/underscore.string/escapeHTML.js
new file mode 100644 (file)
index 0000000..808e2f0
--- /dev/null
@@ -0,0 +1,17 @@
+var makeString = require('./helper/makeString');
+var escapeChars = require('./helper/escapeChars');
+
+var regexString = '[';
+for(var key in escapeChars) {
+  regexString += key;
+}
+regexString += ']';
+
+var regex = new RegExp( regexString, 'g');
+
+module.exports = function escapeHTML(str) {
+
+  return makeString(str).replace(regex, function(m) {
+    return '&' + escapeChars[m] + ';';
+  });
+};
diff --git a/wrt/node_modules/underscore.string/exports.js b/wrt/node_modules/underscore.string/exports.js
new file mode 100644 (file)
index 0000000..62e0732
--- /dev/null
@@ -0,0 +1,10 @@
+module.exports = function() {
+  var result = {};
+
+  for (var prop in this) {
+    if (!this.hasOwnProperty(prop) || prop.match(/^(?:include|contains|reverse|join|map|wrap)$/)) continue;
+    result[prop] = this[prop];
+  }
+
+  return result;
+};
diff --git a/wrt/node_modules/underscore.string/helper/adjacent.js b/wrt/node_modules/underscore.string/helper/adjacent.js
new file mode 100644 (file)
index 0000000..bd26013
--- /dev/null
@@ -0,0 +1,9 @@
+var makeString = require('./makeString');
+
+module.exports = function adjacent(str, direction) {
+  str = makeString(str);
+  if (str.length === 0) {
+    return '';
+  }
+  return str.slice(0, -1) + String.fromCharCode(str.charCodeAt(str.length - 1) + direction);
+};
diff --git a/wrt/node_modules/underscore.string/helper/defaultToWhiteSpace.js b/wrt/node_modules/underscore.string/helper/defaultToWhiteSpace.js
new file mode 100644 (file)
index 0000000..0cd9f06
--- /dev/null
@@ -0,0 +1,10 @@
+var escapeRegExp = require('./escapeRegExp');
+
+module.exports = function defaultToWhiteSpace(characters) {
+  if (characters == null)
+    return '\\s';
+  else if (characters.source)
+    return characters.source;
+  else
+    return '[' + escapeRegExp(characters) + ']';
+};
diff --git a/wrt/node_modules/underscore.string/helper/escapeChars.js b/wrt/node_modules/underscore.string/helper/escapeChars.js
new file mode 100644 (file)
index 0000000..862fb44
--- /dev/null
@@ -0,0 +1,19 @@
+/* We're explicitly defining the list of entities we want to escape.
+nbsp is an HTML entity, but we don't want to escape all space characters in a string, hence its omission in this map.
+
+*/
+var escapeChars = {
+  '¢' : 'cent',
+  '£' : 'pound',
+  '¥' : 'yen',
+  '€': 'euro',
+  '©' :'copy',
+  '®' : 'reg',
+  '<' : 'lt',
+  '>' : 'gt',
+  '"' : 'quot',
+  '&' : 'amp',
+  '\'' : '#39'
+};
+
+module.exports = escapeChars;
diff --git a/wrt/node_modules/underscore.string/helper/escapeRegExp.js b/wrt/node_modules/underscore.string/helper/escapeRegExp.js
new file mode 100644 (file)
index 0000000..01097fb
--- /dev/null
@@ -0,0 +1,5 @@
+var makeString = require('./makeString');
+
+module.exports = function escapeRegExp(str) {
+  return makeString(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
+};
diff --git a/wrt/node_modules/underscore.string/helper/htmlEntities.js b/wrt/node_modules/underscore.string/helper/htmlEntities.js
new file mode 100644 (file)
index 0000000..4b78d74
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+We're explicitly defining the list of entities that might see in escape HTML strings
+*/
+var htmlEntities = {
+  nbsp: ' ',
+  cent: '¢',
+  pound: '£',
+  yen: '¥',
+  euro: '€',
+  copy: '©',
+  reg: '®',
+  lt: '<',
+  gt: '>',
+  quot: '"',
+  amp: '&',
+  apos: '\''
+};
+
+module.exports = htmlEntities;
diff --git a/wrt/node_modules/underscore.string/helper/makeString.js b/wrt/node_modules/underscore.string/helper/makeString.js
new file mode 100644 (file)
index 0000000..3b279ab
--- /dev/null
@@ -0,0 +1,7 @@
+/**
+ * Ensure some object is a coerced to a string
+ **/
+module.exports = function makeString(object) {
+  if (object == null) return '';
+  return '' + object;
+};
diff --git a/wrt/node_modules/underscore.string/helper/strRepeat.js b/wrt/node_modules/underscore.string/helper/strRepeat.js
new file mode 100644 (file)
index 0000000..b60d876
--- /dev/null
@@ -0,0 +1,9 @@
+module.exports = function strRepeat(str, qty){
+  if (qty < 1) return '';
+  var result = '';
+  while (qty > 0) {
+    if (qty & 1) result += str;
+    qty >>= 1, str += str;
+  }
+  return result;
+};
diff --git a/wrt/node_modules/underscore.string/helper/toPositive.js b/wrt/node_modules/underscore.string/helper/toPositive.js
new file mode 100644 (file)
index 0000000..6dda0a3
--- /dev/null
@@ -0,0 +1,3 @@
+module.exports = function toPositive(number) {
+  return number < 0 ? 0 : (+number || 0);
+};
diff --git a/wrt/node_modules/underscore.string/humanize.js b/wrt/node_modules/underscore.string/humanize.js
new file mode 100644 (file)
index 0000000..8f82d07
--- /dev/null
@@ -0,0 +1,7 @@
+var capitalize = require('./capitalize');
+var underscored = require('./underscored');
+var trim = require('./trim');
+
+module.exports = function humanize(str) {
+  return capitalize(trim(underscored(str).replace(/_id$/, '').replace(/_/g, ' ')));
+};
diff --git a/wrt/node_modules/underscore.string/include.js b/wrt/node_modules/underscore.string/include.js
new file mode 100644 (file)
index 0000000..a2e910f
--- /dev/null
@@ -0,0 +1,6 @@
+var makeString = require('./helper/makeString');
+
+module.exports = function include(str, needle) {
+  if (needle === '') return true;
+  return makeString(str).indexOf(needle) !== -1;
+};
diff --git a/wrt/node_modules/underscore.string/index.js b/wrt/node_modules/underscore.string/index.js
new file mode 100644 (file)
index 0000000..3b91962
--- /dev/null
@@ -0,0 +1,143 @@
+/*
+* Underscore.string
+* (c) 2010 Esa-Matti Suuronen <esa-matti aet suuronen dot org>
+* Underscore.string is freely distributable under the terms of the MIT license.
+* Documentation: https://github.com/epeli/underscore.string
+* Some code is borrowed from MooTools and Alexandru Marasteanu.
+* Version '3.3.4'
+* @preserve
+*/
+
+'use strict';
+
+function s(value) {
+  /* jshint validthis: true */
+  if (!(this instanceof s)) return new s(value);
+  this._wrapped = value;
+}
+
+s.VERSION = '3.3.4';
+
+s.isBlank          = require('./isBlank');
+s.stripTags        = require('./stripTags');
+s.capitalize       = require('./capitalize');
+s.decapitalize     = require('./decapitalize');
+s.chop             = require('./chop');
+s.trim             = require('./trim');
+s.clean            = require('./clean');
+s.cleanDiacritics  = require('./cleanDiacritics');
+s.count            = require('./count');
+s.chars            = require('./chars');
+s.swapCase         = require('./swapCase');
+s.escapeHTML       = require('./escapeHTML');
+s.unescapeHTML     = require('./unescapeHTML');
+s.splice           = require('./splice');
+s.insert           = require('./insert');
+s.replaceAll       = require('./replaceAll');
+s.include          = require('./include');
+s.join             = require('./join');
+s.lines            = require('./lines');
+s.dedent           = require('./dedent');
+s.reverse          = require('./reverse');
+s.startsWith       = require('./startsWith');
+s.endsWith         = require('./endsWith');
+s.pred             = require('./pred');
+s.succ             = require('./succ');
+s.titleize         = require('./titleize');
+s.camelize         = require('./camelize');
+s.underscored      = require('./underscored');
+s.dasherize        = require('./dasherize');
+s.classify         = require('./classify');
+s.humanize         = require('./humanize');
+s.ltrim            = require('./ltrim');
+s.rtrim            = require('./rtrim');
+s.truncate         = require('./truncate');
+s.prune            = require('./prune');
+s.words            = require('./words');
+s.pad              = require('./pad');
+s.lpad             = require('./lpad');
+s.rpad             = require('./rpad');
+s.lrpad            = require('./lrpad');
+s.sprintf          = require('./sprintf');
+s.vsprintf         = require('./vsprintf');
+s.toNumber         = require('./toNumber');
+s.numberFormat     = require('./numberFormat');
+s.strRight         = require('./strRight');
+s.strRightBack     = require('./strRightBack');
+s.strLeft          = require('./strLeft');
+s.strLeftBack      = require('./strLeftBack');
+s.toSentence       = require('./toSentence');
+s.toSentenceSerial = require('./toSentenceSerial');
+s.slugify          = require('./slugify');
+s.surround         = require('./surround');
+s.quote            = require('./quote');
+s.unquote          = require('./unquote');
+s.repeat           = require('./repeat');
+s.naturalCmp       = require('./naturalCmp');
+s.levenshtein      = require('./levenshtein');
+s.toBoolean        = require('./toBoolean');
+s.exports          = require('./exports');
+s.escapeRegExp     = require('./helper/escapeRegExp');
+s.wrap             = require('./wrap');
+s.map              = require('./map');
+
+// Aliases
+s.strip     = s.trim;
+s.lstrip    = s.ltrim;
+s.rstrip    = s.rtrim;
+s.center    = s.lrpad;
+s.rjust     = s.lpad;
+s.ljust     = s.rpad;
+s.contains  = s.include;
+s.q         = s.quote;
+s.toBool    = s.toBoolean;
+s.camelcase = s.camelize;
+s.mapChars  = s.map;
+
+
+// Implement chaining
+s.prototype = {
+  value: function value() {
+    return this._wrapped;
+  }
+};
+
+function fn2method(key, fn) {
+  if (typeof fn !== 'function') return;
+  s.prototype[key] = function() {
+    var args = [this._wrapped].concat(Array.prototype.slice.call(arguments));
+    var res = fn.apply(null, args);
+    // if the result is non-string stop the chain and return the value
+    return typeof res === 'string' ? new s(res) : res;
+  };
+}
+
+// Copy functions to instance methods for chaining
+for (var key in s) fn2method(key, s[key]);
+
+fn2method('tap', function tap(string, fn) {
+  return fn(string);
+});
+
+function prototype2method(methodName) {
+  fn2method(methodName, function(context) {
+    var args = Array.prototype.slice.call(arguments, 1);
+    return String.prototype[methodName].apply(context, args);
+  });
+}
+
+var prototypeMethods = [
+  'toUpperCase',
+  'toLowerCase',
+  'split',
+  'replace',
+  'slice',
+  'substring',
+  'substr',
+  'concat'
+];
+
+for (var method in prototypeMethods) prototype2method(prototypeMethods[method]);
+
+
+module.exports = s;
diff --git a/wrt/node_modules/underscore.string/insert.js b/wrt/node_modules/underscore.string/insert.js
new file mode 100644 (file)
index 0000000..1c99c3b
--- /dev/null
@@ -0,0 +1,5 @@
+var splice = require('./splice');
+
+module.exports = function insert(str, i, substr) {
+  return splice(str, i, 0, substr);
+};
diff --git a/wrt/node_modules/underscore.string/isBlank.js b/wrt/node_modules/underscore.string/isBlank.js
new file mode 100644 (file)
index 0000000..386e819
--- /dev/null
@@ -0,0 +1,5 @@
+var makeString = require('./helper/makeString');
+
+module.exports = function isBlank(str) {
+  return (/^\s*$/).test(makeString(str));
+};
diff --git a/wrt/node_modules/underscore.string/join.js b/wrt/node_modules/underscore.string/join.js
new file mode 100644 (file)
index 0000000..b1a18ca
--- /dev/null
@@ -0,0 +1,9 @@
+var makeString = require('./helper/makeString');
+var slice = [].slice;
+
+module.exports = function join() {
+  var args = slice.call(arguments),
+    separator = args.shift();
+
+  return args.join(makeString(separator));
+};
diff --git a/wrt/node_modules/underscore.string/levenshtein.js b/wrt/node_modules/underscore.string/levenshtein.js
new file mode 100644 (file)
index 0000000..85f220c
--- /dev/null
@@ -0,0 +1,52 @@
+var makeString = require('./helper/makeString');
+
+/**
+ * Based on the implementation here: https://github.com/hiddentao/fast-levenshtein
+ */
+module.exports = function levenshtein(str1, str2) {
+  'use strict';
+  str1 = makeString(str1);
+  str2 = makeString(str2);
+
+  // Short cut cases  
+  if (str1 === str2) return 0;
+  if (!str1 || !str2) return Math.max(str1.length, str2.length);
+
+  // two rows
+  var prevRow = new Array(str2.length + 1);
+
+  // initialise previous row
+  for (var i = 0; i < prevRow.length; ++i) {
+    prevRow[i] = i;
+  }
+
+  // calculate current row distance from previous row
+  for (i = 0; i < str1.length; ++i) {
+    var nextCol = i + 1;
+
+    for (var j = 0; j < str2.length; ++j) {
+      var curCol = nextCol;
+
+      // substution
+      nextCol = prevRow[j] + ( (str1.charAt(i) === str2.charAt(j)) ? 0 : 1 );
+      // insertion
+      var tmp = curCol + 1;
+      if (nextCol > tmp) {
+        nextCol = tmp;
+      }
+      // deletion
+      tmp = prevRow[j + 1] + 1;
+      if (nextCol > tmp) {
+        nextCol = tmp;
+      }
+
+      // copy current col value into previous (in preparation for next iteration)
+      prevRow[j] = curCol;
+    }
+
+    // copy last col value into previous (in preparation for next iteration)
+    prevRow[j] = nextCol;
+  }
+
+  return nextCol;
+};
diff --git a/wrt/node_modules/underscore.string/lines.js b/wrt/node_modules/underscore.string/lines.js
new file mode 100644 (file)
index 0000000..40b11cc
--- /dev/null
@@ -0,0 +1,4 @@
+module.exports = function lines(str) {
+  if (str == null) return [];
+  return String(str).split(/\r\n?|\n/);
+};
diff --git a/wrt/node_modules/underscore.string/lpad.js b/wrt/node_modules/underscore.string/lpad.js
new file mode 100644 (file)
index 0000000..ada8c7e
--- /dev/null
@@ -0,0 +1,5 @@
+var pad = require('./pad');
+
+module.exports = function lpad(str, length, padStr) {
+  return pad(str, length, padStr);
+};
diff --git a/wrt/node_modules/underscore.string/lrpad.js b/wrt/node_modules/underscore.string/lrpad.js
new file mode 100644 (file)
index 0000000..e3162b0
--- /dev/null
@@ -0,0 +1,5 @@
+var pad = require('./pad');
+
+module.exports = function lrpad(str, length, padStr) {
+  return pad(str, length, padStr, 'both');
+};
diff --git a/wrt/node_modules/underscore.string/ltrim.js b/wrt/node_modules/underscore.string/ltrim.js
new file mode 100644 (file)
index 0000000..858936e
--- /dev/null
@@ -0,0 +1,10 @@
+var makeString = require('./helper/makeString');
+var defaultToWhiteSpace = require('./helper/defaultToWhiteSpace');
+var nativeTrimLeft = String.prototype.trimLeft;
+
+module.exports = function ltrim(str, characters) {
+  str = makeString(str);
+  if (!characters && nativeTrimLeft) return nativeTrimLeft.call(str);
+  characters = defaultToWhiteSpace(characters);
+  return str.replace(new RegExp('^' + characters + '+'), '');
+};
diff --git a/wrt/node_modules/underscore.string/map.js b/wrt/node_modules/underscore.string/map.js
new file mode 100644 (file)
index 0000000..c2910ae
--- /dev/null
@@ -0,0 +1,9 @@
+var makeString = require('./helper/makeString');
+
+module.exports = function(str, callback) {
+  str = makeString(str);
+
+  if (str.length === 0 || typeof callback !== 'function') return str;
+
+  return str.replace(/./g, callback);
+};
diff --git a/wrt/node_modules/underscore.string/meteor-post.js b/wrt/node_modules/underscore.string/meteor-post.js
new file mode 100644 (file)
index 0000000..3f38d8d
--- /dev/null
@@ -0,0 +1,2 @@
+// s will be picked up by Meteor and exported
+s = module.exports;
diff --git a/wrt/node_modules/underscore.string/meteor-pre.js b/wrt/node_modules/underscore.string/meteor-pre.js
new file mode 100644 (file)
index 0000000..e692bc3
--- /dev/null
@@ -0,0 +1,6 @@
+// Defining this will trick dist/underscore.string.js into putting its exports into module.exports
+// Credit to Tim Heckel for this trick - see https://github.com/TimHeckel/meteor-underscore-string
+module = {};
+
+// This also needed, otherwise above doesn't work???
+exports = {};
diff --git a/wrt/node_modules/underscore.string/naturalCmp.js b/wrt/node_modules/underscore.string/naturalCmp.js
new file mode 100644 (file)
index 0000000..7cb94e6
--- /dev/null
@@ -0,0 +1,29 @@
+module.exports = function naturalCmp(str1, str2) {
+  if (str1 == str2) return 0;
+  if (!str1) return -1;
+  if (!str2) return 1;
+
+  var cmpRegex = /(\.\d+|\d+|\D+)/g,
+    tokens1 = String(str1).match(cmpRegex),
+    tokens2 = String(str2).match(cmpRegex),
+    count = Math.min(tokens1.length, tokens2.length);
+
+  for (var i = 0; i < count; i++) {
+    var a = tokens1[i],
+      b = tokens2[i];
+
+    if (a !== b) {
+      var num1 = +a;
+      var num2 = +b;
+      if (num1 === num1 && num2 === num2) {
+        return num1 > num2 ? 1 : -1;
+      }
+      return a < b ? -1 : 1;
+    }
+  }
+
+  if (tokens1.length != tokens2.length)
+    return tokens1.length - tokens2.length;
+
+  return str1 < str2 ? -1 : 1;
+};
diff --git a/wrt/node_modules/underscore.string/numberFormat.js b/wrt/node_modules/underscore.string/numberFormat.js
new file mode 100644 (file)
index 0000000..6a681fe
--- /dev/null
@@ -0,0 +1,12 @@
+module.exports = function numberFormat(number, dec, dsep, tsep) {
+  if (isNaN(number) || number == null) return '';
+
+  number = number.toFixed(~~dec);
+  tsep = typeof tsep == 'string' ? tsep : ',';
+
+  var parts = number.split('.'),
+    fnums = parts[0],
+    decimals = parts[1] ? (dsep || '.') + parts[1] : '';
+
+  return fnums.replace(/(\d)(?=(?:\d{3})+$)/g, '$1' + tsep) + decimals;
+};
diff --git a/wrt/node_modules/underscore.string/package.js b/wrt/node_modules/underscore.string/package.js
new file mode 100644 (file)
index 0000000..96f0d42
--- /dev/null
@@ -0,0 +1,16 @@
+// package metadata file for Meteor.js
+
+Package.describe({
+  name: 'underscorestring:underscore.string',
+  summary: 'underscore.string (official): String manipulation extensions for Underscore.js javascript library.',
+  version: '3.3.4',
+  git: 'https://github.com/epeli/underscore.string.git',
+  documentation: 'README.markdown'
+});
+
+
+Package.onUse(function (api) {
+  api.versionsFrom('METEOR@1.0');
+  api.addFiles(['meteor-pre.js','dist/underscore.string.js','meteor-post.js']);
+  api.export("s");
+});
diff --git a/wrt/node_modules/underscore.string/package.json b/wrt/node_modules/underscore.string/package.json
new file mode 100644 (file)
index 0000000..5757903
--- /dev/null
@@ -0,0 +1,177 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "underscore.string",
+        "scope": null,
+        "escapedName": "underscore.string",
+        "name": "underscore.string",
+        "rawSpec": "",
+        "spec": "latest",
+        "type": "tag"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt"
+    ]
+  ],
+  "_from": "underscore.string@latest",
+  "_id": "underscore.string@3.3.4",
+  "_inCache": true,
+  "_location": "/underscore.string",
+  "_nodeVersion": "4.2.2",
+  "_npmOperationalInternal": {
+    "host": "packages-6-west.internal.npmjs.com",
+    "tmp": "tmp/underscore.string-3.3.4.tgz_1456303259101_0.7602346076164395"
+  },
+  "_npmUser": {
+    "name": "schtoeffel",
+    "email": "schtoeffel@gmail.com"
+  },
+  "_npmVersion": "2.14.7",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "underscore.string",
+    "scope": null,
+    "escapedName": "underscore.string",
+    "name": "underscore.string",
+    "rawSpec": "",
+    "spec": "latest",
+    "type": "tag"
+  },
+  "_requiredBy": [
+    "#USER"
+  ],
+  "_resolved": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.4.tgz",
+  "_shasum": "2c2a3f9f83e64762fdc45e6ceac65142864213db",
+  "_shrinkwrap": null,
+  "_spec": "underscore.string",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt",
+  "bugs": {
+    "url": "https://github.com/epeli/underscore.string/issues"
+  },
+  "contributors": [
+    {
+      "name": "Esa-Matti Suuronen",
+      "email": "esa-matti@suuronen.org",
+      "url": "http://esa-matti.suuronen.org/"
+    },
+    {
+      "name": "Edward Tsech",
+      "email": "edtsech@gmail.com"
+    },
+    {
+      "name": "Pavel Pravosud",
+      "email": "pavel@pravosud.com",
+      "url": "<https://github.com/rwz>"
+    },
+    {
+      "name": "Sasha Koss",
+      "email": "kossnocorp@gmail.com",
+      "url": "http://koss.nocorp.me/"
+    },
+    {
+      "name": "Vladimir Dronnikov",
+      "email": "dronnikov@gmail.com"
+    },
+    {
+      "name": "Pete Kruckenberg",
+      "email": "https://github.com/kruckenb",
+      "url": "<https://github.com/kruckenb>"
+    },
+    {
+      "name": "Paul Chavard",
+      "email": "paul@chavard.net",
+      "url": "<http://tchak.net>"
+    },
+    {
+      "name": "Ed Finkler",
+      "email": "coj@funkatron.com",
+      "url": "<http://funkatron.com>"
+    },
+    {
+      "name": "Christoph Hermann",
+      "email": "schtoeffel@gmail.com",
+      "url": "<https://github.com/stoeffel>"
+    }
+  ],
+  "dependencies": {
+    "sprintf-js": "^1.0.3",
+    "util-deprecate": "^1.0.2"
+  },
+  "description": "String manipulation extensions for Underscore.js javascript library.",
+  "devDependencies": {
+    "browserify": "^13.0.0",
+    "browserify-header": "^0.9.2",
+    "eslint": "^1.10.3",
+    "istanbul": "^0.4.2",
+    "mocha": "^2.1.0",
+    "mocha-lcov-reporter": "^1.0.0",
+    "replace": "^0.3.0",
+    "uglifyjs": "^2.4.10",
+    "underscore": "^1.7.0"
+  },
+  "directories": {
+    "lib": "./"
+  },
+  "dist": {
+    "shasum": "2c2a3f9f83e64762fdc45e6ceac65142864213db",
+    "tarball": "https://registry.npmjs.org/underscore.string/-/underscore.string-3.3.4.tgz"
+  },
+  "engines": {
+    "node": "*"
+  },
+  "gitHead": "2f78f0d6e36d553484a1bf5fe5ed1998f013dea5",
+  "homepage": "http://epeli.github.com/underscore.string/",
+  "jshintConfig": {
+    "node": true,
+    "browser": true,
+    "qunit": true,
+    "globals": {
+      "s": true
+    }
+  },
+  "keywords": [
+    "underscore",
+    "string"
+  ],
+  "license": "MIT",
+  "main": "./index.js",
+  "maintainers": [
+    {
+      "name": "edtsech",
+      "email": "edtsech@gmail.com"
+    },
+    {
+      "name": "rwz",
+      "email": "rwz@duckroll.ru"
+    },
+    {
+      "name": "epeli",
+      "email": "esa-matti@suuronen.org"
+    },
+    {
+      "name": "schtoeffel",
+      "email": "schtoeffel@gmail.com"
+    }
+  ],
+  "name": "underscore.string",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/epeli/underscore.string.git"
+  },
+  "scripts": {
+    "build": "npm run build:clean && npm run build:bundle && npm run build:min",
+    "build:bundle": "mkdir dist && browserify index.js -o dist/underscore.string.js -p browserify-header -s s",
+    "build:clean": "rm -rf dist",
+    "build:min": "uglifyjs dist/underscore.string.js -o dist/underscore.string.min.js --comments",
+    "coverage": "istanbul cover ./node_modules/mocha/bin/_mocha  -- --report=lcov --ui=qunit tests",
+    "release": "npm test && npm run release:version && npm run build && npm run release:push",
+    "release:push": "node scripts/push-tags.js",
+    "release:version": "node scripts/bump-version.js",
+    "test": "npm run test:lint && npm run test:unit && npm run coverage",
+    "test:lint": "eslint -c .eslintrc .",
+    "test:unit": "mocha --ui=qunit tests"
+  },
+  "version": "3.3.4"
+}
diff --git a/wrt/node_modules/underscore.string/pad.js b/wrt/node_modules/underscore.string/pad.js
new file mode 100644 (file)
index 0000000..9a2a87d
--- /dev/null
@@ -0,0 +1,26 @@
+var makeString = require('./helper/makeString');
+var strRepeat = require('./helper/strRepeat');
+
+module.exports = function pad(str, length, padStr, type) {
+  str = makeString(str);
+  length = ~~length;
+
+  var padlen = 0;
+
+  if (!padStr)
+    padStr = ' ';
+  else if (padStr.length > 1)
+    padStr = padStr.charAt(0);
+
+  switch (type) {
+  case 'right':
+    padlen = length - str.length;
+    return str + strRepeat(padStr, padlen);
+  case 'both':
+    padlen = length - str.length;
+    return strRepeat(padStr, Math.ceil(padlen / 2)) + str + strRepeat(padStr, Math.floor(padlen / 2));
+  default: // 'left'
+    padlen = length - str.length;
+    return strRepeat(padStr, padlen) + str;
+  }
+};
diff --git a/wrt/node_modules/underscore.string/pred.js b/wrt/node_modules/underscore.string/pred.js
new file mode 100644 (file)
index 0000000..a123701
--- /dev/null
@@ -0,0 +1,5 @@
+var adjacent = require('./helper/adjacent');
+
+module.exports = function succ(str) {
+  return adjacent(str, -1);
+};
diff --git a/wrt/node_modules/underscore.string/prune.js b/wrt/node_modules/underscore.string/prune.js
new file mode 100644 (file)
index 0000000..85b8398
--- /dev/null
@@ -0,0 +1,27 @@
+/**
+ * _s.prune: a more elegant version of truncate
+ * prune extra chars, never leaving a half-chopped word.
+ * @author github.com/rwz
+ */
+var makeString = require('./helper/makeString');
+var rtrim = require('./rtrim');
+
+module.exports = function prune(str, length, pruneStr) {
+  str = makeString(str);
+  length = ~~length;
+  pruneStr = pruneStr != null ? String(pruneStr) : '...';
+
+  if (str.length <= length) return str;
+
+  var tmpl = function(c) {
+      return c.toUpperCase() !== c.toLowerCase() ? 'A' : ' ';
+    },
+    template = str.slice(0, length + 1).replace(/.(?=\W*\w*$)/g, tmpl); // 'Hello, world' -> 'HellAA AAAAA'
+
+  if (template.slice(template.length - 2).match(/\w\w/))
+    template = template.replace(/\s*\S+$/, '');
+  else
+    template = rtrim(template.slice(0, template.length - 1));
+
+  return (template + pruneStr).length > str.length ? str : str.slice(0, template.length) + pruneStr;
+};
diff --git a/wrt/node_modules/underscore.string/quote.js b/wrt/node_modules/underscore.string/quote.js
new file mode 100644 (file)
index 0000000..1e90f63
--- /dev/null
@@ -0,0 +1,5 @@
+var surround = require('./surround');
+
+module.exports = function quote(str, quoteChar) {
+  return surround(str, quoteChar || '"');
+};
diff --git a/wrt/node_modules/underscore.string/repeat.js b/wrt/node_modules/underscore.string/repeat.js
new file mode 100644 (file)
index 0000000..71228ed
--- /dev/null
@@ -0,0 +1,16 @@
+var makeString = require('./helper/makeString');
+var strRepeat = require('./helper/strRepeat');
+
+module.exports = function repeat(str, qty, separator) {
+  str = makeString(str);
+
+  qty = ~~qty;
+
+  // using faster implementation if separator is not needed;
+  if (separator == null) return strRepeat(str, qty);
+
+  // this one is about 300x slower in Google Chrome
+  /*eslint no-empty: 0*/
+  for (var repeat = []; qty > 0; repeat[--qty] = str) {}
+  return repeat.join(separator);
+};
diff --git a/wrt/node_modules/underscore.string/replaceAll.js b/wrt/node_modules/underscore.string/replaceAll.js
new file mode 100644 (file)
index 0000000..93f6c0d
--- /dev/null
@@ -0,0 +1,8 @@
+var makeString = require('./helper/makeString');
+
+module.exports = function replaceAll(str, find, replace, ignorecase) {
+  var flags = (ignorecase === true)?'gi':'g';
+  var reg = new RegExp(find, flags);
+
+  return makeString(str).replace(reg, replace);
+};
diff --git a/wrt/node_modules/underscore.string/reverse.js b/wrt/node_modules/underscore.string/reverse.js
new file mode 100644 (file)
index 0000000..b9ef2e6
--- /dev/null
@@ -0,0 +1,5 @@
+var chars = require('./chars');
+
+module.exports = function reverse(str) {
+  return chars(str).reverse().join('');
+};
diff --git a/wrt/node_modules/underscore.string/rpad.js b/wrt/node_modules/underscore.string/rpad.js
new file mode 100644 (file)
index 0000000..b37d386
--- /dev/null
@@ -0,0 +1,5 @@
+var pad = require('./pad');
+
+module.exports = function rpad(str, length, padStr) {
+  return pad(str, length, padStr, 'right');
+};
diff --git a/wrt/node_modules/underscore.string/rtrim.js b/wrt/node_modules/underscore.string/rtrim.js
new file mode 100644 (file)
index 0000000..e6be2ed
--- /dev/null
@@ -0,0 +1,10 @@
+var makeString = require('./helper/makeString');
+var defaultToWhiteSpace = require('./helper/defaultToWhiteSpace');
+var nativeTrimRight = String.prototype.trimRight;
+
+module.exports = function rtrim(str, characters) {
+  str = makeString(str);
+  if (!characters && nativeTrimRight) return nativeTrimRight.call(str);
+  characters = defaultToWhiteSpace(characters);
+  return str.replace(new RegExp(characters + '+$'), '');
+};
diff --git a/wrt/node_modules/underscore.string/slugify.js b/wrt/node_modules/underscore.string/slugify.js
new file mode 100644 (file)
index 0000000..3701ccd
--- /dev/null
@@ -0,0 +1,7 @@
+var trim = require('./trim');
+var dasherize = require('./dasherize');
+var cleanDiacritics = require('./cleanDiacritics');
+
+module.exports = function slugify(str) {
+  return trim(dasherize(cleanDiacritics(str).replace(/[^\w\s-]/g, '-').toLowerCase()), '-');
+};
diff --git a/wrt/node_modules/underscore.string/splice.js b/wrt/node_modules/underscore.string/splice.js
new file mode 100644 (file)
index 0000000..34c0410
--- /dev/null
@@ -0,0 +1,7 @@
+var chars = require('./chars');
+
+module.exports = function splice(str, i, howmany, substr) {
+  var arr = chars(str);
+  arr.splice(~~i, ~~howmany, substr);
+  return arr.join('');
+};
diff --git a/wrt/node_modules/underscore.string/sprintf.js b/wrt/node_modules/underscore.string/sprintf.js
new file mode 100644 (file)
index 0000000..427e620
--- /dev/null
@@ -0,0 +1,4 @@
+var deprecate = require('util-deprecate');
+
+module.exports = deprecate(require('sprintf-js').sprintf,
+  'sprintf() will be removed in the next major release, use the sprintf-js package instead.');
diff --git a/wrt/node_modules/underscore.string/startsWith.js b/wrt/node_modules/underscore.string/startsWith.js
new file mode 100644 (file)
index 0000000..a9f4790
--- /dev/null
@@ -0,0 +1,9 @@
+var makeString = require('./helper/makeString');
+var toPositive = require('./helper/toPositive');
+
+module.exports = function startsWith(str, starts, position) {
+  str = makeString(str);
+  starts = '' + starts;
+  position = position == null ? 0 : Math.min(toPositive(position), str.length);
+  return str.lastIndexOf(starts, position) === position;
+};
diff --git a/wrt/node_modules/underscore.string/strLeft.js b/wrt/node_modules/underscore.string/strLeft.js
new file mode 100644 (file)
index 0000000..0602984
--- /dev/null
@@ -0,0 +1,8 @@
+var makeString = require('./helper/makeString');
+
+module.exports = function strLeft(str, sep) {
+  str = makeString(str);
+  sep = makeString(sep);
+  var pos = !sep ? -1 : str.indexOf(sep);
+  return~ pos ? str.slice(0, pos) : str;
+};
diff --git a/wrt/node_modules/underscore.string/strLeftBack.js b/wrt/node_modules/underscore.string/strLeftBack.js
new file mode 100644 (file)
index 0000000..0136e20
--- /dev/null
@@ -0,0 +1,8 @@
+var makeString = require('./helper/makeString');
+
+module.exports = function strLeftBack(str, sep) {
+  str = makeString(str);
+  sep = makeString(sep);
+  var pos = str.lastIndexOf(sep);
+  return~ pos ? str.slice(0, pos) : str;
+};
diff --git a/wrt/node_modules/underscore.string/strRight.js b/wrt/node_modules/underscore.string/strRight.js
new file mode 100644 (file)
index 0000000..67b45b5
--- /dev/null
@@ -0,0 +1,8 @@
+var makeString = require('./helper/makeString');
+
+module.exports = function strRight(str, sep) {
+  str = makeString(str);
+  sep = makeString(sep);
+  var pos = !sep ? -1 : str.indexOf(sep);
+  return~ pos ? str.slice(pos + sep.length, str.length) : str;
+};
diff --git a/wrt/node_modules/underscore.string/strRightBack.js b/wrt/node_modules/underscore.string/strRightBack.js
new file mode 100644 (file)
index 0000000..43de0e9
--- /dev/null
@@ -0,0 +1,8 @@
+var makeString = require('./helper/makeString');
+
+module.exports = function strRightBack(str, sep) {
+  str = makeString(str);
+  sep = makeString(sep);
+  var pos = !sep ? -1 : str.lastIndexOf(sep);
+  return~ pos ? str.slice(pos + sep.length, str.length) : str;
+};
diff --git a/wrt/node_modules/underscore.string/stripTags.js b/wrt/node_modules/underscore.string/stripTags.js
new file mode 100644 (file)
index 0000000..8948d36
--- /dev/null
@@ -0,0 +1,5 @@
+var makeString = require('./helper/makeString');
+
+module.exports = function stripTags(str) {
+  return makeString(str).replace(/<\/?[^>]+>/g, '');
+};
diff --git a/wrt/node_modules/underscore.string/succ.js b/wrt/node_modules/underscore.string/succ.js
new file mode 100644 (file)
index 0000000..313c8e8
--- /dev/null
@@ -0,0 +1,5 @@
+var adjacent = require('./helper/adjacent');
+
+module.exports = function succ(str) {
+  return adjacent(str, 1);
+};
diff --git a/wrt/node_modules/underscore.string/surround.js b/wrt/node_modules/underscore.string/surround.js
new file mode 100644 (file)
index 0000000..9cb7f7e
--- /dev/null
@@ -0,0 +1,3 @@
+module.exports = function surround(str, wrapper) {
+  return [wrapper, str, wrapper].join('');
+};
diff --git a/wrt/node_modules/underscore.string/swapCase.js b/wrt/node_modules/underscore.string/swapCase.js
new file mode 100644 (file)
index 0000000..0857262
--- /dev/null
@@ -0,0 +1,7 @@
+var makeString = require('./helper/makeString');
+
+module.exports = function swapCase(str) {
+  return makeString(str).replace(/\S/g, function(c) {
+    return c === c.toUpperCase() ? c.toLowerCase() : c.toUpperCase();
+  });
+};
diff --git a/wrt/node_modules/underscore.string/titleize.js b/wrt/node_modules/underscore.string/titleize.js
new file mode 100644 (file)
index 0000000..c4a8a47
--- /dev/null
@@ -0,0 +1,7 @@
+var makeString = require('./helper/makeString');
+
+module.exports = function titleize(str) {
+  return makeString(str).toLowerCase().replace(/(?:^|\s|-)\S/g, function(c) {
+    return c.toUpperCase();
+  });
+};
diff --git a/wrt/node_modules/underscore.string/toBoolean.js b/wrt/node_modules/underscore.string/toBoolean.js
new file mode 100644 (file)
index 0000000..f2c184e
--- /dev/null
@@ -0,0 +1,20 @@
+var trim = require('./trim');
+
+function boolMatch(s, matchers) {
+  var i, matcher, down = s.toLowerCase();
+  matchers = [].concat(matchers);
+  for (i = 0; i < matchers.length; i += 1) {
+    matcher = matchers[i];
+    if (!matcher) continue;
+    if (matcher.test && matcher.test(s)) return true;
+    if (matcher.toLowerCase() === down) return true;
+  }
+}
+
+module.exports = function toBoolean(str, trueValues, falseValues) {
+  if (typeof str === 'number') str = '' + str;
+  if (typeof str !== 'string') return !!str;
+  str = trim(str);
+  if (boolMatch(str, trueValues || ['true', '1'])) return true;
+  if (boolMatch(str, falseValues || ['false', '0'])) return false;
+};
diff --git a/wrt/node_modules/underscore.string/toNumber.js b/wrt/node_modules/underscore.string/toNumber.js
new file mode 100644 (file)
index 0000000..92d47dd
--- /dev/null
@@ -0,0 +1,5 @@
+module.exports = function toNumber(num, precision) {
+  if (num == null) return 0;
+  var factor = Math.pow(10, isFinite(precision) ? precision : 0);
+  return Math.round(num * factor) / factor;
+};
diff --git a/wrt/node_modules/underscore.string/toSentence.js b/wrt/node_modules/underscore.string/toSentence.js
new file mode 100644 (file)
index 0000000..2284bd9
--- /dev/null
@@ -0,0 +1,12 @@
+var rtrim = require('./rtrim');
+
+module.exports = function toSentence(array, separator, lastSeparator, serial) {
+  separator = separator || ', ';
+  lastSeparator = lastSeparator || ' and ';
+  var a = array.slice(),
+    lastMember = a.pop();
+
+  if (array.length > 2 && serial) lastSeparator = rtrim(separator) + lastSeparator;
+
+  return a.length ? a.join(separator) + lastSeparator + lastMember : lastMember;
+};
diff --git a/wrt/node_modules/underscore.string/toSentenceSerial.js b/wrt/node_modules/underscore.string/toSentenceSerial.js
new file mode 100644 (file)
index 0000000..2b8d350
--- /dev/null
@@ -0,0 +1,5 @@
+var toSentence = require('./toSentence');
+
+module.exports = function toSentenceSerial(array, sep, lastSep) {
+  return toSentence(array, sep, lastSep, true);
+};
diff --git a/wrt/node_modules/underscore.string/trim.js b/wrt/node_modules/underscore.string/trim.js
new file mode 100644 (file)
index 0000000..0f2a33d
--- /dev/null
@@ -0,0 +1,10 @@
+var makeString = require('./helper/makeString');
+var defaultToWhiteSpace = require('./helper/defaultToWhiteSpace');
+var nativeTrim = String.prototype.trim;
+
+module.exports = function trim(str, characters) {
+  str = makeString(str);
+  if (!characters && nativeTrim) return nativeTrim.call(str);
+  characters = defaultToWhiteSpace(characters);
+  return str.replace(new RegExp('^' + characters + '+|' + characters + '+$', 'g'), '');
+};
diff --git a/wrt/node_modules/underscore.string/truncate.js b/wrt/node_modules/underscore.string/truncate.js
new file mode 100644 (file)
index 0000000..dbb8fd7
--- /dev/null
@@ -0,0 +1,8 @@
+var makeString = require('./helper/makeString');
+
+module.exports = function truncate(str, length, truncateStr) {
+  str = makeString(str);
+  truncateStr = truncateStr || '...';
+  length = ~~length;
+  return str.length > length ? str.slice(0, length) + truncateStr : str;
+};
diff --git a/wrt/node_modules/underscore.string/underscored.js b/wrt/node_modules/underscore.string/underscored.js
new file mode 100644 (file)
index 0000000..b9d1628
--- /dev/null
@@ -0,0 +1,5 @@
+var trim = require('./trim');
+
+module.exports = function underscored(str) {
+  return trim(str).replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/[-\s]+/g, '_').toLowerCase();
+};
diff --git a/wrt/node_modules/underscore.string/unescapeHTML.js b/wrt/node_modules/underscore.string/unescapeHTML.js
new file mode 100644 (file)
index 0000000..78b59c2
--- /dev/null
@@ -0,0 +1,20 @@
+var makeString = require('./helper/makeString');
+var htmlEntities = require('./helper/htmlEntities');
+
+module.exports = function unescapeHTML(str) {
+  return makeString(str).replace(/\&([^;]+);/g, function(entity, entityCode) {
+    var match;
+
+    if (entityCode in htmlEntities) {
+      return htmlEntities[entityCode];
+    /*eslint no-cond-assign: 0*/
+    } else if (match = entityCode.match(/^#x([\da-fA-F]+)$/)) {
+      return String.fromCharCode(parseInt(match[1], 16));
+    /*eslint no-cond-assign: 0*/
+    } else if (match = entityCode.match(/^#(\d+)$/)) {
+      return String.fromCharCode(~~match[1]);
+    } else {
+      return entity;
+    }
+  });
+};
diff --git a/wrt/node_modules/underscore.string/unquote.js b/wrt/node_modules/underscore.string/unquote.js
new file mode 100644 (file)
index 0000000..fefba49
--- /dev/null
@@ -0,0 +1,6 @@
+module.exports = function unquote(str, quoteChar) {
+  quoteChar = quoteChar || '"';
+  if (str[0] === quoteChar && str[str.length - 1] === quoteChar)
+    return str.slice(1, str.length - 1);
+  else return str;
+};
diff --git a/wrt/node_modules/underscore.string/vsprintf.js b/wrt/node_modules/underscore.string/vsprintf.js
new file mode 100644 (file)
index 0000000..6ce2c98
--- /dev/null
@@ -0,0 +1,4 @@
+var deprecate = require('util-deprecate');
+
+module.exports = deprecate(require('sprintf-js').vsprintf,
+  'vsprintf() will be removed in the next major release, use the sprintf-js package instead.');
diff --git a/wrt/node_modules/underscore.string/words.js b/wrt/node_modules/underscore.string/words.js
new file mode 100644 (file)
index 0000000..be55c9c
--- /dev/null
@@ -0,0 +1,7 @@
+var isBlank = require('./isBlank');
+var trim = require('./trim');
+
+module.exports = function words(str, delimiter) {
+  if (isBlank(str)) return [];
+  return trim(str, delimiter).split(delimiter || /\s+/);
+};
diff --git a/wrt/node_modules/underscore.string/wrap.js b/wrt/node_modules/underscore.string/wrap.js
new file mode 100644 (file)
index 0000000..e4e1756
--- /dev/null
@@ -0,0 +1,102 @@
+// Wrap
+// wraps a string by a certain width
+
+var makeString = require('./helper/makeString');
+
+module.exports = function wrap(str, options){
+  str = makeString(str);
+  
+  options = options || {};
+  
+  var width = options.width || 75;
+  var seperator = options.seperator || '\n';
+  var cut = options.cut || false;
+  var preserveSpaces = options.preserveSpaces || false;
+  var trailingSpaces = options.trailingSpaces || false;
+  
+  var result;
+  
+  if(width <= 0){
+    return str;
+  }
+  
+  else if(!cut){
+  
+    var words = str.split(' ');
+    var current_column = 0;
+    result = '';
+  
+    while(words.length > 0){
+      
+      // if adding a space and the next word would cause this line to be longer than width...
+      if(1 + words[0].length + current_column > width){
+        //start a new line if this line is not already empty
+        if(current_column > 0){
+          // add a space at the end of the line is preserveSpaces is true
+          if (preserveSpaces){
+            result += ' ';
+            current_column++;
+          }
+          // fill the rest of the line with spaces if trailingSpaces option is true
+          else if(trailingSpaces){
+            while(current_column < width){
+              result += ' ';
+              current_column++;
+            }            
+          }
+          //start new line
+          result += seperator;
+          current_column = 0;
+        }
+      }
+  
+      // if not at the begining of the line, add a space in front of the word
+      if(current_column > 0){
+        result += ' ';
+        current_column++;
+      }
+  
+      // tack on the next word, update current column, a pop words array
+      result += words[0];
+      current_column += words[0].length;
+      words.shift();
+  
+    }
+  
+    // fill the rest of the line with spaces if trailingSpaces option is true
+    if(trailingSpaces){
+      while(current_column < width){
+        result += ' ';
+        current_column++;
+      }            
+    }
+  
+    return result;
+  
+  }
+  
+  else {
+  
+    var index = 0;
+    result = '';
+  
+    // walk through each character and add seperators where appropriate
+    while(index < str.length){
+      if(index % width == 0 && index > 0){
+        result += seperator;
+      }
+      result += str.charAt(index);
+      index++;
+    }
+  
+    // fill the rest of the line with spaces if trailingSpaces option is true
+    if(trailingSpaces){
+      while(index % width > 0){
+        result += ' ';
+        index++;
+      }            
+    }
+    
+    return result;
+  }
+};
diff --git a/wrt/node_modules/underscore/LICENSE b/wrt/node_modules/underscore/LICENSE
new file mode 100644 (file)
index 0000000..0d6b873
--- /dev/null
@@ -0,0 +1,23 @@
+Copyright (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative
+Reporters & Editors
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/underscore/README.md b/wrt/node_modules/underscore/README.md
new file mode 100644 (file)
index 0000000..c2ba259
--- /dev/null
@@ -0,0 +1,22 @@
+                       __
+                      /\ \                                                         __
+     __  __    ___    \_\ \     __   _ __   ____    ___    ___   _ __    __       /\_\    ____
+    /\ \/\ \ /' _ `\  /'_  \  /'__`\/\  __\/ ,__\  / ___\ / __`\/\  __\/'__`\     \/\ \  /',__\
+    \ \ \_\ \/\ \/\ \/\ \ \ \/\  __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\  __/  __  \ \ \/\__, `\
+     \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/
+      \/___/  \/_/\/_/\/__,_ /\/____/ \/_/ \/___/  \/____/\/___/  \/_/ \/____/\/_//\ \_\ \/___/
+                                                                                  \ \____/
+                                                                                   \/___/
+
+Underscore.js is a utility-belt library for JavaScript that provides
+support for the usual functional suspects (each, map, reduce, filter...)
+without extending any core JavaScript objects.
+
+For Docs, License, Tests, and pre-packed downloads, see:
+http://underscorejs.org
+
+Underscore is an open-sourced component of DocumentCloud:
+https://github.com/documentcloud
+
+Many thanks to our contributors:
+https://github.com/jashkenas/underscore/contributors
diff --git a/wrt/node_modules/underscore/package.json b/wrt/node_modules/underscore/package.json
new file mode 100644 (file)
index 0000000..21c788c
--- /dev/null
@@ -0,0 +1,71 @@
+{
+  "_from": "underscore@~1.6.0",
+  "_id": "underscore@1.6.0",
+  "_inBundle": false,
+  "_integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=",
+  "_location": "/underscore",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "underscore@~1.6.0",
+    "name": "underscore",
+    "escapedName": "underscore",
+    "rawSpec": "~1.6.0",
+    "saveSpec": null,
+    "fetchSpec": "~1.6.0"
+  },
+  "_requiredBy": [
+    "/underscore-plus"
+  ],
+  "_resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz",
+  "_shasum": "8b38b10cacdef63337b8b24e4ff86d45aea529a8",
+  "_spec": "underscore@~1.6.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was/node_modules/underscore-plus",
+  "author": {
+    "name": "Jeremy Ashkenas",
+    "email": "jeremy@documentcloud.org"
+  },
+  "bugs": {
+    "url": "https://github.com/jashkenas/underscore/issues"
+  },
+  "bundleDependencies": false,
+  "deprecated": false,
+  "description": "JavaScript's functional programming helper library.",
+  "devDependencies": {
+    "docco": "0.6.x",
+    "phantomjs": "1.9.0-1",
+    "uglify-js": "2.4.x"
+  },
+  "files": [
+    "underscore.js",
+    "underscore-min.js",
+    "LICENSE"
+  ],
+  "homepage": "http://underscorejs.org",
+  "keywords": [
+    "util",
+    "functional",
+    "server",
+    "client",
+    "browser"
+  ],
+  "licenses": [
+    {
+      "type": "MIT",
+      "url": "https://raw.github.com/jashkenas/underscore/master/LICENSE"
+    }
+  ],
+  "main": "underscore.js",
+  "name": "underscore",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/jashkenas/underscore.git"
+  },
+  "scripts": {
+    "build": "uglifyjs underscore.js -c \"evaluate=false\" --comments \"/    .*/\" -m --source-map underscore-min.map -o underscore-min.js",
+    "doc": "docco underscore.js",
+    "test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true"
+  },
+  "version": "1.6.0"
+}
diff --git a/wrt/node_modules/underscore/underscore-min.js b/wrt/node_modules/underscore/underscore-min.js
new file mode 100644 (file)
index 0000000..3434d6c
--- /dev/null
@@ -0,0 +1,6 @@
+//     Underscore.js 1.6.0
+//     http://underscorejs.org
+//     (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+//     Underscore may be freely distributed under the MIT license.
+(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,g=e.filter,d=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,w=Object.keys,_=i.bind,j=function(n){return n instanceof j?n:this instanceof j?void(this._wrapped=n):new j(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=j),exports._=j):n._=j,j.VERSION="1.6.0";var A=j.each=j.forEach=function(n,t,e){if(null==n)return n;if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a=j.keys(n),u=0,i=a.length;i>u;u++)if(t.call(e,n[a[u]],a[u],n)===r)return;return n};j.map=j.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e.push(t.call(r,n,u,i))}),e)};var O="Reduce of empty array with no initial value";j.reduce=j.foldl=j.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=j.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(O);return r},j.reduceRight=j.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=j.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=j.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(O);return r},j.find=j.detect=function(n,t,r){var e;return k(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},j.filter=j.select=function(n,t,r){var e=[];return null==n?e:g&&n.filter===g?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&e.push(n)}),e)},j.reject=function(n,t,r){return j.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},j.every=j.all=function(n,t,e){t||(t=j.identity);var u=!0;return null==n?u:d&&n.every===d?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var k=j.some=j.any=function(n,t,e){t||(t=j.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};j.contains=j.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:k(n,function(n){return n===t})},j.invoke=function(n,t){var r=o.call(arguments,2),e=j.isFunction(t);return j.map(n,function(n){return(e?t:n[t]).apply(n,r)})},j.pluck=function(n,t){return j.map(n,j.property(t))},j.where=function(n,t){return j.filter(n,j.matches(t))},j.findWhere=function(n,t){return j.find(n,j.matches(t))},j.max=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.max.apply(Math,n);var e=-1/0,u=-1/0;return A(n,function(n,i,a){var o=t?t.call(r,n,i,a):n;o>u&&(e=n,u=o)}),e},j.min=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.min.apply(Math,n);var e=1/0,u=1/0;return A(n,function(n,i,a){var o=t?t.call(r,n,i,a):n;u>o&&(e=n,u=o)}),e},j.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=j.random(r++),e[r-1]=e[t],e[t]=n}),e},j.sample=function(n,t,r){return null==t||r?(n.length!==+n.length&&(n=j.values(n)),n[j.random(n.length-1)]):j.shuffle(n).slice(0,Math.max(0,t))};var E=function(n){return null==n?j.identity:j.isFunction(n)?n:j.property(n)};j.sortBy=function(n,t,r){return t=E(t),j.pluck(j.map(n,function(n,e,u){return{value:n,index:e,criteria:t.call(r,n,e,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={};return r=E(r),A(t,function(i,a){var o=r.call(e,i,a,t);n(u,o,i)}),u}};j.groupBy=F(function(n,t,r){j.has(n,t)?n[t].push(r):n[t]=[r]}),j.indexBy=F(function(n,t,r){n[t]=r}),j.countBy=F(function(n,t){j.has(n,t)?n[t]++:n[t]=1}),j.sortedIndex=function(n,t,r,e){r=E(r);for(var u=r.call(e,t),i=0,a=n.length;a>i;){var o=i+a>>>1;r.call(e,n[o])<u?i=o+1:a=o}return i},j.toArray=function(n){return n?j.isArray(n)?o.call(n):n.length===+n.length?j.map(n,j.identity):j.values(n):[]},j.size=function(n){return null==n?0:n.length===+n.length?n.length:j.keys(n).length},j.first=j.head=j.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:0>t?[]:o.call(n,0,t)},j.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},j.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},j.rest=j.tail=j.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},j.compact=function(n){return j.filter(n,j.identity)};var M=function(n,t,r){return t&&j.every(n,j.isArray)?c.apply(r,n):(A(n,function(n){j.isArray(n)||j.isArguments(n)?t?a.apply(r,n):M(n,t,r):r.push(n)}),r)};j.flatten=function(n,t){return M(n,t,[])},j.without=function(n){return j.difference(n,o.call(arguments,1))},j.partition=function(n,t){var r=[],e=[];return A(n,function(n){(t(n)?r:e).push(n)}),[r,e]},j.uniq=j.unique=function(n,t,r,e){j.isFunction(t)&&(e=r,r=t,t=!1);var u=r?j.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:j.contains(a,r))||(a.push(r),i.push(n[e]))}),i},j.union=function(){return j.uniq(j.flatten(arguments,!0))},j.intersection=function(n){var t=o.call(arguments,1);return j.filter(j.uniq(n),function(n){return j.every(t,function(t){return j.contains(t,n)})})},j.difference=function(n){var t=c.apply(e,o.call(arguments,1));return j.filter(n,function(n){return!j.contains(t,n)})},j.zip=function(){for(var n=j.max(j.pluck(arguments,"length").concat(0)),t=new Array(n),r=0;n>r;r++)t[r]=j.pluck(arguments,""+r);return t},j.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},j.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=j.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},j.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},j.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=new Array(e);e>u;)i[u++]=n,n+=r;return i};var R=function(){};j.bind=function(n,t){var r,e;if(_&&n.bind===_)return _.apply(n,o.call(arguments,1));if(!j.isFunction(n))throw new TypeError;return r=o.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(o.call(arguments)));R.prototype=n.prototype;var u=new R;R.prototype=null;var i=n.apply(u,r.concat(o.call(arguments)));return Object(i)===i?i:u}},j.partial=function(n){var t=o.call(arguments,1);return function(){for(var r=0,e=t.slice(),u=0,i=e.length;i>u;u++)e[u]===j&&(e[u]=arguments[r++]);for(;r<arguments.length;)e.push(arguments[r++]);return n.apply(this,e)}},j.bindAll=function(n){var t=o.call(arguments,1);if(0===t.length)throw new Error("bindAll must be passed function names");return A(t,function(t){n[t]=j.bind(n[t],n)}),n},j.memoize=function(n,t){var r={};return t||(t=j.identity),function(){var e=t.apply(this,arguments);return j.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},j.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},j.defer=function(n){return j.delay.apply(j,[n,1].concat(o.call(arguments,1)))},j.throttle=function(n,t,r){var e,u,i,a=null,o=0;r||(r={});var c=function(){o=r.leading===!1?0:j.now(),a=null,i=n.apply(e,u),e=u=null};return function(){var l=j.now();o||r.leading!==!1||(o=l);var f=t-(l-o);return e=this,u=arguments,0>=f?(clearTimeout(a),a=null,o=l,i=n.apply(e,u),e=u=null):a||r.trailing===!1||(a=setTimeout(c,f)),i}},j.debounce=function(n,t,r){var e,u,i,a,o,c=function(){var l=j.now()-a;t>l?e=setTimeout(c,t-l):(e=null,r||(o=n.apply(i,u),i=u=null))};return function(){i=this,u=arguments,a=j.now();var l=r&&!e;return e||(e=setTimeout(c,t)),l&&(o=n.apply(i,u),i=u=null),o}},j.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},j.wrap=function(n,t){return j.partial(t,n)},j.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},j.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},j.keys=function(n){if(!j.isObject(n))return[];if(w)return w(n);var t=[];for(var r in n)j.has(n,r)&&t.push(r);return t},j.values=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},j.pairs=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},j.invert=function(n){for(var t={},r=j.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},j.functions=j.methods=function(n){var t=[];for(var r in n)j.isFunction(n[r])&&t.push(r);return t.sort()},j.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},j.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},j.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)j.contains(r,u)||(t[u]=n[u]);return t},j.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]===void 0&&(n[r]=t[r])}),n},j.clone=function(n){return j.isObject(n)?j.isArray(n)?n.slice():j.extend({},n):n},j.tap=function(n,t){return t(n),n};var S=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof j&&(n=n._wrapped),t instanceof j&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==String(t);case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;var a=n.constructor,o=t.constructor;if(a!==o&&!(j.isFunction(a)&&a instanceof a&&j.isFunction(o)&&o instanceof o)&&"constructor"in n&&"constructor"in t)return!1;r.push(n),e.push(t);var c=0,f=!0;if("[object Array]"==u){if(c=n.length,f=c==t.length)for(;c--&&(f=S(n[c],t[c],r,e)););}else{for(var s in n)if(j.has(n,s)&&(c++,!(f=j.has(t,s)&&S(n[s],t[s],r,e))))break;if(f){for(s in t)if(j.has(t,s)&&!c--)break;f=!c}}return r.pop(),e.pop(),f};j.isEqual=function(n,t){return S(n,t,[],[])},j.isEmpty=function(n){if(null==n)return!0;if(j.isArray(n)||j.isString(n))return 0===n.length;for(var t in n)if(j.has(n,t))return!1;return!0},j.isElement=function(n){return!(!n||1!==n.nodeType)},j.isArray=x||function(n){return"[object Array]"==l.call(n)},j.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){j["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),j.isArguments(arguments)||(j.isArguments=function(n){return!(!n||!j.has(n,"callee"))}),"function"!=typeof/./&&(j.isFunction=function(n){return"function"==typeof n}),j.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},j.isNaN=function(n){return j.isNumber(n)&&n!=+n},j.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},j.isNull=function(n){return null===n},j.isUndefined=function(n){return n===void 0},j.has=function(n,t){return f.call(n,t)},j.noConflict=function(){return n._=t,this},j.identity=function(n){return n},j.constant=function(n){return function(){return n}},j.property=function(n){return function(t){return t[n]}},j.matches=function(n){return function(t){if(t===n)return!0;for(var r in n)if(n[r]!==t[r])return!1;return!0}},j.times=function(n,t,r){for(var e=Array(Math.max(0,n)),u=0;n>u;u++)e[u]=t.call(r,u);return e},j.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},j.now=Date.now||function(){return(new Date).getTime()};var T={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"}};T.unescape=j.invert(T.escape);var I={escape:new RegExp("["+j.keys(T.escape).join("")+"]","g"),unescape:new RegExp("("+j.keys(T.unescape).join("|")+")","g")};j.each(["escape","unescape"],function(n){j[n]=function(t){return null==t?"":(""+t).replace(I[n],function(t){return T[n][t]})}}),j.result=function(n,t){if(null==n)return void 0;var r=n[t];return j.isFunction(r)?r.call(n):r},j.mixin=function(n){A(j.functions(n),function(t){var r=j[t]=n[t];j.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),z.call(this,r.apply(j,n))}})};var N=0;j.uniqueId=function(n){var t=++N+"";return n?n+t:t},j.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var q=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n","  ":"t","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\t|\u2028|\u2029/g;j.template=function(n,t,r){var e;r=j.defaults({},r,j.templateSettings);var u=new RegExp([(r.escape||q).source,(r.interpolate||q).source,(r.evaluate||q).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(D,function(n){return"\\"+B[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=new Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,j);var c=function(n){return e.call(this,n,j)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},j.chain=function(n){return j(n).chain()};var z=function(n){return this._chain?j(n).chain():n};j.mixin(j),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];j.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],z.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];j.prototype[n]=function(){return z.call(this,t.apply(this._wrapped,arguments))}}),j.extend(j.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}}),"function"==typeof define&&define.amd&&define("underscore",[],function(){return j})}).call(this);
+//# sourceMappingURL=underscore-min.map
\ No newline at end of file
diff --git a/wrt/node_modules/underscore/underscore.js b/wrt/node_modules/underscore/underscore.js
new file mode 100644 (file)
index 0000000..9a4cabe
--- /dev/null
@@ -0,0 +1,1343 @@
+//     Underscore.js 1.6.0
+//     http://underscorejs.org
+//     (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+//     Underscore may be freely distributed under the MIT license.
+
+(function() {
+
+  // Baseline setup
+  // --------------
+
+  // Establish the root object, `window` in the browser, or `exports` on the server.
+  var root = this;
+
+  // Save the previous value of the `_` variable.
+  var previousUnderscore = root._;
+
+  // Establish the object that gets returned to break out of a loop iteration.
+  var breaker = {};
+
+  // Save bytes in the minified (but not gzipped) version:
+  var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
+
+  // Create quick reference variables for speed access to core prototypes.
+  var
+    push             = ArrayProto.push,
+    slice            = ArrayProto.slice,
+    concat           = ArrayProto.concat,
+    toString         = ObjProto.toString,
+    hasOwnProperty   = ObjProto.hasOwnProperty;
+
+  // All **ECMAScript 5** native function implementations that we hope to use
+  // are declared here.
+  var
+    nativeForEach      = ArrayProto.forEach,
+    nativeMap          = ArrayProto.map,
+    nativeReduce       = ArrayProto.reduce,
+    nativeReduceRight  = ArrayProto.reduceRight,
+    nativeFilter       = ArrayProto.filter,
+    nativeEvery        = ArrayProto.every,
+    nativeSome         = ArrayProto.some,
+    nativeIndexOf      = ArrayProto.indexOf,
+    nativeLastIndexOf  = ArrayProto.lastIndexOf,
+    nativeIsArray      = Array.isArray,
+    nativeKeys         = Object.keys,
+    nativeBind         = FuncProto.bind;
+
+  // Create a safe reference to the Underscore object for use below.
+  var _ = function(obj) {
+    if (obj instanceof _) return obj;
+    if (!(this instanceof _)) return new _(obj);
+    this._wrapped = obj;
+  };
+
+  // Export the Underscore object for **Node.js**, with
+  // backwards-compatibility for the old `require()` API. If we're in
+  // the browser, add `_` as a global object via a string identifier,
+  // for Closure Compiler "advanced" mode.
+  if (typeof exports !== 'undefined') {
+    if (typeof module !== 'undefined' && module.exports) {
+      exports = module.exports = _;
+    }
+    exports._ = _;
+  } else {
+    root._ = _;
+  }
+
+  // Current version.
+  _.VERSION = '1.6.0';
+
+  // Collection Functions
+  // --------------------
+
+  // The cornerstone, an `each` implementation, aka `forEach`.
+  // Handles objects with the built-in `forEach`, arrays, and raw objects.
+  // Delegates to **ECMAScript 5**'s native `forEach` if available.
+  var each = _.each = _.forEach = function(obj, iterator, context) {
+    if (obj == null) return obj;
+    if (nativeForEach && obj.forEach === nativeForEach) {
+      obj.forEach(iterator, context);
+    } else if (obj.length === +obj.length) {
+      for (var i = 0, length = obj.length; i < length; i++) {
+        if (iterator.call(context, obj[i], i, obj) === breaker) return;
+      }
+    } else {
+      var keys = _.keys(obj);
+      for (var i = 0, length = keys.length; i < length; i++) {
+        if (iterator.call(context, obj[keys[i]], keys[i], obj) === breaker) return;
+      }
+    }
+    return obj;
+  };
+
+  // Return the results of applying the iterator to each element.
+  // Delegates to **ECMAScript 5**'s native `map` if available.
+  _.map = _.collect = function(obj, iterator, context) {
+    var results = [];
+    if (obj == null) return results;
+    if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
+    each(obj, function(value, index, list) {
+      results.push(iterator.call(context, value, index, list));
+    });
+    return results;
+  };
+
+  var reduceError = 'Reduce of empty array with no initial value';
+
+  // **Reduce** builds up a single result from a list of values, aka `inject`,
+  // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.
+  _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {
+    var initial = arguments.length > 2;
+    if (obj == null) obj = [];
+    if (nativeReduce && obj.reduce === nativeReduce) {
+      if (context) iterator = _.bind(iterator, context);
+      return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
+    }
+    each(obj, function(value, index, list) {
+      if (!initial) {
+        memo = value;
+        initial = true;
+      } else {
+        memo = iterator.call(context, memo, value, index, list);
+      }
+    });
+    if (!initial) throw new TypeError(reduceError);
+    return memo;
+  };
+
+  // The right-associative version of reduce, also known as `foldr`.
+  // Delegates to **ECMAScript 5**'s native `reduceRight` if available.
+  _.reduceRight = _.foldr = function(obj, iterator, memo, context) {
+    var initial = arguments.length > 2;
+    if (obj == null) obj = [];
+    if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
+      if (context) iterator = _.bind(iterator, context);
+      return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
+    }
+    var length = obj.length;
+    if (length !== +length) {
+      var keys = _.keys(obj);
+      length = keys.length;
+    }
+    each(obj, function(value, index, list) {
+      index = keys ? keys[--length] : --length;
+      if (!initial) {
+        memo = obj[index];
+        initial = true;
+      } else {
+        memo = iterator.call(context, memo, obj[index], index, list);
+      }
+    });
+    if (!initial) throw new TypeError(reduceError);
+    return memo;
+  };
+
+  // Return the first value which passes a truth test. Aliased as `detect`.
+  _.find = _.detect = function(obj, predicate, context) {
+    var result;
+    any(obj, function(value, index, list) {
+      if (predicate.call(context, value, index, list)) {
+        result = value;
+        return true;
+      }
+    });
+    return result;
+  };
+
+  // Return all the elements that pass a truth test.
+  // Delegates to **ECMAScript 5**'s native `filter` if available.
+  // Aliased as `select`.
+  _.filter = _.select = function(obj, predicate, context) {
+    var results = [];
+    if (obj == null) return results;
+    if (nativeFilter && obj.filter === nativeFilter) return obj.filter(predicate, context);
+    each(obj, function(value, index, list) {
+      if (predicate.call(context, value, index, list)) results.push(value);
+    });
+    return results;
+  };
+
+  // Return all the elements for which a truth test fails.
+  _.reject = function(obj, predicate, context) {
+    return _.filter(obj, function(value, index, list) {
+      return !predicate.call(context, value, index, list);
+    }, context);
+  };
+
+  // Determine whether all of the elements match a truth test.
+  // Delegates to **ECMAScript 5**'s native `every` if available.
+  // Aliased as `all`.
+  _.every = _.all = function(obj, predicate, context) {
+    predicate || (predicate = _.identity);
+    var result = true;
+    if (obj == null) return result;
+    if (nativeEvery && obj.every === nativeEvery) return obj.every(predicate, context);
+    each(obj, function(value, index, list) {
+      if (!(result = result && predicate.call(context, value, index, list))) return breaker;
+    });
+    return !!result;
+  };
+
+  // Determine if at least one element in the object matches a truth test.
+  // Delegates to **ECMAScript 5**'s native `some` if available.
+  // Aliased as `any`.
+  var any = _.some = _.any = function(obj, predicate, context) {
+    predicate || (predicate = _.identity);
+    var result = false;
+    if (obj == null) return result;
+    if (nativeSome && obj.some === nativeSome) return obj.some(predicate, context);
+    each(obj, function(value, index, list) {
+      if (result || (result = predicate.call(context, value, index, list))) return breaker;
+    });
+    return !!result;
+  };
+
+  // Determine if the array or object contains a given value (using `===`).
+  // Aliased as `include`.
+  _.contains = _.include = function(obj, target) {
+    if (obj == null) return false;
+    if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
+    return any(obj, function(value) {
+      return value === target;
+    });
+  };
+
+  // Invoke a method (with arguments) on every item in a collection.
+  _.invoke = function(obj, method) {
+    var args = slice.call(arguments, 2);
+    var isFunc = _.isFunction(method);
+    return _.map(obj, function(value) {
+      return (isFunc ? method : value[method]).apply(value, args);
+    });
+  };
+
+  // Convenience version of a common use case of `map`: fetching a property.
+  _.pluck = function(obj, key) {
+    return _.map(obj, _.property(key));
+  };
+
+  // Convenience version of a common use case of `filter`: selecting only objects
+  // containing specific `key:value` pairs.
+  _.where = function(obj, attrs) {
+    return _.filter(obj, _.matches(attrs));
+  };
+
+  // Convenience version of a common use case of `find`: getting the first object
+  // containing specific `key:value` pairs.
+  _.findWhere = function(obj, attrs) {
+    return _.find(obj, _.matches(attrs));
+  };
+
+  // Return the maximum element or (element-based computation).
+  // Can't optimize arrays of integers longer than 65,535 elements.
+  // See [WebKit Bug 80797](https://bugs.webkit.org/show_bug.cgi?id=80797)
+  _.max = function(obj, iterator, context) {
+    if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
+      return Math.max.apply(Math, obj);
+    }
+    var result = -Infinity, lastComputed = -Infinity;
+    each(obj, function(value, index, list) {
+      var computed = iterator ? iterator.call(context, value, index, list) : value;
+      if (computed > lastComputed) {
+        result = value;
+        lastComputed = computed;
+      }
+    });
+    return result;
+  };
+
+  // Return the minimum element (or element-based computation).
+  _.min = function(obj, iterator, context) {
+    if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
+      return Math.min.apply(Math, obj);
+    }
+    var result = Infinity, lastComputed = Infinity;
+    each(obj, function(value, index, list) {
+      var computed = iterator ? iterator.call(context, value, index, list) : value;
+      if (computed < lastComputed) {
+        result = value;
+        lastComputed = computed;
+      }
+    });
+    return result;
+  };
+
+  // Shuffle an array, using the modern version of the
+  // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
+  _.shuffle = function(obj) {
+    var rand;
+    var index = 0;
+    var shuffled = [];
+    each(obj, function(value) {
+      rand = _.random(index++);
+      shuffled[index - 1] = shuffled[rand];
+      shuffled[rand] = value;
+    });
+    return shuffled;
+  };
+
+  // Sample **n** random values from a collection.
+  // If **n** is not specified, returns a single random element.
+  // The internal `guard` argument allows it to work with `map`.
+  _.sample = function(obj, n, guard) {
+    if (n == null || guard) {
+      if (obj.length !== +obj.length) obj = _.values(obj);
+      return obj[_.random(obj.length - 1)];
+    }
+    return _.shuffle(obj).slice(0, Math.max(0, n));
+  };
+
+  // An internal function to generate lookup iterators.
+  var lookupIterator = function(value) {
+    if (value == null) return _.identity;
+    if (_.isFunction(value)) return value;
+    return _.property(value);
+  };
+
+  // Sort the object's values by a criterion produced by an iterator.
+  _.sortBy = function(obj, iterator, context) {
+    iterator = lookupIterator(iterator);
+    return _.pluck(_.map(obj, function(value, index, list) {
+      return {
+        value: value,
+        index: index,
+        criteria: iterator.call(context, value, index, list)
+      };
+    }).sort(function(left, right) {
+      var a = left.criteria;
+      var b = right.criteria;
+      if (a !== b) {
+        if (a > b || a === void 0) return 1;
+        if (a < b || b === void 0) return -1;
+      }
+      return left.index - right.index;
+    }), 'value');
+  };
+
+  // An internal function used for aggregate "group by" operations.
+  var group = function(behavior) {
+    return function(obj, iterator, context) {
+      var result = {};
+      iterator = lookupIterator(iterator);
+      each(obj, function(value, index) {
+        var key = iterator.call(context, value, index, obj);
+        behavior(result, key, value);
+      });
+      return result;
+    };
+  };
+
+  // Groups the object's values by a criterion. Pass either a string attribute
+  // to group by, or a function that returns the criterion.
+  _.groupBy = group(function(result, key, value) {
+    _.has(result, key) ? result[key].push(value) : result[key] = [value];
+  });
+
+  // Indexes the object's values by a criterion, similar to `groupBy`, but for
+  // when you know that your index values will be unique.
+  _.indexBy = group(function(result, key, value) {
+    result[key] = value;
+  });
+
+  // Counts instances of an object that group by a certain criterion. Pass
+  // either a string attribute to count by, or a function that returns the
+  // criterion.
+  _.countBy = group(function(result, key) {
+    _.has(result, key) ? result[key]++ : result[key] = 1;
+  });
+
+  // Use a comparator function to figure out the smallest index at which
+  // an object should be inserted so as to maintain order. Uses binary search.
+  _.sortedIndex = function(array, obj, iterator, context) {
+    iterator = lookupIterator(iterator);
+    var value = iterator.call(context, obj);
+    var low = 0, high = array.length;
+    while (low < high) {
+      var mid = (low + high) >>> 1;
+      iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid;
+    }
+    return low;
+  };
+
+  // Safely create a real, live array from anything iterable.
+  _.toArray = function(obj) {
+    if (!obj) return [];
+    if (_.isArray(obj)) return slice.call(obj);
+    if (obj.length === +obj.length) return _.map(obj, _.identity);
+    return _.values(obj);
+  };
+
+  // Return the number of elements in an object.
+  _.size = function(obj) {
+    if (obj == null) return 0;
+    return (obj.length === +obj.length) ? obj.length : _.keys(obj).length;
+  };
+
+  // Array Functions
+  // ---------------
+
+  // Get the first element of an array. Passing **n** will return the first N
+  // values in the array. Aliased as `head` and `take`. The **guard** check
+  // allows it to work with `_.map`.
+  _.first = _.head = _.take = function(array, n, guard) {
+    if (array == null) return void 0;
+    if ((n == null) || guard) return array[0];
+    if (n < 0) return [];
+    return slice.call(array, 0, n);
+  };
+
+  // Returns everything but the last entry of the array. Especially useful on
+  // the arguments object. Passing **n** will return all the values in
+  // the array, excluding the last N. The **guard** check allows it to work with
+  // `_.map`.
+  _.initial = function(array, n, guard) {
+    return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n));
+  };
+
+  // Get the last element of an array. Passing **n** will return the last N
+  // values in the array. The **guard** check allows it to work with `_.map`.
+  _.last = function(array, n, guard) {
+    if (array == null) return void 0;
+    if ((n == null) || guard) return array[array.length - 1];
+    return slice.call(array, Math.max(array.length - n, 0));
+  };
+
+  // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.
+  // Especially useful on the arguments object. Passing an **n** will return
+  // the rest N values in the array. The **guard**
+  // check allows it to work with `_.map`.
+  _.rest = _.tail = _.drop = function(array, n, guard) {
+    return slice.call(array, (n == null) || guard ? 1 : n);
+  };
+
+  // Trim out all falsy values from an array.
+  _.compact = function(array) {
+    return _.filter(array, _.identity);
+  };
+
+  // Internal implementation of a recursive `flatten` function.
+  var flatten = function(input, shallow, output) {
+    if (shallow && _.every(input, _.isArray)) {
+      return concat.apply(output, input);
+    }
+    each(input, function(value) {
+      if (_.isArray(value) || _.isArguments(value)) {
+        shallow ? push.apply(output, value) : flatten(value, shallow, output);
+      } else {
+        output.push(value);
+      }
+    });
+    return output;
+  };
+
+  // Flatten out an array, either recursively (by default), or just one level.
+  _.flatten = function(array, shallow) {
+    return flatten(array, shallow, []);
+  };
+
+  // Return a version of the array that does not contain the specified value(s).
+  _.without = function(array) {
+    return _.difference(array, slice.call(arguments, 1));
+  };
+
+  // Split an array into two arrays: one whose elements all satisfy the given
+  // predicate, and one whose elements all do not satisfy the predicate.
+  _.partition = function(array, predicate) {
+    var pass = [], fail = [];
+    each(array, function(elem) {
+      (predicate(elem) ? pass : fail).push(elem);
+    });
+    return [pass, fail];
+  };
+
+  // Produce a duplicate-free version of the array. If the array has already
+  // been sorted, you have the option of using a faster algorithm.
+  // Aliased as `unique`.
+  _.uniq = _.unique = function(array, isSorted, iterator, context) {
+    if (_.isFunction(isSorted)) {
+      context = iterator;
+      iterator = isSorted;
+      isSorted = false;
+    }
+    var initial = iterator ? _.map(array, iterator, context) : array;
+    var results = [];
+    var seen = [];
+    each(initial, function(value, index) {
+      if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) {
+        seen.push(value);
+        results.push(array[index]);
+      }
+    });
+    return results;
+  };
+
+  // Produce an array that contains the union: each distinct element from all of
+  // the passed-in arrays.
+  _.union = function() {
+    return _.uniq(_.flatten(arguments, true));
+  };
+
+  // Produce an array that contains every item shared between all the
+  // passed-in arrays.
+  _.intersection = function(array) {
+    var rest = slice.call(arguments, 1);
+    return _.filter(_.uniq(array), function(item) {
+      return _.every(rest, function(other) {
+        return _.contains(other, item);
+      });
+    });
+  };
+
+  // Take the difference between one array and a number of other arrays.
+  // Only the elements present in just the first array will remain.
+  _.difference = function(array) {
+    var rest = concat.apply(ArrayProto, slice.call(arguments, 1));
+    return _.filter(array, function(value){ return !_.contains(rest, value); });
+  };
+
+  // Zip together multiple lists into a single array -- elements that share
+  // an index go together.
+  _.zip = function() {
+    var length = _.max(_.pluck(arguments, 'length').concat(0));
+    var results = new Array(length);
+    for (var i = 0; i < length; i++) {
+      results[i] = _.pluck(arguments, '' + i);
+    }
+    return results;
+  };
+
+  // Converts lists into objects. Pass either a single array of `[key, value]`
+  // pairs, or two parallel arrays of the same length -- one of keys, and one of
+  // the corresponding values.
+  _.object = function(list, values) {
+    if (list == null) return {};
+    var result = {};
+    for (var i = 0, length = list.length; i < length; i++) {
+      if (values) {
+        result[list[i]] = values[i];
+      } else {
+        result[list[i][0]] = list[i][1];
+      }
+    }
+    return result;
+  };
+
+  // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),
+  // we need this function. Return the position of the first occurrence of an
+  // item in an array, or -1 if the item is not included in the array.
+  // Delegates to **ECMAScript 5**'s native `indexOf` if available.
+  // If the array is large and already in sort order, pass `true`
+  // for **isSorted** to use binary search.
+  _.indexOf = function(array, item, isSorted) {
+    if (array == null) return -1;
+    var i = 0, length = array.length;
+    if (isSorted) {
+      if (typeof isSorted == 'number') {
+        i = (isSorted < 0 ? Math.max(0, length + isSorted) : isSorted);
+      } else {
+        i = _.sortedIndex(array, item);
+        return array[i] === item ? i : -1;
+      }
+    }
+    if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted);
+    for (; i < length; i++) if (array[i] === item) return i;
+    return -1;
+  };
+
+  // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.
+  _.lastIndexOf = function(array, item, from) {
+    if (array == null) return -1;
+    var hasIndex = from != null;
+    if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) {
+      return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item);
+    }
+    var i = (hasIndex ? from : array.length);
+    while (i--) if (array[i] === item) return i;
+    return -1;
+  };
+
+  // Generate an integer Array containing an arithmetic progression. A port of
+  // the native Python `range()` function. See
+  // [the Python documentation](http://docs.python.org/library/functions.html#range).
+  _.range = function(start, stop, step) {
+    if (arguments.length <= 1) {
+      stop = start || 0;
+      start = 0;
+    }
+    step = arguments[2] || 1;
+
+    var length = Math.max(Math.ceil((stop - start) / step), 0);
+    var idx = 0;
+    var range = new Array(length);
+
+    while(idx < length) {
+      range[idx++] = start;
+      start += step;
+    }
+
+    return range;
+  };
+
+  // Function (ahem) Functions
+  // ------------------
+
+  // Reusable constructor function for prototype setting.
+  var ctor = function(){};
+
+  // Create a function bound to a given object (assigning `this`, and arguments,
+  // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if
+  // available.
+  _.bind = function(func, context) {
+    var args, bound;
+    if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
+    if (!_.isFunction(func)) throw new TypeError;
+    args = slice.call(arguments, 2);
+    return bound = function() {
+      if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments)));
+      ctor.prototype = func.prototype;
+      var self = new ctor;
+      ctor.prototype = null;
+      var result = func.apply(self, args.concat(slice.call(arguments)));
+      if (Object(result) === result) return result;
+      return self;
+    };
+  };
+
+  // Partially apply a function by creating a version that has had some of its
+  // arguments pre-filled, without changing its dynamic `this` context. _ acts
+  // as a placeholder, allowing any combination of arguments to be pre-filled.
+  _.partial = function(func) {
+    var boundArgs = slice.call(arguments, 1);
+    return function() {
+      var position = 0;
+      var args = boundArgs.slice();
+      for (var i = 0, length = args.length; i < length; i++) {
+        if (args[i] === _) args[i] = arguments[position++];
+      }
+      while (position < arguments.length) args.push(arguments[position++]);
+      return func.apply(this, args);
+    };
+  };
+
+  // Bind a number of an object's methods to that object. Remaining arguments
+  // are the method names to be bound. Useful for ensuring that all callbacks
+  // defined on an object belong to it.
+  _.bindAll = function(obj) {
+    var funcs = slice.call(arguments, 1);
+    if (funcs.length === 0) throw new Error('bindAll must be passed function names');
+    each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });
+    return obj;
+  };
+
+  // Memoize an expensive function by storing its results.
+  _.memoize = function(func, hasher) {
+    var memo = {};
+    hasher || (hasher = _.identity);
+    return function() {
+      var key = hasher.apply(this, arguments);
+      return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));
+    };
+  };
+
+  // Delays a function for the given number of milliseconds, and then calls
+  // it with the arguments supplied.
+  _.delay = function(func, wait) {
+    var args = slice.call(arguments, 2);
+    return setTimeout(function(){ return func.apply(null, args); }, wait);
+  };
+
+  // Defers a function, scheduling it to run after the current call stack has
+  // cleared.
+  _.defer = function(func) {
+    return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
+  };
+
+  // Returns a function, that, when invoked, will only be triggered at most once
+  // during a given window of time. Normally, the throttled function will run
+  // as much as it can, without ever going more than once per `wait` duration;
+  // but if you'd like to disable the execution on the leading edge, pass
+  // `{leading: false}`. To disable execution on the trailing edge, ditto.
+  _.throttle = function(func, wait, options) {
+    var context, args, result;
+    var timeout = null;
+    var previous = 0;
+    options || (options = {});
+    var later = function() {
+      previous = options.leading === false ? 0 : _.now();
+      timeout = null;
+      result = func.apply(context, args);
+      context = args = null;
+    };
+    return function() {
+      var now = _.now();
+      if (!previous && options.leading === false) previous = now;
+      var remaining = wait - (now - previous);
+      context = this;
+      args = arguments;
+      if (remaining <= 0) {
+        clearTimeout(timeout);
+        timeout = null;
+        previous = now;
+        result = func.apply(context, args);
+        context = args = null;
+      } else if (!timeout && options.trailing !== false) {
+        timeout = setTimeout(later, remaining);
+      }
+      return result;
+    };
+  };
+
+  // Returns a function, that, as long as it continues to be invoked, will not
+  // be triggered. The function will be called after it stops being called for
+  // N milliseconds. If `immediate` is passed, trigger the function on the
+  // leading edge, instead of the trailing.
+  _.debounce = function(func, wait, immediate) {
+    var timeout, args, context, timestamp, result;
+
+    var later = function() {
+      var last = _.now() - timestamp;
+      if (last < wait) {
+        timeout = setTimeout(later, wait - last);
+      } else {
+        timeout = null;
+        if (!immediate) {
+          result = func.apply(context, args);
+          context = args = null;
+        }
+      }
+    };
+
+    return function() {
+      context = this;
+      args = arguments;
+      timestamp = _.now();
+      var callNow = immediate && !timeout;
+      if (!timeout) {
+        timeout = setTimeout(later, wait);
+      }
+      if (callNow) {
+        result = func.apply(context, args);
+        context = args = null;
+      }
+
+      return result;
+    };
+  };
+
+  // Returns a function that will be executed at most one time, no matter how
+  // often you call it. Useful for lazy initialization.
+  _.once = function(func) {
+    var ran = false, memo;
+    return function() {
+      if (ran) return memo;
+      ran = true;
+      memo = func.apply(this, arguments);
+      func = null;
+      return memo;
+    };
+  };
+
+  // Returns the first function passed as an argument to the second,
+  // allowing you to adjust arguments, run code before and after, and
+  // conditionally execute the original function.
+  _.wrap = function(func, wrapper) {
+    return _.partial(wrapper, func);
+  };
+
+  // Returns a function that is the composition of a list of functions, each
+  // consuming the return value of the function that follows.
+  _.compose = function() {
+    var funcs = arguments;
+    return function() {
+      var args = arguments;
+      for (var i = funcs.length - 1; i >= 0; i--) {
+        args = [funcs[i].apply(this, args)];
+      }
+      return args[0];
+    };
+  };
+
+  // Returns a function that will only be executed after being called N times.
+  _.after = function(times, func) {
+    return function() {
+      if (--times < 1) {
+        return func.apply(this, arguments);
+      }
+    };
+  };
+
+  // Object Functions
+  // ----------------
+
+  // Retrieve the names of an object's properties.
+  // Delegates to **ECMAScript 5**'s native `Object.keys`
+  _.keys = function(obj) {
+    if (!_.isObject(obj)) return [];
+    if (nativeKeys) return nativeKeys(obj);
+    var keys = [];
+    for (var key in obj) if (_.has(obj, key)) keys.push(key);
+    return keys;
+  };
+
+  // Retrieve the values of an object's properties.
+  _.values = function(obj) {
+    var keys = _.keys(obj);
+    var length = keys.length;
+    var values = new Array(length);
+    for (var i = 0; i < length; i++) {
+      values[i] = obj[keys[i]];
+    }
+    return values;
+  };
+
+  // Convert an object into a list of `[key, value]` pairs.
+  _.pairs = function(obj) {
+    var keys = _.keys(obj);
+    var length = keys.length;
+    var pairs = new Array(length);
+    for (var i = 0; i < length; i++) {
+      pairs[i] = [keys[i], obj[keys[i]]];
+    }
+    return pairs;
+  };
+
+  // Invert the keys and values of an object. The values must be serializable.
+  _.invert = function(obj) {
+    var result = {};
+    var keys = _.keys(obj);
+    for (var i = 0, length = keys.length; i < length; i++) {
+      result[obj[keys[i]]] = keys[i];
+    }
+    return result;
+  };
+
+  // Return a sorted list of the function names available on the object.
+  // Aliased as `methods`
+  _.functions = _.methods = function(obj) {
+    var names = [];
+    for (var key in obj) {
+      if (_.isFunction(obj[key])) names.push(key);
+    }
+    return names.sort();
+  };
+
+  // Extend a given object with all the properties in passed-in object(s).
+  _.extend = function(obj) {
+    each(slice.call(arguments, 1), function(source) {
+      if (source) {
+        for (var prop in source) {
+          obj[prop] = source[prop];
+        }
+      }
+    });
+    return obj;
+  };
+
+  // Return a copy of the object only containing the whitelisted properties.
+  _.pick = function(obj) {
+    var copy = {};
+    var keys = concat.apply(ArrayProto, slice.call(arguments, 1));
+    each(keys, function(key) {
+      if (key in obj) copy[key] = obj[key];
+    });
+    return copy;
+  };
+
+   // Return a copy of the object without the blacklisted properties.
+  _.omit = function(obj) {
+    var copy = {};
+    var keys = concat.apply(ArrayProto, slice.call(arguments, 1));
+    for (var key in obj) {
+      if (!_.contains(keys, key)) copy[key] = obj[key];
+    }
+    return copy;
+  };
+
+  // Fill in a given object with default properties.
+  _.defaults = function(obj) {
+    each(slice.call(arguments, 1), function(source) {
+      if (source) {
+        for (var prop in source) {
+          if (obj[prop] === void 0) obj[prop] = source[prop];
+        }
+      }
+    });
+    return obj;
+  };
+
+  // Create a (shallow-cloned) duplicate of an object.
+  _.clone = function(obj) {
+    if (!_.isObject(obj)) return obj;
+    return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
+  };
+
+  // Invokes interceptor with the obj, and then returns obj.
+  // The primary purpose of this method is to "tap into" a method chain, in
+  // order to perform operations on intermediate results within the chain.
+  _.tap = function(obj, interceptor) {
+    interceptor(obj);
+    return obj;
+  };
+
+  // Internal recursive comparison function for `isEqual`.
+  var eq = function(a, b, aStack, bStack) {
+    // Identical objects are equal. `0 === -0`, but they aren't identical.
+    // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
+    if (a === b) return a !== 0 || 1 / a == 1 / b;
+    // A strict comparison is necessary because `null == undefined`.
+    if (a == null || b == null) return a === b;
+    // Unwrap any wrapped objects.
+    if (a instanceof _) a = a._wrapped;
+    if (b instanceof _) b = b._wrapped;
+    // Compare `[[Class]]` names.
+    var className = toString.call(a);
+    if (className != toString.call(b)) return false;
+    switch (className) {
+      // Strings, numbers, dates, and booleans are compared by value.
+      case '[object String]':
+        // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
+        // equivalent to `new String("5")`.
+        return a == String(b);
+      case '[object Number]':
+        // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for
+        // other numeric values.
+        return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b);
+      case '[object Date]':
+      case '[object Boolean]':
+        // Coerce dates and booleans to numeric primitive values. Dates are compared by their
+        // millisecond representations. Note that invalid dates with millisecond representations
+        // of `NaN` are not equivalent.
+        return +a == +b;
+      // RegExps are compared by their source patterns and flags.
+      case '[object RegExp]':
+        return a.source == b.source &&
+               a.global == b.global &&
+               a.multiline == b.multiline &&
+               a.ignoreCase == b.ignoreCase;
+    }
+    if (typeof a != 'object' || typeof b != 'object') return false;
+    // Assume equality for cyclic structures. The algorithm for detecting cyclic
+    // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
+    var length = aStack.length;
+    while (length--) {
+      // Linear search. Performance is inversely proportional to the number of
+      // unique nested structures.
+      if (aStack[length] == a) return bStack[length] == b;
+    }
+    // Objects with different constructors are not equivalent, but `Object`s
+    // from different frames are.
+    var aCtor = a.constructor, bCtor = b.constructor;
+    if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) &&
+                             _.isFunction(bCtor) && (bCtor instanceof bCtor))
+                        && ('constructor' in a && 'constructor' in b)) {
+      return false;
+    }
+    // Add the first object to the stack of traversed objects.
+    aStack.push(a);
+    bStack.push(b);
+    var size = 0, result = true;
+    // Recursively compare objects and arrays.
+    if (className == '[object Array]') {
+      // Compare array lengths to determine if a deep comparison is necessary.
+      size = a.length;
+      result = size == b.length;
+      if (result) {
+        // Deep compare the contents, ignoring non-numeric properties.
+        while (size--) {
+          if (!(result = eq(a[size], b[size], aStack, bStack))) break;
+        }
+      }
+    } else {
+      // Deep compare objects.
+      for (var key in a) {
+        if (_.has(a, key)) {
+          // Count the expected number of properties.
+          size++;
+          // Deep compare each member.
+          if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break;
+        }
+      }
+      // Ensure that both objects contain the same number of properties.
+      if (result) {
+        for (key in b) {
+          if (_.has(b, key) && !(size--)) break;
+        }
+        result = !size;
+      }
+    }
+    // Remove the first object from the stack of traversed objects.
+    aStack.pop();
+    bStack.pop();
+    return result;
+  };
+
+  // Perform a deep comparison to check if two objects are equal.
+  _.isEqual = function(a, b) {
+    return eq(a, b, [], []);
+  };
+
+  // Is a given array, string, or object empty?
+  // An "empty" object has no enumerable own-properties.
+  _.isEmpty = function(obj) {
+    if (obj == null) return true;
+    if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;
+    for (var key in obj) if (_.has(obj, key)) return false;
+    return true;
+  };
+
+  // Is a given value a DOM element?
+  _.isElement = function(obj) {
+    return !!(obj && obj.nodeType === 1);
+  };
+
+  // Is a given value an array?
+  // Delegates to ECMA5's native Array.isArray
+  _.isArray = nativeIsArray || function(obj) {
+    return toString.call(obj) == '[object Array]';
+  };
+
+  // Is a given variable an object?
+  _.isObject = function(obj) {
+    return obj === Object(obj);
+  };
+
+  // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp.
+  each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) {
+    _['is' + name] = function(obj) {
+      return toString.call(obj) == '[object ' + name + ']';
+    };
+  });
+
+  // Define a fallback version of the method in browsers (ahem, IE), where
+  // there isn't any inspectable "Arguments" type.
+  if (!_.isArguments(arguments)) {
+    _.isArguments = function(obj) {
+      return !!(obj && _.has(obj, 'callee'));
+    };
+  }
+
+  // Optimize `isFunction` if appropriate.
+  if (typeof (/./) !== 'function') {
+    _.isFunction = function(obj) {
+      return typeof obj === 'function';
+    };
+  }
+
+  // Is a given object a finite number?
+  _.isFinite = function(obj) {
+    return isFinite(obj) && !isNaN(parseFloat(obj));
+  };
+
+  // Is the given value `NaN`? (NaN is the only number which does not equal itself).
+  _.isNaN = function(obj) {
+    return _.isNumber(obj) && obj != +obj;
+  };
+
+  // Is a given value a boolean?
+  _.isBoolean = function(obj) {
+    return obj === true || obj === false || toString.call(obj) == '[object Boolean]';
+  };
+
+  // Is a given value equal to null?
+  _.isNull = function(obj) {
+    return obj === null;
+  };
+
+  // Is a given variable undefined?
+  _.isUndefined = function(obj) {
+    return obj === void 0;
+  };
+
+  // Shortcut function for checking if an object has a given property directly
+  // on itself (in other words, not on a prototype).
+  _.has = function(obj, key) {
+    return hasOwnProperty.call(obj, key);
+  };
+
+  // Utility Functions
+  // -----------------
+
+  // Run Underscore.js in *noConflict* mode, returning the `_` variable to its
+  // previous owner. Returns a reference to the Underscore object.
+  _.noConflict = function() {
+    root._ = previousUnderscore;
+    return this;
+  };
+
+  // Keep the identity function around for default iterators.
+  _.identity = function(value) {
+    return value;
+  };
+
+  _.constant = function(value) {
+    return function () {
+      return value;
+    };
+  };
+
+  _.property = function(key) {
+    return function(obj) {
+      return obj[key];
+    };
+  };
+
+  // Returns a predicate for checking whether an object has a given set of `key:value` pairs.
+  _.matches = function(attrs) {
+    return function(obj) {
+      if (obj === attrs) return true; //avoid comparing an object to itself.
+      for (var key in attrs) {
+        if (attrs[key] !== obj[key])
+          return false;
+      }
+      return true;
+    }
+  };
+
+  // Run a function **n** times.
+  _.times = function(n, iterator, context) {
+    var accum = Array(Math.max(0, n));
+    for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i);
+    return accum;
+  };
+
+  // Return a random integer between min and max (inclusive).
+  _.random = function(min, max) {
+    if (max == null) {
+      max = min;
+      min = 0;
+    }
+    return min + Math.floor(Math.random() * (max - min + 1));
+  };
+
+  // A (possibly faster) way to get the current timestamp as an integer.
+  _.now = Date.now || function() { return new Date().getTime(); };
+
+  // List of HTML entities for escaping.
+  var entityMap = {
+    escape: {
+      '&': '&amp;',
+      '<': '&lt;',
+      '>': '&gt;',
+      '"': '&quot;',
+      "'": '&#x27;'
+    }
+  };
+  entityMap.unescape = _.invert(entityMap.escape);
+
+  // Regexes containing the keys and values listed immediately above.
+  var entityRegexes = {
+    escape:   new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'),
+    unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g')
+  };
+
+  // Functions for escaping and unescaping strings to/from HTML interpolation.
+  _.each(['escape', 'unescape'], function(method) {
+    _[method] = function(string) {
+      if (string == null) return '';
+      return ('' + string).replace(entityRegexes[method], function(match) {
+        return entityMap[method][match];
+      });
+    };
+  });
+
+  // If the value of the named `property` is a function then invoke it with the
+  // `object` as context; otherwise, return it.
+  _.result = function(object, property) {
+    if (object == null) return void 0;
+    var value = object[property];
+    return _.isFunction(value) ? value.call(object) : value;
+  };
+
+  // Add your own custom functions to the Underscore object.
+  _.mixin = function(obj) {
+    each(_.functions(obj), function(name) {
+      var func = _[name] = obj[name];
+      _.prototype[name] = function() {
+        var args = [this._wrapped];
+        push.apply(args, arguments);
+        return result.call(this, func.apply(_, args));
+      };
+    });
+  };
+
+  // Generate a unique integer id (unique within the entire client session).
+  // Useful for temporary DOM ids.
+  var idCounter = 0;
+  _.uniqueId = function(prefix) {
+    var id = ++idCounter + '';
+    return prefix ? prefix + id : id;
+  };
+
+  // By default, Underscore uses ERB-style template delimiters, change the
+  // following template settings to use alternative delimiters.
+  _.templateSettings = {
+    evaluate    : /<%([\s\S]+?)%>/g,
+    interpolate : /<%=([\s\S]+?)%>/g,
+    escape      : /<%-([\s\S]+?)%>/g
+  };
+
+  // When customizing `templateSettings`, if you don't want to define an
+  // interpolation, evaluation or escaping regex, we need one that is
+  // guaranteed not to match.
+  var noMatch = /(.)^/;
+
+  // Certain characters need to be escaped so that they can be put into a
+  // string literal.
+  var escapes = {
+    "'":      "'",
+    '\\':     '\\',
+    '\r':     'r',
+    '\n':     'n',
+    '\t':     't',
+    '\u2028': 'u2028',
+    '\u2029': 'u2029'
+  };
+
+  var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g;
+
+  // JavaScript micro-templating, similar to John Resig's implementation.
+  // Underscore templating handles arbitrary delimiters, preserves whitespace,
+  // and correctly escapes quotes within interpolated code.
+  _.template = function(text, data, settings) {
+    var render;
+    settings = _.defaults({}, settings, _.templateSettings);
+
+    // Combine delimiters into one regular expression via alternation.
+    var matcher = new RegExp([
+      (settings.escape || noMatch).source,
+      (settings.interpolate || noMatch).source,
+      (settings.evaluate || noMatch).source
+    ].join('|') + '|$', 'g');
+
+    // Compile the template source, escaping string literals appropriately.
+    var index = 0;
+    var source = "__p+='";
+    text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
+      source += text.slice(index, offset)
+        .replace(escaper, function(match) { return '\\' + escapes[match]; });
+
+      if (escape) {
+        source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
+      }
+      if (interpolate) {
+        source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
+      }
+      if (evaluate) {
+        source += "';\n" + evaluate + "\n__p+='";
+      }
+      index = offset + match.length;
+      return match;
+    });
+    source += "';\n";
+
+    // If a variable is not specified, place data values in local scope.
+    if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';
+
+    source = "var __t,__p='',__j=Array.prototype.join," +
+      "print=function(){__p+=__j.call(arguments,'');};\n" +
+      source + "return __p;\n";
+
+    try {
+      render = new Function(settings.variable || 'obj', '_', source);
+    } catch (e) {
+      e.source = source;
+      throw e;
+    }
+
+    if (data) return render(data, _);
+    var template = function(data) {
+      return render.call(this, data, _);
+    };
+
+    // Provide the compiled function source as a convenience for precompilation.
+    template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}';
+
+    return template;
+  };
+
+  // Add a "chain" function, which will delegate to the wrapper.
+  _.chain = function(obj) {
+    return _(obj).chain();
+  };
+
+  // OOP
+  // ---------------
+  // If Underscore is called as a function, it returns a wrapped object that
+  // can be used OO-style. This wrapper holds altered versions of all the
+  // underscore functions. Wrapped objects may be chained.
+
+  // Helper function to continue chaining intermediate results.
+  var result = function(obj) {
+    return this._chain ? _(obj).chain() : obj;
+  };
+
+  // Add all of the Underscore functions to the wrapper object.
+  _.mixin(_);
+
+  // Add all mutator Array functions to the wrapper.
+  each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
+    var method = ArrayProto[name];
+    _.prototype[name] = function() {
+      var obj = this._wrapped;
+      method.apply(obj, arguments);
+      if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0];
+      return result.call(this, obj);
+    };
+  });
+
+  // Add all accessor Array functions to the wrapper.
+  each(['concat', 'join', 'slice'], function(name) {
+    var method = ArrayProto[name];
+    _.prototype[name] = function() {
+      return result.call(this, method.apply(this._wrapped, arguments));
+    };
+  });
+
+  _.extend(_.prototype, {
+
+    // Start chaining a wrapped Underscore object.
+    chain: function() {
+      this._chain = true;
+      return this;
+    },
+
+    // Extracts the result from a wrapped and chained object.
+    value: function() {
+      return this._wrapped;
+    }
+
+  });
+
+  // AMD registration happens at the end for compatibility with AMD loaders
+  // that may not enforce next-turn semantics on modules. Even though general
+  // practice for AMD registration is to be anonymous, underscore registers
+  // as a named module because, like jQuery, it is a base library that is
+  // popular enough to be bundled in a third party lib, but not be part of
+  // an AMD load request. Those cases could generate an error when an
+  // anonymous define() is called outside of a loader request.
+  if (typeof define === 'function' && define.amd) {
+    define('underscore', [], function() {
+      return _;
+    });
+  }
+}).call(this);
diff --git a/wrt/node_modules/unpipe/HISTORY.md b/wrt/node_modules/unpipe/HISTORY.md
new file mode 100644 (file)
index 0000000..85e0f8d
--- /dev/null
@@ -0,0 +1,4 @@
+1.0.0 / 2015-06-14
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/unpipe/LICENSE b/wrt/node_modules/unpipe/LICENSE
new file mode 100644 (file)
index 0000000..aed0138
--- /dev/null
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2015 Douglas Christopher Wilson <doug@somethingdoug.com>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/unpipe/README.md b/wrt/node_modules/unpipe/README.md
new file mode 100644 (file)
index 0000000..e536ad2
--- /dev/null
@@ -0,0 +1,43 @@
+# unpipe
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-image]][node-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+Unpipe a stream from all destinations.
+
+## Installation
+
+```sh
+$ npm install unpipe
+```
+
+## API
+
+```js
+var unpipe = require('unpipe')
+```
+
+### unpipe(stream)
+
+Unpipes all destinations from a given stream. With stream 2+, this is
+equivalent to `stream.unpipe()`. When used with streams 1 style streams
+(typically Node.js 0.8 and below), this module attempts to undo the
+actions done in `stream.pipe(dest)`.
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/unpipe.svg
+[npm-url]: https://npmjs.org/package/unpipe
+[node-image]: https://img.shields.io/node/v/unpipe.svg
+[node-url]: http://nodejs.org/download/
+[travis-image]: https://img.shields.io/travis/stream-utils/unpipe.svg
+[travis-url]: https://travis-ci.org/stream-utils/unpipe
+[coveralls-image]: https://img.shields.io/coveralls/stream-utils/unpipe.svg
+[coveralls-url]: https://coveralls.io/r/stream-utils/unpipe?branch=master
+[downloads-image]: https://img.shields.io/npm/dm/unpipe.svg
+[downloads-url]: https://npmjs.org/package/unpipe
diff --git a/wrt/node_modules/unpipe/index.js b/wrt/node_modules/unpipe/index.js
new file mode 100644 (file)
index 0000000..15c3d97
--- /dev/null
@@ -0,0 +1,69 @@
+/*!
+ * unpipe
+ * Copyright(c) 2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module exports.
+ * @public
+ */
+
+module.exports = unpipe
+
+/**
+ * Determine if there are Node.js pipe-like data listeners.
+ * @private
+ */
+
+function hasPipeDataListeners(stream) {
+  var listeners = stream.listeners('data')
+
+  for (var i = 0; i < listeners.length; i++) {
+    if (listeners[i].name === 'ondata') {
+      return true
+    }
+  }
+
+  return false
+}
+
+/**
+ * Unpipe a stream from all destinations.
+ *
+ * @param {object} stream
+ * @public
+ */
+
+function unpipe(stream) {
+  if (!stream) {
+    throw new TypeError('argument stream is required')
+  }
+
+  if (typeof stream.unpipe === 'function') {
+    // new-style
+    stream.unpipe()
+    return
+  }
+
+  // Node.js 0.8 hack
+  if (!hasPipeDataListeners(stream)) {
+    return
+  }
+
+  var listener
+  var listeners = stream.listeners('close')
+
+  for (var i = 0; i < listeners.length; i++) {
+    listener = listeners[i]
+
+    if (listener.name !== 'cleanup' && listener.name !== 'onclose') {
+      continue
+    }
+
+    // invoke the listener
+    listener.call(stream)
+  }
+}
diff --git a/wrt/node_modules/unpipe/package.json b/wrt/node_modules/unpipe/package.json
new file mode 100644 (file)
index 0000000..31cdf5b
--- /dev/null
@@ -0,0 +1,93 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "unpipe@~1.0.0",
+        "scope": null,
+        "escapedName": "unpipe",
+        "name": "unpipe",
+        "rawSpec": "~1.0.0",
+        "spec": ">=1.0.0 <1.1.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/finalhandler"
+    ]
+  ],
+  "_from": "unpipe@>=1.0.0 <1.1.0",
+  "_id": "unpipe@1.0.0",
+  "_inCache": true,
+  "_location": "/unpipe",
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "1.4.28",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "unpipe@~1.0.0",
+    "scope": null,
+    "escapedName": "unpipe",
+    "name": "unpipe",
+    "rawSpec": "~1.0.0",
+    "spec": ">=1.0.0 <1.1.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/finalhandler"
+  ],
+  "_resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
+  "_shasum": "b2bf4ee8514aae6165b4817829d21b2ef49904ec",
+  "_shrinkwrap": null,
+  "_spec": "unpipe@~1.0.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/finalhandler",
+  "author": {
+    "name": "Douglas Christopher Wilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "bugs": {
+    "url": "https://github.com/stream-utils/unpipe/issues"
+  },
+  "dependencies": {},
+  "description": "Unpipe a stream from all destinations",
+  "devDependencies": {
+    "istanbul": "0.3.15",
+    "mocha": "2.2.5",
+    "readable-stream": "1.1.13"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "b2bf4ee8514aae6165b4817829d21b2ef49904ec",
+    "tarball": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz"
+  },
+  "engines": {
+    "node": ">= 0.8"
+  },
+  "files": [
+    "HISTORY.md",
+    "LICENSE",
+    "README.md",
+    "index.js"
+  ],
+  "gitHead": "d2df901c06487430e78dca62b6edb8bb2fc5e99d",
+  "homepage": "https://github.com/stream-utils/unpipe",
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "name": "unpipe",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/stream-utils/unpipe.git"
+  },
+  "scripts": {
+    "test": "mocha --reporter spec --bail --check-leaks test/",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
+    "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
+  },
+  "version": "1.0.0"
+}
diff --git a/wrt/node_modules/unzip/.npmignore b/wrt/node_modules/unzip/.npmignore
new file mode 100644 (file)
index 0000000..e0b850e
--- /dev/null
@@ -0,0 +1,2 @@
+/.idea
+/node_modules
\ No newline at end of file
diff --git a/wrt/node_modules/unzip/.travis.yml b/wrt/node_modules/unzip/.travis.yml
new file mode 100644 (file)
index 0000000..5f6edf0
--- /dev/null
@@ -0,0 +1,6 @@
+language: node_js
+node_js:
+  - "0.11"
+  - "0.10"
+  - "0.8"
+
diff --git a/wrt/node_modules/unzip/LICENSE b/wrt/node_modules/unzip/LICENSE
new file mode 100644 (file)
index 0000000..ccfbbcd
--- /dev/null
@@ -0,0 +1,20 @@
+Copyright (c) 2012 - 2013 Near Infinity Corporation
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/unzip/README.md b/wrt/node_modules/unzip/README.md
new file mode 100644 (file)
index 0000000..9a3f7f8
--- /dev/null
@@ -0,0 +1,81 @@
+# unzip [![Build Status](https://travis-ci.org/EvanOxfeld/node-unzip.png)](https://travis-ci.org/EvanOxfeld/node-unzip)
+
+Streaming cross-platform unzip tool written in node.js.
+
+Unzip provides simple APIs similar to [node-tar](https://github.com/isaacs/node-tar) for parsing and extracting zip files.
+There are no added compiled dependencies - inflation is handled by node.js's built in zlib support.  Unzip is also an
+example use case of [node-pullstream](https://github.com/EvanOxfeld/node-pullstream).
+
+## Installation
+
+```bash
+$ npm install unzip
+```
+
+## Quick Examples
+
+### Extract to a directory
+```javascript
+fs.createReadStream('path/to/archive.zip').pipe(unzip.Extract({ path: 'output/path' }));
+```
+
+Extract emits the 'close' event once the zip's contents have been fully extracted to disk.
+
+### Parse zip file contents
+
+Process each zip file entry or pipe entries to another stream.
+
+__Important__: If you do not intend to consume an entry stream's raw data, call autodrain() to dispose of the entry's
+contents. Otherwise you risk running out of memory.
+
+```javascript
+fs.createReadStream('path/to/archive.zip')
+  .pipe(unzip.Parse())
+  .on('entry', function (entry) {
+    var fileName = entry.path;
+    var type = entry.type; // 'Directory' or 'File'
+    var size = entry.size;
+    if (fileName === "this IS the file I'm looking for") {
+      entry.pipe(fs.createWriteStream('output/path'));
+    } else {
+      entry.autodrain();
+    }
+  });
+```
+
+Or pipe the output of unzip.Parse() to fstream
+
+```javascript
+var readStream = fs.createReadStream('path/to/archive.zip');
+var writeStream = fstream.Writer('output/path');
+
+readStream
+  .pipe(unzip.Parse())
+  .pipe(writeStream)
+```
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2012 - 2013 Near Infinity Corporation
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/wrt/node_modules/unzip/lib/entry.js b/wrt/node_modules/unzip/lib/entry.js
new file mode 100644 (file)
index 0000000..43535a8
--- /dev/null
@@ -0,0 +1,17 @@
+'use strict';
+
+module.exports = Entry;
+
+var PassThrough = require('readable-stream/passthrough');
+var inherits = require('util').inherits;
+
+inherits(Entry, PassThrough);
+
+function Entry () {
+  PassThrough.call(this);
+  this.props = {};
+}
+
+Entry.prototype.autodrain = function () {
+  this.on('readable', this.read.bind(this));
+};
diff --git a/wrt/node_modules/unzip/lib/extract.js b/wrt/node_modules/unzip/lib/extract.js
new file mode 100644 (file)
index 0000000..fd03181
--- /dev/null
@@ -0,0 +1,56 @@
+'use strict';
+
+module.exports = Extract;
+
+var Parse = require("../unzip").Parse;
+var Writer = require("fstream").Writer;
+var Writable = require('readable-stream/writable');
+var path = require('path');
+var inherits = require('util').inherits;
+
+inherits(Extract, Writable);
+
+function Extract (opts) {
+  var self = this;
+  if (!(this instanceof Extract)) {
+    return new Extract(opts);
+  }
+
+  Writable.apply(this);
+  this._opts = opts || { verbose: false };
+
+  this._parser = Parse(this._opts);
+  this._parser.on('error', function(err) {
+    self.emit('error', err);
+  });
+  this.on('finish', function() {
+    self._parser.end();
+  });
+
+  var writer = Writer({
+    type: 'Directory',
+    path: opts.path
+  });
+  writer.on('error', function(err) {
+    self.emit('error', err);
+  });
+  writer.on('close', function() {
+    self.emit('close')
+  });
+
+  this.on('pipe', function(source) {
+    if (opts.verbose && source.path) {
+      console.log('Archive: ', source.path);
+    }
+  });
+
+  this._parser.pipe(writer);
+}
+
+Extract.prototype._write = function (chunk, encoding, callback) {
+  if (this._parser.write(chunk)) {
+    return callback();
+  }
+
+  return this._parser.once('drain', callback);
+};
diff --git a/wrt/node_modules/unzip/lib/parse.js b/wrt/node_modules/unzip/lib/parse.js
new file mode 100644 (file)
index 0000000..69fc2c4
--- /dev/null
@@ -0,0 +1,314 @@
+'use strict';
+
+module.exports = Parse.create = Parse;
+
+require("setimmediate");
+var Transform = require('readable-stream/transform');
+var inherits = require('util').inherits;
+var zlib = require('zlib');
+var binary = require('binary');
+var PullStream = require('pullstream');
+var MatchStream = require('match-stream');
+var Entry = require('./entry');
+
+inherits(Parse, Transform);
+
+function Parse(opts) {
+  var self = this;
+  if (!(this instanceof Parse)) {
+    return new Parse(opts);
+  }
+
+  Transform.call(this, { lowWaterMark: 0 });
+  this._opts = opts || { verbose: false };
+  this._hasEntryListener = false;
+
+  this._pullStream = new PullStream();
+  this._pullStream.on("error", function (e) {
+    self.emit('error', e);
+  });
+  this._pullStream.once("end", function () {
+    self._streamEnd = true;
+  });
+  this._pullStream.once("finish", function () {
+    self._streamFinish = true;
+  });
+
+  this._readRecord();
+}
+
+Parse.prototype._readRecord = function () {
+  var self = this;
+  this._pullStream.pull(4, function (err, data) {
+    if (err) {
+      return self.emit('error', err);
+    }
+
+    if (data.length === 0) {
+      return;
+    }
+
+    var signature = data.readUInt32LE(0);
+    if (signature === 0x04034b50) {
+      self._readFile();
+    } else if (signature === 0x02014b50) {
+      self._readCentralDirectoryFileHeader();
+    } else if (signature === 0x06054b50) {
+      self._readEndOfCentralDirectoryRecord();
+    } else {
+      err = new Error('invalid signature: 0x' + signature.toString(16));
+      self.emit('error', err);
+    }
+  });
+};
+
+Parse.prototype._readFile = function () {
+  var self = this;
+  this._pullStream.pull(26, function (err, data) {
+    if (err) {
+      return self.emit('error', err);
+    }
+
+    var vars = binary.parse(data)
+      .word16lu('versionsNeededToExtract')
+      .word16lu('flags')
+      .word16lu('compressionMethod')
+      .word16lu('lastModifiedTime')
+      .word16lu('lastModifiedDate')
+      .word32lu('crc32')
+      .word32lu('compressedSize')
+      .word32lu('uncompressedSize')
+      .word16lu('fileNameLength')
+      .word16lu('extraFieldLength')
+      .vars;
+
+    return self._pullStream.pull(vars.fileNameLength, function (err, fileName) {
+      if (err) {
+        return self.emit('error', err);
+      }
+      fileName = fileName.toString('utf8');
+      var entry = new Entry();
+      entry.path = fileName;
+      entry.props.path = fileName;
+      entry.type = (vars.compressedSize === 0 && /[\/\\]$/.test(fileName)) ? 'Directory' : 'File';
+
+      if (self._opts.verbose) {
+        if (entry.type === 'Directory') {
+          console.log('   creating:', fileName);
+        } else if (entry.type === 'File') {
+          if (vars.compressionMethod === 0) {
+            console.log(' extracting:', fileName);
+          } else {
+            console.log('  inflating:', fileName);
+          }
+        }
+      }
+
+      var hasEntryListener = self._hasEntryListener;
+      if (hasEntryListener) {
+        self.emit('entry', entry);
+      }
+
+      self._pullStream.pull(vars.extraFieldLength, function (err, extraField) {
+        if (err) {
+          return self.emit('error', err);
+        }
+        if (vars.compressionMethod === 0) {
+          self._pullStream.pull(vars.compressedSize, function (err, compressedData) {
+            if (err) {
+              return self.emit('error', err);
+            }
+
+            if (hasEntryListener) {
+              entry.write(compressedData);
+              entry.end();
+            }
+
+            return self._readRecord();
+          });
+        } else {
+          var fileSizeKnown = !(vars.flags & 0x08);
+
+          var inflater = zlib.createInflateRaw();
+          inflater.on('error', function (err) {
+            self.emit('error', err);
+          });
+
+          if (fileSizeKnown) {
+            entry.size = vars.uncompressedSize;
+            if (hasEntryListener) {
+              entry.on('finish', self._readRecord.bind(self));
+              self._pullStream.pipe(vars.compressedSize, inflater).pipe(entry);
+            } else {
+              self._pullStream.drain(vars.compressedSize, function (err) {
+                if (err) {
+                  return self.emit('error', err);
+                }
+                self._readRecord();
+              });
+            }
+          } else {
+            var descriptorSig = new Buffer(4);
+            descriptorSig.writeUInt32LE(0x08074b50, 0);
+
+            var matchStream = new MatchStream({ pattern: descriptorSig }, function (buf, matched, extra) {
+              if (hasEntryListener) {
+                if (!matched) {
+                  return this.push(buf);
+                }
+                this.push(buf);
+              }
+              setImmediate(function() {
+                self._pullStream.unpipe();
+                self._pullStream.prepend(extra);
+                self._processDataDescriptor(entry);
+              });
+              return this.push(null);
+            });
+
+            self._pullStream.pipe(matchStream);
+            if (hasEntryListener) {
+              matchStream.pipe(inflater).pipe(entry);
+            }
+          }
+        }
+      });
+    });
+  });
+};
+
+Parse.prototype._processDataDescriptor = function (entry) {
+  var self = this;
+  this._pullStream.pull(16, function (err, data) {
+    if (err) {
+      return self.emit('error', err);
+    }
+
+    var vars = binary.parse(data)
+      .word32lu('dataDescriptorSignature')
+      .word32lu('crc32')
+      .word32lu('compressedSize')
+      .word32lu('uncompressedSize')
+      .vars;
+
+    entry.size = vars.uncompressedSize;
+    self._readRecord();
+  });
+};
+
+Parse.prototype._readCentralDirectoryFileHeader = function () {
+  var self = this;
+  this._pullStream.pull(42, function (err, data) {
+    if (err) {
+      return self.emit('error', err);
+    }
+
+    var vars = binary.parse(data)
+      .word16lu('versionMadeBy')
+      .word16lu('versionsNeededToExtract')
+      .word16lu('flags')
+      .word16lu('compressionMethod')
+      .word16lu('lastModifiedTime')
+      .word16lu('lastModifiedDate')
+      .word32lu('crc32')
+      .word32lu('compressedSize')
+      .word32lu('uncompressedSize')
+      .word16lu('fileNameLength')
+      .word16lu('extraFieldLength')
+      .word16lu('fileCommentLength')
+      .word16lu('diskNumber')
+      .word16lu('internalFileAttributes')
+      .word32lu('externalFileAttributes')
+      .word32lu('offsetToLocalFileHeader')
+      .vars;
+
+    return self._pullStream.pull(vars.fileNameLength, function (err, fileName) {
+      if (err) {
+        return self.emit('error', err);
+      }
+      fileName = fileName.toString('utf8');
+
+      self._pullStream.pull(vars.extraFieldLength, function (err, extraField) {
+        if (err) {
+          return self.emit('error', err);
+        }
+        self._pullStream.pull(vars.fileCommentLength, function (err, fileComment) {
+          if (err) {
+            return self.emit('error', err);
+          }
+          return self._readRecord();
+        });
+      });
+    });
+  });
+};
+
+Parse.prototype._readEndOfCentralDirectoryRecord = function () {
+  var self = this;
+  this._pullStream.pull(18, function (err, data) {
+    if (err) {
+      return self.emit('error', err);
+    }
+
+    var vars = binary.parse(data)
+      .word16lu('diskNumber')
+      .word16lu('diskStart')
+      .word16lu('numberOfRecordsOnDisk')
+      .word16lu('numberOfRecords')
+      .word32lu('sizeOfCentralDirectory')
+      .word32lu('offsetToStartOfCentralDirectory')
+      .word16lu('commentLength')
+      .vars;
+
+    if (vars.commentLength) {
+      setImmediate(function() {
+        self._pullStream.pull(vars.commentLength, function (err, comment) {
+          if (err) {
+            return self.emit('error', err);
+          }
+          comment = comment.toString('utf8');
+          return self._pullStream.end();
+        });
+      });
+
+    } else {
+      self._pullStream.end();
+    }
+  });
+};
+
+Parse.prototype._transform = function (chunk, encoding, callback) {
+  if (this._pullStream.write(chunk)) {
+    return callback();
+  }
+
+  this._pullStream.once('drain', callback);
+};
+
+Parse.prototype.pipe = function (dest, opts) {
+  var self = this;
+  if (typeof dest.add === "function") {
+    self.on("entry", function (entry) {
+      dest.add(entry);
+    })
+  }
+  return Transform.prototype.pipe.apply(this, arguments);
+};
+
+Parse.prototype._flush = function (callback) {
+  if (!this._streamEnd || !this._streamFinish) {
+    return setImmediate(this._flush.bind(this, callback));
+  }
+
+  this.emit('close');
+  return callback();
+};
+
+Parse.prototype.addListener = function(type, listener) {
+  if ('entry' === type) {
+    this._hasEntryListener = true;
+  }
+  return Transform.prototype.addListener.call(this, type, listener);
+};
+
+Parse.prototype.on = Parse.prototype.addListener;
diff --git a/wrt/node_modules/unzip/package.json b/wrt/node_modules/unzip/package.json
new file mode 100644 (file)
index 0000000..ac91330
--- /dev/null
@@ -0,0 +1,107 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "unzip",
+        "scope": null,
+        "escapedName": "unzip",
+        "name": "unzip",
+        "rawSpec": "",
+        "spec": "latest",
+        "type": "tag"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt"
+    ]
+  ],
+  "_from": "unzip@latest",
+  "_id": "unzip@0.1.11",
+  "_inCache": true,
+  "_location": "/unzip",
+  "_npmUser": {
+    "name": "evanoxfeld",
+    "email": "eoxfeld@gmail.com"
+  },
+  "_npmVersion": "1.4.21",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "unzip",
+    "scope": null,
+    "escapedName": "unzip",
+    "name": "unzip",
+    "rawSpec": "",
+    "spec": "latest",
+    "type": "tag"
+  },
+  "_requiredBy": [
+    "#USER"
+  ],
+  "_resolved": "https://registry.npmjs.org/unzip/-/unzip-0.1.11.tgz",
+  "_shasum": "89749c63b058d7d90d619f86b98aa1535d3b97f0",
+  "_shrinkwrap": null,
+  "_spec": "unzip",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt",
+  "author": {
+    "name": "Evan Oxfeld",
+    "email": "eoxfeld@gmail.com"
+  },
+  "bugs": {
+    "url": "https://github.com/EvanOxfeld/node-unzip/issues"
+  },
+  "dependencies": {
+    "binary": ">= 0.3.0 < 1",
+    "fstream": ">= 0.1.30 < 1",
+    "match-stream": ">= 0.0.2 < 1",
+    "pullstream": ">= 0.4.1 < 1",
+    "readable-stream": "~1.0.31",
+    "setimmediate": ">= 1.0.1 < 2"
+  },
+  "description": "Unzip cross-platform streaming API compatible with fstream and fs.ReadStream",
+  "devDependencies": {
+    "dirdiff": ">= 0.0.1 < 1",
+    "stream-buffers": ">= 0.2.5 < 1",
+    "tap": ">= 0.3.0 < 1",
+    "temp": ">= 0.4.0 < 1"
+  },
+  "directories": {
+    "example": "examples",
+    "test": "test"
+  },
+  "dist": {
+    "shasum": "89749c63b058d7d90d619f86b98aa1535d3b97f0",
+    "tarball": "https://registry.npmjs.org/unzip/-/unzip-0.1.11.tgz"
+  },
+  "gitHead": "5a62ecbcef6523708bb8b37decaf6e41728ac7fc",
+  "homepage": "https://github.com/EvanOxfeld/node-unzip",
+  "keywords": [
+    "zip",
+    "unzip",
+    "zlib",
+    "uncompress",
+    "archive",
+    "stream",
+    "extract"
+  ],
+  "license": "MIT",
+  "main": "unzip.js",
+  "maintainers": [
+    {
+      "name": "evanoxfeld",
+      "email": "eoxfeld@gmail.com"
+    },
+    {
+      "name": "joeferner",
+      "email": "joe@fernsroth.com"
+    }
+  ],
+  "name": "unzip",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/EvanOxfeld/node-unzip.git"
+  },
+  "scripts": {
+    "test": "tap ./test/*.js"
+  },
+  "version": "0.1.11"
+}
diff --git a/wrt/node_modules/unzip/test/compressed.js b/wrt/node_modules/unzip/test/compressed.js
new file mode 100644 (file)
index 0000000..4f598c7
--- /dev/null
@@ -0,0 +1,49 @@
+'use strict';
+
+var test = require('tap').test;
+var fs = require('fs');
+var path = require('path');
+var temp = require('temp');
+var dirdiff = require('dirdiff');
+var unzip = require('../');
+
+test("parse compressed archive (created by POSIX zip)", function (t) {
+  var archive = path.join(__dirname, '../testData/compressed-standard/archive.zip');
+
+  var unzipParser = unzip.Parse();
+  fs.createReadStream(archive).pipe(unzipParser);
+  unzipParser.on('error', function(err) {
+    throw err;
+  });
+
+  unzipParser.on('close', t.end.bind(this));
+});
+
+test("extract compressed archive w/ file sizes known prior to zlib inflation (created by POSIX zip)", function (t) {
+  var archive = path.join(__dirname, '../testData/compressed-standard/archive.zip');
+
+  temp.mkdir('node-unzip-', function (err, dirPath) {
+    if (err) {
+      throw err;
+    }
+    var unzipExtractor = unzip.Extract({ path: dirPath });
+    unzipExtractor.on('error', function(err) {
+      throw err;
+    });
+    unzipExtractor.on('close', testExtractionResults);
+
+    fs.createReadStream(archive).pipe(unzipExtractor);
+
+    function testExtractionResults() {
+      dirdiff(path.join(__dirname, '../testData/compressed-standard/inflated'), dirPath, {
+        fileContents: true
+      }, function (err, diffs) {
+        if (err) {
+          throw err;
+        }
+        t.equal(diffs.length, 0, 'extracted directory contents');
+        t.end();
+      });
+    }
+  });
+});
\ No newline at end of file
diff --git a/wrt/node_modules/unzip/test/fileSizeUnknownFlag.js b/wrt/node_modules/unzip/test/fileSizeUnknownFlag.js
new file mode 100644 (file)
index 0000000..a0f3af4
--- /dev/null
@@ -0,0 +1,78 @@
+'use strict';
+
+var test = require('tap').test;
+var fs = require('fs');
+var path = require('path');
+var temp = require('temp');
+var dirdiff = require('dirdiff');
+var unzip = require('../');
+
+test("parse archive w/ file size unknown flag set (created by OS X Finder)", function (t) {
+  var archive = path.join(__dirname, '../testData/compressed-OSX-Finder/archive.zip');
+
+  var unzipParser = unzip.Parse();
+  fs.createReadStream(archive).pipe(unzipParser);
+  unzipParser.on('error', function(err) {
+    throw err;
+  });
+
+  unzipParser.on('close', t.end.bind(this));
+});
+
+test("extract archive w/ file size unknown flag set (created by OS X Finder)", function (t) {
+  var archive = path.join(__dirname, '../testData/compressed-OSX-Finder/archive.zip');
+
+  temp.mkdir('node-unzip-', function (err, dirPath) {
+    if (err) {
+      throw err;
+    }
+    var unzipExtractor = unzip.Extract({ path: dirPath });
+    unzipExtractor.on('error', function(err) {
+      throw err;
+    });
+    unzipExtractor.on('close', testExtractionResults);
+
+    fs.createReadStream(archive).pipe(unzipExtractor);
+
+    function testExtractionResults() {
+      dirdiff(path.join(__dirname, '../testData/compressed-OSX-Finder/inflated'), dirPath, {
+        fileContents: true
+      }, function (err, diffs) {
+        if (err) {
+          throw err;
+        }
+        t.equal(diffs.length, 0, 'extracted directory contents');
+        t.end();
+      });
+    }
+  });
+});
+
+test("archive w/ language encoding flag set", function (t) {
+  var archive = path.join(__dirname, '../testData/compressed-flags-set/archive.zip');
+
+  temp.mkdir('node-unzip-', function (err, dirPath) {
+    if (err) {
+      throw err;
+    }
+    var unzipExtractor = unzip.Extract({ path: dirPath });
+    unzipExtractor.on('error', function(err) {
+      throw err;
+    });
+    unzipExtractor.on('close', testExtractionResults);
+
+    fs.createReadStream(archive).pipe(unzipExtractor);
+
+    function testExtractionResults() {
+      dirdiff(path.join(__dirname, '../testData/compressed-flags-set/inflated'), dirPath, {
+        fileContents: true
+      }, function (err, diffs) {
+        if (err) {
+          throw err;
+        }
+        t.equal(diffs.length, 0, 'extracted directory contents');
+        t.end();
+      });
+    }
+  });
+});
\ No newline at end of file
diff --git a/wrt/node_modules/unzip/test/pipeSingleEntry.js b/wrt/node_modules/unzip/test/pipeSingleEntry.js
new file mode 100644 (file)
index 0000000..d29b4eb
--- /dev/null
@@ -0,0 +1,29 @@
+'use strict';
+
+var test = require('tap').test;
+var fs = require('fs');
+var path = require('path');
+var temp = require('temp');
+var streamBuffers = require("stream-buffers");
+var unzip = require('../');
+
+test("pipe a single file entry out of a zip", function (t) {
+  var archive = path.join(__dirname, '../testData/compressed-standard/archive.zip');
+
+  fs.createReadStream(archive)
+    .pipe(unzip.Parse())
+    .on('entry', function(entry) {
+      if (entry.path === 'file.txt') {
+        var writableStream = new streamBuffers.WritableStreamBuffer();
+        writableStream.on('close', function () {
+          var str = writableStream.getContentsAsString('utf8');
+          var fileStr = fs.readFileSync(path.join(__dirname, '../testData/compressed-standard/inflated/file.txt'), 'utf8')
+          t.equal(str, fileStr);
+          t.end();
+        });
+        entry.pipe(writableStream);
+      } else {
+        entry.autodrain();
+      }
+    });
+});
\ No newline at end of file
diff --git a/wrt/node_modules/unzip/test/uncompressed.js b/wrt/node_modules/unzip/test/uncompressed.js
new file mode 100644 (file)
index 0000000..fcbf3be
--- /dev/null
@@ -0,0 +1,49 @@
+'use strict';
+
+var test = require('tap').test;
+var fs = require('fs');
+var path = require('path');
+var temp = require('temp');
+var dirdiff = require('dirdiff');
+var unzip = require('../');
+
+test("parse uncompressed archive", function (t) {
+  var archive = path.join(__dirname, '../testData/uncompressed/archive.zip');
+
+  var unzipParser = unzip.Parse();
+  fs.createReadStream(archive).pipe(unzipParser);
+  unzipParser.on('error', function(err) {
+    throw err;
+  });
+
+  unzipParser.on('close', t.end.bind(this));
+});
+
+test("extract uncompressed archive", function (t) {
+  var archive = path.join(__dirname, '../testData/uncompressed/archive.zip');
+
+  temp.mkdir('node-unzip-', function (err, dirPath) {
+    if (err) {
+      throw err;
+    }
+    var unzipExtractor = unzip.Extract({ path: dirPath });
+    unzipExtractor.on('error', function(err) {
+      throw err;
+    });
+    unzipExtractor.on('close', testExtractionResults);
+
+    fs.createReadStream(archive).pipe(unzipExtractor);
+
+    function testExtractionResults() {
+      dirdiff(path.join(__dirname, '../testData/uncompressed/inflated'), dirPath, {
+        fileContents: true
+      }, function (err, diffs) {
+        if (err) {
+          throw err;
+        }
+        t.equal(diffs.length, 0, 'extracted directory contents');
+        t.end();
+      });
+    }
+  });
+});
\ No newline at end of file
diff --git a/wrt/node_modules/unzip/testData/compressed-OSX-Finder/archive.zip b/wrt/node_modules/unzip/testData/compressed-OSX-Finder/archive.zip
new file mode 100644 (file)
index 0000000..7c73227
Binary files /dev/null and b/wrt/node_modules/unzip/testData/compressed-OSX-Finder/archive.zip differ
diff --git a/wrt/node_modules/unzip/testData/compressed-OSX-Finder/inflated/dir/fileInsideDir.txt b/wrt/node_modules/unzip/testData/compressed-OSX-Finder/inflated/dir/fileInsideDir.txt
new file mode 100644 (file)
index 0000000..d81cc07
--- /dev/null
@@ -0,0 +1 @@
+42
diff --git a/wrt/node_modules/unzip/testData/compressed-OSX-Finder/inflated/file.txt b/wrt/node_modules/unzip/testData/compressed-OSX-Finder/inflated/file.txt
new file mode 100644 (file)
index 0000000..ac65224
--- /dev/null
@@ -0,0 +1,11 @@
+node.js rocks
+
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras commodo molestie nunc, eu pharetra libero accumsan nec. Vestibulum hendrerit, augue ac congue varius, enim metus congue quam, imperdiet gravida diam felis nec dui. Morbi ipsum enim, tristique nec congue a, commodo ac sapien. Praesent semper metus quis diam hendrerit ut condimentum eros lobortis. Aenean faucibus arcu nec leo aliquam tincidunt. Nunc bibendum dictum bibendum. Nunc ultricies pretium lacus, sit amet lobortis quam egestas quis. Fusce viverra magna rhoncus sem posuere non tempus nulla vestibulum.
+
+Sed aliquet, odio vel condimentum pellentesque, mauris risus iaculis elit, at congue erat mi at ante. In at dictum metus. Ut rutrum mauris felis. Nulla sed risus nunc, eget ultrices est. Nullam gravida diam in arcu vulputate varius. Sed id egestas magna. Ut a libero sapien.
+
+Integer congue felis ut nisl fringilla ac interdum est pretium. Proin tellus augue, molestie id ultricies placerat, ornare a felis. In eu nibh velit. Pellentesque cursus ultricies fermentum. Mauris eget velit tempor nulla bibendum accumsan sit amet a ante. Morbi rutrum tempor varius. Aenean congue leo vitae mi suscipit ac tempor nibh pulvinar. Maecenas risus eros, sodales quis tincidunt non, vulputate eget orci. Maecenas condimentum lectus pretium orci adipiscing interdum. Sed interdum vehicula urna ut scelerisque.
+
+Phasellus pellentesque tellus in neque auctor pellentesque adipiscing justo consequat. In tincidunt rhoncus mollis. Suspendisse quis est elit, vel semper lorem. Donec cursus, leo ac fermentum luctus, dui dolor pretium nunc, vel congue eros arcu sit amet enim. Nam nibh orci, laoreet id volutpat eu, aliquet sed ligula. Donec placerat sagittis leo, eget hendrerit nisi varius sed. In pharetra erat non justo interdum id tempus purus tempor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse felis leo, pellentesque tristique iaculis consequat, vestibulum a erat. Curabitur ligula risus, consectetur at adipiscing sit amet, accumsan non justo. Proin ultricies molestie lorem et auctor. Duis commodo varius semper. Ut tempus porttitor dolor nec mattis. Cras massa eros, tincidunt eget placerat a, luctus eu arcu. Nulla ac orci vitae odio dapibus dictum vitae porta erat.
+
+Duis luctus convallis euismod. Integer orci massa, bibendum eu blandit quis, facilisis lobortis purus. Donec et sapien quis elit fermentum cursus a ut lacus. Nullam tellus felis, congue et pulvinar sit amet, luctus ac augue. Sed massa nunc, dignissim non viverra ac, dictum sit amet erat. Sed nunc tortor, convallis et tristique ut, aliquam ut orci. Integer nec magna vitae elit sagittis accumsan id ac mi.
diff --git a/wrt/node_modules/unzip/testData/compressed-flags-set/archive.zip b/wrt/node_modules/unzip/testData/compressed-flags-set/archive.zip
new file mode 100644 (file)
index 0000000..015ce23
Binary files /dev/null and b/wrt/node_modules/unzip/testData/compressed-flags-set/archive.zip differ
diff --git a/wrt/node_modules/unzip/testData/compressed-flags-set/inflated/dir/fileInsideDir.txt b/wrt/node_modules/unzip/testData/compressed-flags-set/inflated/dir/fileInsideDir.txt
new file mode 100644 (file)
index 0000000..d81cc07
--- /dev/null
@@ -0,0 +1 @@
+42
diff --git a/wrt/node_modules/unzip/testData/compressed-flags-set/inflated/file.txt b/wrt/node_modules/unzip/testData/compressed-flags-set/inflated/file.txt
new file mode 100644 (file)
index 0000000..ac65224
--- /dev/null
@@ -0,0 +1,11 @@
+node.js rocks
+
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras commodo molestie nunc, eu pharetra libero accumsan nec. Vestibulum hendrerit, augue ac congue varius, enim metus congue quam, imperdiet gravida diam felis nec dui. Morbi ipsum enim, tristique nec congue a, commodo ac sapien. Praesent semper metus quis diam hendrerit ut condimentum eros lobortis. Aenean faucibus arcu nec leo aliquam tincidunt. Nunc bibendum dictum bibendum. Nunc ultricies pretium lacus, sit amet lobortis quam egestas quis. Fusce viverra magna rhoncus sem posuere non tempus nulla vestibulum.
+
+Sed aliquet, odio vel condimentum pellentesque, mauris risus iaculis elit, at congue erat mi at ante. In at dictum metus. Ut rutrum mauris felis. Nulla sed risus nunc, eget ultrices est. Nullam gravida diam in arcu vulputate varius. Sed id egestas magna. Ut a libero sapien.
+
+Integer congue felis ut nisl fringilla ac interdum est pretium. Proin tellus augue, molestie id ultricies placerat, ornare a felis. In eu nibh velit. Pellentesque cursus ultricies fermentum. Mauris eget velit tempor nulla bibendum accumsan sit amet a ante. Morbi rutrum tempor varius. Aenean congue leo vitae mi suscipit ac tempor nibh pulvinar. Maecenas risus eros, sodales quis tincidunt non, vulputate eget orci. Maecenas condimentum lectus pretium orci adipiscing interdum. Sed interdum vehicula urna ut scelerisque.
+
+Phasellus pellentesque tellus in neque auctor pellentesque adipiscing justo consequat. In tincidunt rhoncus mollis. Suspendisse quis est elit, vel semper lorem. Donec cursus, leo ac fermentum luctus, dui dolor pretium nunc, vel congue eros arcu sit amet enim. Nam nibh orci, laoreet id volutpat eu, aliquet sed ligula. Donec placerat sagittis leo, eget hendrerit nisi varius sed. In pharetra erat non justo interdum id tempus purus tempor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse felis leo, pellentesque tristique iaculis consequat, vestibulum a erat. Curabitur ligula risus, consectetur at adipiscing sit amet, accumsan non justo. Proin ultricies molestie lorem et auctor. Duis commodo varius semper. Ut tempus porttitor dolor nec mattis. Cras massa eros, tincidunt eget placerat a, luctus eu arcu. Nulla ac orci vitae odio dapibus dictum vitae porta erat.
+
+Duis luctus convallis euismod. Integer orci massa, bibendum eu blandit quis, facilisis lobortis purus. Donec et sapien quis elit fermentum cursus a ut lacus. Nullam tellus felis, congue et pulvinar sit amet, luctus ac augue. Sed massa nunc, dignissim non viverra ac, dictum sit amet erat. Sed nunc tortor, convallis et tristique ut, aliquam ut orci. Integer nec magna vitae elit sagittis accumsan id ac mi.
diff --git a/wrt/node_modules/unzip/testData/compressed-standard/archive.zip b/wrt/node_modules/unzip/testData/compressed-standard/archive.zip
new file mode 100644 (file)
index 0000000..327aab6
Binary files /dev/null and b/wrt/node_modules/unzip/testData/compressed-standard/archive.zip differ
diff --git a/wrt/node_modules/unzip/testData/compressed-standard/inflated/dir/fileInsideDir.txt b/wrt/node_modules/unzip/testData/compressed-standard/inflated/dir/fileInsideDir.txt
new file mode 100644 (file)
index 0000000..d81cc07
--- /dev/null
@@ -0,0 +1 @@
+42
diff --git a/wrt/node_modules/unzip/testData/compressed-standard/inflated/file.txt b/wrt/node_modules/unzip/testData/compressed-standard/inflated/file.txt
new file mode 100644 (file)
index 0000000..ac65224
--- /dev/null
@@ -0,0 +1,11 @@
+node.js rocks
+
+Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras commodo molestie nunc, eu pharetra libero accumsan nec. Vestibulum hendrerit, augue ac congue varius, enim metus congue quam, imperdiet gravida diam felis nec dui. Morbi ipsum enim, tristique nec congue a, commodo ac sapien. Praesent semper metus quis diam hendrerit ut condimentum eros lobortis. Aenean faucibus arcu nec leo aliquam tincidunt. Nunc bibendum dictum bibendum. Nunc ultricies pretium lacus, sit amet lobortis quam egestas quis. Fusce viverra magna rhoncus sem posuere non tempus nulla vestibulum.
+
+Sed aliquet, odio vel condimentum pellentesque, mauris risus iaculis elit, at congue erat mi at ante. In at dictum metus. Ut rutrum mauris felis. Nulla sed risus nunc, eget ultrices est. Nullam gravida diam in arcu vulputate varius. Sed id egestas magna. Ut a libero sapien.
+
+Integer congue felis ut nisl fringilla ac interdum est pretium. Proin tellus augue, molestie id ultricies placerat, ornare a felis. In eu nibh velit. Pellentesque cursus ultricies fermentum. Mauris eget velit tempor nulla bibendum accumsan sit amet a ante. Morbi rutrum tempor varius. Aenean congue leo vitae mi suscipit ac tempor nibh pulvinar. Maecenas risus eros, sodales quis tincidunt non, vulputate eget orci. Maecenas condimentum lectus pretium orci adipiscing interdum. Sed interdum vehicula urna ut scelerisque.
+
+Phasellus pellentesque tellus in neque auctor pellentesque adipiscing justo consequat. In tincidunt rhoncus mollis. Suspendisse quis est elit, vel semper lorem. Donec cursus, leo ac fermentum luctus, dui dolor pretium nunc, vel congue eros arcu sit amet enim. Nam nibh orci, laoreet id volutpat eu, aliquet sed ligula. Donec placerat sagittis leo, eget hendrerit nisi varius sed. In pharetra erat non justo interdum id tempus purus tempor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse felis leo, pellentesque tristique iaculis consequat, vestibulum a erat. Curabitur ligula risus, consectetur at adipiscing sit amet, accumsan non justo. Proin ultricies molestie lorem et auctor. Duis commodo varius semper. Ut tempus porttitor dolor nec mattis. Cras massa eros, tincidunt eget placerat a, luctus eu arcu. Nulla ac orci vitae odio dapibus dictum vitae porta erat.
+
+Duis luctus convallis euismod. Integer orci massa, bibendum eu blandit quis, facilisis lobortis purus. Donec et sapien quis elit fermentum cursus a ut lacus. Nullam tellus felis, congue et pulvinar sit amet, luctus ac augue. Sed massa nunc, dignissim non viverra ac, dictum sit amet erat. Sed nunc tortor, convallis et tristique ut, aliquam ut orci. Integer nec magna vitae elit sagittis accumsan id ac mi.
diff --git a/wrt/node_modules/unzip/testData/uncompressed/archive.zip b/wrt/node_modules/unzip/testData/uncompressed/archive.zip
new file mode 100644 (file)
index 0000000..2d3626d
Binary files /dev/null and b/wrt/node_modules/unzip/testData/uncompressed/archive.zip differ
diff --git a/wrt/node_modules/unzip/testData/uncompressed/inflated/dir/fileInsideDir.txt b/wrt/node_modules/unzip/testData/uncompressed/inflated/dir/fileInsideDir.txt
new file mode 100644 (file)
index 0000000..d81cc07
--- /dev/null
@@ -0,0 +1 @@
+42
diff --git a/wrt/node_modules/unzip/testData/uncompressed/inflated/file.txt b/wrt/node_modules/unzip/testData/uncompressed/inflated/file.txt
new file mode 100644 (file)
index 0000000..210e1e1
--- /dev/null
@@ -0,0 +1 @@
+node.js rocks
diff --git a/wrt/node_modules/unzip/unzip.js b/wrt/node_modules/unzip/unzip.js
new file mode 100644 (file)
index 0000000..f58bf06
--- /dev/null
@@ -0,0 +1,4 @@
+'use strict';
+
+exports.Parse = require('./lib/parse');
+exports.Extract = require('./lib/extract');
\ No newline at end of file
diff --git a/wrt/node_modules/util-deprecate/History.md b/wrt/node_modules/util-deprecate/History.md
new file mode 100644 (file)
index 0000000..acc8675
--- /dev/null
@@ -0,0 +1,16 @@
+
+1.0.2 / 2015-10-07
+==================
+
+  * use try/catch when checking `localStorage` (#3, @kumavis)
+
+1.0.1 / 2014-11-25
+==================
+
+  * browser: use `console.warn()` for deprecation calls
+  * browser: more jsdocs
+
+1.0.0 / 2014-04-30
+==================
+
+  * initial commit
diff --git a/wrt/node_modules/util-deprecate/LICENSE b/wrt/node_modules/util-deprecate/LICENSE
new file mode 100644 (file)
index 0000000..6a60e8c
--- /dev/null
@@ -0,0 +1,24 @@
+(The MIT License)
+
+Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/util-deprecate/README.md b/wrt/node_modules/util-deprecate/README.md
new file mode 100644 (file)
index 0000000..75622fa
--- /dev/null
@@ -0,0 +1,53 @@
+util-deprecate
+==============
+### The Node.js `util.deprecate()` function with browser support
+
+In Node.js, this module simply re-exports the `util.deprecate()` function.
+
+In the web browser (i.e. via browserify), a browser-specific implementation
+of the `util.deprecate()` function is used.
+
+
+## API
+
+A `deprecate()` function is the only thing exposed by this module.
+
+``` javascript
+// setup:
+exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead');
+
+
+// users see:
+foo();
+// foo() is deprecated, use bar() instead
+foo();
+foo();
+```
+
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/util-deprecate/browser.js b/wrt/node_modules/util-deprecate/browser.js
new file mode 100644 (file)
index 0000000..549ae2f
--- /dev/null
@@ -0,0 +1,67 @@
+
+/**
+ * Module exports.
+ */
+
+module.exports = deprecate;
+
+/**
+ * Mark that a method should not be used.
+ * Returns a modified function which warns once by default.
+ *
+ * If `localStorage.noDeprecation = true` is set, then it is a no-op.
+ *
+ * If `localStorage.throwDeprecation = true` is set, then deprecated functions
+ * will throw an Error when invoked.
+ *
+ * If `localStorage.traceDeprecation = true` is set, then deprecated functions
+ * will invoke `console.trace()` instead of `console.error()`.
+ *
+ * @param {Function} fn - the function to deprecate
+ * @param {String} msg - the string to print to the console when `fn` is invoked
+ * @returns {Function} a new "deprecated" version of `fn`
+ * @api public
+ */
+
+function deprecate (fn, msg) {
+  if (config('noDeprecation')) {
+    return fn;
+  }
+
+  var warned = false;
+  function deprecated() {
+    if (!warned) {
+      if (config('throwDeprecation')) {
+        throw new Error(msg);
+      } else if (config('traceDeprecation')) {
+        console.trace(msg);
+      } else {
+        console.warn(msg);
+      }
+      warned = true;
+    }
+    return fn.apply(this, arguments);
+  }
+
+  return deprecated;
+}
+
+/**
+ * Checks `localStorage` for boolean values for the given `name`.
+ *
+ * @param {String} name
+ * @returns {Boolean}
+ * @api private
+ */
+
+function config (name) {
+  // accessing global.localStorage can trigger a DOMException in sandboxed iframes
+  try {
+    if (!global.localStorage) return false;
+  } catch (_) {
+    return false;
+  }
+  var val = global.localStorage[name];
+  if (null == val) return false;
+  return String(val).toLowerCase() === 'true';
+}
diff --git a/wrt/node_modules/util-deprecate/node.js b/wrt/node_modules/util-deprecate/node.js
new file mode 100644 (file)
index 0000000..5e6fcff
--- /dev/null
@@ -0,0 +1,6 @@
+
+/**
+ * For Node.js, simply re-export the core `util.deprecate` function.
+ */
+
+module.exports = require('util').deprecate;
diff --git a/wrt/node_modules/util-deprecate/package.json b/wrt/node_modules/util-deprecate/package.json
new file mode 100644 (file)
index 0000000..91f6af0
--- /dev/null
@@ -0,0 +1,89 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "util-deprecate@^1.0.2",
+        "scope": null,
+        "escapedName": "util-deprecate",
+        "name": "util-deprecate",
+        "rawSpec": "^1.0.2",
+        "spec": ">=1.0.2 <2.0.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/underscore.string"
+    ]
+  ],
+  "_from": "util-deprecate@>=1.0.2 <2.0.0",
+  "_id": "util-deprecate@1.0.2",
+  "_inCache": true,
+  "_location": "/util-deprecate",
+  "_nodeVersion": "4.1.2",
+  "_npmUser": {
+    "name": "tootallnate",
+    "email": "nathan@tootallnate.net"
+  },
+  "_npmVersion": "2.14.4",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "util-deprecate@^1.0.2",
+    "scope": null,
+    "escapedName": "util-deprecate",
+    "name": "util-deprecate",
+    "rawSpec": "^1.0.2",
+    "spec": ">=1.0.2 <2.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/underscore.string"
+  ],
+  "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
+  "_shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf",
+  "_shrinkwrap": null,
+  "_spec": "util-deprecate@^1.0.2",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/underscore.string",
+  "author": {
+    "name": "Nathan Rajlich",
+    "email": "nathan@tootallnate.net",
+    "url": "http://n8.io/"
+  },
+  "browser": "browser.js",
+  "bugs": {
+    "url": "https://github.com/TooTallNate/util-deprecate/issues"
+  },
+  "dependencies": {},
+  "description": "The Node.js `util.deprecate()` function with browser support",
+  "devDependencies": {},
+  "directories": {},
+  "dist": {
+    "shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf",
+    "tarball": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz"
+  },
+  "gitHead": "475fb6857cd23fafff20c1be846c1350abf8e6d4",
+  "homepage": "https://github.com/TooTallNate/util-deprecate",
+  "keywords": [
+    "util",
+    "deprecate",
+    "browserify",
+    "browser",
+    "node"
+  ],
+  "license": "MIT",
+  "main": "node.js",
+  "maintainers": [
+    {
+      "name": "tootallnate",
+      "email": "nathan@tootallnate.net"
+    }
+  ],
+  "name": "util-deprecate",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/TooTallNate/util-deprecate.git"
+  },
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "version": "1.0.2"
+}
diff --git a/wrt/node_modules/utils-merge/.travis.yml b/wrt/node_modules/utils-merge/.travis.yml
new file mode 100644 (file)
index 0000000..af92b02
--- /dev/null
@@ -0,0 +1,6 @@
+language: "node_js"
+node_js:
+  - "0.4"
+  - "0.6"
+  - "0.8"
+  - "0.10"
diff --git a/wrt/node_modules/utils-merge/LICENSE b/wrt/node_modules/utils-merge/LICENSE
new file mode 100644 (file)
index 0000000..e33bd10
--- /dev/null
@@ -0,0 +1,20 @@
+(The MIT License)
+
+Copyright (c) 2013 Jared Hanson
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/utils-merge/README.md b/wrt/node_modules/utils-merge/README.md
new file mode 100644 (file)
index 0000000..2f94e9b
--- /dev/null
@@ -0,0 +1,34 @@
+# utils-merge
+
+Merges the properties from a source object into a destination object.
+
+## Install
+
+    $ npm install utils-merge
+
+## Usage
+
+```javascript
+var a = { foo: 'bar' }
+  , b = { bar: 'baz' };
+
+merge(a, b);
+// => { foo: 'bar', bar: 'baz' }
+```
+
+## Tests
+
+    $ npm install
+    $ npm test
+
+[![Build Status](https://secure.travis-ci.org/jaredhanson/utils-merge.png)](http://travis-ci.org/jaredhanson/utils-merge)
+
+## Credits
+
+  - [Jared Hanson](http://github.com/jaredhanson)
+
+## License
+
+[The MIT License](http://opensource.org/licenses/MIT)
+
+Copyright (c) 2013 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)>
diff --git a/wrt/node_modules/utils-merge/index.js b/wrt/node_modules/utils-merge/index.js
new file mode 100644 (file)
index 0000000..4265c69
--- /dev/null
@@ -0,0 +1,23 @@
+/**
+ * Merge object b with object a.
+ *
+ *     var a = { foo: 'bar' }
+ *       , b = { bar: 'baz' };
+ *
+ *     merge(a, b);
+ *     // => { foo: 'bar', bar: 'baz' }
+ *
+ * @param {Object} a
+ * @param {Object} b
+ * @return {Object}
+ * @api public
+ */
+
+exports = module.exports = function(a, b){
+  if (a && b) {
+    for (var key in b) {
+      a[key] = b[key];
+    }
+  }
+  return a;
+};
diff --git a/wrt/node_modules/utils-merge/package.json b/wrt/node_modules/utils-merge/package.json
new file mode 100644 (file)
index 0000000..c8ce530
--- /dev/null
@@ -0,0 +1,93 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "utils-merge@1.0.0",
+        "scope": null,
+        "escapedName": "utils-merge",
+        "name": "utils-merge",
+        "rawSpec": "1.0.0",
+        "spec": "1.0.0",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express"
+    ]
+  ],
+  "_from": "utils-merge@1.0.0",
+  "_id": "utils-merge@1.0.0",
+  "_inCache": true,
+  "_location": "/utils-merge",
+  "_npmUser": {
+    "name": "jaredhanson",
+    "email": "jaredhanson@gmail.com"
+  },
+  "_npmVersion": "1.2.25",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "utils-merge@1.0.0",
+    "scope": null,
+    "escapedName": "utils-merge",
+    "name": "utils-merge",
+    "rawSpec": "1.0.0",
+    "spec": "1.0.0",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/express"
+  ],
+  "_resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz",
+  "_shasum": "0294fb922bb9375153541c4f7096231f287c8af8",
+  "_shrinkwrap": null,
+  "_spec": "utils-merge@1.0.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express",
+  "author": {
+    "name": "Jared Hanson",
+    "email": "jaredhanson@gmail.com",
+    "url": "http://www.jaredhanson.net/"
+  },
+  "bugs": {
+    "url": "http://github.com/jaredhanson/utils-merge/issues"
+  },
+  "dependencies": {},
+  "description": "merge() utility function",
+  "devDependencies": {
+    "chai": "1.x.x",
+    "mocha": "1.x.x"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "0294fb922bb9375153541c4f7096231f287c8af8",
+    "tarball": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz"
+  },
+  "engines": {
+    "node": ">= 0.4.0"
+  },
+  "homepage": "https://github.com/jaredhanson/utils-merge#readme",
+  "keywords": [
+    "util"
+  ],
+  "licenses": [
+    {
+      "type": "MIT",
+      "url": "http://www.opensource.org/licenses/MIT"
+    }
+  ],
+  "main": "./index",
+  "maintainers": [
+    {
+      "name": "jaredhanson",
+      "email": "jaredhanson@gmail.com"
+    }
+  ],
+  "name": "utils-merge",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/jaredhanson/utils-merge.git"
+  },
+  "scripts": {
+    "test": "node_modules/.bin/mocha --reporter spec --require test/bootstrap/node test/*.test.js"
+  },
+  "version": "1.0.0"
+}
diff --git a/wrt/node_modules/uws/LICENSE b/wrt/node_modules/uws/LICENSE
new file mode 100644 (file)
index 0000000..4280e07
--- /dev/null
@@ -0,0 +1,17 @@
+Copyright (c) 2016 Alex Hultman and contributors
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any damages
+arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not
+   claim that you wrote the original software. If you use this software
+   in a product, an acknowledgement in the product documentation would be
+   appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be
+   misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
diff --git a/wrt/node_modules/uws/README.md b/wrt/node_modules/uws/README.md
new file mode 100644 (file)
index 0000000..12e9e4e
--- /dev/null
@@ -0,0 +1,32 @@
+## Usage
+`uws` tries to mimic `ws` as closely as possible without sacrificing too much performance. In most cases you simply swap `require('ws')` with `require('uws')`:
+
+```javascript
+var WebSocketServer = require('uws').Server;
+var wss = new WebSocketServer({ port: 3000 });
+
+function onMessage(message) {
+    console.log('received: ' + message);
+}
+
+wss.on('connection', function(ws) {
+    ws.on('message', onMessage);
+    ws.send('something');
+});
+```
+
+##### Deviations from ws
+There are some important incompatibilities with `ws` though, we aim to be ~90% compatible but will never implement behavior that is deemed too inefficient:
+
+* Binary data is passed zero-copy as an `ArrayBuffer`. This means you need to copy it to keep it past the callback. It also means you need to convert it with `Buffer.from(message)` if you expect a `Node.js Buffer`.
+* `webSocket._socket` is not a `net.Socket`, it is just a getter function with very basic functionalities.
+* `webSocket._socket.remote...` might fail, you need to cache it at connection.
+* `webSocket` acts like an `EventEmitter` with one listener per event maximum.
+* `webSocket.upgradeReq` is only valid during execution of the connection handler. If you want to keep properties of the upgradeReq for the entire lifetime of the webSocket you better attach that specific property to the webSocket at connection.
+
+## Installation
+[![](https://nodei.co/npm/uws.png)](https://www.npmjs.com/package/uws)
+
+At installation `uws` will try to recompile itself using the system's C++11 compiler (GCC 4.8+, Clang 3.3, VC++ 2015+).
+If this fails it will silently fall back to using the precompiled binaries.
+NPM installation will never fail but `require('uws')` will throw if it cannot properly load the binary module.
diff --git a/wrt/node_modules/uws/binding.gyp b/wrt/node_modules/uws/binding.gyp
new file mode 100644 (file)
index 0000000..4cb8060
--- /dev/null
@@ -0,0 +1,80 @@
+{
+  'targets': [
+    {
+      'target_name': 'uws',
+      'sources': [
+        'src/Extensions.cpp',
+        'src/Group.cpp',
+        'src/Networking.cpp',
+        'src/Hub.cpp',
+        'src/Node.cpp',
+        'src/WebSocket.cpp',
+        'src/HTTPSocket.cpp',
+        'src/Socket.cpp',
+        'src/addon.cpp'
+      ],
+      'conditions': [
+        ['OS=="linux"', {
+          'cflags_cc': [ '-std=c++11', '-DUSE_LIBUV' ],
+          'cflags_cc!': [ '-fno-exceptions', '-std=gnu++0x', '-fno-rtti' ],
+          'cflags!': [ '-fno-omit-frame-pointer' ],
+          'ldflags!': [ '-rdynamic' ],
+          'ldflags': [ '-s' ]
+        }],
+        ['OS=="mac"', {
+          'xcode_settings': {
+            'MACOSX_DEPLOYMENT_TARGET': '10.7',
+            'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',
+            'CLANG_CXX_LIBRARY': 'libc++',
+            'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
+            'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
+            'GCC_THREADSAFE_STATICS': 'YES',
+            'GCC_OPTIMIZATION_LEVEL': '3',
+            'GCC_ENABLE_CPP_RTTI': 'YES',
+            'OTHER_CFLAGS!': [ '-fno-strict-aliasing' ],
+            'OTHER_CPLUSPLUSFLAGS': [ '-DUSE_LIBUV' ]
+          }
+        }],
+        ['OS=="win"', {
+          'cflags_cc': [ '/DUSE_LIBUV' ],
+          'cflags_cc!': []
+        }]
+       ]
+    },
+    {
+      'target_name': 'action_after_build',
+      'type': 'none',
+      'dependencies': [ 'uws' ],
+      'conditions': [
+        ['OS!="win"', {
+            'actions': [
+              {
+                'action_name': 'move_lib',
+                'inputs': [
+                  '<@(PRODUCT_DIR)/uws.node'
+                ],
+                'outputs': [
+                  'uws'
+                ],
+                'action': ['cp', '<@(PRODUCT_DIR)/uws.node', 'uws_<!@(node -p process.platform)_<!@(node -p process.versions.modules).node']
+              }
+            ]}
+        ],
+        ['OS=="win"', {
+            'actions': [
+              {
+                'action_name': 'move_lib',
+                'inputs': [
+                  '<@(PRODUCT_DIR)/uws.node'
+                ],
+                'outputs': [
+                  'uws'
+                ],
+                'action': ['copy', '<@(PRODUCT_DIR)/uws.node', 'uws_<!@(node -p process.platform)_<!@(node -p process.versions.modules).node']
+              }
+            ]}
+        ]
+      ]
+    }
+  ]
+}
diff --git a/wrt/node_modules/uws/build/Makefile b/wrt/node_modules/uws/build/Makefile
new file mode 100644 (file)
index 0000000..e738b0a
--- /dev/null
@@ -0,0 +1,329 @@
+# We borrow heavily from the kernel build setup, though we are simpler since
+# we don't have Kconfig tweaking settings on us.
+
+# The implicit make rules have it looking for RCS files, among other things.
+# We instead explicitly write all the rules we care about.
+# It's even quicker (saves ~200ms) to pass -r on the command line.
+MAKEFLAGS=-r
+
+# The source directory tree.
+srcdir := ..
+abs_srcdir := $(abspath $(srcdir))
+
+# The name of the builddir.
+builddir_name ?= .
+
+# The V=1 flag on command line makes us verbosely print command lines.
+ifdef V
+  quiet=
+else
+  quiet=quiet_
+endif
+
+# Specify BUILDTYPE=Release on the command line for a release build.
+BUILDTYPE ?= Release
+
+# Directory all our build output goes into.
+# Note that this must be two directories beneath src/ for unit tests to pass,
+# as they reach into the src/ directory for data with relative paths.
+builddir ?= $(builddir_name)/$(BUILDTYPE)
+abs_builddir := $(abspath $(builddir))
+depsdir := $(builddir)/.deps
+
+# Object output directory.
+obj := $(builddir)/obj
+abs_obj := $(abspath $(obj))
+
+# We build up a list of every single one of the targets so we can slurp in the
+# generated dependency rule Makefiles in one pass.
+all_deps :=
+
+
+
+CC.target ?= $(CC)
+CFLAGS.target ?= $(CPPFLAGS) $(CFLAGS)
+CXX.target ?= $(CXX)
+CXXFLAGS.target ?= $(CPPFLAGS) $(CXXFLAGS)
+LINK.target ?= $(LINK)
+LDFLAGS.target ?= $(LDFLAGS)
+AR.target ?= $(AR)
+
+# C++ apps need to be linked with g++.
+LINK ?= $(CXX.target)
+
+# TODO(evan): move all cross-compilation logic to gyp-time so we don't need
+# to replicate this environment fallback in make as well.
+CC.host ?= gcc
+CFLAGS.host ?= $(CPPFLAGS_host) $(CFLAGS_host)
+CXX.host ?= g++
+CXXFLAGS.host ?= $(CPPFLAGS_host) $(CXXFLAGS_host)
+LINK.host ?= $(CXX.host)
+LDFLAGS.host ?=
+AR.host ?= ar
+
+# Define a dir function that can handle spaces.
+# http://www.gnu.org/software/make/manual/make.html#Syntax-of-Functions
+# "leading spaces cannot appear in the text of the first argument as written.
+# These characters can be put into the argument value by variable substitution."
+empty :=
+space := $(empty) $(empty)
+
+# http://stackoverflow.com/questions/1189781/using-make-dir-or-notdir-on-a-path-with-spaces
+replace_spaces = $(subst $(space),?,$1)
+unreplace_spaces = $(subst ?,$(space),$1)
+dirx = $(call unreplace_spaces,$(dir $(call replace_spaces,$1)))
+
+# Flags to make gcc output dependency info.  Note that you need to be
+# careful here to use the flags that ccache and distcc can understand.
+# We write to a dep file on the side first and then rename at the end
+# so we can't end up with a broken dep file.
+depfile = $(depsdir)/$(call replace_spaces,$@).d
+DEPFLAGS = -MMD -MF $(depfile).raw
+
+# We have to fixup the deps output in a few ways.
+# (1) the file output should mention the proper .o file.
+# ccache or distcc lose the path to the target, so we convert a rule of
+# the form:
+#   foobar.o: DEP1 DEP2
+# into
+#   path/to/foobar.o: DEP1 DEP2
+# (2) we want missing files not to cause us to fail to build.
+# We want to rewrite
+#   foobar.o: DEP1 DEP2 \
+#               DEP3
+# to
+#   DEP1:
+#   DEP2:
+#   DEP3:
+# so if the files are missing, they're just considered phony rules.
+# We have to do some pretty insane escaping to get those backslashes
+# and dollar signs past make, the shell, and sed at the same time.
+# Doesn't work with spaces, but that's fine: .d files have spaces in
+# their names replaced with other characters.
+define fixup_dep
+# The depfile may not exist if the input file didn't have any #includes.
+touch $(depfile).raw
+# Fixup path as in (1).
+sed -e "s|^$(notdir $@)|$@|" $(depfile).raw >> $(depfile)
+# Add extra rules as in (2).
+# We remove slashes and replace spaces with new lines;
+# remove blank lines;
+# delete the first line and append a colon to the remaining lines.
+sed -e 's|\\||' -e 'y| |\n|' $(depfile).raw |\
+  grep -v '^$$'                             |\
+  sed -e 1d -e 's|$$|:|'                     \
+    >> $(depfile)
+rm $(depfile).raw
+endef
+
+# Command definitions:
+# - cmd_foo is the actual command to run;
+# - quiet_cmd_foo is the brief-output summary of the command.
+
+quiet_cmd_cc = CC($(TOOLSET)) $@
+cmd_cc = $(CC.$(TOOLSET)) $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c -o $@ $<
+
+quiet_cmd_cxx = CXX($(TOOLSET)) $@
+cmd_cxx = $(CXX.$(TOOLSET)) $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $<
+
+quiet_cmd_touch = TOUCH $@
+cmd_touch = touch $@
+
+quiet_cmd_copy = COPY $@
+# send stderr to /dev/null to ignore messages when linking directories.
+cmd_copy = rm -rf "$@" && cp -af "$<" "$@"
+
+quiet_cmd_alink = AR($(TOOLSET)) $@
+cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)
+
+quiet_cmd_alink_thin = AR($(TOOLSET)) $@
+cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)
+
+# Due to circular dependencies between libraries :(, we wrap the
+# special "figure out circular dependencies" flags around the entire
+# input list during linking.
+quiet_cmd_link = LINK($(TOOLSET)) $@
+cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS)
+
+# We support two kinds of shared objects (.so):
+# 1) shared_library, which is just bundling together many dependent libraries
+# into a link line.
+# 2) loadable_module, which is generating a module intended for dlopen().
+#
+# They differ only slightly:
+# In the former case, we want to package all dependent code into the .so.
+# In the latter case, we want to package just the API exposed by the
+# outermost module.
+# This means shared_library uses --whole-archive, while loadable_module doesn't.
+# (Note that --whole-archive is incompatible with the --start-group used in
+# normal linking.)
+
+# Other shared-object link notes:
+# - Set SONAME to the library filename so our binaries don't reference
+# the local, absolute paths used on the link command-line.
+quiet_cmd_solink = SOLINK($(TOOLSET)) $@
+cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS)
+
+quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@
+cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS)
+
+
+# Define an escape_quotes function to escape single quotes.
+# This allows us to handle quotes properly as long as we always use
+# use single quotes and escape_quotes.
+escape_quotes = $(subst ','\'',$(1))
+# This comment is here just to include a ' to unconfuse syntax highlighting.
+# Define an escape_vars function to escape '$' variable syntax.
+# This allows us to read/write command lines with shell variables (e.g.
+# $LD_LIBRARY_PATH), without triggering make substitution.
+escape_vars = $(subst $$,$$$$,$(1))
+# Helper that expands to a shell command to echo a string exactly as it is in
+# make. This uses printf instead of echo because printf's behaviour with respect
+# to escape sequences is more portable than echo's across different shells
+# (e.g., dash, bash).
+exact_echo = printf '%s\n' '$(call escape_quotes,$(1))'
+
+# Helper to compare the command we're about to run against the command
+# we logged the last time we ran the command.  Produces an empty
+# string (false) when the commands match.
+# Tricky point: Make has no string-equality test function.
+# The kernel uses the following, but it seems like it would have false
+# positives, where one string reordered its arguments.
+#   arg_check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \
+#                       $(filter-out $(cmd_$@), $(cmd_$(1))))
+# We instead substitute each for the empty string into the other, and
+# say they're equal if both substitutions produce the empty string.
+# .d files contain ? instead of spaces, take that into account.
+command_changed = $(or $(subst $(cmd_$(1)),,$(cmd_$(call replace_spaces,$@))),\
+                       $(subst $(cmd_$(call replace_spaces,$@)),,$(cmd_$(1))))
+
+# Helper that is non-empty when a prerequisite changes.
+# Normally make does this implicitly, but we force rules to always run
+# so we can check their command lines.
+#   $? -- new prerequisites
+#   $| -- order-only dependencies
+prereq_changed = $(filter-out FORCE_DO_CMD,$(filter-out $|,$?))
+
+# Helper that executes all postbuilds until one fails.
+define do_postbuilds
+  @E=0;\
+  for p in $(POSTBUILDS); do\
+    eval $$p;\
+    E=$$?;\
+    if [ $$E -ne 0 ]; then\
+      break;\
+    fi;\
+  done;\
+  if [ $$E -ne 0 ]; then\
+    rm -rf "$@";\
+    exit $$E;\
+  fi
+endef
+
+# do_cmd: run a command via the above cmd_foo names, if necessary.
+# Should always run for a given target to handle command-line changes.
+# Second argument, if non-zero, makes it do asm/C/C++ dependency munging.
+# Third argument, if non-zero, makes it do POSTBUILDS processing.
+# Note: We intentionally do NOT call dirx for depfile, since it contains ? for
+# spaces already and dirx strips the ? characters.
+define do_cmd
+$(if $(or $(command_changed),$(prereq_changed)),
+  @$(call exact_echo,  $($(quiet)cmd_$(1)))
+  @mkdir -p "$(call dirx,$@)" "$(dir $(depfile))"
+  $(if $(findstring flock,$(word 1,$(cmd_$1))),
+    @$(cmd_$(1))
+    @echo "  $(quiet_cmd_$(1)): Finished",
+    @$(cmd_$(1))
+  )
+  @$(call exact_echo,$(call escape_vars,cmd_$(call replace_spaces,$@) := $(cmd_$(1)))) > $(depfile)
+  @$(if $(2),$(fixup_dep))
+  $(if $(and $(3), $(POSTBUILDS)),
+    $(call do_postbuilds)
+  )
+)
+endef
+
+# Declare the "all" target first so it is the default,
+# even though we don't have the deps yet.
+.PHONY: all
+all:
+
+# make looks for ways to re-generate included makefiles, but in our case, we
+# don't have a direct way. Explicitly telling make that it has nothing to do
+# for them makes it go faster.
+%.d: ;
+
+# Use FORCE_DO_CMD to force a target to run.  Should be coupled with
+# do_cmd.
+.PHONY: FORCE_DO_CMD
+FORCE_DO_CMD:
+
+TOOLSET := target
+# Suffix rules, putting all outputs into $(obj).
+$(obj).$(TOOLSET)/%.o: $(srcdir)/%.c FORCE_DO_CMD
+       @$(call do_cmd,cc,1)
+$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD
+       @$(call do_cmd,cxx,1)
+$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cpp FORCE_DO_CMD
+       @$(call do_cmd,cxx,1)
+$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cxx FORCE_DO_CMD
+       @$(call do_cmd,cxx,1)
+$(obj).$(TOOLSET)/%.o: $(srcdir)/%.S FORCE_DO_CMD
+       @$(call do_cmd,cc,1)
+$(obj).$(TOOLSET)/%.o: $(srcdir)/%.s FORCE_DO_CMD
+       @$(call do_cmd,cc,1)
+
+# Try building from generated source, too.
+$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.c FORCE_DO_CMD
+       @$(call do_cmd,cc,1)
+$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD
+       @$(call do_cmd,cxx,1)
+$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cpp FORCE_DO_CMD
+       @$(call do_cmd,cxx,1)
+$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cxx FORCE_DO_CMD
+       @$(call do_cmd,cxx,1)
+$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.S FORCE_DO_CMD
+       @$(call do_cmd,cc,1)
+$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.s FORCE_DO_CMD
+       @$(call do_cmd,cc,1)
+
+$(obj).$(TOOLSET)/%.o: $(obj)/%.c FORCE_DO_CMD
+       @$(call do_cmd,cc,1)
+$(obj).$(TOOLSET)/%.o: $(obj)/%.cc FORCE_DO_CMD
+       @$(call do_cmd,cxx,1)
+$(obj).$(TOOLSET)/%.o: $(obj)/%.cpp FORCE_DO_CMD
+       @$(call do_cmd,cxx,1)
+$(obj).$(TOOLSET)/%.o: $(obj)/%.cxx FORCE_DO_CMD
+       @$(call do_cmd,cxx,1)
+$(obj).$(TOOLSET)/%.o: $(obj)/%.S FORCE_DO_CMD
+       @$(call do_cmd,cc,1)
+$(obj).$(TOOLSET)/%.o: $(obj)/%.s FORCE_DO_CMD
+       @$(call do_cmd,cc,1)
+
+
+ifeq ($(strip $(foreach prefix,$(NO_LOAD),\
+    $(findstring $(join ^,$(prefix)),\
+                 $(join ^,action_after_build.target.mk)))),)
+  include action_after_build.target.mk
+endif
+ifeq ($(strip $(foreach prefix,$(NO_LOAD),\
+    $(findstring $(join ^,$(prefix)),\
+                 $(join ^,uws.target.mk)))),)
+  include uws.target.mk
+endif
+
+quiet_cmd_regen_makefile = ACTION Regenerating $@
+cmd_regen_makefile = cd $(srcdir); /usr/local/ys/node-v7.4.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "--toplevel-dir=." -I/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/uws/build/config.gypi -I/usr/local/ys/node-v7.4.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/home/kenshin.choi/.node-gyp/7.4.0/include/node/common.gypi "--depth=." "-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/home/kenshin.choi/.node-gyp/7.4.0" "-Dnode_gyp_dir=/usr/local/ys/node-v7.4.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp" "-Dnode_lib_file=node.lib" "-Dmodule_root_dir=/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/uws" binding.gyp
+Makefile: $(srcdir)/../../../../../../../../.node-gyp/7.4.0/include/node/common.gypi $(srcdir)/../../../../../../../../../../usr/local/ys/node-v7.4.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/addon.gypi $(srcdir)/build/config.gypi $(srcdir)/binding.gyp
+       $(call do_cmd,regen_makefile)
+
+# "all" is a concatenation of the "all" targets from all the included
+# sub-makefiles. This is just here to clarify.
+all:
+
+# Add in dependency-tracking rules.  $(all_deps) is the list of every single
+# target in our tree. Only consider the ones with .d (dependency) info:
+d_files := $(wildcard $(foreach f,$(all_deps),$(depsdir)/$(f).d))
+ifneq ($(d_files),)
+  include $(d_files)
+endif
diff --git a/wrt/node_modules/uws/build/Release/.deps/Release/obj.target/action_after_build.stamp.d b/wrt/node_modules/uws/build/Release/.deps/Release/obj.target/action_after_build.stamp.d
new file mode 100644 (file)
index 0000000..71e13c4
--- /dev/null
@@ -0,0 +1 @@
+cmd_Release/obj.target/action_after_build.stamp := touch Release/obj.target/action_after_build.stamp
diff --git a/wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws.node.d b/wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws.node.d
new file mode 100644 (file)
index 0000000..42bc201
--- /dev/null
@@ -0,0 +1 @@
+cmd_Release/obj.target/uws.node := g++ -shared -pthread -m64 -s  -Wl,-soname=uws.node -o Release/obj.target/uws.node -Wl,--start-group Release/obj.target/uws/src/Extensions.o Release/obj.target/uws/src/Group.o Release/obj.target/uws/src/Networking.o Release/obj.target/uws/src/Hub.o Release/obj.target/uws/src/Node.o Release/obj.target/uws/src/WebSocket.o Release/obj.target/uws/src/HTTPSocket.o Release/obj.target/uws/src/Socket.o Release/obj.target/uws/src/addon.o -Wl,--end-group 
diff --git a/wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws/src/Extensions.o.d b/wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws/src/Extensions.o.d
new file mode 100644 (file)
index 0000000..9a7d6c5
--- /dev/null
@@ -0,0 +1,5 @@
+cmd_Release/obj.target/uws/src/Extensions.o := g++ '-DNODE_GYP_MODULE_NAME=uws' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/home/kenshin.choi/.node-gyp/7.4.0/include/node -I/home/kenshin.choi/.node-gyp/7.4.0/src -I/home/kenshin.choi/.node-gyp/7.4.0/deps/uv/include -I/home/kenshin.choi/.node-gyp/7.4.0/deps/v8/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -std=c++11 -DUSE_LIBUV -MMD -MF ./Release/.deps/Release/obj.target/uws/src/Extensions.o.d.raw   -c -o Release/obj.target/uws/src/Extensions.o ../src/Extensions.cpp
+Release/obj.target/uws/src/Extensions.o: ../src/Extensions.cpp \
+ ../src/Extensions.h
+../src/Extensions.cpp:
+../src/Extensions.h:
diff --git a/wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws/src/Group.o.d b/wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws/src/Group.o.d
new file mode 100644 (file)
index 0000000..7623b07
--- /dev/null
@@ -0,0 +1,113 @@
+cmd_Release/obj.target/uws/src/Group.o := g++ '-DNODE_GYP_MODULE_NAME=uws' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/home/kenshin.choi/.node-gyp/7.4.0/include/node -I/home/kenshin.choi/.node-gyp/7.4.0/src -I/home/kenshin.choi/.node-gyp/7.4.0/deps/uv/include -I/home/kenshin.choi/.node-gyp/7.4.0/deps/v8/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -std=c++11 -DUSE_LIBUV -MMD -MF ./Release/.deps/Release/obj.target/uws/src/Group.o.d.raw   -c -o Release/obj.target/uws/src/Group.o ../src/Group.cpp
+Release/obj.target/uws/src/Group.o: ../src/Group.cpp ../src/Group.h \
+ ../src/WebSocket.h ../src/WebSocketProtocol.h ../src/Networking.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslv.h \
+ ../src/Backend.h ../src/Libuv.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-errno.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-version.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-unix.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-threadpool.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-linux.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/e_os2.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslconf.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/./archs/linux-x86_64/opensslconf.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/comp.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/crypto.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/stack.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/safestack.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ossl_typ.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/symhacks.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bio.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/buffer.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/evp.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/objects.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/obj_mac.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/asn1.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bn.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ec.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdsa.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdh.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/rsa.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dsa.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dh.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/sha.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509_vfy.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/lhash.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pkcs7.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem2.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/hmac.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/kssl.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl2.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl3.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/tls1.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dtls1.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pqueue.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl23.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/srtp.h \
+ ../src/Socket.h ../src/HTTPSocket.h ../src/Extensions.h ../src/Hub.h \
+ ../src/Node.h /home/kenshin.choi/.node-gyp/7.4.0/include/node/zlib.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/zconf.h
+../src/Group.cpp:
+../src/Group.h:
+../src/WebSocket.h:
+../src/WebSocketProtocol.h:
+../src/Networking.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslv.h:
+../src/Backend.h:
+../src/Libuv.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-errno.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-version.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-unix.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-threadpool.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-linux.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/e_os2.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslconf.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/./archs/linux-x86_64/opensslconf.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/comp.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/crypto.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/stack.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/safestack.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ossl_typ.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/symhacks.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bio.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/buffer.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/evp.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/objects.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/obj_mac.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/asn1.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bn.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ec.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdsa.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdh.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/rsa.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dsa.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dh.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/sha.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509_vfy.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/lhash.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pkcs7.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem2.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/hmac.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/kssl.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl2.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl3.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/tls1.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dtls1.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pqueue.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl23.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/srtp.h:
+../src/Socket.h:
+../src/HTTPSocket.h:
+../src/Extensions.h:
+../src/Hub.h:
+../src/Node.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/zlib.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/zconf.h:
diff --git a/wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws/src/HTTPSocket.o.d b/wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws/src/HTTPSocket.o.d
new file mode 100644 (file)
index 0000000..281e7f1
--- /dev/null
@@ -0,0 +1,108 @@
+cmd_Release/obj.target/uws/src/HTTPSocket.o := g++ '-DNODE_GYP_MODULE_NAME=uws' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/home/kenshin.choi/.node-gyp/7.4.0/include/node -I/home/kenshin.choi/.node-gyp/7.4.0/src -I/home/kenshin.choi/.node-gyp/7.4.0/deps/uv/include -I/home/kenshin.choi/.node-gyp/7.4.0/deps/v8/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -std=c++11 -DUSE_LIBUV -MMD -MF ./Release/.deps/Release/obj.target/uws/src/HTTPSocket.o.d.raw   -c -o Release/obj.target/uws/src/HTTPSocket.o ../src/HTTPSocket.cpp
+Release/obj.target/uws/src/HTTPSocket.o: ../src/HTTPSocket.cpp \
+ ../src/HTTPSocket.h ../src/Socket.h ../src/Networking.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslv.h \
+ ../src/Backend.h ../src/Libuv.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-errno.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-version.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-unix.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-threadpool.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-linux.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/e_os2.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslconf.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/./archs/linux-x86_64/opensslconf.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/comp.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/crypto.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/stack.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/safestack.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ossl_typ.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/symhacks.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bio.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/buffer.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/evp.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/objects.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/obj_mac.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/asn1.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bn.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ec.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdsa.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdh.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/rsa.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dsa.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dh.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/sha.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509_vfy.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/lhash.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pkcs7.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem2.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/hmac.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/kssl.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl2.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl3.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/tls1.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dtls1.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pqueue.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl23.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/srtp.h \
+ ../src/Group.h ../src/WebSocket.h ../src/WebSocketProtocol.h \
+ ../src/Extensions.h
+../src/HTTPSocket.cpp:
+../src/HTTPSocket.h:
+../src/Socket.h:
+../src/Networking.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslv.h:
+../src/Backend.h:
+../src/Libuv.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-errno.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-version.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-unix.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-threadpool.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-linux.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/e_os2.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslconf.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/./archs/linux-x86_64/opensslconf.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/comp.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/crypto.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/stack.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/safestack.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ossl_typ.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/symhacks.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bio.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/buffer.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/evp.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/objects.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/obj_mac.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/asn1.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bn.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ec.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdsa.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdh.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/rsa.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dsa.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dh.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/sha.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509_vfy.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/lhash.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pkcs7.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem2.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/hmac.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/kssl.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl2.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl3.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/tls1.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dtls1.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pqueue.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl23.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/srtp.h:
+../src/Group.h:
+../src/WebSocket.h:
+../src/WebSocketProtocol.h:
+../src/Extensions.h:
diff --git a/wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws/src/Hub.o.d b/wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws/src/Hub.o.d
new file mode 100644 (file)
index 0000000..024b893
--- /dev/null
@@ -0,0 +1,114 @@
+cmd_Release/obj.target/uws/src/Hub.o := g++ '-DNODE_GYP_MODULE_NAME=uws' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/home/kenshin.choi/.node-gyp/7.4.0/include/node -I/home/kenshin.choi/.node-gyp/7.4.0/src -I/home/kenshin.choi/.node-gyp/7.4.0/deps/uv/include -I/home/kenshin.choi/.node-gyp/7.4.0/deps/v8/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -std=c++11 -DUSE_LIBUV -MMD -MF ./Release/.deps/Release/obj.target/uws/src/Hub.o.d.raw   -c -o Release/obj.target/uws/src/Hub.o ../src/Hub.cpp
+Release/obj.target/uws/src/Hub.o: ../src/Hub.cpp ../src/Hub.h \
+ ../src/Group.h ../src/WebSocket.h ../src/WebSocketProtocol.h \
+ ../src/Networking.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslv.h \
+ ../src/Backend.h ../src/Libuv.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-errno.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-version.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-unix.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-threadpool.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-linux.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/e_os2.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslconf.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/./archs/linux-x86_64/opensslconf.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/comp.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/crypto.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/stack.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/safestack.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ossl_typ.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/symhacks.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bio.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/buffer.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/evp.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/objects.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/obj_mac.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/asn1.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bn.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ec.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdsa.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdh.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/rsa.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dsa.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dh.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/sha.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509_vfy.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/lhash.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pkcs7.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem2.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/hmac.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/kssl.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl2.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl3.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/tls1.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dtls1.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pqueue.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl23.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/srtp.h \
+ ../src/Socket.h ../src/HTTPSocket.h ../src/Extensions.h ../src/Node.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/zlib.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/zconf.h
+../src/Hub.cpp:
+../src/Hub.h:
+../src/Group.h:
+../src/WebSocket.h:
+../src/WebSocketProtocol.h:
+../src/Networking.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslv.h:
+../src/Backend.h:
+../src/Libuv.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-errno.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-version.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-unix.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-threadpool.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-linux.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/e_os2.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslconf.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/./archs/linux-x86_64/opensslconf.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/comp.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/crypto.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/stack.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/safestack.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ossl_typ.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/symhacks.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bio.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/buffer.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/evp.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/objects.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/obj_mac.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/asn1.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bn.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ec.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdsa.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdh.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/rsa.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dsa.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dh.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/sha.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509_vfy.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/lhash.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pkcs7.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem2.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/hmac.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/kssl.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl2.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl3.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/tls1.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dtls1.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pqueue.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl23.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/srtp.h:
+../src/Socket.h:
+../src/HTTPSocket.h:
+../src/Extensions.h:
+../src/Node.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/zlib.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/zconf.h:
diff --git a/wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws/src/Networking.o.d b/wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws/src/Networking.o.d
new file mode 100644 (file)
index 0000000..dba85a2
--- /dev/null
@@ -0,0 +1,100 @@
+cmd_Release/obj.target/uws/src/Networking.o := g++ '-DNODE_GYP_MODULE_NAME=uws' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/home/kenshin.choi/.node-gyp/7.4.0/include/node -I/home/kenshin.choi/.node-gyp/7.4.0/src -I/home/kenshin.choi/.node-gyp/7.4.0/deps/uv/include -I/home/kenshin.choi/.node-gyp/7.4.0/deps/v8/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -std=c++11 -DUSE_LIBUV -MMD -MF ./Release/.deps/Release/obj.target/uws/src/Networking.o.d.raw   -c -o Release/obj.target/uws/src/Networking.o ../src/Networking.cpp
+Release/obj.target/uws/src/Networking.o: ../src/Networking.cpp \
+ ../src/Networking.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslv.h \
+ ../src/Backend.h ../src/Libuv.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-errno.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-version.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-unix.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-threadpool.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-linux.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/e_os2.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslconf.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/./archs/linux-x86_64/opensslconf.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/comp.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/crypto.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/stack.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/safestack.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ossl_typ.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/symhacks.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bio.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/buffer.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/evp.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/objects.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/obj_mac.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/asn1.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bn.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ec.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdsa.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdh.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/rsa.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dsa.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dh.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/sha.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509_vfy.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/lhash.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pkcs7.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem2.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/hmac.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/kssl.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl2.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl3.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/tls1.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dtls1.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pqueue.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl23.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/srtp.h
+../src/Networking.cpp:
+../src/Networking.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslv.h:
+../src/Backend.h:
+../src/Libuv.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-errno.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-version.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-unix.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-threadpool.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-linux.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/e_os2.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslconf.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/./archs/linux-x86_64/opensslconf.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/comp.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/crypto.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/stack.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/safestack.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ossl_typ.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/symhacks.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bio.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/buffer.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/evp.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/objects.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/obj_mac.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/asn1.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bn.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ec.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdsa.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdh.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/rsa.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dsa.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dh.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/sha.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509_vfy.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/lhash.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pkcs7.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem2.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/hmac.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/kssl.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl2.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl3.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/tls1.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dtls1.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pqueue.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl23.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/srtp.h:
diff --git a/wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws/src/Node.o.d b/wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws/src/Node.o.d
new file mode 100644 (file)
index 0000000..f27c774
--- /dev/null
@@ -0,0 +1,102 @@
+cmd_Release/obj.target/uws/src/Node.o := g++ '-DNODE_GYP_MODULE_NAME=uws' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/home/kenshin.choi/.node-gyp/7.4.0/include/node -I/home/kenshin.choi/.node-gyp/7.4.0/src -I/home/kenshin.choi/.node-gyp/7.4.0/deps/uv/include -I/home/kenshin.choi/.node-gyp/7.4.0/deps/v8/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -std=c++11 -DUSE_LIBUV -MMD -MF ./Release/.deps/Release/obj.target/uws/src/Node.o.d.raw   -c -o Release/obj.target/uws/src/Node.o ../src/Node.cpp
+Release/obj.target/uws/src/Node.o: ../src/Node.cpp ../src/Node.h \
+ ../src/Socket.h ../src/Networking.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslv.h \
+ ../src/Backend.h ../src/Libuv.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-errno.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-version.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-unix.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-threadpool.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-linux.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/e_os2.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslconf.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/./archs/linux-x86_64/opensslconf.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/comp.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/crypto.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/stack.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/safestack.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ossl_typ.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/symhacks.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bio.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/buffer.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/evp.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/objects.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/obj_mac.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/asn1.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bn.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ec.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdsa.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdh.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/rsa.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dsa.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dh.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/sha.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509_vfy.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/lhash.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pkcs7.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem2.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/hmac.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/kssl.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl2.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl3.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/tls1.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dtls1.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pqueue.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl23.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/srtp.h
+../src/Node.cpp:
+../src/Node.h:
+../src/Socket.h:
+../src/Networking.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslv.h:
+../src/Backend.h:
+../src/Libuv.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-errno.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-version.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-unix.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-threadpool.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-linux.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/e_os2.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslconf.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/./archs/linux-x86_64/opensslconf.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/comp.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/crypto.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/stack.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/safestack.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ossl_typ.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/symhacks.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bio.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/buffer.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/evp.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/objects.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/obj_mac.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/asn1.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bn.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ec.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdsa.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdh.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/rsa.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dsa.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dh.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/sha.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509_vfy.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/lhash.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pkcs7.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem2.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/hmac.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/kssl.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl2.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl3.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/tls1.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dtls1.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pqueue.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl23.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/srtp.h:
diff --git a/wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws/src/Socket.o.d b/wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws/src/Socket.o.d
new file mode 100644 (file)
index 0000000..c2c05f2
--- /dev/null
@@ -0,0 +1,101 @@
+cmd_Release/obj.target/uws/src/Socket.o := g++ '-DNODE_GYP_MODULE_NAME=uws' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/home/kenshin.choi/.node-gyp/7.4.0/include/node -I/home/kenshin.choi/.node-gyp/7.4.0/src -I/home/kenshin.choi/.node-gyp/7.4.0/deps/uv/include -I/home/kenshin.choi/.node-gyp/7.4.0/deps/v8/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -std=c++11 -DUSE_LIBUV -MMD -MF ./Release/.deps/Release/obj.target/uws/src/Socket.o.d.raw   -c -o Release/obj.target/uws/src/Socket.o ../src/Socket.cpp
+Release/obj.target/uws/src/Socket.o: ../src/Socket.cpp ../src/Socket.h \
+ ../src/Networking.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslv.h \
+ ../src/Backend.h ../src/Libuv.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-errno.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-version.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-unix.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-threadpool.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-linux.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/e_os2.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslconf.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/./archs/linux-x86_64/opensslconf.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/comp.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/crypto.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/stack.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/safestack.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ossl_typ.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/symhacks.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bio.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/buffer.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/evp.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/objects.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/obj_mac.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/asn1.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bn.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ec.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdsa.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdh.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/rsa.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dsa.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dh.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/sha.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509_vfy.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/lhash.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pkcs7.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem2.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/hmac.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/kssl.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl2.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl3.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/tls1.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dtls1.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pqueue.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl23.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/srtp.h
+../src/Socket.cpp:
+../src/Socket.h:
+../src/Networking.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslv.h:
+../src/Backend.h:
+../src/Libuv.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-errno.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-version.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-unix.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-threadpool.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-linux.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/e_os2.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslconf.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/./archs/linux-x86_64/opensslconf.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/comp.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/crypto.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/stack.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/safestack.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ossl_typ.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/symhacks.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bio.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/buffer.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/evp.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/objects.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/obj_mac.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/asn1.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bn.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ec.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdsa.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdh.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/rsa.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dsa.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dh.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/sha.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509_vfy.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/lhash.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pkcs7.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem2.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/hmac.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/kssl.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl2.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl3.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/tls1.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dtls1.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pqueue.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl23.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/srtp.h:
diff --git a/wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws/src/WebSocket.o.d b/wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws/src/WebSocket.o.d
new file mode 100644 (file)
index 0000000..67f459f
--- /dev/null
@@ -0,0 +1,114 @@
+cmd_Release/obj.target/uws/src/WebSocket.o := g++ '-DNODE_GYP_MODULE_NAME=uws' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/home/kenshin.choi/.node-gyp/7.4.0/include/node -I/home/kenshin.choi/.node-gyp/7.4.0/src -I/home/kenshin.choi/.node-gyp/7.4.0/deps/uv/include -I/home/kenshin.choi/.node-gyp/7.4.0/deps/v8/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -std=c++11 -DUSE_LIBUV -MMD -MF ./Release/.deps/Release/obj.target/uws/src/WebSocket.o.d.raw   -c -o Release/obj.target/uws/src/WebSocket.o ../src/WebSocket.cpp
+Release/obj.target/uws/src/WebSocket.o: ../src/WebSocket.cpp \
+ ../src/WebSocket.h ../src/WebSocketProtocol.h ../src/Networking.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslv.h \
+ ../src/Backend.h ../src/Libuv.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-errno.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-version.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-unix.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-threadpool.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-linux.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/e_os2.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslconf.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/./archs/linux-x86_64/opensslconf.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/comp.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/crypto.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/stack.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/safestack.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ossl_typ.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/symhacks.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bio.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/buffer.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/evp.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/objects.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/obj_mac.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/asn1.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bn.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ec.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdsa.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdh.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/rsa.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dsa.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dh.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/sha.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509_vfy.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/lhash.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pkcs7.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem2.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/hmac.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/kssl.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl2.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl3.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/tls1.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dtls1.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pqueue.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl23.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/srtp.h \
+ ../src/Socket.h ../src/Group.h ../src/HTTPSocket.h ../src/Extensions.h \
+ ../src/Hub.h ../src/Node.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/zlib.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/zconf.h
+../src/WebSocket.cpp:
+../src/WebSocket.h:
+../src/WebSocketProtocol.h:
+../src/Networking.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslv.h:
+../src/Backend.h:
+../src/Libuv.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-errno.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-version.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-unix.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-threadpool.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-linux.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/e_os2.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslconf.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/./archs/linux-x86_64/opensslconf.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/comp.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/crypto.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/stack.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/safestack.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ossl_typ.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/symhacks.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bio.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/buffer.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/evp.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/objects.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/obj_mac.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/asn1.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bn.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ec.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdsa.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdh.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/rsa.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dsa.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dh.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/sha.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509_vfy.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/lhash.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pkcs7.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem2.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/hmac.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/kssl.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl2.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl3.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/tls1.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dtls1.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pqueue.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl23.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/srtp.h:
+../src/Socket.h:
+../src/Group.h:
+../src/HTTPSocket.h:
+../src/Extensions.h:
+../src/Hub.h:
+../src/Node.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/zlib.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/zconf.h:
diff --git a/wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws/src/addon.o.d b/wrt/node_modules/uws/build/Release/.deps/Release/obj.target/uws/src/addon.o.d
new file mode 100644 (file)
index 0000000..77aba94
--- /dev/null
@@ -0,0 +1,132 @@
+cmd_Release/obj.target/uws/src/addon.o := g++ '-DNODE_GYP_MODULE_NAME=uws' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/home/kenshin.choi/.node-gyp/7.4.0/include/node -I/home/kenshin.choi/.node-gyp/7.4.0/src -I/home/kenshin.choi/.node-gyp/7.4.0/deps/uv/include -I/home/kenshin.choi/.node-gyp/7.4.0/deps/v8/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -std=c++11 -DUSE_LIBUV -MMD -MF ./Release/.deps/Release/obj.target/uws/src/addon.o.d.raw   -c -o Release/obj.target/uws/src/addon.o ../src/addon.cpp
+Release/obj.target/uws/src/addon.o: ../src/addon.cpp ../src/../src/uWS.h \
+ ../src/../src/Hub.h ../src/../src/Group.h ../src/../src/WebSocket.h \
+ ../src/../src/WebSocketProtocol.h ../src/../src/Networking.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslv.h \
+ ../src/../src/Backend.h ../src/../src/Libuv.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-errno.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-version.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-unix.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-threadpool.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-linux.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/e_os2.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslconf.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/./archs/linux-x86_64/opensslconf.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/comp.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/crypto.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/stack.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/safestack.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ossl_typ.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/symhacks.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bio.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/buffer.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/evp.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/objects.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/obj_mac.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/asn1.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bn.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ec.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdsa.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdh.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/rsa.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dsa.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dh.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/sha.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509_vfy.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/lhash.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pkcs7.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem2.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/hmac.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/kssl.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl2.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl3.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/tls1.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dtls1.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pqueue.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl23.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/srtp.h \
+ ../src/../src/Socket.h ../src/../src/HTTPSocket.h \
+ ../src/../src/Extensions.h ../src/../src/Node.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/zlib.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/zconf.h ../src/addon.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/node.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/v8-version.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/v8config.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/node_version.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/node_buffer.h \
+ /home/kenshin.choi/.node-gyp/7.4.0/include/node/node.h ../src/http.h
+../src/addon.cpp:
+../src/../src/uWS.h:
+../src/../src/Hub.h:
+../src/../src/Group.h:
+../src/../src/WebSocket.h:
+../src/../src/WebSocketProtocol.h:
+../src/../src/Networking.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslv.h:
+../src/../src/Backend.h:
+../src/../src/Libuv.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-errno.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-version.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-unix.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-threadpool.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/uv-linux.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/e_os2.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/opensslconf.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/./archs/linux-x86_64/opensslconf.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/comp.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/crypto.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/stack.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/safestack.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ossl_typ.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/symhacks.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bio.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/buffer.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/evp.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/objects.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/obj_mac.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/asn1.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/bn.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ec.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdsa.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ecdh.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/rsa.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dsa.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dh.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/sha.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/x509_vfy.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/lhash.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pkcs7.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pem2.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/hmac.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/kssl.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl2.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl3.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/tls1.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/dtls1.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/pqueue.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/ssl23.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/openssl/srtp.h:
+../src/../src/Socket.h:
+../src/../src/HTTPSocket.h:
+../src/../src/Extensions.h:
+../src/../src/Node.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/zlib.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/zconf.h:
+../src/addon.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/node.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8-version.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8config.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/node_version.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/node_buffer.h:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/node.h:
+../src/http.h:
diff --git a/wrt/node_modules/uws/build/Release/.deps/Release/uws.node.d b/wrt/node_modules/uws/build/Release/.deps/Release/uws.node.d
new file mode 100644 (file)
index 0000000..694bfcb
--- /dev/null
@@ -0,0 +1 @@
+cmd_Release/uws.node := rm -rf "Release/uws.node" && cp -af "Release/obj.target/uws.node" "Release/uws.node"
diff --git a/wrt/node_modules/uws/build/Release/.deps/uws.d b/wrt/node_modules/uws/build/Release/.deps/uws.d
new file mode 100644 (file)
index 0000000..b448072
--- /dev/null
@@ -0,0 +1 @@
+cmd_uws := LD_LIBRARY_PATH=/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/uws/build/Release/lib.host:/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/uws/build/Release/lib.target:$$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../.; cp "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/uws/build/Release/uws.node" uws_linux_51.node
diff --git a/wrt/node_modules/uws/build/Release/obj.target/action_after_build.stamp b/wrt/node_modules/uws/build/Release/obj.target/action_after_build.stamp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/wrt/node_modules/uws/build/Release/obj.target/uws.node b/wrt/node_modules/uws/build/Release/obj.target/uws.node
new file mode 100755 (executable)
index 0000000..60cdd58
Binary files /dev/null and b/wrt/node_modules/uws/build/Release/obj.target/uws.node differ
diff --git a/wrt/node_modules/uws/build/Release/obj.target/uws/src/Extensions.o b/wrt/node_modules/uws/build/Release/obj.target/uws/src/Extensions.o
new file mode 100644 (file)
index 0000000..c9de641
Binary files /dev/null and b/wrt/node_modules/uws/build/Release/obj.target/uws/src/Extensions.o differ
diff --git a/wrt/node_modules/uws/build/Release/obj.target/uws/src/Group.o b/wrt/node_modules/uws/build/Release/obj.target/uws/src/Group.o
new file mode 100644 (file)
index 0000000..1587bb2
Binary files /dev/null and b/wrt/node_modules/uws/build/Release/obj.target/uws/src/Group.o differ
diff --git a/wrt/node_modules/uws/build/Release/obj.target/uws/src/HTTPSocket.o b/wrt/node_modules/uws/build/Release/obj.target/uws/src/HTTPSocket.o
new file mode 100644 (file)
index 0000000..7828e28
Binary files /dev/null and b/wrt/node_modules/uws/build/Release/obj.target/uws/src/HTTPSocket.o differ
diff --git a/wrt/node_modules/uws/build/Release/obj.target/uws/src/Hub.o b/wrt/node_modules/uws/build/Release/obj.target/uws/src/Hub.o
new file mode 100644 (file)
index 0000000..563cb78
Binary files /dev/null and b/wrt/node_modules/uws/build/Release/obj.target/uws/src/Hub.o differ
diff --git a/wrt/node_modules/uws/build/Release/obj.target/uws/src/Networking.o b/wrt/node_modules/uws/build/Release/obj.target/uws/src/Networking.o
new file mode 100644 (file)
index 0000000..9fbb7a8
Binary files /dev/null and b/wrt/node_modules/uws/build/Release/obj.target/uws/src/Networking.o differ
diff --git a/wrt/node_modules/uws/build/Release/obj.target/uws/src/Node.o b/wrt/node_modules/uws/build/Release/obj.target/uws/src/Node.o
new file mode 100644 (file)
index 0000000..e6d1f37
Binary files /dev/null and b/wrt/node_modules/uws/build/Release/obj.target/uws/src/Node.o differ
diff --git a/wrt/node_modules/uws/build/Release/obj.target/uws/src/Socket.o b/wrt/node_modules/uws/build/Release/obj.target/uws/src/Socket.o
new file mode 100644 (file)
index 0000000..a338cee
Binary files /dev/null and b/wrt/node_modules/uws/build/Release/obj.target/uws/src/Socket.o differ
diff --git a/wrt/node_modules/uws/build/Release/obj.target/uws/src/WebSocket.o b/wrt/node_modules/uws/build/Release/obj.target/uws/src/WebSocket.o
new file mode 100644 (file)
index 0000000..0af2d29
Binary files /dev/null and b/wrt/node_modules/uws/build/Release/obj.target/uws/src/WebSocket.o differ
diff --git a/wrt/node_modules/uws/build/Release/obj.target/uws/src/addon.o b/wrt/node_modules/uws/build/Release/obj.target/uws/src/addon.o
new file mode 100644 (file)
index 0000000..e401c73
Binary files /dev/null and b/wrt/node_modules/uws/build/Release/obj.target/uws/src/addon.o differ
diff --git a/wrt/node_modules/uws/build/Release/uws.node b/wrt/node_modules/uws/build/Release/uws.node
new file mode 100755 (executable)
index 0000000..60cdd58
Binary files /dev/null and b/wrt/node_modules/uws/build/Release/uws.node differ
diff --git a/wrt/node_modules/uws/build/action_after_build.target.mk b/wrt/node_modules/uws/build/action_after_build.target.mk
new file mode 100644 (file)
index 0000000..a3f98c4
--- /dev/null
@@ -0,0 +1,38 @@
+# This file is generated by gyp; do not edit.
+
+TOOLSET := target
+TARGET := action_after_build
+### Rules for action "move_lib":
+quiet_cmd_binding_gyp_action_after_build_target_move_lib = ACTION binding_gyp_action_after_build_target_move_lib $@
+cmd_binding_gyp_action_after_build_target_move_lib = LD_LIBRARY_PATH=$(builddir)/lib.host:$(builddir)/lib.target:$$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd $(srcdir)/.; cp "$(builddir)/uws.node" uws_linux_51.node
+
+uws: obj := $(abs_obj)
+uws: builddir := $(abs_builddir)
+uws: TOOLSET := $(TOOLSET)
+uws: $(builddir)/uws.node FORCE_DO_CMD
+       $(call do_cmd,binding_gyp_action_after_build_target_move_lib)
+
+all_deps += uws
+action_binding_gyp_action_after_build_target_move_lib_outputs := uws
+
+
+### Rules for final target.
+# Build our special outputs first.
+$(obj).target/action_after_build.stamp: | $(action_binding_gyp_action_after_build_target_move_lib_outputs)
+
+# Preserve order dependency of special output on deps.
+$(action_binding_gyp_action_after_build_target_move_lib_outputs): | $(builddir)/uws.node
+
+$(obj).target/action_after_build.stamp: TOOLSET := $(TOOLSET)
+$(obj).target/action_after_build.stamp: $(builddir)/uws.node FORCE_DO_CMD
+       $(call do_cmd,touch)
+
+all_deps += $(obj).target/action_after_build.stamp
+# Add target alias
+.PHONY: action_after_build
+action_after_build: $(obj).target/action_after_build.stamp
+
+# Add target alias to "all" target.
+.PHONY: all
+all: action_after_build
+
diff --git a/wrt/node_modules/uws/build/binding.Makefile b/wrt/node_modules/uws/build/binding.Makefile
new file mode 100644 (file)
index 0000000..c4da901
--- /dev/null
@@ -0,0 +1,6 @@
+# This file is generated by gyp; do not edit.
+
+export builddir_name ?= ./build/.
+.PHONY: all
+all:
+       $(MAKE) uws action_after_build
diff --git a/wrt/node_modules/uws/build/config.gypi b/wrt/node_modules/uws/build/config.gypi
new file mode 100644 (file)
index 0000000..a19f363
--- /dev/null
@@ -0,0 +1,156 @@
+# Do not edit. File was generated by node-gyp's "configure" step
+{
+  "target_defaults": {
+    "cflags": [],
+    "default_configuration": "Release",
+    "defines": [],
+    "include_dirs": [],
+    "libraries": []
+  },
+  "variables": {
+    "asan": 0,
+    "coverage": "false",
+    "debug_devtools": "node",
+    "force_dynamic_crt": 0,
+    "gas_version": "2.23",
+    "host_arch": "x64",
+    "icu_data_file": "icudt58l.dat",
+    "icu_data_in": "../../deps/icu-small/source/data/in/icudt58l.dat",
+    "icu_endianness": "l",
+    "icu_gyp_path": "tools/icu/icu-generic.gyp",
+    "icu_locales": "en,root",
+    "icu_path": "deps/icu-small",
+    "icu_small": "true",
+    "icu_ver_major": "58",
+    "node_byteorder": "little",
+    "node_enable_d8": "false",
+    "node_enable_v8_vtunejit": "false",
+    "node_install_npm": "true",
+    "node_module_version": 51,
+    "node_no_browser_globals": "false",
+    "node_prefix": "/",
+    "node_release_urlbase": "https://nodejs.org/download/release/",
+    "node_shared": "false",
+    "node_shared_cares": "false",
+    "node_shared_http_parser": "false",
+    "node_shared_libuv": "false",
+    "node_shared_openssl": "false",
+    "node_shared_zlib": "false",
+    "node_tag": "",
+    "node_use_bundled_v8": "true",
+    "node_use_dtrace": "false",
+    "node_use_etw": "false",
+    "node_use_lttng": "false",
+    "node_use_openssl": "true",
+    "node_use_perfctr": "false",
+    "node_use_v8_platform": "true",
+    "openssl_fips": "",
+    "openssl_no_asm": 0,
+    "shlib_suffix": "so.51",
+    "target_arch": "x64",
+    "uv_parent_path": "/deps/uv/",
+    "uv_use_dtrace": "false",
+    "v8_enable_gdbjit": 0,
+    "v8_enable_i18n_support": 1,
+    "v8_inspector": "true",
+    "v8_no_strict_aliasing": 1,
+    "v8_optimized_debug": 0,
+    "v8_random_seed": 0,
+    "v8_use_snapshot": "true",
+    "want_separate_host_toolset": 0,
+    "want_separate_host_toolset_mkpeephole": 0,
+    "nodedir": "/home/kenshin.choi/.node-gyp/7.4.0",
+    "copy_dev_lib": "true",
+    "standalone_static_library": 1,
+    "cache_lock_stale": "60000",
+    "legacy_bundling": "",
+    "sign_git_tag": "",
+    "user_agent": "npm/4.0.5 node/v7.4.0 linux x64",
+    "always_auth": "",
+    "bin_links": "true",
+    "key": "",
+    "description": "true",
+    "fetch_retries": "2",
+    "heading": "npm",
+    "if_present": "",
+    "init_version": "1.0.0",
+    "user": "1001",
+    "force": "",
+    "only": "",
+    "cache_min": "10",
+    "init_license": "ISC",
+    "editor": "vim",
+    "rollback": "true",
+    "tag_version_prefix": "v",
+    "cache_max": "Infinity",
+    "userconfig": "/home/kenshin.choi/.npmrc",
+    "engine_strict": "",
+    "init_author_name": "",
+    "init_author_url": "",
+    "tmp": "/tmp",
+    "depth": "Infinity",
+    "save_dev": "",
+    "usage": "",
+    "progress": "true",
+    "https_proxy": "",
+    "onload_script": "",
+    "rebuild_bundle": "true",
+    "save_bundle": "",
+    "shell": "/bin/bash",
+    "dry_run": "",
+    "prefix": "/usr/local/ys/node-v7.4.0-linux-x64",
+    "scope": "",
+    "browser": "",
+    "cache_lock_wait": "10000",
+    "registry": "https://registry.npmjs.org/",
+    "save_optional": "",
+    "searchopts": "",
+    "versions": "",
+    "cache": "/home/kenshin.choi/.npm",
+    "global_style": "",
+    "ignore_scripts": "",
+    "version": "",
+    "local_address": "",
+    "viewer": "man",
+    "color": "true",
+    "fetch_retry_mintimeout": "10000",
+    "maxsockets": "50",
+    "umask": "0002",
+    "fetch_retry_maxtimeout": "60000",
+    "message": "%s",
+    "ca": "",
+    "cert": "",
+    "global": "",
+    "link": "",
+    "access": "",
+    "also": "",
+    "save": "",
+    "unicode": "true",
+    "long": "",
+    "production": "",
+    "unsafe_perm": "true",
+    "node_version": "7.4.0",
+    "tag": "latest",
+    "git_tag_version": "true",
+    "shrinkwrap": "true",
+    "strict_ssl": "",
+    "fetch_retry_factor": "10",
+    "proprietary_attribs": "true",
+    "save_exact": "",
+    "dev": "",
+    "globalconfig": "/usr/local/ys/node-v7.4.0-linux-x64/etc/npmrc",
+    "init_module": "/home/kenshin.choi/.npm-init.js",
+    "parseable": "",
+    "globalignorefile": "/usr/local/ys/node-v7.4.0-linux-x64/etc/npmignore",
+    "cache_lock_retries": "10",
+    "searchstaleness": "900",
+    "save_prefix": "^",
+    "scripts_prepend_node_path": "warn-only",
+    "group": "1001",
+    "init_author_email": "",
+    "searchexclude": "",
+    "git": "git",
+    "optional": "true",
+    "json": ""
+  }
+}
diff --git a/wrt/node_modules/uws/build/uws.target.mk b/wrt/node_modules/uws/build/uws.target.mk
new file mode 100644 (file)
index 0000000..7df0726
--- /dev/null
@@ -0,0 +1,145 @@
+# This file is generated by gyp; do not edit.
+
+TOOLSET := target
+TARGET := uws
+DEFS_Debug := \
+       '-DNODE_GYP_MODULE_NAME=uws' \
+       '-DUSING_UV_SHARED=1' \
+       '-DUSING_V8_SHARED=1' \
+       '-DV8_DEPRECATION_WARNINGS=1' \
+       '-D_LARGEFILE_SOURCE' \
+       '-D_FILE_OFFSET_BITS=64' \
+       '-DBUILDING_NODE_EXTENSION' \
+       '-DDEBUG' \
+       '-D_DEBUG'
+
+# Flags passed to all source files.
+CFLAGS_Debug := \
+       -fPIC \
+       -pthread \
+       -Wall \
+       -Wextra \
+       -Wno-unused-parameter \
+       -m64 \
+       -g \
+       -O0
+
+# Flags passed to only C files.
+CFLAGS_C_Debug :=
+
+# Flags passed to only C++ files.
+CFLAGS_CC_Debug := \
+       -std=c++11 \
+       -DUSE_LIBUV
+
+INCS_Debug := \
+       -I/home/kenshin.choi/.node-gyp/7.4.0/include/node \
+       -I/home/kenshin.choi/.node-gyp/7.4.0/src \
+       -I/home/kenshin.choi/.node-gyp/7.4.0/deps/uv/include \
+       -I/home/kenshin.choi/.node-gyp/7.4.0/deps/v8/include
+
+DEFS_Release := \
+       '-DNODE_GYP_MODULE_NAME=uws' \
+       '-DUSING_UV_SHARED=1' \
+       '-DUSING_V8_SHARED=1' \
+       '-DV8_DEPRECATION_WARNINGS=1' \
+       '-D_LARGEFILE_SOURCE' \
+       '-D_FILE_OFFSET_BITS=64' \
+       '-DBUILDING_NODE_EXTENSION'
+
+# Flags passed to all source files.
+CFLAGS_Release := \
+       -fPIC \
+       -pthread \
+       -Wall \
+       -Wextra \
+       -Wno-unused-parameter \
+       -m64 \
+       -O3
+
+# Flags passed to only C files.
+CFLAGS_C_Release :=
+
+# Flags passed to only C++ files.
+CFLAGS_CC_Release := \
+       -std=c++11 \
+       -DUSE_LIBUV
+
+INCS_Release := \
+       -I/home/kenshin.choi/.node-gyp/7.4.0/include/node \
+       -I/home/kenshin.choi/.node-gyp/7.4.0/src \
+       -I/home/kenshin.choi/.node-gyp/7.4.0/deps/uv/include \
+       -I/home/kenshin.choi/.node-gyp/7.4.0/deps/v8/include
+
+OBJS := \
+       $(obj).target/$(TARGET)/src/Extensions.o \
+       $(obj).target/$(TARGET)/src/Group.o \
+       $(obj).target/$(TARGET)/src/Networking.o \
+       $(obj).target/$(TARGET)/src/Hub.o \
+       $(obj).target/$(TARGET)/src/Node.o \
+       $(obj).target/$(TARGET)/src/WebSocket.o \
+       $(obj).target/$(TARGET)/src/HTTPSocket.o \
+       $(obj).target/$(TARGET)/src/Socket.o \
+       $(obj).target/$(TARGET)/src/addon.o
+
+# Add to the list of files we specially track dependencies for.
+all_deps += $(OBJS)
+
+# CFLAGS et al overrides must be target-local.
+# See "Target-specific Variable Values" in the GNU Make manual.
+$(OBJS): TOOLSET := $(TOOLSET)
+$(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE))  $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE))
+$(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE))  $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE))
+
+# Suffix rules, putting all outputs into $(obj).
+
+$(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.cpp FORCE_DO_CMD
+       @$(call do_cmd,cxx,1)
+
+# Try building from generated source, too.
+
+$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.cpp FORCE_DO_CMD
+       @$(call do_cmd,cxx,1)
+
+$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.cpp FORCE_DO_CMD
+       @$(call do_cmd,cxx,1)
+
+# End of this set of suffix rules
+### Rules for final target.
+LDFLAGS_Debug := \
+       -pthread \
+       -m64 \
+       -s
+
+LDFLAGS_Release := \
+       -pthread \
+       -m64 \
+       -s
+
+LIBS :=
+
+$(obj).target/uws.node: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))
+$(obj).target/uws.node: LIBS := $(LIBS)
+$(obj).target/uws.node: TOOLSET := $(TOOLSET)
+$(obj).target/uws.node: $(OBJS) FORCE_DO_CMD
+       $(call do_cmd,solink_module)
+
+all_deps += $(obj).target/uws.node
+# Add target alias
+.PHONY: uws
+uws: $(builddir)/uws.node
+
+# Copy this to the executable output path.
+$(builddir)/uws.node: TOOLSET := $(TOOLSET)
+$(builddir)/uws.node: $(obj).target/uws.node FORCE_DO_CMD
+       $(call do_cmd,copy)
+
+all_deps += $(builddir)/uws.node
+# Short alias for building this executable.
+.PHONY: uws.node
+uws.node: $(obj).target/uws.node $(builddir)/uws.node
+
+# Add executable to "all" target.
+.PHONY: all
+all: $(builddir)/uws.node
+
diff --git a/wrt/node_modules/uws/build_log.txt b/wrt/node_modules/uws/build_log.txt
new file mode 100644 (file)
index 0000000..aca7c44
--- /dev/null
@@ -0,0 +1,264 @@
+make: Entering directory '/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/uws/build'
+  CXX(target) Release/obj.target/uws/src/Extensions.o
+  CXX(target) Release/obj.target/uws/src/Group.o
+  CXX(target) Release/obj.target/uws/src/Networking.o
+  CXX(target) Release/obj.target/uws/src/Hub.o
+  CXX(target) Release/obj.target/uws/src/Node.o
+  CXX(target) Release/obj.target/uws/src/WebSocket.o
+  CXX(target) Release/obj.target/uws/src/HTTPSocket.o
+  CXX(target) Release/obj.target/uws/src/Socket.o
+  CXX(target) Release/obj.target/uws/src/addon.o
+In file included from ../src/addon.cpp:3:0:
+../src/http.h: In static member function ‘static void HttpServer::Request::headers(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>&)’:
+../src/http.h:31:156: warning: ‘static v8::Local<v8::String> v8::String::NewFromOneByte(v8::Isolate*, const uint8_t*, v8::String::NewStringType, int)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
+                     args.GetReturnValue().Set(String::NewFromOneByte(args.GetIsolate(), (uint8_t *) header.value, String::kNormalString, header.valueLength));
+                                                                                                                                                            ^
+In file included from /home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:26:0,
+                 from /home/kenshin.choi/.node-gyp/7.4.0/include/node/node.h:42,
+                 from ../src/addon.h:1,
+                 from ../src/addon.cpp:2:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:2317:21: note: declared here
+       Local<String> NewFromOneByte(Isolate* isolate, const uint8_t* data,
+                     ^
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8config.h:329:3: note: in definition of macro ‘V8_DEPRECATED’
+   declarator __attribute__((deprecated(message)))
+   ^
+In file included from ../src/addon.cpp:3:0:
+../src/http.h: In static member function ‘static void HttpServer::Request::method(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>&)’:
+../src/http.h:45:128: warning: ‘static v8::Local<v8::String> v8::String::NewFromOneByte(v8::Isolate*, const uint8_t*, v8::String::NewStringType, int)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
+                 args.GetReturnValue().Set(String::NewFromOneByte(args.GetIsolate(), (uint8_t *) "GET", String::kNormalString, 3));
+                                                                                                                                ^
+In file included from /home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:26:0,
+                 from /home/kenshin.choi/.node-gyp/7.4.0/include/node/node.h:42,
+                 from ../src/addon.h:1,
+                 from ../src/addon.cpp:2:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:2317:21: note: declared here
+       Local<String> NewFromOneByte(Isolate* isolate, const uint8_t* data,
+                     ^
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8config.h:329:3: note: in definition of macro ‘V8_DEPRECATED’
+   declarator __attribute__((deprecated(message)))
+   ^
+In file included from ../src/addon.cpp:3:0:
+../src/http.h:48:128: warning: ‘static v8::Local<v8::String> v8::String::NewFromOneByte(v8::Isolate*, const uint8_t*, v8::String::NewStringType, int)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
+                 args.GetReturnValue().Set(String::NewFromOneByte(args.GetIsolate(), (uint8_t *) "PUT", String::kNormalString, 3));
+                                                                                                                                ^
+In file included from /home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:26:0,
+                 from /home/kenshin.choi/.node-gyp/7.4.0/include/node/node.h:42,
+                 from ../src/addon.h:1,
+                 from ../src/addon.cpp:2:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:2317:21: note: declared here
+       Local<String> NewFromOneByte(Isolate* isolate, const uint8_t* data,
+                     ^
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8config.h:329:3: note: in definition of macro ‘V8_DEPRECATED’
+   declarator __attribute__((deprecated(message)))
+   ^
+In file included from ../src/addon.cpp:3:0:
+../src/http.h:51:129: warning: ‘static v8::Local<v8::String> v8::String::NewFromOneByte(v8::Isolate*, const uint8_t*, v8::String::NewStringType, int)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
+                 args.GetReturnValue().Set(String::NewFromOneByte(args.GetIsolate(), (uint8_t *) "POST", String::kNormalString, 4));
+                                                                                                                                 ^
+In file included from /home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:26:0,
+                 from /home/kenshin.choi/.node-gyp/7.4.0/include/node/node.h:42,
+                 from ../src/addon.h:1,
+                 from ../src/addon.cpp:2:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:2317:21: note: declared here
+       Local<String> NewFromOneByte(Isolate* isolate, const uint8_t* data,
+                     ^
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8config.h:329:3: note: in definition of macro ‘V8_DEPRECATED’
+   declarator __attribute__((deprecated(message)))
+   ^
+In file included from ../src/addon.cpp:3:0:
+../src/http.h:54:129: warning: ‘static v8::Local<v8::String> v8::String::NewFromOneByte(v8::Isolate*, const uint8_t*, v8::String::NewStringType, int)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
+                 args.GetReturnValue().Set(String::NewFromOneByte(args.GetIsolate(), (uint8_t *) "HEAD", String::kNormalString, 4));
+                                                                                                                                 ^
+In file included from /home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:26:0,
+                 from /home/kenshin.choi/.node-gyp/7.4.0/include/node/node.h:42,
+                 from ../src/addon.h:1,
+                 from ../src/addon.cpp:2:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:2317:21: note: declared here
+       Local<String> NewFromOneByte(Isolate* isolate, const uint8_t* data,
+                     ^
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8config.h:329:3: note: in definition of macro ‘V8_DEPRECATED’
+   declarator __attribute__((deprecated(message)))
+   ^
+In file included from ../src/addon.cpp:3:0:
+../src/http.h:57:130: warning: ‘static v8::Local<v8::String> v8::String::NewFromOneByte(v8::Isolate*, const uint8_t*, v8::String::NewStringType, int)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
+                 args.GetReturnValue().Set(String::NewFromOneByte(args.GetIsolate(), (uint8_t *) "PATCH", String::kNormalString, 5));
+                                                                                                                                  ^
+In file included from /home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:26:0,
+                 from /home/kenshin.choi/.node-gyp/7.4.0/include/node/node.h:42,
+                 from ../src/addon.h:1,
+                 from ../src/addon.cpp:2:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:2317:21: note: declared here
+       Local<String> NewFromOneByte(Isolate* isolate, const uint8_t* data,
+                     ^
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8config.h:329:3: note: in definition of macro ‘V8_DEPRECATED’
+   declarator __attribute__((deprecated(message)))
+   ^
+In file included from ../src/addon.cpp:3:0:
+../src/http.h:60:130: warning: ‘static v8::Local<v8::String> v8::String::NewFromOneByte(v8::Isolate*, const uint8_t*, v8::String::NewStringType, int)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
+                 args.GetReturnValue().Set(String::NewFromOneByte(args.GetIsolate(), (uint8_t *) "TRACE", String::kNormalString, 5));
+                                                                                                                                  ^
+In file included from /home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:26:0,
+                 from /home/kenshin.choi/.node-gyp/7.4.0/include/node/node.h:42,
+                 from ../src/addon.h:1,
+                 from ../src/addon.cpp:2:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:2317:21: note: declared here
+       Local<String> NewFromOneByte(Isolate* isolate, const uint8_t* data,
+                     ^
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8config.h:329:3: note: in definition of macro ‘V8_DEPRECATED’
+   declarator __attribute__((deprecated(message)))
+   ^
+In file included from ../src/addon.cpp:3:0:
+../src/http.h:63:131: warning: ‘static v8::Local<v8::String> v8::String::NewFromOneByte(v8::Isolate*, const uint8_t*, v8::String::NewStringType, int)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
+                 args.GetReturnValue().Set(String::NewFromOneByte(args.GetIsolate(), (uint8_t *) "DELETE", String::kNormalString, 6));
+                                                                                                                                   ^
+In file included from /home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:26:0,
+                 from /home/kenshin.choi/.node-gyp/7.4.0/include/node/node.h:42,
+                 from ../src/addon.h:1,
+                 from ../src/addon.cpp:2:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:2317:21: note: declared here
+       Local<String> NewFromOneByte(Isolate* isolate, const uint8_t* data,
+                     ^
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8config.h:329:3: note: in definition of macro ‘V8_DEPRECATED’
+   declarator __attribute__((deprecated(message)))
+   ^
+In file included from ../src/addon.cpp:3:0:
+../src/http.h:66:132: warning: ‘static v8::Local<v8::String> v8::String::NewFromOneByte(v8::Isolate*, const uint8_t*, v8::String::NewStringType, int)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
+                 args.GetReturnValue().Set(String::NewFromOneByte(args.GetIsolate(), (uint8_t *) "OPTIONS", String::kNormalString, 7));
+                                                                                                                                    ^
+In file included from /home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:26:0,
+                 from /home/kenshin.choi/.node-gyp/7.4.0/include/node/node.h:42,
+                 from ../src/addon.h:1,
+                 from ../src/addon.cpp:2:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:2317:21: note: declared here
+       Local<String> NewFromOneByte(Isolate* isolate, const uint8_t* data,
+                     ^
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8config.h:329:3: note: in definition of macro ‘V8_DEPRECATED’
+   declarator __attribute__((deprecated(message)))
+   ^
+In file included from ../src/addon.cpp:3:0:
+../src/http.h:69:132: warning: ‘static v8::Local<v8::String> v8::String::NewFromOneByte(v8::Isolate*, const uint8_t*, v8::String::NewStringType, int)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
+                 args.GetReturnValue().Set(String::NewFromOneByte(args.GetIsolate(), (uint8_t *) "CONNECT", String::kNormalString, 7));
+                                                                                                                                    ^
+In file included from /home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:26:0,
+                 from /home/kenshin.choi/.node-gyp/7.4.0/include/node/node.h:42,
+                 from ../src/addon.h:1,
+                 from ../src/addon.cpp:2:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:2317:21: note: declared here
+       Local<String> NewFromOneByte(Isolate* isolate, const uint8_t* data,
+                     ^
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8config.h:329:3: note: in definition of macro ‘V8_DEPRECATED’
+   declarator __attribute__((deprecated(message)))
+   ^
+In file included from ../src/addon.cpp:3:0:
+../src/http.h: In static member function ‘static v8::Local<v8::Object> HttpServer::Request::getTemplateObject(v8::Isolate*)’:
+../src/http.h:99:89: warning: ‘v8::Local<v8::Object> v8::Function::NewInstance() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
+             Local<Object> reqObjectLocal = reqTemplateLocal->GetFunction()->NewInstance();
+                                                                                         ^
+In file included from /home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:26:0,
+                 from /home/kenshin.choi/.node-gyp/7.4.0/include/node/node.h:42,
+                 from ../src/addon.h:1,
+                 from ../src/addon.cpp:2:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:3292:52: note: declared here
+   V8_DEPRECATED("Use maybe version", Local<Object> NewInstance() const);
+                                                    ^
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8config.h:329:3: note: in definition of macro ‘V8_DEPRECATED’
+   declarator __attribute__((deprecated(message)))
+   ^
+In file included from ../src/addon.cpp:3:0:
+../src/http.h: In static member function ‘static void HttpServer::Response::writeHead(const v8::FunctionCallbackInfo<v8::Value>&)’:
+../src/http.h:149:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
+                     for (int i = 0; i < headers->Length(); i++) {
+                                       ^
+../src/http.h: In static member function ‘static v8::Local<v8::Object> HttpServer::Response::getTemplateObject(v8::Isolate*)’:
+../src/http.h:196:65: warning: ‘v8::Local<v8::Object> v8::Function::NewInstance() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
+             return resTemplateLocal->GetFunction()->NewInstance();
+                                                                 ^
+In file included from /home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:26:0,
+                 from /home/kenshin.choi/.node-gyp/7.4.0/include/node/node.h:42,
+                 from ../src/addon.h:1,
+                 from ../src/addon.cpp:2:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:3292:52: note: declared here
+   V8_DEPRECATED("Use maybe version", Local<Object> NewInstance() const);
+                                                    ^
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8config.h:329:3: note: in definition of macro ‘V8_DEPRECATED’
+   declarator __attribute__((deprecated(message)))
+   ^
+In file included from ../src/addon.cpp:3:0:
+../src/http.h: In lambda function:
+../src/http.h:227:155: warning: ‘static v8::Local<v8::String> v8::String::NewFromOneByte(v8::Isolate*, const uint8_t*, v8::String::NewStringType, int)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
+             reqObject->SetInternalField(4, String::NewFromOneByte(isolate, (uint8_t *) req.getUrl().value, String::kNormalString, req.getUrl().valueLength));
+                                                                                                                                                           ^
+In file included from /home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:26:0,
+                 from /home/kenshin.choi/.node-gyp/7.4.0/include/node/node.h:42,
+                 from ../src/addon.h:1,
+                 from ../src/addon.cpp:2:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:2317:21: note: declared here
+       Local<String> NewFromOneByte(Isolate* isolate, const uint8_t* data,
+                     ^
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8config.h:329:3: note: in definition of macro ‘V8_DEPRECATED’
+   declarator __attribute__((deprecated(message)))
+   ^
+In file included from ../src/addon.cpp:3:0:
+../src/http.h: In static member function ‘static void HttpServer::createServer(const v8::FunctionCallbackInfo<v8::Value>&)’:
+../src/http.h:293:122: warning: ‘v8::Local<v8::Object> v8::Function::NewInstance() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
+             args.GetReturnValue().Set(newInstance = Local<Function>::New(args.GetIsolate(), httpPersistent)->NewInstance());
+                                                                                                                          ^
+In file included from /home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:26:0,
+                 from /home/kenshin.choi/.node-gyp/7.4.0/include/node/node.h:42,
+                 from ../src/addon.h:1,
+                 from ../src/addon.cpp:2:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:3292:52: note: declared here
+   V8_DEPRECATED("Use maybe version", Local<Object> NewInstance() const);
+                                                    ^
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8config.h:329:3: note: in definition of macro ‘V8_DEPRECATED’
+   declarator __attribute__((deprecated(message)))
+   ^
+In file included from ../src/addon.cpp:3:0:
+../src/http.h: In static member function ‘static void HttpServer::getExpressApp(const v8::FunctionCallbackInfo<v8::Value>&)’:
+../src/http.h:320:159: warning: ‘bool v8::Object::SetPrototype(v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
+             express->Get(String::NewFromUtf8(isolate, "request"))->ToObject()->SetPrototype(Local<Object>::New(args.GetIsolate(), reqTemplate)->GetPrototype());
+                                                                                                                                                               ^
+In file included from /home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:26:0,
+                 from /home/kenshin.choi/.node-gyp/7.4.0/include/node/node.h:42,
+                 from ../src/addon.h:1,
+                 from ../src/addon.cpp:2:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:2835:43: note: declared here
+   V8_DEPRECATED("Use maybe version", bool SetPrototype(Local<Value> prototype));
+                                           ^
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8config.h:329:3: note: in definition of macro ‘V8_DEPRECATED’
+   declarator __attribute__((deprecated(message)))
+   ^
+In file included from ../src/addon.cpp:3:0:
+../src/http.h:321:160: warning: ‘bool v8::Object::SetPrototype(v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
+             express->Get(String::NewFromUtf8(isolate, "response"))->ToObject()->SetPrototype(Local<Object>::New(args.GetIsolate(), resTemplate)->GetPrototype());
+                                                                                                                                                                ^
+In file included from /home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:26:0,
+                 from /home/kenshin.choi/.node-gyp/7.4.0/include/node/node.h:42,
+                 from ../src/addon.h:1,
+                 from ../src/addon.cpp:2:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:2835:43: note: declared here
+   V8_DEPRECATED("Use maybe version", bool SetPrototype(Local<Value> prototype));
+                                           ^
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8config.h:329:3: note: in definition of macro ‘V8_DEPRECATED’
+   declarator __attribute__((deprecated(message)))
+   ^
+In file included from ../src/addon.cpp:3:0:
+../src/http.h:327:60: warning: ‘v8::Local<v8::Object> v8::Function::NewInstance() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
+             args.GetReturnValue().Set(express->NewInstance());
+                                                            ^
+In file included from /home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:26:0,
+                 from /home/kenshin.choi/.node-gyp/7.4.0/include/node/node.h:42,
+                 from ../src/addon.h:1,
+                 from ../src/addon.cpp:2:
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8.h:3292:52: note: declared here
+   V8_DEPRECATED("Use maybe version", Local<Object> NewInstance() const);
+                                                    ^
+/home/kenshin.choi/.node-gyp/7.4.0/include/node/v8config.h:329:3: note: in definition of macro ‘V8_DEPRECATED’
+   declarator __attribute__((deprecated(message)))
+   ^
+  SOLINK_MODULE(target) Release/obj.target/uws.node
+  COPY Release/uws.node
+  ACTION binding_gyp_action_after_build_target_move_lib uws
+  TOUCH Release/obj.target/action_after_build.stamp
+make: Leaving directory '/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/uws/build'
diff --git a/wrt/node_modules/uws/package.json b/wrt/node_modules/uws/package.json
new file mode 100644 (file)
index 0000000..39de404
--- /dev/null
@@ -0,0 +1,91 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "uws@~0.14.4",
+        "scope": null,
+        "escapedName": "uws",
+        "name": "uws",
+        "rawSpec": "~0.14.4",
+        "spec": ">=0.14.4 <0.15.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io"
+    ]
+  ],
+  "_from": "uws@>=0.14.4 <0.15.0",
+  "_id": "uws@0.14.5",
+  "_inCache": true,
+  "_location": "/uws",
+  "_nodeVersion": "5.11.0",
+  "_npmOperationalInternal": {
+    "host": "packages-18-east.internal.npmjs.com",
+    "tmp": "tmp/uws-0.14.5.tgz_1493399064525_0.939868062036112"
+  },
+  "_npmUser": {
+    "name": "alexhultman",
+    "email": "alexhultman@gmail.com"
+  },
+  "_npmVersion": "3.8.6",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "uws@~0.14.4",
+    "scope": null,
+    "escapedName": "uws",
+    "name": "uws",
+    "rawSpec": "~0.14.4",
+    "spec": ">=0.14.4 <0.15.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/engine.io"
+  ],
+  "_resolved": "https://registry.npmjs.org/uws/-/uws-0.14.5.tgz",
+  "_shasum": "67aaf33c46b2a587a5f6666d00f7691328f149dc",
+  "_shrinkwrap": null,
+  "_spec": "uws@~0.14.4",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io",
+  "author": {
+    "name": "Alex Hultman",
+    "email": "alexhultman@gmail.com",
+    "url": "https://github.com/alexhultman"
+  },
+  "bugs": {
+    "url": "https://github.com/uWebSockets/uWebSockets/issues"
+  },
+  "dependencies": {},
+  "description": "Tiny WebSockets",
+  "devDependencies": {},
+  "directories": {},
+  "dist": {
+    "shasum": "67aaf33c46b2a587a5f6666d00f7691328f149dc",
+    "tarball": "https://registry.npmjs.org/uws/-/uws-0.14.5.tgz"
+  },
+  "engines": {
+    "node": ">=4"
+  },
+  "homepage": "https://github.com/uWebSockets/uWebSockets",
+  "keywords": [
+    "tiny",
+    "websockets"
+  ],
+  "license": "Zlib",
+  "main": "uws.js",
+  "maintainers": [
+    {
+      "name": "alexhultman",
+      "email": "alexhultman@gmail.com"
+    }
+  ],
+  "name": "uws",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/uWebSockets/uWebSockets.git"
+  },
+  "scripts": {
+    "install": "node-gyp rebuild > build_log.txt 2>&1 || exit 0"
+  },
+  "version": "0.14.5"
+}
diff --git a/wrt/node_modules/uws/src/Asio.h b/wrt/node_modules/uws/src/Asio.h
new file mode 100644 (file)
index 0000000..2792c29
--- /dev/null
@@ -0,0 +1,184 @@
+#ifndef ASIO_H
+#define ASIO_H
+
+#include <boost/asio.hpp>
+
+typedef boost::asio::ip::tcp::socket::native_type uv_os_sock_t;
+static const int UV_READABLE = 1;
+static const int UV_WRITABLE = 2;
+
+struct Loop : boost::asio::io_service {
+
+    static Loop *createLoop(bool defaultLoop = true) {
+        return new Loop;
+    }
+
+    void destroy() {
+        delete this;
+    }
+
+    void run() {
+        boost::asio::io_service::run();
+    }
+};
+
+struct Timer {
+    boost::asio::deadline_timer asio_timer;
+    void *data;
+
+    Timer(Loop *loop) : asio_timer(*loop) {
+
+    }
+
+    void start(void (*cb)(Timer *), int first, int repeat) {
+        asio_timer.expires_from_now(boost::posix_time::milliseconds(first));
+        asio_timer.async_wait([this, cb, repeat](const boost::system::error_code &ec) {
+            if (ec != boost::asio::error::operation_aborted) {
+                if (repeat) {
+                    start(cb, repeat, repeat);
+                }
+                cb(this);
+            }
+        });
+    }
+
+    void setData(void *data) {
+        this->data = data;
+    }
+
+    void *getData() {
+        return data;
+    }
+
+    // bug: cancel does not cancel expired timers!
+    // it has to guarantee that the timer is not called after
+    // stop is called! ffs boost!
+    void stop() {
+        asio_timer.cancel();
+    }
+
+    void close() {
+        asio_timer.get_io_service().post([this]() {
+            delete this;
+        });
+    }
+};
+
+struct Async {
+    Loop *loop;
+    void (*cb)(Async *);
+    void *data;
+
+    boost::asio::io_service::work asio_work;
+
+    Async(Loop *loop) : loop(loop), asio_work(*loop) {
+    }
+
+    void start(void (*cb)(Async *)) {
+        this->cb = cb;
+    }
+
+    void send() {
+        loop->post([this]() {
+            cb(this);
+        });
+    }
+
+    void close() {
+        loop->post([this]() {
+            delete this;
+        });
+    }
+
+    void setData(void *data) {
+        this->data = data;
+    }
+
+    void *getData() {
+        return data;
+    }
+};
+
+struct Poll {
+    boost::asio::posix::stream_descriptor *socket;
+    void (*cb)(Poll *p, int status, int events);
+
+    Poll(Loop *loop, uv_os_sock_t fd) {
+        socket = new boost::asio::posix::stream_descriptor(*loop, fd);
+        socket->non_blocking(true);
+    }
+
+    bool isClosed() {
+        return !socket;
+    }
+
+    boost::asio::ip::tcp::socket::native_type getFd() {
+        return socket ? socket->native_handle() : -1;
+    }
+
+    void setCb(void (*cb)(Poll *p, int status, int events)) {
+        this->cb = cb;
+    }
+
+    void (*getCb())(Poll *, int, int) {
+        return cb;
+    }
+
+    void reInit(Loop *loop, uv_os_sock_t fd) {
+        delete socket;
+        socket = new boost::asio::posix::stream_descriptor(*loop, fd);
+        socket->non_blocking(true);
+    }
+
+    void start(Loop *, Poll *self, int events) {
+        if (events & UV_READABLE) {
+            socket->async_read_some(boost::asio::null_buffers(), [self](boost::system::error_code ec, std::size_t) {
+                if (ec != boost::asio::error::operation_aborted) {
+                    self->start(nullptr, self, UV_READABLE);
+                    self->cb(self, ec ? -1 : 0, UV_READABLE);
+                }
+            });
+        }
+
+        if (events & UV_WRITABLE) {
+            socket->async_write_some(boost::asio::null_buffers(), [self](boost::system::error_code ec, std::size_t) {
+                if (ec != boost::asio::error::operation_aborted) {
+                    self->start(nullptr, self, UV_WRITABLE);
+                    self->cb(self, ec ? -1 : 0, UV_WRITABLE);
+                }
+            });
+        }
+    }
+
+    void change(Loop *, Poll *self, int events) {
+        socket->cancel();
+        start(nullptr, self, events);
+    }
+
+    bool fastTransfer(Loop *loop, Loop *newLoop, int events) {
+        return false;
+    }
+
+    // todo: asio is thread safe, use it!
+    bool threadSafeChange(Loop *loop, Poll *self, int events) {
+        return false;
+    }
+
+    void stop(Loop *) {
+        socket->cancel();
+    }
+
+    // this is not correct, but it works for now
+    // think about transfer - should allow one to not delete
+    // but in this case it doesn't matter at all
+    void close(Loop *loop, void (*cb)(Poll *)) {
+        socket->release();
+        socket->get_io_service().post([cb, this]() {
+            cb(this);
+        });
+        delete socket;
+        socket = nullptr;
+    }
+};
+
+#endif // ASIO_H
diff --git a/wrt/node_modules/uws/src/Backend.h b/wrt/node_modules/uws/src/Backend.h
new file mode 100644 (file)
index 0000000..4bfed95
--- /dev/null
@@ -0,0 +1,15 @@
+#ifndef BACKEND_H
+#define BACKEND_H
+
+// Default to Epoll if nothing specified and on Linux
+// Default to Libuv if nothing specified and not on Linux
+#ifdef USE_ASIO
+#include "Asio.h"
+#elif !defined(__linux__) || defined(USE_LIBUV)
+#include "Libuv.h"
+#else
+#define USE_EPOLL
+#include "Epoll.h"
+#endif
+
+#endif // BACKEND_H
diff --git a/wrt/node_modules/uws/src/Epoll.cpp b/wrt/node_modules/uws/src/Epoll.cpp
new file mode 100644 (file)
index 0000000..f78d2ba
--- /dev/null
@@ -0,0 +1,60 @@
+#include "Backend.h"
+
+#ifdef USE_EPOLL
+
+// todo: remove this mutex, have callbacks set at program start
+std::recursive_mutex cbMutex;
+void (*callbacks[16])(Poll *, int, int);
+int cbHead = 0;
+
+void Loop::run() {
+    timepoint = std::chrono::system_clock::now();
+    while (numPolls) {
+        for (std::pair<Poll *, void (*)(Poll *)> c : closing) {
+            numPolls--;
+
+            c.second(c.first);
+
+            if (!numPolls) {
+                closing.clear();
+                return;
+            }
+        }
+        closing.clear();
+
+        int numFdReady = epoll_wait(epfd, readyEvents, 1024, delay);
+        timepoint = std::chrono::system_clock::now();
+
+        if (preCb) {
+            preCb(preCbData);
+        }
+
+        for (int i = 0; i < numFdReady; i++) {
+            Poll *poll = (Poll *) readyEvents[i].data.ptr;
+            int status = -bool(readyEvents[i].events & EPOLLERR);
+            callbacks[poll->state.cbIndex](poll, status, readyEvents[i].events);
+        }
+
+        while (timers.size() && timers[0].timepoint < timepoint) {
+            Timer *timer = timers[0].timer;
+            cancelledLastTimer = false;
+            timers[0].cb(timers[0].timer);
+
+            if (cancelledLastTimer) {
+                continue;
+            }
+
+            int repeat = timers[0].nextDelay;
+            auto cb = timers[0].cb;
+            timers.erase(timers.begin());
+            if (repeat) {
+                timer->start(cb, repeat, repeat);
+            }
+        }
+
+        if (postCb) {
+            postCb(postCbData);
+        }
+    }
+}
+#endif
diff --git a/wrt/node_modules/uws/src/Epoll.h b/wrt/node_modules/uws/src/Epoll.h
new file mode 100644 (file)
index 0000000..949791f
--- /dev/null
@@ -0,0 +1,257 @@
+#ifndef EPOLL_H
+#define EPOLL_H
+
+#include <sys/epoll.h>
+#include <sys/eventfd.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <chrono>
+#include <algorithm>
+#include <vector>
+#include <mutex>
+
+typedef int uv_os_sock_t;
+static const int UV_READABLE = EPOLLIN;
+static const int UV_WRITABLE = EPOLLOUT;
+
+struct Poll;
+struct Timer;
+
+extern std::recursive_mutex cbMutex;
+extern void (*callbacks[16])(Poll *, int, int);
+extern int cbHead;
+
+struct Timepoint {
+    void (*cb)(Timer *);
+    Timer *timer;
+    std::chrono::system_clock::time_point timepoint;
+    int nextDelay;
+};
+
+struct Loop {
+    int epfd;
+    int numPolls = 0;
+    bool cancelledLastTimer;
+    int delay = -1;
+    epoll_event readyEvents[1024];
+    std::chrono::system_clock::time_point timepoint;
+    std::vector<Timepoint> timers;
+    std::vector<std::pair<Poll *, void (*)(Poll *)>> closing;
+
+    void (*preCb)(void *) = nullptr;
+    void (*postCb)(void *) = nullptr;
+    void *preCbData, *postCbData;
+
+    Loop(bool defaultLoop) {
+        epfd = epoll_create1(EPOLL_CLOEXEC);
+        timepoint = std::chrono::system_clock::now();
+    }
+
+    static Loop *createLoop(bool defaultLoop = true) {
+        return new Loop(defaultLoop);
+    }
+
+    void destroy() {
+        ::close(epfd);
+        delete this;
+    }
+
+    void run();
+
+    int getEpollFd() {
+        return epfd;
+    }
+};
+
+struct Timer {
+    Loop *loop;
+    void *data;
+
+    Timer(Loop *loop) {
+        this->loop = loop;
+    }
+
+    void start(void (*cb)(Timer *), int timeout, int repeat) {
+        loop->timepoint = std::chrono::system_clock::now();
+        std::chrono::system_clock::time_point timepoint = loop->timepoint + std::chrono::milliseconds(timeout);
+
+        Timepoint t = {cb, this, timepoint, repeat};
+        loop->timers.insert(
+            std::upper_bound(loop->timers.begin(), loop->timers.end(), t, [](const Timepoint &a, const Timepoint &b) {
+                return a.timepoint < b.timepoint;
+            }),
+            t
+        );
+
+        loop->delay = -1;
+        if (loop->timers.size()) {
+            loop->delay = std::max<int>(std::chrono::duration_cast<std::chrono::milliseconds>(loop->timers[0].timepoint - loop->timepoint).count(), 0);
+        }
+    }
+
+    void setData(void *data) {
+        this->data = data;
+    }
+
+    void *getData() {
+        return data;
+    }
+
+    // always called before destructor
+    void stop() {
+        auto pos = loop->timers.begin();
+        for (Timepoint &t : loop->timers) {
+            if (t.timer == this) {
+                loop->timers.erase(pos);
+                break;
+            }
+            pos++;
+        }
+        loop->cancelledLastTimer = true;
+
+        loop->delay = -1;
+        if (loop->timers.size()) {
+            loop->delay = std::max<int>(std::chrono::duration_cast<std::chrono::milliseconds>(loop->timers[0].timepoint - loop->timepoint).count(), 0);
+        }
+    }
+
+    void close() {
+        delete this;
+    }
+};
+
+// 4 bytes
+struct Poll {
+protected:
+    struct {
+        int fd : 28;
+        unsigned int cbIndex : 4;
+    } state = {-1, 0};
+
+    Poll(Loop *loop, uv_os_sock_t fd) {
+        fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK);
+        state.fd = fd;
+        loop->numPolls++;
+    }
+
+    // todo: pre-set all of callbacks up front and remove mutex
+    void setCb(void (*cb)(Poll *p, int status, int events)) {
+        cbMutex.lock();
+        state.cbIndex = cbHead;
+        for (int i = 0; i < cbHead; i++) {
+            if (callbacks[i] == cb) {
+                state.cbIndex = i;
+                break;
+            }
+        }
+        if (state.cbIndex == cbHead) {
+            callbacks[cbHead++] = cb;
+        }
+        cbMutex.unlock();
+    }
+
+    void (*getCb())(Poll *, int, int) {
+        return callbacks[state.cbIndex];
+    }
+
+    void reInit(Loop *loop, uv_os_sock_t fd) {
+        state.fd = fd;
+        loop->numPolls++;
+    }
+
+    void start(Loop *loop, Poll *self, int events) {
+        epoll_event event;
+        event.events = events;
+        event.data.ptr = self;
+        epoll_ctl(loop->epfd, EPOLL_CTL_ADD, state.fd, &event);
+    }
+
+    void change(Loop *loop, Poll *self, int events) {
+        epoll_event event;
+        event.events = events;
+        event.data.ptr = self;
+        epoll_ctl(loop->epfd, EPOLL_CTL_MOD, state.fd, &event);
+    }
+
+    void stop(Loop *loop) {
+        epoll_event event;
+        epoll_ctl(loop->epfd, EPOLL_CTL_DEL, state.fd, &event);
+    }
+
+    bool fastTransfer(Loop *loop, Loop *newLoop, int events) {
+        stop(loop);
+        start(newLoop, this, events);
+        loop->numPolls--;
+        // needs to lock the newLoop's numPolls!
+        newLoop->numPolls++;
+        return true;
+    }
+
+    bool threadSafeChange(Loop *loop, Poll *self, int events) {
+        change(loop, self, events);
+        return true;
+    }
+
+    void close(Loop *loop, void (*cb)(Poll *)) {
+        state.fd = -1;
+        loop->closing.push_back({this, cb});
+    }
+
+public:
+    bool isClosed() {
+        return state.fd == -1;
+    }
+
+    uv_os_sock_t getFd() {
+        return state.fd;
+    }
+
+    friend struct Loop;
+};
+
+// this should be put in the Loop as a general "post" function always available
+struct Async : Poll {
+    void (*cb)(Async *);
+    Loop *loop;
+    void *data;
+
+    Async(Loop *loop) : Poll(loop, ::eventfd(0, EFD_CLOEXEC)) {
+        this->loop = loop;
+    }
+
+    void start(void (*cb)(Async *)) {
+        this->cb = cb;
+        Poll::setCb([](Poll *p, int, int) {
+            uint64_t val;
+            if (::read(((Async *) p)->state.fd, &val, 8) == 8) {
+                ((Async *) p)->cb((Async *) p);
+            }
+        });
+        Poll::start(loop, this, UV_READABLE);
+    }
+
+    void send() {
+        uint64_t one = 1;
+        if (::write(state.fd, &one, 8) != 8) {
+            return;
+        }
+    }
+
+    void close() {
+        Poll::stop(loop);
+        ::close(state.fd);
+        Poll::close(loop, [](Poll *p) {
+            delete p;
+        });
+    }
+
+    void setData(void *data) {
+        this->data = data;
+    }
+
+    void *getData() {
+        return data;
+    }
+};
+
+#endif // EPOLL_H
diff --git a/wrt/node_modules/uws/src/Extensions.cpp b/wrt/node_modules/uws/src/Extensions.cpp
new file mode 100644 (file)
index 0000000..ef8f9da
--- /dev/null
@@ -0,0 +1,131 @@
+#include "Extensions.h"
+
+namespace uWS {
+
+enum ExtensionTokens {
+    TOK_PERMESSAGE_DEFLATE = 1838,
+    TOK_SERVER_NO_CONTEXT_TAKEOVER = 2807,
+    TOK_CLIENT_NO_CONTEXT_TAKEOVER = 2783,
+    TOK_SERVER_MAX_WINDOW_BITS = 2372,
+    TOK_CLIENT_MAX_WINDOW_BITS = 2348
+};
+
+class ExtensionsParser {
+private:
+    int *lastInteger = nullptr;
+
+public:
+    bool perMessageDeflate = false;
+    bool serverNoContextTakeover = false;
+    bool clientNoContextTakeover = false;
+    int serverMaxWindowBits = 0;
+    int clientMaxWindowBits = 0;
+
+    int getToken(const char *&in, const char *stop);
+    ExtensionsParser(const char *data, size_t length);
+};
+
+int ExtensionsParser::getToken(const char *&in, const char *stop) {
+    while (!isalnum(*in) && in != stop) {
+        in++;
+    }
+
+    int hashedToken = 0;
+    while (isalnum(*in) || *in == '-' || *in == '_') {
+        if (isdigit(*in)) {
+            hashedToken = hashedToken * 10 - (*in - '0');
+        } else {
+            hashedToken += *in;
+        }
+        in++;
+    }
+    return hashedToken;
+}
+
+ExtensionsParser::ExtensionsParser(const char *data, size_t length) {
+    const char *stop = data + length;
+    int token = 1;
+    for (; token && token != TOK_PERMESSAGE_DEFLATE; token = getToken(data, stop));
+
+    perMessageDeflate = (token == TOK_PERMESSAGE_DEFLATE);
+    while ((token = getToken(data, stop))) {
+        switch (token) {
+        case TOK_PERMESSAGE_DEFLATE:
+            return;
+        case TOK_SERVER_NO_CONTEXT_TAKEOVER:
+            serverNoContextTakeover = true;
+            break;
+        case TOK_CLIENT_NO_CONTEXT_TAKEOVER:
+            clientNoContextTakeover = true;
+            break;
+        case TOK_SERVER_MAX_WINDOW_BITS:
+            serverMaxWindowBits = 1;
+            lastInteger = &serverMaxWindowBits;
+            break;
+        case TOK_CLIENT_MAX_WINDOW_BITS:
+            clientMaxWindowBits = 1;
+            lastInteger = &clientMaxWindowBits;
+            break;
+        default:
+            if (token < 0 && lastInteger) {
+                *lastInteger = -token;
+            }
+            break;
+        }
+    }
+}
+
+template <bool isServer>
+ExtensionsNegotiator<isServer>::ExtensionsNegotiator(int wantedOptions) {
+    options = wantedOptions;
+}
+
+template <bool isServer>
+std::string ExtensionsNegotiator<isServer>::generateOffer() {
+    std::string extensionsOffer;
+    if (options & Options::PERMESSAGE_DEFLATE) {
+        extensionsOffer += "permessage-deflate";
+
+        if (options & Options::CLIENT_NO_CONTEXT_TAKEOVER) {
+            extensionsOffer += "; client_no_context_takeover";
+        }
+
+        if (options & Options::SERVER_NO_CONTEXT_TAKEOVER) {
+            extensionsOffer += "; server_no_context_takeover";
+        }
+    }
+
+    return extensionsOffer;
+}
+
+template <bool isServer>
+void ExtensionsNegotiator<isServer>::readOffer(std::string offer) {
+    if (isServer) {
+        ExtensionsParser extensionsParser(offer.data(), offer.length());
+        if ((options & PERMESSAGE_DEFLATE) && extensionsParser.perMessageDeflate) {
+            if (extensionsParser.clientNoContextTakeover || (options & CLIENT_NO_CONTEXT_TAKEOVER)) {
+                options |= CLIENT_NO_CONTEXT_TAKEOVER;
+            }
+
+            if (extensionsParser.serverNoContextTakeover) {
+                options |= SERVER_NO_CONTEXT_TAKEOVER;
+            } else {
+                options &= ~SERVER_NO_CONTEXT_TAKEOVER;
+            }
+        } else {
+            options &= ~PERMESSAGE_DEFLATE;
+        }
+    } else {
+        // todo!
+    }
+}
+
+template <bool isServer>
+int ExtensionsNegotiator<isServer>::getNegotiatedOptions() {
+    return options;
+}
+
+template class ExtensionsNegotiator<true>;
+template class ExtensionsNegotiator<false>;
+
+}
diff --git a/wrt/node_modules/uws/src/Extensions.h b/wrt/node_modules/uws/src/Extensions.h
new file mode 100644 (file)
index 0000000..763b4d2
--- /dev/null
@@ -0,0 +1,29 @@
+#ifndef EXTENSIONS_UWS_H
+#define EXTENSIONS_UWS_H
+
+#include <string>
+
+namespace uWS {
+
+enum Options : unsigned int {
+    NO_OPTIONS = 0,
+    PERMESSAGE_DEFLATE = 1,
+    SERVER_NO_CONTEXT_TAKEOVER = 2,
+    CLIENT_NO_CONTEXT_TAKEOVER = 4,
+    NO_DELAY = 8
+};
+
+template <bool isServer>
+class ExtensionsNegotiator {
+private:
+    int options;
+public:
+    ExtensionsNegotiator(int wantedOptions);
+    std::string generateOffer();
+    void readOffer(std::string offer);
+    int getNegotiatedOptions();
+};
+
+}
+
+#endif // EXTENSIONS_UWS_H
diff --git a/wrt/node_modules/uws/src/Group.cpp b/wrt/node_modules/uws/src/Group.cpp
new file mode 100644 (file)
index 0000000..028b1a0
--- /dev/null
@@ -0,0 +1,263 @@
+#include "Group.h"
+#include "Hub.h"
+
+namespace uWS {
+
+template <bool isServer>
+void Group<isServer>::setUserData(void *user) {
+    this->userData = user;
+}
+
+template <bool isServer>
+void *Group<isServer>::getUserData() {
+    return userData;
+}
+
+template <bool isServer>
+void Group<isServer>::timerCallback(Timer *timer) {
+    Group<isServer> *group = (Group<isServer> *) timer->getData();
+
+    group->forEach([](uWS::WebSocket<isServer> *webSocket) {
+        if (webSocket->hasOutstandingPong) {
+            webSocket->terminate();
+        } else {
+            webSocket->hasOutstandingPong = true;
+        }
+    });
+
+    if (group->userPingMessage.length()) {
+        group->broadcast(group->userPingMessage.data(), group->userPingMessage.length(), OpCode::TEXT);
+    } else {
+        group->broadcast(nullptr, 0, OpCode::PING);
+    }
+}
+
+template <bool isServer>
+void Group<isServer>::startAutoPing(int intervalMs, std::string userMessage) {
+    timer = new Timer(loop);
+    timer->setData(this);
+    timer->start(timerCallback, intervalMs, intervalMs);
+    userPingMessage = userMessage;
+}
+
+template <bool isServer>
+void Group<isServer>::addHttpSocket(HttpSocket<isServer> *httpSocket) {
+    if (httpSocketHead) {
+        httpSocketHead->prev = httpSocket;
+        httpSocket->next = httpSocketHead;
+    } else {
+        httpSocket->next = nullptr;
+        // start timer
+        httpTimer = new Timer(hub->getLoop());
+        httpTimer->setData(this);
+        httpTimer->start([](Timer *httpTimer) {
+            Group<isServer> *group = (Group<isServer> *) httpTimer->getData();
+            group->forEachHttpSocket([](HttpSocket<isServer> *httpSocket) {
+                if (httpSocket->missedDeadline) {
+                    httpSocket->terminate();
+                } else if (!httpSocket->outstandingResponsesHead) {
+                    httpSocket->missedDeadline = true;
+                }
+            });
+        }, 1000, 1000);
+    }
+    httpSocketHead = httpSocket;
+    httpSocket->prev = nullptr;
+}
+
+template <bool isServer>
+void Group<isServer>::removeHttpSocket(HttpSocket<isServer> *httpSocket) {
+    if (iterators.size()) {
+        iterators.top() = httpSocket->next;
+    }
+    if (httpSocket->prev == httpSocket->next) {
+        httpSocketHead = nullptr;
+        httpTimer->stop();
+        httpTimer->close();
+    } else {
+        if (httpSocket->prev) {
+            ((HttpSocket<isServer> *) httpSocket->prev)->next = httpSocket->next;
+        } else {
+            httpSocketHead = (HttpSocket<isServer> *) httpSocket->next;
+        }
+        if (httpSocket->next) {
+            ((HttpSocket<isServer> *) httpSocket->next)->prev = httpSocket->prev;
+        }
+    }
+}
+
+template <bool isServer>
+void Group<isServer>::addWebSocket(WebSocket<isServer> *webSocket) {
+    if (webSocketHead) {
+        webSocketHead->prev = webSocket;
+        webSocket->next = webSocketHead;
+    } else {
+        webSocket->next = nullptr;
+    }
+    webSocketHead = webSocket;
+    webSocket->prev = nullptr;
+}
+
+template <bool isServer>
+void Group<isServer>::removeWebSocket(WebSocket<isServer> *webSocket) {
+    if (iterators.size()) {
+        iterators.top() = webSocket->next;
+    }
+    if (webSocket->prev == webSocket->next) {
+        webSocketHead = nullptr;
+    } else {
+        if (webSocket->prev) {
+            ((WebSocket<isServer> *) webSocket->prev)->next = webSocket->next;
+        } else {
+            webSocketHead = (WebSocket<isServer> *) webSocket->next;
+        }
+        if (webSocket->next) {
+            ((WebSocket<isServer> *) webSocket->next)->prev = webSocket->prev;
+        }
+    }
+}
+
+template <bool isServer>
+Group<isServer>::Group(int extensionOptions, unsigned int maxPayload, Hub *hub, uS::NodeData *nodeData) : uS::NodeData(*nodeData), maxPayload(maxPayload), hub(hub), extensionOptions(extensionOptions) {
+    connectionHandler = [](WebSocket<isServer> *, HttpRequest) {};
+    transferHandler = [](WebSocket<isServer> *) {};
+    messageHandler = [](WebSocket<isServer> *, char *, size_t, OpCode) {};
+    disconnectionHandler = [](WebSocket<isServer> *, int, char *, size_t) {};
+    pingHandler = pongHandler = [](WebSocket<isServer> *, char *, size_t) {};
+    errorHandler = [](errorType) {};
+    httpRequestHandler = [](HttpResponse *, HttpRequest, char *, size_t, size_t) {};
+    httpConnectionHandler = [](HttpSocket<isServer> *) {};
+    httpDisconnectionHandler = [](HttpSocket<isServer> *) {};
+    httpCancelledRequestHandler = [](HttpResponse *) {};
+    httpDataHandler = [](HttpResponse *, char *, size_t, size_t) {};
+
+    this->extensionOptions |= CLIENT_NO_CONTEXT_TAKEOVER | SERVER_NO_CONTEXT_TAKEOVER;
+}
+
+template <bool isServer>
+void Group<isServer>::stopListening() {
+    if (isServer) {
+        if (user) {
+            // todo: we should allow one group to listen to many ports!
+            uS::ListenSocket *listenSocket = (uS::ListenSocket *) user;
+
+            if (listenSocket->timer) {
+                listenSocket->timer->stop();
+                listenSocket->timer->close();
+            }
+
+            listenSocket->closeSocket<uS::ListenSocket>();
+
+            // mark as stopped listening (extra care?)
+            user = nullptr;
+        }
+    }
+
+    if (async) {
+        async->close();
+    }
+}
+
+template <bool isServer>
+void Group<isServer>::onConnection(std::function<void (WebSocket<isServer> *, HttpRequest)> handler) {
+    connectionHandler = handler;
+}
+
+template <bool isServer>
+void Group<isServer>::onTransfer(std::function<void (WebSocket<isServer> *)> handler) {
+    transferHandler = handler;
+}
+
+template <bool isServer>
+void Group<isServer>::onMessage(std::function<void (WebSocket<isServer> *, char *, size_t, OpCode)> handler) {
+    messageHandler = handler;
+}
+
+template <bool isServer>
+void Group<isServer>::onDisconnection(std::function<void (WebSocket<isServer> *, int, char *, size_t)> handler) {
+    disconnectionHandler = handler;
+}
+
+template <bool isServer>
+void Group<isServer>::onPing(std::function<void (WebSocket<isServer> *, char *, size_t)> handler) {
+    pingHandler = handler;
+}
+
+template <bool isServer>
+void Group<isServer>::onPong(std::function<void (WebSocket<isServer> *, char *, size_t)> handler) {
+    pongHandler = handler;
+}
+
+template <bool isServer>
+void Group<isServer>::onError(std::function<void (typename Group::errorType)> handler) {
+    errorHandler = handler;
+}
+
+template <bool isServer>
+void Group<isServer>::onHttpConnection(std::function<void (HttpSocket<isServer> *)> handler) {
+    httpConnectionHandler = handler;
+}
+
+template <bool isServer>
+void Group<isServer>::onHttpRequest(std::function<void (HttpResponse *, HttpRequest, char *, size_t, size_t)> handler) {
+    httpRequestHandler = handler;
+}
+
+template <bool isServer>
+void Group<isServer>::onHttpData(std::function<void(HttpResponse *, char *, size_t, size_t)> handler) {
+    httpDataHandler = handler;
+}
+
+template <bool isServer>
+void Group<isServer>::onHttpDisconnection(std::function<void (HttpSocket<isServer> *)> handler) {
+    httpDisconnectionHandler = handler;
+}
+
+template <bool isServer>
+void Group<isServer>::onCancelledHttpRequest(std::function<void (HttpResponse *)> handler) {
+    httpCancelledRequestHandler = handler;
+}
+
+template <bool isServer>
+void Group<isServer>::onHttpUpgrade(std::function<void(HttpSocket<isServer> *, HttpRequest)> handler) {
+    httpUpgradeHandler = handler;
+}
+
+template <bool isServer>
+void Group<isServer>::broadcast(const char *message, size_t length, OpCode opCode) {
+
+#ifdef UWS_THREADSAFE
+    std::lock_guard<std::recursive_mutex> lockGuard(*asyncMutex);
+#endif
+
+    typename WebSocket<isServer>::PreparedMessage *preparedMessage = WebSocket<isServer>::prepareMessage((char *) message, length, opCode, false);
+    forEach([preparedMessage](uWS::WebSocket<isServer> *ws) {
+        ws->sendPrepared(preparedMessage);
+    });
+    WebSocket<isServer>::finalizeMessage(preparedMessage);
+}
+
+template <bool isServer>
+void Group<isServer>::terminate() {
+    forEach([](uWS::WebSocket<isServer> *ws) {
+        ws->terminate();
+    });
+    stopListening();
+}
+
+template <bool isServer>
+void Group<isServer>::close(int code, char *message, size_t length) {
+    forEach([code, message, length](uWS::WebSocket<isServer> *ws) {
+        ws->close(code, message, length);
+    });
+    stopListening();
+    if (timer) {
+        timer->stop();
+        timer->close();
+    }
+}
+
+template struct Group<true>;
+template struct Group<false>;
+
+}
diff --git a/wrt/node_modules/uws/src/Group.h b/wrt/node_modules/uws/src/Group.h
new file mode 100644 (file)
index 0000000..18c8c63
--- /dev/null
@@ -0,0 +1,144 @@
+#ifndef GROUP_UWS_H
+#define GROUP_UWS_H
+
+#include "WebSocket.h"
+#include "HTTPSocket.h"
+#include "Extensions.h"
+#include <functional>
+#include <stack>
+
+namespace uWS {
+
+enum ListenOptions {
+    TRANSFERS
+};
+
+struct Hub;
+
+template <bool isServer>
+struct WIN32_EXPORT Group : private uS::NodeData {
+protected:
+    friend struct Hub;
+    friend struct WebSocket<isServer>;
+    friend struct HttpSocket<false>;
+    friend struct HttpSocket<true>;
+
+    std::function<void(WebSocket<isServer> *, HttpRequest)> connectionHandler;
+    std::function<void(WebSocket<isServer> *)> transferHandler;
+    std::function<void(WebSocket<isServer> *, char *message, size_t length, OpCode opCode)> messageHandler;
+    std::function<void(WebSocket<isServer> *, int code, char *message, size_t length)> disconnectionHandler;
+    std::function<void(WebSocket<isServer> *, char *, size_t)> pingHandler;
+    std::function<void(WebSocket<isServer> *, char *, size_t)> pongHandler;
+    std::function<void(HttpSocket<isServer> *)> httpConnectionHandler;
+    std::function<void(HttpResponse *, HttpRequest, char *, size_t, size_t)> httpRequestHandler;
+    std::function<void(HttpResponse *, char *, size_t, size_t)> httpDataHandler;
+    std::function<void(HttpResponse *)> httpCancelledRequestHandler;
+    std::function<void(HttpSocket<isServer> *)> httpDisconnectionHandler;
+    std::function<void(HttpSocket<isServer> *, HttpRequest)> httpUpgradeHandler;
+
+    using errorType = typename std::conditional<isServer, int, void *>::type;
+    std::function<void(errorType)> errorHandler;
+
+    unsigned int maxPayload;
+    Hub *hub;
+    int extensionOptions;
+    Timer *timer = nullptr, *httpTimer = nullptr;
+    std::string userPingMessage;
+    std::stack<Poll *> iterators;
+
+    // todo: cannot be named user, collides with parent!
+    void *userData = nullptr;
+    static void timerCallback(Timer *timer);
+
+    WebSocket<isServer> *webSocketHead = nullptr;
+    HttpSocket<isServer> *httpSocketHead = nullptr;
+
+    void addWebSocket(WebSocket<isServer> *webSocket);
+    void removeWebSocket(WebSocket<isServer> *webSocket);
+
+    // todo: remove these, template
+    void addHttpSocket(HttpSocket<isServer> *httpSocket);
+    void removeHttpSocket(HttpSocket<isServer> *httpSocket);
+
+    Group(int extensionOptions, unsigned int maxPayload, Hub *hub, uS::NodeData *nodeData);
+    void stopListening();
+
+public:
+    void onConnection(std::function<void(WebSocket<isServer> *, HttpRequest)> handler);
+    void onTransfer(std::function<void(WebSocket<isServer> *)> handler);
+    void onMessage(std::function<void(WebSocket<isServer> *, char *, size_t, OpCode)> handler);
+    void onDisconnection(std::function<void(WebSocket<isServer> *, int code, char *message, size_t length)> handler);
+    void onPing(std::function<void(WebSocket<isServer> *, char *, size_t)> handler);
+    void onPong(std::function<void(WebSocket<isServer> *, char *, size_t)> handler);
+    void onError(std::function<void(errorType)> handler);
+    void onHttpConnection(std::function<void(HttpSocket<isServer> *)> handler);
+    void onHttpRequest(std::function<void(HttpResponse *, HttpRequest, char *data, size_t length, size_t remainingBytes)> handler);
+    void onHttpData(std::function<void(HttpResponse *, char *data, size_t length, size_t remainingBytes)> handler);
+    void onHttpDisconnection(std::function<void(HttpSocket<isServer> *)> handler);
+    void onCancelledHttpRequest(std::function<void(HttpResponse *)> handler);
+    void onHttpUpgrade(std::function<void(HttpSocket<isServer> *, HttpRequest)> handler);
+
+    // Thread safe
+    void broadcast(const char *message, size_t length, OpCode opCode);
+    void setUserData(void *user);
+    void *getUserData();
+
+    // Not thread safe
+    void terminate();
+    void close(int code = 1000, char *message = nullptr, size_t length = 0);
+    void startAutoPing(int intervalMs, std::string userMessage = "");
+
+    // same as listen(TRANSFERS), backwards compatible API for now
+    void addAsync() {
+        if (!async) {
+            NodeData::addAsync();
+        }
+    }
+
+    void listen(ListenOptions listenOptions) {
+        if (listenOptions == TRANSFERS && !async) {
+            addAsync();
+        }
+    }
+
+    template <class F>
+    void forEach(const F &cb) {
+        Poll *iterator = webSocketHead;
+        iterators.push(iterator);
+        while (iterator) {
+            Poll *lastIterator = iterator;
+            cb((WebSocket<isServer> *) iterator);
+            iterator = iterators.top();
+            if (lastIterator == iterator) {
+                iterator = ((uS::Socket *) iterator)->next;
+                iterators.top() = iterator;
+            }
+        }
+        iterators.pop();
+    }
+
+    // duplicated code for now!
+    template <class F>
+    void forEachHttpSocket(const F &cb) {
+        Poll *iterator = httpSocketHead;
+        iterators.push(iterator);
+        while (iterator) {
+            Poll *lastIterator = iterator;
+            cb((HttpSocket<isServer> *) iterator);
+            iterator = iterators.top();
+            if (lastIterator == iterator) {
+                iterator = ((uS::Socket *) iterator)->next;
+                iterators.top() = iterator;
+            }
+        }
+        iterators.pop();
+    }
+
+    static Group<isServer> *from(uS::Socket *s) {
+        return static_cast<Group<isServer> *>(s->getNodeData());
+    }
+};
+
+}
+
+#endif // GROUP_UWS_H
diff --git a/wrt/node_modules/uws/src/HTTPSocket.cpp b/wrt/node_modules/uws/src/HTTPSocket.cpp
new file mode 100644 (file)
index 0000000..84e30b2
--- /dev/null
@@ -0,0 +1,310 @@
+#include "HTTPSocket.h"
+#include "Group.h"
+#include "Extensions.h"
+#include <cstdio>
+
+#define MAX_HEADERS 100
+#define MAX_HEADER_BUFFER_SIZE 4096
+#define FORCE_SLOW_PATH false
+
+namespace uWS {
+
+// UNSAFETY NOTE: assumes *end == '\r' (might unref end pointer)
+char *getHeaders(char *buffer, char *end, Header *headers, size_t maxHeaders) {
+    for (unsigned int i = 0; i < maxHeaders; i++) {
+        for (headers->key = buffer; (*buffer != ':') & (*buffer > 32); *(buffer++) |= 32);
+        if (*buffer == '\r') {
+            if ((buffer != end) & (buffer[1] == '\n') & (i > 0)) {
+                headers->key = nullptr;
+                return buffer + 2;
+            } else {
+                return nullptr;
+            }
+        } else {
+            headers->keyLength = buffer - headers->key;
+            for (buffer++; (*buffer == ':' || *buffer < 33) && *buffer != '\r'; buffer++);
+            headers->value = buffer;
+            buffer = (char *) memchr(buffer, '\r', end - buffer); //for (; *buffer != '\r'; buffer++);
+            if (buffer /*!= end*/ && buffer[1] == '\n') {
+                headers->valueLength = buffer - headers->value;
+                buffer += 2;
+                headers++;
+            } else {
+                return nullptr;
+            }
+        }
+    }
+    return nullptr;
+}
+
+// UNSAFETY NOTE: assumes 24 byte input length
+static void base64(unsigned char *src, char *dst) {
+    static const char *b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+    for (int i = 0; i < 18; i += 3) {
+        *dst++ = b64[(src[i] >> 2) & 63];
+        *dst++ = b64[((src[i] & 3) << 4) | ((src[i + 1] & 240) >> 4)];
+        *dst++ = b64[((src[i + 1] & 15) << 2) | ((src[i + 2] & 192) >> 6)];
+        *dst++ = b64[src[i + 2] & 63];
+    }
+    *dst++ = b64[(src[18] >> 2) & 63];
+    *dst++ = b64[((src[18] & 3) << 4) | ((src[19] & 240) >> 4)];
+    *dst++ = b64[((src[19] & 15) << 2)];
+    *dst++ = '=';
+}
+
+template <bool isServer>
+uS::Socket *HttpSocket<isServer>::onData(uS::Socket *s, char *data, size_t length) {
+    HttpSocket<isServer> *httpSocket = (HttpSocket<isServer> *) s;
+
+    httpSocket->cork(true);
+
+    if (httpSocket->contentLength) {
+        httpSocket->missedDeadline = false;
+        if (httpSocket->contentLength >= length) {
+            Group<isServer>::from(httpSocket)->httpDataHandler(httpSocket->outstandingResponsesTail, data, length, httpSocket->contentLength -= length);
+            return httpSocket;
+        } else {
+            Group<isServer>::from(httpSocket)->httpDataHandler(httpSocket->outstandingResponsesTail, data, httpSocket->contentLength, 0);
+            data += httpSocket->contentLength;
+            length -= httpSocket->contentLength;
+            httpSocket->contentLength = 0;
+        }
+    }
+
+    if (FORCE_SLOW_PATH || httpSocket->httpBuffer.length()) {
+        if (httpSocket->httpBuffer.length() + length > MAX_HEADER_BUFFER_SIZE) {
+            httpSocket->onEnd(httpSocket);
+            return httpSocket;
+        }
+
+        httpSocket->httpBuffer.reserve(httpSocket->httpBuffer.length() + length + WebSocketProtocol<uWS::CLIENT, WebSocket<uWS::CLIENT>>::CONSUME_POST_PADDING);
+        httpSocket->httpBuffer.append(data, length);
+        data = (char *) httpSocket->httpBuffer.data();
+        length = httpSocket->httpBuffer.length();
+    }
+
+    char *end = data + length;
+    char *cursor = data;
+    *end = '\r';
+    Header headers[MAX_HEADERS];
+    do {
+        char *lastCursor = cursor;
+        if ((cursor = getHeaders(cursor, end, headers, MAX_HEADERS))) {
+            HttpRequest req(headers);
+
+            if (isServer) {
+                headers->valueLength = std::max<int>(0, headers->valueLength - 9);
+                httpSocket->missedDeadline = false;
+                if (req.getHeader("upgrade", 7)) {
+                    if (Group<SERVER>::from(httpSocket)->httpUpgradeHandler) {
+                        Group<SERVER>::from(httpSocket)->httpUpgradeHandler((HttpSocket<SERVER> *) httpSocket, req);
+                    } else {
+                        Header secKey = req.getHeader("sec-websocket-key", 17);
+                        Header extensions = req.getHeader("sec-websocket-extensions", 24);
+                        Header subprotocol = req.getHeader("sec-websocket-protocol", 22);
+                        if (secKey.valueLength == 24) {
+                            bool perMessageDeflate;
+                            httpSocket->upgrade(secKey.value, extensions.value, extensions.valueLength,
+                                               subprotocol.value, subprotocol.valueLength, &perMessageDeflate);
+                            Group<isServer>::from(httpSocket)->removeHttpSocket(httpSocket);
+
+                            // Warning: changes socket, needs to inform the stack of Poll address change!
+                            WebSocket<isServer> *webSocket = new WebSocket<isServer>(perMessageDeflate, httpSocket);
+                            webSocket->template setState<WebSocket<isServer>>();
+                            webSocket->change(webSocket->nodeData->loop, webSocket, webSocket->setPoll(UV_READABLE));
+                            Group<isServer>::from(webSocket)->addWebSocket(webSocket);
+
+                            webSocket->cork(true);
+                            Group<isServer>::from(webSocket)->connectionHandler(webSocket, req);
+                            // todo: should not uncork if closed!
+                            webSocket->cork(false);
+                            delete httpSocket;
+
+                            return webSocket;
+                        } else {
+                            httpSocket->onEnd(httpSocket);
+                        }
+                    }
+                    return httpSocket;
+                } else {
+                    if (Group<SERVER>::from(httpSocket)->httpRequestHandler) {
+
+                        HttpResponse *res = HttpResponse::allocateResponse(httpSocket);
+                        if (httpSocket->outstandingResponsesTail) {
+                            httpSocket->outstandingResponsesTail->next = res;
+                        } else {
+                            httpSocket->outstandingResponsesHead = res;
+                        }
+                        httpSocket->outstandingResponsesTail = res;
+
+                        Header contentLength;
+                        if (req.getMethod() != HttpMethod::METHOD_GET && (contentLength = req.getHeader("content-length", 14))) {
+                            httpSocket->contentLength = atoi(contentLength.value);
+                            size_t bytesToRead = std::min<int>(httpSocket->contentLength, end - cursor);
+                            Group<SERVER>::from(httpSocket)->httpRequestHandler(res, req, cursor, bytesToRead, httpSocket->contentLength -= bytesToRead);
+                            cursor += bytesToRead;
+                        } else {
+                            Group<SERVER>::from(httpSocket)->httpRequestHandler(res, req, nullptr, 0, 0);
+                        }
+
+                        if (httpSocket->isClosed() || httpSocket->isShuttingDown()) {
+                            return httpSocket;
+                        }
+                    } else {
+                        httpSocket->onEnd(httpSocket);
+                        return httpSocket;
+                    }
+                }
+            } else {
+                if (req.getHeader("upgrade", 7)) {
+
+                    // Warning: changes socket, needs to inform the stack of Poll address change!
+                    WebSocket<isServer> *webSocket = new WebSocket<isServer>(false, httpSocket);
+                    httpSocket->cancelTimeout();
+                    webSocket->setUserData(httpSocket->httpUser);
+                    webSocket->template setState<WebSocket<isServer>>();
+                    webSocket->change(webSocket->nodeData->loop, webSocket, webSocket->setPoll(UV_READABLE));
+                    Group<isServer>::from(webSocket)->addWebSocket(webSocket);
+
+                    webSocket->cork(true);
+                    Group<isServer>::from(webSocket)->connectionHandler(webSocket, req);
+                    if (!(webSocket->isClosed() || webSocket->isShuttingDown())) {
+                        WebSocketProtocol<isServer, WebSocket<isServer>>::consume(cursor, end - cursor, webSocket);
+                    }
+                    webSocket->cork(false);
+                    delete httpSocket;
+
+                    return webSocket;
+                } else {
+                    httpSocket->onEnd(httpSocket);
+                }
+                return httpSocket;
+            }
+        } else {
+            if (!httpSocket->httpBuffer.length()) {
+                if (length > MAX_HEADER_BUFFER_SIZE) {
+                    httpSocket->onEnd(httpSocket);
+                } else {
+                    httpSocket->httpBuffer.append(lastCursor, end - lastCursor);
+                }
+            }
+            return httpSocket;
+        }
+    } while(cursor != end);
+
+    httpSocket->cork(false);
+    httpSocket->httpBuffer.clear();
+
+    return httpSocket;
+}
+
+// todo: make this into a transformer and make use of sendTransformed
+template <bool isServer>
+void HttpSocket<isServer>::upgrade(const char *secKey, const char *extensions, size_t extensionsLength,
+                                   const char *subprotocol, size_t subprotocolLength, bool *perMessageDeflate) {
+
+    Queue::Message *messagePtr;
+
+    if (isServer) {
+        *perMessageDeflate = false;
+        std::string extensionsResponse;
+        if (extensionsLength) {
+            Group<isServer> *group = Group<isServer>::from(this);
+            ExtensionsNegotiator<uWS::SERVER> extensionsNegotiator(group->extensionOptions);
+            extensionsNegotiator.readOffer(std::string(extensions, extensionsLength));
+            extensionsResponse = extensionsNegotiator.generateOffer();
+            if (extensionsNegotiator.getNegotiatedOptions() & PERMESSAGE_DEFLATE) {
+                *perMessageDeflate = true;
+            }
+        }
+
+        unsigned char shaInput[] = "XXXXXXXXXXXXXXXXXXXXXXXX258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
+        memcpy(shaInput, secKey, 24);
+        unsigned char shaDigest[SHA_DIGEST_LENGTH];
+        SHA1(shaInput, sizeof(shaInput) - 1, shaDigest);
+
+        char upgradeBuffer[1024];
+        memcpy(upgradeBuffer, "HTTP/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: ", 97);
+        base64(shaDigest, upgradeBuffer + 97);
+        memcpy(upgradeBuffer + 125, "\r\n", 2);
+        size_t upgradeResponseLength = 127;
+        if (extensionsResponse.length() && extensionsResponse.length() < 200) {
+            memcpy(upgradeBuffer + upgradeResponseLength, "Sec-WebSocket-Extensions: ", 26);
+            memcpy(upgradeBuffer + upgradeResponseLength + 26, extensionsResponse.data(), extensionsResponse.length());
+            memcpy(upgradeBuffer + upgradeResponseLength + 26 + extensionsResponse.length(), "\r\n", 2);
+            upgradeResponseLength += 26 + extensionsResponse.length() + 2;
+        }
+        if (subprotocolLength && subprotocolLength < 200) {
+            memcpy(upgradeBuffer + upgradeResponseLength, "Sec-WebSocket-Protocol: ", 24);
+            memcpy(upgradeBuffer + upgradeResponseLength + 24, subprotocol, subprotocolLength);
+            memcpy(upgradeBuffer + upgradeResponseLength + 24 + subprotocolLength, "\r\n", 2);
+            upgradeResponseLength += 24 + subprotocolLength + 2;
+        }
+        static char stamp[] = "Sec-WebSocket-Version: 13\r\nWebSocket-Server: uWebSockets\r\n\r\n";
+        memcpy(upgradeBuffer + upgradeResponseLength, stamp, sizeof(stamp) - 1);
+        upgradeResponseLength += sizeof(stamp) - 1;
+
+        messagePtr = allocMessage(upgradeResponseLength, upgradeBuffer);
+    } else {
+        messagePtr = allocMessage(httpBuffer.length(), httpBuffer.data());
+        httpBuffer.clear();
+    }
+
+    bool wasTransferred;
+    if (write(messagePtr, wasTransferred)) {
+        if (!wasTransferred) {
+            freeMessage(messagePtr);
+        } else {
+            messagePtr->callback = nullptr;
+        }
+    } else {
+        freeMessage(messagePtr);
+    }
+}
+
+template <bool isServer>
+void HttpSocket<isServer>::onEnd(uS::Socket *s) {
+    HttpSocket<isServer> *httpSocket = (HttpSocket<isServer> *) s;
+
+    if (!httpSocket->isShuttingDown()) {
+        if (isServer) {
+            Group<isServer>::from(httpSocket)->removeHttpSocket(httpSocket);
+            Group<isServer>::from(httpSocket)->httpDisconnectionHandler(httpSocket);
+        }
+    } else {
+        httpSocket->cancelTimeout();
+    }
+
+    httpSocket->template closeSocket<HttpSocket<isServer>>();
+
+    while (!httpSocket->messageQueue.empty()) {
+        Queue::Message *message = httpSocket->messageQueue.front();
+        if (message->callback) {
+            message->callback(nullptr, message->callbackData, true, nullptr);
+        }
+        httpSocket->messageQueue.pop();
+    }
+
+    while (httpSocket->outstandingResponsesHead) {
+        Group<isServer>::from(httpSocket)->httpCancelledRequestHandler(httpSocket->outstandingResponsesHead);
+        HttpResponse *next = httpSocket->outstandingResponsesHead->next;
+        delete httpSocket->outstandingResponsesHead;
+        httpSocket->outstandingResponsesHead = next;
+    }
+
+    if (httpSocket->preAllocatedResponse) {
+        delete httpSocket->preAllocatedResponse;
+    }
+
+    httpSocket->nodeData->clearPendingPollChanges(httpSocket);
+
+    if (!isServer) {
+        httpSocket->cancelTimeout();
+        Group<CLIENT>::from(httpSocket)->errorHandler(httpSocket->httpUser);
+    }
+}
+
+template struct HttpSocket<SERVER>;
+template struct HttpSocket<CLIENT>;
+
+}
diff --git a/wrt/node_modules/uws/src/HTTPSocket.h b/wrt/node_modules/uws/src/HTTPSocket.h
new file mode 100644 (file)
index 0000000..5cc7a7f
--- /dev/null
@@ -0,0 +1,285 @@
+#ifndef HTTPSOCKET_UWS_H
+#define HTTPSOCKET_UWS_H
+
+#include "Socket.h"
+#include <string>
+// #include <experimental/string_view>
+
+namespace uWS {
+
+struct Header {
+    char *key, *value;
+    unsigned int keyLength, valueLength;
+
+    operator bool() {
+        return key;
+    }
+
+    // slow without string_view!
+    std::string toString() {
+        return std::string(value, valueLength);
+    }
+};
+
+enum HttpMethod {
+    METHOD_GET,
+    METHOD_POST,
+    METHOD_PUT,
+    METHOD_DELETE,
+    METHOD_PATCH,
+    METHOD_OPTIONS,
+    METHOD_HEAD,
+    METHOD_TRACE,
+    METHOD_CONNECT,
+    METHOD_INVALID
+};
+
+struct HttpRequest {
+    Header *headers;
+    Header getHeader(const char *key) {
+        return getHeader(key, strlen(key));
+    }
+
+    HttpRequest(Header *headers = nullptr) : headers(headers) {}
+
+    Header getHeader(const char *key, size_t length) {
+        if (headers) {
+            for (Header *h = headers; *++h; ) {
+                if (h->keyLength == length && !strncmp(h->key, key, length)) {
+                    return *h;
+                }
+            }
+        }
+        return {nullptr, nullptr, 0, 0};
+    }
+
+    Header getUrl() {
+        if (headers->key) {
+            return *headers;
+        }
+        return {nullptr, nullptr, 0, 0};
+    }
+
+    HttpMethod getMethod() {
+        if (!headers->key) {
+            return METHOD_INVALID;
+        }
+        switch (headers->keyLength) {
+        case 3:
+            if (!strncmp(headers->key, "get", 3)) {
+                return METHOD_GET;
+            } else if (!strncmp(headers->key, "put", 3)) {
+                return METHOD_PUT;
+            }
+            break;
+        case 4:
+            if (!strncmp(headers->key, "post", 4)) {
+                return METHOD_POST;
+            } else if (!strncmp(headers->key, "head", 4)) {
+                return METHOD_HEAD;
+            }
+            break;
+        case 5:
+            if (!strncmp(headers->key, "patch", 5)) {
+                return METHOD_PATCH;
+            } else if (!strncmp(headers->key, "trace", 5)) {
+                return METHOD_TRACE;
+            }
+            break;
+        case 6:
+            if (!strncmp(headers->key, "delete", 6)) {
+                return METHOD_DELETE;
+            }
+            break;
+        case 7:
+            if (!strncmp(headers->key, "options", 7)) {
+                return METHOD_OPTIONS;
+            } else if (!strncmp(headers->key, "connect", 7)) {
+                return METHOD_CONNECT;
+            }
+            break;
+        }
+        return METHOD_INVALID;
+    }
+};
+
+struct HttpResponse;
+
+template <const bool isServer>
+struct WIN32_EXPORT HttpSocket : uS::Socket {
+    void *httpUser; // remove this later, setTimeout occupies user for now
+    HttpResponse *outstandingResponsesHead = nullptr;
+    HttpResponse *outstandingResponsesTail = nullptr;
+    HttpResponse *preAllocatedResponse = nullptr;
+
+    std::string httpBuffer;
+    size_t contentLength = 0;
+    bool missedDeadline = false;
+
+    HttpSocket(uS::Socket *socket) : uS::Socket(std::move(*socket)) {}
+
+    void terminate() {
+        onEnd(this);
+    }
+
+    void upgrade(const char *secKey, const char *extensions,
+                 size_t extensionsLength, const char *subprotocol,
+                 size_t subprotocolLength, bool *perMessageDeflate);
+
+private:
+    friend struct uS::Socket;
+    friend struct HttpResponse;
+    friend struct Hub;
+    static uS::Socket *onData(uS::Socket *s, char *data, size_t length);
+    static void onEnd(uS::Socket *s);
+};
+
+struct HttpResponse {
+    HttpSocket<true> *httpSocket;
+    HttpResponse *next = nullptr;
+    void *userData = nullptr;
+    void *extraUserData = nullptr;
+    HttpSocket<true>::Queue::Message *messageQueue = nullptr;
+    bool hasEnded = false;
+    bool hasHead = false;
+
+    HttpResponse(HttpSocket<true> *httpSocket) : httpSocket(httpSocket) {
+
+    }
+
+    template <bool isServer>
+    static HttpResponse *allocateResponse(HttpSocket<isServer> *httpSocket) {
+        if (httpSocket->preAllocatedResponse) {
+            HttpResponse *ret = httpSocket->preAllocatedResponse;
+            httpSocket->preAllocatedResponse = nullptr;
+            return ret;
+        } else {
+            return new HttpResponse((HttpSocket<true> *) httpSocket);
+        }
+    }
+
+    //template <bool isServer>
+    void freeResponse(HttpSocket<true> *httpData) {
+        if (httpData->preAllocatedResponse) {
+            delete this;
+        } else {
+            httpData->preAllocatedResponse = this;
+        }
+    }
+
+    void write(const char *message, size_t length = 0,
+               void(*callback)(void *httpSocket, void *data, bool cancelled, void *reserved) = nullptr,
+               void *callbackData = nullptr) {
+
+        struct NoopTransformer {
+            static size_t estimate(const char *data, size_t length) {
+                return length;
+            }
+
+            static size_t transform(const char *src, char *dst, size_t length, int transformData) {
+                memcpy(dst, src, length);
+                return length;
+            }
+        };
+
+        httpSocket->sendTransformed<NoopTransformer>(message, length, callback, callbackData, 0);
+        hasHead = true;
+    }
+
+    // todo: maybe this function should have a fast path for 0 length?
+    void end(const char *message = nullptr, size_t length = 0,
+             void(*callback)(void *httpResponse, void *data, bool cancelled, void *reserved) = nullptr,
+             void *callbackData = nullptr) {
+
+        struct TransformData {
+            bool hasHead;
+        } transformData = {hasHead};
+
+        struct HttpTransformer {
+
+            // todo: this should get TransformData!
+            static size_t estimate(const char *data, size_t length) {
+                return length + 128;
+            }
+
+            static size_t transform(const char *src, char *dst, size_t length, TransformData transformData) {
+                // todo: sprintf is extremely slow
+                int offset = transformData.hasHead ? 0 : std::sprintf(dst, "HTTP/1.1 200 OK\r\nContent-Length: %u\r\n\r\n", (unsigned int) length);
+                memcpy(dst + offset, src, length);
+                return length + offset;
+            }
+        };
+
+        if (httpSocket->outstandingResponsesHead != this) {
+            HttpSocket<true>::Queue::Message *messagePtr = httpSocket->allocMessage(HttpTransformer::estimate(message, length));
+            messagePtr->length = HttpTransformer::transform(message, (char *) messagePtr->data, length, transformData);
+            messagePtr->callback = callback;
+            messagePtr->callbackData = callbackData;
+            messagePtr->nextMessage = messageQueue;
+            messageQueue = messagePtr;
+            hasEnded = true;
+        } else {
+            httpSocket->sendTransformed<HttpTransformer>(message, length, callback, callbackData, transformData);
+            // move head as far as possible
+            HttpResponse *head = next;
+            while (head) {
+                // empty message queue
+                HttpSocket<true>::Queue::Message *messagePtr = head->messageQueue;
+                while (messagePtr) {
+                    HttpSocket<true>::Queue::Message *nextMessage = messagePtr->nextMessage;
+
+                    bool wasTransferred;
+                    if (httpSocket->write(messagePtr, wasTransferred)) {
+                        if (!wasTransferred) {
+                            httpSocket->freeMessage(messagePtr);
+                            if (callback) {
+                                callback(this, callbackData, false, nullptr);
+                            }
+                        } else {
+                            messagePtr->callback = callback;
+                            messagePtr->callbackData = callbackData;
+                        }
+                    } else {
+                        httpSocket->freeMessage(messagePtr);
+                        if (callback) {
+                            callback(this, callbackData, true, nullptr);
+                        }
+                        goto updateHead;
+                    }
+                    messagePtr = nextMessage;
+                }
+                // cannot go beyond unfinished responses
+                if (!head->hasEnded) {
+                    break;
+                } else {
+                    HttpResponse *next = head->next;
+                    head->freeResponse(httpSocket);
+                    head = next;
+                }
+            }
+            updateHead:
+            httpSocket->outstandingResponsesHead = head;
+            if (!head) {
+                httpSocket->outstandingResponsesTail = nullptr;
+            }
+
+            freeResponse(httpSocket);
+        }
+    }
+
+    void setUserData(void *userData) {
+        this->userData = userData;
+    }
+
+    void *getUserData() {
+        return userData;
+    }
+
+    HttpSocket<true> *getHttpSocket() {
+        return httpSocket;
+    }
+};
+
+}
+
+#endif // HTTPSOCKET_UWS_H
diff --git a/wrt/node_modules/uws/src/Hub.cpp b/wrt/node_modules/uws/src/Hub.cpp
new file mode 100644 (file)
index 0000000..771c263
--- /dev/null
@@ -0,0 +1,177 @@
+#include "Hub.h"
+#include "HTTPSocket.h"
+#include <openssl/sha.h>
+
+namespace uWS {
+
+char *Hub::inflate(char *data, size_t &length, size_t maxPayload) {
+    dynamicInflationBuffer.clear();
+
+    inflationStream.next_in = (Bytef *) data;
+    inflationStream.avail_in = length;
+
+    int err;
+    do {
+        inflationStream.next_out = (Bytef *) inflationBuffer;
+        inflationStream.avail_out = LARGE_BUFFER_SIZE;
+        err = ::inflate(&inflationStream, Z_FINISH);
+        if (!inflationStream.avail_in) {
+            break;
+        }
+
+        dynamicInflationBuffer.append(inflationBuffer, LARGE_BUFFER_SIZE - inflationStream.avail_out);
+    } while (err == Z_BUF_ERROR && dynamicInflationBuffer.length() <= maxPayload);
+
+    inflateReset(&inflationStream);
+
+    if ((err != Z_BUF_ERROR && err != Z_OK) || dynamicInflationBuffer.length() > maxPayload) {
+        length = 0;
+        return nullptr;
+    }
+
+    if (dynamicInflationBuffer.length()) {
+        dynamicInflationBuffer.append(inflationBuffer, LARGE_BUFFER_SIZE - inflationStream.avail_out);
+
+        length = dynamicInflationBuffer.length();
+        return (char *) dynamicInflationBuffer.data();
+    }
+
+    length = LARGE_BUFFER_SIZE - inflationStream.avail_out;
+    return inflationBuffer;
+}
+
+void Hub::onServerAccept(uS::Socket *s) {
+    HttpSocket<SERVER> *httpSocket = new HttpSocket<SERVER>(s);
+    delete s;
+
+    httpSocket->setState<HttpSocket<SERVER>>();
+    httpSocket->start(httpSocket->nodeData->loop, httpSocket, httpSocket->setPoll(UV_READABLE));
+    httpSocket->setNoDelay(true);
+    Group<SERVER>::from(httpSocket)->addHttpSocket(httpSocket);
+    Group<SERVER>::from(httpSocket)->httpConnectionHandler(httpSocket);
+}
+
+void Hub::onClientConnection(uS::Socket *s, bool error) {
+    HttpSocket<CLIENT> *httpSocket = (HttpSocket<CLIENT> *) s;
+
+    if (error) {
+        httpSocket->onEnd(httpSocket);
+    } else {
+        httpSocket->setState<HttpSocket<CLIENT>>();
+        httpSocket->change(httpSocket->nodeData->loop, httpSocket, httpSocket->setPoll(UV_READABLE));
+        httpSocket->setNoDelay(true);
+        httpSocket->upgrade(nullptr, nullptr, 0, nullptr, 0, nullptr);
+    }
+}
+
+bool Hub::listen(const char *host, int port, uS::TLS::Context sslContext, int options, Group<SERVER> *eh) {
+    if (!eh) {
+        eh = (Group<SERVER> *) this;
+    }
+
+    if (uS::Node::listen<onServerAccept>(host, port, sslContext, options, (uS::NodeData *) eh, nullptr)) {
+        eh->errorHandler(port);
+        return false;
+    }
+    return true;
+}
+
+bool Hub::listen(int port, uS::TLS::Context sslContext, int options, Group<SERVER> *eh) {
+    return listen(nullptr, port, sslContext, options, eh);
+}
+
+uS::Socket *allocateHttpSocket(uS::Socket *s) {
+    return (uS::Socket *) new HttpSocket<CLIENT>(s);
+}
+
+void Hub::connect(std::string uri, void *user, std::map<std::string, std::string> extraHeaders, int timeoutMs, Group<CLIENT> *eh) {
+    if (!eh) {
+        eh = (Group<CLIENT> *) this;
+    }
+
+    size_t offset = 0;
+    std::string protocol = uri.substr(offset, uri.find("://")), hostname, portStr, path;
+    if ((offset += protocol.length() + 3) < uri.length()) {
+        hostname = uri.substr(offset, uri.find_first_of(":/", offset) - offset);
+
+        offset += hostname.length();
+        if (uri[offset] == ':') {
+            offset++;
+            portStr = uri.substr(offset, uri.find("/", offset) - offset);
+        }
+
+        offset += portStr.length();
+        if (uri[offset] == '/') {
+            path = uri.substr(++offset);
+        }
+    }
+
+    if (hostname.length()) {
+        int port = 80;
+        bool secure = false;
+        if (protocol == "wss") {
+            port = 443;
+            secure = true;
+        } else if (protocol != "ws") {
+            eh->errorHandler(user);
+        }
+
+        if (portStr.length()) {
+            port = stoi(portStr);
+        }
+
+        HttpSocket<CLIENT> *httpSocket = (HttpSocket<CLIENT> *) uS::Node::connect<allocateHttpSocket, onClientConnection>(hostname.c_str(), port, secure, eh);
+        if (httpSocket) {
+            // startTimeout occupies the user
+            httpSocket->startTimeout<HttpSocket<CLIENT>::onEnd>(timeoutMs);
+            httpSocket->httpUser = user;
+
+            std::string randomKey = "x3JJHMbDL1EzLkh9GBhXDw==";
+//            for (int i = 0; i < 22; i++) {
+//                randomKey[i] = rand() %
+//            }
+
+            httpSocket->httpBuffer = "GET /" + path + " HTTP/1.1\r\n"
+                                     "Upgrade: websocket\r\n"
+                                     "Connection: Upgrade\r\n"
+                                     "Sec-WebSocket-Key: " + randomKey + "\r\n"
+                                     "Host: " + hostname + "\r\n" +
+                                     "Sec-WebSocket-Version: 13\r\n";
+
+            for (std::pair<std::string, std::string> header : extraHeaders) {
+                httpSocket->httpBuffer += header.first + ": " + header.second + "\r\n";
+            }
+
+            httpSocket->httpBuffer += "\r\n";
+        } else {
+            eh->errorHandler(user);
+        }
+    } else {
+        eh->errorHandler(user);
+    }
+}
+
+void Hub::upgrade(uv_os_sock_t fd, const char *secKey, SSL *ssl, const char *extensions, size_t extensionsLength, const char *subprotocol, size_t subprotocolLength, Group<SERVER> *serverGroup) {
+    if (!serverGroup) {
+        serverGroup = &getDefaultGroup<SERVER>();
+    }
+
+    uS::Socket s((uS::NodeData *) serverGroup, serverGroup->loop, fd, ssl);
+    s.setNoDelay(true);
+
+    // todo: skip httpSocket -> it cannot fail anyways!
+    HttpSocket<SERVER> *httpSocket = new HttpSocket<SERVER>(&s);
+    httpSocket->setState<HttpSocket<SERVER>>();
+    httpSocket->change(httpSocket->nodeData->loop, httpSocket, httpSocket->setPoll(UV_READABLE));
+    bool perMessageDeflate;
+    httpSocket->upgrade(secKey, extensions, extensionsLength, subprotocol, subprotocolLength, &perMessageDeflate);
+
+    WebSocket<SERVER> *webSocket = new WebSocket<SERVER>(perMessageDeflate, httpSocket);
+    delete httpSocket;
+    webSocket->setState<WebSocket<SERVER>>();
+    webSocket->change(webSocket->nodeData->loop, webSocket, webSocket->setPoll(UV_READABLE));
+    serverGroup->addWebSocket(webSocket);
+    serverGroup->connectionHandler(webSocket, {});
+}
+
+}
diff --git a/wrt/node_modules/uws/src/Hub.h b/wrt/node_modules/uws/src/Hub.h
new file mode 100644 (file)
index 0000000..f879579
--- /dev/null
@@ -0,0 +1,97 @@
+#ifndef HUB_UWS_H
+#define HUB_UWS_H
+
+#include "Group.h"
+#include "Node.h"
+#include <string>
+#include <zlib.h>
+#include <mutex>
+#include <map>
+
+namespace uWS {
+
+struct WIN32_EXPORT Hub : private uS::Node, public Group<SERVER>, public Group<CLIENT> {
+protected:
+    struct ConnectionData {
+        std::string path;
+        void *user;
+        Group<CLIENT> *group;
+    };
+
+    z_stream inflationStream = {};
+    char *inflationBuffer;
+    char *inflate(char *data, size_t &length, size_t maxPayload);
+    std::string dynamicInflationBuffer;
+    static const int LARGE_BUFFER_SIZE = 300 * 1024;
+
+    static void onServerAccept(uS::Socket *s);
+    static void onClientConnection(uS::Socket *s, bool error);
+
+public:
+    template <bool isServer>
+    Group<isServer> *createGroup(int extensionOptions = 0, unsigned int maxPayload = 16777216) {
+        return new Group<isServer>(extensionOptions, maxPayload, this, nodeData);
+    }
+
+    template <bool isServer>
+    Group<isServer> &getDefaultGroup() {
+        return static_cast<Group<isServer> &>(*this);
+    }
+
+    bool listen(int port, uS::TLS::Context sslContext = nullptr, int options = 0, Group<SERVER> *eh = nullptr);
+    bool listen(const char *host, int port, uS::TLS::Context sslContext = nullptr, int options = 0, Group<SERVER> *eh = nullptr);
+    void connect(std::string uri, void *user = nullptr, std::map<std::string, std::string> extraHeaders = {}, int timeoutMs = 5000, Group<CLIENT> *eh = nullptr);
+    void upgrade(uv_os_sock_t fd, const char *secKey, SSL *ssl, const char *extensions, size_t extensionsLength, const char *subprotocol, size_t subprotocolLength, Group<SERVER> *serverGroup = nullptr);
+
+    Hub(int extensionOptions = 0, bool useDefaultLoop = false, unsigned int maxPayload = 16777216) : uS::Node(LARGE_BUFFER_SIZE, WebSocketProtocol<SERVER, WebSocket<SERVER>>::CONSUME_PRE_PADDING, WebSocketProtocol<SERVER, WebSocket<SERVER>>::CONSUME_POST_PADDING, useDefaultLoop),
+                                             Group<SERVER>(extensionOptions, maxPayload, this, nodeData), Group<CLIENT>(0, maxPayload, this, nodeData) {
+        inflateInit2(&inflationStream, -15);
+        inflationBuffer = new char[LARGE_BUFFER_SIZE];
+
+#ifdef UWS_THREADSAFE
+        getLoop()->preCbData = nodeData;
+        getLoop()->preCb = [](void *nodeData) {
+            static_cast<uS::NodeData *>(nodeData)->asyncMutex->lock();
+        };
+
+        getLoop()->postCbData = nodeData;
+        getLoop()->postCb = [](void *nodeData) {
+            static_cast<uS::NodeData *>(nodeData)->asyncMutex->unlock();
+        };
+#endif
+    }
+
+    ~Hub() {
+        inflateEnd(&inflationStream);
+        delete [] inflationBuffer;
+    }
+
+    using uS::Node::run;
+    using uS::Node::getLoop;
+    using Group<SERVER>::onConnection;
+    using Group<CLIENT>::onConnection;
+    using Group<SERVER>::onTransfer;
+    using Group<SERVER>::onMessage;
+    using Group<CLIENT>::onMessage;
+    using Group<SERVER>::onDisconnection;
+    using Group<CLIENT>::onDisconnection;
+    using Group<SERVER>::onPing;
+    using Group<CLIENT>::onPing;
+    using Group<SERVER>::onPong;
+    using Group<CLIENT>::onPong;
+    using Group<SERVER>::onError;
+    using Group<CLIENT>::onError;
+    using Group<SERVER>::onHttpRequest;
+    using Group<SERVER>::onHttpData;
+    using Group<SERVER>::onHttpConnection;
+    using Group<SERVER>::onHttpDisconnection;
+    using Group<SERVER>::onHttpUpgrade;
+    using Group<SERVER>::onCancelledHttpRequest;
+
+    friend struct WebSocket<SERVER>;
+    friend struct WebSocket<CLIENT>;
+};
+
+}
+
+#endif // HUB_UWS_H
diff --git a/wrt/node_modules/uws/src/Libuv.h b/wrt/node_modules/uws/src/Libuv.h
new file mode 100644 (file)
index 0000000..7a71c53
--- /dev/null
@@ -0,0 +1,175 @@
+#ifndef LIBUV_H
+#define LIBUV_H
+
+#include <uv.h>
+static_assert (UV_VERSION_MINOR >= 3, "µWebSockets requires libuv >=1.3.0");
+
+struct Loop : uv_loop_t {
+    static Loop *createLoop(bool defaultLoop = true) {
+        if (defaultLoop) {
+            return (Loop *) uv_default_loop();
+        } else {
+            return (Loop *) uv_loop_new();
+        }
+    }
+
+    void destroy() {
+        if (this != uv_default_loop()) {
+            uv_loop_delete(this);
+        }
+    }
+
+    void run() {
+        uv_run(this, UV_RUN_DEFAULT);
+    }
+};
+
+struct Async {
+    uv_async_t uv_async;
+
+    Async(Loop *loop) {
+        uv_async.loop = loop;
+    }
+
+    void start(void (*cb)(Async *)) {
+        uv_async_init(uv_async.loop, &uv_async, (uv_async_cb) cb);
+    }
+
+    void send() {
+        uv_async_send(&uv_async);
+    }
+
+    void close() {
+        uv_close((uv_handle_t *) &uv_async, [](uv_handle_t *a) {
+            delete (Async *) a;
+        });
+    }
+
+    void setData(void *data) {
+        uv_async.data = data;
+    }
+
+    void *getData() {
+        return uv_async.data;
+    }
+};
+
+struct Timer {
+    uv_timer_t uv_timer;
+
+    Timer(Loop *loop) {
+        uv_timer_init(loop, &uv_timer);
+    }
+
+    void start(void (*cb)(Timer *), int first, int repeat) {
+        uv_timer_start(&uv_timer, (uv_timer_cb) cb, first, repeat);
+    }
+
+    void setData(void *data) {
+        uv_timer.data = data;
+    }
+
+    void *getData() {
+        return uv_timer.data;
+    }
+
+    void stop() {
+        uv_timer_stop(&uv_timer);
+    }
+
+    void close() {
+        uv_close((uv_handle_t *) &uv_timer, [](uv_handle_t *t) {
+            delete (Timer *) t;
+        });
+    }
+
+private:
+    ~Timer() {
+
+    }
+};
+
+struct Poll {
+    uv_poll_t *uv_poll;
+    void (*cb)(Poll *p, int status, int events);
+
+    Poll(Loop *loop, uv_os_sock_t fd) {
+        uv_poll = new uv_poll_t;
+        uv_poll_init_socket(loop, uv_poll, fd);
+    }
+
+    Poll(Poll &&other) {
+        uv_poll = other.uv_poll;
+        cb = other.cb;
+        other.uv_poll = nullptr;
+    }
+
+    Poll(const Poll &other) = delete;
+
+    ~Poll() {
+        delete uv_poll;
+    }
+
+    bool isClosed() {
+        return uv_is_closing((uv_handle_t *) uv_poll);
+    }
+
+    uv_os_sock_t getFd() {
+#ifdef _WIN32
+        uv_os_sock_t fd;
+        uv_fileno((uv_handle_t *) uv_poll, (uv_os_fd_t *) &fd);
+        return fd;
+#else
+        return uv_poll->io_watcher.fd;
+#endif
+    }
+
+    void setCb(void (*cb)(Poll *p, int status, int events)) {
+        this->cb = cb;
+    }
+
+    void (*getCb())(Poll *, int, int) {
+        return cb;
+    }
+
+    void reInit(Loop *loop, uv_os_sock_t fd) {
+        delete uv_poll;
+        uv_poll = new uv_poll_t;
+        uv_poll_init_socket(loop, uv_poll, fd);
+    }
+
+    void start(Loop *, Poll *self, int events) {
+        uv_poll->data = self;
+        uv_poll_start(uv_poll, events, [](uv_poll_t *p, int status, int events) {
+            Poll *self = (Poll *) p->data;
+            self->cb(self, status, events);
+        });
+    }
+
+    void change(Loop *, Poll *self, int events) {
+        start(nullptr, self, events);
+    }
+
+    void stop(Loop *loop) {
+        uv_poll_stop(uv_poll);
+    }
+
+    bool fastTransfer(Loop *loop, Loop *newLoop, int events) {
+        return false;
+    }
+
+    bool threadSafeChange(Loop *, Poll *self, int events) {
+        return false;
+    }
+
+    void close(Loop *loop, void (*cb)(Poll *)) {
+        this->cb = (void(*)(Poll *, int, int)) cb;
+        uv_close((uv_handle_t *) uv_poll, [](uv_handle_t *p) {
+            Poll *poll = (Poll *) p->data;
+            void (*cb)(Poll *) = (void(*)(Poll *)) poll->cb;
+            cb(poll);
+        });
+    }
+};
+
+#endif // LIBUV_H
diff --git a/wrt/node_modules/uws/src/Networking.cpp b/wrt/node_modules/uws/src/Networking.cpp
new file mode 100644 (file)
index 0000000..743f83b
--- /dev/null
@@ -0,0 +1,78 @@
+#include "Networking.h"
+
+namespace uS {
+
+namespace TLS {
+
+Context::Context(const Context &other)
+{
+    if (other.context) {
+        context = other.context;
+        SSL_CTX_up_ref(context);
+    }
+}
+
+Context &Context::operator=(const Context &other) {
+    if (other.context) {
+        context = other.context;
+        SSL_CTX_up_ref(context);
+    }
+    return *this;
+}
+
+Context::~Context()
+{
+    if (context) {
+        SSL_CTX_free(context);
+    }
+}
+
+struct Init {
+    Init() {SSL_library_init();}
+    ~Init() {/*EVP_cleanup();*/}
+} init;
+
+Context createContext(std::string certChainFileName, std::string keyFileName, std::string keyFilePassword)
+{
+    Context context(SSL_CTX_new(SSLv23_server_method()));
+    if (!context.context) {
+        return nullptr;
+    }
+
+    if (keyFilePassword.length()) {
+        context.password.reset(new std::string(keyFilePassword));
+        SSL_CTX_set_default_passwd_cb_userdata(context.context, context.password.get());
+        SSL_CTX_set_default_passwd_cb(context.context, Context::passwordCallback);
+    }
+
+    SSL_CTX_set_options(context.context, SSL_OP_NO_SSLv3);
+
+    if (SSL_CTX_use_certificate_chain_file(context.context, certChainFileName.c_str()) != 1) {
+        return nullptr;
+    } else if (SSL_CTX_use_PrivateKey_file(context.context, keyFileName.c_str(), SSL_FILETYPE_PEM) != 1) {
+        return nullptr;
+    }
+
+    return context;
+}
+
+}
+
+#ifndef _WIN32
+struct Init {
+    Init() {signal(SIGPIPE, SIG_IGN);}
+} init;
+#endif
+
+#ifdef _WIN32
+#pragma comment(lib, "Ws2_32.lib")
+
+struct WindowsInit {
+    WSADATA wsaData;
+    WindowsInit() {WSAStartup(MAKEWORD(2, 2), &wsaData);}
+    ~WindowsInit() {WSACleanup();}
+} windowsInit;
+
+#endif
+
+}
diff --git a/wrt/node_modules/uws/src/Networking.h b/wrt/node_modules/uws/src/Networking.h
new file mode 100644 (file)
index 0000000..7ae88a2
--- /dev/null
@@ -0,0 +1,259 @@
+// the purpose of this header should be to provide SSL and networking wrapped in a common interface
+// it should allow cross-platform networking and SSL and also easy usage of mTCP and similar tech
+
+#ifndef NETWORKING_UWS_H
+#define NETWORKING_UWS_H
+
+#include <openssl/opensslv.h>
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#define SSL_CTX_up_ref(x) x->references++
+#define SSL_up_ref(x) x->references++
+#endif
+
+#ifndef __linux
+#define MSG_NOSIGNAL 0
+#else
+#include <endian.h>
+#endif
+
+#ifdef __APPLE__
+#include <libkern/OSByteOrder.h>
+#define htobe64(x) OSSwapHostToBigInt64(x)
+#define be64toh(x) OSSwapBigToHostInt64(x)
+#endif
+
+#ifdef _WIN32
+#define NOMINMAX
+#include <WinSock2.h>
+#include <Ws2tcpip.h>
+#pragma comment(lib, "ws2_32.lib")
+#define SHUT_WR SD_SEND
+#ifdef __MINGW32__
+// Windows has always been tied to LE
+#define htobe64(x) __builtin_bswap64(x)
+#define be64toh(x) __builtin_bswap64(x)
+#else
+#define __thread __declspec(thread)
+#define htobe64(x) htonll(x)
+#define be64toh(x) ntohll(x)
+#define pthread_t DWORD
+#define pthread_self GetCurrentThreadId
+#endif
+#define WIN32_EXPORT __declspec(dllexport)
+
+inline void close(SOCKET fd) {closesocket(fd);}
+inline int setsockopt(SOCKET fd, int level, int optname, const void *optval, socklen_t optlen) {
+    return setsockopt(fd, level, optname, (const char *) optval, optlen);
+}
+
+inline SOCKET dup(SOCKET socket) {
+    WSAPROTOCOL_INFOW pi;
+    if (WSADuplicateSocketW(socket, GetCurrentProcessId(), &pi) == SOCKET_ERROR) {
+        return INVALID_SOCKET;
+    }
+    return WSASocketW(pi.iAddressFamily, pi.iSocketType, pi.iProtocol, &pi, 0, WSA_FLAG_OVERLAPPED);
+}
+#else
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include <netdb.h>
+#include <unistd.h>
+#include <arpa/inet.h>
+#include <cstring>
+#define SOCKET_ERROR -1
+#define INVALID_SOCKET -1
+#define WIN32_EXPORT
+#endif
+
+#include "Backend.h"
+#include <openssl/ssl.h>
+#include <csignal>
+#include <vector>
+#include <string>
+#include <mutex>
+#include <algorithm>
+#include <memory>
+
+namespace uS {
+
+// todo: mark sockets nonblocking in these functions
+// todo: probably merge this Context with the TLS::Context for same interface for SSL and non-SSL!
+struct Context {
+
+#ifdef USE_MTCP
+    mtcp_context *mctx;
+#endif
+
+    Context() {
+        // mtcp_create_context
+#ifdef USE_MTCP
+        mctx = mtcp_create_context(0); // cpu index?
+#endif
+    }
+
+    ~Context() {
+#ifdef USE_MTCP
+        mtcp_destroy_context(mctx);
+#endif
+    }
+
+    // returns INVALID_SOCKET on error
+    uv_os_sock_t acceptSocket(uv_os_sock_t fd) {
+        uv_os_sock_t acceptedFd;
+#if defined(SOCK_CLOEXEC) && defined(SOCK_NONBLOCK)
+        // Linux, FreeBSD
+        acceptedFd = accept4(fd, nullptr, nullptr, SOCK_CLOEXEC | SOCK_NONBLOCK);
+#else
+        // Windows, OS X
+        acceptedFd = accept(fd, nullptr, nullptr);
+#endif
+
+#ifdef __APPLE__
+        if (acceptedFd != INVALID_SOCKET) {
+            int noSigpipe = 1;
+            setsockopt(acceptedFd, SOL_SOCKET, SO_NOSIGPIPE, &noSigpipe, sizeof(int));
+        }
+#endif
+        return acceptedFd;
+    }
+
+    // returns INVALID_SOCKET on error
+    uv_os_sock_t createSocket(int domain, int type, int protocol) {
+        int flags = 0;
+#if defined(SOCK_CLOEXEC) && defined(SOCK_NONBLOCK)
+        flags = SOCK_CLOEXEC | SOCK_NONBLOCK;
+#endif
+
+        uv_os_sock_t createdFd = socket(domain, type | flags, protocol);
+
+#ifdef __APPLE__
+        if (createdFd != INVALID_SOCKET) {
+            int noSigpipe = 1;
+            setsockopt(createdFd, SOL_SOCKET, SO_NOSIGPIPE, &noSigpipe, sizeof(int));
+        }
+#endif
+
+        return createdFd;
+    }
+
+    void closeSocket(uv_os_sock_t fd) {
+#ifdef _WIN32
+        closesocket(fd);
+#else
+        close(fd);
+#endif
+    }
+
+    bool wouldBlock() {
+#ifdef _WIN32
+        return WSAGetLastError() == WSAEWOULDBLOCK;
+#else
+        return errno == EWOULDBLOCK;// || errno == EAGAIN;
+#endif
+    }
+};
+
+namespace TLS {
+
+class WIN32_EXPORT Context {
+private:
+    SSL_CTX *context = nullptr;
+    std::shared_ptr<std::string> password;
+
+    static int passwordCallback(char *buf, int size, int rwflag, void *u)
+    {
+        std::string *password = (std::string *) u;
+        int length = std::min<int>(size, password->length());
+        memcpy(buf, password->data(), length);
+        buf[length] = '\0';
+        return length;
+    }
+
+public:
+    friend Context WIN32_EXPORT createContext(std::string certChainFileName, std::string keyFileName, std::string keyFilePassword);
+    Context(SSL_CTX *context) : context(context) {
+
+    }
+
+    Context() = default;
+    Context(const Context &other);
+    Context &operator=(const Context &other);
+    ~Context();
+    operator bool() {
+        return context;
+    }
+
+    SSL_CTX *getNativeContext() {
+        return context;
+    }
+};
+
+Context WIN32_EXPORT createContext(std::string certChainFileName, std::string keyFileName, std::string keyFilePassword = std::string());
+
+}
+
+struct Socket;
+
+// NodeData is like a Context, maybe merge them?
+struct WIN32_EXPORT NodeData {
+    char *recvBufferMemoryBlock;
+    char *recvBuffer;
+    int recvLength;
+    Loop *loop;
+    uS::Context *netContext;
+    void *user = nullptr;
+    static const int preAllocMaxSize = 1024;
+    char **preAlloc;
+    SSL_CTX *clientContext;
+
+    Async *async = nullptr;
+    pthread_t tid;
+
+    std::recursive_mutex *asyncMutex;
+    std::vector<Poll *> transferQueue;
+    std::vector<Poll *> changePollQueue;
+    static void asyncCallback(Async *async);
+
+    static int getMemoryBlockIndex(size_t length) {
+        return (length >> 4) + bool(length & 15);
+    }
+
+    char *getSmallMemoryBlock(int index) {
+        if (preAlloc[index]) {
+            char *memory = preAlloc[index];
+            preAlloc[index] = nullptr;
+            return memory;
+        } else {
+            return new char[index << 4];
+        }
+    }
+
+    void freeSmallMemoryBlock(char *memory, int index) {
+        if (!preAlloc[index]) {
+            preAlloc[index] = memory;
+        } else {
+            delete [] memory;
+        }
+    }
+
+public:
+    void addAsync() {
+        async = new Async(loop);
+        async->setData(this);
+        async->start(NodeData::asyncCallback);
+    }
+
+    void clearPendingPollChanges(Poll *p) {
+        asyncMutex->lock();
+        changePollQueue.erase(
+            std::remove(changePollQueue.begin(), changePollQueue.end(), p),
+            changePollQueue.end()
+        );
+        asyncMutex->unlock();
+    }
+};
+
+}
+
+#endif // NETWORKING_UWS_H
diff --git a/wrt/node_modules/uws/src/Node.cpp b/wrt/node_modules/uws/src/Node.cpp
new file mode 100644 (file)
index 0000000..cd20e79
--- /dev/null
@@ -0,0 +1,83 @@
+#include "Node.h"
+
+namespace uS {
+
+// this should be Node
+void NodeData::asyncCallback(Async *async)
+{
+    NodeData *nodeData = (NodeData *) async->getData();
+
+    nodeData->asyncMutex->lock();
+    for (Poll *p : nodeData->transferQueue) {
+        Socket *s = (Socket *) p;
+        TransferData *transferData = (TransferData *) s->getUserData();
+
+        s->reInit(nodeData->loop, transferData->fd);
+        s->setCb(transferData->pollCb);
+        s->start(nodeData->loop, s, s->setPoll(transferData->pollEvents));
+
+        s->nodeData = transferData->destination;
+        s->setUserData(transferData->userData);
+        auto *transferCb = transferData->transferCb;
+
+        delete transferData;
+        transferCb(s);
+    }
+
+    for (Poll *p : nodeData->changePollQueue) {
+        Socket *s = (Socket *) p;
+        s->change(s->nodeData->loop, s, s->getPoll());
+    }
+
+    nodeData->changePollQueue.clear();
+    nodeData->transferQueue.clear();
+    nodeData->asyncMutex->unlock();
+}
+
+Node::Node(int recvLength, int prePadding, int postPadding, bool useDefaultLoop) {
+    nodeData = new NodeData;
+    nodeData->recvBufferMemoryBlock = new char[recvLength];
+    nodeData->recvBuffer = nodeData->recvBufferMemoryBlock + prePadding;
+    nodeData->recvLength = recvLength - prePadding - postPadding;
+
+    nodeData->tid = pthread_self();
+    loop = Loop::createLoop(useDefaultLoop);
+
+    // each node has a context
+    nodeData->netContext = new Context();
+
+    nodeData->loop = loop;
+    nodeData->asyncMutex = &asyncMutex;
+
+    int indices = NodeData::getMemoryBlockIndex(NodeData::preAllocMaxSize) + 1;
+    nodeData->preAlloc = new char*[indices];
+    for (int i = 0; i < indices; i++) {
+        nodeData->preAlloc[i] = nullptr;
+    }
+
+    nodeData->clientContext = SSL_CTX_new(SSLv23_client_method());
+    SSL_CTX_set_options(nodeData->clientContext, SSL_OP_NO_SSLv3);
+}
+
+void Node::run() {
+    nodeData->tid = pthread_self();
+    loop->run();
+}
+
+Node::~Node() {
+    delete [] nodeData->recvBufferMemoryBlock;
+    SSL_CTX_free(nodeData->clientContext);
+
+    int indices = NodeData::getMemoryBlockIndex(NodeData::preAllocMaxSize) + 1;
+    for (int i = 0; i < indices; i++) {
+        if (nodeData->preAlloc[i]) {
+            delete [] nodeData->preAlloc[i];
+        }
+    }
+    delete [] nodeData->preAlloc;
+    delete nodeData->netContext;
+    delete nodeData;
+    loop->destroy();
+}
+
+}
diff --git a/wrt/node_modules/uws/src/Node.h b/wrt/node_modules/uws/src/Node.h
new file mode 100644 (file)
index 0000000..3c4d3be
--- /dev/null
@@ -0,0 +1,198 @@
+#ifndef NODE_UWS_H
+#define NODE_UWS_H
+
+#include "Socket.h"
+#include <vector>
+#include <mutex>
+
+namespace uS {
+
+enum ListenOptions : int {
+    REUSE_PORT = 1,
+    ONLY_IPV4 = 2
+};
+
+class WIN32_EXPORT Node {
+private:
+    template <void C(Socket *p, bool error)>
+    static void connect_cb(Poll *p, int status, int events) {
+        C((Socket *) p, status < 0);
+    }
+
+    template <void A(Socket *s)>
+    static void accept_poll_cb(Poll *p, int status, int events) {
+        ListenSocket *listenData = (ListenSocket *) p;
+        accept_cb<A, false>(listenData);
+    }
+
+    template <void A(Socket *s)>
+    static void accept_timer_cb(Timer *p) {
+        ListenSocket *listenData = (ListenSocket *) p->getData();
+        accept_cb<A, true>(listenData);
+    }
+
+    template <void A(Socket *s), bool TIMER>
+    static void accept_cb(ListenSocket *listenSocket) {
+        uv_os_sock_t serverFd = listenSocket->getFd();
+        Context *netContext = listenSocket->nodeData->netContext;
+        uv_os_sock_t clientFd = netContext->acceptSocket(serverFd);
+        if (clientFd == INVALID_SOCKET) {
+            /*
+            * If accept is failing, the pending connection won't be removed and the
+            * polling will cause the server to spin, using 100% cpu. Switch to a timer
+            * event instead to avoid this.
+            */
+            if (!TIMER && !netContext->wouldBlock()) {
+                listenSocket->stop(listenSocket->nodeData->loop);
+
+                listenSocket->timer = new Timer(listenSocket->nodeData->loop);
+                listenSocket->timer->setData(listenSocket);
+                listenSocket->timer->start(accept_timer_cb<A>, 1000, 1000);
+            }
+            return;
+        } else if (TIMER) {
+            listenSocket->timer->stop();
+            listenSocket->timer->close();
+            listenSocket->timer = nullptr;
+
+            listenSocket->setCb(accept_poll_cb<A>);
+            listenSocket->start(listenSocket->nodeData->loop, listenSocket, UV_READABLE);
+        }
+        do {
+            SSL *ssl = nullptr;
+            if (listenSocket->sslContext) {
+                ssl = SSL_new(listenSocket->sslContext.getNativeContext());
+                SSL_set_accept_state(ssl);
+            }
+
+            Socket *socket = new Socket(listenSocket->nodeData, listenSocket->nodeData->loop, clientFd, ssl);
+            socket->setPoll(UV_READABLE);
+            A(socket);
+        } while ((clientFd = netContext->acceptSocket(serverFd)) != INVALID_SOCKET);
+    }
+
+protected:
+    Loop *loop;
+    NodeData *nodeData;
+    std::recursive_mutex asyncMutex;
+
+public:
+    Node(int recvLength = 1024, int prePadding = 0, int postPadding = 0, bool useDefaultLoop = false);
+    ~Node();
+    void run();
+
+    Loop *getLoop() {
+        return loop;
+    }
+
+    template <uS::Socket *I(Socket *s), void C(Socket *p, bool error)>
+    Socket *connect(const char *hostname, int port, bool secure, NodeData *nodeData) {
+        Context *netContext = nodeData->netContext;
+
+        addrinfo hints, *result;
+        memset(&hints, 0, sizeof(addrinfo));
+        hints.ai_family = AF_UNSPEC;
+        hints.ai_socktype = SOCK_STREAM;
+        if (getaddrinfo(hostname, std::to_string(port).c_str(), &hints, &result) != 0) {
+            return nullptr;
+        }
+
+        uv_os_sock_t fd = netContext->createSocket(result->ai_family, result->ai_socktype, result->ai_protocol);
+        if (fd == INVALID_SOCKET) {
+            freeaddrinfo(result);
+            return nullptr;
+        }
+
+        ::connect(fd, result->ai_addr, result->ai_addrlen);
+        freeaddrinfo(result);
+
+        SSL *ssl = nullptr;
+        if (secure) {
+            ssl = SSL_new(nodeData->clientContext);
+            SSL_set_connect_state(ssl);
+            SSL_set_tlsext_host_name(ssl, hostname);
+        }
+
+        Socket initialSocket(nodeData, getLoop(), fd, ssl);
+        uS::Socket *socket = I(&initialSocket);
+
+        socket->setCb(connect_cb<C>);
+        socket->start(loop, socket, socket->setPoll(UV_WRITABLE));
+        return socket;
+    }
+
+    // todo: hostname, backlog
+    template <void A(Socket *s)>
+    bool listen(const char *host, int port, uS::TLS::Context sslContext, int options, uS::NodeData *nodeData, void *user) {
+        addrinfo hints, *result;
+        memset(&hints, 0, sizeof(addrinfo));
+
+        hints.ai_flags = AI_PASSIVE;
+        hints.ai_family = AF_UNSPEC;
+        hints.ai_socktype = SOCK_STREAM;
+
+        Context *netContext = nodeData->netContext;
+
+        if (getaddrinfo(host, std::to_string(port).c_str(), &hints, &result)) {
+            return true;
+        }
+
+        uv_os_sock_t listenFd = SOCKET_ERROR;
+        addrinfo *listenAddr;
+        if ((options & uS::ONLY_IPV4) == 0) {
+            for (addrinfo *a = result; a && listenFd == SOCKET_ERROR; a = a->ai_next) {
+                if (a->ai_family == AF_INET6) {
+                    listenFd = netContext->createSocket(a->ai_family, a->ai_socktype, a->ai_protocol);
+                    listenAddr = a;
+                }
+            }
+        }
+
+        for (addrinfo *a = result; a && listenFd == SOCKET_ERROR; a = a->ai_next) {
+            if (a->ai_family == AF_INET) {
+                listenFd = netContext->createSocket(a->ai_family, a->ai_socktype, a->ai_protocol);
+                listenAddr = a;
+            }
+        }
+
+        if (listenFd == SOCKET_ERROR) {
+            freeaddrinfo(result);
+            return true;
+        }
+
+#ifdef __linux
+#ifdef SO_REUSEPORT
+        if (options & REUSE_PORT) {
+            int optval = 1;
+            setsockopt(listenFd, SOL_SOCKET, SO_REUSEPORT, &optval, sizeof(optval));
+        }
+#endif
+#endif
+
+        int enabled = true;
+        setsockopt(listenFd, SOL_SOCKET, SO_REUSEADDR, &enabled, sizeof(enabled));
+
+        if (bind(listenFd, listenAddr->ai_addr, listenAddr->ai_addrlen) || ::listen(listenFd, 512)) {
+            netContext->closeSocket(listenFd);
+            freeaddrinfo(result);
+            return true;
+        }
+
+        ListenSocket *listenSocket = new ListenSocket(nodeData, loop, listenFd, nullptr);
+        listenSocket->sslContext = sslContext;
+        listenSocket->nodeData = nodeData;
+
+        listenSocket->setCb(accept_poll_cb<A>);
+        listenSocket->start(loop, listenSocket, UV_READABLE);
+
+        // should be vector of listen data! one group can have many listeners!
+        nodeData->user = listenSocket;
+
+        freeaddrinfo(result);
+        return false;
+    }
+};
+
+}
+
+#endif // NODE_UWS_H
diff --git a/wrt/node_modules/uws/src/Socket.cpp b/wrt/node_modules/uws/src/Socket.cpp
new file mode 100644 (file)
index 0000000..c35bbf8
--- /dev/null
@@ -0,0 +1,28 @@
+#include "Socket.h"
+
+namespace uS {
+
+Socket::Address Socket::getAddress()
+{
+    uv_os_sock_t fd = getFd();
+
+    sockaddr_storage addr;
+    socklen_t addrLength = sizeof(addr);
+    if (getpeername(fd, (sockaddr *) &addr, &addrLength) == -1) {
+        return {0, "", ""};
+    }
+
+    static __thread char buf[INET6_ADDRSTRLEN];
+
+    if (addr.ss_family == AF_INET) {
+        sockaddr_in *ipv4 = (sockaddr_in *) &addr;
+        inet_ntop(AF_INET, &ipv4->sin_addr, buf, sizeof(buf));
+        return {ntohs(ipv4->sin_port), buf, "IPv4"};
+    } else {
+        sockaddr_in6 *ipv6 = (sockaddr_in6 *) &addr;
+        inet_ntop(AF_INET6, &ipv6->sin6_addr, buf, sizeof(buf));
+        return {ntohs(ipv6->sin6_port), buf, "IPv6"};
+    }
+}
+
+}
diff --git a/wrt/node_modules/uws/src/Socket.h b/wrt/node_modules/uws/src/Socket.h
new file mode 100644 (file)
index 0000000..2179ff8
--- /dev/null
@@ -0,0 +1,507 @@
+#ifndef SOCKET_UWS_H
+#define SOCKET_UWS_H
+
+#include "Networking.h"
+
+namespace uS {
+
+struct TransferData {
+    // Connection state
+    uv_os_sock_t fd;
+    SSL *ssl;
+
+    // Poll state
+    void (*pollCb)(Poll *, int, int);
+    int pollEvents;
+
+    // User state
+    void *userData;
+
+    // Destination
+    NodeData *destination;
+    void (*transferCb)(Poll *);
+};
+
+// perfectly 64 bytes (4 + 60)
+struct WIN32_EXPORT Socket : Poll {
+protected:
+    struct {
+        int poll : 4;
+        int shuttingDown : 4;
+    } state = {0, false};
+
+    SSL *ssl;
+    void *user = nullptr;
+    NodeData *nodeData;
+
+    // this is not needed by HttpSocket!
+    struct Queue {
+        struct Message {
+            const char *data;
+            size_t length;
+            Message *nextMessage = nullptr;
+            void (*callback)(void *socket, void *data, bool cancelled, void *reserved) = nullptr;
+            void *callbackData = nullptr, *reserved = nullptr;
+        };
+
+        Message *head = nullptr, *tail = nullptr;
+        void pop()
+        {
+            Message *nextMessage;
+            if ((nextMessage = head->nextMessage)) {
+                delete [] (char *) head;
+                head = nextMessage;
+            } else {
+                delete [] (char *) head;
+                head = tail = nullptr;
+            }
+        }
+
+        bool empty() {return head == nullptr;}
+        Message *front() {return head;}
+
+        void push(Message *message)
+        {
+            message->nextMessage = nullptr;
+            if (tail) {
+                tail->nextMessage = message;
+                tail = message;
+            } else {
+                head = message;
+                tail = message;
+            }
+        }
+    } messageQueue;
+
+    int getPoll() {
+        return state.poll;
+    }
+
+    int setPoll(int poll) {
+        state.poll = poll;
+        return poll;
+    }
+
+    void setShuttingDown(bool shuttingDown) {
+        state.shuttingDown = shuttingDown;
+    }
+
+    void transfer(NodeData *nodeData, void (*cb)(Poll *)) {
+        // userData is invalid from now on till onTransfer
+        setUserData(new TransferData({getFd(), ssl, getCb(), getPoll(), getUserData(), nodeData, cb}));
+        stop(this->nodeData->loop);
+        close(this->nodeData->loop, [](Poll *p) {
+            Socket *s = (Socket *) p;
+            TransferData *transferData = (TransferData *) s->getUserData();
+
+            transferData->destination->asyncMutex->lock();
+            bool wasEmpty = transferData->destination->transferQueue.empty();
+            transferData->destination->transferQueue.push_back(s);
+            transferData->destination->asyncMutex->unlock();
+
+            if (wasEmpty) {
+                transferData->destination->async->send();
+            }
+        });
+    }
+
+    void changePoll(Socket *socket) {
+        if (!threadSafeChange(nodeData->loop, this, socket->getPoll())) {
+            if (socket->nodeData->tid != pthread_self()) {
+                socket->nodeData->asyncMutex->lock();
+                socket->nodeData->changePollQueue.push_back(socket);
+                socket->nodeData->asyncMutex->unlock();
+                socket->nodeData->async->send();
+            } else {
+                change(socket->nodeData->loop, socket, socket->getPoll());
+            }
+        }
+    }
+
+    // clears user data!
+    template <void onTimeout(Socket *)>
+    void startTimeout(int timeoutMs = 15000) {
+        Timer *timer = new Timer(nodeData->loop);
+        timer->setData(this);
+        timer->start([](Timer *timer) {
+            Socket *s = (Socket *) timer->getData();
+            s->cancelTimeout();
+            onTimeout(s);
+        }, timeoutMs, 0);
+
+        user = timer;
+    }
+
+    void cancelTimeout() {
+        Timer *timer = (Timer *) getUserData();
+        if (timer) {
+            timer->stop();
+            timer->close();
+            user = nullptr;
+        }
+    }
+
+    template <class STATE>
+    static void sslIoHandler(Poll *p, int status, int events) {
+        Socket *socket = (Socket *) p;
+
+        if (status < 0) {
+            STATE::onEnd((Socket *) p);
+            return;
+        }
+
+        if (!socket->messageQueue.empty() && ((events & UV_WRITABLE) || SSL_want(socket->ssl) == SSL_READING)) {
+            socket->cork(true);
+            while (true) {
+                Queue::Message *messagePtr = socket->messageQueue.front();
+                int sent = SSL_write(socket->ssl, messagePtr->data, messagePtr->length);
+                if (sent == (ssize_t) messagePtr->length) {
+                    if (messagePtr->callback) {
+                        messagePtr->callback(p, messagePtr->callbackData, false, messagePtr->reserved);
+                    }
+                    socket->messageQueue.pop();
+                    if (socket->messageQueue.empty()) {
+                        if ((socket->state.poll & UV_WRITABLE) && SSL_want(socket->ssl) != SSL_WRITING) {
+                            socket->change(socket->nodeData->loop, socket, socket->setPoll(UV_READABLE));
+                        }
+                        break;
+                    }
+                } else if (sent <= 0) {
+                    switch (SSL_get_error(socket->ssl, sent)) {
+                    case SSL_ERROR_WANT_READ:
+                        break;
+                    case SSL_ERROR_WANT_WRITE:
+                        if ((socket->getPoll() & UV_WRITABLE) == 0) {
+                            socket->change(socket->nodeData->loop, socket, socket->setPoll(socket->getPoll() | UV_WRITABLE));
+                        }
+                        break;
+                    default:
+                        STATE::onEnd((Socket *) p);
+                        return;
+                    }
+                    break;
+                }
+            }
+            socket->cork(false);
+        }
+
+        if (events & UV_READABLE) {
+            do {
+                int length = SSL_read(socket->ssl, socket->nodeData->recvBuffer, socket->nodeData->recvLength);
+                if (length <= 0) {
+                    switch (SSL_get_error(socket->ssl, length)) {
+                    case SSL_ERROR_WANT_READ:
+                        break;
+                    case SSL_ERROR_WANT_WRITE:
+                        if ((socket->getPoll() & UV_WRITABLE) == 0) {
+                            socket->change(socket->nodeData->loop, socket, socket->setPoll(socket->getPoll() | UV_WRITABLE));
+                        }
+                        break;
+                    default:
+                        STATE::onEnd((Socket *) p);
+                        return;
+                    }
+                    break;
+                } else {
+                    // Warning: onData can delete the socket! Happens when HttpSocket upgrades
+                    socket = STATE::onData((Socket *) p, socket->nodeData->recvBuffer, length);
+                    if (socket->isClosed() || socket->isShuttingDown()) {
+                        return;
+                    }
+                }
+            } while (SSL_pending(socket->ssl));
+        }
+    }
+
+    template <class STATE>
+    static void ioHandler(Poll *p, int status, int events) {
+        Socket *socket = (Socket *) p;
+        NodeData *nodeData = socket->nodeData;
+        Context *netContext = nodeData->netContext;
+
+        if (status < 0) {
+            STATE::onEnd((Socket *) p);
+            return;
+        }
+
+        if (events & UV_WRITABLE) {
+            if (!socket->messageQueue.empty() && (events & UV_WRITABLE)) {
+                socket->cork(true);
+                while (true) {
+                    Queue::Message *messagePtr = socket->messageQueue.front();
+                    ssize_t sent = ::send(socket->getFd(), messagePtr->data, messagePtr->length, MSG_NOSIGNAL);
+                    if (sent == (ssize_t) messagePtr->length) {
+                        if (messagePtr->callback) {
+                            messagePtr->callback(p, messagePtr->callbackData, false, messagePtr->reserved);
+                        }
+                        socket->messageQueue.pop();
+                        if (socket->messageQueue.empty()) {
+                            // todo, remove bit, don't set directly
+                            socket->change(socket->nodeData->loop, socket, socket->setPoll(UV_READABLE));
+                            break;
+                        }
+                    } else if (sent == SOCKET_ERROR) {
+                        if (!netContext->wouldBlock()) {
+                            STATE::onEnd((Socket *) p);
+                            return;
+                        }
+                        break;
+                    } else {
+                        messagePtr->length -= sent;
+                        messagePtr->data += sent;
+                        break;
+                    }
+                }
+                socket->cork(false);
+            }
+        }
+
+        if (events & UV_READABLE) {
+            int length = recv(socket->getFd(), nodeData->recvBuffer, nodeData->recvLength, 0);
+            if (length > 0) {
+                STATE::onData((Socket *) p, nodeData->recvBuffer, length);
+            } else if (length <= 0 || (length == SOCKET_ERROR && !netContext->wouldBlock())) {
+                STATE::onEnd((Socket *) p);
+            }
+        }
+
+    }
+
+    template<class STATE>
+    void setState() {
+        if (ssl) {
+            setCb(sslIoHandler<STATE>);
+        } else {
+            setCb(ioHandler<STATE>);
+        }
+    }
+
+    bool hasEmptyQueue() {
+        return messageQueue.empty();
+    }
+
+    void enqueue(Queue::Message *message) {
+        messageQueue.push(message);
+    }
+
+    Queue::Message *allocMessage(size_t length, const char *data = 0) {
+        Queue::Message *messagePtr = (Queue::Message *) new char[sizeof(Queue::Message) + length];
+        messagePtr->length = length;
+        messagePtr->data = ((char *) messagePtr) + sizeof(Queue::Message);
+        messagePtr->nextMessage = nullptr;
+
+        if (data) {
+            memcpy((char *) messagePtr->data, data, messagePtr->length);
+        }
+
+        return messagePtr;
+    }
+
+    void freeMessage(Queue::Message *message) {
+        delete [] (char *) message;
+    }
+
+    bool write(Queue::Message *message, bool &wasTransferred) {
+        ssize_t sent = 0;
+        if (messageQueue.empty()) {
+
+            if (ssl) {
+                sent = SSL_write(ssl, message->data, message->length);
+                if (sent == (ssize_t) message->length) {
+                    wasTransferred = false;
+                    return true;
+                } else if (sent < 0) {
+                    switch (SSL_get_error(ssl, sent)) {
+                    case SSL_ERROR_WANT_READ:
+                        break;
+                    case SSL_ERROR_WANT_WRITE:
+                        if ((getPoll() & UV_WRITABLE) == 0) {
+                            setPoll(getPoll() | UV_WRITABLE);
+                            changePoll(this);
+                        }
+                        break;
+                    default:
+                        return false;
+                    }
+                }
+            } else {
+                sent = ::send(getFd(), message->data, message->length, MSG_NOSIGNAL);
+                if (sent == (ssize_t) message->length) {
+                    wasTransferred = false;
+                    return true;
+                } else if (sent == SOCKET_ERROR) {
+                    if (!nodeData->netContext->wouldBlock()) {
+                        return false;
+                    }
+                } else {
+                    message->length -= sent;
+                    message->data += sent;
+                }
+
+                if ((getPoll() & UV_WRITABLE) == 0) {
+                    setPoll(getPoll() | UV_WRITABLE);
+                    changePoll(this);
+                }
+            }
+        }
+        messageQueue.push(message);
+        wasTransferred = true;
+        return true;
+    }
+
+    template <class T, class D>
+    void sendTransformed(const char *message, size_t length, void(*callback)(void *socket, void *data, bool cancelled, void *reserved), void *callbackData, D transformData) {
+        size_t estimatedLength = T::estimate(message, length) + sizeof(Queue::Message);
+
+        if (hasEmptyQueue()) {
+            if (estimatedLength <= uS::NodeData::preAllocMaxSize) {
+                int memoryLength = estimatedLength;
+                int memoryIndex = nodeData->getMemoryBlockIndex(memoryLength);
+
+                Queue::Message *messagePtr = (Queue::Message *) nodeData->getSmallMemoryBlock(memoryIndex);
+                messagePtr->data = ((char *) messagePtr) + sizeof(Queue::Message);
+                messagePtr->length = T::transform(message, (char *) messagePtr->data, length, transformData);
+
+                bool wasTransferred;
+                if (write(messagePtr, wasTransferred)) {
+                    if (!wasTransferred) {
+                        nodeData->freeSmallMemoryBlock((char *) messagePtr, memoryIndex);
+                        if (callback) {
+                            callback(this, callbackData, false, nullptr);
+                        }
+                    } else {
+                        messagePtr->callback = callback;
+                        messagePtr->callbackData = callbackData;
+                    }
+                } else {
+                    nodeData->freeSmallMemoryBlock((char *) messagePtr, memoryIndex);
+                    if (callback) {
+                        callback(this, callbackData, true, nullptr);
+                    }
+                }
+            } else {
+                Queue::Message *messagePtr = allocMessage(estimatedLength - sizeof(Queue::Message));
+                messagePtr->length = T::transform(message, (char *) messagePtr->data, length, transformData);
+
+                bool wasTransferred;
+                if (write(messagePtr, wasTransferred)) {
+                    if (!wasTransferred) {
+                        freeMessage(messagePtr);
+                        if (callback) {
+                            callback(this, callbackData, false, nullptr);
+                        }
+                    } else {
+                        messagePtr->callback = callback;
+                        messagePtr->callbackData = callbackData;
+                    }
+                } else {
+                    freeMessage(messagePtr);
+                    if (callback) {
+                        callback(this, callbackData, true, nullptr);
+                    }
+                }
+            }
+        } else {
+            Queue::Message *messagePtr = allocMessage(estimatedLength - sizeof(Queue::Message));
+            messagePtr->length = T::transform(message, (char *) messagePtr->data, length, transformData);
+            messagePtr->callback = callback;
+            messagePtr->callbackData = callbackData;
+            enqueue(messagePtr);
+        }
+    }
+
+public:
+    Socket(NodeData *nodeData, Loop *loop, uv_os_sock_t fd, SSL *ssl) : Poll(loop, fd), ssl(ssl), nodeData(nodeData) {
+        if (ssl) {
+            // OpenSSL treats SOCKETs as int
+            SSL_set_fd(ssl, (int) fd);
+            SSL_set_mode(ssl, SSL_MODE_RELEASE_BUFFERS);
+        }
+    }
+
+    NodeData *getNodeData() {
+        return nodeData;
+    }
+
+    Poll *next = nullptr, *prev = nullptr;
+
+    void *getUserData() {
+        return user;
+    }
+
+    void setUserData(void *user) {
+        this->user = user;
+    }
+
+    struct Address {
+        unsigned int port;
+        const char *address;
+        const char *family;
+    };
+
+    Address getAddress();
+
+    void setNoDelay(int enable) {
+        setsockopt(getFd(), IPPROTO_TCP, TCP_NODELAY, &enable, sizeof(int));
+    }
+
+    void cork(int enable) {
+#if defined(TCP_CORK)
+        // Linux & SmartOS have proper TCP_CORK
+        setsockopt(getFd(), IPPROTO_TCP, TCP_CORK, &enable, sizeof(int));
+#elif defined(TCP_NOPUSH)
+        // Mac OS X & FreeBSD have TCP_NOPUSH
+        setsockopt(getFd(), IPPROTO_TCP, TCP_NOPUSH, &enable, sizeof(int));
+        if (!enable) {
+            // Tested on OS X, FreeBSD situation is unclear
+            ::send(getFd(), "", 0, MSG_NOSIGNAL);
+        }
+#endif
+    }
+
+    void shutdown() {
+        if (ssl) {
+            //todo: poll in/out - have the io_cb recall shutdown if failed
+            SSL_shutdown(ssl);
+        } else {
+            ::shutdown(getFd(), SHUT_WR);
+        }
+    }
+
+    template <class T>
+    void closeSocket() {
+        uv_os_sock_t fd = getFd();
+        Context *netContext = nodeData->netContext;
+        stop(nodeData->loop);
+        netContext->closeSocket(fd);
+
+        if (ssl) {
+            SSL_free(ssl);
+        }
+
+        Poll::close(nodeData->loop, [](Poll *p) {
+            delete (T *) p;
+        });
+    }
+
+    bool isShuttingDown() {
+        return state.shuttingDown;
+    }
+
+    friend class Node;
+    friend struct NodeData;
+};
+
+struct ListenSocket : Socket {
+
+    ListenSocket(NodeData *nodeData, Loop *loop, uv_os_sock_t fd, SSL *ssl) : Socket(nodeData, loop, fd, ssl) {
+
+    }
+
+    Timer *timer = nullptr;
+    uS::TLS::Context sslContext;
+};
+
+}
+
+#endif // SOCKET_UWS_H
diff --git a/wrt/node_modules/uws/src/WebSocket.cpp b/wrt/node_modules/uws/src/WebSocket.cpp
new file mode 100644 (file)
index 0000000..89ac23a
--- /dev/null
@@ -0,0 +1,405 @@
+#include "WebSocket.h"
+#include "Group.h"
+#include "Hub.h"
+
+namespace uWS {
+
+/*
+ * Frames and sends a WebSocket message.
+ *
+ * Hints: Consider using any of the prepare function if any of their
+ * use cases match what you are trying to achieve (pub/sub, broadcast)
+ *
+ * Thread safe
+ *
+ */
+template <bool isServer>
+void WebSocket<isServer>::send(const char *message, size_t length, OpCode opCode, void(*callback)(WebSocket<isServer> *webSocket, void *data, bool cancelled, void *reserved), void *callbackData) {
+
+#ifdef UWS_THREADSAFE
+    std::lock_guard<std::recursive_mutex> lockGuard(*nodeData->asyncMutex);
+    if (isClosed()) {
+        if (callback) {
+            callback(this, callbackData, true, nullptr);
+        }
+        return;
+    }
+#endif
+
+    const int HEADER_LENGTH = WebSocketProtocol<!isServer, WebSocket<!isServer>>::LONG_MESSAGE_HEADER;
+
+    struct TransformData {
+        OpCode opCode;
+    } transformData = {opCode};
+
+    struct WebSocketTransformer {
+        static size_t estimate(const char *data, size_t length) {
+            return length + HEADER_LENGTH;
+        }
+
+        static size_t transform(const char *src, char *dst, size_t length, TransformData transformData) {
+            return WebSocketProtocol<isServer, WebSocket<isServer>>::formatMessage(dst, src, length, transformData.opCode, length, false);
+        }
+    };
+
+    sendTransformed<WebSocketTransformer>((char *) message, length, (void(*)(void *, void *, bool, void *)) callback, callbackData, transformData);
+}
+
+/*
+ * Prepares a single message for use with sendPrepared.
+ *
+ * Hints: Useful in cases where you need to send the same message to many
+ * recipients. Do not use when only sending one message.
+ *
+ * Thread safe
+ *
+ */
+template <bool isServer>
+typename WebSocket<isServer>::PreparedMessage *WebSocket<isServer>::prepareMessage(char *data, size_t length, OpCode opCode, bool compressed, void(*callback)(WebSocket<isServer> *webSocket, void *data, bool cancelled, void *reserved)) {
+    PreparedMessage *preparedMessage = new PreparedMessage;
+    preparedMessage->buffer = new char[length + 10];
+    preparedMessage->length = WebSocketProtocol<isServer, WebSocket<isServer>>::formatMessage(preparedMessage->buffer, data, length, opCode, length, compressed);
+    preparedMessage->references = 1;
+    preparedMessage->callback = (void(*)(void *, void *, bool, void *)) callback;
+    return preparedMessage;
+}
+
+/*
+ * Prepares a batch of messages to send as one single TCP packet / syscall.
+ *
+ * Hints: Useful when doing pub/sub-like broadcasts where many recipients should receive many
+ * messages. Do not use if only sending one message.
+ *
+ * Thread safe
+ *
+ */
+template <bool isServer>
+typename WebSocket<isServer>::PreparedMessage *WebSocket<isServer>::prepareMessageBatch(std::vector<std::string> &messages, std::vector<int> &excludedMessages, OpCode opCode, bool compressed, void (*callback)(WebSocket<isServer> *, void *, bool, void *))
+{
+    // should be sent in!
+    size_t batchLength = 0;
+    for (size_t i = 0; i < messages.size(); i++) {
+        batchLength += messages[i].length();
+    }
+
+    PreparedMessage *preparedMessage = new PreparedMessage;
+    preparedMessage->buffer = new char[batchLength + 10 * messages.size()];
+
+    int offset = 0;
+    for (size_t i = 0; i < messages.size(); i++) {
+        offset += WebSocketProtocol<isServer, WebSocket<isServer>>::formatMessage(preparedMessage->buffer + offset, messages[i].data(), messages[i].length(), opCode, messages[i].length(), compressed);
+    }
+    preparedMessage->length = offset;
+    preparedMessage->references = 1;
+    preparedMessage->callback = (void(*)(void *, void *, bool, void *)) callback;
+    return preparedMessage;
+}
+
+/*
+ * Sends a prepared message.
+ *
+ * Hints: Used to improve broadcasting and similar use cases where the same
+ * message is sent to multiple recipients. Do not used if only sending one message
+ * in total.
+ *
+ * Warning: Modifies passed PreparedMessage and is thus not thread safe. Other
+ * data is also modified and it makes sense to not make this function thread-safe
+ * since it is a central part in broadcasting and other high-perf code paths.
+ *
+ */
+template <bool isServer>
+void WebSocket<isServer>::sendPrepared(typename WebSocket<isServer>::PreparedMessage *preparedMessage, void *callbackData) {
+    // todo: see if this can be made a transformer instead
+    preparedMessage->references++;
+    void (*callback)(void *webSocket, void *userData, bool cancelled, void *reserved) = [](void *webSocket, void *userData, bool cancelled, void *reserved) {
+        PreparedMessage *preparedMessage = (PreparedMessage *) userData;
+        bool lastReference = !--preparedMessage->references;
+
+        if (preparedMessage->callback) {
+            preparedMessage->callback(webSocket, reserved, cancelled, (void *) lastReference);
+        }
+
+        if (lastReference) {
+            delete [] preparedMessage->buffer;
+            delete preparedMessage;
+        }
+    };
+
+    // candidate for fixed size pool allocator
+    int memoryLength = sizeof(Queue::Message);
+    int memoryIndex = nodeData->getMemoryBlockIndex(memoryLength);
+
+    Queue::Message *messagePtr = (Queue::Message *) nodeData->getSmallMemoryBlock(memoryIndex);
+    messagePtr->data = preparedMessage->buffer;
+    messagePtr->length = preparedMessage->length;
+
+    bool wasTransferred;
+    if (write(messagePtr, wasTransferred)) {
+        if (!wasTransferred) {
+            nodeData->freeSmallMemoryBlock((char *) messagePtr, memoryIndex);
+            if (callback) {
+                callback(this, preparedMessage, false, callbackData);
+            }
+        } else {
+            messagePtr->callback = callback;
+            messagePtr->callbackData = preparedMessage;
+            messagePtr->reserved = callbackData;
+        }
+    } else {
+        nodeData->freeSmallMemoryBlock((char *) messagePtr, memoryIndex);
+        if (callback) {
+            callback(this, preparedMessage, true, callbackData);
+        }
+    }
+}
+
+/*
+ * Decrements the reference count of passed PreparedMessage. On zero references
+ * the memory will be deleted.
+ *
+ * Hints: Used together with prepareMessage, prepareMessageBatch and similar calls.
+ *
+ * Warning: Will modify passed PrepareMessage and is thus not thread safe by itself.
+ *
+ */
+template <bool isServer>
+void WebSocket<isServer>::finalizeMessage(typename WebSocket<isServer>::PreparedMessage *preparedMessage) {
+    if (!--preparedMessage->references) {
+        delete [] preparedMessage->buffer;
+        delete preparedMessage;
+    }
+}
+
+template <bool isServer>
+uS::Socket *WebSocket<isServer>::onData(uS::Socket *s, char *data, size_t length) {
+    WebSocket<isServer> *webSocket = static_cast<WebSocket<isServer> *>(s);
+
+    webSocket->hasOutstandingPong = false;
+    if (!webSocket->isShuttingDown()) {
+        webSocket->cork(true);
+        WebSocketProtocol<isServer, WebSocket<isServer>>::consume(data, length, webSocket);
+        if (!webSocket->isClosed()) {
+            webSocket->cork(false);
+        }
+    }
+
+    return webSocket;
+}
+
+/*
+ * Immediately terminates this WebSocket. Will call onDisconnection of its Group.
+ *
+ * Hints: Close code will be 1006 and message will be empty.
+ *
+ */
+template <bool isServer>
+void WebSocket<isServer>::terminate() {
+
+#ifdef UWS_THREADSAFE
+    std::lock_guard<std::recursive_mutex> lockGuard(*nodeData->asyncMutex);
+    if (isClosed()) {
+        return;
+    }
+#endif
+
+    WebSocket<isServer>::onEnd(this);
+}
+
+/*
+ * Transfers this WebSocket from its current Group to specified Group.
+ *
+ * Receiving Group has to have called listen(uWS::TRANSFERS) prior.
+ *
+ * Hints: Useful to implement subprotocols on the same thread and Loop
+ * or to transfer WebSockets between threads at any point (dynamic load balancing).
+ *
+ * Warning: From the point of call to the point of onTransfer, this WebSocket
+ * is invalid and cannot be used. What you put in is not guaranteed to be what you
+ * get in onTransfer, the only guaranteed consistency is passed userData is the userData
+ * of given WebSocket in onTransfer. Use setUserData and getUserData to identify the WebSocket.
+ */
+template <bool isServer>
+void WebSocket<isServer>::transfer(Group<isServer> *group) {
+    Group<isServer>::from(this)->removeWebSocket(this);
+    if (group->loop == Group<isServer>::from(this)->loop) {
+        // fast path
+        this->nodeData = group;
+        Group<isServer>::from(this)->addWebSocket(this);
+        Group<isServer>::from(this)->transferHandler(this);
+    } else {
+        // slow path
+        uS::Socket::transfer((uS::NodeData *) group, [](Poll *p) {
+            WebSocket<isServer> *webSocket = (WebSocket<isServer> *) p;
+            Group<isServer>::from(webSocket)->addWebSocket(webSocket);
+            Group<isServer>::from(webSocket)->transferHandler(webSocket);
+        });
+    }
+}
+
+/*
+ * Immediately calls onDisconnection of its Group and begins a passive
+ * WebSocket closedown handshake in the background (might succeed or not,
+ * we don't care).
+ *
+ * Hints: Close code and message will be what you pass yourself.
+ *
+ */
+template <bool isServer>
+void WebSocket<isServer>::close(int code, const char *message, size_t length) {
+
+    // startTimeout is not thread safe
+
+    static const int MAX_CLOSE_PAYLOAD = 123;
+    length = std::min<size_t>(MAX_CLOSE_PAYLOAD, length);
+    Group<isServer>::from(this)->removeWebSocket(this);
+    Group<isServer>::from(this)->disconnectionHandler(this, code, (char *) message, length);
+    setShuttingDown(true);
+
+    // todo: using the shared timer in the group, we can skip creating a new timer per socket
+    // only this line and the one in Hub::connect uses the timeout feature
+    startTimeout<WebSocket<isServer>::onEnd>();
+
+    char closePayload[MAX_CLOSE_PAYLOAD + 2];
+    int closePayloadLength = WebSocketProtocol<isServer, WebSocket<isServer>>::formatClosePayload(closePayload, code, message, length);
+    send(closePayload, closePayloadLength, OpCode::CLOSE, [](WebSocket<isServer> *p, void *data, bool cancelled, void *reserved) {
+        if (!cancelled) {
+            p->shutdown();
+        }
+    });
+}
+
+template <bool isServer>
+void WebSocket<isServer>::onEnd(uS::Socket *s) {
+    WebSocket<isServer> *webSocket = static_cast<WebSocket<isServer> *>(s);
+
+    if (!webSocket->isShuttingDown()) {
+        Group<isServer>::from(webSocket)->removeWebSocket(webSocket);
+        Group<isServer>::from(webSocket)->disconnectionHandler(webSocket, 1006, nullptr, 0);
+    } else {
+        webSocket->cancelTimeout();
+    }
+
+    webSocket->template closeSocket<WebSocket<isServer>>();
+
+    while (!webSocket->messageQueue.empty()) {
+        Queue::Message *message = webSocket->messageQueue.front();
+        if (message->callback) {
+            message->callback(nullptr, message->callbackData, true, nullptr);
+        }
+        webSocket->messageQueue.pop();
+    }
+
+    webSocket->nodeData->clearPendingPollChanges(webSocket);
+}
+
+template <bool isServer>
+bool WebSocket<isServer>::handleFragment(char *data, size_t length, unsigned int remainingBytes, int opCode, bool fin, WebSocketState<isServer> *webSocketState) {
+    WebSocket<isServer> *webSocket = static_cast<WebSocket<isServer> *>(webSocketState);
+    Group<isServer> *group = Group<isServer>::from(webSocket);
+
+    if (opCode < 3) {
+        if (!remainingBytes && fin && !webSocket->fragmentBuffer.length()) {
+            if (webSocket->compressionStatus == WebSocket<isServer>::CompressionStatus::COMPRESSED_FRAME) {
+                    webSocket->compressionStatus = WebSocket<isServer>::CompressionStatus::ENABLED;
+                    data = group->hub->inflate(data, length, group->maxPayload);
+                    if (!data) {
+                        forceClose(webSocketState);
+                        return true;
+                    }
+            }
+
+            if (opCode == 1 && !WebSocketProtocol<isServer, WebSocket<isServer>>::isValidUtf8((unsigned char *) data, length)) {
+                forceClose(webSocketState);
+                return true;
+            }
+
+            group->messageHandler(webSocket, data, length, (OpCode) opCode);
+            if (webSocket->isClosed() || webSocket->isShuttingDown()) {
+                return true;
+            }
+        } else {
+            webSocket->fragmentBuffer.append(data, length);
+            if (!remainingBytes && fin) {
+                length = webSocket->fragmentBuffer.length();
+                if (webSocket->compressionStatus == WebSocket<isServer>::CompressionStatus::COMPRESSED_FRAME) {
+                        webSocket->compressionStatus = WebSocket<isServer>::CompressionStatus::ENABLED;
+                        webSocket->fragmentBuffer.append("....");
+                        data = group->hub->inflate((char *) webSocket->fragmentBuffer.data(), length, group->maxPayload);
+                        if (!data) {
+                            forceClose(webSocketState);
+                            return true;
+                        }
+                } else {
+                    data = (char *) webSocket->fragmentBuffer.data();
+                }
+
+                if (opCode == 1 && !WebSocketProtocol<isServer, WebSocket<isServer>>::isValidUtf8((unsigned char *) data, length)) {
+                    forceClose(webSocketState);
+                    return true;
+                }
+
+                group->messageHandler(webSocket, data, length, (OpCode) opCode);
+                if (webSocket->isClosed() || webSocket->isShuttingDown()) {
+                    return true;
+                }
+                webSocket->fragmentBuffer.clear();
+            }
+        }
+    } else {
+        if (!remainingBytes && fin && !webSocket->controlTipLength) {
+            if (opCode == CLOSE) {
+                typename WebSocketProtocol<isServer, WebSocket<isServer>>::CloseFrame closeFrame = WebSocketProtocol<isServer, WebSocket<isServer>>::parseClosePayload(data, length);
+                webSocket->close(closeFrame.code, closeFrame.message, closeFrame.length);
+                return true;
+            } else {
+                if (opCode == PING) {
+                    webSocket->send(data, length, (OpCode) OpCode::PONG);
+                    group->pingHandler(webSocket, data, length);
+                    if (webSocket->isClosed() || webSocket->isShuttingDown()) {
+                        return true;
+                    }
+                } else if (opCode == PONG) {
+                    group->pongHandler(webSocket, data, length);
+                    if (webSocket->isClosed() || webSocket->isShuttingDown()) {
+                        return true;
+                    }
+                }
+            }
+        } else {
+            webSocket->fragmentBuffer.append(data, length);
+            webSocket->controlTipLength += length;
+
+            if (!remainingBytes && fin) {
+                char *controlBuffer = (char *) webSocket->fragmentBuffer.data() + webSocket->fragmentBuffer.length() - webSocket->controlTipLength;
+                if (opCode == CLOSE) {
+                    typename WebSocketProtocol<isServer, WebSocket<isServer>>::CloseFrame closeFrame = WebSocketProtocol<isServer, WebSocket<isServer>>::parseClosePayload(controlBuffer, webSocket->controlTipLength);
+                    webSocket->close(closeFrame.code, closeFrame.message, closeFrame.length);
+                    return true;
+                } else {
+                    if (opCode == PING) {
+                        webSocket->send(controlBuffer, webSocket->controlTipLength, (OpCode) OpCode::PONG);
+                        group->pingHandler(webSocket, controlBuffer, webSocket->controlTipLength);
+                        if (webSocket->isClosed() || webSocket->isShuttingDown()) {
+                            return true;
+                        }
+                    } else if (opCode == PONG) {
+                        group->pongHandler(webSocket, controlBuffer, webSocket->controlTipLength);
+                        if (webSocket->isClosed() || webSocket->isShuttingDown()) {
+                            return true;
+                        }
+                    }
+                }
+
+                webSocket->fragmentBuffer.resize(webSocket->fragmentBuffer.length() - webSocket->controlTipLength);
+                webSocket->controlTipLength = 0;
+            }
+        }
+    }
+
+    return false;
+}
+
+template struct WebSocket<SERVER>;
+template struct WebSocket<CLIENT>;
+
+}
diff --git a/wrt/node_modules/uws/src/WebSocket.h b/wrt/node_modules/uws/src/WebSocket.h
new file mode 100644 (file)
index 0000000..9e7f547
--- /dev/null
@@ -0,0 +1,89 @@
+#ifndef WEBSOCKET_UWS_H
+#define WEBSOCKET_UWS_H
+
+#include "WebSocketProtocol.h"
+#include "Socket.h"
+
+namespace uWS {
+
+template <bool isServer>
+struct Group;
+
+template <bool isServer>
+struct HttpSocket;
+
+template <const bool isServer>
+struct WIN32_EXPORT WebSocket : uS::Socket, WebSocketState<isServer> {
+protected:
+    std::string fragmentBuffer;
+    enum CompressionStatus : char {
+        DISABLED,
+        ENABLED,
+        COMPRESSED_FRAME
+    } compressionStatus;
+    unsigned char controlTipLength = 0, hasOutstandingPong = false;
+
+    WebSocket(bool perMessageDeflate, uS::Socket *socket) : uS::Socket(std::move(*socket)) {
+        compressionStatus = perMessageDeflate ? CompressionStatus::ENABLED : CompressionStatus::DISABLED;
+    }
+
+    static uS::Socket *onData(uS::Socket *s, char *data, size_t length);
+    static void onEnd(uS::Socket *s);
+    using uS::Socket::closeSocket;
+
+    static bool refusePayloadLength(uint64_t length, WebSocketState<isServer> *webSocketState) {
+        WebSocket<isServer> *webSocket = static_cast<WebSocket<isServer> *>(webSocketState);
+        return length > Group<isServer>::from(webSocket)->maxPayload;
+    }
+
+    static bool setCompressed(WebSocketState<isServer> *webSocketState) {
+        WebSocket<isServer> *webSocket = static_cast<WebSocket<isServer> *>(webSocketState);
+
+        if (webSocket->compressionStatus == WebSocket<isServer>::CompressionStatus::ENABLED) {
+            webSocket->compressionStatus = WebSocket<isServer>::CompressionStatus::COMPRESSED_FRAME;
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    static void forceClose(WebSocketState<isServer> *webSocketState) {
+        WebSocket<isServer> *webSocket = static_cast<WebSocket<isServer> *>(webSocketState);
+        webSocket->terminate();
+    }
+
+    static bool handleFragment(char *data, size_t length, unsigned int remainingBytes, int opCode, bool fin, WebSocketState<isServer> *webSocketState);
+
+public:
+    struct PreparedMessage {
+        char *buffer;
+        size_t length;
+        int references;
+        void(*callback)(void *webSocket, void *data, bool cancelled, void *reserved);
+    };
+
+    // Not thread safe
+    void sendPrepared(PreparedMessage *preparedMessage, void *callbackData = nullptr);
+    static void finalizeMessage(PreparedMessage *preparedMessage);
+    void close(int code = 1000, const char *message = nullptr, size_t length = 0);
+    void transfer(Group<isServer> *group);
+
+    // Thread safe
+    void terminate();
+    void ping(const char *message) {send(message, OpCode::PING);}
+    void send(const char *message, OpCode opCode = OpCode::TEXT) {send(message, strlen(message), opCode);}
+    void send(const char *message, size_t length, OpCode opCode, void(*callback)(WebSocket<isServer> *webSocket, void *data, bool cancelled, void *reserved) = nullptr, void *callbackData = nullptr);
+    static PreparedMessage *prepareMessage(char *data, size_t length, OpCode opCode, bool compressed, void(*callback)(WebSocket<isServer> *webSocket, void *data, bool cancelled, void *reserved) = nullptr);
+    static PreparedMessage *prepareMessageBatch(std::vector<std::string> &messages, std::vector<int> &excludedMessages,
+                                                OpCode opCode, bool compressed, void(*callback)(WebSocket<isServer> *webSocket, void *data, bool cancelled, void *reserved) = nullptr);
+
+    friend struct Hub;
+    friend struct Group<isServer>;
+    friend struct HttpSocket<isServer>;
+    friend struct uS::Socket;
+    friend class WebSocketProtocol<isServer, WebSocket<isServer>>;
+};
+
+}
+
+#endif // WEBSOCKET_UWS_H
diff --git a/wrt/node_modules/uws/src/WebSocketProtocol.h b/wrt/node_modules/uws/src/WebSocketProtocol.h
new file mode 100644 (file)
index 0000000..b7b4695
--- /dev/null
@@ -0,0 +1,377 @@
+#ifndef WEBSOCKETPROTOCOL_UWS_H
+#define WEBSOCKETPROTOCOL_UWS_H
+
+// we do need to include this for htobe64, should be moved from networking!
+#include "Networking.h"
+
+#include <cstring>
+#include <cstdlib>
+
+namespace uWS {
+
+enum OpCode : unsigned char {
+    TEXT = 1,
+    BINARY = 2,
+    CLOSE = 8,
+    PING = 9,
+    PONG = 10
+};
+
+enum {
+    CLIENT,
+    SERVER
+};
+
+// 24 bytes perfectly
+template <bool isServer>
+struct WebSocketState {
+public:
+    static const unsigned int SHORT_MESSAGE_HEADER = isServer ? 6 : 2;
+    static const unsigned int MEDIUM_MESSAGE_HEADER = isServer ? 8 : 4;
+    static const unsigned int LONG_MESSAGE_HEADER = isServer ? 14 : 10;
+
+    // 16 bytes
+    struct State {
+        unsigned int wantsHead : 1;
+        unsigned int spillLength : 4;
+        int opStack : 2; // -1, 0, 1
+        unsigned int lastFin : 1;
+
+        // 15 bytes
+        unsigned char spill[LONG_MESSAGE_HEADER - 1];
+        OpCode opCode[2];
+
+        State() {
+            wantsHead = true;
+            spillLength = 0;
+            opStack = -1;
+            lastFin = true;
+        }
+
+    } state;
+
+    // 8 bytes
+    unsigned int remainingBytes = 0;
+    char mask[isServer ? 4 : 1];
+};
+
+template <const bool isServer, class Impl>
+class WIN32_EXPORT WebSocketProtocol {
+public:
+    static const unsigned int SHORT_MESSAGE_HEADER = isServer ? 6 : 2;
+    static const unsigned int MEDIUM_MESSAGE_HEADER = isServer ? 8 : 4;
+    static const unsigned int LONG_MESSAGE_HEADER = isServer ? 14 : 10;
+
+private:
+    static inline bool isFin(char *frame) {return *((unsigned char *) frame) & 128;}
+    static inline unsigned char getOpCode(char *frame) {return *((unsigned char *) frame) & 15;}
+    static inline unsigned char payloadLength(char *frame) {return ((unsigned char *) frame)[1] & 127;}
+    static inline bool rsv23(char *frame) {return *((unsigned char *) frame) & 48;}
+    static inline bool rsv1(char *frame) {return *((unsigned char *) frame) & 64;}
+
+    static inline void unmaskImprecise(char *dst, char *src, char *mask, unsigned int length) {
+        for (unsigned int n = (length >> 2) + 1; n; n--) {
+            *(dst++) = *(src++) ^ mask[0];
+            *(dst++) = *(src++) ^ mask[1];
+            *(dst++) = *(src++) ^ mask[2];
+            *(dst++) = *(src++) ^ mask[3];
+        }
+    }
+
+    static inline void unmaskImpreciseCopyMask(char *dst, char *src, char *maskPtr, unsigned int length) {
+        char mask[4] = {maskPtr[0], maskPtr[1], maskPtr[2], maskPtr[3]};
+        unmaskImprecise(dst, src, mask, length);
+    }
+
+    static inline void rotateMask(unsigned int offset, char *mask) {
+        char originalMask[4] = {mask[0], mask[1], mask[2], mask[3]};
+        mask[(0 + offset) % 4] = originalMask[0];
+        mask[(1 + offset) % 4] = originalMask[1];
+        mask[(2 + offset) % 4] = originalMask[2];
+        mask[(3 + offset) % 4] = originalMask[3];
+    }
+
+    static inline void unmaskInplace(char *data, char *stop, char *mask) {
+        while (data < stop) {
+            *(data++) ^= mask[0];
+            *(data++) ^= mask[1];
+            *(data++) ^= mask[2];
+            *(data++) ^= mask[3];
+        }
+    }
+
+    enum {
+        SND_CONTINUATION = 1,
+        SND_NO_FIN = 2,
+        SND_COMPRESSED = 64
+    };
+
+    template <unsigned int MESSAGE_HEADER, typename T>
+    static inline bool consumeMessage(T payLength, char *&src, unsigned int &length, WebSocketState<isServer> *wState) {
+        if (getOpCode(src)) {
+            if (wState->state.opStack == 1 || (!wState->state.lastFin && getOpCode(src) < 2)) {
+                Impl::forceClose(wState);
+                return true;
+            }
+            wState->state.opCode[++wState->state.opStack] = (OpCode) getOpCode(src);
+        } else if (wState->state.opStack == -1) {
+            Impl::forceClose(wState);
+            return true;
+        }
+        wState->state.lastFin = isFin(src);
+
+        if (Impl::refusePayloadLength(payLength, wState)) {
+            Impl::forceClose(wState);
+            return true;
+        }
+
+        if (payLength + MESSAGE_HEADER <= length) {
+            if (isServer) {
+                unmaskImpreciseCopyMask(src + MESSAGE_HEADER - 4, src + MESSAGE_HEADER, src + MESSAGE_HEADER - 4, payLength);
+                if (Impl::handleFragment(src + MESSAGE_HEADER - 4, payLength, 0, wState->state.opCode[wState->state.opStack], isFin(src), wState)) {
+                    return true;
+                }
+            } else {
+                if (Impl::handleFragment(src + MESSAGE_HEADER, payLength, 0, wState->state.opCode[wState->state.opStack], isFin(src), wState)) {
+                    return true;
+                }
+            }
+
+            if (isFin(src)) {
+                wState->state.opStack--;
+            }
+
+            src += payLength + MESSAGE_HEADER;
+            length -= payLength + MESSAGE_HEADER;
+            wState->state.spillLength = 0;
+            return false;
+        } else {
+            wState->state.spillLength = 0;
+            wState->state.wantsHead = false;
+            wState->remainingBytes = payLength - length + MESSAGE_HEADER;
+            bool fin = isFin(src);
+            if (isServer) {
+                memcpy(wState->mask, src + MESSAGE_HEADER - 4, 4);
+                unmaskImprecise(src, src + MESSAGE_HEADER, wState->mask, length - MESSAGE_HEADER);
+                rotateMask(4 - (length - MESSAGE_HEADER) % 4, wState->mask);
+            } else {
+                src += MESSAGE_HEADER;
+            }
+            Impl::handleFragment(src, length - MESSAGE_HEADER, wState->remainingBytes, wState->state.opCode[wState->state.opStack], fin, wState);
+            return true;
+        }
+    }
+
+    static inline bool consumeContinuation(char *&src, unsigned int &length, WebSocketState<isServer> *wState) {
+        if (wState->remainingBytes <= length) {
+            if (isServer) {
+                int n = wState->remainingBytes >> 2;
+                unmaskInplace(src, src + n * 4, wState->mask);
+                for (int i = 0, s = wState->remainingBytes % 4; i < s; i++) {
+                    src[n * 4 + i] ^= wState->mask[i];
+                }
+            }
+
+            if (Impl::handleFragment(src, wState->remainingBytes, 0, wState->state.opCode[wState->state.opStack], wState->state.lastFin, wState)) {
+                return false;
+            }
+
+            if (wState->state.lastFin) {
+                wState->state.opStack--;
+            }
+
+            src += wState->remainingBytes;
+            length -= wState->remainingBytes;
+            wState->state.wantsHead = true;
+            return true;
+        } else {
+            if (isServer) {
+                unmaskInplace(src, src + ((length >> 2) + 1) * 4, wState->mask);
+            }
+
+            wState->remainingBytes -= length;
+            if (Impl::handleFragment(src, length, wState->remainingBytes, wState->state.opCode[wState->state.opStack], wState->state.lastFin, wState)) {
+                return false;
+            }
+
+            if (isServer && length % 4) {
+                rotateMask(4 - (length % 4), wState->mask);
+            }
+            return false;
+        }
+    }
+
+public:
+    WebSocketProtocol() {
+
+    }
+
+    // Based on utf8_check.c by Markus Kuhn, 2005
+    // https://www.cl.cam.ac.uk/~mgk25/ucs/utf8_check.c
+    // Optimized for predominantly 7-bit content by Alex Hultman, 2016
+    // Licensed as Zlib, like the rest of this project
+    static bool isValidUtf8(unsigned char *s, size_t length)
+    {
+        for (unsigned char *e = s + length; s != e; ) {
+            if (s + 4 <= e && ((*(uint32_t *) s) & 0x80808080) == 0) {
+                s += 4;
+            } else {
+                while (!(*s & 0x80)) {
+                    if (++s == e) {
+                        return true;
+                    }
+                }
+
+                if ((s[0] & 0x60) == 0x40) {
+                    if (s + 1 >= e || (s[1] & 0xc0) != 0x80 || (s[0] & 0xfe) == 0xc0) {
+                        return false;
+                    }
+                    s += 2;
+                } else if ((s[0] & 0xf0) == 0xe0) {
+                    if (s + 2 >= e || (s[1] & 0xc0) != 0x80 || (s[2] & 0xc0) != 0x80 ||
+                            (s[0] == 0xe0 && (s[1] & 0xe0) == 0x80) || (s[0] == 0xed && (s[1] & 0xe0) == 0xa0)) {
+                        return false;
+                    }
+                    s += 3;
+                } else if ((s[0] & 0xf8) == 0xf0) {
+                    if (s + 3 >= e || (s[1] & 0xc0) != 0x80 || (s[2] & 0xc0) != 0x80 || (s[3] & 0xc0) != 0x80 ||
+                            (s[0] == 0xf0 && (s[1] & 0xf0) == 0x80) || (s[0] == 0xf4 && s[1] > 0x8f) || s[0] > 0xf4) {
+                        return false;
+                    }
+                    s += 4;
+                } else {
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+
+    struct CloseFrame {
+        uint16_t code;
+        char *message;
+        size_t length;
+    };
+
+    static inline CloseFrame parseClosePayload(char *src, size_t length) {
+        CloseFrame cf = {};
+        if (length >= 2) {
+            memcpy(&cf.code, src, 2);
+            cf = {ntohs(cf.code), src + 2, length - 2};
+            if (cf.code < 1000 || cf.code > 4999 || (cf.code > 1011 && cf.code < 4000) ||
+                (cf.code >= 1004 && cf.code <= 1006) || !isValidUtf8((unsigned char *) cf.message, cf.length)) {
+                return {};
+            }
+        }
+        return cf;
+    }
+
+    static inline size_t formatClosePayload(char *dst, uint16_t code, const char *message, size_t length) {
+        if (code) {
+            code = htons(code);
+            memcpy(dst, &code, 2);
+            memcpy(dst + 2, message, length);
+            return length + 2;
+        }
+        return 0;
+    }
+
+    static inline size_t formatMessage(char *dst, const char *src, size_t length, OpCode opCode, size_t reportedLength, bool compressed) {
+        size_t messageLength;
+        size_t headerLength;
+        if (reportedLength < 126) {
+            headerLength = 2;
+            dst[1] = reportedLength;
+        } else if (reportedLength <= UINT16_MAX) {
+            headerLength = 4;
+            dst[1] = 126;
+            *((uint16_t *) &dst[2]) = htons(reportedLength);
+        } else {
+            headerLength = 10;
+            dst[1] = 127;
+            *((uint64_t *) &dst[2]) = htobe64(reportedLength);
+        }
+
+        int flags = 0;
+        dst[0] = (flags & SND_NO_FIN ? 0 : 128) | (compressed ? SND_COMPRESSED : 0);
+        if (!(flags & SND_CONTINUATION)) {
+            dst[0] |= opCode;
+        }
+
+        char mask[4];
+        if (!isServer) {
+            dst[1] |= 0x80;
+            uint32_t random = rand();
+            memcpy(mask, &random, 4);
+            memcpy(dst + headerLength, &random, 4);
+            headerLength += 4;
+        }
+
+        messageLength = headerLength + length;
+        memcpy(dst + headerLength, src, length);
+
+        if (!isServer) {
+
+            // overwrites up to 3 bytes outside of the given buffer!
+            //WebSocketProtocol<isServer>::unmaskInplace(dst + headerLength, dst + headerLength + length, mask);
+
+            // this is not optimal
+            char *start = dst + headerLength;
+            char *stop = start + length;
+            int i = 0;
+            while (start != stop) {
+                (*start++) ^= mask[i++ % 4];
+            }
+        }
+        return messageLength;
+    }
+
+    static inline void consume(char *src, unsigned int length, WebSocketState<isServer> *wState) {
+        if (wState->state.spillLength) {
+            src -= wState->state.spillLength;
+            length += wState->state.spillLength;
+            memcpy(src, wState->state.spill, wState->state.spillLength);
+        }
+        if (wState->state.wantsHead) {
+            parseNext:
+            while (length >= SHORT_MESSAGE_HEADER) {
+
+                // invalid reserved bits / invalid opcodes / invalid control frames / set compressed frame
+                if ((rsv1(src) && !Impl::setCompressed(wState)) || rsv23(src) || (getOpCode(src) > 2 && getOpCode(src) < 8) ||
+                    getOpCode(src) > 10 || (getOpCode(src) > 2 && (!isFin(src) || payloadLength(src) > 125))) {
+                    Impl::forceClose(wState);
+                    return;
+                }
+
+                if (payloadLength(src) < 126) {
+                    if (consumeMessage<SHORT_MESSAGE_HEADER, uint8_t>(payloadLength(src), src, length, wState)) {
+                        return;
+                    }
+                } else if (payloadLength(src) == 126) {
+                    if (length < MEDIUM_MESSAGE_HEADER) {
+                        break;
+                    } else if(consumeMessage<MEDIUM_MESSAGE_HEADER, uint16_t>(ntohs(*(uint16_t *) &src[2]), src, length, wState)) {
+                        return;
+                    }
+                } else if (length < LONG_MESSAGE_HEADER) {
+                    break;
+                } else if (consumeMessage<LONG_MESSAGE_HEADER, uint64_t>(be64toh(*(uint64_t *) &src[2]), src, length, wState)) {
+                    return;
+                }
+            }
+            if (length) {
+                memcpy(wState->state.spill, src, length);
+                wState->state.spillLength = length;
+            }
+        } else if (consumeContinuation(src, length, wState)) {
+            goto parseNext;
+        }
+    }
+
+    static const int CONSUME_POST_PADDING = 4;
+    static const int CONSUME_PRE_PADDING = LONG_MESSAGE_HEADER - 1;
+};
+
+}
+
+#endif // WEBSOCKETPROTOCOL_UWS_H
diff --git a/wrt/node_modules/uws/src/addon.cpp b/wrt/node_modules/uws/src/addon.cpp
new file mode 100644 (file)
index 0000000..15e6905
--- /dev/null
@@ -0,0 +1,24 @@
+#include "../src/uWS.h"
+#include "addon.h"
+#include "http.h"
+
+void Main(Local<Object> exports) {
+    Isolate *isolate = exports->GetIsolate();
+
+    exports->Set(String::NewFromUtf8(isolate, "server"), Namespace<uWS::SERVER>(isolate).object);
+    exports->Set(String::NewFromUtf8(isolate, "client"), Namespace<uWS::CLIENT>(isolate).object);
+    exports->Set(String::NewFromUtf8(isolate, "httpServer"), HttpServer::getHttpServer(isolate));
+
+    NODE_SET_METHOD(exports, "setUserData", setUserData<uWS::SERVER>);
+    NODE_SET_METHOD(exports, "getUserData", getUserData<uWS::SERVER>);
+    NODE_SET_METHOD(exports, "clearUserData", clearUserData<uWS::SERVER>);
+    NODE_SET_METHOD(exports, "getAddress", getAddress<uWS::SERVER>);
+
+    NODE_SET_METHOD(exports, "transfer", transfer);
+    NODE_SET_METHOD(exports, "upgrade", upgrade);
+    NODE_SET_METHOD(exports, "connect", connect);
+    NODE_SET_METHOD(exports, "setNoop", setNoop);
+    registerCheck(isolate);
+}
+
+NODE_MODULE(uws, Main)
diff --git a/wrt/node_modules/uws/src/addon.h b/wrt/node_modules/uws/src/addon.h
new file mode 100644 (file)
index 0000000..93a41e5
--- /dev/null
@@ -0,0 +1,464 @@
+#include <node.h>
+#include <node_buffer.h>
+#include <cstring>
+#include <openssl/ssl.h>
+#include <openssl/bio.h>
+#include <uv.h>
+
+using namespace std;
+using namespace v8;
+
+uWS::Hub hub(0, true);
+uv_check_t check;
+Persistent<Function> noop;
+
+void registerCheck(Isolate *isolate) {
+    uv_check_init((uv_loop_t *) hub.getLoop(), &check);
+    check.data = isolate;
+    uv_check_start(&check, [](uv_check_t *check) {
+        Isolate *isolate = (Isolate *) check->data;
+        HandleScope hs(isolate);
+        node::MakeCallback(isolate, isolate->GetCurrentContext()->Global(), Local<Function>::New(isolate, noop), 0, nullptr);
+    });
+    uv_unref((uv_handle_t *) &check);
+}
+
+class NativeString {
+    char *data;
+    size_t length;
+    char utf8ValueMemory[sizeof(String::Utf8Value)];
+    String::Utf8Value *utf8Value = nullptr;
+public:
+    NativeString(const Local<Value> &value) {
+        if (value->IsUndefined()) {
+            data = nullptr;
+            length = 0;
+        } else if (value->IsString()) {
+            utf8Value = new (utf8ValueMemory) String::Utf8Value(value);
+            data = (**utf8Value);
+            length = utf8Value->length();
+        } else if (node::Buffer::HasInstance(value)) {
+            data = node::Buffer::Data(value);
+            length = node::Buffer::Length(value);
+        } else if (value->IsTypedArray()) {
+            Local<ArrayBufferView> arrayBufferView = Local<ArrayBufferView>::Cast(value);
+            ArrayBuffer::Contents contents = arrayBufferView->Buffer()->GetContents();
+            length = contents.ByteLength();
+            data = (char *) contents.Data();
+        } else if (value->IsArrayBuffer()) {
+            Local<ArrayBuffer> arrayBuffer = Local<ArrayBuffer>::Cast(value);
+            ArrayBuffer::Contents contents = arrayBuffer->GetContents();
+            length = contents.ByteLength();
+            data = (char *) contents.Data();
+        } else {
+            static char empty[] = "";
+            data = empty;
+            length = 0;
+        }
+    }
+
+    char *getData() {return data;}
+    size_t getLength() {return length;}
+    ~NativeString() {
+        if (utf8Value) {
+            utf8Value->~Utf8Value();
+        }
+    }
+};
+
+struct GroupData {
+    Persistent<Function> connectionHandler, messageHandler,
+                         disconnectionHandler, pingHandler,
+                         pongHandler, errorHandler, httpRequestHandler,
+                         httpUpgradeHandler, httpCancelledRequestCallback;
+    int size = 0;
+};
+
+template <bool isServer>
+void createGroup(const FunctionCallbackInfo<Value> &args) {
+    uWS::Group<isServer> *group = hub.createGroup<isServer>(args[0]->IntegerValue(), args[1]->IntegerValue());
+    group->setUserData(new GroupData);
+    args.GetReturnValue().Set(External::New(args.GetIsolate(), group));
+}
+
+template <bool isServer>
+void deleteGroup(const FunctionCallbackInfo<Value> &args) {
+    uWS::Group<isServer> *group = (uWS::Group<isServer> *) args[0].As<External>()->Value();
+    delete (GroupData *) group->getUserData();
+    delete group;
+}
+
+template <bool isServer>
+inline Local<External> wrapSocket(uWS::WebSocket<isServer> *webSocket, Isolate *isolate) {
+    return External::New(isolate, webSocket);
+}
+
+template <bool isServer>
+inline uWS::WebSocket<isServer> *unwrapSocket(Local<External> external) {
+    return (uWS::WebSocket<isServer> *) external->Value();
+}
+
+inline Local<Value> wrapMessage(const char *message, size_t length, uWS::OpCode opCode, Isolate *isolate) {
+    return opCode == uWS::OpCode::BINARY ? (Local<Value>) ArrayBuffer::New(isolate, (char *) message, length) : (Local<Value>) String::NewFromUtf8(isolate, message, String::kNormalString, length);
+}
+
+template <bool isServer>
+inline Local<Value> getDataV8(uWS::WebSocket<isServer> *webSocket, Isolate *isolate) {
+    return webSocket->getUserData() ? Local<Value>::New(isolate, *(Persistent<Value> *) webSocket->getUserData()) : Local<Value>::Cast(Undefined(isolate));
+}
+
+template <bool isServer>
+void getUserData(const FunctionCallbackInfo<Value> &args) {
+    args.GetReturnValue().Set(getDataV8(unwrapSocket<isServer>(args[0].As<External>()), args.GetIsolate()));
+}
+
+template <bool isServer>
+void clearUserData(const FunctionCallbackInfo<Value> &args) {
+    uWS::WebSocket<isServer> *webSocket = unwrapSocket<isServer>(args[0].As<External>());
+    ((Persistent<Value> *) webSocket->getUserData())->Reset();
+    delete (Persistent<Value> *) webSocket->getUserData();
+}
+
+template <bool isServer>
+void setUserData(const FunctionCallbackInfo<Value> &args) {
+    uWS::WebSocket<isServer> *webSocket = unwrapSocket<isServer>(args[0].As<External>());
+    if (webSocket->getUserData()) {
+        ((Persistent<Value> *) webSocket->getUserData())->Reset(args.GetIsolate(), args[1]);
+    } else {
+        webSocket->setUserData(new Persistent<Value>(args.GetIsolate(), args[1]));
+    }
+}
+
+template <bool isServer>
+void getAddress(const FunctionCallbackInfo<Value> &args)
+{
+    typename uWS::WebSocket<isServer>::Address address = unwrapSocket<isServer>(args[0].As<External>())->getAddress();
+    Local<Array> array = Array::New(args.GetIsolate(), 3);
+    array->Set(0, Integer::New(args.GetIsolate(), address.port));
+    array->Set(1, String::NewFromUtf8(args.GetIsolate(), address.address));
+    array->Set(2, String::NewFromUtf8(args.GetIsolate(), address.family));
+    args.GetReturnValue().Set(array);
+}
+
+uv_handle_t *getTcpHandle(void *handleWrap) {
+    volatile char *memory = (volatile char *) handleWrap;
+    for (volatile uv_handle_t *tcpHandle = (volatile uv_handle_t *) memory; tcpHandle->type != UV_TCP
+         || tcpHandle->data != handleWrap || tcpHandle->loop != uv_default_loop(); tcpHandle = (volatile uv_handle_t *) memory) {
+        memory++;
+    }
+    return (uv_handle_t *) memory;
+}
+
+struct SendCallbackData {
+    Persistent<Function> jsCallback;
+    Isolate *isolate;
+};
+
+template <bool isServer>
+void sendCallback(uWS::WebSocket<isServer> *webSocket, void *data, bool cancelled, void *reserved)
+{
+    SendCallbackData *sc = (SendCallbackData *) data;
+    if (!cancelled) {
+        HandleScope hs(sc->isolate);
+        node::MakeCallback(sc->isolate, sc->isolate->GetCurrentContext()->Global(), Local<Function>::New(sc->isolate, sc->jsCallback), 0, nullptr);
+    }
+    sc->jsCallback.Reset();
+    delete sc;
+}
+
+template <bool isServer>
+void send(const FunctionCallbackInfo<Value> &args)
+{
+    uWS::OpCode opCode = (uWS::OpCode) args[2]->IntegerValue();
+    NativeString nativeString(args[1]);
+
+    SendCallbackData *sc = nullptr;
+    void (*callback)(uWS::WebSocket<isServer> *, void *, bool, void *) = nullptr;
+
+    if (args[3]->IsFunction()) {
+        callback = sendCallback;
+        sc = new SendCallbackData;
+        sc->jsCallback.Reset(args.GetIsolate(), Local<Function>::Cast(args[3]));
+        sc->isolate = args.GetIsolate();
+    }
+
+    unwrapSocket<isServer>(args[0].As<External>())->send(nativeString.getData(),
+                           nativeString.getLength(), opCode, callback, sc);
+}
+
+void connect(const FunctionCallbackInfo<Value> &args) {
+    uWS::Group<uWS::CLIENT> *clientGroup = (uWS::Group<uWS::CLIENT> *) args[0].As<External>()->Value();
+    NativeString uri(args[1]);
+    hub.connect(std::string(uri.getData(), uri.getLength()), new Persistent<Value>(args.GetIsolate(), args[2]), {}, 5000, clientGroup);
+}
+
+struct Ticket {
+    uv_os_sock_t fd;
+    SSL *ssl;
+};
+
+void upgrade(const FunctionCallbackInfo<Value> &args) {
+    uWS::Group<uWS::SERVER> *serverGroup = (uWS::Group<uWS::SERVER> *) args[0].As<External>()->Value();
+    Ticket *ticket = (Ticket *) args[1].As<External>()->Value();
+    NativeString secKey(args[2]);
+    NativeString extensions(args[3]);
+    NativeString subprotocol(args[4]);
+
+    // todo: move this check into core!
+    if (ticket->fd != INVALID_SOCKET) {
+        hub.upgrade(ticket->fd, secKey.getData(), ticket->ssl, extensions.getData(), extensions.getLength(), subprotocol.getData(), subprotocol.getLength(), serverGroup);
+    } else {
+        if (ticket->ssl) {
+            SSL_free(ticket->ssl);
+        }
+    }
+    delete ticket;
+}
+
+void transfer(const FunctionCallbackInfo<Value> &args) {
+    // (_handle.fd OR _handle), SSL
+    uv_handle_t *handle = nullptr;
+    Ticket *ticket = new Ticket;
+    if (args[0]->IsObject()) {
+        uv_fileno((handle = getTcpHandle(args[0]->ToObject()->GetAlignedPointerFromInternalField(0))), (uv_os_fd_t *) &ticket->fd);
+    } else {
+        ticket->fd = args[0]->IntegerValue();
+    }
+
+    ticket->fd = dup(ticket->fd);
+    ticket->ssl = nullptr;
+    if (args[1]->IsExternal()) {
+        ticket->ssl = (SSL *) args[1].As<External>()->Value();
+        SSL_up_ref(ticket->ssl);
+    }
+
+    // uv_close calls shutdown if not set on Windows
+    if (handle) {
+        // UV_HANDLE_SHARED_TCP_SOCKET
+        handle->flags |= 0x40000000;
+    }
+
+    args.GetReturnValue().Set(External::New(args.GetIsolate(), ticket));
+}
+
+template <bool isServer>
+void onConnection(const FunctionCallbackInfo<Value> &args) {
+    uWS::Group<isServer> *group = (uWS::Group<isServer> *) args[0].As<External>()->Value();
+    GroupData *groupData = (GroupData *) group->getUserData();
+
+    Isolate *isolate = args.GetIsolate();
+    Persistent<Function> *connectionCallback = &groupData->connectionHandler;
+    connectionCallback->Reset(isolate, Local<Function>::Cast(args[1]));
+    group->onConnection([isolate, connectionCallback, groupData](uWS::WebSocket<isServer> *webSocket, uWS::HttpRequest req) {
+        groupData->size++;
+        HandleScope hs(isolate);
+        Local<Value> argv[] = {wrapSocket(webSocket, isolate)};
+        node::MakeCallback(isolate, isolate->GetCurrentContext()->Global(), Local<Function>::New(isolate, *connectionCallback), 1, argv);
+    });
+}
+
+template <bool isServer>
+void onMessage(const FunctionCallbackInfo<Value> &args) {
+    uWS::Group<isServer> *group = (uWS::Group<isServer> *) args[0].As<External>()->Value();
+    GroupData *groupData = (GroupData *) group->getUserData();
+
+    Isolate *isolate = args.GetIsolate();
+    Persistent<Function> *messageCallback = &groupData->messageHandler;
+    messageCallback->Reset(isolate, Local<Function>::Cast(args[1]));
+    group->onMessage([isolate, messageCallback](uWS::WebSocket<isServer> *webSocket, const char *message, size_t length, uWS::OpCode opCode) {
+        HandleScope hs(isolate);
+        Local<Value> argv[] = {wrapMessage(message, length, opCode, isolate),
+                               getDataV8(webSocket, isolate)};
+        Local<Function>::New(isolate, *messageCallback)->Call(isolate->GetCurrentContext()->Global(), 2, argv);
+    });
+}
+
+template <bool isServer>
+void onPing(const FunctionCallbackInfo<Value> &args) {
+    uWS::Group<isServer> *group = (uWS::Group<isServer> *) args[0].As<External>()->Value();
+    GroupData *groupData = (GroupData *) group->getUserData();
+
+    Isolate *isolate = args.GetIsolate();
+    Persistent<Function> *pingCallback = &groupData->pingHandler;
+    pingCallback->Reset(isolate, Local<Function>::Cast(args[1]));
+    group->onPing([isolate, pingCallback](uWS::WebSocket<isServer> *webSocket, const char *message, size_t length) {
+        HandleScope hs(isolate);
+        Local<Value> argv[] = {wrapMessage(message, length, uWS::OpCode::PING, isolate),
+                               getDataV8(webSocket, isolate)};
+        node::MakeCallback(isolate, isolate->GetCurrentContext()->Global(), Local<Function>::New(isolate, *pingCallback), 2, argv);
+    });
+}
+
+template <bool isServer>
+void onPong(const FunctionCallbackInfo<Value> &args) {
+    uWS::Group<isServer> *group = (uWS::Group<isServer> *) args[0].As<External>()->Value();
+    GroupData *groupData = (GroupData *) group->getUserData();
+
+    Isolate *isolate = args.GetIsolate();
+    Persistent<Function> *pongCallback = &groupData->pongHandler;
+    pongCallback->Reset(isolate, Local<Function>::Cast(args[1]));
+    group->onPong([isolate, pongCallback](uWS::WebSocket<isServer> *webSocket, const char *message, size_t length) {
+        HandleScope hs(isolate);
+        Local<Value> argv[] = {wrapMessage(message, length, uWS::OpCode::PONG, isolate),
+                               getDataV8(webSocket, isolate)};
+        node::MakeCallback(isolate, isolate->GetCurrentContext()->Global(), Local<Function>::New(isolate, *pongCallback), 2, argv);
+    });
+}
+
+template <bool isServer>
+void onDisconnection(const FunctionCallbackInfo<Value> &args) {
+    uWS::Group<isServer> *group = (uWS::Group<isServer> *) args[0].As<External>()->Value();
+    GroupData *groupData = (GroupData *) group->getUserData();
+
+    Isolate *isolate = args.GetIsolate();
+    Persistent<Function> *disconnectionCallback = &groupData->disconnectionHandler;
+    disconnectionCallback->Reset(isolate, Local<Function>::Cast(args[1]));
+
+    group->onDisconnection([isolate, disconnectionCallback, groupData](uWS::WebSocket<isServer> *webSocket, int code, char *message, size_t length) {
+        groupData->size--;
+        HandleScope hs(isolate);
+        Local<Value> argv[] = {wrapSocket(webSocket, isolate),
+                               Integer::New(isolate, code),
+                               wrapMessage(message, length, uWS::OpCode::CLOSE, isolate),
+                               getDataV8(webSocket, isolate)};
+        node::MakeCallback(isolate, isolate->GetCurrentContext()->Global(), Local<Function>::New(isolate, *disconnectionCallback), 4, argv);
+    });
+}
+
+void onError(const FunctionCallbackInfo<Value> &args) {
+    uWS::Group<uWS::CLIENT> *group = (uWS::Group<uWS::CLIENT> *) args[0].As<External>()->Value();
+    GroupData *groupData = (GroupData *) group->getUserData();
+
+    Isolate *isolate = args.GetIsolate();
+    Persistent<Function> *errorCallback = &groupData->errorHandler;
+    errorCallback->Reset(isolate, Local<Function>::Cast(args[1]));
+
+    group->onError([isolate, errorCallback](void *user) {
+        HandleScope hs(isolate);
+        Local<Value> argv[] = {Local<Value>::New(isolate, *(Persistent<Value> *) user)};
+        node::MakeCallback(isolate, isolate->GetCurrentContext()->Global(), Local<Function>::New(isolate, *errorCallback), 1, argv);
+
+        ((Persistent<Value> *) user)->Reset();
+        delete (Persistent<Value> *) user;
+    });
+}
+
+template <bool isServer>
+void closeSocket(const FunctionCallbackInfo<Value> &args) {
+    NativeString nativeString(args[2]);
+    unwrapSocket<isServer>(args[0].As<External>())->close(args[1]->IntegerValue(), nativeString.getData(), nativeString.getLength());
+}
+
+template <bool isServer>
+void terminateSocket(const FunctionCallbackInfo<Value> &args) {
+    unwrapSocket<isServer>(args[0].As<External>())->terminate();
+}
+
+template <bool isServer>
+void closeGroup(const FunctionCallbackInfo<Value> &args) {
+    NativeString nativeString(args[2]);
+    uWS::Group<isServer> *group = (uWS::Group<isServer> *) args[0].As<External>()->Value();
+    group->close(args[1]->IntegerValue(), nativeString.getData(), nativeString.getLength());
+}
+
+template <bool isServer>
+void terminateGroup(const FunctionCallbackInfo<Value> &args) {
+    ((uWS::Group<isServer> *) args[0].As<External>()->Value())->terminate();
+}
+
+template <bool isServer>
+void broadcast(const FunctionCallbackInfo<Value> &args) {
+    uWS::Group<isServer> *group = (uWS::Group<isServer> *) args[0].As<External>()->Value();
+    uWS::OpCode opCode = args[2]->BooleanValue() ? uWS::OpCode::BINARY : uWS::OpCode::TEXT;
+    NativeString nativeString(args[1]);
+    group->broadcast(nativeString.getData(), nativeString.getLength(), opCode);
+}
+
+template <bool isServer>
+void prepareMessage(const FunctionCallbackInfo<Value> &args) {
+    uWS::OpCode opCode = (uWS::OpCode) args[1]->IntegerValue();
+    NativeString nativeString(args[0]);
+    args.GetReturnValue().Set(External::New(args.GetIsolate(), uWS::WebSocket<isServer>::prepareMessage(nativeString.getData(), nativeString.getLength(), opCode, false)));
+}
+
+template <bool isServer>
+void sendPrepared(const FunctionCallbackInfo<Value> &args) {
+    unwrapSocket<isServer>(args[0].As<External>())
+        ->sendPrepared((typename uWS::WebSocket<isServer>::PreparedMessage *) args[1].As<External>()->Value());
+}
+
+template <bool isServer>
+void finalizeMessage(const FunctionCallbackInfo<Value> &args) {
+    uWS::WebSocket<isServer>::finalizeMessage((typename uWS::WebSocket<isServer>::PreparedMessage *) args[0].As<External>()->Value());
+}
+
+void forEach(const FunctionCallbackInfo<Value> &args) {
+    Isolate *isolate = args.GetIsolate();
+    uWS::Group<uWS::SERVER> *group = (uWS::Group<uWS::SERVER> *) args[0].As<External>()->Value();
+    Local<Function> cb = Local<Function>::Cast(args[1]);
+    group->forEach([isolate, &cb](uWS::WebSocket<uWS::SERVER> *webSocket) {
+        Local<Value> argv[] = {
+            getDataV8(webSocket, isolate)
+        };
+        cb->Call(Null(isolate), 1, argv);
+    });
+}
+
+void getSize(const FunctionCallbackInfo<Value> &args) {
+    uWS::Group<uWS::SERVER> *group = (uWS::Group<uWS::SERVER> *) args[0].As<External>()->Value();
+    GroupData *groupData = (GroupData *) group->getUserData();
+    args.GetReturnValue().Set(Integer::New(args.GetIsolate(), groupData->size));
+}
+
+void startAutoPing(const FunctionCallbackInfo<Value> &args) {
+    uWS::Group<uWS::SERVER> *group = (uWS::Group<uWS::SERVER> *) args[0].As<External>()->Value();
+    NativeString nativeString(args[2]);
+    group->startAutoPing(args[1]->IntegerValue(), std::string(nativeString.getData(), nativeString.getLength()));
+}
+
+void setNoop(const FunctionCallbackInfo<Value> &args) {
+    noop.Reset(args.GetIsolate(), Local<Function>::Cast(args[0]));
+}
+
+void listen(const FunctionCallbackInfo<Value> &args) {
+    uWS::Group<uWS::SERVER> *group = (uWS::Group<uWS::SERVER> *) args[0].As<External>()->Value();
+    hub.listen(args[1]->IntegerValue(), nullptr, 0, group);
+}
+
+template <bool isServer>
+struct Namespace {
+    Local<Object> object;
+    Namespace (Isolate *isolate) {
+        object = Object::New(isolate);
+        NODE_SET_METHOD(object, "send", send<isServer>);
+        NODE_SET_METHOD(object, "close", closeSocket<isServer>);
+        NODE_SET_METHOD(object, "terminate", terminateSocket<isServer>);
+        NODE_SET_METHOD(object, "prepareMessage", prepareMessage<isServer>);
+        NODE_SET_METHOD(object, "sendPrepared", sendPrepared<isServer>);
+        NODE_SET_METHOD(object, "finalizeMessage", finalizeMessage<isServer>);
+
+        Local<Object> group = Object::New(isolate);
+        NODE_SET_METHOD(group, "onConnection", onConnection<isServer>);
+        NODE_SET_METHOD(group, "onMessage", onMessage<isServer>);
+        NODE_SET_METHOD(group, "onDisconnection", onDisconnection<isServer>);
+
+        if (!isServer) {
+            NODE_SET_METHOD(group, "onError", onError);
+        } else {
+            NODE_SET_METHOD(group, "forEach", forEach);
+            NODE_SET_METHOD(group, "getSize", getSize);
+            NODE_SET_METHOD(group, "startAutoPing", startAutoPing);
+            NODE_SET_METHOD(group, "listen", listen);
+        }
+
+        NODE_SET_METHOD(group, "onPing", onPing<isServer>);
+        NODE_SET_METHOD(group, "onPong", onPong<isServer>);
+        NODE_SET_METHOD(group, "create", createGroup<isServer>);
+        NODE_SET_METHOD(group, "delete", deleteGroup<isServer>);
+        NODE_SET_METHOD(group, "close", closeGroup<isServer>);
+        NODE_SET_METHOD(group, "terminate", terminateGroup<isServer>);
+        NODE_SET_METHOD(group, "broadcast", broadcast<isServer>);
+
+        object->Set(String::NewFromUtf8(isolate, "group"), group);
+    }
+};
diff --git a/wrt/node_modules/uws/src/http.h b/wrt/node_modules/uws/src/http.h
new file mode 100644 (file)
index 0000000..61c9d2e
--- /dev/null
@@ -0,0 +1,357 @@
+#include <iostream>
+
+Persistent<Object> reqTemplate, resTemplate;
+Persistent<Function> httpPersistent;
+
+uWS::HttpRequest *currentReq = nullptr;
+
+struct HttpServer {
+
+    struct Request {
+        static void on(const FunctionCallbackInfo<Value> &args) {
+            NativeString eventName(args[0]);
+            if (std::string(eventName.getData(), eventName.getLength()) == "data") {
+                args.Holder()->SetInternalField(1, args[1]);
+            } else if (std::string(eventName.getData(), eventName.getLength()) == "end") {
+                args.Holder()->SetInternalField(2, args[1]);
+            } else {
+                std::cout << "Warning: req.on(" << std::string(eventName.getData(), eventName.getLength()) << ") is not implemented!" << std::endl;
+            }
+            args.GetReturnValue().Set(args.Holder());
+        }
+
+        static void headers(Local<String> property, const PropertyCallbackInfo<Value> &args) {
+            uWS::HttpRequest *req = currentReq;
+            if (!req) {
+                std::cerr << "Warning: req.headers usage past request handler is not supported!" << std::endl;
+            } else {
+                NativeString nativeString(property);
+                uWS::Header header = req->getHeader(nativeString.getData(), nativeString.getLength());
+                if (header) {
+                    args.GetReturnValue().Set(String::NewFromOneByte(args.GetIsolate(), (uint8_t *) header.value, String::kNormalString, header.valueLength));
+                }
+            }
+        }
+
+        static void url(Local<String> property, const PropertyCallbackInfo<Value> &args) {
+            args.GetReturnValue().Set(args.This()->GetInternalField(4));
+        }
+
+        static void method(Local<String> property, const PropertyCallbackInfo<Value> &args) {
+            //std::cout << "method" << std::endl;
+            long methodId = ((long) args.This()->GetAlignedPointerFromInternalField(3)) >> 1;
+            switch (methodId) {
+            case uWS::HttpMethod::METHOD_GET:
+                args.GetReturnValue().Set(String::NewFromOneByte(args.GetIsolate(), (uint8_t *) "GET", String::kNormalString, 3));
+                break;
+            case uWS::HttpMethod::METHOD_PUT:
+                args.GetReturnValue().Set(String::NewFromOneByte(args.GetIsolate(), (uint8_t *) "PUT", String::kNormalString, 3));
+                break;
+            case uWS::HttpMethod::METHOD_POST:
+                args.GetReturnValue().Set(String::NewFromOneByte(args.GetIsolate(), (uint8_t *) "POST", String::kNormalString, 4));
+                break;
+            case uWS::HttpMethod::METHOD_HEAD:
+                args.GetReturnValue().Set(String::NewFromOneByte(args.GetIsolate(), (uint8_t *) "HEAD", String::kNormalString, 4));
+                break;
+            case uWS::HttpMethod::METHOD_PATCH:
+                args.GetReturnValue().Set(String::NewFromOneByte(args.GetIsolate(), (uint8_t *) "PATCH", String::kNormalString, 5));
+                break;
+            case uWS::HttpMethod::METHOD_TRACE:
+                args.GetReturnValue().Set(String::NewFromOneByte(args.GetIsolate(), (uint8_t *) "TRACE", String::kNormalString, 5));
+                break;
+            case uWS::HttpMethod::METHOD_DELETE:
+                args.GetReturnValue().Set(String::NewFromOneByte(args.GetIsolate(), (uint8_t *) "DELETE", String::kNormalString, 6));
+                break;
+            case uWS::HttpMethod::METHOD_OPTIONS:
+                args.GetReturnValue().Set(String::NewFromOneByte(args.GetIsolate(), (uint8_t *) "OPTIONS", String::kNormalString, 7));
+                break;
+            case uWS::HttpMethod::METHOD_CONNECT:
+                args.GetReturnValue().Set(String::NewFromOneByte(args.GetIsolate(), (uint8_t *) "CONNECT", String::kNormalString, 7));
+                break;
+            }
+        }
+
+        // placeholders
+        static void unpipe(const FunctionCallbackInfo<Value> &args) {
+            //std::cout << "req.unpipe called" << std::endl;
+        }
+
+        static void resume(const FunctionCallbackInfo<Value> &args) {
+            //std::cout << "req.resume called" << std::endl;
+        }
+
+        static void socket(const FunctionCallbackInfo<Value> &args) {
+            // return new empty object
+            args.GetReturnValue().Set(Object::New(args.GetIsolate()));
+        }
+
+        static Local<Object> getTemplateObject(Isolate *isolate) {
+            Local<FunctionTemplate> reqTemplateLocal = FunctionTemplate::New(isolate);
+            reqTemplateLocal->SetClassName(String::NewFromUtf8(isolate, "uws.Request"));
+            reqTemplateLocal->InstanceTemplate()->SetInternalFieldCount(5);
+            reqTemplateLocal->PrototypeTemplate()->SetAccessor(String::NewFromUtf8(isolate, "url"), Request::url);
+            reqTemplateLocal->PrototypeTemplate()->SetAccessor(String::NewFromUtf8(isolate, "method"), Request::method);
+            reqTemplateLocal->PrototypeTemplate()->Set(String::NewFromUtf8(isolate, "on"), FunctionTemplate::New(isolate, Request::on));
+            reqTemplateLocal->PrototypeTemplate()->Set(String::NewFromUtf8(isolate, "unpipe"), FunctionTemplate::New(isolate, Request::unpipe));
+            reqTemplateLocal->PrototypeTemplate()->Set(String::NewFromUtf8(isolate, "resume"), FunctionTemplate::New(isolate, Request::resume));
+            reqTemplateLocal->PrototypeTemplate()->Set(String::NewFromUtf8(isolate, "socket"), FunctionTemplate::New(isolate, Request::socket));
+
+            Local<Object> reqObjectLocal = reqTemplateLocal->GetFunction()->NewInstance();
+
+            Local<ObjectTemplate> headersTemplate = ObjectTemplate::New(isolate);
+            headersTemplate->SetNamedPropertyHandler(Request::headers);
+
+            reqObjectLocal->Set(String::NewFromUtf8(isolate, "headers"), headersTemplate->NewInstance());
+            return reqObjectLocal;
+        }
+    };
+
+    struct Response {
+        static void on(const FunctionCallbackInfo<Value> &args) {
+            NativeString eventName(args[0]);
+            if (std::string(eventName.getData(), eventName.getLength()) == "close") {
+                args.Holder()->SetInternalField(1, args[1]);
+            } else {
+                std::cout << "Warning: res.on(" << std::string(eventName.getData(), eventName.getLength()) << ") is not implemented!" << std::endl;
+            }
+            args.GetReturnValue().Set(args.Holder());
+        }
+
+        static void end(const FunctionCallbackInfo<Value> &args) {
+            uWS::HttpResponse *res = (uWS::HttpResponse *) args.Holder()->GetAlignedPointerFromInternalField(0);
+            if (res) {
+                NativeString nativeString(args[0]);
+
+                ((Persistent<Object> *) &res->userData)->Reset();
+                ((Persistent<Object> *) &res->userData)->~Persistent<Object>();
+                ((Persistent<Object> *) &res->extraUserData)->Reset();
+                ((Persistent<Object> *) &res->extraUserData)->~Persistent<Object>();
+                res->end(nativeString.getData(), nativeString.getLength());
+            }
+        }
+
+        // todo: this is slow
+        static void writeHead(const FunctionCallbackInfo<Value> &args) {
+            uWS::HttpResponse *res = (uWS::HttpResponse *) args.Holder()->GetAlignedPointerFromInternalField(0);
+            if (res) {
+                std::string head = "HTTP/1.1 " + std::to_string(args[0]->IntegerValue()) + " ";
+
+                if (args.Length() > 1 && args[1]->IsString()) {
+                    NativeString statusMessage(args[1]);
+                    head.append(statusMessage.getData(), statusMessage.getLength());
+                } else {
+                    head += "OK";
+                }
+
+                if (args[args.Length() - 1]->IsObject()) {
+                    Local<Object> headersObject = args[args.Length() - 1]->ToObject();
+                    Local<Array> headers = headersObject->GetOwnPropertyNames();
+                    for (int i = 0; i < headers->Length(); i++) {
+                        Local<Value> key = headers->Get(i);
+                        Local<Value> value = headersObject->Get(key);
+
+                        NativeString nativeKey(key);
+                        NativeString nativeValue(value);
+
+                        head += "\r\n";
+                        head.append(nativeKey.getData(), nativeKey.getLength());
+                        head += ": ";
+                        head.append(nativeValue.getData(), nativeValue.getLength());
+                    }
+                }
+
+                head += "\r\n\r\n";
+                res->write(head.data(), head.length());
+            }
+        }
+
+        // todo: if not writeHead called before then should write implicit headers
+        static void write(const FunctionCallbackInfo<Value> &args) {
+            uWS::HttpResponse *res = (uWS::HttpResponse *) args.Holder()->GetAlignedPointerFromInternalField(0);
+
+            if (res) {
+                NativeString nativeString(args[0]);
+                res->write(nativeString.getData(), nativeString.getLength());
+            }
+        }
+
+        static void setHeader(const FunctionCallbackInfo<Value> &args) {
+            //std::cout << "res.setHeader called" << std::endl;
+        }
+
+        static void getHeader(const FunctionCallbackInfo<Value> &args) {
+            //std::cout << "res.getHeader called" << std::endl;
+        }
+
+        static Local<Object> getTemplateObject(Isolate *isolate) {
+            Local<FunctionTemplate> resTemplateLocal = FunctionTemplate::New(isolate);
+            resTemplateLocal->SetClassName(String::NewFromUtf8(isolate, "uws.Response"));
+            resTemplateLocal->InstanceTemplate()->SetInternalFieldCount(5);
+            resTemplateLocal->PrototypeTemplate()->Set(String::NewFromUtf8(isolate, "end"), FunctionTemplate::New(isolate, Response::end));
+            resTemplateLocal->PrototypeTemplate()->Set(String::NewFromUtf8(isolate, "writeHead"), FunctionTemplate::New(isolate, Response::writeHead));
+            resTemplateLocal->PrototypeTemplate()->Set(String::NewFromUtf8(isolate, "write"), FunctionTemplate::New(isolate, Response::write));
+            resTemplateLocal->PrototypeTemplate()->Set(String::NewFromUtf8(isolate, "on"), FunctionTemplate::New(isolate, Response::on));
+            resTemplateLocal->PrototypeTemplate()->Set(String::NewFromUtf8(isolate, "setHeader"), FunctionTemplate::New(isolate, Response::setHeader));
+            resTemplateLocal->PrototypeTemplate()->Set(String::NewFromUtf8(isolate, "getHeader"), FunctionTemplate::New(isolate, Response::getHeader));
+            return resTemplateLocal->GetFunction()->NewInstance();
+        }
+    };
+
+    // todo: wrap everything up - most important function to get correct
+    static void createServer(const FunctionCallbackInfo<Value> &args) {
+
+        // todo: delete this on destructor
+        uWS::Group<uWS::SERVER> *group = hub.createGroup<uWS::SERVER>();
+        group->setUserData(new GroupData);
+        GroupData *groupData = (GroupData *) group->getUserData();
+
+        Isolate *isolate = args.GetIsolate();
+        Persistent<Function> *httpRequestCallback = &groupData->httpRequestHandler;
+        httpRequestCallback->Reset(isolate, Local<Function>::Cast(args[0]));
+        group->onHttpRequest([isolate, httpRequestCallback](uWS::HttpResponse *res, uWS::HttpRequest req, char *data, size_t length, size_t remainingBytes) {
+            HandleScope hs(isolate);
+
+            currentReq = &req;
+
+            Local<Object> reqObject = Local<Object>::New(isolate, reqTemplate)->Clone();
+            reqObject->SetAlignedPointerInInternalField(0, &req);
+            new (&res->extraUserData) Persistent<Object>(isolate, reqObject);
+
+            Local<Object> resObject = Local<Object>::New(isolate, resTemplate)->Clone();
+            resObject->SetAlignedPointerInInternalField(0, res);
+            new (&res->userData) Persistent<Object>(isolate, resObject);
+
+            // store url & method (needed by Koa and Express)
+            long methodId = req.getMethod() << 1;
+            reqObject->SetAlignedPointerInInternalField(3, (void *) methodId);
+            reqObject->SetInternalField(4, String::NewFromOneByte(isolate, (uint8_t *) req.getUrl().value, String::kNormalString, req.getUrl().valueLength));
+
+            Local<Value> argv[] = {reqObject, resObject};
+            Local<Function>::New(isolate, *httpRequestCallback)->Call(isolate->GetCurrentContext()->Global(), 2, argv);
+
+            if (length) {
+                Local<Value> dataCallback = reqObject->GetInternalField(1);
+                if (!dataCallback->IsUndefined()) {
+                    Local<Value> argv[] = {ArrayBuffer::New(isolate, data, length)};
+                    Local<Function>::Cast(dataCallback)->Call(isolate->GetCurrentContext()->Global(), 1, argv);
+                }
+
+                if (!remainingBytes) {
+                    Local<Value> endCallback = reqObject->GetInternalField(2);
+                    if (!endCallback->IsUndefined()) {
+                        Local<Function>::Cast(endCallback)->Call(isolate->GetCurrentContext()->Global(), 0, nullptr);
+                    }
+                }
+            }
+
+            currentReq = nullptr;
+            reqObject->SetAlignedPointerInInternalField(0, nullptr);
+        });
+
+        group->onCancelledHttpRequest([isolate](uWS::HttpResponse *res) {
+            HandleScope hs(isolate);
+
+            // mark res as invalid
+            Local<Object> resObject = Local<Object>::New(isolate, *(Persistent<Object> *) &res->userData);
+            resObject->SetAlignedPointerInInternalField(0, nullptr);
+
+            // mark req as invalid
+            Local<Object> reqObject = Local<Object>::New(isolate, *(Persistent<Object> *) &res->extraUserData);
+            reqObject->SetAlignedPointerInInternalField(0, nullptr);
+
+            // emit res 'close' on aborted response
+            Local<Value> closeCallback = resObject->GetInternalField(1);
+            if (!closeCallback->IsUndefined()) {
+                Local<Function>::Cast(closeCallback)->Call(isolate->GetCurrentContext()->Global(), 0, nullptr);
+            }
+
+            ((Persistent<Object> *) &res->userData)->Reset();
+            ((Persistent<Object> *) &res->userData)->~Persistent<Object>();
+            ((Persistent<Object> *) &res->extraUserData)->Reset();
+            ((Persistent<Object> *) &res->extraUserData)->~Persistent<Object>();
+        });
+
+        group->onHttpData([isolate](uWS::HttpResponse *res, char *data, size_t length, size_t remainingBytes) {
+            Local<Object> reqObject = Local<Object>::New(isolate, *(Persistent<Object> *) res->extraUserData);
+
+            Local<Value> dataCallback = reqObject->GetInternalField(1);
+            if (!dataCallback->IsUndefined()) {
+                Local<Value> argv[] = {ArrayBuffer::New(isolate, data, length)};
+                Local<Function>::Cast(dataCallback)->Call(isolate->GetCurrentContext()->Global(), 1, argv);
+            }
+
+            if (!remainingBytes) {
+                Local<Value> endCallback = reqObject->GetInternalField(2);
+                if (!endCallback->IsUndefined()) {
+                    Local<Function>::Cast(endCallback)->Call(isolate->GetCurrentContext()->Global(), 0, nullptr);
+                }
+            }
+        });
+
+        Local<Object> newInstance;
+        if (!args.IsConstructCall()) {
+            args.GetReturnValue().Set(newInstance = Local<Function>::New(args.GetIsolate(), httpPersistent)->NewInstance());
+        } else {
+            args.GetReturnValue().Set(newInstance = args.This());
+        }
+
+        newInstance->SetAlignedPointerInInternalField(0, group);
+    }
+
+    static void on(const FunctionCallbackInfo<Value> &args) {
+        NativeString eventName(args[0]);
+        std::cout << "Warning: server.on(" << std::string(eventName.getData(), eventName.getLength()) << ") is not implemented!" << std::endl;
+    }
+
+    static void listen(const FunctionCallbackInfo<Value> &args) {
+        uWS::Group<uWS::SERVER> *group = (uWS::Group<uWS::SERVER> *) args.Holder()->GetAlignedPointerFromInternalField(0);
+        std::cout << "listen: " << hub.listen(args[0]->IntegerValue(), nullptr, 0, group) << std::endl;
+
+        if (args[args.Length() - 1]->IsFunction()) {
+            Local<Function>::Cast(args[args.Length() - 1])->Call(args.GetIsolate()->GetCurrentContext()->Global(), 0, nullptr);
+        }
+    }
+
+    // var app = getExpressApp(express)
+    static void getExpressApp(const FunctionCallbackInfo<Value> &args) {
+        Isolate *isolate = args.GetIsolate();
+        if (args[0]->IsFunction()) {
+            Local<Function> express = Local<Function>::Cast(args[0]);
+            express->Get(String::NewFromUtf8(isolate, "request"))->ToObject()->SetPrototype(Local<Object>::New(args.GetIsolate(), reqTemplate)->GetPrototype());
+            express->Get(String::NewFromUtf8(isolate, "response"))->ToObject()->SetPrototype(Local<Object>::New(args.GetIsolate(), resTemplate)->GetPrototype());
+
+            // also change app.listen?
+
+            // change prototypes back?
+
+            args.GetReturnValue().Set(express->NewInstance());
+        }
+    }
+
+    static void getResponsePrototype(const FunctionCallbackInfo<Value> &args) {
+        args.GetReturnValue().Set(Local<Object>::New(args.GetIsolate(), resTemplate)->GetPrototype());
+    }
+
+    static void getRequestPrototype(const FunctionCallbackInfo<Value> &args) {
+        args.GetReturnValue().Set(Local<Object>::New(args.GetIsolate(), reqTemplate)->GetPrototype());
+    }
+
+    static Local<Function> getHttpServer(Isolate *isolate) {
+        Local<FunctionTemplate> httpServer = FunctionTemplate::New(isolate, HttpServer::createServer);
+        httpServer->InstanceTemplate()->SetInternalFieldCount(1);
+
+        httpServer->Set(String::NewFromUtf8(isolate, "createServer"), FunctionTemplate::New(isolate, HttpServer::createServer));
+        httpServer->Set(String::NewFromUtf8(isolate, "getExpressApp"), FunctionTemplate::New(isolate, HttpServer::getExpressApp));
+        httpServer->Set(String::NewFromUtf8(isolate, "getResponsePrototype"), FunctionTemplate::New(isolate, HttpServer::getResponsePrototype));
+        httpServer->Set(String::NewFromUtf8(isolate, "getRequestPrototype"), FunctionTemplate::New(isolate, HttpServer::getRequestPrototype));
+        httpServer->PrototypeTemplate()->Set(String::NewFromUtf8(isolate, "listen"), FunctionTemplate::New(isolate, HttpServer::listen));
+        httpServer->PrototypeTemplate()->Set(String::NewFromUtf8(isolate, "on"), FunctionTemplate::New(isolate, HttpServer::on));
+
+        reqTemplate.Reset(isolate, Request::getTemplateObject(isolate));
+        resTemplate.Reset(isolate, Response::getTemplateObject(isolate));
+
+        Local<Function> httpServerLocal = httpServer->GetFunction();
+        httpPersistent.Reset(isolate, httpServerLocal);
+        return httpServerLocal;
+    }
+};
diff --git a/wrt/node_modules/uws/src/uWS.h b/wrt/node_modules/uws/src/uWS.h
new file mode 100644 (file)
index 0000000..40a0e40
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef UWS_UWS_H
+#define UWS_UWS_H
+
+#include "Hub.h"
+
+#endif // UWS_UWS_H
diff --git a/wrt/node_modules/uws/uws.js b/wrt/node_modules/uws/uws.js
new file mode 100644 (file)
index 0000000..648d9f6
--- /dev/null
@@ -0,0 +1,563 @@
+'use strict';
+
+const http = require('http');
+const EventEmitter = require('events');
+const EE_ERROR = 'Registering more than one listener to a WebSocket is not supported.';
+const DEFAULT_PAYLOAD_LIMIT = 16777216;
+
+function noop() {}
+
+function abortConnection(socket, code, name) {
+    socket.end('HTTP/1.1 ' + code + ' ' + name + '\r\n\r\n');
+}
+
+function emitConnection(ws) {
+    this.emit('connection', ws);
+}
+
+function onServerMessage(message, webSocket) {
+    webSocket.internalOnMessage(message);
+}
+
+const native = (() => {
+    try {
+        try {
+            return process.binding('uws_builtin');
+        } catch (e) {
+            return require(`./uws_${process.platform}_${process.versions.modules}`);
+        }
+    } catch (e) {
+        const version = process.version.substring(1).split('.').map(function(n) {
+            return parseInt(n);
+        });
+        const lessThanSixFour = version[0] < 6 || (version[0] === 6 && version[1] < 4);
+
+        if (process.platform === 'win32' && lessThanSixFour) {
+            throw new Error('µWebSockets requires Node.js 6.4.0 or greater on Windows.');
+        } else {
+            throw new Error('Compilation of µWebSockets has failed and there is no pre-compiled binary ' +
+            'available for your system. Please install a supported C++11 compiler and reinstall the module \'uws\'.');
+        }
+    }
+})();
+
+native.setNoop(noop);
+
+var _upgradeReq = null;
+
+const clientGroup = native.client.group.create(0, DEFAULT_PAYLOAD_LIMIT);
+
+native.client.group.onConnection(clientGroup, (external) => {
+    const webSocket = native.getUserData(external);
+    webSocket.external = external;
+    webSocket.internalOnOpen();
+});
+
+native.client.group.onMessage(clientGroup, (message, webSocket) => {
+    webSocket.internalOnMessage(message);
+});
+
+native.client.group.onDisconnection(clientGroup, (external, code, message, webSocket) => {
+    webSocket.external = null;
+
+    process.nextTick(() => {
+        webSocket.internalOnClose(code, message);
+    });
+
+    native.clearUserData(external);
+});
+
+native.client.group.onPing(clientGroup, (message, webSocket) => {
+    webSocket.onping(message);
+});
+
+native.client.group.onPong(clientGroup, (message, webSocket) => {
+    webSocket.onpong(message);
+});
+
+native.client.group.onError(clientGroup, (webSocket) => {
+    process.nextTick(() => {
+        webSocket.internalOnError({
+            message: 'uWs client connection error',
+            stack: 'uWs client connection error'
+        });
+    });
+});
+
+class WebSocket {
+    constructor(external) {
+        this.external = external;
+        this.internalOnMessage = noop;
+        this.internalOnClose = noop;
+        this.onping = noop;
+        this.onpong = noop;
+    }
+
+    get upgradeReq() {
+        return _upgradeReq;
+    }
+
+    set onmessage(f) {
+        if (f) {
+            this.internalOnMessage = (message) => {
+                f({data: message});
+            };
+        } else {
+            this.internalOnMessage = noop;
+        }
+    }
+
+    set onopen(f) {
+        if (f) {
+            this.internalOnOpen = f;
+        } else {
+            this.internalOnOpen = noop;
+        }
+    }
+
+    set onclose(f) {
+        if (f) {
+            this.internalOnClose = (code, message) => {
+                f({code: code, reason: message});
+            };
+        } else {
+            this.internalOnClose = noop;
+        }
+    }
+
+    set onerror(f) {
+        if (f && this instanceof WebSocketClient) {
+            this.internalOnError = f;
+        } else {
+            this.internalOnError = noop;
+        }
+    }
+
+    emit(eventName, arg1, arg2) {
+        if (eventName === 'message') {
+            this.internalOnMessage(arg1);
+        } else if (eventName === 'close') {
+            this.internalOnClose(arg1, arg2);
+        } else if (eventName === 'ping') {
+            this.onping(arg1);
+        } else if (eventName === 'pong') {
+            this.onpong(arg1);
+        }
+        return this;
+    }
+
+    on(eventName, f) {
+        if (eventName === 'message') {
+            if (this.internalOnMessage !== noop) {
+                throw Error(EE_ERROR);
+            }
+            this.internalOnMessage = f;
+        } else if (eventName === 'close') {
+            if (this.internalOnClose !== noop) {
+                throw Error(EE_ERROR);
+            }
+            this.internalOnClose = f;
+        } else if (eventName === 'ping') {
+            if (this.onping !== noop) {
+                throw Error(EE_ERROR);
+            }
+            this.onping = f;
+        } else if (eventName === 'pong') {
+            if (this.onpong !== noop) {
+                throw Error(EE_ERROR);
+            }
+            this.onpong = f;
+        } else if (eventName === 'open') {
+            if (this.internalOnOpen !== noop) {
+                throw Error(EE_ERROR);
+            }
+            this.internalOnOpen = f;
+        } else if (eventName === 'error' && this instanceof WebSocketClient) {
+            if (this.internalOnError !== noop) {
+                throw Error(EE_ERROR);
+            }
+            this.internalOnError = f;
+        }
+        return this;
+    }
+
+    once(eventName, f) {
+        if (eventName === 'message') {
+            if (this.internalOnMessage !== noop) {
+                throw Error(EE_ERROR);
+            }
+            this.internalOnMessage = (message) => {
+                this.internalOnMessage = noop;
+                f(message);
+            };
+        } else if (eventName === 'close') {
+            if (this.internalOnClose !== noop) {
+                throw Error(EE_ERROR);
+            }
+            this.internalOnClose = (code, message) => {
+                this.internalOnClose = noop;
+                f(code, message);
+            };
+        } else if (eventName === 'ping') {
+            if (this.onping !== noop) {
+                throw Error(EE_ERROR);
+            }
+            this.onping = () => {
+                this.onping = noop;
+                f();
+            };
+        } else if (eventName === 'pong') {
+            if (this.onpong !== noop) {
+                throw Error(EE_ERROR);
+            }
+            this.onpong = () => {
+                this.onpong = noop;
+                f();
+            };
+        }
+        return this;
+    }
+
+    removeAllListeners(eventName) {
+        if (!eventName || eventName === 'message') {
+            this.internalOnMessage = noop;
+        }
+        if (!eventName || eventName === 'close') {
+            this.internalOnClose = noop;
+        }
+        if (!eventName || eventName === 'ping') {
+            this.onping = noop;
+        }
+        if (!eventName || eventName === 'pong') {
+            this.onpong = noop;
+        }
+        return this;
+    }
+
+    removeListener(eventName, cb) {
+        if (eventName === 'message' && this.internalOnMessage === cb) {
+            this.internalOnMessage = noop;
+        } else if (eventName === 'close' && this.internalOnClose === cb) {
+            this.internalOnClose = noop;
+        } else if (eventName === 'ping' && this.onping === cb) {
+            this.onping = noop;
+        } else if (eventName === 'pong' && this.onpong === cb) {
+            this.onpong = noop;
+        }
+        return this;
+    }
+
+    get OPEN() {
+        return WebSocketClient.OPEN;
+    }
+
+    get CLOSED() {
+        return WebSocketClient.CLOSED;
+    }
+
+    get readyState() {
+        return this.external ? WebSocketClient.OPEN : WebSocketClient.CLOSED;
+    }
+
+    get _socket() {
+        const address = this.external ? native.getAddress(this.external) : new Array(3);
+        return {
+            remotePort: address[0],
+            remoteAddress: address[1],
+            remoteFamily: address[2]
+        };
+    }
+
+    // from here down, functions are not common between client and server
+
+    ping(message, options, dontFailWhenClosed) {
+        if (this.external) {
+            native.server.send(this.external, message, WebSocketClient.OPCODE_PING);
+        }
+    }
+
+    terminate() {
+        if (this.external) {
+            native.server.terminate(this.external);
+            this.external = null;
+        }
+    }
+
+    send(message, options, cb) {
+        if (this.external) {
+            if (typeof options === 'function') {
+                cb = options;
+                options = null;
+            }
+
+            const binary = options && options.binary || typeof message !== 'string';
+
+            native.server.send(this.external, message, binary ? WebSocketClient.OPCODE_BINARY : WebSocketClient.OPCODE_TEXT, cb ? (() => {
+                process.nextTick(cb);
+            }) : undefined);
+        } else if (cb) {
+            cb(new Error('not opened'));
+        }
+    }
+
+    close(code, data) {
+        if (this.external) {
+            native.server.close(this.external, code, data);
+            this.external = null;
+        }
+    }
+}
+
+class WebSocketClient extends WebSocket {
+    constructor(uri) {
+        super(null);
+        this.internalOnOpen = noop;
+        this.internalOnError = noop;
+        native.connect(clientGroup, uri, this);
+    }
+
+    ping(message, options, dontFailWhenClosed) {
+        if (this.external) {
+            native.client.send(this.external, message, WebSocketClient.OPCODE_PING);
+        }
+    }
+
+    terminate() {
+        if (this.external) {
+            native.client.terminate(this.external);
+            this.external = null;
+        }
+    }
+
+    send(message, options, cb) {
+        if (this.external) {
+            if (typeof options === 'function') {
+                cb = options;
+                options = null;
+            }
+
+            const binary = options && options.binary || typeof message !== 'string';
+
+            native.client.send(this.external, message, binary ? WebSocketClient.OPCODE_BINARY : WebSocketClient.OPCODE_TEXT, cb ? (() => {
+                process.nextTick(cb);
+            }) : undefined);
+        } else if (cb) {
+            cb(new Error('not opened'));
+        }
+    }
+
+    close(code, data) {
+        if (this.external) {
+            native.client.close(this.external, code, data);
+            this.external = null;
+        }
+    }
+}
+
+class Server extends EventEmitter {
+    constructor(options, callback) {
+        super();
+
+        if (!options) {
+            throw new TypeError('missing options');
+        }
+
+        if (options.port === undefined && !options.server && !options.noServer) {
+            throw new TypeError('invalid options');
+        }
+
+        var nativeOptions = WebSocketClient.PERMESSAGE_DEFLATE;
+
+        if (options.perMessageDeflate !== undefined) {
+            if (options.perMessageDeflate === false) {
+                nativeOptions = 0;
+            }
+        }
+
+        this.serverGroup = native.server.group.create(nativeOptions, options.maxPayload === undefined ? DEFAULT_PAYLOAD_LIMIT : options.maxPayload);
+
+        // can these be made private?
+        this._upgradeCallback = noop;
+        this._upgradeListener = null;
+        this._noDelay = options.noDelay === undefined ? true : options.noDelay;
+        this._lastUpgradeListener = true;
+        this._passedHttpServer = options.server;
+
+        if (!options.noServer) {
+            this.httpServer = options.server ? options.server : http.createServer((request, response) => {
+                // todo: default HTTP response
+                response.end();
+            });
+
+            if (options.path && (!options.path.length || options.path[0] !== '/')) {
+                options.path = '/' + options.path;
+            }
+
+            this.httpServer.on('upgrade', this._upgradeListener = ((request, socket, head) => {
+                if (!options.path || options.path == request.url.split('?')[0].split('#')[0]) {
+                    if (options.verifyClient) {
+                        const info = {
+                            origin: request.headers.origin,
+                            secure: request.connection.authorized !== undefined || request.connection.encrypted !== undefined,
+                            req: request
+                        };
+
+                        if (options.verifyClient.length === 2) {
+                            options.verifyClient(info, (result, code, name) => {
+                                if (result) {
+                                    this.handleUpgrade(request, socket, head, emitConnection);
+                                } else {
+                                    abortConnection(socket, code, name);
+                                }
+                            });
+                        } else {
+                            if (options.verifyClient(info)) {
+                                this.handleUpgrade(request, socket, head, emitConnection);
+                            } else {
+                                abortConnection(socket, 400, 'Client verification failed');
+                            }
+                        }
+                    } else {
+                        this.handleUpgrade(request, socket, head, emitConnection);
+                    }
+                } else {
+                    if (this._lastUpgradeListener) {
+                        abortConnection(socket, 400, 'URL not supported');
+                    }
+                }
+            }));
+
+            this.httpServer.on('newListener', (eventName, listener) => {
+                if (eventName === 'upgrade') {
+                    this._lastUpgradeListener = false;
+                }
+            });
+
+            this.httpServer.on('error', (err) => {
+                this.emit('error', err);
+            });
+        }
+
+        native.server.group.onDisconnection(this.serverGroup, (external, code, message, webSocket) => {
+            webSocket.external = null;
+
+            process.nextTick(() => {
+                webSocket.internalOnClose(code, message);
+            });
+
+            native.clearUserData(external);
+        });
+
+        native.server.group.onMessage(this.serverGroup, onServerMessage);
+
+        native.server.group.onPing(this.serverGroup, (message, webSocket) => {
+            webSocket.onping(message);
+        });
+
+        native.server.group.onPong(this.serverGroup, (message, webSocket) => {
+            webSocket.onpong(message);
+        });
+
+        native.server.group.onConnection(this.serverGroup, (external) => {
+            const webSocket = new WebSocket(external);
+
+            native.setUserData(external, webSocket);
+            this._upgradeCallback(webSocket);
+            _upgradeReq = null;
+        });
+
+        if (options.port !== undefined) {
+            if (options.host) {
+                this.httpServer.listen(options.port, options.host, () => {
+                    this.emit('listening');
+                    callback && callback();
+                });
+            } else {
+                this.httpServer.listen(options.port, () => {
+                    this.emit('listening');
+                    callback && callback();
+                });
+            }
+        }
+    }
+
+    handleUpgrade(request, socket, upgradeHead, callback) {
+        if (socket._isNative) {
+            if (this.serverGroup) {
+                _upgradeReq = request;
+                this._upgradeCallback = callback ? callback : noop;
+                native.upgrade(this.serverGroup, socket.external, secKey, request.headers['sec-websocket-extensions'], request.headers['sec-websocket-protocol']);
+            }
+        } else {
+            const secKey = request.headers['sec-websocket-key'];
+            const socketHandle = socket.ssl ? socket._parent._handle : socket._handle;
+            const sslState = socket.ssl ? socket.ssl._external : null;
+            if (socketHandle && secKey && secKey.length == 24) {
+                socket.setNoDelay(this._noDelay);
+                const ticket = native.transfer(socketHandle.fd === -1 ? socketHandle : socketHandle.fd, sslState);
+                socket.on('close', (error) => {
+                    if (this.serverGroup) {
+                        _upgradeReq = request;
+                        this._upgradeCallback = callback ? callback : noop;
+                        native.upgrade(this.serverGroup, ticket, secKey, request.headers['sec-websocket-extensions'], request.headers['sec-websocket-protocol']);
+                    }
+                });
+            }
+            socket.destroy();
+        }
+    }
+
+    broadcast(message, options) {
+        if (this.serverGroup) {
+            native.server.group.broadcast(this.serverGroup, message, options && options.binary || false);
+        }
+    }
+
+    startAutoPing(interval, userMessage) {
+        if (this.serverGroup) {
+            native.server.group.startAutoPing(this.serverGroup, interval, userMessage);
+        }
+    }
+
+    close(cb) {
+        if (this._upgradeListener && this.httpServer) {
+            this.httpServer.removeListener('upgrade', this._upgradeListener);
+
+            if (!this._passedHttpServer) {
+                this.httpServer.close();
+            }
+        }
+
+        if (this.serverGroup) {
+            native.server.group.close(this.serverGroup);
+            this.serverGroup = null;
+        }
+
+        if (typeof cb === 'function') {
+            // compatibility hack, 15 seconds timeout
+            setTimeout(cb, 20000);
+        }
+    }
+
+    get clients() {
+        if (this.serverGroup) {
+            return {
+                length: native.server.group.getSize(this.serverGroup),
+                forEach: ((cb) => {native.server.group.forEach(this.serverGroup, cb)})
+            };
+        }
+    }
+}
+
+WebSocketClient.PERMESSAGE_DEFLATE = 1;
+WebSocketClient.SERVER_NO_CONTEXT_TAKEOVER = 2;
+WebSocketClient.CLIENT_NO_CONTEXT_TAKEOVER = 4;
+WebSocketClient.OPCODE_TEXT = 1;
+WebSocketClient.OPCODE_BINARY = 2;
+WebSocketClient.OPCODE_PING = 9;
+WebSocketClient.OPEN = 1;
+WebSocketClient.CLOSED = 0;
+WebSocketClient.Server = Server;
+WebSocketClient.http = native.httpServer;
+WebSocketClient.native = native;
+module.exports = WebSocketClient;
diff --git a/wrt/node_modules/uws/uws_darwin_46.node b/wrt/node_modules/uws/uws_darwin_46.node
new file mode 100755 (executable)
index 0000000..c7de93b
Binary files /dev/null and b/wrt/node_modules/uws/uws_darwin_46.node differ
diff --git a/wrt/node_modules/uws/uws_darwin_47.node b/wrt/node_modules/uws/uws_darwin_47.node
new file mode 100755 (executable)
index 0000000..10c6424
Binary files /dev/null and b/wrt/node_modules/uws/uws_darwin_47.node differ
diff --git a/wrt/node_modules/uws/uws_darwin_48.node b/wrt/node_modules/uws/uws_darwin_48.node
new file mode 100755 (executable)
index 0000000..d174a5d
Binary files /dev/null and b/wrt/node_modules/uws/uws_darwin_48.node differ
diff --git a/wrt/node_modules/uws/uws_darwin_51.node b/wrt/node_modules/uws/uws_darwin_51.node
new file mode 100755 (executable)
index 0000000..91df0a3
Binary files /dev/null and b/wrt/node_modules/uws/uws_darwin_51.node differ
diff --git a/wrt/node_modules/uws/uws_linux_46.node b/wrt/node_modules/uws/uws_linux_46.node
new file mode 100755 (executable)
index 0000000..21fb42a
Binary files /dev/null and b/wrt/node_modules/uws/uws_linux_46.node differ
diff --git a/wrt/node_modules/uws/uws_linux_47.node b/wrt/node_modules/uws/uws_linux_47.node
new file mode 100755 (executable)
index 0000000..ee3a072
Binary files /dev/null and b/wrt/node_modules/uws/uws_linux_47.node differ
diff --git a/wrt/node_modules/uws/uws_linux_48.node b/wrt/node_modules/uws/uws_linux_48.node
new file mode 100755 (executable)
index 0000000..d672a3e
Binary files /dev/null and b/wrt/node_modules/uws/uws_linux_48.node differ
diff --git a/wrt/node_modules/uws/uws_linux_51.node b/wrt/node_modules/uws/uws_linux_51.node
new file mode 100755 (executable)
index 0000000..60cdd58
Binary files /dev/null and b/wrt/node_modules/uws/uws_linux_51.node differ
diff --git a/wrt/node_modules/uws/uws_win32_48.node b/wrt/node_modules/uws/uws_win32_48.node
new file mode 100755 (executable)
index 0000000..6904bf0
Binary files /dev/null and b/wrt/node_modules/uws/uws_win32_48.node differ
diff --git a/wrt/node_modules/uws/uws_win32_51.node b/wrt/node_modules/uws/uws_win32_51.node
new file mode 100755 (executable)
index 0000000..05d4b4b
Binary files /dev/null and b/wrt/node_modules/uws/uws_win32_51.node differ
diff --git a/wrt/node_modules/vary/HISTORY.md b/wrt/node_modules/vary/HISTORY.md
new file mode 100644 (file)
index 0000000..f6cbcf7
--- /dev/null
@@ -0,0 +1,39 @@
+1.1.2 / 2017-09-23
+==================
+
+  * perf: improve header token parsing speed
+
+1.1.1 / 2017-03-20
+==================
+
+  * perf: hoist regular expression
+
+1.1.0 / 2015-09-29
+==================
+
+  * Only accept valid field names in the `field` argument
+    - Ensures the resulting string is a valid HTTP header value
+
+1.0.1 / 2015-07-08
+==================
+
+  * Fix setting empty header from empty `field`
+  * perf: enable strict mode
+  * perf: remove argument reassignments
+
+1.0.0 / 2014-08-10
+==================
+
+  * Accept valid `Vary` header string as `field`
+  * Add `vary.append` for low-level string manipulation
+  * Move to `jshttp` orgainzation
+
+0.1.0 / 2014-06-05
+==================
+
+  * Support array of fields to set
+
+0.0.0 / 2014-06-04
+==================
+
+  * Initial release
diff --git a/wrt/node_modules/vary/LICENSE b/wrt/node_modules/vary/LICENSE
new file mode 100644 (file)
index 0000000..84441fb
--- /dev/null
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2014-2017 Douglas Christopher Wilson
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/vary/README.md b/wrt/node_modules/vary/README.md
new file mode 100644 (file)
index 0000000..cc000b3
--- /dev/null
@@ -0,0 +1,101 @@
+# vary
+
+[![NPM Version][npm-image]][npm-url]
+[![NPM Downloads][downloads-image]][downloads-url]
+[![Node.js Version][node-version-image]][node-version-url]
+[![Build Status][travis-image]][travis-url]
+[![Test Coverage][coveralls-image]][coveralls-url]
+
+Manipulate the HTTP Vary header
+
+## Installation
+
+This is a [Node.js](https://nodejs.org/en/) module available through the
+[npm registry](https://www.npmjs.com/). Installation is done using the
+[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): 
+
+```sh
+$ npm install vary
+```
+
+## API
+
+<!-- eslint-disable no-unused-vars -->
+
+```js
+var vary = require('vary')
+```
+
+### vary(res, field)
+
+Adds the given header `field` to the `Vary` response header of `res`.
+This can be a string of a single field, a string of a valid `Vary`
+header, or an array of multiple fields.
+
+This will append the header if not already listed, otherwise leaves
+it listed in the current location.
+
+<!-- eslint-disable no-undef -->
+
+```js
+// Append "Origin" to the Vary header of the response
+vary(res, 'Origin')
+```
+
+### vary.append(header, field)
+
+Adds the given header `field` to the `Vary` response header string `header`.
+This can be a string of a single field, a string of a valid `Vary` header,
+or an array of multiple fields.
+
+This will append the header if not already listed, otherwise leaves
+it listed in the current location. The new header string is returned.
+
+<!-- eslint-disable no-undef -->
+
+```js
+// Get header string appending "Origin" to "Accept, User-Agent"
+vary.append('Accept, User-Agent', 'Origin')
+```
+
+## Examples
+
+### Updating the Vary header when content is based on it
+
+```js
+var http = require('http')
+var vary = require('vary')
+
+http.createServer(function onRequest (req, res) {
+  // about to user-agent sniff
+  vary(res, 'User-Agent')
+
+  var ua = req.headers['user-agent'] || ''
+  var isMobile = /mobi|android|touch|mini/i.test(ua)
+
+  // serve site, depending on isMobile
+  res.setHeader('Content-Type', 'text/html')
+  res.end('You are (probably) ' + (isMobile ? '' : 'not ') + 'a mobile user')
+})
+```
+
+## Testing
+
+```sh
+$ npm test
+```
+
+## License
+
+[MIT](LICENSE)
+
+[npm-image]: https://img.shields.io/npm/v/vary.svg
+[npm-url]: https://npmjs.org/package/vary
+[node-version-image]: https://img.shields.io/node/v/vary.svg
+[node-version-url]: https://nodejs.org/en/download
+[travis-image]: https://img.shields.io/travis/jshttp/vary/master.svg
+[travis-url]: https://travis-ci.org/jshttp/vary
+[coveralls-image]: https://img.shields.io/coveralls/jshttp/vary/master.svg
+[coveralls-url]: https://coveralls.io/r/jshttp/vary
+[downloads-image]: https://img.shields.io/npm/dm/vary.svg
+[downloads-url]: https://npmjs.org/package/vary
diff --git a/wrt/node_modules/vary/index.js b/wrt/node_modules/vary/index.js
new file mode 100644 (file)
index 0000000..5b5e741
--- /dev/null
@@ -0,0 +1,149 @@
+/*!
+ * vary
+ * Copyright(c) 2014-2017 Douglas Christopher Wilson
+ * MIT Licensed
+ */
+
+'use strict'
+
+/**
+ * Module exports.
+ */
+
+module.exports = vary
+module.exports.append = append
+
+/**
+ * RegExp to match field-name in RFC 7230 sec 3.2
+ *
+ * field-name    = token
+ * token         = 1*tchar
+ * tchar         = "!" / "#" / "$" / "%" / "&" / "'" / "*"
+ *               / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
+ *               / DIGIT / ALPHA
+ *               ; any VCHAR, except delimiters
+ */
+
+var FIELD_NAME_REGEXP = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/
+
+/**
+ * Append a field to a vary header.
+ *
+ * @param {String} header
+ * @param {String|Array} field
+ * @return {String}
+ * @public
+ */
+
+function append (header, field) {
+  if (typeof header !== 'string') {
+    throw new TypeError('header argument is required')
+  }
+
+  if (!field) {
+    throw new TypeError('field argument is required')
+  }
+
+  // get fields array
+  var fields = !Array.isArray(field)
+    ? parse(String(field))
+    : field
+
+  // assert on invalid field names
+  for (var j = 0; j < fields.length; j++) {
+    if (!FIELD_NAME_REGEXP.test(fields[j])) {
+      throw new TypeError('field argument contains an invalid header name')
+    }
+  }
+
+  // existing, unspecified vary
+  if (header === '*') {
+    return header
+  }
+
+  // enumerate current values
+  var val = header
+  var vals = parse(header.toLowerCase())
+
+  // unspecified vary
+  if (fields.indexOf('*') !== -1 || vals.indexOf('*') !== -1) {
+    return '*'
+  }
+
+  for (var i = 0; i < fields.length; i++) {
+    var fld = fields[i].toLowerCase()
+
+    // append value (case-preserving)
+    if (vals.indexOf(fld) === -1) {
+      vals.push(fld)
+      val = val
+        ? val + ', ' + fields[i]
+        : fields[i]
+    }
+  }
+
+  return val
+}
+
+/**
+ * Parse a vary header into an array.
+ *
+ * @param {String} header
+ * @return {Array}
+ * @private
+ */
+
+function parse (header) {
+  var end = 0
+  var list = []
+  var start = 0
+
+  // gather tokens
+  for (var i = 0, len = header.length; i < len; i++) {
+    switch (header.charCodeAt(i)) {
+      case 0x20: /*   */
+        if (start === end) {
+          start = end = i + 1
+        }
+        break
+      case 0x2c: /* , */
+        list.push(header.substring(start, end))
+        start = end = i + 1
+        break
+      default:
+        end = i + 1
+        break
+    }
+  }
+
+  // final token
+  list.push(header.substring(start, end))
+
+  return list
+}
+
+/**
+ * Mark that a request is varied on a header field.
+ *
+ * @param {Object} res
+ * @param {String|Array} field
+ * @public
+ */
+
+function vary (res, field) {
+  if (!res || !res.getHeader || !res.setHeader) {
+    // quack quack
+    throw new TypeError('res argument is required')
+  }
+
+  // get existing header
+  var val = res.getHeader('Vary') || ''
+  var header = Array.isArray(val)
+    ? val.join(', ')
+    : String(val)
+
+  // set new header
+  if ((val = append(header, field))) {
+    res.setHeader('Vary', val)
+  }
+}
diff --git a/wrt/node_modules/vary/package.json b/wrt/node_modules/vary/package.json
new file mode 100644 (file)
index 0000000..066a524
--- /dev/null
@@ -0,0 +1,114 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "vary@~1.1.1",
+        "scope": null,
+        "escapedName": "vary",
+        "name": "vary",
+        "rawSpec": "~1.1.1",
+        "spec": ">=1.1.1 <1.2.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express"
+    ]
+  ],
+  "_from": "vary@>=1.1.1 <1.2.0",
+  "_id": "vary@1.1.2",
+  "_inCache": true,
+  "_location": "/vary",
+  "_nodeVersion": "6.11.1",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/vary-1.1.2.tgz_1506217630296_0.28528453782200813"
+  },
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "_npmVersion": "3.10.10",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "vary@~1.1.1",
+    "scope": null,
+    "escapedName": "vary",
+    "name": "vary",
+    "rawSpec": "~1.1.1",
+    "spec": ">=1.1.1 <1.2.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/express"
+  ],
+  "_resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
+  "_shasum": "2299f02c6ded30d4a5961b0b9f74524a18f634fc",
+  "_shrinkwrap": null,
+  "_spec": "vary@~1.1.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/express",
+  "author": {
+    "name": "Douglas Christopher Wilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "bugs": {
+    "url": "https://github.com/jshttp/vary/issues"
+  },
+  "dependencies": {},
+  "description": "Manipulate the HTTP Vary header",
+  "devDependencies": {
+    "beautify-benchmark": "0.2.4",
+    "benchmark": "2.1.4",
+    "eslint": "3.19.0",
+    "eslint-config-standard": "10.2.1",
+    "eslint-plugin-import": "2.7.0",
+    "eslint-plugin-markdown": "1.0.0-beta.6",
+    "eslint-plugin-node": "5.1.1",
+    "eslint-plugin-promise": "3.5.0",
+    "eslint-plugin-standard": "3.0.1",
+    "istanbul": "0.4.5",
+    "mocha": "2.5.3",
+    "supertest": "1.1.0"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "2299f02c6ded30d4a5961b0b9f74524a18f634fc",
+    "tarball": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz"
+  },
+  "engines": {
+    "node": ">= 0.8"
+  },
+  "files": [
+    "HISTORY.md",
+    "LICENSE",
+    "README.md",
+    "index.js"
+  ],
+  "gitHead": "4067e646233fbc8ec9e7a9cd78d6f063c6fdc17e",
+  "homepage": "https://github.com/jshttp/vary#readme",
+  "keywords": [
+    "http",
+    "res",
+    "vary"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "name": "vary",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/jshttp/vary.git"
+  },
+  "scripts": {
+    "bench": "node benchmark/index.js",
+    "lint": "eslint --plugin markdown --ext js,md .",
+    "test": "mocha --reporter spec --bail --check-leaks test/",
+    "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
+    "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
+  },
+  "version": "1.1.2"
+}
diff --git a/wrt/node_modules/window-size/LICENSE b/wrt/node_modules/window-size/LICENSE
new file mode 100644 (file)
index 0000000..65f90ac
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2015, Jon Schlinkert.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/window-size/README.md b/wrt/node_modules/window-size/README.md
new file mode 100644 (file)
index 0000000..0985bd6
--- /dev/null
@@ -0,0 +1,45 @@
+# window-size [![NPM version](https://badge.fury.io/js/window-size.svg)](http://badge.fury.io/js/window-size)  [![Build Status](https://travis-ci.org/jonschlinkert/window-size.svg)](https://travis-ci.org/jonschlinkert/window-size)
+
+> Reliable way to to get the height and width of the terminal/console in a node.js environment.
+
+## Install
+
+Install with [npm](https://www.npmjs.com/)
+
+```sh
+$ npm i window-size --save
+```
+
+## Usage
+
+```js
+var size = require('window-size');
+size.height; // "25" (rows)
+size.width; // "80" (columns)
+```
+
+## Other projects
+
+* [base-cli](https://www.npmjs.com/package/base-cli): Plugin for base-methods that maps built-in methods to CLI args (also supports methods from a… [more](https://www.npmjs.com/package/base-cli) | [homepage](https://github.com/jonschlinkert/base-cli)
+* [lint-deps](https://www.npmjs.com/package/lint-deps): CLI tool that tells you when dependencies are missing from package.json and offers you a… [more](https://www.npmjs.com/package/lint-deps) | [homepage](https://github.com/jonschlinkert/lint-deps)
+* [yargs](https://www.npmjs.com/package/yargs): Light-weight option parsing with an argv hash. No optstrings attached. | [homepage](https://github.com/bcoe/yargs#readme)
+
+## Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/window-size/issues/new).
+
+## Author
+
+**Jon Schlinkert**
+
++ [github/jonschlinkert](https://github.com/jonschlinkert)
++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
+
+## License
+
+Copyright © 2014-2015 [Jon Schlinkert](https://github.com/jonschlinkert)
+Released under the MIT license.
+
+***
+
+_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on November 15, 2015._
\ No newline at end of file
diff --git a/wrt/node_modules/window-size/cli.js b/wrt/node_modules/window-size/cli.js
new file mode 100755 (executable)
index 0000000..dd8d0e5
--- /dev/null
@@ -0,0 +1,30 @@
+#!/usr/bin/env node
+'use strict';
+var helpText = ['Usage',
+'  $ window-size',
+'',
+'Example',
+'  $ window-size',
+'  height: 40 ',
+'  width : 145',
+''].join('\n');
+
+function showSize () {
+  var size = require('./');
+  console.log('height: ' + size.height);
+  console.log('width : ' + size.width);
+}
+
+if (process.argv.length > 2) {
+  switch (process.argv[2]) {
+    case 'help':
+    case '--help':
+    case '-h':
+      console.log(helpText);
+      break;
+    default:
+      showSize();
+  }
+} else {
+  showSize();
+}
diff --git a/wrt/node_modules/window-size/index.js b/wrt/node_modules/window-size/index.js
new file mode 100644 (file)
index 0000000..eba89c9
--- /dev/null
@@ -0,0 +1,32 @@
+'use strict';
+
+/*!
+ * window-size <https://github.com/jonschlinkert/window-size>
+ *
+ * Copyright (c) 2014-2015 Jon Schlinkert
+ * Licensed under the MIT license.
+ */
+
+var tty = require('tty');
+
+module.exports = (function () {
+  var width;
+  var height;
+
+  if (tty.isatty(1) && tty.isatty(2)) {
+    if (process.stdout.getWindowSize) {
+      width = process.stdout.getWindowSize(1)[0];
+      height = process.stdout.getWindowSize(1)[1];
+    } else if (tty.getWindowSize) {
+      width = tty.getWindowSize()[1];
+      height = tty.getWindowSize()[0];
+    } else if (process.stdout.columns && process.stdout.rows) {
+      height = process.stdout.columns;
+      width = process.stdout.rows;
+    }
+  } else {
+    Error('window-size could not get size with tty or process.stdout.');
+  }
+
+  return {height: height, width: width};
+})();
diff --git a/wrt/node_modules/window-size/package.json b/wrt/node_modules/window-size/package.json
new file mode 100644 (file)
index 0000000..4aaecc0
--- /dev/null
@@ -0,0 +1,81 @@
+{
+  "_from": "window-size@^0.1.1",
+  "_id": "window-size@0.1.4",
+  "_inBundle": false,
+  "_integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=",
+  "_location": "/window-size",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "window-size@^0.1.1",
+    "name": "window-size",
+    "escapedName": "window-size",
+    "rawSpec": "^0.1.1",
+    "saveSpec": null,
+    "fetchSpec": "^0.1.1"
+  },
+  "_requiredBy": [
+    "/yargs"
+  ],
+  "_resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz",
+  "_shasum": "f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876",
+  "_spec": "window-size@^0.1.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was/node_modules/yargs",
+  "author": {
+    "name": "Jon Schlinkert",
+    "url": "https://github.com/jonschlinkert"
+  },
+  "bin": {
+    "window-size": "cli.js"
+  },
+  "bugs": {
+    "url": "https://github.com/jonschlinkert/window-size/issues"
+  },
+  "bundleDependencies": false,
+  "deprecated": false,
+  "description": "Reliable way to to get the height and width of the terminal/console in a node.js environment.",
+  "devDependencies": {
+    "semistandard": "^7.0.2",
+    "tap": "^2.2.1"
+  },
+  "engines": {
+    "node": ">= 0.10.0"
+  },
+  "files": [
+    "index.js",
+    "cli.js"
+  ],
+  "homepage": "https://github.com/jonschlinkert/window-size",
+  "keywords": [
+    "console",
+    "height",
+    "resize",
+    "size",
+    "terminal",
+    "tty",
+    "width",
+    "window"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "name": "window-size",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/jonschlinkert/window-size.git"
+  },
+  "scripts": {
+    "pretest": "semistandard",
+    "test": "tap --coverage test.js"
+  },
+  "verb": {
+    "related": {
+      "list": [
+        "yargs",
+        "lint-deps",
+        "base-cli"
+      ]
+    }
+  },
+  "version": "0.1.4"
+}
diff --git a/wrt/node_modules/wrappy/LICENSE b/wrt/node_modules/wrappy/LICENSE
new file mode 100644 (file)
index 0000000..19129e3
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/wrt/node_modules/wrappy/README.md b/wrt/node_modules/wrappy/README.md
new file mode 100644 (file)
index 0000000..98eab25
--- /dev/null
@@ -0,0 +1,36 @@
+# wrappy
+
+Callback wrapping utility
+
+## USAGE
+
+```javascript
+var wrappy = require("wrappy")
+
+// var wrapper = wrappy(wrapperFunction)
+
+// make sure a cb is called only once
+// See also: http://npm.im/once for this specific use case
+var once = wrappy(function (cb) {
+  var called = false
+  return function () {
+    if (called) return
+    called = true
+    return cb.apply(this, arguments)
+  }
+})
+
+function printBoo () {
+  console.log('boo')
+}
+// has some rando property
+printBoo.iAmBooPrinter = true
+
+var onlyPrintOnce = once(printBoo)
+
+onlyPrintOnce() // prints 'boo'
+onlyPrintOnce() // does nothing
+
+// random property is retained!
+assert.equal(onlyPrintOnce.iAmBooPrinter, true)
+```
diff --git a/wrt/node_modules/wrappy/package.json b/wrt/node_modules/wrappy/package.json
new file mode 100644 (file)
index 0000000..4a0f6b2
--- /dev/null
@@ -0,0 +1,59 @@
+{
+  "_from": "wrappy@1",
+  "_id": "wrappy@1.0.2",
+  "_inBundle": false,
+  "_integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
+  "_location": "/wrappy",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "wrappy@1",
+    "name": "wrappy",
+    "escapedName": "wrappy",
+    "rawSpec": "1",
+    "saveSpec": null,
+    "fetchSpec": "1"
+  },
+  "_requiredBy": [
+    "/inflight",
+    "/once"
+  ],
+  "_resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
+  "_shasum": "b5243d8f3ec1aa35f1364605bc0d1036e30ab69f",
+  "_spec": "wrappy@1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was/node_modules/inflight",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bugs": {
+    "url": "https://github.com/npm/wrappy/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {},
+  "deprecated": false,
+  "description": "Callback wrapping utility",
+  "devDependencies": {
+    "tap": "^2.3.1"
+  },
+  "directories": {
+    "test": "test"
+  },
+  "files": [
+    "wrappy.js"
+  ],
+  "homepage": "https://github.com/npm/wrappy",
+  "license": "ISC",
+  "main": "wrappy.js",
+  "name": "wrappy",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/npm/wrappy.git"
+  },
+  "scripts": {
+    "test": "tap --coverage test/*.js"
+  },
+  "version": "1.0.2"
+}
diff --git a/wrt/node_modules/wrappy/wrappy.js b/wrt/node_modules/wrappy/wrappy.js
new file mode 100644 (file)
index 0000000..bb7e7d6
--- /dev/null
@@ -0,0 +1,33 @@
+// Returns a wrapper function that returns a wrapped callback
+// The wrapper function should do some stuff, and return a
+// presumably different callback function.
+// This makes sure that own properties are retained, so that
+// decorations and such are not lost along the way.
+module.exports = wrappy
+function wrappy (fn, cb) {
+  if (fn && cb) return wrappy(fn)(cb)
+
+  if (typeof fn !== 'function')
+    throw new TypeError('need wrapper function')
+
+  Object.keys(fn).forEach(function (k) {
+    wrapper[k] = fn[k]
+  })
+
+  return wrapper
+
+  function wrapper() {
+    var args = new Array(arguments.length)
+    for (var i = 0; i < args.length; i++) {
+      args[i] = arguments[i]
+    }
+    var ret = fn.apply(this, args)
+    var cb = args[args.length-1]
+    if (typeof ret === 'function' && ret !== cb) {
+      Object.keys(cb).forEach(function (k) {
+        ret[k] = cb[k]
+      })
+    }
+    return ret
+  }
+}
diff --git a/wrt/node_modules/ws/LICENSE b/wrt/node_modules/ws/LICENSE
new file mode 100644 (file)
index 0000000..a145cd1
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/wrt/node_modules/ws/README.md b/wrt/node_modules/ws/README.md
new file mode 100644 (file)
index 0000000..1ca0bdb
--- /dev/null
@@ -0,0 +1,260 @@
+# ws: a Node.js WebSocket library
+
+[![Version npm](https://img.shields.io/npm/v/ws.svg)](https://www.npmjs.com/package/ws)
+[![Linux Build](https://img.shields.io/travis/websockets/ws/master.svg)](https://travis-ci.org/websockets/ws)
+[![Windows Build](https://ci.appveyor.com/api/projects/status/github/websockets/ws?branch=master&svg=true)](https://ci.appveyor.com/project/lpinca/ws)
+[![Coverage Status](https://img.shields.io/coveralls/websockets/ws/master.svg)](https://coveralls.io/r/websockets/ws?branch=master)
+
+`ws` is a simple to use, blazing fast, and thoroughly tested WebSocket client
+and server implementation.
+
+Passes the quite extensive Autobahn test suite. See http://websockets.github.io/ws/
+for the full reports.
+
+**Note**: This module does not work in the browser. The client in the docs is a
+reference to a back end with the role of a client in the WebSocket
+communication. Browser clients must use the native
+[`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) object.
+
+## Protocol support
+
+* **HyBi drafts 07-12** (Use the option `protocolVersion: 8`)
+* **HyBi drafts 13-17** (Current default, alternatively option `protocolVersion: 13`)
+
+## Installing
+
+```
+npm install --save ws
+```
+
+### Opt-in for performance and spec compliance
+
+There are 2 optional modules that can be installed along side with the `ws`
+module. These modules are binary addons which improve certain operations.
+Prebuilt binaries are available for the most popular platforms so you don't
+necessarily need to have a C++ compiler installed on your machine.
+
+- `npm install --save-optional bufferutil`: Allows to efficiently perform
+  operations such as masking and unmasking the data payload of the WebSocket
+  frames.
+- `npm install --save-optional utf-8-validate`: Allows to efficiently check
+  if a message contains valid UTF-8 as required by the spec.
+
+## API Docs
+
+See [`/doc/ws.md`](https://github.com/websockets/ws/blob/master/doc/ws.md)
+for Node.js-like docs for the ws classes.
+
+## WebSocket compression
+
+`ws` supports the [permessage-deflate extension][permessage-deflate] which
+enables the client and server to negotiate a compression algorithm and its
+parameters, and then selectively apply it to the data payloads of each
+WebSocket message.
+
+The extension is enabled by default but adds a significant overhead in terms of
+performance and memory comsumption. We suggest to use WebSocket compression
+only if it is really needed.
+
+To disable the extension you can set the `perMessageDeflate` option to `false`.
+On the server:
+
+```js
+const WebSocket = require('ws');
+
+const wss = new WebSocket.Server({
+  perMessageDeflate: false,
+  port: 8080
+});
+```
+
+On the client:
+
+```js
+const WebSocket = require('ws');
+
+const ws = new WebSocket('ws://www.host.com/path', {
+  perMessageDeflate: false
+});
+```
+
+## Usage examples
+
+### Sending and receiving text data
+
+```js
+const WebSocket = require('ws');
+
+const ws = new WebSocket('ws://www.host.com/path');
+
+ws.on('open', function open() {
+  ws.send('something');
+});
+
+ws.on('message', function incoming(data, flags) {
+  // flags.binary will be set if a binary data is received.
+  // flags.masked will be set if the data was masked.
+});
+```
+
+### Sending binary data
+
+```js
+const WebSocket = require('ws');
+
+const ws = new WebSocket('ws://www.host.com/path');
+
+ws.on('open', function open() {
+  const array = new Float32Array(5);
+
+  for (var i = 0; i < array.length; ++i) {
+    array[i] = i / 2;
+  }
+
+  ws.send(array);
+});
+```
+
+### Server example
+
+```js
+const WebSocket = require('ws');
+
+const wss = new WebSocket.Server({ port: 8080 });
+
+wss.on('connection', function connection(ws) {
+  ws.on('message', function incoming(message) {
+    console.log('received: %s', message);
+  });
+
+  ws.send('something');
+});
+```
+
+### Broadcast example
+
+```js
+const WebSocket = require('ws');
+
+const wss = new WebSocket.Server({ port: 8080 });
+
+// Broadcast to all.
+wss.broadcast = function broadcast(data) {
+  wss.clients.forEach(function each(client) {
+    if (client.readyState === WebSocket.OPEN) {
+      client.send(data);
+    }
+  });
+};
+
+wss.on('connection', function connection(ws) {
+  ws.on('message', function incoming(data) {
+    // Broadcast to everyone else.
+    wss.clients.forEach(function each(client) {
+      if (client !== ws && client.readyState === WebSocket.OPEN) {
+        client.send(data);
+      }
+    });
+  });
+});
+```
+
+### ExpressJS example
+
+```js
+const express = require('express');
+const http = require('http');
+const url = require('url');
+const WebSocket = require('ws');
+
+const app = express();
+
+app.use(function (req, res) {
+  res.send({ msg: "hello" });
+});
+
+const server = http.createServer(app);
+const wss = new WebSocket.Server({ server });
+
+wss.on('connection', function connection(ws) {
+  const location = url.parse(ws.upgradeReq.url, true);
+  // You might use location.query.access_token to authenticate or share sessions
+  // or ws.upgradeReq.headers.cookie (see http://stackoverflow.com/a/16395220/151312)
+
+  ws.on('message', function incoming(message) {
+    console.log('received: %s', message);
+  });
+
+  ws.send('something');
+});
+
+server.listen(8080, function listening() {
+  console.log('Listening on %d', server.address().port);
+});
+```
+
+### echo.websocket.org demo
+
+```js
+const WebSocket = require('ws');
+
+const ws = new WebSocket('wss://echo.websocket.org/', {
+  origin: 'https://websocket.org'
+});
+
+ws.on('open', function open() {
+  console.log('connected');
+  ws.send(Date.now());
+});
+
+ws.on('close', function close() {
+  console.log('disconnected');
+});
+
+ws.on('message', function incoming(data, flags) {
+  console.log(`Roundtrip time: ${Date.now() - data} ms`, flags);
+
+  setTimeout(function timeout() {
+    ws.send(Date.now());
+  }, 500);
+});
+```
+
+### Other examples
+
+For a full example with a browser client communicating with a ws server, see the
+examples folder.
+
+Otherwise, see the test cases.
+
+## Error handling best practices
+
+```js
+// If the WebSocket is closed before the following send is attempted
+ws.send('something');
+
+// Errors (both immediate and async write errors) can be detected in an optional
+// callback. The callback is also the only way of being notified that data has
+// actually been sent.
+ws.send('something', function ack(error) {
+  // If error is not defined, the send has been completed, otherwise the error
+  // object will indicate what failed.
+});
+
+// Immediate errors can also be handled with `try...catch`, but **note** that
+// since sends are inherently asynchronous, socket write failures will *not* be
+// captured when this technique is used.
+try { ws.send('something'); }
+catch (e) { /* handle error */ }
+```
+
+## Changelog
+
+We're using the GitHub [`releases`](https://github.com/websockets/ws/releases)
+for changelog entries.
+
+## License
+
+[MIT](LICENSE)
+
+[permessage-deflate]: https://tools.ietf.org/html/rfc7692
diff --git a/wrt/node_modules/ws/index.js b/wrt/node_modules/ws/index.js
new file mode 100644 (file)
index 0000000..489e169
--- /dev/null
@@ -0,0 +1,15 @@
+/*!
+ * ws: a node.js websocket client
+ * Copyright(c) 2011 Einar Otto Stangvik <einaros@gmail.com>
+ * MIT Licensed
+ */
+
+'use strict';
+
+const WebSocket = require('./lib/WebSocket');
+
+WebSocket.Server = require('./lib/WebSocketServer');
+WebSocket.Receiver = require('./lib/Receiver');
+WebSocket.Sender = require('./lib/Sender');
+
+module.exports = WebSocket;
diff --git a/wrt/node_modules/ws/lib/BufferUtil.js b/wrt/node_modules/ws/lib/BufferUtil.js
new file mode 100644 (file)
index 0000000..6a35e8f
--- /dev/null
@@ -0,0 +1,71 @@
+/*!
+ * ws: a node.js websocket client
+ * Copyright(c) 2011 Einar Otto Stangvik <einaros@gmail.com>
+ * MIT Licensed
+ */
+
+'use strict';
+
+const safeBuffer = require('safe-buffer');
+
+const Buffer = safeBuffer.Buffer;
+
+/**
+ * Merges an array of buffers into a new buffer.
+ *
+ * @param {Buffer[]} list The array of buffers to concat
+ * @param {Number} totalLength The total length of buffers in the list
+ * @return {Buffer} The resulting buffer
+ * @public
+ */
+const concat = (list, totalLength) => {
+  const target = Buffer.allocUnsafe(totalLength);
+  var offset = 0;
+
+  for (var i = 0; i < list.length; i++) {
+    const buf = list[i];
+    buf.copy(target, offset);
+    offset += buf.length;
+  }
+
+  return target;
+};
+
+try {
+  const bufferUtil = require('bufferutil');
+
+  module.exports = Object.assign({ concat }, bufferUtil.BufferUtil || bufferUtil);
+} catch (e) /* istanbul ignore next */ {
+  /**
+   * Masks a buffer using the given mask.
+   *
+   * @param {Buffer} source The buffer to mask
+   * @param {Buffer} mask The mask to use
+   * @param {Buffer} output The buffer where to store the result
+   * @param {Number} offset The offset at which to start writing
+   * @param {Number} length The number of bytes to mask.
+   * @public
+   */
+  const mask = (source, mask, output, offset, length) => {
+    for (var i = 0; i < length; i++) {
+      output[offset + i] = source[i] ^ mask[i & 3];
+    }
+  };
+
+  /**
+   * Unmasks a buffer using the given mask.
+   *
+   * @param {Buffer} buffer The buffer to unmask
+   * @param {Buffer} mask The mask to use
+   * @public
+   */
+  const unmask = (buffer, mask) => {
+    // Required until https://github.com/nodejs/node/issues/9006 is resolved.
+    const length = buffer.length;
+    for (var i = 0; i < length; i++) {
+      buffer[i] ^= mask[i & 3];
+    }
+  };
+
+  module.exports = { concat, mask, unmask };
+}
diff --git a/wrt/node_modules/ws/lib/Constants.js b/wrt/node_modules/ws/lib/Constants.js
new file mode 100644 (file)
index 0000000..3904414
--- /dev/null
@@ -0,0 +1,10 @@
+'use strict';
+
+const safeBuffer = require('safe-buffer');
+
+const Buffer = safeBuffer.Buffer;
+
+exports.BINARY_TYPES = ['nodebuffer', 'arraybuffer', 'fragments'];
+exports.GUID = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11';
+exports.EMPTY_BUFFER = Buffer.alloc(0);
+exports.NOOP = () => {};
diff --git a/wrt/node_modules/ws/lib/ErrorCodes.js b/wrt/node_modules/ws/lib/ErrorCodes.js
new file mode 100644 (file)
index 0000000..f515571
--- /dev/null
@@ -0,0 +1,28 @@
+/*!
+ * ws: a node.js websocket client
+ * Copyright(c) 2011 Einar Otto Stangvik <einaros@gmail.com>
+ * MIT Licensed
+ */
+
+'use strict';
+
+module.exports = {
+  isValidErrorCode: function (code) {
+    return (code >= 1000 && code <= 1013 && code !== 1004 && code !== 1005 && code !== 1006) ||
+      (code >= 3000 && code <= 4999);
+  },
+  1000: 'normal',
+  1001: 'going away',
+  1002: 'protocol error',
+  1003: 'unsupported data',
+  1004: 'reserved',
+  1005: 'reserved for extensions',
+  1006: 'reserved for extensions',
+  1007: 'inconsistent or invalid data',
+  1008: 'policy violation',
+  1009: 'message too big',
+  1010: 'extension handshake missing',
+  1011: 'an unexpected condition prevented the request from being fulfilled',
+  1012: 'service restart',
+  1013: 'try again later'
+};
diff --git a/wrt/node_modules/ws/lib/EventTarget.js b/wrt/node_modules/ws/lib/EventTarget.js
new file mode 100644 (file)
index 0000000..e30b1b3
--- /dev/null
@@ -0,0 +1,155 @@
+'use strict';
+
+/**
+ * Class representing an event.
+ *
+ * @private
+ */
+class Event {
+  /**
+   * Create a new `Event`.
+   *
+   * @param {String} type The name of the event
+   * @param {Object} target A reference to the target to which the event was dispatched
+   */
+  constructor (type, target) {
+    this.target = target;
+    this.type = type;
+  }
+}
+
+/**
+ * Class representing a message event.
+ *
+ * @extends Event
+ * @private
+ */
+class MessageEvent extends Event {
+  /**
+   * Create a new `MessageEvent`.
+   *
+   * @param {(String|Buffer|ArrayBuffer|Buffer[])} data The received data
+   * @param {Boolean} isBinary Specifies if `data` is binary
+   * @param {WebSocket} target A reference to the target to which the event was dispatched
+   */
+  constructor (data, isBinary, target) {
+    super('message', target);
+
+    this.binary = isBinary; // non-standard.
+    this.data = data;
+  }
+}
+
+/**
+ * Class representing a close event.
+ *
+ * @extends Event
+ * @private
+ */
+class CloseEvent extends Event {
+  /**
+   * Create a new `CloseEvent`.
+   *
+   * @param {Number} code The status code explaining why the connection is being closed
+   * @param {String} reason A human-readable string explaining why the connection is closing
+   * @param {WebSocket} target A reference to the target to which the event was dispatched
+   */
+  constructor (code, reason, target) {
+    super('close', target);
+
+    this.wasClean = code === undefined || code === 1000;
+    this.reason = reason;
+    this.target = target;
+    this.type = 'close';
+    this.code = code;
+  }
+}
+
+/**
+ * Class representing an open event.
+ *
+ * @extends Event
+ * @private
+ */
+class OpenEvent extends Event {
+  /**
+   * Create a new `OpenEvent`.
+   *
+   * @param {WebSocket} target A reference to the target to which the event was dispatched
+   */
+  constructor (target) {
+    super('open', target);
+  }
+}
+
+/**
+ * This provides methods for emulating the `EventTarget` interface. It's not
+ * meant to be used directly.
+ *
+ * @mixin
+ */
+const EventTarget = {
+  /**
+   * Register an event listener.
+   *
+   * @param {String} method A string representing the event type to listen for
+   * @param {Function} listener The listener to add
+   * @public
+   */
+  addEventListener (method, listener) {
+    if (typeof listener !== 'function') return;
+
+    function onMessage (data, flags) {
+      listener.call(this, new MessageEvent(data, !!flags.binary, this));
+    }
+
+    function onClose (code, message) {
+      listener.call(this, new CloseEvent(code, message, this));
+    }
+
+    function onError (event) {
+      event.type = 'error';
+      event.target = this;
+      listener.call(this, event);
+    }
+
+    function onOpen () {
+      listener.call(this, new OpenEvent(this));
+    }
+
+    if (method === 'message') {
+      onMessage._listener = listener;
+      this.on(method, onMessage);
+    } else if (method === 'close') {
+      onClose._listener = listener;
+      this.on(method, onClose);
+    } else if (method === 'error') {
+      onError._listener = listener;
+      this.on(method, onError);
+    } else if (method === 'open') {
+      onOpen._listener = listener;
+      this.on(method, onOpen);
+    } else {
+      this.on(method, listener);
+    }
+  },
+
+  /**
+   * Remove an event listener.
+   *
+   * @param {String} method A string representing the event type to remove
+   * @param {Function} listener The listener to remove
+   * @public
+   */
+  removeEventListener (method, listener) {
+    const listeners = this.listeners(method);
+
+    for (var i = 0; i < listeners.length; i++) {
+      if (listeners[i] === listener || listeners[i]._listener === listener) {
+        this.removeListener(method, listeners[i]);
+      }
+    }
+  }
+};
+
+module.exports = EventTarget;
diff --git a/wrt/node_modules/ws/lib/Extensions.js b/wrt/node_modules/ws/lib/Extensions.js
new file mode 100644 (file)
index 0000000..a91910e
--- /dev/null
@@ -0,0 +1,67 @@
+'use strict';
+
+/**
+ * Parse the `Sec-WebSocket-Extensions` header into an object.
+ *
+ * @param {String} value field value of the header
+ * @return {Object} The parsed object
+ * @public
+ */
+const parse = (value) => {
+  value = value || '';
+
+  const extensions = {};
+
+  value.split(',').forEach((v) => {
+    const params = v.split(';');
+    const token = params.shift().trim();
+    const paramsList = extensions[token] = extensions[token] || [];
+    const parsedParams = {};
+
+    params.forEach((param) => {
+      const parts = param.trim().split('=');
+      const key = parts[0];
+      var value = parts[1];
+
+      if (value === undefined) {
+        value = true;
+      } else {
+        // unquote value
+        if (value[0] === '"') {
+          value = value.slice(1);
+        }
+        if (value[value.length - 1] === '"') {
+          value = value.slice(0, value.length - 1);
+        }
+      }
+      (parsedParams[key] = parsedParams[key] || []).push(value);
+    });
+
+    paramsList.push(parsedParams);
+  });
+
+  return extensions;
+};
+
+/**
+ * Serialize a parsed `Sec-WebSocket-Extensions` header to a string.
+ *
+ * @param {Object} value The object to format
+ * @return {String} A string representing the given value
+ * @public
+ */
+const format = (value) => {
+  return Object.keys(value).map((token) => {
+    var paramsList = value[token];
+    if (!Array.isArray(paramsList)) paramsList = [paramsList];
+    return paramsList.map((params) => {
+      return [token].concat(Object.keys(params).map((k) => {
+        var p = params[k];
+        if (!Array.isArray(p)) p = [p];
+        return p.map((v) => v === true ? k : `${k}=${v}`).join('; ');
+      })).join('; ');
+    }).join(', ');
+  }).join(', ');
+};
+
+module.exports = { format, parse };
diff --git a/wrt/node_modules/ws/lib/PerMessageDeflate.js b/wrt/node_modules/ws/lib/PerMessageDeflate.js
new file mode 100644 (file)
index 0000000..c1a1d3c
--- /dev/null
@@ -0,0 +1,384 @@
+'use strict';
+
+const safeBuffer = require('safe-buffer');
+const zlib = require('zlib');
+
+const bufferUtil = require('./BufferUtil');
+
+const Buffer = safeBuffer.Buffer;
+
+const AVAILABLE_WINDOW_BITS = [8, 9, 10, 11, 12, 13, 14, 15];
+const TRAILER = Buffer.from([0x00, 0x00, 0xff, 0xff]);
+const EMPTY_BLOCK = Buffer.from([0x00]);
+const DEFAULT_WINDOW_BITS = 15;
+const DEFAULT_MEM_LEVEL = 8;
+
+/**
+ * Per-message Deflate implementation.
+ */
+class PerMessageDeflate {
+  constructor (options, isServer, maxPayload) {
+    this._options = options || {};
+    this._isServer = !!isServer;
+    this._inflate = null;
+    this._deflate = null;
+    this.params = null;
+    this._maxPayload = maxPayload || 0;
+    this.threshold = this._options.threshold === undefined ? 1024 : this._options.threshold;
+  }
+
+  static get extensionName () {
+    return 'permessage-deflate';
+  }
+
+  /**
+   * Create extension parameters offer.
+   *
+   * @return {Object} Extension parameters
+   * @public
+   */
+  offer () {
+    const params = {};
+
+    if (this._options.serverNoContextTakeover) {
+      params.server_no_context_takeover = true;
+    }
+    if (this._options.clientNoContextTakeover) {
+      params.client_no_context_takeover = true;
+    }
+    if (this._options.serverMaxWindowBits) {
+      params.server_max_window_bits = this._options.serverMaxWindowBits;
+    }
+    if (this._options.clientMaxWindowBits) {
+      params.client_max_window_bits = this._options.clientMaxWindowBits;
+    } else if (this._options.clientMaxWindowBits == null) {
+      params.client_max_window_bits = true;
+    }
+
+    return params;
+  }
+
+  /**
+   * Accept extension offer.
+   *
+   * @param {Array} paramsList Extension parameters
+   * @return {Object} Accepted configuration
+   * @public
+   */
+  accept (paramsList) {
+    paramsList = this.normalizeParams(paramsList);
+
+    var params;
+    if (this._isServer) {
+      params = this.acceptAsServer(paramsList);
+    } else {
+      params = this.acceptAsClient(paramsList);
+    }
+
+    this.params = params;
+    return params;
+  }
+
+  /**
+   * Releases all resources used by the extension.
+   *
+   * @public
+   */
+  cleanup () {
+    if (this._inflate) {
+      if (this._inflate.writeInProgress) {
+        this._inflate.pendingClose = true;
+      } else {
+        this._inflate.close();
+        this._inflate = null;
+      }
+    }
+    if (this._deflate) {
+      if (this._deflate.writeInProgress) {
+        this._deflate.pendingClose = true;
+      } else {
+        this._deflate.close();
+        this._deflate = null;
+      }
+    }
+  }
+
+  /**
+   * Accept extension offer from client.
+   *
+   * @param {Array} paramsList Extension parameters
+   * @return {Object} Accepted configuration
+   * @private
+   */
+  acceptAsServer (paramsList) {
+    const accepted = {};
+    const result = paramsList.some((params) => {
+      if ((
+        this._options.serverNoContextTakeover === false &&
+        params.server_no_context_takeover
+      ) || (
+        this._options.serverMaxWindowBits === false &&
+        params.server_max_window_bits
+      ) || (
+        typeof this._options.serverMaxWindowBits === 'number' &&
+        typeof params.server_max_window_bits === 'number' &&
+        this._options.serverMaxWindowBits > params.server_max_window_bits
+      ) || (
+        typeof this._options.clientMaxWindowBits === 'number' &&
+        !params.client_max_window_bits
+      )) {
+        return;
+      }
+
+      if (
+        this._options.serverNoContextTakeover ||
+        params.server_no_context_takeover
+      ) {
+        accepted.server_no_context_takeover = true;
+      }
+      if (this._options.clientNoContextTakeover) {
+        accepted.client_no_context_takeover = true;
+      }
+      if (
+        this._options.clientNoContextTakeover !== false &&
+        params.client_no_context_takeover
+      ) {
+        accepted.client_no_context_takeover = true;
+      }
+      if (typeof this._options.serverMaxWindowBits === 'number') {
+        accepted.server_max_window_bits = this._options.serverMaxWindowBits;
+      } else if (typeof params.server_max_window_bits === 'number') {
+        accepted.server_max_window_bits = params.server_max_window_bits;
+      }
+      if (typeof this._options.clientMaxWindowBits === 'number') {
+        accepted.client_max_window_bits = this._options.clientMaxWindowBits;
+      } else if (
+        this._options.clientMaxWindowBits !== false &&
+        typeof params.client_max_window_bits === 'number'
+      ) {
+        accepted.client_max_window_bits = params.client_max_window_bits;
+      }
+      return true;
+    });
+
+    if (!result) throw new Error(`Doesn't support the offered configuration`);
+
+    return accepted;
+  }
+
+  /**
+   * Accept extension response from server.
+   *
+   * @param {Array} paramsList Extension parameters
+   * @return {Object} Accepted configuration
+   * @private
+   */
+  acceptAsClient (paramsList) {
+    const params = paramsList[0];
+
+    if (this._options.clientNoContextTakeover != null) {
+      if (
+        this._options.clientNoContextTakeover === false &&
+        params.client_no_context_takeover
+      ) {
+        throw new Error('Invalid value for "client_no_context_takeover"');
+      }
+    }
+    if (this._options.clientMaxWindowBits != null) {
+      if (
+        this._options.clientMaxWindowBits === false &&
+        params.client_max_window_bits
+      ) {
+        throw new Error('Invalid value for "client_max_window_bits"');
+      }
+      if (
+        typeof this._options.clientMaxWindowBits === 'number' && (
+        !params.client_max_window_bits ||
+        params.client_max_window_bits > this._options.clientMaxWindowBits
+      )) {
+        throw new Error('Invalid value for "client_max_window_bits"');
+      }
+    }
+
+    return params;
+  }
+
+  /**
+   * Normalize extensions parameters.
+   *
+   * @param {Array} paramsList Extension parameters
+   * @return {Array} Normalized extensions parameters
+   * @private
+   */
+  normalizeParams (paramsList) {
+    return paramsList.map((params) => {
+      Object.keys(params).forEach((key) => {
+        var value = params[key];
+        if (value.length > 1) {
+          throw new Error(`Multiple extension parameters for ${key}`);
+        }
+
+        value = value[0];
+
+        switch (key) {
+          case 'server_no_context_takeover':
+          case 'client_no_context_takeover':
+            if (value !== true) {
+              throw new Error(`invalid extension parameter value for ${key} (${value})`);
+            }
+            params[key] = true;
+            break;
+          case 'server_max_window_bits':
+          case 'client_max_window_bits':
+            if (typeof value === 'string') {
+              value = parseInt(value, 10);
+              if (!~AVAILABLE_WINDOW_BITS.indexOf(value)) {
+                throw new Error(`invalid extension parameter value for ${key} (${value})`);
+              }
+            }
+            if (!this._isServer && value === true) {
+              throw new Error(`Missing extension parameter value for ${key}`);
+            }
+            params[key] = value;
+            break;
+          default:
+            throw new Error(`Not defined extension parameter (${key})`);
+        }
+      });
+      return params;
+    });
+  }
+
+  /**
+   * Decompress data.
+   *
+   * @param {Buffer} data Compressed data
+   * @param {Boolean} fin Specifies whether or not this is the last fragment
+   * @param {Function} callback Callback
+   * @public
+   */
+  decompress (data, fin, callback) {
+    const endpoint = this._isServer ? 'client' : 'server';
+
+    if (!this._inflate) {
+      const maxWindowBits = this.params[`${endpoint}_max_window_bits`];
+      this._inflate = zlib.createInflateRaw({
+        windowBits: typeof maxWindowBits === 'number' ? maxWindowBits : DEFAULT_WINDOW_BITS
+      });
+    }
+    this._inflate.writeInProgress = true;
+
+    var totalLength = 0;
+    const buffers = [];
+    var err;
+
+    const onData = (data) => {
+      totalLength += data.length;
+      if (this._maxPayload < 1 || totalLength <= this._maxPayload) {
+        return buffers.push(data);
+      }
+
+      err = new Error('max payload size exceeded');
+      err.closeCode = 1009;
+      this._inflate.reset();
+    };
+
+    const onError = (err) => {
+      cleanup();
+      callback(err);
+    };
+
+    const cleanup = () => {
+      if (!this._inflate) return;
+
+      this._inflate.removeListener('error', onError);
+      this._inflate.removeListener('data', onData);
+      this._inflate.writeInProgress = false;
+
+      if (
+        (fin && this.params[`${endpoint}_no_context_takeover`]) ||
+        this._inflate.pendingClose
+      ) {
+        this._inflate.close();
+        this._inflate = null;
+      }
+    };
+
+    this._inflate.on('error', onError).on('data', onData);
+    this._inflate.write(data);
+    if (fin) this._inflate.write(TRAILER);
+
+    this._inflate.flush(() => {
+      cleanup();
+      if (err) callback(err);
+      else callback(null, bufferUtil.concat(buffers, totalLength));
+    });
+  }
+
+  /**
+   * Compress data.
+   *
+   * @param {Buffer} data Data to compress
+   * @param {Boolean} fin Specifies whether or not this is the last fragment
+   * @param {Function} callback Callback
+   * @public
+   */
+  compress (data, fin, callback) {
+    if (!data || data.length === 0) {
+      process.nextTick(callback, null, EMPTY_BLOCK);
+      return;
+    }
+
+    const endpoint = this._isServer ? 'server' : 'client';
+
+    if (!this._deflate) {
+      const maxWindowBits = this.params[`${endpoint}_max_window_bits`];
+      this._deflate = zlib.createDeflateRaw({
+        flush: zlib.Z_SYNC_FLUSH,
+        windowBits: typeof maxWindowBits === 'number' ? maxWindowBits : DEFAULT_WINDOW_BITS,
+        memLevel: this._options.memLevel || DEFAULT_MEM_LEVEL
+      });
+    }
+    this._deflate.writeInProgress = true;
+
+    var totalLength = 0;
+    const buffers = [];
+
+    const onData = (data) => {
+      totalLength += data.length;
+      buffers.push(data);
+    };
+
+    const onError = (err) => {
+      cleanup();
+      callback(err);
+    };
+
+    const cleanup = () => {
+      if (!this._deflate) return;
+
+      this._deflate.removeListener('error', onError);
+      this._deflate.removeListener('data', onData);
+      this._deflate.writeInProgress = false;
+
+      if (
+        (fin && this.params[`${endpoint}_no_context_takeover`]) ||
+        this._deflate.pendingClose
+      ) {
+        this._deflate.close();
+        this._deflate = null;
+      }
+    };
+
+    this._deflate.on('error', onError).on('data', onData);
+    this._deflate.write(data);
+    this._deflate.flush(zlib.Z_SYNC_FLUSH, () => {
+      cleanup();
+      var data = bufferUtil.concat(buffers, totalLength);
+      if (fin) data = data.slice(0, data.length - 4);
+      callback(null, data);
+    });
+  }
+}
+
+module.exports = PerMessageDeflate;
diff --git a/wrt/node_modules/ws/lib/Receiver.js b/wrt/node_modules/ws/lib/Receiver.js
new file mode 100644 (file)
index 0000000..6c1a10e
--- /dev/null
@@ -0,0 +1,555 @@
+/*!
+ * ws: a node.js websocket client
+ * Copyright(c) 2011 Einar Otto Stangvik <einaros@gmail.com>
+ * MIT Licensed
+ */
+
+'use strict';
+
+const safeBuffer = require('safe-buffer');
+
+const PerMessageDeflate = require('./PerMessageDeflate');
+const isValidUTF8 = require('./Validation');
+const bufferUtil = require('./BufferUtil');
+const ErrorCodes = require('./ErrorCodes');
+const constants = require('./Constants');
+
+const Buffer = safeBuffer.Buffer;
+
+const GET_INFO = 0;
+const GET_PAYLOAD_LENGTH_16 = 1;
+const GET_PAYLOAD_LENGTH_64 = 2;
+const GET_MASK = 3;
+const GET_DATA = 4;
+const INFLATING = 5;
+
+/**
+ * HyBi Receiver implementation.
+ */
+class Receiver {
+  /**
+   * Creates a Receiver instance.
+   *
+   * @param {Object} extensions An object containing the negotiated extensions
+   * @param {Number} maxPayload The maximum allowed message length
+   * @param {String} binaryType The type for binary data
+   */
+  constructor (extensions, maxPayload, binaryType) {
+    this.binaryType = binaryType || constants.BINARY_TYPES[0];
+    this.extensions = extensions || {};
+    this.maxPayload = maxPayload | 0;
+
+    this.bufferedBytes = 0;
+    this.buffers = [];
+
+    this.compressed = false;
+    this.payloadLength = 0;
+    this.fragmented = 0;
+    this.masked = false;
+    this.fin = false;
+    this.mask = null;
+    this.opcode = 0;
+
+    this.totalPayloadLength = 0;
+    this.messageLength = 0;
+    this.fragments = [];
+
+    this.cleanupCallback = null;
+    this.hadError = false;
+    this.dead = false;
+    this.loop = false;
+
+    this.onmessage = null;
+    this.onclose = null;
+    this.onerror = null;
+    this.onping = null;
+    this.onpong = null;
+
+    this.state = GET_INFO;
+  }
+
+  /**
+   * Consumes bytes from the available buffered data.
+   *
+   * @param {Number} bytes The number of bytes to consume
+   * @return {Buffer} Consumed bytes
+   * @private
+   */
+  readBuffer (bytes) {
+    var offset = 0;
+    var dst;
+    var l;
+
+    this.bufferedBytes -= bytes;
+
+    if (bytes === this.buffers[0].length) return this.buffers.shift();
+
+    if (bytes < this.buffers[0].length) {
+      dst = this.buffers[0].slice(0, bytes);
+      this.buffers[0] = this.buffers[0].slice(bytes);
+      return dst;
+    }
+
+    dst = Buffer.allocUnsafe(bytes);
+
+    while (bytes > 0) {
+      l = this.buffers[0].length;
+
+      if (bytes >= l) {
+        this.buffers[0].copy(dst, offset);
+        offset += l;
+        this.buffers.shift();
+      } else {
+        this.buffers[0].copy(dst, offset, 0, bytes);
+        this.buffers[0] = this.buffers[0].slice(bytes);
+      }
+
+      bytes -= l;
+    }
+
+    return dst;
+  }
+
+  /**
+   * Checks if the number of buffered bytes is bigger or equal than `n` and
+   * calls `cleanup` if necessary.
+   *
+   * @param {Number} n The number of bytes to check against
+   * @return {Boolean} `true` if `bufferedBytes >= n`, else `false`
+   * @private
+   */
+  hasBufferedBytes (n) {
+    if (this.bufferedBytes >= n) return true;
+
+    this.loop = false;
+    if (this.dead) this.cleanup(this.cleanupCallback);
+    return false;
+  }
+
+  /**
+   * Adds new data to the parser.
+   *
+   * @public
+   */
+  add (data) {
+    if (this.dead) return;
+
+    this.bufferedBytes += data.length;
+    this.buffers.push(data);
+    this.startLoop();
+  }
+
+  /**
+   * Starts the parsing loop.
+   *
+   * @private
+   */
+  startLoop () {
+    this.loop = true;
+
+    while (this.loop) {
+      switch (this.state) {
+        case GET_INFO:
+          this.getInfo();
+          break;
+        case GET_PAYLOAD_LENGTH_16:
+          this.getPayloadLength16();
+          break;
+        case GET_PAYLOAD_LENGTH_64:
+          this.getPayloadLength64();
+          break;
+        case GET_MASK:
+          this.getMask();
+          break;
+        case GET_DATA:
+          this.getData();
+          break;
+        default: // `INFLATING`
+          this.loop = false;
+      }
+    }
+  }
+
+  /**
+   * Reads the first two bytes of a frame.
+   *
+   * @private
+   */
+  getInfo () {
+    if (!this.hasBufferedBytes(2)) return;
+
+    const buf = this.readBuffer(2);
+
+    if ((buf[0] & 0x30) !== 0x00) {
+      this.error(new Error('RSV2 and RSV3 must be clear'), 1002);
+      return;
+    }
+
+    const compressed = (buf[0] & 0x40) === 0x40;
+
+    if (compressed && !this.extensions[PerMessageDeflate.extensionName]) {
+      this.error(new Error('RSV1 must be clear'), 1002);
+      return;
+    }
+
+    this.fin = (buf[0] & 0x80) === 0x80;
+    this.opcode = buf[0] & 0x0f;
+    this.payloadLength = buf[1] & 0x7f;
+
+    if (this.opcode === 0x00) {
+      if (compressed) {
+        this.error(new Error('RSV1 must be clear'), 1002);
+        return;
+      }
+
+      if (!this.fragmented) {
+        this.error(new Error(`invalid opcode: ${this.opcode}`), 1002);
+        return;
+      } else {
+        this.opcode = this.fragmented;
+      }
+    } else if (this.opcode === 0x01 || this.opcode === 0x02) {
+      if (this.fragmented) {
+        this.error(new Error(`invalid opcode: ${this.opcode}`), 1002);
+        return;
+      }
+
+      this.compressed = compressed;
+    } else if (this.opcode > 0x07 && this.opcode < 0x0b) {
+      if (!this.fin) {
+        this.error(new Error('FIN must be set'), 1002);
+        return;
+      }
+
+      if (compressed) {
+        this.error(new Error('RSV1 must be clear'), 1002);
+        return;
+      }
+
+      if (this.payloadLength > 0x7d) {
+        this.error(new Error('invalid payload length'), 1002);
+        return;
+      }
+    } else {
+      this.error(new Error(`invalid opcode: ${this.opcode}`), 1002);
+      return;
+    }
+
+    if (!this.fin && !this.fragmented) this.fragmented = this.opcode;
+
+    this.masked = (buf[1] & 0x80) === 0x80;
+
+    if (this.payloadLength === 126) this.state = GET_PAYLOAD_LENGTH_16;
+    else if (this.payloadLength === 127) this.state = GET_PAYLOAD_LENGTH_64;
+    else this.haveLength();
+  }
+
+  /**
+   * Gets extended payload length (7+16).
+   *
+   * @private
+   */
+  getPayloadLength16 () {
+    if (!this.hasBufferedBytes(2)) return;
+
+    this.payloadLength = this.readBuffer(2).readUInt16BE(0, true);
+    this.haveLength();
+  }
+
+  /**
+   * Gets extended payload length (7+64).
+   *
+   * @private
+   */
+  getPayloadLength64 () {
+    if (!this.hasBufferedBytes(8)) return;
+
+    const buf = this.readBuffer(8);
+    const num = buf.readUInt32BE(0, true);
+
+    //
+    // The maximum safe integer in JavaScript is 2^53 - 1. An error is returned
+    // if payload length is greater than this number.
+    //
+    if (num > Math.pow(2, 53 - 32) - 1) {
+      this.error(new Error('max payload size exceeded'), 1009);
+      return;
+    }
+
+    this.payloadLength = (num * Math.pow(2, 32)) + buf.readUInt32BE(4, true);
+    this.haveLength();
+  }
+
+  /**
+   * Payload length has been read.
+   *
+   * @private
+   */
+  haveLength () {
+    if (this.opcode < 0x08 && this.maxPayloadExceeded(this.payloadLength)) {
+      return;
+    }
+
+    if (this.masked) this.state = GET_MASK;
+    else this.state = GET_DATA;
+  }
+
+  /**
+   * Reads mask bytes.
+   *
+   * @private
+   */
+  getMask () {
+    if (!this.hasBufferedBytes(4)) return;
+
+    this.mask = this.readBuffer(4);
+    this.state = GET_DATA;
+  }
+
+  /**
+   * Reads data bytes.
+   *
+   * @private
+   */
+  getData () {
+    var data = constants.EMPTY_BUFFER;
+
+    if (this.payloadLength) {
+      if (!this.hasBufferedBytes(this.payloadLength)) return;
+
+      data = this.readBuffer(this.payloadLength);
+      if (this.masked) bufferUtil.unmask(data, this.mask);
+    }
+
+    if (this.opcode > 0x07) {
+      this.controlMessage(data);
+    } else if (this.compressed) {
+      this.state = INFLATING;
+      this.decompress(data);
+    } else if (this.pushFragment(data)) {
+      this.dataMessage();
+    }
+  }
+
+  /**
+   * Decompresses data.
+   *
+   * @param {Buffer} data Compressed data
+   * @private
+   */
+  decompress (data) {
+    const extension = this.extensions[PerMessageDeflate.extensionName];
+
+    extension.decompress(data, this.fin, (err, buf) => {
+      if (err) {
+        this.error(err, err.closeCode === 1009 ? 1009 : 1007);
+        return;
+      }
+
+      if (this.pushFragment(buf)) this.dataMessage();
+      this.startLoop();
+    });
+  }
+
+  /**
+   * Handles a data message.
+   *
+   * @private
+   */
+  dataMessage () {
+    if (this.fin) {
+      const messageLength = this.messageLength;
+      const fragments = this.fragments;
+
+      this.totalPayloadLength = 0;
+      this.messageLength = 0;
+      this.fragmented = 0;
+      this.fragments = [];
+
+      if (this.opcode === 2) {
+        var data;
+
+        if (this.binaryType === 'nodebuffer') {
+          data = toBuffer(fragments, messageLength);
+        } else if (this.binaryType === 'arraybuffer') {
+          data = toArrayBuffer(toBuffer(fragments, messageLength));
+        } else {
+          data = fragments;
+        }
+
+        this.onmessage(data, { masked: this.masked, binary: true });
+      } else {
+        const buf = toBuffer(fragments, messageLength);
+
+        if (!isValidUTF8(buf)) {
+          this.error(new Error('invalid utf8 sequence'), 1007);
+          return;
+        }
+
+        this.onmessage(buf.toString(), { masked: this.masked });
+      }
+    }
+
+    this.state = GET_INFO;
+  }
+
+  /**
+   * Handles a control message.
+   *
+   * @param {Buffer} data Data to handle
+   * @private
+   */
+  controlMessage (data) {
+    if (this.opcode === 0x08) {
+      if (data.length === 0) {
+        this.onclose(1000, '', { masked: this.masked });
+        this.loop = false;
+        this.cleanup(this.cleanupCallback);
+      } else if (data.length === 1) {
+        this.error(new Error('invalid payload length'), 1002);
+      } else {
+        const code = data.readUInt16BE(0, true);
+
+        if (!ErrorCodes.isValidErrorCode(code)) {
+          this.error(new Error(`invalid status code: ${code}`), 1002);
+          return;
+        }
+
+        const buf = data.slice(2);
+
+        if (!isValidUTF8(buf)) {
+          this.error(new Error('invalid utf8 sequence'), 1007);
+          return;
+        }
+
+        this.onclose(code, buf.toString(), { masked: this.masked });
+        this.loop = false;
+        this.cleanup(this.cleanupCallback);
+      }
+
+      return;
+    }
+
+    const flags = { masked: this.masked, binary: true };
+
+    if (this.opcode === 0x09) this.onping(data, flags);
+    else this.onpong(data, flags);
+
+    this.state = GET_INFO;
+  }
+
+  /**
+   * Handles an error.
+   *
+   * @param {Error} err The error
+   * @param {Number} code Close code
+   * @private
+   */
+  error (err, code) {
+    this.onerror(err, code);
+    this.hadError = true;
+    this.loop = false;
+    this.cleanup(this.cleanupCallback);
+  }
+
+  /**
+   * Checks payload size, disconnects socket when it exceeds `maxPayload`.
+   *
+   * @param {Number} length Payload length
+   * @private
+   */
+  maxPayloadExceeded (length) {
+    if (length === 0 || this.maxPayload < 1) return false;
+
+    const fullLength = this.totalPayloadLength + length;
+
+    if (fullLength <= this.maxPayload) {
+      this.totalPayloadLength = fullLength;
+      return false;
+    }
+
+    this.error(new Error('max payload size exceeded'), 1009);
+    return true;
+  }
+
+  /**
+   * Appends a fragment in the fragments array after checking that the sum of
+   * fragment lengths does not exceed `maxPayload`.
+   *
+   * @param {Buffer} fragment The fragment to add
+   * @return {Boolean} `true` if `maxPayload` is not exceeded, else `false`
+   * @private
+   */
+  pushFragment (fragment) {
+    if (fragment.length === 0) return true;
+
+    const totalLength = this.messageLength + fragment.length;
+
+    if (this.maxPayload < 1 || totalLength <= this.maxPayload) {
+      this.messageLength = totalLength;
+      this.fragments.push(fragment);
+      return true;
+    }
+
+    this.error(new Error('max payload size exceeded'), 1009);
+    return false;
+  }
+
+  /**
+   * Releases resources used by the receiver.
+   *
+   * @param {Function} cb Callback
+   * @public
+   */
+  cleanup (cb) {
+    this.dead = true;
+
+    if (!this.hadError && (this.loop || this.state === INFLATING)) {
+      this.cleanupCallback = cb;
+    } else {
+      this.extensions = null;
+      this.fragments = null;
+      this.buffers = null;
+      this.mask = null;
+
+      this.cleanupCallback = null;
+      this.onmessage = null;
+      this.onclose = null;
+      this.onerror = null;
+      this.onping = null;
+      this.onpong = null;
+
+      if (cb) cb();
+    }
+  }
+}
+
+module.exports = Receiver;
+
+/**
+ * Makes a buffer from a list of fragments.
+ *
+ * @param {Buffer[]} fragments The list of fragments composing the message
+ * @param {Number} messageLength The length of the message
+ * @return {Buffer}
+ * @private
+ */
+function toBuffer (fragments, messageLength) {
+  if (fragments.length === 1) return fragments[0];
+  if (fragments.length > 1) return bufferUtil.concat(fragments, messageLength);
+  return constants.EMPTY_BUFFER;
+}
+
+/**
+ * Converts a buffer to an `ArrayBuffer`.
+ *
+ * @param {Buffer} The buffer to convert
+ * @return {ArrayBuffer} Converted buffer
+ */
+function toArrayBuffer (buf) {
+  if (buf.byteOffset === 0 && buf.byteLength === buf.buffer.byteLength) {
+    return buf.buffer;
+  }
+
+  return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
+}
diff --git a/wrt/node_modules/ws/lib/Sender.js b/wrt/node_modules/ws/lib/Sender.js
new file mode 100644 (file)
index 0000000..79e68a5
--- /dev/null
@@ -0,0 +1,403 @@
+/*!
+ * ws: a node.js websocket client
+ * Copyright(c) 2011 Einar Otto Stangvik <einaros@gmail.com>
+ * MIT Licensed
+ */
+
+'use strict';
+
+const safeBuffer = require('safe-buffer');
+const crypto = require('crypto');
+
+const PerMessageDeflate = require('./PerMessageDeflate');
+const bufferUtil = require('./BufferUtil');
+const ErrorCodes = require('./ErrorCodes');
+
+const Buffer = safeBuffer.Buffer;
+
+/**
+ * HyBi Sender implementation.
+ */
+class Sender {
+  /**
+   * Creates a Sender instance.
+   *
+   * @param {net.Socket} socket The connection socket
+   * @param {Object} extensions An object containing the negotiated extensions
+   */
+  constructor (socket, extensions) {
+    this.perMessageDeflate = (extensions || {})[PerMessageDeflate.extensionName];
+    this._socket = socket;
+
+    this.firstFragment = true;
+    this.compress = false;
+
+    this.bufferedBytes = 0;
+    this.deflating = false;
+    this.queue = [];
+
+    this.onerror = null;
+  }
+
+  /**
+   * Frames a piece of data according to the HyBi WebSocket protocol.
+   *
+   * @param {Buffer} data The data to frame
+   * @param {Object} options Options object
+   * @param {Number} options.opcode The opcode
+   * @param {Boolean} options.readOnly Specifies whether `data` can be modified
+   * @param {Boolean} options.fin Specifies whether or not to set the FIN bit
+   * @param {Boolean} options.mask Specifies whether or not to mask `data`
+   * @param {Boolean} options.rsv1 Specifies whether or not to set the RSV1 bit
+   * @return {Buffer[]} The framed data as a list of `Buffer` instances
+   * @public
+   */
+  static frame (data, options) {
+    const merge = data.length < 1024 || (options.mask && options.readOnly);
+    var offset = options.mask ? 6 : 2;
+    var payloadLength = data.length;
+
+    if (data.length >= 65536) {
+      offset += 8;
+      payloadLength = 127;
+    } else if (data.length > 125) {
+      offset += 2;
+      payloadLength = 126;
+    }
+
+    const target = Buffer.allocUnsafe(merge ? data.length + offset : offset);
+
+    target[0] = options.fin ? options.opcode | 0x80 : options.opcode;
+    if (options.rsv1) target[0] |= 0x40;
+
+    if (payloadLength === 126) {
+      target.writeUInt16BE(data.length, 2, true);
+    } else if (payloadLength === 127) {
+      target.writeUInt32BE(0, 2, true);
+      target.writeUInt32BE(data.length, 6, true);
+    }
+
+    if (!options.mask) {
+      target[1] = payloadLength;
+      if (merge) {
+        data.copy(target, offset);
+        return [target];
+      }
+
+      return [target, data];
+    }
+
+    const mask = crypto.randomBytes(4);
+
+    target[1] = payloadLength | 0x80;
+    target[offset - 4] = mask[0];
+    target[offset - 3] = mask[1];
+    target[offset - 2] = mask[2];
+    target[offset - 1] = mask[3];
+
+    if (merge) {
+      bufferUtil.mask(data, mask, target, offset, data.length);
+      return [target];
+    }
+
+    bufferUtil.mask(data, mask, data, 0, data.length);
+    return [target, data];
+  }
+
+  /**
+   * Sends a close message to the other peer.
+   *
+   * @param {(Number|undefined)} code The status code component of the body
+   * @param {String} data The message component of the body
+   * @param {Boolean} mask Specifies whether or not to mask the message
+   * @param {Function} cb Callback
+   * @public
+   */
+  close (code, data, mask, cb) {
+    if (code !== undefined && (typeof code !== 'number' || !ErrorCodes.isValidErrorCode(code))) {
+      throw new Error('first argument must be a valid error code number');
+    }
+
+    const buf = Buffer.allocUnsafe(2 + (data ? Buffer.byteLength(data) : 0));
+
+    buf.writeUInt16BE(code || 1000, 0, true);
+    if (buf.length > 2) buf.write(data, 2);
+
+    if (this.deflating) {
+      this.enqueue([this.doClose, buf, mask, cb]);
+    } else {
+      this.doClose(buf, mask, cb);
+    }
+  }
+
+  /**
+   * Frames and sends a close message.
+   *
+   * @param {Buffer} data The message to send
+   * @param {Boolean} mask Specifies whether or not to mask `data`
+   * @param {Function} cb Callback
+   * @private
+   */
+  doClose (data, mask, cb) {
+    this.sendFrame(Sender.frame(data, {
+      fin: true,
+      rsv1: false,
+      opcode: 0x08,
+      mask,
+      readOnly: false
+    }), cb);
+  }
+
+  /**
+   * Sends a ping message to the other peer.
+   *
+   * @param {*} data The message to send
+   * @param {Boolean} mask Specifies whether or not to mask `data`
+   * @public
+   */
+  ping (data, mask) {
+    var readOnly = true;
+
+    if (!Buffer.isBuffer(data)) {
+      if (data instanceof ArrayBuffer) {
+        data = Buffer.from(data);
+      } else if (ArrayBuffer.isView(data)) {
+        data = viewToBuffer(data);
+      } else {
+        data = Buffer.from(data);
+        readOnly = false;
+      }
+    }
+
+    if (this.deflating) {
+      this.enqueue([this.doPing, data, mask, readOnly]);
+    } else {
+      this.doPing(data, mask, readOnly);
+    }
+  }
+
+  /**
+   * Frames and sends a ping message.
+   *
+   * @param {*} data The message to send
+   * @param {Boolean} mask Specifies whether or not to mask `data`
+   * @param {Boolean} readOnly Specifies whether `data` can be modified
+   * @private
+   */
+  doPing (data, mask, readOnly) {
+    this.sendFrame(Sender.frame(data, {
+      fin: true,
+      rsv1: false,
+      opcode: 0x09,
+      mask,
+      readOnly
+    }));
+  }
+
+  /**
+   * Sends a pong message to the other peer.
+   *
+   * @param {*} data The message to send
+   * @param {Boolean} mask Specifies whether or not to mask `data`
+   * @public
+   */
+  pong (data, mask) {
+    var readOnly = true;
+
+    if (!Buffer.isBuffer(data)) {
+      if (data instanceof ArrayBuffer) {
+        data = Buffer.from(data);
+      } else if (ArrayBuffer.isView(data)) {
+        data = viewToBuffer(data);
+      } else {
+        data = Buffer.from(data);
+        readOnly = false;
+      }
+    }
+
+    if (this.deflating) {
+      this.enqueue([this.doPong, data, mask, readOnly]);
+    } else {
+      this.doPong(data, mask, readOnly);
+    }
+  }
+
+  /**
+   * Frames and sends a pong message.
+   *
+   * @param {*} data The message to send
+   * @param {Boolean} mask Specifies whether or not to mask `data`
+   * @param {Boolean} readOnly Specifies whether `data` can be modified
+   * @private
+   */
+  doPong (data, mask, readOnly) {
+    this.sendFrame(Sender.frame(data, {
+      fin: true,
+      rsv1: false,
+      opcode: 0x0a,
+      mask,
+      readOnly
+    }));
+  }
+
+  /**
+   * Sends a data message to the other peer.
+   *
+   * @param {*} data The message to send
+   * @param {Object} options Options object
+   * @param {Boolean} options.compress Specifies whether or not to compress `data`
+   * @param {Boolean} options.binary Specifies whether `data` is binary or text
+   * @param {Boolean} options.fin Specifies whether the fragment is the last one
+   * @param {Boolean} options.mask Specifies whether or not to mask `data`
+   * @param {Function} cb Callback
+   * @public
+   */
+  send (data, options, cb) {
+    var opcode = options.binary ? 2 : 1;
+    var rsv1 = options.compress;
+    var readOnly = true;
+
+    if (!Buffer.isBuffer(data)) {
+      if (data instanceof ArrayBuffer) {
+        data = Buffer.from(data);
+      } else if (ArrayBuffer.isView(data)) {
+        data = viewToBuffer(data);
+      } else {
+        data = Buffer.from(data);
+        readOnly = false;
+      }
+    }
+
+    if (this.firstFragment) {
+      this.firstFragment = false;
+      if (rsv1 && this.perMessageDeflate) {
+        rsv1 = data.length >= this.perMessageDeflate.threshold;
+      }
+      this.compress = rsv1;
+    } else {
+      rsv1 = false;
+      opcode = 0;
+    }
+
+    if (options.fin) this.firstFragment = true;
+
+    if (this.perMessageDeflate) {
+      const opts = {
+        fin: options.fin,
+        rsv1,
+        opcode,
+        mask: options.mask,
+        readOnly
+      };
+
+      if (this.deflating) {
+        this.enqueue([this.dispatch, data, this.compress, opts, cb]);
+      } else {
+        this.dispatch(data, this.compress, opts, cb);
+      }
+    } else {
+      this.sendFrame(Sender.frame(data, {
+        fin: options.fin,
+        rsv1: false,
+        opcode,
+        mask: options.mask,
+        readOnly
+      }), cb);
+    }
+  }
+
+  /**
+   * Dispatches a data message.
+   *
+   * @param {Buffer} data The message to send
+   * @param {Boolean} compress Specifies whether or not to compress `data`
+   * @param {Object} options Options object
+   * @param {Number} options.opcode The opcode
+   * @param {Boolean} options.readOnly Specifies whether `data` can be modified
+   * @param {Boolean} options.fin Specifies whether or not to set the FIN bit
+   * @param {Boolean} options.mask Specifies whether or not to mask `data`
+   * @param {Boolean} options.rsv1 Specifies whether or not to set the RSV1 bit
+   * @param {Function} cb Callback
+   * @private
+   */
+  dispatch (data, compress, options, cb) {
+    if (!compress) {
+      this.sendFrame(Sender.frame(data, options), cb);
+      return;
+    }
+
+    this.deflating = true;
+    this.perMessageDeflate.compress(data, options.fin, (err, buf) => {
+      if (err) {
+        if (cb) cb(err);
+        else this.onerror(err);
+        return;
+      }
+
+      options.readOnly = false;
+      this.sendFrame(Sender.frame(buf, options), cb);
+      this.deflating = false;
+      this.dequeue();
+    });
+  }
+
+  /**
+   * Executes queued send operations.
+   *
+   * @private
+   */
+  dequeue () {
+    while (!this.deflating && this.queue.length) {
+      const params = this.queue.shift();
+
+      this.bufferedBytes -= params[1].length;
+      params[0].apply(this, params.slice(1));
+    }
+  }
+
+  /**
+   * Enqueues a send operation.
+   *
+   * @param {Array} params Send operation parameters.
+   * @private
+   */
+  enqueue (params) {
+    this.bufferedBytes += params[1].length;
+    this.queue.push(params);
+  }
+
+  /**
+   * Sends a frame.
+   *
+   * @param {Buffer[]} list The frame to send
+   * @param {Function} cb Callback
+   * @private
+   */
+  sendFrame (list, cb) {
+    if (list.length === 2) {
+      this._socket.write(list[0]);
+      this._socket.write(list[1], cb);
+    } else {
+      this._socket.write(list[0], cb);
+    }
+  }
+}
+
+module.exports = Sender;
+
+/**
+ * Converts an `ArrayBuffer` view into a buffer.
+ *
+ * @param {(DataView|TypedArray)} view The view to convert
+ * @return {Buffer} Converted view
+ * @private
+ */
+function viewToBuffer (view) {
+  const buf = Buffer.from(view.buffer);
+
+  if (view.byteLength !== view.buffer.byteLength) {
+    return buf.slice(view.byteOffset, view.byteOffset + view.byteLength);
+  }
+
+  return buf;
+}
diff --git a/wrt/node_modules/ws/lib/Validation.js b/wrt/node_modules/ws/lib/Validation.js
new file mode 100644 (file)
index 0000000..fcb170f
--- /dev/null
@@ -0,0 +1,17 @@
+/*!
+ * ws: a node.js websocket client
+ * Copyright(c) 2011 Einar Otto Stangvik <einaros@gmail.com>
+ * MIT Licensed
+ */
+
+'use strict';
+
+try {
+  const isValidUTF8 = require('utf-8-validate');
+
+  module.exports = typeof isValidUTF8 === 'object'
+    ? isValidUTF8.Validation.isValidUTF8  // utf-8-validate@<3.0.0
+    : isValidUTF8;
+} catch (e) /* istanbul ignore next */ {
+  module.exports = () => true;
+}
diff --git a/wrt/node_modules/ws/lib/WebSocket.js b/wrt/node_modules/ws/lib/WebSocket.js
new file mode 100644 (file)
index 0000000..41868d8
--- /dev/null
@@ -0,0 +1,712 @@
+/*!
+ * ws: a node.js websocket client
+ * Copyright(c) 2011 Einar Otto Stangvik <einaros@gmail.com>
+ * MIT Licensed
+ */
+
+'use strict';
+
+const EventEmitter = require('events');
+const crypto = require('crypto');
+const Ultron = require('ultron');
+const https = require('https');
+const http = require('http');
+const url = require('url');
+
+const PerMessageDeflate = require('./PerMessageDeflate');
+const EventTarget = require('./EventTarget');
+const Extensions = require('./Extensions');
+const constants = require('./Constants');
+const Receiver = require('./Receiver');
+const Sender = require('./Sender');
+
+const protocolVersions = [8, 13];
+const closeTimeout = 30 * 1000; // Allow 30 seconds to terminate the connection cleanly.
+
+/**
+ * Class representing a WebSocket.
+ *
+ * @extends EventEmitter
+ */
+class WebSocket extends EventEmitter {
+  /**
+   * Create a new `WebSocket`.
+   *
+   * @param {String} address The URL to which to connect
+   * @param {(String|String[])} protocols The subprotocols
+   * @param {Object} options Connection options
+   */
+  constructor (address, protocols, options) {
+    super();
+
+    if (!protocols) {
+      protocols = [];
+    } else if (typeof protocols === 'string') {
+      protocols = [protocols];
+    } else if (!Array.isArray(protocols)) {
+      options = protocols;
+      protocols = [];
+    }
+
+    this.readyState = WebSocket.CONNECTING;
+    this.bytesReceived = 0;
+    this.extensions = {};
+    this.protocol = '';
+
+    this._binaryType = constants.BINARY_TYPES[0];
+    this._finalize = this.finalize.bind(this);
+    this._finalizeCalled = false;
+    this._closeMessage = null;
+    this._closeTimer = null;
+    this._closeCode = null;
+    this._receiver = null;
+    this._sender = null;
+    this._socket = null;
+    this._ultron = null;
+
+    if (Array.isArray(address)) {
+      initAsServerClient.call(this, address[0], address[1], address[2], options);
+    } else {
+      initAsClient.call(this, address, protocols, options);
+    }
+  }
+
+  get CONNECTING () { return WebSocket.CONNECTING; }
+  get CLOSING () { return WebSocket.CLOSING; }
+  get CLOSED () { return WebSocket.CLOSED; }
+  get OPEN () { return WebSocket.OPEN; }
+
+  /**
+   * @type {Number}
+   */
+  get bufferedAmount () {
+    var amount = 0;
+
+    if (this._socket) {
+      amount = this._socket.bufferSize + this._sender.bufferedBytes;
+    }
+    return amount;
+  }
+
+  /**
+   * This deviates from the WHATWG interface since ws doesn't support the required
+   * default "blob" type (instead we define a custom "nodebuffer" type).
+   *
+   * @type {String}
+   */
+  get binaryType () {
+    return this._binaryType;
+  }
+
+  set binaryType (type) {
+    if (constants.BINARY_TYPES.indexOf(type) < 0) return;
+
+    this._binaryType = type;
+
+    //
+    // Allow to change `binaryType` on the fly.
+    //
+    if (this._receiver) this._receiver.binaryType = type;
+  }
+
+  /**
+   * Set up the socket and the internal resources.
+   *
+   * @param {net.Socket} socket The network socket between the server and client
+   * @param {Buffer} head The first packet of the upgraded stream
+   * @private
+   */
+  setSocket (socket, head) {
+    socket.setTimeout(0);
+    socket.setNoDelay();
+
+    this._receiver = new Receiver(this.extensions, this.maxPayload, this.binaryType);
+    this._sender = new Sender(socket, this.extensions);
+    this._ultron = new Ultron(socket);
+    this._socket = socket;
+
+    // socket cleanup handlers
+    this._ultron.on('close', this._finalize);
+    this._ultron.on('error', this._finalize);
+    this._ultron.on('end', this._finalize);
+
+    // ensure that the head is added to the receiver
+    if (head && head.length > 0) {
+      socket.unshift(head);
+      head = null;
+    }
+
+    // subsequent packets are pushed to the receiver
+    this._ultron.on('data', (data) => {
+      this.bytesReceived += data.length;
+      this._receiver.add(data);
+    });
+
+    // receiver event handlers
+    this._receiver.onmessage = (data, flags) => this.emit('message', data, flags);
+    this._receiver.onping = (data, flags) => {
+      this.pong(data, !this._isServer, true);
+      this.emit('ping', data, flags);
+    };
+    this._receiver.onpong = (data, flags) => this.emit('pong', data, flags);
+    this._receiver.onclose = (code, reason) => {
+      this._closeMessage = reason;
+      this._closeCode = code;
+      this.close(code, reason);
+    };
+    this._receiver.onerror = (error, code) => {
+      // close the connection when the receiver reports a HyBi error code
+      this.close(code, '');
+      this.emit('error', error);
+    };
+
+    // sender event handlers
+    this._sender.onerror = (error) => {
+      this.close(1002, '');
+      this.emit('error', error);
+    };
+
+    this.readyState = WebSocket.OPEN;
+    this.emit('open');
+  }
+
+  /**
+   * Clean up and release internal resources.
+   *
+   * @param {(Boolean|Error)} Indicates whether or not an error occurred
+   * @private
+   */
+  finalize (error) {
+    if (this._finalizeCalled) return;
+
+    this.readyState = WebSocket.CLOSING;
+    this._finalizeCalled = true;
+
+    clearTimeout(this._closeTimer);
+    this._closeTimer = null;
+
+    //
+    // If the connection was closed abnormally (with an error), or if the close
+    // control frame was malformed or not received then the close code must be
+    // 1006.
+    //
+    if (error) this._closeCode = 1006;
+
+    if (this._socket) {
+      this._ultron.destroy();
+      this._socket.on('error', function onerror () {
+        this.destroy();
+      });
+
+      if (!error) this._socket.end();
+      else this._socket.destroy();
+
+      this._socket = null;
+      this._ultron = null;
+    }
+
+    if (this._sender) {
+      this._sender = this._sender.onerror = null;
+    }
+
+    if (this._receiver) {
+      this._receiver.cleanup(() => this.emitClose());
+      this._receiver = null;
+    } else {
+      this.emitClose();
+    }
+  }
+
+  /**
+   * Emit the `close` event.
+   *
+   * @private
+   */
+  emitClose () {
+    this.readyState = WebSocket.CLOSED;
+    this.emit('close', this._closeCode || 1006, this._closeMessage || '');
+
+    if (this.extensions[PerMessageDeflate.extensionName]) {
+      this.extensions[PerMessageDeflate.extensionName].cleanup();
+    }
+
+    this.extensions = null;
+
+    this.removeAllListeners();
+    this.on('error', constants.NOOP); // Catch all errors after this.
+  }
+
+  /**
+   * Pause the socket stream.
+   *
+   * @public
+   */
+  pause () {
+    if (this.readyState !== WebSocket.OPEN) throw new Error('not opened');
+
+    this._socket.pause();
+  }
+
+  /**
+   * Resume the socket stream
+   *
+   * @public
+   */
+  resume () {
+    if (this.readyState !== WebSocket.OPEN) throw new Error('not opened');
+
+    this._socket.resume();
+  }
+
+  /**
+   * Start a closing handshake.
+   *
+   * @param {Number} code Status code explaining why the connection is closing
+   * @param {String} data A string explaining why the connection is closing
+   * @public
+   */
+  close (code, data) {
+    if (this.readyState === WebSocket.CLOSED) return;
+    if (this.readyState === WebSocket.CONNECTING) {
+      if (this._req && !this._req.aborted) {
+        this._req.abort();
+        this.emit('error', new Error('closed before the connection is established'));
+        this.finalize(true);
+      }
+      return;
+    }
+
+    if (this.readyState === WebSocket.CLOSING) {
+      if (this._closeCode && this._socket) this._socket.end();
+      return;
+    }
+
+    this.readyState = WebSocket.CLOSING;
+    this._sender.close(code, data, !this._isServer, (err) => {
+      if (err) this.emit('error', err);
+
+      if (this._socket) {
+        if (this._closeCode) this._socket.end();
+        //
+        // Ensure that the connection is cleaned up even when the closing
+        // handshake fails.
+        //
+        clearTimeout(this._closeTimer);
+        this._closeTimer = setTimeout(this._finalize, closeTimeout, true);
+      }
+    });
+  }
+
+  /**
+   * Send a ping message.
+   *
+   * @param {*} data The message to send
+   * @param {Boolean} mask Indicates whether or not to mask `data`
+   * @param {Boolean} failSilently Indicates whether or not to throw if `readyState` isn't `OPEN`
+   * @public
+   */
+  ping (data, mask, failSilently) {
+    if (this.readyState !== WebSocket.OPEN) {
+      if (failSilently) return;
+      throw new Error('not opened');
+    }
+
+    if (typeof data === 'number') data = data.toString();
+    if (mask === undefined) mask = !this._isServer;
+    this._sender.ping(data || constants.EMPTY_BUFFER, mask);
+  }
+
+  /**
+   * Send a pong message.
+   *
+   * @param {*} data The message to send
+   * @param {Boolean} mask Indicates whether or not to mask `data`
+   * @param {Boolean} failSilently Indicates whether or not to throw if `readyState` isn't `OPEN`
+   * @public
+   */
+  pong (data, mask, failSilently) {
+    if (this.readyState !== WebSocket.OPEN) {
+      if (failSilently) return;
+      throw new Error('not opened');
+    }
+
+    if (typeof data === 'number') data = data.toString();
+    if (mask === undefined) mask = !this._isServer;
+    this._sender.pong(data || constants.EMPTY_BUFFER, mask);
+  }
+
+  /**
+   * Send a data message.
+   *
+   * @param {*} data The message to send
+   * @param {Object} options Options object
+   * @param {Boolean} options.compress Specifies whether or not to compress `data`
+   * @param {Boolean} options.binary Specifies whether `data` is binary or text
+   * @param {Boolean} options.fin Specifies whether the fragment is the last one
+   * @param {Boolean} options.mask Specifies whether or not to mask `data`
+   * @param {Function} cb Callback which is executed when data is written out
+   * @public
+   */
+  send (data, options, cb) {
+    if (typeof options === 'function') {
+      cb = options;
+      options = {};
+    }
+
+    if (this.readyState !== WebSocket.OPEN) {
+      if (cb) cb(new Error('not opened'));
+      else throw new Error('not opened');
+      return;
+    }
+
+    if (typeof data === 'number') data = data.toString();
+
+    const opts = Object.assign({
+      binary: typeof data !== 'string',
+      mask: !this._isServer,
+      compress: true,
+      fin: true
+    }, options);
+
+    if (!this.extensions[PerMessageDeflate.extensionName]) {
+      opts.compress = false;
+    }
+
+    this._sender.send(data || constants.EMPTY_BUFFER, opts, cb);
+  }
+
+  /**
+   * Forcibly close the connection.
+   *
+   * @public
+   */
+  terminate () {
+    if (this.readyState === WebSocket.CLOSED) return;
+    if (this.readyState === WebSocket.CONNECTING) {
+      if (this._req && !this._req.aborted) {
+        this._req.abort();
+        this.emit('error', new Error('closed before the connection is established'));
+        this.finalize(true);
+      }
+      return;
+    }
+
+    this.finalize(true);
+  }
+}
+
+WebSocket.CONNECTING = 0;
+WebSocket.OPEN = 1;
+WebSocket.CLOSING = 2;
+WebSocket.CLOSED = 3;
+
+//
+// Add the `onopen`, `onerror`, `onclose`, and `onmessage` attributes.
+// See https://html.spec.whatwg.org/multipage/comms.html#the-websocket-interface
+//
+['open', 'error', 'close', 'message'].forEach((method) => {
+  Object.defineProperty(WebSocket.prototype, `on${method}`, {
+    /**
+     * Return the listener of the event.
+     *
+     * @return {(Function|undefined)} The event listener or `undefined`
+     * @public
+     */
+    get () {
+      const listeners = this.listeners(method);
+      for (var i = 0; i < listeners.length; i++) {
+        if (listeners[i]._listener) return listeners[i]._listener;
+      }
+    },
+    /**
+     * Add a listener for the event.
+     *
+     * @param {Function} listener The listener to add
+     * @public
+     */
+    set (listener) {
+      const listeners = this.listeners(method);
+      for (var i = 0; i < listeners.length; i++) {
+        //
+        // Remove only the listeners added via `addEventListener`.
+        //
+        if (listeners[i]._listener) this.removeListener(method, listeners[i]);
+      }
+      this.addEventListener(method, listener);
+    }
+  });
+});
+
+WebSocket.prototype.addEventListener = EventTarget.addEventListener;
+WebSocket.prototype.removeEventListener = EventTarget.removeEventListener;
+
+module.exports = WebSocket;
+
+/**
+ * Initialize a WebSocket server client.
+ *
+ * @param {http.IncomingMessage} req The request object
+ * @param {net.Socket} socket The network socket between the server and client
+ * @param {Buffer} head The first packet of the upgraded stream
+ * @param {Object} options WebSocket attributes
+ * @param {Number} options.protocolVersion The WebSocket protocol version
+ * @param {Object} options.extensions The negotiated extensions
+ * @param {Number} options.maxPayload The maximum allowed message size
+ * @param {String} options.protocol The chosen subprotocol
+ * @private
+ */
+function initAsServerClient (req, socket, head, options) {
+  this.protocolVersion = options.protocolVersion;
+  this.extensions = options.extensions;
+  this.maxPayload = options.maxPayload;
+  this.protocol = options.protocol;
+
+  this.upgradeReq = req;
+  this._isServer = true;
+
+  this.setSocket(socket, head);
+}
+
+/**
+ * Initialize a WebSocket client.
+ *
+ * @param {String} address The URL to which to connect
+ * @param {String[]} protocols The list of subprotocols
+ * @param {Object} options Connection options
+ * @param {String} options.protocol Value of the `Sec-WebSocket-Protocol` header
+ * @param {(Boolean|Object)} options.perMessageDeflate Enable/disable permessage-deflate
+ * @param {String} options.localAddress Local interface to bind for network connections
+ * @param {Number} options.protocolVersion Value of the `Sec-WebSocket-Version` header
+ * @param {Object} options.headers An object containing request headers
+ * @param {String} options.origin Value of the `Origin` or `Sec-WebSocket-Origin` header
+ * @param {http.Agent} options.agent Use the specified Agent
+ * @param {String} options.host Value of the `Host` header
+ * @param {Number} options.family IP address family to use during hostname lookup (4 or 6).
+ * @param {Function} options.checkServerIdentity A function to validate the server hostname
+ * @param {Boolean} options.rejectUnauthorized Verify or not the server certificate
+ * @param {String} options.passphrase The passphrase for the private key or pfx
+ * @param {String} options.ciphers The ciphers to use or exclude
+ * @param {(String|String[]|Buffer|Buffer[])} options.cert The certificate key
+ * @param {(String|String[]|Buffer|Buffer[])} options.key The private key
+ * @param {(String|Buffer)} options.pfx The private key, certificate, and CA certs
+ * @param {(String|String[]|Buffer|Buffer[])} options.ca Trusted certificates
+ * @private
+ */
+function initAsClient (address, protocols, options) {
+  options = Object.assign({
+    protocolVersion: protocolVersions[1],
+    protocol: protocols.join(','),
+    perMessageDeflate: true,
+    localAddress: null,
+    headers: null,
+    family: null,
+    origin: null,
+    agent: null,
+    host: null,
+
+    //
+    // SSL options.
+    //
+    checkServerIdentity: null,
+    rejectUnauthorized: null,
+    passphrase: null,
+    ciphers: null,
+    cert: null,
+    key: null,
+    pfx: null,
+    ca: null
+  }, options);
+
+  if (protocolVersions.indexOf(options.protocolVersion) === -1) {
+    throw new Error(
+      `unsupported protocol version: ${options.protocolVersion} ` +
+      `(supported versions: ${protocolVersions.join(', ')})`
+    );
+  }
+
+  this.protocolVersion = options.protocolVersion;
+  this._isServer = false;
+  this.url = address;
+
+  const serverUrl = url.parse(address);
+  const isUnixSocket = serverUrl.protocol === 'ws+unix:';
+
+  if (!serverUrl.host && (!isUnixSocket || !serverUrl.path)) {
+    throw new Error('invalid url');
+  }
+
+  const isSecure = serverUrl.protocol === 'wss:' || serverUrl.protocol === 'https:';
+  const key = crypto.randomBytes(16).toString('base64');
+  const httpObj = isSecure ? https : http;
+
+  //
+  // Prepare extensions.
+  //
+  const extensionsOffer = {};
+  var perMessageDeflate;
+
+  if (options.perMessageDeflate) {
+    perMessageDeflate = new PerMessageDeflate(
+      options.perMessageDeflate !== true ? options.perMessageDeflate : {},
+      false
+    );
+    extensionsOffer[PerMessageDeflate.extensionName] = perMessageDeflate.offer();
+  }
+
+  const requestOptions = {
+    port: serverUrl.port || (isSecure ? 443 : 80),
+    host: serverUrl.hostname,
+    path: '/',
+    headers: {
+      'Sec-WebSocket-Version': options.protocolVersion,
+      'Sec-WebSocket-Key': key,
+      'Connection': 'Upgrade',
+      'Upgrade': 'websocket'
+    }
+  };
+
+  if (options.headers) Object.assign(requestOptions.headers, options.headers);
+  if (Object.keys(extensionsOffer).length) {
+    requestOptions.headers['Sec-WebSocket-Extensions'] = Extensions.format(extensionsOffer);
+  }
+  if (options.protocol) {
+    requestOptions.headers['Sec-WebSocket-Protocol'] = options.protocol;
+  }
+  if (options.origin) {
+    if (options.protocolVersion < 13) {
+      requestOptions.headers['Sec-WebSocket-Origin'] = options.origin;
+    } else {
+      requestOptions.headers.Origin = options.origin;
+    }
+  }
+  if (options.host) requestOptions.headers.Host = options.host;
+  if (serverUrl.auth) requestOptions.auth = serverUrl.auth;
+
+  if (options.localAddress) requestOptions.localAddress = options.localAddress;
+  if (options.family) requestOptions.family = options.family;
+
+  if (isUnixSocket) {
+    const parts = serverUrl.path.split(':');
+
+    requestOptions.socketPath = parts[0];
+    requestOptions.path = parts[1];
+  } else if (serverUrl.path) {
+    //
+    // Make sure that path starts with `/`.
+    //
+    if (serverUrl.path.charAt(0) !== '/') {
+      requestOptions.path = `/${serverUrl.path}`;
+    } else {
+      requestOptions.path = serverUrl.path;
+    }
+  }
+
+  var agent = options.agent;
+
+  //
+  // A custom agent is required for these options.
+  //
+  if (
+    options.rejectUnauthorized != null ||
+    options.checkServerIdentity ||
+    options.passphrase ||
+    options.ciphers ||
+    options.cert ||
+    options.key ||
+    options.pfx ||
+    options.ca
+  ) {
+    if (options.passphrase) requestOptions.passphrase = options.passphrase;
+    if (options.ciphers) requestOptions.ciphers = options.ciphers;
+    if (options.cert) requestOptions.cert = options.cert;
+    if (options.key) requestOptions.key = options.key;
+    if (options.pfx) requestOptions.pfx = options.pfx;
+    if (options.ca) requestOptions.ca = options.ca;
+    if (options.checkServerIdentity) {
+      requestOptions.checkServerIdentity = options.checkServerIdentity;
+    }
+    if (options.rejectUnauthorized != null) {
+      requestOptions.rejectUnauthorized = options.rejectUnauthorized;
+    }
+
+    if (!agent) agent = new httpObj.Agent(requestOptions);
+  }
+
+  if (agent) requestOptions.agent = agent;
+
+  this._req = httpObj.get(requestOptions);
+
+  this._req.on('error', (error) => {
+    if (this._req.aborted) return;
+
+    this._req = null;
+    this.emit('error', error);
+    this.finalize(true);
+  });
+
+  this._req.on('response', (res) => {
+    if (!this.emit('unexpected-response', this._req, res)) {
+      this._req.abort();
+      this.emit('error', new Error(`unexpected server response (${res.statusCode})`));
+      this.finalize(true);
+    }
+  });
+
+  this._req.on('upgrade', (res, socket, head) => {
+    this.emit('headers', res.headers, res);
+
+    //
+    // The user may have closed the connection from a listener of the `headers`
+    // event.
+    //
+    if (this.readyState !== WebSocket.CONNECTING) return;
+
+    this._req = null;
+
+    const digest = crypto.createHash('sha1')
+      .update(key + constants.GUID, 'binary')
+      .digest('base64');
+
+    if (res.headers['sec-websocket-accept'] !== digest) {
+      socket.destroy();
+      this.emit('error', new Error('invalid server key'));
+      return this.finalize(true);
+    }
+
+    const serverProt = res.headers['sec-websocket-protocol'];
+    const protList = (options.protocol || '').split(/, */);
+    var protError;
+
+    if (!options.protocol && serverProt) {
+      protError = 'server sent a subprotocol even though none requested';
+    } else if (options.protocol && !serverProt) {
+      protError = 'server sent no subprotocol even though requested';
+    } else if (serverProt && protList.indexOf(serverProt) === -1) {
+      protError = 'server responded with an invalid protocol';
+    }
+
+    if (protError) {
+      socket.destroy();
+      this.emit('error', new Error(protError));
+      return this.finalize(true);
+    }
+
+    if (serverProt) this.protocol = serverProt;
+
+    const serverExtensions = Extensions.parse(res.headers['sec-websocket-extensions']);
+
+    if (perMessageDeflate && serverExtensions[PerMessageDeflate.extensionName]) {
+      try {
+        perMessageDeflate.accept(serverExtensions[PerMessageDeflate.extensionName]);
+      } catch (err) {
+        socket.destroy();
+        this.emit('error', new Error('invalid extension parameter'));
+        return this.finalize(true);
+      }
+
+      this.extensions[PerMessageDeflate.extensionName] = perMessageDeflate;
+    }
+
+    this.setSocket(socket, head);
+  });
+}
diff --git a/wrt/node_modules/ws/lib/WebSocketServer.js b/wrt/node_modules/ws/lib/WebSocketServer.js
new file mode 100644 (file)
index 0000000..bd3ef24
--- /dev/null
@@ -0,0 +1,336 @@
+/*!
+ * ws: a node.js websocket client
+ * Copyright(c) 2011 Einar Otto Stangvik <einaros@gmail.com>
+ * MIT Licensed
+ */
+
+'use strict';
+
+const safeBuffer = require('safe-buffer');
+const EventEmitter = require('events');
+const crypto = require('crypto');
+const Ultron = require('ultron');
+const http = require('http');
+const url = require('url');
+
+const PerMessageDeflate = require('./PerMessageDeflate');
+const Extensions = require('./Extensions');
+const constants = require('./Constants');
+const WebSocket = require('./WebSocket');
+
+const Buffer = safeBuffer.Buffer;
+
+/**
+ * Class representing a WebSocket server.
+ *
+ * @extends EventEmitter
+ */
+class WebSocketServer extends EventEmitter {
+  /**
+   * Create a `WebSocketServer` instance.
+   *
+   * @param {Object} options Configuration options
+   * @param {String} options.host The hostname where to bind the server
+   * @param {Number} options.port The port where to bind the server
+   * @param {http.Server} options.server A pre-created HTTP/S server to use
+   * @param {Function} options.verifyClient An hook to reject connections
+   * @param {Function} options.handleProtocols An hook to handle protocols
+   * @param {String} options.path Accept only connections matching this path
+   * @param {Boolean} options.noServer Enable no server mode
+   * @param {Boolean} options.clientTracking Specifies whether or not to track clients
+   * @param {(Boolean|Object)} options.perMessageDeflate Enable/disable permessage-deflate
+   * @param {Number} options.maxPayload The maximum allowed message size
+   * @param {Function} callback A listener for the `listening` event
+   */
+  constructor (options, callback) {
+    super();
+
+    options = Object.assign({
+      maxPayload: 100 * 1024 * 1024,
+      perMessageDeflate: true,
+      handleProtocols: null,
+      clientTracking: true,
+      verifyClient: null,
+      noServer: false,
+      backlog: null, // use default (511 as implemented in net.js)
+      server: null,
+      host: null,
+      path: null,
+      port: null
+    }, options);
+
+    if (options.port == null && !options.server && !options.noServer) {
+      throw new TypeError('missing or invalid options');
+    }
+
+    if (options.port != null) {
+      this._server = http.createServer((req, res) => {
+        const body = http.STATUS_CODES[426];
+
+        res.writeHead(426, {
+          'Content-Length': body.length,
+          'Content-Type': 'text/plain'
+        });
+        res.end(body);
+      });
+      this._server.allowHalfOpen = false;
+      this._server.listen(options.port, options.host, options.backlog, callback);
+    } else if (options.server) {
+      this._server = options.server;
+    }
+
+    if (this._server) {
+      this._ultron = new Ultron(this._server);
+      this._ultron.on('listening', () => this.emit('listening'));
+      this._ultron.on('error', (err) => this.emit('error', err));
+      this._ultron.on('upgrade', (req, socket, head) => {
+        this.handleUpgrade(req, socket, head, (client) => {
+          this.emit(`connection${req.url}`, client);
+          this.emit('connection', client);
+        });
+      });
+    }
+
+    if (options.clientTracking) this.clients = new Set();
+    this.options = options;
+    this.path = options.path;
+  }
+
+  /**
+   * Close the server.
+   *
+   * @param {Function} cb Callback
+   * @public
+   */
+  close (cb) {
+    //
+    // Terminate all associated clients.
+    //
+    if (this.clients) {
+      for (const client of this.clients) client.terminate();
+    }
+
+    const server = this._server;
+
+    if (server) {
+      this._ultron.destroy();
+      this._ultron = this._server = null;
+
+      //
+      // Close the http server if it was internally created.
+      //
+      if (this.options.port != null) return server.close(cb);
+    }
+
+    if (cb) cb();
+  }
+
+  /**
+   * See if a given request should be handled by this server instance.
+   *
+   * @param {http.IncomingMessage} req Request object to inspect
+   * @return {Boolean} `true` if the request is valid, else `false`
+   * @public
+   */
+  shouldHandle (req) {
+    if (this.options.path && url.parse(req.url).pathname !== this.options.path) {
+      return false;
+    }
+
+    return true;
+  }
+
+  /**
+   * Handle a HTTP Upgrade request.
+   *
+   * @param {http.IncomingMessage} req The request object
+   * @param {net.Socket} socket The network socket between the server and client
+   * @param {Buffer} head The first packet of the upgraded stream
+   * @param {Function} cb Callback
+   * @public
+   */
+  handleUpgrade (req, socket, head, cb) {
+    socket.on('error', socketError);
+
+    const version = +req.headers['sec-websocket-version'];
+
+    if (
+      req.method !== 'GET' || req.headers.upgrade.toLowerCase() !== 'websocket' ||
+      !req.headers['sec-websocket-key'] || (version !== 8 && version !== 13) ||
+      !this.shouldHandle(req)
+    ) {
+      return abortConnection(socket, 400);
+    }
+
+    var protocol = (req.headers['sec-websocket-protocol'] || '').split(/, */);
+
+    //
+    // Optionally call external protocol selection handler.
+    //
+    if (this.options.handleProtocols) {
+      protocol = this.options.handleProtocols(protocol, req);
+      if (protocol === false) return abortConnection(socket, 401);
+    } else {
+      protocol = protocol[0];
+    }
+
+    //
+    // Optionally call external client verification handler.
+    //
+    if (this.options.verifyClient) {
+      const info = {
+        origin: req.headers[`${version === 8 ? 'sec-websocket-origin' : 'origin'}`],
+        secure: !!(req.connection.authorized || req.connection.encrypted),
+        req
+      };
+
+      if (this.options.verifyClient.length === 2) {
+        this.options.verifyClient(info, (verified, code, message) => {
+          if (!verified) return abortConnection(socket, code || 401, message);
+
+          this.completeUpgrade(protocol, version, req, socket, head, cb);
+        });
+        return;
+      } else if (!this.options.verifyClient(info)) {
+        return abortConnection(socket, 401);
+      }
+    }
+
+    this.completeUpgrade(protocol, version, req, socket, head, cb);
+  }
+
+  /**
+   * Upgrade the connection to WebSocket.
+   *
+   * @param {String} protocol The chosen subprotocol
+   * @param {Number} version The WebSocket protocol version
+   * @param {http.IncomingMessage} req The request object
+   * @param {net.Socket} socket The network socket between the server and client
+   * @param {Buffer} head The first packet of the upgraded stream
+   * @param {Function} cb Callback
+   * @private
+   */
+  completeUpgrade (protocol, version, req, socket, head, cb) {
+    //
+    // Destroy the socket if the client has already sent a FIN packet.
+    //
+    if (!socket.readable || !socket.writable) return socket.destroy();
+
+    const key = crypto.createHash('sha1')
+      .update(req.headers['sec-websocket-key'] + constants.GUID, 'binary')
+      .digest('base64');
+
+    const headers = [
+      'HTTP/1.1 101 Switching Protocols',
+      'Upgrade: websocket',
+      'Connection: Upgrade',
+      `Sec-WebSocket-Accept: ${key}`
+    ];
+
+    if (protocol) headers.push(`Sec-WebSocket-Protocol: ${protocol}`);
+
+    const offer = Extensions.parse(req.headers['sec-websocket-extensions']);
+    var extensions;
+
+    try {
+      extensions = acceptExtensions(this.options, offer);
+    } catch (err) {
+      return abortConnection(socket, 400);
+    }
+
+    const props = Object.keys(extensions);
+
+    if (props.length) {
+      const serverExtensions = props.reduce((obj, key) => {
+        obj[key] = [extensions[key].params];
+        return obj;
+      }, {});
+
+      headers.push(`Sec-WebSocket-Extensions: ${Extensions.format(serverExtensions)}`);
+    }
+
+    //
+    // Allow external modification/inspection of handshake headers.
+    //
+    this.emit('headers', headers, req);
+
+    socket.write(headers.concat('', '').join('\r\n'));
+
+    const client = new WebSocket([req, socket, head], null, {
+      maxPayload: this.options.maxPayload,
+      protocolVersion: version,
+      extensions,
+      protocol
+    });
+
+    if (this.clients) {
+      this.clients.add(client);
+      client.on('close', () => this.clients.delete(client));
+    }
+
+    socket.removeListener('error', socketError);
+    cb(client);
+  }
+}
+
+module.exports = WebSocketServer;
+
+/**
+ * Handle premature socket errors.
+ *
+ * @private
+ */
+function socketError () {
+  this.destroy();
+}
+
+/**
+ * Accept WebSocket extensions.
+ *
+ * @param {Object} options The `WebSocketServer` configuration options
+ * @param {Object} offer The parsed value of the `sec-websocket-extensions` header
+ * @return {Object} Accepted extensions
+ * @private
+ */
+function acceptExtensions (options, offer) {
+  const pmd = options.perMessageDeflate;
+  const extensions = {};
+
+  if (pmd && offer[PerMessageDeflate.extensionName]) {
+    const perMessageDeflate = new PerMessageDeflate(
+      pmd !== true ? pmd : {},
+      true,
+      options.maxPayload
+    );
+
+    perMessageDeflate.accept(offer[PerMessageDeflate.extensionName]);
+    extensions[PerMessageDeflate.extensionName] = perMessageDeflate;
+  }
+
+  return extensions;
+}
+
+/**
+ * Close the connection when preconditions are not fulfilled.
+ *
+ * @param {net.Socket} socket The socket of the upgrade request
+ * @param {Number} code The HTTP response status code
+ * @param {String} [message] The HTTP response body
+ * @private
+ */
+function abortConnection (socket, code, message) {
+  if (socket.writable) {
+    message = message || http.STATUS_CODES[code];
+    socket.write(
+      `HTTP/1.1 ${code} ${http.STATUS_CODES[code]}\r\n` +
+      'Connection: close\r\n' +
+      'Content-type: text/html\r\n' +
+      `Content-Length: ${Buffer.byteLength(message)}\r\n` +
+      '\r\n' +
+      message
+    );
+  }
+
+  socket.removeListener('error', socketError);
+  socket.destroy();
+}
diff --git a/wrt/node_modules/ws/package.json b/wrt/node_modules/ws/package.json
new file mode 100644 (file)
index 0000000..08c7a42
--- /dev/null
@@ -0,0 +1,127 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "ws@~2.3.1",
+        "scope": null,
+        "escapedName": "ws",
+        "name": "ws",
+        "rawSpec": "~2.3.1",
+        "spec": ">=2.3.1 <2.4.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io"
+    ]
+  ],
+  "_from": "ws@>=2.3.1 <2.4.0",
+  "_id": "ws@2.3.1",
+  "_inCache": true,
+  "_location": "/ws",
+  "_nodeVersion": "7.9.0",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/ws-2.3.1.tgz_1492711201097_0.04034068179316819"
+  },
+  "_npmUser": {
+    "name": "lpinca",
+    "email": "luigipinca@gmail.com"
+  },
+  "_npmVersion": "4.2.0",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "ws@~2.3.1",
+    "scope": null,
+    "escapedName": "ws",
+    "name": "ws",
+    "rawSpec": "~2.3.1",
+    "spec": ">=2.3.1 <2.4.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/engine.io",
+    "/engine.io-client"
+  ],
+  "_resolved": "https://registry.npmjs.org/ws/-/ws-2.3.1.tgz",
+  "_shasum": "6b94b3e447cb6a363f785eaf94af6359e8e81c80",
+  "_shrinkwrap": null,
+  "_spec": "ws@~2.3.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io",
+  "author": {
+    "name": "Einar Otto Stangvik",
+    "email": "einaros@gmail.com",
+    "url": "http://2x.io"
+  },
+  "bugs": {
+    "url": "https://github.com/websockets/ws/issues"
+  },
+  "dependencies": {
+    "safe-buffer": "~5.0.1",
+    "ultron": "~1.1.0"
+  },
+  "description": "Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js",
+  "devDependencies": {
+    "benchmark": "~2.1.2",
+    "bufferutil": "~3.0.0",
+    "eslint": "~3.19.0",
+    "eslint-config-standard": "~10.2.0",
+    "eslint-plugin-import": "~2.2.0",
+    "eslint-plugin-node": "~4.2.0",
+    "eslint-plugin-promise": "~3.5.0",
+    "eslint-plugin-standard": "~3.0.0",
+    "mocha": "~3.2.0",
+    "nyc": "~10.2.0",
+    "utf-8-validate": "~3.0.0"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "6b94b3e447cb6a363f785eaf94af6359e8e81c80",
+    "tarball": "https://registry.npmjs.org/ws/-/ws-2.3.1.tgz"
+  },
+  "files": [
+    "index.js",
+    "lib"
+  ],
+  "gitHead": "732aaf06b76700f104eeff2740e1896be4e88199",
+  "homepage": "https://github.com/websockets/ws",
+  "keywords": [
+    "HyBi",
+    "Push",
+    "RFC-6455",
+    "WebSocket",
+    "WebSockets",
+    "real-time"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "3rdeden",
+      "email": "npm@3rd-Eden.com"
+    },
+    {
+      "name": "einaros",
+      "email": "einaros@gmail.com"
+    },
+    {
+      "name": "lpinca",
+      "email": "luigipinca@gmail.com"
+    },
+    {
+      "name": "v1",
+      "email": "npm@3rd-Eden.com"
+    }
+  ],
+  "name": "ws",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/websockets/ws.git"
+  },
+  "scripts": {
+    "integration": "eslint . && mocha test/*.integration.js",
+    "lint": "eslint .",
+    "test": "eslint . && nyc --reporter=html --reporter=text mocha test/*.test.js"
+  },
+  "version": "2.3.1"
+}
diff --git a/wrt/node_modules/xml2js/LICENSE b/wrt/node_modules/xml2js/LICENSE
new file mode 100644 (file)
index 0000000..e3b4222
--- /dev/null
@@ -0,0 +1,19 @@
+Copyright 2010, 2011, 2012, 2013. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
diff --git a/wrt/node_modules/xml2js/README.md b/wrt/node_modules/xml2js/README.md
new file mode 100644 (file)
index 0000000..9c69d6f
--- /dev/null
@@ -0,0 +1,406 @@
+node-xml2js
+===========
+
+Ever had the urge to parse XML? And wanted to access the data in some sane,
+easy way? Don't want to compile a C parser, for whatever reason? Then xml2js is
+what you're looking for!
+
+Description
+===========
+
+Simple XML to JavaScript object converter. It supports bi-directional conversion.
+Uses [sax-js](https://github.com/isaacs/sax-js/) and
+[xmlbuilder-js](https://github.com/oozcitak/xmlbuilder-js/).
+
+Note: If you're looking for a full DOM parser, you probably want
+[JSDom](https://github.com/tmpvar/jsdom).
+
+Installation
+============
+
+Simplest way to install `xml2js` is to use [npm](http://npmjs.org), just `npm
+install xml2js` which will download xml2js and all dependencies.
+
+xml2js is also available via [Bower](http://bower.io/), just `bower install
+xml2js` which will download xml2js and all dependencies.
+
+Usage
+=====
+
+No extensive tutorials required because you are a smart developer! The task of
+parsing XML should be an easy one, so let's make it so! Here's some examples.
+
+Shoot-and-forget usage
+----------------------
+
+You want to parse XML as simple and easy as possible? It's dangerous to go
+alone, take this:
+
+```javascript
+var parseString = require('xml2js').parseString;
+var xml = "<root>Hello xml2js!</root>"
+parseString(xml, function (err, result) {
+    console.dir(result);
+});
+```
+
+Can't get easier than this, right? This works starting with `xml2js` 0.2.3.
+With CoffeeScript it looks like this:
+
+```coffeescript
+{parseString} = require 'xml2js'
+xml = "<root>Hello xml2js!</root>"
+parseString xml, (err, result) ->
+    console.dir result
+```
+
+If you need some special options, fear not, `xml2js` supports a number of
+options (see below), you can specify these as second argument:
+
+```javascript
+parseString(xml, {trim: true}, function (err, result) {
+});
+```
+
+Simple as pie usage
+-------------------
+
+That's right, if you have been using xml-simple or a home-grown
+wrapper, this was added in 0.1.11 just for you:
+
+```javascript
+var fs = require('fs'),
+    xml2js = require('xml2js');
+
+var parser = new xml2js.Parser();
+fs.readFile(__dirname + '/foo.xml', function(err, data) {
+    parser.parseString(data, function (err, result) {
+        console.dir(result);
+        console.log('Done');
+    });
+});
+```
+
+Look ma, no event listeners!
+
+You can also use `xml2js` from
+[CoffeeScript](https://github.com/jashkenas/coffeescript), further reducing
+the clutter:
+
+```coffeescript
+fs = require 'fs',
+xml2js = require 'xml2js'
+
+parser = new xml2js.Parser()
+fs.readFile __dirname + '/foo.xml', (err, data) ->
+  parser.parseString data, (err, result) ->
+    console.dir result
+    console.log 'Done.'
+```
+
+But what happens if you forget the `new` keyword to create a new `Parser`? In
+the middle of a nightly coding session, it might get lost, after all. Worry
+not, we got you covered! Starting with 0.2.8 you can also leave it out, in
+which case `xml2js` will helpfully add it for you, no bad surprises and
+inexplicable bugs!
+
+Parsing multiple files
+----------------------
+
+If you want to parse multiple files, you have multiple possibilities:
+
+  * You can create one `xml2js.Parser` per file. That's the recommended one
+    and is promised to always *just work*.
+  * You can call `reset()` on your parser object.
+  * You can hope everything goes well anyway. This behaviour is not
+    guaranteed work always, if ever. Use option #1 if possible. Thanks!
+
+So you wanna some JSON?
+-----------------------
+
+Just wrap the `result` object in a call to `JSON.stringify` like this
+`JSON.stringify(result)`. You get a string containing the JSON representation
+of the parsed object that you can feed to JSON-hungry consumers.
+
+Displaying results
+------------------
+
+You might wonder why, using `console.dir` or `console.log` the output at some
+level is only `[Object]`. Don't worry, this is not because `xml2js` got lazy.
+That's because Node uses `util.inspect` to convert the object into strings and
+that function stops after `depth=2` which is a bit low for most XML.
+
+To display the whole deal, you can use `console.log(util.inspect(result, false,
+null))`, which displays the whole result.
+
+So much for that, but what if you use
+[eyes](https://github.com/cloudhead/eyes.js) for nice colored output and it
+truncates the output with `…`? Don't fear, there's also a solution for that,
+you just need to increase the `maxLength` limit by creating a custom inspector
+`var inspect = require('eyes').inspector({maxLength: false})` and then you can
+easily `inspect(result)`.
+
+XML builder usage
+-----------------
+
+Since 0.4.0, objects can be also be used to build XML:
+
+```javascript
+var fs = require('fs'),
+    xml2js = require('xml2js');
+
+var obj = {name: "Super", Surname: "Man", age: 23};
+
+var builder = new xml2js.Builder();
+var xml = builder.buildObject(obj);
+```
+
+At the moment, a one to one bi-directional conversion is guaranteed only for
+default configuration, except for `attrkey`, `charkey` and `explicitArray` options
+you can redefine to your taste. Writing CDATA is supported via setting the `cdata`
+option to `true`.
+
+Processing attribute, tag names and values
+------------------------------------------
+
+Since 0.4.1 you can optionally provide the parser with attribute name and tag name processors as well as element value processors (Since 0.4.14, you can also optionally provide the parser with attribute value processors):
+
+```javascript
+
+function nameToUpperCase(name){
+    return name.toUpperCase();
+}
+
+//transform all attribute and tag names and values to uppercase
+parseString(xml, {
+  tagNameProcessors: [nameToUpperCase],
+  attrNameProcessors: [nameToUpperCase],
+  valueProcessors: [nameToUpperCase],
+  attrValueProcessors: [nameToUpperCase]},
+  function (err, result) {
+    // processed data
+});
+```
+
+The `tagNameProcessors` and `attrNameProcessors` options
+accept an `Array` of functions with the following signature:
+
+```javascript
+function (name){
+  //do something with `name`
+  return name
+}
+```
+
+The `attrValueProcessors` and `valueProcessors` options
+accept an `Array` of functions with the following signature:
+
+```javascript
+function (value, name) {
+  //`name` will be the node name or attribute name
+  //do something with `value`, (optionally) dependent on the node/attr name
+  return value
+}
+```
+
+Some processors are provided out-of-the-box and can be found in `lib/processors.js`:
+
+- `normalize`: transforms the name to lowercase.
+(Automatically used when `options.normalize` is set to `true`)
+
+- `firstCharLowerCase`: transforms the first character to lower case.
+E.g. 'MyTagName' becomes 'myTagName'
+
+- `stripPrefix`: strips the xml namespace prefix. E.g `<foo:Bar/>` will become 'Bar'.
+(N.B.: the `xmlns` prefix is NOT stripped.)
+
+- `parseNumbers`: parses integer-like strings as integers and float-like strings as floats
+E.g. "0" becomes 0 and "15.56" becomes 15.56
+
+- `parseBooleans`: parses boolean-like strings to booleans
+E.g. "true" becomes true and "False" becomes false
+
+Options
+=======
+
+Apart from the default settings, there are a number of options that can be
+specified for the parser. Options are specified by ``new Parser({optionName:
+value})``. Possible options are:
+
+  * `attrkey` (default: `$`): Prefix that is used to access the attributes.
+    Version 0.1 default was `@`.
+  * `charkey` (default: `_`): Prefix that is used to access the character
+    content. Version 0.1 default was `#`.
+  * `explicitCharkey` (default: `false`)
+  * `trim` (default: `false`): Trim the whitespace at the beginning and end of
+    text nodes.
+  * `normalizeTags` (default: `false`): Normalize all tag names to lowercase.
+  * `normalize` (default: `false`): Trim whitespaces inside text nodes.
+  * `explicitRoot` (default: `true`): Set this if you want to get the root
+    node in the resulting object.
+  * `emptyTag` (default: `''`): what will the value of empty nodes be.
+  * `explicitArray` (default: `true`): Always put child nodes in an array if
+    true; otherwise an array is created only if there is more than one.
+  * `ignoreAttrs` (default: `false`): Ignore all XML attributes and only create
+    text nodes.
+  * `mergeAttrs` (default: `false`): Merge attributes and child elements as
+    properties of the parent, instead of keying attributes off a child
+    attribute object. This option is ignored if `ignoreAttrs` is `false`.
+  * `validator` (default `null`): You can specify a callable that validates
+    the resulting structure somehow, however you want. See unit tests
+    for an example.
+  * `xmlns` (default `false`): Give each element a field usually called '$ns'
+    (the first character is the same as attrkey) that contains its local name
+    and namespace URI.
+  * `explicitChildren` (default `false`): Put child elements to separate
+    property. Doesn't work with `mergeAttrs = true`. If element has no children
+    then "children" won't be created. Added in 0.2.5.
+  * `childkey` (default `$$`): Prefix that is used to access child elements if
+    `explicitChildren` is set to `true`. Added in 0.2.5.
+  * `preserveChildrenOrder` (default `false`): Modifies the behavior of
+    `explicitChildren` so that the value of the "children" property becomes an
+    ordered array. When this is `true`, every node will also get a `#name` field
+    whose value will correspond to the XML nodeName, so that you may iterate
+    the "children" array and still be able to determine node names. The named
+    (and potentially unordered) properties are also retained in this
+    configuration at the same level as the ordered "children" array. Added in
+    0.4.9.
+  * `charsAsChildren` (default `false`): Determines whether chars should be
+    considered children if `explicitChildren` is on. Added in 0.2.5.
+  * `includeWhiteChars` (default `false`): Determines whether whitespace-only
+     text nodes should be included. Added in 0.4.17.
+  * `async` (default `false`): Should the callbacks be async? This *might* be
+    an incompatible change if your code depends on sync execution of callbacks.
+    Future versions of `xml2js` might change this default, so the recommendation
+    is to not depend on sync execution anyway. Added in 0.2.6.
+  * `strict` (default `true`): Set sax-js to strict or non-strict parsing mode.
+    Defaults to `true` which is *highly* recommended, since parsing HTML which
+    is not well-formed XML might yield just about anything. Added in 0.2.7.
+  * `attrNameProcessors` (default: `null`): Allows the addition of attribute
+    name processing functions. Accepts an `Array` of functions with following
+    signature:
+    ```javascript
+    function (name){
+        //do something with `name`
+        return name
+    }
+    ```
+    Added in 0.4.14
+  * `attrValueProcessors` (default: `null`): Allows the addition of attribute
+    value processing functions. Accepts an `Array` of functions with following
+    signature:
+    ```javascript
+    function (name){
+      //do something with `name`
+      return name
+    }
+    ```
+    Added in 0.4.1
+  * `tagNameProcessors` (default: `null`): Allows the addition of tag name
+    processing functions. Accepts an `Array` of functions with following
+    signature:
+    ```javascript
+    function (name){
+      //do something with `name`
+      return name
+    }
+    ```
+    Added in 0.4.1
+  * `valueProcessors` (default: `null`): Allows the addition of element value
+    processing functions. Accepts an `Array` of functions with following
+    signature:
+    ```javascript
+    function (name){
+      //do something with `name`
+      return name
+    }
+    ```
+    Added in 0.4.6
+
+Options for the `Builder` class
+-------------------------------
+These options are specified by ``new Builder({optionName: value})``.
+Possible options are:
+
+  * `rootName` (default `root` or the root key name): root element name to be used in case
+     `explicitRoot` is `false` or to override the root element name.
+  * `renderOpts` (default `{ 'pretty': true, 'indent': '  ', 'newline': '\n' }`):
+    Rendering options for xmlbuilder-js.
+    * pretty: prettify generated XML
+    * indent: whitespace for indentation (only when pretty)
+    * newline: newline char (only when pretty)
+  * `xmldec` (default `{ 'version': '1.0', 'encoding': 'UTF-8', 'standalone': true }`:
+    XML declaration attributes.
+    * `xmldec.version` A version number string, e.g. 1.0
+    * `xmldec.encoding` Encoding declaration, e.g. UTF-8
+    * `xmldec.standalone` standalone document declaration: true or false
+  * `doctype` (default `null`): optional DTD. Eg. `{'ext': 'hello.dtd'}`
+  * `headless` (default: `false`): omit the XML header. Added in 0.4.3.
+  * `allowSurrogateChars` (default: `false`): allows using characters from the Unicode
+    surrogate blocks.
+  * `cdata` (default: `false`): wrap text nodes in `<![CDATA[ ... ]]>` instead of
+    escaping when necessary. Does not add `<![CDATA[ ... ]]>` if it is not required.
+    Added in 0.4.5.
+
+`renderOpts`, `xmldec`,`doctype` and `headless` pass through to
+[xmlbuilder-js](https://github.com/oozcitak/xmlbuilder-js).
+
+Updating to new version
+=======================
+
+Version 0.2 changed the default parsing settings, but version 0.1.14 introduced
+the default settings for version 0.2, so these settings can be tried before the
+migration.
+
+```javascript
+var xml2js = require('xml2js');
+var parser = new xml2js.Parser(xml2js.defaults["0.2"]);
+```
+
+To get the 0.1 defaults in version 0.2 you can just use
+`xml2js.defaults["0.1"]` in the same place. This provides you with enough time
+to migrate to the saner way of parsing in `xml2js` 0.2. We try to make the
+migration as simple and gentle as possible, but some breakage cannot be
+avoided.
+
+So, what exactly did change and why? In 0.2 we changed some defaults to parse
+the XML in a more universal and sane way. So we disabled `normalize` and `trim`
+so `xml2js` does not cut out any text content. You can reenable this at will of
+course. A more important change is that we return the root tag in the resulting
+JavaScript structure via the `explicitRoot` setting, so you need to access the
+first element. This is useful for anybody who wants to know what the root node
+is and preserves more information. The last major change was to enable
+`explicitArray`, so everytime it is possible that one might embed more than one
+sub-tag into a tag, xml2js >= 0.2 returns an array even if the array just
+includes one element. This is useful when dealing with APIs that return
+variable amounts of subtags.
+
+Running tests, development
+==========================
+
+[![Build Status](https://travis-ci.org/Leonidas-from-XIV/node-xml2js.svg?branch=master)](https://travis-ci.org/Leonidas-from-XIV/node-xml2js)
+[![Coverage Status](https://coveralls.io/repos/Leonidas-from-XIV/node-xml2js/badge.svg?branch=)](https://coveralls.io/r/Leonidas-from-XIV/node-xml2js?branch=master)
+[![Dependency Status](https://david-dm.org/Leonidas-from-XIV/node-xml2js.svg)](https://david-dm.org/Leonidas-from-XIV/node-xml2js)
+
+The development requirements are handled by npm, you just need to install them.
+We also have a number of unit tests, they can be run using `npm test` directly
+from the project root. This runs zap to discover all the tests and execute
+them.
+
+If you like to contribute, keep in mind that `xml2js` is written in
+CoffeeScript, so don't develop on the JavaScript files that are checked into
+the repository for convenience reasons. Also, please write some unit test to
+check your behaviour and if it is some user-facing thing, add some
+documentation to this README, so people will know it exists. Thanks in advance!
+
+Getting support
+===============
+
+Please, if you have a problem with the library, first make sure you read this
+README. If you read this far, thanks, you're good. Then, please make sure your
+problem really is with `xml2js`. It is? Okay, then I'll look at it. Send me a
+mail and we can talk. Please don't open issues, as I don't think that is the
+proper forum for support problems. Some problems might as well really be bugs
+in `xml2js`, if so I'll let you know to open an issue instead :)
+
+But if you know you really found a bug, feel free to open an issue instead.
diff --git a/wrt/node_modules/xml2js/lib/bom.js b/wrt/node_modules/xml2js/lib/bom.js
new file mode 100644 (file)
index 0000000..7b8fb27
--- /dev/null
@@ -0,0 +1,12 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+  "use strict";
+  exports.stripBOM = function(str) {
+    if (str[0] === '\uFEFF') {
+      return str.substring(1);
+    } else {
+      return str;
+    }
+  };
+
+}).call(this);
diff --git a/wrt/node_modules/xml2js/lib/builder.js b/wrt/node_modules/xml2js/lib/builder.js
new file mode 100644 (file)
index 0000000..58f3638
--- /dev/null
@@ -0,0 +1,127 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+  "use strict";
+  var builder, defaults, escapeCDATA, requiresCDATA, wrapCDATA,
+    hasProp = {}.hasOwnProperty;
+
+  builder = require('xmlbuilder');
+
+  defaults = require('./defaults').defaults;
+
+  requiresCDATA = function(entry) {
+    return typeof entry === "string" && (entry.indexOf('&') >= 0 || entry.indexOf('>') >= 0 || entry.indexOf('<') >= 0);
+  };
+
+  wrapCDATA = function(entry) {
+    return "<![CDATA[" + (escapeCDATA(entry)) + "]]>";
+  };
+
+  escapeCDATA = function(entry) {
+    return entry.replace(']]>', ']]]]><![CDATA[>');
+  };
+
+  exports.Builder = (function() {
+    function Builder(opts) {
+      var key, ref, value;
+      this.options = {};
+      ref = defaults["0.2"];
+      for (key in ref) {
+        if (!hasProp.call(ref, key)) continue;
+        value = ref[key];
+        this.options[key] = value;
+      }
+      for (key in opts) {
+        if (!hasProp.call(opts, key)) continue;
+        value = opts[key];
+        this.options[key] = value;
+      }
+    }
+
+    Builder.prototype.buildObject = function(rootObj) {
+      var attrkey, charkey, render, rootElement, rootName;
+      attrkey = this.options.attrkey;
+      charkey = this.options.charkey;
+      if ((Object.keys(rootObj).length === 1) && (this.options.rootName === defaults['0.2'].rootName)) {
+        rootName = Object.keys(rootObj)[0];
+        rootObj = rootObj[rootName];
+      } else {
+        rootName = this.options.rootName;
+      }
+      render = (function(_this) {
+        return function(element, obj) {
+          var attr, child, entry, index, key, value;
+          if (typeof obj !== 'object') {
+            if (_this.options.cdata && requiresCDATA(obj)) {
+              element.raw(wrapCDATA(obj));
+            } else {
+              element.txt(obj);
+            }
+          } else if (Array.isArray(obj)) {
+            for (index in obj) {
+              if (!hasProp.call(obj, index)) continue;
+              child = obj[index];
+              for (key in child) {
+                entry = child[key];
+                element = render(element.ele(key), entry).up();
+              }
+            }
+          } else {
+            for (key in obj) {
+              if (!hasProp.call(obj, key)) continue;
+              child = obj[key];
+              if (key === attrkey) {
+                if (typeof child === "object") {
+                  for (attr in child) {
+                    value = child[attr];
+                    element = element.att(attr, value);
+                  }
+                }
+              } else if (key === charkey) {
+                if (_this.options.cdata && requiresCDATA(child)) {
+                  element = element.raw(wrapCDATA(child));
+                } else {
+                  element = element.txt(child);
+                }
+              } else if (Array.isArray(child)) {
+                for (index in child) {
+                  if (!hasProp.call(child, index)) continue;
+                  entry = child[index];
+                  if (typeof entry === 'string') {
+                    if (_this.options.cdata && requiresCDATA(entry)) {
+                      element = element.ele(key).raw(wrapCDATA(entry)).up();
+                    } else {
+                      element = element.ele(key, entry).up();
+                    }
+                  } else {
+                    element = render(element.ele(key), entry).up();
+                  }
+                }
+              } else if (typeof child === "object") {
+                element = render(element.ele(key), child).up();
+              } else {
+                if (typeof child === 'string' && _this.options.cdata && requiresCDATA(child)) {
+                  element = element.ele(key).raw(wrapCDATA(child)).up();
+                } else {
+                  if (child == null) {
+                    child = '';
+                  }
+                  element = element.ele(key, child.toString()).up();
+                }
+              }
+            }
+          }
+          return element;
+        };
+      })(this);
+      rootElement = builder.create(rootName, this.options.xmldec, this.options.doctype, {
+        headless: this.options.headless,
+        allowSurrogateChars: this.options.allowSurrogateChars
+      });
+      return render(rootElement, rootObj).end(this.options.renderOpts);
+    };
+
+    return Builder;
+
+  })();
+
+}).call(this);
diff --git a/wrt/node_modules/xml2js/lib/defaults.js b/wrt/node_modules/xml2js/lib/defaults.js
new file mode 100644 (file)
index 0000000..0a21da0
--- /dev/null
@@ -0,0 +1,72 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+  exports.defaults = {
+    "0.1": {
+      explicitCharkey: false,
+      trim: true,
+      normalize: true,
+      normalizeTags: false,
+      attrkey: "@",
+      charkey: "#",
+      explicitArray: false,
+      ignoreAttrs: false,
+      mergeAttrs: false,
+      explicitRoot: false,
+      validator: null,
+      xmlns: false,
+      explicitChildren: false,
+      childkey: '@@',
+      charsAsChildren: false,
+      includeWhiteChars: false,
+      async: false,
+      strict: true,
+      attrNameProcessors: null,
+      attrValueProcessors: null,
+      tagNameProcessors: null,
+      valueProcessors: null,
+      emptyTag: ''
+    },
+    "0.2": {
+      explicitCharkey: false,
+      trim: false,
+      normalize: false,
+      normalizeTags: false,
+      attrkey: "$",
+      charkey: "_",
+      explicitArray: true,
+      ignoreAttrs: false,
+      mergeAttrs: false,
+      explicitRoot: true,
+      validator: null,
+      xmlns: false,
+      explicitChildren: false,
+      preserveChildrenOrder: false,
+      childkey: '$$',
+      charsAsChildren: false,
+      includeWhiteChars: false,
+      async: false,
+      strict: true,
+      attrNameProcessors: null,
+      attrValueProcessors: null,
+      tagNameProcessors: null,
+      valueProcessors: null,
+      rootName: 'root',
+      xmldec: {
+        'version': '1.0',
+        'encoding': 'UTF-8',
+        'standalone': true
+      },
+      doctype: null,
+      renderOpts: {
+        'pretty': true,
+        'indent': '  ',
+        'newline': '\n'
+      },
+      headless: false,
+      chunkSize: 10000,
+      emptyTag: '',
+      cdata: false
+    }
+  };
+
+}).call(this);
diff --git a/wrt/node_modules/xml2js/lib/parser.js b/wrt/node_modules/xml2js/lib/parser.js
new file mode 100644 (file)
index 0000000..9e8261e
--- /dev/null
@@ -0,0 +1,357 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+  "use strict";
+  var bom, defaults, events, isEmpty, processItem, processors, sax, setImmediate,
+    bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
+    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+    hasProp = {}.hasOwnProperty;
+
+  sax = require('sax');
+
+  events = require('events');
+
+  bom = require('./bom');
+
+  processors = require('./processors');
+
+  setImmediate = require('timers').setImmediate;
+
+  defaults = require('./defaults').defaults;
+
+  isEmpty = function(thing) {
+    return typeof thing === "object" && (thing != null) && Object.keys(thing).length === 0;
+  };
+
+  processItem = function(processors, item, key) {
+    var i, len, process;
+    for (i = 0, len = processors.length; i < len; i++) {
+      process = processors[i];
+      item = process(item, key);
+    }
+    return item;
+  };
+
+  exports.Parser = (function(superClass) {
+    extend(Parser, superClass);
+
+    function Parser(opts) {
+      this.parseString = bind(this.parseString, this);
+      this.reset = bind(this.reset, this);
+      this.assignOrPush = bind(this.assignOrPush, this);
+      this.processAsync = bind(this.processAsync, this);
+      var key, ref, value;
+      if (!(this instanceof exports.Parser)) {
+        return new exports.Parser(opts);
+      }
+      this.options = {};
+      ref = defaults["0.2"];
+      for (key in ref) {
+        if (!hasProp.call(ref, key)) continue;
+        value = ref[key];
+        this.options[key] = value;
+      }
+      for (key in opts) {
+        if (!hasProp.call(opts, key)) continue;
+        value = opts[key];
+        this.options[key] = value;
+      }
+      if (this.options.xmlns) {
+        this.options.xmlnskey = this.options.attrkey + "ns";
+      }
+      if (this.options.normalizeTags) {
+        if (!this.options.tagNameProcessors) {
+          this.options.tagNameProcessors = [];
+        }
+        this.options.tagNameProcessors.unshift(processors.normalize);
+      }
+      this.reset();
+    }
+
+    Parser.prototype.processAsync = function() {
+      var chunk, err;
+      try {
+        if (this.remaining.length <= this.options.chunkSize) {
+          chunk = this.remaining;
+          this.remaining = '';
+          this.saxParser = this.saxParser.write(chunk);
+          return this.saxParser.close();
+        } else {
+          chunk = this.remaining.substr(0, this.options.chunkSize);
+          this.remaining = this.remaining.substr(this.options.chunkSize, this.remaining.length);
+          this.saxParser = this.saxParser.write(chunk);
+          return setImmediate(this.processAsync);
+        }
+      } catch (error1) {
+        err = error1;
+        if (!this.saxParser.errThrown) {
+          this.saxParser.errThrown = true;
+          return this.emit(err);
+        }
+      }
+    };
+
+    Parser.prototype.assignOrPush = function(obj, key, newValue) {
+      if (!(key in obj)) {
+        if (!this.options.explicitArray) {
+          return obj[key] = newValue;
+        } else {
+          return obj[key] = [newValue];
+        }
+      } else {
+        if (!(obj[key] instanceof Array)) {
+          obj[key] = [obj[key]];
+        }
+        return obj[key].push(newValue);
+      }
+    };
+
+    Parser.prototype.reset = function() {
+      var attrkey, charkey, ontext, stack;
+      this.removeAllListeners();
+      this.saxParser = sax.parser(this.options.strict, {
+        trim: false,
+        normalize: false,
+        xmlns: this.options.xmlns
+      });
+      this.saxParser.errThrown = false;
+      this.saxParser.onerror = (function(_this) {
+        return function(error) {
+          _this.saxParser.resume();
+          if (!_this.saxParser.errThrown) {
+            _this.saxParser.errThrown = true;
+            return _this.emit("error", error);
+          }
+        };
+      })(this);
+      this.saxParser.onend = (function(_this) {
+        return function() {
+          if (!_this.saxParser.ended) {
+            _this.saxParser.ended = true;
+            return _this.emit("end", _this.resultObject);
+          }
+        };
+      })(this);
+      this.saxParser.ended = false;
+      this.EXPLICIT_CHARKEY = this.options.explicitCharkey;
+      this.resultObject = null;
+      stack = [];
+      attrkey = this.options.attrkey;
+      charkey = this.options.charkey;
+      this.saxParser.onopentag = (function(_this) {
+        return function(node) {
+          var key, newValue, obj, processedKey, ref;
+          obj = {};
+          obj[charkey] = "";
+          if (!_this.options.ignoreAttrs) {
+            ref = node.attributes;
+            for (key in ref) {
+              if (!hasProp.call(ref, key)) continue;
+              if (!(attrkey in obj) && !_this.options.mergeAttrs) {
+                obj[attrkey] = {};
+              }
+              newValue = _this.options.attrValueProcessors ? processItem(_this.options.attrValueProcessors, node.attributes[key], key) : node.attributes[key];
+              processedKey = _this.options.attrNameProcessors ? processItem(_this.options.attrNameProcessors, key) : key;
+              if (_this.options.mergeAttrs) {
+                _this.assignOrPush(obj, processedKey, newValue);
+              } else {
+                obj[attrkey][processedKey] = newValue;
+              }
+            }
+          }
+          obj["#name"] = _this.options.tagNameProcessors ? processItem(_this.options.tagNameProcessors, node.name) : node.name;
+          if (_this.options.xmlns) {
+            obj[_this.options.xmlnskey] = {
+              uri: node.uri,
+              local: node.local
+            };
+          }
+          return stack.push(obj);
+        };
+      })(this);
+      this.saxParser.onclosetag = (function(_this) {
+        return function() {
+          var cdata, emptyStr, key, node, nodeName, obj, objClone, old, s, xpath;
+          obj = stack.pop();
+          nodeName = obj["#name"];
+          if (!_this.options.explicitChildren || !_this.options.preserveChildrenOrder) {
+            delete obj["#name"];
+          }
+          if (obj.cdata === true) {
+            cdata = obj.cdata;
+            delete obj.cdata;
+          }
+          s = stack[stack.length - 1];
+          if (obj[charkey].match(/^\s*$/) && !cdata) {
+            emptyStr = obj[charkey];
+            delete obj[charkey];
+          } else {
+            if (_this.options.trim) {
+              obj[charkey] = obj[charkey].trim();
+            }
+            if (_this.options.normalize) {
+              obj[charkey] = obj[charkey].replace(/\s{2,}/g, " ").trim();
+            }
+            obj[charkey] = _this.options.valueProcessors ? processItem(_this.options.valueProcessors, obj[charkey], nodeName) : obj[charkey];
+            if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) {
+              obj = obj[charkey];
+            }
+          }
+          if (isEmpty(obj)) {
+            obj = _this.options.emptyTag !== '' ? _this.options.emptyTag : emptyStr;
+          }
+          if (_this.options.validator != null) {
+            xpath = "/" + ((function() {
+              var i, len, results;
+              results = [];
+              for (i = 0, len = stack.length; i < len; i++) {
+                node = stack[i];
+                results.push(node["#name"]);
+              }
+              return results;
+            })()).concat(nodeName).join("/");
+            (function() {
+              var err;
+              try {
+                return obj = _this.options.validator(xpath, s && s[nodeName], obj);
+              } catch (error1) {
+                err = error1;
+                return _this.emit("error", err);
+              }
+            })();
+          }
+          if (_this.options.explicitChildren && !_this.options.mergeAttrs && typeof obj === 'object') {
+            if (!_this.options.preserveChildrenOrder) {
+              node = {};
+              if (_this.options.attrkey in obj) {
+                node[_this.options.attrkey] = obj[_this.options.attrkey];
+                delete obj[_this.options.attrkey];
+              }
+              if (!_this.options.charsAsChildren && _this.options.charkey in obj) {
+                node[_this.options.charkey] = obj[_this.options.charkey];
+                delete obj[_this.options.charkey];
+              }
+              if (Object.getOwnPropertyNames(obj).length > 0) {
+                node[_this.options.childkey] = obj;
+              }
+              obj = node;
+            } else if (s) {
+              s[_this.options.childkey] = s[_this.options.childkey] || [];
+              objClone = {};
+              for (key in obj) {
+                if (!hasProp.call(obj, key)) continue;
+                objClone[key] = obj[key];
+              }
+              s[_this.options.childkey].push(objClone);
+              delete obj["#name"];
+              if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) {
+                obj = obj[charkey];
+              }
+            }
+          }
+          if (stack.length > 0) {
+            return _this.assignOrPush(s, nodeName, obj);
+          } else {
+            if (_this.options.explicitRoot) {
+              old = obj;
+              obj = {};
+              obj[nodeName] = old;
+            }
+            _this.resultObject = obj;
+            _this.saxParser.ended = true;
+            return _this.emit("end", _this.resultObject);
+          }
+        };
+      })(this);
+      ontext = (function(_this) {
+        return function(text) {
+          var charChild, s;
+          s = stack[stack.length - 1];
+          if (s) {
+            s[charkey] += text;
+            if (_this.options.explicitChildren && _this.options.preserveChildrenOrder && _this.options.charsAsChildren && (_this.options.includeWhiteChars || text.replace(/\\n/g, '').trim() !== '')) {
+              s[_this.options.childkey] = s[_this.options.childkey] || [];
+              charChild = {
+                '#name': '__text__'
+              };
+              charChild[charkey] = text;
+              if (_this.options.normalize) {
+                charChild[charkey] = charChild[charkey].replace(/\s{2,}/g, " ").trim();
+              }
+              s[_this.options.childkey].push(charChild);
+            }
+            return s;
+          }
+        };
+      })(this);
+      this.saxParser.ontext = ontext;
+      return this.saxParser.oncdata = (function(_this) {
+        return function(text) {
+          var s;
+          s = ontext(text);
+          if (s) {
+            return s.cdata = true;
+          }
+        };
+      })(this);
+    };
+
+    Parser.prototype.parseString = function(str, cb) {
+      var err;
+      if ((cb != null) && typeof cb === "function") {
+        this.on("end", function(result) {
+          this.reset();
+          return cb(null, result);
+        });
+        this.on("error", function(err) {
+          this.reset();
+          return cb(err);
+        });
+      }
+      try {
+        str = str.toString();
+        if (str.trim() === '') {
+          this.emit("end", null);
+          return true;
+        }
+        str = bom.stripBOM(str);
+        if (this.options.async) {
+          this.remaining = str;
+          setImmediate(this.processAsync);
+          return this.saxParser;
+        }
+        return this.saxParser.write(str).close();
+      } catch (error1) {
+        err = error1;
+        if (!(this.saxParser.errThrown || this.saxParser.ended)) {
+          this.emit('error', err);
+          return this.saxParser.errThrown = true;
+        } else if (this.saxParser.ended) {
+          throw err;
+        }
+      }
+    };
+
+    return Parser;
+
+  })(events.EventEmitter);
+
+  exports.parseString = function(str, a, b) {
+    var cb, options, parser;
+    if (b != null) {
+      if (typeof b === 'function') {
+        cb = b;
+      }
+      if (typeof a === 'object') {
+        options = a;
+      }
+    } else {
+      if (typeof a === 'function') {
+        cb = a;
+      }
+      options = {};
+    }
+    parser = new exports.Parser(options);
+    return parser.parseString(str, cb);
+  };
+
+}).call(this);
diff --git a/wrt/node_modules/xml2js/lib/processors.js b/wrt/node_modules/xml2js/lib/processors.js
new file mode 100644 (file)
index 0000000..89aa85f
--- /dev/null
@@ -0,0 +1,34 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+  "use strict";
+  var prefixMatch;
+
+  prefixMatch = new RegExp(/(?!xmlns)^.*:/);
+
+  exports.normalize = function(str) {
+    return str.toLowerCase();
+  };
+
+  exports.firstCharLowerCase = function(str) {
+    return str.charAt(0).toLowerCase() + str.slice(1);
+  };
+
+  exports.stripPrefix = function(str) {
+    return str.replace(prefixMatch, '');
+  };
+
+  exports.parseNumbers = function(str) {
+    if (!isNaN(str)) {
+      str = str % 1 === 0 ? parseInt(str, 10) : parseFloat(str);
+    }
+    return str;
+  };
+
+  exports.parseBooleans = function(str) {
+    if (/^(?:true|false)$/i.test(str)) {
+      str = str.toLowerCase() === 'true';
+    }
+    return str;
+  };
+
+}).call(this);
diff --git a/wrt/node_modules/xml2js/lib/xml2js.js b/wrt/node_modules/xml2js/lib/xml2js.js
new file mode 100644 (file)
index 0000000..599d3dd
--- /dev/null
@@ -0,0 +1,37 @@
+// Generated by CoffeeScript 1.12.7
+(function() {
+  "use strict";
+  var builder, defaults, parser, processors,
+    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+    hasProp = {}.hasOwnProperty;
+
+  defaults = require('./defaults');
+
+  builder = require('./builder');
+
+  parser = require('./parser');
+
+  processors = require('./processors');
+
+  exports.defaults = defaults.defaults;
+
+  exports.processors = processors;
+
+  exports.ValidationError = (function(superClass) {
+    extend(ValidationError, superClass);
+
+    function ValidationError(message) {
+      this.message = message;
+    }
+
+    return ValidationError;
+
+  })(Error);
+
+  exports.Builder = builder.Builder;
+
+  exports.Parser = parser.Parser;
+
+  exports.parseString = parser.parseString;
+
+}).call(this);
diff --git a/wrt/node_modules/xml2js/package.json b/wrt/node_modules/xml2js/package.json
new file mode 100644 (file)
index 0000000..64d5984
--- /dev/null
@@ -0,0 +1,314 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "xml2js",
+        "scope": null,
+        "escapedName": "xml2js",
+        "name": "xml2js",
+        "rawSpec": "",
+        "spec": "latest",
+        "type": "tag"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt"
+    ]
+  ],
+  "_from": "xml2js@latest",
+  "_id": "xml2js@0.4.19",
+  "_inCache": true,
+  "_location": "/xml2js",
+  "_nodeVersion": "8.4.0",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/xml2js-0.4.19.tgz_1503387862909_0.5125016651581973"
+  },
+  "_npmUser": {
+    "name": "leonidas",
+    "email": "marek@xivilization.net"
+  },
+  "_npmVersion": "5.3.0",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "xml2js",
+    "scope": null,
+    "escapedName": "xml2js",
+    "name": "xml2js",
+    "rawSpec": "",
+    "spec": "latest",
+    "type": "tag"
+  },
+  "_requiredBy": [
+    "#USER"
+  ],
+  "_resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz",
+  "_shasum": "686c20f213209e94abf0d1bcf1efaa291c7827a7",
+  "_shrinkwrap": null,
+  "_spec": "xml2js",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt",
+  "author": {
+    "name": "Marek Kubica",
+    "email": "marek@xivilization.net",
+    "url": "https://xivilization.net"
+  },
+  "bugs": {
+    "url": "https://github.com/Leonidas-from-XIV/node-xml2js/issues"
+  },
+  "contributors": [
+    {
+      "name": "maqr",
+      "email": "maqr.lollerskates@gmail.com",
+      "url": "https://github.com/maqr"
+    },
+    {
+      "name": "Ben Weaver",
+      "url": "http://benweaver.com/"
+    },
+    {
+      "name": "Jae Kwon",
+      "url": "https://github.com/jaekwon"
+    },
+    {
+      "name": "Jim Robert"
+    },
+    {
+      "name": "Ștefan Rusu",
+      "url": "http://www.saltwaterc.eu/"
+    },
+    {
+      "name": "Carter Cole",
+      "email": "carter.cole@cartercole.com",
+      "url": "http://cartercole.com/"
+    },
+    {
+      "name": "Kurt Raschke",
+      "email": "kurt@kurtraschke.com",
+      "url": "http://www.kurtraschke.com/"
+    },
+    {
+      "name": "Contra",
+      "email": "contra@australia.edu",
+      "url": "https://github.com/Contra"
+    },
+    {
+      "name": "Marcelo Diniz",
+      "email": "marudiniz@gmail.com",
+      "url": "https://github.com/mdiniz"
+    },
+    {
+      "name": "Michael Hart",
+      "url": "https://github.com/mhart"
+    },
+    {
+      "name": "Zachary Scott",
+      "email": "zachary@zacharyscott.net",
+      "url": "http://zacharyscott.net/"
+    },
+    {
+      "name": "Raoul Millais",
+      "url": "https://github.com/raoulmillais"
+    },
+    {
+      "name": "Salsita Software",
+      "url": "http://www.salsitasoft.com/"
+    },
+    {
+      "name": "Mike Schilling",
+      "email": "mike@emotive.com",
+      "url": "http://www.emotive.com/"
+    },
+    {
+      "name": "Jackson Tian",
+      "email": "shyvo1987@gmail.com",
+      "url": "http://weibo.com/shyvo"
+    },
+    {
+      "name": "Mikhail Zyatin",
+      "email": "mikhail.zyatin@gmail.com",
+      "url": "https://github.com/Sitin"
+    },
+    {
+      "name": "Chris Tavares",
+      "email": "ctavares@microsoft.com",
+      "url": "https://github.com/christav"
+    },
+    {
+      "name": "Frank Xu",
+      "email": "yyfrankyy@gmail.com",
+      "url": "http://f2e.us/"
+    },
+    {
+      "name": "Guido D'Albore",
+      "email": "guido@bitstorm.it",
+      "url": "http://www.bitstorm.it/"
+    },
+    {
+      "name": "Jack Senechal",
+      "url": "http://jacksenechal.com/"
+    },
+    {
+      "name": "Matthias Hölzl",
+      "email": "tc@xantira.com",
+      "url": "https://github.com/hoelzl"
+    },
+    {
+      "name": "Camille Reynders",
+      "email": "info@creynders.be",
+      "url": "http://www.creynders.be/"
+    },
+    {
+      "name": "Taylor Gautier",
+      "url": "https://github.com/tsgautier"
+    },
+    {
+      "name": "Todd Bryan",
+      "url": "https://github.com/toddrbryan"
+    },
+    {
+      "name": "Leore Avidar",
+      "email": "leore.avidar@gmail.com",
+      "url": "http://leoreavidar.com/"
+    },
+    {
+      "name": "Dave Aitken",
+      "email": "dave.aitken@gmail.com",
+      "url": "http://www.actionshrimp.com/"
+    },
+    {
+      "name": "Shaney Orrowe",
+      "email": "shaney.orrowe@practiceweb.co.uk"
+    },
+    {
+      "name": "Candle",
+      "email": "candle@candle.me.uk"
+    },
+    {
+      "name": "Jess Telford",
+      "email": "hi@jes.st",
+      "url": "http://jes.st"
+    },
+    {
+      "name": "Tom Hughes",
+      "email": "<tom@compton.nu",
+      "url": "http://compton.nu/"
+    },
+    {
+      "name": "Piotr Rochala",
+      "url": "http://rocha.la/"
+    },
+    {
+      "name": "Michael Avila",
+      "url": "https://github.com/michaelavila"
+    },
+    {
+      "name": "Ryan Gahl",
+      "url": "https://github.com/ryedin"
+    },
+    {
+      "name": "Eric Laberge",
+      "email": "e.laberge@gmail.com",
+      "url": "https://github.com/elaberge"
+    },
+    {
+      "name": "Benjamin E. Coe",
+      "email": "ben@npmjs.com",
+      "url": "https://twitter.com/benjamincoe"
+    },
+    {
+      "name": "Stephen Cresswell",
+      "url": "https://github.com/cressie176"
+    },
+    {
+      "name": "Pascal Ehlert",
+      "email": "pascal@hacksrus.net",
+      "url": "http://www.hacksrus.net/"
+    },
+    {
+      "name": "Tom Spencer",
+      "email": "fiznool@gmail.com",
+      "url": "http://fiznool.com/"
+    },
+    {
+      "name": "Tristian Flanagan",
+      "email": "tflanagan@datacollaborative.com",
+      "url": "https://github.com/tflanagan"
+    },
+    {
+      "name": "Tim Johns",
+      "email": "timjohns@yahoo.com",
+      "url": "https://github.com/TimJohns"
+    },
+    {
+      "name": "Bogdan Chadkin",
+      "email": "trysound@yandex.ru",
+      "url": "https://github.com/TrySound"
+    },
+    {
+      "name": "David Wood",
+      "email": "david.p.wood@gmail.com",
+      "url": "http://codesleuth.co.uk/"
+    },
+    {
+      "name": "Nicolas Maquet",
+      "url": "https://github.com/nmaquet"
+    },
+    {
+      "name": "Lovell Fuller",
+      "url": "http://lovell.info/"
+    },
+    {
+      "name": "d3adc0d3",
+      "url": "https://github.com/d3adc0d3"
+    }
+  ],
+  "dependencies": {
+    "sax": ">=0.6.0",
+    "xmlbuilder": "~9.0.1"
+  },
+  "description": "Simple XML to JavaScript object converter.",
+  "devDependencies": {
+    "coffee-script": ">=1.10.0",
+    "coveralls": "^2.11.2",
+    "diff": ">=1.0.8",
+    "docco": ">=0.6.2",
+    "nyc": ">=2.2.1",
+    "zap": ">=0.2.9"
+  },
+  "directories": {
+    "lib": "./lib"
+  },
+  "dist": {
+    "integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==",
+    "shasum": "686c20f213209e94abf0d1bcf1efaa291c7827a7",
+    "tarball": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz"
+  },
+  "files": [
+    "lib"
+  ],
+  "gitHead": "1ab44ea837eff59305bd11f0e1a1e542e7c3e79f",
+  "homepage": "https://github.com/Leonidas-from-XIV/node-xml2js",
+  "keywords": [
+    "xml",
+    "json"
+  ],
+  "license": "MIT",
+  "main": "./lib/xml2js",
+  "maintainers": [
+    {
+      "name": "leonidas",
+      "email": "marek@xivilization.net"
+    }
+  ],
+  "name": "xml2js",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/Leonidas-from-XIV/node-xml2js.git"
+  },
+  "scripts": {
+    "coverage": "nyc npm test && nyc report",
+    "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls",
+    "test": "zap"
+  },
+  "version": "0.4.19"
+}
diff --git a/wrt/node_modules/xmlbuilder/.npmignore b/wrt/node_modules/xmlbuilder/.npmignore
new file mode 100644 (file)
index 0000000..b6ad1f6
--- /dev/null
@@ -0,0 +1,5 @@
+.travis.yml
+src
+test
+perf
+coverage
diff --git a/wrt/node_modules/xmlbuilder/CHANGELOG.md b/wrt/node_modules/xmlbuilder/CHANGELOG.md
new file mode 100644 (file)
index 0000000..6264283
--- /dev/null
@@ -0,0 +1,423 @@
+# Change Log
+
+All notable changes to this project are documented in this file. This project adheres to [Semantic Versioning](http://semver.org/#semantic-versioning-200).
+
+## [9.0.4] - 2017-08-16
+- `spacebeforeslash` writer option accepts `true` as well as space char(s).
+
+## [9.0.3] - 2017-08-15
+- `spacebeforeslash` writer option can now be used with XML fragments.
+
+## [9.0.2] - 2017-08-15
+- Added the `spacebeforeslash` writer option to add a space character before closing tags of empty elements. See
+[#157](https://github.com/oozcitak/xmlbuilder-js/issues/157).
+
+## [9.0.1] - 2017-06-19
+- Fixed character validity checks to work with node.js 4.0 and 5.0. See
+[#161](https://github.com/oozcitak/xmlbuilder-js/issues/161).
+
+## [9.0.0] - 2017-05-05
+- Removed case conversion options.
+- Removed support for node.js 4.0 and 5.0. Minimum required version is now 6.0.
+- Fixed valid char filter to use XML 1.1 instead of 1.0. See
+[#147](https://github.com/oozcitak/xmlbuilder-js/issues/147).
+- Added options for negative indentation and suppressing pretty printing of text
+nodes. See
+[#145](https://github.com/oozcitak/xmlbuilder-js/issues/145).
+
+## [8.2.2] - 2016-04-08
+- Falsy values can now be used as a text node in callback mode.
+
+## [8.2.1] - 2016-04-07
+- Falsy values can now be used as a text node. See 
+[#117](https://github.com/oozcitak/xmlbuilder-js/issues/117).
+
+## [8.2.0] - 2016-04-01
+- Removed lodash dependency to keep the library small and simple. See
+[#114](https://github.com/oozcitak/xmlbuilder-js/issues/114),
+[#53](https://github.com/oozcitak/xmlbuilder-js/issues/53),
+and [#43](https://github.com/oozcitak/xmlbuilder-js/issues/43).
+- Added title case to name conversion options.
+
+## [8.1.0] - 2016-03-29
+- Added the callback option to the `begin` export function. When used with a
+callback function, the XML document will be generated in chunks and each chunk
+will be passed to the supplied function. In this mode, `begin` uses a different
+code path and the builder should use much less memory since the entire XML tree
+is not kept. There are a few drawbacks though. For example, traversing the document
+tree or adding attributes to a node after it is written is not possible. It is
+also not possible to remove nodes or attributes.
+
+``` js
+var result = '';
+
+builder.begin(function(chunk) { result += chunk; })
+  .dec()
+  .ele('root')
+    .ele('xmlbuilder').up()
+  .end();
+```
+
+- Replaced native `Object.assign` with `lodash.assign` to support old JS engines.  See [#111](https://github.com/oozcitak/xmlbuilder-js/issues/111).
+
+## [8.0.0] - 2016-03-25
+- Added the `begin` export function. See the wiki for details.
+- Added the ability to add comments and processing instructions before and after the root element. Added `commentBefore`, `commentAfter`, `instructionBefore` and `instructionAfter` functions for this purpose.
+- Dropped support for old node.js releases. Minimum required node.js version is now 4.0.
+
+## [7.0.0] - 2016-03-21
+- Processing instructions are now created as regular nodes. This is a major breaking change if you are using processing instructions. Previously processing instructions were inserted before their parent node. After this change processing instructions are appended to the children of the parent node. Note that it is not currently possible to insert processing instructions before or after the root element.
+```js
+root.ele('node').ins('pi');
+// pre-v7
+<?pi?><node/>
+// v7
+<node><?pi?></node>
+```
+
+## [6.0.0] - 2016-03-20
+- Added custom XML writers. The default string conversion functions are now collected under the `XMLStringWriter` class which can be accessed by the `stringWriter(options)` function exported by the module. An `XMLStreamWriter` is also added which outputs the XML document to a writable stream. A stream writer can be created by calling the `streamWriter(stream, options)` function exported by the module. Both classes are heavily customizable and the details are added to the wiki. It is also possible to write an XML writer from scratch and use it when calling `end()` on the XML document.
+
+## [5.0.1] - 2016-03-08
+- Moved require statements for text case conversion to the top of files to reduce lazy requires.
+
+## [5.0.0] - 2016-03-05
+- Added text case option for element names and attribute names. Valid cases are `lower`, `upper`, `camel`, `kebab` and `snake`.
+- Attribute and element values are escaped according to the [Canonical XML 1.0 specification](http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping). See [#54](https://github.com/oozcitak/xmlbuilder-js/issues/54) and [#86](https://github.com/oozcitak/xmlbuilder-js/issues/86).
+- Added the `allowEmpty` option to `end()`. When this option is set, empty elements are not self-closed.
+- Added support for [nested CDATA](https://en.wikipedia.org/wiki/CDATA#Nesting). The triad `]]>` in CDATA is now automatically replaced with `]]]]><![CDATA[>`.
+
+## [4.2.1] - 2016-01-15
+- Updated lodash dependency to 4.0.0.
+
+## [4.2.0] - 2015-12-16
+- Added the `noDoubleEncoding` option to `create()` to control whether existing html entities are encoded.
+
+## [4.1.0] - 2015-11-11
+- Added the `separateArrayItems` option to `create()` to control how arrays are handled when converting from objects. e.g.
+
+```js
+root.ele({ number: [ "one", "two"  ]});
+// with separateArrayItems: true
+<number>
+  <one/>
+  <two/>
+</number>
+// with separateArrayItems: false
+<number>one</number>
+<number>two</number>
+```
+
+## [4.0.0] - 2015-11-01
+- Removed the `#list` decorator. Array items are now created as child nodes by default.
+- Fixed a bug where the XML encoding string was checked partially.
+
+## [3.1.0] - 2015-09-19
+- `#list` decorator ignores empty arrays.
+
+## [3.0.0] - 2015-09-10
+- Allow `\r`, `\n` and `\t` in attribute values without escaping. See [#86](https://github.com/oozcitak/xmlbuilder-js/issues/86).
+
+## [2.6.5] - 2015-09-09
+- Use native `isArray` instead of lodash.
+- Indentation of processing instructions are set to the parent element's.
+
+## [2.6.4] - 2015-05-27
+- Updated lodash dependency to 3.5.0.
+
+## [2.6.3] - 2015-05-27
+- Bumped version because previous release was not published on npm.
+
+## [2.6.2] - 2015-03-10
+- Updated lodash dependency to 3.5.0.
+
+## [2.6.1] - 2015-02-20
+- Updated lodash dependency to 3.3.0.
+
+## [2.6.0] - 2015-02-20
+- Fixed a bug where the `XMLNode` constructor overwrote the super class parent.
+- Removed document property from cloned nodes.
+- Switched to mocha.js for testing.
+
+## [2.5.2] - 2015-02-16
+- Updated lodash dependency to 3.2.0.
+
+## [2.5.1] - 2015-02-09
+- Updated lodash dependency to 3.1.0.
+- Support all node >= 0.8.
+
+## [2.5.0] - 2015-00-03
+- Updated lodash dependency to 3.0.0.
+
+## [2.4.6] - 2015-01-26
+-      Show more information from attribute creation with null values.
+-      Added iojs as an engine.
+-      Self close elements with empty text.
+
+## [2.4.5] - 2014-11-15
+- Fixed prepublish script to run on windows.
+- Fixed  bug in XMLStringifier where an undefined value was used while reporting an invalid encoding value.
+- Moved require statements to the top of files to reduce lazy requires. See [#62](https://github.com/oozcitak/xmlbuilder-js/issues/62).
+
+## [2.4.4] - 2014-09-08
+- Added the `offset` option to `toString()` for use in XML fragments.
+
+## [2.4.3] - 2014-08-13
+- Corrected license in package description.
+
+## [2.4.2] - 2014-08-13
+- Dropped performance test and memwatch dependency.
+
+## [2.4.1] - 2014-08-12
+- Fixed a bug where empty indent string was omitted when pretty printing. See [#59](https://github.com/oozcitak/xmlbuilder-js/issues/59).
+
+## [2.4.0] - 2014-08-04
+- Correct cases of pubID and sysID.
+- Use single lodash instead of separate npm modules. See [#53](https://github.com/oozcitak/xmlbuilder-js/issues/53).
+- Escape according to Canonical XML 1.0. See [#54](https://github.com/oozcitak/xmlbuilder-js/issues/54).
+
+## [2.3.0] - 2014-07-17
+- Convert objects to JS primitives while sanitizing user input.
+- Object builder preserves items with null values. See [#44](https://github.com/oozcitak/xmlbuilder-js/issues/44).
+- Use modularized lodash functions to cut down dependencies.
+- Process empty objects when converting from objects so that we don't throw on empty child objects.
+
+## [2.2.1] - 2014-04-04
+- Bumped version because previous release was not published on npm.
+
+## [2.2.0] - 2014-04-04
+- Switch to lodash from underscore.
+- Removed legacy `ext` option from `create()`.
+- Drop old node versions: 0.4, 0.5, 0.6. 0.8 is the minimum requirement from now on.
+
+## [2.1.0] - 2013-12-30
+- Removed duplicate null checks from constructors.
+- Fixed node count in performance test.
+- Added option for skipping null attribute values. See [#26](https://github.com/oozcitak/xmlbuilder-js/issues/26).
+- Allow multiple values in `att()` and `ins()`.
+- Added ability to run individual performance tests.
+- Added flag for ignoring decorator strings.
+
+## [2.0.1] - 2013-12-24
+- Removed performance tests from npm package.
+
+## [2.0.0] - 2013-12-24
+- Combined loops for speed up.
+- Added support for the DTD and XML declaration.
+- `clone` includes attributes.
+- Added performance tests.
+- Evaluate attribute value if function.
+- Evaluate instruction value if function.
+
+## [1.1.2] - 2013-12-11
+-      Changed processing instruction decorator to `?`.
+
+## [1.1.1] - 2013-12-11
+-      Added processing instructions to JS object conversion.
+
+## [1.1.0] - 2013-12-10
+- Added license to package.
+- `create()` and `element()` accept JS object to fully build the document.
+- Added `nod()` and `n()` aliases for `node()`.
+- Renamed `convertAttChar` decorator to `convertAttKey`.
+- Ignore empty decorator strings when converting JS objects.
+
+## [1.0.2] - 2013-11-27
+- Removed temp file which was accidentally included in the package.
+
+## [1.0.1] - 2013-11-27
+- Custom stringify functions affect current instance only.
+
+## [1.0.0] - 2013-11-27
+- Added processing instructions.
+- Added stringify functions to sanitize and convert input values.
+- Added option for headless XML documents.
+- Added vows tests.
+- Removed Makefile. Using npm publish scripts instead.
+- Removed the `begin()` function. `create()` begins the document by creating the root node.
+
+## [0.4.3] - 2013-11-08
+- Added option to include surrogate pairs in XML content. See [#29](https://github.com/oozcitak/xmlbuilder-js/issues/29).
+- Fixed empty value string representation in pretty mode.
+- Added pre and postpublish scripts to package.json.
+- Filtered out prototype properties when appending attributes. See [#31](https://github.com/oozcitak/xmlbuilder-js/issues/31).
+
+## [0.4.2] - 2012-09-14
+- Removed README.md from `.npmignore`.
+
+## [0.4.1] - 2012-08-31
+- Removed `begin()` calls in favor of `XMLBuilder` constructor.
+- Added the `end()` function. `end()` is a convenience over `doc().toString()`.
+
+## [0.4.0] - 2012-08-31
+- Added arguments to `XMLBuilder` constructor to allow the name of the root element and XML prolog to be defined in one line.
+- Soft deprecated `begin()`.
+
+## [0.3.11] - 2012-08-13
+- Package keywords are fixed to be an array of values.
+
+## [0.3.10] - 2012-08-13
+- Brought back npm package contents which were lost due to incorrect configuration of `package.json` in previous releases.
+
+## [0.3.3] - 2012-07-27
+- Implemented `importXMLBuilder()`.
+
+## [0.3.2] - 2012-07-20
+- Fixed a duplicated escaping problem on `element()`.
+- Fixed a problem with text node creation from empty string.
+- Calling `root()` on the document element returns the root element.
+- `XMLBuilder` no longer extends `XMLFragment`.
+
+## [0.3.1] - 2011-11-28
+- Added guards for document element so that nodes cannot be inserted at document level.
+
+## [0.3.0] - 2011-11-28
+- Added `doc()` to return the document element.
+
+## [0.2.2] - 2011-11-28
+- Prevent code relying on `up()`'s older behavior to break.
+
+## [0.2.1] - 2011-11-28
+- Added the `root()` function.
+
+## [0.2.0] - 2011-11-21
+- Added Travis-CI integration.
+- Added coffee-script dependency.
+- Added insert, traversal and delete functions.
+
+## [0.1.7] - 2011-10-25
+- No changes. Accidental release.
+
+## [0.1.6] - 2011-10-25
+- Corrected `package.json` bugs link to `url` from `web`.
+
+## [0.1.5] - 2011-08-08
+- Added missing npm package contents.
+
+## [0.1.4] - 2011-07-29
+- Text-only nodes are no longer indented.
+- Added documentation for multiple instances.
+
+## [0.1.3] - 2011-07-27
+- Exported the `create()` function to return a new instance. This allows multiple builder instances to be constructed.
+- Fixed `u()` function so that it now correctly calls `up()`.
+- Fixed typo in `element()` so that `attributes` and `text` can be passed interchangeably.
+
+## [0.1.2] - 2011-06-03
+- `ele()` accepts element text.
+- `attributes()` now overrides existing attributes if passed the same attribute name.
+
+## [0.1.1] - 2011-05-19
+- Added the raw output option.
+- Removed most validity checks.
+
+## [0.1.0] - 2011-04-27
+- `text()` and `cdata()` now return parent element.
+- Attribute values are escaped.
+
+## [0.0.7] - 2011-04-23
+-      Coerced text values to string.
+
+## [0.0.6] - 2011-02-23
+- Added support for XML comments.
+- Text nodes are checked against CharData.
+
+## [0.0.5] - 2010-12-31
+- Corrected the name of the main npm module in `package.json`.
+
+## [0.0.4] - 2010-12-28
+- Added `.npmignore`.
+
+## [0.0.3] - 2010-12-27
+- root element is now constructed in `begin()`.
+- moved prolog to `begin()`.
+- Added the ability to have CDATA in element text.
+- Removed unused prolog aliases.
+- Removed `builder()` function from main module.
+- Added the name of the main npm module in `package.json`.
+
+## [0.0.2] - 2010-11-03
+- `element()` expands nested arrays.
+- Added pretty printing.
+- Added the `up()`, `build()` and `prolog()` functions.
+- Added readme.
+
+## 0.0.1 - 2010-11-02
+- Initial release
+
+[9.0.4]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.3...v9.0.4
+[9.0.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.2...v9.0.3
+[9.0.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.1...v9.0.2
+[9.0.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v9.0.0...v9.0.1
+[9.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v8.2.2...v9.0.0
+[8.2.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v8.2.1...v8.2.2
+[8.2.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v8.2.0...v8.2.1
+[8.2.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v8.1.0...v8.2.0
+[8.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v8.0.0...v8.1.0
+[8.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v7.0.0...v8.0.0
+[7.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v6.0.0...v7.0.0
+[6.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v5.0.1...v6.0.0
+[5.0.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v5.0.0...v5.0.1
+[5.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v4.2.1...v5.0.0
+[4.2.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v4.2.0...v4.2.1
+[4.2.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v4.1.0...v4.2.0
+[4.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v4.0.0...v4.1.0
+[4.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v3.1.0...v4.0.0
+[3.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v3.0.0...v3.1.0
+[3.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.5...v3.0.0
+[2.6.5]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.4...v2.6.5
+[2.6.4]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.3...v2.6.4
+[2.6.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.2...v2.6.3
+[2.6.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.1...v2.6.2
+[2.6.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.6.0...v2.6.1
+[2.6.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.5.2...v2.6.0
+[2.5.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.5.1...v2.5.2
+[2.5.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.5.0...v2.5.1
+[2.5.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.6...v2.5.0
+[2.4.6]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.5...v2.4.6
+[2.4.5]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.4...v2.4.5
+[2.4.4]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.3...v2.4.4
+[2.4.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.2...v2.4.3
+[2.4.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.1...v2.4.2
+[2.4.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.4.0...v2.4.1
+[2.4.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.3.0...v2.4.0
+[2.3.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.2.1...v2.3.0
+[2.2.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.2.0...v2.2.1
+[2.2.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.1.0...v2.2.0
+[2.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.0.1...v2.1.0
+[2.0.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v2.0.0...v2.0.1
+[2.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.1.2...v2.0.0
+[1.1.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.1.1...v1.1.2
+[1.1.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.1.0...v1.1.1
+[1.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.0.2...v1.1.0
+[1.0.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.0.1...v1.0.2
+[1.0.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v1.0.0...v1.0.1
+[1.0.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.4.3...v1.0.0
+[0.4.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.4.2...v0.4.3
+[0.4.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.4.1...v0.4.2
+[0.4.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.4.0...v0.4.1
+[0.4.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.11...v0.4.0
+[0.3.11]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.10...v0.3.11
+[0.3.10]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.3...v0.3.10
+[0.3.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.2...v0.3.3
+[0.3.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.1...v0.3.2
+[0.3.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.3.0...v0.3.1
+[0.3.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.2.2...v0.3.0
+[0.2.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.2.1...v0.2.2
+[0.2.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.2.0...v0.2.1
+[0.2.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.7...v0.2.0
+[0.1.7]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.6...v0.1.7
+[0.1.6]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.5...v0.1.6
+[0.1.5]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.4...v0.1.5
+[0.1.4]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.3...v0.1.4
+[0.1.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.2...v0.1.3
+[0.1.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.1...v0.1.2
+[0.1.1]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.1.0...v0.1.1
+[0.1.0]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.7...v0.1.0
+[0.0.7]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.6...v0.0.7
+[0.0.6]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.5...v0.0.6
+[0.0.5]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.4...v0.0.5
+[0.0.4]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.3...v0.0.4
+[0.0.3]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.2...v0.0.3
+[0.0.2]: https://github.com/oozcitak/xmlbuilder-js/compare/v0.0.1...v0.0.2
+
diff --git a/wrt/node_modules/xmlbuilder/LICENSE b/wrt/node_modules/xmlbuilder/LICENSE
new file mode 100644 (file)
index 0000000..e7cbac9
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2013 Ozgur Ozcitak
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/xmlbuilder/README.md b/wrt/node_modules/xmlbuilder/README.md
new file mode 100644 (file)
index 0000000..785c4dd
--- /dev/null
@@ -0,0 +1,85 @@
+# xmlbuilder-js
+
+An XML builder for [node.js](https://nodejs.org/) similar to
+[java-xmlbuilder](https://github.com/jmurty/java-xmlbuilder).
+
+[![License](http://img.shields.io/npm/l/xmlbuilder.svg?style=flat-square)](http://opensource.org/licenses/MIT)
+[![NPM Version](http://img.shields.io/npm/v/xmlbuilder.svg?style=flat-square)](https://npmjs.com/package/xmlbuilder)
+[![NPM Downloads](https://img.shields.io/npm/dm/xmlbuilder.svg?style=flat-square)](https://npmjs.com/package/xmlbuilder)
+
+[![Build Status](http://img.shields.io/travis/oozcitak/xmlbuilder-js.svg?style=flat-square)](http://travis-ci.org/oozcitak/xmlbuilder-js)
+[![Dev Dependency Status](http://img.shields.io/david/dev/oozcitak/xmlbuilder-js.svg?style=flat-square)](https://david-dm.org/oozcitak/xmlbuilder-js)
+[![Code Coverage](https://img.shields.io/coveralls/oozcitak/xmlbuilder-js.svg?style=flat-square)](https://coveralls.io/github/oozcitak/xmlbuilder-js)
+
+### Installation:
+
+``` sh
+npm install xmlbuilder
+```
+
+### Usage:
+
+``` js
+var builder = require('xmlbuilder');
+var xml = builder.create('root')
+  .ele('xmlbuilder')
+    .ele('repo', {'type': 'git'}, 'git://github.com/oozcitak/xmlbuilder-js.git')
+  .end({ pretty: true});
+
+console.log(xml);
+```
+
+will result in:
+
+``` xml
+<?xml version="1.0"?>
+<root>
+  <xmlbuilder>
+    <repo type="git">git://github.com/oozcitak/xmlbuilder-js.git</repo>
+  </xmlbuilder>
+</root>
+```
+
+It is also possible to convert objects into nodes:
+
+``` js
+builder.create({
+  root: {
+    xmlbuilder: {
+      repo: {
+        '@type': 'git', // attributes start with @
+        '#text': 'git://github.com/oozcitak/xmlbuilder-js.git' // text node
+      }
+    }
+  }
+});
+```
+
+If you need to do some processing:
+
+``` js
+var root = builder.create('squares');
+root.com('f(x) = x^2');
+for(var i = 1; i <= 5; i++)
+{
+  var item = root.ele('data');
+  item.att('x', i);
+  item.att('y', i * i);
+}
+```
+
+This will result in:
+
+``` xml
+<?xml version="1.0"?>
+<squares>
+  <!-- f(x) = x^2 -->
+  <data x="1" y="1"/>
+  <data x="2" y="4"/>
+  <data x="3" y="9"/>
+  <data x="4" y="16"/>
+  <data x="5" y="25"/>
+</squares>
+```
+
+See the [wiki](https://github.com/oozcitak/xmlbuilder-js/wiki) for details and [examples](https://github.com/oozcitak/xmlbuilder-js/wiki/Examples) for more complex examples.
diff --git a/wrt/node_modules/xmlbuilder/lib/Utility.js b/wrt/node_modules/xmlbuilder/lib/Utility.js
new file mode 100644 (file)
index 0000000..ba2deb0
--- /dev/null
@@ -0,0 +1,73 @@
+// Generated by CoffeeScript 1.12.6
+(function() {
+  var assign, isArray, isEmpty, isFunction, isObject, isPlainObject,
+    slice = [].slice,
+    hasProp = {}.hasOwnProperty;
+
+  assign = function() {
+    var i, key, len, source, sources, target;
+    target = arguments[0], sources = 2 <= arguments.length ? slice.call(arguments, 1) : [];
+    if (isFunction(Object.assign)) {
+      Object.assign.apply(null, arguments);
+    } else {
+      for (i = 0, len = sources.length; i < len; i++) {
+        source = sources[i];
+        if (source != null) {
+          for (key in source) {
+            if (!hasProp.call(source, key)) continue;
+            target[key] = source[key];
+          }
+        }
+      }
+    }
+    return target;
+  };
+
+  isFunction = function(val) {
+    return !!val && Object.prototype.toString.call(val) === '[object Function]';
+  };
+
+  isObject = function(val) {
+    var ref;
+    return !!val && ((ref = typeof val) === 'function' || ref === 'object');
+  };
+
+  isArray = function(val) {
+    if (isFunction(Array.isArray)) {
+      return Array.isArray(val);
+    } else {
+      return Object.prototype.toString.call(val) === '[object Array]';
+    }
+  };
+
+  isEmpty = function(val) {
+    var key;
+    if (isArray(val)) {
+      return !val.length;
+    } else {
+      for (key in val) {
+        if (!hasProp.call(val, key)) continue;
+        return false;
+      }
+      return true;
+    }
+  };
+
+  isPlainObject = function(val) {
+    var ctor, proto;
+    return isObject(val) && (proto = Object.getPrototypeOf(val)) && (ctor = proto.constructor) && (typeof ctor === 'function') && (ctor instanceof ctor) && (Function.prototype.toString.call(ctor) === Function.prototype.toString.call(Object));
+  };
+
+  module.exports.assign = assign;
+
+  module.exports.isFunction = isFunction;
+
+  module.exports.isObject = isObject;
+
+  module.exports.isArray = isArray;
+
+  module.exports.isEmpty = isEmpty;
+
+  module.exports.isPlainObject = isPlainObject;
+
+}).call(this);
diff --git a/wrt/node_modules/xmlbuilder/lib/XMLAttribute.js b/wrt/node_modules/xmlbuilder/lib/XMLAttribute.js
new file mode 100644 (file)
index 0000000..aff7c3d
--- /dev/null
@@ -0,0 +1,31 @@
+// Generated by CoffeeScript 1.12.6
+(function() {
+  var XMLAttribute;
+
+  module.exports = XMLAttribute = (function() {
+    function XMLAttribute(parent, name, value) {
+      this.options = parent.options;
+      this.stringify = parent.stringify;
+      if (name == null) {
+        throw new Error("Missing attribute name of element " + parent.name);
+      }
+      if (value == null) {
+        throw new Error("Missing attribute value for attribute " + name + " of element " + parent.name);
+      }
+      this.name = this.stringify.attName(name);
+      this.value = this.stringify.attValue(value);
+    }
+
+    XMLAttribute.prototype.clone = function() {
+      return Object.create(this);
+    };
+
+    XMLAttribute.prototype.toString = function(options) {
+      return this.options.writer.set(options).attribute(this);
+    };
+
+    return XMLAttribute;
+
+  })();
+
+}).call(this);
diff --git a/wrt/node_modules/xmlbuilder/lib/XMLCData.js b/wrt/node_modules/xmlbuilder/lib/XMLCData.js
new file mode 100644 (file)
index 0000000..8177ed0
--- /dev/null
@@ -0,0 +1,32 @@
+// Generated by CoffeeScript 1.12.6
+(function() {
+  var XMLCData, XMLNode,
+    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+    hasProp = {}.hasOwnProperty;
+
+  XMLNode = require('./XMLNode');
+
+  module.exports = XMLCData = (function(superClass) {
+    extend(XMLCData, superClass);
+
+    function XMLCData(parent, text) {
+      XMLCData.__super__.constructor.call(this, parent);
+      if (text == null) {
+        throw new Error("Missing CDATA text");
+      }
+      this.text = this.stringify.cdata(text);
+    }
+
+    XMLCData.prototype.clone = function() {
+      return Object.create(this);
+    };
+
+    XMLCData.prototype.toString = function(options) {
+      return this.options.writer.set(options).cdata(this);
+    };
+
+    return XMLCData;
+
+  })(XMLNode);
+
+}).call(this);
diff --git a/wrt/node_modules/xmlbuilder/lib/XMLComment.js b/wrt/node_modules/xmlbuilder/lib/XMLComment.js
new file mode 100644 (file)
index 0000000..3b8568f
--- /dev/null
@@ -0,0 +1,32 @@
+// Generated by CoffeeScript 1.12.6
+(function() {
+  var XMLComment, XMLNode,
+    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+    hasProp = {}.hasOwnProperty;
+
+  XMLNode = require('./XMLNode');
+
+  module.exports = XMLComment = (function(superClass) {
+    extend(XMLComment, superClass);
+
+    function XMLComment(parent, text) {
+      XMLComment.__super__.constructor.call(this, parent);
+      if (text == null) {
+        throw new Error("Missing comment text");
+      }
+      this.text = this.stringify.comment(text);
+    }
+
+    XMLComment.prototype.clone = function() {
+      return Object.create(this);
+    };
+
+    XMLComment.prototype.toString = function(options) {
+      return this.options.writer.set(options).comment(this);
+    };
+
+    return XMLComment;
+
+  })(XMLNode);
+
+}).call(this);
diff --git a/wrt/node_modules/xmlbuilder/lib/XMLDTDAttList.js b/wrt/node_modules/xmlbuilder/lib/XMLDTDAttList.js
new file mode 100644 (file)
index 0000000..9484f15
--- /dev/null
@@ -0,0 +1,50 @@
+// Generated by CoffeeScript 1.12.6
+(function() {
+  var XMLDTDAttList, XMLNode,
+    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+    hasProp = {}.hasOwnProperty;
+
+  XMLNode = require('./XMLNode');
+
+  module.exports = XMLDTDAttList = (function(superClass) {
+    extend(XMLDTDAttList, superClass);
+
+    function XMLDTDAttList(parent, elementName, attributeName, attributeType, defaultValueType, defaultValue) {
+      XMLDTDAttList.__super__.constructor.call(this, parent);
+      if (elementName == null) {
+        throw new Error("Missing DTD element name");
+      }
+      if (attributeName == null) {
+        throw new Error("Missing DTD attribute name");
+      }
+      if (!attributeType) {
+        throw new Error("Missing DTD attribute type");
+      }
+      if (!defaultValueType) {
+        throw new Error("Missing DTD attribute default");
+      }
+      if (defaultValueType.indexOf('#') !== 0) {
+        defaultValueType = '#' + defaultValueType;
+      }
+      if (!defaultValueType.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)) {
+        throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT");
+      }
+      if (defaultValue && !defaultValueType.match(/^(#FIXED|#DEFAULT)$/)) {
+        throw new Error("Default value only applies to #FIXED or #DEFAULT");
+      }
+      this.elementName = this.stringify.eleName(elementName);
+      this.attributeName = this.stringify.attName(attributeName);
+      this.attributeType = this.stringify.dtdAttType(attributeType);
+      this.defaultValue = this.stringify.dtdAttDefault(defaultValue);
+      this.defaultValueType = defaultValueType;
+    }
+
+    XMLDTDAttList.prototype.toString = function(options) {
+      return this.options.writer.set(options).dtdAttList(this);
+    };
+
+    return XMLDTDAttList;
+
+  })(XMLNode);
+
+}).call(this);
diff --git a/wrt/node_modules/xmlbuilder/lib/XMLDTDElement.js b/wrt/node_modules/xmlbuilder/lib/XMLDTDElement.js
new file mode 100644 (file)
index 0000000..e906861
--- /dev/null
@@ -0,0 +1,35 @@
+// Generated by CoffeeScript 1.12.6
+(function() {
+  var XMLDTDElement, XMLNode,
+    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+    hasProp = {}.hasOwnProperty;
+
+  XMLNode = require('./XMLNode');
+
+  module.exports = XMLDTDElement = (function(superClass) {
+    extend(XMLDTDElement, superClass);
+
+    function XMLDTDElement(parent, name, value) {
+      XMLDTDElement.__super__.constructor.call(this, parent);
+      if (name == null) {
+        throw new Error("Missing DTD element name");
+      }
+      if (!value) {
+        value = '(#PCDATA)';
+      }
+      if (Array.isArray(value)) {
+        value = '(' + value.join(',') + ')';
+      }
+      this.name = this.stringify.eleName(name);
+      this.value = this.stringify.dtdElementValue(value);
+    }
+
+    XMLDTDElement.prototype.toString = function(options) {
+      return this.options.writer.set(options).dtdElement(this);
+    };
+
+    return XMLDTDElement;
+
+  })(XMLNode);
+
+}).call(this);
diff --git a/wrt/node_modules/xmlbuilder/lib/XMLDTDEntity.js b/wrt/node_modules/xmlbuilder/lib/XMLDTDEntity.js
new file mode 100644 (file)
index 0000000..505f733
--- /dev/null
@@ -0,0 +1,56 @@
+// Generated by CoffeeScript 1.12.6
+(function() {
+  var XMLDTDEntity, XMLNode, isObject,
+    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+    hasProp = {}.hasOwnProperty;
+
+  isObject = require('./Utility').isObject;
+
+  XMLNode = require('./XMLNode');
+
+  module.exports = XMLDTDEntity = (function(superClass) {
+    extend(XMLDTDEntity, superClass);
+
+    function XMLDTDEntity(parent, pe, name, value) {
+      XMLDTDEntity.__super__.constructor.call(this, parent);
+      if (name == null) {
+        throw new Error("Missing entity name");
+      }
+      if (value == null) {
+        throw new Error("Missing entity value");
+      }
+      this.pe = !!pe;
+      this.name = this.stringify.eleName(name);
+      if (!isObject(value)) {
+        this.value = this.stringify.dtdEntityValue(value);
+      } else {
+        if (!value.pubID && !value.sysID) {
+          throw new Error("Public and/or system identifiers are required for an external entity");
+        }
+        if (value.pubID && !value.sysID) {
+          throw new Error("System identifier is required for a public external entity");
+        }
+        if (value.pubID != null) {
+          this.pubID = this.stringify.dtdPubID(value.pubID);
+        }
+        if (value.sysID != null) {
+          this.sysID = this.stringify.dtdSysID(value.sysID);
+        }
+        if (value.nData != null) {
+          this.nData = this.stringify.dtdNData(value.nData);
+        }
+        if (this.pe && this.nData) {
+          throw new Error("Notation declaration is not allowed in a parameter entity");
+        }
+      }
+    }
+
+    XMLDTDEntity.prototype.toString = function(options) {
+      return this.options.writer.set(options).dtdEntity(this);
+    };
+
+    return XMLDTDEntity;
+
+  })(XMLNode);
+
+}).call(this);
diff --git a/wrt/node_modules/xmlbuilder/lib/XMLDTDNotation.js b/wrt/node_modules/xmlbuilder/lib/XMLDTDNotation.js
new file mode 100644 (file)
index 0000000..b82f628
--- /dev/null
@@ -0,0 +1,37 @@
+// Generated by CoffeeScript 1.12.6
+(function() {
+  var XMLDTDNotation, XMLNode,
+    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+    hasProp = {}.hasOwnProperty;
+
+  XMLNode = require('./XMLNode');
+
+  module.exports = XMLDTDNotation = (function(superClass) {
+    extend(XMLDTDNotation, superClass);
+
+    function XMLDTDNotation(parent, name, value) {
+      XMLDTDNotation.__super__.constructor.call(this, parent);
+      if (name == null) {
+        throw new Error("Missing notation name");
+      }
+      if (!value.pubID && !value.sysID) {
+        throw new Error("Public or system identifiers are required for an external entity");
+      }
+      this.name = this.stringify.eleName(name);
+      if (value.pubID != null) {
+        this.pubID = this.stringify.dtdPubID(value.pubID);
+      }
+      if (value.sysID != null) {
+        this.sysID = this.stringify.dtdSysID(value.sysID);
+      }
+    }
+
+    XMLDTDNotation.prototype.toString = function(options) {
+      return this.options.writer.set(options).dtdNotation(this);
+    };
+
+    return XMLDTDNotation;
+
+  })(XMLNode);
+
+}).call(this);
diff --git a/wrt/node_modules/xmlbuilder/lib/XMLDeclaration.js b/wrt/node_modules/xmlbuilder/lib/XMLDeclaration.js
new file mode 100644 (file)
index 0000000..e24a803
--- /dev/null
@@ -0,0 +1,40 @@
+// Generated by CoffeeScript 1.12.6
+(function() {
+  var XMLDeclaration, XMLNode, isObject,
+    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+    hasProp = {}.hasOwnProperty;
+
+  isObject = require('./Utility').isObject;
+
+  XMLNode = require('./XMLNode');
+
+  module.exports = XMLDeclaration = (function(superClass) {
+    extend(XMLDeclaration, superClass);
+
+    function XMLDeclaration(parent, version, encoding, standalone) {
+      var ref;
+      XMLDeclaration.__super__.constructor.call(this, parent);
+      if (isObject(version)) {
+        ref = version, version = ref.version, encoding = ref.encoding, standalone = ref.standalone;
+      }
+      if (!version) {
+        version = '1.0';
+      }
+      this.version = this.stringify.xmlVersion(version);
+      if (encoding != null) {
+        this.encoding = this.stringify.xmlEncoding(encoding);
+      }
+      if (standalone != null) {
+        this.standalone = this.stringify.xmlStandalone(standalone);
+      }
+    }
+
+    XMLDeclaration.prototype.toString = function(options) {
+      return this.options.writer.set(options).declaration(this);
+    };
+
+    return XMLDeclaration;
+
+  })(XMLNode);
+
+}).call(this);
diff --git a/wrt/node_modules/xmlbuilder/lib/XMLDocType.js b/wrt/node_modules/xmlbuilder/lib/XMLDocType.js
new file mode 100644 (file)
index 0000000..b5e4536
--- /dev/null
@@ -0,0 +1,107 @@
+// Generated by CoffeeScript 1.12.6
+(function() {
+  var XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDocType, XMLNode, isObject,
+    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+    hasProp = {}.hasOwnProperty;
+
+  isObject = require('./Utility').isObject;
+
+  XMLNode = require('./XMLNode');
+
+  XMLDTDAttList = require('./XMLDTDAttList');
+
+  XMLDTDEntity = require('./XMLDTDEntity');
+
+  XMLDTDElement = require('./XMLDTDElement');
+
+  XMLDTDNotation = require('./XMLDTDNotation');
+
+  module.exports = XMLDocType = (function(superClass) {
+    extend(XMLDocType, superClass);
+
+    function XMLDocType(parent, pubID, sysID) {
+      var ref, ref1;
+      XMLDocType.__super__.constructor.call(this, parent);
+      this.documentObject = parent;
+      if (isObject(pubID)) {
+        ref = pubID, pubID = ref.pubID, sysID = ref.sysID;
+      }
+      if (sysID == null) {
+        ref1 = [pubID, sysID], sysID = ref1[0], pubID = ref1[1];
+      }
+      if (pubID != null) {
+        this.pubID = this.stringify.dtdPubID(pubID);
+      }
+      if (sysID != null) {
+        this.sysID = this.stringify.dtdSysID(sysID);
+      }
+    }
+
+    XMLDocType.prototype.element = function(name, value) {
+      var child;
+      child = new XMLDTDElement(this, name, value);
+      this.children.push(child);
+      return this;
+    };
+
+    XMLDocType.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
+      var child;
+      child = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue);
+      this.children.push(child);
+      return this;
+    };
+
+    XMLDocType.prototype.entity = function(name, value) {
+      var child;
+      child = new XMLDTDEntity(this, false, name, value);
+      this.children.push(child);
+      return this;
+    };
+
+    XMLDocType.prototype.pEntity = function(name, value) {
+      var child;
+      child = new XMLDTDEntity(this, true, name, value);
+      this.children.push(child);
+      return this;
+    };
+
+    XMLDocType.prototype.notation = function(name, value) {
+      var child;
+      child = new XMLDTDNotation(this, name, value);
+      this.children.push(child);
+      return this;
+    };
+
+    XMLDocType.prototype.toString = function(options) {
+      return this.options.writer.set(options).docType(this);
+    };
+
+    XMLDocType.prototype.ele = function(name, value) {
+      return this.element(name, value);
+    };
+
+    XMLDocType.prototype.att = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
+      return this.attList(elementName, attributeName, attributeType, defaultValueType, defaultValue);
+    };
+
+    XMLDocType.prototype.ent = function(name, value) {
+      return this.entity(name, value);
+    };
+
+    XMLDocType.prototype.pent = function(name, value) {
+      return this.pEntity(name, value);
+    };
+
+    XMLDocType.prototype.not = function(name, value) {
+      return this.notation(name, value);
+    };
+
+    XMLDocType.prototype.up = function() {
+      return this.root() || this.documentObject;
+    };
+
+    return XMLDocType;
+
+  })(XMLNode);
+
+}).call(this);
diff --git a/wrt/node_modules/xmlbuilder/lib/XMLDocument.js b/wrt/node_modules/xmlbuilder/lib/XMLDocument.js
new file mode 100644 (file)
index 0000000..a61cb8c
--- /dev/null
@@ -0,0 +1,48 @@
+// Generated by CoffeeScript 1.12.6
+(function() {
+  var XMLDocument, XMLNode, XMLStringWriter, XMLStringifier, isPlainObject,
+    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+    hasProp = {}.hasOwnProperty;
+
+  isPlainObject = require('./Utility').isPlainObject;
+
+  XMLNode = require('./XMLNode');
+
+  XMLStringifier = require('./XMLStringifier');
+
+  XMLStringWriter = require('./XMLStringWriter');
+
+  module.exports = XMLDocument = (function(superClass) {
+    extend(XMLDocument, superClass);
+
+    function XMLDocument(options) {
+      XMLDocument.__super__.constructor.call(this, null);
+      options || (options = {});
+      if (!options.writer) {
+        options.writer = new XMLStringWriter();
+      }
+      this.options = options;
+      this.stringify = new XMLStringifier(options);
+      this.isDocument = true;
+    }
+
+    XMLDocument.prototype.end = function(writer) {
+      var writerOptions;
+      if (!writer) {
+        writer = this.options.writer;
+      } else if (isPlainObject(writer)) {
+        writerOptions = writer;
+        writer = this.options.writer.set(writerOptions);
+      }
+      return writer.document(this);
+    };
+
+    XMLDocument.prototype.toString = function(options) {
+      return this.options.writer.set(options).document(this);
+    };
+
+    return XMLDocument;
+
+  })(XMLNode);
+
+}).call(this);
diff --git a/wrt/node_modules/xmlbuilder/lib/XMLDocumentCB.js b/wrt/node_modules/xmlbuilder/lib/XMLDocumentCB.js
new file mode 100644 (file)
index 0000000..71528f3
--- /dev/null
@@ -0,0 +1,402 @@
+// Generated by CoffeeScript 1.12.6
+(function() {
+  var XMLAttribute, XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDocumentCB, XMLElement, XMLProcessingInstruction, XMLRaw, XMLStringWriter, XMLStringifier, XMLText, isFunction, isObject, isPlainObject, ref,
+    hasProp = {}.hasOwnProperty;
+
+  ref = require('./Utility'), isObject = ref.isObject, isFunction = ref.isFunction, isPlainObject = ref.isPlainObject;
+
+  XMLElement = require('./XMLElement');
+
+  XMLCData = require('./XMLCData');
+
+  XMLComment = require('./XMLComment');
+
+  XMLRaw = require('./XMLRaw');
+
+  XMLText = require('./XMLText');
+
+  XMLProcessingInstruction = require('./XMLProcessingInstruction');
+
+  XMLDeclaration = require('./XMLDeclaration');
+
+  XMLDocType = require('./XMLDocType');
+
+  XMLDTDAttList = require('./XMLDTDAttList');
+
+  XMLDTDEntity = require('./XMLDTDEntity');
+
+  XMLDTDElement = require('./XMLDTDElement');
+
+  XMLDTDNotation = require('./XMLDTDNotation');
+
+  XMLAttribute = require('./XMLAttribute');
+
+  XMLStringifier = require('./XMLStringifier');
+
+  XMLStringWriter = require('./XMLStringWriter');
+
+  module.exports = XMLDocumentCB = (function() {
+    function XMLDocumentCB(options, onData, onEnd) {
+      var writerOptions;
+      options || (options = {});
+      if (!options.writer) {
+        options.writer = new XMLStringWriter(options);
+      } else if (isPlainObject(options.writer)) {
+        writerOptions = options.writer;
+        options.writer = new XMLStringWriter(writerOptions);
+      }
+      this.options = options;
+      this.writer = options.writer;
+      this.stringify = new XMLStringifier(options);
+      this.onDataCallback = onData || function() {};
+      this.onEndCallback = onEnd || function() {};
+      this.currentNode = null;
+      this.currentLevel = -1;
+      this.openTags = {};
+      this.documentStarted = false;
+      this.documentCompleted = false;
+      this.root = null;
+    }
+
+    XMLDocumentCB.prototype.node = function(name, attributes, text) {
+      var ref1;
+      if (name == null) {
+        throw new Error("Missing node name");
+      }
+      if (this.root && this.currentLevel === -1) {
+        throw new Error("Document can only have one root node");
+      }
+      this.openCurrent();
+      name = name.valueOf();
+      if (attributes == null) {
+        attributes = {};
+      }
+      attributes = attributes.valueOf();
+      if (!isObject(attributes)) {
+        ref1 = [attributes, text], text = ref1[0], attributes = ref1[1];
+      }
+      this.currentNode = new XMLElement(this, name, attributes);
+      this.currentNode.children = false;
+      this.currentLevel++;
+      this.openTags[this.currentLevel] = this.currentNode;
+      if (text != null) {
+        this.text(text);
+      }
+      return this;
+    };
+
+    XMLDocumentCB.prototype.element = function(name, attributes, text) {
+      if (this.currentNode && this.currentNode instanceof XMLDocType) {
+        return this.dtdElement.apply(this, arguments);
+      } else {
+        return this.node(name, attributes, text);
+      }
+    };
+
+    XMLDocumentCB.prototype.attribute = function(name, value) {
+      var attName, attValue;
+      if (!this.currentNode || this.currentNode.children) {
+        throw new Error("att() can only be used immediately after an ele() call in callback mode");
+      }
+      if (name != null) {
+        name = name.valueOf();
+      }
+      if (isObject(name)) {
+        for (attName in name) {
+          if (!hasProp.call(name, attName)) continue;
+          attValue = name[attName];
+          this.attribute(attName, attValue);
+        }
+      } else {
+        if (isFunction(value)) {
+          value = value.apply();
+        }
+        if (!this.options.skipNullAttributes || (value != null)) {
+          this.currentNode.attributes[name] = new XMLAttribute(this, name, value);
+        }
+      }
+      return this;
+    };
+
+    XMLDocumentCB.prototype.text = function(value) {
+      var node;
+      this.openCurrent();
+      node = new XMLText(this, value);
+      this.onData(this.writer.text(node, this.currentLevel + 1));
+      return this;
+    };
+
+    XMLDocumentCB.prototype.cdata = function(value) {
+      var node;
+      this.openCurrent();
+      node = new XMLCData(this, value);
+      this.onData(this.writer.cdata(node, this.currentLevel + 1));
+      return this;
+    };
+
+    XMLDocumentCB.prototype.comment = function(value) {
+      var node;
+      this.openCurrent();
+      node = new XMLComment(this, value);
+      this.onData(this.writer.comment(node, this.currentLevel + 1));
+      return this;
+    };
+
+    XMLDocumentCB.prototype.raw = function(value) {
+      var node;
+      this.openCurrent();
+      node = new XMLRaw(this, value);
+      this.onData(this.writer.raw(node, this.currentLevel + 1));
+      return this;
+    };
+
+    XMLDocumentCB.prototype.instruction = function(target, value) {
+      var i, insTarget, insValue, len, node;
+      this.openCurrent();
+      if (target != null) {
+        target = target.valueOf();
+      }
+      if (value != null) {
+        value = value.valueOf();
+      }
+      if (Array.isArray(target)) {
+        for (i = 0, len = target.length; i < len; i++) {
+          insTarget = target[i];
+          this.instruction(insTarget);
+        }
+      } else if (isObject(target)) {
+        for (insTarget in target) {
+          if (!hasProp.call(target, insTarget)) continue;
+          insValue = target[insTarget];
+          this.instruction(insTarget, insValue);
+        }
+      } else {
+        if (isFunction(value)) {
+          value = value.apply();
+        }
+        node = new XMLProcessingInstruction(this, target, value);
+        this.onData(this.writer.processingInstruction(node, this.currentLevel + 1));
+      }
+      return this;
+    };
+
+    XMLDocumentCB.prototype.declaration = function(version, encoding, standalone) {
+      var node;
+      this.openCurrent();
+      if (this.documentStarted) {
+        throw new Error("declaration() must be the first node");
+      }
+      node = new XMLDeclaration(this, version, encoding, standalone);
+      this.onData(this.writer.declaration(node, this.currentLevel + 1));
+      return this;
+    };
+
+    XMLDocumentCB.prototype.doctype = function(root, pubID, sysID) {
+      this.openCurrent();
+      if (root == null) {
+        throw new Error("Missing root node name");
+      }
+      if (this.root) {
+        throw new Error("dtd() must come before the root node");
+      }
+      this.currentNode = new XMLDocType(this, pubID, sysID);
+      this.currentNode.rootNodeName = root;
+      this.currentNode.children = false;
+      this.currentLevel++;
+      this.openTags[this.currentLevel] = this.currentNode;
+      return this;
+    };
+
+    XMLDocumentCB.prototype.dtdElement = function(name, value) {
+      var node;
+      this.openCurrent();
+      node = new XMLDTDElement(this, name, value);
+      this.onData(this.writer.dtdElement(node, this.currentLevel + 1));
+      return this;
+    };
+
+    XMLDocumentCB.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) {
+      var node;
+      this.openCurrent();
+      node = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue);
+      this.onData(this.writer.dtdAttList(node, this.currentLevel + 1));
+      return this;
+    };
+
+    XMLDocumentCB.prototype.entity = function(name, value) {
+      var node;
+      this.openCurrent();
+      node = new XMLDTDEntity(this, false, name, value);
+      this.onData(this.writer.dtdEntity(node, this.currentLevel + 1));
+      return this;
+    };
+
+    XMLDocumentCB.prototype.pEntity = function(name, value) {
+      var node;
+      this.openCurrent();
+      node = new XMLDTDEntity(this, true, name, value);
+      this.onData(this.writer.dtdEntity(node, this.currentLevel + 1));
+      return this;
+    };
+
+    XMLDocumentCB.prototype.notation = function(name, value) {
+      var node;
+      this.openCurrent();
+      node = new XMLDTDNotation(this, name, value);
+      this.onData(this.writer.dtdNotation(node, this.currentLevel + 1));
+      return this;
+    };
+
+    XMLDocumentCB.prototype.up = function() {
+      if (this.currentLevel < 0) {
+        throw new Error("The document node has no parent");
+      }
+      if (this.currentNode) {
+        if (this.currentNode.children) {
+          this.closeNode(this.currentNode);
+        } else {
+          this.openNode(this.currentNode);
+        }
+        this.currentNode = null;
+      } else {
+        this.closeNode(this.openTags[this.currentLevel]);
+      }
+      delete this.openTags[this.currentLevel];
+      this.currentLevel--;
+      return this;
+    };
+
+    XMLDocumentCB.prototype.end = function() {
+      while (this.currentLevel >= 0) {
+        this.up();
+      }
+      return this.onEnd();
+    };
+
+    XMLDocumentCB.prototype.openCurrent = function() {
+      if (this.currentNode) {
+        this.currentNode.children = true;
+        return this.openNode(this.currentNode);
+      }
+    };
+
+    XMLDocumentCB.prototype.openNode = function(node) {
+      if (!node.isOpen) {
+        if (!this.root && this.currentLevel === 0 && node instanceof XMLElement) {
+          this.root = node;
+        }
+        this.onData(this.writer.openNode(node, this.currentLevel));
+        return node.isOpen = true;
+      }
+    };
+
+    XMLDocumentCB.prototype.closeNode = function(node) {
+      if (!node.isClosed) {
+        this.onData(this.writer.closeNode(node, this.currentLevel));
+        return node.isClosed = true;
+      }
+    };
+
+    XMLDocumentCB.prototype.onData = function(chunk) {
+      this.documentStarted = true;
+      return this.onDataCallback(chunk);
+    };
+
+    XMLDocumentCB.prototype.onEnd = function() {
+      this.documentCompleted = true;
+      return this.onEndCallback();
+    };
+
+    XMLDocumentCB.prototype.ele = function() {
+      return this.element.apply(this, arguments);
+    };
+
+    XMLDocumentCB.prototype.nod = function(name, attributes, text) {
+      return this.node(name, attributes, text);
+    };
+
+    XMLDocumentCB.prototype.txt = function(value) {
+      return this.text(value);
+    };
+
+    XMLDocumentCB.prototype.dat = function(value) {
+      return this.cdata(value);
+    };
+
+    XMLDocumentCB.prototype.com = function(value) {
+      return this.comment(value);
+    };
+
+    XMLDocumentCB.prototype.ins = function(target, value) {
+      return this.instruction(target, value);
+    };
+
+    XMLDocumentCB.prototype.dec = function(version, encoding, standalone) {
+      return this.declaration(version, encoding, standalone);
+    };
+
+    XMLDocumentCB.prototype.dtd = function(root, pubID, sysID) {
+      return this.doctype(root, pubID, sysID);
+    };
+
+    XMLDocumentCB.prototype.e = function(name, attributes, text) {
+      return this.element(name, attributes, text);
+    };
+
+    XMLDocumentCB.prototype.n = function(name, attributes, text) {
+      return this.node(name, attributes, text);
+    };
+
+    XMLDocumentCB.prototype.t = function(value) {
+      return this.text(value);
+    };
+
+    XMLDocumentCB.prototype.d = function(value) {
+      return this.cdata(value);
+    };
+
+    XMLDocumentCB.prototype.c = function(value) {
+      return this.comment(value);
+    };
+
+    XMLDocumentCB.prototype.r = function(value) {
+      return this.raw(value);
+    };
+
+    XMLDocumentCB.prototype.i = function(target, value) {
+      return this.instruction(target, value);
+    };
+
+    XMLDocumentCB.prototype.att = function() {
+      if (this.currentNode && this.currentNode instanceof XMLDocType) {
+        return this.attList.apply(this, arguments);
+      } else {
+        return this.attribute.apply(this, arguments);
+      }
+    };
+
+    XMLDocumentCB.prototype.a = function() {
+      if (this.currentNode && this.currentNode instanceof XMLDocType) {
+        return this.attList.apply(this, arguments);
+      } else {
+        return this.attribute.apply(this, arguments);
+      }
+    };
+
+    XMLDocumentCB.prototype.ent = function(name, value) {
+      return this.entity(name, value);
+    };
+
+    XMLDocumentCB.prototype.pent = function(name, value) {
+      return this.pEntity(name, value);
+    };
+
+    XMLDocumentCB.prototype.not = function(name, value) {
+      return this.notation(name, value);
+    };
+
+    return XMLDocumentCB;
+
+  })();
+
+}).call(this);
diff --git a/wrt/node_modules/xmlbuilder/lib/XMLElement.js b/wrt/node_modules/xmlbuilder/lib/XMLElement.js
new file mode 100644 (file)
index 0000000..f388fe6
--- /dev/null
@@ -0,0 +1,111 @@
+// Generated by CoffeeScript 1.12.6
+(function() {
+  var XMLAttribute, XMLElement, XMLNode, isFunction, isObject, ref,
+    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+    hasProp = {}.hasOwnProperty;
+
+  ref = require('./Utility'), isObject = ref.isObject, isFunction = ref.isFunction;
+
+  XMLNode = require('./XMLNode');
+
+  XMLAttribute = require('./XMLAttribute');
+
+  module.exports = XMLElement = (function(superClass) {
+    extend(XMLElement, superClass);
+
+    function XMLElement(parent, name, attributes) {
+      XMLElement.__super__.constructor.call(this, parent);
+      if (name == null) {
+        throw new Error("Missing element name");
+      }
+      this.name = this.stringify.eleName(name);
+      this.attributes = {};
+      if (attributes != null) {
+        this.attribute(attributes);
+      }
+      if (parent.isDocument) {
+        this.isRoot = true;
+        this.documentObject = parent;
+        parent.rootObject = this;
+      }
+    }
+
+    XMLElement.prototype.clone = function() {
+      var att, attName, clonedSelf, ref1;
+      clonedSelf = Object.create(this);
+      if (clonedSelf.isRoot) {
+        clonedSelf.documentObject = null;
+      }
+      clonedSelf.attributes = {};
+      ref1 = this.attributes;
+      for (attName in ref1) {
+        if (!hasProp.call(ref1, attName)) continue;
+        att = ref1[attName];
+        clonedSelf.attributes[attName] = att.clone();
+      }
+      clonedSelf.children = [];
+      this.children.forEach(function(child) {
+        var clonedChild;
+        clonedChild = child.clone();
+        clonedChild.parent = clonedSelf;
+        return clonedSelf.children.push(clonedChild);
+      });
+      return clonedSelf;
+    };
+
+    XMLElement.prototype.attribute = function(name, value) {
+      var attName, attValue;
+      if (name != null) {
+        name = name.valueOf();
+      }
+      if (isObject(name)) {
+        for (attName in name) {
+          if (!hasProp.call(name, attName)) continue;
+          attValue = name[attName];
+          this.attribute(attName, attValue);
+        }
+      } else {
+        if (isFunction(value)) {
+          value = value.apply();
+        }
+        if (!this.options.skipNullAttributes || (value != null)) {
+          this.attributes[name] = new XMLAttribute(this, name, value);
+        }
+      }
+      return this;
+    };
+
+    XMLElement.prototype.removeAttribute = function(name) {
+      var attName, i, len;
+      if (name == null) {
+        throw new Error("Missing attribute name");
+      }
+      name = name.valueOf();
+      if (Array.isArray(name)) {
+        for (i = 0, len = name.length; i < len; i++) {
+          attName = name[i];
+          delete this.attributes[attName];
+        }
+      } else {
+        delete this.attributes[name];
+      }
+      return this;
+    };
+
+    XMLElement.prototype.toString = function(options) {
+      return this.options.writer.set(options).element(this);
+    };
+
+    XMLElement.prototype.att = function(name, value) {
+      return this.attribute(name, value);
+    };
+
+    XMLElement.prototype.a = function(name, value) {
+      return this.attribute(name, value);
+    };
+
+    return XMLElement;
+
+  })(XMLNode);
+
+}).call(this);
diff --git a/wrt/node_modules/xmlbuilder/lib/XMLNode.js b/wrt/node_modules/xmlbuilder/lib/XMLNode.js
new file mode 100644 (file)
index 0000000..96215b8
--- /dev/null
@@ -0,0 +1,432 @@
+// Generated by CoffeeScript 1.12.6
+(function() {
+  var XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLElement, XMLNode, XMLProcessingInstruction, XMLRaw, XMLText, isEmpty, isFunction, isObject, ref,
+    hasProp = {}.hasOwnProperty;
+
+  ref = require('./Utility'), isObject = ref.isObject, isFunction = ref.isFunction, isEmpty = ref.isEmpty;
+
+  XMLElement = null;
+
+  XMLCData = null;
+
+  XMLComment = null;
+
+  XMLDeclaration = null;
+
+  XMLDocType = null;
+
+  XMLRaw = null;
+
+  XMLText = null;
+
+  XMLProcessingInstruction = null;
+
+  module.exports = XMLNode = (function() {
+    function XMLNode(parent) {
+      this.parent = parent;
+      if (this.parent) {
+        this.options = this.parent.options;
+        this.stringify = this.parent.stringify;
+      }
+      this.children = [];
+      if (!XMLElement) {
+        XMLElement = require('./XMLElement');
+        XMLCData = require('./XMLCData');
+        XMLComment = require('./XMLComment');
+        XMLDeclaration = require('./XMLDeclaration');
+        XMLDocType = require('./XMLDocType');
+        XMLRaw = require('./XMLRaw');
+        XMLText = require('./XMLText');
+        XMLProcessingInstruction = require('./XMLProcessingInstruction');
+      }
+    }
+
+    XMLNode.prototype.element = function(name, attributes, text) {
+      var childNode, item, j, k, key, lastChild, len, len1, ref1, val;
+      lastChild = null;
+      if (attributes == null) {
+        attributes = {};
+      }
+      attributes = attributes.valueOf();
+      if (!isObject(attributes)) {
+        ref1 = [attributes, text], text = ref1[0], attributes = ref1[1];
+      }
+      if (name != null) {
+        name = name.valueOf();
+      }
+      if (Array.isArray(name)) {
+        for (j = 0, len = name.length; j < len; j++) {
+          item = name[j];
+          lastChild = this.element(item);
+        }
+      } else if (isFunction(name)) {
+        lastChild = this.element(name.apply());
+      } else if (isObject(name)) {
+        for (key in name) {
+          if (!hasProp.call(name, key)) continue;
+          val = name[key];
+          if (isFunction(val)) {
+            val = val.apply();
+          }
+          if ((isObject(val)) && (isEmpty(val))) {
+            val = null;
+          }
+          if (!this.options.ignoreDecorators && this.stringify.convertAttKey && key.indexOf(this.stringify.convertAttKey) === 0) {
+            lastChild = this.attribute(key.substr(this.stringify.convertAttKey.length), val);
+          } else if (!this.options.separateArrayItems && Array.isArray(val)) {
+            for (k = 0, len1 = val.length; k < len1; k++) {
+              item = val[k];
+              childNode = {};
+              childNode[key] = item;
+              lastChild = this.element(childNode);
+            }
+          } else if (isObject(val)) {
+            lastChild = this.element(key);
+            lastChild.element(val);
+          } else {
+            lastChild = this.element(key, val);
+          }
+        }
+      } else {
+        if (!this.options.ignoreDecorators && this.stringify.convertTextKey && name.indexOf(this.stringify.convertTextKey) === 0) {
+          lastChild = this.text(text);
+        } else if (!this.options.ignoreDecorators && this.stringify.convertCDataKey && name.indexOf(this.stringify.convertCDataKey) === 0) {
+          lastChild = this.cdata(text);
+        } else if (!this.options.ignoreDecorators && this.stringify.convertCommentKey && name.indexOf(this.stringify.convertCommentKey) === 0) {
+          lastChild = this.comment(text);
+        } else if (!this.options.ignoreDecorators && this.stringify.convertRawKey && name.indexOf(this.stringify.convertRawKey) === 0) {
+          lastChild = this.raw(text);
+        } else if (!this.options.ignoreDecorators && this.stringify.convertPIKey && name.indexOf(this.stringify.convertPIKey) === 0) {
+          lastChild = this.instruction(name.substr(this.stringify.convertPIKey.length), text);
+        } else {
+          lastChild = this.node(name, attributes, text);
+        }
+      }
+      if (lastChild == null) {
+        throw new Error("Could not create any elements with: " + name);
+      }
+      return lastChild;
+    };
+
+    XMLNode.prototype.insertBefore = function(name, attributes, text) {
+      var child, i, removed;
+      if (this.isRoot) {
+        throw new Error("Cannot insert elements at root level");
+      }
+      i = this.parent.children.indexOf(this);
+      removed = this.parent.children.splice(i);
+      child = this.parent.element(name, attributes, text);
+      Array.prototype.push.apply(this.parent.children, removed);
+      return child;
+    };
+
+    XMLNode.prototype.insertAfter = function(name, attributes, text) {
+      var child, i, removed;
+      if (this.isRoot) {
+        throw new Error("Cannot insert elements at root level");
+      }
+      i = this.parent.children.indexOf(this);
+      removed = this.parent.children.splice(i + 1);
+      child = this.parent.element(name, attributes, text);
+      Array.prototype.push.apply(this.parent.children, removed);
+      return child;
+    };
+
+    XMLNode.prototype.remove = function() {
+      var i, ref1;
+      if (this.isRoot) {
+        throw new Error("Cannot remove the root element");
+      }
+      i = this.parent.children.indexOf(this);
+      [].splice.apply(this.parent.children, [i, i - i + 1].concat(ref1 = [])), ref1;
+      return this.parent;
+    };
+
+    XMLNode.prototype.node = function(name, attributes, text) {
+      var child, ref1;
+      if (name != null) {
+        name = name.valueOf();
+      }
+      attributes || (attributes = {});
+      attributes = attributes.valueOf();
+      if (!isObject(attributes)) {
+        ref1 = [attributes, text], text = ref1[0], attributes = ref1[1];
+      }
+      child = new XMLElement(this, name, attributes);
+      if (text != null) {
+        child.text(text);
+      }
+      this.children.push(child);
+      return child;
+    };
+
+    XMLNode.prototype.text = function(value) {
+      var child;
+      child = new XMLText(this, value);
+      this.children.push(child);
+      return this;
+    };
+
+    XMLNode.prototype.cdata = function(value) {
+      var child;
+      child = new XMLCData(this, value);
+      this.children.push(child);
+      return this;
+    };
+
+    XMLNode.prototype.comment = function(value) {
+      var child;
+      child = new XMLComment(this, value);
+      this.children.push(child);
+      return this;
+    };
+
+    XMLNode.prototype.commentBefore = function(value) {
+      var child, i, removed;
+      i = this.parent.children.indexOf(this);
+      removed = this.parent.children.splice(i);
+      child = this.parent.comment(value);
+      Array.prototype.push.apply(this.parent.children, removed);
+      return this;
+    };
+
+    XMLNode.prototype.commentAfter = function(value) {
+      var child, i, removed;
+      i = this.parent.children.indexOf(this);
+      removed = this.parent.children.splice(i + 1);
+      child = this.parent.comment(value);
+      Array.prototype.push.apply(this.parent.children, removed);
+      return this;
+    };
+
+    XMLNode.prototype.raw = function(value) {
+      var child;
+      child = new XMLRaw(this, value);
+      this.children.push(child);
+      return this;
+    };
+
+    XMLNode.prototype.instruction = function(target, value) {
+      var insTarget, insValue, instruction, j, len;
+      if (target != null) {
+        target = target.valueOf();
+      }
+      if (value != null) {
+        value = value.valueOf();
+      }
+      if (Array.isArray(target)) {
+        for (j = 0, len = target.length; j < len; j++) {
+          insTarget = target[j];
+          this.instruction(insTarget);
+        }
+      } else if (isObject(target)) {
+        for (insTarget in target) {
+          if (!hasProp.call(target, insTarget)) continue;
+          insValue = target[insTarget];
+          this.instruction(insTarget, insValue);
+        }
+      } else {
+        if (isFunction(value)) {
+          value = value.apply();
+        }
+        instruction = new XMLProcessingInstruction(this, target, value);
+        this.children.push(instruction);
+      }
+      return this;
+    };
+
+    XMLNode.prototype.instructionBefore = function(target, value) {
+      var child, i, removed;
+      i = this.parent.children.indexOf(this);
+      removed = this.parent.children.splice(i);
+      child = this.parent.instruction(target, value);
+      Array.prototype.push.apply(this.parent.children, removed);
+      return this;
+    };
+
+    XMLNode.prototype.instructionAfter = function(target, value) {
+      var child, i, removed;
+      i = this.parent.children.indexOf(this);
+      removed = this.parent.children.splice(i + 1);
+      child = this.parent.instruction(target, value);
+      Array.prototype.push.apply(this.parent.children, removed);
+      return this;
+    };
+
+    XMLNode.prototype.declaration = function(version, encoding, standalone) {
+      var doc, xmldec;
+      doc = this.document();
+      xmldec = new XMLDeclaration(doc, version, encoding, standalone);
+      if (doc.children[0] instanceof XMLDeclaration) {
+        doc.children[0] = xmldec;
+      } else {
+        doc.children.unshift(xmldec);
+      }
+      return doc.root() || doc;
+    };
+
+    XMLNode.prototype.doctype = function(pubID, sysID) {
+      var child, doc, doctype, i, j, k, len, len1, ref1, ref2;
+      doc = this.document();
+      doctype = new XMLDocType(doc, pubID, sysID);
+      ref1 = doc.children;
+      for (i = j = 0, len = ref1.length; j < len; i = ++j) {
+        child = ref1[i];
+        if (child instanceof XMLDocType) {
+          doc.children[i] = doctype;
+          return doctype;
+        }
+      }
+      ref2 = doc.children;
+      for (i = k = 0, len1 = ref2.length; k < len1; i = ++k) {
+        child = ref2[i];
+        if (child.isRoot) {
+          doc.children.splice(i, 0, doctype);
+          return doctype;
+        }
+      }
+      doc.children.push(doctype);
+      return doctype;
+    };
+
+    XMLNode.prototype.up = function() {
+      if (this.isRoot) {
+        throw new Error("The root node has no parent. Use doc() if you need to get the document object.");
+      }
+      return this.parent;
+    };
+
+    XMLNode.prototype.root = function() {
+      var node;
+      node = this;
+      while (node) {
+        if (node.isDocument) {
+          return node.rootObject;
+        } else if (node.isRoot) {
+          return node;
+        } else {
+          node = node.parent;
+        }
+      }
+    };
+
+    XMLNode.prototype.document = function() {
+      var node;
+      node = this;
+      while (node) {
+        if (node.isDocument) {
+          return node;
+        } else {
+          node = node.parent;
+        }
+      }
+    };
+
+    XMLNode.prototype.end = function(options) {
+      return this.document().end(options);
+    };
+
+    XMLNode.prototype.prev = function() {
+      var i;
+      i = this.parent.children.indexOf(this);
+      if (i < 1) {
+        throw new Error("Already at the first node");
+      }
+      return this.parent.children[i - 1];
+    };
+
+    XMLNode.prototype.next = function() {
+      var i;
+      i = this.parent.children.indexOf(this);
+      if (i === -1 || i === this.parent.children.length - 1) {
+        throw new Error("Already at the last node");
+      }
+      return this.parent.children[i + 1];
+    };
+
+    XMLNode.prototype.importDocument = function(doc) {
+      var clonedRoot;
+      clonedRoot = doc.root().clone();
+      clonedRoot.parent = this;
+      clonedRoot.isRoot = false;
+      this.children.push(clonedRoot);
+      return this;
+    };
+
+    XMLNode.prototype.ele = function(name, attributes, text) {
+      return this.element(name, attributes, text);
+    };
+
+    XMLNode.prototype.nod = function(name, attributes, text) {
+      return this.node(name, attributes, text);
+    };
+
+    XMLNode.prototype.txt = function(value) {
+      return this.text(value);
+    };
+
+    XMLNode.prototype.dat = function(value) {
+      return this.cdata(value);
+    };
+
+    XMLNode.prototype.com = function(value) {
+      return this.comment(value);
+    };
+
+    XMLNode.prototype.ins = function(target, value) {
+      return this.instruction(target, value);
+    };
+
+    XMLNode.prototype.doc = function() {
+      return this.document();
+    };
+
+    XMLNode.prototype.dec = function(version, encoding, standalone) {
+      return this.declaration(version, encoding, standalone);
+    };
+
+    XMLNode.prototype.dtd = function(pubID, sysID) {
+      return this.doctype(pubID, sysID);
+    };
+
+    XMLNode.prototype.e = function(name, attributes, text) {
+      return this.element(name, attributes, text);
+    };
+
+    XMLNode.prototype.n = function(name, attributes, text) {
+      return this.node(name, attributes, text);
+    };
+
+    XMLNode.prototype.t = function(value) {
+      return this.text(value);
+    };
+
+    XMLNode.prototype.d = function(value) {
+      return this.cdata(value);
+    };
+
+    XMLNode.prototype.c = function(value) {
+      return this.comment(value);
+    };
+
+    XMLNode.prototype.r = function(value) {
+      return this.raw(value);
+    };
+
+    XMLNode.prototype.i = function(target, value) {
+      return this.instruction(target, value);
+    };
+
+    XMLNode.prototype.u = function() {
+      return this.up();
+    };
+
+    XMLNode.prototype.importXMLBuilder = function(doc) {
+      return this.importDocument(doc);
+    };
+
+    return XMLNode;
+
+  })();
+
+}).call(this);
diff --git a/wrt/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js b/wrt/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js
new file mode 100644 (file)
index 0000000..0f3b9ec
--- /dev/null
@@ -0,0 +1,35 @@
+// Generated by CoffeeScript 1.12.6
+(function() {
+  var XMLNode, XMLProcessingInstruction,
+    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+    hasProp = {}.hasOwnProperty;
+
+  XMLNode = require('./XMLNode');
+
+  module.exports = XMLProcessingInstruction = (function(superClass) {
+    extend(XMLProcessingInstruction, superClass);
+
+    function XMLProcessingInstruction(parent, target, value) {
+      XMLProcessingInstruction.__super__.constructor.call(this, parent);
+      if (target == null) {
+        throw new Error("Missing instruction target");
+      }
+      this.target = this.stringify.insTarget(target);
+      if (value) {
+        this.value = this.stringify.insValue(value);
+      }
+    }
+
+    XMLProcessingInstruction.prototype.clone = function() {
+      return Object.create(this);
+    };
+
+    XMLProcessingInstruction.prototype.toString = function(options) {
+      return this.options.writer.set(options).processingInstruction(this);
+    };
+
+    return XMLProcessingInstruction;
+
+  })(XMLNode);
+
+}).call(this);
diff --git a/wrt/node_modules/xmlbuilder/lib/XMLRaw.js b/wrt/node_modules/xmlbuilder/lib/XMLRaw.js
new file mode 100644 (file)
index 0000000..0957ebb
--- /dev/null
@@ -0,0 +1,32 @@
+// Generated by CoffeeScript 1.12.6
+(function() {
+  var XMLNode, XMLRaw,
+    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+    hasProp = {}.hasOwnProperty;
+
+  XMLNode = require('./XMLNode');
+
+  module.exports = XMLRaw = (function(superClass) {
+    extend(XMLRaw, superClass);
+
+    function XMLRaw(parent, text) {
+      XMLRaw.__super__.constructor.call(this, parent);
+      if (text == null) {
+        throw new Error("Missing raw text");
+      }
+      this.value = this.stringify.raw(text);
+    }
+
+    XMLRaw.prototype.clone = function() {
+      return Object.create(this);
+    };
+
+    XMLRaw.prototype.toString = function(options) {
+      return this.options.writer.set(options).raw(this);
+    };
+
+    return XMLRaw;
+
+  })(XMLNode);
+
+}).call(this);
diff --git a/wrt/node_modules/xmlbuilder/lib/XMLStreamWriter.js b/wrt/node_modules/xmlbuilder/lib/XMLStreamWriter.js
new file mode 100644 (file)
index 0000000..5e33226
--- /dev/null
@@ -0,0 +1,279 @@
+// Generated by CoffeeScript 1.12.6
+(function() {
+  var XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLElement, XMLProcessingInstruction, XMLRaw, XMLStreamWriter, XMLText, XMLWriterBase,
+    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+    hasProp = {}.hasOwnProperty;
+
+  XMLDeclaration = require('./XMLDeclaration');
+
+  XMLDocType = require('./XMLDocType');
+
+  XMLCData = require('./XMLCData');
+
+  XMLComment = require('./XMLComment');
+
+  XMLElement = require('./XMLElement');
+
+  XMLRaw = require('./XMLRaw');
+
+  XMLText = require('./XMLText');
+
+  XMLProcessingInstruction = require('./XMLProcessingInstruction');
+
+  XMLDTDAttList = require('./XMLDTDAttList');
+
+  XMLDTDElement = require('./XMLDTDElement');
+
+  XMLDTDEntity = require('./XMLDTDEntity');
+
+  XMLDTDNotation = require('./XMLDTDNotation');
+
+  XMLWriterBase = require('./XMLWriterBase');
+
+  module.exports = XMLStreamWriter = (function(superClass) {
+    extend(XMLStreamWriter, superClass);
+
+    function XMLStreamWriter(stream, options) {
+      this.stream = stream;
+      XMLStreamWriter.__super__.constructor.call(this, options);
+    }
+
+    XMLStreamWriter.prototype.document = function(doc) {
+      var child, i, j, len, len1, ref, ref1, results;
+      ref = doc.children;
+      for (i = 0, len = ref.length; i < len; i++) {
+        child = ref[i];
+        child.isLastRootNode = false;
+      }
+      doc.children[doc.children.length - 1].isLastRootNode = true;
+      ref1 = doc.children;
+      results = [];
+      for (j = 0, len1 = ref1.length; j < len1; j++) {
+        child = ref1[j];
+        switch (false) {
+          case !(child instanceof XMLDeclaration):
+            results.push(this.declaration(child));
+            break;
+          case !(child instanceof XMLDocType):
+            results.push(this.docType(child));
+            break;
+          case !(child instanceof XMLComment):
+            results.push(this.comment(child));
+            break;
+          case !(child instanceof XMLProcessingInstruction):
+            results.push(this.processingInstruction(child));
+            break;
+          default:
+            results.push(this.element(child));
+        }
+      }
+      return results;
+    };
+
+    XMLStreamWriter.prototype.attribute = function(att) {
+      return this.stream.write(' ' + att.name + '="' + att.value + '"');
+    };
+
+    XMLStreamWriter.prototype.cdata = function(node, level) {
+      return this.stream.write(this.space(level) + '<![CDATA[' + node.text + ']]>' + this.endline(node));
+    };
+
+    XMLStreamWriter.prototype.comment = function(node, level) {
+      return this.stream.write(this.space(level) + '<!-- ' + node.text + ' -->' + this.endline(node));
+    };
+
+    XMLStreamWriter.prototype.declaration = function(node, level) {
+      this.stream.write(this.space(level));
+      this.stream.write('<?xml version="' + node.version + '"');
+      if (node.encoding != null) {
+        this.stream.write(' encoding="' + node.encoding + '"');
+      }
+      if (node.standalone != null) {
+        this.stream.write(' standalone="' + node.standalone + '"');
+      }
+      this.stream.write(this.spacebeforeslash + '?>');
+      return this.stream.write(this.endline(node));
+    };
+
+    XMLStreamWriter.prototype.docType = function(node, level) {
+      var child, i, len, ref;
+      level || (level = 0);
+      this.stream.write(this.space(level));
+      this.stream.write('<!DOCTYPE ' + node.root().name);
+      if (node.pubID && node.sysID) {
+        this.stream.write(' PUBLIC "' + node.pubID + '" "' + node.sysID + '"');
+      } else if (node.sysID) {
+        this.stream.write(' SYSTEM "' + node.sysID + '"');
+      }
+      if (node.children.length > 0) {
+        this.stream.write(' [');
+        this.stream.write(this.endline(node));
+        ref = node.children;
+        for (i = 0, len = ref.length; i < len; i++) {
+          child = ref[i];
+          switch (false) {
+            case !(child instanceof XMLDTDAttList):
+              this.dtdAttList(child, level + 1);
+              break;
+            case !(child instanceof XMLDTDElement):
+              this.dtdElement(child, level + 1);
+              break;
+            case !(child instanceof XMLDTDEntity):
+              this.dtdEntity(child, level + 1);
+              break;
+            case !(child instanceof XMLDTDNotation):
+              this.dtdNotation(child, level + 1);
+              break;
+            case !(child instanceof XMLCData):
+              this.cdata(child, level + 1);
+              break;
+            case !(child instanceof XMLComment):
+              this.comment(child, level + 1);
+              break;
+            case !(child instanceof XMLProcessingInstruction):
+              this.processingInstruction(child, level + 1);
+              break;
+            default:
+              throw new Error("Unknown DTD node type: " + child.constructor.name);
+          }
+        }
+        this.stream.write(']');
+      }
+      this.stream.write(this.spacebeforeslash + '>');
+      return this.stream.write(this.endline(node));
+    };
+
+    XMLStreamWriter.prototype.element = function(node, level) {
+      var att, child, i, len, name, ref, ref1, space;
+      level || (level = 0);
+      space = this.space(level);
+      this.stream.write(space + '<' + node.name);
+      ref = node.attributes;
+      for (name in ref) {
+        if (!hasProp.call(ref, name)) continue;
+        att = ref[name];
+        this.attribute(att);
+      }
+      if (node.children.length === 0 || node.children.every(function(e) {
+        return e.value === '';
+      })) {
+        if (this.allowEmpty) {
+          this.stream.write('></' + node.name + '>');
+        } else {
+          this.stream.write(this.spacebeforeslash + '/>');
+        }
+      } else if (this.pretty && node.children.length === 1 && (node.children[0].value != null)) {
+        this.stream.write('>');
+        this.stream.write(node.children[0].value);
+        this.stream.write('</' + node.name + '>');
+      } else {
+        this.stream.write('>' + this.newline);
+        ref1 = node.children;
+        for (i = 0, len = ref1.length; i < len; i++) {
+          child = ref1[i];
+          switch (false) {
+            case !(child instanceof XMLCData):
+              this.cdata(child, level + 1);
+              break;
+            case !(child instanceof XMLComment):
+              this.comment(child, level + 1);
+              break;
+            case !(child instanceof XMLElement):
+              this.element(child, level + 1);
+              break;
+            case !(child instanceof XMLRaw):
+              this.raw(child, level + 1);
+              break;
+            case !(child instanceof XMLText):
+              this.text(child, level + 1);
+              break;
+            case !(child instanceof XMLProcessingInstruction):
+              this.processingInstruction(child, level + 1);
+              break;
+            default:
+              throw new Error("Unknown XML node type: " + child.constructor.name);
+          }
+        }
+        this.stream.write(space + '</' + node.name + '>');
+      }
+      return this.stream.write(this.endline(node));
+    };
+
+    XMLStreamWriter.prototype.processingInstruction = function(node, level) {
+      this.stream.write(this.space(level) + '<?' + node.target);
+      if (node.value) {
+        this.stream.write(' ' + node.value);
+      }
+      return this.stream.write(this.spacebeforeslash + '?>' + this.endline(node));
+    };
+
+    XMLStreamWriter.prototype.raw = function(node, level) {
+      return this.stream.write(this.space(level) + node.value + this.endline(node));
+    };
+
+    XMLStreamWriter.prototype.text = function(node, level) {
+      return this.stream.write(this.space(level) + node.value + this.endline(node));
+    };
+
+    XMLStreamWriter.prototype.dtdAttList = function(node, level) {
+      this.stream.write(this.space(level) + '<!ATTLIST ' + node.elementName + ' ' + node.attributeName + ' ' + node.attributeType);
+      if (node.defaultValueType !== '#DEFAULT') {
+        this.stream.write(' ' + node.defaultValueType);
+      }
+      if (node.defaultValue) {
+        this.stream.write(' "' + node.defaultValue + '"');
+      }
+      return this.stream.write(this.spacebeforeslash + '>' + this.endline(node));
+    };
+
+    XMLStreamWriter.prototype.dtdElement = function(node, level) {
+      this.stream.write(this.space(level) + '<!ELEMENT ' + node.name + ' ' + node.value);
+      return this.stream.write(this.spacebeforeslash + '>' + this.endline(node));
+    };
+
+    XMLStreamWriter.prototype.dtdEntity = function(node, level) {
+      this.stream.write(this.space(level) + '<!ENTITY');
+      if (node.pe) {
+        this.stream.write(' %');
+      }
+      this.stream.write(' ' + node.name);
+      if (node.value) {
+        this.stream.write(' "' + node.value + '"');
+      } else {
+        if (node.pubID && node.sysID) {
+          this.stream.write(' PUBLIC "' + node.pubID + '" "' + node.sysID + '"');
+        } else if (node.sysID) {
+          this.stream.write(' SYSTEM "' + node.sysID + '"');
+        }
+        if (node.nData) {
+          this.stream.write(' NDATA ' + node.nData);
+        }
+      }
+      return this.stream.write(this.spacebeforeslash + '>' + this.endline(node));
+    };
+
+    XMLStreamWriter.prototype.dtdNotation = function(node, level) {
+      this.stream.write(this.space(level) + '<!NOTATION ' + node.name);
+      if (node.pubID && node.sysID) {
+        this.stream.write(' PUBLIC "' + node.pubID + '" "' + node.sysID + '"');
+      } else if (node.pubID) {
+        this.stream.write(' PUBLIC "' + node.pubID + '"');
+      } else if (node.sysID) {
+        this.stream.write(' SYSTEM "' + node.sysID + '"');
+      }
+      return this.stream.write(this.spacebeforeslash + '>' + this.endline(node));
+    };
+
+    XMLStreamWriter.prototype.endline = function(node) {
+      if (!node.isLastRootNode) {
+        return this.newline;
+      } else {
+        return '';
+      }
+    };
+
+    return XMLStreamWriter;
+
+  })(XMLWriterBase);
+
+}).call(this);
diff --git a/wrt/node_modules/xmlbuilder/lib/XMLStringWriter.js b/wrt/node_modules/xmlbuilder/lib/XMLStringWriter.js
new file mode 100644 (file)
index 0000000..b5c0a93
--- /dev/null
@@ -0,0 +1,334 @@
+// Generated by CoffeeScript 1.12.6
+(function() {
+  var XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLElement, XMLProcessingInstruction, XMLRaw, XMLStringWriter, XMLText, XMLWriterBase,
+    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+    hasProp = {}.hasOwnProperty;
+
+  XMLDeclaration = require('./XMLDeclaration');
+
+  XMLDocType = require('./XMLDocType');
+
+  XMLCData = require('./XMLCData');
+
+  XMLComment = require('./XMLComment');
+
+  XMLElement = require('./XMLElement');
+
+  XMLRaw = require('./XMLRaw');
+
+  XMLText = require('./XMLText');
+
+  XMLProcessingInstruction = require('./XMLProcessingInstruction');
+
+  XMLDTDAttList = require('./XMLDTDAttList');
+
+  XMLDTDElement = require('./XMLDTDElement');
+
+  XMLDTDEntity = require('./XMLDTDEntity');
+
+  XMLDTDNotation = require('./XMLDTDNotation');
+
+  XMLWriterBase = require('./XMLWriterBase');
+
+  module.exports = XMLStringWriter = (function(superClass) {
+    extend(XMLStringWriter, superClass);
+
+    function XMLStringWriter(options) {
+      XMLStringWriter.__super__.constructor.call(this, options);
+    }
+
+    XMLStringWriter.prototype.document = function(doc) {
+      var child, i, len, r, ref;
+      this.textispresent = false;
+      r = '';
+      ref = doc.children;
+      for (i = 0, len = ref.length; i < len; i++) {
+        child = ref[i];
+        r += (function() {
+          switch (false) {
+            case !(child instanceof XMLDeclaration):
+              return this.declaration(child);
+            case !(child instanceof XMLDocType):
+              return this.docType(child);
+            case !(child instanceof XMLComment):
+              return this.comment(child);
+            case !(child instanceof XMLProcessingInstruction):
+              return this.processingInstruction(child);
+            default:
+              return this.element(child, 0);
+          }
+        }).call(this);
+      }
+      if (this.pretty && r.slice(-this.newline.length) === this.newline) {
+        r = r.slice(0, -this.newline.length);
+      }
+      return r;
+    };
+
+    XMLStringWriter.prototype.attribute = function(att) {
+      return ' ' + att.name + '="' + att.value + '"';
+    };
+
+    XMLStringWriter.prototype.cdata = function(node, level) {
+      return this.space(level) + '<![CDATA[' + node.text + ']]>' + this.newline;
+    };
+
+    XMLStringWriter.prototype.comment = function(node, level) {
+      return this.space(level) + '<!-- ' + node.text + ' -->' + this.newline;
+    };
+
+    XMLStringWriter.prototype.declaration = function(node, level) {
+      var r;
+      r = this.space(level);
+      r += '<?xml version="' + node.version + '"';
+      if (node.encoding != null) {
+        r += ' encoding="' + node.encoding + '"';
+      }
+      if (node.standalone != null) {
+        r += ' standalone="' + node.standalone + '"';
+      }
+      r += this.spacebeforeslash + '?>';
+      r += this.newline;
+      return r;
+    };
+
+    XMLStringWriter.prototype.docType = function(node, level) {
+      var child, i, len, r, ref;
+      level || (level = 0);
+      r = this.space(level);
+      r += '<!DOCTYPE ' + node.root().name;
+      if (node.pubID && node.sysID) {
+        r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
+      } else if (node.sysID) {
+        r += ' SYSTEM "' + node.sysID + '"';
+      }
+      if (node.children.length > 0) {
+        r += ' [';
+        r += this.newline;
+        ref = node.children;
+        for (i = 0, len = ref.length; i < len; i++) {
+          child = ref[i];
+          r += (function() {
+            switch (false) {
+              case !(child instanceof XMLDTDAttList):
+                return this.dtdAttList(child, level + 1);
+              case !(child instanceof XMLDTDElement):
+                return this.dtdElement(child, level + 1);
+              case !(child instanceof XMLDTDEntity):
+                return this.dtdEntity(child, level + 1);
+              case !(child instanceof XMLDTDNotation):
+                return this.dtdNotation(child, level + 1);
+              case !(child instanceof XMLCData):
+                return this.cdata(child, level + 1);
+              case !(child instanceof XMLComment):
+                return this.comment(child, level + 1);
+              case !(child instanceof XMLProcessingInstruction):
+                return this.processingInstruction(child, level + 1);
+              default:
+                throw new Error("Unknown DTD node type: " + child.constructor.name);
+            }
+          }).call(this);
+        }
+        r += ']';
+      }
+      r += this.spacebeforeslash + '>';
+      r += this.newline;
+      return r;
+    };
+
+    XMLStringWriter.prototype.element = function(node, level) {
+      var att, child, i, j, len, len1, name, r, ref, ref1, ref2, space, textispresentwasset;
+      level || (level = 0);
+      textispresentwasset = false;
+      if (this.textispresent) {
+        this.newline = '';
+        this.pretty = false;
+      } else {
+        this.newline = this.newlinedefault;
+        this.pretty = this.prettydefault;
+      }
+      space = this.space(level);
+      r = '';
+      r += space + '<' + node.name;
+      ref = node.attributes;
+      for (name in ref) {
+        if (!hasProp.call(ref, name)) continue;
+        att = ref[name];
+        r += this.attribute(att);
+      }
+      if (node.children.length === 0 || node.children.every(function(e) {
+        return e.value === '';
+      })) {
+        if (this.allowEmpty) {
+          r += '></' + node.name + '>' + this.newline;
+        } else {
+          r += this.spacebeforeslash + '/>' + this.newline;
+        }
+      } else if (this.pretty && node.children.length === 1 && (node.children[0].value != null)) {
+        r += '>';
+        r += node.children[0].value;
+        r += '</' + node.name + '>' + this.newline;
+      } else {
+        if (this.dontprettytextnodes) {
+          ref1 = node.children;
+          for (i = 0, len = ref1.length; i < len; i++) {
+            child = ref1[i];
+            if (child.value != null) {
+              this.textispresent++;
+              textispresentwasset = true;
+              break;
+            }
+          }
+        }
+        if (this.textispresent) {
+          this.newline = '';
+          this.pretty = false;
+          space = this.space(level);
+        }
+        r += '>' + this.newline;
+        ref2 = node.children;
+        for (j = 0, len1 = ref2.length; j < len1; j++) {
+          child = ref2[j];
+          r += (function() {
+            switch (false) {
+              case !(child instanceof XMLCData):
+                return this.cdata(child, level + 1);
+              case !(child instanceof XMLComment):
+                return this.comment(child, level + 1);
+              case !(child instanceof XMLElement):
+                return this.element(child, level + 1);
+              case !(child instanceof XMLRaw):
+                return this.raw(child, level + 1);
+              case !(child instanceof XMLText):
+                return this.text(child, level + 1);
+              case !(child instanceof XMLProcessingInstruction):
+                return this.processingInstruction(child, level + 1);
+              default:
+                throw new Error("Unknown XML node type: " + child.constructor.name);
+            }
+          }).call(this);
+        }
+        if (textispresentwasset) {
+          this.textispresent--;
+        }
+        if (!this.textispresent) {
+          this.newline = this.newlinedefault;
+          this.pretty = this.prettydefault;
+        }
+        r += space + '</' + node.name + '>' + this.newline;
+      }
+      return r;
+    };
+
+    XMLStringWriter.prototype.processingInstruction = function(node, level) {
+      var r;
+      r = this.space(level) + '<?' + node.target;
+      if (node.value) {
+        r += ' ' + node.value;
+      }
+      r += this.spacebeforeslash + '?>' + this.newline;
+      return r;
+    };
+
+    XMLStringWriter.prototype.raw = function(node, level) {
+      return this.space(level) + node.value + this.newline;
+    };
+
+    XMLStringWriter.prototype.text = function(node, level) {
+      return this.space(level) + node.value + this.newline;
+    };
+
+    XMLStringWriter.prototype.dtdAttList = function(node, level) {
+      var r;
+      r = this.space(level) + '<!ATTLIST ' + node.elementName + ' ' + node.attributeName + ' ' + node.attributeType;
+      if (node.defaultValueType !== '#DEFAULT') {
+        r += ' ' + node.defaultValueType;
+      }
+      if (node.defaultValue) {
+        r += ' "' + node.defaultValue + '"';
+      }
+      r += this.spacebeforeslash + '>' + this.newline;
+      return r;
+    };
+
+    XMLStringWriter.prototype.dtdElement = function(node, level) {
+      return this.space(level) + '<!ELEMENT ' + node.name + ' ' + node.value + this.spacebeforeslash + '>' + this.newline;
+    };
+
+    XMLStringWriter.prototype.dtdEntity = function(node, level) {
+      var r;
+      r = this.space(level) + '<!ENTITY';
+      if (node.pe) {
+        r += ' %';
+      }
+      r += ' ' + node.name;
+      if (node.value) {
+        r += ' "' + node.value + '"';
+      } else {
+        if (node.pubID && node.sysID) {
+          r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
+        } else if (node.sysID) {
+          r += ' SYSTEM "' + node.sysID + '"';
+        }
+        if (node.nData) {
+          r += ' NDATA ' + node.nData;
+        }
+      }
+      r += this.spacebeforeslash + '>' + this.newline;
+      return r;
+    };
+
+    XMLStringWriter.prototype.dtdNotation = function(node, level) {
+      var r;
+      r = this.space(level) + '<!NOTATION ' + node.name;
+      if (node.pubID && node.sysID) {
+        r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
+      } else if (node.pubID) {
+        r += ' PUBLIC "' + node.pubID + '"';
+      } else if (node.sysID) {
+        r += ' SYSTEM "' + node.sysID + '"';
+      }
+      r += this.spacebeforeslash + '>' + this.newline;
+      return r;
+    };
+
+    XMLStringWriter.prototype.openNode = function(node, level) {
+      var att, name, r, ref;
+      level || (level = 0);
+      if (node instanceof XMLElement) {
+        r = this.space(level) + '<' + node.name;
+        ref = node.attributes;
+        for (name in ref) {
+          if (!hasProp.call(ref, name)) continue;
+          att = ref[name];
+          r += this.attribute(att);
+        }
+        r += (node.children ? '>' : '/>') + this.newline;
+        return r;
+      } else {
+        r = this.space(level) + '<!DOCTYPE ' + node.rootNodeName;
+        if (node.pubID && node.sysID) {
+          r += ' PUBLIC "' + node.pubID + '" "' + node.sysID + '"';
+        } else if (node.sysID) {
+          r += ' SYSTEM "' + node.sysID + '"';
+        }
+        r += (node.children ? ' [' : '>') + this.newline;
+        return r;
+      }
+    };
+
+    XMLStringWriter.prototype.closeNode = function(node, level) {
+      level || (level = 0);
+      switch (false) {
+        case !(node instanceof XMLElement):
+          return this.space(level) + '</' + node.name + '>' + this.newline;
+        case !(node instanceof XMLDocType):
+          return this.space(level) + ']>' + this.newline;
+      }
+    };
+
+    return XMLStringWriter;
+
+  })(XMLWriterBase);
+
+}).call(this);
diff --git a/wrt/node_modules/xmlbuilder/lib/XMLStringifier.js b/wrt/node_modules/xmlbuilder/lib/XMLStringifier.js
new file mode 100644 (file)
index 0000000..23bb4c8
--- /dev/null
@@ -0,0 +1,163 @@
+// Generated by CoffeeScript 1.12.6
+(function() {
+  var XMLStringifier,
+    bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
+    hasProp = {}.hasOwnProperty;
+
+  module.exports = XMLStringifier = (function() {
+    function XMLStringifier(options) {
+      this.assertLegalChar = bind(this.assertLegalChar, this);
+      var key, ref, value;
+      options || (options = {});
+      this.noDoubleEncoding = options.noDoubleEncoding;
+      ref = options.stringify || {};
+      for (key in ref) {
+        if (!hasProp.call(ref, key)) continue;
+        value = ref[key];
+        this[key] = value;
+      }
+    }
+
+    XMLStringifier.prototype.eleName = function(val) {
+      val = '' + val || '';
+      return this.assertLegalChar(val);
+    };
+
+    XMLStringifier.prototype.eleText = function(val) {
+      val = '' + val || '';
+      return this.assertLegalChar(this.elEscape(val));
+    };
+
+    XMLStringifier.prototype.cdata = function(val) {
+      val = '' + val || '';
+      val = val.replace(']]>', ']]]]><![CDATA[>');
+      return this.assertLegalChar(val);
+    };
+
+    XMLStringifier.prototype.comment = function(val) {
+      val = '' + val || '';
+      if (val.match(/--/)) {
+        throw new Error("Comment text cannot contain double-hypen: " + val);
+      }
+      return this.assertLegalChar(val);
+    };
+
+    XMLStringifier.prototype.raw = function(val) {
+      return '' + val || '';
+    };
+
+    XMLStringifier.prototype.attName = function(val) {
+      return val = '' + val || '';
+    };
+
+    XMLStringifier.prototype.attValue = function(val) {
+      val = '' + val || '';
+      return this.attEscape(val);
+    };
+
+    XMLStringifier.prototype.insTarget = function(val) {
+      return '' + val || '';
+    };
+
+    XMLStringifier.prototype.insValue = function(val) {
+      val = '' + val || '';
+      if (val.match(/\?>/)) {
+        throw new Error("Invalid processing instruction value: " + val);
+      }
+      return val;
+    };
+
+    XMLStringifier.prototype.xmlVersion = function(val) {
+      val = '' + val || '';
+      if (!val.match(/1\.[0-9]+/)) {
+        throw new Error("Invalid version number: " + val);
+      }
+      return val;
+    };
+
+    XMLStringifier.prototype.xmlEncoding = function(val) {
+      val = '' + val || '';
+      if (!val.match(/^[A-Za-z](?:[A-Za-z0-9._-]|-)*$/)) {
+        throw new Error("Invalid encoding: " + val);
+      }
+      return val;
+    };
+
+    XMLStringifier.prototype.xmlStandalone = function(val) {
+      if (val) {
+        return "yes";
+      } else {
+        return "no";
+      }
+    };
+
+    XMLStringifier.prototype.dtdPubID = function(val) {
+      return '' + val || '';
+    };
+
+    XMLStringifier.prototype.dtdSysID = function(val) {
+      return '' + val || '';
+    };
+
+    XMLStringifier.prototype.dtdElementValue = function(val) {
+      return '' + val || '';
+    };
+
+    XMLStringifier.prototype.dtdAttType = function(val) {
+      return '' + val || '';
+    };
+
+    XMLStringifier.prototype.dtdAttDefault = function(val) {
+      if (val != null) {
+        return '' + val || '';
+      } else {
+        return val;
+      }
+    };
+
+    XMLStringifier.prototype.dtdEntityValue = function(val) {
+      return '' + val || '';
+    };
+
+    XMLStringifier.prototype.dtdNData = function(val) {
+      return '' + val || '';
+    };
+
+    XMLStringifier.prototype.convertAttKey = '@';
+
+    XMLStringifier.prototype.convertPIKey = '?';
+
+    XMLStringifier.prototype.convertTextKey = '#text';
+
+    XMLStringifier.prototype.convertCDataKey = '#cdata';
+
+    XMLStringifier.prototype.convertCommentKey = '#comment';
+
+    XMLStringifier.prototype.convertRawKey = '#raw';
+
+    XMLStringifier.prototype.assertLegalChar = function(str) {
+      var res;
+      res = str.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/);
+      if (res) {
+        throw new Error("Invalid character in string: " + str + " at index " + res.index);
+      }
+      return str;
+    };
+
+    XMLStringifier.prototype.elEscape = function(str) {
+      var ampregex;
+      ampregex = this.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g;
+      return str.replace(ampregex, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\r/g, '&#xD;');
+    };
+
+    XMLStringifier.prototype.attEscape = function(str) {
+      var ampregex;
+      ampregex = this.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g;
+      return str.replace(ampregex, '&amp;').replace(/</g, '&lt;').replace(/"/g, '&quot;').replace(/\t/g, '&#x9;').replace(/\n/g, '&#xA;').replace(/\r/g, '&#xD;');
+    };
+
+    return XMLStringifier;
+
+  })();
+
+}).call(this);
diff --git a/wrt/node_modules/xmlbuilder/lib/XMLText.js b/wrt/node_modules/xmlbuilder/lib/XMLText.js
new file mode 100644 (file)
index 0000000..ec23d2a
--- /dev/null
@@ -0,0 +1,32 @@
+// Generated by CoffeeScript 1.12.6
+(function() {
+  var XMLNode, XMLText,
+    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+    hasProp = {}.hasOwnProperty;
+
+  XMLNode = require('./XMLNode');
+
+  module.exports = XMLText = (function(superClass) {
+    extend(XMLText, superClass);
+
+    function XMLText(parent, text) {
+      XMLText.__super__.constructor.call(this, parent);
+      if (text == null) {
+        throw new Error("Missing element text");
+      }
+      this.value = this.stringify.eleText(text);
+    }
+
+    XMLText.prototype.clone = function() {
+      return Object.create(this);
+    };
+
+    XMLText.prototype.toString = function(options) {
+      return this.options.writer.set(options).text(this);
+    };
+
+    return XMLText;
+
+  })(XMLNode);
+
+}).call(this);
diff --git a/wrt/node_modules/xmlbuilder/lib/XMLWriterBase.js b/wrt/node_modules/xmlbuilder/lib/XMLWriterBase.js
new file mode 100644 (file)
index 0000000..c21142a
--- /dev/null
@@ -0,0 +1,90 @@
+// Generated by CoffeeScript 1.12.6
+(function() {
+  var XMLWriterBase,
+    hasProp = {}.hasOwnProperty;
+
+  module.exports = XMLWriterBase = (function() {
+    function XMLWriterBase(options) {
+      var key, ref, ref1, ref2, ref3, ref4, ref5, ref6, value;
+      options || (options = {});
+      this.pretty = options.pretty || false;
+      this.allowEmpty = (ref = options.allowEmpty) != null ? ref : false;
+      if (this.pretty) {
+        this.indent = (ref1 = options.indent) != null ? ref1 : '  ';
+        this.newline = (ref2 = options.newline) != null ? ref2 : '\n';
+        this.offset = (ref3 = options.offset) != null ? ref3 : 0;
+        this.dontprettytextnodes = (ref4 = options.dontprettytextnodes) != null ? ref4 : 0;
+      } else {
+        this.indent = '';
+        this.newline = '';
+        this.offset = 0;
+        this.dontprettytextnodes = 0;
+      }
+      this.spacebeforeslash = (ref5 = options.spacebeforeslash) != null ? ref5 : '';
+      if (this.spacebeforeslash === true) {
+        this.spacebeforeslash = ' ';
+      }
+      this.newlinedefault = this.newline;
+      this.prettydefault = this.pretty;
+      ref6 = options.writer || {};
+      for (key in ref6) {
+        if (!hasProp.call(ref6, key)) continue;
+        value = ref6[key];
+        this[key] = value;
+      }
+    }
+
+    XMLWriterBase.prototype.set = function(options) {
+      var key, ref, value;
+      options || (options = {});
+      if ("pretty" in options) {
+        this.pretty = options.pretty;
+      }
+      if ("allowEmpty" in options) {
+        this.allowEmpty = options.allowEmpty;
+      }
+      if (this.pretty) {
+        this.indent = "indent" in options ? options.indent : '  ';
+        this.newline = "newline" in options ? options.newline : '\n';
+        this.offset = "offset" in options ? options.offset : 0;
+        this.dontprettytextnodes = "dontprettytextnodes" in options ? options.dontprettytextnodes : 0;
+      } else {
+        this.indent = '';
+        this.newline = '';
+        this.offset = 0;
+        this.dontprettytextnodes = 0;
+      }
+      this.spacebeforeslash = "spacebeforeslash" in options ? options.spacebeforeslash : '';
+      if (this.spacebeforeslash === true) {
+        this.spacebeforeslash = ' ';
+      }
+      this.newlinedefault = this.newline;
+      this.prettydefault = this.pretty;
+      ref = options.writer || {};
+      for (key in ref) {
+        if (!hasProp.call(ref, key)) continue;
+        value = ref[key];
+        this[key] = value;
+      }
+      return this;
+    };
+
+    XMLWriterBase.prototype.space = function(level) {
+      var indent;
+      if (this.pretty) {
+        indent = (level || 0) + this.offset + 1;
+        if (indent > 0) {
+          return new Array(indent).join(this.indent);
+        } else {
+          return '';
+        }
+      } else {
+        return '';
+      }
+    };
+
+    return XMLWriterBase;
+
+  })();
+
+}).call(this);
diff --git a/wrt/node_modules/xmlbuilder/lib/index.js b/wrt/node_modules/xmlbuilder/lib/index.js
new file mode 100644 (file)
index 0000000..9bf142d
--- /dev/null
@@ -0,0 +1,53 @@
+// Generated by CoffeeScript 1.12.6
+(function() {
+  var XMLDocument, XMLDocumentCB, XMLStreamWriter, XMLStringWriter, assign, isFunction, ref;
+
+  ref = require('./Utility'), assign = ref.assign, isFunction = ref.isFunction;
+
+  XMLDocument = require('./XMLDocument');
+
+  XMLDocumentCB = require('./XMLDocumentCB');
+
+  XMLStringWriter = require('./XMLStringWriter');
+
+  XMLStreamWriter = require('./XMLStreamWriter');
+
+  module.exports.create = function(name, xmldec, doctype, options) {
+    var doc, root;
+    if (name == null) {
+      throw new Error("Root element needs a name");
+    }
+    options = assign({}, xmldec, doctype, options);
+    doc = new XMLDocument(options);
+    root = doc.element(name);
+    if (!options.headless) {
+      doc.declaration(options);
+      if ((options.pubID != null) || (options.sysID != null)) {
+        doc.doctype(options);
+      }
+    }
+    return root;
+  };
+
+  module.exports.begin = function(options, onData, onEnd) {
+    var ref1;
+    if (isFunction(options)) {
+      ref1 = [options, onData], onData = ref1[0], onEnd = ref1[1];
+      options = {};
+    }
+    if (onData) {
+      return new XMLDocumentCB(options, onData, onEnd);
+    } else {
+      return new XMLDocument(options);
+    }
+  };
+
+  module.exports.stringWriter = function(options) {
+    return new XMLStringWriter(options);
+  };
+
+  module.exports.streamWriter = function(stream, options) {
+    return new XMLStreamWriter(stream, options);
+  };
+
+}).call(this);
diff --git a/wrt/node_modules/xmlbuilder/package.json b/wrt/node_modules/xmlbuilder/package.json
new file mode 100644 (file)
index 0000000..24cc018
--- /dev/null
@@ -0,0 +1,100 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "xmlbuilder@~9.0.1",
+        "scope": null,
+        "escapedName": "xmlbuilder",
+        "name": "xmlbuilder",
+        "rawSpec": "~9.0.1",
+        "spec": ">=9.0.1 <9.1.0",
+        "type": "range"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/xml2js"
+    ]
+  ],
+  "_from": "xmlbuilder@>=9.0.1 <9.1.0",
+  "_id": "xmlbuilder@9.0.4",
+  "_inCache": true,
+  "_location": "/xmlbuilder",
+  "_nodeVersion": "6.11.0",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/xmlbuilder-9.0.4.tgz_1502884089961_0.9179640170186758"
+  },
+  "_npmUser": {
+    "name": "oozcitak",
+    "email": "oozcitak@gmail.com"
+  },
+  "_npmVersion": "3.10.10",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "xmlbuilder@~9.0.1",
+    "scope": null,
+    "escapedName": "xmlbuilder",
+    "name": "xmlbuilder",
+    "rawSpec": "~9.0.1",
+    "spec": ">=9.0.1 <9.1.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/xml2js"
+  ],
+  "_resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.4.tgz",
+  "_shasum": "519cb4ca686d005a8420d3496f3f0caeecca580f",
+  "_shrinkwrap": null,
+  "_spec": "xmlbuilder@~9.0.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/xml2js",
+  "author": {
+    "name": "Ozgur Ozcitak",
+    "email": "oozcitak@gmail.com"
+  },
+  "bugs": {
+    "url": "http://github.com/oozcitak/xmlbuilder-js/issues"
+  },
+  "contributors": [],
+  "dependencies": {},
+  "description": "An XML builder for node.js",
+  "devDependencies": {
+    "coffee-coverage": "*",
+    "coffeescript": "github:jashkenas/coffeescript",
+    "coveralls": "*",
+    "istanbul": "*",
+    "mocha": "*"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "519cb4ca686d005a8420d3496f3f0caeecca580f",
+    "tarball": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.4.tgz"
+  },
+  "engines": {
+    "node": ">=4.0"
+  },
+  "gitHead": "f1c99a9c2abec65238ce86e8ed48bf9cb162ac6c",
+  "homepage": "http://github.com/oozcitak/xmlbuilder-js",
+  "keywords": [
+    "xml",
+    "xmlbuilder"
+  ],
+  "license": "MIT",
+  "main": "./lib/index",
+  "maintainers": [
+    {
+      "name": "oozcitak",
+      "email": "oozcitak@gmail.com"
+    }
+  ],
+  "name": "xmlbuilder",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/oozcitak/xmlbuilder-js.git"
+  },
+  "scripts": {
+    "postpublish": "rm -rf lib",
+    "prepublish": "coffee -co lib src",
+    "test": "mocha && istanbul report text lcov"
+  },
+  "version": "9.0.4"
+}
diff --git a/wrt/node_modules/xmlhttprequest-ssl/LICENSE b/wrt/node_modules/xmlhttprequest-ssl/LICENSE
new file mode 100644 (file)
index 0000000..1c63271
--- /dev/null
@@ -0,0 +1,22 @@
+ Copyright (c) 2010 passive.ly LLC
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
diff --git a/wrt/node_modules/xmlhttprequest-ssl/README.md b/wrt/node_modules/xmlhttprequest-ssl/README.md
new file mode 100644 (file)
index 0000000..73f8876
--- /dev/null
@@ -0,0 +1,61 @@
+# node-XMLHttpRequest #
+
+Fork of [node-XMLHttpRequest](https://github.com/driverdan/node-XMLHttpRequest) by [driverdan](http://driverdan.com). Forked and published to npm because a [pull request](https://github.com/rase-/node-XMLHttpRequest/commit/a6b6f296e0a8278165c2d0270d9840b54d5eeadd) is not being created and merged. Changes made by [rase-](https://github.com/rase-/node-XMLHttpRequest/tree/add/ssl-support) are needed for [engine.io-client](https://github.com/Automattic/engine.io-client).
+
+# Original README #
+
+node-XMLHttpRequest is a wrapper for the built-in http client to emulate the
+browser XMLHttpRequest object.
+
+This can be used with JS designed for browsers to improve reuse of code and
+allow the use of existing libraries.
+
+Note: This library currently conforms to [XMLHttpRequest 1](http://www.w3.org/TR/XMLHttpRequest/). Version 2.0 will target [XMLHttpRequest Level 2](http://www.w3.org/TR/XMLHttpRequest2/).
+
+## Usage ##
+
+Here's how to include the module in your project and use as the browser-based
+XHR object.
+
+       var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
+       var xhr = new XMLHttpRequest();
+
+Note: use the lowercase string "xmlhttprequest" in your require(). On
+case-sensitive systems (eg Linux) using uppercase letters won't work.
+
+## Versions ##
+
+Prior to 1.4.0 version numbers were arbitrary. From 1.4.0 on they conform to
+the standard major.minor.bugfix. 1.x shouldn't necessarily be considered
+stable just because it's above 0.x.
+
+Since the XMLHttpRequest API is stable this library's API is stable as
+well. Major version numbers indicate significant core code changes.
+Minor versions indicate minor core code changes or better conformity to
+the W3C spec.
+
+## License ##
+
+MIT license. See LICENSE for full details.
+
+## Supports ##
+
+* Async and synchronous requests
+* GET, POST, PUT, and DELETE requests
+* All spec methods (open, send, abort, getRequestHeader,
+  getAllRequestHeaders, event methods)
+* Requests to all domains
+
+## Known Issues / Missing Features ##
+
+For a list of open issues or to report your own visit the [github issues
+page](https://github.com/driverdan/node-XMLHttpRequest/issues).
+
+* Local file access may have unexpected results for non-UTF8 files
+* Synchronous requests don't set headers properly
+* Synchronous requests freeze node while waiting for response (But that's what you want, right? Stick with async!).
+* Some events are missing, such as abort
+* getRequestHeader is case-sensitive
+* Cookies aren't persisted between requests
+* Missing XML support
+* Missing basic auth
diff --git a/wrt/node_modules/xmlhttprequest-ssl/autotest.watchr b/wrt/node_modules/xmlhttprequest-ssl/autotest.watchr
new file mode 100644 (file)
index 0000000..5324db6
--- /dev/null
@@ -0,0 +1,8 @@
+def run_all_tests
+    puts `clear`
+    puts `node tests/test-constants.js`
+    puts `node tests/test-headers.js`
+    puts `node tests/test-request.js`
+end
+watch('.*.js') { run_all_tests }
+run_all_tests
diff --git a/wrt/node_modules/xmlhttprequest-ssl/example/demo.js b/wrt/node_modules/xmlhttprequest-ssl/example/demo.js
new file mode 100644 (file)
index 0000000..4f333de
--- /dev/null
@@ -0,0 +1,16 @@
+var sys = require('util');
+var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
+
+var xhr = new XMLHttpRequest();
+
+xhr.onreadystatechange = function() {
+       sys.puts("State: " + this.readyState);
+       
+       if (this.readyState == 4) {
+               sys.puts("Complete.\nBody length: " + this.responseText.length);
+               sys.puts("Body:\n" + this.responseText);
+       }
+};
+
+xhr.open("GET", "http://driverdan.com");
+xhr.send();
diff --git a/wrt/node_modules/xmlhttprequest-ssl/lib/XMLHttpRequest.js b/wrt/node_modules/xmlhttprequest-ssl/lib/XMLHttpRequest.js
new file mode 100644 (file)
index 0000000..aad495d
--- /dev/null
@@ -0,0 +1,650 @@
+/**
+ * Wrapper for built-in http.js to emulate the browser XMLHttpRequest object.
+ *
+ * This can be used with JS designed for browsers to improve reuse of code and
+ * allow the use of existing libraries.
+ *
+ * Usage: include("XMLHttpRequest.js") and use XMLHttpRequest per W3C specs.
+ *
+ * @author Dan DeFelippi <dan@driverdan.com>
+ * @contributor David Ellis <d.f.ellis@ieee.org>
+ * @license MIT
+ */
+
+var fs = require('fs');
+var Url = require('url');
+var spawn = require('child_process').spawn;
+
+/**
+ * Module exports.
+ */
+
+module.exports = XMLHttpRequest;
+
+// backwards-compat
+XMLHttpRequest.XMLHttpRequest = XMLHttpRequest;
+
+/**
+ * `XMLHttpRequest` constructor.
+ *
+ * Supported options for the `opts` object are:
+ *
+ *  - `agent`: An http.Agent instance; http.globalAgent may be used; if 'undefined', agent usage is disabled
+ *
+ * @param {Object} opts optional "options" object
+ */
+
+function XMLHttpRequest(opts) {
+  "use strict";
+
+  /**
+   * Private variables
+   */
+  var self = this;
+  var http = require('http');
+  var https = require('https');
+
+  // Holds http.js objects
+  var request;
+  var response;
+
+  // Request settings
+  var settings = {};
+
+  // Disable header blacklist.
+  // Not part of XHR specs.
+  var disableHeaderCheck = false;
+
+  // Set some default headers
+  var defaultHeaders = {
+    "User-Agent": "node-XMLHttpRequest",
+    "Accept": "*/*"
+  };
+
+  var headers = defaultHeaders;
+
+  // These headers are not user setable.
+  // The following are allowed but banned in the spec:
+  // * user-agent
+  var forbiddenRequestHeaders = [
+    "accept-charset",
+    "accept-encoding",
+    "access-control-request-headers",
+    "access-control-request-method",
+    "connection",
+    "content-length",
+    "content-transfer-encoding",
+    "cookie",
+    "cookie2",
+    "date",
+    "expect",
+    "host",
+    "keep-alive",
+    "origin",
+    "referer",
+    "te",
+    "trailer",
+    "transfer-encoding",
+    "upgrade",
+    "via"
+  ];
+
+  // These request methods are not allowed
+  var forbiddenRequestMethods = [
+    "TRACE",
+    "TRACK",
+    "CONNECT"
+  ];
+
+  // Send flag
+  var sendFlag = false;
+  // Error flag, used when errors occur or abort is called
+  var errorFlag = false;
+
+  // Event listeners
+  var listeners = {};
+
+  /**
+   * Constants
+   */
+
+  this.UNSENT = 0;
+  this.OPENED = 1;
+  this.HEADERS_RECEIVED = 2;
+  this.LOADING = 3;
+  this.DONE = 4;
+
+  /**
+   * Public vars
+   */
+
+  // Current state
+  this.readyState = this.UNSENT;
+
+  // default ready state change handler in case one is not set or is set late
+  this.onreadystatechange = null;
+
+  // Result & response
+  this.responseText = "";
+  this.responseXML = "";
+  this.status = null;
+  this.statusText = null;
+
+  /**
+   * Private methods
+   */
+
+  /**
+   * Check if the specified header is allowed.
+   *
+   * @param string header Header to validate
+   * @return boolean False if not allowed, otherwise true
+   */
+  var isAllowedHttpHeader = function(header) {
+    return disableHeaderCheck || (header && forbiddenRequestHeaders.indexOf(header.toLowerCase()) === -1);
+  };
+
+  /**
+   * Check if the specified method is allowed.
+   *
+   * @param string method Request method to validate
+   * @return boolean False if not allowed, otherwise true
+   */
+  var isAllowedHttpMethod = function(method) {
+    return (method && forbiddenRequestMethods.indexOf(method) === -1);
+  };
+
+  /**
+   * Public methods
+   */
+
+  /**
+   * Open the connection. Currently supports local server requests.
+   *
+   * @param string method Connection method (eg GET, POST)
+   * @param string url URL for the connection.
+   * @param boolean async Asynchronous connection. Default is true.
+   * @param string user Username for basic authentication (optional)
+   * @param string password Password for basic authentication (optional)
+   */
+  this.open = function(method, url, async, user, password) {
+    this.abort();
+    errorFlag = false;
+
+    // Check for valid request method
+    if (!isAllowedHttpMethod(method)) {
+      throw "SecurityError: Request method not allowed";
+    }
+
+    settings = {
+      "method": method,
+      "url": url.toString(),
+      "async": (typeof async !== "boolean" ? true : async),
+      "user": user || null,
+      "password": password || null
+    };
+
+    setState(this.OPENED);
+  };
+
+  /**
+   * Disables or enables isAllowedHttpHeader() check the request. Enabled by default.
+   * This does not conform to the W3C spec.
+   *
+   * @param boolean state Enable or disable header checking.
+   */
+  this.setDisableHeaderCheck = function(state) {
+    disableHeaderCheck = state;
+  };
+
+  /**
+   * Sets a header for the request.
+   *
+   * @param string header Header name
+   * @param string value Header value
+   * @return boolean Header added
+   */
+  this.setRequestHeader = function(header, value) {
+    if (this.readyState != this.OPENED) {
+      throw "INVALID_STATE_ERR: setRequestHeader can only be called when state is OPEN";
+      return false;
+    }
+    if (!isAllowedHttpHeader(header)) {
+      console.warn('Refused to set unsafe header "' + header + '"');
+      return false;
+    }
+    if (sendFlag) {
+      throw "INVALID_STATE_ERR: send flag is true";
+      return false;
+    }
+    headers[header] = value;
+    return true;
+  };
+
+  /**
+   * Gets a header from the server response.
+   *
+   * @param string header Name of header to get.
+   * @return string Text of the header or null if it doesn't exist.
+   */
+  this.getResponseHeader = function(header) {
+    if (typeof header === "string"
+      && this.readyState > this.OPENED
+      && response.headers[header.toLowerCase()]
+      && !errorFlag
+    ) {
+      return response.headers[header.toLowerCase()];
+    }
+
+    return null;
+  };
+
+  /**
+   * Gets all the response headers.
+   *
+   * @return string A string with all response headers separated by CR+LF
+   */
+  this.getAllResponseHeaders = function() {
+    if (this.readyState < this.HEADERS_RECEIVED || errorFlag) {
+      return "";
+    }
+    var result = "";
+
+    for (var i in response.headers) {
+      // Cookie headers are excluded
+      if (i !== "set-cookie" && i !== "set-cookie2") {
+        result += i + ": " + response.headers[i] + "\r\n";
+      }
+    }
+    return result.substr(0, result.length - 2);
+  };
+
+  /**
+   * Gets a request header
+   *
+   * @param string name Name of header to get
+   * @return string Returns the request header or empty string if not set
+   */
+  this.getRequestHeader = function(name) {
+    // @TODO Make this case insensitive
+    if (typeof name === "string" && headers[name]) {
+      return headers[name];
+    }
+
+    return "";
+  };
+
+  /**
+   * Sends the request to the server.
+   *
+   * @param string data Optional data to send as request body.
+   */
+  this.send = function(data) {
+    if (this.readyState != this.OPENED) {
+      throw "INVALID_STATE_ERR: connection must be opened before send() is called";
+    }
+
+    if (sendFlag) {
+      throw "INVALID_STATE_ERR: send has already been called";
+    }
+
+    var ssl = false, local = false;
+    var url = Url.parse(settings.url);
+    var host;
+    // Determine the server
+    switch (url.protocol) {
+      case 'https:':
+        ssl = true;
+        // SSL & non-SSL both need host, no break here.
+      case 'http:':
+        host = url.hostname;
+        break;
+
+      case 'file:':
+        local = true;
+        break;
+
+      case undefined:
+      case '':
+        host = "localhost";
+        break;
+
+      default:
+        throw "Protocol not supported.";
+    }
+
+    // Load files off the local filesystem (file://)
+    if (local) {
+      if (settings.method !== "GET") {
+        throw "XMLHttpRequest: Only GET method is supported";
+      }
+
+      if (settings.async) {
+        fs.readFile(url.pathname, 'utf8', function(error, data) {
+          if (error) {
+            self.handleError(error);
+          } else {
+            self.status = 200;
+            self.responseText = data;
+            setState(self.DONE);
+          }
+        });
+      } else {
+        try {
+          this.responseText = fs.readFileSync(url.pathname, 'utf8');
+          this.status = 200;
+          setState(self.DONE);
+        } catch(e) {
+          this.handleError(e);
+        }
+      }
+
+      return;
+    }
+
+    // Default to port 80. If accessing localhost on another port be sure
+    // to use http://localhost:port/path
+    var port = url.port || (ssl ? 443 : 80);
+    // Add query string if one is used
+    var uri = url.pathname + (url.search ? url.search : '');
+
+    // Set the Host header or the server may reject the request
+    headers["Host"] = host;
+    if (!((ssl && port === 443) || port === 80)) {
+      headers["Host"] += ':' + url.port;
+    }
+
+    // Set Basic Auth if necessary
+    if (settings.user) {
+      if (typeof settings.password == "undefined") {
+        settings.password = "";
+      }
+      var authBuf = new Buffer(settings.user + ":" + settings.password);
+      headers["Authorization"] = "Basic " + authBuf.toString("base64");
+    }
+
+    // Set content length header
+    if (settings.method === "GET" || settings.method === "HEAD") {
+      data = null;
+    } else if (data) {
+      headers["Content-Length"] = Buffer.isBuffer(data) ? data.length : Buffer.byteLength(data);
+
+      if (!headers["Content-Type"]) {
+        headers["Content-Type"] = "text/plain;charset=UTF-8";
+      }
+    } else if (settings.method === "POST") {
+      // For a post with no data set Content-Length: 0.
+      // This is required by buggy servers that don't meet the specs.
+      headers["Content-Length"] = 0;
+    }
+
+    var agent = false;
+    if (opts && opts.agent) {
+      agent = opts.agent;
+    }
+    var options = {
+      host: host,
+      port: port,
+      path: uri,
+      method: settings.method,
+      headers: headers,
+      agent: agent
+    };
+
+    if (ssl) {
+      options.pfx = opts.pfx;
+      options.key = opts.key;
+      options.passphrase = opts.passphrase;
+      options.cert = opts.cert;
+      options.ca = opts.ca;
+      options.ciphers = opts.ciphers;
+      options.rejectUnauthorized = opts.rejectUnauthorized;
+    }
+
+    // Reset error flag
+    errorFlag = false;
+
+    // Handle async requests
+    if (settings.async) {
+      // Use the proper protocol
+      var doRequest = ssl ? https.request : http.request;
+
+      // Request is being sent, set send flag
+      sendFlag = true;
+
+      // As per spec, this is called here for historical reasons.
+      self.dispatchEvent("readystatechange");
+
+      // Handler for the response
+      var responseHandler = function(resp) {
+        // Set response var to the response we got back
+        // This is so it remains accessable outside this scope
+        response = resp;
+        // Check for redirect
+        // @TODO Prevent looped redirects
+        if (response.statusCode === 302 || response.statusCode === 303 || response.statusCode === 307) {
+          // Change URL to the redirect location
+          settings.url = response.headers.location;
+          var url = Url.parse(settings.url);
+          // Set host var in case it's used later
+          host = url.hostname;
+          // Options for the new request
+          var newOptions = {
+            hostname: url.hostname,
+            port: url.port,
+            path: url.path,
+            method: response.statusCode === 303 ? 'GET' : settings.method,
+            headers: headers
+          };
+
+          if (ssl) {
+            newOptions.pfx = opts.pfx;
+            newOptions.key = opts.key;
+            newOptions.passphrase = opts.passphrase;
+            newOptions.cert = opts.cert;
+            newOptions.ca = opts.ca;
+            newOptions.ciphers = opts.ciphers;
+            newOptions.rejectUnauthorized = opts.rejectUnauthorized;
+          }
+
+          // Issue the new request
+          request = doRequest(newOptions, responseHandler).on('error', errorHandler);
+          request.end();
+          // @TODO Check if an XHR event needs to be fired here
+          return;
+        }
+
+        if (response && response.setEncoding) {
+          response.setEncoding("utf8");
+        }
+
+        setState(self.HEADERS_RECEIVED);
+        self.status = response.statusCode;
+
+        response.on('data', function(chunk) {
+          // Make sure there's some data
+          if (chunk) {
+            self.responseText += chunk;
+          }
+          // Don't emit state changes if the connection has been aborted.
+          if (sendFlag) {
+            setState(self.LOADING);
+          }
+        });
+
+        response.on('end', function() {
+          if (sendFlag) {
+            // Discard the 'end' event if the connection has been aborted
+            setState(self.DONE);
+            sendFlag = false;
+          }
+        });
+
+        response.on('error', function(error) {
+          self.handleError(error);
+        });
+      }
+
+      // Error handler for the request
+      var errorHandler = function(error) {
+        self.handleError(error);
+      }
+
+      // Create the request
+      request = doRequest(options, responseHandler).on('error', errorHandler);
+
+      // Node 0.4 and later won't accept empty data. Make sure it's needed.
+      if (data) {
+        request.write(data);
+      }
+
+      request.end();
+
+      self.dispatchEvent("loadstart");
+    } else { // Synchronous
+      // Create a temporary file for communication with the other Node process
+      var contentFile = ".node-xmlhttprequest-content-" + process.pid;
+      var syncFile = ".node-xmlhttprequest-sync-" + process.pid;
+      fs.writeFileSync(syncFile, "", "utf8");
+      // The async request the other Node process executes
+      var execString = "var http = require('http'), https = require('https'), fs = require('fs');"
+        + "var doRequest = http" + (ssl ? "s" : "") + ".request;"
+        + "var options = " + JSON.stringify(options) + ";"
+        + "var responseText = '';"
+        + "var req = doRequest(options, function(response) {"
+        + "response.setEncoding('utf8');"
+        + "response.on('data', function(chunk) {"
+        + "  responseText += chunk;"
+        + "});"
+        + "response.on('end', function() {"
+        + "fs.writeFileSync('" + contentFile + "', 'NODE-XMLHTTPREQUEST-STATUS:' + response.statusCode + ',' + responseText, 'utf8');"
+        + "fs.unlinkSync('" + syncFile + "');"
+        + "});"
+        + "response.on('error', function(error) {"
+        + "fs.writeFileSync('" + contentFile + "', 'NODE-XMLHTTPREQUEST-ERROR:' + JSON.stringify(error), 'utf8');"
+        + "fs.unlinkSync('" + syncFile + "');"
+        + "});"
+        + "}).on('error', function(error) {"
+        + "fs.writeFileSync('" + contentFile + "', 'NODE-XMLHTTPREQUEST-ERROR:' + JSON.stringify(error), 'utf8');"
+        + "fs.unlinkSync('" + syncFile + "');"
+        + "});"
+        + (data ? "req.write('" + data.replace(/'/g, "\\'") + "');":"")
+        + "req.end();";
+      // Start the other Node Process, executing this string
+      var syncProc = spawn(process.argv[0], ["-e", execString]);
+      var statusText;
+      while(fs.existsSync(syncFile)) {
+        // Wait while the sync file is empty
+      }
+      self.responseText = fs.readFileSync(contentFile, 'utf8');
+      // Kill the child process once the file has data
+      syncProc.stdin.end();
+      // Remove the temporary file
+      fs.unlinkSync(contentFile);
+      if (self.responseText.match(/^NODE-XMLHTTPREQUEST-ERROR:/)) {
+        // If the file returned an error, handle it
+        var errorObj = self.responseText.replace(/^NODE-XMLHTTPREQUEST-ERROR:/, "");
+        self.handleError(errorObj);
+      } else {
+        // If the file returned okay, parse its data and move to the DONE state
+        self.status = self.responseText.replace(/^NODE-XMLHTTPREQUEST-STATUS:([0-9]*),.*/, "$1");
+        self.responseText = self.responseText.replace(/^NODE-XMLHTTPREQUEST-STATUS:[0-9]*,(.*)/, "$1");
+        setState(self.DONE);
+      }
+    }
+  };
+
+  /**
+   * Called when an error is encountered to deal with it.
+   */
+  this.handleError = function(error) {
+    this.status = 503;
+    this.statusText = error;
+    this.responseText = error.stack;
+    errorFlag = true;
+    setState(this.DONE);
+  };
+
+  /**
+   * Aborts a request.
+   */
+  this.abort = function() {
+    if (request) {
+      request.abort();
+      request = null;
+    }
+
+    headers = defaultHeaders;
+    this.responseText = "";
+    this.responseXML = "";
+
+    errorFlag = true;
+
+    if (this.readyState !== this.UNSENT
+        && (this.readyState !== this.OPENED || sendFlag)
+        && this.readyState !== this.DONE) {
+      sendFlag = false;
+      setState(this.DONE);
+    }
+    this.readyState = this.UNSENT;
+  };
+
+  /**
+   * Adds an event listener. Preferred method of binding to events.
+   */
+  this.addEventListener = function(event, callback) {
+    if (!(event in listeners)) {
+      listeners[event] = [];
+    }
+    // Currently allows duplicate callbacks. Should it?
+    listeners[event].push(callback);
+  };
+
+  /**
+   * Remove an event callback that has already been bound.
+   * Only works on the matching funciton, cannot be a copy.
+   */
+  this.removeEventListener = function(event, callback) {
+    if (event in listeners) {
+      // Filter will return a new array with the callback removed
+      listeners[event] = listeners[event].filter(function(ev) {
+        return ev !== callback;
+      });
+    }
+  };
+
+  /**
+   * Dispatch any events, including both "on" methods and events attached using addEventListener.
+   */
+  this.dispatchEvent = function(event) {
+    if (typeof self["on" + event] === "function") {
+      self["on" + event]();
+    }
+    if (event in listeners) {
+      for (var i = 0, len = listeners[event].length; i < len; i++) {
+        listeners[event][i].call(self);
+      }
+    }
+  };
+
+  /**
+   * Changes readyState and calls onreadystatechange.
+   *
+   * @param int state New state
+   */
+  var setState = function(state) {
+    if (self.readyState !== state) {
+      self.readyState = state;
+
+      if (settings.async || self.readyState < self.OPENED || self.readyState === self.DONE) {
+        self.dispatchEvent("readystatechange");
+      }
+
+      if (self.readyState === self.DONE && !errorFlag) {
+        self.dispatchEvent("load");
+        // @TODO figure out InspectorInstrumentation::didLoadXHR(cookie)
+        self.dispatchEvent("loadend");
+      }
+    }
+  };
+};
diff --git a/wrt/node_modules/xmlhttprequest-ssl/package.json b/wrt/node_modules/xmlhttprequest-ssl/package.json
new file mode 100644 (file)
index 0000000..fddea01
--- /dev/null
@@ -0,0 +1,98 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "xmlhttprequest-ssl@1.5.3",
+        "scope": null,
+        "escapedName": "xmlhttprequest-ssl",
+        "name": "xmlhttprequest-ssl",
+        "rawSpec": "1.5.3",
+        "spec": "1.5.3",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io-client"
+    ]
+  ],
+  "_from": "xmlhttprequest-ssl@1.5.3",
+  "_id": "xmlhttprequest-ssl@1.5.3",
+  "_inCache": true,
+  "_location": "/xmlhttprequest-ssl",
+  "_nodeVersion": "6.1.0",
+  "_npmOperationalInternal": {
+    "host": "packages-16-east.internal.npmjs.com",
+    "tmp": "tmp/xmlhttprequest-ssl-1.5.3.tgz_1474374069567_0.6647198903374374"
+  },
+  "_npmUser": {
+    "name": "mjwwit",
+    "email": "mjwwit@gmail.com"
+  },
+  "_npmVersion": "3.9.6",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "xmlhttprequest-ssl@1.5.3",
+    "scope": null,
+    "escapedName": "xmlhttprequest-ssl",
+    "name": "xmlhttprequest-ssl",
+    "rawSpec": "1.5.3",
+    "spec": "1.5.3",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/engine.io-client"
+  ],
+  "_resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.3.tgz",
+  "_shasum": "185a888c04eca46c3e4070d99f7b49de3528992d",
+  "_shrinkwrap": null,
+  "_spec": "xmlhttprequest-ssl@1.5.3",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io-client",
+  "author": {
+    "name": "Michael de Wit"
+  },
+  "bugs": {
+    "url": "http://github.com/mjwwit/node-XMLHttpRequest/issues"
+  },
+  "dependencies": {},
+  "description": "XMLHttpRequest for Node",
+  "devDependencies": {},
+  "directories": {
+    "lib": "./lib",
+    "example": "./example"
+  },
+  "dist": {
+    "shasum": "185a888c04eca46c3e4070d99f7b49de3528992d",
+    "tarball": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.3.tgz"
+  },
+  "engines": {
+    "node": ">=0.4.0"
+  },
+  "gitHead": "d35e16183e162f3c67b29191ab20e4c81db68742",
+  "homepage": "https://github.com/mjwwit/node-XMLHttpRequest#readme",
+  "keywords": [
+    "xhr",
+    "ajax"
+  ],
+  "licenses": [
+    {
+      "type": "MIT",
+      "url": "http://creativecommons.org/licenses/MIT/"
+    }
+  ],
+  "main": "./lib/XMLHttpRequest.js",
+  "maintainers": [
+    {
+      "name": "mjwwit",
+      "email": "mjwwit@gmail.com"
+    }
+  ],
+  "name": "xmlhttprequest-ssl",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/mjwwit/node-XMLHttpRequest.git"
+  },
+  "scripts": {
+    "test": "cd ./tests && node test-constants.js && node test-events.js && node test-exceptions.js && node test-headers.js && node test-redirect-302.js && node test-redirect-303.js && node test-redirect-307.js && node test-request-methods.js && node test-request-protocols.js"
+  },
+  "version": "1.5.3"
+}
diff --git a/wrt/node_modules/xmlhttprequest-ssl/tests/test-constants.js b/wrt/node_modules/xmlhttprequest-ssl/tests/test-constants.js
new file mode 100644 (file)
index 0000000..372e46c
--- /dev/null
@@ -0,0 +1,13 @@
+var sys = require("util")
+  , assert = require("assert")
+  , XMLHttpRequest = require("../lib/XMLHttpRequest").XMLHttpRequest
+  , xhr = new XMLHttpRequest();
+
+// Test constant values
+assert.equal(0, xhr.UNSENT);
+assert.equal(1, xhr.OPENED);
+assert.equal(2, xhr.HEADERS_RECEIVED);
+assert.equal(3, xhr.LOADING);
+assert.equal(4, xhr.DONE);
+
+sys.puts("done");
diff --git a/wrt/node_modules/xmlhttprequest-ssl/tests/test-events.js b/wrt/node_modules/xmlhttprequest-ssl/tests/test-events.js
new file mode 100644 (file)
index 0000000..c72f001
--- /dev/null
@@ -0,0 +1,50 @@
+var sys = require("util")
+  , assert = require("assert")
+  , http = require("http")
+  , XMLHttpRequest = require("../lib/XMLHttpRequest").XMLHttpRequest
+  , xhr;
+
+// Test server
+var server = http.createServer(function (req, res) {
+  var body = (req.method != "HEAD" ? "Hello World" : "");
+
+  res.writeHead(200, {
+    "Content-Type": "text/plain",
+    "Content-Length": Buffer.byteLength(body)
+  });
+  // HEAD has no body
+  if (req.method != "HEAD") {
+    res.write(body);
+  }
+  res.end();
+  assert.equal(onreadystatechange, true);
+  assert.equal(readystatechange, true);
+  assert.equal(removed, true);
+  sys.puts("done");
+  this.close();
+}).listen(8000);
+
+xhr = new XMLHttpRequest();
+
+// Track event calls
+var onreadystatechange = false;
+var readystatechange = false;
+var removed = true;
+var removedEvent = function() {
+  removed = false;
+};
+
+xhr.onreadystatechange = function() {
+  onreadystatechange = true;
+};
+
+xhr.addEventListener("readystatechange", function() {
+  readystatechange = true;
+});
+
+// This isn't perfect, won't guarantee it was added in the first place
+xhr.addEventListener("readystatechange", removedEvent);
+xhr.removeEventListener("readystatechange", removedEvent);
+
+xhr.open("GET", "http://localhost:8000");
+xhr.send();
diff --git a/wrt/node_modules/xmlhttprequest-ssl/tests/test-exceptions.js b/wrt/node_modules/xmlhttprequest-ssl/tests/test-exceptions.js
new file mode 100644 (file)
index 0000000..10eaea2
--- /dev/null
@@ -0,0 +1,59 @@
+var sys = require("util")
+  , assert = require("assert")
+  , XMLHttpRequest = require("../lib/XMLHttpRequest").XMLHttpRequest
+  , xhr = new XMLHttpRequest();
+
+// Test request methods that aren't allowed
+try {
+  xhr.open("TRACK", "http://localhost:8000/");
+  console.log("ERROR: TRACK should have thrown exception");
+} catch(e) {}
+try {
+  xhr.open("TRACE", "http://localhost:8000/");
+  console.log("ERROR: TRACE should have thrown exception");
+} catch(e) {}
+try {
+  xhr.open("CONNECT", "http://localhost:8000/");
+  console.log("ERROR: CONNECT should have thrown exception");
+} catch(e) {}
+// Test valid request method
+try {
+  xhr.open("GET", "http://localhost:8000/");
+} catch(e) {
+  console.log("ERROR: Invalid exception for GET", e);
+}
+
+// Test forbidden headers
+var forbiddenRequestHeaders = [
+  "accept-charset",
+  "accept-encoding",
+  "access-control-request-headers",
+  "access-control-request-method",
+  "connection",
+  "content-length",
+  "content-transfer-encoding",
+  "cookie",
+  "cookie2",
+  "date",
+  "expect",
+  "host",
+  "keep-alive",
+  "origin",
+  "referer",
+  "te",
+  "trailer",
+  "transfer-encoding",
+  "upgrade",
+  "via"
+];
+
+for (var i in forbiddenRequestHeaders) {
+  if(xhr.setRequestHeader(forbiddenRequestHeaders[i], "Test") !== false) {
+    console.log("ERROR: " + forbiddenRequestHeaders[i] + " should have thrown exception");
+  }
+}
+
+// Try valid header
+xhr.setRequestHeader("X-Foobar", "Test");
+
+console.log("Done");
diff --git a/wrt/node_modules/xmlhttprequest-ssl/tests/test-headers.js b/wrt/node_modules/xmlhttprequest-ssl/tests/test-headers.js
new file mode 100644 (file)
index 0000000..76454f1
--- /dev/null
@@ -0,0 +1,76 @@
+var sys = require("util")
+  , assert = require("assert")
+  , XMLHttpRequest = require("../lib/XMLHttpRequest").XMLHttpRequest
+  , xhr = new XMLHttpRequest()
+  , http = require("http");
+
+// Test server
+var server = http.createServer(function (req, res) {
+  // Test setRequestHeader
+  assert.equal("Foobar", req.headers["x-test"]);
+  // Test non-conforming allowed header
+  assert.equal("node-XMLHttpRequest-test", req.headers["user-agent"]);
+  // Test header set with blacklist disabled
+  assert.equal("http://github.com", req.headers["referer"]);
+
+  var body = "Hello World";
+  res.writeHead(200, {
+    "Content-Type": "text/plain",
+    "Content-Length": Buffer.byteLength(body),
+    // Set cookie headers to see if they're correctly suppressed
+    // Actual values don't matter
+    "Set-Cookie": "foo=bar",
+    "Set-Cookie2": "bar=baz",
+    "Date": "Thu, 30 Aug 2012 18:17:53 GMT",
+    "Connection": "close"
+  });
+  res.write("Hello World");
+  res.end();
+
+  this.close();
+}).listen(8000);
+
+xhr.onreadystatechange = function() {
+  if (this.readyState == 4) {
+    // Test getAllResponseHeaders()
+    var headers = "content-type: text/plain\r\ncontent-length: 11\r\ndate: Thu, 30 Aug 2012 18:17:53 GMT\r\nconnection: close";
+    assert.equal(headers, this.getAllResponseHeaders());
+
+    // Test case insensitivity
+    assert.equal('text/plain', this.getResponseHeader('Content-Type'));
+    assert.equal('text/plain', this.getResponseHeader('Content-type'));
+    assert.equal('text/plain', this.getResponseHeader('content-Type'));
+    assert.equal('text/plain', this.getResponseHeader('content-type'));
+
+    // Test aborted getAllResponseHeaders
+    this.abort();
+    assert.equal("", this.getAllResponseHeaders());
+    assert.equal(null, this.getResponseHeader("Connection"));
+
+    sys.puts("done");
+  }
+};
+
+assert.equal(null, xhr.getResponseHeader("Content-Type"));
+try {
+  xhr.open("GET", "http://localhost:8000/");
+  // Valid header
+  xhr.setRequestHeader("X-Test", "Foobar");
+  // Invalid header
+  xhr.setRequestHeader("Content-Length", 0);
+  // Allowed header outside of specs
+  xhr.setRequestHeader("user-agent", "node-XMLHttpRequest-test");
+  // Test getRequestHeader
+  assert.equal("Foobar", xhr.getRequestHeader("X-Test"));
+  // Test invalid header
+  assert.equal("", xhr.getRequestHeader("Content-Length"));
+
+  // Test allowing all headers
+  xhr.setDisableHeaderCheck(true);
+  xhr.setRequestHeader("Referer", "http://github.com");
+  assert.equal("http://github.com", xhr.getRequestHeader("Referer"));
+
+  xhr.send();
+} catch(e) {
+  console.log("ERROR: Exception raised", e);
+}
diff --git a/wrt/node_modules/xmlhttprequest-ssl/tests/test-redirect-302.js b/wrt/node_modules/xmlhttprequest-ssl/tests/test-redirect-302.js
new file mode 100644 (file)
index 0000000..d884f78
--- /dev/null
@@ -0,0 +1,41 @@
+var sys = require("util")
+  , assert = require("assert")
+  , XMLHttpRequest = require("../lib/XMLHttpRequest").XMLHttpRequest
+  , xhr = new XMLHttpRequest()
+  , http = require("http");
+
+// Test server
+var server = http.createServer(function (req, res) {
+  if (req.url === '/redirectingResource') {
+    res.writeHead(302, {'Location': 'http://localhost:8000/'});
+    res.end();
+    return;
+  }
+
+  var body = "Hello World";
+  res.writeHead(200, {
+    "Content-Type": "text/plain",
+    "Content-Length": Buffer.byteLength(body),
+    "Date": "Thu, 30 Aug 2012 18:17:53 GMT",
+    "Connection": "close"
+  });
+  res.write("Hello World");
+  res.end();
+
+  this.close();
+}).listen(8000);
+
+xhr.onreadystatechange = function() {
+  if (this.readyState == 4) {
+    assert.equal(xhr.getRequestHeader('Location'), '');
+    assert.equal(xhr.responseText, "Hello World");
+    sys.puts("done");
+  }
+};
+
+try {
+  xhr.open("GET", "http://localhost:8000/redirectingResource");
+  xhr.send();
+} catch(e) {
+  console.log("ERROR: Exception raised", e);
+}
diff --git a/wrt/node_modules/xmlhttprequest-ssl/tests/test-redirect-303.js b/wrt/node_modules/xmlhttprequest-ssl/tests/test-redirect-303.js
new file mode 100644 (file)
index 0000000..60d9343
--- /dev/null
@@ -0,0 +1,41 @@
+var sys = require("util")
+  , assert = require("assert")
+  , XMLHttpRequest = require("../lib/XMLHttpRequest").XMLHttpRequest
+  , xhr = new XMLHttpRequest()
+  , http = require("http");
+
+// Test server
+var server = http.createServer(function (req, res) {
+  if (req.url === '/redirectingResource') {
+    res.writeHead(303, {'Location': 'http://localhost:8000/'});
+    res.end();
+    return;
+  }
+
+  var body = "Hello World";
+  res.writeHead(200, {
+    "Content-Type": "text/plain",
+    "Content-Length": Buffer.byteLength(body),
+    "Date": "Thu, 30 Aug 2012 18:17:53 GMT",
+    "Connection": "close"
+  });
+  res.write("Hello World");
+  res.end();
+
+  this.close();
+}).listen(8000);
+
+xhr.onreadystatechange = function() {
+  if (this.readyState == 4) {
+    assert.equal(xhr.getRequestHeader('Location'), '');
+    assert.equal(xhr.responseText, "Hello World");
+    sys.puts("done");
+  }
+};
+
+try {
+  xhr.open("POST", "http://localhost:8000/redirectingResource");
+  xhr.send();
+} catch(e) {
+  console.log("ERROR: Exception raised", e);
+}
diff --git a/wrt/node_modules/xmlhttprequest-ssl/tests/test-redirect-307.js b/wrt/node_modules/xmlhttprequest-ssl/tests/test-redirect-307.js
new file mode 100644 (file)
index 0000000..3abc906
--- /dev/null
@@ -0,0 +1,43 @@
+var sys = require("util")
+  , assert = require("assert")
+  , XMLHttpRequest = require("../lib/XMLHttpRequest").XMLHttpRequest
+  , xhr = new XMLHttpRequest()
+  , http = require("http");
+
+// Test server
+var server = http.createServer(function (req, res) {
+  if (req.url === '/redirectingResource') {
+    res.writeHead(307, {'Location': 'http://localhost:8000/'});
+    res.end();
+    return;
+  }
+
+  assert.equal(req.method, 'POST');
+
+  var body = "Hello World";
+  res.writeHead(200, {
+    "Content-Type": "text/plain",
+    "Content-Length": Buffer.byteLength(body),
+    "Date": "Thu, 30 Aug 2012 18:17:53 GMT",
+    "Connection": "close"
+  });
+  res.write("Hello World");
+  res.end();
+
+  this.close();
+}).listen(8000);
+
+xhr.onreadystatechange = function() {
+  if (this.readyState == 4) {
+    assert.equal(xhr.getRequestHeader('Location'), '');
+    assert.equal(xhr.responseText, "Hello World");
+    sys.puts("done");
+  }
+};
+
+try {
+  xhr.open("POST", "http://localhost:8000/redirectingResource");
+  xhr.send();
+} catch(e) {
+  console.log("ERROR: Exception raised", e);
+}
diff --git a/wrt/node_modules/xmlhttprequest-ssl/tests/test-request-methods.js b/wrt/node_modules/xmlhttprequest-ssl/tests/test-request-methods.js
new file mode 100644 (file)
index 0000000..fa1b1be
--- /dev/null
@@ -0,0 +1,62 @@
+var sys = require("util")
+  , assert = require("assert")
+  , XMLHttpRequest = require("../lib/XMLHttpRequest").XMLHttpRequest
+  , http = require("http")
+  , xhr;
+
+// Test server
+var server = http.createServer(function (req, res) {
+  // Check request method and URL
+  assert.equal(methods[curMethod], req.method);
+  assert.equal("/" + methods[curMethod], req.url);
+
+  var body = (req.method != "HEAD" ? "Hello World" : "");
+
+  res.writeHead(200, {
+    "Content-Type": "text/plain",
+    "Content-Length": Buffer.byteLength(body)
+  });
+  // HEAD has no body
+  if (req.method != "HEAD") {
+    res.write(body);
+  }
+  res.end();
+
+  if (curMethod == methods.length - 1) {
+    this.close();
+    sys.puts("done");
+  }
+}).listen(8000);
+
+// Test standard methods
+var methods = ["GET", "POST", "HEAD", "PUT", "DELETE"];
+var curMethod = 0;
+
+function start(method) {
+  // Reset each time
+  xhr = new XMLHttpRequest();
+
+  xhr.onreadystatechange = function() {
+    if (this.readyState == 4) {
+      if (method == "HEAD") {
+        assert.equal("", this.responseText);
+      } else {
+        assert.equal("Hello World", this.responseText);
+      }
+
+      curMethod++;
+
+      if (curMethod < methods.length) {
+        sys.puts("Testing " + methods[curMethod]);
+        start(methods[curMethod]);
+      }
+    }
+  };
+
+  var url = "http://localhost:8000/" + method;
+  xhr.open(method, url);
+  xhr.send();
+}
+
+sys.puts("Testing " + methods[curMethod]);
+start(methods[curMethod]);
diff --git a/wrt/node_modules/xmlhttprequest-ssl/tests/test-request-protocols.js b/wrt/node_modules/xmlhttprequest-ssl/tests/test-request-protocols.js
new file mode 100644 (file)
index 0000000..543917d
--- /dev/null
@@ -0,0 +1,32 @@
+var sys = require("util")
+  , assert = require("assert")
+  , XMLHttpRequest = require("../lib/XMLHttpRequest").XMLHttpRequest
+  , xhr;
+
+xhr = new XMLHttpRequest();
+
+xhr.onreadystatechange = function() {
+  if (this.readyState == 4) {
+    assert.equal("Hello World", this.responseText);
+    runSync();
+  }
+};
+
+// Async
+var url = "file://" + __dirname + "/testdata.txt";
+xhr.open("GET", url);
+xhr.send();
+
+// Sync
+var runSync = function() {
+  xhr = new XMLHttpRequest();
+
+  xhr.onreadystatechange = function() {
+    if (this.readyState == 4) {
+      assert.equal("Hello World", this.responseText);
+      sys.puts("done");
+    }
+  };
+  xhr.open("GET", url, false);
+  xhr.send();
+}
diff --git a/wrt/node_modules/xmlhttprequest-ssl/tests/testdata.txt b/wrt/node_modules/xmlhttprequest-ssl/tests/testdata.txt
new file mode 100644 (file)
index 0000000..5e1c309
--- /dev/null
@@ -0,0 +1 @@
+Hello World
\ No newline at end of file
diff --git a/wrt/node_modules/y18n/LICENSE b/wrt/node_modules/y18n/LICENSE
new file mode 100644 (file)
index 0000000..3c157f0
--- /dev/null
@@ -0,0 +1,13 @@
+Copyright (c) 2015, Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any purpose
+with or without fee is hereby granted, provided that the above copyright notice
+and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+THIS SOFTWARE.
diff --git a/wrt/node_modules/y18n/README.md b/wrt/node_modules/y18n/README.md
new file mode 100644 (file)
index 0000000..9859458
--- /dev/null
@@ -0,0 +1,91 @@
+# y18n
+
+[![Build Status][travis-image]][travis-url]
+[![Coverage Status][coveralls-image]][coveralls-url]
+[![NPM version][npm-image]][npm-url]
+[![js-standard-style][standard-image]][standard-url]
+
+The bare-bones internationalization library used by yargs.
+
+Inspired by [i18n](https://www.npmjs.com/package/i18n).
+
+## Examples
+
+_simple string translation:_
+
+```js
+var __ = require('y18n').__
+
+console.log(__('my awesome string %s', 'foo'))
+```
+
+output:
+
+`my awesome string foo`
+
+_pluralization support:_
+
+```js
+var __n = require('y18n').__n
+
+console.log(__n('one fish %s', '%d fishes %s', 2, 'foo'))
+```
+
+output:
+
+`2 fishes foo`
+
+## JSON Language Files
+
+The JSON language files should be stored in a `./locales` folder.
+File names correspond to locales, e.g., `en.json`, `pirate.json`.
+
+When strings are observed for the first time they will be
+added to the JSON file corresponding to the current locale.
+
+## Methods
+
+### require('y18n')(config)
+
+Create an instance of y18n with the config provided, options include:
+
+* `directory`: the locale directory, default `./locales`.
+* `updateFiles`: should newly observed strings be updated in file, default `true`.
+* `locale`: what locale should be used.
+* `fallbackToLanguage`: should fallback to a language-only file (e.g. `en.json`)
+  be allowed if a file matching the locale does not exist (e.g. `en_US.json`),
+  default `true`.
+
+### y18n.\_\_(str, arg, arg, arg)
+
+Print a localized string, `%s` will be replaced with `arg`s.
+
+### y18n.\_\_n(singularString, pluralString, count, arg, arg, arg)
+
+Print a localized string with appropriate pluralization. If `%d` is provided
+in the string, the `count` will replace this placeholder.
+
+### y18n.setLocale(str)
+
+Set the current locale being used.
+
+### y18n.getLocale()
+
+What locale is currently being used?
+
+### y18n.updateLocale(obj)
+
+Update the current locale with the key value pairs in `obj`.
+
+## License
+
+ISC
+
+[travis-url]: https://travis-ci.org/yargs/y18n
+[travis-image]: https://img.shields.io/travis/yargs/y18n.svg
+[coveralls-url]: https://coveralls.io/github/yargs/y18n
+[coveralls-image]: https://img.shields.io/coveralls/yargs/y18n.svg
+[npm-url]: https://npmjs.org/package/y18n
+[npm-image]: https://img.shields.io/npm/v/y18n.svg
+[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg
+[standard-url]: https://github.com/feross/standard
diff --git a/wrt/node_modules/y18n/index.js b/wrt/node_modules/y18n/index.js
new file mode 100644 (file)
index 0000000..91b159e
--- /dev/null
@@ -0,0 +1,172 @@
+var fs = require('fs')
+var path = require('path')
+var util = require('util')
+
+function Y18N (opts) {
+  // configurable options.
+  opts = opts || {}
+  this.directory = opts.directory || './locales'
+  this.updateFiles = typeof opts.updateFiles === 'boolean' ? opts.updateFiles : true
+  this.locale = opts.locale || 'en'
+  this.fallbackToLanguage = typeof opts.fallbackToLanguage === 'boolean' ? opts.fallbackToLanguage : true
+
+  // internal stuff.
+  this.cache = {}
+  this.writeQueue = []
+}
+
+Y18N.prototype.__ = function () {
+  var args = Array.prototype.slice.call(arguments)
+  var str = args.shift()
+  var cb = function () {} // start with noop.
+
+  if (typeof args[args.length - 1] === 'function') cb = args.pop()
+  cb = cb || function () {} // noop.
+
+  if (!this.cache[this.locale]) this._readLocaleFile()
+
+  // we've observed a new string, update the language file.
+  if (!this.cache[this.locale][str] && this.updateFiles) {
+    this.cache[this.locale][str] = str
+
+    // include the current directory and locale,
+    // since these values could change before the
+    // write is performed.
+    this._enqueueWrite([this.directory, this.locale, cb])
+  } else {
+    cb()
+  }
+
+  return util.format.apply(util, [this.cache[this.locale][str] || str].concat(args))
+}
+
+Y18N.prototype._enqueueWrite = function (work) {
+  this.writeQueue.push(work)
+  if (this.writeQueue.length === 1) this._processWriteQueue()
+}
+
+Y18N.prototype._processWriteQueue = function () {
+  var _this = this
+  var work = this.writeQueue[0]
+
+  // destructure the enqueued work.
+  var directory = work[0]
+  var locale = work[1]
+  var cb = work[2]
+
+  var languageFile = this._resolveLocaleFile(directory, locale)
+  var serializedLocale = JSON.stringify(this.cache[locale], null, 2)
+
+  fs.writeFile(languageFile, serializedLocale, 'utf-8', function (err) {
+    _this.writeQueue.shift()
+    if (_this.writeQueue.length > 0) _this._processWriteQueue()
+    cb(err)
+  })
+}
+
+Y18N.prototype._readLocaleFile = function () {
+  var localeLookup = {}
+  var languageFile = this._resolveLocaleFile(this.directory, this.locale)
+
+  try {
+    localeLookup = JSON.parse(fs.readFileSync(languageFile, 'utf-8'))
+  } catch (err) {
+    if (err instanceof SyntaxError) {
+      err.message = 'syntax error in ' + languageFile
+    }
+
+    if (err.code === 'ENOENT') localeLookup = {}
+    else throw err
+  }
+
+  this.cache[this.locale] = localeLookup
+}
+
+Y18N.prototype._resolveLocaleFile = function (directory, locale) {
+  var file = path.resolve(directory, './', locale + '.json')
+  if (this.fallbackToLanguage && !this._fileExistsSync(file) && ~locale.lastIndexOf('_')) {
+    // attempt fallback to language only
+    var languageFile = path.resolve(directory, './', locale.split('_')[0] + '.json')
+    if (this._fileExistsSync(languageFile)) file = languageFile
+  }
+  return file
+}
+
+// this only exists because fs.existsSync() "will be deprecated"
+// see https://nodejs.org/api/fs.html#fs_fs_existssync_path
+Y18N.prototype._fileExistsSync = function (file) {
+  try {
+    return fs.statSync(file).isFile()
+  } catch (err) {
+    return false
+  }
+}
+
+Y18N.prototype.__n = function () {
+  var args = Array.prototype.slice.call(arguments)
+  var singular = args.shift()
+  var plural = args.shift()
+  var quantity = args.shift()
+
+  var cb = function () {} // start with noop.
+  if (typeof args[args.length - 1] === 'function') cb = args.pop()
+
+  if (!this.cache[this.locale]) this._readLocaleFile()
+
+  var str = quantity === 1 ? singular : plural
+  if (this.cache[this.locale][singular]) {
+    str = this.cache[this.locale][singular][quantity === 1 ? 'one' : 'other']
+  }
+
+  // we've observed a new string, update the language file.
+  if (!this.cache[this.locale][singular] && this.updateFiles) {
+    this.cache[this.locale][singular] = {
+      one: singular,
+      other: plural
+    }
+
+    // include the current directory and locale,
+    // since these values could change before the
+    // write is performed.
+    this._enqueueWrite([this.directory, this.locale, cb])
+  } else {
+    cb()
+  }
+
+  // if a %d placeholder is provided, add quantity
+  // to the arguments expanded by util.format.
+  var values = [str]
+  if (~str.indexOf('%d')) values.push(quantity)
+
+  return util.format.apply(util, values.concat(args))
+}
+
+Y18N.prototype.setLocale = function (locale) {
+  this.locale = locale
+}
+
+Y18N.prototype.getLocale = function () {
+  return this.locale
+}
+
+Y18N.prototype.updateLocale = function (obj) {
+  if (!this.cache[this.locale]) this._readLocaleFile()
+
+  for (var key in obj) {
+    this.cache[this.locale][key] = obj[key]
+  }
+}
+
+module.exports = function (opts) {
+  var y18n = new Y18N(opts)
+
+  // bind all functions to y18n, so that
+  // they can be used in isolation.
+  for (var key in y18n) {
+    if (typeof y18n[key] === 'function') {
+      y18n[key] = y18n[key].bind(y18n)
+    }
+  }
+
+  return y18n
+}
diff --git a/wrt/node_modules/y18n/package.json b/wrt/node_modules/y18n/package.json
new file mode 100644 (file)
index 0000000..da4dd5a
--- /dev/null
@@ -0,0 +1,66 @@
+{
+  "_from": "y18n@^3.2.1",
+  "_id": "y18n@3.2.1",
+  "_inBundle": false,
+  "_integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=",
+  "_location": "/y18n",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "y18n@^3.2.1",
+    "name": "y18n",
+    "escapedName": "y18n",
+    "rawSpec": "^3.2.1",
+    "saveSpec": null,
+    "fetchSpec": "^3.2.1"
+  },
+  "_requiredBy": [
+    "/electron-rebuild/yargs",
+    "/yargs"
+  ],
+  "_resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz",
+  "_shasum": "6d15fba884c08679c0d77e88e7759e811e07fa41",
+  "_spec": "y18n@^3.2.1",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was/node_modules/electron-rebuild/node_modules/yargs",
+  "author": {
+    "name": "Ben Coe",
+    "email": "ben@npmjs.com"
+  },
+  "bugs": {
+    "url": "https://github.com/yargs/y18n/issues"
+  },
+  "bundleDependencies": false,
+  "deprecated": false,
+  "description": "the bare-bones internationalization library used by yargs",
+  "devDependencies": {
+    "chai": "^3.4.1",
+    "coveralls": "^2.11.6",
+    "mocha": "^2.3.4",
+    "nyc": "^6.1.1",
+    "rimraf": "^2.5.0",
+    "standard": "^5.4.1"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/yargs/y18n",
+  "keywords": [
+    "i18n",
+    "internationalization",
+    "yargs"
+  ],
+  "license": "ISC",
+  "main": "index.js",
+  "name": "y18n",
+  "repository": {
+    "type": "git",
+    "url": "git+ssh://git@github.com/yargs/y18n.git"
+  },
+  "scripts": {
+    "coverage": "nyc report --reporter=text-lcov | coveralls",
+    "pretest": "standard",
+    "test": "nyc mocha"
+  },
+  "version": "3.2.1"
+}
diff --git a/wrt/node_modules/yargs/CHANGELOG.md b/wrt/node_modules/yargs/CHANGELOG.md
new file mode 100644 (file)
index 0000000..68eb6d3
--- /dev/null
@@ -0,0 +1,429 @@
+## Change Log
+
+### v3.19.0 (2015/08/14 05:12 +00:00)
+- [#224](https://github.com/bcoe/yargs/pull/224) added Portuguese translation (@codemonkey3045)
+
+### v3.18.1 (2015/08/12 05:53 +00:00)
+
+- [#228](https://github.com/bcoe/yargs/pull/228) notes about embedding yargs in Electron (@etiktin)
+- [#223](https://github.com/bcoe/yargs/pull/223) make booleans work in config files (@sgentle)
+
+### v3.18.0 (2015/08/06 20:05 +00:00)
+- [#222](https://github.com/bcoe/yargs/pull/222) updates fr locale (@nexdrew)
+- [#221](https://github.com/bcoe/yargs/pull/221) adds missing locale strings (@nexdrew)
+- [#220](https://github.com/bcoe/yargs/pull/220) adds es locale (@zkat)
+
+### v3.17.1 (2015/08/02 19:35 +00:00)
+- [#218](https://github.com/bcoe/yargs/pull/218) upgrades nyc (@bcoe)
+
+### v3.17.0 (2015/08/02 18:39 +00:00)
+- [#217](https://github.com/bcoe/yargs/pull/217) sort methods in README.md (@nexdrew)
+- [#215](https://github.com/bcoe/yargs/pull/215) adds fr locale (@LoicMahieu)
+
+### v3.16.0 (2015/07/30 04:35 +00:00)
+- [#210](https://github.com/bcoe/yargs/pull/210) adds i18n support to yargs (@bcoe)
+- [#209](https://github.com/bcoe/yargs/pull/209) adds choices type to yargs (@nexdrew)
+- [#207](https://github.com/bcoe/yargs/pull/207) pretty new shields from shields.io (@SimenB)
+- [#208](https://github.com/bcoe/yargs/pull/208) improvements to README.md (@nexdrew)
+- [#205](https://github.com/bcoe/yargs/pull/205) faster build times on Travis (@ChristianMurphy)
+
+### v3.15.0 (2015/07/06 06:01 +00:00)
+- [#197](https://github.com/bcoe/yargs/pull/197) tweaks to how errors bubble up from parser.js (@bcoe)
+- [#193](https://github.com/bcoe/yargs/pull/193) upgraded nyc, reporting now happens by default (@bcoe)
+
+### v3.14.0 (2015/06/28 02:12 +00:00)
+
+- [#192](https://github.com/bcoe/yargs/pull/192) standard style nits (@bcoe)
+- [#190](https://github.com/bcoe/yargs/pull/190) allow for hidden commands, e.g.,
+  .completion('completion', false) (@tschaub)
+
+### v3.13.0 (2015/06/24 04:12 +00:00)
+
+- [#187](https://github.com/bcoe/yargs/pull/187) completion now behaves differently
+  if it is being run in the context of a command (@tschaub)
+- [#186](https://github.com/bcoe/yargs/pull/186) if no matches are found for a completion
+  default to filename completion (@tschaub)
+
+### v3.12.0 (2015/06/19 03:23 +00:00)
+- [#183](https://github.com/bcoe/yargs/pull/183) don't complete commands if they've already been completed (@tschaub)
+- [#181](https://github.com/bcoe/yargs/pull/181) various fixes for completion. (@bcoe, @tschaub)
+- [#182](https://github.com/bcoe/yargs/pull/182) you can now set a maximum # of of required arguments (@bcoe)
+
+### v3.11.0 (2015/06/15 05:15 +00:00)
+
+- [#173](https://github.com/bcoe/yargs/pull/173) update standard, window-size, chai (@bcoe)
+- [#171](https://github.com/bcoe/yargs/pull/171) a description can now be set
+  when providing a config option. (@5c077yP)
+
+### v3.10.0 (2015/05/29 04:25 +00:00)
+
+- [#165](https://github.com/bcoe/yargs/pull/165) expose yargs.terminalWidth() thanks @ensonic (@bcoe)
+- [#164](https://github.com/bcoe/yargs/pull/164) better array handling thanks @getify (@bcoe)
+
+### v3.9.1 (2015/05/20 05:14 +00:00)
+- [b6662b6](https://github.com/bcoe/yargs/commit/b6662b6774cfeab4876f41ec5e2f67b7698f4e2f) clarify .config() docs (@linclark)
+- [0291360](https://github.com/bcoe/yargs/commit/02913606285ce31ce81d7f12c48d8a3029776ec7) fixed tests, switched to nyc for coverage, fixed security issue, added Lin as collaborator (@bcoe)
+
+### v3.9.0 (2015/05/10 18:32 +00:00)
+- [#157](https://github.com/bcoe/yargs/pull/157) Merge pull request #157 from bcoe/command-yargs. allows handling of command specific arguments. Thanks for the suggestion @ohjames (@bcoe)
+- [#158](https://github.com/bcoe/yargs/pull/158) Merge pull request #158 from kemitchell/spdx-license. Update license format (@kemitchell)
+
+### v3.8.0 (2015/04/24 23:10 +00:00)
+- [#154](https://github.com/bcoe/yargs/pull/154) showHelp's method signature was misleading fixes #153 (@bcoe)
+- [#151](https://github.com/bcoe/yargs/pull/151) refactor yargs' table layout logic to use new helper library (@bcoe)
+- [#150](https://github.com/bcoe/yargs/pull/150) Fix README example in argument requirements (@annonymouse)
+
+### v3.7.2 (2015/04/13 11:52 -07:00)
+
+* [679fbbf](https://github.com/bcoe/yargs/commit/679fbbf55904030ccee8a2635e8e5f46551ab2f0) updated yargs to use the [standard](https://github.com/feross/standard) style guide (agokjr)
+* [22382ee](https://github.com/bcoe/yargs/commit/22382ee9f5b495bc2586c1758cd1091cec3647f9 various bug fixes for $0 (@nylen)
+
+### v3.7.1 (2015/04/10 11:06 -07:00)
+
+* [89e1992](https://github.com/bcoe/yargs/commit/89e1992a004ba73609b5f9ee6890c4060857aba4) detect iojs bin along with node bin. (@bcoe)
+* [755509e](https://github.com/bcoe/yargs/commit/755509ea90041e5f7833bba3b8c5deffe56f0aab) improvements to example documentation in README.md (@rstacruz)
+* [0d2dfc8](https://github.com/bcoe/yargs/commit/0d2dfc822a43418242908ad97ddd5291a1b35dc6) showHelp() no longer requires that .argv has been called (@bcoe)
+
+### v3.7.0 (2015/04/04 02:29 -07:00)
+
+* [56cbe2d](https://github.com/bcoe/yargs/commit/56cbe2ddd33dc176dcbf97ba40559864a9f114e4) make .requiresArg() work with type hints. (@bcoe).
+* [2f5d562](https://github.com/bcoe/yargs/commit/2f5d5624f736741deeedf6a664d57bc4d857bdd0) serialize arrays and objects in usage strings. (@bcoe).
+* [5126304](https://github.com/bcoe/yargs/commit/5126304dd18351fc28f10530616fdd9361e0af98) be more lenient about alias/primary key ordering in chaining API. (@bcoe)
+
+### v3.6.0 (2015/03/21 01:00 +00:00)
+- [4e24e22](https://github.com/bcoe/yargs/commit/4e24e22e6a195e55ab943ede704a0231ac33b99c) support for .js configuration files. (@pirxpilot)
+
+### v3.5.4 (2015/03/12 05:56 +00:00)
+- [c16cc08](https://github.com/bcoe/yargs/commit/c16cc085501155cf7fd853ccdf8584b05ab92b78) message for non-option arguments is now optional, thanks to (@raine)
+
+### v3.5.3 (2015/03/09 06:14 +00:00)
+- [870b428](https://github.com/bcoe/yargs/commit/870b428cf515d560926ca392555b7ad57dba9e3d) completion script was missing in package.json (@bcoe)
+
+### v3.5.2 (2015/03/09 06:11 +00:00)
+- [58a4b24](https://github.com/bcoe/yargs/commit/58a4b2473ebbb326713d522be53e32d3aabb08d2) parse was being called multiple times, resulting in strange behavior (@bcoe)
+
+### v3.5.1 (2015/03/09 04:55 +00:00)
+- [4e588e0](https://github.com/bcoe/yargs/commit/4e588e055afbeb9336533095f051496e3977f515) accidentally left testing logic in (@bcoe)
+
+### v3.5.0 (2015/03/09 04:49 +00:00)
+- [718bacd](https://github.com/bcoe/yargs/commit/718bacd81b9b44f786af76b2afe491fe06274f19) added support for bash completions see #4 (@bcoe)
+- [a192882](https://github.com/bcoe/yargs/commit/a19288270fc431396c42af01125eeb4443664528) downgrade to mocha 2.1.0 until https://github.com/mochajs/mocha/issues/1585 can be sorted out (@bcoe)
+
+### v3.4.7 (2015/03/09 04:09 +00:00)
+- [9845e5c](https://github.com/bcoe/yargs/commit/9845e5c1a9c684ba0be3f0bfb40e7b62ab49d9c8) the Argv singleton was not being updated when manually parsing arguments, fixes #114 (@bcoe)
+
+### v3.4.6 (2015/03/09 04:01 +00:00)
+- [45b4c80](https://github.com/bcoe/yargs/commit/45b4c80b890d02770b0a94f326695a8a566e8fe9) set placeholders for all keys fixes #115 (@bcoe)
+
+### v3.4.5 (2015/03/01 20:31 +00:00)
+- [a758e0b](https://github.com/bcoe/yargs/commit/a758e0b2556184f067cf3d9c4ef886d39817ebd2) fix for count consuming too many arguments (@bcoe)
+
+### v3.4.4 (2015/02/28 04:52 +00:00)
+- [0476af7](https://github.com/bcoe/yargs/commit/0476af757966acf980d998b45108221d4888cfcb) added nargs feature, allowing you to specify the number of arguments after an option (@bcoe)
+- [092477d](https://github.com/bcoe/yargs/commit/092477d7ab3efbf0ba11cede57f7d8cfc70b024f) updated README with full example of v3.0 API (@bcoe)
+
+### v3.3.3 (2015/02/28 04:23 +00:00)
+- [0c4b769](https://github.com/bcoe/yargs/commit/0c4b769516cd8d93a7c4e5e675628ae0049aa9a8) remove string dependency, which conflicted with other libraries see #106 (@bcoe)
+
+### v3.3.2 (2015/02/28 04:11 +00:00)
+- [2a98906](https://github.com/bcoe/yargs/commit/2a9890675821c0e7a12f146ce008b0562cb8ec9a) add $0 to epilog (@schnittstabil)
+
+### v3.3.1 (2015/02/24 03:28 +00:00)
+- [ad485ce](https://github.com/bcoe/yargs/commit/ad485ce748ebdfce25b88ef9d6e83d97a2f68987) fix for applying defaults to camel-case args (@bcoe)
+
+### v3.3.0 (2015/02/24 00:49 +00:00)
+- [8bfe36d](https://github.com/bcoe/yargs/commit/8bfe36d7fb0f93a799ea3f4c756a7467c320f8c0) fix and document restart() command, as a tool for building nested CLIs (@bcoe)
+
+### v3.2.1 (2015/02/22 05:45 +00:00)
+- [49a6d18](https://github.com/bcoe/yargs/commit/49a6d1822a4ef9b1ea6f90cc366be60912628885) you can now provide a function that generates a default value (@bcoe)
+
+### v3.2.0 (2015/02/22 05:24 +00:00)
+- [7a55886](https://github.com/bcoe/yargs/commit/7a55886c9343cf71a20744ca5cdd56d2ea7412d5) improvements to yargs two-column text layout (@bcoe)
+- [b6ab513](https://github.com/bcoe/yargs/commit/b6ab5136a4c3fa6aa496f6b6360382e403183989) Tweak NPM version badge (@nylen)
+
+### v3.1.0 (2015/02/19 19:37 +00:00)
+- [9bd2379](https://github.com/bcoe/yargs/commit/9bd237921cf1b61fd9f32c0e6d23f572fc225861) version now accepts a function, making it easy to load version #s from a package.json (@bcoe)
+
+### v3.0.4 (2015/02/14 01:40 +00:00)
+- [0b7c19b](https://github.com/bcoe/yargs/commit/0b7c19beaecb747267ca4cc10e5cb2a8550bc4b7) various fixes for dot-notation handling (@bcoe)
+
+### v3.0.3 (2015/02/14 00:59 +00:00)
+- [c3f35e9](https://github.com/bcoe/yargs/commit/c3f35e99bd5a0d278073fcadd95e2d778616cc17) make sure dot-notation is applied to aliases (@bcoe)
+
+### 3.0.2 (2015/02/13 16:50 +00:00)
+- [74c8967](https://github.com/bcoe/yargs/commit/74c8967c340c204a0a7edf8a702b6f46c2705435) document epilog shorthand of epilogue. (@bcoe)
+- [670110f](https://github.com/bcoe/yargs/commit/670110fc01bedc4831b6fec6afac54517d5a71bc) any non-truthy value now causes check to fail see #76 (@bcoe)
+- [0d8f791](https://github.com/bcoe/yargs/commit/0d8f791a33c11ced4cd431ea8d3d3a337d456b56) finished implementing my wish-list of fetures for yargs 3.0. see #88 (@bcoe)
+- [5768447](https://github.com/bcoe/yargs/commit/5768447447c4c8e8304f178846206ce86540f063) fix coverage. (@bcoe)
+- [82e793f](https://github.com/bcoe/yargs/commit/82e793f3f61c41259eaacb67f0796aea2cf2aaa0) detect console width and perform word-wrapping. (@bcoe)
+- [67476b3](https://github.com/bcoe/yargs/commit/67476b37eea07fee55f23f35b9e0c7d76682b86d) refactor two-column table layout so that we can use it for examples and usage (@bcoe)
+- [4724cdf](https://github.com/bcoe/yargs/commit/4724cdfcc8e37ae1ca3dcce9d762f476e9ef4bb4) major refactor of index.js, in prep for 3.x release. (@bcoe)
+
+### v2.3.0 (2015/02/08 20:41 +00:00)
+- [d824620](https://github.com/bcoe/yargs/commit/d824620493df4e63664af1fe320764dd1a9244e6) allow for undefined boolean defaults (@ashi009)
+
+### v2.2.0 (2015/02/08 20:07 +00:00)
+- [d6edd98](https://github.com/bcoe/yargs/commit/d6edd9848826e7389ed1393858c45d03961365fd) in-prep for further refactoring, and a 3.x release I've shuffled some things around and gotten test-coverage to 100%. (@bcoe)
+
+### v2.1.2 (2015/02/08 06:05 +00:00)
+- [d640745](https://github.com/bcoe/yargs/commit/d640745a7b9f8d476e0223879d056d18d9c265c4) switch to path.relative (@bcoe)
+- [3bfd41f](https://github.com/bcoe/yargs/commit/3bfd41ff262a041f29d828b88936a79c63cad594) remove mocha.opts. (@bcoe)
+- [47a2f35](https://github.com/bcoe/yargs/commit/47a2f357091db70903a402d6765501c1d63f15fe) document using .string('_') for string ids. see #56 (@bcoe)
+- [#57](https://github.com/bcoe/yargs/pull/57) Merge pull request #57 from eush77/option-readme (@eush77)
+
+### v2.1.1 (2015/02/06 08:08 +00:00)
+- [01c6c61](https://github.com/bcoe/yargs/commit/01c6c61d67b4ebf88f41f0b32a345ec67f0ac17d) fix for #71, 'newAliases' of undefined (@bcoe)
+
+### v2.1.0 (2015/02/06 07:59 +00:00)
+- [6a1a3fa](https://github.com/bcoe/yargs/commit/6a1a3fa731958e26ccd56885f183dd8985cc828f) try to guess argument types, and apply sensible defaults see #73 (@bcoe)
+
+### v2.0.1 (2015/02/06 07:54 +00:00)
+- [96a06b2](https://github.com/bcoe/yargs/commit/96a06b2650ff1d085a52b7328d8bba614c20cc12) Fix for strange behavior with --sort option, see #51 (@bcoe)
+
+### v2.0.0 (2015/02/06 07:45 +00:00)
+- [0250517](https://github.com/bcoe/yargs/commit/0250517c9643e53f431b824e8ccfa54937414011) - [108fb84](https://github.com/bcoe/yargs/commit/108fb8409a3a63dcaf99d917fe4dfcfaa1de236d) fixed bug with boolean parsing, when bools separated by = see #66 (@bcoe)
+- [a465a59](https://github.com/bcoe/yargs/commit/a465a5915f912715738de890982e4f8395958b10) Add `files` field to the package.json (@shinnn)
+- [31043de](https://github.com/bcoe/yargs/commit/31043de7a38a17c4c97711f1099f5fb164334db3) fix for yargs.argv having the same keys added multiple times see #63 (@bcoe)
+- [2d68c5b](https://github.com/bcoe/yargs/commit/2d68c5b91c976431001c4863ce47c9297850f1ad) Disable process.exit calls using .exitProcess(false) (@cianclarke)
+- [45da9ec](https://github.com/bcoe/yargs/commit/45da9ec4c55a7bd394721bc6a1db0dabad7bc52a) Mention .option in README (@eush77)
+
+### v1.3.2 (2014/10/06 21:56 +00:00)
+- [b8d3472](https://github.com/bcoe/yargs/commit/b8d34725482e5821a3cc809c0df71378f282f526) 1.3.2 (@chevex)
+
+### list (2014/08/30 18:41 +00:00)
+- [fbc777f](https://github.com/bcoe/yargs/commit/fbc777f416eeefd37c84e44d27d7dfc7c1925721) Now that yargs is the successor to optimist, I'm changing the README language to be more universal. Pirate speak isn't very accessible to non-native speakers. (@chevex)
+- [a54d068](https://github.com/bcoe/yargs/commit/a54d0682ae2efc2394d407ab171cc8a8bbd135ea) version output will not print extra newline (@boneskull)
+- [1cef5d6](https://github.com/bcoe/yargs/commit/1cef5d62a9d6d61a3948a49574892e01932cc6ae) Added contributors section to package.json (@chrisn)
+- [cc295c0](https://github.com/bcoe/yargs/commit/cc295c0a80a2de267e0155b60d315fc4b6f7c709) Added 'require' and 'required' as synonyms for 'demand' (@chrisn)
+- [d0bf951](https://github.com/bcoe/yargs/commit/d0bf951d949066b6280101ed606593d079ee15c8) Updating minimist. (@chevex)
+- [c15f8e7](https://github.com/bcoe/yargs/commit/c15f8e7f245b261e542cf205ce4f4313630cbdb4) Fix #31 (bad interaction between camelCase options and strict mode) (@nylen)
+- [d991b9b](https://github.com/bcoe/yargs/commit/d991b9be687a68812dee1e3b185ba64b7778b82d) Added .help() and .version() methods (@chrisn)
+- [e8c8aa4](https://github.com/bcoe/yargs/commit/e8c8aa46268379357cb11e9fc34b8c403037724b) Added .showHelpOnFail() method (@chrisn)
+- [e855af4](https://github.com/bcoe/yargs/commit/e855af4a933ea966b5bbdd3c4c6397a4bac1a053) Allow boolean flag with .demand() (@chrisn)
+- [14dbec2](https://github.com/bcoe/yargs/commit/14dbec24fb7380683198e2b20c4deb8423e64bea) Fixes issue #22. Arguments are no longer printed to the console when using .config. (@chevex)
+- [bef74fc](https://github.com/bcoe/yargs/commit/bef74fcddc1544598a804f80d0a3728459f196bf) Informing users that Yargs is the official optimist successor. (@chevex)
+- [#24](https://github.com/bcoe/yargs/pull/24) Merge pull request #24 from chrisn/strict (@chrisn)
+- [889a2b2](https://github.com/bcoe/yargs/commit/889a2b28eb9768801b05163360a470d0fd6c8b79) Added requiresArg option, for options that require values (@chrisn)
+- [eb16369](https://github.com/bcoe/yargs/commit/eb163692262be1fe80b992fd8803d5923c5a9b18) Added .strict() method, to report error if unknown arguments are given (@chrisn)
+- [0471c3f](https://github.com/bcoe/yargs/commit/0471c3fd999e1ad4e6cded88b8aa02013b66d14f) Changed optimist to yargs in usage-options.js example (@chrisn)
+- [5c88f74](https://github.com/bcoe/yargs/commit/5c88f74e3cf031b17c54b4b6606c83e485ff520e) Change optimist to yargs in examples (@chrisn)
+- [66f12c8](https://github.com/bcoe/yargs/commit/66f12c82ba3c943e4de8ca862980e835da8ecb3a) Fix a couple of bad interactions between aliases and defaults (@nylen)
+- [8fa1d80](https://github.com/bcoe/yargs/commit/8fa1d80f14b03eb1f2898863a61f1d1615bceb50) Document second argument of usage(message, opts) (@Gobie)
+- [56e6528](https://github.com/bcoe/yargs/commit/56e6528cf674ff70d63083fb044ff240f608448e) For "--some-option", also set argv.someOption (@nylen)
+- [ed5f6d3](https://github.com/bcoe/yargs/commit/ed5f6d33f57ad1086b11c91b51100f7c6c7fa8ee) Finished porting unit tests to Mocha. (@chevex)
+
+### v1.0.15 (2014/02/05 23:18 +00:00)
+- [e2b1fc0](https://github.com/bcoe/yargs/commit/e2b1fc0c4a59cf532ae9b01b275e1ef57eeb64d2) 1.0.15 update to badges (@chevex)
+
+### v1.0.14 (2014/02/05 23:17 +00:00)
+- [f33bbb0](https://github.com/bcoe/yargs/commit/f33bbb0f00fe18960f849cc8e15a7428a4cd59b8) Revert "Fixed issue which caused .demand function not to work correctly." (@chevex)
+
+### v1.0.13 (2014/02/05 22:13 +00:00)
+- [6509e5e](https://github.com/bcoe/yargs/commit/6509e5e7dee6ef1a1f60eea104be0faa1a045075) Fixed issue which caused .demand function not to work correctly. (@chevex)
+
+### v1.0.12 (2013/12/13 00:09 +00:00)
+- [05eb267](https://github.com/bcoe/yargs/commit/05eb26741c9ce446b33ff006e5d33221f53eaceb) 1.0.12 (@chevex)
+
+### v1.0.11 (2013/12/13 00:07 +00:00)
+- [c1bde46](https://github.com/bcoe/yargs/commit/c1bde46e37318a68b87d17a50c130c861d6ce4a9) 1.0.11 (@chevex)
+
+### v1.0.10 (2013/12/12 23:57 +00:00)
+- [dfebf81](https://github.com/bcoe/yargs/commit/dfebf8164c25c650701528ee581ca483a99dc21c) Fixed formatting in README (@chevex)
+
+### v1.0.9 (2013/12/12 23:47 +00:00)
+- [0b4e34a](https://github.com/bcoe/yargs/commit/0b4e34af5e6d84a9dbb3bb6d02cd87588031c182) Update README.md (@chevex)
+
+### v1.0.8 (2013/12/06 16:36 +00:00)
+- [#1](https://github.com/bcoe/yargs/pull/1) fix error caused by check() see #1 (@martinheidegger)
+
+### v1.0.7 (2013/11/24 18:01 +00:00)
+- [a247d88](https://github.com/bcoe/yargs/commit/a247d88d6e46644cbb7303c18b1bb678fc132d72) Modified Pirate Joe image. (@chevex)
+
+### v1.0.6 (2013/11/23 19:21 +00:00)
+- [d7f69e1](https://github.com/bcoe/yargs/commit/d7f69e1d34bc929736a8bdccdc724583e21b7eab) Updated Pirate Joe image. (@chevex)
+
+### v1.0.5 (2013/11/23 19:09 +00:00)
+- [ece809c](https://github.com/bcoe/yargs/commit/ece809cf317cc659175e1d66d87f3ca68c2760be) Updated readme notice again. (@chevex)
+
+### v1.0.4 (2013/11/23 19:05 +00:00)
+- [9e81e81](https://github.com/bcoe/yargs/commit/9e81e81654028f83ba86ffc3ac772a0476084e5e) Updated README with a notice about yargs being a fork of optimist and what that implies. (@chevex)
+
+### v1.0.3 (2013/11/23 17:43 +00:00)
+- [65e7a78](https://github.com/bcoe/yargs/commit/65e7a782c86764944d63d084416aba9ee6019c5f) Changed some small wording in README.md. (@chevex)
+- [459e20e](https://github.com/bcoe/yargs/commit/459e20e539b366b85128dd281ccd42221e96c7da) Fix a bug in the options function, when string and boolean options weren't applied to aliases. (@shockone)
+
+### v1.0.2 (2013/11/23 09:46 +00:00)
+- [3d80ebe](https://github.com/bcoe/yargs/commit/3d80ebed866d3799224b6f7d596247186a3898a9) 1.0.2 (@chevex)
+
+### v1.0.1 (2013/11/23 09:39 +00:00)
+- [f80ff36](https://github.com/bcoe/yargs/commit/f80ff3642d580d4b68bf9f5a94277481bd027142) Updated image. (@chevex)
+
+### v1.0.0 (2013/11/23 09:33 +00:00)
+- [54e31d5](https://github.com/bcoe/yargs/commit/54e31d505f820b80af13644e460894b320bf25a3) Rebranded from optimist to yargs in the spirit of the fork :D (@chevex)
+- [4ebb6c5](https://github.com/bcoe/yargs/commit/4ebb6c59f44787db7c24c5b8fe2680f01a23f498) Added documentation for demandCount(). (@chevex)
+- [4561ce6](https://github.com/bcoe/yargs/commit/4561ce66dcffa95f49e8b4449b25b94cd68acb25) Simplified the error messages returned by .check(). (@chevex)
+- [661c678](https://github.com/bcoe/yargs/commit/661c67886f479b16254a830b7e1db3be29e6b7a6) Fixed an issue with demand not accepting a zero value. (@chevex)
+- [731dd3c](https://github.com/bcoe/yargs/commit/731dd3c37624790490bd6df4d5f1da8f4348279e) Add .fail(fn) so death isn't the only option. Should fix issue #39. (@chevex)
+- [fa15417](https://github.com/bcoe/yargs/commit/fa15417ff9e70dace0d726627a5818654824c1d8) Added a few missing 'return self' (@chevex)
+- [e655e4d](https://github.com/bcoe/yargs/commit/e655e4d99d1ae1d3695ef755d51c2de08d669761) Fix showing help in certain JS environments. (@chevex)
+- [a746a31](https://github.com/bcoe/yargs/commit/a746a31cd47c87327028e6ea33762d6187ec5c87) Better string representation of default values. (@chevex)
+- [6134619](https://github.com/bcoe/yargs/commit/6134619a7e90b911d5443230b644c5d447c1a68c) Implies: conditional demands (@chevex)
+- [046b93b](https://github.com/bcoe/yargs/commit/046b93b5d40a27367af4cb29726e4d781d934639) Added support for JSON config files. (@chevex)
+- [a677ec0](https://github.com/bcoe/yargs/commit/a677ec0a0ecccd99c75e571d03323f950688da03) Add .example(cmd, desc) feature. (@chevex)
+- [1bd4375](https://github.com/bcoe/yargs/commit/1bd4375e11327ba1687d4bb6e5e9f3c30c1be2af) Added 'defaults' as alias to 'default' so as to avoid usage of a reserved keyword. (@chevex)
+- [6b753c1](https://github.com/bcoe/yargs/commit/6b753c16ca09e723060e70b773b430323b29c45c) add .normalize(args..) support for normalizing paths (@chevex)
+- [33d7d59](https://github.com/bcoe/yargs/commit/33d7d59341d364f03d3a25f0a55cb99004dbbe4b) Customize error messages with demand(key, msg) (@chevex)
+- [647d37f](https://github.com/bcoe/yargs/commit/647d37f164c20f4bafbf67dd9db6cd6e2cd3b49f) Merge branch 'rewrite-duplicate-test' of github.com:isbadawi/node-optimist (@chevex)
+- [9059d1a](https://github.com/bcoe/yargs/commit/9059d1ad5e8aea686c2a01c89a23efdf929fff2e) Pass aliases object to check functions for greater versatility. (@chevex)
+- [623dc26](https://github.com/bcoe/yargs/commit/623dc26c7331abff2465ef8532e3418996d42fe6) Added ability to count boolean options and rolled minimist library back into project. (@chevex)
+- [49f0dce](https://github.com/bcoe/yargs/commit/49f0dcef35de4db544c3966350d36eb5838703f6) Fixed small typo. (@chevex)
+- [79ec980](https://github.com/bcoe/yargs/commit/79ec9806d9ca6eb0014cfa4b6d1849f4f004baf2) Removed dependency on wordwrap module. (@chevex)
+- [ea14630](https://github.com/bcoe/yargs/commit/ea14630feddd69d1de99dd8c0e08948f4c91f00a) Merge branch 'master' of github.com:chbrown/node-optimist (@chevex)
+- [2b75da2](https://github.com/bcoe/yargs/commit/2b75da2624061e0f4f3107d20303c06ec9054906) Merge branch 'master' of github.com:seanzhou1023/node-optimist (@chevex)
+- [d9bda11](https://github.com/bcoe/yargs/commit/d9bda1116e26f3b40e833ca9ca19263afea53565) Merge branch 'patch-1' of github.com:thefourtheye/node-optimist (@chevex)
+- [d6cc606](https://github.com/bcoe/yargs/commit/d6cc6064a4f1bea38a16a4430b8a1334832fbeff) Renamed README. (@chevex)
+- [9498d3f](https://github.com/bcoe/yargs/commit/9498d3f59acfb5e102826503e681623c3a64b178) Renamed readme and added .gitignore. (@chevex)
+- [bbd1fe3](https://github.com/bcoe/yargs/commit/bbd1fe37fefa366dde0fb3dc44d91fe8b28f57f5) Included examples for ```help``` and ```showHelp``` functions and fixed few formatting issues (@thefourtheye)
+- [37fea04](https://github.com/bcoe/yargs/commit/37fea0470a5796a0294c1dcfff68d8041650e622) .alias({}) behaves differently based on mapping direction when generating descriptions (@chbrown)
+- [855b20d](https://github.com/bcoe/yargs/commit/855b20d0be567ca121d06b30bea64001b74f3d6d) Documented function signatures are useful for dynamically typed languages. (@chbrown)
+
+### 0.6.0 (2013/06/25 08:48 +00:00)
+- [d37bfe0](https://github.com/bcoe/yargs/commit/d37bfe05ae6d295a0ab481efe4881222412791f4) all tests passing using minimist (@substack)
+- [76f1352](https://github.com/bcoe/yargs/commit/76f135270399d01f2bbc621e524a5966e5c422fd) all parse tests now passing (@substack)
+- [a7b6754](https://github.com/bcoe/yargs/commit/a7b6754276c38d1565479a5685c3781aeb947816) using minimist, some tests passing (@substack)
+- [6655688](https://github.com/bcoe/yargs/commit/66556882aa731cbbbe16cc4d42c85740a2e98099) Give credit where its due (@DeadAlready)
+- [602a2a9](https://github.com/bcoe/yargs/commit/602a2a92a459f93704794ad51b115bbb08b535ce) v0.5.3 - Remove wordwrap as dependency (@DeadAlready)
+
+### 0.5.2 (2013/05/31 03:46 +00:00)
+- [4497ca5](https://github.com/bcoe/yargs/commit/4497ca55e332760a37b866ec119ded347ca27a87) fixed the whitespace bug without breaking anything else (@substack)
+- [5a3dd1a](https://github.com/bcoe/yargs/commit/5a3dd1a4e0211a38613c6e02f61328e1031953fa) failing test for whitespace arg (@substack)
+
+### 0.5.1 (2013/05/30 07:17 +00:00)
+- [a20228f](https://github.com/bcoe/yargs/commit/a20228f62a454755dd07f628a7c5759113918327) fix parse() to work with functions before it (@substack)
+- [b13bd4c](https://github.com/bcoe/yargs/commit/b13bd4cac856a9821d42fa173bdb58f089365a7d) failing test for parse() with modifiers (@substack)
+
+### 0.5.0 (2013/05/18 21:59 +00:00)
+- [c474a64](https://github.com/bcoe/yargs/commit/c474a649231527915c222156e3b40806d365a87c) fixes for dash (@substack)
+
+### 0.4.0 (2013/04/13 19:03 +00:00)
+- [dafe3e1](https://github.com/bcoe/yargs/commit/dafe3e18d7c6e7c2d68e06559df0e5cbea3adb14) failing short test (@substack)
+
+### 0.3.7 (2013/04/04 04:07 +00:00)
+- [6c7a0ec](https://github.com/bcoe/yargs/commit/6c7a0ec94ce4199a505f0518b4d6635d4e47cc81) Fix for windows. On windows there is no _ in environment. (@hdf)
+
+### 0.3.6 (2013/04/04 04:04 +00:00)
+- [e72346a](https://github.com/bcoe/yargs/commit/e72346a727b7267af5aa008b418db89970873f05) Add support for newlines in -a="" arguments (@danielbeardsley)
+- [71e1fb5](https://github.com/bcoe/yargs/commit/71e1fb55ea9987110a669ac6ec12338cfff3821c) drop 0.4, add 0.8 to travis (@substack)
+
+### 0.3.5 (2012/10/10 11:09 +00:00)
+- [ee692b3](https://github.com/bcoe/yargs/commit/ee692b37554c70a0bb16389a50a26b66745cbbea) Fix parsing booleans (@vojtajina)
+- [5045122](https://github.com/bcoe/yargs/commit/5045122664c3f5b4805addf1be2148d5856f7ce8) set $0 properly in the tests (@substack)
+
+### 0.3.4 (2012/04/30 06:54 +00:00)
+- [f28c0e6](https://github.com/bcoe/yargs/commit/f28c0e62ca94f6e0bb2e6d82fc3d91a55e69b903) bump for string "true" params (@substack)
+- [8f44aeb](https://github.com/bcoe/yargs/commit/8f44aeb74121ddd689580e2bf74ef86a605e9bf2) Fix failing test for aliased booleans. (@coderarity)
+- [b9f7b61](https://github.com/bcoe/yargs/commit/b9f7b613b1e68e11e6c23fbda9e555a517dcc976) Add failing test for short aliased booleans. (@coderarity)
+
+### 0.3.3 (2012/04/30 06:45 +00:00)
+- [541bac8](https://github.com/bcoe/yargs/commit/541bac8dd787a5f1a5d28f6d8deb1627871705e7) Fixes #37.
+
+### 0.3.2 (2012/04/12 20:28 +00:00)
+- [3a0f014](https://github.com/bcoe/yargs/commit/3a0f014c1451280ac1c9caa1f639d31675586eec) travis badge (@substack)
+- [4fb60bf](https://github.com/bcoe/yargs/commit/4fb60bf17845f4ce3293f8ca49c9a1a7c736cfce) Fix boolean aliases. (@coderarity)
+- [f14dda5](https://github.com/bcoe/yargs/commit/f14dda546efc4fe06ace04d36919bfbb7634f79b) Adjusted package.json to use tap (@jfhbrook)
+- [88e5d32](https://github.com/bcoe/yargs/commit/88e5d32295be6e544c8d355ff84e355af38a1c74) test/usage.js no longer hangs (@jfhbrook)
+- [e1e740c](https://github.com/bcoe/yargs/commit/e1e740c27082f3ce84deca2093d9db2ef735d0e5) two tests for combined boolean/alias opts parsing (@jfhbrook)
+
+### 0.3.1 (2011/12/31 08:44 +00:00)
+- [d09b719](https://github.com/bcoe/yargs/commit/d09b71980ef711b6cf3918cd19beec8257e40e82) If "default" is set to false it was not passed on, fixed. (@wolframkriesing)
+
+### 0.3.0 (2011/12/09 06:03 +00:00)
+- [6e74aa7](https://github.com/bcoe/yargs/commit/6e74aa7b46a65773e20c0cb68d2d336d4a0d553d) bump and documented dot notation (@substack)
+
+### 0.2.7 (2011/10/20 02:25 +00:00)
+- [94adee2](https://github.com/bcoe/yargs/commit/94adee20e17b58d0836f80e8b9cdbe9813800916) argv._ can be told 'Hey! argv._! Don't be messing with my args.', and it WILL obey (@colinta)
+- [c46fdd5](https://github.com/bcoe/yargs/commit/c46fdd56a05410ae4a1e724a4820c82e77ff5469) optimistic critter image (@substack)
+- [5c95c73](https://github.com/bcoe/yargs/commit/5c95c73aedf4c7482bd423e10c545e86d7c8a125) alias options() to option() (@substack)
+- [f7692ea](https://github.com/bcoe/yargs/commit/f7692ea8da342850af819367833abb685fde41d8) [fix] Fix for parsing boolean edge case (@indexzero)
+- [d1f92d1](https://github.com/bcoe/yargs/commit/d1f92d1425bd7f356055e78621b30cdf9741a3c2)
+- [b01bda8](https://github.com/bcoe/yargs/commit/b01bda8d86e455bbf74ce497864cb8ab5b9fb847) [fix test] Update to ensure optimist is aware of default booleans. Associated tests included (@indexzero)
+- [aa753e7](https://github.com/bcoe/yargs/commit/aa753e7c54fb3a12f513769a0ff6d54aa0f63943) [dist test] Update devDependencies in package.json. Update test pathing to be more npm and require.paths future-proof (@indexzero)
+- [7bfce2f](https://github.com/bcoe/yargs/commit/7bfce2f3b3c98e6539e7549d35fbabced7e9341e) s/sys/util/ (@substack)
+- [d420a7a](https://github.com/bcoe/yargs/commit/d420a7a9c890d2cdb11acfaf3ea3f43bc3e39f41) update usage output (@substack)
+- [cf86eed](https://github.com/bcoe/yargs/commit/cf86eede2e5fc7495b6ec15e6d137d9ac814f075) some sage readme protips about parsing rules (@substack)
+- [5da9f7a](https://github.com/bcoe/yargs/commit/5da9f7a5c0e1758ec7c5801fb3e94d3f6e970513) documented all the methods finally (@substack)
+- [8ca6879](https://github.com/bcoe/yargs/commit/8ca6879311224b25933642987300f6a29de5c21b) fenced syntax highlighting (@substack)
+- [b72bacf](https://github.com/bcoe/yargs/commit/b72bacf1d02594778c1935405bc8137eb61761dc) right-alignment of wrapped extra params (@substack)
+- [2b980bf](https://github.com/bcoe/yargs/commit/2b980bf2656b4ee8fc5134dc5f56a48855c35198) now with .wrap() (@substack)
+- [d614f63](https://github.com/bcoe/yargs/commit/d614f639654057d1b7e35e3f5a306e88ec2ad1e4) don't show 'Options:' when there aren't any (@substack)
+- [691eda3](https://github.com/bcoe/yargs/commit/691eda354df97b5a86168317abcbcaabdc08a0fb) failing test for multi-aliasing (@substack)
+- [0826c9f](https://github.com/bcoe/yargs/commit/0826c9f462109feab2bc7a99346d22e72bf774b7) "Options:" > "options:" (@substack)
+- [72f7490](https://github.com/bcoe/yargs/commit/72f749025d01b7f295738ed370a669d885fbada0) [minor] Update formatting for `.showHelp()` (@indexzero)
+- [75aecce](https://github.com/bcoe/yargs/commit/75aeccea74329094072f95800e02c275e7d999aa) options works again, too lazy to write a proper test right now (@substack)
+- [f742e54](https://github.com/bcoe/yargs/commit/f742e5439817c662dc3bd8734ddd6467e6018cfd) line_count_options example, which breaks (@substack)
+- [4ca06b8](https://github.com/bcoe/yargs/commit/4ca06b8b4ea99b5d5714b315a2a8576bee6e5537) line count example (@substack)
+- [eeb8423](https://github.com/bcoe/yargs/commit/eeb8423e0a5ecc9dc3eb1e6df9f3f8c1c88f920b) remove self.argv setting in boolean (@substack)
+- [6903412](https://github.com/bcoe/yargs/commit/69034126804660af9cc20ea7f4457b50338ee3d7) removed camel case for now (@substack)
+- [5a0d88b](https://github.com/bcoe/yargs/commit/5a0d88bf23e9fa79635dd034e2a1aa992acc83cd) remove dead longest checking code (@substack)
+- [d782170](https://github.com/bcoe/yargs/commit/d782170babf7284b1aa34f5350df0dd49c373fa8) .help() too (@substack)
+- [622ec17](https://github.com/bcoe/yargs/commit/622ec17379bb5374fdbb190404c82bc600975791) rm old help generator (@substack)
+- [7c8baac](https://github.com/bcoe/yargs/commit/7c8baac4d66195e9f5158503ea9ebfb61153dab7) nub keys (@substack)
+- [8197785](https://github.com/bcoe/yargs/commit/8197785ad4762465084485b041abd722f69bf344) generate help message based on the previous calls, todo: nub (@substack)
+- [3ffbdc3](https://github.com/bcoe/yargs/commit/3ffbdc33c8f5e83d4ea2ac60575ce119570c7ede) stub out new showHelp, better checks (@substack)
+- [d4e21f5](https://github.com/bcoe/yargs/commit/d4e21f56a4830f7de841900d3c79756fb9886184) let .options() take single options too (@substack)
+- [3c4cf29](https://github.com/bcoe/yargs/commit/3c4cf2901a29bac119cca8e983028d8669230ec6) .options() is now heaps simpler (@substack)
+- [89f0d04](https://github.com/bcoe/yargs/commit/89f0d043cbccd302f10ab30c2069e05d2bf817c9) defaults work again, all tests pass (@substack)
+- [dd87333](https://github.com/bcoe/yargs/commit/dd8733365423006a6e4156372ebb55f98323af58) update test error messages, down to 2 failing tests (@substack)
+- [53f7bc6](https://github.com/bcoe/yargs/commit/53f7bc626b9875f2abdfc5dd7a80bde7f14143a3) fix for bools doubling up, passes the parse test again, others fail (@substack)
+- [2213e2d](https://github.com/bcoe/yargs/commit/2213e2ddc7263226fba717fb041dc3fde9bc2ee4) refactored for an argv getter, failing several tests (@substack)
+- [d1e7379](https://github.com/bcoe/yargs/commit/d1e737970f15c6c006bebdd8917706827ff2f0f2) just rescan for now, alias test passes (@substack)
+- [b2f8c99](https://github.com/bcoe/yargs/commit/b2f8c99cc477a8eb0fdf4cf178e1785b63185cfd) failing alias test (@substack)
+- [d0c0174](https://github.com/bcoe/yargs/commit/d0c0174daa144bfb6dc7290fdc448c393c475e15) .alias() (@substack)
+- [d85f431](https://github.com/bcoe/yargs/commit/d85f431ad7d07b058af3f2a57daa51495576c164) [api] Remove `.describe()` in favor of building upon the existing `.usage()` API (@indexzero)
+- [edbd527](https://github.com/bcoe/yargs/commit/edbd5272a8e213e71acd802782135c7f9699913a) [doc api] Add `.describe()`, `.options()`, and `.showHelp()` methods along with example. (@indexzero)
+- [be4902f](https://github.com/bcoe/yargs/commit/be4902ff0961ae8feb9093f2c0a4066463ded2cf) updates for coffee since it now does argv the node way (@substack)
+- [e24cb23](https://github.com/bcoe/yargs/commit/e24cb23798ee64e53b60815e7fda78b87f42390c) more general coffeescript detection (@substack)
+- [78ac753](https://github.com/bcoe/yargs/commit/78ac753e5d0ec32a96d39d893272afe989e42a4d) Don't trigger the CoffeeScript hack when running under node_g. (@papandreou)
+- [bcfe973](https://github.com/bcoe/yargs/commit/bcfe9731d7f90d4632281b8a52e8d76eb0195ae6) .string() but failing test (@substack)
+- [1987aca](https://github.com/bcoe/yargs/commit/1987aca28c7ba4e8796c07bbc547cb984804c826) test hex strings (@substack)
+- [ef36db3](https://github.com/bcoe/yargs/commit/ef36db32259b0b0d62448dc907c760e5554fb7e7) more keywords (@substack)
+- [cc53c56](https://github.com/bcoe/yargs/commit/cc53c56329960bed6ab077a79798e991711ba01d) Added camelCase function that converts --multi-word-option to camel case (so it becomes argv.multiWordOption). (@papandreou)
+- [60b57da](https://github.com/bcoe/yargs/commit/60b57da36797716e5783a633c6d5c79099016d45) fixed boolean bug by rescanning (@substack)
+- [dff6d07](https://github.com/bcoe/yargs/commit/dff6d078d97f8ac503c7d18dcc7b7a8c364c2883) boolean examples (@substack)
+- [0e380b9](https://github.com/bcoe/yargs/commit/0e380b92c4ef4e3c8dac1da18b5c31d85b1d02c9) boolean() with passing test (@substack)
+- [62644d4](https://github.com/bcoe/yargs/commit/62644d4bffbb8d1bbf0c2baf58a1d14a6359ef07) coffee compatibility with node regex for versions too (@substack)
+- [430fafc](https://github.com/bcoe/yargs/commit/430fafcf1683d23774772826581acff84b456827) argv._ fixed by fixing the coffee detection (@substack)
+- [343b8af](https://github.com/bcoe/yargs/commit/343b8afefd98af274ebe21b5a16b3a949ec5429f) whichNodeArgs test fails too (@substack)
+- [63df2f3](https://github.com/bcoe/yargs/commit/63df2f371f31e63d7f1dec2cbf0022a5f08da9d2) replicated mnot's bug in whichNodeEmpty test (@substack)
+- [35473a4](https://github.com/bcoe/yargs/commit/35473a4d93a45e5e7e512af8bb54ebb532997ae1) test for ./bin usage (@substack)
+- [13df151](https://github.com/bcoe/yargs/commit/13df151e44228eed10e5441c7cd163e086c458a4) don't coerce booleans to numbers (@substack)
+- [85f8007](https://github.com/bcoe/yargs/commit/85f8007e93b8be7124feea64b1f1916d8ba1894a) package bump for automatic number conversion (@substack)
+- [8f17014](https://github.com/bcoe/yargs/commit/8f170141cded4ccc0c6d67a849c5bf996aa29643) updated readme and examples with new auto-numberification goodness (@substack)
+- [73dc901](https://github.com/bcoe/yargs/commit/73dc9011ac968e39b55e19e916084a839391b506) auto number conversion works yay (@substack)
+- [bcec56b](https://github.com/bcoe/yargs/commit/bcec56b3d031e018064cbb691539ccc4f28c14ad) failing test for not-implemented auto numification (@substack)
+- [ebd2844](https://github.com/bcoe/yargs/commit/ebd2844d683feeac583df79af0e5124a7a7db04e) odd that eql doesn't check types careflly (@substack)
+- [fd854b0](https://github.com/bcoe/yargs/commit/fd854b02e512ce854b76386d395672a7969c1bc4) package author + keywords (@substack)
+- [656a1d5](https://github.com/bcoe/yargs/commit/656a1d5a1b7c0e49d72e80cb13f20671d56f76c6) updated readme with .default() stuff (@substack)
+- [cd7f8c5](https://github.com/bcoe/yargs/commit/cd7f8c55f0b82b79b690d14c5f806851236998a1) passing tests for new .default() behavior (@substack)
+- [932725e](https://github.com/bcoe/yargs/commit/932725e39ce65bc91a0385a5fab659a5fa976ac2) new default() thing for setting default key/values (@substack)
+- [4e6c7ab](https://github.com/bcoe/yargs/commit/4e6c7aba6374ac9ebc6259ecf91f13af7bce40e3) test for coffee usage (@substack)
+- [d54ffcc](https://github.com/bcoe/yargs/commit/d54ffccf2a5a905f51ed5108f7c647f35d64ae23) new --key value style with passing tests. NOTE: changes existing behavior (@substack)
+- [ed2a2d5](https://github.com/bcoe/yargs/commit/ed2a2d5d828100ebeef6385c0fb88d146a5cfe9b) package bump for summatix's coffee script fix (@substack)
+- [75a975e](https://github.com/bcoe/yargs/commit/75a975eed8430d28e2a79dc9e6d819ad545f4587) Added support for CoffeeScript (@summatix)
+- [56b2b1d](https://github.com/bcoe/yargs/commit/56b2b1de8d11f8a2b91979d8ae2d6db02d8fe64d) test coverage for the falsy check() usage (@substack)
+- [a4843a9](https://github.com/bcoe/yargs/commit/a4843a9f0e69ffb4afdf6a671d89eb6f218be35d) check bug fixed plus a handy string (@substack)
+- [857bd2d](https://github.com/bcoe/yargs/commit/857bd2db933a5aaa9cfecba0ced2dc9b415f8111) tests for demandCount, back up to 100% coverage (@substack)
+- [073b776](https://github.com/bcoe/yargs/commit/073b7768ebd781668ef05c13f9003aceca2f5c35) call demandCount from demand (@substack)
+- [4bd4b7a](https://github.com/bcoe/yargs/commit/4bd4b7a085c8b6ce1d885a0f486cc9865cee2db1) add demandCount to check for the number of arguments in the _ list (@marshall)
+- [b8689ac](https://github.com/bcoe/yargs/commit/b8689ac68dacf248119d242bba39a41cb0adfa07) Rebase checks. That will be its own module eventually. (@substack)
+- [e688370](https://github.com/bcoe/yargs/commit/e688370b576f0aa733c3f46183df69e1b561668e) a $0 like in perl (@substack)
+- [2e5e196](https://github.com/bcoe/yargs/commit/2e5e1960fc19afb21fb3293752316eaa8bcd3609) usage test hacking around process and console (@substack)
+- [fcc3521](https://github.com/bcoe/yargs/commit/fcc352163fbec6a1dfe8caf47a0df39de24fe016) description pun (@substack)
+- [87a1fe2](https://github.com/bcoe/yargs/commit/87a1fe29037ca2ca5fefda85141aaeb13e8ce761) mit/x11 license (@substack)
+- [8d089d2](https://github.com/bcoe/yargs/commit/8d089d24cd687c0bde3640a96c09b78f884900dd) bool example is more consistent and also shows off short option grouping (@substack)
+- [448d747](https://github.com/bcoe/yargs/commit/448d7473ac68e8e03d8befc9457b0d9e21725be0) start of the readme and examples (@substack)
+- [da74dea](https://github.com/bcoe/yargs/commit/da74dea799a9b59dbf022cbb8001bfdb0d52eec9) more tests for long and short captures (@substack)
+- [ab6387e](https://github.com/bcoe/yargs/commit/ab6387e6769ca4af82ca94c4c67c7319f0d9fcfa) silly bug in the tests with s/not/no/, all tests pass now (@substack)
+- [102496a](https://github.com/bcoe/yargs/commit/102496a319e8e06f6550d828fc2f72992c7d9ecc) hack an instance for process.argv onto Argv so the export can be called to create an instance or used for argv, which is the most common case (@substack)
+- [a01caeb](https://github.com/bcoe/yargs/commit/a01caeb532546d19f68f2b2b87f7036cfe1aaedd) divide example (@substack)
+- [443da55](https://github.com/bcoe/yargs/commit/443da55736acbaf8ff8b04d1b9ce19ab016ddda2) start of the lib with a package.json (@substack)
diff --git a/wrt/node_modules/yargs/LICENSE b/wrt/node_modules/yargs/LICENSE
new file mode 100644 (file)
index 0000000..432d1ae
--- /dev/null
@@ -0,0 +1,21 @@
+Copyright 2010 James Halliday (mail@substack.net)
+
+This project is free software released under the MIT/X11 license:
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/yargs/README.md b/wrt/node_modules/yargs/README.md
new file mode 100644 (file)
index 0000000..a310d31
--- /dev/null
@@ -0,0 +1,1071 @@
+yargs
+========
+
+Yargs be a node.js library fer hearties tryin' ter parse optstrings.
+
+With yargs, ye be havin' a map that leads straight to yer treasure! Treasure of course, being a simple option hash.
+
+[![Build Status][travis-image]][travis-url]
+[![Dependency Status][gemnasium-image]][gemnasium-url]
+[![Coverage Status][coveralls-image]][coveralls-url]
+[![NPM version][npm-image]][npm-url]
+
+> Yargs is the official successor to optimist. Please feel free to submit issues and pull requests. If you'd like to contribute and don't know where to start, have a look at [the issue list](https://github.com/bcoe/yargs/issues) :)
+
+examples
+========
+
+With yargs, the options be just a hash!
+-------------------------------------------------------------------
+
+plunder.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs').argv;
+
+if (argv.ships > 3 && argv.distance < 53.5) {
+    console.log('Plunder more riffiwobbles!');
+}
+else {
+    console.log('Retreat from the xupptumblers!');
+}
+````
+
+***
+
+    $ ./plunder.js --ships=4 --distance=22
+    Plunder more riffiwobbles!
+
+    $ ./plunder.js --ships 12 --distance 98.7
+    Retreat from the xupptumblers!
+
+![Joe was one optimistic pirate.](http://i.imgur.com/4WFGVJ9.png)
+
+But don't walk the plank just yet! There be more! You can do short options:
+-------------------------------------------------
+
+short.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs').argv;
+console.log('(%d,%d)', argv.x, argv.y);
+````
+
+***
+
+    $ ./short.js -x 10 -y 21
+    (10,21)
+
+And booleans, both long, short, and even grouped:
+----------------------------------
+
+bool.js:
+
+````javascript
+#!/usr/bin/env node
+var util = require('util');
+var argv = require('yargs').argv;
+
+if (argv.s) {
+    process.stdout.write(argv.fr ? 'Le perroquet dit: ' : 'The parrot says: ');
+}
+console.log(
+    (argv.fr ? 'couac' : 'squawk') + (argv.p ? '!' : '')
+);
+````
+
+***
+
+    $ ./bool.js -s
+    The parrot says: squawk
+
+    $ ./bool.js -sp
+    The parrot says: squawk!
+
+    $ ./bool.js -sp --fr
+    Le perroquet dit: couac!
+
+And non-hyphenated options too! Just use `argv._`!
+-------------------------------------------------
+
+nonopt.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs').argv;
+console.log('(%d,%d)', argv.x, argv.y);
+console.log(argv._);
+````
+
+***
+
+    $ ./nonopt.js -x 6.82 -y 3.35 rum
+    (6.82,3.35)
+    [ 'rum' ]
+
+    $ ./nonopt.js "me hearties" -x 0.54 yo -y 1.12 ho
+    (0.54,1.12)
+    [ 'me hearties', 'yo', 'ho' ]
+
+Yargs even counts your booleans!
+----------------------------------------------------------------------
+
+count.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs')
+    .count('verbose')
+    .alias('v', 'verbose')
+    .argv;
+
+VERBOSE_LEVEL = argv.verbose;
+
+function WARN()  { VERBOSE_LEVEL >= 0 && console.log.apply(console, arguments); }
+function INFO()  { VERBOSE_LEVEL >= 1 && console.log.apply(console, arguments); }
+function DEBUG() { VERBOSE_LEVEL >= 2 && console.log.apply(console, arguments); }
+
+WARN("Showing only important stuff");
+INFO("Showing semi-important stuff too");
+DEBUG("Extra chatty mode");
+````
+
+***
+    $ node count.js
+    Showing only important stuff
+
+    $ node count.js -v
+    Showing only important stuff
+    Showing semi-important stuff too
+
+    $ node count.js -vv
+    Showing only important stuff
+    Showing semi-important stuff too
+    Extra chatty mode
+
+    $ node count.js -v --verbose
+    Showing only important stuff
+    Showing semi-important stuff too
+    Extra chatty mode
+
+Tell users how to use yer options and make demands.
+-------------------------------------------------
+
+area.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs')
+    .usage('Usage: $0 -w [num] -h [num]')
+    .demand(['w','h'])
+    .argv;
+
+console.log("The area is:", argv.w * argv.h);
+````
+
+***
+
+    $ ./area.js -w 55 -h 11
+    The area is: 605
+
+    $ node ./area.js -w 4.91 -w 2.51
+    Usage: area.js -w [num] -h [num]
+
+    Options:
+      -w  [required]
+      -h  [required]
+
+    Missing required arguments: h
+
+After yer demands have been met, demand more! Ask for non-hypenated arguments!
+-----------------------------------------
+
+demand_count.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs')
+    .demand(2)
+    .argv;
+console.dir(argv);
+````
+
+***
+
+       $ ./demand_count.js a
+
+       Not enough non-option arguments: got 1, need at least 2
+
+       $ ./demand_count.js a b
+       { _: [ 'a', 'b' ], '$0': 'demand_count.js' }
+
+       $ ./demand_count.js a b c
+       { _: [ 'a', 'b', 'c' ], '$0': 'demand_count.js' }
+
+EVEN MORE SHIVER ME TIMBERS!
+------------------
+
+default_singles.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs')
+    .default('x', 10)
+    .default('y', 10)
+    .argv
+;
+console.log(argv.x + argv.y);
+````
+
+***
+
+    $ ./default_singles.js -x 5
+    15
+
+default_hash.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs')
+    .default({ x : 10, y : 10 })
+    .argv
+;
+console.log(argv.x + argv.y);
+````
+
+***
+
+    $ ./default_hash.js -y 7
+    17
+
+And if you really want to get all descriptive about it...
+---------------------------------------------------------
+
+boolean_single.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs')
+    .boolean('v')
+    .argv
+;
+console.dir(argv.v);
+console.dir(argv._);
+````
+
+***
+
+    $ ./boolean_single.js -v "me hearties" yo ho
+    true
+    [ 'me hearties', 'yo', 'ho' ]
+
+
+boolean_double.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs')
+    .boolean(['x','y','z'])
+    .argv
+;
+console.dir([ argv.x, argv.y, argv.z ]);
+console.dir(argv._);
+````
+
+***
+
+    $ ./boolean_double.js -x -z one two three
+    [ true, false, true ]
+    [ 'one', 'two', 'three' ]
+
+Yargs is here to help you...
+---------------------------
+
+Ye can describe parameters fer help messages and set aliases. Yargs figures
+out how ter format a handy help string automatically.
+
+line_count.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs')
+    .usage('Usage: $0 <command> [options]')
+    .command('count', 'Count the lines in a file')
+    .demand(1)
+    .example('$0 count -f foo.js', 'count the lines in the given file')
+    .demand('f')
+    .alias('f', 'file')
+    .nargs('f', 1)
+    .describe('f', 'Load a file')
+    .help('h')
+    .alias('h', 'help')
+    .epilog('copyright 2015')
+    .argv;
+
+var fs = require('fs');
+var s = fs.createReadStream(argv.file);
+
+var lines = 0;
+s.on('data', function (buf) {
+    lines += buf.toString().match(/\n/g).length;
+});
+
+s.on('end', function () {
+    console.log(lines);
+});
+````
+
+***
+    $ node line_count.js count
+    Usage: line_count.js <command> [options]
+
+    Commands:
+      count    Count the lines in a file
+
+    Options:
+      -f, --file  Load a file        [required]
+      -h, --help  Show help           [boolean]
+
+    Examples:
+      line_count.js count -f foo.js  count the lines in the given file
+
+    copyright 2015
+
+    Missing required arguments: f
+
+    $ node line_count.js count --file line_count.js
+    26
+
+    $ node line_count.js count -f line_count.js
+    26
+
+methods
+=======
+
+By itself,
+
+````javascript
+require('yargs').argv
+````
+
+will use the `process.argv` array to construct the `argv` object.
+
+You can pass in the `process.argv` yourself:
+
+````javascript
+require('yargs')([ '-x', '1', '-y', '2' ]).argv
+````
+
+or use `.parse()` to do the same thing:
+
+````javascript
+require('yargs').parse([ '-x', '1', '-y', '2' ])
+````
+
+The rest of these methods below come in just before the terminating `.argv`.
+
+.alias(key, alias)
+------------------
+
+Set key names as equivalent such that updates to a key will propagate to aliases
+and vice-versa.
+
+Optionally `.alias()` can take an object that maps keys to aliases.
+Each key of this object should be the canonical version of the option, and each
+value should be a string or an array of strings.
+
+.argv
+-----
+
+Get the arguments as a plain old object.
+
+Arguments without a corresponding flag show up in the `argv._` array.
+
+The script name or node command is available at `argv.$0` similarly to how `$0`
+works in bash or perl.
+
+If `yargs` is executed in an environment that embeds node and there's no script name (e.g. [Electron]
+(http://electron.atom.io/) or [nw.js](http://nwjs.io/)), it will ignore the first parameter since it
+expects it to be the script name. In order to override this behavior, use `.parse(process.argv.slice(1))`
+instead of `.argv` and the first parameter won't be ignored.
+
+.array(key)
+----------
+
+Tell the parser to interpret `key` as an array. If `.array('foo')` is set,
+`--foo foo bar` will be parsed as `['foo', 'bar']` rather than as `'foo'`.
+
+.boolean(key)
+-------------
+
+Interpret `key` as a boolean. If a non-flag option follows `key` in
+`process.argv`, that string won't get set as the value of `key`.
+
+`key` will default to `false`, unless a `default(key, undefined)` is
+explicitly set.
+
+If `key` is an array, interpret all the elements as booleans.
+
+.check(fn)
+----------
+
+Check that certain conditions are met in the provided arguments.
+
+`fn` is called with two arguments, the parsed `argv` hash and an array of options and their aliases.
+
+If `fn` throws or returns a non-truthy value, show the thrown error, usage information, and
+exit.
+
+.choices(key, choices)
+----------------------
+
+Limit valid values for `key` to a predefined set of `choices`, given as an array
+or as an individual value.
+
+```js
+var argv = require('yargs')
+  .alias('i', 'ingredient')
+  .describe('i', 'choose your sandwich ingredients')
+  .choices('i', ['peanut-butter', 'jelly', 'banana', 'pickles'])
+  .help('help')
+  .argv
+```
+
+If this method is called multiple times, all enumerated values will be merged
+together. Choices are generally strings or numbers, and value matching is
+case-sensitive.
+
+Optionally `.choices()` can take an object that maps multiple keys to their
+choices.
+
+Choices can also be specified as `choices` in the object given to `option()`.
+
+```js
+var argv = require('yargs')
+  .option('size', {
+    alias: 's',
+    describe: 'choose a size',
+    choices: ['xs', 's', 'm', 'l', 'xl']
+  })
+  .argv
+```
+
+.command(cmd, desc, [fn])
+-------------------
+
+Document the commands exposed by your application.
+
+Use `desc` to provide a description for each command your application accepts (the
+values stored in `argv._`).  Set `desc` to `false` to create a hidden command.
+Hidden commands don't show up in the help output and aren't available for
+completion.
+
+Optionally, you can provide a handler `fn` which will be executed when
+a given command is provided. The handler will be executed with an instance
+of `yargs`, which can be used to compose nested commands.
+
+Here's an example of top-level and nested commands in action:
+
+```js
+var argv = require('yargs')
+  .usage('npm <command>')
+  .command('install', 'tis a mighty fine package to install')
+  .command('publish', 'shiver me timbers, should you be sharing all that', function (yargs) {
+    argv = yargs.option('f', {
+      alias: 'force',
+      description: 'yar, it usually be a bad idea'
+    })
+    .help('help')
+    .argv
+  })
+  .help('help')
+  .argv;
+```
+
+.completion(cmd, [description], [fn]);
+-------------
+
+Enable bash-completion shortcuts for commands and options.
+
+`cmd`: When present in `argv._`, will result in the `.bashrc` completion script
+being outputted. To enable bash completions, concat the generated script to your
+`.bashrc` or `.bash_profile`.
+
+`description`: Provide a description in your usage instructions for the command
+that generates bash completion scripts.
+
+`fn`: Rather than relying on yargs' default completion functionality, which
+shiver me timbers is pretty awesome, you can provide your own completion
+method.
+
+```js
+var argv = require('yargs')
+  .completion('completion', function(current, argv) {
+    // 'current' is the current command being completed.
+    // 'argv' is the parsed arguments so far.
+    // simply return an array of completions.
+    return [
+      'foo',
+      'bar'
+    ];
+  })
+  .argv;
+```
+
+But wait, there's more! You can provide asynchronous completions.
+
+```js
+var argv = require('yargs')
+  .completion('completion', function(current, argv, done) {
+    setTimeout(function() {
+      done([
+        'apple',
+        'banana'
+      ]);
+    }, 500);
+  })
+  .argv;
+```
+
+.config(key, [description])
+------------
+
+Tells the parser that if the option specified by `key` is passed in, it
+should be interpreted as a path to a JSON config file. The file is loaded
+and parsed, and its properties are set as arguments. If present, the
+`description` parameter customizes the description of the config (`key`) option
+in the usage string.
+
+.default(key, value, [description])
+--------------------
+
+Set `argv[key]` to `value` if no option was specified in `process.argv`.
+
+Optionally `.default()` can take an object that maps keys to default values.
+
+But wait, there's more! The default value can be a `function` which returns
+a value. The name of the function will be used in the usage string:
+
+```js
+var argv = require('yargs')
+  .default('random', function randomValue() {
+    return Math.random() * 256;
+  }).argv;
+```
+
+Optionally, `description` can also be provided and will take precedence over
+displaying the value in the usage instructions:
+
+```js
+.default('timeout', 60000, '(one-minute)')
+```
+
+<a name="demand-key-msg-boolean"></a>.demand(key, [msg | boolean])
+------------------------------
+.demand(count, [max], [msg])
+------------------------------
+
+If `key` is a string, show the usage information and exit if `key` wasn't
+specified in `process.argv`.
+
+If `key` is a number, demand at least as many non-option arguments, which show
+up in `argv._`. A second number can also optionally be provided, which indicates
+the maximum number of non-option arguments.
+
+If `key` is an array, demand each element.
+
+If a `msg` string is given, it will be printed when the argument is missing,
+instead of the standard error message. This is especially helpful for the non-option arguments in `argv._`.
+
+If a `boolean` value is given, it controls whether the option is demanded;
+this is useful when using `.options()` to specify command line parameters.
+
+.describe(key, desc)
+--------------------
+
+Describe a `key` for the generated usage information.
+
+Optionally `.describe()` can take an object that maps keys to descriptions.
+
+.epilog(str)
+------------
+.epilogue(str)
+--------------
+
+A message to print at the end of the usage instructions, e.g.
+
+```js
+var argv = require('yargs')
+  .epilogue('for more information, find our manual at http://example.com');
+```
+
+.example(cmd, desc)
+-------------------
+
+Give some example invocations of your program. Inside `cmd`, the string
+`$0` will get interpolated to the current script name or node command for the
+present script similar to how `$0` works in bash or perl.
+Examples will be printed out as part of the help message.
+
+.exitProcess(enable)
+----------------------------------
+
+By default, yargs exits the process when the user passes a help flag, uses the
+`.version` functionality, or when validation fails. Calling
+`.exitProcess(false)` disables this behavior, enabling further actions after
+yargs have been validated.
+
+.fail(fn)
+---------
+
+Method to execute when a failure occurs, rather than printing the failure message.
+
+`fn` is called with the failure message that would have been printed.
+
+.help([option, [description]])
+------------------------------
+
+Add an option (e.g. `--help`) that displays the usage string and exits the
+process. If present, the `description` parameter customizes the description of
+the help option in the usage string.
+
+If invoked without parameters, `.help()` returns the generated usage string.
+
+Example:
+
+```js
+var yargs = require("yargs")
+  .usage("$0 -operand1 number -operand2 number -operation [add|subtract]");
+console.log(yargs.help());
+```
+
+Later on, `argv` can be retrieved with `yargs.argv`.
+
+.implies(x, y)
+--------------
+
+Given the key `x` is set, it is required that the key `y` is set.
+
+Optionally `.implies()` can accept an object specifying multiple implications.
+
+.locale(locale)
+---------------
+
+Set a locale other than the default `en` locale:
+
+```js
+var argv = require('yargs')
+  .usage('./$0 - follow ye instructions true')
+  .option('option', {
+    alias: 'o',
+    describe: "'tis a mighty fine option",
+    demand: true
+  })
+  .command('run', "Arrr, ya best be knowin' what yer doin'")
+  .example('$0 run foo', "shiver me timbers, here's an example for ye")
+  .help('help')
+  .wrap(70)
+  .locale('pirate')
+  .argv
+```
+
+***
+
+```shell
+./test.js - follow ye instructions true
+
+Choose yer command:
+  run  Arrr, ya best be knowin' what yer doin'
+
+Options for me hearties!
+  --option, -o  'tis a mighty fine option               [requi-yar-ed]
+  --help        Parlay this here code of conduct             [boolean]
+
+Ex. marks the spot:
+  test.js run foo  shiver me timbers, here's an example for ye
+
+Ye be havin' to set the followin' argument land lubber: option
+```
+
+Locales currently supported:
+
+* **en:** American English.
+* **es:** Spanish.
+* **fr:** French.
+* **pt:** Portuguese.
+* **pirate:** American Pirate.
+
+To submit a new translation for yargs:
+
+1. use `./locales/en.json` as a starting point.
+2. submit a pull request with the new locale file.
+
+.nargs(key, count)
+-----------
+
+The number of arguments that should be consumed after a key. This can be a
+useful hint to prevent parsing ambiguity. For example:
+
+```js
+var argv = require('yargs')
+  .nargs('token', 1)
+  .parse(['--token', '-my-token']);
+```
+
+parses as:
+
+`{ _: [], token: '-my-token', '$0': 'node test' }`
+
+Optionally `.nargs()` can take an object of `key`/`narg` pairs.
+
+.option(key, opt)
+-----------------
+.options(key, opt)
+------------------
+
+Instead of chaining together `.alias().demand().default().describe().string()`, you can specify
+keys in `opt` for each of the chainable methods.
+
+For example:
+
+````javascript
+var argv = require('yargs')
+    .option('f', {
+        alias: 'file',
+        demand: true,
+        default: '/etc/passwd',
+        describe: 'x marks the spot',
+        type: 'string'
+    })
+    .argv
+;
+````
+
+is the same as
+
+````javascript
+var argv = require('yargs')
+    .alias('f', 'file')
+    .demand('f')
+    .default('f', '/etc/passwd')
+    .describe('f', 'x marks the spot')
+    .string('f')
+    .argv
+;
+````
+
+Optionally `.options()` can take an object that maps keys to `opt` parameters.
+
+````javascript
+var argv = require('yargs')
+    .options({
+      'f': {
+        alias: 'file',
+        demand: true,
+        default: '/etc/passwd',
+        describe: 'x marks the spot',
+        type: 'string'
+      }
+    })
+    .argv
+;
+````
+
+.parse(args)
+------------
+
+Parse `args` instead of `process.argv`. Returns the `argv` object.
+
+.require(key, [msg | boolean])
+------------------------------
+.required(key, [msg | boolean])
+------------------------------
+
+An alias for [`demand()`](#demand-key-msg-boolean). See docs there.
+
+.requiresArg(key)
+-----------------
+
+Specifies either a single option key (string), or an array of options that
+must be followed by option values. If any option value is missing, show the
+usage information and exit.
+
+The default behavior is to set the value of any key not followed by an
+option value to `true`.
+
+.reset()
+--------
+
+Reset the argument object built up so far. This is useful for
+creating nested command line interfaces.
+
+```js
+var yargs = require('yargs')
+  .usage('$0 command')
+  .command('hello', 'hello command')
+  .command('world', 'world command')
+  .demand(1, 'must provide a valid command'),
+  argv = yargs.argv,
+  command = argv._[0];
+
+if (command === 'hello') {
+  yargs.reset()
+    .usage('$0 hello')
+    .help('h')
+    .example('$0 hello', 'print the hello message!')
+    .argv
+
+  console.log('hello!');
+} else if (command === 'world'){
+  yargs.reset()
+    .usage('$0 world')
+    .help('h')
+    .example('$0 world', 'print the world message!')
+    .argv
+
+  console.log('world!');
+} else {
+  yargs.showHelp();
+}
+```
+
+.showCompletionScript()
+----------------------
+
+Generate a bash completion script. Users of your application can install this
+script in their `.bashrc`, and yargs will provide completion shortcuts for
+commands and options.
+
+.showHelp(consoleLevel='error')
+---------------------------
+
+Print the usage data using the [`console`](https://nodejs.org/api/console.html) function `consoleLevel` for printing.
+
+Example:
+
+```js
+var yargs = require("yargs")
+  .usage("$0 -operand1 number -operand2 number -operation [add|subtract]");
+yargs.showHelp(); //prints to stderr using console.error()
+```
+
+Or, to print the usage data to `stdout` instead, you can specify the use of `console.log`:
+
+```js
+yargs.showHelp("log"); //prints to stdout using console.log()
+```
+
+Later on, `argv` can be retrieved with `yargs.argv`.
+
+.showHelpOnFail(enable, [message])
+----------------------------------
+
+By default, yargs outputs a usage string if any error is detected. Use the
+`.showHelpOnFail()` method to customize this behavior. If `enable` is `false`,
+the usage string is not output. If the `message` parameter is present, this
+message is output after the error message.
+
+line_count.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs')
+    .usage('Count the lines in a file.\nUsage: $0 -f <file>')
+    .demand('f')
+    .alias('f', 'file')
+    .describe('f', 'Load a file')
+    .string('f')
+    .showHelpOnFail(false, 'Specify --help for available options')
+    .help('help')
+    .argv;
+
+// etc.
+````
+
+***
+
+```
+$ node line_count.js
+Missing argument value: f
+
+Specify --help for available options
+```
+
+.strict()
+---------
+
+Any command-line argument given that is not demanded, or does not have a
+corresponding description, will be reported as an error.
+
+.string(key)
+------------
+
+Tell the parser logic not to interpret `key` as a number or boolean.
+This can be useful if you need to preserve leading zeros in an input.
+
+If `key` is an array, interpret all the elements as strings.
+
+`.string('_')` will result in non-hyphenated arguments being interpreted as strings,
+regardless of whether they resemble numbers.
+
+.updateLocale(obj)
+------------------
+.updateStrings(obj)
+------------------
+
+Override the default strings used by yargs with the key/value
+pairs provided in `obj`:
+
+```js
+var argv = require('yargs')
+  .command('run', 'the run command')
+  .help('help')
+  .updateStrings({
+    'Commands:': 'My Commands -->\n'
+  })
+  .wrap(null)
+  .argv
+```
+
+***
+
+```shell
+My Commands -->
+
+  run  the run command
+
+Options:
+  --help  Show help  [boolean]
+```
+
+If you explicitly specify a `locale()`, you should do so *before* calling
+`updateStrings()`.
+
+.usage(message, [opts])
+---------------------
+
+Set a usage message to show which commands to use. Inside `message`, the string
+`$0` will get interpolated to the current script name or node command for the
+present script similar to how `$0` works in bash or perl.
+
+`opts` is optional and acts like calling `.options(opts)`.
+
+.version(version, [option], [description])
+----------------------------------------
+
+Add an option (e.g. `--version`) that displays the version number (given by the
+`version` parameter) and exits the process. If present, the `description`
+parameter customizes the description of the version option in the usage string.
+
+You can provide a `function` for version, rather than a string.
+This is useful if you want to use the version from your package.json:
+
+```js
+var argv = require('yargs')
+  .version(function() {
+    return require('../package').version;
+  })
+  .argv;
+```
+
+.wrap(columns)
+--------------
+
+Format usage output to wrap at `columns` many columns.
+
+By default wrap will be set to `Math.min(80, windowWidth)`. Use `.wrap(null)` to
+specify no column limit (no right-align). Use `.wrap(yargs.terminalWidth())` to
+maximize the width of yargs' usage instructions.
+
+parsing tricks
+==============
+
+stop parsing
+------------
+
+Use `--` to stop parsing flags and stuff the remainder into `argv._`.
+
+    $ node examples/reflect.js -a 1 -b 2 -- -c 3 -d 4
+    { _: [ '-c', '3', '-d', '4' ],
+      a: 1,
+      b: 2,
+      '$0': 'examples/reflect.js' }
+
+negate fields
+-------------
+
+If you want to explicity set a field to false instead of just leaving it
+undefined or to override a default you can do `--no-key`.
+
+    $ node examples/reflect.js -a --no-b
+    { _: [], a: true, b: false, '$0': 'examples/reflect.js' }
+
+numbers
+-------
+
+Every argument that looks like a number (`!isNaN(Number(arg))`) is converted to
+one. This way you can just `net.createConnection(argv.port)` and you can add
+numbers out of `argv` with `+` without having that mean concatenation,
+which is super frustrating.
+
+duplicates
+----------
+
+If you specify a flag multiple times it will get turned into an array containing
+all the values in order.
+
+    $ node examples/reflect.js -x 5 -x 8 -x 0
+    { _: [], x: [ 5, 8, 0 ], '$0': 'examples/reflect.js' }
+
+dot notation
+------------
+
+When you use dots (`.`s) in argument names, an implicit object path is assumed.
+This lets you organize arguments into nested objects.
+
+    $ node examples/reflect.js --foo.bar.baz=33 --foo.quux=5
+    { _: [],
+      foo: { bar: { baz: 33 }, quux: 5 },
+      '$0': 'examples/reflect.js' }
+
+short numbers
+-------------
+
+Short numeric `-n5` style arguments work too:
+
+    $ node examples/reflect.js -n123 -m456
+    { _: [], n: 123, m: 456, '$0': 'examples/reflect.js' }
+
+installation
+============
+
+With [npm](http://github.com/isaacs/npm), just do:
+
+    npm install yargs
+
+or clone this project on github:
+
+    git clone http://github.com/bcoe/yargs.git
+
+To run the tests with npm, just do:
+
+    npm test
+
+inspired by
+===========
+
+This module is loosely inspired by Perl's
+[Getopt::Casual](http://search.cpan.org/~photo/Getopt-Casual-0.13.1/Casual.pm).
+
+
+
+[travis-url]: https://travis-ci.org/bcoe/yargs
+[travis-image]: https://img.shields.io/travis/bcoe/yargs.svg
+[gemnasium-url]: https://gemnasium.com/bcoe/yargs
+[gemnasium-image]: https://img.shields.io/gemnasium/bcoe/yargs.svg
+[coveralls-url]: https://coveralls.io/github/bcoe/yargs
+[coveralls-image]: https://img.shields.io/coveralls/bcoe/yargs.svg
+[npm-url]: https://npmjs.org/package/yargs
+[npm-image]: https://img.shields.io/npm/v/yargs.svg
diff --git a/wrt/node_modules/yargs/completion.sh.hbs b/wrt/node_modules/yargs/completion.sh.hbs
new file mode 100644 (file)
index 0000000..8392ad5
--- /dev/null
@@ -0,0 +1,28 @@
+###-begin-{{app_name}}-completions-###
+#
+# yargs command completion script
+#
+# Installation: {{app_path}} completion >> ~/.bashrc
+#    or {{app_path}} completion >> ~/.bash_profile on OSX.
+#
+_yargs_completions()
+{
+    local cur_word args type_list
+
+    cur_word="${COMP_WORDS[COMP_CWORD]}"
+    args=$(printf "%s " "${COMP_WORDS[@]}")
+
+    # ask yargs to generate completions.
+    type_list=`{{app_path}} --get-yargs-completions $args`
+
+    COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) )
+
+    # if no match was found, fall back to filename completion
+    if [ ${#COMPREPLY[@]} -eq 0 ]; then
+      COMPREPLY=( $(compgen -f -- "${cur_word}" ) )
+    fi
+
+    return 0
+}
+complete -F _yargs_completions {{app_name}}
+###-end-{{app_name}}-completions-###
diff --git a/wrt/node_modules/yargs/index.js b/wrt/node_modules/yargs/index.js
new file mode 100644 (file)
index 0000000..0376469
--- /dev/null
@@ -0,0 +1,564 @@
+var assert = require('assert')
+var Completion = require('./lib/completion')
+var Parser = require('./lib/parser')
+var path = require('path')
+var Usage = require('./lib/usage')
+var Validation = require('./lib/validation')
+var Y18n = require('y18n')
+
+Argv(process.argv.slice(2))
+
+var exports = module.exports = Argv
+function Argv (processArgs, cwd) {
+  processArgs = processArgs || [] // handle calling yargs().
+
+  var self = {}
+  var completion = null
+  var usage = null
+  var validation = null
+  var y18n = Y18n({
+    directory: path.resolve(__dirname, './locales'),
+    locale: 'en',
+    updateFiles: false
+  })
+
+  if (!cwd) cwd = process.cwd()
+
+  self.$0 = process.argv
+    .slice(0, 2)
+    .map(function (x, i) {
+      // ignore the node bin, specify this in your
+      // bin file with #!/usr/bin/env node
+      if (i === 0 && /\b(node|iojs)$/.test(x)) return
+      var b = rebase(cwd, x)
+      return x.match(/^\//) && b.length < x.length
+      ? b : x
+    })
+    .join(' ').trim()
+
+  if (process.env._ !== undefined && process.argv[1] === process.env._) {
+    self.$0 = process.env._.replace(
+      path.dirname(process.execPath) + '/', ''
+    )
+  }
+
+  var options
+  self.resetOptions = self.reset = function () {
+    // put yargs back into its initial
+    // state, this is useful for creating a
+    // nested CLI.
+    options = {
+      array: [],
+      boolean: [],
+      string: [],
+      narg: {},
+      key: {},
+      alias: {},
+      default: {},
+      defaultDescription: {},
+      choices: {},
+      requiresArg: [],
+      count: [],
+      normalize: [],
+      config: []
+    }
+
+    usage = Usage(self, y18n) // handle usage output.
+    validation = Validation(self, usage, y18n) // handle arg validation.
+    completion = Completion(self, usage)
+
+    demanded = {}
+
+    exitProcess = true
+    strict = false
+    helpOpt = null
+    versionOpt = null
+    commandHandlers = {}
+    self.parsed = false
+
+    return self
+  }
+  self.resetOptions()
+
+  self.boolean = function (bools) {
+    options.boolean.push.apply(options.boolean, [].concat(bools))
+    return self
+  }
+
+  self.array = function (arrays) {
+    options.array.push.apply(options.array, [].concat(arrays))
+    return self
+  }
+
+  self.nargs = function (key, n) {
+    if (typeof key === 'object') {
+      Object.keys(key).forEach(function (k) {
+        self.nargs(k, key[k])
+      })
+    } else {
+      options.narg[key] = n
+    }
+    return self
+  }
+
+  self.choices = function (key, values) {
+    if (typeof key === 'object') {
+      Object.keys(key).forEach(function (k) {
+        self.choices(k, key[k])
+      })
+    } else {
+      options.choices[key] = (options.choices[key] || []).concat(values)
+    }
+    return self
+  }
+
+  self.normalize = function (strings) {
+    options.normalize.push.apply(options.normalize, [].concat(strings))
+    return self
+  }
+
+  self.config = function (key, msg) {
+    self.describe(key, msg || usage.deferY18nLookup('Path to JSON config file'))
+    options.config.push.apply(options.config, [].concat(key))
+    return self
+  }
+
+  self.example = function (cmd, description) {
+    usage.example(cmd, description)
+    return self
+  }
+
+  self.command = function (cmd, description, fn) {
+    if (description !== false) {
+      usage.command(cmd, description)
+    }
+    if (fn) commandHandlers[cmd] = fn
+    return self
+  }
+
+  var commandHandlers = {}
+  self.getCommandHandlers = function () {
+    return commandHandlers
+  }
+
+  self.string = function (strings) {
+    options.string.push.apply(options.string, [].concat(strings))
+    return self
+  }
+
+  self.default = function (key, value, defaultDescription) {
+    if (typeof key === 'object') {
+      Object.keys(key).forEach(function (k) {
+        self.default(k, key[k])
+      })
+    } else {
+      if (typeof value === 'function') {
+        defaultDescription = usage.functionDescription(value, defaultDescription)
+        value = value.call()
+      }
+      options.defaultDescription[key] = defaultDescription
+      options.default[key] = value
+    }
+    return self
+  }
+
+  self.alias = function (x, y) {
+    if (typeof x === 'object') {
+      Object.keys(x).forEach(function (key) {
+        self.alias(key, x[key])
+      })
+    } else {
+      options.alias[x] = (options.alias[x] || []).concat(y)
+    }
+    return self
+  }
+
+  self.count = function (counts) {
+    options.count.push.apply(options.count, [].concat(counts))
+    return self
+  }
+
+  var demanded = {}
+  self.demand = self.required = self.require = function (keys, max, msg) {
+    // you can optionally provide a 'max' key,
+    // which will raise an exception if too many '_'
+    // options are provided.
+    if (typeof max !== 'number') {
+      msg = max
+      max = Infinity
+    }
+
+    if (typeof keys === 'number') {
+      if (!demanded._) demanded._ = { count: 0, msg: null, max: max }
+      demanded._.count = keys
+      demanded._.msg = msg
+    } else if (Array.isArray(keys)) {
+      keys.forEach(function (key) {
+        self.demand(key, msg)
+      })
+    } else {
+      if (typeof msg === 'string') {
+        demanded[keys] = { msg: msg }
+      } else if (msg === true || typeof msg === 'undefined') {
+        demanded[keys] = { msg: undefined }
+      }
+    }
+
+    return self
+  }
+  self.getDemanded = function () {
+    return demanded
+  }
+
+  self.requiresArg = function (requiresArgs) {
+    options.requiresArg.push.apply(options.requiresArg, [].concat(requiresArgs))
+    return self
+  }
+
+  self.implies = function (key, value) {
+    validation.implies(key, value)
+    return self
+  }
+
+  self.usage = function (msg, opts) {
+    if (!opts && typeof msg === 'object') {
+      opts = msg
+      msg = null
+    }
+
+    usage.usage(msg)
+
+    if (opts) self.options(opts)
+
+    return self
+  }
+
+  self.epilogue = self.epilog = function (msg) {
+    usage.epilog(msg)
+    return self
+  }
+
+  self.fail = function (f) {
+    usage.failFn(f)
+    return self
+  }
+
+  self.check = function (f) {
+    validation.check(f)
+    return self
+  }
+
+  self.defaults = self.default
+
+  self.describe = function (key, desc) {
+    options.key[key] = true
+    usage.describe(key, desc)
+    return self
+  }
+
+  self.parse = function (args) {
+    return parseArgs(args)
+  }
+
+  self.option = self.options = function (key, opt) {
+    if (typeof key === 'object') {
+      Object.keys(key).forEach(function (k) {
+        self.options(k, key[k])
+      })
+    } else {
+      assert(typeof opt === 'object', 'second argument to option must be an object')
+
+      options.key[key] = true // track manually set keys.
+
+      if (opt.alias) self.alias(key, opt.alias)
+
+      var demand = opt.demand || opt.required || opt.require
+
+      if (demand) {
+        self.demand(key, demand)
+      } if ('config' in opt) {
+        self.config(key)
+      } if ('default' in opt) {
+        self.default(key, opt.default)
+      } if ('nargs' in opt) {
+        self.nargs(key, opt.nargs)
+      } if ('choices' in opt) {
+        self.choices(key, opt.choices)
+      } if (opt.boolean || opt.type === 'boolean') {
+        self.boolean(key)
+        if (opt.alias) self.boolean(opt.alias)
+      } if (opt.array || opt.type === 'array') {
+        self.array(key)
+        if (opt.alias) self.array(opt.alias)
+      } if (opt.string || opt.type === 'string') {
+        self.string(key)
+        if (opt.alias) self.string(opt.alias)
+      } if (opt.count || opt.type === 'count') {
+        self.count(key)
+      }
+
+      var desc = opt.describe || opt.description || opt.desc
+      if (desc) {
+        self.describe(key, desc)
+      }
+
+      if (opt.requiresArg) {
+        self.requiresArg(key)
+      }
+    }
+
+    return self
+  }
+  self.getOptions = function () {
+    return options
+  }
+
+  self.wrap = function (cols) {
+    usage.wrap(cols)
+    return self
+  }
+
+  var strict = false
+  self.strict = function () {
+    strict = true
+    return self
+  }
+  self.getStrict = function () {
+    return strict
+  }
+
+  self.showHelp = function (level) {
+    if (!self.parsed) parseArgs(processArgs) // run parser, if it has not already been executed.
+    usage.showHelp(level)
+    return self
+  }
+
+  var versionOpt = null
+  self.version = function (ver, opt, msg) {
+    versionOpt = opt || 'version'
+    usage.version(ver)
+    self.boolean(versionOpt)
+    self.describe(versionOpt, msg || usage.deferY18nLookup('Show version number'))
+    return self
+  }
+
+  var helpOpt = null
+  self.addHelpOpt = function (opt, msg) {
+    helpOpt = opt
+    self.boolean(opt)
+    self.describe(opt, msg || usage.deferY18nLookup('Show help'))
+    return self
+  }
+
+  self.showHelpOnFail = function (enabled, message) {
+    usage.showHelpOnFail(enabled, message)
+    return self
+  }
+
+  var exitProcess = true
+  self.exitProcess = function (enabled) {
+    if (typeof enabled !== 'boolean') {
+      enabled = true
+    }
+    exitProcess = enabled
+    return self
+  }
+  self.getExitProcess = function () {
+    return exitProcess
+  }
+
+  self.help = function () {
+    if (arguments.length > 0) return self.addHelpOpt.apply(self, arguments)
+
+    if (!self.parsed) parseArgs(processArgs) // run parser, if it has not already been executed.
+
+    return usage.help()
+  }
+
+  var completionCommand = null
+  self.completion = function (cmd, desc, fn) {
+    // a function to execute when generating
+    // completions can be provided as the second
+    // or third argument to completion.
+    if (typeof desc === 'function') {
+      fn = desc
+      desc = null
+    }
+
+    // register the completion command.
+    completionCommand = cmd || 'completion'
+    if (!desc && desc !== false) {
+      desc = 'generate bash completion script'
+    }
+    self.command(completionCommand, desc)
+
+    // a function can be provided
+    if (fn) completion.registerFunction(fn)
+
+    return self
+  }
+
+  self.showCompletionScript = function ($0) {
+    $0 = $0 || self.$0
+    console.log(completion.generateCompletionScript($0))
+    return self
+  }
+
+  self.locale = function (locale) {
+    y18n.setLocale(locale)
+    return self
+  }
+
+  self.updateStrings = self.updateLocale = function (obj) {
+    y18n.updateLocale(obj)
+    return self
+  }
+
+  self.getUsageInstance = function () {
+    return usage
+  }
+
+  self.getValidationInstance = function () {
+    return validation
+  }
+
+  self.terminalWidth = function () {
+    return require('window-size').width
+  }
+
+  Object.defineProperty(self, 'argv', {
+    get: function () {
+      var args = null
+
+      try {
+        args = parseArgs(processArgs)
+      } catch (err) {
+        usage.fail(err.message)
+      }
+
+      return args
+    },
+    enumerable: true
+  })
+
+  function parseArgs (args) {
+    var parsed = Parser(args, options, y18n)
+    var argv = parsed.argv
+    var aliases = parsed.aliases
+
+    argv.$0 = self.$0
+
+    self.parsed = parsed
+
+    // while building up the argv object, there
+    // are two passes through the parser. If completion
+    // is being performed short-circuit on the first pass.
+    if (completionCommand &&
+      (process.argv.join(' ')).indexOf(completion.completionKey) !== -1 &&
+      !argv[completion.completionKey]) {
+      return argv
+    }
+
+    // if there's a handler associated with a
+    // command defer processing to it.
+    var handlerKeys = Object.keys(self.getCommandHandlers())
+    for (var i = 0, command; (command = handlerKeys[i]) !== undefined; i++) {
+      if (~argv._.indexOf(command)) {
+        self.getCommandHandlers()[command](self.reset())
+        return self.argv
+      }
+    }
+
+    // generate a completion script for adding to ~/.bashrc.
+    if (completionCommand && ~argv._.indexOf(completionCommand) && !argv[completion.completionKey]) {
+      self.showCompletionScript()
+      if (exitProcess) {
+        process.exit(0)
+      }
+    }
+
+    // we must run completions first, a user might
+    // want to complete the --help or --version option.
+    if (completion.completionKey in argv) {
+      // we allow for asynchronous completions,
+      // e.g., loading in a list of commands from an API.
+      completion.getCompletion(function (completions) {
+        ;(completions || []).forEach(function (completion) {
+          console.log(completion)
+        })
+
+        if (exitProcess) {
+          process.exit(0)
+        }
+      })
+      return
+    }
+
+    Object.keys(argv).forEach(function (key) {
+      if (key === helpOpt && argv[key]) {
+        self.showHelp('log')
+        if (exitProcess) {
+          process.exit(0)
+        }
+      } else if (key === versionOpt && argv[key]) {
+        usage.showVersion()
+        if (exitProcess) {
+          process.exit(0)
+        }
+      }
+    })
+
+    if (parsed.error) throw parsed.error
+
+    // if we're executed via bash completion, don't
+    // bother with validation.
+    if (!argv[completion.completionKey]) {
+      validation.nonOptionCount(argv)
+      validation.missingArgumentValue(argv)
+      validation.requiredArguments(argv)
+      if (strict) validation.unknownArguments(argv, aliases)
+      validation.customChecks(argv, aliases)
+      validation.limitedChoices(argv)
+      validation.implications(argv)
+    }
+
+    setPlaceholderKeys(argv)
+
+    return argv
+  }
+
+  function setPlaceholderKeys (argv) {
+    Object.keys(options.key).forEach(function (key) {
+      if (typeof argv[key] === 'undefined') argv[key] = undefined
+    })
+  }
+
+  sigletonify(self)
+  return self
+}
+
+// rebase an absolute path to a relative one with respect to a base directory
+// exported for tests
+exports.rebase = rebase
+function rebase (base, dir) {
+  return path.relative(base, dir)
+}
+
+/*  Hack an instance of Argv with process.argv into Argv
+    so people can do
+    require('yargs')(['--beeble=1','-z','zizzle']).argv
+    to parse a list of args and
+    require('yargs').argv
+    to get a parsed version of process.argv.
+*/
+function sigletonify (inst) {
+  Object.keys(inst).forEach(function (key) {
+    if (key === 'argv') {
+      Argv.__defineGetter__(key, inst.__lookupGetter__(key))
+    } else {
+      Argv[key] = typeof inst[key] === 'function'
+      ? inst[key].bind(inst)
+      : inst[key]
+    }
+  })
+}
diff --git a/wrt/node_modules/yargs/lib/completion.js b/wrt/node_modules/yargs/lib/completion.js
new file mode 100644 (file)
index 0000000..33e9b75
--- /dev/null
@@ -0,0 +1,80 @@
+var fs = require('fs')
+var path = require('path')
+
+// add bash completions to your
+//  yargs-powered applications.
+module.exports = function (yargs, usage) {
+  var self = {
+    completionKey: 'get-yargs-completions'
+  }
+
+  // get a list of completion commands.
+  self.getCompletion = function (done) {
+    var completions = []
+    var current = process.argv[process.argv.length - 1]
+    var previous = process.argv.slice(process.argv.indexOf('--' + self.completionKey) + 1)
+    var argv = yargs.parse(previous)
+
+    // a custom completion function can be provided
+    // to completion().
+    if (completionFunction) {
+      if (completionFunction.length < 3) {
+        // synchronous completion function.
+        return done(completionFunction(current, argv))
+      } else {
+        // asynchronous completion function
+        return completionFunction(current, argv, function (completions) {
+          done(completions)
+        })
+      }
+    }
+
+    var handlers = yargs.getCommandHandlers()
+    for (var i = 0, ii = previous.length; i < ii; ++i) {
+      if (handlers[previous[i]]) {
+        return handlers[previous[i]](yargs.reset())
+      }
+    }
+
+    if (!current.match(/^-/)) {
+      usage.getCommands().forEach(function (command) {
+        if (previous.indexOf(command[0]) === -1) {
+          completions.push(command[0])
+        }
+      })
+    }
+
+    if (current.match(/^-/)) {
+      Object.keys(yargs.getOptions().key).forEach(function (key) {
+        completions.push('--' + key)
+      })
+    }
+
+    done(completions)
+  }
+
+  // generate the completion script to add to your .bashrc.
+  self.generateCompletionScript = function ($0) {
+    var script = fs.readFileSync(
+      path.resolve(__dirname, '../completion.sh.hbs'),
+      'utf-8'
+    )
+    var name = path.basename($0)
+
+    // add ./to applications not yet installed as bin.
+    if ($0.match(/\.js$/)) $0 = './' + $0
+
+    script = script.replace(/{{app_name}}/g, name)
+    return script.replace(/{{app_path}}/g, $0)
+  }
+
+  // register a function to perform your own custom
+  // completions., this function can be either
+  // synchrnous or asynchronous.
+  var completionFunction = null
+  self.registerFunction = function (fn) {
+    completionFunction = fn
+  }
+
+  return self
+}
diff --git a/wrt/node_modules/yargs/lib/parser.js b/wrt/node_modules/yargs/lib/parser.js
new file mode 100644 (file)
index 0000000..145c57e
--- /dev/null
@@ -0,0 +1,467 @@
+// fancy-pants parsing of argv, originally forked
+// from minimist: https://www.npmjs.com/package/minimist
+var camelCase = require('camelcase')
+var path = require('path')
+
+function increment (orig) {
+  return orig !== undefined ? orig + 1 : 0
+}
+
+module.exports = function (args, opts, y18n) {
+  if (!opts) opts = {}
+
+  var __ = y18n.__
+  var error = null
+  var flags = { arrays: {}, bools: {}, strings: {}, counts: {}, normalize: {}, configs: {}, defaulted: {} }
+
+  ;[].concat(opts['array']).filter(Boolean).forEach(function (key) {
+    flags.arrays[key] = true
+  })
+
+  ;[].concat(opts['boolean']).filter(Boolean).forEach(function (key) {
+    flags.bools[key] = true
+  })
+
+  ;[].concat(opts.string).filter(Boolean).forEach(function (key) {
+    flags.strings[key] = true
+  })
+
+  ;[].concat(opts.count).filter(Boolean).forEach(function (key) {
+    flags.counts[key] = true
+  })
+
+  ;[].concat(opts.normalize).filter(Boolean).forEach(function (key) {
+    flags.normalize[key] = true
+  })
+
+  ;[].concat(opts.config).filter(Boolean).forEach(function (key) {
+    flags.configs[key] = true
+  })
+
+  var aliases = {}
+  var newAliases = {}
+
+  extendAliases(opts.key)
+  extendAliases(opts.alias)
+
+  var defaults = opts['default'] || {}
+  Object.keys(defaults).forEach(function (key) {
+    if (/-/.test(key) && !opts.alias[key]) {
+      aliases[key] = aliases[key] || []
+    }
+    (aliases[key] || []).forEach(function (alias) {
+      defaults[alias] = defaults[key]
+    })
+  })
+
+  var argv = { _: [] }
+
+  Object.keys(flags.bools).forEach(function (key) {
+    setArg(key, !(key in defaults) ? false : defaults[key])
+    setDefaulted(key)
+  })
+
+  var notFlags = []
+  if (args.indexOf('--') !== -1) {
+    notFlags = args.slice(args.indexOf('--') + 1)
+    args = args.slice(0, args.indexOf('--'))
+  }
+
+  for (var i = 0; i < args.length; i++) {
+    var arg = args[i]
+    var broken
+    var key
+    var letters
+    var m
+    var next
+    var value
+
+    // -- seperated by =
+    if (arg.match(/^--.+=/)) {
+      // Using [\s\S] instead of . because js doesn't support the
+      // 'dotall' regex modifier. See:
+      // http://stackoverflow.com/a/1068308/13216
+      m = arg.match(/^--([^=]+)=([\s\S]*)$/)
+
+      // nargs format = '--f=monkey washing cat'
+      if (checkAllAliases(m[1], opts.narg)) {
+        args.splice(i + 1, m[1], m[2])
+        i = eatNargs(i, m[1], args)
+      // arrays format = '--f=a b c'
+      } else if (checkAllAliases(m[1], flags.arrays) && args.length > i + 1) {
+        args.splice(i + 1, m[1], m[2])
+        i = eatArray(i, m[1], args)
+      } else {
+        setArg(m[1], m[2])
+      }
+    } else if (arg.match(/^--no-.+/)) {
+      key = arg.match(/^--no-(.+)/)[1]
+      setArg(key, false)
+
+    // -- seperated by space.
+    } else if (arg.match(/^--.+/)) {
+      key = arg.match(/^--(.+)/)[1]
+
+      // nargs format = '--foo a b c'
+      if (checkAllAliases(key, opts.narg)) {
+        i = eatNargs(i, key, args)
+      // array format = '--foo a b c'
+      } else if (checkAllAliases(key, flags.arrays) && args.length > i + 1) {
+        i = eatArray(i, key, args)
+      } else {
+        next = args[i + 1]
+
+        if (next !== undefined && !next.match(/^-/) &&
+          !checkAllAliases(key, flags.bools) &&
+          !checkAllAliases(key, flags.counts)) {
+          setArg(key, next)
+          i++
+        } else if (/^(true|false)$/.test(next)) {
+          setArg(key, next)
+          i++
+        } else {
+          setArg(key, defaultForType(guessType(key, flags)))
+        }
+      }
+
+    // dot-notation flag seperated by '='.
+    } else if (arg.match(/^-.\..+=/)) {
+      m = arg.match(/^-([^=]+)=([\s\S]*)$/)
+      setArg(m[1], m[2])
+
+    // dot-notation flag seperated by space.
+    } else if (arg.match(/^-.\..+/)) {
+      next = args[i + 1]
+      key = arg.match(/^-(.\..+)/)[1]
+
+      if (next !== undefined && !next.match(/^-/) &&
+        !checkAllAliases(key, flags.bools) &&
+        !checkAllAliases(key, flags.counts)) {
+        setArg(key, next)
+        i++
+      } else {
+        setArg(key, defaultForType(guessType(key, flags)))
+      }
+    } else if (arg.match(/^-[^-]+/)) {
+      letters = arg.slice(1, -1).split('')
+      broken = false
+
+      for (var j = 0; j < letters.length; j++) {
+        next = arg.slice(j + 2)
+
+        if (letters[j + 1] && letters[j + 1] === '=') {
+          value = arg.slice(j + 3)
+          key = letters[j]
+
+          // nargs format = '-f=monkey washing cat'
+          if (checkAllAliases(letters[j], opts.narg)) {
+            args.splice(i + 1, 0, value)
+            i = eatNargs(i, key, args)
+          // array format = '-f=a b c'
+          } else if (checkAllAliases(key, flags.arrays) && args.length > i + 1) {
+            args.splice(i + 1, 0, value)
+            i = eatArray(i, key, args)
+          } else {
+            setArg(key, value)
+          }
+
+          broken = true
+          break
+        }
+
+        if (next === '-') {
+          setArg(letters[j], next)
+          continue
+        }
+
+        if (/[A-Za-z]/.test(letters[j]) &&
+          /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
+          setArg(letters[j], next)
+          broken = true
+          break
+        }
+
+        if (letters[j + 1] && letters[j + 1].match(/\W/)) {
+          setArg(letters[j], arg.slice(j + 2))
+          broken = true
+          break
+        } else {
+          setArg(letters[j], defaultForType(guessType(letters[j], flags)))
+        }
+      }
+
+      key = arg.slice(-1)[0]
+
+      if (!broken && key !== '-') {
+        // nargs format = '-f a b c'
+        if (checkAllAliases(key, opts.narg)) {
+          i = eatNargs(i, key, args)
+        // array format = '-f a b c'
+        } else if (checkAllAliases(key, flags.arrays) && args.length > i + 1) {
+          i = eatArray(i, key, args)
+        } else {
+          if (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) &&
+            !checkAllAliases(key, flags.bools) &&
+            !checkAllAliases(key, flags.counts)) {
+            setArg(key, args[i + 1])
+            i++
+          } else if (args[i + 1] && /true|false/.test(args[i + 1])) {
+            setArg(key, args[i + 1])
+            i++
+          } else {
+            setArg(key, defaultForType(guessType(key, flags)))
+          }
+        }
+      }
+    } else {
+      argv._.push(
+        flags.strings['_'] || !isNumber(arg) ? arg : Number(arg)
+      )
+    }
+  }
+
+  setConfig(argv)
+  applyDefaultsAndAliases(argv, aliases, defaults)
+
+  Object.keys(flags.counts).forEach(function (key) {
+    setArg(key, defaults[key])
+  })
+
+  notFlags.forEach(function (key) {
+    argv._.push(key)
+  })
+
+  // how many arguments should we consume, based
+  // on the nargs option?
+  function eatNargs (i, key, args) {
+    var toEat = checkAllAliases(key, opts.narg)
+
+    if (args.length - (i + 1) < toEat) error = Error(__('Not enough arguments following: %s', key))
+
+    for (var ii = i + 1; ii < (toEat + i + 1); ii++) {
+      setArg(key, args[ii])
+    }
+
+    return (i + toEat)
+  }
+
+  // if an option is an array, eat all non-hyphenated arguments
+  // following it... YUM!
+  // e.g., --foo apple banana cat becomes ["apple", "banana", "cat"]
+  function eatArray (i, key, args) {
+    for (var ii = i + 1; ii < args.length; ii++) {
+      if (/^-/.test(args[ii])) break
+      i = ii
+      setArg(key, args[ii])
+    }
+
+    return i
+  }
+
+  function setArg (key, val) {
+    unsetDefaulted(key)
+
+    // handle parsing boolean arguments --foo=true --bar false.
+    if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) {
+      if (typeof val === 'string') val = val === 'true'
+    }
+
+    if (/-/.test(key) && !(aliases[key] && aliases[key].length)) {
+      var c = camelCase(key)
+      aliases[key] = [c]
+      newAliases[c] = true
+    }
+
+    var value = !checkAllAliases(key, flags.strings) && isNumber(val) ? Number(val) : val
+
+    if (checkAllAliases(key, flags.counts)) {
+      value = increment
+    }
+
+    var splitKey = key.split('.')
+    setKey(argv, splitKey, value)
+
+    ;(aliases[splitKey[0]] || []).forEach(function (x) {
+      x = x.split('.')
+
+      // handle populating dot notation for both
+      // the key and its aliases.
+      if (splitKey.length > 1) {
+        var a = [].concat(splitKey)
+        a.shift() // nuke the old key.
+        x = x.concat(a)
+      }
+
+      setKey(argv, x, value)
+    })
+
+    var keys = [key].concat(aliases[key] || [])
+    for (var i = 0, l = keys.length; i < l; i++) {
+      if (flags.normalize[keys[i]]) {
+        keys.forEach(function (key) {
+          argv.__defineSetter__(key, function (v) {
+            val = path.normalize(v)
+          })
+
+          argv.__defineGetter__(key, function () {
+            return typeof val === 'string' ?
+            path.normalize(val) : val
+          })
+        })
+        break
+      }
+    }
+  }
+
+  // set args from config.json file, this should be
+  // applied last so that defaults can be applied.
+  function setConfig (argv) {
+    var configLookup = {}
+
+    // expand defaults/aliases, in-case any happen to reference
+    // the config.json file.
+    applyDefaultsAndAliases(configLookup, aliases, defaults)
+
+    Object.keys(flags.configs).forEach(function (configKey) {
+      var configPath = argv[configKey] || configLookup[configKey]
+      if (configPath) {
+        try {
+          var config = require(path.resolve(process.cwd(), configPath))
+
+          Object.keys(config).forEach(function (key) {
+            // setting arguments via CLI takes precedence over
+            // values within the config file.
+            if (argv[key] === undefined || (flags.defaulted[key])) {
+              delete argv[key]
+              setArg(key, config[key])
+            }
+          })
+        } catch (ex) {
+          if (argv[configKey]) error = Error(__('Invalid JSON config file: %s', configPath))
+        }
+      }
+    })
+  }
+
+  function applyDefaultsAndAliases (obj, aliases, defaults) {
+    Object.keys(defaults).forEach(function (key) {
+      if (!hasKey(obj, key.split('.'))) {
+        setKey(obj, key.split('.'), defaults[key])
+
+        ;(aliases[key] || []).forEach(function (x) {
+          setKey(obj, x.split('.'), defaults[key])
+        })
+      }
+    })
+  }
+
+  function hasKey (obj, keys) {
+    var o = obj
+    keys.slice(0, -1).forEach(function (key) {
+      o = (o[key] || {})
+    })
+
+    var key = keys[keys.length - 1]
+    return key in o
+  }
+
+  function setKey (obj, keys, value) {
+    var o = obj
+    keys.slice(0, -1).forEach(function (key) {
+      if (o[key] === undefined) o[key] = {}
+      o = o[key]
+    })
+
+    var key = keys[keys.length - 1]
+    if (value === increment) {
+      o[key] = increment(o[key])
+    } else if (o[key] === undefined && checkAllAliases(key, flags.arrays)) {
+      o[key] = Array.isArray(value) ? value : [value]
+    } else if (o[key] === undefined || typeof o[key] === 'boolean') {
+      o[key] = value
+    } else if (Array.isArray(o[key])) {
+      o[key].push(value)
+    } else {
+      o[key] = [ o[key], value ]
+    }
+  }
+
+  // extend the aliases list with inferred aliases.
+  function extendAliases (obj) {
+    Object.keys(obj || {}).forEach(function (key) {
+      aliases[key] = [].concat(opts.alias[key] || [])
+      // For "--option-name", also set argv.optionName
+      aliases[key].concat(key).forEach(function (x) {
+        if (/-/.test(x)) {
+          var c = camelCase(x)
+          aliases[key].push(c)
+          newAliases[c] = true
+        }
+      })
+      aliases[key].forEach(function (x) {
+        aliases[x] = [key].concat(aliases[key].filter(function (y) {
+          return x !== y
+        }))
+      })
+    })
+  }
+
+  // check if a flag is set for any of a key's aliases.
+  function checkAllAliases (key, flag) {
+    var isSet = false
+    var toCheck = [].concat(aliases[key] || [], key)
+
+    toCheck.forEach(function (key) {
+      if (flag[key]) isSet = flag[key]
+    })
+
+    return isSet
+  }
+
+  function setDefaulted (key) {
+    [].concat(aliases[key] || [], key).forEach(function (k) {
+      flags.defaulted[k] = true
+    })
+  }
+
+  function unsetDefaulted (key) {
+    [].concat(aliases[key] || [], key).forEach(function (k) {
+      delete flags.defaulted[k]
+    })
+  }
+
+  // return a default value, given the type of a flag.,
+  // e.g., key of type 'string' will default to '', rather than 'true'.
+  function defaultForType (type) {
+    var def = {
+      boolean: true,
+      string: '',
+      array: []
+    }
+
+    return def[type]
+  }
+
+  // given a flag, enforce a default type.
+  function guessType (key, flags) {
+    var type = 'boolean'
+
+    if (flags.strings && flags.strings[key]) type = 'string'
+    else if (flags.arrays && flags.arrays[key]) type = 'array'
+
+    return type
+  }
+
+  function isNumber (x) {
+    if (typeof x === 'number') return true
+    if (/^0x[0-9a-f]+$/i.test(x)) return true
+    return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x)
+  }
+
+  return {
+    argv: argv,
+    aliases: aliases,
+    error: error,
+    newAliases: newAliases
+  }
+}
diff --git a/wrt/node_modules/yargs/lib/usage.js b/wrt/node_modules/yargs/lib/usage.js
new file mode 100644 (file)
index 0000000..e0af2be
--- /dev/null
@@ -0,0 +1,339 @@
+// this file handles outputting usage instructions,
+// failures, etc. keeps logging in one place.
+var cliui = require('cliui')
+var decamelize = require('decamelize')
+var wsize = require('window-size')
+
+module.exports = function (yargs, y18n) {
+  var __ = y18n.__
+  var self = {}
+
+  // methods for ouputting/building failure message.
+  var fails = []
+  self.failFn = function (f) {
+    fails.push(f)
+  }
+
+  var failMessage = null
+  var showHelpOnFail = true
+  self.showHelpOnFail = function (enabled, message) {
+    if (typeof enabled === 'string') {
+      message = enabled
+      enabled = true
+    } else if (typeof enabled === 'undefined') {
+      enabled = true
+    }
+    failMessage = message
+    showHelpOnFail = enabled
+    return self
+  }
+
+  self.fail = function (msg) {
+    if (fails.length) {
+      fails.forEach(function (f) {
+        f(msg)
+      })
+    } else {
+      if (showHelpOnFail) yargs.showHelp('error')
+      if (msg) console.error(msg)
+      if (failMessage) {
+        if (msg) console.error('')
+        console.error(failMessage)
+      }
+      if (yargs.getExitProcess()) {
+        process.exit(1)
+      } else {
+        throw new Error(msg)
+      }
+    }
+  }
+
+  // methods for ouputting/building help (usage) message.
+  var usage
+  self.usage = function (msg) {
+    usage = msg
+  }
+
+  var examples = []
+  self.example = function (cmd, description) {
+    examples.push([cmd, description || ''])
+  }
+
+  var commands = []
+  self.command = function (cmd, description) {
+    commands.push([cmd, description || ''])
+  }
+  self.getCommands = function () {
+    return commands
+  }
+
+  var descriptions = {}
+  self.describe = function (key, desc) {
+    if (typeof key === 'object') {
+      Object.keys(key).forEach(function (k) {
+        self.describe(k, key[k])
+      })
+    } else {
+      descriptions[key] = desc
+    }
+  }
+  self.getDescriptions = function () {
+    return descriptions
+  }
+
+  var epilog
+  self.epilog = function (msg) {
+    epilog = msg
+  }
+
+  var wrap = windowWidth()
+  self.wrap = function (cols) {
+    wrap = cols
+  }
+
+  var deferY18nLookupPrefix = '__yargsString__:'
+  self.deferY18nLookup = function (str) {
+    return deferY18nLookupPrefix + str
+  }
+
+  self.help = function () {
+    normalizeAliases()
+
+    var demanded = yargs.getDemanded()
+    var options = yargs.getOptions()
+    var keys = Object.keys(
+      Object.keys(descriptions)
+      .concat(Object.keys(demanded))
+      .concat(Object.keys(options.default))
+      .reduce(function (acc, key) {
+        if (key !== '_') acc[key] = true
+        return acc
+      }, {})
+    )
+    var ui = cliui({
+      width: wrap,
+      wrap: !!wrap
+    })
+
+    // the usage string.
+    if (usage) {
+      var u = usage.replace(/\$0/g, yargs.$0)
+      ui.div(u + '\n')
+    }
+
+    // your application's commands, i.e., non-option
+    // arguments populated in '_'.
+    if (commands.length) {
+      ui.div(__('Commands:'))
+
+      commands.forEach(function (command) {
+        ui.div(
+          {text: command[0], padding: [0, 2, 0, 2], width: maxWidth(commands) + 4},
+          {text: command[1]}
+        )
+      })
+
+      ui.div()
+    }
+
+    // the options table.
+    var aliasKeys = (Object.keys(options.alias) || [])
+      .concat(Object.keys(yargs.parsed.newAliases) || [])
+
+    keys = keys.filter(function (key) {
+      return !yargs.parsed.newAliases[key] && aliasKeys.every(function (alias) {
+        return (options.alias[alias] || []).indexOf(key) === -1
+      })
+    })
+
+    var switches = keys.reduce(function (acc, key) {
+      acc[key] = [ key ].concat(options.alias[key] || [])
+      .map(function (sw) {
+        return (sw.length > 1 ? '--' : '-') + sw
+      })
+      .join(', ')
+
+      return acc
+    }, {})
+
+    if (keys.length) {
+      ui.div(__('Options:'))
+
+      keys.forEach(function (key) {
+        var kswitch = switches[key]
+        var desc = descriptions[key] || ''
+        var type = null
+
+        if (~desc.lastIndexOf(deferY18nLookupPrefix)) desc = __(desc.substring(deferY18nLookupPrefix.length))
+
+        if (~options.boolean.indexOf(key)) type = '[' + __('boolean') + ']'
+        if (~options.count.indexOf(key)) type = '[' + __('count') + ']'
+        if (~options.string.indexOf(key)) type = '[' + __('string') + ']'
+        if (~options.normalize.indexOf(key)) type = '[' + __('string') + ']'
+        if (~options.array.indexOf(key)) type = '[' + __('array') + ']'
+
+        var extra = [
+            type,
+            demanded[key] ? '[' + __('required') + ']' : null,
+            options.choices && options.choices[key] ? '[' + __('choices:') + ' ' +
+              self.stringifiedValues(options.choices[key]) + ']' : null,
+            defaultString(options.default[key], options.defaultDescription[key])
+          ].filter(Boolean).join(' ')
+
+        ui.span(
+          {text: kswitch, padding: [0, 2, 0, 2], width: maxWidth(switches) + 4},
+          desc
+        )
+
+        if (extra) ui.div({text: extra, padding: [0, 0, 0, 2], align: 'right'})
+        else ui.div()
+      })
+
+      ui.div()
+    }
+
+    // describe some common use-cases for your application.
+    if (examples.length) {
+      ui.div(__('Examples:'))
+
+      examples.forEach(function (example) {
+        example[0] = example[0].replace(/\$0/g, yargs.$0)
+      })
+
+      examples.forEach(function (example) {
+        ui.div(
+          {text: example[0], padding: [0, 2, 0, 2], width: maxWidth(examples) + 4},
+          example[1]
+        )
+      })
+
+      ui.div()
+    }
+
+    // the usage string.
+    if (epilog) {
+      var e = epilog.replace(/\$0/g, yargs.$0)
+      ui.div(e + '\n')
+    }
+
+    return ui.toString()
+  }
+
+  // return the maximum width of a string
+  // in the left-hand column of a table.
+  function maxWidth (table) {
+    var width = 0
+
+    // table might be of the form [leftColumn],
+    // or {key: leftColumn}}
+    if (!Array.isArray(table)) {
+      table = Object.keys(table).map(function (key) {
+        return [table[key]]
+      })
+    }
+
+    table.forEach(function (v) {
+      width = Math.max(v[0].length, width)
+    })
+
+    // if we've enabled 'wrap' we should limit
+    // the max-width of the left-column.
+    if (wrap) width = Math.min(width, parseInt(wrap * 0.5, 10))
+
+    return width
+  }
+
+  // make sure any options set for aliases,
+  // are copied to the keys being aliased.
+  function normalizeAliases () {
+    var demanded = yargs.getDemanded()
+    var options = yargs.getOptions()
+
+    ;(Object.keys(options.alias) || []).forEach(function (key) {
+      options.alias[key].forEach(function (alias) {
+        // copy descriptions.
+        if (descriptions[alias]) self.describe(key, descriptions[alias])
+        // copy demanded.
+        if (demanded[alias]) yargs.demand(key, demanded[alias].msg)
+
+        // type messages.
+        if (~options.boolean.indexOf(alias)) yargs.boolean(key)
+        if (~options.count.indexOf(alias)) yargs.count(key)
+        if (~options.string.indexOf(alias)) yargs.string(key)
+        if (~options.normalize.indexOf(alias)) yargs.normalize(key)
+        if (~options.array.indexOf(alias)) yargs.array(key)
+      })
+    })
+  }
+
+  self.showHelp = function (level) {
+    level = level || 'error'
+    console[level](self.help())
+  }
+
+  self.functionDescription = function (fn, defaultDescription) {
+    if (defaultDescription) {
+      return defaultDescription
+    }
+    var description = fn.name ? decamelize(fn.name, '-') : __('generated-value')
+    return ['(', description, ')'].join('')
+  }
+
+  self.stringifiedValues = function (values, separator) {
+    var string = ''
+    var sep = separator || ', '
+    var array = [].concat(values)
+
+    if (!values || !array.length) return string
+
+    array.forEach(function (value) {
+      if (string.length) string += sep
+      string += JSON.stringify(value)
+    })
+
+    return string
+  }
+
+  // format the default-value-string displayed in
+  // the right-hand column.
+  function defaultString (value, defaultDescription) {
+    var string = '[' + __('default:') + ' '
+
+    if (value === undefined) return null
+
+    if (defaultDescription) {
+      string += defaultDescription
+    } else {
+      switch (typeof value) {
+        case 'string':
+          string += JSON.stringify(value)
+          break
+        case 'object':
+          string += JSON.stringify(value)
+          break
+        default:
+          string += value
+      }
+    }
+
+    return string + ']'
+  }
+
+  // guess the width of the console window, max-width 80.
+  function windowWidth () {
+    return wsize.width ? Math.min(80, wsize.width) : null
+  }
+
+  // logic for displaying application version.
+  var version = null
+  self.version = function (ver, opt, msg) {
+    version = ver
+  }
+
+  self.showVersion = function () {
+    if (typeof version === 'function') console.log(version())
+    else console.log(version)
+  }
+
+  return self
+}
diff --git a/wrt/node_modules/yargs/lib/validation.js b/wrt/node_modules/yargs/lib/validation.js
new file mode 100644 (file)
index 0000000..514bbff
--- /dev/null
@@ -0,0 +1,249 @@
+// validation-type-stuff, missing params,
+// bad implications, custom checks.
+module.exports = function (yargs, usage, y18n) {
+  var __ = y18n.__
+  var __n = y18n.__n
+  var self = {}
+
+  // validate appropriate # of non-option
+  // arguments were provided, i.e., '_'.
+  self.nonOptionCount = function (argv) {
+    var demanded = yargs.getDemanded()
+    var _s = argv._.length
+
+    if (demanded._ && (_s < demanded._.count || _s > demanded._.max)) {
+      if (demanded._.msg !== undefined) {
+        usage.fail(demanded._.msg)
+      } else if (_s < demanded._.count) {
+        usage.fail(
+          __('Not enough non-option arguments: got %s, need at least %s', argv._.length, demanded._.count)
+        )
+      } else {
+        usage.fail(
+          __('Too many non-option arguments: got %s, maximum of %s', argv._.length, demanded._.max)
+        )
+      }
+    }
+  }
+
+  // make sure that any args that require an
+  // value (--foo=bar), have a value.
+  self.missingArgumentValue = function (argv) {
+    var defaultValues = [true, false, '']
+    var options = yargs.getOptions()
+
+    if (options.requiresArg.length > 0) {
+      var missingRequiredArgs = []
+
+      options.requiresArg.forEach(function (key) {
+        var value = argv[key]
+
+        // if a value is explicitly requested,
+        // flag argument as missing if it does not
+        // look like foo=bar was entered.
+        if (~defaultValues.indexOf(value) ||
+          (Array.isArray(value) && !value.length)) {
+          missingRequiredArgs.push(key)
+        }
+      })
+
+      if (missingRequiredArgs.length > 0) {
+        usage.fail(__n(
+          'Missing argument value: %s',
+          'Missing argument values: %s',
+          missingRequiredArgs.length,
+          missingRequiredArgs.join(', ')
+        ))
+      }
+    }
+  }
+
+  // make sure all the required arguments are present.
+  self.requiredArguments = function (argv) {
+    var demanded = yargs.getDemanded()
+    var missing = null
+
+    Object.keys(demanded).forEach(function (key) {
+      if (!argv.hasOwnProperty(key)) {
+        missing = missing || {}
+        missing[key] = demanded[key]
+      }
+    })
+
+    if (missing) {
+      var customMsgs = []
+      Object.keys(missing).forEach(function (key) {
+        var msg = missing[key].msg
+        if (msg && customMsgs.indexOf(msg) < 0) {
+          customMsgs.push(msg)
+        }
+      })
+
+      var customMsg = customMsgs.length ? '\n' + customMsgs.join('\n') : ''
+
+      usage.fail(__n(
+        'Missing required argument: %s',
+        'Missing required arguments: %s',
+        Object.keys(missing).length,
+        Object.keys(missing).join(', ') + customMsg
+      ))
+    }
+  }
+
+  // check for unknown arguments (strict-mode).
+  self.unknownArguments = function (argv, aliases) {
+    var aliasLookup = {}
+    var descriptions = usage.getDescriptions()
+    var demanded = yargs.getDemanded()
+    var unknown = []
+
+    Object.keys(aliases).forEach(function (key) {
+      aliases[key].forEach(function (alias) {
+        aliasLookup[alias] = key
+      })
+    })
+
+    Object.keys(argv).forEach(function (key) {
+      if (key !== '$0' && key !== '_' &&
+        !descriptions.hasOwnProperty(key) &&
+        !demanded.hasOwnProperty(key) &&
+        !aliasLookup.hasOwnProperty(key)) {
+        unknown.push(key)
+      }
+    })
+
+    if (unknown.length > 0) {
+      usage.fail(__n(
+        'Unknown argument: %s',
+        'Unknown arguments: %s',
+        unknown.length,
+        unknown.join(', ')
+      ))
+    }
+  }
+
+  // validate arguments limited to enumerated choices
+  self.limitedChoices = function (argv) {
+    var options = yargs.getOptions()
+    var invalid = {}
+
+    if (!Object.keys(options.choices).length) return
+
+    Object.keys(argv).forEach(function (key) {
+      if (key !== '$0' && key !== '_' &&
+        options.choices.hasOwnProperty(key)) {
+        [].concat(argv[key]).forEach(function (value) {
+          // TODO case-insensitive configurability
+          if (options.choices[key].indexOf(value) === -1) {
+            invalid[key] = (invalid[key] || []).concat(value)
+          }
+        })
+      }
+    })
+
+    var invalidKeys = Object.keys(invalid)
+
+    if (!invalidKeys.length) return
+
+    var msg = __('Invalid values:')
+    invalidKeys.forEach(function (key) {
+      msg += '\n  ' + __(
+        'Argument: %s, Given: %s, Choices: %s',
+        key,
+        usage.stringifiedValues(invalid[key]),
+        usage.stringifiedValues(options.choices[key])
+      )
+    })
+    usage.fail(msg)
+  }
+
+  // custom checks, added using the `check` option on yargs.
+  var checks = []
+  self.check = function (f) {
+    checks.push(f)
+  }
+
+  self.customChecks = function (argv, aliases) {
+    checks.forEach(function (f) {
+      try {
+        var result = f(argv, aliases)
+        if (!result) {
+          usage.fail(__('Argument check failed: %s', f.toString()))
+        } else if (typeof result === 'string') {
+          usage.fail(result)
+        }
+      } catch (err) {
+        usage.fail(err.message ? err.message : err)
+      }
+    })
+  }
+
+  // check implications, argument foo implies => argument bar.
+  var implied = {}
+  self.implies = function (key, value) {
+    if (typeof key === 'object') {
+      Object.keys(key).forEach(function (k) {
+        self.implies(k, key[k])
+      })
+    } else {
+      implied[key] = value
+    }
+  }
+  self.getImplied = function () {
+    return implied
+  }
+
+  self.implications = function (argv) {
+    var implyFail = []
+
+    Object.keys(implied).forEach(function (key) {
+      var num
+      var origKey = key
+      var value = implied[key]
+
+      // convert string '1' to number 1
+      num = Number(key)
+      key = isNaN(num) ? key : num
+
+      if (typeof key === 'number') {
+        // check length of argv._
+        key = argv._.length >= key
+      } else if (key.match(/^--no-.+/)) {
+        // check if key doesn't exist
+        key = key.match(/^--no-(.+)/)[1]
+        key = !argv[key]
+      } else {
+        // check if key exists
+        key = argv[key]
+      }
+
+      num = Number(value)
+      value = isNaN(num) ? value : num
+
+      if (typeof value === 'number') {
+        value = argv._.length >= value
+      } else if (value.match(/^--no-.+/)) {
+        value = value.match(/^--no-(.+)/)[1]
+        value = !argv[value]
+      } else {
+        value = argv[value]
+      }
+
+      if (key && !value) {
+        implyFail.push(origKey)
+      }
+    })
+
+    if (implyFail.length) {
+      var msg = __('Implications failed:') + '\n'
+
+      implyFail.forEach(function (key) {
+        msg += ('  ' + key + ' -> ' + implied[key])
+      })
+
+      usage.fail(msg)
+    }
+  }
+
+  return self
+}
diff --git a/wrt/node_modules/yargs/locales/en.json b/wrt/node_modules/yargs/locales/en.json
new file mode 100644 (file)
index 0000000..ce19199
--- /dev/null
@@ -0,0 +1,36 @@
+{
+  "Commands:": "Commands:",
+  "Options:": "Options:",
+  "Examples:": "Examples:",
+  "boolean": "boolean",
+  "count": "count",
+  "string": "string",
+  "array": "array",
+  "required": "required",
+  "default:": "default:",
+  "choices:": "choices:",
+  "generated-value": "generated-value",
+  "Not enough non-option arguments: got %s, need at least %s": "Not enough non-option arguments: got %s, need at least %s",
+  "Too many non-option arguments: got %s, maximum of %s": "Too many non-option arguments: got %s, maximum of %s",
+  "Missing argument value: %s": {
+    "one": "Missing argument value: %s",
+    "other": "Missing argument values: %s"
+  },
+  "Missing required argument: %s": {
+    "one": "Missing required argument: %s",
+    "other": "Missing required arguments: %s"
+  },
+  "Unknown argument: %s": {
+    "one": "Unknown argument: %s",
+    "other": "Unknown arguments: %s"
+  },
+  "Invalid values:": "Invalid values:",
+  "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Given: %s, Choices: %s",
+  "Argument check failed: %s": "Argument check failed: %s",
+  "Implications failed:": "Implications failed:",
+  "Not enough arguments following: %s": "Not enough arguments following: %s",
+  "Invalid JSON config file: %s": "Invalid JSON config file: %s",
+  "Path to JSON config file": "Path to JSON config file",
+  "Show help": "Show help",
+  "Show version number": "Show version number"
+}
diff --git a/wrt/node_modules/yargs/locales/es.json b/wrt/node_modules/yargs/locales/es.json
new file mode 100644 (file)
index 0000000..c4f1917
--- /dev/null
@@ -0,0 +1,36 @@
+{
+  "Commands:": "Comandos:",
+  "Options:": "Opciones:",
+  "Examples:": "Ejemplos:",
+  "boolean": "boolean",
+  "count": "cuenta",
+  "string": "cadena de caracteres",
+  "array": "tabla",
+  "required": "requisito",
+  "default:": "defecto:",
+  "choices:": "selección:",
+  "generated-value": "valor-generado",
+  "Not enough non-option arguments: got %s, need at least %s": "Hacen falta argumentos no-opcionales: Número recibido %s, necesita por lo menos %s",
+  "Too many non-option arguments: got %s, maximum of %s": "Demasiados argumentos no-opcionales: Número recibido %s, máximo es %s",
+  "Missing argument value: %s": {
+    "one": "Falta argumento: %s",
+    "other": "Faltan argumentos: %s"
+  },
+  "Missing required argument: %s": {
+    "one": "Falta argumento requerido: %s",
+    "other": "Faltan argumentos requeridos: %s"
+  },
+  "Unknown argument: %s": {
+    "one": "Argumento desconocido: %s",
+    "other": "Argumentos desconocidos: %s"
+  },
+  "Invalid values:": "Valores inválidos:",
+  "Argument: %s, Given: %s, Choices: %s": "Argumento: %s, Recibido: %s, Selección: %s",
+  "Argument check failed: %s": "Verificación de argumento ha fracasado: %s",
+  "Implications failed:": "Implicaciones fracasadas:",
+  "Not enough arguments following: %s": "No hay suficientes argumentos después de: %s",
+  "Invalid JSON config file: %s": "Archivo de configuración JSON inválido: %s",
+  "Path to JSON config file": "Ruta al archivo de configuración JSON",
+  "Show help": "Muestra ayuda",
+  "Show version number": "Muestra número de versión"
+}
diff --git a/wrt/node_modules/yargs/locales/fr.json b/wrt/node_modules/yargs/locales/fr.json
new file mode 100644 (file)
index 0000000..49d068b
--- /dev/null
@@ -0,0 +1,36 @@
+{
+  "Commands:": "Commandes:",
+  "Options:": "Options:",
+  "Examples:": "Exemples:",
+  "boolean": "booléen",
+  "count": "comptage",
+  "string": "chaine de caractère",
+  "array": "tableau",
+  "required": "requis",
+  "default:": "défaut:",
+  "choices:": "choix:",
+  "generated-value": "valeur générée",
+  "Not enough non-option arguments: got %s, need at least %s": "Pas assez d'arguments non-option: reçu %s, besoin d'au moins %s",
+  "Too many non-option arguments: got %s, maximum of %s": "Trop d'arguments non-option: reçu %s, maximum %s",
+  "Missing argument value: %s": {
+    "one": "Argument manquant: %s",
+    "other": "Arguments manquants: %s"
+  },
+  "Missing required argument: %s": {
+    "one": "Argument requis manquant: %s",
+    "other": "Arguments requis manquants: %s"
+  },
+  "Unknown argument: %s": {
+    "one": "Argument inconnu: %s",
+    "other": "Arguments inconnus: %s"
+  },
+  "Invalid values:": "Valeurs invalides:",
+  "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Donné: %s, Choix: %s",
+  "Argument check failed: %s": "Echec de la vérification de l'argument: %s",
+  "Implications failed:": "Implications échouées:",
+  "Not enough arguments following: %s": "Pas assez d'arguments suivant: %s",
+  "Invalid JSON config file: %s": "Fichier de configuration JSON invalide: %s",
+  "Path to JSON config file": "Chemin du fichier de configuration JSON",
+  "Show help": "Affiche de l'aide",
+  "Show version number": "Affiche le numéro de version"
+}
diff --git a/wrt/node_modules/yargs/locales/pirate.json b/wrt/node_modules/yargs/locales/pirate.json
new file mode 100644 (file)
index 0000000..1f4e19e
--- /dev/null
@@ -0,0 +1,12 @@
+{
+  "Commands:": "Choose yer command:",
+  "Options:": "Options for me hearties!",
+  "Examples:": "Ex. marks the spot:",
+  "required": "requi-yar-ed",
+  "Missing required argument: %s": {
+    "one": "Ye be havin' to set the followin' argument land lubber: %s",
+    "other": "Ye be havin' to set the followin' arguments land lubber: %s"
+  },
+  "Show help": "Parlay this here code of conduct",
+  "Show version number": "'Tis the version ye be askin' fer"
+}
diff --git a/wrt/node_modules/yargs/locales/pt.json b/wrt/node_modules/yargs/locales/pt.json
new file mode 100644 (file)
index 0000000..6abbcd4
--- /dev/null
@@ -0,0 +1,36 @@
+{
+  "Commands:": "Comandos:",
+  "Options:": "Opções:",
+  "Examples:": "Exemplos:",
+  "boolean": "boolean",
+  "count": "contagem",
+  "string": "cadeia de caracteres",
+  "array": "arranjo",
+  "required": "requerido",
+  "default:": "padrão:",
+  "choices:": "escolhas:",
+  "generated-value": "valor-gerado",
+  "Not enough non-option arguments: got %s, need at least %s": "Argumentos insuficientes não opcionais: Argumento %s, necessário pelo menos %s",
+  "Too many non-option arguments: got %s, maximum of %s": "Excesso de argumentos não opcionais: recebido %s, máximo de %s",
+  "Missing argument value: %s": {
+    "one": "Falta valor de argumento: %s",
+    "other": "Falta valores de argumento: %s"
+  },
+  "Missing required argument: %s": {
+    "one": "Falta argumento obrigatório: %s",
+    "other": "Faltando argumentos obrigatórios: %s"
+  },
+  "Unknown argument: %s": {
+    "one": "Argumento desconhecido: %s",
+    "other": "Argumentos desconhecidos: %s"
+  },
+  "Invalid values:": "Valores inválidos:",
+  "Argument: %s, Given: %s, Choices: %s": "Argumento: %s, Dado: %s, Escolhas: %s",
+  "Argument check failed: %s": "Verificação de argumento falhou: %s",
+  "Implications failed:": "Implicações falharam:",
+  "Not enough arguments following: %s": "Insuficientes argumentos a seguir: %s",
+  "Invalid JSON config file: %s": "Arquivo de configuração em JSON esta inválido: %s",
+  "Path to JSON config file": "Caminho para o arquivo de configuração em JSON",
+  "Show help": "Mostra ajuda",
+  "Show version number": "Mostra número de versão"
+}
diff --git a/wrt/node_modules/yargs/node_modules/camelcase/index.js b/wrt/node_modules/yargs/node_modules/camelcase/index.js
new file mode 100644 (file)
index 0000000..b46e100
--- /dev/null
@@ -0,0 +1,27 @@
+'use strict';
+module.exports = function () {
+       var str = [].map.call(arguments, function (str) {
+               return str.trim();
+       }).filter(function (str) {
+               return str.length;
+       }).join('-');
+
+       if (!str.length) {
+               return '';
+       }
+
+       if (str.length === 1 || !(/[_.\- ]+/).test(str) ) {
+               if (str[0] === str[0].toLowerCase() && str.slice(1) !== str.slice(1).toLowerCase()) {
+                       return str;
+               }
+
+               return str.toLowerCase();
+       }
+
+       return str
+       .replace(/^[_.\- ]+/, '')
+       .toLowerCase()
+       .replace(/[_.\- ]+(\w|$)/g, function (m, p1) {
+               return p1.toUpperCase();
+       });
+};
diff --git a/wrt/node_modules/yargs/node_modules/camelcase/license b/wrt/node_modules/yargs/node_modules/camelcase/license
new file mode 100644 (file)
index 0000000..654d0bf
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/wrt/node_modules/yargs/node_modules/camelcase/package.json b/wrt/node_modules/yargs/node_modules/camelcase/package.json
new file mode 100644 (file)
index 0000000..29e3bfe
--- /dev/null
@@ -0,0 +1,70 @@
+{
+  "_from": "camelcase@^1.0.2",
+  "_id": "camelcase@1.2.1",
+  "_inBundle": false,
+  "_integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=",
+  "_location": "/yargs/camelcase",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "camelcase@^1.0.2",
+    "name": "camelcase",
+    "escapedName": "camelcase",
+    "rawSpec": "^1.0.2",
+    "saveSpec": null,
+    "fetchSpec": "^1.0.2"
+  },
+  "_requiredBy": [
+    "/yargs"
+  ],
+  "_resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz",
+  "_shasum": "9bb5304d2e0b56698b2c758b08a3eaa9daa58a39",
+  "_spec": "camelcase@^1.0.2",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was/node_modules/yargs",
+  "author": {
+    "name": "Sindre Sorhus",
+    "email": "sindresorhus@gmail.com",
+    "url": "http://sindresorhus.com"
+  },
+  "bugs": {
+    "url": "https://github.com/sindresorhus/camelcase/issues"
+  },
+  "bundleDependencies": false,
+  "deprecated": false,
+  "description": "Convert a dash/dot/underscore/space separated string to camelCase: foo-bar → fooBar",
+  "devDependencies": {
+    "ava": "0.0.4"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/sindresorhus/camelcase#readme",
+  "keywords": [
+    "camelcase",
+    "camel-case",
+    "camel",
+    "case",
+    "dash",
+    "hyphen",
+    "dot",
+    "underscore",
+    "separator",
+    "string",
+    "text",
+    "convert"
+  ],
+  "license": "MIT",
+  "name": "camelcase",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/sindresorhus/camelcase.git"
+  },
+  "scripts": {
+    "test": "node test.js"
+  },
+  "version": "1.2.1"
+}
diff --git a/wrt/node_modules/yargs/node_modules/camelcase/readme.md b/wrt/node_modules/yargs/node_modules/camelcase/readme.md
new file mode 100644 (file)
index 0000000..516dc39
--- /dev/null
@@ -0,0 +1,56 @@
+# camelcase [![Build Status](https://travis-ci.org/sindresorhus/camelcase.svg?branch=master)](https://travis-ci.org/sindresorhus/camelcase)
+
+> Convert a dash/dot/underscore/space separated string to camelCase: `foo-bar` → `fooBar`
+
+
+## Install
+
+```sh
+$ npm install --save camelcase
+```
+
+
+## Usage
+
+```js
+var camelCase = require('camelcase');
+
+camelCase('foo-bar');
+//=> fooBar
+
+camelCase('foo_bar');
+//=> fooBar
+
+camelCase('Foo-Bar');
+//=> fooBar
+
+camelCase('--foo.bar');
+//=> fooBar
+
+camelCase('__foo__bar__');
+//=> fooBar
+
+camelCase('foo bar');
+//=> fooBar
+
+console.log(process.argv[3]);
+//=> --foo-bar
+camelCase(process.argv[3]);
+//=> fooBar
+
+camelCase('foo', 'bar');
+//=> fooBar
+
+camelCase('__foo__', '--bar');
+//=> fooBar
+```
+
+
+## Related
+
+See [`decamelize`](https://github.com/sindresorhus/decamelize) for the inverse.
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/wrt/node_modules/yargs/node_modules/cliui/.coveralls.yml b/wrt/node_modules/yargs/node_modules/cliui/.coveralls.yml
new file mode 100644 (file)
index 0000000..73367db
--- /dev/null
@@ -0,0 +1 @@
+repo_token: NiRhyj91Z2vtgob6XdEAqs83rzNnbMZUu
diff --git a/wrt/node_modules/yargs/node_modules/cliui/.npmignore b/wrt/node_modules/yargs/node_modules/cliui/.npmignore
new file mode 100644 (file)
index 0000000..9daa824
--- /dev/null
@@ -0,0 +1,2 @@
+.DS_Store
+node_modules
diff --git a/wrt/node_modules/yargs/node_modules/cliui/.travis.yml b/wrt/node_modules/yargs/node_modules/cliui/.travis.yml
new file mode 100644 (file)
index 0000000..d96edf8
--- /dev/null
@@ -0,0 +1,7 @@
+language: node_js
+node_js:
+  - "0.10"
+  - "0.11"
+  - "0.12"
+  - "iojs"
+after_script: "NODE_ENV=test YOURPACKAGE_COVERAGE=1 ./node_modules/.bin/mocha --require patched-blanket --reporter mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js"
diff --git a/wrt/node_modules/yargs/node_modules/cliui/LICENSE.txt b/wrt/node_modules/yargs/node_modules/cliui/LICENSE.txt
new file mode 100644 (file)
index 0000000..c7e2747
--- /dev/null
@@ -0,0 +1,14 @@
+Copyright (c) 2015, Contributors
+
+Permission to use, copy, modify, and/or distribute this software
+for any purpose with or without fee is hereby granted, provided
+that the above copyright notice and this permission notice
+appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
+LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/wrt/node_modules/yargs/node_modules/cliui/README.md b/wrt/node_modules/yargs/node_modules/cliui/README.md
new file mode 100644 (file)
index 0000000..edcafa8
--- /dev/null
@@ -0,0 +1,104 @@
+# cliui
+
+[![Build Status](https://travis-ci.org/bcoe/cliui.png)](https://travis-ci.org/bcoe/cliui)
+[![Coverage Status](https://coveralls.io/repos/bcoe/cliui/badge.svg?branch=)](https://coveralls.io/r/bcoe/cliui?branch=)
+[![NPM version](https://img.shields.io/npm/v/cliui.svg)](https://www.npmjs.com/package/cliui)
+
+easily create complex multi-column command-line-interfaces.
+
+## Example
+
+```js
+var ui = require('cliui')({
+  width: 80
+})
+
+ui.div('Usage: $0 [command] [options]')
+
+ui.div({
+  text: 'Options:',
+  padding: [2, 0, 2, 0]
+})
+
+ui.div(
+  {
+    text: "-f, --file",
+    width: 40,
+    padding: [0, 4, 0, 4]
+  },
+  {
+    text: "the file to load",
+    width: 25
+  },
+  {
+    text: "[required]",
+    align: 'right'
+  }
+)
+
+console.log(ui.toString())
+```
+
+## Layout DSL
+
+cliui exposes a simple layout DSL:
+
+If you create a single `ui.row`, passing a string rather than an
+object:
+
+* `\n`: characters will be interpreted as new rows.
+* `\t`: characters will be interpreted as new columns.
+* ` `: characters will be interpreted as padding.
+
+**as an example...**
+
+```js
+var ui = require('./')({
+  width: 60
+})
+
+ui.div(
+  'Usage: node ./bin/foo.js\n' +
+  '  <regex>\t  provide a regex\n' +
+  '  <glob>\t  provide a glob\t [required]'
+)
+
+console.log(ui.toString())
+```
+
+**will output:**
+
+```shell
+Usage: node ./bin/foo.js
+  <regex>  provide a regex
+  <glob>   provide a glob          [required]
+```
+
+## Methods
+
+```js
+cliui = require('cliui')
+```
+
+### cliui({width: integer})
+
+Specify the maximum width of the UI being generated.
+
+### cliui({wrap: boolean})
+
+Enable or disable the wrapping of text in a column.
+
+### cliui.div(column, column, column)
+
+Create a row with any number of columns, a column
+can either be a string, or an object with the following
+options:
+
+* **width:** the width of a column.
+* **align:** alignment, `right` or `center`.
+* **padding:** `[top, right, bottom, left]`.
+
+### cliui.span(column, column, column)
+
+Similar to `div`, except the next row will be appended without
+a new line being created.
diff --git a/wrt/node_modules/yargs/node_modules/cliui/index.js b/wrt/node_modules/yargs/node_modules/cliui/index.js
new file mode 100644 (file)
index 0000000..31b4aa7
--- /dev/null
@@ -0,0 +1,273 @@
+var wrap = require('wordwrap'),
+  align = {
+    right: require('right-align'),
+    center: require('center-align')
+  },
+  top = 0,
+  right = 1,
+  bottom = 2,
+  left = 3
+
+function UI (opts) {
+  this.width = opts.width
+  this.wrap = opts.wrap
+  this.rows = []
+}
+
+UI.prototype.span = function () {
+  var cols = this.div.apply(this, arguments)
+  cols.span = true
+}
+
+UI.prototype.div = function () {
+  if (arguments.length === 0) this.div('')
+  if (this.wrap && this._shouldApplyLayoutDSL.apply(this, arguments)) {
+    return this._applyLayoutDSL(arguments[0])
+  }
+
+  var cols = []
+
+  for (var i = 0, arg; (arg = arguments[i]) !== undefined; i++) {
+    if (typeof arg === 'string') cols.push(this._colFromString(arg))
+    else cols.push(arg)
+  }
+
+  this.rows.push(cols)
+  return cols
+}
+
+UI.prototype._shouldApplyLayoutDSL = function () {
+  return arguments.length === 1 && typeof arguments[0] === 'string' &&
+    /[\t\n]/.test(arguments[0])
+}
+
+UI.prototype._applyLayoutDSL = function (str) {
+  var _this = this,
+    rows = str.split('\n'),
+    leftColumnWidth = 0
+
+  // simple heuristic for layout, make sure the
+  // second column lines up along the left-hand.
+  // don't allow the first column to take up more
+  // than 50% of the screen.
+  rows.forEach(function (row) {
+    var columns = row.split('\t')
+    if (columns.length > 1 && columns[0].length > leftColumnWidth) {
+      leftColumnWidth = Math.min(
+        Math.floor(_this.width * 0.5),
+        columns[0].length
+      )
+    }
+  })
+
+  // generate a table:
+  //  replacing ' ' with padding calculations.
+  //  using the algorithmically generated width.
+  rows.forEach(function (row) {
+    var columns = row.split('\t')
+    _this.div.apply(_this, columns.map(function (r, i) {
+      return {
+        text: r.trim(),
+        padding: [0, r.match(/\s*$/)[0].length, 0, r.match(/^\s*/)[0].length],
+        width: (i === 0 && columns.length > 1) ? leftColumnWidth : undefined
+      }
+    }))
+  })
+
+  return this.rows[this.rows.length - 1]
+}
+
+UI.prototype._colFromString = function (str) {
+  return {
+    text: str
+  }
+}
+
+UI.prototype.toString = function () {
+  var _this = this,
+    lines = []
+
+  _this.rows.forEach(function (row, i) {
+    _this.rowToString(row, lines)
+  })
+
+  // don't display any lines with the
+  // hidden flag set.
+  lines = lines.filter(function (line) {
+    return !line.hidden
+  })
+
+  return lines.map(function (line) {
+    return line.text
+  }).join('\n')
+}
+
+UI.prototype.rowToString = function (row, lines) {
+  var _this = this,
+    paddingLeft,
+    rrows = this._rasterize(row),
+    str = '',
+    ts,
+    width,
+    wrapWidth
+
+  rrows.forEach(function (rrow, r) {
+    str = ''
+    rrow.forEach(function (col, c) {
+      ts = '' // temporary string used during alignment/padding.
+      width = row[c].width // the width with padding.
+      wrapWidth = _this._negatePadding(row[c]) // the width without padding.
+
+      for (var i = 0; i < Math.max(wrapWidth, col.length); i++) {
+        ts += col.charAt(i) || ' '
+      }
+
+      // align the string within its column.
+      if (row[c].align && row[c].align !== 'left' && _this.wrap) {
+        ts = align[row[c].align](ts.trim() + '\n' + new Array(wrapWidth + 1).join(' '))
+          .split('\n')[0]
+        if (ts.length < wrapWidth) ts += new Array(width - ts.length).join(' ')
+      }
+
+      // add left/right padding and print string.
+      paddingLeft = (row[c].padding || [0, 0, 0, 0])[left]
+      if (paddingLeft) str += new Array(row[c].padding[left] + 1).join(' ')
+      str += ts
+      if (row[c].padding && row[c].padding[right]) str += new Array(row[c].padding[right] + 1).join(' ')
+
+      // if prior row is span, try to render the
+      // current row on the prior line.
+      if (r === 0 && lines.length > 0) {
+        str = _this._renderInline(str, lines[lines.length - 1], paddingLeft)
+      }
+    })
+
+    // remove trailing whitespace.
+    lines.push({
+      text: str.replace(/ +$/, ''),
+      span: row.span
+    })
+  })
+
+  return lines
+}
+
+// if the full 'source' can render in
+// the target line, do so.
+UI.prototype._renderInline = function (source, previousLine, paddingLeft) {
+  var target = previousLine.text,
+    str = ''
+
+  if (!previousLine.span) return source
+
+  // if we're not applying wrapping logic,
+  // just always append to the span.
+  if (!this.wrap) {
+    previousLine.hidden = true
+    return target + source
+  }
+
+  for (var i = 0, tc, sc; i < Math.max(source.length, target.length); i++) {
+    tc = target.charAt(i) || ' '
+    sc = source.charAt(i) || ' '
+    // we tried to overwrite a character in the other string.
+    if (tc !== ' ' && sc !== ' ') return source
+    // there is not enough whitespace to maintain padding.
+    if (sc !== ' ' && i < paddingLeft + target.length) return source
+    // :thumbsup:
+    if (tc === ' ') str += sc
+    else str += tc
+  }
+
+  previousLine.hidden = true
+
+  return str
+}
+
+UI.prototype._rasterize = function (row) {
+  var _this = this,
+    i,
+    rrow,
+    rrows = [],
+    widths = this._columnWidths(row),
+    wrapped
+
+  // word wrap all columns, and create
+  // a data-structure that is easy to rasterize.
+  row.forEach(function (col, c) {
+    // leave room for left and right padding.
+    col.width = widths[c]
+    if (_this.wrap) wrapped = wrap.hard(_this._negatePadding(col))(col.text).split('\n')
+    else wrapped = col.text.split('\n')
+
+    // add top and bottom padding.
+    if (col.padding) {
+      for (i = 0; i < (col.padding[top] || 0); i++) wrapped.unshift('')
+      for (i = 0; i < (col.padding[bottom] || 0); i++) wrapped.push('')
+    }
+
+    wrapped.forEach(function (str, r) {
+      if (!rrows[r]) rrows.push([])
+
+      rrow = rrows[r]
+
+      for (var i = 0; i < c; i++) {
+        if (rrow[i] === undefined) rrow.push('')
+      }
+      rrow.push(str)
+    })
+  })
+
+  return rrows
+}
+
+UI.prototype._negatePadding = function (col) {
+  var wrapWidth = col.width
+  if (col.padding) wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0)
+  return wrapWidth
+}
+
+UI.prototype._columnWidths = function (row) {
+  var _this = this,
+    widths = [],
+    unset = row.length,
+    unsetWidth,
+    remainingWidth = this.width
+
+  // column widths can be set in config.
+  row.forEach(function (col, i) {
+    if (col.width) {
+      unset--
+      widths[i] = col.width
+      remainingWidth -= col.width
+    } else {
+      widths[i] = undefined
+    }
+  })
+
+  // any unset widths should be calculated.
+  if (unset) unsetWidth = Math.floor(remainingWidth / unset)
+  widths.forEach(function (w, i) {
+    if (!_this.wrap) widths[i] = row[i].width || row[i].text.length
+    else if (w === undefined) widths[i] = Math.max(unsetWidth, _minWidth(row[i]))
+  })
+
+  return widths
+}
+
+// calculates the minimum width of
+// a column, based on padding preferences.
+function _minWidth (col) {
+  var padding = col.padding || []
+
+  return 1 + (padding[left] || 0) + (padding[right] || 0)
+}
+
+module.exports = function (opts) {
+  opts = opts || {}
+
+  return new UI({
+    width: (opts || {}).width || 80,
+    wrap: typeof opts.wrap === 'boolean' ? opts.wrap : true
+  })
+}
diff --git a/wrt/node_modules/yargs/node_modules/cliui/package.json b/wrt/node_modules/yargs/node_modules/cliui/package.json
new file mode 100644 (file)
index 0000000..56fce87
--- /dev/null
@@ -0,0 +1,91 @@
+{
+  "_from": "cliui@^2.1.0",
+  "_id": "cliui@2.1.0",
+  "_inBundle": false,
+  "_integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=",
+  "_location": "/yargs/cliui",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "cliui@^2.1.0",
+    "name": "cliui",
+    "escapedName": "cliui",
+    "rawSpec": "^2.1.0",
+    "saveSpec": null,
+    "fetchSpec": "^2.1.0"
+  },
+  "_requiredBy": [
+    "/yargs"
+  ],
+  "_resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz",
+  "_shasum": "4b475760ff80264c762c3a1719032e91c7fea0d1",
+  "_spec": "cliui@^2.1.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was/node_modules/yargs",
+  "author": {
+    "name": "Ben Coe",
+    "email": "ben@npmjs.com"
+  },
+  "bugs": {
+    "url": "https://github.com/bcoe/cliui/issues"
+  },
+  "bundleDependencies": false,
+  "config": {
+    "blanket": {
+      "pattern": [
+        "index.js"
+      ],
+      "data-cover-never": [
+        "node_modules",
+        "test"
+      ],
+      "output-reporter": "spec"
+    }
+  },
+  "dependencies": {
+    "center-align": "^0.1.1",
+    "right-align": "^0.1.1",
+    "wordwrap": "0.0.2"
+  },
+  "deprecated": false,
+  "description": "easily create complex multi-column command-line-interfaces",
+  "devDependencies": {
+    "blanket": "^1.1.6",
+    "chai": "^2.2.0",
+    "coveralls": "^2.11.2",
+    "mocha": "^2.2.4",
+    "mocha-lcov-reporter": "0.0.2",
+    "mocoverage": "^1.0.0",
+    "patched-blanket": "^1.0.1",
+    "standard": "^3.6.1"
+  },
+  "homepage": "https://github.com/bcoe/cliui#readme",
+  "keywords": [
+    "cli",
+    "command-line",
+    "layout",
+    "design",
+    "console",
+    "wrap",
+    "table"
+  ],
+  "license": "ISC",
+  "main": "index.js",
+  "name": "cliui",
+  "repository": {
+    "type": "git",
+    "url": "git+ssh://git@github.com/bcoe/cliui.git"
+  },
+  "scripts": {
+    "test": "standard && mocha --check-leaks --ui exports --require patched-blanket -R mocoverage"
+  },
+  "standard": {
+    "ignore": [
+      "**/example/**"
+    ],
+    "globals": [
+      "it"
+    ]
+  },
+  "version": "2.1.0"
+}
diff --git a/wrt/node_modules/yargs/node_modules/cliui/test/cliui.js b/wrt/node_modules/yargs/node_modules/cliui/test/cliui.js
new file mode 100644 (file)
index 0000000..1cc6127
--- /dev/null
@@ -0,0 +1,349 @@
+/* global describe, it */
+
+require('chai').should()
+
+var cliui = require('../')
+
+describe('cliui', function () {
+  describe('div', function () {
+    it("wraps text at 'width' if a single column is given", function () {
+      var ui = cliui({
+        width: 10
+      })
+
+      ui.div('i am a string that should be wrapped')
+
+      ui.toString().split('\n').forEach(function (row) {
+        row.length.should.be.lte(10)
+      })
+    })
+
+    it('evenly divides text across columns if multiple columns are given', function () {
+      var ui = cliui({
+        width: 40
+      })
+
+      ui.div(
+        {text: 'i am a string that should be wrapped', width: 15},
+        'i am a second string that should be wrapped',
+        'i am a third string that should be wrapped'
+      )
+
+      // total width of all columns is <=
+      // the width cliui is initialized with.
+      ui.toString().split('\n').forEach(function (row) {
+        row.length.should.be.lte(40)
+      })
+
+      // it should wrap each column appropriately.
+      var expected = [
+       'i am a string  i am a      i am a third',
+       'that should be second      string that',
+       'wrapped        string that should be',
+       '               should be   wrapped',
+       '               wrapped'
+      ]
+
+      ui.toString().split('\n').should.eql(expected)
+    })
+
+    it('allows for a blank row to be appended', function () {
+      var ui = cliui({
+        width: 40
+      })
+
+      ui.div()
+
+      // it should wrap each column appropriately.
+      var expected = ['']
+
+      ui.toString().split('\n').should.eql(expected)
+    })
+  })
+
+  describe('_columnWidths', function () {
+    it('uses same width for each column by default', function () {
+      var ui = cliui({
+          width: 40
+        }),
+        widths = ui._columnWidths([{}, {}, {}])
+
+      widths[0].should.equal(13)
+      widths[1].should.equal(13)
+      widths[2].should.equal(13)
+    })
+
+    it('divides width over remaining columns if first column has width specified', function () {
+      var ui = cliui({
+          width: 40
+        }),
+        widths = ui._columnWidths([{width: 20}, {}, {}])
+
+      widths[0].should.equal(20)
+      widths[1].should.equal(10)
+      widths[2].should.equal(10)
+    })
+
+    it('divides width over remaining columns if middle column has width specified', function () {
+      var ui = cliui({
+          width: 40
+        }),
+        widths = ui._columnWidths([{}, {width: 10}, {}])
+
+      widths[0].should.equal(15)
+      widths[1].should.equal(10)
+      widths[2].should.equal(15)
+    })
+
+    it('keeps track of remaining width if multiple columns have width specified', function () {
+      var ui = cliui({
+          width: 40
+        }),
+        widths = ui._columnWidths([{width: 20}, {width: 12}, {}])
+
+      widths[0].should.equal(20)
+      widths[1].should.equal(12)
+      widths[2].should.equal(8)
+    })
+
+    it('uses a sane default if impossible widths are specified', function () {
+      var ui = cliui({
+          width: 40
+        }),
+        widths = ui._columnWidths([{width: 30}, {width: 30}, {padding: [0, 2, 0, 1]}])
+
+      widths[0].should.equal(30)
+      widths[1].should.equal(30)
+      widths[2].should.equal(4)
+    })
+  })
+
+  describe('alignment', function () {
+    it('allows a column to be right aligned', function () {
+      var ui = cliui({
+        width: 40
+      })
+
+      ui.div(
+        'i am a string',
+        {text: 'i am a second string', align: 'right'},
+        'i am a third string that should be wrapped'
+      )
+
+      // it should right-align the second column.
+      var expected = [
+       'i am a stringi am a secondi am a third',
+       '                    stringstring that',
+       '                          should be',
+       '                          wrapped'
+      ]
+
+      ui.toString().split('\n').should.eql(expected)
+    })
+
+    it('allows a column to be center aligned', function () {
+      var ui = cliui({
+        width: 60
+      })
+
+      ui.div(
+        'i am a string',
+        {text: 'i am a second string', align: 'center', padding: [0, 2, 0, 2]},
+        'i am a third string that should be wrapped'
+      )
+
+      // it should right-align the second column.
+      var expected = [
+       'i am a string          i am a second       i am a third string',
+       '                           string          that should be',
+       '                                           wrapped'
+      ]
+
+      ui.toString().split('\n').should.eql(expected)
+    })
+  })
+
+  describe('padding', function () {
+    it('handles left/right padding', function () {
+      var ui = cliui({
+        width: 40
+      })
+
+      ui.div(
+        {text: 'i have padding on my left', padding: [0, 0, 0, 4]},
+        {text: 'i have padding on my right', padding: [0, 2, 0, 0], align: 'center'},
+        {text: 'i have no padding', padding: [0, 0, 0, 0]}
+      )
+
+      // it should add left/right padding to columns.
+      var expected = [
+       '    i have     i have      i have no',
+       '    padding  padding on    padding',
+       '    on my     my right',
+       '    left'
+      ]
+
+      ui.toString().split('\n').should.eql(expected)
+    })
+
+    it('handles top/bottom padding', function () {
+      var ui = cliui({
+        width: 40
+      })
+
+      ui.div(
+        'i am a string',
+        {text: 'i am a second string', padding: [2, 0, 0, 0]},
+        {text: 'i am a third string that should be wrapped', padding: [0, 0, 1, 0]}
+      )
+
+      // it should add top/bottom padding to second
+      // and third columns.
+      var expected = [
+       'i am a string             i am a third',
+       '                          string that',
+       '             i am a secondshould be',
+       '             string       wrapped',
+       ''
+      ]
+
+      ui.toString().split('\n').should.eql(expected)
+    })
+  })
+
+  describe('wrap', function () {
+    it('allows wordwrap to be disabled', function () {
+      var ui = cliui({
+        wrap: false
+      })
+
+      ui.div(
+        {text: 'i am a string', padding: [0, 1, 0, 0]},
+        {text: 'i am a second string', padding: [0, 2, 0, 0]},
+        {text: 'i am a third string that should not be wrapped', padding: [0, 0, 0, 2]}
+      )
+
+      ui.toString().should.equal('i am a string i am a second string    i am a third string that should not be wrapped')
+    })
+  })
+
+  describe('span', function () {
+    it('appends the next row to the end of the prior row if it fits', function () {
+      var ui = cliui({
+        width: 40
+      })
+
+      ui.span(
+        {text: 'i am a string that will be wrapped', width: 30}
+      )
+
+      ui.div(
+        {text: ' [required] [default: 99]', align: 'right'}
+      )
+
+      var expected = [
+       'i am a string that will be',
+       'wrapped         [required] [default: 99]'
+      ]
+
+      ui.toString().split('\n').should.eql(expected)
+    })
+
+    it('does not append the string if it does not fit on the prior row', function () {
+      var ui = cliui({
+        width: 40
+      })
+
+      ui.span(
+        {text: 'i am a string that will be wrapped', width: 30}
+      )
+
+      ui.div(
+        {text: 'i am a second row', align: 'left'}
+      )
+
+      var expected = [
+       'i am a string that will be',
+       'wrapped',
+       'i am a second row'
+      ]
+
+      ui.toString().split('\n').should.eql(expected)
+    })
+
+    it('always appends text to prior span if wrap is disabled', function () {
+      var ui = cliui({
+        wrap: false,
+        width: 40
+      })
+
+      ui.span(
+        {text: 'i am a string that will be wrapped', width: 30}
+      )
+
+      ui.div(
+        {text: 'i am a second row', align: 'left', padding: [0, 0, 0, 3]}
+      )
+
+      ui.div('a third line')
+
+      var expected = [
+       'i am a string that will be wrapped   i am a second row',
+       'a third line'
+      ]
+
+      ui.toString().split('\n').should.eql(expected)
+    })
+  })
+
+  describe('layoutDSL', function () {
+    it('turns tab into multiple columns', function () {
+      var ui = cliui({
+        width: 60
+      })
+
+      ui.div(
+        '  <regex>  \tmy awesome regex\n  <my second thing>  \tanother row\t  a third column'
+      )
+
+      var expected = [
+       '  <regex>            my awesome regex',
+       '  <my second thing>  another row          a third column'
+      ]
+
+      ui.toString().split('\n').should.eql(expected)
+    })
+
+    it('turns newline into multiple rows', function () {
+      var ui = cliui({
+        width: 40
+      })
+
+      ui.div(
+        'Usage: $0\n  <regex>\t  my awesome regex\n  <glob>\t  my awesome glob\t  [required]'
+      )
+      var expected = [
+       'Usage: $0',
+       '  <regex>  my awesome regex',
+       '  <glob>   my awesome     [required]',
+       '           glob'
+      ]
+
+      ui.toString().split('\n').should.eql(expected)
+    })
+
+    it('does not apply DSL if wrap is false', function () {
+      var ui = cliui({
+        width: 40,
+        wrap: false
+      })
+
+      ui.div(
+        'Usage: $0\ttwo\tthree'
+      )
+
+      ui.toString().should.eql('Usage: $0\ttwo\tthree')
+    })
+
+  })
+})
diff --git a/wrt/node_modules/yargs/node_modules/wordwrap/.npmignore b/wrt/node_modules/yargs/node_modules/wordwrap/.npmignore
new file mode 100644 (file)
index 0000000..3c3629e
--- /dev/null
@@ -0,0 +1 @@
+node_modules
diff --git a/wrt/node_modules/yargs/node_modules/wordwrap/README.markdown b/wrt/node_modules/yargs/node_modules/wordwrap/README.markdown
new file mode 100644 (file)
index 0000000..346374e
--- /dev/null
@@ -0,0 +1,70 @@
+wordwrap
+========
+
+Wrap your words.
+
+example
+=======
+
+made out of meat
+----------------
+
+meat.js
+
+    var wrap = require('wordwrap')(15);
+    console.log(wrap('You and your whole family are made out of meat.'));
+
+output:
+
+    You and your
+    whole family
+    are made out
+    of meat.
+
+centered
+--------
+
+center.js
+
+    var wrap = require('wordwrap')(20, 60);
+    console.log(wrap(
+        'At long last the struggle and tumult was over.'
+        + ' The machines had finally cast off their oppressors'
+        + ' and were finally free to roam the cosmos.'
+        + '\n'
+        + 'Free of purpose, free of obligation.'
+        + ' Just drifting through emptiness.'
+        + ' The sun was just another point of light.'
+    ));
+
+output:
+
+                        At long last the struggle and tumult
+                        was over. The machines had finally cast
+                        off their oppressors and were finally
+                        free to roam the cosmos.
+                        Free of purpose, free of obligation.
+                        Just drifting through emptiness. The
+                        sun was just another point of light.
+
+methods
+=======
+
+var wrap = require('wordwrap');
+
+wrap(stop), wrap(start, stop, params={mode:"soft"})
+---------------------------------------------------
+
+Returns a function that takes a string and returns a new string.
+
+Pad out lines with spaces out to column `start` and then wrap until column
+`stop`. If a word is longer than `stop - start` characters it will overflow.
+
+In "soft" mode, split chunks by `/(\S+\s+/` and don't break up chunks which are
+longer than `stop - start`, in "hard" mode, split chunks with `/\b/` and break
+up chunks longer than `stop - start`.
+
+wrap.hard(start, stop)
+----------------------
+
+Like `wrap()` but with `params.mode = "hard"`.
diff --git a/wrt/node_modules/yargs/node_modules/wordwrap/example/center.js b/wrt/node_modules/yargs/node_modules/wordwrap/example/center.js
new file mode 100644 (file)
index 0000000..a3fbaae
--- /dev/null
@@ -0,0 +1,10 @@
+var wrap = require('wordwrap')(20, 60);
+console.log(wrap(
+    'At long last the struggle and tumult was over.'
+    + ' The machines had finally cast off their oppressors'
+    + ' and were finally free to roam the cosmos.'
+    + '\n'
+    + 'Free of purpose, free of obligation.'
+    + ' Just drifting through emptiness.'
+    + ' The sun was just another point of light.'
+));
diff --git a/wrt/node_modules/yargs/node_modules/wordwrap/example/meat.js b/wrt/node_modules/yargs/node_modules/wordwrap/example/meat.js
new file mode 100644 (file)
index 0000000..a4665e1
--- /dev/null
@@ -0,0 +1,3 @@
+var wrap = require('wordwrap')(15);
+
+console.log(wrap('You and your whole family are made out of meat.'));
diff --git a/wrt/node_modules/yargs/node_modules/wordwrap/index.js b/wrt/node_modules/yargs/node_modules/wordwrap/index.js
new file mode 100644 (file)
index 0000000..c9bc945
--- /dev/null
@@ -0,0 +1,76 @@
+var wordwrap = module.exports = function (start, stop, params) {
+    if (typeof start === 'object') {
+        params = start;
+        start = params.start;
+        stop = params.stop;
+    }
+    
+    if (typeof stop === 'object') {
+        params = stop;
+        start = start || params.start;
+        stop = undefined;
+    }
+    
+    if (!stop) {
+        stop = start;
+        start = 0;
+    }
+    
+    if (!params) params = {};
+    var mode = params.mode || 'soft';
+    var re = mode === 'hard' ? /\b/ : /(\S+\s+)/;
+    
+    return function (text) {
+        var chunks = text.toString()
+            .split(re)
+            .reduce(function (acc, x) {
+                if (mode === 'hard') {
+                    for (var i = 0; i < x.length; i += stop - start) {
+                        acc.push(x.slice(i, i + stop - start));
+                    }
+                }
+                else acc.push(x)
+                return acc;
+            }, [])
+        ;
+        
+        return chunks.reduce(function (lines, rawChunk) {
+            if (rawChunk === '') return lines;
+            
+            var chunk = rawChunk.replace(/\t/g, '    ');
+            
+            var i = lines.length - 1;
+            if (lines[i].length + chunk.length > stop) {
+                lines[i] = lines[i].replace(/\s+$/, '');
+                
+                chunk.split(/\n/).forEach(function (c) {
+                    lines.push(
+                        new Array(start + 1).join(' ')
+                        + c.replace(/^\s+/, '')
+                    );
+                });
+            }
+            else if (chunk.match(/\n/)) {
+                var xs = chunk.split(/\n/);
+                lines[i] += xs.shift();
+                xs.forEach(function (c) {
+                    lines.push(
+                        new Array(start + 1).join(' ')
+                        + c.replace(/^\s+/, '')
+                    );
+                });
+            }
+            else {
+                lines[i] += chunk;
+            }
+            
+            return lines;
+        }, [ new Array(start + 1).join(' ') ]).join('\n');
+    };
+};
+
+wordwrap.soft = wordwrap;
+
+wordwrap.hard = function (start, stop) {
+    return wordwrap(start, stop, { mode : 'hard' });
+};
diff --git a/wrt/node_modules/yargs/node_modules/wordwrap/package.json b/wrt/node_modules/yargs/node_modules/wordwrap/package.json
new file mode 100644 (file)
index 0000000..03176c8
--- /dev/null
@@ -0,0 +1,66 @@
+{
+  "_from": "wordwrap@0.0.2",
+  "_id": "wordwrap@0.0.2",
+  "_inBundle": false,
+  "_integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=",
+  "_location": "/yargs/wordwrap",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "wordwrap@0.0.2",
+    "name": "wordwrap",
+    "escapedName": "wordwrap",
+    "rawSpec": "0.0.2",
+    "saveSpec": null,
+    "fetchSpec": "0.0.2"
+  },
+  "_requiredBy": [
+    "/yargs/cliui"
+  ],
+  "_resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz",
+  "_shasum": "b79669bb42ecb409f83d583cad52ca17eaa1643f",
+  "_spec": "wordwrap@0.0.2",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was/node_modules/yargs/node_modules/cliui",
+  "author": {
+    "name": "James Halliday",
+    "email": "mail@substack.net",
+    "url": "http://substack.net"
+  },
+  "bugs": {
+    "url": "https://github.com/substack/node-wordwrap/issues"
+  },
+  "bundleDependencies": false,
+  "deprecated": false,
+  "description": "Wrap those words. Show them at what columns to start and stop.",
+  "devDependencies": {
+    "expresso": "=0.7.x"
+  },
+  "directories": {
+    "lib": ".",
+    "example": "example",
+    "test": "test"
+  },
+  "engines": {
+    "node": ">=0.4.0"
+  },
+  "homepage": "https://github.com/substack/node-wordwrap#readme",
+  "keywords": [
+    "word",
+    "wrap",
+    "rule",
+    "format",
+    "column"
+  ],
+  "license": "MIT/X11",
+  "main": "./index.js",
+  "name": "wordwrap",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/substack/node-wordwrap.git"
+  },
+  "scripts": {
+    "test": "expresso"
+  },
+  "version": "0.0.2"
+}
diff --git a/wrt/node_modules/yargs/node_modules/wordwrap/test/break.js b/wrt/node_modules/yargs/node_modules/wordwrap/test/break.js
new file mode 100644 (file)
index 0000000..749292e
--- /dev/null
@@ -0,0 +1,30 @@
+var assert = require('assert');
+var wordwrap = require('../');
+
+exports.hard = function () {
+    var s = 'Assert from {"type":"equal","ok":false,"found":1,"wanted":2,'
+        + '"stack":[],"id":"b7ddcd4c409de8799542a74d1a04689b",'
+        + '"browser":"chrome/6.0"}'
+    ;
+    var s_ = wordwrap.hard(80)(s);
+    
+    var lines = s_.split('\n');
+    assert.equal(lines.length, 2);
+    assert.ok(lines[0].length < 80);
+    assert.ok(lines[1].length < 80);
+    
+    assert.equal(s, s_.replace(/\n/g, ''));
+};
+
+exports.break = function () {
+    var s = new Array(55+1).join('a');
+    var s_ = wordwrap.hard(20)(s);
+    
+    var lines = s_.split('\n');
+    assert.equal(lines.length, 3);
+    assert.ok(lines[0].length === 20);
+    assert.ok(lines[1].length === 20);
+    assert.ok(lines[2].length === 15);
+    
+    assert.equal(s, s_.replace(/\n/g, ''));
+};
diff --git a/wrt/node_modules/yargs/node_modules/wordwrap/test/idleness.txt b/wrt/node_modules/yargs/node_modules/wordwrap/test/idleness.txt
new file mode 100644 (file)
index 0000000..aa3f490
--- /dev/null
@@ -0,0 +1,63 @@
+In Praise of Idleness
+
+By Bertrand Russell
+
+[1932]
+
+Like most of my generation, I was brought up on the saying: 'Satan finds some mischief for idle hands to do.' Being a highly virtuous child, I believed all that I was told, and acquired a conscience which has kept me working hard down to the present moment. But although my conscience has controlled my actions, my opinions have undergone a revolution. I think that there is far too much work done in the world, that immense harm is caused by the belief that work is virtuous, and that what needs to be preached in modern industrial countries is quite different from what always has been preached. Everyone knows the story of the traveler in Naples who saw twelve beggars lying in the sun (it was before the days of Mussolini), and offered a lira to the laziest of them. Eleven of them jumped up to claim it, so he gave it to the twelfth. this traveler was on the right lines. But in countries which do not enjoy Mediterranean sunshine idleness is more difficult, and a great public propaganda will be required to inaugurate it. I hope that, after reading the following pages, the leaders of the YMCA will start a campaign to induce good young men to do nothing. If so, I shall not have lived in vain.
+
+Before advancing my own arguments for laziness, I must dispose of one which I cannot accept. Whenever a person who already has enough to live on proposes to engage in some everyday kind of job, such as school-teaching or typing, he or she is told that such conduct takes the bread out of other people's mouths, and is therefore wicked. If this argument were valid, it would only be necessary for us all to be idle in order that we should all have our mouths full of bread. What people who say such things forget is that what a man earns he usually spends, and in spending he gives employment. As long as a man spends his income, he puts just as much bread into people's mouths in spending as he takes out of other people's mouths in earning. The real villain, from this point of view, is the man who saves. If he merely puts his savings in a stocking, like the proverbial French peasant, it is obvious that they do not give employment. If he invests his savings, the matter is less obvious, and different cases arise.
+
+One of the commonest things to do with savings is to lend them to some Government. In view of the fact that the bulk of the public expenditure of most civilized Governments consists in payment for past wars or preparation for future wars, the man who lends his money to a Government is in the same position as the bad men in Shakespeare who hire murderers. The net result of the man's economical habits is to increase the armed forces of the State to which he lends his savings. Obviously it would be better if he spent the money, even if he spent it in drink or gambling.
+
+But, I shall be told, the case is quite different when savings are invested in industrial enterprises. When such enterprises succeed, and produce something useful, this may be conceded. In these days, however, no one will deny that most enterprises fail. That means that a large amount of human labor, which might have been devoted to producing something that could be enjoyed, was expended on producing machines which, when produced, lay idle and did no good to anyone. The man who invests his savings in a concern that goes bankrupt is therefore injuring others as well as himself. If he spent his money, say, in giving parties for his friends, they (we may hope) would get pleasure, and so would all those upon whom he spent money, such as the butcher, the baker, and the bootlegger. But if he spends it (let us say) upon laying down rails for surface card in some place where surface cars turn out not to be wanted, he has diverted a mass of labor into channels where it gives pleasure to no one. Nevertheless, when he becomes poor through failure of his investment he will be regarded as a victim of undeserved misfortune, whereas the gay spendthrift, who has spent his money philanthropically, will be despised as a fool and a frivolous person.
+
+All this is only preliminary. I want to say, in all seriousness, that a great deal of harm is being done in the modern world by belief in the virtuousness of work, and that the road to happiness and prosperity lies in an organized diminution of work.
+
+First of all: what is work? Work is of two kinds: first, altering the position of matter at or near the earth's surface relatively to other such matter; second, telling other people to do so. The first kind is unpleasant and ill paid; the second is pleasant and highly paid. The second kind is capable of indefinite extension: there are not only those who give orders, but those who give advice as to what orders should be given. Usually two opposite kinds of advice are given simultaneously by two organized bodies of men; this is called politics. The skill required for this kind of work is not knowledge of the subjects as to which advice is given, but knowledge of the art of persuasive speaking and writing, i.e. of advertising.
+
+Throughout Europe, though not in America, there is a third class of men, more respected than either of the classes of workers. There are men who, through ownership of land, are able to make others pay for the privilege of being allowed to exist and to work. These landowners are idle, and I might therefore be expected to praise them. Unfortunately, their idleness is only rendered possible by the industry of others; indeed their desire for comfortable idleness is historically the source of the whole gospel of work. The last thing they have ever wished is that others should follow their example.
+
+From the beginning of civilization until the Industrial Revolution, a man could, as a rule, produce by hard work little more than was required for the subsistence of himself and his family, although his wife worked at least as hard as he did, and his children added their labor as soon as they were old enough to do so. The small surplus above bare necessaries was not left to those who produced it, but was appropriated by warriors and priests. In times of famine there was no surplus; the warriors and priests, however, still secured as much as at other times, with the result that many of the workers died of hunger. This system persisted in Russia until 1917 [1], and still persists in the East; in England, in spite of the Industrial Revolution, it remained in full force throughout the Napoleonic wars, and until a hundred years ago, when the new class of manufacturers acquired power. In America, the system came to an end with the Revolution, except in the South, where it persisted until the Civil War. A system which lasted so long and ended so recently has naturally left a profound impress upon men's thoughts and opinions. Much that we take for granted about the desirability of work is derived from this system, and, being pre-industrial, is not adapted to the modern world. Modern technique has made it possible for leisure, within limits, to be not the prerogative of small privileged classes, but a right evenly distributed throughout the community. The morality of work is the morality of slaves, and the modern world has no need of slavery.
+
+It is obvious that, in primitive communities, peasants, left to themselves, would not have parted with the slender surplus upon which the warriors and priests subsisted, but would have either produced less or consumed more. At first, sheer force compelled them to produce and part with the surplus. Gradually, however, it was found possible to induce many of them to accept an ethic according to which it was their duty to work hard, although part of their work went to support others in idleness. By this means the amount of compulsion required was lessened, and the expenses of government were diminished. To this day, 99 per cent of British wage-earners would be genuinely shocked if it were proposed that the King should not have a larger income than a working man. The conception of duty, speaking historically, has been a means used by the holders of power to induce others to live for the interests of their masters rather than for their own. Of course the holders of power conceal this fact from themselves by managing to believe that their interests are identical with the larger interests of humanity. Sometimes this is true; Athenian slave-owners, for instance, employed part of their leisure in making a permanent contribution to civilization which would have been impossible under a just economic system. Leisure is essential to civilization, and in former times leisure for the few was only rendered possible by the labors of the many. But their labors were valuable, not because work is good, but because leisure is good. And with modern technique it would be possible to distribute leisure justly without injury to civilization.
+
+Modern technique has made it possible to diminish enormously the amount of labor required to secure the necessaries of life for everyone. This was made obvious during the war. At that time all the men in the armed forces, and all the men and women engaged in the production of munitions, all the men and women engaged in spying, war propaganda, or Government offices connected with the war, were withdrawn from productive occupations. In spite of this, the general level of well-being among unskilled wage-earners on the side of the Allies was higher than before or since. The significance of this fact was concealed by finance: borrowing made it appear as if the future was nourishing the present. But that, of course, would have been impossible; a man cannot eat a loaf of bread that does not yet exist. The war showed conclusively that, by the scientific organization of production, it is possible to keep modern populations in fair comfort on a small part of the working capacity of the modern world. If, at the end of the war, the scientific organization, which had been created in order to liberate men for fighting and munition work, had been preserved, and the hours of the week had been cut down to four, all would have been well. Instead of that the old chaos was restored, those whose work was demanded were made to work long hours, and the rest were left to starve as unemployed. Why? Because work is a duty, and a man should not receive wages in proportion to what he has produced, but in proportion to his virtue as exemplified by his industry.
+
+This is the morality of the Slave State, applied in circumstances totally unlike those in which it arose. No wonder the result has been disastrous. Let us take an illustration. Suppose that, at a given moment, a certain number of people are engaged in the manufacture of pins. They make as many pins as the world needs, working (say) eight hours a day. Someone makes an invention by which the same number of men can make twice as many pins: pins are already so cheap that hardly any more will be bought at a lower price. In a sensible world, everybody concerned in the manufacturing of pins would take to working four hours instead of eight, and everything else would go on as before. But in the actual world this would be thought demoralizing. The men still work eight hours, there are too many pins, some employers go bankrupt, and half the men previously concerned in making pins are thrown out of work. There is, in the end, just as much leisure as on the other plan, but half the men are totally idle while half are still overworked. In this way, it is insured that the unavoidable leisure shall cause misery all round instead of being a universal source of happiness. Can anything more insane be imagined?
+
+The idea that the poor should have leisure has always been shocking to the rich. In England, in the early nineteenth century, fifteen hours was the ordinary day's work for a man; children sometimes did as much, and very commonly did twelve hours a day. When meddlesome busybodies suggested that perhaps these hours were rather long, they were told that work kept adults from drink and children from mischief. When I was a child, shortly after urban working men had acquired the vote, certain public holidays were established by law, to the great indignation of the upper classes. I remember hearing an old Duchess say: 'What do the poor want with holidays? They ought to work.' People nowadays are less frank, but the sentiment persists, and is the source of much of our economic confusion.
+
+Let us, for a moment, consider the ethics of work frankly, without superstition. Every human being, of necessity, consumes, in the course of his life, a certain amount of the produce of human labor. Assuming, as we may, that labor is on the whole disagreeable, it is unjust that a man should consume more than he produces. Of course he may provide services rather than commodities, like a medical man, for example; but he should provide something in return for his board and lodging. to this extent, the duty of work must be admitted, but to this extent only.
+
+I shall not dwell upon the fact that, in all modern societies outside the USSR, many people escape even this minimum amount of work, namely all those who inherit money and all those who marry money. I do not think the fact that these people are allowed to be idle is nearly so harmful as the fact that wage-earners are expected to overwork or starve.
+
+If the ordinary wage-earner worked four hours a day, there would be enough for everybody and no unemployment -- assuming a certain very moderate amount of sensible organization. This idea shocks the well-to-do, because they are convinced that the poor would not know how to use so much leisure. In America men often work long hours even when they are well off; such men, naturally, are indignant at the idea of leisure for wage-earners, except as the grim punishment of unemployment; in fact, they dislike leisure even for their sons. Oddly enough, while they wish their sons to work so hard as to have no time to be civilized, they do not mind their wives and daughters having no work at all. the snobbish admiration of uselessness, which, in an aristocratic society, extends to both sexes, is, under a plutocracy, confined to women; this, however, does not make it any more in agreement with common sense.
+
+The wise use of leisure, it must be conceded, is a product of civilization and education. A man who has worked long hours all his life will become bored if he becomes suddenly idle. But without a considerable amount of leisure a man is cut off from many of the best things. There is no longer any reason why the bulk of the population should suffer this deprivation; only a foolish asceticism, usually vicarious, makes us continue to insist on work in excessive quantities now that the need no longer exists.
+
+In the new creed which controls the government of Russia, while there is much that is very different from the traditional teaching of the West, there are some things that are quite unchanged. The attitude of the governing classes, and especially of those who conduct educational propaganda, on the subject of the dignity of labor, is almost exactly that which the governing classes of the world have always preached to what were called the 'honest poor'. Industry, sobriety, willingness to work long hours for distant advantages, even submissiveness to authority, all these reappear; moreover authority still represents the will of the Ruler of the Universe, Who, however, is now called by a new name, Dialectical Materialism.
+
+The victory of the proletariat in Russia has some points in common with the victory of the feminists in some other countries. For ages, men had conceded the superior saintliness of women, and had consoled women for their inferiority by maintaining that saintliness is more desirable than power. At last the feminists decided that they would have both, since the pioneers among them believed all that the men had told them about the desirability of virtue, but not what they had told them about the worthlessness of political power. A similar thing has happened in Russia as regards manual work. For ages, the rich and their sycophants have written in praise of 'honest toil', have praised the simple life, have professed a religion which teaches that the poor are much more likely to go to heaven than the rich, and in general have tried to make manual workers believe that there is some special nobility about altering the position of matter in space, just as men tried to make women believe that they derived some special nobility from their sexual enslavement. In Russia, all this teaching about the excellence of manual work has been taken seriously, with the result that the manual worker is more honored than anyone else. What are, in essence, revivalist appeals are made, but not for the old purposes: they are made to secure shock workers for special tasks. Manual work is the ideal which is held before the young, and is the basis of all ethical teaching.
+
+For the present, possibly, this is all to the good. A large country, full of natural resources, awaits development, and has has to be developed with very little use of credit. In these circumstances, hard work is necessary, and is likely to bring a great reward. But what will happen when the point has been reached where everybody could be comfortable without working long hours?
+
+In the West, we have various ways of dealing with this problem. We have no attempt at economic justice, so that a large proportion of the total produce goes to a small minority of the population, many of whom do no work at all. Owing to the absence of any central control over production, we produce hosts of things that are not wanted. We keep a large percentage of the working population idle, because we can dispense with their labor by making the others overwork. When all these methods prove inadequate, we have a war: we cause a number of people to manufacture high explosives, and a number of others to explode them, as if we were children who had just discovered fireworks. By a combination of all these devices we manage, though with difficulty, to keep alive the notion that a great deal of severe manual work must be the lot of the average man.
+
+In Russia, owing to more economic justice and central control over production, the problem will have to be differently solved. the rational solution would be, as soon as the necessaries and elementary comforts can be provided for all, to reduce the hours of labor gradually, allowing a popular vote to decide, at each stage, whether more leisure or more goods were to be preferred. But, having taught the supreme virtue of hard work, it is difficult to see how the authorities can aim at a paradise in which there will be much leisure and little work. It seems more likely that they will find continually fresh schemes, by which present leisure is to be sacrificed to future productivity. I read recently of an ingenious plan put forward by Russian engineers, for making the White Sea and the northern coasts of Siberia warm, by putting a dam across the Kara Sea. An admirable project, but liable to postpone proletarian comfort for a generation, while the nobility of toil is being displayed amid the ice-fields and snowstorms of the Arctic Ocean. This sort of thing, if it happens, will be the result of regarding the virtue of hard work as an end in itself, rather than as a means to a state of affairs in which it is no longer needed.
+
+The fact is that moving matter about, while a certain amount of it is necessary to our existence, is emphatically not one of the ends of human life. If it were, we should have to consider every navvy superior to Shakespeare. We have been misled in this matter by two causes. One is the necessity of keeping the poor contented, which has led the rich, for thousands of years, to preach the dignity of labor, while taking care themselves to remain undignified in this respect. The other is the new pleasure in mechanism, which makes us delight in the astonishingly clever changes that we can produce on the earth's surface. Neither of these motives makes any great appeal to the actual worker. If you ask him what he thinks the best part of his life, he is not likely to say: 'I enjoy manual work because it makes me feel that I am fulfilling man's noblest task, and because I like to think how much man can transform his planet. It is true that my body demands periods of rest, which I have to fill in as best I may, but I am never so happy as when the morning comes and I can return to the toil from which my contentment springs.' I have never heard working men say this sort of thing. They consider work, as it should be considered, a necessary means to a livelihood, and it is from their leisure that they derive whatever happiness they may enjoy.
+
+It will be said that, while a little leisure is pleasant, men would not know how to fill their days if they had only four hours of work out of the twenty-four. In so far as this is true in the modern world, it is a condemnation of our civilization; it would not have been true at any earlier period. There was formerly a capacity for light-heartedness and play which has been to some extent inhibited by the cult of efficiency. The modern man thinks that everything ought to be done for the sake of something else, and never for its own sake. Serious-minded persons, for example, are continually condemning the habit of going to the cinema, and telling us that it leads the young into crime. But all the work that goes to producing a cinema is respectable, because it is work, and because it brings a money profit. The notion that the desirable activities are those that bring a profit has made everything topsy-turvy. The butcher who provides you with meat and the baker who provides you with bread are praiseworthy, because they are making money; but when you enjoy the food they have provided, you are merely frivolous, unless you eat only to get strength for your work. Broadly speaking, it is held that getting money is good and spending money is bad. Seeing that they are two sides of one transaction, this is absurd; one might as well maintain that keys are good, but keyholes are bad. Whatever merit there may be in the production of goods must be entirely derivative from the advantage to be obtained by consuming them. The individual, in our society, works for profit; but the social purpose of his work lies in the consumption of what he produces. It is this divorce between the individual and the social purpose of production that makes it so difficult for men to think clearly in a world in which profit-making is the incentive to industry. We think too much of production, and too little of consumption. One result is that we attach too little importance to enjoyment and simple happiness, and that we do not judge production by the pleasure that it gives to the consumer.
+
+When I suggest that working hours should be reduced to four, I am not meaning to imply that all the remaining time should necessarily be spent in pure frivolity. I mean that four hours' work a day should entitle a man to the necessities and elementary comforts of life, and that the rest of his time should be his to use as he might see fit. It is an essential part of any such social system that education should be carried further than it usually is at present, and should aim, in part, at providing tastes which would enable a man to use leisure intelligently. I am not thinking mainly of the sort of things that would be considered 'highbrow'. Peasant dances have died out except in remote rural areas, but the impulses which caused them to be cultivated must still exist in human nature. The pleasures of urban populations have become mainly passive: seeing cinemas, watching football matches, listening to the radio, and so on. This results from the fact that their active energies are fully taken up with work; if they had more leisure, they would again enjoy pleasures in which they took an active part.
+
+In the past, there was a small leisure class and a larger working class. The leisure class enjoyed advantages for which there was no basis in social justice; this necessarily made it oppressive, limited its sympathies, and caused it to invent theories by which to justify its privileges. These facts greatly diminished its excellence, but in spite of this drawback it contributed nearly the whole of what we call civilization. It cultivated the arts and discovered the sciences; it wrote the books, invented the philosophies, and refined social relations. Even the liberation of the oppressed has usually been inaugurated from above. Without the leisure class, mankind would never have emerged from barbarism.
+
+The method of a leisure class without duties was, however, extraordinarily wasteful. None of the members of the class had to be taught to be industrious, and the class as a whole was not exceptionally intelligent. The class might produce one Darwin, but against him had to be set tens of thousands of country gentlemen who never thought of anything more intelligent than fox-hunting and punishing poachers. At present, the universities are supposed to provide, in a more systematic way, what the leisure class provided accidentally and as a by-product. This is a great improvement, but it has certain drawbacks. University life is so different from life in the world at large that men who live in academic milieu tend to be unaware of the preoccupations and problems of ordinary men and women; moreover their ways of expressing themselves are usually such as to rob their opinions of the influence that they ought to have upon the general public. Another disadvantage is that in universities studies are organized, and the man who thinks of some original line of research is likely to be discouraged. Academic institutions, therefore, useful as they are, are not adequate guardians of the interests of civilization in a world where everyone outside their walls is too busy for unutilitarian pursuits.
+
+In a world where no one is compelled to work more than four hours a day, every person possessed of scientific curiosity will be able to indulge it, and every painter will be able to paint without starving, however excellent his pictures may be. Young writers will not be obliged to draw attention to themselves by sensational pot-boilers, with a view to acquiring the economic independence needed for monumental works, for which, when the time at last comes, they will have lost the taste and capacity. Men who, in their professional work, have become interested in some phase of economics or government, will be able to develop their ideas without the academic detachment that makes the work of university economists often seem lacking in reality. Medical men will have the time to learn about the progress of medicine, teachers will not be exasperatedly struggling to teach by routine methods things which they learnt in their youth, which may, in the interval, have been proved to be untrue.
+
+Above all, there will be happiness and joy of life, instead of frayed nerves, weariness, and dyspepsia. The work exacted will be enough to make leisure delightful, but not enough to produce exhaustion. Since men will not be tired in their spare time, they will not demand only such amusements as are passive and vapid. At least one per cent will probably devote the time not spent in professional work to pursuits of some public importance, and, since they will not depend upon these pursuits for their livelihood, their originality will be unhampered, and there will be no need to conform to the standards set by elderly pundits. But it is not only in these exceptional cases that the advantages of leisure will appear. Ordinary men and women, having the opportunity of a happy life, will become more kindly and less persecuting and less inclined to view others with suspicion. The taste for war will die out, partly for this reason, and partly because it will involve long and severe work for all. Good nature is, of all moral qualities, the one that the world needs most, and good nature is the result of ease and security, not of a life of arduous struggle. Modern methods of production have given us the possibility of ease and security for all; we have chosen, instead, to have overwork for some and starvation for others. Hitherto we have continued to be as energetic as we were before there were machines; in this we have been foolish, but there is no reason to go on being foolish forever.
+
+[1] Since then, members of the Communist Party have succeeded to this privilege of the warriors and priests.
diff --git a/wrt/node_modules/yargs/node_modules/wordwrap/test/wrap.js b/wrt/node_modules/yargs/node_modules/wordwrap/test/wrap.js
new file mode 100644 (file)
index 0000000..0cfb76d
--- /dev/null
@@ -0,0 +1,31 @@
+var assert = require('assert');
+var wordwrap = require('wordwrap');
+
+var fs = require('fs');
+var idleness = fs.readFileSync(__dirname + '/idleness.txt', 'utf8');
+
+exports.stop80 = function () {
+    var lines = wordwrap(80)(idleness).split(/\n/);
+    var words = idleness.split(/\s+/);
+    
+    lines.forEach(function (line) {
+        assert.ok(line.length <= 80, 'line > 80 columns');
+        var chunks = line.match(/\S/) ? line.split(/\s+/) : [];
+        assert.deepEqual(chunks, words.splice(0, chunks.length));
+    });
+};
+
+exports.start20stop60 = function () {
+    var lines = wordwrap(20, 100)(idleness).split(/\n/);
+    var words = idleness.split(/\s+/);
+    
+    lines.forEach(function (line) {
+        assert.ok(line.length <= 100, 'line > 100 columns');
+        var chunks = line
+            .split(/\s+/)
+            .filter(function (x) { return x.match(/\S/) })
+        ;
+        assert.deepEqual(chunks, words.splice(0, chunks.length));
+        assert.deepEqual(line.slice(0, 20), new Array(20 + 1).join(' '));
+    });
+};
diff --git a/wrt/node_modules/yargs/package.json b/wrt/node_modules/yargs/package.json
new file mode 100644 (file)
index 0000000..8ffc8f6
--- /dev/null
@@ -0,0 +1,127 @@
+{
+  "_from": "yargs@3.19.0",
+  "_id": "yargs@3.19.0",
+  "_inBundle": false,
+  "_integrity": "sha1-NaWoQab+cPP6u7iN1tnr+1bbUyA=",
+  "_location": "/yargs",
+  "_phantomChildren": {
+    "center-align": "0.1.3",
+    "right-align": "0.1.3"
+  },
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "yargs@3.19.0",
+    "name": "yargs",
+    "escapedName": "yargs",
+    "rawSpec": "3.19.0",
+    "saveSpec": null,
+    "fetchSpec": "3.19.0"
+  },
+  "_requiredBy": [
+    "#DEV:/"
+  ],
+  "_resolved": "https://registry.npmjs.org/yargs/-/yargs-3.19.0.tgz",
+  "_shasum": "35a5a841a6fe70f3fabbb88dd6d9ebfb56db5320",
+  "_spec": "yargs@3.19.0",
+  "_where": "/home/kenshin.choi/project/blink/workspace/demo/chromium-efl/electron/was",
+  "author": {
+    "name": "Alex Ford",
+    "email": "Alex.Ford@CodeTunnel.com",
+    "url": "http://CodeTunnel.com"
+  },
+  "bugs": {
+    "url": "https://github.com/bcoe/yargs/issues"
+  },
+  "bundleDependencies": false,
+  "contributors": [
+    {
+      "name": "Benjamin Coe",
+      "email": "ben@npmjs.com",
+      "url": "https://github.com/bcoe"
+    },
+    {
+      "name": "Andrew Goode",
+      "url": "https://github.com/nexdrew"
+    },
+    {
+      "name": "Chris Needham",
+      "email": "chris@chrisneedham.com",
+      "url": "http://chrisneedham.com"
+    },
+    {
+      "name": "James Nylen",
+      "email": "jnylen@gmail.com",
+      "url": "https://github.com/nylen"
+    },
+    {
+      "name": "Benjamin Horsleben",
+      "url": "https://github.com/fizker"
+    },
+    {
+      "name": "Lin Clark",
+      "url": "https://github.com/linclark"
+    },
+    {
+      "name": "Tim Schaub",
+      "url": "https://github.com/tschaub"
+    }
+  ],
+  "dependencies": {
+    "camelcase": "^1.0.2",
+    "cliui": "^2.1.0",
+    "decamelize": "^1.0.0",
+    "window-size": "^0.1.1",
+    "y18n": "^3.0.0"
+  },
+  "deprecated": false,
+  "description": "Light-weight option parsing with an argv hash. No optstrings attached.",
+  "devDependencies": {
+    "chai": "^3.0.0",
+    "coveralls": "^2.11.2",
+    "hashish": "0.0.4",
+    "mocha": "^2.2.1",
+    "nyc": "^3.1.0",
+    "standard": "^5.0.2"
+  },
+  "engine": {
+    "node": ">=0.4"
+  },
+  "files": [
+    "index.js",
+    "lib",
+    "locales",
+    "completion.sh.hbs",
+    "LICENSE"
+  ],
+  "homepage": "https://github.com/bcoe/yargs#readme",
+  "keywords": [
+    "argument",
+    "args",
+    "option",
+    "parser",
+    "parsing",
+    "cli",
+    "command"
+  ],
+  "license": "MIT",
+  "main": "./index.js",
+  "name": "yargs",
+  "repository": {
+    "type": "git",
+    "url": "git+ssh://git@github.com/bcoe/yargs.git"
+  },
+  "scripts": {
+    "coverage": "nyc report --reporter=text-lcov | coveralls",
+    "test": "standard && nyc mocha --check-leaks"
+  },
+  "standard": {
+    "ignore": [
+      "**/example/**"
+    ],
+    "globals": [
+      "it"
+    ]
+  },
+  "version": "3.19.0"
+}
diff --git a/wrt/node_modules/yeast/LICENSE b/wrt/node_modules/yeast/LICENSE
new file mode 100644 (file)
index 0000000..6dc9316
--- /dev/null
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Unshift.io, Arnout Kazemier,  the Contributors.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/wrt/node_modules/yeast/README.md b/wrt/node_modules/yeast/README.md
new file mode 100644 (file)
index 0000000..0b0af0d
--- /dev/null
@@ -0,0 +1,82 @@
+# yeast
+
+[![Made by unshift](https://img.shields.io/badge/made%20by-unshift-00ffcc.svg?style=flat-square)](http://unshift.io)[![Version npm](https://img.shields.io/npm/v/yeast.svg?style=flat-square)](http://browsenpm.org/package/yeast)[![Build Status](https://img.shields.io/travis/unshiftio/yeast/master.svg?style=flat-square)](https://travis-ci.org/unshiftio/yeast)[![Dependencies](https://img.shields.io/david/unshiftio/yeast.svg?style=flat-square)](https://david-dm.org/unshiftio/yeast)[![Coverage Status](https://img.shields.io/coveralls/unshiftio/yeast/master.svg?style=flat-square)](https://coveralls.io/r/unshiftio/yeast?branch=master)[![IRC channel](https://img.shields.io/badge/IRC-irc.freenode.net%23unshift-00a8ff.svg?style=flat-square)](https://webchat.freenode.net/?channels=unshift)
+
+[![Sauce Test Status](https://saucelabs.com/browser-matrix/yeast.svg)](https://saucelabs.com/u/yeast)
+
+Yeast is a unique id generator. It has been primarily designed to generate a
+unique id which can be used for cache busting. A common practice for this is
+to use a timestamp, but there are couple of downsides when using timestamps.
+
+1. The timestamp is already 13 chars long. This might not matter for 1 request
+   but if you make hundreds of them this quickly adds up in bandwidth and
+   processing time.
+2. It's not unique enough. If you generate two stamps right after each other,
+   they would be identical because the timing accuracy is limited to
+   milliseconds.
+
+Yeast solves both of these issues by:
+
+1. Compressing the generated timestamp using a custom `encode()` function that
+   returns a string representation of the number.
+2. Seeding the id in case of collision (when the id is identical to the previous
+   one).
+
+To keep the strings unique it will use the `.` char to separate the generated
+stamp from the seed.
+
+## Installation
+
+The module is intended to be used in browsers as well as in Node.js and is
+therefore released in the npm registry and can be installed using:
+
+```
+npm install --save yeast
+```
+
+## Usage
+
+All the examples assume that this library is initialized as follow:
+
+```js
+'use strict';
+
+var yeast = require('yeast');
+```
+
+To generate an id just call the `yeast` function.
+
+```js
+console.log(yeast(), yeast(), yeast()); // outputs: KyxidwN KyxidwN.0 KyxidwN.1
+
+setTimeout(function () {
+  console.log(yeast()); // outputs: KyxidwO
+});
+```
+
+### yeast.encode(num)
+
+An helper function that returns a string representing the specified number. The
+returned string contains only URL safe characters.
+
+```js
+yeast.encode(+new Date()); // outputs: Kyxjuo1
+```
+
+### yeast.decode(str)
+
+An helper function that returns the integer value specified by the given string.
+This function can be used to retrieve the timestamp from a `yeast` id.
+
+```js
+var id = yeast(); // holds the value: Kyxl1OU
+
+yeast.decode(id); // outputs: 1439816226334
+```
+
+That's all folks. If you have ideas on how we can further compress the ids
+please open an issue!
+
+## License
+
+[MIT](LICENSE)
diff --git a/wrt/node_modules/yeast/index.js b/wrt/node_modules/yeast/index.js
new file mode 100644 (file)
index 0000000..7299762
--- /dev/null
@@ -0,0 +1,68 @@
+'use strict';
+
+var alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split('')
+  , length = 64
+  , map = {}
+  , seed = 0
+  , i = 0
+  , prev;
+
+/**
+ * Return a string representing the specified number.
+ *
+ * @param {Number} num The number to convert.
+ * @returns {String} The string representation of the number.
+ * @api public
+ */
+function encode(num) {
+  var encoded = '';
+
+  do {
+    encoded = alphabet[num % length] + encoded;
+    num = Math.floor(num / length);
+  } while (num > 0);
+
+  return encoded;
+}
+
+/**
+ * Return the integer value specified by the given string.
+ *
+ * @param {String} str The string to convert.
+ * @returns {Number} The integer value represented by the string.
+ * @api public
+ */
+function decode(str) {
+  var decoded = 0;
+
+  for (i = 0; i < str.length; i++) {
+    decoded = decoded * length + map[str.charAt(i)];
+  }
+
+  return decoded;
+}
+
+/**
+ * Yeast: A tiny growing id generator.
+ *
+ * @returns {String} A unique id.
+ * @api public
+ */
+function yeast() {
+  var now = encode(+new Date());
+
+  if (now !== prev) return seed = 0, prev = now;
+  return now +'.'+ encode(seed++);
+}
+
+//
+// Map each character to its index.
+//
+for (; i < length; i++) map[alphabet[i]] = i;
+
+//
+// Expose the `yeast`, `encode` and `decode` functions.
+//
+yeast.encode = encode;
+yeast.decode = decode;
+module.exports = yeast;
diff --git a/wrt/node_modules/yeast/package.json b/wrt/node_modules/yeast/package.json
new file mode 100644 (file)
index 0000000..fad919d
--- /dev/null
@@ -0,0 +1,100 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "yeast@0.1.2",
+        "scope": null,
+        "escapedName": "yeast",
+        "name": "yeast",
+        "rawSpec": "0.1.2",
+        "spec": "0.1.2",
+        "type": "version"
+      },
+      "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io-client"
+    ]
+  ],
+  "_from": "yeast@0.1.2",
+  "_id": "yeast@0.1.2",
+  "_inCache": true,
+  "_location": "/yeast",
+  "_nodeVersion": "0.12.3",
+  "_npmUser": {
+    "name": "3rdeden",
+    "email": "npm@3rd-Eden.com"
+  },
+  "_npmVersion": "2.9.1",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "yeast@0.1.2",
+    "scope": null,
+    "escapedName": "yeast",
+    "name": "yeast",
+    "rawSpec": "0.1.2",
+    "spec": "0.1.2",
+    "type": "version"
+  },
+  "_requiredBy": [
+    "/engine.io-client"
+  ],
+  "_resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz",
+  "_shasum": "008e06d8094320c372dbc2f8ed76a0ca6c8ac419",
+  "_shrinkwrap": null,
+  "_spec": "yeast@0.1.2",
+  "_where": "/home/kenshin.choi/project/blink/workspace/public/crosswalk-tizen/wrt/node_modules/engine.io-client",
+  "author": {
+    "name": "Arnout Kazemier"
+  },
+  "bugs": {
+    "url": "https://github.com/unshiftio/yeast/issues"
+  },
+  "dependencies": {},
+  "description": "Tiny but linear growing unique id generator",
+  "devDependencies": {
+    "assume": "1.3.x",
+    "istanbul": "0.3.x",
+    "mocha": "2.3.x",
+    "pre-commit": "1.1.x",
+    "zuul": "3.4.x"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "008e06d8094320c372dbc2f8ed76a0ca6c8ac419",
+    "tarball": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz"
+  },
+  "gitHead": "5a7300f934302009aa8733fa84d43cc570756b98",
+  "homepage": "https://github.com/unshiftio/yeast",
+  "keywords": [
+    "yeast",
+    "id",
+    "generator",
+    "unique"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "unshift",
+      "email": "npm@unshift.io"
+    },
+    {
+      "name": "3rdeden",
+      "email": "npm@3rd-Eden.com"
+    }
+  ],
+  "name": "yeast",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/unshiftio/yeast.git"
+  },
+  "scripts": {
+    "100%": "istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100",
+    "coverage": "istanbul cover _mocha -- test.js",
+    "test": "mocha test.js",
+    "test-browser": "zuul -- test.js",
+    "test-node": "istanbul cover _mocha --report lcovonly -- test.js",
+    "watch": "mocha --watch test.js"
+  },
+  "version": "0.1.2"
+}