UNPKG

74.1 kBJavaScriptView Raw
1(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
2module.exports = {
3 VERSION: '%KARMA_VERSION%',
4 KARMA_URL_ROOT: '%KARMA_URL_ROOT%',
5 KARMA_PROXY_PATH: '%KARMA_PROXY_PATH%',
6 BROWSER_SOCKET_TIMEOUT: '%BROWSER_SOCKET_TIMEOUT%',
7 CONTEXT_URL: 'context.html'
8}
9
10},{}],2:[function(require,module,exports){
11var stringify = require('../common/stringify')
12var constant = require('./constants')
13var util = require('../common/util')
14
15function Karma (socket, iframe, opener, navigator, location, document) {
16 var startEmitted = false
17 var reloadingContext = false
18 var self = this
19 var queryParams = util.parseQueryParams(location.search)
20 var browserId = queryParams.id || util.generateId('manual-')
21 var displayName = queryParams.displayName
22 var returnUrl = queryParams['return_url' + ''] || null
23
24 var resultsBufferLimit = 50
25 var resultsBuffer = []
26
27 // This is a no-op if not running with a Trusted Types CSP policy, and
28 // lets tests declare that they trust the way that karma creates and handles
29 // URLs.
30 //
31 // More info about the proposed Trusted Types standard at
32 // https://github.com/WICG/trusted-types
33 var policy = {
34 createURL: function (s) {
35 return s
36 },
37 createScriptURL: function (s) {
38 return s
39 }
40 }
41 var trustedTypes = window.trustedTypes || window.TrustedTypes
42 if (trustedTypes) {
43 policy = trustedTypes.createPolicy('karma', policy)
44 if (!policy.createURL) {
45 // Install createURL for newer browsers. Only browsers that implement an
46 // old version of the spec require createURL.
47 // Should be safe to delete all reference to createURL by
48 // February 2020.
49 // https://github.com/WICG/trusted-types/pull/204
50 policy.createURL = function (s) { return s }
51 }
52 }
53
54 // This variable will be set to "true" whenever the socket lost connection and was able to
55 // reconnect to the Karma server. This will be passed to the Karma server then, so that
56 // Karma can differentiate between a socket client reconnect and a full browser reconnect.
57 var socketReconnect = false
58
59 this.VERSION = constant.VERSION
60 this.config = {}
61
62 // Expose for testing purposes as there is no global socket.io
63 // registry anymore.
64 this.socket = socket
65
66 // Set up postMessage bindings for current window
67 // DEV: These are to allow windows in separate processes execute local tasks
68 // Electron is one of these environments
69 if (window.addEventListener) {
70 window.addEventListener('message', function handleMessage (evt) {
71 // Resolve the origin of our message
72 var origin = evt.origin || evt.originalEvent.origin
73
74 // If the message isn't from our host, then reject it
75 if (origin !== window.location.origin) {
76 return
77 }
78
79 // Take action based on the message type
80 var method = evt.data.__karmaMethod
81 if (method) {
82 if (!self[method]) {
83 self.error('Received `postMessage` for "' + method + '" but the method doesn\'t exist')
84 return
85 }
86 self[method].apply(self, evt.data.__karmaArguments)
87 }
88 }, false)
89 }
90
91 var childWindow = null
92 function navigateContextTo (url) {
93 if (self.config.useIframe === false) {
94 // run in new window
95 if (self.config.runInParent === false) {
96 // If there is a window already open, then close it
97 // DEV: In some environments (e.g. Electron), we don't have setter access for location
98 if (childWindow !== null && childWindow.closed !== true) {
99 childWindow.close()
100 }
101 childWindow = opener(url)
102 // run context on parent element (client_with_context)
103 // using window.__karma__.scriptUrls to get the html element strings and load them dynamically
104 } else if (url !== 'about:blank') {
105 var loadScript = function (idx) {
106 if (idx < window.__karma__.scriptUrls.length) {
107 var parser = new DOMParser()
108 // Revert escaped characters with special roles in HTML before parsing
109 var string = window.__karma__.scriptUrls[idx]
110 .replace(/\\x3C/g, '<')
111 .replace(/\\x3E/g, '>')
112 var doc = parser.parseFromString(string, 'text/html')
113 var ele = doc.head.firstChild || doc.body.firstChild
114 // script elements created by DomParser are marked as unexecutable,
115 // create a new script element manually and copy necessary properties
116 // so it is executable
117 if (ele.tagName && ele.tagName.toLowerCase() === 'script') {
118 var tmp = ele
119 ele = document.createElement('script')
120 ele.src = policy.createScriptURL(tmp.src)
121 ele.crossOrigin = tmp.crossOrigin
122 }
123 ele.onload = function () {
124 loadScript(idx + 1)
125 }
126 document.body.appendChild(ele)
127 } else {
128 window.__karma__.loaded()
129 }
130 }
131 loadScript(0)
132 }
133 // run in iframe
134 } else {
135 iframe.src = policy.createURL(url)
136 }
137 }
138
139 this.onbeforeunload = function () {
140 if (!reloadingContext) {
141 // TODO(vojta): show what test (with explanation about jasmine.UPDATE_INTERVAL)
142 self.error('Some of your tests did a full page reload!')
143 }
144 }
145
146 this.log = function (type, args) {
147 var values = []
148
149 for (var i = 0; i < args.length; i++) {
150 values.push(this.stringify(args[i], 3))
151 }
152
153 this.info({ log: values.join(', '), type: type })
154 }
155
156 this.stringify = stringify
157
158 function clearContext () {
159 reloadingContext = true
160
161 navigateContextTo('about:blank')
162 }
163
164 function getLocation (url, lineno, colno) {
165 var location = ''
166
167 if (url !== undefined) {
168 location += url
169 }
170
171 if (lineno !== undefined) {
172 location += ':' + lineno
173 }
174
175 if (colno !== undefined) {
176 location += ':' + colno
177 }
178
179 return location
180 }
181
182 // error during js file loading (most likely syntax error)
183 // we are not going to execute at all. `window.onerror` callback.
184 this.error = function (messageOrEvent, source, lineno, colno, error) {
185 var message
186 if (typeof messageOrEvent === 'string') {
187 message = messageOrEvent
188
189 var location = getLocation(source, lineno, colno)
190 if (location !== '') {
191 message += '\nat ' + location
192 }
193 if (error && error.stack) {
194 message += '\n\n' + error.stack
195 }
196 } else {
197 // create an object with the string representation of the message to
198 // ensure all its content is properly transferred to the console log
199 message = { message: messageOrEvent, str: messageOrEvent.toString() }
200 }
201
202 socket.emit('karma_error', message)
203 this.complete()
204 return false
205 }
206
207 this.result = function (originalResult) {
208 var convertedResult = {}
209
210 // Convert all array-like objects to real arrays.
211 for (var propertyName in originalResult) {
212 if (originalResult.hasOwnProperty(propertyName)) {
213 var propertyValue = originalResult[propertyName]
214
215 if (Object.prototype.toString.call(propertyValue) === '[object Array]') {
216 convertedResult[propertyName] = Array.prototype.slice.call(propertyValue)
217 } else {
218 convertedResult[propertyName] = propertyValue
219 }
220 }
221 }
222
223 if (!startEmitted) {
224 socket.emit('start', { total: null })
225 startEmitted = true
226 }
227
228 if (resultsBufferLimit === 1) {
229 return socket.emit('result', convertedResult)
230 }
231
232 resultsBuffer.push(convertedResult)
233
234 if (resultsBuffer.length === resultsBufferLimit) {
235 socket.emit('result', resultsBuffer)
236 resultsBuffer = []
237 }
238 }
239
240 this.complete = function (result) {
241 if (resultsBuffer.length) {
242 socket.emit('result', resultsBuffer)
243 resultsBuffer = []
244 }
245
246 if (self.config.clearContext) {
247 // give the browser some time to breath, there could be a page reload, but because a bunch of
248 // tests could run in the same event loop, we wouldn't notice.
249 setTimeout(function () {
250 clearContext()
251 }, 0)
252 }
253
254 socket.emit('complete', result || {}, function () {
255 if (returnUrl) {
256 location.href = returnUrl
257 }
258 })
259 }
260
261 this.info = function (info) {
262 // TODO(vojta): introduce special API for this
263 if (!startEmitted && util.isDefined(info.total)) {
264 socket.emit('start', info)
265 startEmitted = true
266 } else {
267 socket.emit('info', info)
268 }
269 }
270
271 socket.on('execute', function (cfg) {
272 // reset startEmitted and reload the iframe
273 startEmitted = false
274 self.config = cfg
275 // if not clearing context, reloadingContext always true to prevent beforeUnload error
276 reloadingContext = !self.config.clearContext
277 navigateContextTo(constant.CONTEXT_URL)
278
279 if (self.config.clientDisplayNone) {
280 [].forEach.call(document.querySelectorAll('#banner, #browsers'), function (el) {
281 el.style.display = 'none'
282 })
283 }
284
285 // clear the console before run
286 // works only on FF (Safari, Chrome do not allow to clear console from js source)
287 if (window.console && window.console.clear) {
288 window.console.clear()
289 }
290 })
291 socket.on('stop', function () {
292 this.complete()
293 }.bind(this))
294
295 // Report the browser name and Id. Note that this event can also fire if the connection has
296 // been temporarily lost, but the socket reconnected automatically. Read more in the docs:
297 // https://socket.io/docs/client-api/#Event-%E2%80%98connect%E2%80%99
298 socket.on('connect', function () {
299 socket.io.engine.on('upgrade', function () {
300 resultsBufferLimit = 1
301 })
302 var info = {
303 name: navigator.userAgent,
304 id: browserId,
305 isSocketReconnect: socketReconnect
306 }
307 if (displayName) {
308 info.displayName = displayName
309 }
310 socket.emit('register', info)
311 })
312
313 socket.on('reconnect', function () {
314 socketReconnect = true
315 })
316}
317
318module.exports = Karma
319
320},{"../common/stringify":5,"../common/util":6,"./constants":1}],3:[function(require,module,exports){
321/* global io */
322/* eslint-disable no-new */
323
324var Karma = require('./karma')
325var StatusUpdater = require('./updater')
326var util = require('../common/util')
327var constants = require('./constants')
328
329var KARMA_URL_ROOT = constants.KARMA_URL_ROOT
330var KARMA_PROXY_PATH = constants.KARMA_PROXY_PATH
331var BROWSER_SOCKET_TIMEOUT = constants.BROWSER_SOCKET_TIMEOUT
332
333// Connect to the server using socket.io http://socket.io
334var socket = io(location.host, {
335 reconnectionDelay: 500,
336 reconnectionDelayMax: Infinity,
337 timeout: BROWSER_SOCKET_TIMEOUT,
338 path: KARMA_PROXY_PATH + KARMA_URL_ROOT.substr(1) + 'socket.io',
339 'sync disconnect on unload': true
340})
341
342// instantiate the updater of the view
343new StatusUpdater(socket, util.elm('title'), util.elm('banner'), util.elm('browsers'))
344window.karma = new Karma(socket, util.elm('context'), window.open,
345 window.navigator, window.location, window.document)
346
347},{"../common/util":6,"./constants":1,"./karma":2,"./updater":4}],4:[function(require,module,exports){
348var VERSION = require('./constants').VERSION
349
350function StatusUpdater (socket, titleElement, bannerElement, browsersElement) {
351 function updateBrowsersInfo (browsers) {
352 if (!browsersElement) {
353 return
354 }
355 var status
356
357 // clear browsersElement
358 while (browsersElement.firstChild) {
359 browsersElement.removeChild(browsersElement.firstChild)
360 }
361
362 for (var i = 0; i < browsers.length; i++) {
363 status = browsers[i].isConnected ? 'idle' : 'executing'
364 var li = document.createElement('li')
365 li.setAttribute('class', status)
366 li.textContent = browsers[i].name + ' is ' + status
367 browsersElement.appendChild(li)
368 }
369 }
370
371 function updateBanner (status) {
372 return function (param) {
373 if (!titleElement || !bannerElement) {
374 return
375 }
376 var paramStatus = param ? status.replace('$', param) : status
377 titleElement.textContent = 'Karma v' + VERSION + ' - ' + paramStatus
378 bannerElement.className = status === 'connected' ? 'online' : 'offline'
379 }
380 }
381
382 socket.on('connect', updateBanner('connected'))
383 socket.on('disconnect', updateBanner('disconnected'))
384 socket.on('reconnecting', updateBanner('reconnecting in $ seconds...'))
385 socket.on('reconnect', updateBanner('connected'))
386 socket.on('reconnect_failed', updateBanner('failed to reconnect'))
387 socket.on('info', updateBrowsersInfo)
388 socket.on('disconnect', function () {
389 updateBrowsersInfo([])
390 })
391}
392
393module.exports = StatusUpdater
394
395},{"./constants":1}],5:[function(require,module,exports){
396var serialize = null
397try {
398 serialize = require('dom-serialize')
399} catch (e) {
400 // Ignore failure on IE8
401}
402
403var instanceOf = require('./util').instanceOf
404
405function isNode (obj) {
406 return (obj.tagName || obj.nodeName) && obj.nodeType
407}
408
409function stringify (obj, depth) {
410 if (depth === 0) {
411 return '...'
412 }
413
414 if (obj === null) {
415 return 'null'
416 }
417
418 switch (typeof obj) {
419 case 'symbol':
420 return obj.toString()
421 case 'string':
422 return "'" + obj + "'"
423 case 'undefined':
424 return 'undefined'
425 case 'function':
426 try {
427 // function abc(a, b, c) { /* code goes here */ }
428 // -> function abc(a, b, c) { ... }
429 return obj.toString().replace(/\{[\s\S]*\}/, '{ ... }')
430 } catch (err) {
431 if (err instanceof TypeError) {
432 // Support older browsers
433 return 'function ' + (obj.name || '') + '() { ... }'
434 } else {
435 throw err
436 }
437 }
438 case 'boolean':
439 return obj ? 'true' : 'false'
440 case 'object':
441 var strs = []
442 if (instanceOf(obj, 'Array')) {
443 strs.push('[')
444 for (var i = 0, ii = obj.length; i < ii; i++) {
445 if (i) {
446 strs.push(', ')
447 }
448 strs.push(stringify(obj[i], depth - 1))
449 }
450 strs.push(']')
451 } else if (instanceOf(obj, 'Date')) {
452 return obj.toString()
453 } else if (instanceOf(obj, 'Text')) {
454 return obj.nodeValue
455 } else if (instanceOf(obj, 'Comment')) {
456 return '<!--' + obj.nodeValue + '-->'
457 } else if (obj.outerHTML) {
458 return obj.outerHTML
459 } else if (isNode(obj)) {
460 if (serialize) {
461 return serialize(obj)
462 } else {
463 return 'Skipping stringify, no support for dom-serialize'
464 }
465 } else if (instanceOf(obj, 'Error')) {
466 return obj.toString() + '\n' + obj.stack
467 } else {
468 var constructor = 'Object'
469 if (obj.constructor && typeof obj.constructor === 'function') {
470 constructor = obj.constructor.name
471 }
472
473 strs.push(constructor)
474 strs.push('{')
475 var first = true
476 for (var key in obj) {
477 if (Object.prototype.hasOwnProperty.call(obj, key)) {
478 if (first) {
479 first = false
480 } else {
481 strs.push(', ')
482 }
483
484 strs.push(key + ': ' + stringify(obj[key], depth - 1))
485 }
486 }
487 strs.push('}')
488 }
489 return strs.join('')
490 default:
491 return obj
492 }
493}
494
495module.exports = stringify
496
497},{"./util":6,"dom-serialize":8}],6:[function(require,module,exports){
498exports.instanceOf = function (value, constructorName) {
499 return Object.prototype.toString.apply(value) === '[object ' + constructorName + ']'
500}
501
502exports.elm = function (id) {
503 return document.getElementById(id)
504}
505
506exports.generateId = function (prefix) {
507 return prefix + Math.floor(Math.random() * 10000)
508}
509
510exports.isUndefined = function (value) {
511 return typeof value === 'undefined'
512}
513
514exports.isDefined = function (value) {
515 return !exports.isUndefined(value)
516}
517
518exports.parseQueryParams = function (locationSearch) {
519 var params = {}
520 var pairs = locationSearch.substr(1).split('&')
521 var keyValue
522
523 for (var i = 0; i < pairs.length; i++) {
524 keyValue = pairs[i].split('=')
525 params[decodeURIComponent(keyValue[0])] = decodeURIComponent(keyValue[1])
526 }
527
528 return params
529}
530
531},{}],7:[function(require,module,exports){
532(function (global){
533
534var NativeCustomEvent = global.CustomEvent;
535
536function useNative () {
537 try {
538 var p = new NativeCustomEvent('cat', { detail: { foo: 'bar' } });
539 return 'cat' === p.type && 'bar' === p.detail.foo;
540 } catch (e) {
541 }
542 return false;
543}
544
545/**
546 * Cross-browser `CustomEvent` constructor.
547 *
548 * https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent.CustomEvent
549 *
550 * @public
551 */
552
553module.exports = useNative() ? NativeCustomEvent :
554
555// IE >= 9
556'undefined' !== typeof document && 'function' === typeof document.createEvent ? function CustomEvent (type, params) {
557 var e = document.createEvent('CustomEvent');
558 if (params) {
559 e.initCustomEvent(type, params.bubbles, params.cancelable, params.detail);
560 } else {
561 e.initCustomEvent(type, false, false, void 0);
562 }
563 return e;
564} :
565
566// IE <= 8
567function CustomEvent (type, params) {
568 var e = document.createEventObject();
569 e.type = type;
570 if (params) {
571 e.bubbles = Boolean(params.bubbles);
572 e.cancelable = Boolean(params.cancelable);
573 e.detail = params.detail;
574 } else {
575 e.bubbles = false;
576 e.cancelable = false;
577 e.detail = void 0;
578 }
579 return e;
580}
581
582}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
583},{}],8:[function(require,module,exports){
584
585/**
586 * Module dependencies.
587 */
588
589var extend = require('extend');
590var encode = require('ent/encode');
591var CustomEvent = require('custom-event');
592var voidElements = require('void-elements');
593
594/**
595 * Module exports.
596 */
597
598exports = module.exports = serialize;
599exports.serializeElement = serializeElement;
600exports.serializeAttribute = serializeAttribute;
601exports.serializeText = serializeText;
602exports.serializeComment = serializeComment;
603exports.serializeDocument = serializeDocument;
604exports.serializeDoctype = serializeDoctype;
605exports.serializeDocumentFragment = serializeDocumentFragment;
606exports.serializeNodeList = serializeNodeList;
607
608/**
609 * Serializes any DOM node. Returns a string.
610 *
611 * @param {Node} node - DOM Node to serialize
612 * @param {String} [context] - optional arbitrary "context" string to use (useful for event listeners)
613 * @param {Function} [fn] - optional callback function to use in the "serialize" event for this call
614 * @param {EventTarget} [eventTarget] - optional EventTarget instance to emit the "serialize" event on (defaults to `node`)
615 * return {String}
616 * @public
617 */
618
619function serialize (node, context, fn, eventTarget) {
620 if (!node) return '';
621 if ('function' === typeof context) {
622 fn = context;
623 context = null;
624 }
625 if (!context) context = null;
626
627 var rtn;
628 var nodeType = node.nodeType;
629
630 if (!nodeType && 'number' === typeof node.length) {
631 // assume it's a NodeList or Array of Nodes
632 rtn = exports.serializeNodeList(node, context, fn);
633 } else {
634
635 if ('function' === typeof fn) {
636 // one-time "serialize" event listener
637 node.addEventListener('serialize', fn, false);
638 }
639
640 // emit a custom "serialize" event on `node`, in case there
641 // are event listeners for custom serialization of this node
642 var e = new CustomEvent('serialize', {
643 bubbles: true,
644 cancelable: true,
645 detail: {
646 serialize: null,
647 context: context
648 }
649 });
650
651 e.serializeTarget = node;
652
653 var target = eventTarget || node;
654 var cancelled = !target.dispatchEvent(e);
655
656 // `e.detail.serialize` can be set to a:
657 // String - returned directly
658 // Node - goes through serializer logic instead of `node`
659 // Anything else - get Stringified first, and then returned directly
660 var s = e.detail.serialize;
661 if (s != null) {
662 if ('string' === typeof s) {
663 rtn = s;
664 } else if ('number' === typeof s.nodeType) {
665 // make it go through the serialization logic
666 rtn = serialize(s, context, null, target);
667 } else {
668 rtn = String(s);
669 }
670 } else if (!cancelled) {
671 // default serialization logic
672 switch (nodeType) {
673 case 1 /* element */:
674 rtn = exports.serializeElement(node, context, eventTarget);
675 break;
676 case 2 /* attribute */:
677 rtn = exports.serializeAttribute(node);
678 break;
679 case 3 /* text */:
680 rtn = exports.serializeText(node);
681 break;
682 case 8 /* comment */:
683 rtn = exports.serializeComment(node);
684 break;
685 case 9 /* document */:
686 rtn = exports.serializeDocument(node, context, eventTarget);
687 break;
688 case 10 /* doctype */:
689 rtn = exports.serializeDoctype(node);
690 break;
691 case 11 /* document fragment */:
692 rtn = exports.serializeDocumentFragment(node, context, eventTarget);
693 break;
694 }
695 }
696
697 if ('function' === typeof fn) {
698 node.removeEventListener('serialize', fn, false);
699 }
700 }
701
702 return rtn || '';
703}
704
705/**
706 * Serialize an Attribute node.
707 */
708
709function serializeAttribute (node, opts) {
710 return node.name + '="' + encode(node.value, extend({
711 named: true
712 }, opts)) + '"';
713}
714
715/**
716 * Serialize a DOM element.
717 */
718
719function serializeElement (node, context, eventTarget) {
720 var c, i, l;
721 var name = node.nodeName.toLowerCase();
722
723 // opening tag
724 var r = '<' + name;
725
726 // attributes
727 for (i = 0, c = node.attributes, l = c.length; i < l; i++) {
728 r += ' ' + exports.serializeAttribute(c[i]);
729 }
730
731 r += '>';
732
733 // child nodes
734 r += exports.serializeNodeList(node.childNodes, context, null, eventTarget);
735
736 // closing tag, only for non-void elements
737 if (!voidElements[name]) {
738 r += '</' + name + '>';
739 }
740
741 return r;
742}
743
744/**
745 * Serialize a text node.
746 */
747
748function serializeText (node, opts) {
749 return encode(node.nodeValue, extend({
750 named: true,
751 special: { '<': true, '>': true, '&': true }
752 }, opts));
753}
754
755/**
756 * Serialize a comment node.
757 */
758
759function serializeComment (node) {
760 return '<!--' + node.nodeValue + '-->';
761}
762
763/**
764 * Serialize a Document node.
765 */
766
767function serializeDocument (node, context, eventTarget) {
768 return exports.serializeNodeList(node.childNodes, context, null, eventTarget);
769}
770
771/**
772 * Serialize a DOCTYPE node.
773 * See: http://stackoverflow.com/a/10162353
774 */
775
776function serializeDoctype (node) {
777 var r = '<!DOCTYPE ' + node.name;
778
779 if (node.publicId) {
780 r += ' PUBLIC "' + node.publicId + '"';
781 }
782
783 if (!node.publicId && node.systemId) {
784 r += ' SYSTEM';
785 }
786
787 if (node.systemId) {
788 r += ' "' + node.systemId + '"';
789 }
790
791 r += '>';
792 return r;
793}
794
795/**
796 * Serialize a DocumentFragment instance.
797 */
798
799function serializeDocumentFragment (node, context, eventTarget) {
800 return exports.serializeNodeList(node.childNodes, context, null, eventTarget);
801}
802
803/**
804 * Serialize a NodeList/Array of nodes.
805 */
806
807function serializeNodeList (list, context, fn, eventTarget) {
808 var r = '';
809 for (var i = 0, l = list.length; i < l; i++) {
810 r += serialize(list[i], context, fn, eventTarget);
811 }
812 return r;
813}
814
815},{"custom-event":7,"ent/encode":9,"extend":11,"void-elements":13}],9:[function(require,module,exports){
816var punycode = require('punycode');
817var revEntities = require('./reversed.json');
818
819module.exports = encode;
820
821function encode (str, opts) {
822 if (typeof str !== 'string') {
823 throw new TypeError('Expected a String');
824 }
825 if (!opts) opts = {};
826
827 var numeric = true;
828 if (opts.named) numeric = false;
829 if (opts.numeric !== undefined) numeric = opts.numeric;
830
831 var special = opts.special || {
832 '"': true, "'": true,
833 '<': true, '>': true,
834 '&': true
835 };
836
837 var codePoints = punycode.ucs2.decode(str);
838 var chars = [];
839 for (var i = 0; i < codePoints.length; i++) {
840 var cc = codePoints[i];
841 var c = punycode.ucs2.encode([ cc ]);
842 var e = revEntities[cc];
843 if (e && (cc >= 127 || special[c]) && !numeric) {
844 chars.push('&' + (/;$/.test(e) ? e : e + ';'));
845 }
846 else if (cc < 32 || cc >= 127 || special[c]) {
847 chars.push('&#' + cc + ';');
848 }
849 else {
850 chars.push(c);
851 }
852 }
853 return chars.join('');
854}
855
856},{"./reversed.json":10,"punycode":12}],10:[function(require,module,exports){
857module.exports={
858 "9": "Tab;",
859 "10": "NewLine;",
860 "33": "excl;",
861 "34": "quot;",
862 "35": "num;",
863 "36": "dollar;",
864 "37": "percnt;",
865 "38": "amp;",
866 "39": "apos;",
867 "40": "lpar;",
868 "41": "rpar;",
869 "42": "midast;",
870 "43": "plus;",
871 "44": "comma;",
872 "46": "period;",
873 "47": "sol;",
874 "58": "colon;",
875 "59": "semi;",
876 "60": "lt;",
877 "61": "equals;",
878 "62": "gt;",
879 "63": "quest;",
880 "64": "commat;",
881 "91": "lsqb;",
882 "92": "bsol;",
883 "93": "rsqb;",
884 "94": "Hat;",
885 "95": "UnderBar;",
886 "96": "grave;",
887 "123": "lcub;",
888 "124": "VerticalLine;",
889 "125": "rcub;",
890 "160": "NonBreakingSpace;",
891 "161": "iexcl;",
892 "162": "cent;",
893 "163": "pound;",
894 "164": "curren;",
895 "165": "yen;",
896 "166": "brvbar;",
897 "167": "sect;",
898 "168": "uml;",
899 "169": "copy;",
900 "170": "ordf;",
901 "171": "laquo;",
902 "172": "not;",
903 "173": "shy;",
904 "174": "reg;",
905 "175": "strns;",
906 "176": "deg;",
907 "177": "pm;",
908 "178": "sup2;",
909 "179": "sup3;",
910 "180": "DiacriticalAcute;",
911 "181": "micro;",
912 "182": "para;",
913 "183": "middot;",
914 "184": "Cedilla;",
915 "185": "sup1;",
916 "186": "ordm;",
917 "187": "raquo;",
918 "188": "frac14;",
919 "189": "half;",
920 "190": "frac34;",
921 "191": "iquest;",
922 "192": "Agrave;",
923 "193": "Aacute;",
924 "194": "Acirc;",
925 "195": "Atilde;",
926 "196": "Auml;",
927 "197": "Aring;",
928 "198": "AElig;",
929 "199": "Ccedil;",
930 "200": "Egrave;",
931 "201": "Eacute;",
932 "202": "Ecirc;",
933 "203": "Euml;",
934 "204": "Igrave;",
935 "205": "Iacute;",
936 "206": "Icirc;",
937 "207": "Iuml;",
938 "208": "ETH;",
939 "209": "Ntilde;",
940 "210": "Ograve;",
941 "211": "Oacute;",
942 "212": "Ocirc;",
943 "213": "Otilde;",
944 "214": "Ouml;",
945 "215": "times;",
946 "216": "Oslash;",
947 "217": "Ugrave;",
948 "218": "Uacute;",
949 "219": "Ucirc;",
950 "220": "Uuml;",
951 "221": "Yacute;",
952 "222": "THORN;",
953 "223": "szlig;",
954 "224": "agrave;",
955 "225": "aacute;",
956 "226": "acirc;",
957 "227": "atilde;",
958 "228": "auml;",
959 "229": "aring;",
960 "230": "aelig;",
961 "231": "ccedil;",
962 "232": "egrave;",
963 "233": "eacute;",
964 "234": "ecirc;",
965 "235": "euml;",
966 "236": "igrave;",
967 "237": "iacute;",
968 "238": "icirc;",
969 "239": "iuml;",
970 "240": "eth;",
971 "241": "ntilde;",
972 "242": "ograve;",
973 "243": "oacute;",
974 "244": "ocirc;",
975 "245": "otilde;",
976 "246": "ouml;",
977 "247": "divide;",
978 "248": "oslash;",
979 "249": "ugrave;",
980 "250": "uacute;",
981 "251": "ucirc;",
982 "252": "uuml;",
983 "253": "yacute;",
984 "254": "thorn;",
985 "255": "yuml;",
986 "256": "Amacr;",
987 "257": "amacr;",
988 "258": "Abreve;",
989 "259": "abreve;",
990 "260": "Aogon;",
991 "261": "aogon;",
992 "262": "Cacute;",
993 "263": "cacute;",
994 "264": "Ccirc;",
995 "265": "ccirc;",
996 "266": "Cdot;",
997 "267": "cdot;",
998 "268": "Ccaron;",
999 "269": "ccaron;",
1000 "270": "Dcaron;",
1001 "271": "dcaron;",
1002 "272": "Dstrok;",
1003 "273": "dstrok;",
1004 "274": "Emacr;",
1005 "275": "emacr;",
1006 "278": "Edot;",
1007 "279": "edot;",
1008 "280": "Eogon;",
1009 "281": "eogon;",
1010 "282": "Ecaron;",
1011 "283": "ecaron;",
1012 "284": "Gcirc;",
1013 "285": "gcirc;",
1014 "286": "Gbreve;",
1015 "287": "gbreve;",
1016 "288": "Gdot;",
1017 "289": "gdot;",
1018 "290": "Gcedil;",
1019 "292": "Hcirc;",
1020 "293": "hcirc;",
1021 "294": "Hstrok;",
1022 "295": "hstrok;",
1023 "296": "Itilde;",
1024 "297": "itilde;",
1025 "298": "Imacr;",
1026 "299": "imacr;",
1027 "302": "Iogon;",
1028 "303": "iogon;",
1029 "304": "Idot;",
1030 "305": "inodot;",
1031 "306": "IJlig;",
1032 "307": "ijlig;",
1033 "308": "Jcirc;",
1034 "309": "jcirc;",
1035 "310": "Kcedil;",
1036 "311": "kcedil;",
1037 "312": "kgreen;",
1038 "313": "Lacute;",
1039 "314": "lacute;",
1040 "315": "Lcedil;",
1041 "316": "lcedil;",
1042 "317": "Lcaron;",
1043 "318": "lcaron;",
1044 "319": "Lmidot;",
1045 "320": "lmidot;",
1046 "321": "Lstrok;",
1047 "322": "lstrok;",
1048 "323": "Nacute;",
1049 "324": "nacute;",
1050 "325": "Ncedil;",
1051 "326": "ncedil;",
1052 "327": "Ncaron;",
1053 "328": "ncaron;",
1054 "329": "napos;",
1055 "330": "ENG;",
1056 "331": "eng;",
1057 "332": "Omacr;",
1058 "333": "omacr;",
1059 "336": "Odblac;",
1060 "337": "odblac;",
1061 "338": "OElig;",
1062 "339": "oelig;",
1063 "340": "Racute;",
1064 "341": "racute;",
1065 "342": "Rcedil;",
1066 "343": "rcedil;",
1067 "344": "Rcaron;",
1068 "345": "rcaron;",
1069 "346": "Sacute;",
1070 "347": "sacute;",
1071 "348": "Scirc;",
1072 "349": "scirc;",
1073 "350": "Scedil;",
1074 "351": "scedil;",
1075 "352": "Scaron;",
1076 "353": "scaron;",
1077 "354": "Tcedil;",
1078 "355": "tcedil;",
1079 "356": "Tcaron;",
1080 "357": "tcaron;",
1081 "358": "Tstrok;",
1082 "359": "tstrok;",
1083 "360": "Utilde;",
1084 "361": "utilde;",
1085 "362": "Umacr;",
1086 "363": "umacr;",
1087 "364": "Ubreve;",
1088 "365": "ubreve;",
1089 "366": "Uring;",
1090 "367": "uring;",
1091 "368": "Udblac;",
1092 "369": "udblac;",
1093 "370": "Uogon;",
1094 "371": "uogon;",
1095 "372": "Wcirc;",
1096 "373": "wcirc;",
1097 "374": "Ycirc;",
1098 "375": "ycirc;",
1099 "376": "Yuml;",
1100 "377": "Zacute;",
1101 "378": "zacute;",
1102 "379": "Zdot;",
1103 "380": "zdot;",
1104 "381": "Zcaron;",
1105 "382": "zcaron;",
1106 "402": "fnof;",
1107 "437": "imped;",
1108 "501": "gacute;",
1109 "567": "jmath;",
1110 "710": "circ;",
1111 "711": "Hacek;",
1112 "728": "breve;",
1113 "729": "dot;",
1114 "730": "ring;",
1115 "731": "ogon;",
1116 "732": "tilde;",
1117 "733": "DiacriticalDoubleAcute;",
1118 "785": "DownBreve;",
1119 "913": "Alpha;",
1120 "914": "Beta;",
1121 "915": "Gamma;",
1122 "916": "Delta;",
1123 "917": "Epsilon;",
1124 "918": "Zeta;",
1125 "919": "Eta;",
1126 "920": "Theta;",
1127 "921": "Iota;",
1128 "922": "Kappa;",
1129 "923": "Lambda;",
1130 "924": "Mu;",
1131 "925": "Nu;",
1132 "926": "Xi;",
1133 "927": "Omicron;",
1134 "928": "Pi;",
1135 "929": "Rho;",
1136 "931": "Sigma;",
1137 "932": "Tau;",
1138 "933": "Upsilon;",
1139 "934": "Phi;",
1140 "935": "Chi;",
1141 "936": "Psi;",
1142 "937": "Omega;",
1143 "945": "alpha;",
1144 "946": "beta;",
1145 "947": "gamma;",
1146 "948": "delta;",
1147 "949": "epsilon;",
1148 "950": "zeta;",
1149 "951": "eta;",
1150 "952": "theta;",
1151 "953": "iota;",
1152 "954": "kappa;",
1153 "955": "lambda;",
1154 "956": "mu;",
1155 "957": "nu;",
1156 "958": "xi;",
1157 "959": "omicron;",
1158 "960": "pi;",
1159 "961": "rho;",
1160 "962": "varsigma;",
1161 "963": "sigma;",
1162 "964": "tau;",
1163 "965": "upsilon;",
1164 "966": "phi;",
1165 "967": "chi;",
1166 "968": "psi;",
1167 "969": "omega;",
1168 "977": "vartheta;",
1169 "978": "upsih;",
1170 "981": "varphi;",
1171 "982": "varpi;",
1172 "988": "Gammad;",
1173 "989": "gammad;",
1174 "1008": "varkappa;",
1175 "1009": "varrho;",
1176 "1013": "varepsilon;",
1177 "1014": "bepsi;",
1178 "1025": "IOcy;",
1179 "1026": "DJcy;",
1180 "1027": "GJcy;",
1181 "1028": "Jukcy;",
1182 "1029": "DScy;",
1183 "1030": "Iukcy;",
1184 "1031": "YIcy;",
1185 "1032": "Jsercy;",
1186 "1033": "LJcy;",
1187 "1034": "NJcy;",
1188 "1035": "TSHcy;",
1189 "1036": "KJcy;",
1190 "1038": "Ubrcy;",
1191 "1039": "DZcy;",
1192 "1040": "Acy;",
1193 "1041": "Bcy;",
1194 "1042": "Vcy;",
1195 "1043": "Gcy;",
1196 "1044": "Dcy;",
1197 "1045": "IEcy;",
1198 "1046": "ZHcy;",
1199 "1047": "Zcy;",
1200 "1048": "Icy;",
1201 "1049": "Jcy;",
1202 "1050": "Kcy;",
1203 "1051": "Lcy;",
1204 "1052": "Mcy;",
1205 "1053": "Ncy;",
1206 "1054": "Ocy;",
1207 "1055": "Pcy;",
1208 "1056": "Rcy;",
1209 "1057": "Scy;",
1210 "1058": "Tcy;",
1211 "1059": "Ucy;",
1212 "1060": "Fcy;",
1213 "1061": "KHcy;",
1214 "1062": "TScy;",
1215 "1063": "CHcy;",
1216 "1064": "SHcy;",
1217 "1065": "SHCHcy;",
1218 "1066": "HARDcy;",
1219 "1067": "Ycy;",
1220 "1068": "SOFTcy;",
1221 "1069": "Ecy;",
1222 "1070": "YUcy;",
1223 "1071": "YAcy;",
1224 "1072": "acy;",
1225 "1073": "bcy;",
1226 "1074": "vcy;",
1227 "1075": "gcy;",
1228 "1076": "dcy;",
1229 "1077": "iecy;",
1230 "1078": "zhcy;",
1231 "1079": "zcy;",
1232 "1080": "icy;",
1233 "1081": "jcy;",
1234 "1082": "kcy;",
1235 "1083": "lcy;",
1236 "1084": "mcy;",
1237 "1085": "ncy;",
1238 "1086": "ocy;",
1239 "1087": "pcy;",
1240 "1088": "rcy;",
1241 "1089": "scy;",
1242 "1090": "tcy;",
1243 "1091": "ucy;",
1244 "1092": "fcy;",
1245 "1093": "khcy;",
1246 "1094": "tscy;",
1247 "1095": "chcy;",
1248 "1096": "shcy;",
1249 "1097": "shchcy;",
1250 "1098": "hardcy;",
1251 "1099": "ycy;",
1252 "1100": "softcy;",
1253 "1101": "ecy;",
1254 "1102": "yucy;",
1255 "1103": "yacy;",
1256 "1105": "iocy;",
1257 "1106": "djcy;",
1258 "1107": "gjcy;",
1259 "1108": "jukcy;",
1260 "1109": "dscy;",
1261 "1110": "iukcy;",
1262 "1111": "yicy;",
1263 "1112": "jsercy;",
1264 "1113": "ljcy;",
1265 "1114": "njcy;",
1266 "1115": "tshcy;",
1267 "1116": "kjcy;",
1268 "1118": "ubrcy;",
1269 "1119": "dzcy;",
1270 "8194": "ensp;",
1271 "8195": "emsp;",
1272 "8196": "emsp13;",
1273 "8197": "emsp14;",
1274 "8199": "numsp;",
1275 "8200": "puncsp;",
1276 "8201": "ThinSpace;",
1277 "8202": "VeryThinSpace;",
1278 "8203": "ZeroWidthSpace;",
1279 "8204": "zwnj;",
1280 "8205": "zwj;",
1281 "8206": "lrm;",
1282 "8207": "rlm;",
1283 "8208": "hyphen;",
1284 "8211": "ndash;",
1285 "8212": "mdash;",
1286 "8213": "horbar;",
1287 "8214": "Vert;",
1288 "8216": "OpenCurlyQuote;",
1289 "8217": "rsquor;",
1290 "8218": "sbquo;",
1291 "8220": "OpenCurlyDoubleQuote;",
1292 "8221": "rdquor;",
1293 "8222": "ldquor;",
1294 "8224": "dagger;",
1295 "8225": "ddagger;",
1296 "8226": "bullet;",
1297 "8229": "nldr;",
1298 "8230": "mldr;",
1299 "8240": "permil;",
1300 "8241": "pertenk;",
1301 "8242": "prime;",
1302 "8243": "Prime;",
1303 "8244": "tprime;",
1304 "8245": "bprime;",
1305 "8249": "lsaquo;",
1306 "8250": "rsaquo;",
1307 "8254": "OverBar;",
1308 "8257": "caret;",
1309 "8259": "hybull;",
1310 "8260": "frasl;",
1311 "8271": "bsemi;",
1312 "8279": "qprime;",
1313 "8287": "MediumSpace;",
1314 "8288": "NoBreak;",
1315 "8289": "ApplyFunction;",
1316 "8290": "it;",
1317 "8291": "InvisibleComma;",
1318 "8364": "euro;",
1319 "8411": "TripleDot;",
1320 "8412": "DotDot;",
1321 "8450": "Copf;",
1322 "8453": "incare;",
1323 "8458": "gscr;",
1324 "8459": "Hscr;",
1325 "8460": "Poincareplane;",
1326 "8461": "quaternions;",
1327 "8462": "planckh;",
1328 "8463": "plankv;",
1329 "8464": "Iscr;",
1330 "8465": "imagpart;",
1331 "8466": "Lscr;",
1332 "8467": "ell;",
1333 "8469": "Nopf;",
1334 "8470": "numero;",
1335 "8471": "copysr;",
1336 "8472": "wp;",
1337 "8473": "primes;",
1338 "8474": "rationals;",
1339 "8475": "Rscr;",
1340 "8476": "Rfr;",
1341 "8477": "Ropf;",
1342 "8478": "rx;",
1343 "8482": "trade;",
1344 "8484": "Zopf;",
1345 "8487": "mho;",
1346 "8488": "Zfr;",
1347 "8489": "iiota;",
1348 "8492": "Bscr;",
1349 "8493": "Cfr;",
1350 "8495": "escr;",
1351 "8496": "expectation;",
1352 "8497": "Fscr;",
1353 "8499": "phmmat;",
1354 "8500": "oscr;",
1355 "8501": "aleph;",
1356 "8502": "beth;",
1357 "8503": "gimel;",
1358 "8504": "daleth;",
1359 "8517": "DD;",
1360 "8518": "DifferentialD;",
1361 "8519": "exponentiale;",
1362 "8520": "ImaginaryI;",
1363 "8531": "frac13;",
1364 "8532": "frac23;",
1365 "8533": "frac15;",
1366 "8534": "frac25;",
1367 "8535": "frac35;",
1368 "8536": "frac45;",
1369 "8537": "frac16;",
1370 "8538": "frac56;",
1371 "8539": "frac18;",
1372 "8540": "frac38;",
1373 "8541": "frac58;",
1374 "8542": "frac78;",
1375 "8592": "slarr;",
1376 "8593": "uparrow;",
1377 "8594": "srarr;",
1378 "8595": "ShortDownArrow;",
1379 "8596": "leftrightarrow;",
1380 "8597": "varr;",
1381 "8598": "UpperLeftArrow;",
1382 "8599": "UpperRightArrow;",
1383 "8600": "searrow;",
1384 "8601": "swarrow;",
1385 "8602": "nleftarrow;",
1386 "8603": "nrightarrow;",
1387 "8605": "rightsquigarrow;",
1388 "8606": "twoheadleftarrow;",
1389 "8607": "Uarr;",
1390 "8608": "twoheadrightarrow;",
1391 "8609": "Darr;",
1392 "8610": "leftarrowtail;",
1393 "8611": "rightarrowtail;",
1394 "8612": "mapstoleft;",
1395 "8613": "UpTeeArrow;",
1396 "8614": "RightTeeArrow;",
1397 "8615": "mapstodown;",
1398 "8617": "larrhk;",
1399 "8618": "rarrhk;",
1400 "8619": "looparrowleft;",
1401 "8620": "rarrlp;",
1402 "8621": "leftrightsquigarrow;",
1403 "8622": "nleftrightarrow;",
1404 "8624": "lsh;",
1405 "8625": "rsh;",
1406 "8626": "ldsh;",
1407 "8627": "rdsh;",
1408 "8629": "crarr;",
1409 "8630": "curvearrowleft;",
1410 "8631": "curvearrowright;",
1411 "8634": "olarr;",
1412 "8635": "orarr;",
1413 "8636": "lharu;",
1414 "8637": "lhard;",
1415 "8638": "upharpoonright;",
1416 "8639": "upharpoonleft;",
1417 "8640": "RightVector;",
1418 "8641": "rightharpoondown;",
1419 "8642": "RightDownVector;",
1420 "8643": "LeftDownVector;",
1421 "8644": "rlarr;",
1422 "8645": "UpArrowDownArrow;",
1423 "8646": "lrarr;",
1424 "8647": "llarr;",
1425 "8648": "uuarr;",
1426 "8649": "rrarr;",
1427 "8650": "downdownarrows;",
1428 "8651": "ReverseEquilibrium;",
1429 "8652": "rlhar;",
1430 "8653": "nLeftarrow;",
1431 "8654": "nLeftrightarrow;",
1432 "8655": "nRightarrow;",
1433 "8656": "Leftarrow;",
1434 "8657": "Uparrow;",
1435 "8658": "Rightarrow;",
1436 "8659": "Downarrow;",
1437 "8660": "Leftrightarrow;",
1438 "8661": "vArr;",
1439 "8662": "nwArr;",
1440 "8663": "neArr;",
1441 "8664": "seArr;",
1442 "8665": "swArr;",
1443 "8666": "Lleftarrow;",
1444 "8667": "Rrightarrow;",
1445 "8669": "zigrarr;",
1446 "8676": "LeftArrowBar;",
1447 "8677": "RightArrowBar;",
1448 "8693": "duarr;",
1449 "8701": "loarr;",
1450 "8702": "roarr;",
1451 "8703": "hoarr;",
1452 "8704": "forall;",
1453 "8705": "complement;",
1454 "8706": "PartialD;",
1455 "8707": "Exists;",
1456 "8708": "NotExists;",
1457 "8709": "varnothing;",
1458 "8711": "nabla;",
1459 "8712": "isinv;",
1460 "8713": "notinva;",
1461 "8715": "SuchThat;",
1462 "8716": "NotReverseElement;",
1463 "8719": "Product;",
1464 "8720": "Coproduct;",
1465 "8721": "sum;",
1466 "8722": "minus;",
1467 "8723": "mp;",
1468 "8724": "plusdo;",
1469 "8726": "ssetmn;",
1470 "8727": "lowast;",
1471 "8728": "SmallCircle;",
1472 "8730": "Sqrt;",
1473 "8733": "vprop;",
1474 "8734": "infin;",
1475 "8735": "angrt;",
1476 "8736": "angle;",
1477 "8737": "measuredangle;",
1478 "8738": "angsph;",
1479 "8739": "VerticalBar;",
1480 "8740": "nsmid;",
1481 "8741": "spar;",
1482 "8742": "nspar;",
1483 "8743": "wedge;",
1484 "8744": "vee;",
1485 "8745": "cap;",
1486 "8746": "cup;",
1487 "8747": "Integral;",
1488 "8748": "Int;",
1489 "8749": "tint;",
1490 "8750": "oint;",
1491 "8751": "DoubleContourIntegral;",
1492 "8752": "Cconint;",
1493 "8753": "cwint;",
1494 "8754": "cwconint;",
1495 "8755": "CounterClockwiseContourIntegral;",
1496 "8756": "therefore;",
1497 "8757": "because;",
1498 "8758": "ratio;",
1499 "8759": "Proportion;",
1500 "8760": "minusd;",
1501 "8762": "mDDot;",
1502 "8763": "homtht;",
1503 "8764": "Tilde;",
1504 "8765": "bsim;",
1505 "8766": "mstpos;",
1506 "8767": "acd;",
1507 "8768": "wreath;",
1508 "8769": "nsim;",
1509 "8770": "esim;",
1510 "8771": "TildeEqual;",
1511 "8772": "nsimeq;",
1512 "8773": "TildeFullEqual;",
1513 "8774": "simne;",
1514 "8775": "NotTildeFullEqual;",
1515 "8776": "TildeTilde;",
1516 "8777": "NotTildeTilde;",
1517 "8778": "approxeq;",
1518 "8779": "apid;",
1519 "8780": "bcong;",
1520 "8781": "CupCap;",
1521 "8782": "HumpDownHump;",
1522 "8783": "HumpEqual;",
1523 "8784": "esdot;",
1524 "8785": "eDot;",
1525 "8786": "fallingdotseq;",
1526 "8787": "risingdotseq;",
1527 "8788": "coloneq;",
1528 "8789": "eqcolon;",
1529 "8790": "eqcirc;",
1530 "8791": "cire;",
1531 "8793": "wedgeq;",
1532 "8794": "veeeq;",
1533 "8796": "trie;",
1534 "8799": "questeq;",
1535 "8800": "NotEqual;",
1536 "8801": "equiv;",
1537 "8802": "NotCongruent;",
1538 "8804": "leq;",
1539 "8805": "GreaterEqual;",
1540 "8806": "LessFullEqual;",
1541 "8807": "GreaterFullEqual;",
1542 "8808": "lneqq;",
1543 "8809": "gneqq;",
1544 "8810": "NestedLessLess;",
1545 "8811": "NestedGreaterGreater;",
1546 "8812": "twixt;",
1547 "8813": "NotCupCap;",
1548 "8814": "NotLess;",
1549 "8815": "NotGreater;",
1550 "8816": "NotLessEqual;",
1551 "8817": "NotGreaterEqual;",
1552 "8818": "lsim;",
1553 "8819": "gtrsim;",
1554 "8820": "NotLessTilde;",
1555 "8821": "NotGreaterTilde;",
1556 "8822": "lg;",
1557 "8823": "gtrless;",
1558 "8824": "ntlg;",
1559 "8825": "ntgl;",
1560 "8826": "Precedes;",
1561 "8827": "Succeeds;",
1562 "8828": "PrecedesSlantEqual;",
1563 "8829": "SucceedsSlantEqual;",
1564 "8830": "prsim;",
1565 "8831": "succsim;",
1566 "8832": "nprec;",
1567 "8833": "nsucc;",
1568 "8834": "subset;",
1569 "8835": "supset;",
1570 "8836": "nsub;",
1571 "8837": "nsup;",
1572 "8838": "SubsetEqual;",
1573 "8839": "supseteq;",
1574 "8840": "nsubseteq;",
1575 "8841": "nsupseteq;",
1576 "8842": "subsetneq;",
1577 "8843": "supsetneq;",
1578 "8845": "cupdot;",
1579 "8846": "uplus;",
1580 "8847": "SquareSubset;",
1581 "8848": "SquareSuperset;",
1582 "8849": "SquareSubsetEqual;",
1583 "8850": "SquareSupersetEqual;",
1584 "8851": "SquareIntersection;",
1585 "8852": "SquareUnion;",
1586 "8853": "oplus;",
1587 "8854": "ominus;",
1588 "8855": "otimes;",
1589 "8856": "osol;",
1590 "8857": "odot;",
1591 "8858": "ocir;",
1592 "8859": "oast;",
1593 "8861": "odash;",
1594 "8862": "plusb;",
1595 "8863": "minusb;",
1596 "8864": "timesb;",
1597 "8865": "sdotb;",
1598 "8866": "vdash;",
1599 "8867": "LeftTee;",
1600 "8868": "top;",
1601 "8869": "UpTee;",
1602 "8871": "models;",
1603 "8872": "vDash;",
1604 "8873": "Vdash;",
1605 "8874": "Vvdash;",
1606 "8875": "VDash;",
1607 "8876": "nvdash;",
1608 "8877": "nvDash;",
1609 "8878": "nVdash;",
1610 "8879": "nVDash;",
1611 "8880": "prurel;",
1612 "8882": "vltri;",
1613 "8883": "vrtri;",
1614 "8884": "trianglelefteq;",
1615 "8885": "trianglerighteq;",
1616 "8886": "origof;",
1617 "8887": "imof;",
1618 "8888": "mumap;",
1619 "8889": "hercon;",
1620 "8890": "intercal;",
1621 "8891": "veebar;",
1622 "8893": "barvee;",
1623 "8894": "angrtvb;",
1624 "8895": "lrtri;",
1625 "8896": "xwedge;",
1626 "8897": "xvee;",
1627 "8898": "xcap;",
1628 "8899": "xcup;",
1629 "8900": "diamond;",
1630 "8901": "sdot;",
1631 "8902": "Star;",
1632 "8903": "divonx;",
1633 "8904": "bowtie;",
1634 "8905": "ltimes;",
1635 "8906": "rtimes;",
1636 "8907": "lthree;",
1637 "8908": "rthree;",
1638 "8909": "bsime;",
1639 "8910": "cuvee;",
1640 "8911": "cuwed;",
1641 "8912": "Subset;",
1642 "8913": "Supset;",
1643 "8914": "Cap;",
1644 "8915": "Cup;",
1645 "8916": "pitchfork;",
1646 "8917": "epar;",
1647 "8918": "ltdot;",
1648 "8919": "gtrdot;",
1649 "8920": "Ll;",
1650 "8921": "ggg;",
1651 "8922": "LessEqualGreater;",
1652 "8923": "gtreqless;",
1653 "8926": "curlyeqprec;",
1654 "8927": "curlyeqsucc;",
1655 "8928": "nprcue;",
1656 "8929": "nsccue;",
1657 "8930": "nsqsube;",
1658 "8931": "nsqsupe;",
1659 "8934": "lnsim;",
1660 "8935": "gnsim;",
1661 "8936": "prnsim;",
1662 "8937": "succnsim;",
1663 "8938": "ntriangleleft;",
1664 "8939": "ntriangleright;",
1665 "8940": "ntrianglelefteq;",
1666 "8941": "ntrianglerighteq;",
1667 "8942": "vellip;",
1668 "8943": "ctdot;",
1669 "8944": "utdot;",
1670 "8945": "dtdot;",
1671 "8946": "disin;",
1672 "8947": "isinsv;",
1673 "8948": "isins;",
1674 "8949": "isindot;",
1675 "8950": "notinvc;",
1676 "8951": "notinvb;",
1677 "8953": "isinE;",
1678 "8954": "nisd;",
1679 "8955": "xnis;",
1680 "8956": "nis;",
1681 "8957": "notnivc;",
1682 "8958": "notnivb;",
1683 "8965": "barwedge;",
1684 "8966": "doublebarwedge;",
1685 "8968": "LeftCeiling;",
1686 "8969": "RightCeiling;",
1687 "8970": "lfloor;",
1688 "8971": "RightFloor;",
1689 "8972": "drcrop;",
1690 "8973": "dlcrop;",
1691 "8974": "urcrop;",
1692 "8975": "ulcrop;",
1693 "8976": "bnot;",
1694 "8978": "profline;",
1695 "8979": "profsurf;",
1696 "8981": "telrec;",
1697 "8982": "target;",
1698 "8988": "ulcorner;",
1699 "8989": "urcorner;",
1700 "8990": "llcorner;",
1701 "8991": "lrcorner;",
1702 "8994": "sfrown;",
1703 "8995": "ssmile;",
1704 "9005": "cylcty;",
1705 "9006": "profalar;",
1706 "9014": "topbot;",
1707 "9021": "ovbar;",
1708 "9023": "solbar;",
1709 "9084": "angzarr;",
1710 "9136": "lmoustache;",
1711 "9137": "rmoustache;",
1712 "9140": "tbrk;",
1713 "9141": "UnderBracket;",
1714 "9142": "bbrktbrk;",
1715 "9180": "OverParenthesis;",
1716 "9181": "UnderParenthesis;",
1717 "9182": "OverBrace;",
1718 "9183": "UnderBrace;",
1719 "9186": "trpezium;",
1720 "9191": "elinters;",
1721 "9251": "blank;",
1722 "9416": "oS;",
1723 "9472": "HorizontalLine;",
1724 "9474": "boxv;",
1725 "9484": "boxdr;",
1726 "9488": "boxdl;",
1727 "9492": "boxur;",
1728 "9496": "boxul;",
1729 "9500": "boxvr;",
1730 "9508": "boxvl;",
1731 "9516": "boxhd;",
1732 "9524": "boxhu;",
1733 "9532": "boxvh;",
1734 "9552": "boxH;",
1735 "9553": "boxV;",
1736 "9554": "boxdR;",
1737 "9555": "boxDr;",
1738 "9556": "boxDR;",
1739 "9557": "boxdL;",
1740 "9558": "boxDl;",
1741 "9559": "boxDL;",
1742 "9560": "boxuR;",
1743 "9561": "boxUr;",
1744 "9562": "boxUR;",
1745 "9563": "boxuL;",
1746 "9564": "boxUl;",
1747 "9565": "boxUL;",
1748 "9566": "boxvR;",
1749 "9567": "boxVr;",
1750 "9568": "boxVR;",
1751 "9569": "boxvL;",
1752 "9570": "boxVl;",
1753 "9571": "boxVL;",
1754 "9572": "boxHd;",
1755 "9573": "boxhD;",
1756 "9574": "boxHD;",
1757 "9575": "boxHu;",
1758 "9576": "boxhU;",
1759 "9577": "boxHU;",
1760 "9578": "boxvH;",
1761 "9579": "boxVh;",
1762 "9580": "boxVH;",
1763 "9600": "uhblk;",
1764 "9604": "lhblk;",
1765 "9608": "block;",
1766 "9617": "blk14;",
1767 "9618": "blk12;",
1768 "9619": "blk34;",
1769 "9633": "square;",
1770 "9642": "squf;",
1771 "9643": "EmptyVerySmallSquare;",
1772 "9645": "rect;",
1773 "9646": "marker;",
1774 "9649": "fltns;",
1775 "9651": "xutri;",
1776 "9652": "utrif;",
1777 "9653": "utri;",
1778 "9656": "rtrif;",
1779 "9657": "triangleright;",
1780 "9661": "xdtri;",
1781 "9662": "dtrif;",
1782 "9663": "triangledown;",
1783 "9666": "ltrif;",
1784 "9667": "triangleleft;",
1785 "9674": "lozenge;",
1786 "9675": "cir;",
1787 "9708": "tridot;",
1788 "9711": "xcirc;",
1789 "9720": "ultri;",
1790 "9721": "urtri;",
1791 "9722": "lltri;",
1792 "9723": "EmptySmallSquare;",
1793 "9724": "FilledSmallSquare;",
1794 "9733": "starf;",
1795 "9734": "star;",
1796 "9742": "phone;",
1797 "9792": "female;",
1798 "9794": "male;",
1799 "9824": "spadesuit;",
1800 "9827": "clubsuit;",
1801 "9829": "heartsuit;",
1802 "9830": "diams;",
1803 "9834": "sung;",
1804 "9837": "flat;",
1805 "9838": "natural;",
1806 "9839": "sharp;",
1807 "10003": "checkmark;",
1808 "10007": "cross;",
1809 "10016": "maltese;",
1810 "10038": "sext;",
1811 "10072": "VerticalSeparator;",
1812 "10098": "lbbrk;",
1813 "10099": "rbbrk;",
1814 "10184": "bsolhsub;",
1815 "10185": "suphsol;",
1816 "10214": "lobrk;",
1817 "10215": "robrk;",
1818 "10216": "LeftAngleBracket;",
1819 "10217": "RightAngleBracket;",
1820 "10218": "Lang;",
1821 "10219": "Rang;",
1822 "10220": "loang;",
1823 "10221": "roang;",
1824 "10229": "xlarr;",
1825 "10230": "xrarr;",
1826 "10231": "xharr;",
1827 "10232": "xlArr;",
1828 "10233": "xrArr;",
1829 "10234": "xhArr;",
1830 "10236": "xmap;",
1831 "10239": "dzigrarr;",
1832 "10498": "nvlArr;",
1833 "10499": "nvrArr;",
1834 "10500": "nvHarr;",
1835 "10501": "Map;",
1836 "10508": "lbarr;",
1837 "10509": "rbarr;",
1838 "10510": "lBarr;",
1839 "10511": "rBarr;",
1840 "10512": "RBarr;",
1841 "10513": "DDotrahd;",
1842 "10514": "UpArrowBar;",
1843 "10515": "DownArrowBar;",
1844 "10518": "Rarrtl;",
1845 "10521": "latail;",
1846 "10522": "ratail;",
1847 "10523": "lAtail;",
1848 "10524": "rAtail;",
1849 "10525": "larrfs;",
1850 "10526": "rarrfs;",
1851 "10527": "larrbfs;",
1852 "10528": "rarrbfs;",
1853 "10531": "nwarhk;",
1854 "10532": "nearhk;",
1855 "10533": "searhk;",
1856 "10534": "swarhk;",
1857 "10535": "nwnear;",
1858 "10536": "toea;",
1859 "10537": "tosa;",
1860 "10538": "swnwar;",
1861 "10547": "rarrc;",
1862 "10549": "cudarrr;",
1863 "10550": "ldca;",
1864 "10551": "rdca;",
1865 "10552": "cudarrl;",
1866 "10553": "larrpl;",
1867 "10556": "curarrm;",
1868 "10557": "cularrp;",
1869 "10565": "rarrpl;",
1870 "10568": "harrcir;",
1871 "10569": "Uarrocir;",
1872 "10570": "lurdshar;",
1873 "10571": "ldrushar;",
1874 "10574": "LeftRightVector;",
1875 "10575": "RightUpDownVector;",
1876 "10576": "DownLeftRightVector;",
1877 "10577": "LeftUpDownVector;",
1878 "10578": "LeftVectorBar;",
1879 "10579": "RightVectorBar;",
1880 "10580": "RightUpVectorBar;",
1881 "10581": "RightDownVectorBar;",
1882 "10582": "DownLeftVectorBar;",
1883 "10583": "DownRightVectorBar;",
1884 "10584": "LeftUpVectorBar;",
1885 "10585": "LeftDownVectorBar;",
1886 "10586": "LeftTeeVector;",
1887 "10587": "RightTeeVector;",
1888 "10588": "RightUpTeeVector;",
1889 "10589": "RightDownTeeVector;",
1890 "10590": "DownLeftTeeVector;",
1891 "10591": "DownRightTeeVector;",
1892 "10592": "LeftUpTeeVector;",
1893 "10593": "LeftDownTeeVector;",
1894 "10594": "lHar;",
1895 "10595": "uHar;",
1896 "10596": "rHar;",
1897 "10597": "dHar;",
1898 "10598": "luruhar;",
1899 "10599": "ldrdhar;",
1900 "10600": "ruluhar;",
1901 "10601": "rdldhar;",
1902 "10602": "lharul;",
1903 "10603": "llhard;",
1904 "10604": "rharul;",
1905 "10605": "lrhard;",
1906 "10606": "UpEquilibrium;",
1907 "10607": "ReverseUpEquilibrium;",
1908 "10608": "RoundImplies;",
1909 "10609": "erarr;",
1910 "10610": "simrarr;",
1911 "10611": "larrsim;",
1912 "10612": "rarrsim;",
1913 "10613": "rarrap;",
1914 "10614": "ltlarr;",
1915 "10616": "gtrarr;",
1916 "10617": "subrarr;",
1917 "10619": "suplarr;",
1918 "10620": "lfisht;",
1919 "10621": "rfisht;",
1920 "10622": "ufisht;",
1921 "10623": "dfisht;",
1922 "10629": "lopar;",
1923 "10630": "ropar;",
1924 "10635": "lbrke;",
1925 "10636": "rbrke;",
1926 "10637": "lbrkslu;",
1927 "10638": "rbrksld;",
1928 "10639": "lbrksld;",
1929 "10640": "rbrkslu;",
1930 "10641": "langd;",
1931 "10642": "rangd;",
1932 "10643": "lparlt;",
1933 "10644": "rpargt;",
1934 "10645": "gtlPar;",
1935 "10646": "ltrPar;",
1936 "10650": "vzigzag;",
1937 "10652": "vangrt;",
1938 "10653": "angrtvbd;",
1939 "10660": "ange;",
1940 "10661": "range;",
1941 "10662": "dwangle;",
1942 "10663": "uwangle;",
1943 "10664": "angmsdaa;",
1944 "10665": "angmsdab;",
1945 "10666": "angmsdac;",
1946 "10667": "angmsdad;",
1947 "10668": "angmsdae;",
1948 "10669": "angmsdaf;",
1949 "10670": "angmsdag;",
1950 "10671": "angmsdah;",
1951 "10672": "bemptyv;",
1952 "10673": "demptyv;",
1953 "10674": "cemptyv;",
1954 "10675": "raemptyv;",
1955 "10676": "laemptyv;",
1956 "10677": "ohbar;",
1957 "10678": "omid;",
1958 "10679": "opar;",
1959 "10681": "operp;",
1960 "10683": "olcross;",
1961 "10684": "odsold;",
1962 "10686": "olcir;",
1963 "10687": "ofcir;",
1964 "10688": "olt;",
1965 "10689": "ogt;",
1966 "10690": "cirscir;",
1967 "10691": "cirE;",
1968 "10692": "solb;",
1969 "10693": "bsolb;",
1970 "10697": "boxbox;",
1971 "10701": "trisb;",
1972 "10702": "rtriltri;",
1973 "10703": "LeftTriangleBar;",
1974 "10704": "RightTriangleBar;",
1975 "10716": "iinfin;",
1976 "10717": "infintie;",
1977 "10718": "nvinfin;",
1978 "10723": "eparsl;",
1979 "10724": "smeparsl;",
1980 "10725": "eqvparsl;",
1981 "10731": "lozf;",
1982 "10740": "RuleDelayed;",
1983 "10742": "dsol;",
1984 "10752": "xodot;",
1985 "10753": "xoplus;",
1986 "10754": "xotime;",
1987 "10756": "xuplus;",
1988 "10758": "xsqcup;",
1989 "10764": "qint;",
1990 "10765": "fpartint;",
1991 "10768": "cirfnint;",
1992 "10769": "awint;",
1993 "10770": "rppolint;",
1994 "10771": "scpolint;",
1995 "10772": "npolint;",
1996 "10773": "pointint;",
1997 "10774": "quatint;",
1998 "10775": "intlarhk;",
1999 "10786": "pluscir;",
2000 "10787": "plusacir;",
2001 "10788": "simplus;",
2002 "10789": "plusdu;",
2003 "10790": "plussim;",
2004 "10791": "plustwo;",
2005 "10793": "mcomma;",
2006 "10794": "minusdu;",
2007 "10797": "loplus;",
2008 "10798": "roplus;",
2009 "10799": "Cross;",
2010 "10800": "timesd;",
2011 "10801": "timesbar;",
2012 "10803": "smashp;",
2013 "10804": "lotimes;",
2014 "10805": "rotimes;",
2015 "10806": "otimesas;",
2016 "10807": "Otimes;",
2017 "10808": "odiv;",
2018 "10809": "triplus;",
2019 "10810": "triminus;",
2020 "10811": "tritime;",
2021 "10812": "iprod;",
2022 "10815": "amalg;",
2023 "10816": "capdot;",
2024 "10818": "ncup;",
2025 "10819": "ncap;",
2026 "10820": "capand;",
2027 "10821": "cupor;",
2028 "10822": "cupcap;",
2029 "10823": "capcup;",
2030 "10824": "cupbrcap;",
2031 "10825": "capbrcup;",
2032 "10826": "cupcup;",
2033 "10827": "capcap;",
2034 "10828": "ccups;",
2035 "10829": "ccaps;",
2036 "10832": "ccupssm;",
2037 "10835": "And;",
2038 "10836": "Or;",
2039 "10837": "andand;",
2040 "10838": "oror;",
2041 "10839": "orslope;",
2042 "10840": "andslope;",
2043 "10842": "andv;",
2044 "10843": "orv;",
2045 "10844": "andd;",
2046 "10845": "ord;",
2047 "10847": "wedbar;",
2048 "10854": "sdote;",
2049 "10858": "simdot;",
2050 "10861": "congdot;",
2051 "10862": "easter;",
2052 "10863": "apacir;",
2053 "10864": "apE;",
2054 "10865": "eplus;",
2055 "10866": "pluse;",
2056 "10867": "Esim;",
2057 "10868": "Colone;",
2058 "10869": "Equal;",
2059 "10871": "eDDot;",
2060 "10872": "equivDD;",
2061 "10873": "ltcir;",
2062 "10874": "gtcir;",
2063 "10875": "ltquest;",
2064 "10876": "gtquest;",
2065 "10877": "LessSlantEqual;",
2066 "10878": "GreaterSlantEqual;",
2067 "10879": "lesdot;",
2068 "10880": "gesdot;",
2069 "10881": "lesdoto;",
2070 "10882": "gesdoto;",
2071 "10883": "lesdotor;",
2072 "10884": "gesdotol;",
2073 "10885": "lessapprox;",
2074 "10886": "gtrapprox;",
2075 "10887": "lneq;",
2076 "10888": "gneq;",
2077 "10889": "lnapprox;",
2078 "10890": "gnapprox;",
2079 "10891": "lesseqqgtr;",
2080 "10892": "gtreqqless;",
2081 "10893": "lsime;",
2082 "10894": "gsime;",
2083 "10895": "lsimg;",
2084 "10896": "gsiml;",
2085 "10897": "lgE;",
2086 "10898": "glE;",
2087 "10899": "lesges;",
2088 "10900": "gesles;",
2089 "10901": "eqslantless;",
2090 "10902": "eqslantgtr;",
2091 "10903": "elsdot;",
2092 "10904": "egsdot;",
2093 "10905": "el;",
2094 "10906": "eg;",
2095 "10909": "siml;",
2096 "10910": "simg;",
2097 "10911": "simlE;",
2098 "10912": "simgE;",
2099 "10913": "LessLess;",
2100 "10914": "GreaterGreater;",
2101 "10916": "glj;",
2102 "10917": "gla;",
2103 "10918": "ltcc;",
2104 "10919": "gtcc;",
2105 "10920": "lescc;",
2106 "10921": "gescc;",
2107 "10922": "smt;",
2108 "10923": "lat;",
2109 "10924": "smte;",
2110 "10925": "late;",
2111 "10926": "bumpE;",
2112 "10927": "preceq;",
2113 "10928": "succeq;",
2114 "10931": "prE;",
2115 "10932": "scE;",
2116 "10933": "prnE;",
2117 "10934": "succneqq;",
2118 "10935": "precapprox;",
2119 "10936": "succapprox;",
2120 "10937": "prnap;",
2121 "10938": "succnapprox;",
2122 "10939": "Pr;",
2123 "10940": "Sc;",
2124 "10941": "subdot;",
2125 "10942": "supdot;",
2126 "10943": "subplus;",
2127 "10944": "supplus;",
2128 "10945": "submult;",
2129 "10946": "supmult;",
2130 "10947": "subedot;",
2131 "10948": "supedot;",
2132 "10949": "subseteqq;",
2133 "10950": "supseteqq;",
2134 "10951": "subsim;",
2135 "10952": "supsim;",
2136 "10955": "subsetneqq;",
2137 "10956": "supsetneqq;",
2138 "10959": "csub;",
2139 "10960": "csup;",
2140 "10961": "csube;",
2141 "10962": "csupe;",
2142 "10963": "subsup;",
2143 "10964": "supsub;",
2144 "10965": "subsub;",
2145 "10966": "supsup;",
2146 "10967": "suphsub;",
2147 "10968": "supdsub;",
2148 "10969": "forkv;",
2149 "10970": "topfork;",
2150 "10971": "mlcp;",
2151 "10980": "DoubleLeftTee;",
2152 "10982": "Vdashl;",
2153 "10983": "Barv;",
2154 "10984": "vBar;",
2155 "10985": "vBarv;",
2156 "10987": "Vbar;",
2157 "10988": "Not;",
2158 "10989": "bNot;",
2159 "10990": "rnmid;",
2160 "10991": "cirmid;",
2161 "10992": "midcir;",
2162 "10993": "topcir;",
2163 "10994": "nhpar;",
2164 "10995": "parsim;",
2165 "11005": "parsl;",
2166 "64256": "fflig;",
2167 "64257": "filig;",
2168 "64258": "fllig;",
2169 "64259": "ffilig;",
2170 "64260": "ffllig;"
2171}
2172},{}],11:[function(require,module,exports){
2173'use strict';
2174
2175var hasOwn = Object.prototype.hasOwnProperty;
2176var toStr = Object.prototype.toString;
2177var defineProperty = Object.defineProperty;
2178var gOPD = Object.getOwnPropertyDescriptor;
2179
2180var isArray = function isArray(arr) {
2181 if (typeof Array.isArray === 'function') {
2182 return Array.isArray(arr);
2183 }
2184
2185 return toStr.call(arr) === '[object Array]';
2186};
2187
2188var isPlainObject = function isPlainObject(obj) {
2189 if (!obj || toStr.call(obj) !== '[object Object]') {
2190 return false;
2191 }
2192
2193 var hasOwnConstructor = hasOwn.call(obj, 'constructor');
2194 var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');
2195 // Not own constructor property must be Object
2196 if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
2197 return false;
2198 }
2199
2200 // Own properties are enumerated firstly, so to speed up,
2201 // if last one is own, then all properties are own.
2202 var key;
2203 for (key in obj) { /**/ }
2204
2205 return typeof key === 'undefined' || hasOwn.call(obj, key);
2206};
2207
2208// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target
2209var setProperty = function setProperty(target, options) {
2210 if (defineProperty && options.name === '__proto__') {
2211 defineProperty(target, options.name, {
2212 enumerable: true,
2213 configurable: true,
2214 value: options.newValue,
2215 writable: true
2216 });
2217 } else {
2218 target[options.name] = options.newValue;
2219 }
2220};
2221
2222// Return undefined instead of __proto__ if '__proto__' is not an own property
2223var getProperty = function getProperty(obj, name) {
2224 if (name === '__proto__') {
2225 if (!hasOwn.call(obj, name)) {
2226 return void 0;
2227 } else if (gOPD) {
2228 // In early versions of node, obj['__proto__'] is buggy when obj has
2229 // __proto__ as an own property. Object.getOwnPropertyDescriptor() works.
2230 return gOPD(obj, name).value;
2231 }
2232 }
2233
2234 return obj[name];
2235};
2236
2237module.exports = function extend() {
2238 var options, name, src, copy, copyIsArray, clone;
2239 var target = arguments[0];
2240 var i = 1;
2241 var length = arguments.length;
2242 var deep = false;
2243
2244 // Handle a deep copy situation
2245 if (typeof target === 'boolean') {
2246 deep = target;
2247 target = arguments[1] || {};
2248 // skip the boolean and the target
2249 i = 2;
2250 }
2251 if (target == null || (typeof target !== 'object' && typeof target !== 'function')) {
2252 target = {};
2253 }
2254
2255 for (; i < length; ++i) {
2256 options = arguments[i];
2257 // Only deal with non-null/undefined values
2258 if (options != null) {
2259 // Extend the base object
2260 for (name in options) {
2261 src = getProperty(target, name);
2262 copy = getProperty(options, name);
2263
2264 // Prevent never-ending loop
2265 if (target !== copy) {
2266 // Recurse if we're merging plain objects or arrays
2267 if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {
2268 if (copyIsArray) {
2269 copyIsArray = false;
2270 clone = src && isArray(src) ? src : [];
2271 } else {
2272 clone = src && isPlainObject(src) ? src : {};
2273 }
2274
2275 // Never move original objects, clone them
2276 setProperty(target, { name: name, newValue: extend(deep, clone, copy) });
2277
2278 // Don't bring in undefined values
2279 } else if (typeof copy !== 'undefined') {
2280 setProperty(target, { name: name, newValue: copy });
2281 }
2282 }
2283 }
2284 }
2285 }
2286
2287 // Return the modified object
2288 return target;
2289};
2290
2291},{}],12:[function(require,module,exports){
2292(function (global){
2293/*! https://mths.be/punycode v1.4.1 by @mathias */
2294;(function(root) {
2295
2296 /** Detect free variables */
2297 var freeExports = typeof exports == 'object' && exports &&
2298 !exports.nodeType && exports;
2299 var freeModule = typeof module == 'object' && module &&
2300 !module.nodeType && module;
2301 var freeGlobal = typeof global == 'object' && global;
2302 if (
2303 freeGlobal.global === freeGlobal ||
2304 freeGlobal.window === freeGlobal ||
2305 freeGlobal.self === freeGlobal
2306 ) {
2307 root = freeGlobal;
2308 }
2309
2310 /**
2311 * The `punycode` object.
2312 * @name punycode
2313 * @type Object
2314 */
2315 var punycode,
2316
2317 /** Highest positive signed 32-bit float value */
2318 maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1
2319
2320 /** Bootstring parameters */
2321 base = 36,
2322 tMin = 1,
2323 tMax = 26,
2324 skew = 38,
2325 damp = 700,
2326 initialBias = 72,
2327 initialN = 128, // 0x80
2328 delimiter = '-', // '\x2D'
2329
2330 /** Regular expressions */
2331 regexPunycode = /^xn--/,
2332 regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars
2333 regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators
2334
2335 /** Error messages */
2336 errors = {
2337 'overflow': 'Overflow: input needs wider integers to process',
2338 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
2339 'invalid-input': 'Invalid input'
2340 },
2341
2342 /** Convenience shortcuts */
2343 baseMinusTMin = base - tMin,
2344 floor = Math.floor,
2345 stringFromCharCode = String.fromCharCode,
2346
2347 /** Temporary variable */
2348 key;
2349
2350 /*--------------------------------------------------------------------------*/
2351
2352 /**
2353 * A generic error utility function.
2354 * @private
2355 * @param {String} type The error type.
2356 * @returns {Error} Throws a `RangeError` with the applicable error message.
2357 */
2358 function error(type) {
2359 throw new RangeError(errors[type]);
2360 }
2361
2362 /**
2363 * A generic `Array#map` utility function.
2364 * @private
2365 * @param {Array} array The array to iterate over.
2366 * @param {Function} callback The function that gets called for every array
2367 * item.
2368 * @returns {Array} A new array of values returned by the callback function.
2369 */
2370 function map(array, fn) {
2371 var length = array.length;
2372 var result = [];
2373 while (length--) {
2374 result[length] = fn(array[length]);
2375 }
2376 return result;
2377 }
2378
2379 /**
2380 * A simple `Array#map`-like wrapper to work with domain name strings or email
2381 * addresses.
2382 * @private
2383 * @param {String} domain The domain name or email address.
2384 * @param {Function} callback The function that gets called for every
2385 * character.
2386 * @returns {Array} A new string of characters returned by the callback
2387 * function.
2388 */
2389 function mapDomain(string, fn) {
2390 var parts = string.split('@');
2391 var result = '';
2392 if (parts.length > 1) {
2393 // In email addresses, only the domain name should be punycoded. Leave
2394 // the local part (i.e. everything up to `@`) intact.
2395 result = parts[0] + '@';
2396 string = parts[1];
2397 }
2398 // Avoid `split(regex)` for IE8 compatibility. See #17.
2399 string = string.replace(regexSeparators, '\x2E');
2400 var labels = string.split('.');
2401 var encoded = map(labels, fn).join('.');
2402 return result + encoded;
2403 }
2404
2405 /**
2406 * Creates an array containing the numeric code points of each Unicode
2407 * character in the string. While JavaScript uses UCS-2 internally,
2408 * this function will convert a pair of surrogate halves (each of which
2409 * UCS-2 exposes as separate characters) into a single code point,
2410 * matching UTF-16.
2411 * @see `punycode.ucs2.encode`
2412 * @see <https://mathiasbynens.be/notes/javascript-encoding>
2413 * @memberOf punycode.ucs2
2414 * @name decode
2415 * @param {String} string The Unicode input string (UCS-2).
2416 * @returns {Array} The new array of code points.
2417 */
2418 function ucs2decode(string) {
2419 var output = [],
2420 counter = 0,
2421 length = string.length,
2422 value,
2423 extra;
2424 while (counter < length) {
2425 value = string.charCodeAt(counter++);
2426 if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
2427 // high surrogate, and there is a next character
2428 extra = string.charCodeAt(counter++);
2429 if ((extra & 0xFC00) == 0xDC00) { // low surrogate
2430 output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
2431 } else {
2432 // unmatched surrogate; only append this code unit, in case the next
2433 // code unit is the high surrogate of a surrogate pair
2434 output.push(value);
2435 counter--;
2436 }
2437 } else {
2438 output.push(value);
2439 }
2440 }
2441 return output;
2442 }
2443
2444 /**
2445 * Creates a string based on an array of numeric code points.
2446 * @see `punycode.ucs2.decode`
2447 * @memberOf punycode.ucs2
2448 * @name encode
2449 * @param {Array} codePoints The array of numeric code points.
2450 * @returns {String} The new Unicode string (UCS-2).
2451 */
2452 function ucs2encode(array) {
2453 return map(array, function(value) {
2454 var output = '';
2455 if (value > 0xFFFF) {
2456 value -= 0x10000;
2457 output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
2458 value = 0xDC00 | value & 0x3FF;
2459 }
2460 output += stringFromCharCode(value);
2461 return output;
2462 }).join('');
2463 }
2464
2465 /**
2466 * Converts a basic code point into a digit/integer.
2467 * @see `digitToBasic()`
2468 * @private
2469 * @param {Number} codePoint The basic numeric code point value.
2470 * @returns {Number} The numeric value of a basic code point (for use in
2471 * representing integers) in the range `0` to `base - 1`, or `base` if
2472 * the code point does not represent a value.
2473 */
2474 function basicToDigit(codePoint) {
2475 if (codePoint - 48 < 10) {
2476 return codePoint - 22;
2477 }
2478 if (codePoint - 65 < 26) {
2479 return codePoint - 65;
2480 }
2481 if (codePoint - 97 < 26) {
2482 return codePoint - 97;
2483 }
2484 return base;
2485 }
2486
2487 /**
2488 * Converts a digit/integer into a basic code point.
2489 * @see `basicToDigit()`
2490 * @private
2491 * @param {Number} digit The numeric value of a basic code point.
2492 * @returns {Number} The basic code point whose value (when used for
2493 * representing integers) is `digit`, which needs to be in the range
2494 * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
2495 * used; else, the lowercase form is used. The behavior is undefined
2496 * if `flag` is non-zero and `digit` has no uppercase form.
2497 */
2498 function digitToBasic(digit, flag) {
2499 // 0..25 map to ASCII a..z or A..Z
2500 // 26..35 map to ASCII 0..9
2501 return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
2502 }
2503
2504 /**
2505 * Bias adaptation function as per section 3.4 of RFC 3492.
2506 * https://tools.ietf.org/html/rfc3492#section-3.4
2507 * @private
2508 */
2509 function adapt(delta, numPoints, firstTime) {
2510 var k = 0;
2511 delta = firstTime ? floor(delta / damp) : delta >> 1;
2512 delta += floor(delta / numPoints);
2513 for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {
2514 delta = floor(delta / baseMinusTMin);
2515 }
2516 return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
2517 }
2518
2519 /**
2520 * Converts a Punycode string of ASCII-only symbols to a string of Unicode
2521 * symbols.
2522 * @memberOf punycode
2523 * @param {String} input The Punycode string of ASCII-only symbols.
2524 * @returns {String} The resulting string of Unicode symbols.
2525 */
2526 function decode(input) {
2527 // Don't use UCS-2
2528 var output = [],
2529 inputLength = input.length,
2530 out,
2531 i = 0,
2532 n = initialN,
2533 bias = initialBias,
2534 basic,
2535 j,
2536 index,
2537 oldi,
2538 w,
2539 k,
2540 digit,
2541 t,
2542 /** Cached calculation results */
2543 baseMinusT;
2544
2545 // Handle the basic code points: let `basic` be the number of input code
2546 // points before the last delimiter, or `0` if there is none, then copy
2547 // the first basic code points to the output.
2548
2549 basic = input.lastIndexOf(delimiter);
2550 if (basic < 0) {
2551 basic = 0;
2552 }
2553
2554 for (j = 0; j < basic; ++j) {
2555 // if it's not a basic code point
2556 if (input.charCodeAt(j) >= 0x80) {
2557 error('not-basic');
2558 }
2559 output.push(input.charCodeAt(j));
2560 }
2561
2562 // Main decoding loop: start just after the last delimiter if any basic code
2563 // points were copied; start at the beginning otherwise.
2564
2565 for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {
2566
2567 // `index` is the index of the next character to be consumed.
2568 // Decode a generalized variable-length integer into `delta`,
2569 // which gets added to `i`. The overflow checking is easier
2570 // if we increase `i` as we go, then subtract off its starting
2571 // value at the end to obtain `delta`.
2572 for (oldi = i, w = 1, k = base; /* no condition */; k += base) {
2573
2574 if (index >= inputLength) {
2575 error('invalid-input');
2576 }
2577
2578 digit = basicToDigit(input.charCodeAt(index++));
2579
2580 if (digit >= base || digit > floor((maxInt - i) / w)) {
2581 error('overflow');
2582 }
2583
2584 i += digit * w;
2585 t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
2586
2587 if (digit < t) {
2588 break;
2589 }
2590
2591 baseMinusT = base - t;
2592 if (w > floor(maxInt / baseMinusT)) {
2593 error('overflow');
2594 }
2595
2596 w *= baseMinusT;
2597
2598 }
2599
2600 out = output.length + 1;
2601 bias = adapt(i - oldi, out, oldi == 0);
2602
2603 // `i` was supposed to wrap around from `out` to `0`,
2604 // incrementing `n` each time, so we'll fix that now:
2605 if (floor(i / out) > maxInt - n) {
2606 error('overflow');
2607 }
2608
2609 n += floor(i / out);
2610 i %= out;
2611
2612 // Insert `n` at position `i` of the output
2613 output.splice(i++, 0, n);
2614
2615 }
2616
2617 return ucs2encode(output);
2618 }
2619
2620 /**
2621 * Converts a string of Unicode symbols (e.g. a domain name label) to a
2622 * Punycode string of ASCII-only symbols.
2623 * @memberOf punycode
2624 * @param {String} input The string of Unicode symbols.
2625 * @returns {String} The resulting Punycode string of ASCII-only symbols.
2626 */
2627 function encode(input) {
2628 var n,
2629 delta,
2630 handledCPCount,
2631 basicLength,
2632 bias,
2633 j,
2634 m,
2635 q,
2636 k,
2637 t,
2638 currentValue,
2639 output = [],
2640 /** `inputLength` will hold the number of code points in `input`. */
2641 inputLength,
2642 /** Cached calculation results */
2643 handledCPCountPlusOne,
2644 baseMinusT,
2645 qMinusT;
2646
2647 // Convert the input in UCS-2 to Unicode
2648 input = ucs2decode(input);
2649
2650 // Cache the length
2651 inputLength = input.length;
2652
2653 // Initialize the state
2654 n = initialN;
2655 delta = 0;
2656 bias = initialBias;
2657
2658 // Handle the basic code points
2659 for (j = 0; j < inputLength; ++j) {
2660 currentValue = input[j];
2661 if (currentValue < 0x80) {
2662 output.push(stringFromCharCode(currentValue));
2663 }
2664 }
2665
2666 handledCPCount = basicLength = output.length;
2667
2668 // `handledCPCount` is the number of code points that have been handled;
2669 // `basicLength` is the number of basic code points.
2670
2671 // Finish the basic string - if it is not empty - with a delimiter
2672 if (basicLength) {
2673 output.push(delimiter);
2674 }
2675
2676 // Main encoding loop:
2677 while (handledCPCount < inputLength) {
2678
2679 // All non-basic code points < n have been handled already. Find the next
2680 // larger one:
2681 for (m = maxInt, j = 0; j < inputLength; ++j) {
2682 currentValue = input[j];
2683 if (currentValue >= n && currentValue < m) {
2684 m = currentValue;
2685 }
2686 }
2687
2688 // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
2689 // but guard against overflow
2690 handledCPCountPlusOne = handledCPCount + 1;
2691 if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
2692 error('overflow');
2693 }
2694
2695 delta += (m - n) * handledCPCountPlusOne;
2696 n = m;
2697
2698 for (j = 0; j < inputLength; ++j) {
2699 currentValue = input[j];
2700
2701 if (currentValue < n && ++delta > maxInt) {
2702 error('overflow');
2703 }
2704
2705 if (currentValue == n) {
2706 // Represent delta as a generalized variable-length integer
2707 for (q = delta, k = base; /* no condition */; k += base) {
2708 t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
2709 if (q < t) {
2710 break;
2711 }
2712 qMinusT = q - t;
2713 baseMinusT = base - t;
2714 output.push(
2715 stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
2716 );
2717 q = floor(qMinusT / baseMinusT);
2718 }
2719
2720 output.push(stringFromCharCode(digitToBasic(q, 0)));
2721 bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
2722 delta = 0;
2723 ++handledCPCount;
2724 }
2725 }
2726
2727 ++delta;
2728 ++n;
2729
2730 }
2731 return output.join('');
2732 }
2733
2734 /**
2735 * Converts a Punycode string representing a domain name or an email address
2736 * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
2737 * it doesn't matter if you call it on a string that has already been
2738 * converted to Unicode.
2739 * @memberOf punycode
2740 * @param {String} input The Punycoded domain name or email address to
2741 * convert to Unicode.
2742 * @returns {String} The Unicode representation of the given Punycode
2743 * string.
2744 */
2745 function toUnicode(input) {
2746 return mapDomain(input, function(string) {
2747 return regexPunycode.test(string)
2748 ? decode(string.slice(4).toLowerCase())
2749 : string;
2750 });
2751 }
2752
2753 /**
2754 * Converts a Unicode string representing a domain name or an email address to
2755 * Punycode. Only the non-ASCII parts of the domain name will be converted,
2756 * i.e. it doesn't matter if you call it with a domain that's already in
2757 * ASCII.
2758 * @memberOf punycode
2759 * @param {String} input The domain name or email address to convert, as a
2760 * Unicode string.
2761 * @returns {String} The Punycode representation of the given domain name or
2762 * email address.
2763 */
2764 function toASCII(input) {
2765 return mapDomain(input, function(string) {
2766 return regexNonASCII.test(string)
2767 ? 'xn--' + encode(string)
2768 : string;
2769 });
2770 }
2771
2772 /*--------------------------------------------------------------------------*/
2773
2774 /** Define the public API */
2775 punycode = {
2776 /**
2777 * A string representing the current Punycode.js version number.
2778 * @memberOf punycode
2779 * @type String
2780 */
2781 'version': '1.4.1',
2782 /**
2783 * An object of methods to convert from JavaScript's internal character
2784 * representation (UCS-2) to Unicode code points, and back.
2785 * @see <https://mathiasbynens.be/notes/javascript-encoding>
2786 * @memberOf punycode
2787 * @type Object
2788 */
2789 'ucs2': {
2790 'decode': ucs2decode,
2791 'encode': ucs2encode
2792 },
2793 'decode': decode,
2794 'encode': encode,
2795 'toASCII': toASCII,
2796 'toUnicode': toUnicode
2797 };
2798
2799 /** Expose `punycode` */
2800 // Some AMD build optimizers, like r.js, check for specific condition patterns
2801 // like the following:
2802 if (
2803 typeof define == 'function' &&
2804 typeof define.amd == 'object' &&
2805 define.amd
2806 ) {
2807 define('punycode', function() {
2808 return punycode;
2809 });
2810 } else if (freeExports && freeModule) {
2811 if (module.exports == freeExports) {
2812 // in Node.js, io.js, or RingoJS v0.8.0+
2813 freeModule.exports = punycode;
2814 } else {
2815 // in Narwhal or RingoJS v0.7.0-
2816 for (key in punycode) {
2817 punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);
2818 }
2819 }
2820 } else {
2821 // in Rhino or a web browser
2822 root.punycode = punycode;
2823 }
2824
2825}(this));
2826
2827}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
2828},{}],13:[function(require,module,exports){
2829/**
2830 * This file automatically generated from `pre-publish.js`.
2831 * Do not manually edit.
2832 */
2833
2834module.exports = {
2835 "area": true,
2836 "base": true,
2837 "br": true,
2838 "col": true,
2839 "embed": true,
2840 "hr": true,
2841 "img": true,
2842 "input": true,
2843 "keygen": true,
2844 "link": true,
2845 "menuitem": true,
2846 "meta": true,
2847 "param": true,
2848 "source": true,
2849 "track": true,
2850 "wbr": true
2851};
2852
2853},{}]},{},[3]);