123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377 |
- ;
- (function (root, factory) {
- if (typeof define === 'function' && define.amd) {
-
- define(factory);
- } else if (typeof exports === 'object') {
-
-
-
- module.exports = factory();
- } else {
-
- root.returnExports = factory();
- }
- }(this, function () {
- function Empty() {}
- if (!Function.prototype.bind) {
- Function.prototype.bind = function bind(that) {
-
- var target = this;
-
- if (typeof target != "function") {
- throw new TypeError("Function.prototype.bind called on incompatible " + target);
- }
-
-
-
- var args = _Array_slice_.call(arguments, 1);
-
-
-
-
-
-
-
-
-
- var binder = function () {
- if (this instanceof bound) {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- var result = target.apply(
- this,
- args.concat(_Array_slice_.call(arguments))
- );
- if (Object(result) === result) {
- return result;
- }
- return this;
- } else {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- return target.apply(
- that,
- args.concat(_Array_slice_.call(arguments))
- );
- }
- };
-
-
-
-
-
- var boundLength = Math.max(0, target.length - args.length);
-
-
- var boundArgs = [];
- for (var i = 0; i < boundLength; i++) {
- boundArgs.push("$" + i);
- }
-
-
-
-
-
-
- var bound = Function("binder", "return function(" + boundArgs.join(",") + "){return binder.apply(this,arguments)}")(binder);
- if (target.prototype) {
- Empty.prototype = target.prototype;
- bound.prototype = new Empty();
-
- Empty.prototype = null;
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- return bound;
- };
- }
- var call = Function.prototype.call;
- var prototypeOfArray = Array.prototype;
- var prototypeOfObject = Object.prototype;
- var _Array_slice_ = prototypeOfArray.slice;
- var _toString = call.bind(prototypeOfObject.toString);
- var owns = call.bind(prototypeOfObject.hasOwnProperty);
- var defineGetter;
- var defineSetter;
- var lookupGetter;
- var lookupSetter;
- var supportsAccessors;
- if ((supportsAccessors = owns(prototypeOfObject, "__defineGetter__"))) {
- defineGetter = call.bind(prototypeOfObject.__defineGetter__);
- defineSetter = call.bind(prototypeOfObject.__defineSetter__);
- lookupGetter = call.bind(prototypeOfObject.__lookupGetter__);
- lookupSetter = call.bind(prototypeOfObject.__lookupSetter__);
- }
- if ([1,2].splice(0).length != 2) {
- var array_splice = Array.prototype.splice;
- var array_push = Array.prototype.push;
- var array_unshift = Array.prototype.unshift;
- if (function() {
- function makeArray(l) {
- var a = [];
- while (l--) {
- a.unshift(l)
- }
- return a
- }
- var array = []
- , lengthBefore
- ;
- array.splice.bind(array, 0, 0).apply(null, makeArray(20));
- array.splice.bind(array, 0, 0).apply(null, makeArray(26));
- lengthBefore = array.length;
- array.splice(5, 0, "XXX");
- if (lengthBefore + 1 == array.length) {
- return true;
- }
-
-
-
- }()) {
- Array.prototype.splice = function(start, deleteCount) {
- if (!arguments.length) {
- return [];
- } else {
- return array_splice.apply(this, [
- start === void 0 ? 0 : start,
- deleteCount === void 0 ? (this.length - start) : deleteCount
- ].concat(_Array_slice_.call(arguments, 2)))
- }
- };
- }
- else {
- Array.prototype.splice = function(start, deleteCount) {
- var result
- , args = _Array_slice_.call(arguments, 2)
- , addElementsCount = args.length
- ;
- if (!arguments.length) {
- return [];
- }
- if (start === void 0) {
- start = 0;
- }
- if (deleteCount === void 0) {
- deleteCount = this.length - start;
- }
- if (addElementsCount > 0) {
- if (deleteCount <= 0) {
- if (start == this.length) {
- array_push.apply(this, args);
- return [];
- }
- if (start == 0) {
- array_unshift.apply(this, args);
- return [];
- }
- }
-
- result = _Array_slice_.call(this, start, start + deleteCount);
- args.push.apply(args, _Array_slice_.call(this, start + deleteCount, this.length));
- args.unshift.apply(args, _Array_slice_.call(this, 0, start));
-
- args.unshift(0, this.length);
- array_splice.apply(this, args);
- return result;
- }
- return array_splice.call(this, start, deleteCount);
- }
- }
- }
- if ([].unshift(0) != 1) {
- var array_unshift = Array.prototype.unshift;
- Array.prototype.unshift = function() {
- array_unshift.apply(this, arguments);
- return this.length;
- };
- }
- if (!Array.isArray) {
- Array.isArray = function isArray(obj) {
- return _toString(obj) == "[object Array]";
- };
- }
- var boxedString = Object("a");
- var splitString = boxedString[0] != "a" || !(0 in boxedString);
- var properlyBoxesContext = function properlyBoxed(method) {
-
- var properlyBoxes = true;
- if (method) {
- method.call('foo', function (item, index, context) {
- if (typeof context !== 'object') { properlyBoxes = false; }
- });
- }
- return !!method && properlyBoxes;
- };
- if (!Array.prototype.forEach || !properlyBoxesContext(Array.prototype.forEach)) {
- Array.prototype.forEach = function forEach(fun /*, thisp*/) {
- var object = toObject(this),
- self = splitString && _toString(this) == "[object String]" ?
- this.split("") :
- object,
- thisp = arguments[1],
- i = -1,
- length = self.length >>> 0;
-
- if (_toString(fun) != "[object Function]") {
- throw new TypeError();
- }
- while (++i < length) {
- if (i in self) {
-
-
-
- fun.call(thisp, self[i], i, object);
- }
- }
- };
- }
- if (!Array.prototype.map || !properlyBoxesContext(Array.prototype.map)) {
- Array.prototype.map = function map(fun /*, thisp*/) {
- var object = toObject(this),
- self = splitString && _toString(this) == "[object String]" ?
- this.split("") :
- object,
- length = self.length >>> 0,
- result = Array(length),
- thisp = arguments[1];
-
- if (_toString(fun) != "[object Function]") {
- throw new TypeError(fun + " is not a function");
- }
- for (var i = 0; i < length; i++) {
- if (i in self)
- result[i] = fun.call(thisp, self[i], i, object);
- }
- return result;
- };
- }
- if (!Array.prototype.filter || !properlyBoxesContext(Array.prototype.filter)) {
- Array.prototype.filter = function filter(fun /*, thisp */) {
- var object = toObject(this),
- self = splitString && _toString(this) == "[object String]" ?
- this.split("") :
- object,
- length = self.length >>> 0,
- result = [],
- value,
- thisp = arguments[1];
-
- if (_toString(fun) != "[object Function]") {
- throw new TypeError(fun + " is not a function");
- }
- for (var i = 0; i < length; i++) {
- if (i in self) {
- value = self[i];
- if (fun.call(thisp, value, i, object)) {
- result.push(value);
- }
- }
- }
- return result;
- };
- }
- if (!Array.prototype.every || !properlyBoxesContext(Array.prototype.every)) {
- Array.prototype.every = function every(fun /*, thisp */) {
- var object = toObject(this),
- self = splitString && _toString(this) == "[object String]" ?
- this.split("") :
- object,
- length = self.length >>> 0,
- thisp = arguments[1];
-
- if (_toString(fun) != "[object Function]") {
- throw new TypeError(fun + " is not a function");
- }
- for (var i = 0; i < length; i++) {
- if (i in self && !fun.call(thisp, self[i], i, object)) {
- return false;
- }
- }
- return true;
- };
- }
- if (!Array.prototype.some || !properlyBoxesContext(Array.prototype.some)) {
- Array.prototype.some = function some(fun /*, thisp */) {
- var object = toObject(this),
- self = splitString && _toString(this) == "[object String]" ?
- this.split("") :
- object,
- length = self.length >>> 0,
- thisp = arguments[1];
-
- if (_toString(fun) != "[object Function]") {
- throw new TypeError(fun + " is not a function");
- }
- for (var i = 0; i < length; i++) {
- if (i in self && fun.call(thisp, self[i], i, object)) {
- return true;
- }
- }
- return false;
- };
- }
- if (!Array.prototype.reduce) {
- Array.prototype.reduce = function reduce(fun /*, initial*/) {
- var object = toObject(this),
- self = splitString && _toString(this) == "[object String]" ?
- this.split("") :
- object,
- length = self.length >>> 0;
-
- if (_toString(fun) != "[object Function]") {
- throw new TypeError(fun + " is not a function");
- }
-
- if (!length && 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 (++i >= length) {
- throw new TypeError("reduce of empty array with no initial value");
- }
- } while (true);
- }
- for (; i < length; i++) {
- if (i in self) {
- result = fun.call(void 0, result, self[i], i, object);
- }
- }
- return result;
- };
- }
- if (!Array.prototype.reduceRight) {
- Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) {
- var object = toObject(this),
- self = splitString && _toString(this) == "[object String]" ?
- this.split("") :
- object,
- length = self.length >>> 0;
-
- if (_toString(fun) != "[object Function]") {
- throw new TypeError(fun + " is not a function");
- }
-
- if (!length && arguments.length == 1) {
- throw new TypeError("reduceRight of empty array with no initial value");
- }
- var result, i = length - 1;
- if (arguments.length >= 2) {
- result = arguments[1];
- } else {
- do {
- if (i in self) {
- result = self[i--];
- break;
- }
-
- 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 this) {
- result = fun.call(void 0, result, self[i], i, object);
- }
- } while (i--);
- return result;
- };
- }
- if (!Array.prototype.indexOf || ([0, 1].indexOf(1, 2) != -1)) {
- Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) {
- var self = splitString && _toString(this) == "[object String]" ?
- this.split("") :
- toObject(this),
- length = self.length >>> 0;
- if (!length) {
- return -1;
- }
- var i = 0;
- if (arguments.length > 1) {
- i = toInteger(arguments[1]);
- }
-
- i = i >= 0 ? i : Math.max(0, length + i);
- for (; i < length; i++) {
- if (i in self && self[i] === sought) {
- return i;
- }
- }
- return -1;
- };
- }
- if (!Array.prototype.lastIndexOf || ([0, 1].lastIndexOf(0, -3) != -1)) {
- Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) {
- var self = splitString && _toString(this) == "[object String]" ?
- this.split("") :
- toObject(this),
- length = self.length >>> 0;
- if (!length) {
- return -1;
- }
- var i = length - 1;
- if (arguments.length > 1) {
- i = Math.min(i, toInteger(arguments[1]));
- }
-
- i = i >= 0 ? i : length - Math.abs(i);
- for (; i >= 0; i--) {
- if (i in self && sought === self[i]) {
- return i;
- }
- }
- return -1;
- };
- }
- if (!Object.keys) {
-
- var hasDontEnumBug = true,
- hasProtoEnumBug = (function () {}).propertyIsEnumerable('prototype'),
- dontEnums = [
- "toString",
- "toLocaleString",
- "valueOf",
- "hasOwnProperty",
- "isPrototypeOf",
- "propertyIsEnumerable",
- "constructor"
- ],
- dontEnumsLength = dontEnums.length;
- for (var key in {"toString": null}) {
- hasDontEnumBug = false;
- }
- Object.keys = function keys(object) {
- var isFunction = _toString(object) === '[object Function]',
- isObject = object !== null && typeof object === 'object';
- if (!isObject && !isFunction) {
- throw new TypeError("Object.keys called on a non-object");
- }
- var keys = [],
- skipProto = hasProtoEnumBug && isFunction;
- for (var name in object) {
- if (!(skipProto && name === 'prototype') && owns(object, name)) {
- keys.push(name);
- }
- }
- if (hasDontEnumBug) {
- var ctor = object.constructor,
- skipConstructor = ctor && ctor.prototype === object;
- for (var i = 0; i < dontEnumsLength; i++) {
- var dontEnum = dontEnums[i];
- if (!(skipConstructor && dontEnum === 'constructor') && owns(object, dontEnum)) {
- keys.push(dontEnum);
- }
- }
- }
- return keys;
- };
- }
- var negativeDate = -62198755200000,
- negativeYearString = "-000001";
- if (
- !Date.prototype.toISOString ||
- (new Date(negativeDate).toISOString().indexOf(negativeYearString) === -1)
- ) {
- Date.prototype.toISOString = function toISOString() {
- var result, length, value, year, month;
- if (!isFinite(this)) {
- throw new RangeError("Date.prototype.toISOString called on non-finite value.");
- }
- year = this.getUTCFullYear();
- month = this.getUTCMonth();
-
- year += Math.floor(month / 12);
- month = (month % 12 + 12) % 12;
-
- result = [month + 1, this.getUTCDate(),
- this.getUTCHours(), this.getUTCMinutes(), this.getUTCSeconds()];
- year = (
- (year < 0 ? "-" : (year > 9999 ? "+" : "")) +
- ("00000" + Math.abs(year))
- .slice(0 <= year && year <= 9999 ? -4 : -6)
- );
- length = result.length;
- while (length--) {
- value = result[length];
-
-
- if (value < 10) {
- result[length] = "0" + value;
- }
- }
-
- return (
- year + "-" + result.slice(0, 2).join("-") +
- "T" + result.slice(2).join(":") + "." +
- ("000" + this.getUTCMilliseconds()).slice(-3) + "Z"
- );
- };
- }
- var dateToJSONIsSupported = false;
- try {
- dateToJSONIsSupported = (
- Date.prototype.toJSON &&
- new Date(NaN).toJSON() === null &&
- new Date(negativeDate).toJSON().indexOf(negativeYearString) !== -1 &&
- Date.prototype.toJSON.call({
- toISOString: function () {
- return true;
- }
- })
- );
- } catch (e) {
- }
- if (!dateToJSONIsSupported) {
- Date.prototype.toJSON = function toJSON(key) {
-
-
-
-
-
- var o = Object(this),
- tv = toPrimitive(o),
- toISO;
-
- if (typeof tv === "number" && !isFinite(tv)) {
- return null;
- }
-
-
- toISO = o.toISOString;
-
- if (typeof toISO != "function") {
- throw new TypeError("toISOString property is not callable");
- }
-
-
- return toISO.call(o);
-
-
-
-
-
-
-
- };
- }
- if (!Date.parse || "Date.parse is buggy") {
-
-
- Date = (function(NativeDate) {
-
- function Date(Y, M, D, h, m, s, ms) {
- var length = arguments.length;
- if (this instanceof NativeDate) {
- var date = length == 1 && String(Y) === Y ?
-
- new NativeDate(Date.parse(Y)) :
-
-
- length >= 7 ? new NativeDate(Y, M, D, h, m, s, ms) :
- length >= 6 ? new NativeDate(Y, M, D, h, m, s) :
- 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) :
- new NativeDate();
-
- date.constructor = Date;
- return date;
- }
- return NativeDate.apply(this, arguments);
- };
-
- var isoDateExpression = 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 months = [
- 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365
- ];
- 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)
- );
- }
- function toUTC(t) {
- return Number(new NativeDate(1970, 0, 1, 0, 0, 0, t));
- }
-
- for (var key in NativeDate) {
- Date[key] = NativeDate[key];
- }
-
- Date.now = NativeDate.now;
- Date.UTC = NativeDate.UTC;
- Date.prototype = NativeDate.prototype;
- Date.prototype.constructor = Date;
-
- Date.parse = function parse(string) {
- var match = isoDateExpression.exec(string);
- if (match) {
-
-
-
- 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),
-
-
-
- isLocalTime = Boolean(match[4] && !match[8]),
- signOffset = match[9] === "-" ? 1 : -1,
- hourOffset = Number(match[10] || 0),
- minuteOffset = Number(match[11] || 0),
- result;
- if (
- hour < (
- minute > 0 || second > 0 || millisecond > 0 ?
- 24 : 25
- ) &&
- minute < 60 && second < 60 && millisecond < 1000 &&
- month > -1 && month < 12 && hourOffset < 24 &&
- minuteOffset < 60 &&
- 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);
- };
- return Date;
- })(Date);
- }
- if (!Date.now) {
- Date.now = function now() {
- return new Date().getTime();
- };
- }
- if (!Number.prototype.toFixed || (0.00008).toFixed(3) !== '0.000' || (0.9).toFixed(0) === '0' || (1.255).toFixed(2) !== '1.25' || (1000000000000000128).toFixed(0) !== "1000000000000000128") {
-
- (function () {
- var base, size, data, i;
- base = 1e7;
- size = 6;
- data = [0, 0, 0, 0, 0, 0];
- function multiply(n, c) {
- var i = -1;
- while (++i < size) {
- c += n * data[i];
- data[i] = c % base;
- c = Math.floor(c / base);
- }
- }
- function divide(n) {
- var i = size, c = 0;
- while (--i >= 0) {
- c += data[i];
- data[i] = Math.floor(c / n);
- c = (c % n) * base;
- }
- }
- function toString() {
- var i = size;
- var s = '';
- while (--i >= 0) {
- if (s !== '' || i === 0 || data[i] !== 0) {
- var t = String(data[i]);
- if (s === '') {
- s = t;
- } else {
- s += '0000000'.slice(0, 7 - t.length) + t;
- }
- }
- }
- return s;
- }
- function pow(x, n, acc) {
- return (n === 0 ? acc : (n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc)));
- }
- function log(x) {
- var n = 0;
- while (x >= 4096) {
- n += 12;
- x /= 4096;
- }
- while (x >= 2) {
- n += 1;
- x /= 2;
- }
- return n;
- }
- Number.prototype.toFixed = function (fractionDigits) {
- var f, x, s, m, e, z, j, k;
-
- f = Number(fractionDigits);
- f = f !== 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 (x !== x) {
- return "NaN";
- }
-
- if (x <= -1e21 || x >= 1e21) {
- return String(x);
- }
- s = "";
- if (x < 0) {
- s = "-";
- x = -x;
- }
- m = "0";
- if (x > 1e-21) {
-
-
- e = log(x * pow(2, 69, 1)) - 69;
- z = (e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1));
- z *= 0x10000000000000;
- e = 52 - e;
-
-
- if (e > 0) {
- multiply(0, z);
- j = f;
- while (j >= 7) {
- multiply(1e7, 0);
- j -= 7;
- }
- multiply(pow(10, j, 1), 0);
- j = e - 1;
- while (j >= 23) {
- divide(1 << 23);
- j -= 23;
- }
- divide(1 << j);
- multiply(1, 1);
- divide(2);
- m = toString();
- } else {
- multiply(0, z);
- multiply(1 << (-e), 0);
- m = toString() + '0.00000000000000000000'.slice(2, 2 + f);
- }
- }
- if (f > 0) {
- k = m.length;
- if (k <= f) {
- m = s + '0.0000000000000000000'.slice(0, f - k + 2) + m;
- } else {
- m = s + m.slice(0, k - f) + '.' + m.slice(k - f);
- }
- } else {
- m = s + m;
- }
- return m;
- }
- }());
- }
- var string_split = String.prototype.split;
- if (
- 'ab'.split(/(?:ab)*/).length !== 2 ||
- '.'.split(/(.?)(.?)/).length !== 4 ||
- 'tesst'.split(/(s)*/)[1] === "t" ||
- ''.split(/.?/).length ||
- '.'.split(/()()/).length > 1
- ) {
- (function () {
- var compliantExecNpcg = /()??/.exec("")[1] === void 0;
- String.prototype.split = function (separator, limit) {
- var string = this;
- if (separator === void 0 && limit === 0)
- return [];
-
- if (Object.prototype.toString.call(separator) !== "[object RegExp]") {
- return string_split.apply(this, arguments);
- }
- var output = [],
- flags = (separator.ignoreCase ? "i" : "") +
- (separator.multiline ? "m" : "") +
- (separator.extended ? "x" : "") +
- (separator.sticky ? "y" : ""),
- lastLastIndex = 0,
-
- separator = new RegExp(separator.source, flags + "g"),
- separator2, match, lastIndex, lastLength;
- string += "";
- if (!compliantExecNpcg) {
-
- separator2 = new RegExp("^" + separator.source + "$(?!\\s)", flags);
- }
-
- limit = limit === void 0 ?
- -1 >>> 0 :
- limit >>> 0;
- while (match = separator.exec(string)) {
-
- lastIndex = match.index + match[0].length;
- if (lastIndex > lastLastIndex) {
- output.push(string.slice(lastLastIndex, match.index));
-
-
- if (!compliantExecNpcg && match.length > 1) {
- match[0].replace(separator2, function () {
- for (var i = 1; i < arguments.length - 2; i++) {
- if (arguments[i] === void 0) {
- match[i] = void 0;
- }
- }
- });
- }
- if (match.length > 1 && match.index < string.length) {
- Array.prototype.push.apply(output, match.slice(1));
- }
- lastLength = match[0].length;
- lastLastIndex = lastIndex;
- if (output.length >= limit) {
- break;
- }
- }
- if (separator.lastIndex === match.index) {
- separator.lastIndex++;
- }
- }
- if (lastLastIndex === string.length) {
- if (lastLength || !separator.test("")) {
- output.push("");
- }
- } else {
- output.push(string.slice(lastLastIndex));
- }
- return output.length > limit ? output.slice(0, limit) : output;
- };
- }());
- } else if ("0".split(void 0, 0).length) {
- String.prototype.split = function(separator, limit) {
- if (separator === void 0 && limit === 0) return [];
- return string_split.apply(this, arguments);
- }
- }
- if ("".substr && "0b".substr(-1) !== "b") {
- var string_substr = String.prototype.substr;
-
- String.prototype.substr = function(start, length) {
- return string_substr.call(
- this,
- start < 0 ? ((start = this.length + start) < 0 ? 0 : start) : start,
- length
- );
- }
- }
- 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";
- if (!String.prototype.trim || ws.trim()) {
-
-
- ws = "[" + ws + "]";
- var trimBeginRegexp = new RegExp("^" + ws + ws + "*"),
- trimEndRegexp = new RegExp(ws + ws + "*$");
- String.prototype.trim = function trim() {
- if (this === void 0 || this === null) {
- throw new TypeError("can't convert "+this+" to object");
- }
- return String(this)
- .replace(trimBeginRegexp, "")
- .replace(trimEndRegexp, "");
- };
- }
- if (parseInt(ws + '08') !== 8 || parseInt(ws + '0x16') !== 22) {
- parseInt = (function (origParseInt) {
- var hexRegex = /^0[xX]/;
- return function parseIntES5(str, radix) {
- str = String(str).trim();
- if (!+radix) {
- radix = hexRegex.test(str) ? 16 : 10;
- }
- return origParseInt(str, radix);
- };
- }(parseInt));
- }
- function toInteger(n) {
- n = +n;
- if (n !== n) {
- n = 0;
- } else if (n !== 0 && n !== (1/0) && n !== -(1/0)) {
- n = (n > 0 || -1) * Math.floor(Math.abs(n));
- }
- return n;
- }
- function isPrimitive(input) {
- var type = typeof input;
- return (
- input === null ||
- type === "undefined" ||
- type === "boolean" ||
- type === "number" ||
- type === "string"
- );
- }
- function toPrimitive(input) {
- var val, valueOf, toString;
- if (isPrimitive(input)) {
- return input;
- }
- valueOf = input.valueOf;
- if (typeof valueOf === "function") {
- val = valueOf.call(input);
- if (isPrimitive(val)) {
- return val;
- }
- }
- toString = input.toString;
- if (typeof toString === "function") {
- val = toString.call(input);
- if (isPrimitive(val)) {
- return val;
- }
- }
- throw new TypeError();
- }
- var toObject = function (o) {
- if (o == null) {
- throw new TypeError("can't convert "+o+" to object");
- }
- return Object(o);
- };
- }));
|