作者 whf

11111

要显示太多修改。

为保证性能只显示 33 of 33+ 个文件。

/*!
* EventEmitter v4.2.11 - git.io/ee
* Unlicense - http://unlicense.org/
* Oliver Caldwell - http://oli.me.uk/
* @preserve
*/
;(function () {
'use strict';
/**
* Class for managing events.
* Can be extended to provide event functionality in other classes.
*
* @class EventEmitter Manages event registering and emitting.
*/
function EventEmitter() {}
// Shortcuts to improve speed and size
var proto = EventEmitter.prototype;
var exports = this;
var originalGlobalValue = exports.EventEmitter;
/**
* Finds the index of the listener for the event in its storage array.
*
* @param {Function[]} listeners Array of listeners to search through.
* @param {Function} listener Method to look for.
* @return {Number} Index of the specified listener, -1 if not found
* @api private
*/
function indexOfListener(listeners, listener) {
var i = listeners.length;
while (i--) {
if (listeners[i].listener === listener) {
return i;
}
}
return -1;
}
/**
* Alias a method while keeping the context correct, to allow for overwriting of target method.
*
* @param {String} name The name of the target method.
* @return {Function} The aliased method
* @api private
*/
function alias(name) {
return function aliasClosure() {
return this[name].apply(this, arguments);
};
}
/**
* Returns the listener array for the specified event.
* Will initialise the event object and listener arrays if required.
* Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.
* Each property in the object response is an array of listener functions.
*
* @param {String|RegExp} evt Name of the event to return the listeners from.
* @return {Function[]|Object} All listener functions for the event.
*/
proto.getListeners = function getListeners(evt) {
var events = this._getEvents();
var response;
var key;
// Return a concatenated array of all matching events if
// the selector is a regular expression.
if (evt instanceof RegExp) {
response = {};
for (key in events) {
if (events.hasOwnProperty(key) && evt.test(key)) {
response[key] = events[key];
}
}
}
else {
response = events[evt] || (events[evt] = []);
}
return response;
};
/**
* Takes a list of listener objects and flattens it into a list of listener functions.
*
* @param {Object[]} listeners Raw listener objects.
* @return {Function[]} Just the listener functions.
*/
proto.flattenListeners = function flattenListeners(listeners) {
var flatListeners = [];
var i;
for (i = 0; i < listeners.length; i += 1) {
flatListeners.push(listeners[i].listener);
}
return flatListeners;
};
/**
* Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.
*
* @param {String|RegExp} evt Name of the event to return the listeners from.
* @return {Object} All listener functions for an event in an object.
*/
proto.getListenersAsObject = function getListenersAsObject(evt) {
var listeners = this.getListeners(evt);
var response;
if (listeners instanceof Array) {
response = {};
response[evt] = listeners;
}
return response || listeners;
};
/**
* Adds a listener function to the specified event.
* The listener will not be added if it is a duplicate.
* If the listener returns true then it will be removed after it is called.
* If you pass a regular expression as the event name then the listener will be added to all events that match it.
*
* @param {String|RegExp} evt Name of the event to attach the listener to.
* @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.addListener = function addListener(evt, listener) {
var listeners = this.getListenersAsObject(evt);
var listenerIsWrapped = typeof listener === 'object';
var key;
for (key in listeners) {
if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {
listeners[key].push(listenerIsWrapped ? listener : {
listener: listener,
once: false
});
}
}
return this;
};
/**
* Alias of addListener
*/
proto.on = alias('addListener');
/**
* Semi-alias of addListener. It will add a listener that will be
* automatically removed after its first execution.
*
* @param {String|RegExp} evt Name of the event to attach the listener to.
* @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.addOnceListener = function addOnceListener(evt, listener) {
return this.addListener(evt, {
listener: listener,
once: true
});
};
/**
* Alias of addOnceListener.
*/
proto.once = alias('addOnceListener');
/**
* Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.
* You need to tell it what event names should be matched by a regex.
*
* @param {String} evt Name of the event to create.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.defineEvent = function defineEvent(evt) {
this.getListeners(evt);
return this;
};
/**
* Uses defineEvent to define multiple events.
*
* @param {String[]} evts An array of event names to define.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.defineEvents = function defineEvents(evts) {
for (var i = 0; i < evts.length; i += 1) {
this.defineEvent(evts[i]);
}
return this;
};
/**
* Removes a listener function from the specified event.
* When passed a regular expression as the event name, it will remove the listener from all events that match it.
*
* @param {String|RegExp} evt Name of the event to remove the listener from.
* @param {Function} listener Method to remove from the event.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.removeListener = function removeListener(evt, listener) {
var listeners = this.getListenersAsObject(evt);
var index;
var key;
for (key in listeners) {
if (listeners.hasOwnProperty(key)) {
index = indexOfListener(listeners[key], listener);
if (index !== -1) {
listeners[key].splice(index, 1);
}
}
}
return this;
};
/**
* Alias of removeListener
*/
proto.off = alias('removeListener');
/**
* Adds listeners in bulk using the manipulateListeners method.
* If you pass an object as the second argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.
* You can also pass it a regular expression to add the array of listeners to all events that match it.
* Yeah, this function does quite a bit. That's probably a bad thing.
*
* @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.
* @param {Function[]} [listeners] An optional array of listener functions to add.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.addListeners = function addListeners(evt, listeners) {
// Pass through to manipulateListeners
return this.manipulateListeners(false, evt, listeners);
};
/**
* Removes listeners in bulk using the manipulateListeners method.
* If you pass an object as the second argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
* You can also pass it an event name and an array of listeners to be removed.
* You can also pass it a regular expression to remove the listeners from all events that match it.
*
* @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.
* @param {Function[]} [listeners] An optional array of listener functions to remove.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.removeListeners = function removeListeners(evt, listeners) {
// Pass through to manipulateListeners
return this.manipulateListeners(true, evt, listeners);
};
/**
* Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.
* The first argument will determine if the listeners are removed (true) or added (false).
* If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
* You can also pass it an event name and an array of listeners to be added/removed.
* You can also pass it a regular expression to manipulate the listeners of all events that match it.
*
* @param {Boolean} remove True if you want to remove listeners, false if you want to add.
* @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.
* @param {Function[]} [listeners] An optional array of listener functions to add/remove.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {
var i;
var value;
var single = remove ? this.removeListener : this.addListener;
var multiple = remove ? this.removeListeners : this.addListeners;
// If evt is an object then pass each of its properties to this method
if (typeof evt === 'object' && !(evt instanceof RegExp)) {
for (i in evt) {
if (evt.hasOwnProperty(i) && (value = evt[i])) {
// Pass the single listener straight through to the singular method
if (typeof value === 'function') {
single.call(this, i, value);
}
else {
// Otherwise pass back to the multiple function
multiple.call(this, i, value);
}
}
}
}
else {
// So evt must be a string
// And listeners must be an array of listeners
// Loop over it and pass each one to the multiple method
i = listeners.length;
while (i--) {
single.call(this, evt, listeners[i]);
}
}
return this;
};
/**
* Removes all listeners from a specified event.
* If you do not specify an event then all listeners will be removed.
* That means every event will be emptied.
* You can also pass a regex to remove all events that match it.
*
* @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.removeEvent = function removeEvent(evt) {
var type = typeof evt;
var events = this._getEvents();
var key;
// Remove different things depending on the state of evt
if (type === 'string') {
// Remove all listeners for the specified event
delete events[evt];
}
else if (evt instanceof RegExp) {
// Remove all events matching the regex.
for (key in events) {
if (events.hasOwnProperty(key) && evt.test(key)) {
delete events[key];
}
}
}
else {
// Remove all listeners in all events
delete this._events;
}
return this;
};
/**
* Alias of removeEvent.
*
* Added to mirror the node API.
*/
proto.removeAllListeners = alias('removeEvent');
/**
* Emits an event of your choice.
* When emitted, every listener attached to that event will be executed.
* If you pass the optional argument array then those arguments will be passed to every listener upon execution.
* Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.
* So they will not arrive within the array on the other side, they will be separate.
* You can also pass a regular expression to emit to all events that match it.
*
* @param {String|RegExp} evt Name of the event to emit and execute listeners for.
* @param {Array} [args] Optional array of arguments to be passed to each listener.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.emitEvent = function emitEvent(evt, args) {
var listenersMap = this.getListenersAsObject(evt);
var listeners;
var listener;
var i;
var key;
var response;
for (key in listenersMap) {
if (listenersMap.hasOwnProperty(key)) {
listeners = listenersMap[key].slice(0);
i = listeners.length;
while (i--) {
// If the listener returns true then it shall be removed from the event
// The function is executed either with a basic call or an apply if there is an args array
listener = listeners[i];
if (listener.once === true) {
this.removeListener(evt, listener.listener);
}
response = listener.listener.apply(this, args || []);
if (response === this._getOnceReturnValue()) {
this.removeListener(evt, listener.listener);
}
}
}
}
return this;
};
/**
* Alias of emitEvent
*/
proto.trigger = alias('emitEvent');
/**
* Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.
* As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.
*
* @param {String|RegExp} evt Name of the event to emit and execute listeners for.
* @param {...*} Optional additional arguments to be passed to each listener.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.emit = function emit(evt) {
var args = Array.prototype.slice.call(arguments, 1);
return this.emitEvent(evt, args);
};
/**
* Sets the current value to check against when executing listeners. If a
* listeners return value matches the one set here then it will be removed
* after execution. This value defaults to true.
*
* @param {*} value The new value to check for when executing listeners.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.setOnceReturnValue = function setOnceReturnValue(value) {
this._onceReturnValue = value;
return this;
};
/**
* Fetches the current value to check against when executing listeners. If
* the listeners return value matches this one then it should be removed
* automatically. It will return true by default.
*
* @return {*|Boolean} The current value to check for or the default, true.
* @api private
*/
proto._getOnceReturnValue = function _getOnceReturnValue() {
if (this.hasOwnProperty('_onceReturnValue')) {
return this._onceReturnValue;
}
else {
return true;
}
};
/**
* Fetches the events object and creates one if required.
*
* @return {Object} The events storage object.
* @api private
*/
proto._getEvents = function _getEvents() {
return this._events || (this._events = {});
};
/**
* Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.
*
* @return {Function} Non conflicting EventEmitter class.
*/
EventEmitter.noConflict = function noConflict() {
exports.EventEmitter = originalGlobalValue;
return EventEmitter;
};
// Expose the class either via AMD, CommonJS or the global object
if (typeof define === 'function' && define.amd) {
define(function () {
return EventEmitter;
});
}
else if (typeof module === 'object' && module.exports){
module.exports = EventEmitter;
}
else {
exports.EventEmitter = EventEmitter;
}
}.call(this));
/*!
* EventEmitter v4.2.11 - git.io/ee
* Unlicense - http://unlicense.org/
* Oliver Caldwell - http://oli.me.uk/
* @preserve
*/
(function(){"use strict";function t(){}function i(t,n){for(var e=t.length;e--;)if(t[e].listener===n)return e;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var e=t.prototype,r=this,s=r.EventEmitter;e.getListeners=function(n){var r,e,t=this._getEvents();if(n instanceof RegExp){r={};for(e in t)t.hasOwnProperty(e)&&n.test(e)&&(r[e]=t[e])}else r=t[n]||(t[n]=[]);return r},e.flattenListeners=function(t){var e,n=[];for(e=0;e<t.length;e+=1)n.push(t[e].listener);return n},e.getListenersAsObject=function(n){var e,t=this.getListeners(n);return t instanceof Array&&(e={},e[n]=t),e||t},e.addListener=function(r,e){var t,n=this.getListenersAsObject(r),s="object"==typeof e;for(t in n)n.hasOwnProperty(t)&&-1===i(n[t],e)&&n[t].push(s?e:{listener:e,once:!1});return this},e.on=n("addListener"),e.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},e.once=n("addOnceListener"),e.defineEvent=function(e){return this.getListeners(e),this},e.defineEvents=function(t){for(var e=0;e<t.length;e+=1)this.defineEvent(t[e]);return this},e.removeListener=function(r,s){var n,e,t=this.getListenersAsObject(r);for(e in t)t.hasOwnProperty(e)&&(n=i(t[e],s),-1!==n&&t[e].splice(n,1));return this},e.off=n("removeListener"),e.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},e.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},e.manipulateListeners=function(r,t,i){var e,n,s=r?this.removeListener:this.addListener,o=r?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(e=i.length;e--;)s.call(this,t,i[e]);else for(e in t)t.hasOwnProperty(e)&&(n=t[e])&&("function"==typeof n?s.call(this,e,n):o.call(this,e,n));return this},e.removeEvent=function(e){var t,r=typeof e,n=this._getEvents();if("string"===r)delete n[e];else if(e instanceof RegExp)for(t in n)n.hasOwnProperty(t)&&e.test(t)&&delete n[t];else delete this._events;return this},e.removeAllListeners=n("removeEvent"),e.emitEvent=function(t,u){var n,e,r,i,o,s=this.getListenersAsObject(t);for(i in s)if(s.hasOwnProperty(i))for(n=s[i].slice(0),r=n.length;r--;)e=n[r],e.once===!0&&this.removeListener(t,e.listener),o=e.listener.apply(this,u||[]),o===this._getOnceReturnValue()&&this.removeListener(t,e.listener);return this},e.trigger=n("emitEvent"),e.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},e.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},e._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},e._getEvents=function(){return this._events||(this._events={})},t.noConflict=function(){return r.EventEmitter=s,t},"function"==typeof define&&define.amd?define(function(){return t}):"object"==typeof module&&module.exports?module.exports=t:r.EventEmitter=t}).call(this);
\ No newline at end of file
此 diff 太大无法显示。
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Netcall=e():t.Netcall=e()}(this,function(){return function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={exports:{},id:i,loaded:!1};return t[i].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var o=n(98),r=i(o),s="4.8.0",a="2.4.0.208",c=n(343),u=n(219),l=n(276),d=n(341),h=n(203),f=n(285),p=n(286),v=n(287),m=void 0,_=(0,r["default"])({version:s,versionAgent:a},h,{webgl:c,install:function(t,e){u.install(t,e),l.install(t,e),t.parser.mixin({configMap:f,serializeMap:p,unserializeMap:v}),d.install(t,e)},getInstance:function(t){return m||(m=new d(t)),m},destroy:function(){m&&(m.destroy(),m=null)}});t.exports=_},,function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){var i=n(35)("wks"),o=n(22),r=n(2).Symbol,s="function"==typeof r,a=t.exports=function(t){return i[t]||(i[t]=s&&r[t]||(s?r:o)("Symbol."+t))};a.store=i},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},,function(t,e){"use strict";e.__esModule=!0,e["default"]=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){t.exports=!n(18)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,n){var i=n(9),o=n(21);t.exports=n(7)?function(t,e,n){return i.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var i=n(14),o=n(50),r=n(37),s=Object.defineProperty;e.f=n(7)?Object.defineProperty:function(t,e,n){if(i(t),e=r(e,!0),i(n),o)try{return s(t,e,n)}catch(a){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e){var n=t.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var i=n(57),o=n(32);t.exports=function(t){return i(o(t))}},function(t,e,n){(function(e){"use strict";var n="'4cb44d7578c1b21a823b0bbf6da74f19e0b51d15",i="4cb44d75'",o="4.8.0",r="2.4.0.208",s="3.7.0",a="45",c=1,u="https://lbs.netease.im/lbs/webconf.jsp",l="development"===e.env.NODE_ENV?6e3:42e3,d={info:{hash:n,shortHash:i,version:o,sdkVersion:a,nrtcVersion:s,protocolVersion:c},agentVersion:r,lbsUrl:u,connectTimeout:l,xhrTimeout:l,socketTimeout:l,reconnectionDelay:656.25,reconnectionDelayMax:l,reconnectionJitter:.1,heartbeatInterval:18e4,cmdTimeout:l};d.formatSocketUrl=function(t){var e=t.url,n=t.secure,i=n?"https":"http";return e.indexOf("http")===-1?i+"://"+e:e},d.fileServerUrl="https://nos.netease.com",d.replaceUrl="http://nos.netease.im",d.genUploadUrl=function(t){return d.uploadUrl?d.uploadUrl+"/"+t:d.fileServerUrl+"/"+t},d.genDownloadUrl=function(t,e){return d.downloadUrl?d.replaceUrl+"/"+t+"/"+e:"https://"+t+".nosdn.127.net/"+e},t.exports=d}).call(e,n(28))},function(t,e,n){var i=n(11);t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=n(121),r=i(o),s=n(120),a=i(s),c=n(20),u=i(c);e["default"]=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof e?"undefined":(0,u["default"])(e)));t.prototype=(0,a["default"])(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(r["default"]?(0,r["default"])(t,e):t.__proto__=e)}},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=n(20),r=i(o);e["default"]=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==("undefined"==typeof e?"undefined":(0,r["default"])(e))&&"function"!=typeof e?t:e}},function(t,e,n){var i=n(2),o=n(10),r=n(45),s=n(8),a="prototype",c=function(t,e,n){var u,l,d,h=t&c.F,f=t&c.G,p=t&c.S,v=t&c.P,m=t&c.B,_=t&c.W,g=f?o:o[e]||(o[e]={}),y=g[a],C=f?i:p?i[e]:(i[e]||{})[a];f&&(n=e);for(u in n)l=!h&&C&&void 0!==C[u],l&&u in g||(d=l?C[u]:n[u],g[u]=f&&"function"!=typeof C[u]?n[u]:m&&l?r(d,i):_&&C[u]==d?function(t){var e=function(e,n,i){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,i)}return t.apply(this,arguments)};return e[a]=t[a],e}(d):v&&"function"==typeof d?r(Function.call,d):d,v&&((g.virtual||(g.virtual={}))[u]=d,t&c.R&&y&&!y[u]&&s(y,u,d)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},function(t,e,n){"use strict";function i(){}function o(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function r(){this._events=new i,this._eventsCount=0}var s=Object.prototype.hasOwnProperty,a="~";Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(a=!1)),r.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)s.call(t,e)&&n.push(a?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},r.prototype.listeners=function(t,e){var n=a?a+t:t,i=this._events[n];if(e)return!!i;if(!i)return[];if(i.fn)return[i.fn];for(var o=0,r=i.length,s=new Array(r);o<r;o++)s[o]=i[o].fn;return s},r.prototype.emit=function(t,e,n,i,o,r){var s=a?a+t:t;if(!this._events[s])return!1;var c,u,l=this._events[s],d=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),d){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,n),!0;case 4:return l.fn.call(l.context,e,n,i),!0;case 5:return l.fn.call(l.context,e,n,i,o),!0;case 6:return l.fn.call(l.context,e,n,i,o,r),!0}for(u=1,c=new Array(d-1);u<d;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var h,f=l.length;for(u=0;u<f;u++)switch(l[u].once&&this.removeListener(t,l[u].fn,void 0,!0),d){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,e);break;case 3:l[u].fn.call(l[u].context,e,n);break;case 4:l[u].fn.call(l[u].context,e,n,i);break;default:if(!c)for(h=1,c=new Array(d-1);h<d;h++)c[h-1]=arguments[h];l[u].fn.apply(l[u].context,c)}}return!0},r.prototype.on=function(t,e,n){var i=new o(e,n||this),r=a?a+t:t;return this._events[r]?this._events[r].fn?this._events[r]=[this._events[r],i]:this._events[r].push(i):(this._events[r]=i,this._eventsCount++),this},r.prototype.once=function(t,e,n){var i=new o(e,n||this,!0),r=a?a+t:t;return this._events[r]?this._events[r].fn?this._events[r]=[this._events[r],i]:this._events[r].push(i):(this._events[r]=i,this._eventsCount++),this},r.prototype.removeListener=function(t,e,n,o){var r=a?a+t:t;if(!this._events[r])return this;if(!e)return 0===--this._eventsCount?this._events=new i:delete this._events[r],this;var s=this._events[r];if(s.fn)s.fn!==e||o&&!s.once||n&&s.context!==n||(0===--this._eventsCount?this._events=new i:delete this._events[r]);else{for(var c=0,u=[],l=s.length;c<l;c++)(s[c].fn!==e||o&&!s[c].once||n&&s[c].context!==n)&&u.push(s[c]);u.length?this._events[r]=1===u.length?u[0]:u:0===--this._eventsCount?this._events=new i:delete this._events[r]}return this},r.prototype.removeAllListeners=function(t){var e;return t?(e=a?a+t:t,this._events[e]&&(0===--this._eventsCount?this._events=new i:delete this._events[e])):(this._events=new i,this._eventsCount=0),this},r.prototype.off=r.prototype.removeListener,r.prototype.addListener=r.prototype.on,r.prototype.setMaxListeners=function(){return this},r.prefixed=a,r.EventEmitter=r,t.exports=r},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=n(74),r=i(o),s=n(73),a=i(s),c="function"==typeof a["default"]&&"symbol"==typeof r["default"]?function(t){return typeof t}:function(t){return t&&"function"==typeof a["default"]&&t.constructor===a["default"]&&t!==a["default"].prototype?"symbol":typeof t};e["default"]="function"==typeof a["default"]&&"symbol"===c(r["default"])?function(t){return"undefined"==typeof t?"undefined":c(t)}:function(t){return t&&"function"==typeof a["default"]&&t.constructor===a["default"]&&t!==a["default"].prototype?"symbol":"undefined"==typeof t?"undefined":c(t)}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var n=0,i=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+i).toString(36))}},,function(t,e,n){var i=n(53),o=n(33);t.exports=Object.keys||function(t){return i(t,o)}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e){t.exports={}},,function(t,e){function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function o(t){if(l===setTimeout)return setTimeout(t,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}catch(e){return l.call(this,t,0)}}}function r(t){if(d===clearTimeout)return clearTimeout(t);if((d===i||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(t);try{return d(t)}catch(e){try{return d.call(null,t)}catch(e){return d.call(this,t)}}}function s(){v&&f&&(v=!1,f.length?p=f.concat(p):m=-1,p.length&&a())}function a(){if(!v){var t=o(s);v=!0;for(var e=p.length;e;){for(f=p,p=[];++m<e;)f&&f[m].run();m=-1,e=p.length}f=null,v=!1,r(t)}}function c(t,e){this.fun=t,this.array=e}function u(){}var l,d,h=t.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(t){l=n}try{d="function"==typeof clearTimeout?clearTimeout:i}catch(t){d=i}}();var f,p=[],v=!1,m=-1;h.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];p.push(new c(t,e)),1!==p.length||v||o(a)},c.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=u,h.addListener=u,h.once=u,h.off=u,h.removeListener=u,h.removeAllListeners=u,h.emit=u,h.prependListener=u,h.prependOnceListener=u,h.listeners=function(t){return[]},h.binding=function(t){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(t){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},,function(t,e){t.exports=!0},function(t,e,n){var i=n(9).f,o=n(4),r=n(3)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,r)&&i(t,r,{configurable:!0,value:e})}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var i=n(35)("keys"),o=n(22);t.exports=function(t){return i[t]||(i[t]=o(t))}},function(t,e,n){var i=n(2),o="__core-js_shared__",r=i[o]||(i[o]={});t.exports=function(t){return r[t]||(r[t]={})}},function(t,e){var n=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?i:n)(t)}},function(t,e,n){var i=n(11);t.exports=function(t,e){if(!i(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!i(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!i(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!i(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var i=n(2),o=n(10),r=n(30),s=n(39),a=n(9).f;t.exports=function(t){var e=o.Symbol||(o.Symbol=r?{}:i.Symbol||{});"_"==t.charAt(0)||t in e||a(e,t,{value:s.f(t)})}},function(t,e,n){e.f=n(3)},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=n(114);Object.defineProperty(e,"ajax",{enumerable:!0,get:function(){return i(o)["default"]}});var r=n(115);Object.defineProperty(e,"element",{enumerable:!0,get:function(){return i(r)["default"]}});var s=n(116);Object.defineProperty(e,"tool",{enumerable:!0,get:function(){return i(s)["default"]}})},function(t,e,n){var i=n(14),o=n(84),r=n(33),s=n(34)("IE_PROTO"),a=function(){},c="prototype",u=function(){var t,e=n(46)("iframe"),i=r.length,o="<",s=">";for(e.style.display="none",n(67).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(o+"script"+s+"document.F=Object"+o+"/script"+s),t.close(),u=t.F;i--;)delete u[c][r[i]];return u()};t.exports=Object.create||function(t,e){var n;return null!==t?(a[c]=i(t),n=new a,a[c]=null,n[s]=t):n=u(),void 0===e?n:o(n,e)}},function(t,e){e.f=Object.getOwnPropertySymbols},,function(t,e,n){var i=n(56);t.exports=function(t,e,n){if(i(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,o){return t.call(e,n,i,o)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){var i=n(11),o=n(2).document,r=i(o)&&i(o.createElement);t.exports=function(t){return r?o.createElement(t):{}}},,,,function(t,e,n){t.exports=!n(7)&&!n(18)(function(){return 7!=Object.defineProperty(n(46)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){"use strict";var i=n(30),o=n(17),r=n(54),s=n(8),a=n(4),c=n(26),u=n(81),l=n(31),d=n(86),h=n(3)("iterator"),f=!([].keys&&"next"in[].keys()),p="@@iterator",v="keys",m="values",_=function(){return this};t.exports=function(t,e,n,g,y,C,T){u(n,e,g);var A,S,b,E=function(t){if(!f&&t in w)return w[t];switch(t){case v:return function(){return new n(this,t)};case m:return function(){return new n(this,t)}}return function(){return new n(this,t)}},I=e+" Iterator",O=y==m,M=!1,w=t.prototype,N=w[h]||w[p]||y&&w[y],k=!f&&N||E(y),x=y?O?E("entries"):k:void 0,L="Array"==e?w.entries||N:N;if(L&&(b=d(L.call(new t)),b!==Object.prototype&&b.next&&(l(b,I,!0),i||a(b,h)||s(b,h,_))),O&&N&&N.name!==m&&(M=!0,k=function(){return N.call(this)}),i&&!T||!f&&!M&&w[h]||s(w,h,k),c[e]=k,c[I]=_,y)if(A={values:O?k:E(m),keys:C?k:E(v),entries:x},T)for(S in A)S in w||r(w,S,A[S]);else o(o.P+o.F*(f||M),e,A);return A}},function(t,e,n){var i=n(53),o=n(33).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return i(t,o)}},function(t,e,n){var i=n(4),o=n(12),r=n(78)(!1),s=n(34)("IE_PROTO");t.exports=function(t,e){var n,a=o(t),c=0,u=[];for(n in a)n!=s&&i(a,n)&&u.push(n);for(;e.length>c;)i(a,n=e[c++])&&(~r(u,n)||u.push(n));return u}},function(t,e,n){t.exports=n(8)},,function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var i=n(40);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==i(t)?t.split(""):Object(t)}},function(t,e,n){var i=n(25),o=n(21),r=n(12),s=n(37),a=n(4),c=n(50),u=Object.getOwnPropertyDescriptor;e.f=n(7)?u:function(t,e){if(t=r(t),e=s(e,!0),c)try{return u(t,e)}catch(n){}if(a(t,e))return o(!i.f.call(t,e),t[e])}},function(t,e,n){var i=n(32);t.exports=function(t){return Object(i(t))}},,,,,,,,function(t,e,n){var i=n(2).document;t.exports=i&&i.documentElement},function(t,e,n){var i=n(36),o=Math.min;t.exports=function(t){return t>0?o(i(t),9007199254740991):0}},function(t,e){},function(t,e,n){"use strict";var i=n(87)(!0);n(51)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=i(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){n(89);for(var i=n(2),o=n(8),r=n(26),s=n(3)("toStringTag"),a="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),c=0;c<a.length;c++){var u=a[c],l=i[u],d=l&&l.prototype;d&&!d[s]&&o(d,s,u),r[u]=r.Array}},,function(t,e,n){t.exports={"default":n(75),__esModule:!0}},function(t,e,n){t.exports={"default":n(76),__esModule:!0}},function(t,e,n){n(90),n(69),n(91),n(92),t.exports=n(10).Symbol},function(t,e,n){n(70),n(71),t.exports=n(39).f("iterator")},function(t,e){t.exports=function(){}},function(t,e,n){var i=n(12),o=n(68),r=n(88);t.exports=function(t){return function(e,n,s){var a,c=i(e),u=o(c.length),l=r(s,u);if(t&&n!=n){for(;u>l;)if(a=c[l++],a!=a)return!0}else for(;u>l;l++)if((t||l in c)&&c[l]===n)return t||l||0;return!t&&-1}}},function(t,e,n){var i=n(24),o=n(43),r=n(25);t.exports=function(t){var e=i(t),n=o.f;if(n)for(var s,a=n(t),c=r.f,u=0;a.length>u;)c.call(t,s=a[u++])&&e.push(s);return e}},function(t,e,n){var i=n(40);t.exports=Array.isArray||function(t){return"Array"==i(t)}},function(t,e,n){"use strict";var i=n(42),o=n(21),r=n(31),s={};n(8)(s,n(3)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=i(s,{next:o(1,n)}),r(t,e+" Iterator")}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){var i=n(22)("meta"),o=n(11),r=n(4),s=n(9).f,a=0,c=Object.isExtensible||function(){return!0},u=!n(18)(function(){return c(Object.preventExtensions({}))}),l=function(t){s(t,i,{value:{i:"O"+ ++a,w:{}}})},d=function(t,e){if(!o(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!r(t,i)){if(!c(t))return"F";if(!e)return"E";l(t)}return t[i].i},h=function(t,e){if(!r(t,i)){if(!c(t))return!0;if(!e)return!1;l(t)}return t[i].w},f=function(t){return u&&p.NEED&&c(t)&&!r(t,i)&&l(t),t},p=t.exports={KEY:i,NEED:!1,fastKey:d,getWeak:h,onFreeze:f}},function(t,e,n){var i=n(9),o=n(14),r=n(24);t.exports=n(7)?Object.defineProperties:function(t,e){o(t);for(var n,s=r(e),a=s.length,c=0;a>c;)i.f(t,n=s[c++],e[n]);return t}},function(t,e,n){var i=n(12),o=n(52).f,r={}.toString,s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(t){try{return o(t)}catch(e){return s.slice()}};t.exports.f=function(t){return s&&"[object Window]"==r.call(t)?a(t):o(i(t))}},function(t,e,n){var i=n(4),o=n(59),r=n(34)("IE_PROTO"),s=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),i(t,r)?t[r]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?s:null}},function(t,e,n){var i=n(36),o=n(32);t.exports=function(t){return function(e,n){var r,s,a=String(o(e)),c=i(n),u=a.length;return c<0||c>=u?t?"":void 0:(r=a.charCodeAt(c),r<55296||r>56319||c+1===u||(s=a.charCodeAt(c+1))<56320||s>57343?t?a.charAt(c):r:t?a.slice(c,c+2):(r-55296<<10)+(s-56320)+65536)}}},function(t,e,n){var i=n(36),o=Math.max,r=Math.min;t.exports=function(t,e){return t=i(t),t<0?o(t+e,0):r(t,e)}},function(t,e,n){"use strict";var i=n(77),o=n(82),r=n(26),s=n(12);t.exports=n(51)(Array,"Array",function(t,e){this._t=s(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,o(1)):"keys"==e?o(0,n):"values"==e?o(0,t[n]):o(0,[n,t[n]])},"values"),r.Arguments=r.Array,i("keys"),i("values"),i("entries")},function(t,e,n){"use strict";var i=n(2),o=n(4),r=n(7),s=n(17),a=n(54),c=n(83).KEY,u=n(18),l=n(35),d=n(31),h=n(22),f=n(3),p=n(39),v=n(38),m=n(79),_=n(80),g=n(14),y=n(11),C=n(12),T=n(37),A=n(21),S=n(42),b=n(85),E=n(58),I=n(9),O=n(24),M=E.f,w=I.f,N=b.f,k=i.Symbol,x=i.JSON,L=x&&x.stringify,D="prototype",R=f("_hidden"),U=f("toPrimitive"),P={}.propertyIsEnumerable,j=l("symbol-registry"),V=l("symbols"),F=l("op-symbols"),H=Object[D],W="function"==typeof k,B=i.QObject,Y=!B||!B[D]||!B[D].findChild,Q=r&&u(function(){return 7!=S(w({},"a",{get:function(){return w(this,"a",{value:7}).a}})).a})?function(t,e,n){var i=M(H,e);i&&delete H[e],w(t,e,n),i&&t!==H&&w(H,e,i)}:w,q=function(t){var e=V[t]=S(k[D]);return e._k=t,e},z=W&&"symbol"==typeof k.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof k},G=function(t,e,n){return t===H&&G(F,e,n),g(t),e=T(e,!0),g(n),o(V,e)?(n.enumerable?(o(t,R)&&t[R][e]&&(t[R][e]=!1),n=S(n,{enumerable:A(0,!1)})):(o(t,R)||w(t,R,A(1,{})),t[R][e]=!0),Q(t,e,n)):w(t,e,n)},J=function(t,e){g(t);for(var n,i=m(e=C(e)),o=0,r=i.length;r>o;)G(t,n=i[o++],e[n]);return t},X=function(t,e){return void 0===e?S(t):J(S(t),e)},K=function(t){var e=P.call(this,t=T(t,!0));return!(this===H&&o(V,t)&&!o(F,t))&&(!(e||!o(this,t)||!o(V,t)||o(this,R)&&this[R][t])||e)},$=function(t,e){if(t=C(t),e=T(e,!0),t!==H||!o(V,e)||o(F,e)){var n=M(t,e);return!n||!o(V,e)||o(t,R)&&t[R][e]||(n.enumerable=!0),n}},Z=function(t){for(var e,n=N(C(t)),i=[],r=0;n.length>r;)o(V,e=n[r++])||e==R||e==c||i.push(e);return i},tt=function(t){for(var e,n=t===H,i=N(n?F:C(t)),r=[],s=0;i.length>s;)!o(V,e=i[s++])||n&&!o(H,e)||r.push(V[e]);return r};W||(k=function(){if(this instanceof k)throw TypeError("Symbol is not a constructor!");var t=h(arguments.length>0?arguments[0]:void 0),e=function(n){this===H&&e.call(F,n),o(this,R)&&o(this[R],t)&&(this[R][t]=!1),Q(this,t,A(1,n))};return r&&Y&&Q(H,t,{configurable:!0,set:e}),q(t)},a(k[D],"toString",function(){return this._k}),E.f=$,I.f=G,n(52).f=b.f=Z,n(25).f=K,n(43).f=tt,r&&!n(30)&&a(H,"propertyIsEnumerable",K,!0),p.f=function(t){return q(f(t))}),s(s.G+s.W+s.F*!W,{Symbol:k});for(var et="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),nt=0;et.length>nt;)f(et[nt++]);for(var it=O(f.store),ot=0;it.length>ot;)v(it[ot++]);s(s.S+s.F*!W,"Symbol",{"for":function(t){return o(j,t+="")?j[t]:j[t]=k(t)},keyFor:function(t){if(!z(t))throw TypeError(t+" is not a symbol!");for(var e in j)if(j[e]===t)return e},useSetter:function(){Y=!0},useSimple:function(){Y=!1}}),s(s.S+s.F*!W,"Object",{create:X,defineProperty:G,defineProperties:J,getOwnPropertyDescriptor:$,getOwnPropertyNames:Z,getOwnPropertySymbols:tt}),x&&s(s.S+s.F*(!W||u(function(){var t=k();return"[null]"!=L([t])||"{}"!=L({a:t})||"{}"!=L(Object(t))})),"JSON",{stringify:function(t){for(var e,n,i=[t],o=1;arguments.length>o;)i.push(arguments[o++]);if(n=e=i[1],(y(e)||void 0!==t)&&!z(t))return _(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!z(e))return e}),i[1]=e,L.apply(x,i)}}),k[D][U]||n(8)(k[D],U,k[D].valueOf),d(k,"Symbol"),d(Math,"Math",!0),d(i.JSON,"JSON",!0)},function(t,e,n){n(38)("asyncIterator")},function(t,e,n){n(38)("observable")},,,,,,function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=n(119),r=i(o);e["default"]=r["default"]||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}},,,,,,,function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=n(6),r=i(o),s=n(41),a=n(13),c=a.info.nrtcVersion,u="https://statistic.live.126.net/statistic/realtime/sdkFunctioninfo",l=function h(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,r["default"])(this,h);var e=t.appkey,n=t.platform;this.apis={},this.isRtc=/WebRTC/.test(n),this.init(e,n),this.resetStatus()};e["default"]=l;var d=l.prototype;d.init=function(t,e){this.apis=Object.assign(this.apis,{ver:1,platform:e,sdk_ver:c||"v4.4.0",uid:null,appkey:t,time:null})},d.start=function(t){this.calling=!0,this.apis=Object.assign(this.apis,t)},d.resetStatus=function(){this.calling=!1,this.apis=Object.assign(this.apis,{p2p:{value:0},meeting:{value:0},bypass:{value:0},call_control_type:{value:0},self_mute:{value:-1},self_mic_mute:{value:-1},switch_p2p_type:{value:0},set_speaker:{value:-1},net_detect:{value:this.isRtc?-1:0},beautify:{value:-1},water_mark:{value:-1},audio_samples:{value:-1},video_samples:{value:-1},pre_view_mirror:{value:-1},code_mirror:{value:-1},custom_audio:{value:-1},custom_video:{value:-1},audio_mix:{value:-1},snap_shot:{value:-1},record:{value:0},audio_record:{value:0},display:{value:0},android_compatibility:{value:-1},hd_audio:{value:0},video_quality:{value:0},fps:{value:0},prefered_video_encoder:{value:-1},prefered_video_decoder:{value:-1},video_max_encode_bitrate:{value:this.isRtc?-1:0},audio_scene:{value:-1},video_adaptive_strategy:{value:this.isRtc?-1:0},ans:{value:this.isRtc?-1:0},agc:{value:-1},dtx:{value:-1},aec:{value:this.isRtc?-1:0},awc:{value:this.isRtc?-1:0}})},d.update=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1],n=t.key,i=t.ext;t.constructor===String&&(n=t),i=i||e,this.apis[n]&&(this.apis[n].value=1,void 0!==i&&(this.apis[n].ext=i),/(p2p|meeting)/.test(n)&&(this.calling=!0))},d.send=function(){var t=this;this.calling&&(this.calling=!1,this.apis.time=Date.now(),(0,s.ajax)({type:"post",url:u,data:this.apis}).then(function(e){t.resetStatus()})["catch"](function(e){console.log("err",e),t.resetStatus()}))},t.exports=e["default"]},,,,,,,,,function(t,e){"use strict";e.__esModule=!0,e["default"]=function(t){if(!t.url||!t.data)return Promise.reject("参数不完整,无法发起请求");t.dataType=t.dataType||"json";var e=new XMLHttpRequest;return e.open(t.type||"GET",t.url,!0),e.responseType=""+t.dataType,e.setRequestHeader("Content-type","application/json;charset=UTF-8"),new Promise(function(n,i){e.onload=function(){var t=e.response;n(t)},e.onerror=function(t){i(t)},e.send(JSON.stringify(t.data))})};t.exports=e["default"]},function(t,e){"use strict";e.__esModule=!0,e["default"]={html2node:function(t){var e=document.createElement("div");e.innerHTML=t;var n,i,o=[];if(e.children)for(n=0,i=e.children.length;n<i;n++)o.push(e.children[n]);else for(n=0,i=e.childNodes.length;n<i;n++){var r=e.childNodes[n];1===r.nodeType&&o.push(r)}return o.length>1?e:o[0]},n2node:function(t){return t?/HTML.+Element/gi.test(t)?t:t[0]&&/HTML.+Element/gi.test(t[0])?t[0]:null:null}},t.exports=e["default"]},function(t,e){"use strict";e.__esModule=!0,e["default"]={merge:function(){var t=arguments;return t[0]=Object.assign.apply(Object.assign,arguments),t[0]},verifyOptions:function(){var t=arguments;if(t[0]&&t[0].constructor===Object)for(var e=1;e<arguments.length;e++){var n=t[e];n=n.split(" "),n.map(function(e){if(!t[0][e])throw Error("参数缺失 "+e)})}},guid:function(){var t=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return function(){return t()+t()+t()+t()+t()+t()+t()+t()}}()},t.exports=e["default"]},,,function(t,e,n){t.exports={"default":n(122),__esModule:!0}},function(t,e,n){t.exports={"default":n(123),__esModule:!0}},function(t,e,n){t.exports={"default":n(124),__esModule:!0}},function(t,e,n){n(127),t.exports=n(10).Object.assign},function(t,e,n){n(128);var i=n(10).Object;t.exports=function(t,e){return i.create(t,e)}},function(t,e,n){n(129),t.exports=n(10).Object.setPrototypeOf},function(t,e,n){"use strict";var i=n(24),o=n(43),r=n(25),s=n(59),a=n(57),c=Object.assign;t.exports=!c||n(18)(function(){var t={},e={},n=Symbol(),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach(function(t){e[t]=t}),7!=c({},t)[n]||Object.keys(c({},e)).join("")!=i})?function(t,e){for(var n=s(t),c=arguments.length,u=1,l=o.f,d=r.f;c>u;)for(var h,f=a(arguments[u++]),p=l?i(f).concat(l(f)):i(f),v=p.length,m=0;v>m;)d.call(f,h=p[m++])&&(n[h]=f[h]);return n}:c},function(t,e,n){var i=n(11),o=n(14),r=function(t,e){if(o(t),!i(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,i){try{i=n(45)(Function.call,n(58).f(Object.prototype,"__proto__").set,2),i(t,[]),e=!(t instanceof Array)}catch(o){e=!0}return function(t,n){return r(t,n),e?t.__proto__=n:i(t,n),t}}({},!1):void 0),check:r}},function(t,e,n){var i=n(17);i(i.S+i.F,"Object",{assign:n(125)})},function(t,e,n){var i=n(17);i(i.S,"Object",{create:n(42)})},function(t,e,n){var i=n(17);i(i.S,"Object",{setPrototypeOf:n(126).set})},,,,,,,,,,,,,,,,,,,,function(t,e){function n(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}t.exports=n,n.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=0==(1&Math.floor(10*e))?t-n:t+n}return 0|Math.min(t,this.max)},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(t){this.ms=t},n.prototype.setMax=function(t){this.max=t},n.prototype.setJitter=function(t){this.jitter=t}},,,function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=n(105),r=i(o),s=n(172),a=i(s),c=n(173),u=i(c);e["default"]={DataApi:function(t){return new r["default"](t)},DataRtc:function(t){return new a["default"](t)},DataStats:function(t){return new u["default"](t)}},t.exports=e["default"]},,,,,,,,,,function(t,e){"use strict";function n(t){i(t.enable)&&(this.enable=t.enable?1:0),i(t.needBadge)&&(this.needBadge=t.needBadge?1:0),i(t.needPushNick)&&(this.needPushNick=t.needPushNick?1:0),i(t.pushContent)&&(this.pushContent=""+t.pushContent),i(t.custom)&&(this.custom=""+t.custom),i(t.pushPayload)&&(this.pushPayload=""+t.pushPayload),i(t.sound)&&(this.sound=""+t.sound),i(t.webrtcEnable)&&(this.webrtcEnable=t.webrtcEnable?1:0)}e.__esModule=!0,e["default"]=function(t){var e=t.util;return i=e.notundef,n};var i=void 0;t.exports=e["default"]},,,,,,,,,,function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=n(6),r=i(o),s=n(41),a=n(13),c=a.info.nrtcVersion,u="https://statistic.live.126.net/statistic/realtime/sdkinfo",l=function f(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,r["default"])(this,f);var e=t.appkey;this.infos={},this.userlist=[],this.localVolumn=0,this.local={},this.remote={},this.init(e),this.resetStatus()};e["default"]=l;var d=l.prototype;d.init=function(t){this.infos=Object.assign(this.infos,{ver:1,device:-1,isp:-1,platform:h.convertPlatform(platform.os.family)+"-"+platform.os.version,browser:platform.name+"-"+platform.version,sdk_ver:c||"3.6.0",appkey:t,interval:60,samples:30,time:null,qos_algorithm:-1,fec_algorithm:-1,qos_scene:-1,qos_strategy:-1})},d.resetStatus=function(){this.infos=Object.assign(this.infos,{uid:null,cid:null,push_url:null,turn_ip:null,proxy_ip:null,meeting:!1,live:!1}),this.clearInfoData(),this.uidSsrcMap={},this.userlist=[]},d.initInfoData=function(t){var e={uid:t,cid:this.imInfo&&this.imInfo.channelId||-1,push_url:this.sessionConfig&&this.sessionConfig.rtmpUrl||-1,turn_ip:this.imInfo&&this.imInfo.turnMap||-1,proxy_ip:this.imInfo&&this.imInfo.turnMap||-1,meeting:/^meeting$/gi.test(this.imInfo.sessionMode),live:this.sessionConfig&&this.sessionConfig.liveEnable||!1,p2p:!1,isp:-1,net:-1,connect_state:this.imInfo&&this.imInfo.code||200,signalling_time:(this.sessionConfig&&this.sessionConfig.signalEndTime||0)-(this.sessionConfig&&this.sessionConfig.signalStartTime||0),connect_time:(this.sessionConfig&&this.sessionConfig.rtcEndTime||0)-(this.sessionConfig&&this.sessionConfig.rtcStartTime||0)};this.infos=Object.assign(this.infos,e)},d.clearInfoData=function(){this.localVolumn=0,this.infos=Object.assign(this.infos,{rx:{audio:[],video:[]},tx:{a_lost:[],v_lost:[],rtt:[],rtt_mdev:[],set_v_fps:[],qos_v_fps:[],v_fps:[],set_v_quality:[],real_v_res:[],real_v_kbps:[],real_v_kbps_n:[],real_a_kbps:[],real_a_kbps_n:[],set_v_kbps:[],qos_v_kbps:[],tx_bw_kbps:[],a_volume:[]}})},d.start=function(t){var e=this,n=t.info,i=t.imInfo,o=t.remoteUidMsidMap,r=t.sessionConfig,s=t.rtcConnection,a=t.uid;i&&o&&s&&(this.infos.appkey=n.appKey||n.appkey||this.infos.appkey,this.imInfo=i||{},this.remoteUidMsidMap=o||{},this.sessionConfig=r||{},this.rtcConnection=s,this.videoConfig=t.videoConfig||{},this.statsTimer||(this.getTurnMap(),this.initInfoData(a),this.format(),this.statsTimer=setInterval(function(){e.sendInfo()},1e3*this.infos.interval)))},
d.stop=function(){this.statsTimer&&(clearInterval(this.statsTimer),this.statsTimer=null,this.resetStatus())},d.update=function(t){this.rtcStats=t,this.format(),this.updateRxMediaInfo(),this.updateTxMediaInfo()},d.updateOnce=function(t){var e=t.imInfo,n=t.remoteUidMsidMap,i=t.sessionConfig,o=t.rtcConnection;e&&(this.imInfo=e||{},this.remoteUidMsidMap=n||{},this.sessionConfig=i||{},this.rtcConnection=o||{},this.videoConfig=t.videoConfig||{},this.getTurnMap(),this.initInfoData(),this.sendInfo())},d.updateLocalVolumn=function(t){this.localVolumn=t},d.updateRxMediaInfo=function(){var t=this,e={u:[],g:[],c:[],bn:[],bc:[]},n={u:[],i:[],bn:[],bc:[],r:[],f:[]};this.userlist.map(function(i){var o=t.getMediaStats(i);e.u.push(o.audio.u),e.g.push(-1),e.c.push(-1),e.bn.push(o.audio.bn),e.bc.push(o.audio.bc),n.u.push(o.video.u),n.i.push(o.video.i),n.bn.push(o.video.bn),n.bc.push(o.video.bc),n.r.push(o.video.r),n.f.push(o.video.f)}),this.infos.rx.audio.push(e),this.infos.rx.video.push(n)},d.getMediaStats=function(t){var e=this.rtcStats,n={audio:{u:+t,g:-1,c:-1,bn:0,bc:0},video:{u:+t,i:-1,bn:0,bc:0,r:-1,f:0}},i={},o=this.uidSsrcMap[t];if(!o)return n;o=o.join("|");var r=new RegExp("("+o+")");return e.results.filter(function(t){return r.test(t.ssrc)&&(i[t.mediaType]=t),r.test(t)}),i.audio&&(n.audio.bn=(i.audio.availableBandwidth||0)-0,n.audio.bc=-1),i.video&&(n.video.bn=(i.video.availableBandwidth||0)-0,n.video.bc=i.video.googFrameWidthReceived+"x"+i.video.googFrameHeightReceived,n.video.f=(i.video.googFrameRateDecoded||0)-0),n},d.getLocalMediaStats=function(){var t=this.rtcStats,e={a_lost:-1,v_lost:-1,rtt:0,rtt_mdev:-1,set_v_fps:this.videoConfig.frameRate||0,qos_v_fps:0,v_fps:0,set_v_quality:this.sessionConfig.videoQuality,real_v_res:0,real_v_kbps:0,real_v_kbps_n:0,real_a_kbps:-1,real_a_kbps_n:0,set_v_kbps:-1,qos_v_kbps:0,tx_bw_kbps:0,a_volume:0},n={},i=this.imInfo.uid,o=this.uidSsrcMap[i];if(!o)return e;o=o.join("|");var r=new RegExp("("+o+")");return t.results.filter(function(t){return t.localCandidateId?void(n.rtt=t):(r.test(t.ssrc)&&(n[t.mediaType]=t),r.test(t))}),n.audio&&(e.real_a_kbps_n=(n.audio.availableBandwidth||t.audio.send.availableBandwidth)-0,e.a_volume=this.localVolumn-0),n.video&&(e.qos_v_fps=n.video.googFrameRateInput-0,e.v_fps=n.video.googFrameRateSent-0,e.real_v_res=n.video.googFrameWidthSent+"x"+n.video.googFrameHeightSent,e.real_v_kbps=n.video.googEncodeUsagePercent-0,e.real_v_kbps_n=n.video.availableBandwidth-0),e.rtt=n.rtt.googRtt-0,e.tx_bw_kbps=(t.connectionType.bitsSentPerSecond||0)-0,e},d.updateTxMediaInfo=function(){var t=this.getLocalMediaStats(),e=this.infos.tx;for(var n in t)e[n].push(t[n]);this.infos.net=h.convertNetwork(this.rtcStats.connectionType.local.networkType[0])},d.getTurnMap=function(){var t=this.imInfo;t.serverMap&&(t.turnMap=JSON.parse(t.serverMap||null),t.turnMap=t.turnMap&&t.turnMap.turnaddrs,t.turnMap=t.turnMap&&t.turnMap[0],t.turnMap=t.turnMap.constructor===Array?t.turnMap[0]:t.turnMap,t.turnMap=t.turnMap&&t.turnMap.match(/\d+\.\d+.\d+\.\d+/),t.turnMap=t.turnMap[0])},d.getSsrc=function(t,e){var n=[],i={audio:this.getTypeSsrc("audio",t,e),video:this.getTypeSsrc("video",t,e)};return i.audio&&n.push(i.audio),i.video&&n.push(i.video),n},d.getTypeSsrc=function(t,e,n){var i=void 0,o="";if(i=new RegExp(t+"[.\\r\\n\\s\\S]*ssrc:(\\d+)\\smsid:"+e),o=n.match(i),o=o&&o[0])return i=new RegExp("ssrc:\\d+\\smsid:"+e),o=o.match(i),o=o.map(function(t){return i=new RegExp("ssrc:(\\d+)\\s"),t=t.match(i),t[1]})},d.format=function(){this.formatLocal(),this.formatRemote()},d.formatLocal=function(){this.localSdp=this.rtcConnection.localDescription,this.localStream=this.rtcConnection.getLocalStreams()[0],this.localStream&&(this.uidSsrcMap[this.imInfo.uid]=this.getSsrc(this.localStream.id,this.localSdp.sdp),this.local.ssrc=this.uidSsrcMap[this.imInfo.uid])},d.formatRemote=function(){this.remoteSdp=this.rtcConnection.remoteDescription,this.userlist=[];var t=this.remoteUidMsidMap;for(var e in t)this.userlist.push(e),this.remote[e]={},this.uidSsrcMap[e]=this.getSsrc(t[e],this.remoteSdp.sdp),this.remote[e].ssrc=this.uidSsrcMap[e]},d.sendInfo=function(){var t=this;this.infos.uid&&this.infos.cid&&(this.infos.time=Date.now(),this.infos.samples=this.infos.rx.audio.length,(0,s.ajax)({type:"post",url:u,data:this.infos}).then(function(e){t.clearInfoData()})["catch"](function(e){t.clearInfoData()}))};var h={convertNetwork:function(t){var e={wlan:"wifi",lan:"ethernet"};return e[t]||"unknown"},convertPlatform:function(t){var e=/Windows/i,n=/OS X/i,i=void 0;return i=e.test(t)&&"Win"||t,i=n.test(i)&&"Mac"||i}};t.exports=e["default"]},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}e.__esModule=!0;var o=n(6),r=i(o),s=n(41),a=n(13),c=a.info.nrtcVersion,u="//statistic.live.126.net/webrtc/stat",l=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,r["default"])(this,t);var n=e.appkey;this.infos={},this.init(n),this.resetStatus()}return t.prototype.resetStatus=function(){},t.prototype.init=function(t){this.infos=Object.assign(this.infos,{interval:60,ver:1,platform:d.convertPlatform(platform.os.family)+"-"+platform.os.version,browser:platform.name+"-"+platform.version,sdk_ver:c||"3.6.0",uid:null,appkey:t,time:null,data:{}})},t.prototype.clear=function(){this.infos.data={}},t.prototype.start=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.infos.appkey=e.appKey||e.appkey||this.infos.appkey,this.infos.cid=e.cid,this.infos.uid=e.uid,this.statsTimer||(this.statsTimer=setInterval(function(){t.send()},1e3*this.infos.interval))},t.prototype.stop=function(){this.statsTimer&&(clearInterval(this.statsTimer),this.statsTimer=null,this.clear())},t.prototype.update=function(t){this.infos.data["stat_"+Date.now()]=t},t.prototype.send=function(){var t=this;0!==Object.keys(this.infos.data).length&&(this.infos.time=Date.now(),(0,s.ajax)({type:"post",url:u,data:this.infos}).then(function(e){t.clear()})["catch"](function(t){console.log("err",t)}))},t}();e["default"]=l;var d={convertNetwork:function(t){var e={wlan:"wifi",lan:"ethernet"};return e[t]||"unknown"},convertPlatform:function(t){var e=/Windows/i,n=/OS X/i,i=void 0;return i=e.test(t)&&"Win"||t,i=n.test(i)&&"Mac"||i}};t.exports=e["default"]},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e){"use strict";e.__esModule=!0;var n,i,o={NETCALL_TYPE_AUDIO:1,NETCALL_TYPE_VIDEO:2,NETCALL_CONTROL_COMMAND_NOTIFY_AUDIO_ON:1,NETCALL_CONTROL_COMMAND_NOTIFY_AUDIO_OFF:2,NETCALL_CONTROL_COMMAND_NOTIFY_VIDEO_ON:3,NETCALL_CONTROL_COMMAND_NOTIFY_VIDEO_OFF:4,NETCALL_CONTROL_COMMAND_SWITCH_AUDIO_TO_VIDEO:5,NETCALL_CONTROL_COMMAND_SWITCH_AUDIO_TO_VIDEO_AGREE:6,NETCALL_CONTROL_COMMAND_SWITCH_AUDIO_TO_VIDEO_REJECT:7,NETCALL_CONTROL_COMMAND_SWITCH_VIDEO_TO_AUDIO:8,NETCALL_CONTROL_COMMAND_BUSY:9,NETCALL_CONTROL_COMMAND_SELF_CAMERA_INVALID:10,NETCALL_CONTROL_COMMAND_SELF_AUDIO_INVALID:11,NETCALL_CONTROL_COMMAND_SELF_ON_BACKGROUND:12,NETCALL_CONTROL_COMMAND_START_NOTIFY_RECEIVED:13,NETCALL_CONTROL_COMMAND_NOTIFY_RECORD_START:14,NETCALL_CONTROL_COMMAND_NOTIFY_RECORD_STOP:15,DEVICE_TYPE_AUDIO_IN:0,DEVICE_TYPE_AUDIO_OUT_LOCAL:1,DEVICE_TYPE_AUDIO_OUT_CHAT:2,DEVICE_TYPE_VIDEO:3,DEVICE_STATUS_NO_CHANGE:0,DEVICE_STATUS_CHANGE:1,DEVICE_STATUS_WORK_REMOVE:2,DEVICE_STATUS_RESET:4,DEVICE_STATUS_START:8,DEVICE_STATUS_END:16,CHAT_VIDEO_QUALITY_NORMAL:0,CHAT_VIDEO_QUALITY_LOW:1,CHAT_VIDEO_QUALITY_MEDIUM:2,CHAT_VIDEO_QUALITY_HIGH:3,CHAT_VIDEO_QUALITY_480P:4,CHAT_VIDEO_QUALITY_720P:5,CHAT_VIDEO_QUALITY_540P:6,CHAT_VIDEO_ENCODEMODE_NORMAL:0,CHAT_VIDEO_ENCODEMODE_SMOOTH:1,CHAT_VIDEO_ENCODEMODE_QUALITY:2,CHAT_VIDEO_ENCODEMODE_SCREEN:3,CHAT_VIDEO_FRAME_RATE_NORMAL:0,CHAT_VIDEO_FRAME_RATE_5:1,CHAT_VIDEO_FRAME_RATE_10:2,CHAT_VIDEO_FRAME_RATE_15:3,CHAT_VIDEO_FRAME_RATE_20:4,CHAT_VIDEO_FRAME_RATE_25:5,CHAT_VIDEO_SCALE_None:0,CHAT_VIDEO_SCALE_1x1:1,CHAT_VIDEO_SCALE_4x3:2,CHAT_VIDEO_SCALE_16x9:3,CHAT_USER_LEFT_TIMEOUT:-1,CHAT_USER_LEFT_NORMAL:0,CHAT_NET_STATUS_VERY_GOOD:0,CHAT_NET_STATUS_GOOD:1,CHAT_NET_STATUS_POOR:2,CHAT_NET_STATUS_BAD:3,CHAT_NET_STATUS_VERY_BAD:4,CLIENT_TYPE_AOS:1,CLIENT_TYPE_IOS:2,CLIENT_TYPE_PC:4,CLIENT_TYPE_WINPHONE:8,CLIENT_TYPE_WEB:16,CLIENT_TYPE_REST:32,LAYOUT_SPLITBOTTOMHORFLOATING:0,LAYOUT_SPLITTOPHORFLOATING:1,LAYOUT_SPLITLATTICETILE:2,LAYOUT_SPLITLATTICECUTTINGTILE:3,LAYOUT_SPLITCUSTOMLAYOUT:4,LAYOUT_SPLITAUDIOLAYOUT:5,NETDETECT_AUDIO:0,NETDETECT_VIDEO:1};o.deviceTypeMap=(n={},n[o.DEVICE_TYPE_AUDIO_IN]="audioIn",n[o.DEVICE_TYPE_AUDIO_OUT_CHAT]="audioOut",n[o.DEVICE_TYPE_VIDEO]="video",n),o.getDeviceTypeStr=function(t){return o.deviceTypeMap[t]},o.deviceStatusMap=(i={},i[o.DEVICE_STATUS_NO_CHANGE]="noChange",i[o.DEVICE_STATUS_CHANGE]="change",i[o.DEVICE_STATUS_WORK_REMOVE]="workRemove",i[o.DEVICE_STATUS_RESET]="reset",i[o.DEVICE_STATUS_START]="start",i[o.DEVICE_STATUS_END]="end",i),o.getDeviceStatusStr=function(t){return o.deviceStatusMap[t]},e["default"]=o,t.exports=e["default"]},,,,,,,,,,,,,,,,function(t,e,n){"use strict";var i=n(162),o={};o.install=function(t){var e=t.fn,n=t.util,o=i({util:n});e.initNetcall=function(t){return n.verifyOptions(t,"type accounts","netcall::initNetcall"),t.pushContent="",t.custom="",t.pushConfig||(t.pushConfig={}),t.pushConfig.webrtcEnable=t.webrtcEnable,t.pushConfig=new o(t.pushConfig),this.cbAndSendCmd("initNetcall",t)},e.keepCalling=function(t){return n.verifyOptions(t,"type accounts channelId","netcall::keepCalling"),this.cbAndSendCmd("keepCalling",t)},e.calleeAck=function(t){return n.verifyOptions(t,"account channelId type accepted","netcall::calleeAck"),this.cbAndSendCmd("calleeAck",t)},e.hangup=function(t){return n.verifyOptions(t,"channelId","netcall::hangup"),this.cbAndSendCmd("hangup",t)},e.netcallControl=function(t){return n.verifyOptions(t,"channelId type","netcall::netcallControl"),this.cbAndSendCmd("netcallControl",t)},e.createChannel=function(t){return this.cbAndSendCmd("createChannel",t)},e.joinChannel=function(t){return n.verifyOptions(t,"channelName","netcall::joinChannel"),n.verifyBooleanWithDefault(t,"liveEnable",!1,"","netcall::joinChannel"),n.verifyBooleanWithDefault(t,"webrtcEnable",!1,"","netcall::joinChannel"),this.cbAndSendCmd("joinChannel",{channelName:t.channelName,liveOption:{liveEnable:t.liveEnable?1:0,webrtcEnable:t.webrtcEnable?1:0}})},e.queryAccountUidMap=function(t,e){return this.cbAndSendCmd("queryAccountUidMap",{channelName:t,uids:e})}},t.exports=o},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e){"use strict";var n={};n.install=function(t){var e=t.Protocol.fn;e.processNetcall=function(t){switch(t.cmd){case"initNetcall":this.onInitNetcall(t);break;case"beCalled":this.onBeCalled(t);break;case"keepCalling":this.onKeepCalling(t);break;case"calleeAck":break;case"notifyCalleeAck":this.onNotifyCalleeAck(t);break;case"hangup":break;case"notifyHangup":this.onNotifyHangup(t);break;case"notifyNetcallControl":this.onNetcallControl(t);break;case"notifyCalleeAckSync":this.onNotifyCalleeAckSync(t);break;case"notifyNetcallRecord":this.onMsg(t);break;case"createChannel":break;case"joinChannel":this.joinChannel(t);break;case"notifyJoin":this.notifyJoin(t)}},e.onInitNetcall=function(t){if(!t.error){var e=t.obj.type;t.obj=t.content,t.obj.type=e,t.obj.accounts=t.obj.keepCallingAccounts,this.setCurrentNetcall(t.obj.channelId),this.keepCalling(t)}},e.setCurrentNetcall=function(t){this.currentNetcallChannelId=t},e.onKeepCalling=function(t){t.error||t.content.accounts.length&&this.keepCalling(t)},e.keepCalling=function(t){var e=this,n=t.obj,i=n.type,o=n.accounts,r=n.channelId;o&&o.length&&setTimeout(function(){e.currentNetcallChannelId&&e.currentNetcallChannelId===r&&e.api.keepCalling({type:i,accounts:o,channelId:r})["catch"](function(){})},3e3)},e.onBeCalled=function(t){t.error||this.emitAPI({type:"beCalled",obj:t.content})},e.onNotifyCalleeAck=function(t){t.error||this.emitAPI({type:"notifyCalleeAck",obj:t.content})},e.onNotifyHangup=function(t){t.error||this.emitAPI({type:"notifyHangup",obj:t.content})},e.onNetcallControl=function(t){t.error||this.emitAPI({type:"netcallControl",obj:t.content})},e.onNotifyCalleeAckSync=function(t){t.error||this.emitAPI({type:"notifyCalleeAckSync",obj:t.content})},e.notifyJoin=function(t){t.error||this.emitAPI({type:"notifyJoin",obj:t.content})},e.joinChannel=function(t){t.obj=t.content}},t.exports=n},,,,,,,,,function(t,e){"use strict";var n=9,i={netcall:{id:n,initNetcall:1,keepCalling:3,calleeAck:4,notifyCalleeAck:5,hangup:6,notifyHangup:7,netcallControl:8,notifyNetcallControl:9,verifyChannelId:10,createChannel:13,joinChannel:14,queryAccountUidMap:16}},o={initNetcall:{sid:n,cid:i.netcall.initNetcall,params:[{type:"byte",name:"type"},{type:"StrArray",name:"accounts"},{type:"String",name:"pushContent"},{type:"String",name:"custom"},{type:"Property",name:"pushConfig"}]},keepCalling:{sid:n,cid:i.netcall.keepCalling,params:[{type:"byte",name:"type"},{type:"StrArray",name:"accounts"},{type:"long",name:"channelId"}]},calleeAck:{sid:n,cid:i.netcall.calleeAck,params:[{type:"string",name:"account"},{type:"long",name:"channelId"},{type:"byte",name:"type"},{type:"bool",name:"accepted"}]},hangup:{sid:n,cid:i.netcall.hangup,params:[{type:"long",name:"channelId"}]},netcallControl:{sid:n,cid:i.netcall.netcallControl,params:[{type:"long",name:"channelId"},{type:"byte",name:"type"}]},verifyChannelId:{sid:n,cid:i.netcall.verifyChannelId,params:[{type:"long",name:"channelId"},{type:"String",name:"account"}]},createChannel:{sid:n,cid:i.netcall.createChannel,params:[{type:"String",name:"channelName"},{type:"String",name:"custom"},{type:"String",name:"webrtcEnable"}]},joinChannel:{sid:n,cid:i.netcall.joinChannel,params:[{type:"String",name:"channelName"},{type:"Property",name:"liveOption"}]},queryAccountUidMap:{sid:n,cid:i.netcall.queryAccountUidMap,params:[{type:"String",name:"channelName"},{type:"LongArray",name:"uids"}]}},r="netcall",s={"9_1":{service:r,cmd:"initNetcall",response:[{type:"Number",name:"timetag"},{type:"Number",name:"uid"},{type:"Number",name:"channelId"},{type:"StrArray",name:"turnServerList"},{type:"StrArray",name:"sturnServerList"},{type:"StrArray",name:"proxyServerList"},{type:"StrArray",name:"keepCallingAccounts"},{type:"StrLongMap",name:"accountUidMap"},{type:"String",name:"clientConfig"},{type:"String",name:"serverMap"}]},"9_2":{service:r,cmd:"beCalled",response:[{type:"Number",name:"timetag"},{type:"Number",name:"type"},{type:"Number",name:"channelId"},{type:"String",name:"account"},{type:"Number",name:"uid"},{type:"StrArray",name:"turnServerList"},{type:"StrArray",name:"sturnServerList"},{type:"StrArray",name:"proxyServerList"},{type:"StrLongMap",name:"accountUidMap"},{type:"String",name:"clientConfig"},{type:"String",name:"custom"},{type:"Property",name:"pushConfig"},{type:"String",name:"serverMap"}]},"9_3":{service:r,cmd:"keepCalling",response:[{type:"StrArr",name:"accounts"}]},"9_4":{service:r,cmd:"calleeAck",response:[]},"9_5":{service:r,cmd:"notifyCalleeAck",response:[{type:"String",name:"account"},{type:"long",name:"channelId"},{type:"byte",name:"type"},{type:"bool",name:"accepted"}]},"9_6":{service:r,cmd:"hangup",response:[]},"9_7":{service:r,cmd:"notifyHangup",response:[{type:"long",name:"channelId"},{type:"String",name:"account"},{type:"long",name:"timetag"}]},"9_8":{service:r,cmd:"netcallControl",response:[]},"9_9":{service:r,cmd:"notifyNetcallControl",response:[{type:"String",name:"account"},{type:"byte",name:"type"},{type:"long",name:"channelId"}]},"9_10":{service:r,cmd:"verifyChannelId",response:[]},"9_11":{service:r,cmd:"notifyNetcallRecord",response:[{type:"Property",name:"msg"}]},"9_12":{service:r,cmd:"notifyCalleeAckSync",response:[{type:"String",name:"timetag"},{type:"long",name:"channelId"},{type:"byte",name:"type"},{type:"bool",name:"accepted"},{type:"byte",name:"fromClientType"}]},"9_13":{service:r,cmd:"createChannel",response:[{type:"long",name:"timetag"}]},"9_14":{service:r,cmd:"joinChannel",response:[{type:"long",name:"timetag"},{type:"long",name:"channelId"},{type:"StrLongMap",name:"accountUidMap"},{type:"String",name:"serverMap"},{type:"String",name:"clientConfig"},{type:"String",name:"custom"}]},"9_15":{service:r,cmd:"notifyJoin",response:[{type:"Long",name:"channelId"},{type:"StrLongMap",name:"accountUidMap"}]},"9_16":{service:r,cmd:"queryAccountUidMap",response:[]}};t.exports={idMap:i,cmdConfig:o,packetConfig:s}},function(t,e){"use strict";t.exports={pushConfig:{enable:1,needBadge:2,needPushNick:3,pushContent:4,custom:5,pushPayload:6,sound:7,webrtcEnable:10},liveOption:{liveEnable:1,webrtcEnable:2}}},function(t,e){"use strict";t.exports={pushConfig:{1:"enable",2:"needBadge",3:"needPushNick",4:"pushContent",5:"custom",6:"pushPayload",7:"sound",10:"webrtcEnable"},liveOption:{1:"liveEnable",2:"webrtcEnable"}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var o=n(98),r=i(o),s=n(6),a=i(s),c=n(16),u=i(c),l=n(15),d=i(l),h=n(41),f=n(152),p=void 0,v=void 0,m=n(19),_=n(351),g=n(13),y=n(352),C=n(353),T=n(342),A=n(203),S=g.agentVersion,b=function(t){function e(n){(0,a["default"])(this,e);var i=(0,u["default"])(this,t.call(this));return n.container=h.element.n2node(n.container),n.remoteContainer=h.element.n2node(n.remoteContainer),i.setUtil(p),p.undef(n.heartbeat)&&(n.heartbeat=!0),p.merge(i,n),i.init(),i}return(0,d["default"])(e,t),e}(m);b.install=function(t){p=t.util,v=t.Promise,y.install(t),C.install(t),T.install(t)};var E=b.prototype;E.init=function(){this.signal=null,this.signalInited=!1,this.localStreamInfo=null,this.resetStatus(),this.initProtocol(),this.dataApi=(0,f.DataApi)({appkey:this.nim.options.appKey,platform:"PC-Agent"})},E.resetStatus=function(){this.channelId=null,this.channelName=null,this.type=null,this.target=null,this.sessionMode=null,this.sessionConfig={},this.isCaller=!1,this.callee=null,this.remoteStreamInfo={},this.calling=!1,this.callAccepted=!1,this.callerInfo=null,this.nim.protocol.setCurrentNetcall(),this.needQueryAccountMap={}},E.initProtocol=function(){var t=this.nim;this.account=this.nim.account,t.on("beCalled",this.onBeCalled.bind(this)),t.on("notifyCalleeAck",this.onCalleeAck.bind(this)),t.on("notifyHangup",this.onHangup.bind(this)),t.on("notifyUploadLog",this.uploadLog.bind(this)),t.on("netcallControl",this.onNetcallControl.bind(this)),t.on("notifyCalleeAckSync",this.onCalleeAckSync.bind(this)),t.on("notifyJoin",this.onNotifyJoin.bind(this))},E.getAccount=function(){return this.nim.account},E.getUid=function(){return this.accountUidMap?this.accountUidMap[this.nim.account]||"-1":"-1"},E.isCurrentChannelId=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.channelId&&this.channelId===t.channelId},E.notCurrentChannelId=function(t){return!this.isCurrentChannelId(t)},E.rejectWithNoSignal=function(){return this.resetWhenHangup(),v.reject({code:"noConnection"})},E.initSignal=function(){var t=this;return this.signal?this.stopSignal().then(function(){return t._initSignal()}):this._initSignal()},E._initSignal=function(){var t=this;return new v(function(e,n){var i=t.signal=new y({url:_.signalUrl,client:t,kickLast:t.kickLast,account:t.getAccount(),heartbeat:t.heartbeat,appkey:t.nim.options.appKey});i.on("init",function(i){return t.log(i),t.checkAgentVersion(i.version)?(t.localStreamInfo=i,t.signalInited=!0,void e()):(t.log("插件版本有更新,请下载最新的插件再使用音视频功能"),t.stopSignal(),i.error="请安装最新版插件,方可使用视频功能",i.errorType="agent_update",void n(i))}),i.on("initError",function(e){t.log(e),e=e||{},417===e.code&&(e.error="设备被别的程序占用中, 请检查重试",e.errorType="device_busy"),"noPC"===e.code&&(e.error="请安装插件PC Agent,方可使用音视频功能",e.errorType="agent_empty"),n(e),t.rejectWithNoSignal()}),i.on("close",function(){t.emit("signalClosed"),t.stopSignal()}),i.on("devices",function(e){t.emit("devices",e)}),i.on("login",function(e){t.emit("sessionStarted",e)}),i.on("deviceStatus",function(e){t.emit("deviceStatus",e)}),i.on("userJoined",t.onUserJoin.bind(t)),i.on("userLeft",t.onUserLeft.bind(t)),i.on("logUploaded",t.onLogUploaded.bind(t)),i.on("netStatus",function(e){var n=e.id,i=e.status;t.emit("netStatus",{account:t.getAccountWithUid(n),status:i})}),i.on("statistics",function(e){t.emit("statistics",e)}),i.on("audioVolume",function(e){var n=e.self,i=e.receiver,o={self:n};i&&i.forEach(function(e){var n=e.id,i=e.status;o[t.getAccountWithUid(n)]={status:i}}),t.emit("audioVolume",o)}),i.on("error",t.onError.bind(t)),i.on("recordMp4",t.onRecordMp4.bind(t)),i.on("heartBeatError",t.onError.bind(t))})},E.checkAgentVersion=function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"0.0.0.0",e=t.split("."),n=S.split("."),i=0;i<e.length;i++){if(+e[i]>+n[i])return!0;if(+e[i]<+n[i])return!1}return!0},E.stopSignal=function(){var t=this;return this.stopLocalStream(),this.stopRemoteStream(),this.signal?this.signal.stopSession().then(function(){t.signal.destroy(),t.signal=null,t.signalInited=!1}):v.resolve()},E.initNetcall=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.type,i=e.pushConfig;return this.type=n,this.sessionMode="p2p",this.nim.initNetcall({type:n,accounts:[this.callee],webrtcEnable:!0,pushConfig:i}).then(function(e){return t.callerInfo=e,t.channelId=e.channelId,v.resolve(e)},function(e){throw t.resetWhenHangup(),e})},E.initSession=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.signalInited){var n=this.isCaller?this.callerInfo:e.beCalledInfo;this.parseAccountUidMap(n.accountUidMap);var i=this.sessionConfig||{};return i.awc&&this.dataApi.update({key:"awc"}),i.ans&&this.dataApi.update({key:"ans"}),i.aec&&this.dataApi.update({key:"aec"}),this.signal.startSession((0,r["default"])({},n,i)).then(function(){return{channelId:t.channelId}})}return this.rejectWithNoSignal()},E.call=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.dataApi.update("p2p"),new v(function(n,i){if(!t.signalInited||t.calling)return t.resetStatus(),i({type:"statusNotMatch",error:"呼叫失败: 当前正在通话中或者Agent唤起失败,请排查"});var o=e.account,r=e.type,s=e.pushConfig,a=e.sessionConfig,c=void 0===a?{}:a;if(t.calling=!0,t.isCaller=!0,t.callee=t.target=o,t.sessionConfig=c,c.highAudio&&t.dataApi.update("hd_audio"),void 0!==c.videoFrameRate&&t.dataApi.update("fps",0===+c.videoFrameRate?0:+c.videoFrameRate+1),void 0!==c.videoEncodeMode&&t.dataApi.update("video_adaptive_strategy",c.videoEncodeMode||0),void 0!==c.videoBitrate&&t.dataApi.update("video_max_encode_bitrate",c.videoBitrate||""),void 0!==c.videoQuality){var u=c.videoQuality;u===A.CHAT_VIDEO_QUALITY_540P?u=A.CHAT_VIDEO_QUALITY_720P:u===A.CHAT_VIDEO_QUALITY_720P&&(u=A.CHAT_VIDEO_QUALITY_540P),t.dataApi.update("video_quality",u||0)}return o?t.initNetcall({type:r,pushConfig:s}).then(function(t){n(t)})["catch"](function(t){i(t)}):(t.resetStatus(),void i({code:"noCalleeAccount"}))})},E.onBeCalled=function(t){this.log("beCalling",t),this.emit("beCalling",t)},E.response=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.dataApi.update("p2p");var n=e.beCalledInfo;if(!n)return v.resolve();var i=n.accepted=e.accepted!==!1,o=this.sessionConfig=e.sessionConfig||{};if(o.highAudio&&this.dataApi.update("hd_audio"),void 0!==o.videoFrameRate&&this.dataApi.update("fps",0===+o.videoFrameRate?0:+o.videoFrameRate+1),void 0!==o.videoEncodeMode&&this.dataApi.update("video_adaptive_strategy",o.videoEncodeMode||0),void 0!==o.videoBitrate&&this.dataApi.update("video_max_encode_bitrate",o.videoBitrate||""),void 0!==o.videoQuality){var r=o.videoQuality;r===A.CHAT_VIDEO_QUALITY_540P?r=A.CHAT_VIDEO_QUALITY_720P:r===A.CHAT_VIDEO_QUALITY_720P&&(r=A.CHAT_VIDEO_QUALITY_540P),this.dataApi.update("video_quality",r||0)}return i?(this.type=n.type,this.channelId=n.channelId,this.target=n.account,this.calling=!0):(this.log("rejectNetcall",n),this.packNetcallRecord({type:n.type,channelId:n.channelId,isCaller:!1,target:n.account,recordType:"rejectNetcall"})),this.sessionMode="p2p",this.nim.calleeAck(n).then(function(){if(i)return t.initSession({beCalledInfo:n})},function(e){throw t.log(e),e})},E.onCalleeAck=function(t){if(!this.notCurrentChannelId(t))return t.accepted?this.initSession({type:t.type}):(this.log("netcallRejected",t),this.packNetcallRecord({type:t.type,channelId:t.channelId,isCaller:!0,target:t.account,recordType:"netcallRejected"}),this.resetWhenHangup(),this.emit("callRejected",t),void 0)},E.onUserJoin=function(t){this.log("onUserJoin ",t);var e=t.account,n=t.uid;return!e&&n&&(t.account=e=this.getAccountWithUid(n)),e?void this.emitUserJoin(t):(this.needQueryAccountMap[n]=t,void this.nim.queryAccountUidMap(this.channelName,[n]))},E.emitUserJoin=function(t){var e=t.uid,n=t.isMeeting;this.remoteStreamInfo[e]=t,this.dataApi.start({uid:this.getUid()}),n?this.emit("joinChannel",{type:t.type,uid:t.uid,account:t.account}):(this.callAccepted||(this.callAccepted=!0),this.emit("callAccepted",{type:t.type,account:t.account,uid:t.uid}))},E.onUserLeft=function(t){var e=this,n=t.account,i=t.uid,o=t.isMeeting;o?(!n&&i&&(t.account=this.getAccountWithUid(i)),this.emit("leaveChannel",{account:t.account})):(this.log("on user left",t),this.calling&&setTimeout(function(){t.account=e.getAccountWithUid(t.uid),e.onHangup(t)},1e3))},E.onNetcallControl=function(t){this.emit("control",t)},E.onCalleeAckSync=function(t){this.emit("callerAckSync",t),this.isCurrentChannelId(t)&&this.resetWhenHangup()},E.onNotifyJoin=function(t){var e=t.accountUidMap,n=this.needQueryAccountMap;this.parseAccountUidMap(e);for(var i in e){var o=i,r=e[i];if(r in n){var s=n[r];s.account=o,this.emitUserJoin(s),delete n[r]}}},E.onHangup=function(t){this.dataApi.send(),this.emit("hangup",t),this.isCurrentChannelId(t)&&this.resetWhenHangup()},E.hangup=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.channelId;!e&&this.calling&&this.channelId&&(e=this.channelId),e&&(this.dataApi.send(),this.nim.hangup({channelId:e})),e===this.channelId&&(this.isCaller&&!this.callAccepted&&(this.log("cancelNetcallBeforeAccept",{channelId:e}),this.packNetcallRecord({recordType:"cancelNetcallBeforeAccept"})),this.resetWhenHangup())},E.packNetcallRecord=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.recordType,n=p.exist(t.type)?t.type:this.type,i=p.exist(t.channelId)?t.channelId:this.channelId,o=p.exist(t.duration)?t.duration:0,r=p.exist(t.isCaller)?t.isCaller:this.isCaller,s=p.exist(t.target)?t.target:this.target,a=this.getAccount(),c=r?a:s,u=r?s:a,l=+new Date;this.nim.protocol.onMsg({content:{msg:{attach:JSON.stringify({data:{calltype:n,channel:i,duration:o,ids:[a,s],time:l},id:e}),from:c,fromClientType:r?16:0,fromDeviceId:"",fromNick:"",idClient:p.guid(),idServer:p.guid(),scene:0,time:l,to:u,type:5}}})},E.resetWhenHangup=function(){this.resetStatus(),this.signalInited&&this.signal.stopSession()},E.control=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.command,i=e.channelId;if(i||(i=this.channelId),n&&i)return this.dataApi.update("call_control_type"),this.nim.netcallControl({channelId:i,type:n})["catch"](function(e){throw t.log(e),e})},E.setVideoViewSize=function(t){return this.signalInited?this.signal.setVideoViewSize(t):this.rejectWithNoSignal()},E.setVideoViewRemoteSize=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.signalInited?(t.account&&(t.id=this.getUidWithAccount(t.account)),this.signal.setVideoViewRemoteSize(t)):this.rejectWithNoSignal()},E.setVideoScale=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.signalInited?(t.account&&(t.id=this.getUidWithAccount(t.account)),this.signal.setVideoScale(t)):this.rejectWithNoSignal()},E.startLocalStream=function(t){var e=this;if(this.dataApi.update("display"),this.signalInited&&!this.stream&&this.localStreamInfo){var n=t||this.container,i=this.localStreamInfo.port;this.stream=new C({client:this,url:_.genStreamUrl(i),container:n,mirror:this.mirror}),this.stream.on("resize",function(t){e.emit("streamResize",t)}),this.stream.on("error",function(t){e.emit("error",t)})}},E.stopLocalStream=function(){this.stream&&(this.stream.destroy(),this.stream=null)},E.startRemoteStream=function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"p2p"===this.sessionMode?(t=this.getUidWithAccount(this.target),this.remoteContainer||this.target||this.nim.logger.error("不传参数且点对点模式实例化Netcall必须设置remoteContainer与target;传参数必须包含account,node"),!this.getRemoteStream(t)&&this.remoteStreamInfo[t]&&this.addRemoteStream(this.remoteStreamInfo[t])):(t=e.uid||this.getUidWithAccount(e.account),e.node=h.element.n2node(e.node),t&&e.node?this.addRemoteStream(this.remoteStreamInfo[t],e.node):this.nim.logger.error("不传参数且点对点模式实例化Netcall必须设置remoteContainer与target;传参数必须包含account,node"))},E.stopRemoteStream=function(t){return t?this.removeRemoteStream(t):this.removeRemoteStreams()},E.addRemoteStream=function(t,e){var n=this,i=t.uid,o=t.port;this.remoteStreams||(this.remoteStreams={});var r=this.remoteStreams[i];r&&r.destroy(),r=this.remoteStreams[i]=new C({client:this,isRemote:!0,url:_.genStreamUrl(o),container:e||this.remoteContainer,mirror:this.mirrorRemote}),r.on("resize",function(t){n.emit("remoteStreamResize",t)}),r.on("error",function(t){n.emit("error",t)})},E.removeRemoteStreams=function(){var t=this;this.remoteStreams&&Object.keys(this.remoteStreams).forEach(function(e){t.remoteStreams[e].destroy()}),this.remoteStreams={}},E.removeRemoteStream=function(t){var e=this.getUidWithAccount(t);if(!this.remoteStreams[e]){var n={code:"accountNotMatch"};throw n}this.remoteStreams[e].destroy()},E.getRemoteStream=function(t){var e=this.getUidWithAccount(t);return this.remoteStreams&&this.remoteStreams[e]},E.suspendLocalStream=function(){this.stream&&this.stream.suspend()},E.resumeLocalStream=function(){this.stream&&this.stream.resume()},E.suspendRemoteStream=function(t){var e=this.getRemoteStream(t||this.target);e&&e.suspend()},E.resumeRemoteStream=function(t){var e=this.getRemoteStream(t||this.target);e&&e.resume()},E.switchVideoToAudio=function(){var t=this;return this.signalInited?(this.dataApi.update("switch_p2p_type"),this.signal.switchVideoToAudio().then(function(){t.type=A.NETCALL_TYPE_AUDIO})):this.rejectWithNoSignal()},E.switchAudioToVideo=function(){var t=this;return this.signalInited?(this.dataApi.update("switch_p2p_type"),this.signal.switchAudioToVideo().then(function(){t.type=A.NETCALL_TYPE_VIDEO})):this.rejectWithNoSignal()},E.getDevicesOfType=function(t){return this.signalInited?this.signal.getDevicesOfType(t):this.rejectWithNoSignal()},E.getStoredDevicesOfType=function(t){return this.signalInited?(t=+t,t===A.DEVICE_TYPE_AUDIO_OUT_LOCAL&&(t=A.DEVICE_TYPE_AUDIO_OUT_CHAT),this.signal.devicesMap[t]):void this.rejectWithNoSignal()},E.hasDevicesOfType=function(t){return this.getStoredDevicesOfType(t)},E.getStartedDeviceOfType=function(t){return this.signalInited?this.signal.deviceMap[t]:this.rejectWithNoSignal()},E.hasStartedDeviceOfType=function(t){return this.getStartedDeviceOfType(t)},E.stopDevice=function(t){return this.signalInited?this.hasStartedDeviceOfType(t)?this.signal.stopDevice(t):v.resolve():this.rejectWithNoSignal()},E.startDevice=function(t){var e=t.type,n=t.device;if(this.signalInited){if(p.exist(e)&&!n){if(this.hasStartedDeviceOfType(e))return v.resolve();this.hasDevicesOfType(e)&&(n=t.device=this.getStoredDevicesOfType(e)[0])}return n?this.signal.startDevice(t):v.reject((0,r["default"])({type:"noDevice"},t))}return this.rejectWithNoSignal()},E.setSessionVideoQuality=function(t){if(this.signalInited){if(void 0!==t){var e=t;e===A.CHAT_VIDEO_QUALITY_540P?e=A.CHAT_VIDEO_QUALITY_720P:e===A.CHAT_VIDEO_QUALITY_720P&&(e=A.CHAT_VIDEO_QUALITY_540P),this.dataApi.update("video_quality",e||0)}return this.signal.setVideoQuality(t)}return this.rejectWithNoSignal()},E.setSessionVideoFrameRate=function(t){return this.signalInited?(this.dataApi.update("fps",void 0!==t?+t+1:0),this.signal.setVideoFrameRate(t)):this.rejectWithNoSignal();
},E.setSessionVideoBitrate=function(t){return this.signalInited?(this.dataApi.update("video_max_encode_bitrate",t||""),this.signal.setVideoBitrate(t)):this.rejectWithNoSignal()},E.setCaptureVolume=function(t){return t=void 0===t?255:t,t.constructor===String&&(t=+t||255),this.signalInited?this.signal.setCaptureVolume(t):this.rejectWithNoSignal()},E.setPlayVolume=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};/(Number|String)/.test(t.constructor)&&(t={volume:t});var e=t,n=e.volume;return n=void 0===n?255:n,this.signalInited?this.signal.setPlayVolume(n):this.rejectWithNoSignal()},E.netDetect=function(t,e){return this.dataApi.update({key:"net_detect"}),t=void 0===t?A.NETDETECT_AUDIO:t,e=e||A.CHAT_VIDEO_QUALITY_480P,this.signalInited?this.signal.netDetect({appKey:this.nim.options.appKey,type:t,quality:e}):this.rejectWithNoSignal()},E.uploadLog=function(){var t=this;this.signalInited&&this.nim.getSimpleNosToken().then(function(e){t.signal.uploadLog(e)},function(e){t.log(e)})},E.onLogUploaded=function(t){this.nim.uploadSdkLogUrl(t)},E.log=function(){var t=this.nim.logger;t.log.apply(t,arguments)},E.info=function(){var t=this.nim.logger;t.info.apply(t,arguments)},E.parseAccountUidMap=function(t){var e=this;Object.keys(t).forEach(function(n){e.addAccountUidMap({account:n,uid:t[n]})})},E.addAccountUidMap=function(t){var e=t.account,n=t.uid;this.uidAccountMap||(this.uidAccountMap={}),this.uidAccountMap[n]=e,this.accountUidMap||(this.accountUidMap={}),this.accountUidMap[e]=n},E.getAccountWithUid=function(t){if(this.uidAccountMap)return this.uidAccountMap[t]},E.getUidWithAccount=function(t){if(this.accountUidMap)return this.accountUidMap[t]},E.onError=function(t){this.emit("error",t)},E.setAudioBlack=function(t){var e=this.getUidWithAccount(t);if(e)return this.signal.setAudioBlack(this.getUidWithAccount(t),1);var n={code:"accountNotMatch"};return v.reject(n)},E.setAudioStart=function(t){var e=this.getUidWithAccount(t);if(e)return this.signal.setAudioBlack(this.getUidWithAccount(t),0);var n={code:"accountNotMatch"};return v.reject(n)},E.setVideoBlack=function(t){return this.signal.setVideoBlack(this.getUidWithAccount(t),1)},E.setVideoShow=function(t){return this.signal.setVideoBlack(this.getUidWithAccount(t),0)},E.startRecordMp4=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.dataApi.update({key:"record"}),p.verifyOptions(t,"path"),t.account&&(t.id=t.account===this.account?0:this.getUidWithAccount(t.account)),this.signal.startRecordMp4(t)},E.stopRecordMp4=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.account&&(t.id=t.account===this.account?0:this.getUidWithAccount(t.account)),this.signal.stopRecordMp4(t)},E.startRecordAac=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.dataApi.update({key:"audio_record"}),p.verifyOptions(t,"path"),this.signal.startRecordAac(t)},E.stopRecordAac=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.signal.stopRecordAac(t)},E.onRecordMp4=function(t,e){t.type=e,this.emit("recordMp4",t)},E.destroy=function(){},E.setNetcallSession=function(t){return this.calling?v.reject({type:"statusNotMatch",error:"开启会话失败: 当前正在通话中"}):(this.calling=!0,this.channelId=t.channelId,this.type=+t.netcallType,this.imInfo=t,this.imInfo.rtcUrls=t.rtcServerMap,this.beCalledInfo=this.imInfo,this.target=t.target.account,this.parseAccountUidMap(t.accountUidMap),this.signal.startSession((0,r["default"])({},this.imInfo,{type:this.type},this.imInfo.sessionConfig),!1))},E.ans=function(t){return this.signal?(this.dataApi.update({key:"ans"}),this.sessionConfig.ns=~~t,this.signal.audioControl({ns:this.sessionConfig.ns})):v.reject({code:"noConnection"})},E.aec=function(t){return this.signal?(this.dataApi.update({key:"aec"}),this.sessionConfig.aec=~~t,this.signal.audioControl({aec:this.sessionConfig.aec})):v.reject({code:"noConnection"})},E.voiceDetection=function(t){return this.signal?(this.sessionConfig.vad=~~t,this.signal.audioControl({vad:this.sessionConfig.vad})):v.reject({code:"noConnection"})},E.awc=function(t){return this.signal?(this.dataApi.update({key:"awc"}),this.sessionConfig.awc=~~t,this.signal.awc(this.sessionConfig.awc)):v.reject({code:"noConnection"})},t.exports=b,n(350)},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var o=n(6),r=i(o),s=n(16),a=i(s),c=n(15),u=i(c),l=void 0,d=n(19),h=n(343),f=n(364),p=n(363),v=function(t){function e(n){(0,r["default"])(this,e);var i=(0,a["default"])(this,t.call(this));return l.merge(i,n),i.init(),i}return(0,u["default"])(e,t),e}(d);v.install=function(t){l=t.util};var m=v.prototype;m.init=function(){this.reset()},m.reset=function(){this.width=0,this.height=0},m.initCanvas=function(t){l.merge(this,t);var e=this.container||document.body,n=this.canvas;n||(n=this.canvas=document.createElement("canvas"),e.appendChild(n)),n.width=this.width,n.height=this.height;var i=this.gl;if(i||(i=this.gl=h.getWebGLContext(n)),i)i.viewport(0,0,this.width,this.height),i.clearColor(0,0,0,1),i.clear(i.COLOR_BUFFER_BIT),h.initShaders(i,f,p),this.initBuffer(i),this.initTextures(i);else{var o={code:"notSupportWebGl"};this.emit("error",o)}},m.initBuffer=function(t){this.positionLocation=t.getAttribLocation(t.program,"a_position"),this.texCoordLocation=t.getAttribLocation(t.program,"a_texCoord"),this.texCoordBuffer=t.createBuffer()},m.initTextures=function(t){this.yTexture=this.createTexture(t.TEXTURE0),this.uTexture=this.createTexture(t.TEXTURE1),this.vTexture=this.createTexture(t.TEXTURE2);var e=t.getUniformLocation(t.program,"Ytex");t.uniform1i(e,0);var n=t.getUniformLocation(t.program,"Utex");t.uniform1i(n,1);var i=t.getUniformLocation(t.program,"Vtex");t.uniform1i(i,2)},m.createTexture=function(t){var e=this.gl,n=e.createTexture();return e.activeTexture(t),e.bindTexture(e.TEXTURE_2D,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),n},m.destroyTextures=function(){var t=this.gl;t&&(t.deleteTexture(this.yTexture),t.deleteTexture(this.uTexture),t.deleteTexture(this.vTexture)),this.yTexture=null,this.uTexture=null,this.vTexture=null},m.destroyBuffer=function(){var t=this.gl;t&&this.texCoordBuffer&&t.deleteBuffer(this.texCoordBuffer),this.texCoordBuffer=null},m.updateShaders=function(){var t=this.gl,e=void 0;e=this.mirror?new Float32Array([-1,1,1,0,-1,-1,1,1,1,1,0,0,1,-1,0,1]):new Float32Array([-1,1,0,0,-1,-1,0,1,1,1,1,0,1,-1,1,1]),t.bindBuffer(t.ARRAY_BUFFER,this.texCoordBuffer),t.bufferData(t.ARRAY_BUFFER,e,t.STATIC_DRAW);var n=e.BYTES_PER_ELEMENT;t.vertexAttribPointer(this.positionLocation,2,t.FLOAT,!1,4*n,0),t.vertexAttribPointer(this.texCoordLocation,2,t.FLOAT,!1,4*n,2*n),t.enableVertexAttribArray(this.positionLocation),t.enableVertexAttribArray(this.texCoordLocation)},m.updateTextures=function(t){var e=t.y,n=t.u,i=t.v,o=this.gl,r=this.width,s=this.height;this.updateTexture(o.TEXTURE0,this.yTexture,e,r,s),this.updateTexture(o.TEXTURE1,this.uTexture,n,r/2,s/2),this.updateTexture(o.TEXTURE2,this.vTexture,i,r/2,s/2),o.finish()},m.updateTexture=function(t,e,n,i,o){var r=this.gl;r.activeTexture(t),r.bindTexture(r.TEXTURE_2D,e),r.texImage2D(r.TEXTURE_2D,0,r.LUMINANCE,i,o,0,r.LUMINANCE,r.UNSIGNED_BYTE,n)},m.drawImage=function(t){if(!this.destroyed){var e=t.width,n=t.height,i=t.y,o=t.u,r=t.v;e===this.width&&n===this.height||(this.width=e,this.height=n,this.clean(),this.initCanvas({width:e,height:n}),this.emit("resize",{width:e,height:n,isRemote:this.isRemote,container:this.container})),this.updateShaders(),this.updateTextures({y:i,u:o,v:r});var s=this.gl;s.drawArrays(s.TRIANGLE_STRIP,0,4)}},m.destroy=function(){this.destroyed||(this.destroyed=!0,this.clean(),this.reset())},m.clean=function(){this.destroyTextures(),this.destroyBuffer(),this.removeGl()},m.removeGl=function(){this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.canvas=null,this.canvasInited=!1,this.gl=null},t.exports=v},function(t,e){"use strict";var n={},i=n.create3DContext=function(t,e){for(var n=["webgl","experimental-webgl","webkit-3d","moz-webgl"],i=null,o=0;o<n.length;++o){try{i=t.getContext(n[o],e)}catch(r){}if(i){console.log("use",n[o]);break}}return i};n.initShaders=function(t,e,n){var i=o(t,e,n);return i?(t.useProgram(i),t.program=i,!0):(console.log("Failed to create program"),!1)};var o=n.createProgram=function(t,e,n){var i=r(t,t.VERTEX_SHADER,e),o=r(t,t.FRAGMENT_SHADER,n);if(!i||!o)return null;var s=t.createProgram();if(!s)return null;t.attachShader(s,i),t.attachShader(s,o),t.linkProgram(s);var a=t.getProgramParameter(s,t.LINK_STATUS);if(!a){var c=t.getProgramInfoLog(s);return console.log("Failed to link program: "+c),t.deleteProgram(s),t.deleteShader(o),t.deleteShader(i),null}return s},r=n.loadShader=function(t,e,n){var i=t.createShader(e);return null==i?(console.log("unable to create shader"),null):(t.shaderSource(i,n),t.compileShader(i),i)};n.getWebGLContext=function(t,e){var n=i(t);return n?n:null},window.requestAnimationFrame||(window.requestAnimationFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}()),window.cancelAnimationFrame||(window.cancelAnimationFrame=window.cancelRequestAnimationFrame||window.webkitCancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelAnimationFrame||window.mozCancelRequestAnimationFrame||window.msCancelAnimationFrame||window.msCancelRequestAnimationFrame||window.oCancelAnimationFrame||window.oCancelRequestAnimationFrame||window.clearTimeout),t.exports=n},,,,,,,function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var o=n(98),r=i(o),s=n(341),a=n(203),c=s.prototype,u=void 0;c.setUtil=function(t){u=t},c.createChannel=function(t){return u.verifyOptions(t,"channelName"),t.custom=t.custom||"",this.dataApi.update("meeting"),t.webrtcEnable=!0,this.nim.createChannel(t)},c.joinChannel=function(t){var e=this;this.dataApi.update("meeting"),u.verifyOptions(t,"channelName type");var n=t.type,i=t.sessionConfig,o=void 0===i?{}:i;if(o.bypassRtmp=t.liveEnable,o.customLayout=t.layout||t.customLayout,t.liveEnable&&this.dataApi.update("bypass",void 0!==o.splitMode?+o.splitMode+1:0),o.highAudio&&this.dataApi.update("hd_audio"),void 0!==o.videoFrameRate&&this.dataApi.update("fps",0===+o.videoFrameRate?0:+o.videoFrameRate+1),void 0!==o.videoEncodeMode&&this.dataApi.update("video_adaptive_strategy",o.videoEncodeMode||0),void 0!==o.videoBitrate&&this.dataApi.update("video_max_encode_bitrate",o.videoBitrate||""),void 0!==o.videoQuality){var s=o.videoQuality;s===a.CHAT_VIDEO_QUALITY_540P?s=a.CHAT_VIDEO_QUALITY_720P:s===a.CHAT_VIDEO_QUALITY_720P&&(s=a.CHAT_VIDEO_QUALITY_540P),this.dataApi.update("video_quality",s||0)}if(o.awc&&this.dataApi.update({key:"awc"}),o.ans&&this.dataApi.update({key:"ans"}),o.aec&&this.dataApi.update({key:"aec"}),this.signalInited)return this.nim.joinChannel({channelName:t.channelName,liveEnable:t.liveEnable,webrtcEnable:!0}).then(function(i){return console.log("joinchannel obj",i),console.log("joinchannel options",t),e.callerInfo=i,e.channelId=i.channelId,e.channelName=t.channelName,e.sessionMode="meeting",e.parseAccountUidMap(i.accountUidMap),i.uid=e.getUidWithAccount(e.account),e.dataApi.start({uid:i.uid}),e.signal.startSession((0,r["default"])({},i,{type:n},t.sessionConfig),!0).then(function(t){return t.custom=i.custom,t})});var c={code:"noConnection"};return Promise.reject(c)},c.leaveChannel=function(){if(this.signalInited)return this.dataApi.send(),this.signal.stopSession();var t={code:"noConnection"};return Promise.reject(t)},c.changeRoleToPlayer=function(){return this.signal.setRole(0)},c.changeRoleToAudience=function(){return this.signal.setRole(1)},c.updateRtmpUrl=function(t){return this.signal.updateRtmpUrl(t)}},function(t,e){"use strict";var n="wss://localhost.netease.im:",i={baseUrl:n,signalUrl:n+"30000",streamUrl:n+"40000",genStreamUrl:function(t){return""+n+t}};t.exports=i},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var o=n(98),r=i(o),s=n(6),a=i(s),c=n(16),u=i(c),l=n(15),d=i(l),h=void 0,f=n(19),p=n(203),v=n(354),m=n(149),_=function(t){function e(n){(0,a["default"])(this,e);var i=(0,u["default"])(this,t.call(this));return h.merge(i,n),i.reset(),window.addEventListener("beforeunload",function(){i.destroy()}),i}return(0,d["default"])(e,t),e}(f);_.install=function(t){h=t.util};var g=_.prototype;g.reset=function(){this.inited=!1,this.isMeeting=!1,this.hasInvokePC=!1,this.cmdId=1,this.cmdTasksMap={},this.sessionStopped=!1,this.devicesMap={},this.deviceMap={},this.initSocket(),this.audioGroup={aec:1,ns:1,vad:1,awc:0}},g.initSocket=function(){var t=this.socket=new WebSocket(this.url);t.onopen=this.onOpen.bind(this),t.onmessage=this.onMessage.bind(this),t.onerror=this.onError.bind(this),t.onclose=this.onClose.bind(this)},g.onOpen=function(t){var e=this,n=this.heartbeat?1:0,i=this.getName()+" open -> signal.js";this.inited=!0,this.logToConsole(i),this.log(i),this.emit("open"),this.sendCmd({type:"on_init",info:{account:this.account,type:this.kickLast?1:0,heartbeat:n,app_key:this.appkey}}).then(this.onInit.bind(this))["catch"](function(t){e.logToConsole("init error -> signal.js",t),e.emit("initError",t)})},g.onError=function(t){if(!this.destroyed&&this.inited){var e=this.getName()+" error -> signal.js";this.logToConsole(e)}},g.onClose=function(t){var e=this;if(!this.destroyed)if(this.inited){var n=this.getName()+" close -> signal.js : "+t.code;this.logToConsole(n),this.inited=!1,this.emit("close")}else{this.hasInvokePC||(this.hasInvokePC=!0,this.invokePC());var i=this.backoff;i||(i=this.backoff=new m({min:1e3,max:2e3})),3===i.attempts?this.emit("initError",{code:"noPC"}):setTimeout(function(){e.initSocket()},i.duration())}},g.invokePC=function(){var t="NIMWebAgent:invokePC",e=document.createElement("iframe");e.src=t,document.body.appendChild(e),setTimeout(function(){e.parentNode&&e.parentNode.removeChild(e)},0)},g.onMessage=function(t){if(!this.destroyed){var e=JSON.parse(t.data),n=e.cmd_id,i=e.cmd_type,o=e.cmd_info;this.shouldPrintMsg({cmdType:i,cmdInfo:o})&&"on_heartbeat_notify"!==i&&this.client.info("signal socket msg",e);var r=this.cmdTasksMap[n];if(r)delete this.cmdTasksMap[n],200===o.code?r.resolve(o):r.reject(o);else switch(i){case"device_status_notify":this.onDeviceStatus(o);break;case"session_notify":this.onSessionNotify(o);break;case"upload_log_notify":this.onUploadLogNotify(o)}}},g.shouldPrintMsg=function(t){var e=t.cmdType,n=t.cmdInfo;return"session_notify"!==e||!n.audio_volume&&!n.net&&!n.static_info},g.sendCmd=function(t){var e=this;return new Promise(function(n,i){var o="on_heartbeat"===t.type?0:e.cmdId++,s=(0,r["default"])({cmd_id:o,cmd_type:t.type,cmd_info:t.info||{}},t.extra);e.socket&&e.socket.readyState===WebSocket.OPEN?("on_heartbeat"!==t.type&&e.logToConsole("send signal cmd",s),e.cmdTasksMap[o]={resolve:n,reject:i},e.socket.send(JSON.stringify(s))):i({code:"noConnection"})})},g.onInit=function(t){var e=t.code,n=t.version,i=t.port,o=t.device_list_notify;200===e&&(o.forEach(this.onDevices,this),this.emit("init",{port:i,version:n,code:e}),this.startHeartBeat())},g.startHeartBeat=function(){var t=this;this.heartBeatTimer&&this.stopHeartBeat(),this.heartBeatTimer=setInterval(function(){t.sendCmd({type:"on_heartbeat",info:{}})["catch"](function(){t.emit("heartBeatError",{type:"heartbeatError"})})},15e3)},g.stopHeartBeat=function(){clearInterval(this.heartBeatTimer),this.heartBeatTimer=null},g.setVideoViewSize=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=parseInt(t.width)||0,n=parseInt(t.height)||0,i=void 0===t.cut?1:~~t.cut;return this.sendCmd({type:"on_capture_video_size",info:{width:e,height:n,cut:i}})},g.setVideoViewRemoteSize=function(t){var e=parseInt(t.width)||0,n=parseInt(t.height)||0,i=t.id||0,o=void 0===t.cut?1:~~t.cut;return this.sendCmd({type:"on_rec_video_size",info:{id:i,width:e,height:n,cut:o}})},g.setVideoScale=function(t){var e=t.type,n=void 0===e?p.CHAT_VIDEO_SCALE_None:e,i=t.id;return this.sendCmd({type:"on_send_video_Scale",info:{id:i,type:n}})},g.getDevicesOfType=function(t){var e=this;return this.sendCmd({type:"on_get_devices",info:{type:t}}).then(function(t){return t.devices=t.devices||[],e.onDevices(t),t})["catch"](function(t){throw t})},g.onDevices=function(t){var e=t.type,n=t.devices;if(n&&n.length){v.sortDevices(n);var i=p.getDeviceTypeStr(e);i&&(this.devicesMap[e]=n,this.emit("devices",{type:e,typeStr:i,devices:n}))}},g.startAllDevices=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.videoQuality,i=e.audioOutType;Object.keys(this.devicesMap).forEach(function(e){e=+e,e===p.DEVICE_TYPE_AUDIO_OUT_CHAT&&i===p.DEVICE_TYPE_AUDIO_OUT_LOCAL&&(e=i);var o=t.devicesMap[e];t.startDevice({device:o[0],type:e,videoQuality:n})})},g.startDevice=function(t){var e=this,n=t.device,i=t.type,o=t.width,r=t.height;if(n){i=+i;var s={type:i,path:n.path};return i===p.DEVICE_TYPE_VIDEO&&(s.width=parseInt(o)||0,s.height=parseInt(r)||0),this.deviceMap[i]=n,this.sendCmd({type:"on_start_device",info:s})["catch"](function(){throw delete e.deviceMap[i],s})}},g.stopDevice=function(t){var e=this,n=this.deviceMap[t];return delete this.deviceMap[t],this.sendCmd({type:"on_stop_device",info:{type:t}})["catch"](function(){e.deviceMap[t]=n})},g.onDeviceStatus=function(t){var e=t.type,n=t.status,i=1===(1&n),o=4===(4&n),s=8===(8&n),a=16===(16&n);s&&(this.deviceMap[e]=t,this.emit("deviceStatus",(0,r["default"])({},t,{status:"started"}))),a&&(delete this.deviceMap[e],this.emit("deviceStatus",(0,r["default"])({},t,{status:"stopped"}))),o&&(this.deviceMap[e]=t,this.emit("deviceStatus",(0,r["default"])({},t,{status:"reset"}))),i&&this.emit("deviceStatus",(0,r["default"])({},t,{status:"change"}))},g.startSession=function(t,e){var n=this;this.sessionStopped=!1;var i=h.guid();this.sessionId=i;var o=t.type;this.type=o;var r={id:t.uid,cid:t.channelId,type:o,p2p_connect:1,dispatch:t.serverMap,config:t.clientConfig,v_encode_mode:this.normalizeVideoEncodeMode(t.videoEncodeMode),video_quality:this.normalizeVideoQuality(t.videoQuality),video_record:t.recordVideo?1:0,record:t.recordAudio?1:0,high_rate:t.highAudio?1:0,frame_rate:this.normalizeVideoFrameRate(t.videoFrameRate),max_video_rate:this.normalizeVideoBitrate(t.videoBitrate),custom_layout:t.customLayout};return e&&(r.meeting_mode=1,r.bypass_rtmp=t.bypassRtmp?1:0,r.rtmp_url=t.rtmpUrl||"",r.rtmp_record=t.rtmpRecord?1:0,r.split_mode=t.splitMode||0),this.sendCmd({type:"on_start_chat",info:r,extra:{session_id:i}}).then(function(i){var o=i.login,r=i.error;if(r)throw r;return n.isMeeting=e,void 0!==t.ns&&n.audioControl({ns:t.ns}),void 0!==t.vad&&n.audioControl({vad:t.vad}),void 0!==t.aec&&n.audioControl({aec:t.aec}),void 0!==t.awc&&n.awc(t.awc),{login:o}})},g.stopSession=function(){return this.sessionStopped?Promise.resolve():(this.sessionStopped=!0,this.isMeeting=!1,this.sendCmd({type:"on_stop_chat"}))},g.clear=function(){this.sendCmd({type:"on_clear"})},g.switchVideoToAudio=function(){return this.sendCmd({type:"on_set_chat_mode",info:{type:p.NETCALL_TYPE_AUDIO}})},g.switchAudioToVideo=function(){return this.sendCmd({type:"on_set_chat_mode",info:{type:p.NETCALL_TYPE_VIDEO}})},g.logToConsole=function(){var t=this.client;t&&t.log.apply(t,arguments)},g.log=function(t){t&&this.doLog({msg:t,level:3})},g.warn=function(t){t&&this.doLog({msg:t,level:2})},g.err=function(t){t&&this.doLog({msg:t,level:1})},g.doLog=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.msg,n=t.level;return this.sendCmd({type:"on_log",info:{type:n,content:""+e}})["catch"](function(){})},g.uploadLog=function(t){var e=t.bucket,n=t.objectName,i=t.token;return this.sendCmd({type:"on_upload_log",info:{nos_bucket:e,nos_object:n,nos_header_token:i}})["catch"](function(){})},g.normalizeVideoEncodeMode=function(t){return parseInt(t)||p.CHAT_VIDEO_ENCODEMODE_NORMAL},g.normalizeVideoQuality=function(t){return parseInt(t)||p.CHAT_VIDEO_QUALITY_480P},g.setVideoQuality=function(t){return this.sendCmd({type:"on_set_video_quality",info:{type:this.normalizeVideoQuality(t)}})},g.normalizeVideoFrameRate=function(t){return parseInt(t)||p.CHAT_VIDEO_FRAME_RATE_NORMAL},g.setVideoFrameRate=function(t){return this.sendCmd({type:"on_set_video_frame_rate",info:{type:this.normalizeVideoFrameRate(t)}})},g.normalizeVideoBitrate=function(t){return parseInt(t)||0},g.setVideoBitrate=function(t){return this.sendCmd({type:"on_set_video_bitrate",info:{code:this.normalizeVideoBitrate(t)}})},g.netDetect=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.appKey,n=t.type,i=t.quality,o=void 0===i?0:i;return this.sendCmd({type:"on_net_detect",info:{app_key:e,type:n,quality:o}})},g.normalizeVolumn=function(t){return t=+t,h.isNumber(t)&&!isNaN(t)||(t=255),t<0&&(t=0),t>255&&(t=255),t},g.setCaptureVolume=function(t){return t=this.normalizeVolumn(t),this.sendCmd({type:"on_capture_volume",info:{status:t}})},g.setPlayVolume=function(t){return t=this.normalizeVolumn(t),this.sendCmd({type:"on_play_volume",info:{status:t}})},g.setRole=function(t){return this.sendCmd({type:"on_set_viewer",info:{status:t}})},g.setAudioBlack=function(t,e){return this.sendCmd({type:"on_set_audio_black",info:{id:t,status:e}})},g.setVideoBlack=function(t,e){return this.sendCmd({type:"on_set_video_black",info:{id:t,status:e}})},g.updateRtmpUrl=function(t){return this.sendCmd({type:"on_update_rtmp_url",info:{content:t}})},g.startRecordMp4=function(t){var e=t.path,n=t.id,i=void 0===n?"":n;return this.sendCmd({type:"on_record_mp4",info:{path:e,id:i}})},g.stopRecordMp4=function(t){var e=t.id,n=void 0===e?0:e;return this.sendCmd({type:"on_stop_record_mp4",info:{id:n}})},g.startRecordAac=function(t){var e=t.path;return this.sendCmd({type:"on_record_aac",info:{path:e}})},g.stopRecordAac=function(){return this.sendCmd({type:"on_stop_record_aac",info:{}})},g.onSessionNotify=function(t){t&&(t.user_joined?(console.log("onSessionNotify ",t),this.emit("userJoined",{uid:t.user_joined.id,port:t.user_joined.port,type:this.type,isMeeting:this.isMeeting})):t.user_left?this.emit("userLeft",{uid:t.user_left.id,type:t.user_left.status,isMeeting:this.isMeeting}):t.net?this.emit("netStatus",t.net):t.static_info?this.emit("statistics",t.static_info):t.audio_volume?this.emit("audioVolume",t.audio_volume):t.error?this.emit("error",t.error):t.mp4_start?this.emit("recordMp4",t.mp4_start,"start"):t.mp4_close&&this.emit("recordMp4",t.mp4_close,"close"))},g.onUploadLogNotify=function(t){var e=t.code,n=t.url;200===e&&this.emit("logUploaded",{url:n})},g.getName=function(){return"signal socket "+this.url},g.destroy=function(){this.destroyed=!0,this.stopHeartBeat();var t="signal close -> signal.js";this.logToConsole(t),this.socket&&(this.socket.onopen=null,this.socket.onmessage=null,this.socket.onerror=null,this.socket.onclose=null,this.socket.readyState===WebSocket.OPEN&&(this.clear(),this.socket.close()),this.socket=null)},g.audioControl=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return h.merge(this.audioGroup,t),this.sendCmd({type:"on_audio_process",info:this.audioGroup,id:++this.cmdId})},g.awc=function(t){return this.sendCmd({type:"on_audio_howling",info:{status:~~t},id:++this.cmdId})},t.exports=_},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}var o=n(6),r=i(o),s=n(16),a=i(s),c=n(15),u=i(c),l=void 0,d=n(19),h=n(342),f=n(362),p=function(t){function e(n){(0,r["default"])(this,e);var i=(0,a["default"])(this,t.call(this));return l.merge(i,n),i.init(),i}return(0,u["default"])(e,t),e}(d);p.install=function(t){l=t.util};var v=p.prototype;v.init=function(){this.reset(),this.initRender(),this.initWorker(),window.addEventListener("beforeunload",this.destroy.bind(this))},v.initRender=function(){var t=this;this.render=new h({client:this.client,stream:this,isRemote:this.isRemote,container:this.container,mirror:this.mirror}),this.render.on("resize",function(e){t.emit("resize",e)}),this.render.on("error",function(e){t.emit("error",e)})},v.reset=function(){this.currFrameCount=0,this.width=0,this.height=0,this.timetag=0,this.worker=null,this.render=null},v.initWorker=function(){var t=this,e=new Blob([f],{type:"application/javascript"}),n=this.worker=new Worker(URL.createObjectURL(e));n.addEventListener("message",function(e){var n=e.data;switch(n.cmd){case"open":t.onOpen();break;case"error":t.onError();break;case"close":t.onClose();break;case"message":t.onMessage(n)}}),this.sendWorkerCmd({cmd:"init",info:{url:this.url}})},v.destroyWorker=function(){this.worker&&this.worker.terminate()},v.sendWorkerCmd=function(t){this.worker&&this.worker.postMessage(t)},v.getName=function(){return(this.isRemote?"remote ":"")+"stream socket "+this.url},v.onOpen=function(t){var e=this.getName()+" open -> stream.js";this.logToConsole(e),this.logToPC(e)},v.startStatisticsTimer=function(){var t=this;this.statisticsTimer=setInterval(function(){var e=t.currFrameCount-t.lastFrameCount;t.sendWorkerCmd({cmd:"msg",info:{cmd:"statistics",info:{lastFrameCount:t.lastFrameCount,fps:e,latency:t.latency}}}),t.lastFrameCount=t.currFrameCount,t.latency=0},1e3)},v.onError=function(t){if(!this.destroyed){var e=this.getName()+" error -> stream.js";this.logToConsole(e),this.logToPC(e),this.destroy()}},v.onClose=function(t){this.destroy(t)},v.onMessage=function(t){var e=t.data;if(!this.destroyed&&e instanceof ArrayBuffer){var n=e.byteLength;this.render&&!this.suspended&&this.renderFrame(e,n)}},v.renderFrame=function(t,e){var n=16,i=new DataView(t),o=this.width=i.getUint32(0),r=this.height=i.getUint32(4),s=i.getUint32(8),a=i.getUint32(12);this.timetag=1e3*s+a;var c=o*r,u=c/4,l=c/4;if(n+c+u+l!==e){var d="yuv数据长度不匹配: total "+e+", meta "+n+", width "+o+", height "+r+", yLength "+c+" uLength "+u+" vLength "+l;return this.logToConsole(d),void this.logToPC(d)}this.currFrameCount++,this.scheduleRender({id:this.currFrameCount,width:o,height:r,y:new Uint8Array(t,n,c),u:new Uint8Array(t,n+c,u),v:new Uint8Array(t,n+c+u)})},v.scheduleRender=function(t){this.render&&!this.suspended&&this.render.drawImage(t)},v.suspend=function(){this.suspended=!0},v.resume=function(){this.suspended=!1},v.destroy=function(t){this.sendWorkerCmd({cmd:"close",info:{cmd_type:"on_clear_media"}}),this.destroyed=!0,this.render&&this.render.destroy(),this.reset();var e=t&&t.constructor===Object?t.code:"",n=this.getName()+" destroy: code - "+e+" -> stream.js";this.logToConsole(n),this.logToPC(n)},v.logToConsole=function(){var t=this.client;t&&t.log.apply(t,arguments)},v.logToPC=function(){var t=this.client;if(t){var e=t.signal;e&&e.log.apply(e,arguments)}},t.exports=p},function(t,e){"use strict";var n={};n.sortDevices=function(t){t&&t.length>1&&t.sort(function(t,e){var n=t.name.toLowerCase().indexOf("virtual")!==-1,i=t.path.toLowerCase().indexOf("virtual")!==-1,o=e.name.toLowerCase().indexOf("virtual")!==-1,r=e.path.toLowerCase().indexOf("virtual")!==-1;return i?1:r?-1:n&&o?0:n?1:o?-1:0})},t.exports=n},,,,,,,,function(t,e){t.exports="'use strict';\n\n/* 该web worker 职能为向 websocket 发送指令及数据*/\n\nvar that = {};\n\nthat.init = function (data) {\n if (!that.socket) {\n var url = that.url = data.info.url;\n var socket = that.socket = new WebSocket(url);\n socket.onopen = function (event) {\n postMessage({\n cmd: 'open'\n });\n };\n socket.onmessage = function (event) {\n postMessage({\n cmd: 'message',\n data: event.data\n }, [event.data]);\n };\n socket.onerror = function (event) {\n postMessage({\n cmd: 'error'\n });\n };\n socket.onclose = function (event) {\n postMessage({ // web 端被动结束\n cmd: 'close'\n });\n };\n socket.binaryType = 'arraybuffer';\n }\n};\n\nthat.close = function () {\n if (that.socket) {\n that.socket.onopen = null;\n that.socket.onmessage = null;\n that.socket.onerror = null;\n that.socket.onclose = null;\n that.socket.close(); // 结束socket\n that.socket = null;\n }\n self.close(); // 结束worker,web端主动\n};\n\nthat.send = function (obj) {\n if (that.socket && that.socket.readyState === WebSocket.OPEN) {\n that.socket.send(JSON.stringify(obj));\n }\n};\n// 侦听主线程的worker消息\nself.addEventListener('message', function (event) {\n var data = event.data;\n switch (data.cmd) {\n case 'init':\n // worker第一步2\n that.init(data);\n break;\n case 'close':\n // web发起,结束worker及相应socket\n that.send(data.info);\n that.close(data);\n break;\n case 'msg':\n that.send(data.info);\n break;\n }\n});"},function(t,e){t.exports="precision mediump float;\r\nuniform sampler2D Ytex, Utex, Vtex;\r\nvarying vec2 v_texCoord;\r\nvoid main(void) {\r\n float r, g, b, y, u, v;\r\n vec4 yuv, rgb;\r\n y = texture2D(Ytex, v_texCoord).r;\r\n u = texture2D(Utex, v_texCoord).r;\r\n v = texture2D(Vtex, v_texCoord).r;\r\n yuv = vec4(y, u, v, 1.0);\r\n yuv = yuv - vec4(0.0625, 0.5, 0.5, 0.0);\r\n yuv = mat4(\r\n 1.1643, 0.0, 0.0, 0.0,\r\n 0.0, 1.0, 0.0, 0.0,\r\n 0.0, 0.0, 1.0, 0.0,\r\n 0.0, 0.0, 0.0, 1.0\r\n ) * yuv;\r\n rgb = mat4(\r\n 1.0, 1.0, 1.0, 0.0,\r\n 0.0, -0.3917, 2.017, 0.0,\r\n 1.5958, -0.8129, 0.0, 0.0,\r\n 0.0, 0.0, 0.0, 1.0\r\n ) * yuv;\r\n gl_FragColor = rgb;\r\n // y = 1.1643 * (y - 0.0625);\r\n // u = u - 0.5;\r\n // v = v - 0.5;\r\n // r = y + 1.5958 * v;\r\n // g = y - 0.39173 * u - 0.81290 * v;\r\n // b = y + 2.017 * u;\r\n // gl_FragColor = vec4(r, g, b, 1.0);\r\n}\r\n"},function(t,e){t.exports="attribute vec4 a_position;\r\nattribute vec2 a_texCoord;\r\nvarying vec2 v_texCoord;\r\nvoid main () {\r\n gl_Position = a_position;\r\n v_texCoord = a_texCoord;\r\n}\r\n"}])});
\ No newline at end of file
此 diff 太大无法显示。
{
"root": true,
"extends": "@ljharb",
"rules": {
"camelcase": [0],
"complexity": [0, 10],
"dot-notation": [2, { "allowKeywords": false }],
"eqeqeq": [2, "allow-null"],
"id-length": [2, { "min": 1, "max": 40 }],
"max-nested-callbacks": [2, 5],
"max-params": [2, 7],
"max-statements": [1, 30],
"new-cap": [2, { "capIsNewExceptions": ["ToInteger", "ToObject", "ToPrimitive", "ToUint32"] }],
"no-constant-condition": [1],
"no-extend-native": [2, {"exceptions": ["Date", "Error", "RegExp"]}],
"no-extra-parens": [0],
"no-extra-semi": [1],
"no-func-assign": [1],
"no-implicit-coercion": [2, {
"boolean": false,
"number": false,
"string": true
}],
"no-invalid-this": [0],
"no-magic-numbers": [0],
"no-native-reassign": [2, {"exceptions": ["Date", "parseInt"]}],
"no-new-func": [1],
"no-plusplus": [1],
"no-restricted-syntax": [2, "ContinueStatement", "DebuggerStatement", "LabeledStatement", "WithStatement"],
"no-shadow": [1],
"no-unused-vars": [1, { "vars": "all", "args": "after-used" }],
"operator-linebreak": [2, "after"],
"quote-props": [1, "as-needed", { "keywords": true }],
"spaced-comment": [0],
"strict": [0]
}
}
{
"es3": true,
"additionalRules": [],
"requireSemicolons": true,
"disallowMultipleSpaces": true,
"disallowIdentifierNames": [],
"requireCurlyBraces": {
"allExcept": [],
"keywords": ["if", "else", "for", "while", "do", "try", "catch"]
},
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"],
"disallowSpaceAfterKeywords": [],
"disallowSpaceBeforeComma": true,
"disallowSpaceAfterComma": false,
"disallowSpaceBeforeSemicolon": true,
"disallowNodeTypes": [
"DebuggerStatement",
"LabeledStatement",
"SwitchCase",
"SwitchStatement",
"WithStatement"
],
"requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] },
"requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true },
"requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true },
"disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true },
"requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true },
"disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true },
"requireSpaceBetweenArguments": true,
"disallowSpacesInsideParentheses": true,
"disallowSpacesInsideArrayBrackets": true,
"disallowQuotedKeysInObjects": "allButReserved",
"disallowSpaceAfterObjectKeys": true,
"requireCommaBeforeLineBreak": true,
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
"requireSpaceAfterPrefixUnaryOperators": [],
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
"requireSpaceBeforePostfixUnaryOperators": [],
"disallowSpaceBeforeBinaryOperators": [],
"requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
"requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
"disallowSpaceAfterBinaryOperators": [],
"disallowImplicitTypeConversion": ["binary", "string"],
"disallowKeywords": ["with", "eval"],
"requireKeywordsOnNewLine": [],
"disallowKeywordsOnNewLine": ["else"],
"requireLineFeedAtFileEnd": true,
"disallowTrailingWhitespace": true,
"disallowTrailingComma": true,
"excludeFiles": ["node_modules/**", "vendor/**"],
"disallowMultipleLineStrings": true,
"requireDotNotation": { "allExcept": ["keywords"] },
"requireParenthesesAroundIIFE": true,
"validateLineBreaks": "LF",
"validateQuoteMarks": {
"escape": true,
"mark": "'"
},
"disallowOperatorBeforeLineBreak": [],
"requireSpaceBeforeKeywords": [
"do",
"for",
"if",
"else",
"switch",
"case",
"try",
"catch",
"finally",
"while",
"with",
"return"
],
"validateAlignedFunctionParameters": {
"lineBreakAfterOpeningBraces": true,
"lineBreakBeforeClosingBraces": true
},
"requirePaddingNewLinesBeforeExport": true,
"validateNewlineAfterArrayElements": {
"maximum": 200
},
"requirePaddingNewLinesAfterUseStrict": true,
"disallowArrowFunctions": true,
"disallowMultiLineTernary": false,
"validateOrderInObjectKeys": false,
"disallowIdenticalDestructuringNames": true,
"disallowNestedTernaries": { "maxLevel": 7 },
"requireSpaceAfterComma": { "allExcept": ["trailing"] },
"requireAlignedMultilineParams": false,
"requireSpacesInGenerator": {
"afterStar": true
},
"disallowSpacesInGenerator": {
"beforeStar": true
},
"disallowVar": false,
"requireArrayDestructuring": false,
"requireEnhancedObjectLiterals": false,
"requireObjectDestructuring": false,
"requireEarlyReturn": false,
"requireCapitalizedConstructorsNew": {
"allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"]
},
"requireImportAlphabetized": false,
"requireSpaceBeforeObjectValues": true,
"requireSpaceBeforeDestructuredValues": true,
"disallowSpacesInsideTemplateStringPlaceholders": true,
"disallowArrayDestructuringReturn": false,
"requireNewlineBeforeSingleStatementsInIf": false
}
language: node_js
node_js:
- "5.9"
- "5.8"
- "5.7"
- "5.6"
- "5.5"
- "5.4"
- "5.3"
- "5.2"
- "5.1"
- "5.0"
- "4.4"
- "4.3"
- "4.2"
- "4.1"
- "4.0"
- "iojs-v3.3"
- "iojs-v3.2"
- "iojs-v3.1"
- "iojs-v3.0"
- "iojs-v2.5"
- "iojs-v2.4"
- "iojs-v2.3"
- "iojs-v2.2"
- "iojs-v2.1"
- "iojs-v2.0"
- "iojs-v1.8"
- "iojs-v1.7"
- "iojs-v1.6"
- "iojs-v1.5"
- "iojs-v1.4"
- "iojs-v1.3"
- "iojs-v1.2"
- "iojs-v1.1"
- "iojs-v1.0"
- "0.12"
- "0.11"
- "0.10"
- "0.9"
- "0.8"
- "0.6"
- "0.4"
before_install:
- 'if [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g npm@1.4.28 ;; 2.*) npm install -g npm@2 ;; esac ; fi'
- 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then npm install -g npm; fi'
script:
- 'if [ "${TRAVIS_NODE_VERSION}" != "4.4" ]; then npm run tests-only ; else npm test ; fi'
sudo: false
matrix:
fast_finish: true
allow_failures:
- node_js: "5.8"
- node_js: "5.7"
- node_js: "5.6"
- node_js: "5.5"
- node_js: "5.4"
- node_js: "5.3"
- node_js: "5.2"
- node_js: "5.1"
- node_js: "5.0"
- node_js: "4.3"
- node_js: "4.2"
- node_js: "4.1"
- node_js: "4.0"
- node_js: "iojs-v3.2"
- node_js: "iojs-v3.1"
- node_js: "iojs-v3.0"
- node_js: "iojs-v2.4"
- node_js: "iojs-v2.3"
- node_js: "iojs-v2.2"
- node_js: "iojs-v2.1"
- node_js: "iojs-v2.0"
- node_js: "iojs-v1.7"
- node_js: "iojs-v1.6"
- node_js: "iojs-v1.5"
- node_js: "iojs-v1.4"
- node_js: "iojs-v1.3"
- node_js: "iojs-v1.2"
- node_js: "iojs-v1.1"
- node_js: "iojs-v1.0"
- node_js: "0.11"
- node_js: "0.9"
- node_js: "0.6"
- node_js: "0.4"
4.5.7
- [Fix] `bind` in IE 8: Update `is-callable` implementation to v1.1.3 (#390)
4.5.6
- [Fix] `new Date(new Date())` should work in IE 8 (#389)
- [Tests] on `node` `v5.7`
- [Dev Deps] update `uglify-js`
4.5.5
- [Fix] Adobe Photoshop’s JS engine bizarrely can have `+date !== date.getTime()` (#365)
- [Dev Deps] update `eslint`
- [Refactor] Update `is-callable` implementation to match latest
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jscs`
4.5.4
- [Fix] careless error from 5cf99aca49e59bae03b5d542381424bb1b13ec42
4.5.3
- [Fix] Saturday is a day in the week (#386)
- [Robustness] improve Function#bind (#381)
- [Tests] on `node` `v5.6`, `v4.3`
- [Tests] use json3 (#382)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`
- [Docs] add note about script order (#379)
4.5.2
- [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380)
4.5.1
- [Fix] Make sure preexisting + broken `Array#` methods that throw don’t break the runtime (#377)
- [Dev Deps] update `jscs`
4.5.0
- [New] `parseFloat('-0')` should return -0 in Opera 12 (#371)
- [New] Provide and replace Date UTC methods (#360)
- [Robustness] cache `Date` getUTC* methods so that `Date#toISOString` doesn’t observably look them up on the receiver
- [Robustness] use a cached and shimmed `String#trim`
- [Tests] up to `node` `v5.5`
- [Tests] add `parallelshell` and use it in a few tasks
- [Refactor] rename cached methods to avoid linter warnings
- [Dev Deps] update `eslint`, `jscs`, '@ljharb/eslint-config'
- [Docs] Update license year to 2016 (#374)
4.4.2
- [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380)
4.4.1
- [Fix] ensure that IE 11 in compatibility mode doesn't throw (#370)
- [Docs] add missing shimmed things
4.4.0
- [New] Detect and patch `RegExp#toString` in IE 8, which returns flags in the wrong order (#364)
- [Fix] Patch `Array#sort` on {Chrome, Safari, IE < 9, FF 4} that throws improperly, per ES5 (#354)
- [Fix] In IE 6, `window.external` makes `Object.keys` throw
- [Fix] `Array#slice`: boxed string access on IE <= 8 (#349)
- [Fix] `Array#join`: fix IE 6-8 join called on string literal (#352)
- [Fix] Ensure that `Error#message` and `Error#name` are non-enumerable (#358)
- [Fix: sham] `Object.getOwnPropertyDescriptor`: In Opera 11.6, `propertyIsEnumerable` is a nonshadowable global, like `toString`
- [Robustness] Use a bound form of `Array#slice.call`
- [Tests] Properly check for descriptor support in IE <= 8
- [Tests] on `node` `v5.1`
- [Tests] Add `Array#slice` tests (#346)
- [Dev Deps] update `uglify-js`, `eslint`, `jscs`, `uglify-js`, `semver`
- [Docs] Fix broken UMD links (#344)
4.3.2
- [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380)
4.3.1
- [Fix] `String#split`: revert part of dcce96ae21185a69d2d40e67416e7496b73e8e47 which broke in older browsers (#342)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jscs`
- [Tests] Firefox allows `Number#toPrecision` values of [1,100], which the spec permits
4.3.0
- [New] `Array#push`: in IE <= 7, `Array#push` was not generic (#336)
- [New] `Array#push` in Opera `10.6` has a super weird bug when pushing `undefined`
- [New] `Array#join`: In IE <= 7, passing `undefined` didn't use the default separator (#333)
- [New] `Error#toString`: prints out the proper message in IE 7 and below (#334)
- [New] `Number#toPrecision`: IE 7 and below incorrectly throw when an explicit `undefined` precision is passed (#340)
- [Fix] `String#lastIndexOf`: ensure the correct length in IE 8
- [Fix] ensure `parseInt` accepts negative and plus-prefixed hex values (#332)
- [Robustness] Use a bound `Array#push` instead of relying on `Function#call`
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jscs`
- [Tests] Add some conditionals to avoid impossible-to-fix test failures in IE 6-8, due to it being unable to distinguish between `undefined` and an absent index (#114)
- [Tests] Fix false negatives in IE 6-8 with jasmine comparing arrays to arraylikes (#114)
- [Tests] add additional `Array#shift` tests (#337)
- [Tests] Add additional `Array#splice` tests (#339)
- [Tests] Add `Array#pop` tests, just in case (#338)
- [Tests] include `global` tests in HTML test files
- [Tests] Make sure the HTML tests run with the right charset
- [Tests] ensure `node` `v0.8` tests stay passing.
- [Tests] Prevent nondeterminism in the tests - this sometime produced values that are one ms off
- [Tests] on `node` `v5.0`
- [Tests] fix npm upgrades for older nodes
4.2.1
- [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380)
4.2.0
- [shim: new] Overwrite `String#lastIndexOf` in IE 9, 10, 11, and Edge, so it has proper unicode support.
- [Dev Deps] update `eslint`, `jscs`
4.1.16
- [shim: fix] use `Array#slice`, not `String#slice`, on `String#split` output (#380)
4.1.15
- [shim: fix] new Date + Date.parse: Fix a Safari 8 & 9 bug where the `ms` arg is treated as a signed instead of unsigned int (#329)
- [shim: fix] add 'frame' to blacklisted keys (#330)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `jscs`, `uglify-js`
- [Tests] on `node` `v4.2`
- [Tests] Date: prevent nondeterminism in the tests - this sometime produced values that are one ms off
4.1.14
- [shim: fix] Wrap more things in a try/catch, because IE sucks and sometimes throws on [[Get]] of window.localStorage (#327)
- [Refactor] Use `ES.ToUint32` instead of inline `>>>`
- [Tests] up to `node` `v4.1`
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `semver`, `jscs`
4.1.13
- [shim: fix] Fix a bug where `Date(x)` threw instead of equalling `String(Date(x))` (#326)
4.1.12
- [fix] Make sure uglify doesn't remove function names
- [shim: fix] Use `is-arguments` implementation; don't call down legacy code path in modern engines (#325)
- [Tests] up to `io.js` `v3.3`
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`
4.1.11
- [shim: fix] Object.keys in Safari 9 has some bugs. (Already fixed in Webkit Nightly)
- [shim: fix] Omit !Date.parse check in the if statement (#323)
- [sham: fix] Fix Object.create sham to not set __proto__ (#301)
- [sham: fix] Add a typeof check to Object.getPrototypeOf (#319, #320)
- [Tests] up to `io.js` `v3.1`
- [Tests] Make sure `Object.getPrototypeOf` tests don't fail when engines implement ES6 semantics
- [Docs] Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG (#318)
- [Dev Deps] Update `eslint`, `uglify-js`, `jscs`; use my personal shared `eslint` config
4.1.10
- [Fix] Fix IE 8 issue with `window.frameElement` access in a child iframe (#322)
- [Tests] Consolidating `Date.parse` extended year tests
- [Tests] Account for a `Date.parse` precision variance in Safari 8
- [Tests] DRY up some Date.parse tests
- [Tests] Don't create globals in Date tests
- [Tests] Better failure output when an invalid date's toJSON throws
- [Tests] Also compare lengths of array-likes
- [Tests] Extra check on Object.keys(arguments)
- [Tests] Skip appropriate tests when objects aren't extensible/freezeable/sealable
4.1.9
- [Fix] Remove "extended", add "unicode" in `String#split` shim, to match ES6
- [Fix] Object.keys: Preserve the IE 8 dontEnum bugfix, and the automation equality bugfix.
- [Fix] Object.keys: Prevent a deprecation message from showing up in Chrome.
- [Performance] Speed up blacklisted key check for Object.keys automation equality bug.
- [Tests] Test on `io.js` `v2.4`
- [Dev Deps] Update `eslint`, `semver`
4.1.8
- [Fix] Fix an `Object.keys` IE 8 bug where `localStorage.prototype.constructor === localStorage` would throw (#275)
- [Fix] Shimmed `Object.defineProperty` should not throw for an empty descriptor (#315)
- [Fix] Fix `Date#toISOString` in Safari 5.1 (#243)
- [Fix] Use `Object#propertyIsEnumerable` to default the initial "enumerable" value in `Object.getOwnPropertyDescriptor` sham (#289)
- [Fix] Fix `Array#splice` with large sparse arrays in Safari 7/8, and Opera 12.15 (#295)
- [Robustness] Safely use and reference many builtins internally (also see #313)
- [Tests] Add `Date#{getUTCDate,getUTCMonth}` tests to expose Opera 10.6/11.61/12 `Date` bugs
- [Dev Deps] Update `eslint`
4.1.7
- Make sure `Date.parse` is not enumerable (#310)
4.1.6
- Support IE 8 when `document.domain` is set (#306, #150)
- Remove version from `bower.json` (#307)
4.1.5
- Add a failing runtime check for Safari 8 `Date.parse`
- Update `eslint`, `semver`
- Test on `io.js` `v2.2`
4.1.4
- Make sure copied `Date` properties remain non-enumerable.
- Using a more reliable check for supported property descriptors in non-IE ES3
- Fix 'constructor' in Object.defineProperties sham in ES3 (#252, #305)
- Use a reference to `Array#concat` rather than relying on the runtime environment's `concat`.
- Test on `io.js` `v2.1`
- Clean up `Array.prototype` iteration methods
4.1.3
- Update `license` in `package.json` per https://docs.npmjs.com/files/package.json#license
- Update `uglify-js`, `eslint`
4.1.2
- In IE 6-8, `Date` inside the function expression does not reference `DateShim` (#303)
- Date: Ensure all code paths have the correct `constructor` property
- Date: Don't copy non-own properties from original `Date`
- Test up to `io.js` `v2.0.0`
- Simplify `isPrimitive` check.
- Adding sanity check tests for ES5 `Number` constants.
- Update `uglify-js`, `eslint`, `semver`
4.1.1
- Fix name of `parseInt` replacement.
- Update copyright year
- Update `eslint`, `jscs`
- Lock `uglify-js` down to v2.4.17, since v2.4.18 and v2.4.19 have a breaking change.
- All grade A-supported `node`/`iojs` versions now ship with an `npm` that understands `^`.
- Run `travis-ci` tests on latest `node` and `iojs`; speed up builds; allow 0.8 failures.
- Ensure some Object tests don't fail in ES6
- Make sure `Date` instances don't have an enumerable `constructor` property, when possible.
4.1.0
- Update `eslint`
- Improve type checks: `Array.isArray`, `isRegex`
- Replace `isRegex`/`isString`/`isCallable` checks with inlined versions from npm modules
- Note which ES abstract methods are replaceable via `es-abstract`
- Run `travis-ci` tests on `iojs`!
4.0.6
- Update `jscs`, `uglify-js`, add `eslint`
- es5-sham: fix Object.defineProperty to not check for own properties (#211)
- Fix Array#splice bug in Safari 5 (#284)
- Fix `Object.keys` issue with boxed primitives with extra properties in older browsers. (#242, #285)
4.0.5
- Update `jscs` so tests pass
4.0.4
- Style/indentation/whitespace cleanups.
- README tweaks
4.0.3
- Fix keywords (#268)
- add some Date tests
- Note in README that the es5-sham requires the es5-shim (https://github.com/es-shims/es5-shim/issues/256#issuecomment-52875710)
4.0.2
- Start including version numbers in minified files (#267)
4.0.1
- Fix legacy arguments object detection in Object.keys (#260)
4.0.0
- No longer shim the ES5-spec behavior of splice when `deleteCount` is omitted - since no engines implement it, and ES6 changes it. (#255)
- Use Object.defineProperty where available, so that polyfills are non-enumerable when possible (#250)
- lots of internal refactoring
- Fixed a bug referencing String#indexOf and String#lastIndexOf before polyfilling it (#253, #254)
3.4.0
- Removed nonstandard SpiderMonkey extension to Array#splice - when `deleteCount` is omitted, it's now treated as 0. (#192, #239)
- Fix Object.keys with Arguments objects in Safari 5.0
- Now shimming String#split in Opera 10.6
- Avoid using "toString" as a variable name, since that breaks Opera
- Internal implementation and test cleanups
3.3.2
- Remove an internal "bind" call, which should make the shim a bit faster
- Fix a bug with object boxing in Array#reduceRight that was failing a test in IE 6
3.3.1
- Fixing an Array#splice bug in IE 6/7
- cleaning up Array#splice tests
3.3.0
- Fix Array#reduceRight in node 0.6 and older browsers (#238)
3.2.0
- Fix es5-sham UMD definition to work properly with AMD (#237)
- Ensure that Array methods do not autobox context in strict mode (#233)
3.1.1
- Update minified files (#231)
3.1.0
- Fix String#replace in Firefox up through 29 (#228)
3.0.2
- Fix `Function#bind` in IE 7 and 8 (#224, #225, #226)
3.0.1
- Version bump to ensure npm has newest minified assets
3.0.0
- es5-sham: fix `Object.getPrototypeOf` and `Object.getOwnPropertyDescriptor` for Opera Mini
- Better override noncompliant native ES5 methods: `Array#forEach`, `Array#map`, `Array#filter`, `Array#every`, `Array#some`, `Array#reduce`, `Date.parse`, `String#trim`
- Added spec-compliant shim for `parseInt`
- Ensure `Object.keys` handles more edge cases with `arguments` objects and boxed primitives
- Improve minification of builds
2.3.0
- parseInt is now properly shimmed in ES3 browsers to default the radix
- update URLs to point to the new organization
2.2.0
- Function.prototype.bind shim now reports correct length on a bound function
- fix node 0.6.x v8 bug in Array#forEach
- test improvements
2.1.0
- Object.create fixes
- tweaks to the Object.defineProperties shim
2.0.0
- Separate reliable shims from dubious shims (shams).
1.2.10
- Group-effort Style Cleanup
- Took a stab at fixing Object.defineProperty on IE8 without
bad side-effects. (@hax)
- Object.isExtensible no longer fakes it. (@xavierm)
- Date.prototype.toISOString no longer deals with partial
ISO dates, per spec (@kitcambridge)
- More (mostly from @bryanforbes)
1.2.9
- Corrections to toISOString by @kitcambridge
- Fixed three bugs in array methods revealed by Jasmine tests.
- Cleaned up Function.prototype.bind with more fixes and tests from
@bryanforbes.
1.2.8
- Actually fixed problems with Function.prototype.bind, and regressions
from 1.2.7 (@bryanforbes, @jdalton #36)
1.2.7 - REGRESSED
- Fixed problems with Function.prototype.bind when called as a constructor.
(@jdalton #36)
1.2.6
- Revised Date.parse to match ES 5.1 (kitcambridge)
1.2.5
- Fixed a bug for padding it Date..toISOString (tadfisher issue #33)
1.2.4
- Fixed a descriptor bug in Object.defineProperty (raynos)
1.2.3
- Cleaned up RequireJS and <script> boilerplate
1.2.2
- Changed reduce to follow the letter of the spec with regard to having and
owning properties.
- Fixed a bug where RegExps pass as Functions in some engines in reduce.
1.2.1
- Adding few fixes to make jshint happy.
- Fix for issue #12, function expressions can cause scoping issues in IE.
- NPM will minify on install or when `npm run-script install` is executed.
- Adding .gitignore to avoid publishing dev dependencies.
1.2.0
- Making script loadable as AMD module.
- Adding `indexOf` to the list of safe shims.
1.1.0
- Added support for accessor properties where possible (which is all browsers
except IE).
- Stop exposing bound function's (that are returned by
`Function.prototype.bind`) internal properties (`bound, boundTo, boundArgs`)
as in some cases (when using facade objects for example) capabilities of the
enclosed functions will be leaked.
- `Object.create` now explicitly sets `__proto__` property to guarantee
correct behavior of `Object.getPrototypeOf`'s on all objects created using
`Object.create`.
- Switched to `===` from `==` where possible as it's slightly faster on older
browsers that are target of this lib.
- Added names to all anonymous functions to have a better stack traces.
1.0.0
- fixed Date.toISODate, using UTC accessors, as in
http://code.google.com/p/v8/source/browse/trunk/src/date.js?r=6120#986
(arian)
0.0.4
- Revised Object.getPrototypeOf to work in more cases
in response to http://ejohn.org/blog/objectgetprototypeof/
[issue #2] (fschaefer)
0.0.3
- Fixed typos in Object.keys (samsonjs)
0.0.2
Per kangax's recommendations:
- faster Object.create(null)
- fixed a function-scope function declaration statement in Object.create
0.0.1
- fixed Object.create(null), in so far as that's possible
- reworked Rhino Object.freeze(Function) bug detector and patcher
0.0.0
- forked from narwhal-lib
- kriskowal Kris Kowal Copyright (C) 2009-2011 MIT License
- tlrobinson Tom Robinson Copyright (C) 2009-2010 MIT License (Narwhal
Project)
- dantman Daniel Friesen Copyright (C) 2010 XXX TODO License or CLA
- fschaefer Florian Schäfer Copyright (C) 2010 MIT License
- Gozala Irakli Gozalishvili Copyright (C) 2010 MIT License
- kitcambridge Kit Cambridge Copyright (C) 2011 MIT License
- kossnocorp Sasha Koss XXX TODO License or CLA
- bryanforbes Bryan Forbes XXX TODO License or CLA
- killdream Quildreen Motta Copyright (C) 2011 MIT Licence
- michaelficarra Michael Ficarra Copyright (C) 2011 3-clause BSD
License
- sharkbrainguy Gerard Paapu Copyright (C) 2011 MIT License
- bbqsrc Brendan Molloy (C) 2011 Creative Commons Zero (public domain)
- iwyg XXX TODO License or CLA
- DomenicDenicola Domenic Denicola Copyright (C) 2011 MIT License
- xavierm02 Montillet Xavier Copyright (C) 2011 MIT License
- Raynos Jake Verbaten Copyright (C) 2011 MIT Licence
- samsonjs Sami Samhuri Copyright (C) 2010 MIT License
- rwldrn Rick Waldron Copyright (C) 2011 MIT License
- lexer Alexey Zakharov XXX TODO License or CLA
- 280 North Inc. (Now Motorola LLC, a subsidiary of Google Inc.)
Copyright (C) 2009 MIT License
- Steven Levithan Copyright (C) 2012 MIT License
- Jordan Harband (C) 2013 MIT License
The MIT License (MIT)
Copyright (C) 2009-2016 Kristopher Michael Kowal and contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
# Since we rely on paths relative to the makefile location, abort if make isn't being run from there.
$(if $(findstring /,$(MAKEFILE_LIST)),$(error Please only invoke this makefile from the directory it resides in))
# The files that need updating when incrementing the version number.
VERSIONED_FILES := *.js *.json *.map README*
# Add the local npm packages' bin folder to the PATH, so that `make` can find them, when invoked directly.
# Note that rather than using `$(npm bin)` the 'node_modules/.bin' path component is hard-coded, so that invocation works even from an environment
# where npm is (temporarily) unavailable due to having deactivated an nvm instance loaded into the calling shell in order to avoid interference with tests.
export PATH := $(shell printf '%s' "$$PWD/node_modules/.bin:$$PATH")
UTILS := semver
# Make sure that all required utilities can be located.
UTIL_CHECK := $(or $(shell PATH="$(PATH)" which $(UTILS) >/dev/null && echo 'ok'),$(error Did you forget to run `npm install` after cloning the repo? At least one of the required supporting utilities not found: $(UTILS)))
# Default target (by virtue of being the first non '.'-prefixed in the file).
.PHONY: _no-target-specified
_no-target-specified:
$(error Please specify the target to make - `make list` shows targets. Alternatively, use `npm test` to run the default tests; `npm run` shows all tests)
# Lists all targets defined in this makefile.
.PHONY: list
list:
@$(MAKE) -pRrn : -f $(MAKEFILE_LIST) 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | command grep -v -e '^[^[:alnum:]]' -e '^$@$$command ' | sort
# All-tests target: invokes the specified test suites for ALL shells defined in $(SHELLS).
.PHONY: test
test:
@npm test
.PHONY: _ensure-tag
_ensure-tag:
ifndef TAG
$(error Please invoke with `make TAG=<new-version> release`, where <new-version> is either an increment specifier (patch, minor, major, prepatch, preminor, premajor, prerelease), or an explicit major.minor.patch version number)
endif
CHANGELOG_ERROR = $(error No CHANGES specified)
.PHONY: _ensure-changelog
_ensure-changelog:
@ (git status -sb --porcelain | command grep -E '^( M|[MA] ) CHANGES' > /dev/null) || (echo no CHANGES specified && exit 2)
# Ensures that the git workspace is clean.
.PHONY: _ensure-clean
_ensure-clean:
@[ -z "$$((git status --porcelain --untracked-files=no || echo err) | command grep -v 'CHANGES')" ] || { echo "Workspace is not clean; please commit changes first." >&2; exit 2; }
# Makes a release; invoke with `make TAG=<versionOrIncrementSpec> release`.
.PHONY: release
release: _ensure-tag _ensure-changelog _ensure-clean
@old_ver=`git describe --abbrev=0 --tags --match 'v[0-9]*.[0-9]*.[0-9]*'` || { echo "Failed to determine current version." >&2; exit 1; }; old_ver=$${old_ver#v}; \
new_ver=`echo "$(TAG)" | sed 's/^v//'`; new_ver=$${new_ver:-patch}; \
if printf "$$new_ver" | command grep -q '^[0-9]'; then \
semver "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be major.minor.patch' >&2; exit 2; }; \
semver -r "> $$old_ver" "$$new_ver" >/dev/null || { echo 'Invalid version number specified: $(TAG) - must be HIGHER than current one.' >&2; exit 2; } \
else \
new_ver=`semver -i "$$new_ver" "$$old_ver"` || { echo 'Invalid version-increment specifier: $(TAG)' >&2; exit 2; } \
fi; \
printf "=== Bumping version **$$old_ver** to **$$new_ver** before committing and tagging:\n=== TYPE 'proceed' TO PROCEED, anything else to abort: " && read response && [ "$$response" = 'proceed' ] || { echo 'Aborted.' >&2; exit 2; }; \
npm run minify; \
replace "$$old_ver" "$$new_ver" -- $(VERSIONED_FILES) && \
replace "blob/master" "blob/v$$new_ver" -- *.min.js && \
git commit -m "v$$new_ver" $(VERSIONED_FILES) CHANGES && \
git tag -a -m "v$$new_ver" "v$$new_ver"
#es5-shim <sup>[![Version Badge][npm-version-svg]][npm-url]</sup>
[![npm badge][npm-badge-png]][npm-url]
[![Build Status][travis-svg]][travis-url]
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
`es5-shim.js` and `es5-shim.min.js` monkey-patch a JavaScript context to
contain all EcmaScript 5 methods that can be faithfully emulated with a
legacy JavaScript engine.
**Note:** As `es5-shim.js` is designed to patch the native Javascript
engine, it should be the library that is loaded first.
`es5-sham.js` and `es5-sham.min.js` monkey-patch other ES5 methods as
closely as possible. For these methods, as closely as possible to ES5
is not very close. Many of these shams are intended only to allow code
to be written to ES5 without causing run-time errors in older engines.
In many cases, this means that these shams cause many ES5 methods to
silently fail. Decide carefully whether this is what you want.
**Note:** `es5-sham.js` requires `es5-shim.js` to be able to work properly.
## Tests
The tests are written with the Jasmine BDD test framework.
To run the tests, navigate to <root-folder>/tests/ , or,
simply `npm install` and `npm test`.
## Shims
### Complete tests ###
* Array.prototype.every
* Array.prototype.filter
* Array.prototype.forEach
* Array.prototype.indexOf
* Array.prototype.lastIndexOf
* Array.prototype.map
* Array.prototype.slice
* Array.prototype.some
* Array.prototype.sort
* Array.prototype.reduce
* Array.prototype.reduceRight
* Array.prototype.push
* Array.prototype.join
* Array.isArray
* Date.now
* Date.prototype.toJSON
* Function.prototype.bind
* :warning: Caveat: the bound function has a prototype property.
* :warning: Caveat: bound functions do not try too hard to keep you
from manipulating their ``arguments`` and ``caller`` properties.
* :warning: Caveat: bound functions don't have checks in ``call`` and
``apply`` to avoid executing as a constructor.
* Number.prototype.toFixed
* Number.prototype.toPrecision
* Object.keys
* String.prototype.split
* String.prototype.trim
* String.prototype.lastIndexOf
* String.prototype.replace
* Firefox (through v29) natively handles capturing groups incorrectly.
* Date.parse (for ISO parsing)
* Date.prototype.toISOString
* parseInt
* parseFloat
* Error.prototype.toString
* Error.prototype.name
* Error.prototype.message
* RegExp.prototype.toString
## Shams
* :warning: Object.create
For the case of simply "begetting" an object that inherits
prototypically from another, this should work fine across legacy
engines.
:warning: The second argument is passed to Object.defineProperties
which will probably fail either silently or with extreme prejudice.
* :warning: Object.getPrototypeOf
This will return "undefined" in some cases. It uses `__proto__` if
it's available. Failing that, it uses constructor.prototype, which
depends on the constructor property of the object's prototype having
not been replaced. If your object was created like this, it won't
work:
function Foo() {
}
Foo.prototype = {};
Because the prototype reassignment destroys the constructor
property.
This will work for all objects that were created using
`Object.create` implemented with this library.
* :warning: Object.getOwnPropertyNames
This method uses Object.keys, so it will not be accurate on legacy
engines.
* Object.isSealed
Returns "false" in all legacy engines for all objects, which is
conveniently guaranteed to be accurate.
* Object.isFrozen
Returns "false" in all legacy engines for all objects, which is
conveniently guaranteed to be accurate.
* Object.isExtensible
Works like a charm, by trying very hard to extend the object then
redacting the extension.
### May fail
* :warning: Object.getOwnPropertyDescriptor
The behavior of this shim does not conform to ES5. It should
probably not be used at this time, until its behavior has been
reviewed and been confirmed to be useful in legacy engines.
* :warning: Object.defineProperty
In the worst of circumstances, IE 8 provides a version of this
method that only works on DOM objects. This sham will not be
installed. The given version of `defineProperty` will throw an
exception if used on non-DOM objects.
In slightly better circumstances, this method will silently fail to
set "writable", "enumerable", and "configurable" properties.
Providing a getter or setter with "get" or "set" on a descriptor
will silently fail on engines that lack "__defineGetter__" and
"__defineSetter__", which include all versions of IE.
https://github.com/es-shims/es5-shim/issues#issue/5
* :warning: Object.defineProperties
This uses the Object.defineProperty shim.
* Object.seal
Silently fails on all legacy engines. This should be
fine unless you are depending on the safety and security
provisions of this method, which you cannot possibly
obtain in legacy engines.
* Object.freeze
Silently fails on all legacy engines. This should be
fine unless you are depending on the safety and security
provisions of this method, which you cannot possibly
obtain in legacy engines.
* Object.preventExtensions
Silently fails on all legacy engines. This should be
fine unless you are depending on the safety and security
provisions of this method, which you cannot possibly
obtain in legacy engines.
### Example of applying ES compatability shims in a browser project
```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-shim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.5.7/es5-sham.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.34.2/es6-shim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.34.2/es6-sham.min.js"></script>
<script src="https://wzrd.in/standalone/es7-shim@latest"></script>
<script src="other-libs.js"></script>
```
[npm-url]: https://npmjs.org/package/es5-shim
[npm-version-svg]: http://versionbadg.es/es-shims/es5-shim.svg
[travis-svg]: https://travis-ci.org/es-shims/es5-shim.svg
[travis-url]: https://travis-ci.org/es-shims/es5-shim
[deps-svg]: https://david-dm.org/es-shims/es5-shim.svg
[deps-url]: https://david-dm.org/es-shims/es5-shim
[dev-deps-svg]: https://david-dm.org/es-shims/es5-shim/dev-status.svg
[dev-deps-url]: https://david-dm.org/es-shims/es5-shim#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/es5-shim.png?downloads=true&stars=true
{
"name": "es5-shim",
"main": "es5-shim.js",
"repository": {
"type": "git",
"url": "git://github.com/es-shims/es5-shim"
},
"homepage": "https://github.com/es-shims/es5-shim",
"authors": [
"Kris Kowal <kris@cixar.com> (http://github.com/kriskowal/)",
"Sami Samhuri <sami.samhuri@gmail.com> (http://samhuri.net/)",
"Florian Schäfer <florian.schaefer@gmail.com> (http://github.com/fschaefer)",
"Irakli Gozalishvili <rfobic@gmail.com> (http://jeditoolkit.com)",
"Kit Cambridge <kitcambridge@gmail.com> (http://kitcambridge.github.com)",
"Jordan Harband <ljharb@gmail.com> (https://github.com/ljharb/)"
],
"description": "ECMAScript 5 compatibility shims for legacy JavaScript engines",
"keywords": [
"shim",
"es5",
"es5 shim",
"javascript",
"ecmascript",
"polyfill"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"tests"
]
}
{
"name": "es5-shim",
"repo": "es-shims/es5-shim",
"description": "ECMAScript 5 compatibility shims for legacy JavaScript engines",
"version": "v4.5.1",
"keywords": [
"shim",
"es5",
"es5 shim",
"javascript",
"ecmascript",
"polyfill"
],
"license": "MIT",
"main": "es5-shim.js",
"scripts": [
"es5-shim.js"
]
}
/*!
* https://github.com/es-shims/es5-shim
* @license es5-shim Copyright 2009-2015 by contributors, MIT License
* see https://github.com/es-shims/es5-shim/blob/master/LICENSE
*/
// vim: ts=4 sts=4 sw=4 expandtab
// Add semicolon to prevent IIFE from being passed as argument to concatenated code.
;
// UMD (Universal Module Definition)
// see https://github.com/umdjs/umd/blob/master/templates/returnExports.js
(function (root, factory) {
'use strict';
/* global define, exports, module */
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(factory);
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like enviroments that support module.exports,
// like Node.
module.exports = factory();
} else {
// Browser globals (root is window)
root.returnExports = factory();
}
}(this, function () {
var call = Function.call;
var prototypeOfObject = Object.prototype;
var owns = call.bind(prototypeOfObject.hasOwnProperty);
var isEnumerable = call.bind(prototypeOfObject.propertyIsEnumerable);
var toStr = call.bind(prototypeOfObject.toString);
// If JS engine supports accessors creating shortcuts.
var defineGetter;
var defineSetter;
var lookupGetter;
var lookupSetter;
var supportsAccessors = owns(prototypeOfObject, '__defineGetter__');
if (supportsAccessors) {
/* eslint-disable no-underscore-dangle */
defineGetter = call.bind(prototypeOfObject.__defineGetter__);
defineSetter = call.bind(prototypeOfObject.__defineSetter__);
lookupGetter = call.bind(prototypeOfObject.__lookupGetter__);
lookupSetter = call.bind(prototypeOfObject.__lookupSetter__);
/* eslint-enable no-underscore-dangle */
}
// ES5 15.2.3.2
// http://es5.github.com/#x15.2.3.2
if (!Object.getPrototypeOf) {
// https://github.com/es-shims/es5-shim/issues#issue/2
// http://ejohn.org/blog/objectgetprototypeof/
// recommended by fschaefer on github
//
// sure, and webreflection says ^_^
// ... this will nerever possibly return null
// ... Opera Mini breaks here with infinite loops
Object.getPrototypeOf = function getPrototypeOf(object) {
/* eslint-disable no-proto */
var proto = object.__proto__;
/* eslint-enable no-proto */
if (proto || proto === null) {
return proto;
} else if (toStr(object.constructor) === '[object Function]') {
return object.constructor.prototype;
} else if (object instanceof Object) {
return prototypeOfObject;
} else {
// Correctly return null for Objects created with `Object.create(null)`
// (shammed or native) or `{ __proto__: null}`. Also returns null for
// cross-realm objects on browsers that lack `__proto__` support (like
// IE <11), but that's the best we can do.
return null;
}
};
}
// ES5 15.2.3.3
// http://es5.github.com/#x15.2.3.3
var doesGetOwnPropertyDescriptorWork = function doesGetOwnPropertyDescriptorWork(object) {
try {
object.sentinel = 0;
return Object.getOwnPropertyDescriptor(object, 'sentinel').value === 0;
} catch (exception) {
return false;
}
};
// check whether getOwnPropertyDescriptor works if it's given. Otherwise, shim partially.
if (Object.defineProperty) {
var getOwnPropertyDescriptorWorksOnObject = doesGetOwnPropertyDescriptorWork({});
var getOwnPropertyDescriptorWorksOnDom = typeof document === 'undefined' ||
doesGetOwnPropertyDescriptorWork(document.createElement('div'));
if (!getOwnPropertyDescriptorWorksOnDom || !getOwnPropertyDescriptorWorksOnObject) {
var getOwnPropertyDescriptorFallback = Object.getOwnPropertyDescriptor;
}
}
if (!Object.getOwnPropertyDescriptor || getOwnPropertyDescriptorFallback) {
var ERR_NON_OBJECT = 'Object.getOwnPropertyDescriptor called on a non-object: ';
/* eslint-disable no-proto */
Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) {
if ((typeof object !== 'object' && typeof object !== 'function') || object === null) {
throw new TypeError(ERR_NON_OBJECT + object);
}
// make a valiant attempt to use the real getOwnPropertyDescriptor
// for I8's DOM elements.
if (getOwnPropertyDescriptorFallback) {
try {
return getOwnPropertyDescriptorFallback.call(Object, object, property);
} catch (exception) {
// try the shim if the real one doesn't work
}
}
var descriptor;
// If object does not owns property return undefined immediately.
if (!owns(object, property)) {
return descriptor;
}
// If object has a property then it's for sure `configurable`, and
// probably `enumerable`. Detect enumerability though.
descriptor = {
enumerable: isEnumerable(object, property),
configurable: true
};
// If JS engine supports accessor properties then property may be a
// getter or setter.
if (supportsAccessors) {
// Unfortunately `__lookupGetter__` will return a getter even
// if object has own non getter property along with a same named
// inherited getter. To avoid misbehavior we temporary remove
// `__proto__` so that `__lookupGetter__` will return getter only
// if it's owned by an object.
var prototype = object.__proto__;
var notPrototypeOfObject = object !== prototypeOfObject;
// avoid recursion problem, breaking in Opera Mini when
// Object.getOwnPropertyDescriptor(Object.prototype, 'toString')
// or any other Object.prototype accessor
if (notPrototypeOfObject) {
object.__proto__ = prototypeOfObject;
}
var getter = lookupGetter(object, property);
var setter = lookupSetter(object, property);
if (notPrototypeOfObject) {
// Once we have getter and setter we can put values back.
object.__proto__ = prototype;
}
if (getter || setter) {
if (getter) {
descriptor.get = getter;
}
if (setter) {
descriptor.set = setter;
}
// If it was accessor property we're done and return here
// in order to avoid adding `value` to the descriptor.
return descriptor;
}
}
// If we got this far we know that object has an own property that is
// not an accessor so we set it as a value and return descriptor.
descriptor.value = object[property];
descriptor.writable = true;
return descriptor;
};
/* eslint-enable no-proto */
}
// ES5 15.2.3.4
// http://es5.github.com/#x15.2.3.4
if (!Object.getOwnPropertyNames) {
Object.getOwnPropertyNames = function getOwnPropertyNames(object) {
return Object.keys(object);
};
}
// ES5 15.2.3.5
// http://es5.github.com/#x15.2.3.5
if (!Object.create) {
// Contributed by Brandon Benvie, October, 2012
var createEmpty;
var supportsProto = !({ __proto__: null } instanceof Object);
// the following produces false positives
// in Opera Mini => not a reliable check
// Object.prototype.__proto__ === null
// Check for document.domain and active x support
// No need to use active x approach when document.domain is not set
// see https://github.com/es-shims/es5-shim/issues/150
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
/* global ActiveXObject */
var shouldUseActiveX = function shouldUseActiveX() {
// return early if document.domain not set
if (!document.domain) {
return false;
}
try {
return !!new ActiveXObject('htmlfile');
} catch (exception) {
return false;
}
};
// This supports IE8 when document.domain is used
// see https://github.com/es-shims/es5-shim/issues/150
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
var getEmptyViaActiveX = function getEmptyViaActiveX() {
var empty;
var xDoc;
xDoc = new ActiveXObject('htmlfile');
var script = 'script';
xDoc.write('<' + script + '></' + script + '>');
xDoc.close();
empty = xDoc.parentWindow.Object.prototype;
xDoc = null;
return empty;
};
// The original implementation using an iframe
// before the activex approach was added
// see https://github.com/es-shims/es5-shim/issues/150
var getEmptyViaIFrame = function getEmptyViaIFrame() {
var iframe = document.createElement('iframe');
var parent = document.body || document.documentElement;
var empty;
iframe.style.display = 'none';
parent.appendChild(iframe);
/* eslint-disable no-script-url */
iframe.src = 'javascript:';
/* eslint-enable no-script-url */
empty = iframe.contentWindow.Object.prototype;
parent.removeChild(iframe);
iframe = null;
return empty;
};
/* global document */
if (supportsProto || typeof document === 'undefined') {
createEmpty = function () {
return { __proto__: null };
};
} else {
// In old IE __proto__ can't be used to manually set `null`, nor does
// any other method exist to make an object that inherits from nothing,
// aside from Object.prototype itself. Instead, create a new global
// object and *steal* its Object.prototype and strip it bare. This is
// used as the prototype to create nullary objects.
createEmpty = function () {
// Determine which approach to use
// see https://github.com/es-shims/es5-shim/issues/150
var empty = shouldUseActiveX() ? getEmptyViaActiveX() : getEmptyViaIFrame();
delete empty.constructor;
delete empty.hasOwnProperty;
delete empty.propertyIsEnumerable;
delete empty.isPrototypeOf;
delete empty.toLocaleString;
delete empty.toString;
delete empty.valueOf;
var Empty = function Empty() {};
Empty.prototype = empty;
// short-circuit future calls
createEmpty = function () {
return new Empty();
};
return new Empty();
};
}
Object.create = function create(prototype, properties) {
var object;
var Type = function Type() {}; // An empty constructor.
if (prototype === null) {
object = createEmpty();
} else {
if (typeof prototype !== 'object' && typeof prototype !== 'function') {
// In the native implementation `parent` can be `null`
// OR *any* `instanceof Object` (Object|Function|Array|RegExp|etc)
// Use `typeof` tho, b/c in old IE, DOM elements are not `instanceof Object`
// like they are in modern browsers. Using `Object.create` on DOM elements
// is...err...probably inappropriate, but the native version allows for it.
throw new TypeError('Object prototype may only be an Object or null'); // same msg as Chrome
}
Type.prototype = prototype;
object = new Type();
// IE has no built-in implementation of `Object.getPrototypeOf`
// neither `__proto__`, but this manually setting `__proto__` will
// guarantee that `Object.getPrototypeOf` will work as expected with
// objects created using `Object.create`
/* eslint-disable no-proto */
object.__proto__ = prototype;
/* eslint-enable no-proto */
}
if (properties !== void 0) {
Object.defineProperties(object, properties);
}
return object;
};
}
// ES5 15.2.3.6
// http://es5.github.com/#x15.2.3.6
// Patch for WebKit and IE8 standard mode
// Designed by hax <hax.github.com>
// related issue: https://github.com/es-shims/es5-shim/issues#issue/5
// IE8 Reference:
// http://msdn.microsoft.com/en-us/library/dd282900.aspx
// http://msdn.microsoft.com/en-us/library/dd229916.aspx
// WebKit Bugs:
// https://bugs.webkit.org/show_bug.cgi?id=36423
var doesDefinePropertyWork = function doesDefinePropertyWork(object) {
try {
Object.defineProperty(object, 'sentinel', {});
return 'sentinel' in object;
} catch (exception) {
return false;
}
};
// check whether defineProperty works if it's given. Otherwise,
// shim partially.
if (Object.defineProperty) {
var definePropertyWorksOnObject = doesDefinePropertyWork({});
var definePropertyWorksOnDom = typeof document === 'undefined' ||
doesDefinePropertyWork(document.createElement('div'));
if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) {
var definePropertyFallback = Object.defineProperty,
definePropertiesFallback = Object.defineProperties;
}
}
if (!Object.defineProperty || definePropertyFallback) {
var ERR_NON_OBJECT_DESCRIPTOR = 'Property description must be an object: ';
var ERR_NON_OBJECT_TARGET = 'Object.defineProperty called on non-object: ';
var ERR_ACCESSORS_NOT_SUPPORTED = 'getters & setters can not be defined on this javascript engine';
Object.defineProperty = function defineProperty(object, property, descriptor) {
if ((typeof object !== 'object' && typeof object !== 'function') || object === null) {
throw new TypeError(ERR_NON_OBJECT_TARGET + object);
}
if ((typeof descriptor !== 'object' && typeof descriptor !== 'function') || descriptor === null) {
throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor);
}
// make a valiant attempt to use the real defineProperty
// for I8's DOM elements.
if (definePropertyFallback) {
try {
return definePropertyFallback.call(Object, object, property, descriptor);
} catch (exception) {
// try the shim if the real one doesn't work
}
}
// If it's a data property.
if ('value' in descriptor) {
// fail silently if 'writable', 'enumerable', or 'configurable'
// are requested but not supported
/*
// alternate approach:
if ( // can't implement these features; allow false but not true
('writable' in descriptor && !descriptor.writable) ||
('enumerable' in descriptor && !descriptor.enumerable) ||
('configurable' in descriptor && !descriptor.configurable)
))
throw new RangeError(
'This implementation of Object.defineProperty does not support configurable, enumerable, or writable.'
);
*/
if (supportsAccessors && (lookupGetter(object, property) || lookupSetter(object, property))) {
// As accessors are supported only on engines implementing
// `__proto__` we can safely override `__proto__` while defining
// a property to make sure that we don't hit an inherited
// accessor.
/* eslint-disable no-proto */
var prototype = object.__proto__;
object.__proto__ = prototypeOfObject;
// Deleting a property anyway since getter / setter may be
// defined on object itself.
delete object[property];
object[property] = descriptor.value;
// Setting original `__proto__` back now.
object.__proto__ = prototype;
/* eslint-enable no-proto */
} else {
object[property] = descriptor.value;
}
} else {
if (!supportsAccessors && (('get' in descriptor) || ('set' in descriptor))) {
throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);
}
// If we got that far then getters and setters can be defined !!
if ('get' in descriptor) {
defineGetter(object, property, descriptor.get);
}
if ('set' in descriptor) {
defineSetter(object, property, descriptor.set);
}
}
return object;
};
}
// ES5 15.2.3.7
// http://es5.github.com/#x15.2.3.7
if (!Object.defineProperties || definePropertiesFallback) {
Object.defineProperties = function defineProperties(object, properties) {
// make a valiant attempt to use the real defineProperties
if (definePropertiesFallback) {
try {
return definePropertiesFallback.call(Object, object, properties);
} catch (exception) {
// try the shim if the real one doesn't work
}
}
Object.keys(properties).forEach(function (property) {
if (property !== '__proto__') {
Object.defineProperty(object, property, properties[property]);
}
});
return object;
};
}
// ES5 15.2.3.8
// http://es5.github.com/#x15.2.3.8
if (!Object.seal) {
Object.seal = function seal(object) {
if (Object(object) !== object) {
throw new TypeError('Object.seal can only be called on Objects.');
}
// this is misleading and breaks feature-detection, but
// allows "securable" code to "gracefully" degrade to working
// but insecure code.
return object;
};
}
// ES5 15.2.3.9
// http://es5.github.com/#x15.2.3.9
if (!Object.freeze) {
Object.freeze = function freeze(object) {
if (Object(object) !== object) {
throw new TypeError('Object.freeze can only be called on Objects.');
}
// this is misleading and breaks feature-detection, but
// allows "securable" code to "gracefully" degrade to working
// but insecure code.
return object;
};
}
// detect a Rhino bug and patch it
try {
Object.freeze(function () {});
} catch (exception) {
Object.freeze = (function (freezeObject) {
return function freeze(object) {
if (typeof object === 'function') {
return object;
} else {
return freezeObject(object);
}
};
}(Object.freeze));
}
// ES5 15.2.3.10
// http://es5.github.com/#x15.2.3.10
if (!Object.preventExtensions) {
Object.preventExtensions = function preventExtensions(object) {
if (Object(object) !== object) {
throw new TypeError('Object.preventExtensions can only be called on Objects.');
}
// this is misleading and breaks feature-detection, but
// allows "securable" code to "gracefully" degrade to working
// but insecure code.
return object;
};
}
// ES5 15.2.3.11
// http://es5.github.com/#x15.2.3.11
if (!Object.isSealed) {
Object.isSealed = function isSealed(object) {
if (Object(object) !== object) {
throw new TypeError('Object.isSealed can only be called on Objects.');
}
return false;
};
}
// ES5 15.2.3.12
// http://es5.github.com/#x15.2.3.12
if (!Object.isFrozen) {
Object.isFrozen = function isFrozen(object) {
if (Object(object) !== object) {
throw new TypeError('Object.isFrozen can only be called on Objects.');
}
return false;
};
}
// ES5 15.2.3.13
// http://es5.github.com/#x15.2.3.13
if (!Object.isExtensible) {
Object.isExtensible = function isExtensible(object) {
// 1. If Type(O) is not Object throw a TypeError exception.
if (Object(object) !== object) {
throw new TypeError('Object.isExtensible can only be called on Objects.');
}
// 2. Return the Boolean value of the [[Extensible]] internal property of O.
var name = '';
while (owns(object, name)) {
name += '?';
}
object[name] = true;
var returnValue = owns(object, name);
delete object[name];
return returnValue;
};
}
}));
{"version":3,"sources":["es5-sham.js"],"names":["root","factory","define","amd","exports","module","returnExports","this","call","Function","prototypeOfObject","Object","prototype","owns","bind","hasOwnProperty","isEnumerable","propertyIsEnumerable","toStr","toString","defineGetter","defineSetter","lookupGetter","lookupSetter","supportsAccessors","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__","getPrototypeOf","object","proto","__proto__","constructor","doesGetOwnPropertyDescriptorWork","sentinel","getOwnPropertyDescriptor","value","exception","defineProperty","getOwnPropertyDescriptorWorksOnObject","getOwnPropertyDescriptorWorksOnDom","document","createElement","getOwnPropertyDescriptorFallback","ERR_NON_OBJECT","property","TypeError","descriptor","enumerable","configurable","notPrototypeOfObject","getter","setter","get","set","writable","getOwnPropertyNames","keys","create","createEmpty","supportsProto","shouldUseActiveX","domain","ActiveXObject","getEmptyViaActiveX","empty","xDoc","write","close","parentWindow","getEmptyViaIFrame","iframe","parent","body","documentElement","style","display","appendChild","src","contentWindow","removeChild","isPrototypeOf","toLocaleString","valueOf","Empty","properties","Type","defineProperties","doesDefinePropertyWork","definePropertyWorksOnObject","definePropertyWorksOnDom","definePropertyFallback","definePropertiesFallback","ERR_NON_OBJECT_DESCRIPTOR","ERR_NON_OBJECT_TARGET","ERR_ACCESSORS_NOT_SUPPORTED","forEach","seal","freeze","freezeObject","preventExtensions","isSealed","isFrozen","isExtensible","name","returnValue"],"mappings":";;;;;CAaC,SAAUA,EAAMC,GACb,YAGA,UAAWC,UAAW,YAAcA,OAAOC,IAAK,CAE5CD,OAAOD,OACJ,UAAWG,WAAY,SAAU,CAIpCC,OAAOD,QAAUH,QACd,CAEHD,EAAKM,cAAgBL,OAE3BM,KAAM,WAER,GAAIC,GAAOC,SAASD,IACpB,IAAIE,GAAoBC,OAAOC,SAC/B,IAAIC,GAAOL,EAAKM,KAAKJ,EAAkBK,eACvC,IAAIC,GAAeR,EAAKM,KAAKJ,EAAkBO,qBAC/C,IAAIC,GAAQV,EAAKM,KAAKJ,EAAkBS,SAGxC,IAAIC,EACJ,IAAIC,EACJ,IAAIC,EACJ,IAAIC,EACJ,IAAIC,GAAoBX,EAAKH,EAAmB,mBAChD,IAAIc,EAAmB,CAEnBJ,EAAeZ,EAAKM,KAAKJ,EAAkBe,iBAC3CJ,GAAeb,EAAKM,KAAKJ,EAAkBgB,iBAC3CJ,GAAed,EAAKM,KAAKJ,EAAkBi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,QAAOrE,GACnB,SAAWA,KAAW,WAAY,CAC9B,MAAOA,OACJ,CACH,MAAOsE,GAAatE,MAG9BnB,OAAOwF,QAKb,IAAKxF,OAAO0F,kBAAmB,CAC3B1F,OAAO0F,kBAAoB,QAASA,mBAAkBvE,GAClD,GAAInB,OAAOmB,KAAYA,EAAQ,CAC3B,KAAM,IAAIiB,WAAU,2DAKxB,MAAOjB,IAMf,IAAKnB,OAAO2F,SAAU,CAClB3F,OAAO2F,SAAW,QAASA,UAASxE,GAChC,GAAInB,OAAOmB,KAAYA,EAAQ,CAC3B,KAAM,IAAIiB,WAAU,kDAExB,MAAO,QAMf,IAAKpC,OAAO4F,SAAU,CAClB5F,OAAO4F,SAAW,QAASA,UAASzE,GAChC,GAAInB,OAAOmB,KAAYA,EAAQ,CAC3B,KAAM,IAAIiB,WAAU,kDAExB,MAAO,QAMf,IAAKpC,OAAO6F,aAAc,CACtB7F,OAAO6F,aAAe,QAASA,cAAa1E,GAExC,GAAInB,OAAOmB,KAAYA,EAAQ,CAC3B,KAAM,IAAIiB,WAAU,sDAGxB,GAAI0D,GAAO,EACX,OAAO5F,EAAKiB,EAAQ2E,GAAO,CACvBA,GAAQ,IAEZ3E,EAAO2E,GAAQ,IACf,IAAIC,GAAc7F,EAAKiB,EAAQ2E,SACxB3E,GAAO2E,EACd,OAAOC"}
\ No newline at end of file
/*!
* https://github.com/es-shims/es5-shim
* @license es5-shim Copyright 2009-2015 by contributors, MIT License
* see https://github.com/es-shims/es5-shim/blob/v4.5.7/LICENSE
*/
(function(e,t){"use strict";if(typeof define==="function"&&define.amd){define(t)}else if(typeof exports==="object"){module.exports=t()}else{e.returnExports=t()}})(this,function(){var e=Function.call;var t=Object.prototype;var r=e.bind(t.hasOwnProperty);var n=e.bind(t.propertyIsEnumerable);var o=e.bind(t.toString);var i;var c;var f;var a;var l=r(t,"__defineGetter__");if(l){i=e.bind(t.__defineGetter__);c=e.bind(t.__defineSetter__);f=e.bind(t.__lookupGetter__);a=e.bind(t.__lookupSetter__)}if(!Object.getPrototypeOf){Object.getPrototypeOf=function getPrototypeOf(e){var r=e.__proto__;if(r||r===null){return r}else if(o(e.constructor)==="[object Function]"){return e.constructor.prototype}else if(e instanceof Object){return t}else{return null}}}var u=function doesGetOwnPropertyDescriptorWork(e){try{e.sentinel=0;return Object.getOwnPropertyDescriptor(e,"sentinel").value===0}catch(t){return false}};if(Object.defineProperty){var p=u({});var s=typeof document==="undefined"||u(document.createElement("div"));if(!s||!p){var b=Object.getOwnPropertyDescriptor}}if(!Object.getOwnPropertyDescriptor||b){var O="Object.getOwnPropertyDescriptor called on a non-object: ";Object.getOwnPropertyDescriptor=function getOwnPropertyDescriptor(e,o){if(typeof e!=="object"&&typeof e!=="function"||e===null){throw new TypeError(O+e)}if(b){try{return b.call(Object,e,o)}catch(i){}}var c;if(!r(e,o)){return c}c={enumerable:n(e,o),configurable:true};if(l){var u=e.__proto__;var p=e!==t;if(p){e.__proto__=t}var s=f(e,o);var y=a(e,o);if(p){e.__proto__=u}if(s||y){if(s){c.get=s}if(y){c.set=y}return c}}c.value=e[o];c.writable=true;return c}}if(!Object.getOwnPropertyNames){Object.getOwnPropertyNames=function getOwnPropertyNames(e){return Object.keys(e)}}if(!Object.create){var y;var d=!({__proto__:null}instanceof Object);var j=function shouldUseActiveX(){if(!document.domain){return false}try{return!!new ActiveXObject("htmlfile")}catch(e){return false}};var v=function getEmptyViaActiveX(){var e;var t;t=new ActiveXObject("htmlfile");t.write("<script></script>");t.close();e=t.parentWindow.Object.prototype;t=null;return e};var _=function getEmptyViaIFrame(){var e=document.createElement("iframe");var t=document.body||document.documentElement;var r;e.style.display="none";t.appendChild(e);e.src="javascript:";r=e.contentWindow.Object.prototype;t.removeChild(e);e=null;return r};if(d||typeof document==="undefined"){y=function(){return{__proto__:null}}}else{y=function(){var e=j()?v():_();delete e.constructor;delete e.hasOwnProperty;delete e.propertyIsEnumerable;delete e.isPrototypeOf;delete e.toLocaleString;delete e.toString;delete e.valueOf;var t=function Empty(){};t.prototype=e;y=function(){return new t};return new t}}Object.create=function create(e,t){var r;var n=function Type(){};if(e===null){r=y()}else{if(typeof e!=="object"&&typeof e!=="function"){throw new TypeError("Object prototype may only be an Object or null")}n.prototype=e;r=new n;r.__proto__=e}if(t!==void 0){Object.defineProperties(r,t)}return r}}var w=function doesDefinePropertyWork(e){try{Object.defineProperty(e,"sentinel",{});return"sentinel"in e}catch(t){return false}};if(Object.defineProperty){var m=w({});var P=typeof document==="undefined"||w(document.createElement("div"));if(!m||!P){var E=Object.defineProperty,h=Object.defineProperties}}if(!Object.defineProperty||E){var g="Property description must be an object: ";var z="Object.defineProperty called on non-object: ";var T="getters & setters can not be defined on this javascript engine";Object.defineProperty=function defineProperty(e,r,n){if(typeof e!=="object"&&typeof e!=="function"||e===null){throw new TypeError(z+e)}if(typeof n!=="object"&&typeof n!=="function"||n===null){throw new TypeError(g+n)}if(E){try{return E.call(Object,e,r,n)}catch(o){}}if("value"in n){if(l&&(f(e,r)||a(e,r))){var u=e.__proto__;e.__proto__=t;delete e[r];e[r]=n.value;e.__proto__=u}else{e[r]=n.value}}else{if(!l&&("get"in n||"set"in n)){throw new TypeError(T)}if("get"in n){i(e,r,n.get)}if("set"in n){c(e,r,n.set)}}return e}}if(!Object.defineProperties||h){Object.defineProperties=function defineProperties(e,t){if(h){try{return h.call(Object,e,t)}catch(r){}}Object.keys(t).forEach(function(r){if(r!=="__proto__"){Object.defineProperty(e,r,t[r])}});return e}}if(!Object.seal){Object.seal=function seal(e){if(Object(e)!==e){throw new TypeError("Object.seal can only be called on Objects.")}return e}}if(!Object.freeze){Object.freeze=function freeze(e){if(Object(e)!==e){throw new TypeError("Object.freeze can only be called on Objects.")}return e}}try{Object.freeze(function(){})}catch(x){Object.freeze=function(e){return function freeze(t){if(typeof t==="function"){return t}else{return e(t)}}}(Object.freeze)}if(!Object.preventExtensions){Object.preventExtensions=function preventExtensions(e){if(Object(e)!==e){throw new TypeError("Object.preventExtensions can only be called on Objects.")}return e}}if(!Object.isSealed){Object.isSealed=function isSealed(e){if(Object(e)!==e){throw new TypeError("Object.isSealed can only be called on Objects.")}return false}}if(!Object.isFrozen){Object.isFrozen=function isFrozen(e){if(Object(e)!==e){throw new TypeError("Object.isFrozen can only be called on Objects.")}return false}}if(!Object.isExtensible){Object.isExtensible=function isExtensible(e){if(Object(e)!==e){throw new TypeError("Object.isExtensible can only be called on Objects.")}var t="";while(r(e,t)){t+="?"}e[t]=true;var n=r(e,t);delete e[t];return n}}});
//# sourceMappingURL=es5-sham.map
/*!
* https://github.com/es-shims/es5-shim
* @license es5-shim Copyright 2009-2015 by contributors, MIT License
* see https://github.com/es-shims/es5-shim/blob/master/LICENSE
*/
// vim: ts=4 sts=4 sw=4 expandtab
// Add semicolon to prevent IIFE from being passed as argument to concatenated code.
;
// UMD (Universal Module Definition)
// see https://github.com/umdjs/umd/blob/master/templates/returnExports.js
(function (root, factory) {
'use strict';
/* global define, exports, module */
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(factory);
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS-like enviroments that support module.exports,
// like Node.
module.exports = factory();
} else {
// Browser globals (root is window)
root.returnExports = factory();
}
}(this, function () {
/**
* Brings an environment as close to ECMAScript 5 compliance
* as is possible with the facilities of erstwhile engines.
*
* Annotated ES5: http://es5.github.com/ (specific links below)
* ES5 Spec: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf
* Required reading: http://javascriptweblog.wordpress.com/2011/12/05/extending-javascript-natives/
*/
// Shortcut to an often accessed properties, in order to avoid multiple
// dereference that costs universally. This also holds a reference to known-good
// functions.
var $Array = Array;
var ArrayPrototype = $Array.prototype;
var $Object = Object;
var ObjectPrototype = $Object.prototype;
var $Function = Function;
var FunctionPrototype = $Function.prototype;
var $String = String;
var StringPrototype = $String.prototype;
var $Number = Number;
var NumberPrototype = $Number.prototype;
var array_slice = ArrayPrototype.slice;
var array_splice = ArrayPrototype.splice;
var array_push = ArrayPrototype.push;
var array_unshift = ArrayPrototype.unshift;
var array_concat = ArrayPrototype.concat;
var array_join = ArrayPrototype.join;
var call = FunctionPrototype.call;
var apply = FunctionPrototype.apply;
var max = Math.max;
var min = Math.min;
// Having a toString local variable name breaks in Opera so use to_string.
var to_string = ObjectPrototype.toString;
/* global Symbol */
/* eslint-disable one-var-declaration-per-line, no-redeclare, max-statements-per-line */
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
var isCallable; /* inlined from https://npmjs.com/is-callable */ var fnToStr = Function.prototype.toString, constructorRegex = /^\s*class /, isES6ClassFn = function isES6ClassFn(value) { try { var fnStr = fnToStr.call(value); var singleStripped = fnStr.replace(/\/\/.*\n/g, ''); var multiStripped = singleStripped.replace(/\/\*[.\s\S]*\*\//g, ''); var spaceStripped = multiStripped.replace(/\n/mg, ' ').replace(/ {2}/g, ' '); return constructorRegex.test(spaceStripped); } catch (e) { return false; /* not a function */ } }, tryFunctionObject = function tryFunctionObject(value) { try { if (isES6ClassFn(value)) { return false; } fnToStr.call(value); return true; } catch (e) { return false; } }, fnClass = '[object Function]', genClass = '[object GeneratorFunction]', isCallable = function isCallable(value) { if (!value) { return false; } if (typeof value !== 'function' && typeof value !== 'object') { return false; } if (hasToStringTag) { return tryFunctionObject(value); } if (isES6ClassFn(value)) { return false; } var strClass = to_string.call(value); return strClass === fnClass || strClass === genClass; };
var isRegex; /* inlined from https://npmjs.com/is-regex */ var regexExec = RegExp.prototype.exec, tryRegexExec = function tryRegexExec(value) { try { regexExec.call(value); return true; } catch (e) { return false; } }, regexClass = '[object RegExp]'; isRegex = function isRegex(value) { if (typeof value !== 'object') { return false; } return hasToStringTag ? tryRegexExec(value) : to_string.call(value) === regexClass; };
var isString; /* inlined from https://npmjs.com/is-string */ var strValue = String.prototype.valueOf, tryStringObject = function tryStringObject(value) { try { strValue.call(value); return true; } catch (e) { return false; } }, stringClass = '[object String]'; isString = function isString(value) { if (typeof value === 'string') { return true; } if (typeof value !== 'object') { return false; } return hasToStringTag ? tryStringObject(value) : to_string.call(value) === stringClass; };
/* eslint-enable one-var-declaration-per-line, no-redeclare, max-statements-per-line */
/* inlined from http://npmjs.com/define-properties */
var supportsDescriptors = $Object.defineProperty && (function () {
try {
var obj = {};
$Object.defineProperty(obj, 'x', { enumerable: false, value: obj });
for (var _ in obj) { return false; }
return obj.x === obj;
} catch (e) { /* this is ES3 */
return false;
}
}());
var defineProperties = (function (has) {
// Define configurable, writable, and non-enumerable props
// if they don't exist.
var defineProperty;
if (supportsDescriptors) {
defineProperty = function (object, name, method, forceAssign) {
if (!forceAssign && (name in object)) { return; }
$Object.defineProperty(object, name, {
configurable: true,
enumerable: false,
writable: true,
value: method
});
};
} else {
defineProperty = function (object, name, method, forceAssign) {
if (!forceAssign && (name in object)) { return; }
object[name] = method;
};
}
return function defineProperties(object, map, forceAssign) {
for (var name in map) {
if (has.call(map, name)) {
defineProperty(object, name, map[name], forceAssign);
}
}
};
}(ObjectPrototype.hasOwnProperty));
//
// Util
// ======
//
/* replaceable with https://npmjs.com/package/es-abstract /helpers/isPrimitive */
var isPrimitive = function isPrimitive(input) {
var type = typeof input;
return input === null || (type !== 'object' && type !== 'function');
};
var isActualNaN = $Number.isNaN || function (x) { return x !== x; };
var ES = {
// ES5 9.4
// http://es5.github.com/#x9.4
// http://jsperf.com/to-integer
/* replaceable with https://npmjs.com/package/es-abstract ES5.ToInteger */
ToInteger: function ToInteger(num) {
var n = +num;
if (isActualNaN(n)) {
n = 0;
} else if (n !== 0 && n !== (1 / 0) && n !== -(1 / 0)) {
n = (n > 0 || -1) * Math.floor(Math.abs(n));
}
return n;
},
/* replaceable with https://npmjs.com/package/es-abstract ES5.ToPrimitive */
ToPrimitive: function ToPrimitive(input) {
var val, valueOf, toStr;
if (isPrimitive(input)) {
return input;
}
valueOf = input.valueOf;
if (isCallable(valueOf)) {
val = valueOf.call(input);
if (isPrimitive(val)) {
return val;
}
}
toStr = input.toString;
if (isCallable(toStr)) {
val = toStr.call(input);
if (isPrimitive(val)) {
return val;
}
}
throw new TypeError();
},
// ES5 9.9
// http://es5.github.com/#x9.9
/* replaceable with https://npmjs.com/package/es-abstract ES5.ToObject */
ToObject: function (o) {
if (o == null) { // this matches both null and undefined
throw new TypeError("can't convert " + o + ' to object');
}
return $Object(o);
},
/* replaceable with https://npmjs.com/package/es-abstract ES5.ToUint32 */
ToUint32: function ToUint32(x) {
return x >>> 0;
}
};
//
// Function
// ========
//
// ES-5 15.3.4.5
// http://es5.github.com/#x15.3.4.5
var Empty = function Empty() {};
defineProperties(FunctionPrototype, {
bind: function bind(that) { // .length is 1
// 1. Let Target be the this value.
var target = this;
// 2. If IsCallable(Target) is false, throw a TypeError exception.
if (!isCallable(target)) {
throw new TypeError('Function.prototype.bind called on incompatible ' + target);
}
// 3. Let A be a new (possibly empty) internal list of all of the
// argument values provided after thisArg (arg1, arg2 etc), in order.
// XXX slicedArgs will stand in for "A" if used
var args = array_slice.call(arguments, 1); // for normal call
// 4. Let F be a new native ECMAScript object.
// 11. Set the [[Prototype]] internal property of F to the standard
// built-in Function prototype object as specified in 15.3.3.1.
// 12. Set the [[Call]] internal property of F as described in
// 15.3.4.5.1.
// 13. Set the [[Construct]] internal property of F as described in
// 15.3.4.5.2.
// 14. Set the [[HasInstance]] internal property of F as described in
// 15.3.4.5.3.
var bound;
var binder = function () {
if (this instanceof bound) {
// 15.3.4.5.2 [[Construct]]
// When the [[Construct]] internal method of a function object,
// F that was created using the bind function is called with a
// list of arguments ExtraArgs, the following steps are taken:
// 1. Let target be the value of F's [[TargetFunction]]
// internal property.
// 2. If target has no [[Construct]] internal method, a
// TypeError exception is thrown.
// 3. Let boundArgs be the value of F's [[BoundArgs]] internal
// property.
// 4. Let args be a new list containing the same values as the
// list boundArgs in the same order followed by the same
// values as the list ExtraArgs in the same order.
// 5. Return the result of calling the [[Construct]] internal
// method of target providing args as the arguments.
var result = apply.call(
target,
this,
array_concat.call(args, array_slice.call(arguments))
);
if ($Object(result) === result) {
return result;
}
return this;
} else {
// 15.3.4.5.1 [[Call]]
// When the [[Call]] internal method of a function object, F,
// which was created using the bind function is called with a
// this value and a list of arguments ExtraArgs, the following
// steps are taken:
// 1. Let boundArgs be the value of F's [[BoundArgs]] internal
// property.
// 2. Let boundThis be the value of F's [[BoundThis]] internal
// property.
// 3. Let target be the value of F's [[TargetFunction]] internal
// property.
// 4. Let args be a new list containing the same values as the
// list boundArgs in the same order followed by the same
// values as the list ExtraArgs in the same order.
// 5. Return the result of calling the [[Call]] internal method
// of target providing boundThis as the this value and
// providing args as the arguments.
// equiv: target.call(this, ...boundArgs, ...args)
return apply.call(
target,
that,
array_concat.call(args, array_slice.call(arguments))
);
}
};
// 15. If the [[Class]] internal property of Target is "Function", then
// a. Let L be the length property of Target minus the length of A.
// b. Set the length own property of F to either 0 or L, whichever is
// larger.
// 16. Else set the length own property of F to 0.
var boundLength = max(0, target.length - args.length);
// 17. Set the attributes of the length own property of F to the values
// specified in 15.3.5.1.
var boundArgs = [];
for (var i = 0; i < boundLength; i++) {
array_push.call(boundArgs, '$' + i);
}
// XXX Build a dynamic function with desired amount of arguments is the only
// way to set the length property of a function.
// In environments where Content Security Policies enabled (Chrome extensions,
// for ex.) all use of eval or Function costructor throws an exception.
// However in all of these environments Function.prototype.bind exists
// and so this code will never be executed.
bound = $Function('binder', 'return function (' + array_join.call(boundArgs, ',') + '){ return binder.apply(this, arguments); }')(binder);
if (target.prototype) {
Empty.prototype = target.prototype;
bound.prototype = new Empty();
// Clean up dangling references.
Empty.prototype = null;
}
// TODO
// 18. Set the [[Extensible]] internal property of F to true.
// TODO
// 19. Let thrower be the [[ThrowTypeError]] function Object (13.2.3).
// 20. Call the [[DefineOwnProperty]] internal method of F with
// arguments "caller", PropertyDescriptor {[[Get]]: thrower, [[Set]]:
// thrower, [[Enumerable]]: false, [[Configurable]]: false}, and
// false.
// 21. Call the [[DefineOwnProperty]] internal method of F with
// arguments "arguments", PropertyDescriptor {[[Get]]: thrower,
// [[Set]]: thrower, [[Enumerable]]: false, [[Configurable]]: false},
// and false.
// TODO
// NOTE Function objects created using Function.prototype.bind do not
// have a prototype property or the [[Code]], [[FormalParameters]], and
// [[Scope]] internal properties.
// XXX can't delete prototype in pure-js.
// 22. Return F.
return bound;
}
});
// _Please note: Shortcuts are defined after `Function.prototype.bind` as we
// use it in defining shortcuts.
var owns = call.bind(ObjectPrototype.hasOwnProperty);
var toStr = call.bind(ObjectPrototype.toString);
var arraySlice = call.bind(array_slice);
var arraySliceApply = apply.bind(array_slice);
var strSlice = call.bind(StringPrototype.slice);
var strSplit = call.bind(StringPrototype.split);
var strIndexOf = call.bind(StringPrototype.indexOf);
var pushCall = call.bind(array_push);
var isEnum = call.bind(ObjectPrototype.propertyIsEnumerable);
var arraySort = call.bind(ArrayPrototype.sort);
//
// Array
// =====
//
var isArray = $Array.isArray || function isArray(obj) {
return toStr(obj) === '[object Array]';
};
// ES5 15.4.4.12
// http://es5.github.com/#x15.4.4.13
// Return len+argCount.
// [bugfix, ielt8]
// IE < 8 bug: [].unshift(0) === undefined but should be "1"
var hasUnshiftReturnValueBug = [].unshift(0) !== 1;
defineProperties(ArrayPrototype, {
unshift: function () {
array_unshift.apply(this, arguments);
return this.length;
}
}, hasUnshiftReturnValueBug);
// ES5 15.4.3.2
// http://es5.github.com/#x15.4.3.2
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray
defineProperties($Array, { isArray: isArray });
// The IsCallable() check in the Array functions
// has been replaced with a strict check on the
// internal class of the object to trap cases where
// the provided function was actually a regular
// expression literal, which in V8 and
// JavaScriptCore is a typeof "function". Only in
// V8 are regular expression literals permitted as
// reduce parameters, so it is desirable in the
// general case for the shim to match the more
// strict and common behavior of rejecting regular
// expressions.
// ES5 15.4.4.18
// http://es5.github.com/#x15.4.4.18
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/array/forEach
// Check failure of by-index access of string characters (IE < 9)
// and failure of `0 in boxedString` (Rhino)
var boxedString = $Object('a');
var splitString = boxedString[0] !== 'a' || !(0 in boxedString);
var properlyBoxesContext = function properlyBoxed(method) {
// Check node 0.6.21 bug where third parameter is not boxed
var properlyBoxesNonStrict = true;
var properlyBoxesStrict = true;
var threwException = false;
if (method) {
try {
method.call('foo', function (_, __, context) {
if (typeof context !== 'object') {
properlyBoxesNonStrict = false;
}
});
method.call([1], function () {
'use strict';
properlyBoxesStrict = typeof this === 'string';
}, 'x');
} catch (e) {
threwException = true;
}
}
return !!method && !threwException && properlyBoxesNonStrict && properlyBoxesStrict;
};
defineProperties(ArrayPrototype, {
forEach: function forEach(callbackfn/*, thisArg*/) {
var object = ES.ToObject(this);
var self = splitString && isString(this) ? strSplit(this, '') : object;
var i = -1;
var length = ES.ToUint32(self.length);
var T;
if (arguments.length > 1) {
T = arguments[1];
}
// If no callback function or if callback is not a callable function
if (!isCallable(callbackfn)) {
throw new TypeError('Array.prototype.forEach callback must be a function');
}
while (++i < length) {
if (i in self) {
// Invoke the callback function with call, passing arguments:
// context, property value, property key, thisArg object
if (typeof T === 'undefined') {
callbackfn(self[i], i, object);
} else {
callbackfn.call(T, self[i], i, object);
}
}
}
}
}, !properlyBoxesContext(ArrayPrototype.forEach));
// ES5 15.4.4.19
// http://es5.github.com/#x15.4.4.19
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/map
defineProperties(ArrayPrototype, {
map: function map(callbackfn/*, thisArg*/) {
var object = ES.ToObject(this);
var self = splitString && isString(this) ? strSplit(this, '') : object;
var length = ES.ToUint32(self.length);
var result = $Array(length);
var T;
if (arguments.length > 1) {
T = arguments[1];
}
// If no callback function or if callback is not a callable function
if (!isCallable(callbackfn)) {
throw new TypeError('Array.prototype.map callback must be a function');
}
for (var i = 0; i < length; i++) {
if (i in self) {
if (typeof T === 'undefined') {
result[i] = callbackfn(self[i], i, object);
} else {
result[i] = callbackfn.call(T, self[i], i, object);
}
}
}
return result;
}
}, !properlyBoxesContext(ArrayPrototype.map));
// ES5 15.4.4.20
// http://es5.github.com/#x15.4.4.20
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/filter
defineProperties(ArrayPrototype, {
filter: function filter(callbackfn/*, thisArg*/) {
var object = ES.ToObject(this);
var self = splitString && isString(this) ? strSplit(this, '') : object;
var length = ES.ToUint32(self.length);
var result = [];
var value;
var T;
if (arguments.length > 1) {
T = arguments[1];
}
// If no callback function or if callback is not a callable function
if (!isCallable(callbackfn)) {
throw new TypeError('Array.prototype.filter callback must be a function');
}
for (var i = 0; i < length; i++) {
if (i in self) {
value = self[i];
if (typeof T === 'undefined' ? callbackfn(value, i, object) : callbackfn.call(T, value, i, object)) {
pushCall(result, value);
}
}
}
return result;
}
}, !properlyBoxesContext(ArrayPrototype.filter));
// ES5 15.4.4.16
// http://es5.github.com/#x15.4.4.16
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/every
defineProperties(ArrayPrototype, {
every: function every(callbackfn/*, thisArg*/) {
var object = ES.ToObject(this);
var self = splitString && isString(this) ? strSplit(this, '') : object;
var length = ES.ToUint32(self.length);
var T;
if (arguments.length > 1) {
T = arguments[1];
}
// If no callback function or if callback is not a callable function
if (!isCallable(callbackfn)) {
throw new TypeError('Array.prototype.every callback must be a function');
}
for (var i = 0; i < length; i++) {
if (i in self && !(typeof T === 'undefined' ? callbackfn(self[i], i, object) : callbackfn.call(T, self[i], i, object))) {
return false;
}
}
return true;
}
}, !properlyBoxesContext(ArrayPrototype.every));
// ES5 15.4.4.17
// http://es5.github.com/#x15.4.4.17
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/some
defineProperties(ArrayPrototype, {
some: function some(callbackfn/*, thisArg */) {
var object = ES.ToObject(this);
var self = splitString && isString(this) ? strSplit(this, '') : object;
var length = ES.ToUint32(self.length);
var T;
if (arguments.length > 1) {
T = arguments[1];
}
// If no callback function or if callback is not a callable function
if (!isCallable(callbackfn)) {
throw new TypeError('Array.prototype.some callback must be a function');
}
for (var i = 0; i < length; i++) {
if (i in self && (typeof T === 'undefined' ? callbackfn(self[i], i, object) : callbackfn.call(T, self[i], i, object))) {
return true;
}
}
return false;
}
}, !properlyBoxesContext(ArrayPrototype.some));
// ES5 15.4.4.21
// http://es5.github.com/#x15.4.4.21
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduce
var reduceCoercesToObject = false;
if (ArrayPrototype.reduce) {
reduceCoercesToObject = typeof ArrayPrototype.reduce.call('es5', function (_, __, ___, list) {
return list;
}) === 'object';
}
defineProperties(ArrayPrototype, {
reduce: function reduce(callbackfn/*, initialValue*/) {
var object = ES.ToObject(this);
var self = splitString && isString(this) ? strSplit(this, '') : object;
var length = ES.ToUint32(self.length);
// If no callback function or if callback is not a callable function
if (!isCallable(callbackfn)) {
throw new TypeError('Array.prototype.reduce callback must be a function');
}
// no value to return if no initial value and an empty array
if (length === 0 && arguments.length === 1) {
throw new TypeError('reduce of empty array with no initial value');
}
var i = 0;
var result;
if (arguments.length >= 2) {
result = arguments[1];
} else {
do {
if (i in self) {
result = self[i++];
break;
}
// if array contains no values, no initial value to return
if (++i >= length) {
throw new TypeError('reduce of empty array with no initial value');
}
} while (true);
}
for (; i < length; i++) {
if (i in self) {
result = callbackfn(result, self[i], i, object);
}
}
return result;
}
}, !reduceCoercesToObject);
// ES5 15.4.4.22
// http://es5.github.com/#x15.4.4.22
// https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array/reduceRight
var reduceRightCoercesToObject = false;
if (ArrayPrototype.reduceRight) {
reduceRightCoercesToObject = typeof ArrayPrototype.reduceRight.call('es5', function (_, __, ___, list) {
return list;
}) === 'object';
}
defineProperties(ArrayPrototype, {
reduceRight: function reduceRight(callbackfn/*, initial*/) {
var object = ES.ToObject(this);
var self = splitString && isString(this) ? strSplit(this, '') : object;
var length = ES.ToUint32(self.length);
// If no callback function or if callback is not a callable function
if (!isCallable(callbackfn)) {
throw new TypeError('Array.prototype.reduceRight callback must be a function');
}
// no value to return if no initial value, empty array
if (length === 0 && arguments.length === 1) {
throw new TypeError('reduceRight of empty array with no initial value');
}
var result;
var i = length - 1;
if (arguments.length >= 2) {
result = arguments[1];
} else {
do {
if (i in self) {
result = self[i--];
break;
}
// if array contains no values, no initial value to return
if (--i < 0) {
throw new TypeError('reduceRight of empty array with no initial value');
}
} while (true);
}
if (i < 0) {
return result;
}
do {
if (i in self) {
result = callbackfn(result, self[i], i, object);
}
} while (i--);
return result;
}
}, !reduceRightCoercesToObject);
// ES5 15.4.4.14
// http://es5.github.com/#x15.4.4.14
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf
var hasFirefox2IndexOfBug = ArrayPrototype.indexOf && [0, 1].indexOf(1, 2) !== -1;
defineProperties(ArrayPrototype, {
indexOf: function indexOf(searchElement/*, fromIndex */) {
var self = splitString && isString(this) ? strSplit(this, '') : ES.ToObject(this);
var length = ES.ToUint32(self.length);
if (length === 0) {
return -1;
}
var i = 0;
if (arguments.length > 1) {
i = ES.ToInteger(arguments[1]);
}
// handle negative indices
i = i >= 0 ? i : max(0, length + i);
for (; i < length; i++) {
if (i in self && self[i] === searchElement) {
return i;
}
}
return -1;
}
}, hasFirefox2IndexOfBug);
// ES5 15.4.4.15
// http://es5.github.com/#x15.4.4.15
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/lastIndexOf
var hasFirefox2LastIndexOfBug = ArrayPrototype.lastIndexOf && [0, 1].lastIndexOf(0, -3) !== -1;
defineProperties(ArrayPrototype, {
lastIndexOf: function lastIndexOf(searchElement/*, fromIndex */) {
var self = splitString && isString(this) ? strSplit(this, '') : ES.ToObject(this);
var length = ES.ToUint32(self.length);
if (length === 0) {
return -1;
}
var i = length - 1;
if (arguments.length > 1) {
i = min(i, ES.ToInteger(arguments[1]));
}
// handle negative indices
i = i >= 0 ? i : length - Math.abs(i);
for (; i >= 0; i--) {
if (i in self && searchElement === self[i]) {
return i;
}
}
return -1;
}
}, hasFirefox2LastIndexOfBug);
// ES5 15.4.4.12
// http://es5.github.com/#x15.4.4.12
var spliceNoopReturnsEmptyArray = (function () {
var a = [1, 2];
var result = a.splice();
return a.length === 2 && isArray(result) && result.length === 0;
}());
defineProperties(ArrayPrototype, {
// Safari 5.0 bug where .splice() returns undefined
splice: function splice(start, deleteCount) {
if (arguments.length === 0) {
return [];
} else {
return array_splice.apply(this, arguments);
}
}
}, !spliceNoopReturnsEmptyArray);
var spliceWorksWithEmptyObject = (function () {
var obj = {};
ArrayPrototype.splice.call(obj, 0, 0, 1);
return obj.length === 1;
}());
defineProperties(ArrayPrototype, {
splice: function splice(start, deleteCount) {
if (arguments.length === 0) { return []; }
var args = arguments;
this.length = max(ES.ToInteger(this.length), 0);
if (arguments.length > 0 && typeof deleteCount !== 'number') {
args = arraySlice(arguments);
if (args.length < 2) {
pushCall(args, this.length - start);
} else {
args[1] = ES.ToInteger(deleteCount);
}
}
return array_splice.apply(this, args);
}
}, !spliceWorksWithEmptyObject);
var spliceWorksWithLargeSparseArrays = (function () {
// Per https://github.com/es-shims/es5-shim/issues/295
// Safari 7/8 breaks with sparse arrays of size 1e5 or greater
var arr = new $Array(1e5);
// note: the index MUST be 8 or larger or the test will false pass
arr[8] = 'x';
arr.splice(1, 1);
// note: this test must be defined *after* the indexOf shim
// per https://github.com/es-shims/es5-shim/issues/313
return arr.indexOf('x') === 7;
}());
var spliceWorksWithSmallSparseArrays = (function () {
// Per https://github.com/es-shims/es5-shim/issues/295
// Opera 12.15 breaks on this, no idea why.
var n = 256;
var arr = [];
arr[n] = 'a';
arr.splice(n + 1, 0, 'b');
return arr[n] === 'a';
}());
defineProperties(ArrayPrototype, {
splice: function splice(start, deleteCount) {
var O = ES.ToObject(this);
var A = [];
var len = ES.ToUint32(O.length);
var relativeStart = ES.ToInteger(start);
var actualStart = relativeStart < 0 ? max((len + relativeStart), 0) : min(relativeStart, len);
var actualDeleteCount = min(max(ES.ToInteger(deleteCount), 0), len - actualStart);
var k = 0;
var from;
while (k < actualDeleteCount) {
from = $String(actualStart + k);
if (owns(O, from)) {
A[k] = O[from];
}
k += 1;
}
var items = arraySlice(arguments, 2);
var itemCount = items.length;
var to;
if (itemCount < actualDeleteCount) {
k = actualStart;
var maxK = len - actualDeleteCount;
while (k < maxK) {
from = $String(k + actualDeleteCount);
to = $String(k + itemCount);
if (owns(O, from)) {
O[to] = O[from];
} else {
delete O[to];
}
k += 1;
}
k = len;
var minK = len - actualDeleteCount + itemCount;
while (k > minK) {
delete O[k - 1];
k -= 1;
}
} else if (itemCount > actualDeleteCount) {
k = len - actualDeleteCount;
while (k > actualStart) {
from = $String(k + actualDeleteCount - 1);
to = $String(k + itemCount - 1);
if (owns(O, from)) {
O[to] = O[from];
} else {
delete O[to];
}
k -= 1;
}
}
k = actualStart;
for (var i = 0; i < items.length; ++i) {
O[k] = items[i];
k += 1;
}
O.length = len - actualDeleteCount + itemCount;
return A;
}
}, !spliceWorksWithLargeSparseArrays || !spliceWorksWithSmallSparseArrays);
var originalJoin = ArrayPrototype.join;
var hasStringJoinBug;
try {
hasStringJoinBug = Array.prototype.join.call('123', ',') !== '1,2,3';
} catch (e) {
hasStringJoinBug = true;
}
if (hasStringJoinBug) {
defineProperties(ArrayPrototype, {
join: function join(separator) {
var sep = typeof separator === 'undefined' ? ',' : separator;
return originalJoin.call(isString(this) ? strSplit(this, '') : this, sep);
}
}, hasStringJoinBug);
}
var hasJoinUndefinedBug = [1, 2].join(undefined) !== '1,2';
if (hasJoinUndefinedBug) {
defineProperties(ArrayPrototype, {
join: function join(separator) {
var sep = typeof separator === 'undefined' ? ',' : separator;
return originalJoin.call(this, sep);
}
}, hasJoinUndefinedBug);
}
var pushShim = function push(item) {
var O = ES.ToObject(this);
var n = ES.ToUint32(O.length);
var i = 0;
while (i < arguments.length) {
O[n + i] = arguments[i];
i += 1;
}
O.length = n + i;
return n + i;
};
var pushIsNotGeneric = (function () {
var obj = {};
var result = Array.prototype.push.call(obj, undefined);
return result !== 1 || obj.length !== 1 || typeof obj[0] !== 'undefined' || !owns(obj, 0);
}());
defineProperties(ArrayPrototype, {
push: function push(item) {
if (isArray(this)) {
return array_push.apply(this, arguments);
}
return pushShim.apply(this, arguments);
}
}, pushIsNotGeneric);
// This fixes a very weird bug in Opera 10.6 when pushing `undefined
var pushUndefinedIsWeird = (function () {
var arr = [];
var result = arr.push(undefined);
return result !== 1 || arr.length !== 1 || typeof arr[0] !== 'undefined' || !owns(arr, 0);
}());
defineProperties(ArrayPrototype, { push: pushShim }, pushUndefinedIsWeird);
// ES5 15.2.3.14
// http://es5.github.io/#x15.4.4.10
// Fix boxed string bug
defineProperties(ArrayPrototype, {
slice: function (start, end) {
var arr = isString(this) ? strSplit(this, '') : this;
return arraySliceApply(arr, arguments);
}
}, splitString);
var sortIgnoresNonFunctions = (function () {
try {
[1, 2].sort(null);
[1, 2].sort({});
return true;
} catch (e) { /**/ }
return false;
}());
var sortThrowsOnRegex = (function () {
// this is a problem in Firefox 4, in which `typeof /a/ === 'function'`
try {
[1, 2].sort(/a/);
return false;
} catch (e) { /**/ }
return true;
}());
var sortIgnoresUndefined = (function () {
// applies in IE 8, for one.
try {
[1, 2].sort(undefined);
return true;
} catch (e) { /**/ }
return false;
}());
defineProperties(ArrayPrototype, {
sort: function sort(compareFn) {
if (typeof compareFn === 'undefined') {
return arraySort(this);
}
if (!isCallable(compareFn)) {
throw new TypeError('Array.prototype.sort callback must be a function');
}
return arraySort(this, compareFn);
}
}, sortIgnoresNonFunctions || !sortIgnoresUndefined || !sortThrowsOnRegex);
//
// Object
// ======
//
// ES5 15.2.3.14
// http://es5.github.com/#x15.2.3.14
// http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation
var hasDontEnumBug = !({ 'toString': null }).propertyIsEnumerable('toString');
var hasProtoEnumBug = function () {}.propertyIsEnumerable('prototype');
var hasStringEnumBug = !owns('x', '0');
var equalsConstructorPrototype = function (o) {
var ctor = o.constructor;
return ctor && ctor.prototype === o;
};
var blacklistedKeys = {
$window: true,
$console: true,
$parent: true,
$self: true,
$frame: true,
$frames: true,
$frameElement: true,
$webkitIndexedDB: true,
$webkitStorageInfo: true,
$external: true
};
var hasAutomationEqualityBug = (function () {
/* globals window */
if (typeof window === 'undefined') { return false; }
for (var k in window) {
try {
if (!blacklistedKeys['$' + k] && owns(window, k) && window[k] !== null && typeof window[k] === 'object') {
equalsConstructorPrototype(window[k]);
}
} catch (e) {
return true;
}
}
return false;
}());
var equalsConstructorPrototypeIfNotBuggy = function (object) {
if (typeof window === 'undefined' || !hasAutomationEqualityBug) { return equalsConstructorPrototype(object); }
try {
return equalsConstructorPrototype(object);
} catch (e) {
return false;
}
};
var dontEnums = [
'toString',
'toLocaleString',
'valueOf',
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
'constructor'
];
var dontEnumsLength = dontEnums.length;
// taken directly from https://github.com/ljharb/is-arguments/blob/master/index.js
// can be replaced with require('is-arguments') if we ever use a build process instead
var isStandardArguments = function isArguments(value) {
return toStr(value) === '[object Arguments]';
};
var isLegacyArguments = function isArguments(value) {
return value !== null &&
typeof value === 'object' &&
typeof value.length === 'number' &&
value.length >= 0 &&
!isArray(value) &&
isCallable(value.callee);
};
var isArguments = isStandardArguments(arguments) ? isStandardArguments : isLegacyArguments;
defineProperties($Object, {
keys: function keys(object) {
var isFn = isCallable(object);
var isArgs = isArguments(object);
var isObject = object !== null && typeof object === 'object';
var isStr = isObject && isString(object);
if (!isObject && !isFn && !isArgs) {
throw new TypeError('Object.keys called on a non-object');
}
var theKeys = [];
var skipProto = hasProtoEnumBug && isFn;
if ((isStr && hasStringEnumBug) || isArgs) {
for (var i = 0; i < object.length; ++i) {
pushCall(theKeys, $String(i));
}
}
if (!isArgs) {
for (var name in object) {
if (!(skipProto && name === 'prototype') && owns(object, name)) {
pushCall(theKeys, $String(name));
}
}
}
if (hasDontEnumBug) {
var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
for (var j = 0; j < dontEnumsLength; j++) {
var dontEnum = dontEnums[j];
if (!(skipConstructor && dontEnum === 'constructor') && owns(object, dontEnum)) {
pushCall(theKeys, dontEnum);
}
}
}
return theKeys;
}
});
var keysWorksWithArguments = $Object.keys && (function () {
// Safari 5.0 bug
return $Object.keys(arguments).length === 2;
}(1, 2));
var keysHasArgumentsLengthBug = $Object.keys && (function () {
var argKeys = $Object.keys(arguments);
return arguments.length !== 1 || argKeys.length !== 1 || argKeys[0] !== 1;
}(1));
var originalKeys = $Object.keys;
defineProperties($Object, {
keys: function keys(object) {
if (isArguments(object)) {
return originalKeys(arraySlice(object));
} else {
return originalKeys(object);
}
}
}, !keysWorksWithArguments || keysHasArgumentsLengthBug);
//
// Date
// ====
//
var hasNegativeMonthYearBug = new Date(-3509827329600292).getUTCMonth() !== 0;
var aNegativeTestDate = new Date(-1509842289600292);
var aPositiveTestDate = new Date(1449662400000);
var hasToUTCStringFormatBug = aNegativeTestDate.toUTCString() !== 'Mon, 01 Jan -45875 11:59:59 GMT';
var hasToDateStringFormatBug;
var hasToStringFormatBug;
var timeZoneOffset = aNegativeTestDate.getTimezoneOffset();
if (timeZoneOffset < -720) {
hasToDateStringFormatBug = aNegativeTestDate.toDateString() !== 'Tue Jan 02 -45875';
hasToStringFormatBug = !(/^Thu Dec 10 2015 \d\d:\d\d:\d\d GMT[-\+]\d\d\d\d(?: |$)/).test(aPositiveTestDate.toString());
} else {
hasToDateStringFormatBug = aNegativeTestDate.toDateString() !== 'Mon Jan 01 -45875';
hasToStringFormatBug = !(/^Wed Dec 09 2015 \d\d:\d\d:\d\d GMT[-\+]\d\d\d\d(?: |$)/).test(aPositiveTestDate.toString());
}
var originalGetFullYear = call.bind(Date.prototype.getFullYear);
var originalGetMonth = call.bind(Date.prototype.getMonth);
var originalGetDate = call.bind(Date.prototype.getDate);
var originalGetUTCFullYear = call.bind(Date.prototype.getUTCFullYear);
var originalGetUTCMonth = call.bind(Date.prototype.getUTCMonth);
var originalGetUTCDate = call.bind(Date.prototype.getUTCDate);
var originalGetUTCDay = call.bind(Date.prototype.getUTCDay);
var originalGetUTCHours = call.bind(Date.prototype.getUTCHours);
var originalGetUTCMinutes = call.bind(Date.prototype.getUTCMinutes);
var originalGetUTCSeconds = call.bind(Date.prototype.getUTCSeconds);
var originalGetUTCMilliseconds = call.bind(Date.prototype.getUTCMilliseconds);
var dayName = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
var monthName = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
var daysInMonth = function daysInMonth(month, year) {
return originalGetDate(new Date(year, month, 0));
};
defineProperties(Date.prototype, {
getFullYear: function getFullYear() {
if (!this || !(this instanceof Date)) {
throw new TypeError('this is not a Date object.');
}
var year = originalGetFullYear(this);
if (year < 0 && originalGetMonth(this) > 11) {
return year + 1;
}
return year;
},
getMonth: function getMonth() {
if (!this || !(this instanceof Date)) {
throw new TypeError('this is not a Date object.');
}
var year = originalGetFullYear(this);
var month = originalGetMonth(this);
if (year < 0 && month > 11) {
return 0;
}
return month;
},
getDate: function getDate() {
if (!this || !(this instanceof Date)) {
throw new TypeError('this is not a Date object.');
}
var year = originalGetFullYear(this);
var month = originalGetMonth(this);
var date = originalGetDate(this);
if (year < 0 && month > 11) {
if (month === 12) {
return date;
}
var days = daysInMonth(0, year + 1);
return (days - date) + 1;
}
return date;
},
getUTCFullYear: function getUTCFullYear() {
if (!this || !(this instanceof Date)) {
throw new TypeError('this is not a Date object.');
}
var year = originalGetUTCFullYear(this);
if (year < 0 && originalGetUTCMonth(this) > 11) {
return year + 1;
}
return year;
},
getUTCMonth: function getUTCMonth() {
if (!this || !(this instanceof Date)) {
throw new TypeError('this is not a Date object.');
}
var year = originalGetUTCFullYear(this);
var month = originalGetUTCMonth(this);
if (year < 0 && month > 11) {
return 0;
}
return month;
},
getUTCDate: function getUTCDate() {
if (!this || !(this instanceof Date)) {
throw new TypeError('this is not a Date object.');
}
var year = originalGetUTCFullYear(this);
var month = originalGetUTCMonth(this);
var date = originalGetUTCDate(this);
if (year < 0 && month > 11) {
if (month === 12) {
return date;
}
var days = daysInMonth(0, year + 1);
return (days - date) + 1;
}
return date;
}
}, hasNegativeMonthYearBug);
defineProperties(Date.prototype, {
toUTCString: function toUTCString() {
if (!this || !(this instanceof Date)) {
throw new TypeError('this is not a Date object.');
}
var day = originalGetUTCDay(this);
var date = originalGetUTCDate(this);
var month = originalGetUTCMonth(this);
var year = originalGetUTCFullYear(this);
var hour = originalGetUTCHours(this);
var minute = originalGetUTCMinutes(this);
var second = originalGetUTCSeconds(this);
return dayName[day] + ', ' +
(date < 10 ? '0' + date : date) + ' ' +
monthName[month] + ' ' +
year + ' ' +
(hour < 10 ? '0' + hour : hour) + ':' +
(minute < 10 ? '0' + minute : minute) + ':' +
(second < 10 ? '0' + second : second) + ' GMT';
}
}, hasNegativeMonthYearBug || hasToUTCStringFormatBug);
// Opera 12 has `,`
defineProperties(Date.prototype, {
toDateString: function toDateString() {
if (!this || !(this instanceof Date)) {
throw new TypeError('this is not a Date object.');
}
var day = this.getDay();
var date = this.getDate();
var month = this.getMonth();
var year = this.getFullYear();
return dayName[day] + ' ' +
monthName[month] + ' ' +
(date < 10 ? '0' + date : date) + ' ' +
year;
}
}, hasNegativeMonthYearBug || hasToDateStringFormatBug);
// can't use defineProperties here because of toString enumeration issue in IE <= 8
if (hasNegativeMonthYearBug || hasToStringFormatBug) {
Date.prototype.toString = function toString() {
if (!this || !(this instanceof Date)) {
throw new TypeError('this is not a Date object.');
}
var day = this.getDay();
var date = this.getDate();
var month = this.getMonth();
var year = this.getFullYear();
var hour = this.getHours();
var minute = this.getMinutes();
var second = this.getSeconds();
var timezoneOffset = this.getTimezoneOffset();
var hoursOffset = Math.floor(Math.abs(timezoneOffset) / 60);
var minutesOffset = Math.floor(Math.abs(timezoneOffset) % 60);
return dayName[day] + ' ' +
monthName[month] + ' ' +
(date < 10 ? '0' + date : date) + ' ' +
year + ' ' +
(hour < 10 ? '0' + hour : hour) + ':' +
(minute < 10 ? '0' + minute : minute) + ':' +
(second < 10 ? '0' + second : second) + ' GMT' +
(timezoneOffset > 0 ? '-' : '+') +
(hoursOffset < 10 ? '0' + hoursOffset : hoursOffset) +
(minutesOffset < 10 ? '0' + minutesOffset : minutesOffset);
};
if (supportsDescriptors) {
$Object.defineProperty(Date.prototype, 'toString', {
configurable: true,
enumerable: false,
writable: true
});
}
}
// ES5 15.9.5.43
// http://es5.github.com/#x15.9.5.43
// This function returns a String value represent the instance in time
// represented by this Date object. The format of the String is the Date Time
// string format defined in 15.9.1.15. All fields are present in the String.
// The time zone is always UTC, denoted by the suffix Z. If the time value of
// this object is not a finite Number a RangeError exception is thrown.
var negativeDate = -62198755200000;
var negativeYearString = '-000001';
var hasNegativeDateBug = Date.prototype.toISOString && new Date(negativeDate).toISOString().indexOf(negativeYearString) === -1;
var hasSafari51DateBug = Date.prototype.toISOString && new Date(-1).toISOString() !== '1969-12-31T23:59:59.999Z';
var getTime = call.bind(Date.prototype.getTime);
defineProperties(Date.prototype, {
toISOString: function toISOString() {
if (!isFinite(this) || !isFinite(getTime(this))) {
// Adope Photoshop requires the second check.
throw new RangeError('Date.prototype.toISOString called on non-finite value.');
}
var year = originalGetUTCFullYear(this);
var month = originalGetUTCMonth(this);
// see https://github.com/es-shims/es5-shim/issues/111
year += Math.floor(month / 12);
month = (month % 12 + 12) % 12;
// the date time string format is specified in 15.9.1.15.
var result = [month + 1, originalGetUTCDate(this), originalGetUTCHours(this), originalGetUTCMinutes(this), originalGetUTCSeconds(this)];
year = (
(year < 0 ? '-' : (year > 9999 ? '+' : '')) +
strSlice('00000' + Math.abs(year), (0 <= year && year <= 9999) ? -4 : -6)
);
for (var i = 0; i < result.length; ++i) {
// pad months, days, hours, minutes, and seconds to have two digits.
result[i] = strSlice('00' + result[i], -2);
}
// pad milliseconds to have three digits.
return (
year + '-' + arraySlice(result, 0, 2).join('-') +
'T' + arraySlice(result, 2).join(':') + '.' +
strSlice('000' + originalGetUTCMilliseconds(this), -3) + 'Z'
);
}
}, hasNegativeDateBug || hasSafari51DateBug);
// ES5 15.9.5.44
// http://es5.github.com/#x15.9.5.44
// This function provides a String representation of a Date object for use by
// JSON.stringify (15.12.3).
var dateToJSONIsSupported = (function () {
try {
return Date.prototype.toJSON &&
new Date(NaN).toJSON() === null &&
new Date(negativeDate).toJSON().indexOf(negativeYearString) !== -1 &&
Date.prototype.toJSON.call({ // generic
toISOString: function () { return true; }
});
} catch (e) {
return false;
}
}());
if (!dateToJSONIsSupported) {
Date.prototype.toJSON = function toJSON(key) {
// When the toJSON method is called with argument key, the following
// steps are taken:
// 1. Let O be the result of calling ToObject, giving it the this
// value as its argument.
// 2. Let tv be ES.ToPrimitive(O, hint Number).
var O = $Object(this);
var tv = ES.ToPrimitive(O);
// 3. If tv is a Number and is not finite, return null.
if (typeof tv === 'number' && !isFinite(tv)) {
return null;
}
// 4. Let toISO be the result of calling the [[Get]] internal method of
// O with argument "toISOString".
var toISO = O.toISOString;
// 5. If IsCallable(toISO) is false, throw a TypeError exception.
if (!isCallable(toISO)) {
throw new TypeError('toISOString property is not callable');
}
// 6. Return the result of calling the [[Call]] internal method of
// toISO with O as the this value and an empty argument list.
return toISO.call(O);
// NOTE 1 The argument is ignored.
// NOTE 2 The toJSON function is intentionally generic; it does not
// require that its this value be a Date object. Therefore, it can be
// transferred to other kinds of objects for use as a method. However,
// it does require that any such object have a toISOString method. An
// object is free to use the argument key to filter its
// stringification.
};
}
// ES5 15.9.4.2
// http://es5.github.com/#x15.9.4.2
// based on work shared by Daniel Friesen (dantman)
// http://gist.github.com/303249
var supportsExtendedYears = Date.parse('+033658-09-27T01:46:40.000Z') === 1e15;
var acceptsInvalidDates = !isNaN(Date.parse('2012-04-04T24:00:00.500Z')) || !isNaN(Date.parse('2012-11-31T23:59:59.000Z')) || !isNaN(Date.parse('2012-12-31T23:59:60.000Z'));
var doesNotParseY2KNewYear = isNaN(Date.parse('2000-01-01T00:00:00.000Z'));
if (doesNotParseY2KNewYear || acceptsInvalidDates || !supportsExtendedYears) {
// XXX global assignment won't work in embeddings that use
// an alternate object for the context.
/* global Date: true */
/* eslint-disable no-undef */
var maxSafeUnsigned32Bit = Math.pow(2, 31) - 1;
var hasSafariSignedIntBug = isActualNaN(new Date(1970, 0, 1, 0, 0, 0, maxSafeUnsigned32Bit + 1).getTime());
/* eslint-disable no-implicit-globals */
Date = (function (NativeDate) {
/* eslint-enable no-implicit-globals */
/* eslint-enable no-undef */
// Date.length === 7
var DateShim = function Date(Y, M, D, h, m, s, ms) {
var length = arguments.length;
var date;
if (this instanceof NativeDate) {
var seconds = s;
var millis = ms;
if (hasSafariSignedIntBug && length >= 7 && ms > maxSafeUnsigned32Bit) {
// work around a Safari 8/9 bug where it treats the seconds as signed
var msToShift = Math.floor(ms / maxSafeUnsigned32Bit) * maxSafeUnsigned32Bit;
var sToShift = Math.floor(msToShift / 1e3);
seconds += sToShift;
millis -= sToShift * 1e3;
}
date = length === 1 && $String(Y) === Y ? // isString(Y)
// We explicitly pass it through parse:
new NativeDate(DateShim.parse(Y)) :
// We have to manually make calls depending on argument
// length here
length >= 7 ? new NativeDate(Y, M, D, h, m, seconds, millis) :
length >= 6 ? new NativeDate(Y, M, D, h, m, seconds) :
length >= 5 ? new NativeDate(Y, M, D, h, m) :
length >= 4 ? new NativeDate(Y, M, D, h) :
length >= 3 ? new NativeDate(Y, M, D) :
length >= 2 ? new NativeDate(Y, M) :
length >= 1 ? new NativeDate(Y instanceof NativeDate ? +Y : Y) :
new NativeDate();
} else {
date = NativeDate.apply(this, arguments);
}
if (!isPrimitive(date)) {
// Prevent mixups with unfixed Date object
defineProperties(date, { constructor: DateShim }, true);
}
return date;
};
// 15.9.1.15 Date Time String Format.
var isoDateExpression = new RegExp('^' +
'(\\d{4}|[+-]\\d{6})' + // four-digit year capture or sign +
// 6-digit extended year
'(?:-(\\d{2})' + // optional month capture
'(?:-(\\d{2})' + // optional day capture
'(?:' + // capture hours:minutes:seconds.milliseconds
'T(\\d{2})' + // hours capture
':(\\d{2})' + // minutes capture
'(?:' + // optional :seconds.milliseconds
':(\\d{2})' + // seconds capture
'(?:(\\.\\d{1,}))?' + // milliseconds capture
')?' +
'(' + // capture UTC offset component
'Z|' + // UTC capture
'(?:' + // offset specifier +/-hours:minutes
'([-+])' + // sign capture
'(\\d{2})' + // hours offset capture
':(\\d{2})' + // minutes offset capture
')' +
')?)?)?)?' +
'$');
var months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365];
var dayFromMonth = function dayFromMonth(year, month) {
var t = month > 1 ? 1 : 0;
return (
months[month] +
Math.floor((year - 1969 + t) / 4) -
Math.floor((year - 1901 + t) / 100) +
Math.floor((year - 1601 + t) / 400) +
365 * (year - 1970)
);
};
var toUTC = function toUTC(t) {
var s = 0;
var ms = t;
if (hasSafariSignedIntBug && ms > maxSafeUnsigned32Bit) {
// work around a Safari 8/9 bug where it treats the seconds as signed
var msToShift = Math.floor(ms / maxSafeUnsigned32Bit) * maxSafeUnsigned32Bit;
var sToShift = Math.floor(msToShift / 1e3);
s += sToShift;
ms -= sToShift * 1e3;
}
return $Number(new NativeDate(1970, 0, 1, 0, 0, s, ms));
};
// Copy any custom methods a 3rd party library may have added
for (var key in NativeDate) {
if (owns(NativeDate, key)) {
DateShim[key] = NativeDate[key];
}
}
// Copy "native" methods explicitly; they may be non-enumerable
defineProperties(DateShim, {
now: NativeDate.now,
UTC: NativeDate.UTC
}, true);
DateShim.prototype = NativeDate.prototype;
defineProperties(DateShim.prototype, {
constructor: DateShim
}, true);
// Upgrade Date.parse to handle simplified ISO 8601 strings
var parseShim = function parse(string) {
var match = isoDateExpression.exec(string);
if (match) {
// parse months, days, hours, minutes, seconds, and milliseconds
// provide default values if necessary
// parse the UTC offset component
var year = $Number(match[1]),
month = $Number(match[2] || 1) - 1,
day = $Number(match[3] || 1) - 1,
hour = $Number(match[4] || 0),
minute = $Number(match[5] || 0),
second = $Number(match[6] || 0),
millisecond = Math.floor($Number(match[7] || 0) * 1000),
// When time zone is missed, local offset should be used
// (ES 5.1 bug)
// see https://bugs.ecmascript.org/show_bug.cgi?id=112
isLocalTime = Boolean(match[4] && !match[8]),
signOffset = match[9] === '-' ? 1 : -1,
hourOffset = $Number(match[10] || 0),
minuteOffset = $Number(match[11] || 0),
result;
var hasMinutesOrSecondsOrMilliseconds = minute > 0 || second > 0 || millisecond > 0;
if (
hour < (hasMinutesOrSecondsOrMilliseconds ? 24 : 25) &&
minute < 60 && second < 60 && millisecond < 1000 &&
month > -1 && month < 12 && hourOffset < 24 &&
minuteOffset < 60 && // detect invalid offsets
day > -1 &&
day < (dayFromMonth(year, month + 1) - dayFromMonth(year, month))
) {
result = (
(dayFromMonth(year, month) + day) * 24 +
hour +
hourOffset * signOffset
) * 60;
result = (
(result + minute + minuteOffset * signOffset) * 60 +
second
) * 1000 + millisecond;
if (isLocalTime) {
result = toUTC(result);
}
if (-8.64e15 <= result && result <= 8.64e15) {
return result;
}
}
return NaN;
}
return NativeDate.parse.apply(this, arguments);
};
defineProperties(DateShim, { parse: parseShim });
return DateShim;
}(Date));
/* global Date: false */
}
// ES5 15.9.4.4
// http://es5.github.com/#x15.9.4.4
if (!Date.now) {
Date.now = function now() {
return new Date().getTime();
};
}
//
// Number
// ======
//
// ES5.1 15.7.4.5
// http://es5.github.com/#x15.7.4.5
var hasToFixedBugs = NumberPrototype.toFixed && (
(0.00008).toFixed(3) !== '0.000' ||
(0.9).toFixed(0) !== '1' ||
(1.255).toFixed(2) !== '1.25' ||
(1000000000000000128).toFixed(0) !== '1000000000000000128'
);
var toFixedHelpers = {
base: 1e7,
size: 6,
data: [0, 0, 0, 0, 0, 0],
multiply: function multiply(n, c) {
var i = -1;
var c2 = c;
while (++i < toFixedHelpers.size) {
c2 += n * toFixedHelpers.data[i];
toFixedHelpers.data[i] = c2 % toFixedHelpers.base;
c2 = Math.floor(c2 / toFixedHelpers.base);
}
},
divide: function divide(n) {
var i = toFixedHelpers.size;
var c = 0;
while (--i >= 0) {
c += toFixedHelpers.data[i];
toFixedHelpers.data[i] = Math.floor(c / n);
c = (c % n) * toFixedHelpers.base;
}
},
numToString: function numToString() {
var i = toFixedHelpers.size;
var s = '';
while (--i >= 0) {
if (s !== '' || i === 0 || toFixedHelpers.data[i] !== 0) {
var t = $String(toFixedHelpers.data[i]);
if (s === '') {
s = t;
} else {
s += strSlice('0000000', 0, 7 - t.length) + t;
}
}
}
return s;
},
pow: function pow(x, n, acc) {
return (n === 0 ? acc : (n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc)));
},
log: function log(x) {
var n = 0;
var x2 = x;
while (x2 >= 4096) {
n += 12;
x2 /= 4096;
}
while (x2 >= 2) {
n += 1;
x2 /= 2;
}
return n;
}
};
var toFixedShim = function toFixed(fractionDigits) {
var f, x, s, m, e, z, j, k;
// Test for NaN and round fractionDigits down
f = $Number(fractionDigits);
f = isActualNaN(f) ? 0 : Math.floor(f);
if (f < 0 || f > 20) {
throw new RangeError('Number.toFixed called with invalid number of decimals');
}
x = $Number(this);
if (isActualNaN(x)) {
return 'NaN';
}
// If it is too big or small, return the string value of the number
if (x <= -1e21 || x >= 1e21) {
return $String(x);
}
s = '';
if (x < 0) {
s = '-';
x = -x;
}
m = '0';
if (x > 1e-21) {
// 1e-21 < x < 1e21
// -70 < log2(x) < 70
e = toFixedHelpers.log(x * toFixedHelpers.pow(2, 69, 1)) - 69;
z = (e < 0 ? x * toFixedHelpers.pow(2, -e, 1) : x / toFixedHelpers.pow(2, e, 1));
z *= 0x10000000000000; // Math.pow(2, 52);
e = 52 - e;
// -18 < e < 122
// x = z / 2 ^ e
if (e > 0) {
toFixedHelpers.multiply(0, z);
j = f;
while (j >= 7) {
toFixedHelpers.multiply(1e7, 0);
j -= 7;
}
toFixedHelpers.multiply(toFixedHelpers.pow(10, j, 1), 0);
j = e - 1;
while (j >= 23) {
toFixedHelpers.divide(1 << 23);
j -= 23;
}
toFixedHelpers.divide(1 << j);
toFixedHelpers.multiply(1, 1);
toFixedHelpers.divide(2);
m = toFixedHelpers.numToString();
} else {
toFixedHelpers.multiply(0, z);
toFixedHelpers.multiply(1 << (-e), 0);
m = toFixedHelpers.numToString() + strSlice('0.00000000000000000000', 2, 2 + f);
}
}
if (f > 0) {
k = m.length;
if (k <= f) {
m = s + strSlice('0.0000000000000000000', 0, f - k + 2) + m;
} else {
m = s + strSlice(m, 0, k - f) + '.' + strSlice(m, k - f);
}
} else {
m = s + m;
}
return m;
};
defineProperties(NumberPrototype, { toFixed: toFixedShim }, hasToFixedBugs);
var hasToPrecisionUndefinedBug = (function () {
try {
return 1.0.toPrecision(undefined) === '1';
} catch (e) {
return true;
}
}());
var originalToPrecision = NumberPrototype.toPrecision;
defineProperties(NumberPrototype, {
toPrecision: function toPrecision(precision) {
return typeof precision === 'undefined' ? originalToPrecision.call(this) : originalToPrecision.call(this, precision);
}
}, hasToPrecisionUndefinedBug);
//
// String
// ======
//
// ES5 15.5.4.14
// http://es5.github.com/#x15.5.4.14
// [bugfix, IE lt 9, firefox 4, Konqueror, Opera, obscure browsers]
// Many browsers do not split properly with regular expressions or they
// do not perform the split correctly under obscure conditions.
// See http://blog.stevenlevithan.com/archives/cross-browser-split
// I've tested in many browsers and this seems to cover the deviant ones:
// 'ab'.split(/(?:ab)*/) should be ["", ""], not [""]
// '.'.split(/(.?)(.?)/) should be ["", ".", "", ""], not ["", ""]
// 'tesst'.split(/(s)*/) should be ["t", undefined, "e", "s", "t"], not
// [undefined, "t", undefined, "e", ...]
// ''.split(/.?/) should be [], not [""]
// '.'.split(/()()/) should be ["."], not ["", "", "."]
if (
'ab'.split(/(?:ab)*/).length !== 2 ||
'.'.split(/(.?)(.?)/).length !== 4 ||
'tesst'.split(/(s)*/)[1] === 't' ||
'test'.split(/(?:)/, -1).length !== 4 ||
''.split(/.?/).length ||
'.'.split(/()()/).length > 1
) {
(function () {
var compliantExecNpcg = typeof (/()??/).exec('')[1] === 'undefined'; // NPCG: nonparticipating capturing group
var maxSafe32BitInt = Math.pow(2, 32) - 1;
StringPrototype.split = function (separator, limit) {
var string = String(this);
if (typeof separator === 'undefined' && limit === 0) {
return [];
}
// If `separator` is not a regex, use native split
if (!isRegex(separator)) {
return strSplit(this, separator, limit);
}
var output = [];
var flags = (separator.ignoreCase ? 'i' : '') +
(separator.multiline ? 'm' : '') +
(separator.unicode ? 'u' : '') + // in ES6
(separator.sticky ? 'y' : ''), // Firefox 3+ and ES6
lastLastIndex = 0,
// Make `global` and avoid `lastIndex` issues by working with a copy
separator2, match, lastIndex, lastLength;
var separatorCopy = new RegExp(separator.source, flags + 'g');
if (!compliantExecNpcg) {
// Doesn't need flags gy, but they don't hurt
separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags);
}
/* Values for `limit`, per the spec:
* If undefined: 4294967295 // maxSafe32BitInt
* If 0, Infinity, or NaN: 0
* If positive number: limit = Math.floor(limit); if (limit > 4294967295) limit -= 4294967296;
* If negative number: 4294967296 - Math.floor(Math.abs(limit))
* If other: Type-convert, then use the above rules
*/
var splitLimit = typeof limit === 'undefined' ? maxSafe32BitInt : ES.ToUint32(limit);
match = separatorCopy.exec(string);
while (match) {
// `separatorCopy.lastIndex` is not reliable cross-browser
lastIndex = match.index + match[0].length;
if (lastIndex > lastLastIndex) {
pushCall(output, strSlice(string, lastLastIndex, match.index));
// Fix browsers whose `exec` methods don't consistently return `undefined` for
// nonparticipating capturing groups
if (!compliantExecNpcg && match.length > 1) {
/* eslint-disable no-loop-func */
match[0].replace(separator2, function () {
for (var i = 1; i < arguments.length - 2; i++) {
if (typeof arguments[i] === 'undefined') {
match[i] = void 0;
}
}
});
/* eslint-enable no-loop-func */
}
if (match.length > 1 && match.index < string.length) {
array_push.apply(output, arraySlice(match, 1));
}
lastLength = match[0].length;
lastLastIndex = lastIndex;
if (output.length >= splitLimit) {
break;
}
}
if (separatorCopy.lastIndex === match.index) {
separatorCopy.lastIndex++; // Avoid an infinite loop
}
match = separatorCopy.exec(string);
}
if (lastLastIndex === string.length) {
if (lastLength || !separatorCopy.test('')) {
pushCall(output, '');
}
} else {
pushCall(output, strSlice(string, lastLastIndex));
}
return output.length > splitLimit ? arraySlice(output, 0, splitLimit) : output;
};
}());
// [bugfix, chrome]
// If separator is undefined, then the result array contains just one String,
// which is the this value (converted to a String). If limit is not undefined,
// then the output array is truncated so that it contains no more than limit
// elements.
// "0".split(undefined, 0) -> []
} else if ('0'.split(void 0, 0).length) {
StringPrototype.split = function split(separator, limit) {
if (typeof separator === 'undefined' && limit === 0) { return []; }
return strSplit(this, separator, limit);
};
}
var str_replace = StringPrototype.replace;
var replaceReportsGroupsCorrectly = (function () {
var groups = [];
'x'.replace(/x(.)?/g, function (match, group) {
pushCall(groups, group);
});
return groups.length === 1 && typeof groups[0] === 'undefined';
}());
if (!replaceReportsGroupsCorrectly) {
StringPrototype.replace = function replace(searchValue, replaceValue) {
var isFn = isCallable(replaceValue);
var hasCapturingGroups = isRegex(searchValue) && (/\)[*?]/).test(searchValue.source);
if (!isFn || !hasCapturingGroups) {
return str_replace.call(this, searchValue, replaceValue);
} else {
var wrappedReplaceValue = function (match) {
var length = arguments.length;
var originalLastIndex = searchValue.lastIndex;
searchValue.lastIndex = 0;
var args = searchValue.exec(match) || [];
searchValue.lastIndex = originalLastIndex;
pushCall(args, arguments[length - 2], arguments[length - 1]);
return replaceValue.apply(this, args);
};
return str_replace.call(this, searchValue, wrappedReplaceValue);
}
};
}
// ECMA-262, 3rd B.2.3
// Not an ECMAScript standard, although ECMAScript 3rd Edition has a
// non-normative section suggesting uniform semantics and it should be
// normalized across all browsers
// [bugfix, IE lt 9] IE < 9 substr() with negative value not working in IE
var string_substr = StringPrototype.substr;
var hasNegativeSubstrBug = ''.substr && '0b'.substr(-1) !== 'b';
defineProperties(StringPrototype, {
substr: function substr(start, length) {
var normalizedStart = start;
if (start < 0) {
normalizedStart = max(this.length + start, 0);
}
return string_substr.call(this, normalizedStart, length);
}
}, hasNegativeSubstrBug);
// ES5 15.5.4.20
// whitespace from: http://es5.github.io/#x15.5.4.20
var ws = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' +
'\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028' +
'\u2029\uFEFF';
var zeroWidth = '\u200b';
var wsRegexChars = '[' + ws + ']';
var trimBeginRegexp = new RegExp('^' + wsRegexChars + wsRegexChars + '*');
var trimEndRegexp = new RegExp(wsRegexChars + wsRegexChars + '*$');
var hasTrimWhitespaceBug = StringPrototype.trim && (ws.trim() || !zeroWidth.trim());
defineProperties(StringPrototype, {
// http://blog.stevenlevithan.com/archives/faster-trim-javascript
// http://perfectionkills.com/whitespace-deviations/
trim: function trim() {
if (typeof this === 'undefined' || this === null) {
throw new TypeError("can't convert " + this + ' to object');
}
return $String(this).replace(trimBeginRegexp, '').replace(trimEndRegexp, '');
}
}, hasTrimWhitespaceBug);
var trim = call.bind(String.prototype.trim);
var hasLastIndexBug = StringPrototype.lastIndexOf && 'abcあい'.lastIndexOf('あい', 2) !== -1;
defineProperties(StringPrototype, {
lastIndexOf: function lastIndexOf(searchString) {
if (typeof this === 'undefined' || this === null) {
throw new TypeError("can't convert " + this + ' to object');
}
var S = $String(this);
var searchStr = $String(searchString);
var numPos = arguments.length > 1 ? $Number(arguments[1]) : NaN;
var pos = isActualNaN(numPos) ? Infinity : ES.ToInteger(numPos);
var start = min(max(pos, 0), S.length);
var searchLen = searchStr.length;
var k = start + searchLen;
while (k > 0) {
k = max(0, k - searchLen);
var index = strIndexOf(strSlice(S, k, start + searchLen), searchStr);
if (index !== -1) {
return k + index;
}
}
return -1;
}
}, hasLastIndexBug);
var originalLastIndexOf = StringPrototype.lastIndexOf;
defineProperties(StringPrototype, {
lastIndexOf: function lastIndexOf(searchString) {
return originalLastIndexOf.apply(this, arguments);
}
}, StringPrototype.lastIndexOf.length !== 1);
// ES-5 15.1.2.2
/* eslint-disable radix */
if (parseInt(ws + '08') !== 8 || parseInt(ws + '0x16') !== 22) {
/* eslint-enable radix */
/* global parseInt: true */
parseInt = (function (origParseInt) {
var hexRegex = /^[\-+]?0[xX]/;
return function parseInt(str, radix) {
var string = trim(str);
var defaultedRadix = $Number(radix) || (hexRegex.test(string) ? 16 : 10);
return origParseInt(string, defaultedRadix);
};
}(parseInt));
}
// https://es5.github.io/#x15.1.2.3
if (1 / parseFloat('-0') !== -Infinity) {
/* global parseFloat: true */
parseFloat = (function (origParseFloat) {
return function parseFloat(string) {
var inputString = trim(string);
var result = origParseFloat(inputString);
return result === 0 && strSlice(inputString, 0, 1) === '-' ? -0 : result;
};
}(parseFloat));
}
if (String(new RangeError('test')) !== 'RangeError: test') {
var errorToStringShim = function toString() {
if (typeof this === 'undefined' || this === null) {
throw new TypeError("can't convert " + this + ' to object');
}
var name = this.name;
if (typeof name === 'undefined') {
name = 'Error';
} else if (typeof name !== 'string') {
name = $String(name);
}
var msg = this.message;
if (typeof msg === 'undefined') {
msg = '';
} else if (typeof msg !== 'string') {
msg = $String(msg);
}
if (!name) {
return msg;
}
if (!msg) {
return name;
}
return name + ': ' + msg;
};
// can't use defineProperties here because of toString enumeration issue in IE <= 8
Error.prototype.toString = errorToStringShim;
}
if (supportsDescriptors) {
var ensureNonEnumerable = function (obj, prop) {
if (isEnum(obj, prop)) {
var desc = Object.getOwnPropertyDescriptor(obj, prop);
desc.enumerable = false;
Object.defineProperty(obj, prop, desc);
}
};
ensureNonEnumerable(Error.prototype, 'message');
if (Error.prototype.message !== '') {
Error.prototype.message = '';
}
ensureNonEnumerable(Error.prototype, 'name');
}
if (String(/a/mig) !== '/a/gim') {
var regexToString = function toString() {
var str = '/' + this.source + '/';
if (this.global) {
str += 'g';
}
if (this.ignoreCase) {
str += 'i';
}
if (this.multiline) {
str += 'm';
}
return str;
};
// can't use defineProperties here because of toString enumeration issue in IE <= 8
RegExp.prototype.toString = regexToString;
}
}));
{"version":3,"sources":["es5-shim.js"],"names":["root","factory","define","amd","exports","module","returnExports","this","$Array","Array","ArrayPrototype","prototype","$Object","Object","ObjectPrototype","$Function","Function","FunctionPrototype","$String","String","StringPrototype","$Number","Number","NumberPrototype","array_slice","slice","array_splice","splice","array_push","push","array_unshift","unshift","array_concat","concat","array_join","join","call","apply","max","Math","min","to_string","toString","hasToStringTag","Symbol","toStringTag","isCallable","fnToStr","constructorRegex","isES6ClassFn","value","fnStr","singleStripped","replace","multiStripped","spaceStripped","test","e","tryFunctionObject","fnClass","genClass","strClass","isRegex","regexExec","RegExp","exec","tryRegexExec","regexClass","isString","strValue","valueOf","tryStringObject","stringClass","supportsDescriptors","defineProperty","obj","enumerable","_","x","defineProperties","has","object","name","method","forceAssign","configurable","writable","map","hasOwnProperty","isPrimitive","input","type","isActualNaN","isNaN","ES","ToInteger","num","n","floor","abs","ToPrimitive","val","toStr","TypeError","ToObject","o","ToUint32","Empty","bind","that","target","args","arguments","bound","binder","result","boundLength","length","boundArgs","i","owns","arraySlice","arraySliceApply","strSlice","strSplit","split","strIndexOf","indexOf","pushCall","isEnum","propertyIsEnumerable","arraySort","sort","isArray","hasUnshiftReturnValueBug","boxedString","splitString","properlyBoxesContext","properlyBoxed","properlyBoxesNonStrict","properlyBoxesStrict","threwException","__","context","forEach","callbackfn","self","T","filter","every","some","reduceCoercesToObject","reduce","___","list","reduceRightCoercesToObject","reduceRight","hasFirefox2IndexOfBug","searchElement","hasFirefox2LastIndexOfBug","lastIndexOf","spliceNoopReturnsEmptyArray","a","start","deleteCount","spliceWorksWithEmptyObject","spliceWorksWithLargeSparseArrays","arr","spliceWorksWithSmallSparseArrays","O","A","len","relativeStart","actualStart","actualDeleteCount","k","from","items","itemCount","to","maxK","minK","originalJoin","hasStringJoinBug","separator","sep","hasJoinUndefinedBug","undefined","pushShim","item","pushIsNotGeneric","pushUndefinedIsWeird","end","sortIgnoresNonFunctions","sortThrowsOnRegex","sortIgnoresUndefined","compareFn","hasDontEnumBug","hasProtoEnumBug","hasStringEnumBug","equalsConstructorPrototype","ctor","constructor","blacklistedKeys","$window","$console","$parent","$self","$frame","$frames","$frameElement","$webkitIndexedDB","$webkitStorageInfo","$external","hasAutomationEqualityBug","window","equalsConstructorPrototypeIfNotBuggy","dontEnums","dontEnumsLength","isStandardArguments","isArguments","isLegacyArguments","callee","keys","isFn","isArgs","isObject","isStr","theKeys","skipProto","skipConstructor","j","dontEnum","keysWorksWithArguments","keysHasArgumentsLengthBug","argKeys","originalKeys","hasNegativeMonthYearBug","Date","getUTCMonth","aNegativeTestDate","aPositiveTestDate","hasToUTCStringFormatBug","toUTCString","hasToDateStringFormatBug","hasToStringFormatBug","timeZoneOffset","getTimezoneOffset","toDateString","originalGetFullYear","getFullYear","originalGetMonth","getMonth","originalGetDate","getDate","originalGetUTCFullYear","getUTCFullYear","originalGetUTCMonth","originalGetUTCDate","getUTCDate","originalGetUTCDay","getUTCDay","originalGetUTCHours","getUTCHours","originalGetUTCMinutes","getUTCMinutes","originalGetUTCSeconds","getUTCSeconds","originalGetUTCMilliseconds","getUTCMilliseconds","dayName","monthName","daysInMonth","month","year","date","days","day","hour","minute","second","getDay","getHours","getMinutes","getSeconds","timezoneOffset","hoursOffset","minutesOffset","negativeDate","negativeYearString","hasNegativeDateBug","toISOString","hasSafari51DateBug","getTime","isFinite","RangeError","dateToJSONIsSupported","toJSON","NaN","key","tv","toISO","supportsExtendedYears","parse","acceptsInvalidDates","doesNotParseY2KNewYear","maxSafeUnsigned32Bit","pow","hasSafariSignedIntBug","NativeDate","DateShim","Y","M","D","h","m","s","ms","seconds","millis","msToShift","sToShift","isoDateExpression","months","dayFromMonth","t","toUTC","now","UTC","parseShim","string","match","millisecond","isLocalTime","Boolean","signOffset","hourOffset","minuteOffset","hasMinutesOrSecondsOrMilliseconds","hasToFixedBugs","toFixed","toFixedHelpers","base","size","data","multiply","c","c2","divide","numToString","acc","log","x2","toFixedShim","fractionDigits","f","z","hasToPrecisionUndefinedBug","toPrecision","originalToPrecision","precision","compliantExecNpcg","maxSafe32BitInt","limit","output","flags","ignoreCase","multiline","unicode","sticky","lastLastIndex","separator2","lastIndex","lastLength","separatorCopy","source","splitLimit","index","str_replace","replaceReportsGroupsCorrectly","groups","group","searchValue","replaceValue","hasCapturingGroups","wrappedReplaceValue","originalLastIndex","string_substr","substr","hasNegativeSubstrBug","normalizedStart","ws","zeroWidth","wsRegexChars","trimBeginRegexp","trimEndRegexp","hasTrimWhitespaceBug","trim","hasLastIndexBug","searchString","S","searchStr","numPos","pos","Infinity","searchLen","originalLastIndexOf","parseInt","origParseInt","hexRegex","str","radix","defaultedRadix","parseFloat","origParseFloat","inputString","errorToStringShim","msg","message","Error","ensureNonEnumerable","prop","desc","getOwnPropertyDescriptor","regexToString","global"],"mappings":";;;;;CAaC,SAAUA,EAAMC,GACb,YAGA,UAAWC,UAAW,YAAcA,OAAOC,IAAK,CAE5CD,OAAOD,OACJ,UAAWG,WAAY,SAAU,CAIpCC,OAAOD,QAAUH,QACd,CAEHD,EAAKM,cAAgBL,OAE3BM,KAAM,WAcR,GAAIC,GAASC,KACb,IAAIC,GAAiBF,EAAOG,SAC5B,IAAIC,GAAUC,MACd,IAAIC,GAAkBF,EAAQD,SAC9B,IAAII,GAAYC,QAChB,IAAIC,GAAoBF,EAAUJ,SAClC,IAAIO,GAAUC,MACd,IAAIC,GAAkBF,EAAQP,SAC9B,IAAIU,GAAUC,MACd,IAAIC,GAAkBF,EAAQV,SAC9B,IAAIa,GAAcd,EAAee,KACjC,IAAIC,GAAehB,EAAeiB,MAClC,IAAIC,GAAalB,EAAemB,IAChC,IAAIC,GAAgBpB,EAAeqB,OACnC,IAAIC,GAAetB,EAAeuB,MAClC,IAAIC,GAAaxB,EAAeyB,IAChC,IAAIC,GAAOnB,EAAkBmB,IAC7B,IAAIC,GAAQpB,EAAkBoB,KAC9B,IAAIC,GAAMC,KAAKD,GACf,IAAIE,GAAMD,KAAKC,GAGf,IAAIC,GAAY3B,EAAgB4B,QAIhC,IAAIC,SAAwBC,UAAW,kBA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,UACrC,IAAIwZ,MAAMxZ,UAAUuZ,UAAY,GAAI,CAClCC,MAAMxZ,UAAUuZ,QAAU,GAE5BE,GAAoBD,MAAMxZ,UAAW,QAGzC,GAAIQ,OAAO,UAAY,SAAU,CAC7B,GAAIqZ,IAAgB,QAAS9X,YACzB,GAAIgX,GAAM,IAAMnZ,KAAKgX,OAAS,GAC9B,IAAIhX,KAAKka,OAAQ,CACbf,GAAO,IAEX,GAAInZ,KAAKuW,WAAY,CACjB4C,GAAO,IAEX,GAAInZ,KAAKwW,UAAW,CAChB2C,GAAO,IAEX,MAAOA,GAGX1V,QAAOrD,UAAU+B,SAAW8X"}
\ No newline at end of file
/*!
* https://github.com/es-shims/es5-shim
* @license es5-shim Copyright 2009-2015 by contributors, MIT License
* see https://github.com/es-shims/es5-shim/blob/v4.5.7/LICENSE
*/
(function(t,r){"use strict";if(typeof define==="function"&&define.amd){define(r)}else if(typeof exports==="object"){module.exports=r()}else{t.returnExports=r()}})(this,function(){var t=Array;var r=t.prototype;var e=Object;var n=e.prototype;var i=Function;var a=i.prototype;var o=String;var f=o.prototype;var u=Number;var l=u.prototype;var s=r.slice;var c=r.splice;var v=r.push;var h=r.unshift;var p=r.concat;var y=r.join;var d=a.call;var g=a.apply;var w=Math.max;var b=Math.min;var T=n.toString;var m=typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol";var D;var x=Function.prototype.toString,S=/^\s*class /,O=function isES6ClassFn(t){try{var r=x.call(t);var e=r.replace(/\/\/.*\n/g,"");var n=e.replace(/\/\*[.\s\S]*\*\//g,"");var i=n.replace(/\n/gm," ").replace(/ {2}/g," ");return S.test(i)}catch(a){return false}},E=function tryFunctionObject(t){try{if(O(t)){return false}x.call(t);return true}catch(r){return false}},j="[object Function]",I="[object GeneratorFunction]",D=function isCallable(t){if(!t){return false}if(typeof t!=="function"&&typeof t!=="object"){return false}if(m){return E(t)}if(O(t)){return false}var r=T.call(t);return r===j||r===I};var M;var U=RegExp.prototype.exec,F=function tryRegexExec(t){try{U.call(t);return true}catch(r){return false}},N="[object RegExp]";M=function isRegex(t){if(typeof t!=="object"){return false}return m?F(t):T.call(t)===N};var C;var k=String.prototype.valueOf,R=function tryStringObject(t){try{k.call(t);return true}catch(r){return false}},A="[object String]";C=function isString(t){if(typeof t==="string"){return true}if(typeof t!=="object"){return false}return m?R(t):T.call(t)===A};var P=e.defineProperty&&function(){try{var t={};e.defineProperty(t,"x",{enumerable:false,value:t});for(var r in t){return false}return t.x===t}catch(n){return false}}();var $=function(t){var r;if(P){r=function(t,r,n,i){if(!i&&r in t){return}e.defineProperty(t,r,{configurable:true,enumerable:false,writable:true,value:n})}}else{r=function(t,r,e,n){if(!n&&r in t){return}t[r]=e}}return function defineProperties(e,n,i){for(var a in n){if(t.call(n,a)){r(e,a,n[a],i)}}}}(n.hasOwnProperty);var J=function isPrimitive(t){var r=typeof t;return t===null||r!=="object"&&r!=="function"};var Y=u.isNaN||function(t){return t!==t};var Z={ToInteger:function ToInteger(t){var r=+t;if(Y(r)){r=0}else if(r!==0&&r!==1/0&&r!==-(1/0)){r=(r>0||-1)*Math.floor(Math.abs(r))}return r},ToPrimitive:function ToPrimitive(t){var r,e,n;if(J(t)){return t}e=t.valueOf;if(D(e)){r=e.call(t);if(J(r)){return r}}n=t.toString;if(D(n)){r=n.call(t);if(J(r)){return r}}throw new TypeError},ToObject:function(t){if(t==null){throw new TypeError("can't convert "+t+" to object")}return e(t)},ToUint32:function ToUint32(t){return t>>>0}};var z=function Empty(){};$(a,{bind:function bind(t){var r=this;if(!D(r)){throw new TypeError("Function.prototype.bind called on incompatible "+r)}var n=s.call(arguments,1);var a;var o=function(){if(this instanceof a){var i=g.call(r,this,p.call(n,s.call(arguments)));if(e(i)===i){return i}return this}else{return g.call(r,t,p.call(n,s.call(arguments)))}};var f=w(0,r.length-n.length);var u=[];for(var l=0;l<f;l++){v.call(u,"$"+l)}a=i("binder","return function ("+y.call(u,",")+"){ return binder.apply(this, arguments); }")(o);if(r.prototype){z.prototype=r.prototype;a.prototype=new z;z.prototype=null}return a}});var G=d.bind(n.hasOwnProperty);var B=d.bind(n.toString);var H=d.bind(s);var W=g.bind(s);var L=d.bind(f.slice);var X=d.bind(f.split);var q=d.bind(f.indexOf);var K=d.bind(v);var Q=d.bind(n.propertyIsEnumerable);var V=d.bind(r.sort);var _=t.isArray||function isArray(t){return B(t)==="[object Array]"};var tt=[].unshift(0)!==1;$(r,{unshift:function(){h.apply(this,arguments);return this.length}},tt);$(t,{isArray:_});var rt=e("a");var et=rt[0]!=="a"||!(0 in rt);var nt=function properlyBoxed(t){var r=true;var e=true;var n=false;if(t){try{t.call("foo",function(t,e,n){if(typeof n!=="object"){r=false}});t.call([1],function(){"use strict";e=typeof this==="string"},"x")}catch(i){n=true}}return!!t&&!n&&r&&e};$(r,{forEach:function forEach(t){var r=Z.ToObject(this);var e=et&&C(this)?X(this,""):r;var n=-1;var i=Z.ToUint32(e.length);var a;if(arguments.length>1){a=arguments[1]}if(!D(t)){throw new TypeError("Array.prototype.forEach callback must be a function")}while(++n<i){if(n in e){if(typeof a==="undefined"){t(e[n],n,r)}else{t.call(a,e[n],n,r)}}}}},!nt(r.forEach));$(r,{map:function map(r){var e=Z.ToObject(this);var n=et&&C(this)?X(this,""):e;var i=Z.ToUint32(n.length);var a=t(i);var o;if(arguments.length>1){o=arguments[1]}if(!D(r)){throw new TypeError("Array.prototype.map callback must be a function")}for(var f=0;f<i;f++){if(f in n){if(typeof o==="undefined"){a[f]=r(n[f],f,e)}else{a[f]=r.call(o,n[f],f,e)}}}return a}},!nt(r.map));$(r,{filter:function filter(t){var r=Z.ToObject(this);var e=et&&C(this)?X(this,""):r;var n=Z.ToUint32(e.length);var i=[];var a;var o;if(arguments.length>1){o=arguments[1]}if(!D(t)){throw new TypeError("Array.prototype.filter callback must be a function")}for(var f=0;f<n;f++){if(f in e){a=e[f];if(typeof o==="undefined"?t(a,f,r):t.call(o,a,f,r)){K(i,a)}}}return i}},!nt(r.filter));$(r,{every:function every(t){var r=Z.ToObject(this);var e=et&&C(this)?X(this,""):r;var n=Z.ToUint32(e.length);var i;if(arguments.length>1){i=arguments[1]}if(!D(t)){throw new TypeError("Array.prototype.every callback must be a function")}for(var a=0;a<n;a++){if(a in e&&!(typeof i==="undefined"?t(e[a],a,r):t.call(i,e[a],a,r))){return false}}return true}},!nt(r.every));$(r,{some:function some(t){var r=Z.ToObject(this);var e=et&&C(this)?X(this,""):r;var n=Z.ToUint32(e.length);var i;if(arguments.length>1){i=arguments[1]}if(!D(t)){throw new TypeError("Array.prototype.some callback must be a function")}for(var a=0;a<n;a++){if(a in e&&(typeof i==="undefined"?t(e[a],a,r):t.call(i,e[a],a,r))){return true}}return false}},!nt(r.some));var it=false;if(r.reduce){it=typeof r.reduce.call("es5",function(t,r,e,n){return n})==="object"}$(r,{reduce:function reduce(t){var r=Z.ToObject(this);var e=et&&C(this)?X(this,""):r;var n=Z.ToUint32(e.length);if(!D(t)){throw new TypeError("Array.prototype.reduce callback must be a function")}if(n===0&&arguments.length===1){throw new TypeError("reduce of empty array with no initial value")}var i=0;var a;if(arguments.length>=2){a=arguments[1]}else{do{if(i in e){a=e[i++];break}if(++i>=n){throw new TypeError("reduce of empty array with no initial value")}}while(true)}for(;i<n;i++){if(i in e){a=t(a,e[i],i,r)}}return a}},!it);var at=false;if(r.reduceRight){at=typeof r.reduceRight.call("es5",function(t,r,e,n){return n})==="object"}$(r,{reduceRight:function reduceRight(t){var r=Z.ToObject(this);var e=et&&C(this)?X(this,""):r;var n=Z.ToUint32(e.length);if(!D(t)){throw new TypeError("Array.prototype.reduceRight callback must be a function")}if(n===0&&arguments.length===1){throw new TypeError("reduceRight of empty array with no initial value")}var i;var a=n-1;if(arguments.length>=2){i=arguments[1]}else{do{if(a in e){i=e[a--];break}if(--a<0){throw new TypeError("reduceRight of empty array with no initial value")}}while(true)}if(a<0){return i}do{if(a in e){i=t(i,e[a],a,r)}}while(a--);return i}},!at);var ot=r.indexOf&&[0,1].indexOf(1,2)!==-1;$(r,{indexOf:function indexOf(t){var r=et&&C(this)?X(this,""):Z.ToObject(this);var e=Z.ToUint32(r.length);if(e===0){return-1}var n=0;if(arguments.length>1){n=Z.ToInteger(arguments[1])}n=n>=0?n:w(0,e+n);for(;n<e;n++){if(n in r&&r[n]===t){return n}}return-1}},ot);var ft=r.lastIndexOf&&[0,1].lastIndexOf(0,-3)!==-1;$(r,{lastIndexOf:function lastIndexOf(t){var r=et&&C(this)?X(this,""):Z.ToObject(this);var e=Z.ToUint32(r.length);if(e===0){return-1}var n=e-1;if(arguments.length>1){n=b(n,Z.ToInteger(arguments[1]))}n=n>=0?n:e-Math.abs(n);for(;n>=0;n--){if(n in r&&t===r[n]){return n}}return-1}},ft);var ut=function(){var t=[1,2];var r=t.splice();return t.length===2&&_(r)&&r.length===0}();$(r,{splice:function splice(t,r){if(arguments.length===0){return[]}else{return c.apply(this,arguments)}}},!ut);var lt=function(){var t={};r.splice.call(t,0,0,1);return t.length===1}();$(r,{splice:function splice(t,r){if(arguments.length===0){return[]}var e=arguments;this.length=w(Z.ToInteger(this.length),0);if(arguments.length>0&&typeof r!=="number"){e=H(arguments);if(e.length<2){K(e,this.length-t)}else{e[1]=Z.ToInteger(r)}}return c.apply(this,e)}},!lt);var st=function(){var r=new t(1e5);r[8]="x";r.splice(1,1);return r.indexOf("x")===7}();var ct=function(){var t=256;var r=[];r[t]="a";r.splice(t+1,0,"b");return r[t]==="a"}();$(r,{splice:function splice(t,r){var e=Z.ToObject(this);var n=[];var i=Z.ToUint32(e.length);var a=Z.ToInteger(t);var f=a<0?w(i+a,0):b(a,i);var u=b(w(Z.ToInteger(r),0),i-f);var l=0;var s;while(l<u){s=o(f+l);if(G(e,s)){n[l]=e[s]}l+=1}var c=H(arguments,2);var v=c.length;var h;if(v<u){l=f;var p=i-u;while(l<p){s=o(l+u);h=o(l+v);if(G(e,s)){e[h]=e[s]}else{delete e[h]}l+=1}l=i;var y=i-u+v;while(l>y){delete e[l-1];l-=1}}else if(v>u){l=i-u;while(l>f){s=o(l+u-1);h=o(l+v-1);if(G(e,s)){e[h]=e[s]}else{delete e[h]}l-=1}}l=f;for(var d=0;d<c.length;++d){e[l]=c[d];l+=1}e.length=i-u+v;return n}},!st||!ct);var vt=r.join;var ht;try{ht=Array.prototype.join.call("123",",")!=="1,2,3"}catch(pt){ht=true}if(ht){$(r,{join:function join(t){var r=typeof t==="undefined"?",":t;return vt.call(C(this)?X(this,""):this,r)}},ht)}var yt=[1,2].join(undefined)!=="1,2";if(yt){$(r,{join:function join(t){var r=typeof t==="undefined"?",":t;return vt.call(this,r)}},yt)}var dt=function push(t){var r=Z.ToObject(this);var e=Z.ToUint32(r.length);var n=0;while(n<arguments.length){r[e+n]=arguments[n];n+=1}r.length=e+n;return e+n};var gt=function(){var t={};var r=Array.prototype.push.call(t,undefined);return r!==1||t.length!==1||typeof t[0]!=="undefined"||!G(t,0)}();$(r,{push:function push(t){if(_(this)){return v.apply(this,arguments)}return dt.apply(this,arguments)}},gt);var wt=function(){var t=[];var r=t.push(undefined);return r!==1||t.length!==1||typeof t[0]!=="undefined"||!G(t,0)}();$(r,{push:dt},wt);$(r,{slice:function(t,r){var e=C(this)?X(this,""):this;return W(e,arguments)}},et);var bt=function(){try{[1,2].sort(null);[1,2].sort({});return true}catch(t){}return false}();var Tt=function(){try{[1,2].sort(/a/);return false}catch(t){}return true}();var mt=function(){try{[1,2].sort(undefined);return true}catch(t){}return false}();$(r,{sort:function sort(t){if(typeof t==="undefined"){return V(this)}if(!D(t)){throw new TypeError("Array.prototype.sort callback must be a function")}return V(this,t)}},bt||!mt||!Tt);var Dt=!{toString:null}.propertyIsEnumerable("toString");var xt=function(){}.propertyIsEnumerable("prototype");var St=!G("x","0");var Ot=function(t){var r=t.constructor;return r&&r.prototype===t};var Et={$window:true,$console:true,$parent:true,$self:true,$frame:true,$frames:true,$frameElement:true,$webkitIndexedDB:true,$webkitStorageInfo:true,$external:true};var jt=function(){if(typeof window==="undefined"){return false}for(var t in window){try{if(!Et["$"+t]&&G(window,t)&&window[t]!==null&&typeof window[t]==="object"){Ot(window[t])}}catch(r){return true}}return false}();var It=function(t){if(typeof window==="undefined"||!jt){return Ot(t)}try{return Ot(t)}catch(r){return false}};var Mt=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];var Ut=Mt.length;var Ft=function isArguments(t){return B(t)==="[object Arguments]"};var Nt=function isArguments(t){return t!==null&&typeof t==="object"&&typeof t.length==="number"&&t.length>=0&&!_(t)&&D(t.callee)};var Ct=Ft(arguments)?Ft:Nt;$(e,{keys:function keys(t){var r=D(t);var e=Ct(t);var n=t!==null&&typeof t==="object";var i=n&&C(t);if(!n&&!r&&!e){throw new TypeError("Object.keys called on a non-object")}var a=[];var f=xt&&r;if(i&&St||e){for(var u=0;u<t.length;++u){K(a,o(u))}}if(!e){for(var l in t){if(!(f&&l==="prototype")&&G(t,l)){K(a,o(l))}}}if(Dt){var s=It(t);for(var c=0;c<Ut;c++){var v=Mt[c];if(!(s&&v==="constructor")&&G(t,v)){K(a,v)}}}return a}});var kt=e.keys&&function(){return e.keys(arguments).length===2}(1,2);var Rt=e.keys&&function(){var t=e.keys(arguments);return arguments.length!==1||t.length!==1||t[0]!==1}(1);var At=e.keys;$(e,{keys:function keys(t){if(Ct(t)){return At(H(t))}else{return At(t)}}},!kt||Rt);var Pt=new Date(-0xc782b5b342b24).getUTCMonth()!==0;var $t=new Date(-0x55d318d56a724);var Jt=new Date(14496624e5);var Yt=$t.toUTCString()!=="Mon, 01 Jan -45875 11:59:59 GMT";var Zt;var zt;var Gt=$t.getTimezoneOffset();if(Gt<-720){Zt=$t.toDateString()!=="Tue Jan 02 -45875";zt=!/^Thu Dec 10 2015 \d\d:\d\d:\d\d GMT[-\+]\d\d\d\d(?: |$)/.test(Jt.toString())}else{Zt=$t.toDateString()!=="Mon Jan 01 -45875";zt=!/^Wed Dec 09 2015 \d\d:\d\d:\d\d GMT[-\+]\d\d\d\d(?: |$)/.test(Jt.toString())}var Bt=d.bind(Date.prototype.getFullYear);var Ht=d.bind(Date.prototype.getMonth);var Wt=d.bind(Date.prototype.getDate);var Lt=d.bind(Date.prototype.getUTCFullYear);var Xt=d.bind(Date.prototype.getUTCMonth);var qt=d.bind(Date.prototype.getUTCDate);var Kt=d.bind(Date.prototype.getUTCDay);var Qt=d.bind(Date.prototype.getUTCHours);var Vt=d.bind(Date.prototype.getUTCMinutes);var _t=d.bind(Date.prototype.getUTCSeconds);var tr=d.bind(Date.prototype.getUTCMilliseconds);var rr=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];var er=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var nr=function daysInMonth(t,r){return Wt(new Date(r,t,0))};$(Date.prototype,{getFullYear:function getFullYear(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=Bt(this);if(t<0&&Ht(this)>11){return t+1}return t},getMonth:function getMonth(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=Bt(this);var r=Ht(this);if(t<0&&r>11){return 0}return r},getDate:function getDate(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=Bt(this);var r=Ht(this);var e=Wt(this);if(t<0&&r>11){if(r===12){return e}var n=nr(0,t+1);return n-e+1}return e},getUTCFullYear:function getUTCFullYear(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=Lt(this);if(t<0&&Xt(this)>11){return t+1}return t},getUTCMonth:function getUTCMonth(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=Lt(this);var r=Xt(this);if(t<0&&r>11){return 0}return r},getUTCDate:function getUTCDate(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=Lt(this);var r=Xt(this);var e=qt(this);if(t<0&&r>11){if(r===12){return e}var n=nr(0,t+1);return n-e+1}return e}},Pt);$(Date.prototype,{toUTCString:function toUTCString(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=Kt(this);var r=qt(this);var e=Xt(this);var n=Lt(this);var i=Qt(this);var a=Vt(this);var o=_t(this);return rr[t]+", "+(r<10?"0"+r:r)+" "+er[e]+" "+n+" "+(i<10?"0"+i:i)+":"+(a<10?"0"+a:a)+":"+(o<10?"0"+o:o)+" GMT"}},Pt||Yt);$(Date.prototype,{toDateString:function toDateString(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=this.getDay();var r=this.getDate();var e=this.getMonth();var n=this.getFullYear();return rr[t]+" "+er[e]+" "+(r<10?"0"+r:r)+" "+n}},Pt||Zt);if(Pt||zt){Date.prototype.toString=function toString(){if(!this||!(this instanceof Date)){throw new TypeError("this is not a Date object.")}var t=this.getDay();var r=this.getDate();var e=this.getMonth();var n=this.getFullYear();var i=this.getHours();var a=this.getMinutes();var o=this.getSeconds();var f=this.getTimezoneOffset();var u=Math.floor(Math.abs(f)/60);var l=Math.floor(Math.abs(f)%60);return rr[t]+" "+er[e]+" "+(r<10?"0"+r:r)+" "+n+" "+(i<10?"0"+i:i)+":"+(a<10?"0"+a:a)+":"+(o<10?"0"+o:o)+" GMT"+(f>0?"-":"+")+(u<10?"0"+u:u)+(l<10?"0"+l:l)};if(P){e.defineProperty(Date.prototype,"toString",{configurable:true,enumerable:false,writable:true})}}var ir=-621987552e5;var ar="-000001";var or=Date.prototype.toISOString&&new Date(ir).toISOString().indexOf(ar)===-1;var fr=Date.prototype.toISOString&&new Date(-1).toISOString()!=="1969-12-31T23:59:59.999Z";var ur=d.bind(Date.prototype.getTime);$(Date.prototype,{toISOString:function toISOString(){if(!isFinite(this)||!isFinite(ur(this))){throw new RangeError("Date.prototype.toISOString called on non-finite value.")}var t=Lt(this);var r=Xt(this);t+=Math.floor(r/12);r=(r%12+12)%12;var e=[r+1,qt(this),Qt(this),Vt(this),_t(this)];t=(t<0?"-":t>9999?"+":"")+L("00000"+Math.abs(t),0<=t&&t<=9999?-4:-6);for(var n=0;n<e.length;++n){e[n]=L("00"+e[n],-2)}return t+"-"+H(e,0,2).join("-")+"T"+H(e,2).join(":")+"."+L("000"+tr(this),-3)+"Z"}},or||fr);var lr=function(){try{return Date.prototype.toJSON&&new Date(NaN).toJSON()===null&&new Date(ir).toJSON().indexOf(ar)!==-1&&Date.prototype.toJSON.call({toISOString:function(){return true}})}catch(t){return false}}();if(!lr){Date.prototype.toJSON=function toJSON(t){var r=e(this);var n=Z.ToPrimitive(r);if(typeof n==="number"&&!isFinite(n)){return null}var i=r.toISOString;if(!D(i)){throw new TypeError("toISOString property is not callable")}return i.call(r)}}var sr=Date.parse("+033658-09-27T01:46:40.000Z")===1e15;var cr=!isNaN(Date.parse("2012-04-04T24:00:00.500Z"))||!isNaN(Date.parse("2012-11-31T23:59:59.000Z"))||!isNaN(Date.parse("2012-12-31T23:59:60.000Z"));var vr=isNaN(Date.parse("2000-01-01T00:00:00.000Z"));if(vr||cr||!sr){var hr=Math.pow(2,31)-1;var pr=Y(new Date(1970,0,1,0,0,0,hr+1).getTime());Date=function(t){var r=function Date(e,n,i,a,f,u,l){var s=arguments.length;var c;if(this instanceof t){var v=u;var h=l;if(pr&&s>=7&&l>hr){var p=Math.floor(l/hr)*hr;var y=Math.floor(p/1e3);v+=y;h-=y*1e3}c=s===1&&o(e)===e?new t(r.parse(e)):s>=7?new t(e,n,i,a,f,v,h):s>=6?new t(e,n,i,a,f,v):s>=5?new t(e,n,i,a,f):s>=4?new t(e,n,i,a):s>=3?new t(e,n,i):s>=2?new t(e,n):s>=1?new t(e instanceof t?+e:e):new t}else{c=t.apply(this,arguments)}if(!J(c)){$(c,{constructor:r},true)}return c};var e=new RegExp("^"+"(\\d{4}|[+-]\\d{6})"+"(?:-(\\d{2})"+"(?:-(\\d{2})"+"(?:"+"T(\\d{2})"+":(\\d{2})"+"(?:"+":(\\d{2})"+"(?:(\\.\\d{1,}))?"+")?"+"("+"Z|"+"(?:"+"([-+])"+"(\\d{2})"+":(\\d{2})"+")"+")?)?)?)?"+"$");var n=[0,31,59,90,120,151,181,212,243,273,304,334,365];var i=function dayFromMonth(t,r){var e=r>1?1:0;return n[r]+Math.floor((t-1969+e)/4)-Math.floor((t-1901+e)/100)+Math.floor((t-1601+e)/400)+365*(t-1970)};var a=function toUTC(r){var e=0;var n=r;if(pr&&n>hr){var i=Math.floor(n/hr)*hr;var a=Math.floor(i/1e3);e+=a;n-=a*1e3}return u(new t(1970,0,1,0,0,e,n))};for(var f in t){if(G(t,f)){r[f]=t[f]}}$(r,{now:t.now,UTC:t.UTC},true);r.prototype=t.prototype;$(r.prototype,{constructor:r},true);var l=function parse(r){var n=e.exec(r);if(n){var o=u(n[1]),f=u(n[2]||1)-1,l=u(n[3]||1)-1,s=u(n[4]||0),c=u(n[5]||0),v=u(n[6]||0),h=Math.floor(u(n[7]||0)*1e3),p=Boolean(n[4]&&!n[8]),y=n[9]==="-"?1:-1,d=u(n[10]||0),g=u(n[11]||0),w;var b=c>0||v>0||h>0;if(s<(b?24:25)&&c<60&&v<60&&h<1e3&&f>-1&&f<12&&d<24&&g<60&&l>-1&&l<i(o,f+1)-i(o,f)){w=((i(o,f)+l)*24+s+d*y)*60;w=((w+c+g*y)*60+v)*1e3+h;if(p){w=a(w)}if(-864e13<=w&&w<=864e13){return w}}return NaN}return t.parse.apply(this,arguments)};$(r,{parse:l});return r}(Date)}if(!Date.now){Date.now=function now(){return(new Date).getTime()}}var yr=l.toFixed&&(8e-5.toFixed(3)!=="0.000"||.9.toFixed(0)!=="1"||1.255.toFixed(2)!=="1.25"||0xde0b6b3a7640080.toFixed(0)!=="1000000000000000128");var dr={base:1e7,size:6,data:[0,0,0,0,0,0],multiply:function multiply(t,r){var e=-1;var n=r;while(++e<dr.size){n+=t*dr.data[e];dr.data[e]=n%dr.base;n=Math.floor(n/dr.base)}},divide:function divide(t){var r=dr.size;var e=0;while(--r>=0){e+=dr.data[r];dr.data[r]=Math.floor(e/t);e=e%t*dr.base}},numToString:function numToString(){var t=dr.size;var r="";while(--t>=0){if(r!==""||t===0||dr.data[t]!==0){var e=o(dr.data[t]);if(r===""){r=e}else{r+=L("0000000",0,7-e.length)+e}}}return r},pow:function pow(t,r,e){return r===0?e:r%2===1?pow(t,r-1,e*t):pow(t*t,r/2,e)},log:function log(t){var r=0;var e=t;while(e>=4096){r+=12;e/=4096}while(e>=2){r+=1;e/=2}return r}};var gr=function toFixed(t){var r,e,n,i,a,f,l,s;r=u(t);r=Y(r)?0:Math.floor(r);if(r<0||r>20){throw new RangeError("Number.toFixed called with invalid number of decimals")}e=u(this);if(Y(e)){return"NaN"}if(e<=-1e21||e>=1e21){return o(e)}n="";if(e<0){n="-";e=-e}i="0";if(e>1e-21){a=dr.log(e*dr.pow(2,69,1))-69;f=a<0?e*dr.pow(2,-a,1):e/dr.pow(2,a,1);f*=4503599627370496;a=52-a;if(a>0){dr.multiply(0,f);l=r;while(l>=7){dr.multiply(1e7,0);l-=7}dr.multiply(dr.pow(10,l,1),0);l=a-1;while(l>=23){dr.divide(1<<23);l-=23}dr.divide(1<<l);dr.multiply(1,1);dr.divide(2);i=dr.numToString()}else{dr.multiply(0,f);dr.multiply(1<<-a,0);i=dr.numToString()+L("0.00000000000000000000",2,2+r)}}if(r>0){s=i.length;if(s<=r){i=n+L("0.0000000000000000000",0,r-s+2)+i}else{i=n+L(i,0,s-r)+"."+L(i,s-r)}}else{i=n+i}return i};$(l,{toFixed:gr},yr);var wr=function(){try{return 1..toPrecision(undefined)==="1"}catch(t){return true}}();var br=l.toPrecision;$(l,{toPrecision:function toPrecision(t){return typeof t==="undefined"?br.call(this):br.call(this,t)}},wr);if("ab".split(/(?:ab)*/).length!==2||".".split(/(.?)(.?)/).length!==4||"tesst".split(/(s)*/)[1]==="t"||"test".split(/(?:)/,-1).length!==4||"".split(/.?/).length||".".split(/()()/).length>1){(function(){var t=typeof/()??/.exec("")[1]==="undefined";var r=Math.pow(2,32)-1;f.split=function(e,n){var i=String(this);if(typeof e==="undefined"&&n===0){return[]}if(!M(e)){return X(this,e,n)}var a=[];var o=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),f=0,u,l,s,c;var h=new RegExp(e.source,o+"g");if(!t){u=new RegExp("^"+h.source+"$(?!\\s)",o)}var p=typeof n==="undefined"?r:Z.ToUint32(n);l=h.exec(i);while(l){s=l.index+l[0].length;if(s>f){K(a,L(i,f,l.index));if(!t&&l.length>1){l[0].replace(u,function(){for(var t=1;t<arguments.length-2;t++){if(typeof arguments[t]==="undefined"){l[t]=void 0}}})}if(l.length>1&&l.index<i.length){v.apply(a,H(l,1))}c=l[0].length;f=s;if(a.length>=p){break}}if(h.lastIndex===l.index){h.lastIndex++}l=h.exec(i)}if(f===i.length){if(c||!h.test("")){K(a,"")}}else{K(a,L(i,f))}return a.length>p?H(a,0,p):a}})()}else if("0".split(void 0,0).length){f.split=function split(t,r){if(typeof t==="undefined"&&r===0){return[]}return X(this,t,r)}}var Tr=f.replace;var mr=function(){var t=[];"x".replace(/x(.)?/g,function(r,e){K(t,e)});return t.length===1&&typeof t[0]==="undefined"}();if(!mr){f.replace=function replace(t,r){var e=D(r);var n=M(t)&&/\)[*?]/.test(t.source);if(!e||!n){return Tr.call(this,t,r)}else{var i=function(e){var n=arguments.length;var i=t.lastIndex;t.lastIndex=0;var a=t.exec(e)||[];t.lastIndex=i;K(a,arguments[n-2],arguments[n-1]);return r.apply(this,a)};return Tr.call(this,t,i)}}}var Dr=f.substr;var xr="".substr&&"0b".substr(-1)!=="b";$(f,{substr:function substr(t,r){var e=t;if(t<0){e=w(this.length+t,0)}return Dr.call(this,e,r)}},xr);var Sr=" \n\x0B\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003"+"\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028"+"\u2029\ufeff";var Or="\u200b";var Er="["+Sr+"]";var jr=new RegExp("^"+Er+Er+"*");var Ir=new RegExp(Er+Er+"*$");var Mr=f.trim&&(Sr.trim()||!Or.trim());$(f,{trim:function trim(){if(typeof this==="undefined"||this===null){throw new TypeError("can't convert "+this+" to object")}return o(this).replace(jr,"").replace(Ir,"")}},Mr);var Ur=d.bind(String.prototype.trim);var Fr=f.lastIndexOf&&"abc\u3042\u3044".lastIndexOf("\u3042\u3044",2)!==-1;$(f,{lastIndexOf:function lastIndexOf(t){if(typeof this==="undefined"||this===null){throw new TypeError("can't convert "+this+" to object")}var r=o(this);var e=o(t);var n=arguments.length>1?u(arguments[1]):NaN;var i=Y(n)?Infinity:Z.ToInteger(n);var a=b(w(i,0),r.length);var f=e.length;var l=a+f;while(l>0){l=w(0,l-f);var s=q(L(r,l,a+f),e);if(s!==-1){return l+s}}return-1}},Fr);var Nr=f.lastIndexOf;$(f,{lastIndexOf:function lastIndexOf(t){return Nr.apply(this,arguments)}},f.lastIndexOf.length!==1);if(parseInt(Sr+"08")!==8||parseInt(Sr+"0x16")!==22){parseInt=function(t){var r=/^[\-+]?0[xX]/;return function parseInt(e,n){var i=Ur(e);var a=u(n)||(r.test(i)?16:10);return t(i,a)}}(parseInt)}if(1/parseFloat("-0")!==-Infinity){parseFloat=function(t){return function parseFloat(r){var e=Ur(r);var n=t(e);return n===0&&L(e,0,1)==="-"?-0:n}}(parseFloat)}if(String(new RangeError("test"))!=="RangeError: test"){var Cr=function toString(){if(typeof this==="undefined"||this===null){throw new TypeError("can't convert "+this+" to object")}var t=this.name;if(typeof t==="undefined"){t="Error"}else if(typeof t!=="string"){t=o(t)}var r=this.message;if(typeof r==="undefined"){r=""}else if(typeof r!=="string"){r=o(r)}if(!t){return r}if(!r){return t}return t+": "+r};Error.prototype.toString=Cr}if(P){var kr=function(t,r){if(Q(t,r)){var e=Object.getOwnPropertyDescriptor(t,r);e.enumerable=false;Object.defineProperty(t,r,e)}};kr(Error.prototype,"message");if(Error.prototype.message!==""){Error.prototype.message=""}kr(Error.prototype,"name")}if(String(/a/gim)!=="/a/gim"){var Rr=function toString(){var t="/"+this.source+"/";if(this.global){t+="g"}if(this.ignoreCase){t+="i"}if(this.multiline){t+="m"}return t};RegExp.prototype.toString=Rr}});
//# sourceMappingURL=es5-shim.map
{
"name": "es5-shim",
"version": "4.5.7",
"description": "ECMAScript 5 compatibility shims for legacy JavaScript engines",
"homepage": "http://github.com/es-shims/es5-shim/",
"contributors": [
"Kris Kowal <kris@cixar.com> (http://github.com/kriskowal/)",
"Sami Samhuri <sami.samhuri@gmail.com> (http://samhuri.net/)",
"Florian Schäfer <florian.schaefer@gmail.com> (http://github.com/fschaefer)",
"Irakli Gozalishvili <rfobic@gmail.com> (http://jeditoolkit.com)",
"Kit Cambridge <kitcambridge@gmail.com> (http://kitcambridge.github.com)",
"Jordan Harband <ljharb@gmail.com> (https://github.com/ljharb/)"
],
"bugs": {
"mail": "ljharb@gmail.com",
"url": "http://github.com/es-shims/es5-shim/issues"
},
"license": "MIT",
"main": "es5-shim.js",
"repository": {
"type": "git",
"url": "http://github.com/es-shims/es5-shim.git"
},
"scripts": {
"minify": "concurrently --raw 'npm run --silent minify-shim' 'npm run --silent minify-sham'",
"minify-shim": "uglifyjs es5-shim.js --keep-fnames --comments --source-map=es5-shim.map -m -b ascii_only=true,beautify=false > es5-shim.min.js",
"minify-sham": "uglifyjs es5-sham.js --keep-fnames --comments --source-map=es5-sham.map -m -b ascii_only=true,beautify=false > es5-sham.min.js",
"pretest": "npm run --silent lint",
"test": "npm run --silent tests-only",
"tests-only": "jasmine-node --matchall ./ tests/spec/",
"test-native": "jasmine-node --matchall tests/spec/",
"lint": "concurrently --raw 'npm run --silent jscs' 'npm run --silent eslint'",
"eslint": "eslint tests/helpers/*.js tests/spec/*.js es5-shim.js es5-sham.js",
"jscs": "jscs tests/helpers/*.js tests/spec/*.js es5-shim.js es5-sham.js"
},
"devDependencies": {
"eslint": "^2.5.3",
"@ljharb/eslint-config": "^2.2.0",
"jasmine-node": "^1.14.5",
"jscs": "^2.11.0",
"uglify-js": "^2.6.2",
"replace": "^0.3.0",
"semver": "^5.1.0",
"concurrently": "^2.0.0"
},
"engines": {
"node": ">=0.4.0"
},
"testling": {
"browsers": [
"iexplore/6.0..latest",
"firefox/3.0..6.0",
"firefox/18.0..latest",
"firefox/nightly",
"chrome/4.0..10.0",
"chrome/25.0..latest",
"chrome/canary",
"opera/10.0..latest",
"opera/next",
"safari/4.0..latest",
"ipad/6.0..latest",
"iphone/6.0..latest",
"android-browser/4.2"
]
},
"keywords": [
"shim",
"es5",
"es5 shim",
"javascript",
"ecmascript",
"polyfill"
]
}
{
"Object": {
"prototype": {},
"keys": "object-keys"
}
}
{
"rules": {
"max-statements-per-line": [2, { "max": 2 }]
}
}
/* global beforeEach, expect */
var has = Object.prototype.hasOwnProperty;
var getKeys = function (o) {
'use strict';
var key;
var a = [];
for (key in o) {
if (has.call(o, key)) {
a.push(key);
}
}
return a;
};
beforeEach(function () {
'use strict';
this.addMatchers({
toExactlyMatch: function (expected) {
var a1, a2, l, i, key;
var actual = this.actual;
a1 = getKeys(actual);
a2 = getKeys(expected);
l = a1.length;
if (l !== a2.length) {
return false;
}
for (i = 0; i < l; i++) {
key = a1[i];
expect(key).toEqual(a2[i]);
expect(actual[key]).toEqual(expected[key]);
}
return true;
}
});
});
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<title>Jasmine Spec Runner</title>
<link rel="shortcut icon" type="image/png" href="lib/jasmine_favicon.png">
<link rel="stylesheet" type="text/css" href="lib/jasmine.css">
<script type="text/javascript" src="lib/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-html.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.min.js"></script>
<!-- include helper files here... -->
<script src="helpers/h-matchers.js"></script>
<!-- include source files here... -->
<script src="../es5-shim.js"></script>
<script src="../es5-sham.js"></script>
<!-- include spec files here... -->
<script src="spec/s-array.js"></script>
<script src="spec/s-date.js"></script>
<script src="spec/s-error.js"></script>
<script src="spec/s-function.js"></script>
<script src="spec/s-global.js"></script>
<script src="spec/s-number.js"></script>
<script src="spec/s-object.js"></script>
<script src="spec/s-string.js"></script>
<script src="spec/s-regexp.js"></script>
<script type="text/javascript">
(function() {
var jasmineEnv = jasmine.getEnv();
jasmineEnv.updateInterval = 1000;
var trivialReporter = new jasmine.TrivialReporter();
jasmineEnv.addReporter(trivialReporter);
jasmineEnv.specFilter = function(spec) {
return trivialReporter.specFilter(spec);
};
var currentWindowOnload = window.onload;
window.onload = function() {
if (currentWindowOnload) {
currentWindowOnload();
}
execJasmine();
};
function execJasmine() {
jasmineEnv.execute();
}
})();
</script>
</head>
<body>
</body>
</html>
<!DOCTYPE HTML>
<html>
<head>
<title>Jasmine Spec Runner</title>
<link rel="shortcut icon" type="image/png" href="lib/jasmine_favicon.png">
<link rel="stylesheet" type="text/css" href="lib/jasmine.css">
<script type="text/javascript" src="lib/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-html.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.min.js"></script>
<!-- include helper files here... -->
<script src="helpers/h-matchers.js"></script>
<!-- include source files here... -->
<script src="../es5-shim.min.js"></script>
<!-- include spec files here... -->
<script src="spec/s-array.js"></script>
<script src="spec/s-date.js"></script>
<script src="spec/s-error.js"></script>
<script src="spec/s-function.js"></script>
<script src="spec/s-global.js"></script>
<script src="spec/s-number.js"></script>
<script src="spec/s-object.js"></script>
<script src="spec/s-string.js"></script>
<script type="text/javascript">
(function() {
var jasmineEnv = jasmine.getEnv();
jasmineEnv.updateInterval = 1000;
var trivialReporter = new jasmine.TrivialReporter();
jasmineEnv.addReporter(trivialReporter);
jasmineEnv.specFilter = function(spec) {
return trivialReporter.specFilter(spec);
};
var currentWindowOnload = window.onload;
window.onload = function() {
if (currentWindowOnload) {
currentWindowOnload();
}
execJasmine();
};
function execJasmine() {
jasmineEnv.execute();
}
})();
</script>
</head>
<body>
</body>
</html>
jasmine.TrivialReporter = function(doc) {
this.document = doc || document;
this.suiteDivs = {};
this.logRunningSpecs = false;
};
jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) {
var el = document.createElement(type);
for (var i = 2; i < arguments.length; i++) {
var child = arguments[i];
if (typeof child === 'string') {
el.appendChild(document.createTextNode(child));
} else {
if (child) { el.appendChild(child); }
}
}
for (var attr in attrs) {
if (attr == "className") {
el[attr] = attrs[attr];
} else {
el.setAttribute(attr, attrs[attr]);
}
}
return el;
};
jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
var showPassed, showSkipped;
this.outerDiv = this.createDom('div', { className: 'jasmine_reporter' },
this.createDom('div', { className: 'banner' },
this.createDom('div', { className: 'logo' },
this.createDom('span', { className: 'title' }, "Jasmine"),
this.createDom('span', { className: 'version' }, runner.env.versionString())),
this.createDom('div', { className: 'options' },
"Show ",
showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' }),
this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "),
showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' }),
this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped")
)
),
this.runnerDiv = this.createDom('div', { className: 'runner running' },
this.createDom('a', { className: 'run_spec', href: '?' }, "run all"),
this.runnerMessageSpan = this.createDom('span', {}, "Running..."),
this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, ""))
);
this.document.body.appendChild(this.outerDiv);
var suites = runner.suites();
for (var i = 0; i < suites.length; i++) {
var suite = suites[i];
var suiteDiv = this.createDom('div', { className: 'suite' },
this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"),
this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description));
this.suiteDivs[suite.id] = suiteDiv;
var parentDiv = this.outerDiv;
if (suite.parentSuite) {
parentDiv = this.suiteDivs[suite.parentSuite.id];
}
parentDiv.appendChild(suiteDiv);
}
this.startedAt = new Date();
var self = this;
showPassed.onclick = function(evt) {
if (showPassed.checked) {
self.outerDiv.className += ' show-passed';
} else {
self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, '');
}
};
showSkipped.onclick = function(evt) {
if (showSkipped.checked) {
self.outerDiv.className += ' show-skipped';
} else {
self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, '');
}
};
};
jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) {
var results = runner.results();
var className = (results.failedCount > 0) ? "runner failed" : "runner passed";
this.runnerDiv.setAttribute("class", className);
//do it twice for IE
this.runnerDiv.setAttribute("className", className);
var specs = runner.specs();
var specCount = 0;
for (var i = 0; i < specs.length; i++) {
if (this.specFilter(specs[i])) {
specCount++;
}
}
var message = "" + specCount + " spec" + (specCount == 1 ? "" : "s" ) + ", " + results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s");
message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s";
this.runnerMessageSpan.replaceChild(this.createDom('a', { className: 'description', href: '?'}, message), this.runnerMessageSpan.firstChild);
this.finishedAtSpan.appendChild(document.createTextNode("Finished at " + new Date().toString()));
};
jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) {
var results = suite.results();
var status = results.passed() ? 'passed' : 'failed';
if (results.totalCount === 0) { // todo: change this to check results.skipped
status = 'skipped';
}
this.suiteDivs[suite.id].className += " " + status;
};
jasmine.TrivialReporter.prototype.reportSpecStarting = function(spec) {
if (this.logRunningSpecs) {
this.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
}
};
jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
var results = spec.results();
var status = results.passed() ? 'passed' : 'failed';
if (results.skipped) {
status = 'skipped';
}
var specDiv = this.createDom('div', { className: 'spec ' + status },
this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"),
this.createDom('a', {
className: 'description',
href: '?spec=' + encodeURIComponent(spec.getFullName()),
title: spec.getFullName()
}, spec.description));
var resultItems = results.getItems();
var messagesDiv = this.createDom('div', { className: 'messages' });
for (var i = 0; i < resultItems.length; i++) {
var result = resultItems[i];
if (result.type == 'log') {
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
} else if (result.type == 'expect' && result.passed && !result.passed()) {
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
if (result.trace.stack) {
messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
}
}
}
if (messagesDiv.childNodes.length > 0) {
specDiv.appendChild(messagesDiv);
}
this.suiteDivs[spec.suite.id].appendChild(specDiv);
};
jasmine.TrivialReporter.prototype.log = function() {
var console = jasmine.getGlobal().console;
if (console && console.log) {
if (console.log.apply) {
console.log.apply(console, arguments);
} else {
console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
}
}
};
jasmine.TrivialReporter.prototype.getLocation = function() {
return this.document.location;
};
jasmine.TrivialReporter.prototype.specFilter = function(spec) {
var paramMap = {};
var params = this.getLocation().search.substring(1).split('&');
for (var i = 0; i < params.length; i++) {
var p = params[i].split('=');
paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
}
if (!paramMap.spec) {
return true;
}
return spec.getFullName().indexOf(paramMap.spec) === 0;
};
body {
font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif;
}
.jasmine_reporter a:visited, .jasmine_reporter a {
color: #303;
}
.jasmine_reporter a:hover, .jasmine_reporter a:active {
color: blue;
}
.run_spec {
float:right;
padding-right: 5px;
font-size: .8em;
text-decoration: none;
}
.jasmine_reporter {
margin: 0 5px;
}
.banner {
color: #303;
background-color: #fef;
padding: 5px;
}
.logo {
float: left;
font-size: 1.1em;
padding-left: 5px;
}
.logo .version {
font-size: .6em;
padding-left: 1em;
}
.runner.running {
background-color: yellow;
}
.options {
text-align: right;
font-size: .8em;
}
.suite {
border: 1px outset gray;
margin: 5px 0;
padding-left: 1em;
}
.suite .suite {
margin: 5px;
}
.suite.passed {
background-color: #dfd;
}
.suite.failed {
background-color: #fdd;
}
.spec {
margin: 5px;
padding-left: 1em;
clear: both;
}
.spec.failed, .spec.passed, .spec.skipped {
padding-bottom: 5px;
border: 1px solid gray;
}
.spec.failed {
background-color: #fbb;
border-color: red;
}
.spec.passed {
background-color: #bfb;
border-color: green;
}
.spec.skipped {
background-color: #bbb;
}
.messages {
border-left: 1px dashed gray;
padding-left: 1em;
padding-right: 1em;
}
.passed {
background-color: #cfc;
display: none;
}
.failed {
background-color: #fbb;
}
.skipped {
color: #777;
background-color: #eee;
display: none;
}
/*.resultMessage {*/
/*white-space: pre;*/
/*}*/
.resultMessage span.result {
display: block;
line-height: 2em;
color: black;
}
.resultMessage .mismatch {
color: black;
}
.stackTrace {
white-space: pre;
font-size: .8em;
margin-left: 10px;
max-height: 5em;
overflow: auto;
border: 1px inset red;
padding: 1em;
background: #eef;
}
.finished-at {
padding-left: 1em;
font-size: .6em;
}
.show-passed .passed,
.show-skipped .skipped {
display: block;
}
#jasmine_content {
position:fixed;
right: 100%;
}
.runner {
border: 1px solid gray;
display: block;
margin: 5px 0;
padding: 2px 0 2px 10px;
}