From baa9601db51a3f1cdfbcb9151f0f00d2623b2d22 Mon Sep 17 00:00:00 2001 From: Hexagon Date: Sat, 2 Oct 2021 21:34:22 +0200 Subject: [PATCH] socket.io 2 -> 4, node-static replaced with serve --- README.md | 2 +- package-lock.json | 868 ++++++++++++++++++++++++++++---------- package.json | 6 +- public/js/cryptalk.min.js | 4 +- public/js/lib/host.js | 2 + server.js | 19 +- 6 files changed, 671 insertions(+), 230 deletions(-) diff --git a/README.md b/README.md index d8e21b2..e99c91f 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ npm install requirejs -g r.js -o requirejs.build.js ``` -(or in windows) +(or in windows, as you'll get a script error from the above script) ``` r.js.cmd -o requirejs.build.js diff --git a/package-lock.json b/package-lock.json index f65589f..cfa3170 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,31 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@types/component-emitter": { + "version": "1.2.10", + "resolved": "https://registry.npmjs.org/@types/component-emitter/-/component-emitter-1.2.10.tgz", + "integrity": "sha512-bsjleuRKWmGqajMerkzox19aGbscQX5rmmvvXl3wlIp5gMG1HgkiwPxsN5p070fBDKTNSPgojVbuY1+HWMbFhg==" + }, + "@types/cookie": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", + "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==" + }, + "@types/cors": { + "version": "2.8.12", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz", + "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==" + }, + "@types/node": { + "version": "16.10.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.10.2.tgz", + "integrity": "sha512-zCclL4/rx+W5SQTzFs9wyvvyCwoK9QtBpratqz2IYJ3O8Umrn0m3nsTv0wQBk9sRGpvUe9CwPDrQFB10f1FIjQ==" + }, + "@zeit/schemas": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@zeit/schemas/-/schemas-2.6.0.tgz", + "integrity": "sha512-uUrgZ8AxS+Lio0fZKAipJjAh415JyrOZowliZAzmnJSsf7piVL5w+G0+gFJ0KSu3QRhvui/7zuvpLz03YjXAhg==" + }, "accepts": { "version": "1.3.7", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", @@ -13,20 +38,52 @@ "negotiator": "0.6.2" } }, - "after": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", - "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=" + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } }, - "arraybuffer.slice": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz", - "integrity": "sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog==" + "ansi-align": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz", + "integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=", + "requires": { + "string-width": "^2.0.0" + } }, - "backo2": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "arch": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/arch/-/arch-2.2.0.tgz", + "integrity": "sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==" + }, + "arg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arg/-/arg-2.0.0.tgz", + "integrity": "sha512-XxNTUzKnz1ctK3ZIcI2XUPlD96wbHP2nGqkPKpvk/HNRlPveYrXIVSTk9m3LcqOgDPg3B1nMvdV/K8wZd7PG4w==" + }, + "balanced-match": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", - "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc=" + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "base64-arraybuffer": { "version": "0.1.4", @@ -38,289 +95,672 @@ "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==" }, - "blob": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.5.tgz", - "integrity": "sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig==" + "boxen": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz", + "integrity": "sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw==", + "requires": { + "ansi-align": "^2.0.0", + "camelcase": "^4.0.0", + "chalk": "^2.0.1", + "cli-boxes": "^1.0.0", + "string-width": "^2.0.0", + "term-size": "^1.2.0", + "widest-line": "^2.0.0" + } }, - "colors": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.3.3.tgz", - "integrity": "sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg==" + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } }, - "component-bind": { + "bytes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" + }, + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=" + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "cli-boxes": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", - "integrity": "sha1-AMYIq33Nk4l8AAllGx06jh5zu9E=" + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz", + "integrity": "sha1-T6kXw+WclKAEzWH47lCdplFocUM=" + }, + "clipboardy": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/clipboardy/-/clipboardy-2.3.0.tgz", + "integrity": "sha512-mKhiIL2DrQIsuXMgBgnfEHOZOryC7kY7YO//TN6c63wlEm3NG5tz+YgY5rVi29KCmq/QQjKYvM7a19+MDOTHOQ==", + "requires": { + "arch": "^2.1.1", + "execa": "^1.0.0", + "is-wsl": "^2.1.1" + }, + "dependencies": { + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "requires": { + "pump": "^3.0.0" + } + } + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, "component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" }, - "component-inherit": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz", - "integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM=" + "compressible": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", + "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", + "requires": { + "mime-db": ">= 1.43.0 < 2" + } + }, + "compression": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.3.tgz", + "integrity": "sha512-HSjyBG5N1Nnz7tF2+O7A9XUhyjru71/fwgNb7oIsEVHR0WShfs2tIS/EySLgiTe98aOK18YDlMXpzjCXY/n9mg==", + "requires": { + "accepts": "~1.3.5", + "bytes": "3.0.0", + "compressible": "~2.0.14", + "debug": "2.6.9", + "on-headers": "~1.0.1", + "safe-buffer": "5.1.2", + "vary": "~1.1.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "content-disposition": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" }, "cookie": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", "integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==" }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", "requires": { - "ms": "^2.1.1" + "object-assign": "^4", + "vary": "^1" + } + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "requires": { + "ms": "2.1.2" + } + }, + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "requires": { + "once": "^1.4.0" } }, "engine.io": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.5.0.tgz", - "integrity": "sha512-21HlvPUKaitDGE4GXNtQ7PLP0Sz4aWLddMPw2VTyFz1FVZqu/kZsJUO8WNpKuE/OCL7nkfRaOui2ZCJloGznGA==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-5.2.0.tgz", + "integrity": "sha512-d1DexkQx87IFr1FLuV+0f5kAm1Hk1uOVijLOb+D1sDO2QMb7YjE02VHtZtxo7xIXMgcWLb+vl3HRT0rI9tr4jQ==", "requires": { "accepts": "~1.3.4", "base64id": "2.0.0", "cookie": "~0.4.1", - "debug": "~4.1.0", - "engine.io-parser": "~2.2.0", + "cors": "~2.8.5", + "debug": "~4.3.1", + "engine.io-parser": "~4.0.0", "ws": "~7.4.2" } }, - "engine.io-client": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.5.0.tgz", - "integrity": "sha512-12wPRfMrugVw/DNyJk34GQ5vIVArEcVMXWugQGGuw2XxUSztFNmJggZmv8IZlLyEdnpO1QB9LkcjeWewO2vxtA==", + "engine.io-parser": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-4.0.3.tgz", + "integrity": "sha512-xEAAY0msNnESNPc00e19y5heTPX4y/TJ36gr8t1voOaNmTojP9b3oK3BbJLFufW2XFPQaaijpFewm2g2Um3uqA==", "requires": { - "component-emitter": "~1.3.0", - "component-inherit": "0.0.3", - "debug": "~3.1.0", - "engine.io-parser": "~2.2.0", - "has-cors": "1.1.0", - "indexof": "0.0.1", - "parseqs": "0.0.6", - "parseuri": "0.0.6", - "ws": "~7.4.2", - "xmlhttprequest-ssl": "~1.5.4", - "yeast": "0.1.2" + "base64-arraybuffer": "0.1.4" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + }, + "fast-url-parser": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/fast-url-parser/-/fast-url-parser-1.1.3.tgz", + "integrity": "sha1-9K8+qfNNiicc9YrSs3WfQx8LMY0=", + "requires": { + "punycode": "^1.3.2" }, "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" } } }, - "engine.io-parser": { + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + }, + "is-docker": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.2.1.tgz", - "integrity": "sha512-x+dN/fBH8Ro8TFwJ+rkB2AmuVw9Yu2mockR/p3W8f8YtExwFgDvBDi0GWyb4ZLkpahtDGZgtr3zLovanJghPqg==", - "requires": { - "after": "0.8.2", - "arraybuffer.slice": "~0.0.7", - "base64-arraybuffer": "0.1.4", - "blob": "0.0.5", - "has-binary2": "~1.0.2" - } + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==" }, - "has-binary2": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-binary2/-/has-binary2-1.0.3.tgz", - "integrity": "sha512-G1LWKhDSvhGeAQ8mPVQlqNcOB2sJdwATtZKl2pDKKHfpf/rYj24lkinxf69blJbnsvtqqNU+L3SL50vzZhXOnw==", - "requires": { - "isarray": "2.0.1" - } + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" }, - "has-cors": { + "is-stream": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz", - "integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk=" + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" }, - "indexof": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", - "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=" + "is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "requires": { + "is-docker": "^2.0.0" + } }, - "isarray": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", - "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=" + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, - "mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, + "lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } }, "mime-db": { - "version": "1.45.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.45.0.tgz", - "integrity": "sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w==" + "version": "1.50.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.50.0.tgz", + "integrity": "sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A==" }, "mime-types": { - "version": "2.1.28", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.28.tgz", - "integrity": "sha512-0TO2yJ5YHYr7M2zzT7gDU1tbwHxEUWBCLt0lscSNpcdAfFyJOVEpRYNS7EXVcTLNj/25QO8gulHC5JtTzSE2UQ==", + "version": "2.1.33", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.33.tgz", + "integrity": "sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g==", "requires": { - "mime-db": "1.45.0" + "mime-db": "1.50.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" } }, "minimist": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", - "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=" + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" }, "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "negotiator": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" }, - "node-static": { - "version": "0.7.11", - "resolved": "https://registry.npmjs.org/node-static/-/node-static-0.7.11.tgz", - "integrity": "sha512-zfWC/gICcqb74D9ndyvxZWaI1jzcoHmf4UTHWQchBNuNMxdBLJMDiUgZ1tjGLEIe/BMhj2DxKD8HOuc2062pDQ==", + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", "requires": { - "colors": ">=0.6.0", - "mime": "^1.2.9", - "optimist": ">=0.3.4" + "path-key": "^2.0.0" } }, - "optimist": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==" + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "requires": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" + "wrappy": "1" } }, - "parseqs": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.6.tgz", - "integrity": "sha512-jeAGzMDbfSHHA091hr0r31eYfTig+29g3GKKE/PPbEQ65X0lmMwlEoqmhzu0iztID5uJpZsFlUPDP8ThPL7M8w==" + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" }, - "parseuri": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.6.tgz", - "integrity": "sha512-AUjen8sAkGgao7UyCX6Ahv0gIK2fABKmYjvP4xmy5JaKvcbTRueIqIPHLAfq30xJddqSE033IOMUSOMCcK3Sow==" + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=" + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" + }, + "path-to-regexp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-2.2.1.tgz", + "integrity": "sha512-gu9bD6Ta5bwGrrU8muHzVOBFFREpp2iRkVfhBJahwJ6p6Xw20SjT0MxLnwkjOibQmGSYhiUnf2FLe7k+jcFmGQ==" + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "range-parser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", + "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" + }, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + } + }, + "registry-auth-token": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.3.2.tgz", + "integrity": "sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ==", + "requires": { + "rc": "^1.1.6", + "safe-buffer": "^5.0.1" + } + }, + "registry-url": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", + "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", + "requires": { + "rc": "^1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + }, + "serve": { + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/serve/-/serve-12.0.1.tgz", + "integrity": "sha512-CQ4ikLpxg/wmNM7yivulpS6fhjRiFG6OjmP8ty3/c1SBnSk23fpKmLAV4HboTA2KrZhkUPlDfjDhnRmAjQ5Phw==", + "requires": { + "@zeit/schemas": "2.6.0", + "ajv": "6.12.6", + "arg": "2.0.0", + "boxen": "1.3.0", + "chalk": "2.4.1", + "clipboardy": "2.3.0", + "compression": "1.7.3", + "serve-handler": "6.1.3", + "update-check": "1.5.2" + } + }, + "serve-handler": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/serve-handler/-/serve-handler-6.1.3.tgz", + "integrity": "sha512-FosMqFBNrLyeiIDvP1zgO6YoTzFYHxLDEIavhlmQ+knB2Z7l1t+kGLHkZIDN7UVWqQAmKI3D20A6F6jo3nDd4w==", + "requires": { + "bytes": "3.0.0", + "content-disposition": "0.5.2", + "fast-url-parser": "1.1.3", + "mime-types": "2.1.18", + "minimatch": "3.0.4", + "path-is-inside": "1.0.2", + "path-to-regexp": "2.2.1", + "range-parser": "1.2.0" + }, + "dependencies": { + "mime-db": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", + "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==" + }, + "mime-types": { + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", + "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "requires": { + "mime-db": "~1.33.0" + } + } + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + }, + "signal-exit": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz", + "integrity": "sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ==" }, "socket.io": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.4.0.tgz", - "integrity": "sha512-9UPJ1UTvKayuQfVv2IQ3k7tCQC/fboDyIK62i99dAQIyHKaBsNdTpwHLgKJ6guRWxRtC9H+138UwpaGuQO9uWQ==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.2.0.tgz", + "integrity": "sha512-sjlGfMmnaWvTRVxGRGWyhd9ctpg4APxWAxu85O/SxekkxHhfxmePWZbaYCkeX5QQX0z1YEnKOlNt6w82E4Nzug==", "requires": { - "debug": "~4.1.0", - "engine.io": "~3.5.0", - "has-binary2": "~1.0.2", - "socket.io-adapter": "~1.1.0", - "socket.io-client": "2.4.0", - "socket.io-parser": "~3.4.0" + "@types/cookie": "^0.4.1", + "@types/cors": "^2.8.12", + "@types/node": ">=10.0.0", + "accepts": "~1.3.4", + "base64id": "~2.0.0", + "debug": "~4.3.2", + "engine.io": "~5.2.0", + "socket.io-adapter": "~2.3.2", + "socket.io-parser": "~4.0.4" } }, "socket.io-adapter": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-1.1.2.tgz", - "integrity": "sha512-WzZRUj1kUjrTIrUKpZLEzFZ1OLj5FwLlAFQs9kuZJzJi5DKdU7FsWc36SNmA8iDOtwBQyT8FkrriRM8vXLYz8g==" - }, - "socket.io-client": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.4.0.tgz", - "integrity": "sha512-M6xhnKQHuuZd4Ba9vltCLT9oa+YvTsP8j9NcEiLElfIg8KeYPyhWOes6x4t+LTAC8enQbE/995AdTem2uNyKKQ==", - "requires": { - "backo2": "1.0.2", - "component-bind": "1.0.0", - "component-emitter": "~1.3.0", - "debug": "~3.1.0", - "engine.io-client": "~3.5.0", - "has-binary2": "~1.0.2", - "indexof": "0.0.1", - "parseqs": "0.0.6", - "parseuri": "0.0.6", - "socket.io-parser": "~3.3.0", - "to-array": "0.1.4" - }, - "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "socket.io-parser": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.2.tgz", - "integrity": "sha512-FJvDBuOALxdCI9qwRrO/Rfp9yfndRtc1jSgVgV8FDraihmSP/MLGD5PEuJrNfjALvcQ+vMDM/33AWOYP/JSjDg==", - "requires": { - "component-emitter": "~1.3.0", - "debug": "~3.1.0", - "isarray": "2.0.1" - } - } - } + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.3.2.tgz", + "integrity": "sha512-PBZpxUPYjmoogY0aoaTmo1643JelsaS1CiAwNjRVdrI0X9Seuc19Y2Wife8k88avW6haG8cznvwbubAZwH4Mtg==" }, "socket.io-parser": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.4.1.tgz", - "integrity": "sha512-11hMgzL+WCLWf1uFtHSNvliI++tcRUWdoeYuwIl+Axvwy9z2gQM+7nJyN3STj1tLj5JyIUH8/gpDGxzAlDdi0A==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.0.4.tgz", + "integrity": "sha512-t+b0SS+IxG7Rxzda2EVvyBZbvFPBCjJoyHuE0P//7OAsN23GItzDRdWa6ALxZI/8R5ygK7jAR6t028/z+7295g==", "requires": { - "component-emitter": "1.2.1", - "debug": "~4.1.0", - "isarray": "2.0.1" - }, - "dependencies": { - "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" - } + "@types/component-emitter": "^1.2.10", + "component-emitter": "~1.3.0", + "debug": "~4.3.1" } }, - "to-array": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz", - "integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA=" + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } }, - "wordwrap": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=" + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + }, + "term-size": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", + "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", + "requires": { + "execa": "^0.7.0" + } + }, + "update-check": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/update-check/-/update-check-1.5.2.tgz", + "integrity": "sha512-1TrmYLuLj/5ZovwUS7fFd1jMH3NnFDN1y1A8dboedIDt7zs/zJMo6TwwlhYKkSeEwzleeiSBV5/3c9ufAQWDaQ==", + "requires": { + "registry-auth-token": "3.3.2", + "registry-url": "3.1.0" + } + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "requires": { + "punycode": "^2.1.0" + } + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "requires": { + "isexe": "^2.0.0" + } + }, + "widest-line": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.1.tgz", + "integrity": "sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA==", + "requires": { + "string-width": "^2.1.1" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "ws": { "version": "7.4.6", "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==" }, - "xmlhttprequest-ssl": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz", - "integrity": "sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4=" - }, - "yeast": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", - "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=" + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" } } } diff --git a/package.json b/package.json index 7f465de..c6c5978 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cryptalk", - "version": "1.1.21", + "version": "1.2.0", "description": "Encrypted HTML5/Node.JS instant chat", "main": "server.js", "subdomain": "cryptalk", @@ -31,8 +31,8 @@ }, "bin": "./server.js", "dependencies": { - "node-static": "*", - "socket.io": "^2.2.0" + "serve": "^12.0.1", + "socket.io": "^4.2.0" }, "os": [ "darwin", diff --git a/public/js/cryptalk.min.js b/public/js/cryptalk.min.js index 476fca2..dae8df9 100644 --- a/public/js/cryptalk.min.js +++ b/public/js/cryptalk.min.js @@ -1,2 +1,2 @@ -!function(t,e){"function"==typeof define&&define.amd?define("castrato/castrato",[],e()):"object"==typeof exports?module.exports=e:t.castrato=e}(this,function(){function t(t,e,o,s){var c=[t,o,1>>2]>>>24-r%4*8&255;e[o+r>>>2]|=s<<24-(o+r)%4*8}else for(var r=0;r>>2]=n[r>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,n=this.sigBytes;e[n>>>2]&=4294967295<<32-n%4*8,e.length=t.ceil(n/4)},clone:function(){var t=r.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var n,o=[],i=function(e){var e=e,n=987654321,o=4294967295;return function(){n=36969*(65535&n)+(n>>16)&o,e=18e3*(65535&e)+(e>>16)&o;var i=(n<<16)+e&o;return i/=4294967296,i+=.5,i*(t.random()>.5?1:-1)}},r=0;r>>2]>>>24-i%4*8&255;o.push((r>>>4).toString(16)),o.push((15&r).toString(16))}return o.join("")},parse:function(t){for(var e=t.length,n=[],o=0;o>>3]|=parseInt(t.substr(o,2),16)<<24-o%8*4;return new s.init(n,e/2)}},u=c.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,o=[],i=0;i>>2]>>>24-i%4*8&255;o.push(String.fromCharCode(r))}return o.join("")},parse:function(t){for(var e=t.length,n=[],o=0;o>>2]|=(255&t.charCodeAt(o))<<24-o%4*8;return new s.init(n,e)}},f=c.Utf8={stringify:function(t){try{return decodeURIComponent(escape(u.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return u.parse(unescape(encodeURIComponent(t)))}},d=i.BufferedBlockAlgorithm=r.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=f.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var n=this._data,o=n.words,i=n.sigBytes,r=this.blockSize,c=4*r,a=i/c;a=e?t.ceil(a):t.max((0|a)-this._minBufferSize,0);var u=a*r,f=t.min(4*u,i);if(u){for(var d=0;d>>6-s%4*2;o[r>>>2]|=(c|a)<<24-r%4*8,r++}return i.create(o,r)}var n=t,o=n.lib,i=o.WordArray,r=n.enc;r.Base64={stringify:function(t){var e=t.words,n=t.sigBytes,o=this._map;t.clamp();for(var i=[],r=0;r>>2]>>>24-r%4*8&255,c=e[r+1>>>2]>>>24-(r+1)%4*8&255,a=e[r+2>>>2]>>>24-(r+2)%4*8&255,u=s<<16|c<<8|a,f=0;f<4&&r+.75*f>>6*(3-f)&63));var d=o.charAt(64);if(d)for(;i.length%4;)i.push(d);return i.join("")},parse:function(t){var n=t.length,o=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var r=0;r>>32-r)+e}function o(t,e,n,o,i,r,s){var c=t+(e&o|n&~o)+i+s;return(c<>>32-r)+e}function i(t,e,n,o,i,r,s){var c=t+(e^n^o)+i+s;return(c<>>32-r)+e}function r(t,e,n,o,i,r,s){var c=t+(n^(e|~o))+i+s;return(c<>>32-r)+e}var s=t,c=s.lib,a=c.WordArray,u=c.Hasher,f=s.algo,d=[];!function(){for(var t=0;t<64;t++)d[t]=4294967296*e.abs(e.sin(t+1))|0}();var l=f.MD5=u.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var s=0;s<16;s++){var c=e+s,a=t[c];t[c]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}var u=this._hash.words,f=t[e+0],l=t[e+1],m=t[e+2],p=t[e+3],h=t[e+4],g=t[e+5],y=t[e+6],v=t[e+7],_=t[e+8],k=t[e+9],w=t[e+10],x=t[e+11],b=t[e+12],S=t[e+13],B=t[e+14],A=t[e+15],C=u[0],j=u[1],E=u[2],H=u[3];C=n(C,j,E,H,f,7,d[0]),H=n(H,C,j,E,l,12,d[1]),E=n(E,H,C,j,m,17,d[2]),j=n(j,E,H,C,p,22,d[3]),C=n(C,j,E,H,h,7,d[4]),H=n(H,C,j,E,g,12,d[5]),E=n(E,H,C,j,y,17,d[6]),j=n(j,E,H,C,v,22,d[7]),C=n(C,j,E,H,_,7,d[8]),H=n(H,C,j,E,k,12,d[9]),E=n(E,H,C,j,w,17,d[10]),j=n(j,E,H,C,x,22,d[11]),C=n(C,j,E,H,b,7,d[12]),H=n(H,C,j,E,S,12,d[13]),E=n(E,H,C,j,B,17,d[14]),j=n(j,E,H,C,A,22,d[15]),C=o(C,j,E,H,l,5,d[16]),H=o(H,C,j,E,y,9,d[17]),E=o(E,H,C,j,x,14,d[18]),j=o(j,E,H,C,f,20,d[19]),C=o(C,j,E,H,g,5,d[20]),H=o(H,C,j,E,w,9,d[21]),E=o(E,H,C,j,A,14,d[22]),j=o(j,E,H,C,h,20,d[23]),C=o(C,j,E,H,k,5,d[24]),H=o(H,C,j,E,B,9,d[25]),E=o(E,H,C,j,p,14,d[26]),j=o(j,E,H,C,_,20,d[27]),C=o(C,j,E,H,S,5,d[28]),H=o(H,C,j,E,m,9,d[29]),E=o(E,H,C,j,v,14,d[30]),j=o(j,E,H,C,b,20,d[31]),C=i(C,j,E,H,g,4,d[32]),H=i(H,C,j,E,_,11,d[33]),E=i(E,H,C,j,x,16,d[34]),j=i(j,E,H,C,B,23,d[35]),C=i(C,j,E,H,l,4,d[36]),H=i(H,C,j,E,h,11,d[37]),E=i(E,H,C,j,v,16,d[38]),j=i(j,E,H,C,w,23,d[39]),C=i(C,j,E,H,S,4,d[40]),H=i(H,C,j,E,f,11,d[41]),E=i(E,H,C,j,p,16,d[42]),j=i(j,E,H,C,y,23,d[43]),C=i(C,j,E,H,k,4,d[44]),H=i(H,C,j,E,b,11,d[45]),E=i(E,H,C,j,A,16,d[46]),j=i(j,E,H,C,m,23,d[47]),C=r(C,j,E,H,f,6,d[48]),H=r(H,C,j,E,v,10,d[49]),E=r(E,H,C,j,B,15,d[50]),j=r(j,E,H,C,g,21,d[51]),C=r(C,j,E,H,b,6,d[52]),H=r(H,C,j,E,p,10,d[53]),E=r(E,H,C,j,w,15,d[54]),j=r(j,E,H,C,l,21,d[55]),C=r(C,j,E,H,_,6,d[56]),H=r(H,C,j,E,A,10,d[57]),E=r(E,H,C,j,y,15,d[58]),j=r(j,E,H,C,S,21,d[59]),C=r(C,j,E,H,h,6,d[60]),H=r(H,C,j,E,x,10,d[61]),E=r(E,H,C,j,m,15,d[62]),j=r(j,E,H,C,k,21,d[63]),u[0]=u[0]+C|0,u[1]=u[1]+j|0,u[2]=u[2]+E|0,u[3]=u[3]+H|0},_doFinalize:function(){var t=this._data,n=t.words,o=8*this._nDataBytes,i=8*t.sigBytes;n[i>>>5]|=128<<24-i%32;var r=e.floor(o/4294967296),s=o;n[(i+64>>>9<<4)+15]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),n[(i+64>>>9<<4)+14]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),t.sigBytes=4*(n.length+1),this._process();for(var c=this._hash,a=c.words,u=0;u<4;u++){var f=a[u];a[u]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return c},clone:function(){var t=u.clone.call(this);return t._hash=this._hash.clone(),t}});s.MD5=u._createHelper(l),s.HmacMD5=u._createHmacHelper(l)}(Math),t.MD5}),function(t,e){"object"==typeof exports?module.exports=exports=e(require("./core")):"function"==typeof define&&define.amd?define("crypto-js/sha1",["./core"],e):e(t.CryptoJS)}(this,function(t){return function(){var e=t,n=e.lib,o=n.WordArray,i=n.Hasher,r=e.algo,s=[],c=r.SHA1=i.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var n=this._hash.words,o=n[0],i=n[1],r=n[2],c=n[3],a=n[4],u=0;u<80;u++){if(u<16)s[u]=0|t[e+u];else{var f=s[u-3]^s[u-8]^s[u-14]^s[u-16];s[u]=f<<1|f>>>31}var d=(o<<5|o>>>27)+a+s[u];d+=u<20?(i&r|~i&c)+1518500249:u<40?(i^r^c)+1859775393:u<60?(i&r|i&c|r&c)-1894007588:(i^r^c)-899497514,a=c,c=r,r=i<<30|i>>>2,i=o,o=d}n[0]=n[0]+o|0,n[1]=n[1]+i|0,n[2]=n[2]+r|0,n[3]=n[3]+c|0,n[4]=n[4]+a|0},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,o=8*t.sigBytes;return e[o>>>5]|=128<<24-o%32,e[(o+64>>>9<<4)+14]=Math.floor(n/4294967296),e[(o+64>>>9<<4)+15]=n,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=i.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA1=i._createHelper(c),e.HmacSHA1=i._createHmacHelper(c)}(),t.SHA1}),function(t,e){"object"==typeof exports?module.exports=exports=e(require("./core")):"function"==typeof define&&define.amd?define("crypto-js/hmac",["./core"],e):e(t.CryptoJS)}(this,function(t){!function(){var e=t,n=e.lib,o=n.Base,i=e.enc,r=i.Utf8,s=e.algo;s.HMAC=o.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=r.parse(e));var n=t.blockSize,o=4*n;e.sigBytes>o&&(e=t.finalize(e)),e.clamp();for(var i=this._oKey=e.clone(),s=this._iKey=e.clone(),c=i.words,a=s.words,u=0;u>>2];t.sigBytes-=e}},y=(o.BlockCipher=d.extend({cfg:d.cfg.extend({mode:p,padding:g}),reset:function(){d.reset.call(this);var t=this.cfg,e=t.iv,n=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var o=n.createEncryptor;else{var o=n.createDecryptor;this._minBufferSize=1}this._mode&&this._mode.__creator==o?this._mode.init(this,e&&e.words):(this._mode=o.call(n,this,e&&e.words),this._mode.__creator=o)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);var e=this._process(!0)}else{var e=this._process(!0);t.unpad(e)}return e},blockSize:4}),o.CipherParams=i.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),v=n.format={},_=v.OpenSSL={stringify:function(t){var e=t.ciphertext,n=t.salt;if(n)var o=r.create([1398893684,1701076831]).concat(n).concat(e);else var o=e;return o.toString(a)},parse:function(t){var e=a.parse(t),n=e.words;if(1398893684==n[0]&&1701076831==n[1]){var o=r.create(n.slice(2,4));n.splice(0,4),e.sigBytes-=16}return y.create({ciphertext:e,salt:o})}},k=o.SerializableCipher=i.extend({cfg:i.extend({format:_}),encrypt:function(t,e,n,o){o=this.cfg.extend(o);var i=t.createEncryptor(n,o),r=i.finalize(e),s=i.cfg;return y.create({ciphertext:r,key:n,iv:s.iv,algorithm:t,mode:s.mode,padding:s.padding,blockSize:t.blockSize,formatter:o.format})},decrypt:function(t,e,n,o){o=this.cfg.extend(o),e=this._parse(e,o.format);var i=t.createDecryptor(n,o).finalize(e.ciphertext);return i},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),w=n.kdf={},x=w.OpenSSL={execute:function(t,e,n,o){o||(o=r.random(8));var i=f.create({keySize:e+n}).compute(t,o),s=r.create(i.words.slice(e),4*n);return i.sigBytes=4*e,y.create({key:i,iv:s,salt:o})}},b=o.PasswordBasedCipher=k.extend({cfg:k.cfg.extend({kdf:x}),encrypt:function(t,e,n,o){o=this.cfg.extend(o);var i=o.kdf.execute(n,t.keySize,t.ivSize);o.iv=i.iv;var r=k.encrypt.call(this,t,e,i.key,o);return r.mixIn(i),r},decrypt:function(t,e,n,o){o=this.cfg.extend(o),e=this._parse(e,o.format);var i=o.kdf.execute(n,t.keySize,t.ivSize,e.salt);o.iv=i.iv;var r=k.decrypt.call(this,t,e,i.key,o);return r}})}()}),function(t,e,n){"object"==typeof exports?module.exports=exports=e(require("./core"),require("./enc-base64"),require("./md5"),require("./evpkdf"),require("./cipher-core")):"function"==typeof define&&define.amd?define("crypto-js/aes",["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)}(this,function(t){return function(){var e=t,n=e.lib,o=n.BlockCipher,i=e.algo,r=[],s=[],c=[],a=[],u=[],f=[],d=[],l=[],m=[],p=[];!function(){for(var t=[],e=0;e<256;e++)e<128?t[e]=e<<1:t[e]=e<<1^283;for(var n=0,o=0,e=0;e<256;e++){var i=o^o<<1^o<<2^o<<3^o<<4;i=i>>>8^255&i^99,r[n]=i,s[i]=n;var h=t[n],g=t[h],y=t[g],v=257*t[i]^16843008*i;c[n]=v<<24|v>>>8,a[n]=v<<16|v>>>16,u[n]=v<<8|v>>>24,f[n]=v;var v=16843009*y^65537*g^257*h^16843008*n;d[i]=v<<24|v>>>8,l[i]=v<<16|v>>>16,m[i]=v<<8|v>>>24,p[i]=v,n?(n=h^t[t[t[y^h]]],o^=t[t[o]]):n=o=1}}();var h=[0,1,2,4,8,16,32,64,128,27,54],g=i.AES=o.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,n=t.sigBytes/4,o=this._nRounds=n+6,i=4*(o+1),s=this._keySchedule=[],c=0;c6&&c%n==4&&(a=r[a>>>24]<<24|r[a>>>16&255]<<16|r[a>>>8&255]<<8|r[255&a]):(a=a<<8|a>>>24,a=r[a>>>24]<<24|r[a>>>16&255]<<16|r[a>>>8&255]<<8|r[255&a],a^=h[c/n|0]<<24),s[c]=s[c-n]^a}for(var u=this._invKeySchedule=[],f=0;f>>24]]^l[r[a>>>16&255]]^m[r[a>>>8&255]]^p[r[255&a]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,c,a,u,f,r)},decryptBlock:function(t,e){var n=t[e+1];t[e+1]=t[e+3],t[e+3]=n,this._doCryptBlock(t,e,this._invKeySchedule,d,l,m,p,s);var n=t[e+1];t[e+1]=t[e+3],t[e+3]=n},_doCryptBlock:function(t,e,n,o,i,r,s,c){for(var a=this._nRounds,u=t[e]^n[0],f=t[e+1]^n[1],d=t[e+2]^n[2],l=t[e+3]^n[3],m=4,p=1;p>>24]^i[f>>>16&255]^r[d>>>8&255]^s[255&l]^n[m++],g=o[f>>>24]^i[d>>>16&255]^r[l>>>8&255]^s[255&u]^n[m++],y=o[d>>>24]^i[l>>>16&255]^r[u>>>8&255]^s[255&f]^n[m++],v=o[l>>>24]^i[u>>>16&255]^r[f>>>8&255]^s[255&d]^n[m++];u=h,f=g,d=y,l=v}var h=(c[u>>>24]<<24|c[f>>>16&255]<<16|c[d>>>8&255]<<8|c[255&l])^n[m++],g=(c[f>>>24]<<24|c[d>>>16&255]<<16|c[l>>>8&255]<<8|c[255&u])^n[m++],y=(c[d>>>24]<<24|c[l>>>16&255]<<16|c[u>>>8&255]<<8|c[255&f])^n[m++],v=(c[l>>>24]<<24|c[u>>>16&255]<<16|c[f>>>8&255]<<8|c[255&d])^n[m++];t[e]=h,t[e+1]=g,t[e+2]=y,t[e+3]=v},keySize:8});e.AES=o._createHelper(g)}(),t.AES}),function(t,e){"object"==typeof exports?module.exports=exports=e(require("./core")):"function"==typeof define&&define.amd?define("crypto-js/enc-utf8",["./core"],e):e(t.CryptoJS)}(this,function(t){return t.enc.Utf8}),define("$.utils",["websocket","crypto-js/aes","crypto-js/sha1","crypto-js/enc-utf8"],function(t,e,n,o){var i={},r=/^\d+$/;return i.io=t,i.SHA1=function(t){return n(t).toString()},i.AES={decrypt:function(t,n){return e.decrypt(t,n).toString(o)},encrypt:function(t,n){return e.encrypt(t,n).toString()}},i.ssplit=function(t,e){var n=t.split(e);return[n.shift(),n.join(e)]},i.activeElement=function(){try{return document.activeElement}catch(t){return}},i.isDigits=function(t){return r.test(t)},i.template=function(t,e){return t&&t.replace(/{(\w+)}/gi,function(t,n){return e.hasOwnProperty(n)?e[n]:t})},i.getJSON=function(t,e,n){var o=new XMLHttpRequest;o.open("GET",t,!0),o.onreadystatechange=function(){if(4===this.readyState)if(this.status>=200&&this.status<400)try{e&&e(JSON.parse(this.responseText))}catch(t){n&&n()}else n&&n()},o.send(),o=null},i.escapeHtml=function(){var t=/[&<>"'\/]/g,e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return function(n){return String(n).replace(t,function(t){return e[t]})}}(),i}),define("$.proto",[],function(){var t={};return t.html=function(t){return this.forEach(function(e){e.innerHTML=t}),this},t.append=function(t){return this.forEach(function(e){e.innerHTML+=t}),this},t.first=function(){return this[0]},t.on=function(t,e){return this.forEach(function(n){n.addEventListener?n.addEventListener(t,e,!1):n.attachEvent&&n.attachEvent("on"+t,e)}),this},t.focus=function(){return this[0]&&this[0].focus(),this},t}),define("$",["$.utils","$.proto"],function(t,e){function n(){}function o(t){var e,o=new n;if(void 0!==t)if(t===document)o.push(document);else if(t===window)o.push(window);else if(e=document.querySelectorAll(t))for(var i=0;i\n\n▄████▄ ██▀███ ▓██ ██▓ ██▓███ ▄▄▄█████▓ ▄▄▄ ██▓ ██ ▄█▀ \n▒██▀ ▀█ ▓██ ▒ ██▒▒██ ██▒▓██░ ██▒▓ ██▒ ▓▒▒████▄ ▓██▒ ██▄█▒ \n▒▓█ ▄ ▓██ ░▄█ ▒ ▒██ ██░▓██░ ██▓▒▒ ▓██░ ▒░▒██ ▀█▄ ▒██░ ▓███▄░ \n▒▓▓▄ ▄██▒▒██▀▀█▄ ░ ▐██▓░▒██▄█▓▒ ▒░ ▓██▓ ░ ░██▄▄▄▄██ ▒██░ ▓██ █▄ \n▒ ▓███▀ ░░██▓ ▒██▒ ░ ██▒▓░▒██▒ ░ ░ ▒██▒ ░ ▓█ ▓██▒░██████▒▒██▒ █▄ \n░ ░▒ ▒ ░░ ▒▓ ░▒▓░ ██▒▒▒ ▒▓▒░ ░ ░ ▒ ░░ ▒▒ ▓▒█░░ ▒░▓ ░▒ ▒▒ ▓▒ \n ░ ▒ ░▒ ░ ▒░▓██ ░▒░ ░▒ ░ ░ ▒ ▒▒ ░░ ░ ▒ ░░ ░▒ ▒░ \n░ ░░ ░ ▒ ▒ ░░ ░░ ░ ░ ▒ ░ ░ ░ ░░ ░ \n░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ \n░ ░ ░ \n https://github.com/hexagon/cryptalk \n \n Tip of the day: /help \n----------------------------------------------------------------------",nick:{maxLen:20,minLen:2},key:{maxLen:1024,minLen:8},room:{minLen:1,maxLen:64},notifications:{maxOnePerMs:3e3}}),define("templates",{help:"
                                                                \nCryptalk, encrypted instant chat.                                      \n                                                                       \n----------------------------------------------------------------------\t\n                                                                       \nClient:                                                    \t\t\t\n\t/key\t\tStrongPassphrase\tSets encryption key                 \n\t/nick\t\tNickName\t\tSets an optional nick                   \n\t/mute  \t\t\t\t\tAudio on\t\t\t\t\t\t\t\t\t\n\t/unmute  \t\t\t\tAudio off\t\t\t\t\t\t\t\t\t\n\t/clear\t\t\t\t\tClear on-screen buffer                      \n\t/help\t\t\t\t\tThis                                        \n\t/title\t\t\t\t\tSet your local page title\t\t\t\t\t\n\t/torch\t\tAfterSeconds\t\tConsole messages are torched  \t\t\n\t\t\t\t\t\tafter this amount of seconds \t\t\t\t\t\n\t\t\t\t\t\t(default 600).\t\t\t\t\t\t\t\t\t\n                                                                       \nRoom:                                                    \t\t\t\t\n\t/join\t\tRoomId\t\t\tJoin a room\t                            \n\t/leave\t\t\t\t\tLeave the room                              \n\t/count\t\t\t\t\tCount participants                          \n                                                                       \nHost:  \t\t                                                    \t\n\t/hosts\t\t\t\t\tList available hosts                   \t\t\n\t/connect\tHostIndex\t\tConnect to selected host               \t\n\t/disconnect\t\t\t\tDisconnect from host    \t\t\t        \n                                                                       \nYou can select any of the five last commands/messages with up/down key.\n                                                                       \nDue to security reasons, /key command is not saved, and command        \nhistory is  automatically cleared after one minute of inactivity.      \n                                                                       \nIt is highly recommended to use incognito mode while chatting, \nto prevent browsers from keeping history or cache.            \n                                                                       \n----------------------------------------------------------------------\t\n
",default_nick:"Anonymous",post:{motd:'
  • {text}
  • ',info:'
  • [{timestamp}] INF> {text}
  • ',server:'
  • [{timestamp}] SRV> {text}
  • ',error:'
  • [{timestamp}] ERR> {text}
  • ',message:'
  • [{timestamp}] MSG> {nick}> {text}
  • '},messages:{key_to_short:"Hmm, that's a weak key, try again...",key_to_long:"Man that's a long key. Make it a tad short, 'kay?",key_ok:"Key set, you can now start communicating.",key_no_host:"You have to connect to a host before setting the key.",join_no_host:"You have to connect to a host before joining a room.",nick_to_short:"Nickname is too short, it has to be at least {nick_minLen} characters long. Try again.",nick_to_long:"Nickname is too long, it can be at most {nick_maxLen} characters long. Try again.",nick_set:"From now on, you're referred to as '{nick}'.",msg_no_room:"You have to join a room before sending messages. See /help.",not_in_room:"You have to be in a room to count participants...",msg_no_key:"You have to set an encryption key before sending a message. See /help.",leave_from_nowhere:"How are you supposed to leave, while being nowhere?",torch_is_now:"Messages are now torched after {ttl} seconds.",torch_not_set:"Invalid torch delay entered, nothing changed. See /help.",title_set:"The title of this window is now '{title}'.",muted:"Notifications and sounds are now muted.",unmuted:"Notifications and sounds are now on.",unrecognized_command:'Unrecognized command: "{commandName}"',room_name_too_long:"Isn't that a bit long?",room_name_too_short:"Nah, too short.",joined_room:"Joined room {roomName}.",left_room:"Left room {roomName}.",already_in_room:"You are already in a room ({room}), stoopid.",unable_to_decrypt:"Unabled to decrypt received message, keys does not match.",socket_error:"A network error has occurred. A restart may be required to bring back full functionality.
    Examine the logs for more details.",connecting:"Connecting to host {host}...",connected:"A connection to the server has been established. Happy chatting!",disconnected:"Disconnected from host {host}.",already_connected:"You have to disconnect from {host} before joining another.",reconnect_no_host:"There is no host to reconnect with.",host_available:'{index}\t[AVAILABLE]\t{name}\n',host_unavailable:'{index}\t[UNAVAILABLE]\t{name}\n'},server:{person_joined:"A person joined this room.",person_left:"A person left this room.",person_count:"There is {payload} person(s) in this room, including you.",command_failed:"Server command failed, you're probably trying to du something bogus.",bogus:"Received a bogus message from server."},client:{title:"Cryptalk - Offline"}}),define("hosts",{autoconnect:0,hosts:[{name:"default",host:"",path:"/js/lib/settings.js"}]}),define("window",["castrato"],function(t){var e={},n=function(){t.emit("window:focused")},o=function(){t.emit("window:blurred")};return e.setTitle=function(t){document.title=t},e.getTitle=function(){return document.title},window.addEventListener?(window.addEventListener("focus",n,!0),window.addEventListener("blur",o,!0)):(window.observe("focusin",n),window.observe("focusout",o)),t.on("window:title",e.setTitle),e}),define("host",["$","castrato","settings","templates","hosts","window"],function(t,e,n,o,i){var r,s,c={},a=function(t){r&&r.emit(t.data,t.payload)},u=function(){e.emit("info",JSON.stringify(s||{}))},f=function(n,r){var s,c=0,a=i.hosts.length,u="\n",f=function(n,i,s){return function(c){n.settings=s?c:0,u+=t.template(o.messages[s?"host_available":"host_unavailable"],{name:n.name,path:n.path,index:i}),0===--a&&(e.emit("console:info",u),r())}};for(n=n&&"force"===n.toLowerCase();s=i.hosts[c];)n||void 0===s.settings?require([s.path],f(s,c,1),f(s,c,0)):s.settings?f(s,c,1)():f(s,c,0)(),c++},d=function(a,u){e.emit("console:lockInput");var f;if(a=void 0===a?i.autoconnect:a,s&&s.connected)return e.emit("console:error",t.template(o.messages.already_connected,{host:s.name||"localhost"})),void e.emit("console:unlockInput");if(t.isDigits(a)){if(!(s=i.hosts[+a]))return e.emit("console:error","Undefined host index: "+a),void e.emit("console:unlockInput");s.settings?n=s.settings:f=s.path}else a?f=a.settings:n=a.settings;return f?require([f],function(t){return s.settings=t,d(a,u)},function(){e.emit("console:error","Could not fetch host settings: "+f),e.emit("console:unlockInput")}):(e.emit("console:info",t.template(o.messages.connecting,{host:s.name||"localhost"})),e.emit("console:motd",s.settings.motd),r=t.io(s.host,{forceNew:!0,"force new connection":!0}),void r.on("room:joined",function(){e.emit("console:info",t.template(o.messages.joined_room,{roomName:t.escapeHtml(c.room)})),r.emit("room:count")}).on("room:left",function(){e.emit("console:info",t.template(o.messages.left_room,{roomName:t.escapeHtml(c.room)})),e.emit("room:changed",!1)}).on("message:send",function(n){var i=t.AES.decrypt(n.msg,t.SHA1(c.room)+c.key),r=t.escapeHtml(i),s=n.nick?t.escapeHtml(t.AES.decrypt(n.nick,t.SHA1(c.room)+c.key)):o.default_nick;i?e.emit("console:message",{message:r,nick:s}):e.emit("console:error",o.messages.unable_to_decrypt)}).on("message:server",function(n){if(n.msg){var i=t.escapeHtml(n.msg);if(o.server[i])if(void 0!==n.payload){var r=t.escapeHtml(n.payload);e.emit("console:server",t.template(o.server[i],{payload:r}))}else e.emit("console:server",o.server[i]);else e.emit("console:error",o.server.bogus)}else e.emit("console:error",o.server.bogus)}).on("connect",function(){e.emit("console:info",t.template(o.messages.connected,{host:s.name||"localhost"})),e.emit("window:title",s.settings.title),e.emit("console:unlockInput"),u(),s.connected=1}).on("disconnect",function(){s.connected=0,e.emit("console:info",t.template(o.messages.disconnected,{host:s.name||"localhost"})),e.emit("room:changed",void 0),e.emit("window:title",o.client.title)}).on("connect_error",function(){s.connected=0,e.emit("console:error",o.messages.socket_error),e.emit("console:unlockInput")}))},l=function(t,n){return s?void(s.connected?(m(),d(s,n)):d(s,n)):(n(),e.emit("console:error",o.messages.reconnect_no_host))},m=function(){r.disconnect()},p=function(t){c=Object.assign({},c,t)};e.on("command:host",u),e.on("command:hosts",f),e.on("command:connect",d),e.on("command:disconnect",m),e.on("command:reconnect",l),e.on("socket:emit",a),e.on("host:param",p)}),define("client",["$","castrato","settings","templates"],function(t,e,n,o){var i,r,s=function(t){return t.length>n.key.maxLen?e.emit("console:error",o.messages.key_to_long):t.lengthn.nick.maxLen?e("console:error",t.template(o.messages.nick_to_long,{nick_maxLen:n.nick.maxLen})):r.length=n.room.maxLen?e.emit("console:error",t.template(o.messages.room_name_too_long)):r.lengthn.notifications.maxOnePerMs)if(void 0===i&&(i=!1),u&&"granted"===Notification.permission){var r=new Notification(t,{body:e,icon:o});r.onshow=function(){setTimeout(function(){r.close()},3e3)},c=f()}else i&&g("Attention",1e3)};u=void 0!==window.Notification,t.on("notification:send",function(t){y(t.title,t.body,t.icon,!0)}),t.on("notification:on",function(){d()}),t.on("notification:off",function(){l()}),h(),l(),c=f(),m()}),define("queue",[],function(){var t={},e=[],n=function(){return performance.now()||Date.now()};return t.add_function_delayed=function(t,o,i){e.push({func:o,pushed:n(),delay:t,data:i})},t.get=function(){return e},t.run=function(){for(var o,i,r=0;o=e[r++];)n()-o.pushed>o.delay&&(o.func(),e.splice(r-1,1));if(e.length){for(i=n();n()-i<1;);t.run()}},t}),define("audio",["queue","castrato","templates"],function(t,e,n){var o=!1,i=!0,r=!1,s=function(e,n){if(n=void 0===n?0:n,o&&i&&n0&&i<3600?(e.emit("console:info",t.template(o.messages.torch_is_now,{ttl:i})),n.ttl=1e3*i):e.emit("console:error",t.template(o.messages.torch_not_set))},param:function(t){s=Object.assign({},s,t)},showNotification:function(t,n,o){var r="message"!==t?"Cryptalk":n,s="message"===t?"gfx/icon_128x128.png":"error"===t?"gfx/icon_128x128_error.png":"gfx/icon_128x128_info.png";e.emit("notification:send",{title:r.substring(0,20),body:o.substring(0,80),icon:s}),"message"===t&&e.emit("audio:play",i.message)},motd:function(t){c.post("motd",t)},info:function(t){c.post("info",t)},error:function(t){c.post("error",t)},server:function(t){c.post("server",t)},message:function(t){c.post("message",t.message,t.nick)},clearInput:function(){r.input[0].value=""},clear:function(){r.chat[0].innerHTML=""},lockInput:function(){r.input[0].setAttribute("disabled","disabled"),r.inputWrapper[0].className="loading"},unlockInput:function(){r.input[0].removeAttribute("disabled"),r.inputWrapper[0].className="",r.input.focus()},_require:function(t,e){c.lockInput(),c.post("info","Requiring "+t+"..."),require([t],function(){c.post("info","Successfully required "+t+"."),c.unlockInput(),e()},function(n){c.post("error",'An error occurred while trying to load "'+t+'":\n'+n),c.unlockInput(),e()})}},a=function(n){var i,a,u,f;if(!n.ctrlKey&&!n.altKey&&r.input[0]!==t.activeElement())return r.input.focus();if(13===n.keyCode&&(i=r.input[0].value))if("/"===(i[0]||i.slice(0,1)))a=t.ssplit(i.slice(1)," "),f=a[0],u=a[1],e.emit("command:"+f,u,function(e,n){return n?void c.clearInput():c.post("error",t.template(o.messages.unrecognized_command,{commandName:f}))});else{if(!s.room||!s.key)return s.room?c.post("error",o.messages.msg_no_key):c.post("error",o.messages.msg_no_room);e.emit("socket:emit",{data:"message:send",payload:{room:t.SHA1(s.room),msg:t.AES.encrypt(i,t.SHA1(s.room)+s.key).toString(),nick:!!s.nick&&t.AES.encrypt(s.nick,t.SHA1(s.room)+s.key).toString()}}),c.clearInput()}};t(document).on("keydown",a),r.input.focus();for(var u in c)"_require"!==u&&"post"!==u&&e.on("console:"+u,c[u]);e.on("console:require",c._require),e.on("console:post",function(t){c.post(t.type,t.data,t.nick)})}),define("cryptalk",["castrato","host","client","console"],function(t){t.on("window:focused",function(){t.emit("audio:off"),t.emit("notification:off")}).on("window:blurred",function(){t.emit("audio:on"),t.emit("notification:on")}).on("command:mute",function(){t.emit("audio:mute")}).on("command:unmute",function(){t.emit("audio:unmute")}).on("room:changed",function(e){t.emit("console:param",{room:e}).emit("host:param",{room:e})}).on("nick:changed",function(e){t.emit("console:param",{nick:e})}).on("key:changed",function(e){t.emit("console:param",{key:e}).emit("host:param",{key:e})}).emit("command:connect",void 0,function(){(hash=window.location.hash)&&(parts=hash.slice(1).split(":"),parts[0]&&t.emit("command:join",parts[0]),parts[1]&&t.emit("command:key",parts[1]))})}),require.config({baseUrl:"js/lib/",paths:{websocket:"/socket.io/socket.io"},packages:[{name:"crypto-js",location:"../vendor/crypto-js-3.1.9",main:"index"},{name:"castrato",location:"../vendor/castrato",main:"castrato"}]}),require(["cryptalk"]),define("main",function(){}); \ No newline at end of file +!function(t,e){"function"==typeof define&&define.amd?define("castrato/castrato",[],e()):"object"==typeof exports?module.exports=e:t.castrato=e}(this,function(){function t(t,e,o,s){var c=[t,o,1>>2]>>>24-r%4*8&255;e[o+r>>>2]|=s<<24-(o+r)%4*8}else for(var r=0;r>>2]=n[r>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,n=this.sigBytes;e[n>>>2]&=4294967295<<32-n%4*8,e.length=t.ceil(n/4)},clone:function(){var t=r.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var n,o=[],i=0;i>16)&o,e=18e3*(65535&e)+(e>>16)&o;var i=(n<<16)+e&o;return i/=4294967296,(i+=.5)*(t.random()>.5?1:-1)}}(4294967296*(n||t.random()));n=987654071*r(),o.push(4294967296*r()|0)}return new s.init(o,e)}}),c=o.enc={},a=c.Hex={stringify:function(t){for(var e=t.words,n=t.sigBytes,o=[],i=0;i>>2]>>>24-i%4*8&255;o.push((r>>>4).toString(16)),o.push((15&r).toString(16))}return o.join("")},parse:function(t){for(var e=t.length,n=[],o=0;o>>3]|=parseInt(t.substr(o,2),16)<<24-o%8*4;return new s.init(n,e/2)}},u=c.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,o=[],i=0;i>>2]>>>24-i%4*8&255;o.push(String.fromCharCode(r))}return o.join("")},parse:function(t){for(var e=t.length,n=[],o=0;o>>2]|=(255&t.charCodeAt(o))<<24-o%4*8;return new s.init(n,e)}},f=c.Utf8={stringify:function(t){try{return decodeURIComponent(escape(u.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return u.parse(unescape(encodeURIComponent(t)))}},d=i.BufferedBlockAlgorithm=r.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=f.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var n=this._data,o=n.words,i=n.sigBytes,r=this.blockSize,c=4*r,a=i/c;a=e?t.ceil(a):t.max((0|a)-this._minBufferSize,0);var u=a*r,f=t.min(4*u,i);if(u){for(var d=0;d>>6-s%4*2;o[r>>>2]|=(c|a)<<24-r%4*8,r++}return i.create(o,r)}var n=t,o=n.lib,i=o.WordArray,r=n.enc;r.Base64={stringify:function(t){var e=t.words,n=t.sigBytes,o=this._map;t.clamp();for(var i=[],r=0;r>>2]>>>24-r%4*8&255,c=e[r+1>>>2]>>>24-(r+1)%4*8&255,a=e[r+2>>>2]>>>24-(r+2)%4*8&255,u=s<<16|c<<8|a,f=0;f<4&&r+.75*f>>6*(3-f)&63));var d=o.charAt(64);if(d)for(;i.length%4;)i.push(d);return i.join("")},parse:function(t){var n=t.length,o=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var r=0;r>>32-r)+e}function o(t,e,n,o,i,r,s){var c=t+(e&o|n&~o)+i+s;return(c<>>32-r)+e}function i(t,e,n,o,i,r,s){var c=t+(e^n^o)+i+s;return(c<>>32-r)+e}function r(t,e,n,o,i,r,s){var c=t+(n^(e|~o))+i+s;return(c<>>32-r)+e}var s=t,c=s.lib,a=c.WordArray,u=c.Hasher,f=s.algo,d=[];!function(){for(var t=0;t<64;t++)d[t]=4294967296*e.abs(e.sin(t+1))|0}();var l=f.MD5=u.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var s=0;s<16;s++){var c=e+s,a=t[c];t[c]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}var u=this._hash.words,f=t[e+0],l=t[e+1],m=t[e+2],p=t[e+3],h=t[e+4],g=t[e+5],y=t[e+6],v=t[e+7],_=t[e+8],k=t[e+9],w=t[e+10],x=t[e+11],b=t[e+12],S=t[e+13],B=t[e+14],A=t[e+15],C=u[0],j=u[1],E=u[2],H=u[3];C=n(C,j,E,H,f,7,d[0]),H=n(H,C,j,E,l,12,d[1]),E=n(E,H,C,j,m,17,d[2]),j=n(j,E,H,C,p,22,d[3]),C=n(C,j,E,H,h,7,d[4]),H=n(H,C,j,E,g,12,d[5]),E=n(E,H,C,j,y,17,d[6]),j=n(j,E,H,C,v,22,d[7]),C=n(C,j,E,H,_,7,d[8]),H=n(H,C,j,E,k,12,d[9]),E=n(E,H,C,j,w,17,d[10]),j=n(j,E,H,C,x,22,d[11]),C=n(C,j,E,H,b,7,d[12]),H=n(H,C,j,E,S,12,d[13]),E=n(E,H,C,j,B,17,d[14]),j=n(j,E,H,C,A,22,d[15]),C=o(C,j,E,H,l,5,d[16]),H=o(H,C,j,E,y,9,d[17]),E=o(E,H,C,j,x,14,d[18]),j=o(j,E,H,C,f,20,d[19]),C=o(C,j,E,H,g,5,d[20]),H=o(H,C,j,E,w,9,d[21]),E=o(E,H,C,j,A,14,d[22]),j=o(j,E,H,C,h,20,d[23]),C=o(C,j,E,H,k,5,d[24]),H=o(H,C,j,E,B,9,d[25]),E=o(E,H,C,j,p,14,d[26]),j=o(j,E,H,C,_,20,d[27]),C=o(C,j,E,H,S,5,d[28]),H=o(H,C,j,E,m,9,d[29]),E=o(E,H,C,j,v,14,d[30]),j=o(j,E,H,C,b,20,d[31]),C=i(C,j,E,H,g,4,d[32]),H=i(H,C,j,E,_,11,d[33]),E=i(E,H,C,j,x,16,d[34]),j=i(j,E,H,C,B,23,d[35]),C=i(C,j,E,H,l,4,d[36]),H=i(H,C,j,E,h,11,d[37]),E=i(E,H,C,j,v,16,d[38]),j=i(j,E,H,C,w,23,d[39]),C=i(C,j,E,H,S,4,d[40]),H=i(H,C,j,E,f,11,d[41]),E=i(E,H,C,j,p,16,d[42]),j=i(j,E,H,C,y,23,d[43]),C=i(C,j,E,H,k,4,d[44]),H=i(H,C,j,E,b,11,d[45]),E=i(E,H,C,j,A,16,d[46]),j=i(j,E,H,C,m,23,d[47]),C=r(C,j,E,H,f,6,d[48]),H=r(H,C,j,E,v,10,d[49]),E=r(E,H,C,j,B,15,d[50]),j=r(j,E,H,C,g,21,d[51]),C=r(C,j,E,H,b,6,d[52]),H=r(H,C,j,E,p,10,d[53]),E=r(E,H,C,j,w,15,d[54]),j=r(j,E,H,C,l,21,d[55]),C=r(C,j,E,H,_,6,d[56]),H=r(H,C,j,E,A,10,d[57]),E=r(E,H,C,j,y,15,d[58]),j=r(j,E,H,C,S,21,d[59]),C=r(C,j,E,H,h,6,d[60]),H=r(H,C,j,E,x,10,d[61]),E=r(E,H,C,j,m,15,d[62]),j=r(j,E,H,C,k,21,d[63]),u[0]=u[0]+C|0,u[1]=u[1]+j|0,u[2]=u[2]+E|0,u[3]=u[3]+H|0},_doFinalize:function(){var t=this._data,n=t.words,o=8*this._nDataBytes,i=8*t.sigBytes;n[i>>>5]|=128<<24-i%32;var r=e.floor(o/4294967296),s=o;n[15+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),n[14+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),t.sigBytes=4*(n.length+1),this._process();for(var c=this._hash,a=c.words,u=0;u<4;u++){var f=a[u];a[u]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return c},clone:function(){var t=u.clone.call(this);return t._hash=this._hash.clone(),t}});s.MD5=u._createHelper(l),s.HmacMD5=u._createHmacHelper(l)}(Math),t.MD5}),function(t,e){"object"==typeof exports?module.exports=exports=e(require("./core")):"function"==typeof define&&define.amd?define("crypto-js/sha1",["./core"],e):e(t.CryptoJS)}(this,function(t){return function(){var e=t,n=e.lib,o=n.WordArray,i=n.Hasher,r=e.algo,s=[],c=r.SHA1=i.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var n=this._hash.words,o=n[0],i=n[1],r=n[2],c=n[3],a=n[4],u=0;u<80;u++){if(u<16)s[u]=0|t[e+u];else{var f=s[u-3]^s[u-8]^s[u-14]^s[u-16];s[u]=f<<1|f>>>31}var d=(o<<5|o>>>27)+a+s[u];d+=u<20?1518500249+(i&r|~i&c):u<40?1859775393+(i^r^c):u<60?(i&r|i&c|r&c)-1894007588:(i^r^c)-899497514,a=c,c=r,r=i<<30|i>>>2,i=o,o=d}n[0]=n[0]+o|0,n[1]=n[1]+i|0,n[2]=n[2]+r|0,n[3]=n[3]+c|0,n[4]=n[4]+a|0},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,o=8*t.sigBytes;return e[o>>>5]|=128<<24-o%32,e[14+(o+64>>>9<<4)]=Math.floor(n/4294967296),e[15+(o+64>>>9<<4)]=n,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=i.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA1=i._createHelper(c),e.HmacSHA1=i._createHmacHelper(c)}(),t.SHA1}),function(t,e){"object"==typeof exports?module.exports=exports=e(require("./core")):"function"==typeof define&&define.amd?define("crypto-js/hmac",["./core"],e):e(t.CryptoJS)}(this,function(t){!function(){var e=t,n=e.lib,o=n.Base,i=e.enc,r=i.Utf8,s=e.algo;s.HMAC=o.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=r.parse(e));var n=t.blockSize,o=4*n;e.sigBytes>o&&(e=t.finalize(e)),e.clamp();for(var i=this._oKey=e.clone(),s=this._iKey=e.clone(),c=i.words,a=s.words,u=0;u>>2];t.sigBytes-=e}},y=(o.BlockCipher=d.extend({cfg:d.cfg.extend({mode:p,padding:g}),reset:function(){d.reset.call(this);var t=this.cfg,e=t.iv,n=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var o=n.createEncryptor;else{var o=n.createDecryptor;this._minBufferSize=1}this._mode&&this._mode.__creator==o?this._mode.init(this,e&&e.words):(this._mode=o.call(n,this,e&&e.words),this._mode.__creator=o)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);var e=this._process(!0)}else{var e=this._process(!0);t.unpad(e)}return e},blockSize:4}),o.CipherParams=i.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),v=n.format={},_=v.OpenSSL={stringify:function(t){var e=t.ciphertext,n=t.salt;if(n)var o=r.create([1398893684,1701076831]).concat(n).concat(e);else var o=e;return o.toString(a)},parse:function(t){var e=a.parse(t),n=e.words;if(1398893684==n[0]&&1701076831==n[1]){var o=r.create(n.slice(2,4));n.splice(0,4),e.sigBytes-=16}return y.create({ciphertext:e,salt:o})}},k=o.SerializableCipher=i.extend({cfg:i.extend({format:_}),encrypt:function(t,e,n,o){o=this.cfg.extend(o);var i=t.createEncryptor(n,o),r=i.finalize(e),s=i.cfg;return y.create({ciphertext:r,key:n,iv:s.iv,algorithm:t,mode:s.mode,padding:s.padding,blockSize:t.blockSize,formatter:o.format})},decrypt:function(t,e,n,o){return o=this.cfg.extend(o),e=this._parse(e,o.format),t.createDecryptor(n,o).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),w=n.kdf={},x=w.OpenSSL={execute:function(t,e,n,o){o||(o=r.random(8));var i=f.create({keySize:e+n}).compute(t,o),s=r.create(i.words.slice(e),4*n);return i.sigBytes=4*e,y.create({key:i,iv:s,salt:o})}},b=o.PasswordBasedCipher=k.extend({cfg:k.cfg.extend({kdf:x}),encrypt:function(t,e,n,o){o=this.cfg.extend(o);var i=o.kdf.execute(n,t.keySize,t.ivSize);o.iv=i.iv;var r=k.encrypt.call(this,t,e,i.key,o);return r.mixIn(i),r},decrypt:function(t,e,n,o){o=this.cfg.extend(o),e=this._parse(e,o.format);var i=o.kdf.execute(n,t.keySize,t.ivSize,e.salt);return o.iv=i.iv,k.decrypt.call(this,t,e,i.key,o)}})}()}),function(t,e,n){"object"==typeof exports?module.exports=exports=e(require("./core"),require("./enc-base64"),require("./md5"),require("./evpkdf"),require("./cipher-core")):"function"==typeof define&&define.amd?define("crypto-js/aes",["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)}(this,function(t){return function(){var e=t,n=e.lib,o=n.BlockCipher,i=e.algo,r=[],s=[],c=[],a=[],u=[],f=[],d=[],l=[],m=[],p=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var n=0,o=0,e=0;e<256;e++){var i=o^o<<1^o<<2^o<<3^o<<4;i=i>>>8^255&i^99,r[n]=i,s[i]=n;var h=t[n],g=t[h],y=t[g],v=257*t[i]^16843008*i;c[n]=v<<24|v>>>8,a[n]=v<<16|v>>>16,u[n]=v<<8|v>>>24,f[n]=v;var v=16843009*y^65537*g^257*h^16843008*n;d[i]=v<<24|v>>>8,l[i]=v<<16|v>>>16,m[i]=v<<8|v>>>24,p[i]=v,n?(n=h^t[t[t[y^h]]],o^=t[t[o]]):n=o=1}}();var h=[0,1,2,4,8,16,32,64,128,27,54],g=i.AES=o.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,n=t.sigBytes/4,o=this._nRounds=n+6,i=4*(o+1),s=this._keySchedule=[],c=0;c6&&c%n==4&&(a=r[a>>>24]<<24|r[a>>>16&255]<<16|r[a>>>8&255]<<8|r[255&a]):(a=a<<8|a>>>24,a=r[a>>>24]<<24|r[a>>>16&255]<<16|r[a>>>8&255]<<8|r[255&a],a^=h[c/n|0]<<24),s[c]=s[c-n]^a}for(var u=this._invKeySchedule=[],f=0;f>>24]]^l[r[a>>>16&255]]^m[r[a>>>8&255]]^p[r[255&a]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,c,a,u,f,r)},decryptBlock:function(t,e){var n=t[e+1];t[e+1]=t[e+3],t[e+3]=n,this._doCryptBlock(t,e,this._invKeySchedule,d,l,m,p,s);var n=t[e+1];t[e+1]=t[e+3],t[e+3]=n},_doCryptBlock:function(t,e,n,o,i,r,s,c){for(var a=this._nRounds,u=t[e]^n[0],f=t[e+1]^n[1],d=t[e+2]^n[2],l=t[e+3]^n[3],m=4,p=1;p>>24]^i[f>>>16&255]^r[d>>>8&255]^s[255&l]^n[m++],g=o[f>>>24]^i[d>>>16&255]^r[l>>>8&255]^s[255&u]^n[m++],y=o[d>>>24]^i[l>>>16&255]^r[u>>>8&255]^s[255&f]^n[m++],v=o[l>>>24]^i[u>>>16&255]^r[f>>>8&255]^s[255&d]^n[m++];u=h,f=g,d=y,l=v}var h=(c[u>>>24]<<24|c[f>>>16&255]<<16|c[d>>>8&255]<<8|c[255&l])^n[m++],g=(c[f>>>24]<<24|c[d>>>16&255]<<16|c[l>>>8&255]<<8|c[255&u])^n[m++],y=(c[d>>>24]<<24|c[l>>>16&255]<<16|c[u>>>8&255]<<8|c[255&f])^n[m++],v=(c[l>>>24]<<24|c[u>>>16&255]<<16|c[f>>>8&255]<<8|c[255&d])^n[m++];t[e]=h,t[e+1]=g,t[e+2]=y,t[e+3]=v},keySize:8});e.AES=o._createHelper(g)}(),t.AES}),function(t,e){"object"==typeof exports?module.exports=exports=e(require("./core")):"function"==typeof define&&define.amd?define("crypto-js/enc-utf8",["./core"],e):e(t.CryptoJS)}(this,function(t){return t.enc.Utf8}),define("$.utils",["websocket","crypto-js/aes","crypto-js/sha1","crypto-js/enc-utf8"],function(t,e,n,o){var i={},r=/^\d+$/;return i.io=t,i.SHA1=function(t){return n(t).toString()},i.AES={decrypt:function(t,n){return e.decrypt(t,n).toString(o)},encrypt:function(t,n){return e.encrypt(t,n).toString()}},i.ssplit=function(t,e){var n=t.split(e);return[n.shift(),n.join(e)]},i.activeElement=function(){try{return document.activeElement}catch(t){return}},i.isDigits=function(t){return r.test(t)},i.template=function(t,e){return t&&t.replace(/{(\w+)}/gi,function(t,n){return e.hasOwnProperty(n)?e[n]:t})},i.getJSON=function(t,e,n){var o=new XMLHttpRequest;o.open("GET",t,!0),o.onreadystatechange=function(){if(4===this.readyState)if(this.status>=200&&this.status<400)try{e&&e(JSON.parse(this.responseText))}catch(t){n&&n()}else n&&n()},o.send(),o=null},i.escapeHtml=function(){var t=/[&<>"'\/]/g,e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return function(n){return String(n).replace(t,function(t){return e[t]})}}(),i}),define("$.proto",[],function(){var t={};return t.html=function(t){return this.forEach(function(e){e.innerHTML=t}),this},t.append=function(t){return this.forEach(function(e){e.innerHTML+=t}),this},t.first=function(){return this[0]},t.on=function(t,e){return this.forEach(function(n){n.addEventListener?n.addEventListener(t,e,!1):n.attachEvent&&n.attachEvent("on"+t,e)}),this},t.focus=function(){return this[0]&&this[0].focus(),this},t}),define("$",["$.utils","$.proto"],function(t,e){function n(){}function o(t){var e,o=new n;if(void 0!==t)if(t===document)o.push(document);else if(t===window)o.push(window);else if(e=document.querySelectorAll(t))for(var i=0;i\n\n▄████▄ ██▀███ ▓██ ██▓ ██▓███ ▄▄▄█████▓ ▄▄▄ ██▓ ██ ▄█▀ \n▒██▀ ▀█ ▓██ ▒ ██▒▒██ ██▒▓██░ ██▒▓ ██▒ ▓▒▒████▄ ▓██▒ ██▄█▒ \n▒▓█ ▄ ▓██ ░▄█ ▒ ▒██ ██░▓██░ ██▓▒▒ ▓██░ ▒░▒██ ▀█▄ ▒██░ ▓███▄░ \n▒▓▓▄ ▄██▒▒██▀▀█▄ ░ ▐██▓░▒██▄█▓▒ ▒░ ▓██▓ ░ ░██▄▄▄▄██ ▒██░ ▓██ █▄ \n▒ ▓███▀ ░░██▓ ▒██▒ ░ ██▒▓░▒██▒ ░ ░ ▒██▒ ░ ▓█ ▓██▒░██████▒▒██▒ █▄ \n░ ░▒ ▒ ░░ ▒▓ ░▒▓░ ██▒▒▒ ▒▓▒░ ░ ░ ▒ ░░ ▒▒ ▓▒█░░ ▒░▓ ░▒ ▒▒ ▓▒ \n ░ ▒ ░▒ ░ ▒░▓██ ░▒░ ░▒ ░ ░ ▒ ▒▒ ░░ ░ ▒ ░░ ░▒ ▒░ \n░ ░░ ░ ▒ ▒ ░░ ░░ ░ ░ ▒ ░ ░ ░ ░░ ░ \n░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ \n░ ░ ░ \n https://github.com/hexagon/cryptalk \n \n Tip of the day: /help \n----------------------------------------------------------------------",nick:{maxLen:20,minLen:2},key:{maxLen:1024,minLen:8},room:{minLen:1,maxLen:64},notifications:{maxOnePerMs:3e3}}),define("templates",{help:"
                                                                    \nCryptalk, encrypted instant chat.                                      \n                                                                       \n----------------------------------------------------------------------\t\n                                                                       \nClient:                                                    \t\t\t\n\t/key\t\tStrongPassphrase\tSets encryption key                 \n\t/nick\t\tNickName\t\tSets an optional nick                   \n\t/mute  \t\t\t\t\tAudio on\t\t\t\t\t\t\t\t\t\n\t/unmute  \t\t\t\tAudio off\t\t\t\t\t\t\t\t\t\n\t/clear\t\t\t\t\tClear on-screen buffer                      \n\t/help\t\t\t\t\tThis                                        \n\t/title\t\t\t\t\tSet your local page title\t\t\t\t\t\n\t/torch\t\tAfterSeconds\t\tConsole messages are torched  \t\t\n\t\t\t\t\t\tafter this amount of seconds \t\t\t\t\t\n\t\t\t\t\t\t(default 600).\t\t\t\t\t\t\t\t\t\n                                                                       \nRoom:                                                    \t\t\t\t\n\t/join\t\tRoomId\t\t\tJoin a room\t                            \n\t/leave\t\t\t\t\tLeave the room                              \n\t/count\t\t\t\t\tCount participants                          \n                                                                       \nHost:  \t\t                                                    \t\n\t/hosts\t\t\t\t\tList available hosts                   \t\t\n\t/connect\tHostIndex\t\tConnect to selected host               \t\n\t/disconnect\t\t\t\tDisconnect from host    \t\t\t        \n                                                                       \nYou can select any of the five last commands/messages with up/down key.\n                                                                       \nDue to security reasons, /key command is not saved, and command        \nhistory is  automatically cleared after one minute of inactivity.      \n                                                                       \nIt is highly recommended to use incognito mode while chatting, \nto prevent browsers from keeping history or cache.            \n                                                                       \n----------------------------------------------------------------------\t\n
    ",default_nick:"Anonymous",post:{motd:'
  • {text}
  • ',info:'
  • [{timestamp}] INF> {text}
  • ',server:'
  • [{timestamp}] SRV> {text}
  • ',error:'
  • [{timestamp}] ERR> {text}
  • ',message:'
  • [{timestamp}] MSG> {nick}> {text}
  • '},messages:{key_to_short:"Hmm, that's a weak key, try again...",key_to_long:"Man that's a long key. Make it a tad short, 'kay?",key_ok:"Key set, you can now start communicating.",key_no_host:"You have to connect to a host before setting the key.",join_no_host:"You have to connect to a host before joining a room.",nick_to_short:"Nickname is too short, it has to be at least {nick_minLen} characters long. Try again.",nick_to_long:"Nickname is too long, it can be at most {nick_maxLen} characters long. Try again.",nick_set:"From now on, you're referred to as '{nick}'.",msg_no_room:"You have to join a room before sending messages. See /help.",not_in_room:"You have to be in a room to count participants...",msg_no_key:"You have to set an encryption key before sending a message. See /help.",leave_from_nowhere:"How are you supposed to leave, while being nowhere?",torch_is_now:"Messages are now torched after {ttl} seconds.",torch_not_set:"Invalid torch delay entered, nothing changed. See /help.",title_set:"The title of this window is now '{title}'.",muted:"Notifications and sounds are now muted.",unmuted:"Notifications and sounds are now on.",unrecognized_command:'Unrecognized command: "{commandName}"',room_name_too_long:"Isn't that a bit long?",room_name_too_short:"Nah, too short.",joined_room:"Joined room {roomName}.",left_room:"Left room {roomName}.",already_in_room:"You are already in a room ({room}), stoopid.",unable_to_decrypt:"Unabled to decrypt received message, keys does not match.",socket_error:"A network error has occurred. A restart may be required to bring back full functionality.
    Examine the logs for more details.",connecting:"Connecting to host {host}...",connected:"A connection to the server has been established. Happy chatting!",disconnected:"Disconnected from host {host}.",already_connected:"You have to disconnect from {host} before joining another.",reconnect_no_host:"There is no host to reconnect with.",host_available:'{index}\t[AVAILABLE]\t{name}\n',host_unavailable:'{index}\t[UNAVAILABLE]\t{name}\n'},server:{person_joined:"A person joined this room.",person_left:"A person left this room.",person_count:"There are {payload} people in this room, including you.",person_single:"You are the only person in this room.",command_failed:"Server command failed, you're probably trying to du something bogus.",bogus:"Received a bogus message from server."},client:{title:"Cryptalk - Offline"}}),define("hosts",{autoconnect:0,hosts:[{name:"default",host:"",path:"/js/lib/settings.js"}]}),define("window",["castrato"],function(t){var e={},n=function(){t.emit("window:focused")},o=function(){t.emit("window:blurred")};return e.setTitle=function(t){document.title=t},e.getTitle=function(){return document.title},window.addEventListener?(window.addEventListener("focus",n,!0),window.addEventListener("blur",o,!0)):(window.observe("focusin",n),window.observe("focusout",o)),t.on("window:title",e.setTitle),e}),define("host",["$","castrato","settings","templates","hosts","window"],function(t,e,n,o,i){var r,s,c={},a=function(t){r&&r.emit(t.data,t.payload)},u=function(){e.emit("info",JSON.stringify(s||{}))},f=function(n,r){var s,c=0,a=i.hosts.length,u="\n",f=function(n,i,s){return function(c){n.settings=s?c:0,u+=t.template(o.messages[s?"host_available":"host_unavailable"],{name:n.name,path:n.path,index:i}),0==--a&&(e.emit("console:info",u),r())}};for(n=n&&"force"===n.toLowerCase();s=i.hosts[c];)n||void 0===s.settings?require([s.path],f(s,c,1),f(s,c,0)):s.settings?f(s,c,1)():f(s,c,0)(),c++},d=function(a,u){e.emit("console:lockInput");var f;if(a=void 0===a?i.autoconnect:a,s&&s.connected)return e.emit("console:error",t.template(o.messages.already_connected,{host:s.name||"localhost"})),void e.emit("console:unlockInput");if(t.isDigits(a)){if(!(s=i.hosts[+a]))return e.emit("console:error","Undefined host index: "+a),void e.emit("console:unlockInput");s.settings?n=s.settings:f=s.path}else a?f=a.settings:n=a.settings;if(f)return require([f],function(t){return s.settings=t,d(a,u)},function(){e.emit("console:error","Could not fetch host settings: "+f),e.emit("console:unlockInput")});e.emit("console:info",t.template(o.messages.connecting,{host:s.name||"localhost"})),e.emit("console:motd",s.settings.motd),r=t.io(s.host,{forceNew:!0,"force new connection":!0}),r.on("room:joined",function(){e.emit("console:info",t.template(o.messages.joined_room,{roomName:t.escapeHtml(c.room)})),r.emit("room:count")}).on("room:left",function(){e.emit("console:info",t.template(o.messages.left_room,{roomName:t.escapeHtml(c.room)})),e.emit("room:changed",!1)}).on("message:send",function(n){var i=t.AES.decrypt(n.msg,t.SHA1(c.room)+c.key),r=t.escapeHtml(i),s=n.nick?t.escapeHtml(t.AES.decrypt(n.nick,t.SHA1(c.room)+c.key)):o.default_nick;i?e.emit("console:message",{message:r,nick:s}):e.emit("console:error",o.messages.unable_to_decrypt)}).on("message:server",function(n){if(n.msg){var i=t.escapeHtml(n.msg);if(o.server[i])if(void 0!==n.payload){var r=t.escapeHtml(n.payload);e.emit("console:server",t.template(o.server[i],{payload:r}))}else e.emit("console:server",o.server[i]);else console.log(santized),e.emit("console:error",o.server.bogus)}else console.log(santized),e.emit("console:error",o.server.bogus)}).on("connect",function(){e.emit("console:info",t.template(o.messages.connected,{host:s.name||"localhost"})),e.emit("window:title",s.settings.title),e.emit("console:unlockInput"),u(),s.connected=1}).on("disconnect",function(){s.connected=0,e.emit("console:info",t.template(o.messages.disconnected,{host:s.name||"localhost"})),e.emit("room:changed",void 0),e.emit("window:title",o.client.title)}).on("connect_error",function(){s.connected=0,e.emit("console:error",o.messages.socket_error),e.emit("console:unlockInput")})},l=function(t,n){if(!s)return n(),e.emit("console:error",o.messages.reconnect_no_host);s.connected?(m(),d(s,n)):d(s,n)},m=function(){r.disconnect()},p=function(t){c=Object.assign({},c,t)};e.on("command:host",u),e.on("command:hosts",f),e.on("command:connect",d),e.on("command:disconnect",m),e.on("command:reconnect",l),e.on("socket:emit",a),e.on("host:param",p)}),define("client",["$","castrato","settings","templates"],function(t,e,n,o){var i,r,s=function(t){return t.length>n.key.maxLen?e.emit("console:error",o.messages.key_to_long):t.lengthn.nick.maxLen?e("console:error",t.template(o.messages.nick_to_long,{nick_maxLen:n.nick.maxLen})):r.length=n.room.maxLen?e.emit("console:error",t.template(o.messages.room_name_too_long)):r.lengthn.notifications.maxOnePerMs)if(void 0===i&&(i=!1),u&&"granted"===Notification.permission){var r=new Notification(t,{body:e,icon:o});r.onshow=function(){setTimeout(function(){r.close()},3e3)},c=f()}else i&&h("Attention",1e3)};u=void 0!==window.Notification,t.on("notification:send",function(t){g(t.title,t.body,t.icon,!0)}),t.on("notification:on",function(){d()}),t.on("notification:off",function(){l()}),function(){u&&"denied"!==Notification.permission&&Notification.requestPermission(function(t){Notification.permission=t})}(),l(),c=f(),m()}),define("queue",[],function(){var t={},e=[],n=function(){return performance.now()||Date.now()};return t.add_function_delayed=function(t,o,i){e.push({func:o,pushed:n(),delay:t,data:i})},t.get=function(){return e},t.run=function(){for(var o,i,r=0;o=e[r++];)n()-o.pushed>o.delay&&(o.func(),e.splice(r-1,1));if(e.length){for(i=n();n()-i<1;);t.run()}},t}),define("audio",["queue","castrato","templates"],function(t,e,n){var o=!1,i=!0,r=!1,s=function(e,n){if(n=void 0===n?0:n,o&&i&&n0&&i<3600?(e.emit("console:info",t.template(o.messages.torch_is_now,{ttl:i})),n.ttl=1e3*i):e.emit("console:error",t.template(o.messages.torch_not_set))},param:function(t){s=Object.assign({},s,t)},showNotification:function(t,n,o){var r="message"!==t?"Cryptalk":n,s="message"===t?"gfx/icon_128x128.png":"error"===t?"gfx/icon_128x128_error.png":"gfx/icon_128x128_info.png";e.emit("notification:send",{title:r.substring(0,20),body:o.substring(0,80),icon:s}),"message"===t&&e.emit("audio:play",i.message)},motd:function(t){c.post("motd",t)},info:function(t){c.post("info",t)},error:function(t){c.post("error",t)},server:function(t){c.post("server",t)},message:function(t){c.post("message",t.message,t.nick)},clearInput:function(){r.input[0].value=""},clear:function(){r.chat[0].innerHTML=""},lockInput:function(){r.input[0].setAttribute("disabled","disabled"),r.inputWrapper[0].className="loading"},unlockInput:function(){r.input[0].removeAttribute("disabled"),r.inputWrapper[0].className="",r.input.focus()},_require:function(t,e){c.lockInput(),c.post("info","Requiring "+t+"..."),require([t],function(){c.post("info","Successfully required "+t+"."),c.unlockInput(),e()},function(n){c.post("error",'An error occurred while trying to load "'+t+'":\n'+n),c.unlockInput(),e()})}},a=function(n){var i,a,u,f;if(!n.ctrlKey&&!n.altKey&&r.input[0]!==t.activeElement())return r.input.focus();if(13===n.keyCode&&(i=r.input[0].value))if("/"===(i[0]||i.slice(0,1)))a=t.ssplit(i.slice(1)," "),f=a[0],u=a[1],e.emit("command:"+f,u,function(e,n){if(!n)return c.post("error",t.template(o.messages.unrecognized_command,{commandName:f}));c.clearInput()});else{if(!s.room||!s.key)return s.room?c.post("error",o.messages.msg_no_key):c.post("error",o.messages.msg_no_room);e.emit("socket:emit",{data:"message:send",payload:{room:t.SHA1(s.room),msg:t.AES.encrypt(i,t.SHA1(s.room)+s.key).toString(),nick:!!s.nick&&t.AES.encrypt(s.nick,t.SHA1(s.room)+s.key).toString()}}),c.clearInput()}};t(document).on("keydown",a),r.input.focus();for(var u in c)"_require"!==u&&"post"!==u&&e.on("console:"+u,c[u]);e.on("console:require",c._require),e.on("console:post",function(t){c.post(t.type,t.data,t.nick)})}),define("cryptalk",["castrato","host","client","console"],function(t){t.on("window:focused",function(){t.emit("audio:off"),t.emit("notification:off")}).on("window:blurred",function(){t.emit("audio:on"),t.emit("notification:on")}).on("command:mute",function(){t.emit("audio:mute")}).on("command:unmute",function(){t.emit("audio:unmute")}).on("room:changed",function(e){t.emit("console:param",{room:e}).emit("host:param",{room:e})}).on("nick:changed",function(e){t.emit("console:param",{nick:e})}).on("key:changed",function(e){t.emit("console:param",{key:e}).emit("host:param",{key:e})}).emit("command:connect",void 0,function(){(hash=window.location.hash)&&(parts=hash.slice(1).split(":"),parts[0]&&t.emit("command:join",parts[0]),parts[1]&&t.emit("command:key",parts[1]))})}),require.config({baseUrl:"js/lib/",paths:{websocket:"/socket.io/socket.io"},packages:[{name:"crypto-js",location:"../vendor/crypto-js-3.1.9",main:"index"},{name:"castrato",location:"../vendor/castrato",main:"castrato"}]}),require(["cryptalk"]),define("main",function(){}); \ No newline at end of file diff --git a/public/js/lib/host.js b/public/js/lib/host.js index 5c5796c..ca39606 100644 --- a/public/js/lib/host.js +++ b/public/js/lib/host.js @@ -168,9 +168,11 @@ define(['$', 'castrato','settings','templates','hosts','window'], function ($, m mediator.emit('console:server', templates.server[sanitized]); } } else { + console.log(santized); mediator.emit('console:error', templates.server.bogus); } } else { + console.log(santized); mediator.emit('console:error', templates.server.bogus); } }) diff --git a/server.js b/server.js index 2c66989..514690f 100644 --- a/server.js +++ b/server.js @@ -1,21 +1,19 @@ #!/usr/bin/env node const - files = require('node-static'), + handler = require('serve-handler'), port = process.env.PORT || 8080, path = require('path'); -var - file, +let server, io; -// Set up files.file location -file = new files.Server(path.resolve(__dirname, 'public')); - // Create http server, handle files.assets server = require('http').createServer(function (req, res) { - req.addListener('end', function () { file.serve(req, res); }).resume(); + return handler(req, res, { + public: path.resolve(__dirname, 'public') + }); }); // Append socket.io to http server @@ -52,9 +50,10 @@ io.on('connection', function(socket) { socket.on('room:count', function () { if( socket.current_room !== undefined ) { - var clientsList = io.sockets.adapter.rooms[socket.current_room]; - if( clientsList.length > 1) { - socket.emit('message:server', {msg:'person_count', payload: clientsList.length } ); + let clientsInRoom = 0; + if (io.sockets.adapter.rooms.has(socket.current_room)) clientsInRoom = io.sockets.adapter.rooms.get(socket.current_room).size + if( clientsInRoom > 1) { + socket.emit('message:server', {msg:'person_count', payload: clientsInRoom } ); } else { socket.emit('message:server', {msg:'person_single'} ); }