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.0 to 1.1.1

946

distribution/profam.js

@@ -61,8 +61,4 @@ (function webpackUniversalModuleDefinition(root, factory) {

var _axios = __webpack_require__(2);
var _profanity = __webpack_require__(2);
var _axios2 = _interopRequireDefault(_axios);
var _profanity = __webpack_require__(19);
var _profanity2 = _interopRequireDefault(_profanity);

@@ -145,3 +141,2 @@

// shim for using process in browser
var process = module.exports = {};

@@ -157,18 +152,80 @@

function defaultSetTimout() {
throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout () {
throw new Error('clearTimeout has not been defined');
}
(function () {
try {
cachedSetTimeout = setTimeout;
} catch (e) {
cachedSetTimeout = function () {
throw new Error('setTimeout is not defined');
try {
if (typeof setTimeout === 'function') {
cachedSetTimeout = setTimeout;
} else {
cachedSetTimeout = defaultSetTimout;
}
} catch (e) {
cachedSetTimeout = defaultSetTimout;
}
}
try {
cachedClearTimeout = clearTimeout;
} catch (e) {
cachedClearTimeout = function () {
throw new Error('clearTimeout is not defined');
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 = [];

@@ -198,3 +255,3 @@ var draining = false;

}
var timeout = cachedSetTimeout.call(null, cleanUpNextTick);
var timeout = runTimeout(cleanUpNextTick);
draining = true;

@@ -216,3 +273,3 @@

draining = false;
cachedClearTimeout.call(null, timeout);
runClearTimeout(timeout);
}

@@ -229,3 +286,3 @@

if (queue.length === 1 && !draining) {
cachedSetTimeout.call(null, drainQueue, 0);
runTimeout(drainQueue);
}

@@ -274,3 +331,383 @@ };

module.exports = __webpack_require__(3);
'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;

@@ -281,12 +718,18 @@ /***/ },

module.exports = __webpack_require__(4);
/***/ },
/* 4 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
var defaults = __webpack_require__(4);
var utils = __webpack_require__(5);
var dispatchRequest = __webpack_require__(6);
var InterceptorManager = __webpack_require__(14);
var isAbsoluteURL = __webpack_require__(15);
var combineURLs = __webpack_require__(16);
var bind = __webpack_require__(17);
var transformData = __webpack_require__(10);
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);

@@ -374,3 +817,3 @@ function Axios(defaultConfig) {

};
axios.spread = __webpack_require__(18);
axios.spread = __webpack_require__(19);

@@ -406,3 +849,3 @@ // Expose interceptors

/***/ },
/* 4 */
/* 5 */
/***/ function(module, exports, __webpack_require__) {

@@ -412,3 +855,3 @@

var utils = __webpack_require__(5);
var utils = __webpack_require__(6);

@@ -477,3 +920,3 @@ var PROTECTION_PREFIX = /^\)\]\}',?\n/;

/***/ },
/* 5 */
/* 6 */
/***/ function(module, exports) {

@@ -728,3 +1171,3 @@

/***/ },
/* 6 */
/* 7 */
/***/ function(module, exports, __webpack_require__) {

@@ -751,6 +1194,6 @@

// For browsers use XHR adapter
adapter = __webpack_require__(7);
adapter = __webpack_require__(8);
} else if (typeof process !== 'undefined') {
// For node use HTTP adapter
adapter = __webpack_require__(7);
adapter = __webpack_require__(8);
}

@@ -771,3 +1214,3 @@

/***/ },
/* 7 */
/* 8 */
/***/ function(module, exports, __webpack_require__) {

@@ -777,8 +1220,8 @@

var utils = __webpack_require__(5);
var buildURL = __webpack_require__(8);
var parseHeaders = __webpack_require__(9);
var transformData = __webpack_require__(10);
var isURLSameOrigin = __webpack_require__(11);
var btoa = window.btoa || __webpack_require__(12);
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);

@@ -858,3 +1301,3 @@ module.exports = function xhrAdapter(resolve, reject, config) {

if (utils.isStandardBrowserEnv()) {
var cookies = __webpack_require__(13);
var cookies = __webpack_require__(14);

@@ -910,3 +1353,3 @@ // Add xsrf header

/***/ },
/* 8 */
/* 9 */
/***/ function(module, exports, __webpack_require__) {

@@ -916,3 +1359,3 @@

var utils = __webpack_require__(5);
var utils = __webpack_require__(6);

@@ -985,3 +1428,3 @@ function encode(val) {

/***/ },
/* 9 */
/* 10 */
/***/ function(module, exports, __webpack_require__) {

@@ -991,3 +1434,3 @@

var utils = __webpack_require__(5);
var utils = __webpack_require__(6);

@@ -1030,3 +1473,3 @@ /**

/***/ },
/* 10 */
/* 11 */
/***/ function(module, exports, __webpack_require__) {

@@ -1036,3 +1479,3 @@

var utils = __webpack_require__(5);
var utils = __webpack_require__(6);

@@ -1058,3 +1501,3 @@ /**

/***/ },
/* 11 */
/* 12 */
/***/ function(module, exports, __webpack_require__) {

@@ -1064,3 +1507,3 @@

var utils = __webpack_require__(5);
var utils = __webpack_require__(6);

@@ -1134,3 +1577,3 @@ module.exports = (

/***/ },
/* 12 */
/* 13 */
/***/ function(module, exports) {

@@ -1177,3 +1620,3 @@

/***/ },
/* 13 */
/* 14 */
/***/ function(module, exports, __webpack_require__) {

@@ -1183,3 +1626,3 @@

var utils = __webpack_require__(5);
var utils = __webpack_require__(6);

@@ -1238,3 +1681,3 @@ module.exports = (

/***/ },
/* 14 */
/* 15 */
/***/ function(module, exports, __webpack_require__) {

@@ -1244,3 +1687,3 @@

var utils = __webpack_require__(5);
var utils = __webpack_require__(6);

@@ -1298,3 +1741,3 @@ function InterceptorManager() {

/***/ },
/* 15 */
/* 16 */
/***/ function(module, exports) {

@@ -1319,3 +1762,3 @@

/***/ },
/* 16 */
/* 17 */
/***/ function(module, exports) {

@@ -1338,3 +1781,3 @@

/***/ },
/* 17 */
/* 18 */
/***/ function(module, exports) {

@@ -1356,3 +1799,3 @@

/***/ },
/* 18 */
/* 19 */
/***/ function(module, exports) {

@@ -1390,381 +1833,2 @@

/***/ },
/* 19 */
/***/ 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 _utils = __webpack_require__(20);
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);
axios.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;
/***/ },
/* 20 */

@@ -1771,0 +1835,0 @@ /***/ function(module, exports) {

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

!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]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){(function(t){"use strict";function r(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 n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=n(2),u=(r(i),n(19)),s=r(u),c=n(21),l=r(c);n(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 s["default"],this.spam=new l["default"],null!==t){var n=Object.keys(t),r=!0,a=!1,i=void 0;try{for(var u,c=n[Symbol.iterator]();!(r=(u=c.next()).done);r=!0){var f=u.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{!r&&c["return"]&&c["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,n(1))},function(e,t){function n(){f&&c&&(f=!1,c.length?l=c.concat(l):d=-1,l.length&&r())}function r(){if(!f){var e=i.call(null,n);f=!0;for(var t=l.length;t;){for(c=l,l=[];++d<t;)c&&c[d].run();d=-1,t=l.length}c=null,f=!1,u.call(null,e)}}function o(e,t){this.fun=e,this.array=t}function a(){}var i,u,s=e.exports={};!function(){try{i=setTimeout}catch(e){i=function(){throw new Error("setTimeout is not defined")}}try{u=clearTimeout}catch(e){u=function(){throw new Error("clearTimeout is not defined")}}}();var c,l=[],f=!1,d=-1;s.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];l.push(new o(e,t)),1!==l.length||f||i.call(null,r,0)},o.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=a,s.addListener=a,s.once=a,s.off=a,s.removeListener=a,s.removeAllListeners=a,s.emit=a,s.binding=function(e){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(e){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},function(e,t,n){e.exports=n(3)},function(e,t,n){"use strict";function r(e){this.defaults=a.merge({},e),this.interceptors={request:new u,response:new u}}var o=n(4),a=n(5),i=n(6),u=n(14),s=n(15),c=n(16),l=n(17),f=n(10);r.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],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};var d=new r(o),p=e.exports=l(r.prototype.request,d);p.create=function(e){return new r(e)},p.defaults=d.defaults,p.all=function(e){return Promise.all(e)},p.spread=n(18),p.interceptors=d.interceptors,a.forEach(["delete","get","head"],function(e){r.prototype[e]=function(t,n){return this.request(a.merge(n||{},{method:e,url:t}))},p[e]=l(r.prototype[e],d)}),a.forEach(["post","put","patch"],function(e){r.prototype[e]=function(t,n,r){return this.request(a.merge(r||{},{method:e,url:t,data:n}))},p[e]=l(r.prototype[e],d)})},function(e,t,n){"use strict";var r=n(5),o=/^\)\]\}',?\n/,a={"Content-Type":"application/x-www-form-urlencoded"};e.exports={transformRequest:[function(e,t){return r.isFormData(e)?e:r.isArrayBuffer(e)?e:r.isArrayBufferView(e)?e.buffer:!r.isObject(e)||r.isFile(e)||r.isBlob(e)?e:(r.isUndefined(t)||(r.forEach(t,function(e,n){"content-type"===n.toLowerCase()&&(t["Content-Type"]=e)}),r.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:r.merge(a),post:r.merge(a),put:r.merge(a)},timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN"}},function(e,t){"use strict";function n(e){return"[object Array]"===g.call(e)}function r(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||n(e)||(e=[e]),n(e))for(var r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else for(var a in e)e.hasOwnProperty(a)&&t.call(null,e[a],a,e)}function v(){function e(e,n){"object"==typeof t[n]&&"object"==typeof e?t[n]=v(t[n],e):t[n]=e}for(var t={},n=0,r=arguments.length;n<r;n++)y(arguments[n],e);return t}var g=Object.prototype.toString;e.exports={isArray:n,isArrayBuffer:r,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,n){(function(t){"use strict";e.exports=function(e){return new Promise(function(r,o){try{var a;"function"==typeof e.adapter?a=e.adapter:"undefined"!=typeof XMLHttpRequest?a=n(7):"undefined"!=typeof t&&(a=n(7)),"function"==typeof a&&a(r,o,e)}catch(i){o(i)}})}}).call(t,n(1))},function(e,t,n){"use strict";var r=n(5),o=n(8),a=n(9),i=n(10),u=n(11),s=window.btoa||n(12);e.exports=function(e,t,c){var l=c.data,f=c.headers;r.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 n="getAllResponseHeaders"in d?a(d.getAllResponseHeaders()):null,r=["text",""].indexOf(c.responseType||"")!==-1?d.responseText:d.response,o={data:i(r,n,c.transformResponse),status:1223===d.status?204:d.status,statusText:1223===d.status?"No Content":d.statusText,headers:n,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},r.isStandardBrowserEnv()){var y=n(13),v=c.withCredentials||u(c.url)?y.read(c.xsrfCookieName):void 0;v&&(f[c.xsrfHeaderName]=v)}if("setRequestHeader"in d&&r.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}r.isArrayBuffer(l)&&(l=new DataView(l)),d.send(l)}},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(5);e.exports=function(e,t,n){if(!t)return e;var a;if(n)a=n(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(r(t)+"="+r(e))}))}),a=i.join("&")}return a&&(e+=(e.indexOf("?")===-1?"?":"&")+a),e}},function(e,t,n){"use strict";var r=n(5);e.exports=function(e){var t,n,o,a={};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&&(a[t]=a[t]?a[t]+", "+n:n)}),a):a}},function(e,t,n){"use strict";var r=n(5);e.exports=function(e,t,n){return r.forEach(n,function(n){e=n(e,t)}),e}},function(e,t,n){"use strict";var r=n(5);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){"use strict";function n(e){this.message=e}function r(e){for(var t,r,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(r=a.charCodeAt(u+=.75),r>255)throw new n("INVALID_CHARACTER_ERR: DOM Exception 5");t=t<<8|r}return i}var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.prototype=new Error,n.prototype.code=5,n.prototype.name="InvalidCharacterError",e.exports=r},function(e,t,n){"use strict";var r=n(5);e.exports=r.isStandardBrowserEnv()?function(){return{write:function(e,t,n,o,a,i){var u=[];u.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),r.isString(o)&&u.push("path="+o),r.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,n){"use strict";function r(){this.handlers=[]}var o=n(5);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){"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 n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},function(e,t){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,n){"use strict";function r(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)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var a="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},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(20),s=function(){function e(){o(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 i(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,u.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,u.logger)("Invalid locales dir provided")}},{key:"setLocales",value:function(){var e=arguments.length<=0||void 0===arguments[0]?[]:arguments[0],t=this,n=arguments.length<=1||void 0===arguments[1]?0:arguments[1],o=arguments.length<=2||void 0===arguments[2]?0:arguments[2],a=this;e=(0,u.toArray)(e),o||a.locales.clear();var i=function(e){var t;(t=a.locales).set.apply(t,r(e))};e.length?e.filter(function(e){return!t.locales.has(e)}).forEach(function(e){if(n)i([e,{enabled:1,available:1,data:[]}]);else{var r=t.makeUrl(e);axios.get(r).then(function(t){i([e,{enabled:1,available:1,data:t.data}])})["catch"](function(e){(0,u.logger)("Tried to download locale but catched an error",e)})}}):(0,u.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,u.toArray)(t),[].concat(r(this.modes.keys())).forEach(function(n){var r=0,o=e.modes.get(n);t.indexOf(n)!==-1&&(r=1),o.enabled=r,e.modes.set(n,o)}),(0,u.logger)("Added Modes",t)):(0,u.logger)("setModes received null")}},{key:"addChoices",value:function(){var e,t=arguments.length<=0||void 0===arguments[0]?[]:arguments[0],n=arguments.length<=1||void 0===arguments[1]?1:arguments[1];t=(0,u.toArray)(t);var o=this.modes.get("choice");return n||(o.data=[]),(e=o.data).push.apply(e,r(t)),o.data=[].concat(r(new Set(o.data))),this.modes.set("choice",o),o.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],n=arguments.length<=2||void 0===arguments[2]||arguments[2];if(t=(0,u.toArray)(t),this.locales.has(e)){var o,a=this.locales.get(e);return n||(a.data=[]),(o=a.data).push.apply(o,r(t)),a.data=[].concat(r(new Set(a.data))),this.locales.set(e,a),a.data}(0,u.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,u.toArray)(t),this.locales.has(e)){var n=this.locales.get(e);return n.data=n.data.filter(function(e){return!(t.indexOf(e)!==-1)}),this.locales.set(e,n),n.data}(0,u.logger)("removeWords: this locale doesnt exist, you might need to setLocales first")}},{key:"getLocales",value:function(){return[].concat(r(this.locales.keys()))}},{key:"getLocalesEnabled",value:function(){var e=this;return[].concat(r(this.locales.keys())).filter(function(t){return e.locales.get(t).enabled})}},{key:"getModes",value:function(){return[].concat(r(this.modes.keys()))}},{key:"getModesEnabled",value:function(){var e=this;return[].concat(r(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,u.toArray)(t);var n=[].concat(r(this.locales.keys())).filter(function(t){return e.locales.get(t).enabled}),o=n.reduce(function(t,n){return t.push.apply(t,r(e.locales.get(n).data)),t},[]),i=[].concat(r(this.modes.keys())).filter(function(t){return e.modes.get(t).enabled}),s=t.map(function(t){return i.map(function(n){var r=t;return o.forEach(function(t){t=(0,u.escapeSymbols)(t);var o=r.match(new RegExp(t,"gi"));null!==o&&o.length>0&&!function(){var o=t.length,i=function(){switch(n){case"choice":var r=e.modes.get("choice").data;return r[(0,u.randomRange)(0,r.length)]||"";case"funny":var i=e.modes.get("funny").data;return i[(0,u.randomRange)(0,i.length)]||"";case"spaces":return" ".repeat(o);case"black":return"&#9632;".repeat(o);case"asterisks-full":return"*".repeat(o);case"asterisks-obscure":return t[0]+"*".repeat(o-2)+t[t.length-1];case"beep":return"BEEP";case"grawlix":var s=function(){var e=["!","@","#","$","%","~","*"];return{v:t.split("").map(function(t){return e[(0,u.randomRange)(0,e.length)]}).join("")}}();if("object"===("undefined"==typeof s?"undefined":a(s)))return s.v;case"hide":return"";default:return t[0]+"*".repeat(o-2)+t[t.length-1]}}();r=function(){var n=new RegExp(t,"gi");return e.wholeWord&&(n=new RegExp("\\b"+t+"\\b","gi")),r.replace(n,i)}()}()}),r})}),c=(0,u.whatIs)(s);return"Array"==c&&1==s.length?s[0]:s}}]),e}();t["default"]=s},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){for(;e.indexOf(t)!==-1;){var n=e.indexOf(t);e=e.splice(n,1)}return e},r=function(){var e=arguments.length<=0||void 0===arguments[0]?null:arguments[0],t="Null";if(null==e)return t;var n=e.constructor.toString();return n==Array.toString()?"Array":n==String.toString()?"String":n==Number.toString()?"Number":n==Object.toString()?"Object":n==Function.toString()?"Function":t},o=function(e){var t=r(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),n=0;n<e;n++)t[n]=arguments[n];var r=!0,o=!1,a=void 0;try{for(var i,u=t[Symbol.iterator]();!(r=(i=u.next()).done);r=!0){var s=i.value;console.log("Profam:",s)}}catch(c){o=!0,a=c}finally{try{!r&&u["return"]&&u["return"]()}finally{if(o)throw a}}},u=function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")};t.arrRemove=n,t.whatIs=r,t.toArray=o,t.randomRange=a,t.logger=i,t.escapeSymbols=u},function(e,t,n){"use strict";function r(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 n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(20),i=function(){function e(){r(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 n=function(t){for(var n=e.frequency,o=function(e){var o=t.split("").reverse(),a=[];o.forEach(function(e,t){var i=r(o,t,n),u=r(o,t+n,n);i!==u&&a.push(e)}),t=a.reverse().join("")},a=0;a<n;a++)o(a);return t},r=function(e,t,n){for(var r=[],o=0;o<n;o++)r.push(e[t+o]||"");return r=r.join("")};return n(t.replace(/(.)\1{3,}/g,"$1$1$1"))})}}]),e}();t["default"]=i}])});
!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
{
"name": "profam",
"version": "1.1.0",
"version": "1.1.1",
"description": "Profanity and Spam Tool, supporting multiple languages and modes.",

@@ -23,4 +23,4 @@ "keywords": [

"scripts": {
"prod": "webpack --mode=production --ugly=false && webpack --mode=production --ugly=true",
"dev": "webpack --progress --colors --watch --mode=development --ugly=false"
"build:prod": "webpack --mode=production --ugly=false && webpack --mode=production --ugly=true",
"build:dev": "webpack --progress --colors --watch --mode=development --ugly=false"
},

@@ -27,0 +27,0 @@ "main": "distribution/profam.min.js",

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

import axios from 'axios'
import profanity from 'profanity'

@@ -3,0 +2,0 @@ import spam from 'spam'

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

import axios from 'axios'
import { whatIs, toArray, randomRange, logger, escapeSymbols } from './utils'

@@ -2,0 +3,0 @@

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