From c556a9e38eb3fc33bed7d00866c03ca11d6b9361 Mon Sep 17 00:00:00 2001 From: Uvis Grinfelds Date: Mon, 20 Oct 2014 18:09:04 +0200 Subject: [PATCH] added typewriter.js to git --- transfersh-web/index.html | 2 +- transfersh-web/scripts/typewriter-bundle.js | 1490 +++++++++++++++++ .../scripts/typewriter-bundle.min.js | 1 + 3 files changed, 1492 insertions(+), 1 deletion(-) create mode 100644 transfersh-web/scripts/typewriter-bundle.js create mode 100644 transfersh-web/scripts/typewriter-bundle.min.js diff --git a/transfersh-web/index.html b/transfersh-web/index.html index 716293c..e343f4c 100644 --- a/transfersh-web/index.html +++ b/transfersh-web/index.html @@ -328,10 +328,10 @@ - + diff --git a/transfersh-web/scripts/typewriter-bundle.js b/transfersh-web/scripts/typewriter-bundle.js new file mode 100644 index 0000000..0b46eda --- /dev/null +++ b/transfersh-web/scripts/typewriter-bundle.js @@ -0,0 +1,1490 @@ +require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= text.length - 1) { + if (typoIndex !== -1) { + shouldCorrect = true; + } else { + return null; + } + } + if (!shouldCorrect) { + currentIndex++; + shouldCorrect = typoIndex !== -1 && currentIndex % checkInterval === 0; + if (random.integerInRange(0, 100) > accuracy) { + result = keyboardLayout.getAdjacentCharacter(text.charAt(currentIndex)); + if (result == null) { + return text.charAt(currentIndex); + } + if (typoIndex === -1) { + typoIndex = currentIndex; + shouldCorrect = random.integerInRange(0, 1) === 1; + } + return result; + } else { + return text.charAt(currentIndex); + } + } + if (currentIndex >= typoIndex) { + currentIndex--; + return '\b'; + } + shouldCorrect = false; + typoIndex = -1; + return text.charAt(++currentIndex); + } + }; + }; + + module.exports = characterGenerator; + +}).call(this); + +},{"./random":4}],2:[function(require,module,exports){ +// Generated by CoffeeScript 1.7.1 +(function() { + var getAdjacentCharacter, isLowerCase, layout, random; + + random = require('./random'); + + layout = [['`', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '='], ['', 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '[', ']', '\\'], ['', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ';', '\''], ['', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', ',', '.', '/']]; + + isLowerCase = function(character) { + return character === character.toLowerCase(); + }; + + getAdjacentCharacter = function(character) { + var adjacentCharacter, adjacentCol, adjacentRow, col, randomNumber, row, _i, _j, _ref, _ref1; + for (row = _i = 0, _ref = layout.length; _i < _ref; row = _i += 1) { + for (col = _j = 0, _ref1 = layout[row].length; _j < _ref1; col = _j += 1) { + if (layout[row][col].toLowerCase() !== character.toLowerCase()) { + continue; + } + randomNumber = random.integerInRange(-1, 1); + adjacentRow = row + randomNumber; + if (adjacentRow >= layout.length || adjacentRow < 0) { + adjacentRow += -2 * randomNumber; + } + if (col >= layout[adjacentRow].length) { + col = layout[adjacentRow].length - 1; + } + if (randomNumber === 0) { + randomNumber = [-1, 1][random.integerInRange(0, 1)]; + } else { + randomNumber = random.integerInRange(-1, 1); + } + adjacentCol = col + randomNumber; + if (adjacentCol >= layout[adjacentRow].length || adjacentCol < 0) { + adjacentCol += -2 * randomNumber; + } + adjacentCharacter = layout[adjacentRow][adjacentCol]; + if (adjacentCharacter === '') { + return getAdjacentCharacter(character); + } + if (isLowerCase(character)) { + return adjacentCharacter.toLowerCase(); + } + return adjacentCharacter; + } + } + return null; + }; + + module.exports.getAdjacentCharacter = getAdjacentCharacter; + +}).call(this); + +},{"./random":4}],3:[function(require,module,exports){ +// Generated by CoffeeScript 1.7.1 +(function() { + var PrioritySequence, Sequence, assert; + + assert = require('assert'); + + Sequence = require('./sequence'); + + PrioritySequence = (function() { + function PrioritySequence(onWait) { + this.onWait = onWait; + this._sequences = []; + this._waiting = true; + if (typeof this.onWait === "function") { + this.onWait(); + } + } + + PrioritySequence.prototype._next = function() { + var s, sequence, _i, _len, _ref; + sequence = null; + _ref = this._sequences; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + s = _ref[_i]; + if (s != null) { + if (s.empty()) { + continue; + } + sequence = s; + break; + } + } + if (sequence != null) { + return sequence.next(this._next.bind(this)); + } else { + this._sequences = []; + this._waiting = true; + return typeof this.onWait === "function" ? this.onWait() : void 0; + } + }; + + PrioritySequence.prototype.then = function(priority, fn) { + assert.ok(priority != null, 'The priority must be specified'); + assert.strictEqual(typeof priority, 'number', 'Priority must be a number'); + assert.strictEqual(~~priority, priority, 'Priority must be an integer'); + assert.ok(priority >= 0, 'Priority must be a positive integer'); + assert.ok(fn != null, 'The function must be specified'); + if (this._sequences[priority] == null) { + this._sequences[priority] = new Sequence(); + } + this._sequences[priority].add(fn); + if (this._waiting) { + this._waiting = false; + return this._next(); + } + }; + + return PrioritySequence; + + })(); + + module.exports = PrioritySequence; + +}).call(this); + +},{"./sequence":5,"assert":9}],4:[function(require,module,exports){ +// Generated by CoffeeScript 1.7.1 +(function() { + var assert, integerInRange; + + assert = require('assert'); + + integerInRange = function(min, max) { + assert.ok(min != null, 'The minimum must be specified'); + assert.strictEqual(typeof min, 'number', 'Min must be a Number'); + assert.strictEqual(~~min, min, 'Min must be an integer'); + assert.ok(max != null, 'The maximum must be specified'); + assert.strictEqual(typeof max, 'number', 'Max must be a Number'); + assert.strictEqual(~~max, max, 'Max must be an integer'); + assert.strictEqual(min <= max, true, 'Min must be less than or equal to Max'); + if (min === max) { + return min; + } + return Math.floor(Math.random() * (max - min + 1)) + min; + }; + + module.exports.integerInRange = integerInRange; + +}).call(this); + +},{"assert":9}],5:[function(require,module,exports){ +// Generated by CoffeeScript 1.7.1 +(function() { + var Sequence, assert; + + assert = require('assert'); + + Sequence = (function() { + function Sequence() { + this._queue = []; + } + + Sequence.prototype.next = function(cb) { + var fn; + if (!this.empty()) { + fn = this._queue.shift(); + return fn(cb); + } + }; + + Sequence.prototype.add = function(fn) { + assert.ok(fn != null, 'The function must be specified'); + return this._queue.push(fn); + }; + + Sequence.prototype.empty = function() { + return this._queue.length === 0; + }; + + return Sequence; + + })(); + + module.exports = Sequence; + +}).call(this); + +},{"assert":9}],6:[function(require,module,exports){ +(function (process){ +// Generated by CoffeeScript 1.7.1 +(function() { + var PrioritySequence, Typewriter, assert, charactergenerator, random; + + assert = require('assert'); + + PrioritySequence = require('./prioritysequence'); + + random = require('./random'); + + charactergenerator = require('./charactergenerator'); + + Typewriter = (function() { + function Typewriter() { + this._prioritySequence = new PrioritySequence((function(_this) { + return function() { + return _this._sequenceLevel = 0; + }; + })(this)); + } + + Typewriter.prototype.setTargetDomElement = function(targetDomElement) { + assert.ok(targetDomElement instanceof Element, 'TargetDomElement must be an instance of Element'); + return this.targetDomElement = targetDomElement; + }; + + Typewriter.prototype.setAccuracy = function(accuracy) { + assert.strictEqual(typeof accuracy, 'number', 'Accuracy must be a number'); + assert.ok(accuracy > 0 && accuracy <= 100, 'Accuracy must be greater than 0 and less than or equal to 100'); + return this.accuracy = accuracy; + }; + + Typewriter.prototype.setMinimumSpeed = function(minimumSpeed) { + assert.strictEqual(typeof minimumSpeed, 'number', 'MinimumSpeed must be a number'); + assert.ok(minimumSpeed > 0, 'MinimumSpeed must be greater than 0'); + if ((this.maximumSpeed != null) && minimumSpeed > this.maximumSpeed) { + return this.minimumSpeed = this.maximumSpeed; + } else { + return this.minimumSpeed = minimumSpeed; + } + }; + + Typewriter.prototype.setMaximumSpeed = function(maximumSpeed) { + assert.strictEqual(typeof maximumSpeed, 'number', 'MaximumSpeed must be a number'); + assert.ok(maximumSpeed > 0, 'MaximumSpeed must be greater than 0'); + if ((this.minimumSpeed != null) && this.minimumSpeed > maximumSpeed) { + return this.maximumSpeed = minimumSpeed; + } else { + return this.maximumSpeed = maximumSpeed; + } + }; + + Typewriter.prototype.setKeyboardLayout = function(keyboardLayout) { + assert.strictEqual(typeof keyboardLayout.getAdjacentCharacter, 'function', 'KeyboardLayout must have an exported getAdjacentCharacter method'); + return this.keyboardLayout = keyboardLayout; + }; + + Typewriter.prototype._makeChainable = function(cb, fn) { + var shadow; + shadow = Object.create(this); + shadow._sequenceLevel = this._sequenceLevel; + this._prioritySequence.then(this._sequenceLevel, function(next) { + return process.nextTick(function() { + return fn(function() { + if (cb != null) { + cb.call(shadow); + } + return next(); + }); + }); + }); + if (cb != null) { + this._sequenceLevel++; + } + if ((cb == null) || this.hasOwnProperty('_prioritySequence')) { + return this; + } + }; + + Typewriter.prototype.clear = function(cb) { + return this._makeChainable(cb, (function(_this) { + return function(done) { + var child; + while ((child = _this.targetDomElement.lastChild) != null) { + _this.targetDomElement.removeChild(child); + } + return done(); + }; + })(this)); + }; + + Typewriter.prototype.waitRange = function(millisMin, millisMax, cb) { + return this._makeChainable(cb, (function(_this) { + return function(done) { + return setTimeout(done, random.integerInRange(millisMin, millisMax)); + }; + })(this)); + }; + + Typewriter.prototype.wait = function(millis, cb) { + return this.waitRange(millis, millis, cb); + }; + + Typewriter.prototype.put = function(text, cb) { + return this._makeChainable(cb, (function(_this) { + return function(done) { + var child, element; + element = document.createElement('div'); + element.innerHTML = text; + while ((child = element.firstChild) != null) { + _this.targetDomElement.appendChild(child); + } + return done(); + }; + })(this)); + }; + + Typewriter.prototype["delete"] = function(cb) { + return this._makeChainable(cb, (function(_this) { + return function(done) { + _this.targetDomElement.removeChild(_this.targetDomElement.lastChild); + return done(); + }; + })(this)); + }; + + Typewriter.prototype.type = function(text, cb) { + var char, checkInterval, gen; + checkInterval = (this.minimumSpeed + this.maximumSpeed) / 2; + gen = charactergenerator(this.keyboardLayout, this.accuracy, checkInterval, text); + while ((char = gen.next()) !== null) { + if (char !== '\b') { + this.put(char); + } else { + this["delete"](); + } + this.waitRange(~~(1000 / this.maximumSpeed), ~~(1000 / this.minimumSpeed)); + } + return this.wait(0, cb); + }; + + return Typewriter; + + })(); + + module.exports = Typewriter; + +}).call(this); + +}).call(this,require("FWaASH")) +},{"./charactergenerator":1,"./prioritysequence":3,"./random":4,"FWaASH":13,"assert":9}],"OPj7T5":[function(require,module,exports){ +// Generated by CoffeeScript 1.7.1 +(function() { + var Typewriter, TypewriterBuilder, assert; + + assert = require('assert'); + + Typewriter = require('./typewriter'); + + TypewriterBuilder = function(targetDomElement) { + var typewriter; + typewriter = new Typewriter(); + typewriter.setTargetDomElement(targetDomElement); + return { + withAccuracy: function(accuracy) { + this.accuracy = accuracy; + typewriter.setAccuracy(this.accuracy); + return this; + }, + withMinimumSpeed: function(minimumSpeed) { + this.minimumSpeed = minimumSpeed; + typewriter.setMinimumSpeed(this.minimumSpeed); + return this; + }, + withMaximumSpeed: function(maximumSpeed) { + this.maximumSpeed = maximumSpeed; + typewriter.setMaximumSpeed(this.maximumSpeed); + return this; + }, + withKeyboardLayout: function(keyboardLayout) { + this.keyboardLayout = keyboardLayout; + typewriter.setKeyboardLayout(this.keyboardLayout); + return this; + }, + build: function() { + assert.ok(this.accuracy != null, 'Accuracy must be set'); + assert.ok(this.minimumSpeed != null, 'MinimumSpeed must be set'); + assert.ok(this.maximumSpeed != null, 'MaximumSpeed must be set'); + if (this.keyboardLayout == null) { + typewriter.setKeyboardLayout(require('./defaultkeyboardlayout')); + } + return typewriter; + } + }; + }; + + module.exports = TypewriterBuilder; + +}).call(this); + +},{"./defaultkeyboardlayout":2,"./typewriter":6,"assert":9}],"typewriter":[function(require,module,exports){ +module.exports=require('OPj7T5'); +},{}],9:[function(require,module,exports){ +// http://wiki.commonjs.org/wiki/Unit_Testing/1.0 +// +// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8! +// +// Originally from narwhal.js (http://narwhaljs.org) +// Copyright (c) 2009 Thomas Robinson <280north.com> +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the 'Software'), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +// when used in node, this will actually load the util module we depend on +// versus loading the builtin util module as happens otherwise +// this is a bug in node module loading as far as I am concerned +var util = require('util/'); + +var pSlice = Array.prototype.slice; +var hasOwn = Object.prototype.hasOwnProperty; + +// 1. The assert module provides functions that throw +// AssertionError's when particular conditions are not met. The +// assert module must conform to the following interface. + +var assert = module.exports = ok; + +// 2. The AssertionError is defined in assert. +// new assert.AssertionError({ message: message, +// actual: actual, +// expected: expected }) + +assert.AssertionError = function AssertionError(options) { + this.name = 'AssertionError'; + this.actual = options.actual; + this.expected = options.expected; + this.operator = options.operator; + if (options.message) { + this.message = options.message; + this.generatedMessage = false; + } else { + this.message = getMessage(this); + this.generatedMessage = true; + } + var stackStartFunction = options.stackStartFunction || fail; + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, stackStartFunction); + } + else { + // non v8 browsers so we can have a stacktrace + var err = new Error(); + if (err.stack) { + var out = err.stack; + + // try to strip useless frames + var fn_name = stackStartFunction.name; + var idx = out.indexOf('\n' + fn_name); + if (idx >= 0) { + // once we have located the function frame + // we need to strip out everything before it (and its line) + var next_line = out.indexOf('\n', idx + 1); + out = out.substring(next_line + 1); + } + + this.stack = out; + } + } +}; + +// assert.AssertionError instanceof Error +util.inherits(assert.AssertionError, Error); + +function replacer(key, value) { + if (util.isUndefined(value)) { + return '' + value; + } + if (util.isNumber(value) && (isNaN(value) || !isFinite(value))) { + return value.toString(); + } + if (util.isFunction(value) || util.isRegExp(value)) { + return value.toString(); + } + return value; +} + +function truncate(s, n) { + if (util.isString(s)) { + return s.length < n ? s : s.slice(0, n); + } else { + return s; + } +} + +function getMessage(self) { + return truncate(JSON.stringify(self.actual, replacer), 128) + ' ' + + self.operator + ' ' + + truncate(JSON.stringify(self.expected, replacer), 128); +} + +// At present only the three keys mentioned above are used and +// understood by the spec. Implementations or sub modules can pass +// other keys to the AssertionError's constructor - they will be +// ignored. + +// 3. All of the following functions must throw an AssertionError +// when a corresponding condition is not met, with a message that +// may be undefined if not provided. All assertion methods provide +// both the actual and expected values to the assertion error for +// display purposes. + +function fail(actual, expected, message, operator, stackStartFunction) { + throw new assert.AssertionError({ + message: message, + actual: actual, + expected: expected, + operator: operator, + stackStartFunction: stackStartFunction + }); +} + +// EXTENSION! allows for well behaved errors defined elsewhere. +assert.fail = fail; + +// 4. Pure assertion tests whether a value is truthy, as determined +// by !!guard. +// assert.ok(guard, message_opt); +// This statement is equivalent to assert.equal(true, !!guard, +// message_opt);. To test strictly for the value true, use +// assert.strictEqual(true, guard, message_opt);. + +function ok(value, message) { + if (!value) fail(value, true, message, '==', assert.ok); +} +assert.ok = ok; + +// 5. The equality assertion tests shallow, coercive equality with +// ==. +// assert.equal(actual, expected, message_opt); + +assert.equal = function equal(actual, expected, message) { + if (actual != expected) fail(actual, expected, message, '==', assert.equal); +}; + +// 6. The non-equality assertion tests for whether two objects are not equal +// with != assert.notEqual(actual, expected, message_opt); + +assert.notEqual = function notEqual(actual, expected, message) { + if (actual == expected) { + fail(actual, expected, message, '!=', assert.notEqual); + } +}; + +// 7. The equivalence assertion tests a deep equality relation. +// assert.deepEqual(actual, expected, message_opt); + +assert.deepEqual = function deepEqual(actual, expected, message) { + if (!_deepEqual(actual, expected)) { + fail(actual, expected, message, 'deepEqual', assert.deepEqual); + } +}; + +function _deepEqual(actual, expected) { + // 7.1. All identical values are equivalent, as determined by ===. + if (actual === expected) { + return true; + + } else if (util.isBuffer(actual) && util.isBuffer(expected)) { + if (actual.length != expected.length) return false; + + for (var i = 0; i < actual.length; i++) { + if (actual[i] !== expected[i]) return false; + } + + return true; + + // 7.2. If the expected value is a Date object, the actual value is + // equivalent if it is also a Date object that refers to the same time. + } else if (util.isDate(actual) && util.isDate(expected)) { + return actual.getTime() === expected.getTime(); + + // 7.3 If the expected value is a RegExp object, the actual value is + // equivalent if it is also a RegExp object with the same source and + // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`). + } else if (util.isRegExp(actual) && util.isRegExp(expected)) { + return actual.source === expected.source && + actual.global === expected.global && + actual.multiline === expected.multiline && + actual.lastIndex === expected.lastIndex && + actual.ignoreCase === expected.ignoreCase; + + // 7.4. Other pairs that do not both pass typeof value == 'object', + // equivalence is determined by ==. + } else if (!util.isObject(actual) && !util.isObject(expected)) { + return actual == expected; + + // 7.5 For all other Object pairs, including Array objects, equivalence is + // determined by having the same number of owned properties (as verified + // with Object.prototype.hasOwnProperty.call), the same set of keys + // (although not necessarily the same order), equivalent values for every + // corresponding key, and an identical 'prototype' property. Note: this + // accounts for both named and indexed properties on Arrays. + } else { + return objEquiv(actual, expected); + } +} + +function isArguments(object) { + return Object.prototype.toString.call(object) == '[object Arguments]'; +} + +function objEquiv(a, b) { + if (util.isNullOrUndefined(a) || util.isNullOrUndefined(b)) + return false; + // an identical 'prototype' property. + if (a.prototype !== b.prototype) return false; + //~~~I've managed to break Object.keys through screwy arguments passing. + // Converting to array solves the problem. + if (isArguments(a)) { + if (!isArguments(b)) { + return false; + } + a = pSlice.call(a); + b = pSlice.call(b); + return _deepEqual(a, b); + } + try { + var ka = objectKeys(a), + kb = objectKeys(b), + key, i; + } catch (e) {//happens when one is a string literal and the other isn't + return false; + } + // having the same number of owned properties (keys incorporates + // hasOwnProperty) + if (ka.length != kb.length) + return false; + //the same set of keys (although not necessarily the same order), + ka.sort(); + kb.sort(); + //~~~cheap key test + for (i = ka.length - 1; i >= 0; i--) { + if (ka[i] != kb[i]) + return false; + } + //equivalent values for every corresponding key, and + //~~~possibly expensive deep test + for (i = ka.length - 1; i >= 0; i--) { + key = ka[i]; + if (!_deepEqual(a[key], b[key])) return false; + } + return true; +} + +// 8. The non-equivalence assertion tests for any deep inequality. +// assert.notDeepEqual(actual, expected, message_opt); + +assert.notDeepEqual = function notDeepEqual(actual, expected, message) { + if (_deepEqual(actual, expected)) { + fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual); + } +}; + +// 9. The strict equality assertion tests strict equality, as determined by ===. +// assert.strictEqual(actual, expected, message_opt); + +assert.strictEqual = function strictEqual(actual, expected, message) { + if (actual !== expected) { + fail(actual, expected, message, '===', assert.strictEqual); + } +}; + +// 10. The strict non-equality assertion tests for strict inequality, as +// determined by !==. assert.notStrictEqual(actual, expected, message_opt); + +assert.notStrictEqual = function notStrictEqual(actual, expected, message) { + if (actual === expected) { + fail(actual, expected, message, '!==', assert.notStrictEqual); + } +}; + +function expectedException(actual, expected) { + if (!actual || !expected) { + return false; + } + + if (Object.prototype.toString.call(expected) == '[object RegExp]') { + return expected.test(actual); + } else if (actual instanceof expected) { + return true; + } else if (expected.call({}, actual) === true) { + return true; + } + + return false; +} + +function _throws(shouldThrow, block, expected, message) { + var actual; + + if (util.isString(expected)) { + message = expected; + expected = null; + } + + try { + block(); + } catch (e) { + actual = e; + } + + message = (expected && expected.name ? ' (' + expected.name + ').' : '.') + + (message ? ' ' + message : '.'); + + if (shouldThrow && !actual) { + fail(actual, expected, 'Missing expected exception' + message); + } + + if (!shouldThrow && expectedException(actual, expected)) { + fail(actual, expected, 'Got unwanted exception' + message); + } + + if ((shouldThrow && actual && expected && + !expectedException(actual, expected)) || (!shouldThrow && actual)) { + throw actual; + } +} + +// 11. Expected to throw an error: +// assert.throws(block, Error_opt, message_opt); + +assert.throws = function(block, /*optional*/error, /*optional*/message) { + _throws.apply(this, [true].concat(pSlice.call(arguments))); +}; + +// EXTENSION! This is annoying to write outside this module. +assert.doesNotThrow = function(block, /*optional*/message) { + _throws.apply(this, [false].concat(pSlice.call(arguments))); +}; + +assert.ifError = function(err) { if (err) {throw err;}}; + +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + if (hasOwn.call(obj, key)) keys.push(key); + } + return keys; +}; + +},{"util/":11}],10:[function(require,module,exports){ +module.exports = function isBuffer(arg) { + return arg && typeof arg === 'object' + && typeof arg.copy === 'function' + && typeof arg.fill === 'function' + && typeof arg.readUInt8 === 'function'; +} +},{}],11:[function(require,module,exports){ +(function (process,global){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var formatRegExp = /%[sdj%]/g; +exports.format = function(f) { + if (!isString(f)) { + var objects = []; + for (var i = 0; i < arguments.length; i++) { + objects.push(inspect(arguments[i])); + } + return objects.join(' '); + } + + var i = 1; + var args = arguments; + var len = args.length; + var str = String(f).replace(formatRegExp, function(x) { + if (x === '%%') return '%'; + if (i >= len) return x; + switch (x) { + case '%s': return String(args[i++]); + case '%d': return Number(args[i++]); + case '%j': + try { + return JSON.stringify(args[i++]); + } catch (_) { + return '[Circular]'; + } + default: + return x; + } + }); + for (var x = args[i]; i < len; x = args[++i]) { + if (isNull(x) || !isObject(x)) { + str += ' ' + x; + } else { + str += ' ' + inspect(x); + } + } + return str; +}; + + +// Mark that a method should not be used. +// Returns a modified function which warns once by default. +// If --no-deprecation is set, then it is a no-op. +exports.deprecate = function(fn, msg) { + // Allow for deprecating things in the process of starting up. + if (isUndefined(global.process)) { + return function() { + return exports.deprecate(fn, msg).apply(this, arguments); + }; + } + + if (process.noDeprecation === true) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (process.throwDeprecation) { + throw new Error(msg); + } else if (process.traceDeprecation) { + console.trace(msg); + } else { + console.error(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +}; + + +var debugs = {}; +var debugEnviron; +exports.debuglog = function(set) { + if (isUndefined(debugEnviron)) + debugEnviron = process.env.NODE_DEBUG || ''; + set = set.toUpperCase(); + if (!debugs[set]) { + if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { + var pid = process.pid; + debugs[set] = function() { + var msg = exports.format.apply(exports, arguments); + console.error('%s %d: %s', set, pid, msg); + }; + } else { + debugs[set] = function() {}; + } + } + return debugs[set]; +}; + + +/** + * Echos the value of a value. Trys to print the value out + * in the best way possible given the different types. + * + * @param {Object} obj The object to print out. + * @param {Object} opts Optional options object that alters the output. + */ +/* legacy: obj, showHidden, depth, colors*/ +function inspect(obj, opts) { + // default options + var ctx = { + seen: [], + stylize: stylizeNoColor + }; + // legacy... + if (arguments.length >= 3) ctx.depth = arguments[2]; + if (arguments.length >= 4) ctx.colors = arguments[3]; + if (isBoolean(opts)) { + // legacy... + ctx.showHidden = opts; + } else if (opts) { + // got an "options" object + exports._extend(ctx, opts); + } + // set default options + if (isUndefined(ctx.showHidden)) ctx.showHidden = false; + if (isUndefined(ctx.depth)) ctx.depth = 2; + if (isUndefined(ctx.colors)) ctx.colors = false; + if (isUndefined(ctx.customInspect)) ctx.customInspect = true; + if (ctx.colors) ctx.stylize = stylizeWithColor; + return formatValue(ctx, obj, ctx.depth); +} +exports.inspect = inspect; + + +// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics +inspect.colors = { + 'bold' : [1, 22], + 'italic' : [3, 23], + 'underline' : [4, 24], + 'inverse' : [7, 27], + 'white' : [37, 39], + 'grey' : [90, 39], + 'black' : [30, 39], + 'blue' : [34, 39], + 'cyan' : [36, 39], + 'green' : [32, 39], + 'magenta' : [35, 39], + 'red' : [31, 39], + 'yellow' : [33, 39] +}; + +// Don't use 'blue' not visible on cmd.exe +inspect.styles = { + 'special': 'cyan', + 'number': 'yellow', + 'boolean': 'yellow', + 'undefined': 'grey', + 'null': 'bold', + 'string': 'green', + 'date': 'magenta', + // "name": intentionally not styling + 'regexp': 'red' +}; + + +function stylizeWithColor(str, styleType) { + var style = inspect.styles[styleType]; + + if (style) { + return '\u001b[' + inspect.colors[style][0] + 'm' + str + + '\u001b[' + inspect.colors[style][1] + 'm'; + } else { + return str; + } +} + + +function stylizeNoColor(str, styleType) { + return str; +} + + +function arrayToHash(array) { + var hash = {}; + + array.forEach(function(val, idx) { + hash[val] = true; + }); + + return hash; +} + + +function formatValue(ctx, value, recurseTimes) { + // Provide a hook for user-specified inspect functions. + // Check that value is an object with an inspect function on it + if (ctx.customInspect && + value && + isFunction(value.inspect) && + // Filter out the util module, it's inspect function is special + value.inspect !== exports.inspect && + // Also filter out any prototype objects using the circular check. + !(value.constructor && value.constructor.prototype === value)) { + var ret = value.inspect(recurseTimes, ctx); + if (!isString(ret)) { + ret = formatValue(ctx, ret, recurseTimes); + } + return ret; + } + + // Primitive types cannot have properties + var primitive = formatPrimitive(ctx, value); + if (primitive) { + return primitive; + } + + // Look up the keys of the object. + var keys = Object.keys(value); + var visibleKeys = arrayToHash(keys); + + if (ctx.showHidden) { + keys = Object.getOwnPropertyNames(value); + } + + // IE doesn't make error fields non-enumerable + // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx + if (isError(value) + && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { + return formatError(value); + } + + // Some type of object without properties can be shortcutted. + if (keys.length === 0) { + if (isFunction(value)) { + var name = value.name ? ': ' + value.name : ''; + return ctx.stylize('[Function' + name + ']', 'special'); + } + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } + if (isDate(value)) { + return ctx.stylize(Date.prototype.toString.call(value), 'date'); + } + if (isError(value)) { + return formatError(value); + } + } + + var base = '', array = false, braces = ['{', '}']; + + // Make Array say that they are Array + if (isArray(value)) { + array = true; + braces = ['[', ']']; + } + + // Make functions say that they are functions + if (isFunction(value)) { + var n = value.name ? ': ' + value.name : ''; + base = ' [Function' + n + ']'; + } + + // Make RegExps say that they are RegExps + if (isRegExp(value)) { + base = ' ' + RegExp.prototype.toString.call(value); + } + + // Make dates with properties first say the date + if (isDate(value)) { + base = ' ' + Date.prototype.toUTCString.call(value); + } + + // Make error with message first say the error + if (isError(value)) { + base = ' ' + formatError(value); + } + + if (keys.length === 0 && (!array || value.length == 0)) { + return braces[0] + base + braces[1]; + } + + if (recurseTimes < 0) { + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } else { + return ctx.stylize('[Object]', 'special'); + } + } + + ctx.seen.push(value); + + var output; + if (array) { + output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); + } else { + output = keys.map(function(key) { + return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); + }); + } + + ctx.seen.pop(); + + return reduceToSingleString(output, base, braces); +} + + +function formatPrimitive(ctx, value) { + if (isUndefined(value)) + return ctx.stylize('undefined', 'undefined'); + if (isString(value)) { + var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') + .replace(/'/g, "\\'") + .replace(/\\"/g, '"') + '\''; + return ctx.stylize(simple, 'string'); + } + if (isNumber(value)) + return ctx.stylize('' + value, 'number'); + if (isBoolean(value)) + return ctx.stylize('' + value, 'boolean'); + // For some reason typeof null is "object", so special case here. + if (isNull(value)) + return ctx.stylize('null', 'null'); +} + + +function formatError(value) { + return '[' + Error.prototype.toString.call(value) + ']'; +} + + +function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { + var output = []; + for (var i = 0, l = value.length; i < l; ++i) { + if (hasOwnProperty(value, String(i))) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + String(i), true)); + } else { + output.push(''); + } + } + keys.forEach(function(key) { + if (!key.match(/^\d+$/)) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + key, true)); + } + }); + return output; +} + + +function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { + var name, str, desc; + desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; + if (desc.get) { + if (desc.set) { + str = ctx.stylize('[Getter/Setter]', 'special'); + } else { + str = ctx.stylize('[Getter]', 'special'); + } + } else { + if (desc.set) { + str = ctx.stylize('[Setter]', 'special'); + } + } + if (!hasOwnProperty(visibleKeys, key)) { + name = '[' + key + ']'; + } + if (!str) { + if (ctx.seen.indexOf(desc.value) < 0) { + if (isNull(recurseTimes)) { + str = formatValue(ctx, desc.value, null); + } else { + str = formatValue(ctx, desc.value, recurseTimes - 1); + } + if (str.indexOf('\n') > -1) { + if (array) { + str = str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n').substr(2); + } else { + str = '\n' + str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n'); + } + } + } else { + str = ctx.stylize('[Circular]', 'special'); + } + } + if (isUndefined(name)) { + if (array && key.match(/^\d+$/)) { + return str; + } + name = JSON.stringify('' + key); + if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { + name = name.substr(1, name.length - 2); + name = ctx.stylize(name, 'name'); + } else { + name = name.replace(/'/g, "\\'") + .replace(/\\"/g, '"') + .replace(/(^"|"$)/g, "'"); + name = ctx.stylize(name, 'string'); + } + } + + return name + ': ' + str; +} + + +function reduceToSingleString(output, base, braces) { + var numLinesEst = 0; + var length = output.reduce(function(prev, cur) { + numLinesEst++; + if (cur.indexOf('\n') >= 0) numLinesEst++; + return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; + }, 0); + + if (length > 60) { + return braces[0] + + (base === '' ? '' : base + '\n ') + + ' ' + + output.join(',\n ') + + ' ' + + braces[1]; + } + + return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; +} + + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. +function isArray(ar) { + return Array.isArray(ar); +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return isObject(e) && + (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = require('./support/isBuffer'); + +function objectToString(o) { + return Object.prototype.toString.call(o); +} + + +function pad(n) { + return n < 10 ? '0' + n.toString(10) : n.toString(10); +} + + +var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', + 'Oct', 'Nov', 'Dec']; + +// 26 Feb 16:19:34 +function timestamp() { + var d = new Date(); + var time = [pad(d.getHours()), + pad(d.getMinutes()), + pad(d.getSeconds())].join(':'); + return [d.getDate(), months[d.getMonth()], time].join(' '); +} + + +// log is just a thin wrapper to console.log that prepends a timestamp +exports.log = function() { + console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); +}; + + +/** + * Inherit the prototype methods from one constructor into another. + * + * The Function.prototype.inherits from lang.js rewritten as a standalone + * function (not on Function.prototype). NOTE: If this file is to be loaded + * during bootstrapping this function needs to be rewritten using some native + * functions as prototype setup using normal JavaScript does not work as + * expected during bootstrapping (see mirror.js in r114903). + * + * @param {function} ctor Constructor function which needs to inherit the + * prototype. + * @param {function} superCtor Constructor function to inherit prototype from. + */ +exports.inherits = require('inherits'); + +exports._extend = function(origin, add) { + // Don't do anything if add isn't an object + if (!add || !isObject(add)) return origin; + + var keys = Object.keys(add); + var i = keys.length; + while (i--) { + origin[keys[i]] = add[keys[i]]; + } + return origin; +}; + +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +}).call(this,require("FWaASH"),typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./support/isBuffer":10,"FWaASH":13,"inherits":12}],12:[function(require,module,exports){ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } +} + +},{}],13:[function(require,module,exports){ +// shim for using process in browser + +var process = module.exports = {}; + +process.nextTick = (function () { + var canSetImmediate = typeof window !== 'undefined' + && window.setImmediate; + var canPost = typeof window !== 'undefined' + && window.postMessage && window.addEventListener + ; + + if (canSetImmediate) { + return function (f) { return window.setImmediate(f) }; + } + + if (canPost) { + var queue = []; + window.addEventListener('message', function (ev) { + var source = ev.source; + if ((source === window || source === null) && ev.data === 'process-tick') { + ev.stopPropagation(); + if (queue.length > 0) { + var fn = queue.shift(); + fn(); + } + } + }, true); + + return function nextTick(fn) { + queue.push(fn); + window.postMessage('process-tick', '*'); + }; + } + + return function nextTick(fn) { + setTimeout(fn, 0); + }; +})(); + +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +} + +// TODO(shtylman) +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; + +},{}]},{},[]) \ No newline at end of file diff --git a/transfersh-web/scripts/typewriter-bundle.min.js b/transfersh-web/scripts/typewriter-bundle.min.js new file mode 100644 index 0000000..bf60407 --- /dev/null +++ b/transfersh-web/scripts/typewriter-bundle.min.js @@ -0,0 +1 @@ +require=function t(e,n,r){function i(u,s){if(!n[u]){if(!e[u]){var a="function"==typeof require&&require;if(!s&&a)return a(u,!0);if(o)return o(u,!0);throw new Error("Cannot find module '"+u+"'")}var c=n[u]={exports:{}};e[u][0].call(c.exports,function(t){var n=e[u][1][t];return i(n?n:t)},c,c.exports,t,e,n,r)}return n[u].exports}for(var o="function"==typeof require&&require,u=0;u=i.length-1){if(-1===s)return null;u=!0}return u?o>=s?(o--,"\b"):(u=!1,s=-1,i.charAt(++o)):(o++,u=-1!==s&&o%n===0,r.integerInRange(0,100)>e?(a=t.getAdjacentCharacter(i.charAt(o)),null==a?i.charAt(o):(-1===s&&(s=o,u=1===r.integerInRange(0,1)),a)):i.charAt(o))}}},e.exports=n}).call(this)},{"./random":4}],2:[function(t,e){(function(){var n,r,i,o;o=t("./random"),i=[["`","1","2","3","4","5","6","7","8","9","0","-","="],["","Q","W","E","R","T","Y","U","I","O","P","[","]","\\"],["","A","S","D","F","G","H","J","K","L",";","'"],["","Z","X","C","V","B","N","M",",",".","/"]],r=function(t){return t===t.toLowerCase()},n=function(t){var e,u,s,a,c,l,f,p,m,h;for(l=f=0,m=i.length;m>f;l=f+=1)for(a=p=0,h=i[l].length;h>p;a=p+=1)if(i[l][a].toLowerCase()===t.toLowerCase())return c=o.integerInRange(-1,1),s=l+c,(s>=i.length||0>s)&&(s+=-2*c),a>=i[s].length&&(a=i[s].length-1),c=0===c?[-1,1][o.integerInRange(0,1)]:o.integerInRange(-1,1),u=a+c,(u>=i[s].length||0>u)&&(u+=-2*c),e=i[s][u],""===e?n(t):r(t)?e.toLowerCase():e;return null},e.exports.getAdjacentCharacter=n}).call(this)},{"./random":4}],3:[function(t,e){(function(){var n,r,i;i=t("assert"),r=t("./sequence"),n=function(){function t(t){this.onWait=t,this._sequences=[],this._waiting=!0,"function"==typeof this.onWait&&this.onWait()}return t.prototype._next=function(){var t,e,n,r,i;for(e=null,i=this._sequences,n=0,r=i.length;r>n;n++)if(t=i[n],null!=t){if(t.empty())continue;e=t;break}return null!=e?e.next(this._next.bind(this)):(this._sequences=[],this._waiting=!0,"function"==typeof this.onWait?this.onWait():void 0)},t.prototype.then=function(t,e){return i.ok(null!=t,"The priority must be specified"),i.strictEqual(typeof t,"number","Priority must be a number"),i.strictEqual(~~t,t,"Priority must be an integer"),i.ok(t>=0,"Priority must be a positive integer"),i.ok(null!=e,"The function must be specified"),null==this._sequences[t]&&(this._sequences[t]=new r),this._sequences[t].add(e),this._waiting?(this._waiting=!1,this._next()):void 0},t}(),e.exports=n}).call(this)},{"./sequence":5,assert:9}],4:[function(t,e){(function(){var n,r;n=t("assert"),r=function(t,e){return n.ok(null!=t,"The minimum must be specified"),n.strictEqual(typeof t,"number","Min must be a Number"),n.strictEqual(~~t,t,"Min must be an integer"),n.ok(null!=e,"The maximum must be specified"),n.strictEqual(typeof e,"number","Max must be a Number"),n.strictEqual(~~e,e,"Max must be an integer"),n.strictEqual(e>=t,!0,"Min must be less than or equal to Max"),t===e?t:Math.floor(Math.random()*(e-t+1))+t},e.exports.integerInRange=r}).call(this)},{assert:9}],5:[function(t,e){(function(){var n,r;r=t("assert"),n=function(){function t(){this._queue=[]}return t.prototype.next=function(t){var e;return this.empty()?void 0:(e=this._queue.shift())(t)},t.prototype.add=function(t){return r.ok(null!=t,"The function must be specified"),this._queue.push(t)},t.prototype.empty=function(){return 0===this._queue.length},t}(),e.exports=n}).call(this)},{assert:9}],6:[function(t,e){(function(n){(function(){var r,i,o,u,s;o=t("assert"),r=t("./prioritysequence"),s=t("./random"),u=t("./charactergenerator"),i=function(){function t(){this._prioritySequence=new r(function(t){return function(){return t._sequenceLevel=0}}(this))}return t.prototype.setTargetDomElement=function(t){return o.ok(t instanceof Element,"TargetDomElement must be an instance of Element"),this.targetDomElement=t},t.prototype.setAccuracy=function(t){return o.strictEqual(typeof t,"number","Accuracy must be a number"),o.ok(t>0&&100>=t,"Accuracy must be greater than 0 and less than or equal to 100"),this.accuracy=t},t.prototype.setMinimumSpeed=function(t){return o.strictEqual(typeof t,"number","MinimumSpeed must be a number"),o.ok(t>0,"MinimumSpeed must be greater than 0"),this.minimumSpeed=null!=this.maximumSpeed&&t>this.maximumSpeed?this.maximumSpeed:t},t.prototype.setMaximumSpeed=function(t){return o.strictEqual(typeof t,"number","MaximumSpeed must be a number"),o.ok(t>0,"MaximumSpeed must be greater than 0"),this.maximumSpeed=null!=this.minimumSpeed&&this.minimumSpeed>t?minimumSpeed:t},t.prototype.setKeyboardLayout=function(t){return o.strictEqual(typeof t.getAdjacentCharacter,"function","KeyboardLayout must have an exported getAdjacentCharacter method"),this.keyboardLayout=t},t.prototype._makeChainable=function(t,e){var r;return r=Object.create(this),r._sequenceLevel=this._sequenceLevel,this._prioritySequence.then(this._sequenceLevel,function(i){return n.nextTick(function(){return e(function(){return null!=t&&t.call(r),i()})})}),null!=t&&this._sequenceLevel++,null==t||this.hasOwnProperty("_prioritySequence")?this:void 0},t.prototype.clear=function(t){return this._makeChainable(t,function(t){return function(e){for(var n;null!=(n=t.targetDomElement.lastChild);)t.targetDomElement.removeChild(n);return e()}}(this))},t.prototype.waitRange=function(t,e,n){return this._makeChainable(n,function(){return function(n){return setTimeout(n,s.integerInRange(t,e))}}(this))},t.prototype.wait=function(t,e){return this.waitRange(t,t,e)},t.prototype.put=function(t,e){return this._makeChainable(e,function(e){return function(n){var r,i;for(i=document.createElement("div"),i.innerHTML=t;null!=(r=i.firstChild);)e.targetDomElement.appendChild(r);return n()}}(this))},t.prototype["delete"]=function(t){return this._makeChainable(t,function(t){return function(e){return t.targetDomElement.removeChild(t.targetDomElement.lastChild),e()}}(this))},t.prototype.type=function(t,e){var n,r,i;for(r=(this.minimumSpeed+this.maximumSpeed)/2,i=u(this.keyboardLayout,this.accuracy,r,t);null!==(n=i.next());)"\b"!==n?this.put(n):this["delete"](),this.waitRange(~~(1e3/this.maximumSpeed),~~(1e3/this.minimumSpeed));return this.wait(0,e)},t}(),e.exports=i}).call(this)}).call(this,t("FWaASH"))},{"./charactergenerator":1,"./prioritysequence":3,"./random":4,FWaASH:13,assert:9}],OPj7T5:[function(t,e){(function(){var n,r,i;i=t("assert"),n=t("./typewriter"),r=function(e){var r;return r=new n,r.setTargetDomElement(e),{withAccuracy:function(t){return this.accuracy=t,r.setAccuracy(this.accuracy),this},withMinimumSpeed:function(t){return this.minimumSpeed=t,r.setMinimumSpeed(this.minimumSpeed),this},withMaximumSpeed:function(t){return this.maximumSpeed=t,r.setMaximumSpeed(this.maximumSpeed),this},withKeyboardLayout:function(t){return this.keyboardLayout=t,r.setKeyboardLayout(this.keyboardLayout),this},build:function(){return i.ok(null!=this.accuracy,"Accuracy must be set"),i.ok(null!=this.minimumSpeed,"MinimumSpeed must be set"),i.ok(null!=this.maximumSpeed,"MaximumSpeed must be set"),null==this.keyboardLayout&&r.setKeyboardLayout(t("./defaultkeyboardlayout")),r}}},e.exports=r}).call(this)},{"./defaultkeyboardlayout":2,"./typewriter":6,assert:9}],typewriter:[function(t,e){e.exports=t("OPj7T5")},{}],9:[function(t,e){function n(t,e){return p.isUndefined(e)?""+e:!p.isNumber(e)||!isNaN(e)&&isFinite(e)?p.isFunction(e)||p.isRegExp(e)?e.toString():e:e.toString()}function r(t,e){return p.isString(t)?t.length=0;r--)if(i[r]!=o[r])return!1;for(r=i.length-1;r>=0;r--)if(n=i[r],!s(t[n],e[n]))return!1;return!0}function l(t,e){return t&&e?"[object RegExp]"==Object.prototype.toString.call(e)?e.test(t):t instanceof e?!0:e.call({},t)===!0?!0:!1:!1}function f(t,e,n,r){var i;p.isString(n)&&(r=n,n=null);try{e()}catch(u){i=u}if(r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),t&&!i&&o(i,n,"Missing expected exception"+r),!t&&l(i,n)&&o(i,n,"Got unwanted exception"+r),t&&i&&n&&!l(i,n)||!t&&i)throw i}var p=t("util/"),m=Array.prototype.slice,h=Object.prototype.hasOwnProperty,d=e.exports=u;d.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=i(this),this.generatedMessage=!0);var e=t.stackStartFunction||o;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var n=new Error;if(n.stack){var r=n.stack,u=e.name,s=r.indexOf("\n"+u);if(s>=0){var a=r.indexOf("\n",s+1);r=r.substring(a+1)}this.stack=r}}},p.inherits(d.AssertionError,Error),d.fail=o,d.ok=u,d.equal=function(t,e,n){t!=e&&o(t,e,n,"==",d.equal)},d.notEqual=function(t,e,n){t==e&&o(t,e,n,"!=",d.notEqual)},d.deepEqual=function(t,e,n){s(t,e)||o(t,e,n,"deepEqual",d.deepEqual)},d.notDeepEqual=function(t,e,n){s(t,e)&&o(t,e,n,"notDeepEqual",d.notDeepEqual)},d.strictEqual=function(t,e,n){t!==e&&o(t,e,n,"===",d.strictEqual)},d.notStrictEqual=function(t,e,n){t===e&&o(t,e,n,"!==",d.notStrictEqual)},d.throws=function(){f.apply(this,[!0].concat(m.call(arguments)))},d.doesNotThrow=function(){f.apply(this,[!1].concat(m.call(arguments)))},d.ifError=function(t){if(t)throw t};var g=Object.keys||function(t){var e=[];for(var n in t)h.call(t,n)&&e.push(n);return e}},{"util/":11}],10:[function(t,e){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],11:[function(t,e,n){(function(e,r){function i(t,e){var r={seen:[],stylize:u};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),d(e)?r.showHidden=e:e&&n._extend(r,e),x(r.showHidden)&&(r.showHidden=!1),x(r.depth)&&(r.depth=2),x(r.colors)&&(r.colors=!1),x(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),a(r,t,r.depth)}function o(t,e){var n=i.styles[e];return n?"["+i.colors[n][0]+"m"+t+"["+i.colors[n][1]+"m":t}function u(t){return t}function s(t){var e={};return t.forEach(function(t){e[t]=!0}),e}function a(t,e,r){if(t.customInspect&&e&&O(e.inspect)&&e.inspect!==n.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(r,t);return v(i)||(i=a(t,i,r)),i}var o=c(t,e);if(o)return o;var u=Object.keys(e),d=s(u);if(t.showHidden&&(u=Object.getOwnPropertyNames(e)),k(e)&&(u.indexOf("message")>=0||u.indexOf("description")>=0))return l(e);if(0===u.length){if(O(e)){var g=e.name?": "+e.name:"";return t.stylize("[Function"+g+"]","special")}if(S(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(q(e))return t.stylize(Date.prototype.toString.call(e),"date");if(k(e))return l(e)}var y="",b=!1,w=["{","}"];if(h(e)&&(b=!0,w=["[","]"]),O(e)){var x=e.name?": "+e.name:"";y=" [Function"+x+"]"}if(S(e)&&(y=" "+RegExp.prototype.toString.call(e)),q(e)&&(y=" "+Date.prototype.toUTCString.call(e)),k(e)&&(y=" "+l(e)),0===u.length&&(!b||0==e.length))return w[0]+y+w[1];if(0>r)return S(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var E;return E=b?f(t,e,r,d,u):u.map(function(n){return p(t,e,r,d,n,b)}),t.seen.pop(),m(E,y,w)}function c(t,e){if(x(e))return t.stylize("undefined","undefined");if(v(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return b(e)?t.stylize(""+e,"number"):d(e)?t.stylize(""+e,"boolean"):g(e)?t.stylize("null","null"):void 0}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,n,r,i){for(var o=[],u=0,s=e.length;s>u;++u)o.push(D(e,String(u))?p(t,e,n,r,String(u),!0):"");return i.forEach(function(i){i.match(/^\d+$/)||o.push(p(t,e,n,r,i,!0))}),o}function p(t,e,n,r,i,o){var u,s,c;if(c=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},c.get?s=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(s=t.stylize("[Setter]","special")),D(r,i)||(u="["+i+"]"),s||(t.seen.indexOf(c.value)<0?(s=g(n)?a(t,c.value,null):a(t,c.value,n-1),s.indexOf("\n")>-1&&(s=o?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n"))):s=t.stylize("[Circular]","special")),x(u)){if(o&&i.match(/^\d+$/))return s;u=JSON.stringify(""+i),u.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(u=u.substr(1,u.length-2),u=t.stylize(u,"name")):(u=u.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),u=t.stylize(u,"string"))}return u+": "+s}function m(t,e,n){var r=0,i=t.reduce(function(t,e){return r++,e.indexOf("\n")>=0&&r++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}function h(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function g(t){return null===t}function y(t){return null==t}function b(t){return"number"==typeof t}function v(t){return"string"==typeof t}function w(t){return"symbol"==typeof t}function x(t){return void 0===t}function S(t){return E(t)&&"[object RegExp]"===_(t)}function E(t){return"object"==typeof t&&null!==t}function q(t){return E(t)&&"[object Date]"===_(t)}function k(t){return E(t)&&("[object Error]"===_(t)||t instanceof Error)}function O(t){return"function"==typeof t}function j(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function _(t){return Object.prototype.toString.call(t)}function A(t){return 10>t?"0"+t.toString(10):t.toString(10)}function M(){var t=new Date,e=[A(t.getHours()),A(t.getMinutes()),A(t.getSeconds())].join(":");return[t.getDate(),N[t.getMonth()],e].join(" ")}function D(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var C=/%[sdj%]/g;n.format=function(t){if(!v(t)){for(var e=[],n=0;n=o)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return t}}),s=r[n];o>n;s=r[++n])u+=g(s)||!E(s)?" "+s:" "+i(s);return u},n.deprecate=function(t,i){function o(){if(!u){if(e.throwDeprecation)throw new Error(i);e.traceDeprecation?console.trace(i):console.error(i),u=!0}return t.apply(this,arguments)}if(x(r.process))return function(){return n.deprecate(t,i).apply(this,arguments)};if(e.noDeprecation===!0)return t;var u=!1;return o};var L,T={};n.debuglog=function(t){if(x(L)&&(L=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!T[t])if(new RegExp("\\b"+t+"\\b","i").test(L)){var r=e.pid;T[t]=function(){var e=n.format.apply(n,arguments);console.error("%s %d: %s",t,r,e)}}else T[t]=function(){};return T[t]},n.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=h,n.isBoolean=d,n.isNull=g,n.isNullOrUndefined=y,n.isNumber=b,n.isString=v,n.isSymbol=w,n.isUndefined=x,n.isRegExp=S,n.isObject=E,n.isDate=q,n.isError=k,n.isFunction=O,n.isPrimitive=j,n.isBuffer=t("./support/isBuffer");var N=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];n.log=function(){console.log("%s - %s",M(),n.format.apply(n,arguments))},n.inherits=t("inherits"),n._extend=function(t,e){if(!e||!E(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t}}).call(this,t("FWaASH"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":10,FWaASH:13,inherits:12}],12:[function(t,e){e.exports="function"==typeof Object.create?function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},{}],13:[function(t,e){function n(){}var r=e.exports={};r.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(e){var n=[];return window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),n.length>0)){var r=n.shift();r()}},!0),function(t){n.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.on=n,r.addListener=n,r.once=n,r.off=n,r.removeListener=n,r.removeAllListeners=n,r.emit=n,r.binding=function(){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw new Error("process.chdir is not supported")}},{}]},{},[]); \ No newline at end of file