n4s 5.0.1 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/CHANGELOG.md +0 -4
  2. package/README.md +2 -0
  3. package/compose/package.json +2 -0
  4. package/compounds/package.json +2 -0
  5. package/date/package.json +9 -0
  6. package/dist/cjs/compose.development.js +14 -97
  7. package/dist/cjs/compose.js +0 -1
  8. package/dist/cjs/compose.production.js +1 -1
  9. package/dist/cjs/compounds.development.js +30 -86
  10. package/dist/cjs/compounds.js +0 -1
  11. package/dist/cjs/compounds.production.js +1 -1
  12. package/dist/cjs/date.development.js +186 -0
  13. package/dist/cjs/date.js +6 -0
  14. package/dist/cjs/date.production.js +1 -0
  15. package/dist/cjs/email.development.js +363 -0
  16. package/dist/cjs/email.js +6 -0
  17. package/dist/cjs/email.production.js +1 -0
  18. package/dist/cjs/isURL.development.js +353 -0
  19. package/dist/cjs/isURL.js +6 -0
  20. package/dist/cjs/isURL.production.js +1 -0
  21. package/dist/cjs/n4s.development.js +205 -387
  22. package/dist/cjs/n4s.js +0 -1
  23. package/dist/cjs/n4s.production.js +1 -1
  24. package/dist/cjs/schema.development.js +19 -80
  25. package/dist/cjs/schema.js +0 -1
  26. package/dist/cjs/schema.production.js +1 -1
  27. package/dist/es/compose.development.js +14 -97
  28. package/dist/es/compose.production.js +1 -1
  29. package/dist/es/compounds.development.js +28 -84
  30. package/dist/es/compounds.production.js +1 -1
  31. package/dist/es/date.development.js +184 -0
  32. package/dist/es/date.production.js +1 -0
  33. package/dist/es/email.development.js +361 -0
  34. package/dist/es/email.production.js +1 -0
  35. package/dist/es/isURL.development.js +351 -0
  36. package/dist/es/isURL.production.js +1 -0
  37. package/dist/es/n4s.development.js +192 -372
  38. package/dist/es/n4s.production.js +1 -1
  39. package/dist/es/schema.development.js +16 -75
  40. package/dist/es/schema.production.js +1 -1
  41. package/dist/umd/compose.development.js +18 -102
  42. package/dist/umd/compose.production.js +1 -1
  43. package/dist/umd/compounds.development.js +34 -91
  44. package/dist/umd/compounds.production.js +1 -1
  45. package/dist/umd/date.development.js +190 -0
  46. package/dist/umd/date.production.js +1 -0
  47. package/dist/umd/email.development.js +367 -0
  48. package/dist/umd/email.production.js +1 -0
  49. package/dist/umd/isURL.development.js +357 -0
  50. package/dist/umd/isURL.production.js +1 -0
  51. package/dist/umd/n4s.development.js +209 -392
  52. package/dist/umd/n4s.production.js +1 -1
  53. package/dist/umd/schema.development.js +23 -85
  54. package/dist/umd/schema.production.js +1 -1
  55. package/email/package.json +9 -0
  56. package/isURL/package.json +9 -0
  57. package/package.json +162 -55
  58. package/schema/package.json +2 -0
  59. package/testUtils/TEnforceMock.ts +3 -0
  60. package/types/compose.d.ts +46 -55
  61. package/types/compose.d.ts.map +1 -0
  62. package/types/compounds.d.ts +50 -62
  63. package/types/compounds.d.ts.map +1 -0
  64. package/types/date.d.ts +18 -0
  65. package/types/date.d.ts.map +1 -0
  66. package/types/email.d.ts +12 -0
  67. package/types/email.d.ts.map +1 -0
  68. package/types/isURL.d.ts +12 -0
  69. package/types/isURL.d.ts.map +1 -0
  70. package/types/n4s.d.ts +62 -73
  71. package/types/n4s.d.ts.map +1 -0
  72. package/types/schema.d.ts +55 -63
  73. package/types/schema.d.ts.map +1 -0
  74. package/docs/.nojekyll +0 -0
  75. package/docs/README.md +0 -44
  76. package/docs/_sidebar.md +0 -5
  77. package/docs/external.md +0 -27
  78. package/docs/index.html +0 -32
  79. package/docs/rules.md +0 -1282
  80. package/tsconfig.json +0 -8
@@ -0,0 +1,363 @@
1
+ 'use strict';
2
+
3
+ var n4s = require('n4s');
4
+
5
+ function _typeof$1(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$1 = function _typeof(obj) { return typeof obj; }; } else { _typeof$1 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$1(obj); }
6
+
7
+ function assertString(input) {
8
+ var isString = typeof input === 'string' || input instanceof String;
9
+
10
+ if (!isString) {
11
+ var invalidType = _typeof$1(input);
12
+
13
+ if (input === null) invalidType = 'null';else if (invalidType === 'object') invalidType = input.constructor.name;
14
+ throw new TypeError("Expected a string but received a ".concat(invalidType));
15
+ }
16
+ }
17
+
18
+ function merge() {
19
+ var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
20
+ var defaults = arguments.length > 1 ? arguments[1] : undefined;
21
+
22
+ for (var key in defaults) {
23
+ if (typeof obj[key] === 'undefined') {
24
+ obj[key] = defaults[key];
25
+ }
26
+ }
27
+
28
+ return obj;
29
+ }
30
+
31
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
32
+ /* eslint-disable prefer-rest-params */
33
+
34
+ function isByteLength(str, options) {
35
+ assertString(str);
36
+ var min;
37
+ var max;
38
+
39
+ if (_typeof(options) === 'object') {
40
+ min = options.min || 0;
41
+ max = options.max;
42
+ } else {
43
+ // backwards compatibility: isByteLength(str, min [, max])
44
+ min = arguments[1];
45
+ max = arguments[2];
46
+ }
47
+
48
+ var len = encodeURI(str).split(/%..|./).length - 1;
49
+ return len >= min && (typeof max === 'undefined' || len <= max);
50
+ }
51
+
52
+ var default_fqdn_options = {
53
+ require_tld: true,
54
+ allow_underscores: false,
55
+ allow_trailing_dot: false,
56
+ allow_numeric_tld: false,
57
+ allow_wildcard: false,
58
+ ignore_max_length: false
59
+ };
60
+ function isFQDN(str, options) {
61
+ assertString(str);
62
+ options = merge(options, default_fqdn_options);
63
+ /* Remove the optional trailing dot before checking validity */
64
+
65
+ if (options.allow_trailing_dot && str[str.length - 1] === '.') {
66
+ str = str.substring(0, str.length - 1);
67
+ }
68
+ /* Remove the optional wildcard before checking validity */
69
+
70
+
71
+ if (options.allow_wildcard === true && str.indexOf('*.') === 0) {
72
+ str = str.substring(2);
73
+ }
74
+
75
+ var parts = str.split('.');
76
+ var tld = parts[parts.length - 1];
77
+
78
+ if (options.require_tld) {
79
+ // disallow fqdns without tld
80
+ if (parts.length < 2) {
81
+ return false;
82
+ }
83
+
84
+ if (!options.allow_numeric_tld && !/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(tld)) {
85
+ return false;
86
+ } // disallow spaces
87
+
88
+
89
+ if (/\s/.test(tld)) {
90
+ return false;
91
+ }
92
+ } // reject numeric TLDs
93
+
94
+
95
+ if (!options.allow_numeric_tld && /^\d+$/.test(tld)) {
96
+ return false;
97
+ }
98
+
99
+ return parts.every(function (part) {
100
+ if (part.length > 63 && !options.ignore_max_length) {
101
+ return false;
102
+ }
103
+
104
+ if (!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(part)) {
105
+ return false;
106
+ } // disallow full-width chars
107
+
108
+
109
+ if (/[\uff01-\uff5e]/.test(part)) {
110
+ return false;
111
+ } // disallow parts starting or ending with hyphen
112
+
113
+
114
+ if (/^-|-$/.test(part)) {
115
+ return false;
116
+ }
117
+
118
+ if (!options.allow_underscores && /_/.test(part)) {
119
+ return false;
120
+ }
121
+
122
+ return true;
123
+ });
124
+ }
125
+
126
+ /**
127
+ 11.3. Examples
128
+
129
+ The following addresses
130
+
131
+ fe80::1234 (on the 1st link of the node)
132
+ ff02::5678 (on the 5th link of the node)
133
+ ff08::9abc (on the 10th organization of the node)
134
+
135
+ would be represented as follows:
136
+
137
+ fe80::1234%1
138
+ ff02::5678%5
139
+ ff08::9abc%10
140
+
141
+ (Here we assume a natural translation from a zone index to the
142
+ <zone_id> part, where the Nth zone of any scope is translated into
143
+ "N".)
144
+
145
+ If we use interface names as <zone_id>, those addresses could also be
146
+ represented as follows:
147
+
148
+ fe80::1234%ne0
149
+ ff02::5678%pvc1.3
150
+ ff08::9abc%interface10
151
+
152
+ where the interface "ne0" belongs to the 1st link, "pvc1.3" belongs
153
+ to the 5th link, and "interface10" belongs to the 10th organization.
154
+ * * */
155
+
156
+ var IPv4SegmentFormat = '(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])';
157
+ var IPv4AddressFormat = "(".concat(IPv4SegmentFormat, "[.]){3}").concat(IPv4SegmentFormat);
158
+ var IPv4AddressRegExp = new RegExp("^".concat(IPv4AddressFormat, "$"));
159
+ var IPv6SegmentFormat = '(?:[0-9a-fA-F]{1,4})';
160
+ var IPv6AddressRegExp = new RegExp('^(' + "(?:".concat(IPv6SegmentFormat, ":){7}(?:").concat(IPv6SegmentFormat, "|:)|") + "(?:".concat(IPv6SegmentFormat, ":){6}(?:").concat(IPv4AddressFormat, "|:").concat(IPv6SegmentFormat, "|:)|") + "(?:".concat(IPv6SegmentFormat, ":){5}(?::").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,2}|:)|") + "(?:".concat(IPv6SegmentFormat, ":){4}(?:(:").concat(IPv6SegmentFormat, "){0,1}:").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,3}|:)|") + "(?:".concat(IPv6SegmentFormat, ":){3}(?:(:").concat(IPv6SegmentFormat, "){0,2}:").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,4}|:)|") + "(?:".concat(IPv6SegmentFormat, ":){2}(?:(:").concat(IPv6SegmentFormat, "){0,3}:").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,5}|:)|") + "(?:".concat(IPv6SegmentFormat, ":){1}(?:(:").concat(IPv6SegmentFormat, "){0,4}:").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,6}|:)|") + "(?::((?::".concat(IPv6SegmentFormat, "){0,5}:").concat(IPv4AddressFormat, "|(?::").concat(IPv6SegmentFormat, "){1,7}|:))") + ')(%[0-9a-zA-Z-.:]{1,})?$');
161
+ function isIP(str) {
162
+ var version = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
163
+ assertString(str);
164
+ version = String(version);
165
+
166
+ if (!version) {
167
+ return isIP(str, 4) || isIP(str, 6);
168
+ }
169
+
170
+ if (version === '4') {
171
+ return IPv4AddressRegExp.test(str);
172
+ }
173
+
174
+ if (version === '6') {
175
+ return IPv6AddressRegExp.test(str);
176
+ }
177
+
178
+ return false;
179
+ }
180
+
181
+ var default_email_options = {
182
+ allow_display_name: false,
183
+ require_display_name: false,
184
+ allow_utf8_local_part: true,
185
+ require_tld: true,
186
+ blacklisted_chars: '',
187
+ ignore_max_length: false,
188
+ host_blacklist: [],
189
+ host_whitelist: []
190
+ };
191
+ /* eslint-disable max-len */
192
+
193
+ /* eslint-disable no-control-regex */
194
+
195
+ var splitNameAddress = /^([^\x00-\x1F\x7F-\x9F\cX]+)</i;
196
+ var emailUserPart = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i;
197
+ var gmailUserPart = /^[a-z\d]+$/;
198
+ var quotedEmailUser = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i;
199
+ var emailUserUtf8Part = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i;
200
+ var quotedEmailUserUtf8 = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i;
201
+ var defaultMaxEmailLength = 254;
202
+ /* eslint-enable max-len */
203
+
204
+ /* eslint-enable no-control-regex */
205
+
206
+ /**
207
+ * Validate display name according to the RFC2822: https://tools.ietf.org/html/rfc2822#appendix-A.1.2
208
+ * @param {String} display_name
209
+ */
210
+
211
+ function validateDisplayName(display_name) {
212
+ var display_name_without_quotes = display_name.replace(/^"(.+)"$/, '$1'); // display name with only spaces is not valid
213
+
214
+ if (!display_name_without_quotes.trim()) {
215
+ return false;
216
+ } // check whether display name contains illegal character
217
+
218
+
219
+ var contains_illegal = /[\.";<>]/.test(display_name_without_quotes);
220
+
221
+ if (contains_illegal) {
222
+ // if contains illegal characters,
223
+ // must to be enclosed in double-quotes, otherwise it's not a valid display name
224
+ if (display_name_without_quotes === display_name) {
225
+ return false;
226
+ } // the quotes in display name must start with character symbol \
227
+
228
+
229
+ var all_start_with_back_slash = display_name_without_quotes.split('"').length === display_name_without_quotes.split('\\"').length;
230
+
231
+ if (!all_start_with_back_slash) {
232
+ return false;
233
+ }
234
+ }
235
+
236
+ return true;
237
+ }
238
+
239
+ function isEmail(str, options) {
240
+ assertString(str);
241
+ options = merge(options, default_email_options);
242
+
243
+ if (options.require_display_name || options.allow_display_name) {
244
+ var display_email = str.match(splitNameAddress);
245
+
246
+ if (display_email) {
247
+ var display_name = display_email[1]; // Remove display name and angle brackets to get email address
248
+ // Can be done in the regex but will introduce a ReDOS (See #1597 for more info)
249
+
250
+ str = str.replace(display_name, '').replace(/(^<|>$)/g, ''); // sometimes need to trim the last space to get the display name
251
+ // because there may be a space between display name and email address
252
+ // eg. myname <address@gmail.com>
253
+ // the display name is `myname` instead of `myname `, so need to trim the last space
254
+
255
+ if (display_name.endsWith(' ')) {
256
+ display_name = display_name.slice(0, -1);
257
+ }
258
+
259
+ if (!validateDisplayName(display_name)) {
260
+ return false;
261
+ }
262
+ } else if (options.require_display_name) {
263
+ return false;
264
+ }
265
+ }
266
+
267
+ if (!options.ignore_max_length && str.length > defaultMaxEmailLength) {
268
+ return false;
269
+ }
270
+
271
+ var parts = str.split('@');
272
+ var domain = parts.pop();
273
+ var lower_domain = domain.toLowerCase();
274
+
275
+ if (options.host_blacklist.includes(lower_domain)) {
276
+ return false;
277
+ }
278
+
279
+ if (options.host_whitelist.length > 0 && !options.host_whitelist.includes(lower_domain)) {
280
+ return false;
281
+ }
282
+
283
+ var user = parts.join('@');
284
+
285
+ if (options.domain_specific_validation && (lower_domain === 'gmail.com' || lower_domain === 'googlemail.com')) {
286
+ /*
287
+ Previously we removed dots for gmail addresses before validating.
288
+ This was removed because it allows `multiple..dots@gmail.com`
289
+ to be reported as valid, but it is not.
290
+ Gmail only normalizes single dots, removing them from here is pointless,
291
+ should be done in normalizeEmail
292
+ */
293
+ user = user.toLowerCase(); // Removing sub-address from username before gmail validation
294
+
295
+ var username = user.split('+')[0]; // Dots are not included in gmail length restriction
296
+
297
+ if (!isByteLength(username.replace(/\./g, ''), {
298
+ min: 6,
299
+ max: 30
300
+ })) {
301
+ return false;
302
+ }
303
+
304
+ var _user_parts = username.split('.');
305
+
306
+ for (var i = 0; i < _user_parts.length; i++) {
307
+ if (!gmailUserPart.test(_user_parts[i])) {
308
+ return false;
309
+ }
310
+ }
311
+ }
312
+
313
+ if (options.ignore_max_length === false && (!isByteLength(user, {
314
+ max: 64
315
+ }) || !isByteLength(domain, {
316
+ max: 254
317
+ }))) {
318
+ return false;
319
+ }
320
+
321
+ if (!isFQDN(domain, {
322
+ require_tld: options.require_tld,
323
+ ignore_max_length: options.ignore_max_length
324
+ })) {
325
+ if (!options.allow_ip_domain) {
326
+ return false;
327
+ }
328
+
329
+ if (!isIP(domain)) {
330
+ if (!domain.startsWith('[') || !domain.endsWith(']')) {
331
+ return false;
332
+ }
333
+
334
+ var noBracketdomain = domain.slice(1, -1);
335
+
336
+ if (noBracketdomain.length === 0 || !isIP(noBracketdomain)) {
337
+ return false;
338
+ }
339
+ }
340
+ }
341
+
342
+ if (user[0] === '"') {
343
+ user = user.slice(1, user.length - 1);
344
+ return options.allow_utf8_local_part ? quotedEmailUserUtf8.test(user) : quotedEmailUser.test(user);
345
+ }
346
+
347
+ var pattern = options.allow_utf8_local_part ? emailUserUtf8Part : emailUserPart;
348
+ var user_parts = user.split('.');
349
+
350
+ for (var _i = 0; _i < user_parts.length; _i++) {
351
+ if (!pattern.test(user_parts[_i])) {
352
+ return false;
353
+ }
354
+ }
355
+
356
+ if (options.blacklisted_chars) {
357
+ if (user.search(new RegExp("[".concat(options.blacklisted_chars, "]+"), 'g')) !== -1) return false;
358
+ }
359
+
360
+ return true;
361
+ }
362
+
363
+ n4s.enforce.extend({ isEmail });
@@ -0,0 +1,6 @@
1
+ 'use strict'
2
+ if (process.env.NODE_ENV === 'production') {
3
+ module.exports = require('./email.production.js');
4
+ } else {
5
+ module.exports = require('./email.development.js');
6
+ }
@@ -0,0 +1 @@
1
+ "use strict";var t=require("n4s");function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}function n(t){if(!("string"==typeof t||t instanceof String)){var n=e(t);throw null===t?n="null":"object"===n&&(n=t.constructor.name),new TypeError("Expected a string but received a ".concat(n))}}function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;for(var n in e)void 0===t[n]&&(t[n]=e[n]);return t}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(t,e){var r,i;n(t),"object"===o(e)?(r=e.min||0,i=e.max):(r=arguments[1],i=arguments[2]);var a=encodeURI(t).split(/%..|./).length-1;return a>=r&&(void 0===i||a<=i)}var a={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};var c="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",l="(".concat(c,"[.]){3}").concat(c),u=new RegExp("^".concat(l,"$")),s="(?:[0-9a-fA-F]{1,4})",f=new RegExp("^("+"(?:".concat(s,":){7}(?:").concat(s,"|:)|")+"(?:".concat(s,":){6}(?:").concat(l,"|:").concat(s,"|:)|")+"(?:".concat(s,":){5}(?::").concat(l,"|(:").concat(s,"){1,2}|:)|")+"(?:".concat(s,":){4}(?:(:").concat(s,"){0,1}:").concat(l,"|(:").concat(s,"){1,3}|:)|")+"(?:".concat(s,":){3}(?:(:").concat(s,"){0,2}:").concat(l,"|(:").concat(s,"){1,4}|:)|")+"(?:".concat(s,":){2}(?:(:").concat(s,"){0,3}:").concat(l,"|(:").concat(s,"){1,5}|:)|")+"(?:".concat(s,":){1}(?:(:").concat(s,"){0,4}:").concat(l,"|(:").concat(s,"){1,6}|:)|")+"(?::((?::".concat(s,"){0,5}:").concat(l,"|(?::").concat(s,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");function _(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return n(t),(e=String(e))?"4"===e?u.test(t):"6"===e&&f.test(t):_(t,4)||_(t,6)}var x={allow_display_name:!1,require_display_name:!1,allow_utf8_local_part:!0,require_tld:!0,blacklisted_chars:"",ignore_max_length:!1,host_blacklist:[],host_whitelist:[]},d=/^([^\x00-\x1F\x7F-\x9F\cX]+)</i,g=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,m=/^[a-z\d]+$/,p=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,F=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,h=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i;t.enforce.extend({isEmail:function(t,e){if(n(t),(e=r(e,x)).require_display_name||e.allow_display_name){var o=t.match(d);if(o){var c=o[1];if(t=t.replace(c,"").replace(/(^<|>$)/g,""),c.endsWith(" ")&&(c=c.slice(0,-1)),!function(t){var e=t.replace(/^"(.+)"$/,"$1");if(!e.trim())return!1;if(/[\.";<>]/.test(e)){if(e===t)return!1;if(e.split('"').length!==e.split('\\"').length)return!1}return!0}(c))return!1}else if(e.require_display_name)return!1}if(!e.ignore_max_length&&t.length>254)return!1;var l=t.split("@"),u=l.pop(),s=u.toLowerCase();if(e.host_blacklist.includes(s))return!1;if(e.host_whitelist.length>0&&!e.host_whitelist.includes(s))return!1;var f=l.join("@");if(e.domain_specific_validation&&("gmail.com"===s||"googlemail.com"===s)){var y=(f=f.toLowerCase()).split("+")[0];if(!i(y.replace(/\./g,""),{min:6,max:30}))return!1;for(var b=y.split("."),v=0;v<b.length;v++)if(!m.test(b[v]))return!1}if(!(!1!==e.ignore_max_length||i(f,{max:64})&&i(u,{max:254})))return!1;if(!function(t,e){n(t),(e=r(e,a)).allow_trailing_dot&&"."===t[t.length-1]&&(t=t.substring(0,t.length-1)),!0===e.allow_wildcard&&0===t.indexOf("*.")&&(t=t.substring(2));var o=t.split("."),i=o[o.length-1];if(e.require_tld){if(o.length<2)return!1;if(!e.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(i))return!1;if(/\s/.test(i))return!1}return!(!e.allow_numeric_tld&&/^\d+$/.test(i))&&o.every((function(t){return!(t.length>63&&!e.ignore_max_length||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(t)||/[\uff01-\uff5e]/.test(t)||/^-|-$/.test(t)||!e.allow_underscores&&/_/.test(t))}))}(u,{require_tld:e.require_tld,ignore_max_length:e.ignore_max_length})){if(!e.allow_ip_domain)return!1;if(!_(u)){if(!u.startsWith("[")||!u.endsWith("]"))return!1;var w=u.slice(1,-1);if(0===w.length||!_(w))return!1}}if('"'===f[0])return f=f.slice(1,f.length-1),e.allow_utf8_local_part?h.test(f):p.test(f);for(var $=e.allow_utf8_local_part?F:g,D=f.split("."),S=0;S<D.length;S++)if(!$.test(D[S]))return!1;return!e.blacklisted_chars||-1===f.search(new RegExp("[".concat(e.blacklisted_chars,"]+"),"g"))}});