Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

profam

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

profam - npm Package Compare versions

Comparing version 1.1.1 to 2.0.0

.eslintrc

4112

distribution/profam.js

@@ -24,5 +24,5 @@ (function webpackUniversalModuleDefinition(root, factory) {

/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };

@@ -34,3 +34,3 @@ /******/

/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ module.l = true;
/******/

@@ -48,2 +48,28 @@ /******/ // Return the exports of the module

/******/
/******/ // identity function for calling harmony imports with the correct context
/******/ __webpack_require__.i = function(value) { return value; };
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__

@@ -53,3 +79,3 @@ /******/ __webpack_require__.p = "";

/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ return __webpack_require__(__webpack_require__.s = 32);
/******/ })

@@ -59,1927 +85,2315 @@ /************************************************************************/

/* 0 */
/***/ function(module, exports, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _profanity = __webpack_require__(2);
var _profanity2 = _interopRequireDefault(_profanity);
var _spam = __webpack_require__(21);
var _spam2 = _interopRequireDefault(_spam);
var _utils = __webpack_require__(20);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var env = typeof process === 'undefined' ? 'browser' : 'server';
module.exports = function () {
function _class() {
var options = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0];
_classCallCheck(this, _class);
//Initialization
this.profanity = new _profanity2.default();
this.spam = new _spam2.default();
//Update Options with options provided in initialization.
if (options !== null) {
var keys = Object.keys(options);
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var key = _step.value;
if (key == 'profanity' || key == 'spam') {
this[key] = Object.assign(this[key], options[key]);
} else {
this[key] = options[key];
}
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return) {
_iterator.return();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
} else {/* logger('No options provided in initialization, not a problem tho.'); */}
}
_createClass(_class, [{
key: 'proceed',
value: function proceed(str) {
str = this.spam.enable ? this.spam.proceed(str) : str;
str = this.profanity.enable ? this.profanity.proceed(str) : str;
return str;
}
}]);
return _class;
}();
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
"use strict";
/***/ },
var bind = __webpack_require__(7);
/*global toString:true*/
// utils is a library of generic helper functions non-specific to axios
var toString = Object.prototype.toString;
/**
* Determine if a value is an Array
*
* @param {Object} val The value to test
* @returns {boolean} True if value is an Array, otherwise false
*/
function isArray(val) {
return toString.call(val) === '[object Array]';
}
/**
* Determine if a value is an ArrayBuffer
*
* @param {Object} val The value to test
* @returns {boolean} True if value is an ArrayBuffer, otherwise false
*/
function isArrayBuffer(val) {
return toString.call(val) === '[object ArrayBuffer]';
}
/**
* Determine if a value is a FormData
*
* @param {Object} val The value to test
* @returns {boolean} True if value is an FormData, otherwise false
*/
function isFormData(val) {
return (typeof FormData !== 'undefined') && (val instanceof FormData);
}
/**
* Determine if a value is a view on an ArrayBuffer
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
*/
function isArrayBufferView(val) {
var result;
if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
result = ArrayBuffer.isView(val);
} else {
result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
}
return result;
}
/**
* Determine if a value is a String
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a String, otherwise false
*/
function isString(val) {
return typeof val === 'string';
}
/**
* Determine if a value is a Number
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Number, otherwise false
*/
function isNumber(val) {
return typeof val === 'number';
}
/**
* Determine if a value is undefined
*
* @param {Object} val The value to test
* @returns {boolean} True if the value is undefined, otherwise false
*/
function isUndefined(val) {
return typeof val === 'undefined';
}
/**
* Determine if a value is an Object
*
* @param {Object} val The value to test
* @returns {boolean} True if value is an Object, otherwise false
*/
function isObject(val) {
return val !== null && typeof val === 'object';
}
/**
* Determine if a value is a Date
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Date, otherwise false
*/
function isDate(val) {
return toString.call(val) === '[object Date]';
}
/**
* Determine if a value is a File
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a File, otherwise false
*/
function isFile(val) {
return toString.call(val) === '[object File]';
}
/**
* Determine if a value is a Blob
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Blob, otherwise false
*/
function isBlob(val) {
return toString.call(val) === '[object Blob]';
}
/**
* Determine if a value is a Function
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Function, otherwise false
*/
function isFunction(val) {
return toString.call(val) === '[object Function]';
}
/**
* Determine if a value is a Stream
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Stream, otherwise false
*/
function isStream(val) {
return isObject(val) && isFunction(val.pipe);
}
/**
* Determine if a value is a URLSearchParams object
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a URLSearchParams object, otherwise false
*/
function isURLSearchParams(val) {
return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
}
/**
* Trim excess whitespace off the beginning and end of a string
*
* @param {String} str The String to trim
* @returns {String} The String freed of excess whitespace
*/
function trim(str) {
return str.replace(/^\s*/, '').replace(/\s*$/, '');
}
/**
* Determine if we're running in a standard browser environment
*
* This allows axios to run in a web worker, and react-native.
* Both environments support XMLHttpRequest, but not fully standard globals.
*
* web workers:
* typeof window -> undefined
* typeof document -> undefined
*
* react-native:
* typeof document.createElement -> undefined
*/
function isStandardBrowserEnv() {
return (
typeof window !== 'undefined' &&
typeof document !== 'undefined' &&
typeof document.createElement === 'function'
);
}
/**
* Iterate over an Array or an Object invoking a function for each item.
*
* If `obj` is an Array callback will be called passing
* the value, index, and complete array for each item.
*
* If 'obj' is an Object callback will be called passing
* the value, key, and complete object for each property.
*
* @param {Object|Array} obj The object to iterate
* @param {Function} fn The callback to invoke for each item
*/
function forEach(obj, fn) {
// Don't bother if no value provided
if (obj === null || typeof obj === 'undefined') {
return;
}
// Force an array if not already something iterable
if (typeof obj !== 'object' && !isArray(obj)) {
/*eslint no-param-reassign:0*/
obj = [obj];
}
if (isArray(obj)) {
// Iterate over array values
for (var i = 0, l = obj.length; i < l; i++) {
fn.call(null, obj[i], i, obj);
}
} else {
// Iterate over object keys
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
fn.call(null, obj[key], key, obj);
}
}
}
}
/**
* Accepts varargs expecting each argument to be an object, then
* immutably merges the properties of each object and returns result.
*
* When multiple objects contain the same key the later object in
* the arguments list will take precedence.
*
* Example:
*
* ```js
* var result = merge({foo: 123}, {foo: 456});
* console.log(result.foo); // outputs 456
* ```
*
* @param {Object} obj1 Object to merge
* @returns {Object} Result of all merge properties
*/
function merge(/* obj1, obj2, obj3, ... */) {
var result = {};
function assignValue(val, key) {
if (typeof result[key] === 'object' && typeof val === 'object') {
result[key] = merge(result[key], val);
} else {
result[key] = val;
}
}
for (var i = 0, l = arguments.length; i < l; i++) {
forEach(arguments[i], assignValue);
}
return result;
}
/**
* Extends object a by mutably adding to it the properties of object b.
*
* @param {Object} a The object to be extended
* @param {Object} b The object to copy properties from
* @param {Object} thisArg The object to bind function to
* @return {Object} The resulting value of object a
*/
function extend(a, b, thisArg) {
forEach(b, function assignValue(val, key) {
if (thisArg && typeof val === 'function') {
a[key] = bind(val, thisArg);
} else {
a[key] = val;
}
});
return a;
}
module.exports = {
isArray: isArray,
isArrayBuffer: isArrayBuffer,
isFormData: isFormData,
isArrayBufferView: isArrayBufferView,
isString: isString,
isNumber: isNumber,
isObject: isObject,
isUndefined: isUndefined,
isDate: isDate,
isFile: isFile,
isBlob: isBlob,
isFunction: isFunction,
isStream: isStream,
isURLSearchParams: isURLSearchParams,
isStandardBrowserEnv: isStandardBrowserEnv,
forEach: forEach,
merge: merge,
extend: extend,
trim: trim
};
/***/ }),
/* 1 */
/***/ function(module, exports) {
/***/ (function(module, exports, __webpack_require__) {
// shim for using process in browser
var process = module.exports = {};
// cached from whatever global is present so that test runners that stub it
// don't break things. But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals. It's inside a
// function because try/catches deoptimize in certain engines.
var cachedSetTimeout;
var cachedClearTimeout;
function defaultSetTimout() {
throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout () {
throw new Error('clearTimeout has not been defined');
}
(function () {
try {
if (typeof setTimeout === 'function') {
cachedSetTimeout = setTimeout;
} else {
cachedSetTimeout = defaultSetTimout;
}
} catch (e) {
cachedSetTimeout = defaultSetTimout;
}
try {
if (typeof clearTimeout === 'function') {
cachedClearTimeout = clearTimeout;
} else {
cachedClearTimeout = defaultClearTimeout;
}
} catch (e) {
cachedClearTimeout = defaultClearTimeout;
}
} ())
function runTimeout(fun) {
if (cachedSetTimeout === setTimeout) {
//normal enviroments in sane situations
return setTimeout(fun, 0);
}
// if setTimeout wasn't available but was latter defined
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
cachedSetTimeout = setTimeout;
return setTimeout(fun, 0);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedSetTimeout(fun, 0);
} catch(e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedSetTimeout.call(null, fun, 0);
} catch(e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
return cachedSetTimeout.call(this, fun, 0);
}
}
}
function runClearTimeout(marker) {
if (cachedClearTimeout === clearTimeout) {
//normal enviroments in sane situations
return clearTimeout(marker);
}
// if clearTimeout wasn't available but was latter defined
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
cachedClearTimeout = clearTimeout;
return clearTimeout(marker);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedClearTimeout(marker);
} catch (e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedClearTimeout.call(null, marker);
} catch (e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
return cachedClearTimeout.call(this, marker);
}
}
}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
if (!draining || !currentQueue) {
return;
}
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = runTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while(len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
currentQueue[queueIndex].run();
}
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
runClearTimeout(timeout);
}
process.nextTick = function (fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
runTimeout(drainQueue);
}
};
// v8 likes predictible objects
function Item(fun, array) {
this.fun = fun;
this.array = array;
}
Item.prototype.run = function () {
this.fun.apply(null, this.array);
};
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = ''; // empty string to avoid regexp issues
process.versions = {};
function noop() {}
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.binding = function (name) {
throw new Error('process.binding is not supported');
};
process.cwd = function () { return '/' };
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
process.umask = function() { return 0; };
"use strict";
/* WEBPACK VAR INJECTION */(function(process) {
var utils = __webpack_require__(0);
var normalizeHeaderName = __webpack_require__(25);
/***/ },
var PROTECTION_PREFIX = /^\)\]\}',?\n/;
var DEFAULT_CONTENT_TYPE = {
'Content-Type': 'application/x-www-form-urlencoded'
};
function setContentTypeIfUnset(headers, value) {
if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
headers['Content-Type'] = value;
}
}
function getDefaultAdapter() {
var adapter;
if (typeof XMLHttpRequest !== 'undefined') {
// For browsers use XHR adapter
adapter = __webpack_require__(3);
} else if (typeof process !== 'undefined') {
// For node use HTTP adapter
adapter = __webpack_require__(3);
}
return adapter;
}
var defaults = {
adapter: getDefaultAdapter(),
transformRequest: [function transformRequest(data, headers) {
normalizeHeaderName(headers, 'Content-Type');
if (utils.isFormData(data) ||
utils.isArrayBuffer(data) ||
utils.isStream(data) ||
utils.isFile(data) ||
utils.isBlob(data)
) {
return data;
}
if (utils.isArrayBufferView(data)) {
return data.buffer;
}
if (utils.isURLSearchParams(data)) {
setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
return data.toString();
}
if (utils.isObject(data)) {
setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
return JSON.stringify(data);
}
return data;
}],
transformResponse: [function transformResponse(data) {
/*eslint no-param-reassign:0*/
if (typeof data === 'string') {
data = data.replace(PROTECTION_PREFIX, '');
try {
data = JSON.parse(data);
} catch (e) { /* Ignore */ }
}
return data;
}],
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
validateStatus: function validateStatus(status) {
return status >= 200 && status < 300;
}
};
defaults.headers = {
common: {
'Accept': 'application/json, text/plain, */*'
}
};
utils.forEach(['delete', 'get', 'head'], function forEachMehtodNoData(method) {
defaults.headers[method] = {};
});
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
});
module.exports = defaults;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(29)))
/***/ }),
/* 2 */
/***/ function(module, exports, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _axios = __webpack_require__(3);
var _axios2 = _interopRequireDefault(_axios);
var _utils = __webpack_require__(20);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var profanity = function () {
function profanity() {
_classCallCheck(this, profanity);
this.enable = 1; // 1, 0 : Enabled or Disabled
this.locales = new Map(); // Can check modes available, enabled
this.localesDir = null; // Url Mockup of locales location for axio.get
this.modes = new Map([// Can check modes available, enabled
['asterisks-obscure', { 'enabled': 1 }], ['asterisks-full', { 'enabled': 0 }], ['choice', { 'enabled': 0, data: [] }], ['funny', { 'enabled': 0, data: ['bunnies', 'butterfly', 'kitten', 'love', 'gingerly', 'flowers', 'puppy', 'joyful', 'rainbows', 'unicorn'] }], ['grawlix', { 'enabled': 0 }], ['spaces', { 'enabled': 0 }], ['black', { 'enabled': 0 }], ['hide', { 'enabled': 0 }], ['beep', { 'enabled': 0 }]]);
this.wholeWord = 0;
}
// Utils
_createClass(profanity, [{
key: 'makeUrl',
value: function makeUrl() {
var locale = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0];
if (this.localesDir !== null) {
return this.localesDir.replace(/\[locale\]/g, locale);
} else {
(0, _utils.logger)('Locale provided is undefined or null, Usage: .makeUrl(<string>)');
}
}
// updateLocalesFromDir(dir) {
// let path = require('path'),
// fs = require('fs');
//
// let files = fs.readdirSync(dir);
// files.forEach((file) => {
// let options = this.locales.get(file);
//
// try {
// options.data = fs.readFileSync(`${dir}/${file}`, 'utf8');
// this.locales.set(file, options);
// } catch (err) {
// logger(`Couldn't read ${file}`);
// }
// });
//
// logger('Updated Locales');
// }
// I\O
//Setters
//Set locales dir
}, {
key: 'setLocalesDir',
value: function setLocalesDir() {
var dir = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0];
if (dir !== null) {
this.localesDir = dir;
// if (this.env == 'server') {
// this.updateLocalesFromDir(dir);
// }
} else {
(0, _utils.logger)('Invalid locales dir provided');
}
}
}, {
key: 'setLocales',
value: function setLocales() {
var locales = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0];
var _this = this;
var isCustom = arguments.length <= 1 || arguments[1] === undefined ? 0 : arguments[1];
var isAdd = arguments.length <= 2 || arguments[2] === undefined ? 0 : arguments[2];
var self = this;
locales = (0, _utils.toArray)(locales);
if (!isAdd) {
self.locales.clear();
}
//Process Locales
var processLocale = function processLocale(item) {
var _self$locales;
(_self$locales = self.locales).set.apply(_self$locales, _toConsumableArray(item));
};
//Prepare locales
if (locales.length) {
locales.filter(function (locale) {
return !_this.locales.has(locale);
}).forEach(function (locale) {
if (!isCustom) {
var url = _this.makeUrl(locale);
_axios2.default.get(url).then(function (response) {
processLocale([locale, { 'enabled': 1, 'available': 1, 'data': response.data }]);
}).catch(function (response) {
(0, _utils.logger)('Tried to download locale but catched an error', response);
});
} else {
processLocale([locale, { 'enabled': 1, 'available': 1, 'data': [] }]);
}
});
} else {
(0, _utils.logger)('Provided empty string or array, Usage: .downloadLocales(<string/array>)');
}
}
}, {
key: 'setModes',
value: function setModes() {
var _this2 = this;
var modes = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0];
if (modes !== null) {
modes = (0, _utils.toArray)(modes);
[].concat(_toConsumableArray(this.modes.keys())).forEach(function (mode) {
var enabled = 0;
var options = _this2.modes.get(mode);
if (modes.indexOf(mode) !== -1) {
enabled = 1;
}
options.enabled = enabled;
_this2.modes.set(mode, options);
});
(0, _utils.logger)('Added Modes', modes);
} else {
(0, _utils.logger)('setModes received null');
}
}
}, {
key: 'addChoices',
value: function addChoices() {
var _options$data;
var words = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0];
var isAdd = arguments.length <= 1 || arguments[1] === undefined ? 1 : arguments[1];
words = (0, _utils.toArray)(words);
var options = this.modes.get('choice');
if (!isAdd) {
options.data = [];
}
(_options$data = options.data).push.apply(_options$data, _toConsumableArray(words));
options.data = [].concat(_toConsumableArray(new Set(options.data)));
this.modes.set('choice', options);
return options.data;
}
}, {
key: 'addWords',
value: function addWords() {
var locale = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0];
var words = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1];
var isAdd = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2];
words = (0, _utils.toArray)(words);
if (this.locales.has(locale)) {
var _options$data2;
var options = this.locales.get(locale);
if (!isAdd) {
options.data = [];
}
(_options$data2 = options.data).push.apply(_options$data2, _toConsumableArray(words));
options.data = [].concat(_toConsumableArray(new Set(options.data)));
this.locales.set(locale, options);
return options.data;
} else {
(0, _utils.logger)('addWords: this locale doesnt exist, you might need to setLocales first');
}
}
}, {
key: 'removeWords',
value: function removeWords() {
var locale = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0];
var words = arguments.length <= 1 || arguments[1] === undefined ? [] : arguments[1];
words = (0, _utils.toArray)(words);
if (this.locales.has(locale)) {
var options = this.locales.get(locale);
options.data = options.data.filter(function (word) {
return !(words.indexOf(word) !== -1);
});
this.locales.set(locale, options);
return options.data;
} else {
(0, _utils.logger)('removeWords: this locale doesnt exist, you might need to setLocales first');
}
}
//Getters
}, {
key: 'getLocales',
value: function getLocales() {
return [].concat(_toConsumableArray(this.locales.keys()));
}
}, {
key: 'getLocalesEnabled',
value: function getLocalesEnabled() {
var _this3 = this;
return [].concat(_toConsumableArray(this.locales.keys())).filter(function (locale) {
return _this3.locales.get(locale).enabled;
});
}
}, {
key: 'getModes',
value: function getModes() {
return [].concat(_toConsumableArray(this.modes.keys()));
}
}, {
key: 'getModesEnabled',
value: function getModesEnabled() {
var _this4 = this;
return [].concat(_toConsumableArray(this.modes.keys())).filter(function (mode) {
return _this4.modes.get(mode).enabled;
});
}
//Profanity behavior
}, {
key: 'proceed',
value: function proceed() {
var _this5 = this;
var strings = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0];
strings = (0, _utils.toArray)(strings);
//Locales
var localesEnabled = [].concat(_toConsumableArray(this.locales.keys())).filter(function (locale) {
return _this5.locales.get(locale).enabled;
});
var localesAllWords = localesEnabled.reduce(function (allLocales, locale) {
allLocales.push.apply(allLocales, _toConsumableArray(_this5.locales.get(locale).data));
return allLocales;
}, []);
//Modes
var modesEnabled = [].concat(_toConsumableArray(this.modes.keys())).filter(function (mode) {
return _this5.modes.get(mode).enabled;
});
var processed = strings.map(function (string) {
return modesEnabled.map(function (mode) {
var toProcess = string;
localesAllWords.forEach(function (word) {
word = (0, _utils.escapeSymbols)(word);
var isIncluded = toProcess.match(new RegExp(word, 'gi'));
if (isIncluded !== null && isIncluded.length > 0) {
(function () {
var wordLength = word.length;
var replaceStr = function () {
switch (mode) {
case 'choice':
{
var list = _this5.modes.get('choice').data;
return list[(0, _utils.randomRange)(0, list.length)] || '';
}
case 'funny':
{
var _list = _this5.modes.get('funny').data;
return _list[(0, _utils.randomRange)(0, _list.length)] || '';
}
case 'spaces':
{
return ' '.repeat(wordLength);
}
case 'black':
{
return '&#9632;'.repeat(wordLength);
}
case 'asterisks-full':
{
return '*'.repeat(wordLength);
}
case 'asterisks-obscure':
{
return word[0] + '*'.repeat(wordLength - 2) + word[word.length - 1];
}
case 'beep':
{
return 'BEEP';
}
case 'grawlix':
{
var _ret2 = function () {
var grawlixChars = ['!', '@', '#', '$', '%', '~', '*'];
return {
v: word.split('').map(function (char) {
return grawlixChars[(0, _utils.randomRange)(0, grawlixChars.length)];
}).join('')
};
}();
if ((typeof _ret2 === 'undefined' ? 'undefined' : _typeof(_ret2)) === "object") return _ret2.v;
}
case 'hide':
{
return '';
}
//asterisks-obscure
default:
{
return word[0] + '*'.repeat(wordLength - 2) + word[word.length - 1];
}
}
}();
toProcess = function () {
var reqexp = new RegExp(word, 'gi');
if (_this5.wholeWord) {
reqexp = new RegExp('\\b' + word + '\\b', 'gi');
}
return toProcess.replace(reqexp, replaceStr);
}();
})();
}
});
return toProcess;
});
});
var whatIsReturn = (0, _utils.whatIs)(processed);
return whatIsReturn == 'Array' && processed.length == 1 ? processed[0] : processed;
}
}]);
return profanity;
}();
;
exports.default = profanity;
"use strict";
/***/ },
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.escapeSymbols = exports.randomRange = exports.toArray = exports.removeFromArray = undefined;
var _typeName = __webpack_require__(30);
var _typeName2 = _interopRequireDefault(_typeName);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var removeFromArray = exports.removeFromArray = function removeFromArray() {
var arr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
var item = arguments[1];
return arr.filter(function (x) {
return x !== item;
});
};
var toArray = exports.toArray = function toArray() {
var item = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
var is = (0, _typeName2.default)(item);
var isArray = is === 'Array';
var isNumber = is === 'number';
var isString = is === 'string';
if (isArray) return item;
if (isNumber || isString) return [item];
return [];
};
var randomRange = exports.randomRange = function randomRange() {
var min = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
var max = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 101;
return Math.floor(Math.random() * (max - min) + min);
};
var escapeSymbols = exports.escapeSymbols = function escapeSymbols(str) {
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
};
/***/ }),
/* 3 */
/***/ function(module, exports, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(4);
"use strict";
/***/ },
var utils = __webpack_require__(0);
var settle = __webpack_require__(17);
var buildURL = __webpack_require__(20);
var parseHeaders = __webpack_require__(26);
var isURLSameOrigin = __webpack_require__(24);
var createError = __webpack_require__(6);
var btoa = (typeof window !== 'undefined' && window.btoa && window.btoa.bind(window)) || __webpack_require__(19);
module.exports = function xhrAdapter(config) {
return new Promise(function dispatchXhrRequest(resolve, reject) {
var requestData = config.data;
var requestHeaders = config.headers;
if (utils.isFormData(requestData)) {
delete requestHeaders['Content-Type']; // Let the browser set it
}
var request = new XMLHttpRequest();
var loadEvent = 'onreadystatechange';
var xDomain = false;
// For IE 8/9 CORS support
// Only supports POST and GET calls and doesn't returns the response headers.
// DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest.
if ("production" !== 'test' &&
typeof window !== 'undefined' &&
window.XDomainRequest && !('withCredentials' in request) &&
!isURLSameOrigin(config.url)) {
request = new window.XDomainRequest();
loadEvent = 'onload';
xDomain = true;
request.onprogress = function handleProgress() {};
request.ontimeout = function handleTimeout() {};
}
// HTTP basic authentication
if (config.auth) {
var username = config.auth.username || '';
var password = config.auth.password || '';
requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
}
request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);
// Set the request timeout in MS
request.timeout = config.timeout;
// Listen for ready state
request[loadEvent] = function handleLoad() {
if (!request || (request.readyState !== 4 && !xDomain)) {
return;
}
// The request errored out and we didn't get a response, this will be
// handled by onerror instead
// With one exception: request that using file: protocol, most browsers
// will return status as 0 even though it's a successful request
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
return;
}
// Prepare the response
var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
var response = {
data: responseData,
// IE sends 1223 instead of 204 (https://github.com/mzabriskie/axios/issues/201)
status: request.status === 1223 ? 204 : request.status,
statusText: request.status === 1223 ? 'No Content' : request.statusText,
headers: responseHeaders,
config: config,
request: request
};
settle(resolve, reject, response);
// Clean up request
request = null;
};
// Handle low level network errors
request.onerror = function handleError() {
// Real errors are hidden from us by the browser
// onerror should only fire if it's a network error
reject(createError('Network Error', config));
// Clean up request
request = null;
};
// Handle timeout
request.ontimeout = function handleTimeout() {
reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED'));
// Clean up request
request = null;
};
// Add xsrf header
// This is only done if running in a standard browser environment.
// Specifically not if we're in a web worker, or react-native.
if (utils.isStandardBrowserEnv()) {
var cookies = __webpack_require__(22);
// Add xsrf header
var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?
cookies.read(config.xsrfCookieName) :
undefined;
if (xsrfValue) {
requestHeaders[config.xsrfHeaderName] = xsrfValue;
}
}
// Add headers to the request
if ('setRequestHeader' in request) {
utils.forEach(requestHeaders, function setRequestHeader(val, key) {
if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
// Remove Content-Type if data is undefined
delete requestHeaders[key];
} else {
// Otherwise add header to the request
request.setRequestHeader(key, val);
}
});
}
// Add withCredentials to request if needed
if (config.withCredentials) {
request.withCredentials = true;
}
// Add responseType to request if needed
if (config.responseType) {
try {
request.responseType = config.responseType;
} catch (e) {
if (request.responseType !== 'json') {
throw e;
}
}
}
// Handle progress if needed
if (typeof config.onDownloadProgress === 'function') {
request.addEventListener('progress', config.onDownloadProgress);
}
// Not all browsers support upload events
if (typeof config.onUploadProgress === 'function' && request.upload) {
request.upload.addEventListener('progress', config.onUploadProgress);
}
if (config.cancelToken) {
// Handle cancellation
config.cancelToken.promise.then(function onCanceled(cancel) {
if (!request) {
return;
}
request.abort();
reject(cancel);
// Clean up request
request = null;
});
}
if (requestData === undefined) {
requestData = null;
}
// Send the request
request.send(requestData);
});
};
/***/ }),
/* 4 */
/***/ function(module, exports, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var defaults = __webpack_require__(5);
var utils = __webpack_require__(6);
var dispatchRequest = __webpack_require__(7);
var InterceptorManager = __webpack_require__(15);
var isAbsoluteURL = __webpack_require__(16);
var combineURLs = __webpack_require__(17);
var bind = __webpack_require__(18);
var transformData = __webpack_require__(11);
function Axios(defaultConfig) {
this.defaults = utils.merge({}, defaultConfig);
this.interceptors = {
request: new InterceptorManager(),
response: new InterceptorManager()
};
}
Axios.prototype.request = function request(config) {
/*eslint no-param-reassign:0*/
// Allow for axios('example/url'[, config]) a la fetch API
if (typeof config === 'string') {
config = utils.merge({
url: arguments[0]
}, arguments[1]);
}
config = utils.merge(defaults, this.defaults, { method: 'get' }, config);
// Support baseURL config
if (config.baseURL && !isAbsoluteURL(config.url)) {
config.url = combineURLs(config.baseURL, config.url);
}
// Don't allow overriding defaults.withCredentials
config.withCredentials = config.withCredentials || this.defaults.withCredentials;
// Transform request data
config.data = transformData(
config.data,
config.headers,
config.transformRequest
);
// Flatten headers
config.headers = utils.merge(
config.headers.common || {},
config.headers[config.method] || {},
config.headers || {}
);
utils.forEach(
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
function cleanHeaderConfig(method) {
delete config.headers[method];
}
);
// Hook up interceptors middleware
var chain = [dispatchRequest, undefined];
var promise = Promise.resolve(config);
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
chain.unshift(interceptor.fulfilled, interceptor.rejected);
});
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
chain.push(interceptor.fulfilled, interceptor.rejected);
});
while (chain.length) {
promise = promise.then(chain.shift(), chain.shift());
}
return promise;
};
var defaultInstance = new Axios(defaults);
var axios = module.exports = bind(Axios.prototype.request, defaultInstance);
axios.create = function create(defaultConfig) {
return new Axios(defaultConfig);
};
// Expose defaults
axios.defaults = defaultInstance.defaults;
// Expose all/spread
axios.all = function all(promises) {
return Promise.all(promises);
};
axios.spread = __webpack_require__(19);
// Expose interceptors
axios.interceptors = defaultInstance.interceptors;
// Provide aliases for supported request methods
utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
/*eslint func-names:0*/
Axios.prototype[method] = function(url, config) {
return this.request(utils.merge(config || {}, {
method: method,
url: url
}));
};
axios[method] = bind(Axios.prototype[method], defaultInstance);
});
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
/*eslint func-names:0*/
Axios.prototype[method] = function(url, data, config) {
return this.request(utils.merge(config || {}, {
method: method,
url: url,
data: data
}));
};
axios[method] = bind(Axios.prototype[method], defaultInstance);
});
"use strict";
/***/ },
/**
* A `Cancel` is an object that is thrown when an operation is canceled.
*
* @class
* @param {string=} message The message.
*/
function Cancel(message) {
this.message = message;
}
Cancel.prototype.toString = function toString() {
return 'Cancel' + (this.message ? ': ' + this.message : '');
};
Cancel.prototype.__CANCEL__ = true;
module.exports = Cancel;
/***/ }),
/* 5 */
/***/ function(module, exports, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var utils = __webpack_require__(6);
var PROTECTION_PREFIX = /^\)\]\}',?\n/;
var DEFAULT_CONTENT_TYPE = {
'Content-Type': 'application/x-www-form-urlencoded'
};
module.exports = {
transformRequest: [function transformResponseJSON(data, headers) {
if (utils.isFormData(data)) {
return data;
}
if (utils.isArrayBuffer(data)) {
return data;
}
if (utils.isArrayBufferView(data)) {
return data.buffer;
}
if (utils.isObject(data) && !utils.isFile(data) && !utils.isBlob(data)) {
// Set application/json if no Content-Type has been specified
if (!utils.isUndefined(headers)) {
utils.forEach(headers, function processContentTypeHeader(val, key) {
if (key.toLowerCase() === 'content-type') {
headers['Content-Type'] = val;
}
});
if (utils.isUndefined(headers['Content-Type'])) {
headers['Content-Type'] = 'application/json;charset=utf-8';
}
}
return JSON.stringify(data);
}
return data;
}],
transformResponse: [function transformResponseJSON(data) {
/*eslint no-param-reassign:0*/
if (typeof data === 'string') {
data = data.replace(PROTECTION_PREFIX, '');
try {
data = JSON.parse(data);
} catch (e) { /* Ignore */ }
}
return data;
}],
headers: {
common: {
'Accept': 'application/json, text/plain, */*'
},
patch: utils.merge(DEFAULT_CONTENT_TYPE),
post: utils.merge(DEFAULT_CONTENT_TYPE),
put: utils.merge(DEFAULT_CONTENT_TYPE)
},
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN'
};
"use strict";
/***/ },
module.exports = function isCancel(value) {
return !!(value && value.__CANCEL__);
};
/***/ }),
/* 6 */
/***/ function(module, exports) {
/***/ (function(module, exports, __webpack_require__) {
'use strict';
/*global toString:true*/
// utils is a library of generic helper functions non-specific to axios
var toString = Object.prototype.toString;
/**
* Determine if a value is an Array
*
* @param {Object} val The value to test
* @returns {boolean} True if value is an Array, otherwise false
*/
function isArray(val) {
return toString.call(val) === '[object Array]';
}
/**
* Determine if a value is an ArrayBuffer
*
* @param {Object} val The value to test
* @returns {boolean} True if value is an ArrayBuffer, otherwise false
*/
function isArrayBuffer(val) {
return toString.call(val) === '[object ArrayBuffer]';
}
/**
* Determine if a value is a FormData
*
* @param {Object} val The value to test
* @returns {boolean} True if value is an FormData, otherwise false
*/
function isFormData(val) {
return toString.call(val) === '[object FormData]';
}
/**
* Determine if a value is a view on an ArrayBuffer
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
*/
function isArrayBufferView(val) {
var result;
if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
result = ArrayBuffer.isView(val);
} else {
result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
}
return result;
}
/**
* Determine if a value is a String
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a String, otherwise false
*/
function isString(val) {
return typeof val === 'string';
}
/**
* Determine if a value is a Number
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Number, otherwise false
*/
function isNumber(val) {
return typeof val === 'number';
}
/**
* Determine if a value is undefined
*
* @param {Object} val The value to test
* @returns {boolean} True if the value is undefined, otherwise false
*/
function isUndefined(val) {
return typeof val === 'undefined';
}
/**
* Determine if a value is an Object
*
* @param {Object} val The value to test
* @returns {boolean} True if value is an Object, otherwise false
*/
function isObject(val) {
return val !== null && typeof val === 'object';
}
/**
* Determine if a value is a Date
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Date, otherwise false
*/
function isDate(val) {
return toString.call(val) === '[object Date]';
}
/**
* Determine if a value is a File
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a File, otherwise false
*/
function isFile(val) {
return toString.call(val) === '[object File]';
}
/**
* Determine if a value is a Blob
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Blob, otherwise false
*/
function isBlob(val) {
return toString.call(val) === '[object Blob]';
}
/**
* Trim excess whitespace off the beginning and end of a string
*
* @param {String} str The String to trim
* @returns {String} The String freed of excess whitespace
*/
function trim(str) {
return str.replace(/^\s*/, '').replace(/\s*$/, '');
}
/**
* Determine if we're running in a standard browser environment
*
* This allows axios to run in a web worker, and react-native.
* Both environments support XMLHttpRequest, but not fully standard globals.
*
* web workers:
* typeof window -> undefined
* typeof document -> undefined
*
* react-native:
* typeof document.createElement -> undefined
*/
function isStandardBrowserEnv() {
return (
typeof window !== 'undefined' &&
typeof document !== 'undefined' &&
typeof document.createElement === 'function'
);
}
/**
* Iterate over an Array or an Object invoking a function for each item.
*
* If `obj` is an Array callback will be called passing
* the value, index, and complete array for each item.
*
* If 'obj' is an Object callback will be called passing
* the value, key, and complete object for each property.
*
* @param {Object|Array} obj The object to iterate
* @param {Function} fn The callback to invoke for each item
*/
function forEach(obj, fn) {
// Don't bother if no value provided
if (obj === null || typeof obj === 'undefined') {
return;
}
// Force an array if not already something iterable
if (typeof obj !== 'object' && !isArray(obj)) {
/*eslint no-param-reassign:0*/
obj = [obj];
}
if (isArray(obj)) {
// Iterate over array values
for (var i = 0, l = obj.length; i < l; i++) {
fn.call(null, obj[i], i, obj);
}
} else {
// Iterate over object keys
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
fn.call(null, obj[key], key, obj);
}
}
}
}
/**
* Accepts varargs expecting each argument to be an object, then
* immutably merges the properties of each object and returns result.
*
* When multiple objects contain the same key the later object in
* the arguments list will take precedence.
*
* Example:
*
* ```js
* var result = merge({foo: 123}, {foo: 456});
* console.log(result.foo); // outputs 456
* ```
*
* @param {Object} obj1 Object to merge
* @returns {Object} Result of all merge properties
*/
function merge(/* obj1, obj2, obj3, ... */) {
var result = {};
function assignValue(val, key) {
if (typeof result[key] === 'object' && typeof val === 'object') {
result[key] = merge(result[key], val);
} else {
result[key] = val;
}
}
for (var i = 0, l = arguments.length; i < l; i++) {
forEach(arguments[i], assignValue);
}
return result;
}
module.exports = {
isArray: isArray,
isArrayBuffer: isArrayBuffer,
isFormData: isFormData,
isArrayBufferView: isArrayBufferView,
isString: isString,
isNumber: isNumber,
isObject: isObject,
isUndefined: isUndefined,
isDate: isDate,
isFile: isFile,
isBlob: isBlob,
isStandardBrowserEnv: isStandardBrowserEnv,
forEach: forEach,
merge: merge,
trim: trim
};
"use strict";
/***/ },
var enhanceError = __webpack_require__(16);
/**
* Create an Error with the specified message, config, error code, and response.
*
* @param {string} message The error message.
* @param {Object} config The config.
* @param {string} [code] The error code (for example, 'ECONNABORTED').
@ @param {Object} [response] The response.
* @returns {Error} The created error.
*/
module.exports = function createError(message, config, code, response) {
var error = new Error(message);
return enhanceError(error, config, code, response);
};
/***/ }),
/* 7 */
/***/ function(module, exports, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(process) {'use strict';
/**
* Dispatch a request to the server using whichever adapter
* is supported by the current environment.
*
* @param {object} config The config that is to be used for the request
* @returns {Promise} The Promise to be fulfilled
*/
module.exports = function dispatchRequest(config) {
return new Promise(function executor(resolve, reject) {
try {
var adapter;
if (typeof config.adapter === 'function') {
// For custom adapter support
adapter = config.adapter;
} else if (typeof XMLHttpRequest !== 'undefined') {
// For browsers use XHR adapter
adapter = __webpack_require__(8);
} else if (typeof process !== 'undefined') {
// For node use HTTP adapter
adapter = __webpack_require__(8);
}
if (typeof adapter === 'function') {
adapter(resolve, reject, config);
}
} catch (e) {
reject(e);
}
});
};
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
"use strict";
/***/ },
module.exports = function bind(fn, thisArg) {
return function wrap() {
var args = new Array(arguments.length);
for (var i = 0; i < args.length; i++) {
args[i] = arguments[i];
}
return fn.apply(thisArg, args);
};
};
/***/ }),
/* 8 */
/***/ function(module, exports, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var utils = __webpack_require__(6);
var buildURL = __webpack_require__(9);
var parseHeaders = __webpack_require__(10);
var transformData = __webpack_require__(11);
var isURLSameOrigin = __webpack_require__(12);
var btoa = window.btoa || __webpack_require__(13);
module.exports = function xhrAdapter(resolve, reject, config) {
var requestData = config.data;
var requestHeaders = config.headers;
if (utils.isFormData(requestData)) {
delete requestHeaders['Content-Type']; // Let the browser set it
}
var request = new XMLHttpRequest();
// For IE 8/9 CORS support
// Only supports POST and GET calls and doesn't returns the response headers.
if (window.XDomainRequest && !('withCredentials' in request) && !isURLSameOrigin(config.url)) {
request = new window.XDomainRequest();
}
// HTTP basic authentication
if (config.auth) {
var username = config.auth.username || '';
var password = config.auth.password || '';
requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
}
request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);
// Set the request timeout in MS
request.timeout = config.timeout;
// Listen for ready state
request.onload = function handleLoad() {
if (!request) {
return;
}
// Prepare the response
var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
var responseData = ['text', ''].indexOf(config.responseType || '') !== -1 ? request.responseText : request.response;
var response = {
data: transformData(
responseData,
responseHeaders,
config.transformResponse
),
// IE sends 1223 instead of 204 (https://github.com/mzabriskie/axios/issues/201)
status: request.status === 1223 ? 204 : request.status,
statusText: request.status === 1223 ? 'No Content' : request.statusText,
headers: responseHeaders,
config: config
};
// Resolve or reject the Promise based on the status
((response.status >= 200 && response.status < 300) ||
(!('status' in request) && response.responseText) ?
resolve :
reject)(response);
// Clean up request
request = null;
};
// Handle low level network errors
request.onerror = function handleError() {
// Real errors are hidden from us by the browser
// onerror should only fire if it's a network error
reject(new Error('Network Error'));
// Clean up request
request = null;
};
// Add xsrf header
// This is only done if running in a standard browser environment.
// Specifically not if we're in a web worker, or react-native.
if (utils.isStandardBrowserEnv()) {
var cookies = __webpack_require__(14);
// Add xsrf header
var xsrfValue = config.withCredentials || isURLSameOrigin(config.url) ?
cookies.read(config.xsrfCookieName) :
undefined;
if (xsrfValue) {
requestHeaders[config.xsrfHeaderName] = xsrfValue;
}
}
// Add headers to the request
if ('setRequestHeader' in request) {
utils.forEach(requestHeaders, function setRequestHeader(val, key) {
if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
// Remove Content-Type if data is undefined
delete requestHeaders[key];
} else {
// Otherwise add header to the request
request.setRequestHeader(key, val);
}
});
}
// Add withCredentials to request if needed
if (config.withCredentials) {
request.withCredentials = true;
}
// Add responseType to request if needed
if (config.responseType) {
try {
request.responseType = config.responseType;
} catch (e) {
if (request.responseType !== 'json') {
throw e;
}
}
}
if (utils.isArrayBuffer(requestData)) {
requestData = new DataView(requestData);
}
// Send the request
request.send(requestData);
};
"use strict";
/***/ },
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _axios = __webpack_require__(10);
var _axios2 = _interopRequireDefault(_axios);
var _runMode = __webpack_require__(28);
var _runMode2 = _interopRequireDefault(_runMode);
var _utils = __webpack_require__(2);
var _modes = __webpack_require__(31);
var _modes2 = _interopRequireDefault(_modes);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
var makeUrl = function makeUrl(url, lang) {
return url.replace(/\[language\]/gi, lang);
};
var Profanity = function Profanity() {
var inputOpts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var opts = _extends({
languages: new Map(),
allWords: [],
downloadUrl: '/languages/[language].json',
modes: _modes2.default
}, inputOpts);
var getDownloadUrl = function getDownloadUrl() {
return opts.downloadUrl;
};
var setDownloadUrl = function setDownloadUrl(url) {
return opts.downloadUrl = url;
};
var getLanguages = function getLanguages() {
return [].concat(_toConsumableArray(opts.languages.keys()));
};
var addLanguages = function addLanguages(languages) {
var langsArray = (0, _utils.toArray)(languages).filter(function (lang) {
return !opts.languages.has(lang);
});
return Promise.all(langsArray.map(function (lang) {
return _axios2.default.get(makeUrl(getDownloadUrl(), lang)).then(function (res) {
return res.data;
}).then(function (data) {
opts.languages.set(lang, {
enabled: true,
data: data
});
return getLanguages()[0];
});
}));
};
var addCustomLanguages = function addCustomLanguages(languages) {
var langsArray = (0, _utils.toArray)(languages).filter(function (lang) {
return !opts.languages.has(lang);
});
langsArray.forEach(function (language) {
return opts.languages.set(language, {
enabled: true,
data: []
});
});
return getLanguages();
};
var removeLanguages = function removeLanguages(languages) {
var langsArray = (0, _utils.toArray)(languages);
langsArray.forEach(function (lang) {
return opts.languages.delete(lang);
});
return getLanguages();
};
var getWords = function getWords(language) {
if (!opts.languages.has(language)) return [];
return opts.languages.get(language).data;
};
var updateAllWords = function updateAllWords() {
var allWords = getLanguages().reduce(function (all, lang) {
var words = opts.languages.get(lang).data;
return all.concat(words);
}, []).map(function (word) {
return (0, _utils.escapeSymbols)(word);
});
opts.allWords = allWords;
return allWords;
};
var addWords = function addWords(language, words) {
if (!opts.languages.has(language)) return [];
var wordsArray = (0, _utils.toArray)(words);
var languageObj = opts.languages.get(language);
languageObj.data = [].concat(_toConsumableArray(new Set(languageObj.data.concat(wordsArray))));
opts.languages.set(language, languageObj);
return getWords(language);
};
var removeWords = function removeWords(language, words) {
if (!opts.languages.has(language)) return [];
var wordsArray = (0, _utils.toArray)(words);
var languageObj = opts.languages.get(language);
languageObj.data = languageObj.data.filter(function (word) {
return !wordsArray.includes(word);
});
return getWords(language);
};
var getModes = function getModes() {
return opts.modes.filter(function (item) {
return item.enabled;
}).map(function (item) {
return item.name;
});
};
var setModes = function setModes(iModes) {
var modesArray = (0, _utils.toArray)(iModes).filter(function (mode) {
return opts.modes.find(function (item) {
return item.name === mode;
});
});
// toggle
opts.modes = opts.modes.map(function (item) {
var newItem = item;
if (modesArray.includes(newItem.name)) newItem.enabled = true;else newItem.enabled = false;
return newItem;
});
return getModes();
};
var run = function run(strs) {
var strsArray = (0, _utils.toArray)(strs);
var enabledModes = getModes();
var words = updateAllWords();
var getIndexes = function getIndexes(str, val) {
var indexes = [];
var i = -1;
while ((i = str.indexOf(val, i + 1)) !== -1) {
indexes.push(i);
}
return indexes;
};
return strsArray.map(function (str) {
var badWords = words.reduce(function (all, word) {
var indexes = getIndexes(str, word);
var length = word.length;
if (indexes.length) {
indexes.forEach(function (index) {
var replaced = enabledModes.reduce(function (item, mode) {
var obj = {
mode: mode,
str: (0, _runMode2.default)(opts.modes, mode, word, length)
};
item.push(obj);
return item;
}, []);
all.push({
word: word,
index: index,
length: length,
replaced: replaced
});
});
}
return all;
}, []);
var final = enabledModes.reduce(function (item, mode) {
var modified = item;
var newStr = str;
badWords.forEach(function (badWord) {
var replacedStr = badWord.replaced.find(function (v) {
return v.mode === mode;
}).str;
newStr = newStr.replace(new RegExp(badWord.word, 'i'), replacedStr);
});
modified[mode] = newStr;
return modified;
}, {});
return final;
});
};
return {
getDownloadUrl: getDownloadUrl,
setDownloadUrl: setDownloadUrl,
getLanguages: getLanguages,
addLanguages: addLanguages,
addCustomLanguages: addCustomLanguages,
removeLanguages: removeLanguages,
getWords: getWords,
addWords: addWords,
removeWords: removeWords,
getModes: getModes,
setModes: setModes,
run: run
};
};
exports.default = Profanity;
/***/ }),
/* 9 */
/***/ function(module, exports, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var utils = __webpack_require__(6);
function encode(val) {
return encodeURIComponent(val).
replace(/%40/gi, '@').
replace(/%3A/gi, ':').
replace(/%24/g, '$').
replace(/%2C/gi, ',').
replace(/%20/g, '+').
replace(/%5B/gi, '[').
replace(/%5D/gi, ']');
}
/**
* Build a URL by appending params to the end
*
* @param {string} url The base of the url (e.g., http://www.google.com)
* @param {object} [params] The params to be appended
* @returns {string} The formatted url
*/
module.exports = function buildURL(url, params, paramsSerializer) {
/*eslint no-param-reassign:0*/
if (!params) {
return url;
}
var serializedParams;
if (paramsSerializer) {
serializedParams = paramsSerializer(params);
} else {
var parts = [];
utils.forEach(params, function serialize(val, key) {
if (val === null || typeof val === 'undefined') {
return;
}
if (utils.isArray(val)) {
key = key + '[]';
}
if (!utils.isArray(val)) {
val = [val];
}
utils.forEach(val, function parseValue(v) {
if (utils.isDate(v)) {
v = v.toISOString();
} else if (utils.isObject(v)) {
v = JSON.stringify(v);
}
parts.push(encode(key) + '=' + encode(v));
});
});
serializedParams = parts.join('&');
}
if (serializedParams) {
url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
}
return url;
};
"use strict";
/***/ },
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _utils = __webpack_require__(2);
var makeBundle = function makeBundle(chars, index, f) {
var bundleChars = [];
for (var c = 0; c < f; c += 1) {
var char = chars[index + c] || '';
bundleChars.push(char);
}
var joined = bundleChars.join('');
return joined;
};
var bundleCheck = function bundleCheck(str, frequency) {
var chars = str.split('').reverse();
var checkedChars = [];
chars.map(function (char, index) {
var bundle = makeBundle(chars, index, frequency);
var future = makeBundle(chars, index + frequency, frequency);
if (bundle !== future) checkedChars.push(char);
return true;
});
var checked = checkedChars.reverse().join('');
return checked;
};
var regexpCheck = function regexpCheck(str) {
return str.replace(/(.)\1{3,}/g, '$1$1$1');
};
var Spam = function Spam() {
var inputOpts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var opts = _extends({
frequency: 3
}, inputOpts);
var getFrequency = function getFrequency() {
return opts.frequency;
};
var setFrequency = function setFrequency(frequency) {
return opts.frequency = frequency;
};
var run = function run() {
var strs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
var strsArray = (0, _utils.toArray)(strs);
if (!getFrequency()) return strsArray;
var checked = strsArray.map(function (str) {
return bundleCheck(str, getFrequency());
}).map(function (str) {
return regexpCheck(str);
});
return checked;
};
return {
getFrequency: getFrequency,
setFrequency: setFrequency,
run: run
};
};
exports.default = Spam;
/***/ }),
/* 10 */
/***/ function(module, exports, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var utils = __webpack_require__(6);
/**
* Parse headers into an object
*
* ```
* Date: Wed, 27 Aug 2014 08:58:49 GMT
* Content-Type: application/json
* Connection: keep-alive
* Transfer-Encoding: chunked
* ```
*
* @param {String} headers Headers needing to be parsed
* @returns {Object} Headers parsed into an object
*/
module.exports = function parseHeaders(headers) {
var parsed = {};
var key;
var val;
var i;
if (!headers) { return parsed; }
utils.forEach(headers.split('\n'), function parser(line) {
i = line.indexOf(':');
key = utils.trim(line.substr(0, i)).toLowerCase();
val = utils.trim(line.substr(i + 1));
if (key) {
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
}
});
return parsed;
};
module.exports = __webpack_require__(11);
/***/ },
/***/ }),
/* 11 */
/***/ function(module, exports, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var utils = __webpack_require__(6);
/**
* Transform the data for a request or a response
*
* @param {Object|String} data The data to be transformed
* @param {Array} headers The headers for the request or response
* @param {Array|Function} fns A single function or Array of functions
* @returns {*} The resulting transformed data
*/
module.exports = function transformData(data, headers, fns) {
/*eslint no-param-reassign:0*/
utils.forEach(fns, function transform(fn) {
data = fn(data, headers);
});
return data;
};
"use strict";
/***/ },
var utils = __webpack_require__(0);
var bind = __webpack_require__(7);
var Axios = __webpack_require__(13);
var defaults = __webpack_require__(1);
/**
* Create an instance of Axios
*
* @param {Object} defaultConfig The default config for the instance
* @return {Axios} A new instance of Axios
*/
function createInstance(defaultConfig) {
var context = new Axios(defaultConfig);
var instance = bind(Axios.prototype.request, context);
// Copy axios.prototype to instance
utils.extend(instance, Axios.prototype, context);
// Copy context to instance
utils.extend(instance, context);
return instance;
}
// Create the default instance to be exported
var axios = createInstance(defaults);
// Expose Axios class to allow class inheritance
axios.Axios = Axios;
// Factory for creating new instances
axios.create = function create(instanceConfig) {
return createInstance(utils.merge(defaults, instanceConfig));
};
// Expose Cancel & CancelToken
axios.Cancel = __webpack_require__(4);
axios.CancelToken = __webpack_require__(12);
axios.isCancel = __webpack_require__(5);
// Expose all/spread
axios.all = function all(promises) {
return Promise.all(promises);
};
axios.spread = __webpack_require__(27);
module.exports = axios;
// Allow use of default import syntax in TypeScript
module.exports.default = axios;
/***/ }),
/* 12 */
/***/ function(module, exports, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var utils = __webpack_require__(6);
module.exports = (
utils.isStandardBrowserEnv() ?
// Standard browser envs have full support of the APIs needed to test
// whether the request URL is of the same origin as current location.
(function standardBrowserEnv() {
var msie = /(msie|trident)/i.test(navigator.userAgent);
var urlParsingNode = document.createElement('a');
var originURL;
/**
* Parse a URL to discover it's components
*
* @param {String} url The URL to be parsed
* @returns {Object}
*/
function resolveURL(url) {
var href = url;
if (msie) {
// IE needs attribute set twice to normalize properties
urlParsingNode.setAttribute('href', href);
href = urlParsingNode.href;
}
urlParsingNode.setAttribute('href', href);
// urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
return {
href: urlParsingNode.href,
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
host: urlParsingNode.host,
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
hostname: urlParsingNode.hostname,
port: urlParsingNode.port,
pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
urlParsingNode.pathname :
'/' + urlParsingNode.pathname
};
}
originURL = resolveURL(window.location.href);
/**
* Determine if a URL shares the same origin as the current location
*
* @param {String} requestURL The URL to test
* @returns {boolean} True if URL shares the same origin, otherwise false
*/
return function isURLSameOrigin(requestURL) {
var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
return (parsed.protocol === originURL.protocol &&
parsed.host === originURL.host);
};
})() :
// Non standard browser envs (web workers, react-native) lack needed support.
(function nonStandardBrowserEnv() {
return function isURLSameOrigin() {
return true;
};
})()
);
"use strict";
/***/ },
var Cancel = __webpack_require__(4);
/**
* A `CancelToken` is an object that can be used to request cancellation of an operation.
*
* @class
* @param {Function} executor The executor function.
*/
function CancelToken(executor) {
if (typeof executor !== 'function') {
throw new TypeError('executor must be a function.');
}
var resolvePromise;
this.promise = new Promise(function promiseExecutor(resolve) {
resolvePromise = resolve;
});
var token = this;
executor(function cancel(message) {
if (token.reason) {
// Cancellation has already been requested
return;
}
token.reason = new Cancel(message);
resolvePromise(token.reason);
});
}
/**
* Throws a `Cancel` if cancellation has been requested.
*/
CancelToken.prototype.throwIfRequested = function throwIfRequested() {
if (this.reason) {
throw this.reason;
}
};
/**
* Returns an object that contains a new `CancelToken` and a function that, when called,
* cancels the `CancelToken`.
*/
CancelToken.source = function source() {
var cancel;
var token = new CancelToken(function executor(c) {
cancel = c;
});
return {
token: token,
cancel: cancel
};
};
module.exports = CancelToken;
/***/ }),
/* 13 */
/***/ function(module, exports) {
/***/ (function(module, exports, __webpack_require__) {
'use strict';
// btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
function InvalidCharacterError(message) {
this.message = message;
}
InvalidCharacterError.prototype = new Error;
InvalidCharacterError.prototype.code = 5;
InvalidCharacterError.prototype.name = 'InvalidCharacterError';
function btoa(input) {
var str = String(input);
var output = '';
for (
// initialize result and counter
var block, charCode, idx = 0, map = chars;
// if the next str index does not exist:
// change the mapping table to "="
// check if d has no fractional digits
str.charAt(idx | 0) || (map = '=', idx % 1);
// "8 - idx % 1 * 8" generates the sequence 2, 4, 6, 8
output += map.charAt(63 & block >> 8 - idx % 1 * 8)
) {
charCode = str.charCodeAt(idx += 3 / 4);
if (charCode > 0xFF) {
throw new InvalidCharacterError('INVALID_CHARACTER_ERR: DOM Exception 5');
}
block = block << 8 | charCode;
}
return output;
}
module.exports = btoa;
"use strict";
/***/ },
var defaults = __webpack_require__(1);
var utils = __webpack_require__(0);
var InterceptorManager = __webpack_require__(14);
var dispatchRequest = __webpack_require__(15);
var isAbsoluteURL = __webpack_require__(23);
var combineURLs = __webpack_require__(21);
/**
* Create a new instance of Axios
*
* @param {Object} instanceConfig The default config for the instance
*/
function Axios(instanceConfig) {
this.defaults = instanceConfig;
this.interceptors = {
request: new InterceptorManager(),
response: new InterceptorManager()
};
}
/**
* Dispatch a request
*
* @param {Object} config The config specific for this request (merged with this.defaults)
*/
Axios.prototype.request = function request(config) {
/*eslint no-param-reassign:0*/
// Allow for axios('example/url'[, config]) a la fetch API
if (typeof config === 'string') {
config = utils.merge({
url: arguments[0]
}, arguments[1]);
}
config = utils.merge(defaults, this.defaults, { method: 'get' }, config);
// Support baseURL config
if (config.baseURL && !isAbsoluteURL(config.url)) {
config.url = combineURLs(config.baseURL, config.url);
}
// Hook up interceptors middleware
var chain = [dispatchRequest, undefined];
var promise = Promise.resolve(config);
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
chain.unshift(interceptor.fulfilled, interceptor.rejected);
});
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
chain.push(interceptor.fulfilled, interceptor.rejected);
});
while (chain.length) {
promise = promise.then(chain.shift(), chain.shift());
}
return promise;
};
// Provide aliases for supported request methods
utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
/*eslint func-names:0*/
Axios.prototype[method] = function(url, config) {
return this.request(utils.merge(config || {}, {
method: method,
url: url
}));
};
});
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
/*eslint func-names:0*/
Axios.prototype[method] = function(url, data, config) {
return this.request(utils.merge(config || {}, {
method: method,
url: url,
data: data
}));
};
});
module.exports = Axios;
/***/ }),
/* 14 */
/***/ function(module, exports, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var utils = __webpack_require__(6);
module.exports = (
utils.isStandardBrowserEnv() ?
// Standard browser envs support document.cookie
(function standardBrowserEnv() {
return {
write: function write(name, value, expires, path, domain, secure) {
var cookie = [];
cookie.push(name + '=' + encodeURIComponent(value));
if (utils.isNumber(expires)) {
cookie.push('expires=' + new Date(expires).toGMTString());
}
if (utils.isString(path)) {
cookie.push('path=' + path);
}
if (utils.isString(domain)) {
cookie.push('domain=' + domain);
}
if (secure === true) {
cookie.push('secure');
}
document.cookie = cookie.join('; ');
},
read: function read(name) {
var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
return (match ? decodeURIComponent(match[3]) : null);
},
remove: function remove(name) {
this.write(name, '', Date.now() - 86400000);
}
};
})() :
// Non standard browser env (web workers, react-native) lack needed support.
(function nonStandardBrowserEnv() {
return {
write: function write() {},
read: function read() { return null; },
remove: function remove() {}
};
})()
);
"use strict";
/***/ },
var utils = __webpack_require__(0);
function InterceptorManager() {
this.handlers = [];
}
/**
* Add a new interceptor to the stack
*
* @param {Function} fulfilled The function to handle `then` for a `Promise`
* @param {Function} rejected The function to handle `reject` for a `Promise`
*
* @return {Number} An ID used to remove interceptor later
*/
InterceptorManager.prototype.use = function use(fulfilled, rejected) {
this.handlers.push({
fulfilled: fulfilled,
rejected: rejected
});
return this.handlers.length - 1;
};
/**
* Remove an interceptor from the stack
*
* @param {Number} id The ID that was returned by `use`
*/
InterceptorManager.prototype.eject = function eject(id) {
if (this.handlers[id]) {
this.handlers[id] = null;
}
};
/**
* Iterate over all the registered interceptors
*
* This method is particularly useful for skipping over any
* interceptors that may have become `null` calling `eject`.
*
* @param {Function} fn The function to call for each interceptor
*/
InterceptorManager.prototype.forEach = function forEach(fn) {
utils.forEach(this.handlers, function forEachHandler(h) {
if (h !== null) {
fn(h);
}
});
};
module.exports = InterceptorManager;
/***/ }),
/* 15 */
/***/ function(module, exports, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
'use strict';
var utils = __webpack_require__(6);
function InterceptorManager() {
this.handlers = [];
}
/**
* Add a new interceptor to the stack
*
* @param {Function} fulfilled The function to handle `then` for a `Promise`
* @param {Function} rejected The function to handle `reject` for a `Promise`
*
* @return {Number} An ID used to remove interceptor later
*/
InterceptorManager.prototype.use = function use(fulfilled, rejected) {
this.handlers.push({
fulfilled: fulfilled,
rejected: rejected
});
return this.handlers.length - 1;
};
/**
* Remove an interceptor from the stack
*
* @param {Number} id The ID that was returned by `use`
*/
InterceptorManager.prototype.eject = function eject(id) {
if (this.handlers[id]) {
this.handlers[id] = null;
}
};
/**
* Iterate over all the registered interceptors
*
* This method is particularly useful for skipping over any
* interceptors that may have become `null` calling `eject`.
*
* @param {Function} fn The function to call for each interceptor
*/
InterceptorManager.prototype.forEach = function forEach(fn) {
utils.forEach(this.handlers, function forEachHandler(h) {
if (h !== null) {
fn(h);
}
});
};
module.exports = InterceptorManager;
"use strict";
/***/ },
var utils = __webpack_require__(0);
var transformData = __webpack_require__(18);
var isCancel = __webpack_require__(5);
var defaults = __webpack_require__(1);
/**
* Throws a `Cancel` if cancellation has been requested.
*/
function throwIfCancellationRequested(config) {
if (config.cancelToken) {
config.cancelToken.throwIfRequested();
}
}
/**
* Dispatch a request to the server using the configured adapter.
*
* @param {object} config The config that is to be used for the request
* @returns {Promise} The Promise to be fulfilled
*/
module.exports = function dispatchRequest(config) {
throwIfCancellationRequested(config);
// Ensure headers exist
config.headers = config.headers || {};
// Transform request data
config.data = transformData(
config.data,
config.headers,
config.transformRequest
);
// Flatten headers
config.headers = utils.merge(
config.headers.common || {},
config.headers[config.method] || {},
config.headers || {}
);
utils.forEach(
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
function cleanHeaderConfig(method) {
delete config.headers[method];
}
);
var adapter = config.adapter || defaults.adapter;
return adapter(config).then(function onAdapterResolution(response) {
throwIfCancellationRequested(config);
// Transform response data
response.data = transformData(
response.data,
response.headers,
config.transformResponse
);
return response;
}, function onAdapterRejection(reason) {
if (!isCancel(reason)) {
throwIfCancellationRequested(config);
// Transform response data
if (reason && reason.response) {
reason.response.data = transformData(
reason.response.data,
reason.response.headers,
config.transformResponse
);
}
}
return Promise.reject(reason);
});
};
/***/ }),
/* 16 */
/***/ function(module, exports) {
/***/ (function(module, exports, __webpack_require__) {
'use strict';
/**
* Determines whether the specified URL is absolute
*
* @param {string} url The URL to test
* @returns {boolean} True if the specified URL is absolute, otherwise false
*/
module.exports = function isAbsoluteURL(url) {
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
// by any combination of letters, digits, plus, period, or hyphen.
return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
};
"use strict";
/***/ },
/**
* Update an Error with the specified config, error code, and response.
*
* @param {Error} error The error to update.
* @param {Object} config The config.
* @param {string} [code] The error code (for example, 'ECONNABORTED').
@ @param {Object} [response] The response.
* @returns {Error} The error.
*/
module.exports = function enhanceError(error, config, code, response) {
error.config = config;
if (code) {
error.code = code;
}
error.response = response;
return error;
};
/***/ }),
/* 17 */
/***/ function(module, exports) {
/***/ (function(module, exports, __webpack_require__) {
'use strict';
/**
* Creates a new URL by combining the specified URLs
*
* @param {string} baseURL The base URL
* @param {string} relativeURL The relative URL
* @returns {string} The combined URL
*/
module.exports = function combineURLs(baseURL, relativeURL) {
return baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '');
};
"use strict";
/***/ },
var createError = __webpack_require__(6);
/**
* Resolve or reject a Promise based on response status.
*
* @param {Function} resolve A function that resolves the promise.
* @param {Function} reject A function that rejects the promise.
* @param {object} response The response.
*/
module.exports = function settle(resolve, reject, response) {
var validateStatus = response.config.validateStatus;
// Note: status is not exposed by XDomainRequest
if (!response.status || !validateStatus || validateStatus(response.status)) {
resolve(response);
} else {
reject(createError(
'Request failed with status code ' + response.status,
response.config,
null,
response
));
}
};
/***/ }),
/* 18 */
/***/ function(module, exports) {
/***/ (function(module, exports, __webpack_require__) {
'use strict';
module.exports = function bind(fn, thisArg) {
return function wrap() {
var args = new Array(arguments.length);
for (var i = 0; i < args.length; i++) {
args[i] = arguments[i];
}
return fn.apply(thisArg, args);
};
};
"use strict";
/***/ },
var utils = __webpack_require__(0);
/**
* Transform the data for a request or a response
*
* @param {Object|String} data The data to be transformed
* @param {Array} headers The headers for the request or response
* @param {Array|Function} fns A single function or Array of functions
* @returns {*} The resulting transformed data
*/
module.exports = function transformData(data, headers, fns) {
/*eslint no-param-reassign:0*/
utils.forEach(fns, function transform(fn) {
data = fn(data, headers);
});
return data;
};
/***/ }),
/* 19 */
/***/ function(module, exports) {
/***/ (function(module, exports, __webpack_require__) {
'use strict';
/**
* Syntactic sugar for invoking a function and expanding an array for arguments.
*
* Common use case would be to use `Function.prototype.apply`.
*
* ```js
* function f(x, y, z) {}
* var args = [1, 2, 3];
* f.apply(null, args);
* ```
*
* With `spread` this example can be re-written.
*
* ```js
* spread(function(x, y, z) {})([1, 2, 3]);
* ```
*
* @param {Function} callback
* @returns {Function}
*/
module.exports = function spread(callback) {
return function wrap(arr) {
return callback.apply(null, arr);
};
};
"use strict";
/***/ },
// btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
function E() {
this.message = 'String contains an invalid character';
}
E.prototype = new Error;
E.prototype.code = 5;
E.prototype.name = 'InvalidCharacterError';
function btoa(input) {
var str = String(input);
var output = '';
for (
// initialize result and counter
var block, charCode, idx = 0, map = chars;
// if the next str index does not exist:
// change the mapping table to "="
// check if d has no fractional digits
str.charAt(idx | 0) || (map = '=', idx % 1);
// "8 - idx % 1 * 8" generates the sequence 2, 4, 6, 8
output += map.charAt(63 & block >> 8 - idx % 1 * 8)
) {
charCode = str.charCodeAt(idx += 3 / 4);
if (charCode > 0xFF) {
throw new E();
}
block = block << 8 | charCode;
}
return output;
}
module.exports = btoa;
/***/ }),
/* 20 */
/***/ function(module, exports) {
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var arrRemove = function arrRemove(arr, item) {
while (arr.indexOf(item) !== -1) {
var index = arr.indexOf(item);
arr = arr.splice(index, 1);
}
return arr;
};
var whatIs = function whatIs() {
var item = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0];
var def = 'Null';
if (item == null) {
return def;
}
var stringify = item.constructor.toString();
return stringify == Array.toString() ? 'Array' : stringify == String.toString() ? 'String' : stringify == Number.toString() ? 'Number' : stringify == Object.toString() ? 'Object' : stringify == Function.toString() ? 'Function' : def;
};
var toArray = function toArray(item) {
var constructor = whatIs(item);
return constructor == 'Array' ? item : constructor == 'Number' || constructor == 'String' ? [item] : null;
};
var randomRange = function randomRange() {
var min = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0];
var max = arguments.length <= 1 || arguments[1] === undefined ? 101 : arguments[1];
return Math.floor(Math.random() * (max - min) + min);
};
var logger = function logger() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator = args[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var argument = _step.value;
console.log('Profam:', argument);
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return) {
_iterator.return();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
};
var escapeSymbols = function escapeSymbols(str) {
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
};
exports.arrRemove = arrRemove;
exports.whatIs = whatIs;
exports.toArray = toArray;
exports.randomRange = randomRange;
exports.logger = logger;
exports.escapeSymbols = escapeSymbols;
"use strict";
/***/ },
var utils = __webpack_require__(0);
function encode(val) {
return encodeURIComponent(val).
replace(/%40/gi, '@').
replace(/%3A/gi, ':').
replace(/%24/g, '$').
replace(/%2C/gi, ',').
replace(/%20/g, '+').
replace(/%5B/gi, '[').
replace(/%5D/gi, ']');
}
/**
* Build a URL by appending params to the end
*
* @param {string} url The base of the url (e.g., http://www.google.com)
* @param {object} [params] The params to be appended
* @returns {string} The formatted url
*/
module.exports = function buildURL(url, params, paramsSerializer) {
/*eslint no-param-reassign:0*/
if (!params) {
return url;
}
var serializedParams;
if (paramsSerializer) {
serializedParams = paramsSerializer(params);
} else if (utils.isURLSearchParams(params)) {
serializedParams = params.toString();
} else {
var parts = [];
utils.forEach(params, function serialize(val, key) {
if (val === null || typeof val === 'undefined') {
return;
}
if (utils.isArray(val)) {
key = key + '[]';
}
if (!utils.isArray(val)) {
val = [val];
}
utils.forEach(val, function parseValue(v) {
if (utils.isDate(v)) {
v = v.toISOString();
} else if (utils.isObject(v)) {
v = JSON.stringify(v);
}
parts.push(encode(key) + '=' + encode(v));
});
});
serializedParams = parts.join('&');
}
if (serializedParams) {
url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
}
return url;
};
/***/ }),
/* 21 */
/***/ function(module, exports, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _utils = __webpack_require__(20);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var spam = function () {
function spam() {
_classCallCheck(this, spam);
this.enable = 0;
this.frequency = 3;
}
// I\O
_createClass(spam, [{
key: 'setFrequency',
value: function setFrequency(f) {
this.frequency = f;
}
// Spam functionality
}, {
key: 'proceed',
value: function proceed() {
var _this = this;
var strings = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0];
strings = (0, _utils.toArray)(strings);
return strings.map(function (str) {
var frequencyCheck = function frequencyCheck(str) {
var times = _this.frequency;
var _loop = function _loop(i) {
var reverted = str.split('').reverse();
var newArr = [];
reverted.forEach(function (char, i1) {
var bundle = makeBundle(reverted, i1, times);
var future = makeBundle(reverted, i1 + times, times);
if (bundle !== future) {
newArr.push(char);
}
});
str = newArr.reverse().join('');
};
for (var i = 0; i < times; i++) {
_loop(i);
}
return str;
};
var makeBundle = function makeBundle(arr, i, times) {
var bundleStr = [];
for (var c = 0; c < times; c++) {
bundleStr.push(arr[i + c] || '');
}
bundleStr = bundleStr.join('');
return bundleStr;
};
return frequencyCheck(str.replace(/(.)\1{3,}/g, '$1$1$1'));
});
}
}]);
return spam;
}();
;
exports.default = spam;
"use strict";
/***/ }
/******/ ])
/**
* Creates a new URL by combining the specified URLs
*
* @param {string} baseURL The base URL
* @param {string} relativeURL The relative URL
* @returns {string} The combined URL
*/
module.exports = function combineURLs(baseURL, relativeURL) {
return baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '');
};
/***/ }),
/* 22 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var utils = __webpack_require__(0);
module.exports = (
utils.isStandardBrowserEnv() ?
// Standard browser envs support document.cookie
(function standardBrowserEnv() {
return {
write: function write(name, value, expires, path, domain, secure) {
var cookie = [];
cookie.push(name + '=' + encodeURIComponent(value));
if (utils.isNumber(expires)) {
cookie.push('expires=' + new Date(expires).toGMTString());
}
if (utils.isString(path)) {
cookie.push('path=' + path);
}
if (utils.isString(domain)) {
cookie.push('domain=' + domain);
}
if (secure === true) {
cookie.push('secure');
}
document.cookie = cookie.join('; ');
},
read: function read(name) {
var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
return (match ? decodeURIComponent(match[3]) : null);
},
remove: function remove(name) {
this.write(name, '', Date.now() - 86400000);
}
};
})() :
// Non standard browser env (web workers, react-native) lack needed support.
(function nonStandardBrowserEnv() {
return {
write: function write() {},
read: function read() { return null; },
remove: function remove() {}
};
})()
);
/***/ }),
/* 23 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Determines whether the specified URL is absolute
*
* @param {string} url The URL to test
* @returns {boolean} True if the specified URL is absolute, otherwise false
*/
module.exports = function isAbsoluteURL(url) {
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
// by any combination of letters, digits, plus, period, or hyphen.
return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
};
/***/ }),
/* 24 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var utils = __webpack_require__(0);
module.exports = (
utils.isStandardBrowserEnv() ?
// Standard browser envs have full support of the APIs needed to test
// whether the request URL is of the same origin as current location.
(function standardBrowserEnv() {
var msie = /(msie|trident)/i.test(navigator.userAgent);
var urlParsingNode = document.createElement('a');
var originURL;
/**
* Parse a URL to discover it's components
*
* @param {String} url The URL to be parsed
* @returns {Object}
*/
function resolveURL(url) {
var href = url;
if (msie) {
// IE needs attribute set twice to normalize properties
urlParsingNode.setAttribute('href', href);
href = urlParsingNode.href;
}
urlParsingNode.setAttribute('href', href);
// urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
return {
href: urlParsingNode.href,
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
host: urlParsingNode.host,
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
hostname: urlParsingNode.hostname,
port: urlParsingNode.port,
pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
urlParsingNode.pathname :
'/' + urlParsingNode.pathname
};
}
originURL = resolveURL(window.location.href);
/**
* Determine if a URL shares the same origin as the current location
*
* @param {String} requestURL The URL to test
* @returns {boolean} True if URL shares the same origin, otherwise false
*/
return function isURLSameOrigin(requestURL) {
var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
return (parsed.protocol === originURL.protocol &&
parsed.host === originURL.host);
};
})() :
// Non standard browser envs (web workers, react-native) lack needed support.
(function nonStandardBrowserEnv() {
return function isURLSameOrigin() {
return true;
};
})()
);
/***/ }),
/* 25 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var utils = __webpack_require__(0);
module.exports = function normalizeHeaderName(headers, normalizedName) {
utils.forEach(headers, function processHeader(value, name) {
if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
headers[normalizedName] = value;
delete headers[name];
}
});
};
/***/ }),
/* 26 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var utils = __webpack_require__(0);
/**
* Parse headers into an object
*
* ```
* Date: Wed, 27 Aug 2014 08:58:49 GMT
* Content-Type: application/json
* Connection: keep-alive
* Transfer-Encoding: chunked
* ```
*
* @param {String} headers Headers needing to be parsed
* @returns {Object} Headers parsed into an object
*/
module.exports = function parseHeaders(headers) {
var parsed = {};
var key;
var val;
var i;
if (!headers) { return parsed; }
utils.forEach(headers.split('\n'), function parser(line) {
i = line.indexOf(':');
key = utils.trim(line.substr(0, i)).toLowerCase();
val = utils.trim(line.substr(i + 1));
if (key) {
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
}
});
return parsed;
};
/***/ }),
/* 27 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* Syntactic sugar for invoking a function and expanding an array for arguments.
*
* Common use case would be to use `Function.prototype.apply`.
*
* ```js
* function f(x, y, z) {}
* var args = [1, 2, 3];
* f.apply(null, args);
* ```
*
* With `spread` this example can be re-written.
*
* ```js
* spread(function(x, y, z) {})([1, 2, 3]);
* ```
*
* @param {Function} callback
* @returns {Function}
*/
module.exports = function spread(callback) {
return function wrap(arr) {
return callback.apply(null, arr);
};
};
/***/ }),
/* 28 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
;
var _utils = __webpack_require__(2);
var emptyList = {
data: []
};
var modeFunny = function modeFunny(modes) {
var mode = modes.find(function (item) {
return item.name === 'funny';
}) || emptyList;
var data = mode.data;
return data[(0, _utils.randomRange)(0, data.length)] || '';
};
var modeSpaces = function modeSpaces(length) {
return ' '.repeat(length);
};
var modeBlack = function modeBlack(length) {
return '&#9632;'.repeat(length);
};
var modeAsterisksFull = function modeAsterisksFull(length) {
return '*'.repeat(length);
};
var modeAsterisksObscure = function modeAsterisksObscure(word, length) {
return word[0] + '*'.repeat(length - 2) + word[word.length - 1];
};
var modeBeep = function modeBeep() {
return 'BEEP';
};
var modeGrawlix = function modeGrawlix(modes, word) {
var mode = modes.find(function (item) {
return item.name === 'grawlix';
}) || emptyList;
var data = mode.data;
return word.split('').map(function () {
return data[(0, _utils.randomRange)(0, data.length)];
}).join('');
};
var modeHide = function modeHide() {
return '';
};
var runMode = function runMode(modes, mode, word, length) {
switch (mode) {
case 'funny':
{
return modeFunny(modes);
}
case 'spaces':
{
return modeSpaces(length);
}
case 'black':
{
return modeBlack(length);
}
case 'asterisks-full':
{
return modeAsterisksFull(length);
}
case 'asterisks-obscure':
{
return modeAsterisksObscure(word, length);
}
case 'beep':
{
return modeBeep();
}
case 'grawlix':
{
return modeGrawlix(modes, word);
}
case 'hide':
{
return modeHide();
}
default:
{
return modeGrawlix(modes, word);
}
}
};
exports.default = runMode;
/***/ }),
/* 29 */
/***/ (function(module, exports) {
// shim for using process in browser
var process = module.exports = {};
// cached from whatever global is present so that test runners that stub it
// don't break things. But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals. It's inside a
// function because try/catches deoptimize in certain engines.
var cachedSetTimeout;
var cachedClearTimeout;
function defaultSetTimout() {
throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout () {
throw new Error('clearTimeout has not been defined');
}
(function () {
try {
if (typeof setTimeout === 'function') {
cachedSetTimeout = setTimeout;
} else {
cachedSetTimeout = defaultSetTimout;
}
} catch (e) {
cachedSetTimeout = defaultSetTimout;
}
try {
if (typeof clearTimeout === 'function') {
cachedClearTimeout = clearTimeout;
} else {
cachedClearTimeout = defaultClearTimeout;
}
} catch (e) {
cachedClearTimeout = defaultClearTimeout;
}
} ())
function runTimeout(fun) {
if (cachedSetTimeout === setTimeout) {
//normal enviroments in sane situations
return setTimeout(fun, 0);
}
// if setTimeout wasn't available but was latter defined
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
cachedSetTimeout = setTimeout;
return setTimeout(fun, 0);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedSetTimeout(fun, 0);
} catch(e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedSetTimeout.call(null, fun, 0);
} catch(e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
return cachedSetTimeout.call(this, fun, 0);
}
}
}
function runClearTimeout(marker) {
if (cachedClearTimeout === clearTimeout) {
//normal enviroments in sane situations
return clearTimeout(marker);
}
// if clearTimeout wasn't available but was latter defined
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
cachedClearTimeout = clearTimeout;
return clearTimeout(marker);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedClearTimeout(marker);
} catch (e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedClearTimeout.call(null, marker);
} catch (e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
return cachedClearTimeout.call(this, marker);
}
}
}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
if (!draining || !currentQueue) {
return;
}
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = runTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while(len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
currentQueue[queueIndex].run();
}
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
runClearTimeout(timeout);
}
process.nextTick = function (fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
runTimeout(drainQueue);
}
};
// v8 likes predictible objects
function Item(fun, array) {
this.fun = fun;
this.array = array;
}
Item.prototype.run = function () {
this.fun.apply(null, this.array);
};
process.title = 'browser';
process.browser = true;
process.env = {};
process.argv = [];
process.version = ''; // empty string to avoid regexp issues
process.versions = {};
function noop() {}
process.on = noop;
process.addListener = noop;
process.once = noop;
process.off = noop;
process.removeListener = noop;
process.removeAllListeners = noop;
process.emit = noop;
process.binding = function (name) {
throw new Error('process.binding is not supported');
};
process.cwd = function () { return '/' };
process.chdir = function (dir) {
throw new Error('process.chdir is not supported');
};
process.umask = function() { return 0; };
/***/ }),
/* 30 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
* type-name - Just a reasonable typeof
*
* https://github.com/twada/type-name
*
* Copyright (c) 2014-2016 Takuto Wada
* Licensed under the MIT license.
* https://github.com/twada/type-name/blob/master/LICENSE
*/
var toStr = Object.prototype.toString;
function funcName (f) {
if (f.name) {
return f.name;
}
var match = /^\s*function\s*([^\(]*)/im.exec(f.toString());
return match ? match[1] : '';
}
function ctorName (obj) {
var strName = toStr.call(obj).slice(8, -1);
if ((strName === 'Object' || strName === 'Error') && obj.constructor) {
return funcName(obj.constructor);
}
return strName;
}
function typeName (val) {
var type;
if (val === null) {
return 'null';
}
type = typeof val;
if (type === 'object') {
return ctorName(val);
}
return type;
}
module.exports = typeName;
/***/ }),
/* 31 */
/***/ (function(module, exports) {
module.exports = [
{
"name": "asterisks-obscure",
"enabled": true,
"data": []
},
{
"name": "asterisks-full",
"enabled": false,
"data": []
},
{
"name": "funny",
"enabled": false,
"data": [
"bunnies",
"butterfly",
"kitten",
"love",
"gingerly",
"flowers",
"puppy",
"joyful",
"rainbows",
"unicorn"
]
},
{
"name": "grawlix",
"enabled": false,
"data": [
"!",
"@",
"#",
"$",
"%",
"~",
"*"
]
},
{
"name": "spaces",
"enabled": false,
"data": []
},
{
"name": "black",
"enabled": false,
"data": []
},
{
"name": "hide",
"enabled": false,
"data": []
},
{
"name": "beep",
"enabled": false,
"data": []
}
];
/***/ }),
/* 32 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Spam = exports.Profanity = undefined;
var _profanity = __webpack_require__(8);
var _profanity2 = _interopRequireDefault(_profanity);
var _spam = __webpack_require__(9);
var _spam2 = _interopRequireDefault(_spam);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.Profanity = _profanity2.default;
exports.Spam = _spam2.default;
/***/ })
/******/ ]);
});
//# sourceMappingURL=profam.js.map

@@ -1,2 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("profam",[],t):"object"==typeof exports?exports.profam=t():e.profam=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){(function(t){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=r(2),u=n(i),s=r(21),c=n(s);r(20);e.exports=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?null:arguments[0];if(o(this,e),this.profanity=new u["default"],this.spam=new c["default"],null!==t){var r=Object.keys(t),n=!0,a=!1,i=void 0;try{for(var s,l=r[Symbol.iterator]();!(n=(s=l.next()).done);n=!0){var f=s.value;"profanity"==f||"spam"==f?this[f]=Object.assign(this[f],t[f]):this[f]=t[f]}}catch(d){a=!0,i=d}finally{try{!n&&l["return"]&&l["return"]()}finally{if(a)throw i}}}}return a(e,[{key:"proceed",value:function(e){return e=this.spam.enable?this.spam.proceed(e):e,e=this.profanity.enable?this.profanity.proceed(e):e}}]),e}()}).call(t,r(1))},function(e,t){function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function o(e){if(l===setTimeout)return setTimeout(e,0);if((l===r||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function a(e){if(f===clearTimeout)return clearTimeout(e);if((f===n||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(e);try{return f(e)}catch(t){try{return f.call(null,e)}catch(t){return f.call(this,e)}}}function i(){y&&p&&(y=!1,p.length?h=p.concat(h):v=-1,h.length&&u())}function u(){if(!y){var e=o(i);y=!0;for(var t=h.length;t;){for(p=h,h=[];++v<t;)p&&p[v].run();v=-1,t=h.length}p=null,y=!1,a(e)}}function s(e,t){this.fun=e,this.array=t}function c(){}var l,f,d=e.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:r}catch(e){l=r}try{f="function"==typeof clearTimeout?clearTimeout:n}catch(e){f=n}}();var p,h=[],y=!1,v=-1;d.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];h.push(new s(e,t)),1!==h.length||y||o(u)},s.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=c,d.addListener=c,d.once=c,d.off=c,d.removeListener=c,d.removeAllListeners=c,d.emit=c,d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function o(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=r(3),c=n(s),l=r(20),f=function(){function e(){a(this,e),this.enable=1,this.locales=new Map,this.localesDir=null,this.modes=new Map([["asterisks-obscure",{enabled:1}],["asterisks-full",{enabled:0}],["choice",{enabled:0,data:[]}],["funny",{enabled:0,data:["bunnies","butterfly","kitten","love","gingerly","flowers","puppy","joyful","rainbows","unicorn"]}],["grawlix",{enabled:0}],["spaces",{enabled:0}],["black",{enabled:0}],["hide",{enabled:0}],["beep",{enabled:0}]]),this.wholeWord=0}return u(e,[{key:"makeUrl",value:function(){var e=arguments.length<=0||void 0===arguments[0]?null:arguments[0];return null!==this.localesDir?this.localesDir.replace(/\[locale\]/g,e):void(0,l.logger)("Locale provided is undefined or null, Usage: .makeUrl(<string>)")}},{key:"setLocalesDir",value:function(){var e=arguments.length<=0||void 0===arguments[0]?null:arguments[0];null!==e?this.localesDir=e:(0,l.logger)("Invalid locales dir provided")}},{key:"setLocales",value:function(){var e=arguments.length<=0||void 0===arguments[0]?[]:arguments[0],t=this,r=arguments.length<=1||void 0===arguments[1]?0:arguments[1],n=arguments.length<=2||void 0===arguments[2]?0:arguments[2],a=this;e=(0,l.toArray)(e),n||a.locales.clear();var i=function(e){var t;(t=a.locales).set.apply(t,o(e))};e.length?e.filter(function(e){return!t.locales.has(e)}).forEach(function(e){if(r)i([e,{enabled:1,available:1,data:[]}]);else{var n=t.makeUrl(e);c["default"].get(n).then(function(t){i([e,{enabled:1,available:1,data:t.data}])})["catch"](function(e){(0,l.logger)("Tried to download locale but catched an error",e)})}}):(0,l.logger)("Provided empty string or array, Usage: .downloadLocales(<string/array>)")}},{key:"setModes",value:function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?null:arguments[0];null!==t?(t=(0,l.toArray)(t),[].concat(o(this.modes.keys())).forEach(function(r){var n=0,o=e.modes.get(r);t.indexOf(r)!==-1&&(n=1),o.enabled=n,e.modes.set(r,o)}),(0,l.logger)("Added Modes",t)):(0,l.logger)("setModes received null")}},{key:"addChoices",value:function(){var e,t=arguments.length<=0||void 0===arguments[0]?[]:arguments[0],r=arguments.length<=1||void 0===arguments[1]?1:arguments[1];t=(0,l.toArray)(t);var n=this.modes.get("choice");return r||(n.data=[]),(e=n.data).push.apply(e,o(t)),n.data=[].concat(o(new Set(n.data))),this.modes.set("choice",n),n.data}},{key:"addWords",value:function(){var e=arguments.length<=0||void 0===arguments[0]?null:arguments[0],t=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],r=arguments.length<=2||void 0===arguments[2]||arguments[2];if(t=(0,l.toArray)(t),this.locales.has(e)){var n,a=this.locales.get(e);return r||(a.data=[]),(n=a.data).push.apply(n,o(t)),a.data=[].concat(o(new Set(a.data))),this.locales.set(e,a),a.data}(0,l.logger)("addWords: this locale doesnt exist, you might need to setLocales first")}},{key:"removeWords",value:function(){var e=arguments.length<=0||void 0===arguments[0]?null:arguments[0],t=arguments.length<=1||void 0===arguments[1]?[]:arguments[1];if(t=(0,l.toArray)(t),this.locales.has(e)){var r=this.locales.get(e);return r.data=r.data.filter(function(e){return!(t.indexOf(e)!==-1)}),this.locales.set(e,r),r.data}(0,l.logger)("removeWords: this locale doesnt exist, you might need to setLocales first")}},{key:"getLocales",value:function(){return[].concat(o(this.locales.keys()))}},{key:"getLocalesEnabled",value:function(){var e=this;return[].concat(o(this.locales.keys())).filter(function(t){return e.locales.get(t).enabled})}},{key:"getModes",value:function(){return[].concat(o(this.modes.keys()))}},{key:"getModesEnabled",value:function(){var e=this;return[].concat(o(this.modes.keys())).filter(function(t){return e.modes.get(t).enabled})}},{key:"proceed",value:function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?[]:arguments[0];t=(0,l.toArray)(t);var r=[].concat(o(this.locales.keys())).filter(function(t){return e.locales.get(t).enabled}),n=r.reduce(function(t,r){return t.push.apply(t,o(e.locales.get(r).data)),t},[]),a=[].concat(o(this.modes.keys())).filter(function(t){return e.modes.get(t).enabled}),u=t.map(function(t){return a.map(function(r){var o=t;return n.forEach(function(t){t=(0,l.escapeSymbols)(t);var n=o.match(new RegExp(t,"gi"));null!==n&&n.length>0&&!function(){var n=t.length,a=function(){switch(r){case"choice":var o=e.modes.get("choice").data;return o[(0,l.randomRange)(0,o.length)]||"";case"funny":var a=e.modes.get("funny").data;return a[(0,l.randomRange)(0,a.length)]||"";case"spaces":return" ".repeat(n);case"black":return"&#9632;".repeat(n);case"asterisks-full":return"*".repeat(n);case"asterisks-obscure":return t[0]+"*".repeat(n-2)+t[t.length-1];case"beep":return"BEEP";case"grawlix":var u=function(){var e=["!","@","#","$","%","~","*"];return{v:t.split("").map(function(t){return e[(0,l.randomRange)(0,e.length)]}).join("")}}();if("object"===("undefined"==typeof u?"undefined":i(u)))return u.v;case"hide":return"";default:return t[0]+"*".repeat(n-2)+t[t.length-1]}}();o=function(){var r=new RegExp(t,"gi");return e.wholeWord&&(r=new RegExp("\\b"+t+"\\b","gi")),o.replace(r,a)}()}()}),o})}),s=(0,l.whatIs)(u);return"Array"==s&&1==u.length?u[0]:u}}]),e}();t["default"]=f},function(e,t,r){e.exports=r(4)},function(e,t,r){"use strict";function n(e){this.defaults=a.merge({},e),this.interceptors={request:new u,response:new u}}var o=r(5),a=r(6),i=r(7),u=r(15),s=r(16),c=r(17),l=r(18),f=r(11);n.prototype.request=function(e){"string"==typeof e&&(e=a.merge({url:arguments[0]},arguments[1])),e=a.merge(o,this.defaults,{method:"get"},e),e.baseURL&&!s(e.url)&&(e.url=c(e.baseURL,e.url)),e.withCredentials=e.withCredentials||this.defaults.withCredentials,e.data=f(e.data,e.headers,e.transformRequest),e.headers=a.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),a.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]});var t=[i,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)r=r.then(t.shift(),t.shift());return r};var d=new n(o),p=e.exports=l(n.prototype.request,d);p.create=function(e){return new n(e)},p.defaults=d.defaults,p.all=function(e){return Promise.all(e)},p.spread=r(19),p.interceptors=d.interceptors,a.forEach(["delete","get","head"],function(e){n.prototype[e]=function(t,r){return this.request(a.merge(r||{},{method:e,url:t}))},p[e]=l(n.prototype[e],d)}),a.forEach(["post","put","patch"],function(e){n.prototype[e]=function(t,r,n){return this.request(a.merge(n||{},{method:e,url:t,data:r}))},p[e]=l(n.prototype[e],d)})},function(e,t,r){"use strict";var n=r(6),o=/^\)\]\}',?\n/,a={"Content-Type":"application/x-www-form-urlencoded"};e.exports={transformRequest:[function(e,t){return n.isFormData(e)?e:n.isArrayBuffer(e)?e:n.isArrayBufferView(e)?e.buffer:!n.isObject(e)||n.isFile(e)||n.isBlob(e)?e:(n.isUndefined(t)||(n.forEach(t,function(e,r){"content-type"===r.toLowerCase()&&(t["Content-Type"]=e)}),n.isUndefined(t["Content-Type"])&&(t["Content-Type"]="application/json;charset=utf-8")),JSON.stringify(e))}],transformResponse:[function(e){if("string"==typeof e){e=e.replace(o,"");try{e=JSON.parse(e)}catch(t){}}return e}],headers:{common:{Accept:"application/json, text/plain, */*"},patch:n.merge(a),post:n.merge(a),put:n.merge(a)},timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN"}},function(e,t){"use strict";function r(e){return"[object Array]"===g.call(e)}function n(e){return"[object ArrayBuffer]"===g.call(e)}function o(e){return"[object FormData]"===g.call(e)}function a(e){var t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer}function i(e){return"string"==typeof e}function u(e){return"number"==typeof e}function s(e){return"undefined"==typeof e}function c(e){return null!==e&&"object"==typeof e}function l(e){return"[object Date]"===g.call(e)}function f(e){return"[object File]"===g.call(e)}function d(e){return"[object Blob]"===g.call(e)}function p(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function h(){return"undefined"!=typeof window&&"undefined"!=typeof document&&"function"==typeof document.createElement}function y(e,t){if(null!==e&&"undefined"!=typeof e)if("object"==typeof e||r(e)||(e=[e]),r(e))for(var n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else for(var a in e)e.hasOwnProperty(a)&&t.call(null,e[a],a,e)}function v(){function e(e,r){"object"==typeof t[r]&&"object"==typeof e?t[r]=v(t[r],e):t[r]=e}for(var t={},r=0,n=arguments.length;r<n;r++)y(arguments[r],e);return t}var g=Object.prototype.toString;e.exports={isArray:r,isArrayBuffer:n,isFormData:o,isArrayBufferView:a,isString:i,isNumber:u,isObject:c,isUndefined:s,isDate:l,isFile:f,isBlob:d,isStandardBrowserEnv:h,forEach:y,merge:v,trim:p}},function(e,t,r){(function(t){"use strict";e.exports=function(e){return new Promise(function(n,o){try{var a;"function"==typeof e.adapter?a=e.adapter:"undefined"!=typeof XMLHttpRequest?a=r(8):"undefined"!=typeof t&&(a=r(8)),"function"==typeof a&&a(n,o,e)}catch(i){o(i)}})}}).call(t,r(1))},function(e,t,r){"use strict";var n=r(6),o=r(9),a=r(10),i=r(11),u=r(12),s=window.btoa||r(13);e.exports=function(e,t,c){var l=c.data,f=c.headers;n.isFormData(l)&&delete f["Content-Type"];var d=new XMLHttpRequest;if(!window.XDomainRequest||"withCredentials"in d||u(c.url)||(d=new window.XDomainRequest),c.auth){var p=c.auth.username||"",h=c.auth.password||"";f.Authorization="Basic "+s(p+":"+h)}if(d.open(c.method.toUpperCase(),o(c.url,c.params,c.paramsSerializer),!0),d.timeout=c.timeout,d.onload=function(){if(d){var r="getAllResponseHeaders"in d?a(d.getAllResponseHeaders()):null,n=["text",""].indexOf(c.responseType||"")!==-1?d.responseText:d.response,o={data:i(n,r,c.transformResponse),status:1223===d.status?204:d.status,statusText:1223===d.status?"No Content":d.statusText,headers:r,config:c};(o.status>=200&&o.status<300||!("status"in d)&&o.responseText?e:t)(o),d=null}},d.onerror=function(){t(new Error("Network Error")),d=null},n.isStandardBrowserEnv()){var y=r(14),v=c.withCredentials||u(c.url)?y.read(c.xsrfCookieName):void 0;v&&(f[c.xsrfHeaderName]=v)}if("setRequestHeader"in d&&n.forEach(f,function(e,t){"undefined"==typeof l&&"content-type"===t.toLowerCase()?delete f[t]:d.setRequestHeader(t,e)}),c.withCredentials&&(d.withCredentials=!0),c.responseType)try{d.responseType=c.responseType}catch(g){if("json"!==d.responseType)throw g}n.isArrayBuffer(l)&&(l=new DataView(l)),d.send(l)}},function(e,t,r){"use strict";function n(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var o=r(6);e.exports=function(e,t,r){if(!t)return e;var a;if(r)a=r(t);else{var i=[];o.forEach(t,function(e,t){null!==e&&"undefined"!=typeof e&&(o.isArray(e)&&(t+="[]"),o.isArray(e)||(e=[e]),o.forEach(e,function(e){o.isDate(e)?e=e.toISOString():o.isObject(e)&&(e=JSON.stringify(e)),i.push(n(t)+"="+n(e))}))}),a=i.join("&")}return a&&(e+=(e.indexOf("?")===-1?"?":"&")+a),e}},function(e,t,r){"use strict";var n=r(6);e.exports=function(e){var t,r,o,a={};return e?(n.forEach(e.split("\n"),function(e){o=e.indexOf(":"),t=n.trim(e.substr(0,o)).toLowerCase(),r=n.trim(e.substr(o+1)),t&&(a[t]=a[t]?a[t]+", "+r:r)}),a):a}},function(e,t,r){"use strict";var n=r(6);e.exports=function(e,t,r){return n.forEach(r,function(r){e=r(e,t)}),e}},function(e,t,r){"use strict";var n=r(6);e.exports=n.isStandardBrowserEnv()?function(){function e(e){var t=e;return r&&(o.setAttribute("href",t),t=o.href),o.setAttribute("href",t),{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",host:o.host,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):"",hostname:o.hostname,port:o.port,pathname:"/"===o.pathname.charAt(0)?o.pathname:"/"+o.pathname}}var t,r=/(msie|trident)/i.test(navigator.userAgent),o=document.createElement("a");return t=e(window.location.href),function(r){var o=n.isString(r)?e(r):r;return o.protocol===t.protocol&&o.host===t.host}}():function(){return function(){return!0}}()},function(e,t){"use strict";function r(e){this.message=e}function n(e){for(var t,n,a=String(e),i="",u=0,s=o;a.charAt(0|u)||(s="=",u%1);i+=s.charAt(63&t>>8-u%1*8)){if(n=a.charCodeAt(u+=.75),n>255)throw new r("INVALID_CHARACTER_ERR: DOM Exception 5");t=t<<8|n}return i}var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.prototype=new Error,r.prototype.code=5,r.prototype.name="InvalidCharacterError",e.exports=n},function(e,t,r){"use strict";var n=r(6);e.exports=n.isStandardBrowserEnv()?function(){return{write:function(e,t,r,o,a,i){var u=[];u.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&u.push("expires="+new Date(r).toGMTString()),n.isString(o)&&u.push("path="+o),n.isString(a)&&u.push("domain="+a),i===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(e,t,r){"use strict";function n(){this.handlers=[]}var o=r(6);n.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},n.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},n.prototype.forEach=function(e){o.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=n},function(e,t){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t){"use strict";e.exports=function(e,t){return e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,"")}},function(e,t){"use strict";e.exports=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}}},function(e,t){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){for(;e.indexOf(t)!==-1;){var r=e.indexOf(t);e=e.splice(r,1)}return e},n=function(){var e=arguments.length<=0||void 0===arguments[0]?null:arguments[0],t="Null";if(null==e)return t;var r=e.constructor.toString();return r==Array.toString()?"Array":r==String.toString()?"String":r==Number.toString()?"Number":r==Object.toString()?"Object":r==Function.toString()?"Function":t},o=function(e){var t=n(e);return"Array"==t?e:"Number"==t||"String"==t?[e]:null},a=function(){var e=arguments.length<=0||void 0===arguments[0]?0:arguments[0],t=arguments.length<=1||void 0===arguments[1]?101:arguments[1];return Math.floor(Math.random()*(t-e)+e)},i=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=!0,o=!1,a=void 0;try{for(var i,u=t[Symbol.iterator]();!(n=(i=u.next()).done);n=!0){var s=i.value;console.log("Profam:",s)}}catch(c){o=!0,a=c}finally{try{!n&&u["return"]&&u["return"]()}finally{if(o)throw a}}},u=function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")};t.arrRemove=r,t.whatIs=n,t.toArray=o,t.randomRange=a,t.logger=i,t.escapeSymbols=u},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=r(20),i=function(){function e(){n(this,e),this.enable=0,this.frequency=3}return o(e,[{key:"setFrequency",value:function(e){this.frequency=e}},{key:"proceed",value:function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?[]:arguments[0];return t=(0,a.toArray)(t),t.map(function(t){var r=function(t){for(var r=e.frequency,o=function(e){var o=t.split("").reverse(),a=[];o.forEach(function(e,t){var i=n(o,t,r),u=n(o,t+r,r);i!==u&&a.push(e)}),t=a.reverse().join("")},a=0;a<r;a++)o(a);return t},n=function(e,t,r){for(var n=[],o=0;o<r;o++)n.push(e[t+o]||"");return n=n.join("")};return r(t.replace(/(.)\1{3,}/g,"$1$1$1"))})}}]),e}();t["default"]=i}])});
//# sourceMappingURL=profam.min.js.map
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("profam",[],t):"object"==typeof exports?exports.profam=t():e.profam=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=32)}([function(e,t,n){"use strict";function r(e){return"[object Array]"===E.call(e)}function o(e){return"[object ArrayBuffer]"===E.call(e)}function u(e){return"undefined"!=typeof FormData&&e instanceof FormData}function a(e){var t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer}function i(e){return"string"==typeof e}function s(e){return"number"==typeof e}function c(e){return"undefined"==typeof e}function f(e){return null!==e&&"object"==typeof e}function l(e){return"[object Date]"===E.call(e)}function d(e){return"[object File]"===E.call(e)}function p(e){return"[object Blob]"===E.call(e)}function h(e){return"[object Function]"===E.call(e)}function m(e){return f(e)&&h(e.pipe)}function g(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams}function v(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function y(){return"undefined"!=typeof window&&"undefined"!=typeof document&&"function"==typeof document.createElement}function w(e,t){if(null!==e&&"undefined"!=typeof e)if("object"==typeof e||r(e)||(e=[e]),r(e))for(var n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else for(var u in e)Object.prototype.hasOwnProperty.call(e,u)&&t.call(null,e[u],u,e)}function b(){function e(e,n){"object"==typeof t[n]&&"object"==typeof e?t[n]=b(t[n],e):t[n]=e}for(var t={},n=0,r=arguments.length;n<r;n++)w(arguments[n],e);return t}function x(e,t,n){return w(t,function(t,r){n&&"function"==typeof t?e[r]=A(t,n):e[r]=t}),e}var A=n(7),E=Object.prototype.toString;e.exports={isArray:r,isArrayBuffer:o,isFormData:u,isArrayBufferView:a,isString:i,isNumber:s,isObject:f,isUndefined:c,isDate:l,isFile:d,isBlob:p,isFunction:h,isStream:m,isURLSearchParams:g,isStandardBrowserEnv:y,forEach:w,merge:b,extend:x,trim:v}},function(e,t,n){"use strict";(function(t){function r(e,t){!u.isUndefined(e)&&u.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}function o(){var e;return"undefined"!=typeof XMLHttpRequest?e=n(3):"undefined"!=typeof t&&(e=n(3)),e}var u=n(0),a=n(25),i=/^\)\]\}',?\n/,s={"Content-Type":"application/x-www-form-urlencoded"},c={adapter:o(),transformRequest:[function(e,t){return a(t,"Content-Type"),u.isFormData(e)||u.isArrayBuffer(e)||u.isStream(e)||u.isFile(e)||u.isBlob(e)?e:u.isArrayBufferView(e)?e.buffer:u.isURLSearchParams(e)?(r(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):u.isObject(e)?(r(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e){e=e.replace(i,"");try{e=JSON.parse(e)}catch(e){}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},u.forEach(["delete","get","head"],function(e){c.headers[e]={}}),u.forEach(["post","put","patch"],function(e){c.headers[e]=u.merge(s)}),e.exports=c}).call(t,n(29))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.escapeSymbols=t.randomRange=t.toArray=t.removeFromArray=void 0;var o=n(30),u=r(o);t.removeFromArray=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1];return e.filter(function(e){return e!==t})},t.toArray=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=(0,u.default)(e),n="Array"===t,r="number"===t,o="string"===t;return n?e:r||o?[e]:[]},t.randomRange=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:101;return Math.floor(Math.random()*(t-e)+e)},t.escapeSymbols=function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}},function(e,t,n){"use strict";var r=n(0),o=n(17),u=n(20),a=n(26),i=n(24),s=n(6),c="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||n(19);e.exports=function(e){return new Promise(function(t,f){var l=e.data,d=e.headers;r.isFormData(l)&&delete d["Content-Type"];var p=new XMLHttpRequest,h="onreadystatechange",m=!1;if("undefined"==typeof window||!window.XDomainRequest||"withCredentials"in p||i(e.url)||(p=new window.XDomainRequest,h="onload",m=!0,p.onprogress=function(){},p.ontimeout=function(){}),e.auth){var g=e.auth.username||"",v=e.auth.password||"";d.Authorization="Basic "+c(g+":"+v)}if(p.open(e.method.toUpperCase(),u(e.url,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,p[h]=function(){if(p&&(4===p.readyState||m)&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in p?a(p.getAllResponseHeaders()):null,r=e.responseType&&"text"!==e.responseType?p.response:p.responseText,u={data:r,status:1223===p.status?204:p.status,statusText:1223===p.status?"No Content":p.statusText,headers:n,config:e,request:p};o(t,f,u),p=null}},p.onerror=function(){f(s("Network Error",e)),p=null},p.ontimeout=function(){f(s("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED")),p=null},r.isStandardBrowserEnv()){var y=n(22),w=(e.withCredentials||i(e.url))&&e.xsrfCookieName?y.read(e.xsrfCookieName):void 0;w&&(d[e.xsrfHeaderName]=w)}if("setRequestHeader"in p&&r.forEach(d,function(e,t){"undefined"==typeof l&&"content-type"===t.toLowerCase()?delete d[t]:p.setRequestHeader(t,e)}),e.withCredentials&&(p.withCredentials=!0),e.responseType)try{p.responseType=e.responseType}catch(e){if("json"!==p.responseType)throw e}"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){p&&(p.abort(),f(e),p=null)}),void 0===l&&(l=null),p.send(l)})}},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e,t,n){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,n){"use strict";var r=n(16);e.exports=function(e,t,n,o){var u=new Error(e);return r(u,t,n,o)}},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=n(10),i=r(a),s=n(28),c=r(s),f=n(2),l=n(31),d=r(l),p=function(e,t){return e.replace(/\[language\]/gi,t)},h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=u({languages:new Map,allWords:[],downloadUrl:"/languages/[language].json",modes:d.default},e),n=function(){return t.downloadUrl},r=function(e){return t.downloadUrl=e},a=function(){return[].concat(o(t.languages.keys()))},s=function(e){var r=(0,f.toArray)(e).filter(function(e){return!t.languages.has(e)});return Promise.all(r.map(function(e){return i.default.get(p(n(),e)).then(function(e){return e.data}).then(function(n){return t.languages.set(e,{enabled:!0,data:n}),a()[0]})}))},l=function(e){var n=(0,f.toArray)(e).filter(function(e){return!t.languages.has(e)});return n.forEach(function(e){return t.languages.set(e,{enabled:!0,data:[]})}),a()},h=function(e){var n=(0,f.toArray)(e);return n.forEach(function(e){return t.languages.delete(e)}),a()},m=function(e){return t.languages.has(e)?t.languages.get(e).data:[]},g=function(){var e=a().reduce(function(e,n){var r=t.languages.get(n).data;return e.concat(r)},[]).map(function(e){return(0,f.escapeSymbols)(e)});return t.allWords=e,e},v=function(e,n){if(!t.languages.has(e))return[];var r=(0,f.toArray)(n),u=t.languages.get(e);return u.data=[].concat(o(new Set(u.data.concat(r)))),t.languages.set(e,u),m(e)},y=function(e,n){if(!t.languages.has(e))return[];var r=(0,f.toArray)(n),o=t.languages.get(e);return o.data=o.data.filter(function(e){return!r.includes(e)}),m(e)},w=function(){return t.modes.filter(function(e){return e.enabled}).map(function(e){return e.name})},b=function(e){var n=(0,f.toArray)(e).filter(function(e){return t.modes.find(function(t){return t.name===e})});return t.modes=t.modes.map(function(e){var t=e;return n.includes(t.name)?t.enabled=!0:t.enabled=!1,t}),w()},x=function(e){var n=(0,f.toArray)(e),r=w(),o=g(),u=function(e,t){for(var n=[],r=-1;(r=e.indexOf(t,r+1))!==-1;)n.push(r);return n};return n.map(function(e){var n=o.reduce(function(n,o){var a=u(e,o),i=o.length;return a.length&&a.forEach(function(e){var u=r.reduce(function(e,n){var r={mode:n,str:(0,c.default)(t.modes,n,o,i)};return e.push(r),e},[]);n.push({word:o,index:e,length:i,replaced:u})}),n},[]),a=r.reduce(function(t,r){var o=t,u=e;return n.forEach(function(e){var t=e.replaced.find(function(e){return e.mode===r}).str;u=u.replace(new RegExp(e.word,"i"),t)}),o[r]=u,o},{});return a})};return{getDownloadUrl:n,setDownloadUrl:r,getLanguages:a,addLanguages:s,addCustomLanguages:l,removeLanguages:h,getWords:m,addWords:v,removeWords:y,getModes:w,setModes:b,run:x}};t.default=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},o=n(2),u=function(e,t,n){for(var r=[],o=0;o<n;o+=1){var u=e[t+o]||"";r.push(u)}var a=r.join("");return a},a=function(e,t){var n=e.split("").reverse(),r=[];n.map(function(e,o){var a=u(n,o,t),i=u(n,o+t,t);return a!==i&&r.push(e),!0});var o=r.reverse().join("");return o},i=function(e){return e.replace(/(.)\1{3,}/g,"$1$1$1")},s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=r({frequency:3},e),n=function(){return t.frequency},u=function(e){return t.frequency=e},s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=(0,o.toArray)(e);if(!n())return t;var r=t.map(function(e){return a(e,n())}).map(function(e){return i(e)});return r};return{getFrequency:n,setFrequency:u,run:s}};t.default=s},function(e,t,n){e.exports=n(11)},function(e,t,n){"use strict";function r(e){var t=new a(e),n=u(a.prototype.request,t);return o.extend(n,a.prototype,t),o.extend(n,t),n}var o=n(0),u=n(7),a=n(13),i=n(1),s=r(i);s.Axios=a,s.create=function(e){return r(o.merge(i,e))},s.Cancel=n(4),s.CancelToken=n(12),s.isCancel=n(5),s.all=function(e){return Promise.all(e)},s.spread=n(27),e.exports=s,e.exports.default=s},function(e,t,n){"use strict";function r(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;e(function(e){n.reason||(n.reason=new o(e),t(n.reason))})}var o=n(4);r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var e,t=new r(function(t){e=t});return{token:t,cancel:e}},e.exports=r},function(e,t,n){"use strict";function r(e){this.defaults=e,this.interceptors={request:new a,response:new a}}var o=n(1),u=n(0),a=n(14),i=n(15),s=n(23),c=n(21);r.prototype.request=function(e){"string"==typeof e&&(e=u.merge({url:arguments[0]},arguments[1])),e=u.merge(o,this.defaults,{method:"get"},e),e.baseURL&&!s(e.url)&&(e.url=c(e.baseURL,e.url));var t=[i,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)n=n.then(t.shift(),t.shift());return n},u.forEach(["delete","get","head"],function(e){r.prototype[e]=function(t,n){return this.request(u.merge(n||{},{method:e,url:t}))}}),u.forEach(["post","put","patch"],function(e){r.prototype[e]=function(t,n,r){return this.request(u.merge(r||{},{method:e,url:t,data:n}))}}),e.exports=r},function(e,t,n){"use strict";function r(){this.handlers=[]}var o=n(0);r.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},r.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},r.prototype.forEach=function(e){o.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=r},function(e,t,n){"use strict";function r(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var o=n(0),u=n(18),a=n(5),i=n(1);e.exports=function(e){r(e),e.headers=e.headers||{},e.data=u(e.data,e.headers,e.transformRequest),e.headers=o.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),o.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]});var t=e.adapter||i.adapter;return t(e).then(function(t){return r(e),t.data=u(t.data,t.headers,e.transformResponse),t},function(t){return a(t)||(r(e),t&&t.response&&(t.response.data=u(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},function(e,t,n){"use strict";e.exports=function(e,t,n,r){return e.config=t,n&&(e.code=n),e.response=r,e}},function(e,t,n){"use strict";var r=n(6);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n)):e(n)}},function(e,t,n){"use strict";var r=n(0);e.exports=function(e,t,n){return r.forEach(n,function(n){e=n(e,t)}),e}},function(e,t,n){"use strict";function r(){this.message="String contains an invalid character"}function o(e){for(var t,n,o=String(e),a="",i=0,s=u;o.charAt(0|i)||(s="=",i%1);a+=s.charAt(63&t>>8-i%1*8)){if(n=o.charCodeAt(i+=.75),n>255)throw new r;t=t<<8|n}return a}var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.prototype=new Error,r.prototype.code=5,r.prototype.name="InvalidCharacterError",e.exports=o},function(e,t,n){"use strict";function r(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var o=n(0);e.exports=function(e,t,n){if(!t)return e;var u;if(n)u=n(t);else if(o.isURLSearchParams(t))u=t.toString();else{var a=[];o.forEach(t,function(e,t){null!==e&&"undefined"!=typeof e&&(o.isArray(e)&&(t+="[]"),o.isArray(e)||(e=[e]),o.forEach(e,function(e){o.isDate(e)?e=e.toISOString():o.isObject(e)&&(e=JSON.stringify(e)),a.push(r(t)+"="+r(e))}))}),u=a.join("&")}return u&&(e+=(e.indexOf("?")===-1?"?":"&")+u),e}},function(e,t,n){"use strict";e.exports=function(e,t){return e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,"")}},function(e,t,n){"use strict";var r=n(0);e.exports=r.isStandardBrowserEnv()?function(){return{write:function(e,t,n,o,u,a){var i=[];i.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),r.isString(o)&&i.push("path="+o),r.isString(u)&&i.push("domain="+u),a===!0&&i.push("secure"),document.cookie=i.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(e,t,n){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,n){"use strict";var r=n(0);e.exports=r.isStandardBrowserEnv()?function(){function e(e){var t=e;return n&&(o.setAttribute("href",t),t=o.href),o.setAttribute("href",t),{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",host:o.host,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):"",hostname:o.hostname,port:o.port,pathname:"/"===o.pathname.charAt(0)?o.pathname:"/"+o.pathname}}var t,n=/(msie|trident)/i.test(navigator.userAgent),o=document.createElement("a");return t=e(window.location.href),function(n){var o=r.isString(n)?e(n):n;return o.protocol===t.protocol&&o.host===t.host}}():function(){return function(){return!0}}()},function(e,t,n){"use strict";var r=n(0);e.exports=function(e,t){r.forEach(e,function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])})}},function(e,t,n){"use strict";var r=n(0);e.exports=function(e){var t,n,o,u={};return e?(r.forEach(e.split("\n"),function(e){o=e.indexOf(":"),t=r.trim(e.substr(0,o)).toLowerCase(),n=r.trim(e.substr(o+1)),t&&(u[t]=u[t]?u[t]+", "+n:n)}),u):u}},function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),o={data:[]},u=function(e){var t=e.find(function(e){return"funny"===e.name})||o,n=t.data;return n[(0,r.randomRange)(0,n.length)]||""},a=function(e){return" ".repeat(e)},i=function(e){return"&#9632;".repeat(e)},s=function(e){return"*".repeat(e)},c=function(e,t){return e[0]+"*".repeat(t-2)+e[e.length-1]},f=function(){return"BEEP"},l=function(e,t){var n=e.find(function(e){return"grawlix"===e.name})||o,u=n.data;return t.split("").map(function(){return u[(0,r.randomRange)(0,u.length)]}).join("")},d=function(){return""},p=function(e,t,n,r){switch(t){case"funny":return u(e);case"spaces":return a(r);case"black":return i(r);case"asterisks-full":return s(r);case"asterisks-obscure":return c(n,r);case"beep":return f();case"grawlix":return l(e,n);case"hide":return d();default:return l(e,n)}};t.default=p},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(e){if(f===setTimeout)return setTimeout(e,0);if((f===n||!f)&&setTimeout)return f=setTimeout,setTimeout(e,0);try{return f(e,0)}catch(t){try{return f.call(null,e,0)}catch(t){return f.call(this,e,0)}}}function u(e){if(l===clearTimeout)return clearTimeout(e);if((l===r||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(e);try{return l(e)}catch(t){try{return l.call(null,e)}catch(t){return l.call(this,e)}}}function a(){m&&p&&(m=!1,p.length?h=p.concat(h):g=-1,h.length&&i())}function i(){if(!m){var e=o(a);m=!0;for(var t=h.length;t;){for(p=h,h=[];++g<t;)p&&p[g].run();g=-1,t=h.length}p=null,m=!1,u(e)}}function s(e,t){this.fun=e,this.array=t}function c(){}var f,l,d=e.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:n}catch(e){f=n}try{l="function"==typeof clearTimeout?clearTimeout:r}catch(e){l=r}}();var p,h=[],m=!1,g=-1;d.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];h.push(new s(e,t)),1!==h.length||m||o(i)},s.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=c,d.addListener=c,d.once=c,d.off=c,d.removeListener=c,d.removeAllListeners=c,d.emit=c,d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(e,t,n){"use strict";function r(e){if(e.name)return e.name;var t=/^\s*function\s*([^\(]*)/im.exec(e.toString());return t?t[1]:""}function o(e){var t=a.call(e).slice(8,-1);return"Object"!==t&&"Error"!==t||!e.constructor?t:r(e.constructor)}function u(e){var t;return null===e?"null":(t=typeof e,"object"===t?o(e):t)}var a=Object.prototype.toString;e.exports=u},function(e,t){e.exports=[{name:"asterisks-obscure",enabled:!0,data:[]},{name:"asterisks-full",enabled:!1,data:[]},{name:"funny",enabled:!1,data:["bunnies","butterfly","kitten","love","gingerly","flowers","puppy","joyful","rainbows","unicorn"]},{name:"grawlix",enabled:!1,data:["!","@","#","$","%","~","*"]},{name:"spaces",enabled:!1,data:[]},{name:"black",enabled:!1,data:[]},{name:"hide",enabled:!1,data:[]},{name:"beep",enabled:!1,data:[]}]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Spam=t.Profanity=void 0;var o=n(8),u=r(o),a=n(9),i=r(a);t.Profanity=u.default,t.Spam=i.default}])});
{
"name": "profam",
"version": "1.1.1",
"version": "2.0.0",
"description": "Profanity and Spam Tool, supporting multiple languages and modes.",

@@ -11,3 +11,4 @@ "keywords": [

"filter",
"sensor"
"sensor",
"nodejs"
],

@@ -24,18 +25,34 @@ "person": {

"scripts": {
"build:prod": "webpack --mode=production --ugly=false && webpack --mode=production --ugly=true",
"build:dev": "webpack --progress --colors --watch --mode=development --ugly=false"
"build:prod": "webpack --env.mode=production --env.ugly=false && webpack --env.mode=production --env.ugly=true",
"build:dev": "webpack --progress --colors --watch --env.mode=development --env.ugly=false",
"test": "jest",
"updateLangs": "babel-node ./tools/updateLangs.js"
},
"main": "distribution/profam.min.js",
"dependencies": {
"axios": "^0.9.1"
"axios": "^0.15.3",
"type-name": "^2.0.2"
},
"devDependencies": {
"babel-core": "^6.4.5",
"babel-loader": "^6.2.2",
"babel-plugin-array-includes": "^2.0.3",
"babel-preset-es2015": "^6.6.0",
"babel-preset-stage-0": "^6.5.0",
"yargs": "^4.8.1",
"webpack": "1.12.9"
"babel-cli": "^6.18.0",
"babel-core": "^6.21.0",
"babel-eslint": "^7.1.1",
"babel-jest": "^18.0.0",
"babel-loader": "^6.2.10",
"babel-plugin-tcomb": "^0.3.24",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"babel-preset-env": "^1.1.8",
"babel-preset-stage-0": "^6.16.0",
"eslint": "^3.14.1",
"eslint-config-airbnb-base": "^11.0.1",
"eslint-plugin-flowtype": "^2.30.0",
"eslint-plugin-import": "^2.2.0",
"flow-bin": "^0.38.0",
"fs-promise": "^1.0.0",
"jest": "^18.1.0",
"request": "^2.79.0",
"tcomb": "^3.2.16",
"unzip": "^0.1.11",
"webpack": "^2.2.1"
}
}

@@ -7,7 +7,7 @@ # Profam

## Tools Available
| Tool | Use | Default Status |
| --- | --- | --- |
| Profanity | Used to censor words using the selected modes. | Enabled |
| Spam | Uses an algorithm to stop repeating characters. | Disabled |
## Tools Overview
Tool | Use
---- | ----
Profanity | Used to censor words using selected modes
Spam | Uses an algorithm to stop repeating characters

@@ -21,30 +21,27 @@

```javascript
import profam from 'profam';
// Initialize
import { profanity, spam } from 'profam'
//Initialize
let profam = new profam();
// Profanity
// set download url
profanity.setDownloadUrl('https://static.gamingforgood.net/assets/profanityLocales/[language].json')
//(server) Changing localesDir will update locales with the contents of the dir
//profam.profanity.setLocalesDir('/locales/'); ( in the works )
//OR
//(client) Assuming you are hosting languages on your own, you will need to specify a get-url mockup.
profam.profanity.setLocalesDir('/locales/[locale].json');
// Now that we have specified languages url you can start adding languages
profanity.addLanguages('en')
//Now that you have a get-url mockup you can start adding languages, and profam will take care of the rest.
profam.profanity.setLocales('en');
// Now English is added, bad-words in English will be censored according to the mode selected
// To change profanity mode:
profanity.setModes('funny')
//Now english is added, bad-words in english will be replaced with the default mode's text. To change it:
profam.profanity.setModes('funny');
// Bad-words will be replaced with funny words using funny mode.
profanity.run('Go to hell!') // --> Go to unicorn!
//Bad-words will be replaced with funny words using funny mode.
profam.process('Go to hell!'); // returns-> Go to unicorn!.
// Adding custom words
profanity.addCustomLanguages('Klingon')
//Adding words to your custom language:
profanity.addWords('Klingon', ['Hu\'tegh', 'baktag'])
// ---> Done! Now bad-words in english will be censored! Lets say you want to add a custom language:
profam.profanity.setLocales('customLanguage', true); // -> 2nd param: marks it as custom
//OR
profam.profanity.setLocales('customLanguage', true, true); // -> 3rd param: simply *adds* a new language, instead of replacing english.
//Adding words to your custom language:
profam.profanity.addWords('customLanguage', ['badword']);
// Spam
spam.run('trolololololololololol') // --> trolol
```

@@ -55,24 +52,23 @@

### Profanity Tool
| Method | Parameters | Use | Default |
| ----- | ----- | ----- | ----- |
| profanity.enable = | Boolean | Enable or disable profanity | TRUE |
| profanity.setLocalesDir(\<string\>) | String | Replaces [locale] with the language you want to download. Ex: yoursite.com/locales/[locale].js | null |
| profanity.setLocales(\<string/array\>, \<true/false\>, \<true/false\> | <ol><li>Locales(s)</li><li>is custom</li><li>keep existing</li></ol> | Add the languages you wonna look for bad-words | <ol><li>Empty</li><li>false</li><li>false</li></ol> |
| profanity.addWords(\<string\>, \<array\>, \<boolean\>) | <ol><li>Locale</li></ol><ol><li>Words</li></ol><ol><li>Add</li></ol> | Add new words in selected locale. | |
| profanity.removeWords(\<string\>, \<array\>) | <ol><li>Locale</li></ol><ol><li>Words</li></ol> | Remove words from locale. | |
| profanity.setModes(\<string/array\>) | <ol><li>Mode(s)</li></ol> | Set Modes | asterisks-obscure |
| profanity.getLocales() | | Get Locales | |
| profanity.getLocalesEnabled() | | Get Locales Enabled | |
| profanity.getModes() | | Get Modes | |
| profanity.getModesEnabled() | | Get Modes Enabled | |
### Profanity Methods
| Method | Use |
| ----- | ----- |
| profanity.getDownloadUrl() | Returns download url |
| profanity.setDownloadUrl(string) | Sets download url |
| profanity.getLanguages() | Returns array of language downloaded |
| profanity.addLanguages(string/array) | Returns a promise and downlods languages |
| profanity.addCustomLanguages(string/array) | Adds custom languages |
| profanity.removeLanguages(string/array) | Removes languages |
| profanity.getWords(string(language)) | Returns bad-words used by language |
| profanity.addWords(string(language), string/array) | Adds words to language |
| profanity.removeWords(string(language), string/array) | Removes words in language |
| profanity.getModes() | Returns enabled modes |
| profanity.setModes(string/array) | Enables modes |
| profanity.run(string/array) | Returns array of object for each string keyed by mode used |
### Spam Tool
| Method | Parameters | Use | Default |
| ----- | ----- | ----- | ----- |
| spam.enable | Boolean | Enable or disable Spam | FALSE |
### Profam
| Method | Parameters | Use | Default |
| ----- | ----- | ----- | ----- |
| .proceed(\<string\>) | String | Return censored string | |
| Method | Use |
| ----- | ----- |
| spam.getFrequency() | Returns frequency used in algorithm |
| spam.setFrequency(number) | Sets frequency used in algorithm |
| spam.run(string/array) | Returns array of strings |

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc