Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function() {
- /**
- * @param {number} step
- * @return {?}
- */
- function add(step) {
- /**
- * @param {Function} collection
- * @param {Function} callback
- * @param {(RegExp|string)} basis
- * @param {Array} indices
- * @param {number} i
- * @param {number} value
- * @return {?}
- */
- function func(collection, callback, basis, indices, i, value) {
- for (;i >= 0 && value > i;i += step) {
- var index = indices ? indices[i] : i;
- basis = callback(basis, collection[index], index, collection);
- }
- return basis;
- }
- return function(result, callback, basis, thisArg) {
- callback = bind(callback, thisArg, 4);
- var indices = !isArray(result) && _.keys(result);
- var udataCur = (indices || result).length;
- /** @type {number} */
- var i = step > 0 ? 0 : udataCur - 1;
- return arguments.length < 3 && (basis = result[indices ? indices[i] : i], i += step), func(result, callback, basis, indices, i, udataCur);
- };
- }
- /**
- * @param {number} increment
- * @return {?}
- */
- function check(increment) {
- return function(data, callback, thisObj) {
- callback = makeIterator(callback, thisObj);
- var ret = value(data);
- /** @type {number} */
- var index = increment > 0 ? 0 : ret - 1;
- for (;index >= 0 && ret > index;index += increment) {
- if (callback(data[index], index, data)) {
- return index;
- }
- }
- return-1;
- };
- }
- /**
- * @param {number} direction
- * @param {?} require
- * @param {number} cb
- * @return {?}
- */
- function init(direction, require, cb) {
- return function(arg, val, index) {
- /** @type {number} */
- var i = 0;
- var n = value(arg);
- if ("number" == typeof index) {
- if (direction > 0) {
- /** @type {number} */
- i = index >= 0 ? index : Math.max(index + n, i);
- } else {
- n = index >= 0 ? Math.min(index + 1, n) : index + n + 1;
- }
- } else {
- if (cb && (index && n)) {
- return index = cb(arg, val), arg[index] === val ? index : -1;
- }
- }
- if (val !== val) {
- return index = require(slice.call(arg, i, n), _.isNaN), index >= 0 ? index + i : -1;
- }
- /** @type {number} */
- index = direction > 0 ? i : n - 1;
- for (;index >= 0 && n > index;index += direction) {
- if (arg[index] === val) {
- return index;
- }
- }
- return-1;
- };
- }
- /**
- * @param {Object} obj
- * @param {Array} arr
- * @return {undefined}
- */
- function remove(obj, arr) {
- /** @type {number} */
- var index = tokenized.length;
- var c = obj.constructor;
- var extention = _.isFunction(c) && c.prototype || ObjProto;
- /** @type {string} */
- var key = "constructor";
- if (_.has(obj, key)) {
- if (!_.contains(arr, key)) {
- arr.push(key);
- }
- }
- for (;index--;) {
- key = tokenized[index];
- if (key in obj) {
- if (obj[key] !== extention[key]) {
- if (!_.contains(arr, key)) {
- arr.push(key);
- }
- }
- }
- }
- }
- var root = this;
- var previousUnderscore = root._;
- var ArrayProto = Array.prototype;
- var ObjProto = Object.prototype;
- var FuncProto = Function.prototype;
- /** @type {function (this:(Array.<T>|{length: number}), ...[T]): number} */
- var push = ArrayProto.push;
- /** @type {function (this:(Array.<T>|string|{length: number}), *=, *=): Array.<T>} */
- var slice = ArrayProto.slice;
- /** @type {function (this:*): string} */
- var toString = ObjProto.toString;
- /** @type {function (this:Object, *): boolean} */
- var hasOwnProperty = ObjProto.hasOwnProperty;
- /** @type {function (*): boolean} */
- var nativeIsArray = Array.isArray;
- /** @type {function (Object): Array.<string>} */
- var nativeKeys = Object.keys;
- /** @type {function (this:Function, (Object|null|undefined), ...[*]): Function} */
- var nativeBind = FuncProto.bind;
- /** @type {function ((Object|null), (Object|null)=): Object} */
- var objectCreate = Object.create;
- /**
- * @return {undefined}
- */
- var ctor = function() {
- };
- /**
- * @param {?} obj
- * @return {?}
- */
- var _ = function(obj) {
- return obj instanceof _ ? obj : this instanceof _ ? void(this._wrapped = obj) : new _(obj);
- };
- if ("undefined" != typeof exports) {
- if ("undefined" != typeof module) {
- if (module.exports) {
- /** @type {function (?): ?} */
- exports = module.exports = _;
- }
- }
- /** @type {function (?): ?} */
- exports._ = _;
- } else {
- /** @type {function (?): ?} */
- root._ = _;
- }
- /** @type {string} */
- _.VERSION = "1.8.3";
- /**
- * @param {Function} func
- * @param {number} thisArg
- * @param {number} deepDataAndEvents
- * @return {?}
- */
- var bind = function(func, thisArg, deepDataAndEvents) {
- if (thisArg === void 0) {
- return func;
- }
- switch(null == deepDataAndEvents ? 3 : deepDataAndEvents) {
- case 1:
- return function(accumulator) {
- return func.call(thisArg, accumulator);
- };
- case 2:
- return function(accumulator, index) {
- return func.call(thisArg, accumulator, index);
- };
- case 3:
- return function(accumulator, index, object) {
- return func.call(thisArg, accumulator, index, object);
- };
- case 4:
- return function(accumulator, index, object, collection) {
- return func.call(thisArg, accumulator, index, object, collection);
- };
- }
- return function() {
- return func.apply(thisArg, arguments);
- };
- };
- /**
- * @param {string} func
- * @param {string} thisObj
- * @param {number} deepDataAndEvents
- * @return {?}
- */
- var makeIterator = function(func, thisObj, deepDataAndEvents) {
- return null == func ? _.identity : _.isFunction(func) ? bind(func, thisObj, deepDataAndEvents) : _.isObject(func) ? _.matcher(func) : _.property(func);
- };
- /**
- * @param {string} callback
- * @param {string} thisObj
- * @return {?}
- */
- _.iteratee = function(callback, thisObj) {
- return makeIterator(callback, thisObj, 1 / 0);
- };
- /**
- * @param {Function} main_callback
- * @param {boolean} dataAndEvents
- * @return {?}
- */
- var some = function(main_callback, dataAndEvents) {
- return function(result) {
- /** @type {number} */
- var argLength = arguments.length;
- if (2 > argLength || null == result) {
- return result;
- }
- /** @type {number} */
- var argsIndex = 1;
- for (;argLength > argsIndex;argsIndex++) {
- var iterable = arguments[argsIndex];
- var keys = main_callback(iterable);
- var len = keys.length;
- /** @type {number} */
- var i = 0;
- for (;len > i;i++) {
- var key = keys[i];
- if (!(dataAndEvents && result[key] !== void 0)) {
- result[key] = iterable[key];
- }
- }
- }
- return result;
- };
- };
- /**
- * @param {Object} proto
- * @return {?}
- */
- var create = function(proto) {
- if (!_.isObject(proto)) {
- return{};
- }
- if (objectCreate) {
- return objectCreate(proto);
- }
- /** @type {Object} */
- ctor.prototype = proto;
- var child = new ctor;
- return ctor.prototype = null, child;
- };
- /**
- * @param {string} key
- * @return {?}
- */
- var property = function(key) {
- return function($cookies) {
- return null == $cookies ? void 0 : $cookies[key];
- };
- };
- /** @type {number} */
- var max = Math.pow(2, 53) - 1;
- var value = property("length");
- /**
- * @param {?} obj
- * @return {?}
- */
- var isArray = function(obj) {
- var val = value(obj);
- return "number" == typeof val && (val >= 0 && max >= val);
- };
- /** @type {function (Object, Function, number): ?} */
- _.each = _.forEach = function(obj, callback, thisArg) {
- callback = bind(callback, thisArg);
- var i;
- var l;
- if (isArray(obj)) {
- /** @type {number} */
- i = 0;
- l = obj.length;
- for (;l > i;i++) {
- callback(obj[i], i, obj);
- }
- } else {
- var items = _.keys(obj);
- /** @type {number} */
- i = 0;
- l = items.length;
- for (;l > i;i++) {
- callback(obj[items[i]], items[i], obj);
- }
- }
- return obj;
- };
- /** @type {function (Object, Function, string): ?} */
- _.map = _.collect = function(obj, callback, thisObj) {
- callback = makeIterator(callback, thisObj);
- var indices = !isArray(obj) && _.keys(obj);
- var indents = (indices || obj).length;
- /** @type {Array} */
- var result = Array(indents);
- /** @type {number} */
- var i = 0;
- for (;indents > i;i++) {
- var index = indices ? indices[i] : i;
- result[i] = callback(obj[index], index, obj);
- }
- return result;
- };
- _.reduce = _.foldl = _.inject = add(1);
- _.reduceRight = _.foldr = add(-1);
- /** @type {function (Object, (Node|string), string): ?} */
- _.find = _.detect = function(item, f, remove) {
- var root;
- return root = isArray(item) ? _.findIndex(item, f, remove) : _.findKey(item, f, remove), root !== void 0 && root !== -1 ? item[root] : void 0;
- };
- /** @type {function (Object, Function, string): ?} */
- _.filter = _.select = function(obj, callback, thisObj) {
- /** @type {Array} */
- var acc = [];
- return callback = makeIterator(callback, thisObj), _.each(obj, function(node, mongoObject, arg) {
- if (callback(node, mongoObject, arg)) {
- acc.push(node);
- }
- }), acc;
- };
- /**
- * @param {Object} qualifier
- * @param {string} iterator
- * @param {Object} context
- * @return {?}
- */
- _.reject = function(qualifier, iterator, context) {
- return _.filter(qualifier, _.negate(makeIterator(iterator)), context);
- };
- /** @type {function (string, Text, string): ?} */
- _.every = _.all = function(object, callback, thisObj) {
- callback = makeIterator(callback, thisObj);
- var list = !isArray(object) && _.keys(object);
- var cnl = (list || object).length;
- /** @type {number} */
- var value = 0;
- for (;cnl > value;value++) {
- var index = list ? list[value] : value;
- if (!callback(object[index], index, object)) {
- return false;
- }
- }
- return true;
- };
- /** @type {function (string, Text, string): ?} */
- _.some = _.any = function(collection, callback, thisObj) {
- callback = makeIterator(callback, thisObj);
- var list = !isArray(collection) && _.keys(collection);
- var cnl = (list || collection).length;
- /** @type {number} */
- var value = 0;
- for (;cnl > value;value++) {
- var index = list ? list[value] : value;
- if (callback(collection[index], index, collection)) {
- return true;
- }
- }
- return false;
- };
- /** @type {function (?, string, (number|string), boolean): ?} */
- _.contains = _.includes = _.include = function(val, key, id, msg) {
- return isArray(val) || (val = _.values(val)), ("number" != typeof id || msg) && (id = 0), _.indexOf(val, key, id) >= 0;
- };
- /**
- * @param {Object} val
- * @param {string} method
- * @return {?}
- */
- _.invoke = function(val, method) {
- /** @type {Array.<?>} */
- var args = slice.call(arguments, 2);
- var isFunc = _.isFunction(method);
- return _.map(val, function(value) {
- var wrapper = isFunc ? method : value[method];
- return null == wrapper ? wrapper : wrapper.apply(value, args);
- });
- };
- /**
- * @param {Object} obj
- * @param {(number|string)} key
- * @return {?}
- */
- _.pluck = function(obj, key) {
- return _.map(obj, _.property(key));
- };
- /**
- * @param {Object} qualifier
- * @param {string} attrs
- * @return {?}
- */
- _.where = function(qualifier, attrs) {
- return _.filter(qualifier, _.matcher(attrs));
- };
- /**
- * @param {string} expr
- * @param {string} attrs
- * @return {?}
- */
- _.findWhere = function(expr, attrs) {
- return _.find(expr, _.matcher(attrs));
- };
- /**
- * @param {number} a
- * @param {number} iterator
- * @param {string} thisObj
- * @return {?}
- */
- _.max = function(a, iterator, thisObj) {
- var obj;
- var i;
- /** @type {number} */
- var value = -1 / 0;
- /** @type {number} */
- var longest = -1 / 0;
- if (null == iterator && null != a) {
- a = isArray(a) ? a : _.values(a);
- /** @type {number} */
- var key2 = 0;
- var al = a.length;
- for (;al > key2;key2++) {
- obj = a[key2];
- if (obj > value) {
- value = obj;
- }
- }
- } else {
- iterator = makeIterator(iterator, thisObj);
- _.each(a, function(x, opt_obj2, capture) {
- i = iterator(x, opt_obj2, capture);
- if (i > longest || i === -1 / 0 && value === -1 / 0) {
- /** @type {number} */
- value = x;
- longest = i;
- }
- });
- }
- return value;
- };
- /**
- * @param {number} obj
- * @param {number} iterator
- * @param {string} thisObj
- * @return {?}
- */
- _.min = function(obj, iterator, thisObj) {
- var maxValue;
- var temp;
- /** @type {number} */
- var value = 1 / 0;
- /** @type {number} */
- var max = 1 / 0;
- if (null == iterator && null != obj) {
- obj = isArray(obj) ? obj : _.values(obj);
- /** @type {number} */
- var i = 0;
- var l = obj.length;
- for (;l > i;i++) {
- maxValue = obj[i];
- if (value > maxValue) {
- value = maxValue;
- }
- }
- } else {
- iterator = makeIterator(iterator, thisObj);
- _.each(obj, function(x, index, arr) {
- temp = iterator(x, index, arr);
- if (max > temp || 1 / 0 === temp && 1 / 0 === value) {
- /** @type {number} */
- value = x;
- max = temp;
- }
- });
- }
- return value;
- };
- /**
- * @param {?} obj
- * @return {?}
- */
- _.shuffle = function(obj) {
- var j;
- var values = isArray(obj) ? obj : _.values(obj);
- var n = values.length;
- /** @type {Array} */
- var result = Array(n);
- /** @type {number} */
- var i = 0;
- for (;n > i;i++) {
- j = _.random(0, i);
- if (j !== i) {
- result[i] = result[j];
- }
- result[j] = values[i];
- }
- return result;
- };
- /**
- * @param {?} obj
- * @param {number} n
- * @param {boolean} guard
- * @return {?}
- */
- _.sample = function(obj, n, guard) {
- return null == n || guard ? (isArray(obj) || (obj = _.values(obj)), obj[_.random(obj.length - 1)]) : _.shuffle(obj).slice(0, Math.max(0, n));
- };
- /**
- * @param {Object} val
- * @param {Text} callback
- * @param {string} thisObj
- * @return {?}
- */
- _.sortBy = function(val, callback, thisObj) {
- return callback = makeIterator(callback, thisObj), _.pluck(_.map(val, function(value, index, collection) {
- return{
- value : value,
- index : index,
- criteria : callback(value, index, collection)
- };
- }).sort(function(left, right) {
- var a = left.criteria;
- var b = right.criteria;
- if (a !== b) {
- if (a > b || a === void 0) {
- return 1;
- }
- if (b > a || b === void 0) {
- return-1;
- }
- }
- return left.index - right.index;
- }), "value");
- };
- /**
- * @param {Function} behavior
- * @return {?}
- */
- var group = function(behavior) {
- return function(attributes, callback, thisObj) {
- var result = {};
- return callback = makeIterator(callback, thisObj), _.each(attributes, function(key, i) {
- var value = callback(key, i, attributes);
- behavior(result, key, value);
- }), result;
- };
- };
- _.groupBy = group(function(obj, v, key) {
- if (_.has(obj, key)) {
- obj[key].push(v);
- } else {
- /** @type {Array} */
- obj[key] = [v];
- }
- });
- _.indexBy = group(function(qs, val, i) {
- qs[i] = val;
- });
- _.countBy = group(function(result, dataAndEvents, key) {
- if (_.has(result, key)) {
- result[key]++;
- } else {
- /** @type {number} */
- result[key] = 1;
- }
- });
- /**
- * @param {Object} obj
- * @return {?}
- */
- _.toArray = function(obj) {
- return obj ? _.isArray(obj) ? slice.call(obj) : isArray(obj) ? _.map(obj, _.identity) : _.values(obj) : [];
- };
- /**
- * @param {string} obj
- * @return {?}
- */
- _.size = function(obj) {
- return null == obj ? 0 : isArray(obj) ? obj.length : _.keys(obj).length;
- };
- /**
- * @param {Object} attributes
- * @param {Text} iterator
- * @param {string} thisObj
- * @return {?}
- */
- _.partition = function(attributes, iterator, thisObj) {
- iterator = makeIterator(iterator, thisObj);
- /** @type {Array} */
- var trues = [];
- /** @type {Array} */
- var falses = [];
- return _.each(attributes, function(value, index, list) {
- (iterator(value, index, list) ? trues : falses).push(value);
- }), [trues, falses];
- };
- /** @type {function (string, number, boolean): ?} */
- _.first = _.head = _.take = function(array, n, guard) {
- return null == array ? void 0 : null == n || guard ? array[0] : _.initial(array, array.length - n);
- };
- /**
- * @param {string} array
- * @param {number} t
- * @param {boolean} r
- * @return {?}
- */
- _.initial = function(array, t, r) {
- return slice.call(array, 0, Math.max(0, array.length - (null == t || r ? 1 : t)));
- };
- /**
- * @param {string} array
- * @param {number} n
- * @param {boolean} guard
- * @return {?}
- */
- _.last = function(array, n, guard) {
- return null == array ? void 0 : null == n || guard ? array[array.length - 1] : _.rest(array, Math.max(0, array.length - n));
- };
- /** @type {function (string, number, boolean): ?} */
- _.rest = _.tail = _.drop = function(array, t, r) {
- return slice.call(array, null == t || r ? 1 : t);
- };
- /**
- * @param {Object} qualifier
- * @return {?}
- */
- _.compact = function(qualifier) {
- return _.filter(qualifier, _.identity);
- };
- /**
- * @param {(Arguments|Array)} obj
- * @param {boolean} shallow
- * @param {boolean} recurring
- * @param {number} dataAndEvents
- * @return {?}
- */
- var flatten = function(obj, shallow, recurring, dataAndEvents) {
- /** @type {Array} */
- var result = [];
- /** @type {number} */
- var ri = 0;
- var argsIndex = dataAndEvents || 0;
- var val = value(obj);
- for (;val > argsIndex;argsIndex++) {
- var iterable = obj[argsIndex];
- if (isArray(iterable) && (_.isArray(iterable) || _.isArguments(iterable))) {
- if (!shallow) {
- iterable = flatten(iterable, shallow, recurring);
- }
- /** @type {number} */
- var i = 0;
- var len = iterable.length;
- result.length += len;
- for (;len > i;) {
- result[ri++] = iterable[i++];
- }
- } else {
- if (!recurring) {
- result[ri++] = iterable;
- }
- }
- }
- return result;
- };
- /**
- * @param {Array} array
- * @param {boolean} shallow
- * @return {?}
- */
- _.flatten = function(array, shallow) {
- return flatten(array, shallow, false);
- };
- /**
- * @param {Object} array
- * @return {?}
- */
- _.without = function(array) {
- return _.difference(array, slice.call(arguments, 1));
- };
- /** @type {function (Array, string, string, string): ?} */
- _.uniq = _.unique = function(results, isSorted, callback, thisObj) {
- if (!_.isBoolean(isSorted)) {
- /** @type {string} */
- thisObj = callback;
- /** @type {string} */
- callback = isSorted;
- /** @type {boolean} */
- isSorted = false;
- }
- if (null != callback) {
- callback = makeIterator(callback, thisObj);
- }
- /** @type {Array} */
- var arr = [];
- /** @type {Array} */
- var current = [];
- /** @type {number} */
- var i = 0;
- var val = value(results);
- for (;val > i;i++) {
- var item = results[i];
- var key = callback ? callback(item, i, results) : item;
- if (isSorted) {
- if (!(i && current === key)) {
- arr.push(item);
- }
- current = key;
- } else {
- if (callback) {
- if (!_.contains(current, key)) {
- current.push(key);
- arr.push(item);
- }
- } else {
- if (!_.contains(arr, item)) {
- arr.push(item);
- }
- }
- }
- }
- return arr;
- };
- /**
- * @return {?}
- */
- _.union = function() {
- return _.uniq(flatten(arguments, true, true));
- };
- /**
- * @param {Array} array
- * @return {?}
- */
- _.intersection = function(array) {
- /** @type {Array} */
- var result = [];
- /** @type {number} */
- var l = arguments.length;
- /** @type {number} */
- var index = 0;
- var idx = value(array);
- for (;idx > index;index++) {
- var item = array[index];
- if (!_.contains(result, item)) {
- /** @type {number} */
- var i = 1;
- for (;l > i && _.contains(arguments[i], item);i++) {
- }
- if (i === l) {
- result.push(item);
- }
- }
- }
- return result;
- };
- /**
- * @param {Object} qualifier
- * @return {?}
- */
- _.difference = function(qualifier) {
- var rest = flatten(arguments, true, true, 1);
- return _.filter(qualifier, function(key) {
- return!_.contains(rest, key);
- });
- };
- /**
- * @return {?}
- */
- _.zip = function() {
- return _.unzip(arguments);
- };
- /**
- * @param {Object} args
- * @return {?}
- */
- _.unzip = function(args) {
- var indents = args && _.max(args, value).length || 0;
- /** @type {Array} */
- var results = Array(indents);
- /** @type {number} */
- var i = 0;
- for (;indents > i;i++) {
- results[i] = _.pluck(args, i);
- }
- return results;
- };
- /**
- * @param {Array} list
- * @param {Array} values
- * @return {?}
- */
- _.object = function(list, values) {
- var result = {};
- /** @type {number} */
- var i = 0;
- var val = value(list);
- for (;val > i;i++) {
- if (values) {
- result[list[i]] = values[i];
- } else {
- result[list[i][0]] = list[i][1];
- }
- }
- return result;
- };
- _.findIndex = check(1);
- _.findLastIndex = check(-1);
- /**
- * @param {Array} obj
- * @param {?} context
- * @param {Text} iterator
- * @param {string} thisObj
- * @return {?}
- */
- _.sortedIndex = function(obj, context, iterator, thisObj) {
- iterator = makeIterator(iterator, thisObj, 1);
- var key = iterator(context);
- /** @type {number} */
- var low = 0;
- var high = value(obj);
- for (;high > low;) {
- /** @type {number} */
- var mid = Math.floor((low + high) / 2);
- if (iterator(obj[mid]) < key) {
- /** @type {number} */
- low = mid + 1;
- } else {
- /** @type {number} */
- high = mid;
- }
- }
- return low;
- };
- _.indexOf = init(1, _.findIndex, _.sortedIndex);
- _.lastIndexOf = init(-1, _.findLastIndex);
- /**
- * @param {number} start
- * @param {number} stop
- * @param {number} step
- * @return {?}
- */
- _.range = function(start, stop, step) {
- if (null == stop) {
- stop = start || 0;
- /** @type {number} */
- start = 0;
- }
- step = step || 1;
- /** @type {number} */
- var length = Math.max(Math.ceil((stop - start) / step), 0);
- /** @type {Array} */
- var result = Array(length);
- /** @type {number} */
- var i = 0;
- for (;length > i;i++, start += step) {
- /** @type {number} */
- result[i] = start;
- }
- return result;
- };
- /**
- * @param {Function} func
- * @param {Function} type
- * @param {?} self
- * @param {?} obj
- * @param {?} args
- * @return {?}
- */
- var get = function(func, type, self, obj, args) {
- if (!(obj instanceof type)) {
- return func.apply(self, args);
- }
- var instance = create(func.prototype);
- var result = func.apply(instance, args);
- return _.isObject(result) ? result : instance;
- };
- /**
- * @param {Object} func
- * @param {string=} callback
- * @return {function (...[?]): ?}
- */
- _.bind = function(func, callback) {
- if (nativeBind && func.bind === nativeBind) {
- return nativeBind.apply(func, slice.call(arguments, 1));
- }
- if (!_.isFunction(func)) {
- throw new TypeError("Bind must be called on a function");
- }
- /** @type {Array.<?>} */
- var args = slice.call(arguments, 2);
- /**
- * @return {?}
- */
- var e = function() {
- return get(func, e, callback, this, args.concat(slice.call(arguments)));
- };
- return e;
- };
- /**
- * @param {Function} o
- * @return {?}
- */
- _.partial = function(o) {
- /** @type {Array.<?>} */
- var parsed = slice.call(arguments, 1);
- /**
- * @return {?}
- */
- var cache = function() {
- /** @type {number} */
- var x = 0;
- /** @type {number} */
- var l = parsed.length;
- /** @type {Array} */
- var args = Array(l);
- /** @type {number} */
- var i = 0;
- for (;l > i;i++) {
- args[i] = parsed[i] === _ ? arguments[x++] : parsed[i];
- }
- for (;x < arguments.length;) {
- args.push(arguments[x++]);
- }
- return get(o, cache, this, this, args);
- };
- return cache;
- };
- /**
- * @param {Object} obj
- * @return {?}
- */
- _.bindAll = function(obj) {
- var i;
- var f;
- /** @type {number} */
- var l = arguments.length;
- if (1 >= l) {
- throw new Error("bindAll must be passed function names");
- }
- /** @type {number} */
- i = 1;
- for (;l > i;i++) {
- f = arguments[i];
- obj[f] = _.bind(obj[f], obj);
- }
- return obj;
- };
- /**
- * @param {Function} matcherFunction
- * @param {Function} func
- * @return {?}
- */
- _.memoize = function(matcherFunction, func) {
- /**
- * @param {Function} val
- * @return {?}
- */
- var require = function(val) {
- var cache = require.cache;
- /** @type {string} */
- var key = "" + (func ? func.apply(this, arguments) : val);
- return _.has(cache, key) || (cache[key] = matcherFunction.apply(this, arguments)), cache[key];
- };
- return require.cache = {}, require;
- };
- /**
- * @param {Function} func
- * @param {?} wait
- * @return {?}
- */
- _.delay = function(func, wait) {
- /** @type {Array.<?>} */
- var args = slice.call(arguments, 2);
- return setTimeout(function() {
- return func.apply(null, args);
- }, wait);
- };
- _.defer = _.partial(_.delay, _, 1);
- /**
- * @param {Function} func
- * @param {number} wait
- * @param {Object} options
- * @return {?}
- */
- _.throttle = function(func, wait, options) {
- var thisObject;
- var args;
- var value;
- /** @type {null} */
- var timeout = null;
- /** @type {number} */
- var previous = 0;
- if (!options) {
- options = {};
- }
- /**
- * @return {undefined}
- */
- var later = function() {
- /** @type {number} */
- previous = options.leading === false ? 0 : _.now();
- /** @type {null} */
- timeout = null;
- value = func.apply(thisObject, args);
- if (!timeout) {
- /** @type {null} */
- thisObject = args = null;
- }
- };
- return function() {
- /** @type {number} */
- var now = _.now();
- if (!previous) {
- if (!(options.leading !== false)) {
- /** @type {number} */
- previous = now;
- }
- }
- /** @type {number} */
- var remaining = wait - (now - previous);
- return thisObject = this, args = arguments, 0 >= remaining || remaining > wait ? (timeout && (clearTimeout(timeout), timeout = null), previous = now, value = func.apply(thisObject, args), timeout || (thisObject = args = null)) : timeout || (options.trailing === false || (timeout = setTimeout(later, remaining))), value;
- };
- };
- /**
- * @param {Function} func
- * @param {number} wait
- * @param {boolean} immediate
- * @return {?}
- */
- _.debounce = function(func, wait, immediate) {
- var timeout;
- var args;
- var thisObject;
- var lastAnimationTime;
- var value;
- /**
- * @return {undefined}
- */
- var delayed = function() {
- /** @type {number} */
- var timeDiff = _.now() - lastAnimationTime;
- if (wait > timeDiff && timeDiff >= 0) {
- /** @type {number} */
- timeout = setTimeout(delayed, wait - timeDiff);
- } else {
- /** @type {null} */
- timeout = null;
- if (!immediate) {
- value = func.apply(thisObject, args);
- if (!timeout) {
- /** @type {null} */
- thisObject = args = null;
- }
- }
- }
- };
- return function() {
- thisObject = this;
- /** @type {Arguments} */
- args = arguments;
- /** @type {number} */
- lastAnimationTime = _.now();
- var callNow = immediate && !timeout;
- return timeout || (timeout = setTimeout(delayed, wait)), callNow && (value = func.apply(thisObject, args), thisObject = args = null), value;
- };
- };
- /**
- * @param {?} func
- * @param {Function} wrapper
- * @return {?}
- */
- _.wrap = function(func, wrapper) {
- return _.partial(wrapper, func);
- };
- /**
- * @param {Function} matcherFunction
- * @return {?}
- */
- _.negate = function(matcherFunction) {
- return function() {
- return!matcherFunction.apply(this, arguments);
- };
- };
- /**
- * @return {?}
- */
- _.compose = function() {
- /** @type {Arguments} */
- var functions = arguments;
- /** @type {number} */
- var i = functions.length - 1;
- return function() {
- /** @type {number} */
- var k = i;
- var result = functions[i].apply(this, arguments);
- for (;k--;) {
- result = functions[k].call(this, result);
- }
- return result;
- };
- };
- /**
- * @param {?} times
- * @param {Function} matcherFunction
- * @return {?}
- */
- _.after = function(times, matcherFunction) {
- return function() {
- return--times < 1 ? matcherFunction.apply(this, arguments) : void 0;
- };
- };
- /**
- * @param {?} fn
- * @param {(Function|number)} matcherFunction
- * @return {?}
- */
- _.before = function(fn, matcherFunction) {
- var returnValue;
- return function() {
- return--fn > 0 && (returnValue = matcherFunction.apply(this, arguments)), 1 >= fn && (matcherFunction = null), returnValue;
- };
- };
- _.once = _.partial(_.before, 2);
- /** @type {boolean} */
- var str = !{
- toString : null
- }.propertyIsEnumerable("toString");
- /** @type {Array} */
- var tokenized = ["valueOf", "isPrototypeOf", "toString", "propertyIsEnumerable", "hasOwnProperty", "toLocaleString"];
- /**
- * @param {?} obj
- * @return {?}
- */
- _.keys = function(obj) {
- if (!_.isObject(obj)) {
- return[];
- }
- if (nativeKeys) {
- return nativeKeys(obj);
- }
- /** @type {Array} */
- var listeners = [];
- var key;
- for (key in obj) {
- if (_.has(obj, key)) {
- listeners.push(key);
- }
- }
- return str && remove(obj, listeners), listeners;
- };
- /**
- * @param {Object} obj
- * @return {?}
- */
- _.allKeys = function(obj) {
- if (!_.isObject(obj)) {
- return[];
- }
- /** @type {Array} */
- var listeners = [];
- var p;
- for (p in obj) {
- listeners.push(p);
- }
- return str && remove(obj, listeners), listeners;
- };
- /**
- * @param {?} obj
- * @return {?}
- */
- _.values = function(obj) {
- var keys = _.keys(obj);
- var length = keys.length;
- /** @type {Array} */
- var result = Array(length);
- /** @type {number} */
- var i = 0;
- for (;length > i;i++) {
- result[i] = obj[keys[i]];
- }
- return result;
- };
- /**
- * @param {Object} obj
- * @param {Text} callback
- * @param {string} thisObj
- * @return {?}
- */
- _.mapObject = function(obj, callback, thisObj) {
- callback = makeIterator(callback, thisObj);
- var key;
- var keys = _.keys(obj);
- var len = keys.length;
- var result = {};
- /** @type {number} */
- var j = 0;
- for (;len > j;j++) {
- key = keys[j];
- result[key] = callback(obj[key], key, obj);
- }
- return result;
- };
- /**
- * @param {?} obj
- * @return {?}
- */
- _.pairs = function(obj) {
- var keys = _.keys(obj);
- var length = keys.length;
- /** @type {Array} */
- var result = Array(length);
- /** @type {number} */
- var i = 0;
- for (;length > i;i++) {
- /** @type {Array} */
- result[i] = [keys[i], obj[keys[i]]];
- }
- return result;
- };
- /**
- * @param {?} obj
- * @return {?}
- */
- _.invert = function(obj) {
- var result = {};
- var keys = _.keys(obj);
- /** @type {number} */
- var i = 0;
- var len = keys.length;
- for (;len > i;i++) {
- result[obj[keys[i]]] = keys[i];
- }
- return result;
- };
- /** @type {function (Object): ?} */
- _.functions = _.methods = function(obj) {
- /** @type {Array} */
- var keys = [];
- var key;
- for (key in obj) {
- if (_.isFunction(obj[key])) {
- keys.push(key);
- }
- }
- return keys.sort();
- };
- _.extend = some(_.allKeys);
- _.extendOwn = _.assign = some(_.keys);
- /**
- * @param {Object} obj
- * @param {(RegExp|string)} callback
- * @param {string} thisObj
- * @return {?}
- */
- _.findKey = function(obj, callback, thisObj) {
- callback = makeIterator(callback, thisObj);
- var key;
- var keys = _.keys(obj);
- /** @type {number} */
- var j = 0;
- var len = keys.length;
- for (;len > j;j++) {
- if (key = keys[j], callback(obj[key], key, obj)) {
- return key;
- }
- }
- };
- /**
- * @param {Function} object
- * @param {Object} obj
- * @param {number} thisArg
- * @return {?}
- */
- _.pick = function(object, obj, thisArg) {
- var filter;
- var result;
- var out = {};
- /** @type {Function} */
- var array = object;
- if (null == array) {
- return out;
- }
- if (_.isFunction(obj)) {
- result = _.allKeys(array);
- filter = bind(obj, thisArg);
- } else {
- result = flatten(arguments, false, false, 1);
- /**
- * @param {?} expr
- * @param {?} event
- * @param {Object} obj
- * @return {?}
- */
- filter = function(expr, event, obj) {
- return event in obj;
- };
- array = Object(array);
- }
- /** @type {number} */
- var index = 0;
- var matches = result.length;
- for (;matches > index;index++) {
- var type = result[index];
- var data = array[type];
- if (filter(data, type, array)) {
- out[type] = data;
- }
- }
- return out;
- };
- /**
- * @param {Function} obj
- * @param {(Object|string)} qualifier
- * @param {number} thisArg
- * @return {?}
- */
- _.omit = function(obj, qualifier, thisArg) {
- if (_.isFunction(qualifier)) {
- qualifier = _.negate(qualifier);
- } else {
- var method = _.map(flatten(arguments, false, false, 1), String);
- /**
- * @param {?} dataAndEvents
- * @param {string} key
- * @return {?}
- */
- qualifier = function(dataAndEvents, key) {
- return!_.contains(method, key);
- };
- }
- return _.pick(obj, qualifier, thisArg);
- };
- _.defaults = some(_.allKeys, true);
- /**
- * @param {Object} type
- * @param {(Node|string)} tag
- * @return {?}
- */
- _.create = function(type, tag) {
- var context = create(type);
- return tag && _.extendOwn(context, tag), context;
- };
- /**
- * @param {Object} obj
- * @return {?}
- */
- _.clone = function(obj) {
- return _.isObject(obj) ? _.isArray(obj) ? obj.slice() : _.extend({}, obj) : obj;
- };
- /**
- * @param {?} n
- * @param {?} t
- * @return {?}
- */
- _.tap = function(n, t) {
- return t(n), n;
- };
- /**
- * @param {?} array
- * @param {?} obj
- * @return {?}
- */
- _.isMatch = function(array, obj) {
- var keys = _.keys(obj);
- var len = keys.length;
- if (null == array) {
- return!len;
- }
- var t = Object(array);
- /** @type {number} */
- var j = 0;
- for (;len > j;j++) {
- var k = keys[j];
- if (obj[k] !== t[k] || !(k in t)) {
- return false;
- }
- }
- return true;
- };
- /**
- * @param {?} a
- * @param {?} b
- * @param {Array} stack
- * @param {Array} bStack
- * @return {?}
- */
- var eq = function(a, b, stack, bStack) {
- if (a === b) {
- return 0 !== a || 1 / a === 1 / b;
- }
- if (null == a || null == b) {
- return a === b;
- }
- if (a instanceof _) {
- a = a._wrapped;
- }
- if (b instanceof _) {
- b = b._wrapped;
- }
- /** @type {string} */
- var array = toString.call(a);
- if (array !== toString.call(b)) {
- return false;
- }
- switch(array) {
- case "[object RegExp]":
- ;
- case "[object String]":
- return "" + a == "" + b;
- case "[object Number]":
- return+a !== +a ? +b !== +b : 0 === +a ? 1 / +a === 1 / b : +a === +b;
- case "[object Date]":
- ;
- case "[object Boolean]":
- return+a === +b;
- }
- /** @type {boolean} */
- var isArray = "[object Array]" === array;
- if (!isArray) {
- if ("object" != typeof a || "object" != typeof b) {
- return false;
- }
- var aCtor = a.constructor;
- var bCtor = b.constructor;
- if (aCtor !== bCtor && (!(_.isFunction(aCtor) && (aCtor instanceof aCtor && (_.isFunction(bCtor) && bCtor instanceof bCtor))) && ("constructor" in a && "constructor" in b))) {
- return false;
- }
- }
- stack = stack || [];
- bStack = bStack || [];
- var i = stack.length;
- for (;i--;) {
- if (stack[i] === a) {
- return bStack[i] === b;
- }
- }
- if (stack.push(a), bStack.push(b), isArray) {
- if (i = a.length, i !== b.length) {
- return false;
- }
- for (;i--;) {
- if (!eq(a[i], b[i], stack, bStack)) {
- return false;
- }
- }
- } else {
- var key;
- var keys = _.keys(a);
- if (i = keys.length, _.keys(b).length !== i) {
- return false;
- }
- for (;i--;) {
- if (key = keys[i], !_.has(b, key) || !eq(a[key], b[key], stack, bStack)) {
- return false;
- }
- }
- }
- return stack.pop(), bStack.pop(), true;
- };
- /**
- * @param {?} a
- * @param {?} b
- * @return {?}
- */
- _.isEqual = function(a, b) {
- return eq(a, b);
- };
- /**
- * @param {string} obj
- * @return {?}
- */
- _.isEmpty = function(obj) {
- return null == obj ? true : isArray(obj) && (_.isArray(obj) || (_.isString(obj) || _.isArguments(obj))) ? 0 === obj.length : 0 === _.keys(obj).length;
- };
- /**
- * @param {Object} obj
- * @return {?}
- */
- _.isElement = function(obj) {
- return!(!obj || 1 !== obj.nodeType);
- };
- /** @type {function (*): boolean} */
- _.isArray = nativeIsArray || function(obj) {
- return "[object Array]" === toString.call(obj);
- };
- /**
- * @param {?} obj
- * @return {?}
- */
- _.isObject = function(obj) {
- /** @type {string} */
- var type = typeof obj;
- return "function" === type || "object" === type && !!obj;
- };
- _.each(["Arguments", "Function", "String", "Number", "Date", "RegExp", "Error"], function(name) {
- /**
- * @param {?} checkSet
- * @return {?}
- */
- _["is" + name] = function(checkSet) {
- return toString.call(checkSet) === "[object " + name + "]";
- };
- });
- if (!_.isArguments(arguments)) {
- /**
- * @param {Object} obj
- * @return {?}
- */
- _.isArguments = function(obj) {
- return _.has(obj, "callee");
- };
- }
- if ("function" != typeof/./) {
- if ("object" != typeof Int8Array) {
- /**
- * @param {Object} obj
- * @return {?}
- */
- _.isFunction = function(obj) {
- return "function" == typeof obj || false;
- };
- }
- }
- /**
- * @param {?} obj
- * @return {?}
- */
- _.isFinite = function(obj) {
- return isFinite(obj) && !isNaN(parseFloat(obj));
- };
- /**
- * @param {number} i
- * @return {?}
- */
- _.isNaN = function(i) {
- return _.isNumber(i) && i !== +i;
- };
- /**
- * @param {boolean} obj
- * @return {?}
- */
- _.isBoolean = function(obj) {
- return obj === true || (obj === false || "[object Boolean]" === toString.call(obj));
- };
- /**
- * @param {number} obj
- * @return {?}
- */
- _.isNull = function(obj) {
- return null === obj;
- };
- /**
- * @param {(Array|string)} obj
- * @return {?}
- */
- _.isUndefined = function(obj) {
- return obj === void 0;
- };
- /**
- * @param {Object} obj
- * @param {string} key
- * @return {?}
- */
- _.has = function(obj, key) {
- return null != obj && hasOwnProperty.call(obj, key);
- };
- /**
- * @return {?}
- */
- _.noConflict = function() {
- return root._ = previousUnderscore, this;
- };
- /**
- * @param {?} value
- * @return {?}
- */
- _.identity = function(value) {
- return value;
- };
- /**
- * @param {?} value
- * @return {?}
- */
- _.constant = function(value) {
- return function() {
- return value;
- };
- };
- /**
- * @return {undefined}
- */
- _.noop = function() {
- };
- /** @type {function (string): ?} */
- _.property = property;
- /**
- * @param {Object} buf
- * @return {?}
- */
- _.propertyOf = function(buf) {
- return null == buf ? function() {
- } : function(off) {
- return buf[off];
- };
- };
- /** @type {function (string): ?} */
- _.matcher = _.matches = function(key) {
- return key = _.extendOwn({}, key), function(other) {
- return _.isMatch(other, key);
- };
- };
- /**
- * @param {number} n
- * @param {?} callback
- * @param {number} thisArg
- * @return {?}
- */
- _.times = function(n, callback, thisArg) {
- /** @type {Array} */
- var result = Array(Math.max(0, n));
- callback = bind(callback, thisArg, 1);
- /** @type {number} */
- var i = 0;
- for (;n > i;i++) {
- result[i] = callback(i);
- }
- return result;
- };
- /**
- * @param {number} min
- * @param {number} max
- * @return {?}
- */
- _.random = function(min, max) {
- return null == max && (max = min, min = 0), min + Math.floor(Math.random() * (max - min + 1));
- };
- /** @type {function (): number} */
- _.now = Date.now || function() {
- return(new Date).getTime();
- };
- var i = {
- "&" : "&",
- "<" : "<",
- ">" : ">",
- '"' : """,
- "'" : "'",
- "`" : "`"
- };
- var a = _.invert(i);
- /**
- * @param {Object} result
- * @return {?}
- */
- var process = function(result) {
- /**
- * @param {string} axis
- * @return {?}
- */
- var next = function(axis) {
- return result[axis];
- };
- /** @type {string} */
- var keyword1 = "(?:" + _.keys(result).join("|") + ")";
- /** @type {RegExp} */
- var hChars = RegExp(keyword1);
- /** @type {RegExp} */
- var r20 = RegExp(keyword1, "g");
- return function(s) {
- return s = null == s ? "" : "" + s, hChars.test(s) ? s.replace(r20, next) : s;
- };
- };
- _.escape = process(i);
- _.unescape = process(a);
- /**
- * @param {Object} object
- * @param {string} property
- * @param {Object} x
- * @return {?}
- */
- _.result = function(object, property, x) {
- var value = null == object ? void 0 : object[property];
- return value === void 0 && (value = x), _.isFunction(value) ? value.call(object) : value;
- };
- /** @type {number} */
- var idCounter = 0;
- /**
- * @param {?} prefix
- * @return {?}
- */
- _.uniqueId = function(prefix) {
- /** @type {string} */
- var id = ++idCounter + "";
- return prefix ? prefix + id : id;
- };
- _.templateSettings = {
- evaluate : /<%([\s\S]+?)%>/g,
- interpolate : /<%=([\s\S]+?)%>/g,
- escape : /<%-([\s\S]+?)%>/g
- };
- /** @type {RegExp} */
- var noMatch = /(.)^/;
- var escapes = {
- "'" : "'",
- "\\" : "\\",
- "\r" : "r",
- "\n" : "n",
- "\u2028" : "u2028",
- "\u2029" : "u2029"
- };
- /** @type {RegExp} */
- var r20 = /\\|'|\r|\n|\u2028|\u2029/g;
- /**
- * @param {?} match
- * @return {?}
- */
- var escapeStringChar = function(match) {
- return "\\" + escapes[match];
- };
- /**
- * @param {string} text
- * @param {Object} settings
- * @param {Object} data
- * @return {?}
- */
- _.template = function(text, settings, data) {
- if (!settings) {
- if (data) {
- /** @type {Object} */
- settings = data;
- }
- }
- settings = _.defaults({}, settings, _.templateSettings);
- /** @type {RegExp} */
- var reDelimiters = RegExp([(settings.escape || noMatch).source, (settings.interpolate || noMatch).source, (settings.evaluate || noMatch).source].join("|") + "|$", "g");
- /** @type {number} */
- var index = 0;
- /** @type {string} */
- var source = "__p+='";
- text.replace(reDelimiters, function(match, dataAndEvents, deepDataAndEvents, ignoreMethodDoesntExist, offset) {
- return source += text.slice(index, offset).replace(r20, escapeStringChar), index = offset + match.length, dataAndEvents ? source += "'+\n((__t=(" + dataAndEvents + "))==null?'':_.escape(__t))+\n'" : deepDataAndEvents ? source += "'+\n((__t=(" + deepDataAndEvents + "))==null?'':__t)+\n'" : ignoreMethodDoesntExist && (source += "';\n" + ignoreMethodDoesntExist + "\n__p+='"), match;
- });
- source += "';\n";
- if (!settings.variable) {
- /** @type {string} */
- source = "with(obj||{}){\n" + source + "}\n";
- }
- /** @type {string} */
- source = "var __t,__p='',__j=Array.prototype.join," + "print=function(){__p+=__j.call(arguments,'');};\n" + source + "return __p;\n";
- try {
- /** @type {Function} */
- var render = new Function(settings.variable || "obj", "_", source);
- } catch (details) {
- throw details.source = source, details;
- }
- /**
- * @param {?} data
- * @return {?}
- */
- var template = function(data) {
- return render.call(this, data, _);
- };
- var obj = settings.variable || "obj";
- return template.source = "function(" + obj + "){\n" + source + "}", template;
- };
- /**
- * @param {?} obj
- * @return {?}
- */
- _.chain = function(obj) {
- var s = _(obj);
- return s._chain = true, s;
- };
- /**
- * @param {?} b
- * @param {?} obj
- * @return {?}
- */
- var chain = function(b, obj) {
- return b._chain ? _(obj).chain() : obj;
- };
- /**
- * @param {Object} obj
- * @return {undefined}
- */
- _.mixin = function(obj) {
- _.each(_.functions(obj), function(name) {
- var wrapper = _[name] = obj[name];
- /**
- * @return {?}
- */
- _.prototype[name] = function() {
- /** @type {Array} */
- var args = [this._wrapped];
- return push.apply(args, arguments), chain(this, wrapper.apply(_, args));
- };
- });
- };
- _.mixin(_);
- _.each(["pop", "push", "reverse", "shift", "sort", "splice", "unshift"], function(name) {
- var method = ArrayProto[name];
- /**
- * @return {?}
- */
- _.prototype[name] = function() {
- var wrapped = this._wrapped;
- return method.apply(wrapped, arguments), "shift" !== name && "splice" !== name || (0 !== wrapped.length || delete wrapped[0]), chain(this, wrapped);
- };
- });
- _.each(["concat", "join", "slice"], function(name) {
- var method = ArrayProto[name];
- /**
- * @return {?}
- */
- _.prototype[name] = function() {
- return chain(this, method.apply(this._wrapped, arguments));
- };
- });
- /**
- * @return {?}
- */
- _.prototype.value = function() {
- return this._wrapped;
- };
- /** @type {function (): ?} */
- _.prototype.valueOf = _.prototype.toJSON = _.prototype.value;
- /**
- * @return {?}
- */
- _.prototype.toString = function() {
- return "" + this._wrapped;
- };
- if ("function" == typeof define) {
- if (define.amd) {
- define("underscore", [], function() {
- return _;
- });
- }
- }
- }).call(this);
- !function(element, proceed) {
- if ("object" == typeof module && "object" == typeof module.exports) {
- module.exports = element.document ? proceed(element, true) : function(event) {
- if (!event.document) {
- throw new Error("jQuery requires a window with a document");
- }
- return proceed(event);
- };
- } else {
- proceed(element);
- }
- }("undefined" != typeof window ? window : this, function(win, dataAndEvents) {
- /**
- * @param {string} obj
- * @return {?}
- */
- function isArraylike(obj) {
- var length = obj.length;
- var type = jQuery.type(obj);
- return "function" === type || jQuery.isWindow(obj) ? false : 1 === obj.nodeType && length ? true : "array" === type || (0 === length || "number" == typeof length && (length > 0 && length - 1 in obj));
- }
- /**
- * @param {Object} elements
- * @param {Object} qualifier
- * @param {boolean} not
- * @return {?}
- */
- function winnow(elements, qualifier, not) {
- if (jQuery.isFunction(qualifier)) {
- return jQuery.grep(elements, function(elem, i) {
- return!!qualifier.call(elem, i, elem) !== not;
- });
- }
- if (qualifier.nodeType) {
- return jQuery.grep(elements, function(elem) {
- return elem === qualifier !== not;
- });
- }
- if ("string" == typeof qualifier) {
- if (isSimple.test(qualifier)) {
- return jQuery.filter(qualifier, elements, not);
- }
- qualifier = jQuery.filter(qualifier, elements);
- }
- return jQuery.grep(elements, function(elem) {
- return core_indexOf.call(qualifier, elem) >= 0 !== not;
- });
- }
- /**
- * @param {Object} cur
- * @param {string} dir
- * @return {?}
- */
- function sibling(cur, dir) {
- for (;(cur = cur[dir]) && 1 !== cur.nodeType;) {
- }
- return cur;
- }
- /**
- * @param {string} options
- * @return {?}
- */
- function createOptions(options) {
- var buf = optionsCache[options] = {};
- return jQuery.each(options.match(core_rnotwhite) || [], function(dataAndEvents, off) {
- /** @type {boolean} */
- buf[off] = true;
- }), buf;
- }
- /**
- * @return {undefined}
- */
- function completed() {
- node.removeEventListener("DOMContentLoaded", completed, false);
- win.removeEventListener("load", completed, false);
- jQuery.ready();
- }
- /**
- * @return {undefined}
- */
- function Data() {
- Object.defineProperty(this.cache = {}, 0, {
- /**
- * @return {?}
- */
- get : function() {
- return{};
- }
- });
- this.expando = jQuery.expando + Data.uid++;
- }
- /**
- * @param {Object} elem
- * @param {string} key
- * @param {string} data
- * @return {?}
- */
- function dataAttr(elem, key, data) {
- var name;
- if (void 0 === data && 1 === elem.nodeType) {
- if (name = "data-" + key.replace(r20, "-$1").toLowerCase(), data = elem.getAttribute(name), "string" == typeof data) {
- try {
- data = "true" === data ? true : "false" === data ? false : "null" === data ? null : +data + "" === data ? +data : rbrace.test(data) ? jQuery.parseJSON(data) : data;
- } catch (o) {
- }
- data_user.set(elem, key, data);
- } else {
- data = void 0;
- }
- }
- return data;
- }
- /**
- * @return {?}
- */
- function returnTrue() {
- return true;
- }
- /**
- * @return {?}
- */
- function returnFalse() {
- return false;
- }
- /**
- * @return {?}
- */
- function safeActiveElement() {
- try {
- return node.activeElement;
- } catch (e) {
- }
- }
- /**
- * @param {Node} elem
- * @param {Object} content
- * @return {?}
- */
- function manipulationTarget(elem, content) {
- return jQuery.nodeName(elem, "table") && jQuery.nodeName(11 !== content.nodeType ? content : content.firstChild, "tr") ? elem.getElementsByTagName("tbody")[0] || elem.appendChild(elem.ownerDocument.createElement("tbody")) : elem;
- }
- /**
- * @param {Element} elem
- * @return {?}
- */
- function restoreScript(elem) {
- return elem.type = (null !== elem.getAttribute("type")) + "/" + elem.type, elem;
- }
- /**
- * @param {Element} s
- * @return {?}
- */
- function fn(s) {
- /** @type {(Array.<string>|null)} */
- var l = re.exec(s.type);
- return l ? s.type = l[1] : s.removeAttribute("type"), s;
- }
- /**
- * @param {(Array|NodeList)} elems
- * @param {Array} refElements
- * @return {undefined}
- */
- function setGlobalEval(elems, refElements) {
- /** @type {number} */
- var i = 0;
- var l = elems.length;
- for (;l > i;i++) {
- data_priv.set(elems[i], "globalEval", !refElements || data_priv.get(refElements[i], "globalEval"));
- }
- }
- /**
- * @param {Object} src
- * @param {Object} dest
- * @return {undefined}
- */
- function cloneCopyEvent(src, dest) {
- var i;
- var ilen;
- var type;
- var pdataOld;
- var pdataCur;
- var udataOld;
- var udataCur;
- var events;
- if (1 === dest.nodeType) {
- if (data_priv.hasData(src) && (pdataOld = data_priv.access(src), pdataCur = data_priv.set(dest, pdataOld), events = pdataOld.events)) {
- delete pdataCur.handle;
- pdataCur.events = {};
- for (type in events) {
- /** @type {number} */
- i = 0;
- ilen = events[type].length;
- for (;ilen > i;i++) {
- jQuery.event.add(dest, type, events[type][i]);
- }
- }
- }
- if (data_user.hasData(src)) {
- udataOld = data_user.access(src);
- udataCur = jQuery.extend({}, udataOld);
- data_user.set(dest, udataCur);
- }
- }
- }
- /**
- * @param {Node} context
- * @param {Object} tag
- * @return {?}
- */
- function getAll(context, tag) {
- var ret = context.getElementsByTagName ? context.getElementsByTagName(tag || "*") : context.querySelectorAll ? context.querySelectorAll(tag || "*") : [];
- return void 0 === tag || tag && jQuery.nodeName(context, tag) ? jQuery.merge([context], ret) : ret;
- }
- /**
- * @param {Element} src
- * @param {Element} dest
- * @return {undefined}
- */
- function fixInput(src, dest) {
- var name = dest.nodeName.toLowerCase();
- if ("input" === name && manipulation_rcheckableType.test(src.type)) {
- dest.checked = src.checked;
- } else {
- if ("input" === name || "textarea" === name) {
- dest.defaultValue = src.defaultValue;
- }
- }
- }
- /**
- * @param {?} name
- * @param {Document} doc
- * @return {?}
- */
- function actualDisplay(name, doc) {
- var result;
- var elem = jQuery(doc.createElement(name)).appendTo(doc.body);
- var o = win.getDefaultComputedStyle && (result = win.getDefaultComputedStyle(elem[0])) ? result.display : jQuery.css(elem[0], "display");
- return elem.detach(), o;
- }
- /**
- * @param {?} nodeName
- * @return {?}
- */
- function defaultDisplay(nodeName) {
- var doc = node;
- var display = elemdisplay[nodeName];
- return display || (display = actualDisplay(nodeName, doc), "none" !== display && display || (iframe = (iframe || jQuery("<iframe frameborder='0' width='0' height='0'/>")).appendTo(doc.documentElement), doc = iframe[0].contentDocument, doc.write(), doc.close(), display = actualDisplay(nodeName, doc), iframe.detach()), elemdisplay[nodeName] = display), display;
- }
- /**
- * @param {Object} elem
- * @param {string} prop
- * @param {Object} computed
- * @return {?}
- */
- function get(elem, prop, computed) {
- var width;
- var minWidth;
- var maxWidth;
- var val;
- var style = elem.style;
- return computed = computed || getStyles(elem), computed && (val = computed.getPropertyValue(prop) || computed[prop]), computed && ("" !== val || (jQuery.contains(elem.ownerDocument, elem) || (val = jQuery.style(elem, prop))), regexp.test(val) && (rbracket.test(prop) && (width = style.width, minWidth = style.minWidth, maxWidth = style.maxWidth, style.minWidth = style.maxWidth = style.width = val, val = computed.width, style.width = width, style.minWidth = minWidth, style.maxWidth = maxWidth))),
- void 0 !== val ? val + "" : val;
- }
- /**
- * @param {?} $timeout
- * @param {Function} hookFn
- * @return {?}
- */
- function addGetHookIf($timeout, hookFn) {
- return{
- /**
- * @return {?}
- */
- get : function() {
- return $timeout() ? void delete this.get : (this.get = hookFn).apply(this, arguments);
- }
- };
- }
- /**
- * @param {Object} style
- * @param {string} name
- * @return {?}
- */
- function vendorPropName(style, name) {
- if (name in style) {
- return name;
- }
- var capName = name[0].toUpperCase() + name.slice(1);
- /** @type {string} */
- var origName = name;
- /** @type {number} */
- var i = cssPrefixes.length;
- for (;i--;) {
- if (name = cssPrefixes[i] + capName, name in style) {
- return name;
- }
- }
- return origName;
- }
- /**
- * @param {Object} elem
- * @param {string} value
- * @param {?} actual
- * @return {?}
- */
- function setPositiveNumber(elem, value, actual) {
- /** @type {(Array.<string>|null)} */
- var iterator = rrelNum.exec(value);
- return iterator ? Math.max(0, iterator[1] - (actual || 0)) + (iterator[2] || "px") : value;
- }
- /**
- * @param {string} elem
- * @param {string} keepData
- * @param {string} extra
- * @param {boolean} isBorderBox
- * @param {?} styles
- * @return {?}
- */
- function augmentWidthOrHeight(elem, keepData, extra, isBorderBox, styles) {
- /** @type {number} */
- var i = extra === (isBorderBox ? "border" : "content") ? 4 : "width" === keepData ? 1 : 0;
- /** @type {number} */
- var val = 0;
- for (;4 > i;i += 2) {
- if ("margin" === extra) {
- val += jQuery.css(elem, extra + cssExpand[i], true, styles);
- }
- if (isBorderBox) {
- if ("content" === extra) {
- val -= jQuery.css(elem, "padding" + cssExpand[i], true, styles);
- }
- if ("margin" !== extra) {
- val -= jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);
- }
- } else {
- val += jQuery.css(elem, "padding" + cssExpand[i], true, styles);
- if ("padding" !== extra) {
- val += jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);
- }
- }
- }
- return val;
- }
- /**
- * @param {Object} elem
- * @param {string} name
- * @param {string} extra
- * @return {?}
- */
- function getWidthOrHeight(elem, name, extra) {
- /** @type {boolean} */
- var valueIsBorderBox = true;
- var val = "width" === name ? elem.offsetWidth : elem.offsetHeight;
- var styles = getStyles(elem);
- /** @type {boolean} */
- var isBorderBox = "border-box" === jQuery.css(elem, "boxSizing", false, styles);
- if (0 >= val || null == val) {
- if (val = get(elem, name, styles), (0 > val || null == val) && (val = elem.style[name]), regexp.test(val)) {
- return val;
- }
- valueIsBorderBox = isBorderBox && (support.boxSizingReliable() || val === elem.style[name]);
- /** @type {number} */
- val = parseFloat(val) || 0;
- }
- return val + augmentWidthOrHeight(elem, name, extra || (isBorderBox ? "border" : "content"), valueIsBorderBox, styles) + "px";
- }
- /**
- * @param {Array} elements
- * @param {boolean} show
- * @return {?}
- */
- function showHide(elements, show) {
- var display;
- var elem;
- var hidden;
- /** @type {Array} */
- var values = [];
- /** @type {number} */
- var index = 0;
- var length = elements.length;
- for (;length > index;index++) {
- elem = elements[index];
- if (elem.style) {
- values[index] = data_priv.get(elem, "olddisplay");
- display = elem.style.display;
- if (show) {
- if (!values[index]) {
- if (!("none" !== display)) {
- /** @type {string} */
- elem.style.display = "";
- }
- }
- if ("" === elem.style.display) {
- if (isHidden(elem)) {
- values[index] = data_priv.access(elem, "olddisplay", defaultDisplay(elem.nodeName));
- }
- }
- } else {
- hidden = isHidden(elem);
- if (!("none" === display && hidden)) {
- data_priv.set(elem, "olddisplay", hidden ? display : jQuery.css(elem, "display"));
- }
- }
- }
- }
- /** @type {number} */
- index = 0;
- for (;length > index;index++) {
- elem = elements[index];
- if (elem.style) {
- if (!(show && ("none" !== elem.style.display && "" !== elem.style.display))) {
- elem.style.display = show ? values[index] || "" : "none";
- }
- }
- }
- return elements;
- }
- /**
- * @param {string} selector
- * @param {string} context
- * @param {string} prop
- * @param {string} end
- * @param {string} easing
- * @return {?}
- */
- function Tween(selector, context, prop, end, easing) {
- return new Tween.prototype.init(selector, context, prop, end, easing);
- }
- /**
- * @return {?}
- */
- function createFxNow() {
- return setTimeout(function() {
- fxNow = void 0;
- }), fxNow = jQuery.now();
- }
- /**
- * @param {string} type
- * @param {boolean} includeWidth
- * @return {?}
- */
- function genFx(type, includeWidth) {
- var which;
- /** @type {number} */
- var i = 0;
- var attrs = {
- height : type
- };
- /** @type {number} */
- includeWidth = includeWidth ? 1 : 0;
- for (;4 > i;i += 2 - includeWidth) {
- which = cssExpand[i];
- attrs["margin" + which] = attrs["padding" + which] = type;
- }
- return includeWidth && (attrs.opacity = attrs.width = type), attrs;
- }
- /**
- * @param {?} value
- * @param {?} prop
- * @param {?} animation
- * @return {?}
- */
- function createTween(value, prop, animation) {
- var tween;
- var q = (cache[prop] || []).concat(cache["*"]);
- /** @type {number} */
- var i = 0;
- var l = q.length;
- for (;l > i;i++) {
- if (tween = q[i].call(animation, prop, value)) {
- return tween;
- }
- }
- }
- /**
- * @param {Object} elem
- * @param {Object} props
- * @param {Object} opts
- * @return {undefined}
- */
- function defaultPrefilter(elem, props, opts) {
- var prop;
- var value;
- var thisp;
- var tween;
- var hooks;
- var oldfire;
- var oldDisplay;
- var type;
- var anim = this;
- var orig = {};
- var style = elem.style;
- var hidden = elem.nodeType && isHidden(elem);
- var dataShow = data_priv.get(elem, "fxshow");
- if (!opts.queue) {
- hooks = jQuery._queueHooks(elem, "fx");
- if (null == hooks.unqueued) {
- /** @type {number} */
- hooks.unqueued = 0;
- /** @type {function (): undefined} */
- oldfire = hooks.empty.fire;
- /**
- * @return {undefined}
- */
- hooks.empty.fire = function() {
- if (!hooks.unqueued) {
- oldfire();
- }
- };
- }
- hooks.unqueued++;
- anim.always(function() {
- anim.always(function() {
- hooks.unqueued--;
- if (!jQuery.queue(elem, "fx").length) {
- hooks.empty.fire();
- }
- });
- });
- }
- if (1 === elem.nodeType) {
- if ("height" in props || "width" in props) {
- /** @type {Array} */
- opts.overflow = [style.overflow, style.overflowX, style.overflowY];
- oldDisplay = jQuery.css(elem, "display");
- type = "none" === oldDisplay ? data_priv.get(elem, "olddisplay") || defaultDisplay(elem.nodeName) : oldDisplay;
- if ("inline" === type) {
- if ("none" === jQuery.css(elem, "float")) {
- /** @type {string} */
- style.display = "inline-block";
- }
- }
- }
- }
- if (opts.overflow) {
- /** @type {string} */
- style.overflow = "hidden";
- anim.always(function() {
- style.overflow = opts.overflow[0];
- style.overflowX = opts.overflow[1];
- style.overflowY = opts.overflow[2];
- });
- }
- for (prop in props) {
- if (value = props[prop], rplusequals.exec(value)) {
- if (delete props[prop], thisp = thisp || "toggle" === value, value === (hidden ? "hide" : "show")) {
- if ("show" !== value || (!dataShow || void 0 === dataShow[prop])) {
- continue;
- }
- /** @type {boolean} */
- hidden = true;
- }
- orig[prop] = dataShow && dataShow[prop] || jQuery.style(elem, prop);
- } else {
- oldDisplay = void 0;
- }
- }
- if (jQuery.isEmptyObject(orig)) {
- if ("inline" === ("none" === oldDisplay ? defaultDisplay(elem.nodeName) : oldDisplay)) {
- style.display = oldDisplay;
- }
- } else {
- if (dataShow) {
- if ("hidden" in dataShow) {
- hidden = dataShow.hidden;
- }
- } else {
- dataShow = data_priv.access(elem, "fxshow", {});
- }
- if (thisp) {
- /** @type {boolean} */
- dataShow.hidden = !hidden;
- }
- if (hidden) {
- jQuery(elem).show();
- } else {
- anim.done(function() {
- jQuery(elem).hide();
- });
- }
- anim.done(function() {
- var prop;
- data_priv.remove(elem, "fxshow");
- for (prop in orig) {
- jQuery.style(elem, prop, orig[prop]);
- }
- });
- for (prop in orig) {
- tween = createTween(hidden ? dataShow[prop] : 0, prop, anim);
- if (!(prop in dataShow)) {
- dataShow[prop] = tween.start;
- if (hidden) {
- tween.end = tween.start;
- /** @type {number} */
- tween.start = "width" === prop || "height" === prop ? 1 : 0;
- }
- }
- }
- }
- }
- /**
- * @param {Object} object
- * @param {Object} paramMap
- * @return {undefined}
- */
- function propFilter(object, paramMap) {
- var key;
- var name;
- var value;
- var val;
- var hooks;
- for (key in object) {
- if (name = jQuery.camelCase(key), value = paramMap[name], val = object[key], jQuery.isArray(val) && (value = val[1], val = object[key] = val[0]), key !== name && (object[name] = val, delete object[key]), hooks = jQuery.cssHooks[name], hooks && "expand" in hooks) {
- val = hooks.expand(val);
- delete object[name];
- for (key in val) {
- if (!(key in object)) {
- object[key] = val[key];
- paramMap[key] = value;
- }
- }
- } else {
- paramMap[name] = value;
- }
- }
- }
- /**
- * @param {string} elem
- * @param {?} properties
- * @param {Object} options
- * @return {?}
- */
- function Animation(elem, properties, options) {
- var result;
- var o;
- /** @type {number} */
- var index = 0;
- /** @type {number} */
- var length = animationPrefilters.length;
- var deferred = jQuery.Deferred().always(function() {
- delete tick.elem;
- });
- /**
- * @return {?}
- */
- var tick = function() {
- if (o) {
- return false;
- }
- var currentTime = fxNow || createFxNow();
- /** @type {number} */
- var remaining = Math.max(0, animation.startTime + animation.duration - currentTime);
- /** @type {number} */
- var temp = remaining / animation.duration || 0;
- /** @type {number} */
- var percent = 1 - temp;
- /** @type {number} */
- var index = 0;
- var startOffset = animation.tweens.length;
- for (;startOffset > index;index++) {
- animation.tweens[index].run(percent);
- }
- return deferred.notifyWith(elem, [animation, percent, remaining]), 1 > percent && startOffset ? remaining : (deferred.resolveWith(elem, [animation]), false);
- };
- var animation = deferred.promise({
- elem : elem,
- props : jQuery.extend({}, properties),
- opts : jQuery.extend(true, {
- specialEasing : {}
- }, options),
- originalProperties : properties,
- originalOptions : options,
- startTime : fxNow || createFxNow(),
- duration : options.duration,
- tweens : [],
- /**
- * @param {string} prop
- * @param {string} end
- * @return {?}
- */
- createTween : function(prop, end) {
- var tween = jQuery.Tween(elem, animation.opts, prop, end, animation.opts.specialEasing[prop] || animation.opts.easing);
- return animation.tweens.push(tween), tween;
- },
- /**
- * @param {boolean} gotoEnd
- * @return {?}
- */
- stop : function(gotoEnd) {
- /** @type {number} */
- var index = 0;
- var length = gotoEnd ? animation.tweens.length : 0;
- if (o) {
- return this;
- }
- /** @type {boolean} */
- o = true;
- for (;length > index;index++) {
- animation.tweens[index].run(1);
- }
- return gotoEnd ? deferred.resolveWith(elem, [animation, gotoEnd]) : deferred.rejectWith(elem, [animation, gotoEnd]), this;
- }
- });
- var scripts = animation.props;
- propFilter(scripts, animation.opts.specialEasing);
- for (;length > index;index++) {
- if (result = animationPrefilters[index].call(animation, elem, scripts, animation.opts)) {
- return result;
- }
- }
- return jQuery.map(scripts, createTween, animation), jQuery.isFunction(animation.opts.start) && animation.opts.start.call(elem, animation), jQuery.fx.timer(jQuery.extend(tick, {
- elem : elem,
- anim : animation,
- queue : animation.opts.queue
- })), animation.progress(animation.opts.progress).done(animation.opts.done, animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always);
- }
- /**
- * @param {Array} structure
- * @return {?}
- */
- function addToPrefiltersOrTransports(structure) {
- return function(selector, fn) {
- if ("string" != typeof selector) {
- /** @type {(Object|string)} */
- fn = selector;
- /** @type {string} */
- selector = "*";
- }
- var node;
- /** @type {number} */
- var i = 0;
- var elem = selector.toLowerCase().match(core_rnotwhite) || [];
- if (jQuery.isFunction(fn)) {
- for (;node = elem[i++];) {
- if ("+" === node[0]) {
- node = node.slice(1) || "*";
- (structure[node] = structure[node] || []).unshift(fn);
- } else {
- (structure[node] = structure[node] || []).push(fn);
- }
- }
- }
- };
- }
- /**
- * @param {?} structure
- * @param {?} options
- * @param {Object} originalOptions
- * @param {?} jqXHR
- * @return {?}
- */
- function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) {
- /**
- * @param {string} key
- * @return {?}
- */
- function inspect(key) {
- var oldName;
- return old[key] = true, jQuery.each(structure[key] || [], function(dataAndEvents, prefilterOrFactory) {
- var name = prefilterOrFactory(options, originalOptions, jqXHR);
- return "string" != typeof name || (seekingTransport || old[name]) ? seekingTransport ? !(oldName = name) : void 0 : (options.dataTypes.unshift(name), inspect(name), false);
- }), oldName;
- }
- var old = {};
- /** @type {boolean} */
- var seekingTransport = structure === transports;
- return inspect(options.dataTypes[0]) || !old["*"] && inspect("*");
- }
- /**
- * @param {(Object|string)} target
- * @param {Object} src
- * @return {?}
- */
- function ajaxExtend(target, src) {
- var key;
- var deep;
- var flatOptions = jQuery.ajaxSettings.flatOptions || {};
- for (key in src) {
- if (void 0 !== src[key]) {
- (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];
- }
- }
- return deep && jQuery.extend(true, target, deep), target;
- }
- /**
- * @param {Object} s
- * @param {XMLHttpRequest} jqXHR
- * @param {Object} responses
- * @return {?}
- */
- function ajaxHandleResponses(s, jqXHR, responses) {
- var ct;
- var type;
- var finalDataType;
- var firstDataType;
- var contents = s.contents;
- var dataTypes = s.dataTypes;
- for (;"*" === dataTypes[0];) {
- dataTypes.shift();
- if (void 0 === ct) {
- ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
- }
- }
- if (ct) {
- for (type in contents) {
- if (contents[type] && contents[type].test(ct)) {
- dataTypes.unshift(type);
- break;
- }
- }
- }
- if (dataTypes[0] in responses) {
- finalDataType = dataTypes[0];
- } else {
- for (type in responses) {
- if (!dataTypes[0] || s.converters[type + " " + dataTypes[0]]) {
- /** @type {string} */
- finalDataType = type;
- break;
- }
- if (!firstDataType) {
- /** @type {string} */
- firstDataType = type;
- }
- }
- /** @type {(string|undefined)} */
- finalDataType = finalDataType || firstDataType;
- }
- return finalDataType ? (finalDataType !== dataTypes[0] && dataTypes.unshift(finalDataType), responses[finalDataType]) : void 0;
- }
- /**
- * @param {Object} s
- * @param {(Object|string)} response
- * @param {?} jqXHR
- * @param {Object} isSuccess
- * @return {?}
- */
- function ajaxConvert(s, response, jqXHR, isSuccess) {
- var conv2;
- var current;
- var conv;
- var tmp;
- var prev;
- var converters = {};
- var dataTypes = s.dataTypes.slice();
- if (dataTypes[1]) {
- for (conv in s.converters) {
- converters[conv.toLowerCase()] = s.converters[conv];
- }
- }
- current = dataTypes.shift();
- for (;current;) {
- if (s.responseFields[current] && (jqXHR[s.responseFields[current]] = response), !prev && (isSuccess && (s.dataFilter && (response = s.dataFilter(response, s.dataType)))), prev = current, current = dataTypes.shift()) {
- if ("*" === current) {
- current = prev;
- } else {
- if ("*" !== prev && prev !== current) {
- if (conv = converters[prev + " " + current] || converters["* " + current], !conv) {
- for (conv2 in converters) {
- if (tmp = conv2.split(" "), tmp[1] === current && (conv = converters[prev + " " + tmp[0]] || converters["* " + tmp[0]])) {
- if (conv === true) {
- conv = converters[conv2];
- } else {
- if (converters[conv2] !== true) {
- /** @type {string} */
- current = tmp[0];
- dataTypes.unshift(tmp[1]);
- }
- }
- break;
- }
- }
- }
- if (conv !== true) {
- if (conv && s["throws"]) {
- response = conv(response);
- } else {
- try {
- response = conv(response);
- } catch (e) {
- return{
- state : "parsererror",
- error : conv ? e : "No conversion from " + prev + " to " + current
- };
- }
- }
- }
- }
- }
- }
- }
- return{
- state : "success",
- data : response
- };
- }
- /**
- * @param {string} prefix
- * @param {string} obj
- * @param {boolean} traditional
- * @param {Function} add
- * @return {undefined}
- */
- function buildParams(prefix, obj, traditional, add) {
- var name;
- if (jQuery.isArray(obj)) {
- jQuery.each(obj, function(i, v) {
- if (traditional || rmargin.test(prefix)) {
- add(prefix, v);
- } else {
- buildParams(prefix + "[" + ("object" == typeof v ? i : "") + "]", v, traditional, add);
- }
- });
- } else {
- if (traditional || "object" !== jQuery.type(obj)) {
- add(prefix, obj);
- } else {
- for (name in obj) {
- buildParams(prefix + "[" + name + "]", obj[name], traditional, add);
- }
- }
- }
- }
- /**
- * @param {Object} element
- * @return {?}
- */
- function getWindow(element) {
- return jQuery.isWindow(element) ? element : 9 === element.nodeType && element.defaultView;
- }
- /** @type {Array} */
- var core_deletedIds = [];
- /** @type {function (this:(Array.<T>|string|{length: number}), *=, *=): Array.<T>} */
- var core_slice = core_deletedIds.slice;
- /** @type {function (this:*, ...[*]): Array} */
- var core_concat = core_deletedIds.concat;
- /** @type {function (this:(Array.<T>|{length: number}), ...[T]): number} */
- var core_push = core_deletedIds.push;
- /** @type {function (this:(Array.<T>|string|{length: number}), T, number=): number} */
- var core_indexOf = core_deletedIds.indexOf;
- var class2type = {};
- /** @type {function (this:*): string} */
- var core_toString = class2type.toString;
- /** @type {function (this:Object, *): boolean} */
- var core_hasOwn = class2type.hasOwnProperty;
- var support = {};
- var node = win.document;
- /** @type {string} */
- var core_version = "2.1.3";
- /**
- * @param {string} selector
- * @param {Function} context
- * @return {?}
- */
- var jQuery = function(selector, context) {
- return new jQuery.fn.init(selector, context);
- };
- /** @type {RegExp} */
- var badChars = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
- /** @type {RegExp} */
- var rmsPrefix = /^-ms-/;
- /** @type {RegExp} */
- var emptyParagraphRegexp = /-([\da-z])/gi;
- /**
- * @param {?} all
- * @param {string} letter
- * @return {?}
- */
- var fcamelCase = function(all, letter) {
- return letter.toUpperCase();
- };
- jQuery.fn = jQuery.prototype = {
- jquery : core_version,
- /** @type {function (string, Function): ?} */
- constructor : jQuery,
- selector : "",
- length : 0,
- /**
- * @return {?}
- */
- toArray : function() {
- return core_slice.call(this);
- },
- /**
- * @param {Object} num
- * @return {?}
- */
- get : function(num) {
- return null != num ? 0 > num ? this[num + this.length] : this[num] : core_slice.call(this);
- },
- /**
- * @param {Array} elems
- * @return {?}
- */
- pushStack : function(elems) {
- var ret = jQuery.merge(this.constructor(), elems);
- return ret.prevObject = this, ret.context = this.context, ret;
- },
- /**
- * @param {Function} opt_attributes
- * @param {Function} args
- * @return {?}
- */
- each : function(opt_attributes, args) {
- return jQuery.each(this, opt_attributes, args);
- },
- /**
- * @param {Function} callback
- * @return {?}
- */
- map : function(callback) {
- return this.pushStack(jQuery.map(this, function(el, operation) {
- return callback.call(el, operation, el);
- }));
- },
- /**
- * @return {?}
- */
- slice : function() {
- return this.pushStack(core_slice.apply(this, arguments));
- },
- /**
- * @return {?}
- */
- first : function() {
- return this.eq(0);
- },
- /**
- * @return {?}
- */
- last : function() {
- return this.eq(-1);
- },
- /**
- * @param {number} idx
- * @return {?}
- */
- eq : function(idx) {
- var l = this.length;
- var i = +idx + (0 > idx ? l : 0);
- return this.pushStack(i >= 0 && l > i ? [this[i]] : []);
- },
- /**
- * @return {?}
- */
- end : function() {
- return this.prevObject || this.constructor(null);
- },
- /** @type {function (this:(Array.<T>|{length: number}), ...[T]): number} */
- push : core_push,
- /** @type {function (this:(Array.<T>|{length: number}), function (T, T): number=): ?} */
- sort : core_deletedIds.sort,
- /** @type {function (this:(Array.<T>|{length: number}), *=, *=, ...[T]): Array.<T>} */
- splice : core_deletedIds.splice
- };
- /** @type {function (): ?} */
- jQuery.extend = jQuery.fn.extend = function() {
- var options;
- var name;
- var src;
- var copy;
- var copyIsArray;
- var clone;
- var target = arguments[0] || {};
- /** @type {number} */
- var i = 1;
- /** @type {number} */
- var l = arguments.length;
- /** @type {boolean} */
- var deep = false;
- if ("boolean" == typeof target) {
- /** @type {boolean} */
- deep = target;
- target = arguments[i] || {};
- i++;
- }
- if (!("object" == typeof target)) {
- if (!jQuery.isFunction(target)) {
- target = {};
- }
- }
- if (i === l) {
- target = this;
- i--;
- }
- for (;l > i;i++) {
- if (null != (options = arguments[i])) {
- for (name in options) {
- src = target[name];
- copy = options[name];
- if (target !== copy) {
- if (deep && (copy && (jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy))))) {
- if (copyIsArray) {
- /** @type {boolean} */
- copyIsArray = false;
- clone = src && jQuery.isArray(src) ? src : [];
- } else {
- clone = src && jQuery.isPlainObject(src) ? src : {};
- }
- target[name] = jQuery.extend(deep, clone, copy);
- } else {
- if (void 0 !== copy) {
- target[name] = copy;
- }
- }
- }
- }
- }
- }
- return target;
- };
- jQuery.extend({
- expando : "jQuery" + (core_version + Math.random()).replace(/\D/g, ""),
- isReady : true,
- /**
- * @param {string} type
- * @return {?}
- */
- error : function(type) {
- throw new Error(type);
- },
- /**
- * @return {undefined}
- */
- noop : function() {
- },
- /**
- * @param {string} obj
- * @return {?}
- */
- isFunction : function(obj) {
- return "function" === jQuery.type(obj);
- },
- /** @type {function (*): boolean} */
- isArray : Array.isArray,
- /**
- * @param {Object} obj
- * @return {?}
- */
- isWindow : function(obj) {
- return null != obj && obj === obj.window;
- },
- /**
- * @param {string} val
- * @return {?}
- */
- isNumeric : function(val) {
- return!jQuery.isArray(val) && val - parseFloat(val) + 1 >= 0;
- },
- /**
- * @param {Object} obj
- * @return {?}
- */
- isPlainObject : function(obj) {
- return "object" !== jQuery.type(obj) || (obj.nodeType || jQuery.isWindow(obj)) ? false : obj.constructor && !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ? false : true;
- },
- /**
- * @param {?} obj
- * @return {?}
- */
- isEmptyObject : function(obj) {
- var prop;
- for (prop in obj) {
- return false;
- }
- return true;
- },
- /**
- * @param {string} type
- * @return {?}
- */
- type : function(type) {
- return null == type ? type + "" : "object" == typeof type || "function" == typeof type ? class2type[core_toString.call(type)] || "object" : typeof type;
- },
- /**
- * @param {string} code
- * @return {undefined}
- */
- globalEval : function(code) {
- var script;
- /** @type {function (string): *} */
- var indirect = eval;
- code = jQuery.trim(code);
- if (code) {
- if (1 === code.indexOf("use strict")) {
- script = node.createElement("script");
- /** @type {string} */
- script.text = code;
- node.head.appendChild(script).parentNode.removeChild(script);
- } else {
- indirect(code);
- }
- }
- },
- /**
- * @param {string} string
- * @return {?}
- */
- camelCase : function(string) {
- return string.replace(rmsPrefix, "ms-").replace(emptyParagraphRegexp, fcamelCase);
- },
- /**
- * @param {Node} elem
- * @param {string} name
- * @return {?}
- */
- nodeName : function(elem, name) {
- return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
- },
- /**
- * @param {Function} obj
- * @param {Function} callback
- * @param {(Error|string)} args
- * @return {?}
- */
- each : function(obj, callback, args) {
- var value;
- /** @type {number} */
- var i = 0;
- var l = obj.length;
- var isArray = isArraylike(obj);
- if (args) {
- if (isArray) {
- for (;l > i && (value = callback.apply(obj[i], args), value !== false);i++) {
- }
- } else {
- for (i in obj) {
- if (value = callback.apply(obj[i], args), value === false) {
- break;
- }
- }
- }
- } else {
- if (isArray) {
- for (;l > i && (value = callback.call(obj[i], i, obj[i]), value !== false);i++) {
- }
- } else {
- for (i in obj) {
- if (value = callback.call(obj[i], i, obj[i]), value === false) {
- break;
- }
- }
- }
- }
- return obj;
- },
- /**
- * @param {Object} text
- * @return {?}
- */
- trim : function(text) {
- return null == text ? "" : (text + "").replace(badChars, "");
- },
- /**
- * @param {?} arr
- * @param {Array} results
- * @return {?}
- */
- makeArray : function(arr, results) {
- var ret = results || [];
- return null != arr && (isArraylike(Object(arr)) ? jQuery.merge(ret, "string" == typeof arr ? [arr] : arr) : core_push.call(ret, arr)), ret;
- },
- /**
- * @param {?} elem
- * @param {?} arr
- * @param {?} i
- * @return {?}
- */
- inArray : function(elem, arr, i) {
- return null == arr ? -1 : core_indexOf.call(arr, elem, i);
- },
- /**
- * @param {Array} first
- * @param {?} second
- * @return {?}
- */
- merge : function(first, second) {
- /** @type {number} */
- var jlen = +second.length;
- /** @type {number} */
- var j = 0;
- var i = first.length;
- for (;jlen > j;j++) {
- first[i++] = second[j];
- }
- return first.length = i, first;
- },
- /**
- * @param {Array} elems
- * @param {Function} callback
- * @param {?} inv
- * @return {?}
- */
- grep : function(elems, callback, inv) {
- var val;
- /** @type {Array} */
- var ret = [];
- /** @type {number} */
- var i = 0;
- var l = elems.length;
- /** @type {boolean} */
- var skip = !inv;
- for (;l > i;i++) {
- /** @type {boolean} */
- val = !callback(elems[i], i);
- if (val !== skip) {
- ret.push(elems[i]);
- }
- }
- return ret;
- },
- /**
- * @param {Object} elems
- * @param {Function} callback
- * @param {boolean} arg
- * @return {?}
- */
- map : function(elems, callback, arg) {
- var value;
- /** @type {number} */
- var i = 0;
- var l = elems.length;
- var isArray = isArraylike(elems);
- /** @type {Array} */
- var args = [];
- if (isArray) {
- for (;l > i;i++) {
- value = callback(elems[i], i, arg);
- if (null != value) {
- args.push(value);
- }
- }
- } else {
- for (i in elems) {
- value = callback(elems[i], i, arg);
- if (null != value) {
- args.push(value);
- }
- }
- }
- return core_concat.apply([], args);
- },
- guid : 1,
- /**
- * @param {Function} fn
- * @param {(Function|string)} context
- * @return {?}
- */
- proxy : function(fn, context) {
- var tmp;
- var args;
- var proxy;
- return "string" == typeof context && (tmp = fn[context], context = fn, fn = tmp), jQuery.isFunction(fn) ? (args = core_slice.call(arguments, 2), proxy = function() {
- return fn.apply(context || this, args.concat(core_slice.call(arguments)));
- }, proxy.guid = fn.guid = fn.guid || jQuery.guid++, proxy) : void 0;
- },
- /** @type {function (): number} */
- now : Date.now,
- support : support
- });
- jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(dataAndEvents, m3) {
- class2type["[object " + m3 + "]"] = m3.toLowerCase();
- });
- var Sizzle = function(win) {
- /**
- * @param {string} selector
- * @param {Object} context
- * @param {Array} results
- * @param {Array} seed
- * @return {?}
- */
- function Sizzle(selector, context, results, seed) {
- var match;
- var elem;
- var id;
- var type;
- var i;
- var groups;
- var old;
- var nid;
- var newContext;
- var newSelector;
- if ((context ? context.ownerDocument || context : preferredDoc) !== doc && setDocument(context), context = context || doc, results = results || [], type = context.nodeType, "string" != typeof selector || (!selector || 1 !== type && (9 !== type && 11 !== type))) {
- return results;
- }
- if (!seed && documentIsHTML) {
- if (11 !== type && (match = rquickExpr.exec(selector))) {
- if (id = match[1]) {
- if (9 === type) {
- if (elem = context.getElementById(id), !elem || !elem.parentNode) {
- return results;
- }
- if (elem.id === id) {
- return results.push(elem), results;
- }
- } else {
- if (context.ownerDocument && ((elem = context.ownerDocument.getElementById(id)) && (contains(context, elem) && elem.id === id))) {
- return results.push(elem), results;
- }
- }
- } else {
- if (match[2]) {
- return push.apply(results, context.getElementsByTagName(selector)), results;
- }
- if ((id = match[3]) && support.getElementsByClassName) {
- return push.apply(results, context.getElementsByClassName(id)), results;
- }
- }
- }
- if (support.qsa && (!rbuggyQSA || !rbuggyQSA.test(selector))) {
- if (nid = old = expando, newContext = context, newSelector = 1 !== type && selector, 1 === type && "object" !== context.nodeName.toLowerCase()) {
- groups = tokenize(selector);
- if (old = context.getAttribute("id")) {
- nid = old.replace(r20, "\\$&");
- } else {
- context.setAttribute("id", nid);
- }
- /** @type {string} */
- nid = "[id='" + nid + "'] ";
- i = groups.length;
- for (;i--;) {
- /** @type {string} */
- groups[i] = nid + toSelector(groups[i]);
- }
- newContext = rsibling.test(selector) && testContext(context.parentNode) || context;
- newSelector = groups.join(",");
- }
- if (newSelector) {
- try {
- return push.apply(results, newContext.querySelectorAll(newSelector)), results;
- } catch (m) {
- } finally {
- if (!old) {
- context.removeAttribute("id");
- }
- }
- }
- }
- }
- return select(selector.replace(rtrim, "$1"), context, results, seed);
- }
- /**
- * @return {?}
- */
- function createCache() {
- /**
- * @param {string} key
- * @param {?} value
- * @return {?}
- */
- function cache(key, value) {
- return buf.push(key + " ") > Expr.cacheLength && delete cache[buf.shift()], cache[key + " "] = value;
- }
- /** @type {Array} */
- var buf = [];
- return cache;
- }
- /**
- * @param {Function} fn
- * @return {?}
- */
- function markFunction(fn) {
- return fn[expando] = true, fn;
- }
- /**
- * @param {Function} fn
- * @return {?}
- */
- function assert(fn) {
- var t = doc.createElement("div");
- try {
- return!!fn(t);
- } catch (n) {
- return false;
- } finally {
- if (t.parentNode) {
- t.parentNode.removeChild(t);
- }
- /** @type {null} */
- t = null;
- }
- }
- /**
- * @param {string} attrs
- * @param {Function} handler
- * @return {undefined}
- */
- function addHandle(attrs, handler) {
- var arr = attrs.split("|");
- var i = attrs.length;
- for (;i--;) {
- /** @type {Function} */
- Expr.attrHandle[arr[i]] = handler;
- }
- }
- /**
- * @param {Object} a
- * @param {Object} b
- * @return {?}
- */
- function siblingCheck(a, b) {
- var cur = b && a;
- var diff = cur && (1 === a.nodeType && (1 === b.nodeType && (~b.sourceIndex || MAX_NEGATIVE) - (~a.sourceIndex || MAX_NEGATIVE)));
- if (diff) {
- return diff;
- }
- if (cur) {
- for (;cur = cur.nextSibling;) {
- if (cur === b) {
- return-1;
- }
- }
- }
- return a ? 1 : -1;
- }
- /**
- * @param {?} type
- * @return {?}
- */
- function createInputPseudo(type) {
- return function(elem) {
- var b = elem.nodeName.toLowerCase();
- return "input" === b && elem.type === type;
- };
- }
- /**
- * @param {?} type
- * @return {?}
- */
- function createButtonPseudo(type) {
- return function(elem) {
- var NULL = elem.nodeName.toLowerCase();
- return("input" === NULL || "button" === NULL) && elem.type === type;
- };
- }
- /**
- * @param {Function} fn
- * @return {?}
- */
- function createPositionalPseudo(fn) {
- return markFunction(function(argument) {
- return argument = +argument, markFunction(function(seed, matches) {
- var j;
- var matchIndexes = fn([], seed.length, argument);
- var i = matchIndexes.length;
- for (;i--;) {
- if (seed[j = matchIndexes[i]]) {
- /** @type {boolean} */
- seed[j] = !(matches[j] = seed[j]);
- }
- }
- });
- });
- }
- /**
- * @param {Object} context
- * @return {?}
- */
- function testContext(context) {
- return context && ("undefined" != typeof context.getElementsByTagName && context);
- }
- /**
- * @return {undefined}
- */
- function setFilters() {
- }
- /**
- * @param {Array} tokens
- * @return {?}
- */
- function toSelector(tokens) {
- /** @type {number} */
- var i = 0;
- var nTokens = tokens.length;
- /** @type {string} */
- var selector = "";
- for (;nTokens > i;i++) {
- selector += tokens[i].value;
- }
- return selector;
- }
- /**
- * @param {Function} matcher
- * @param {Object} combinator
- * @param {boolean} dataAndEvents
- * @return {?}
- */
- function addCombinator(matcher, combinator, dataAndEvents) {
- var dir = combinator.dir;
- var i = dataAndEvents && "parentNode" === dir;
- /** @type {number} */
- var doneName = done++;
- return combinator.first ? function(elem, context, xml) {
- for (;elem = elem[dir];) {
- if (1 === elem.nodeType || i) {
- return matcher(elem, context, xml);
- }
- }
- } : function(elem, context, xml) {
- var oldCache;
- var outerCache;
- /** @type {Array} */
- var newCache = [dirruns, doneName];
- if (xml) {
- for (;elem = elem[dir];) {
- if ((1 === elem.nodeType || i) && matcher(elem, context, xml)) {
- return true;
- }
- }
- } else {
- for (;elem = elem[dir];) {
- if (1 === elem.nodeType || i) {
- if (outerCache = elem[expando] || (elem[expando] = {}), (oldCache = outerCache[dir]) && (oldCache[0] === dirruns && oldCache[1] === doneName)) {
- return newCache[2] = oldCache[2];
- }
- if (outerCache[dir] = newCache, newCache[2] = matcher(elem, context, xml)) {
- return true;
- }
- }
- }
- }
- };
- }
- /**
- * @param {Array} matchers
- * @return {?}
- */
- function elementMatcher(matchers) {
- return matchers.length > 1 ? function(elem, context, xml) {
- var i = matchers.length;
- for (;i--;) {
- if (!matchers[i](elem, context, xml)) {
- return false;
- }
- }
- return true;
- } : matchers[0];
- }
- /**
- * @param {string} selector
- * @param {Array} contexts
- * @param {?} results
- * @return {?}
- */
- function multipleContexts(selector, contexts, results) {
- /** @type {number} */
- var i = 0;
- var len = contexts.length;
- for (;len > i;i++) {
- Sizzle(selector, contexts[i], results);
- }
- return results;
- }
- /**
- * @param {Array} unmatched
- * @param {Object} map
- * @param {string} filter
- * @param {Object} context
- * @param {boolean} xml
- * @return {?}
- */
- function condense(unmatched, map, filter, context, xml) {
- var elem;
- /** @type {Array} */
- var newUnmatched = [];
- /** @type {number} */
- var i = 0;
- var len = unmatched.length;
- /** @type {boolean} */
- var c = null != map;
- for (;len > i;i++) {
- if (elem = unmatched[i]) {
- if (!filter || filter(elem, context, xml)) {
- newUnmatched.push(elem);
- if (c) {
- map.push(i);
- }
- }
- }
- }
- return newUnmatched;
- }
- /**
- * @param {string} preFilter
- * @param {Object} selector
- * @param {boolean} matcher
- * @param {Object} postFilter
- * @param {Object} postFinder
- * @param {Object} postSelector
- * @return {?}
- */
- function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {
- return postFilter && (!postFilter[expando] && (postFilter = setMatcher(postFilter))), postFinder && (!postFinder[expando] && (postFinder = setMatcher(postFinder, postSelector))), markFunction(function(seed, results, context, xml) {
- var fix;
- var i;
- var elem;
- /** @type {Array} */
- var preMap = [];
- /** @type {Array} */
- var postMap = [];
- var preexisting = results.length;
- var elems = seed || multipleContexts(selector || "*", context.nodeType ? [context] : context, []);
- var matcherIn = !preFilter || !seed && selector ? elems : condense(elems, preMap, preFilter, context, xml);
- var matcherOut = matcher ? postFinder || (seed ? preFilter : preexisting || postFilter) ? [] : results : matcherIn;
- if (matcher && matcher(matcherIn, matcherOut, context, xml), postFilter) {
- fix = condense(matcherOut, postMap);
- postFilter(fix, [], context, xml);
- i = fix.length;
- for (;i--;) {
- if (elem = fix[i]) {
- /** @type {boolean} */
- matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem);
- }
- }
- }
- if (seed) {
- if (postFinder || preFilter) {
- if (postFinder) {
- /** @type {Array} */
- fix = [];
- i = matcherOut.length;
- for (;i--;) {
- if (elem = matcherOut[i]) {
- fix.push(matcherIn[i] = elem);
- }
- }
- postFinder(null, matcherOut = [], fix, xml);
- }
- i = matcherOut.length;
- for (;i--;) {
- if (elem = matcherOut[i]) {
- if ((fix = postFinder ? sortFunction(seed, elem) : preMap[i]) > -1) {
- /** @type {boolean} */
- seed[fix] = !(results[fix] = elem);
- }
- }
- }
- }
- } else {
- matcherOut = condense(matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut);
- if (postFinder) {
- postFinder(null, results, matcherOut, xml);
- } else {
- push.apply(results, matcherOut);
- }
- }
- });
- }
- /**
- * @param {Object} tokens
- * @return {?}
- */
- function matcherFromTokens(tokens) {
- var a;
- var matcher;
- var j;
- var len = tokens.length;
- var leadingRelative = Expr.relative[tokens[0].type];
- var implicitRelative = leadingRelative || Expr.relative[" "];
- /** @type {number} */
- var i = leadingRelative ? 1 : 0;
- var matchContext = addCombinator(function(out) {
- return out === a;
- }, implicitRelative, true);
- var matchAnyContext = addCombinator(function(b) {
- return sortFunction(a, b) > -1;
- }, implicitRelative, true);
- /** @type {Array} */
- var matchers = [function(elem, context, xml) {
- var i = !leadingRelative && (xml || context !== outermostContext) || ((a = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml));
- return a = null, i;
- }];
- for (;len > i;i++) {
- if (matcher = Expr.relative[tokens[i].type]) {
- /** @type {Array} */
- matchers = [addCombinator(elementMatcher(matchers), matcher)];
- } else {
- if (matcher = Expr.filter[tokens[i].type].apply(null, tokens[i].matches), matcher[expando]) {
- /** @type {number} */
- j = ++i;
- for (;len > j && !Expr.relative[tokens[j].type];j++) {
- }
- return setMatcher(i > 1 && elementMatcher(matchers), i > 1 && toSelector(tokens.slice(0, i - 1).concat({
- value : " " === tokens[i - 2].type ? "*" : ""
- })).replace(rtrim, "$1"), matcher, j > i && matcherFromTokens(tokens.slice(i, j)), len > j && matcherFromTokens(tokens = tokens.slice(j)), len > j && toSelector(tokens));
- }
- matchers.push(matcher);
- }
- }
- return elementMatcher(matchers);
- }
- /**
- * @param {Array} elementMatchers
- * @param {Array} setMatchers
- * @return {?}
- */
- function matcherFromGroupMatchers(elementMatchers, setMatchers) {
- /** @type {boolean} */
- var bySet = setMatchers.length > 0;
- /** @type {boolean} */
- var triggerElem = elementMatchers.length > 0;
- /**
- * @param {HTMLElement} dataAndEvents
- * @param {Function} context
- * @param {?} xml
- * @param {Array} results
- * @param {Element} seed
- * @return {?}
- */
- var superMatcher = function(dataAndEvents, context, xml, results, seed) {
- var elem;
- var j;
- var matcher;
- /** @type {number} */
- var matchedCount = 0;
- /** @type {string} */
- var i = "0";
- var scripts = dataAndEvents && [];
- /** @type {Array} */
- var setMatched = [];
- var contextBackup = outermostContext;
- var unmatched = dataAndEvents || triggerElem && Expr.find.TAG("*", seed);
- var dirrunsUnique = dirruns += null == contextBackup ? 1 : Math.random() || 0.1;
- var len = unmatched.length;
- if (seed) {
- outermostContext = context !== doc && context;
- }
- for (;i !== len && null != (elem = unmatched[i]);i++) {
- if (triggerElem && elem) {
- /** @type {number} */
- j = 0;
- for (;matcher = elementMatchers[j++];) {
- if (matcher(elem, context, xml)) {
- results.push(elem);
- break;
- }
- }
- if (seed) {
- dirruns = dirrunsUnique;
- }
- }
- if (bySet) {
- if (elem = !matcher && elem) {
- matchedCount--;
- }
- if (dataAndEvents) {
- scripts.push(elem);
- }
- }
- }
- if (matchedCount += i, bySet && i !== matchedCount) {
- /** @type {number} */
- j = 0;
- for (;matcher = setMatchers[j++];) {
- matcher(scripts, setMatched, context, xml);
- }
- if (dataAndEvents) {
- if (matchedCount > 0) {
- for (;i--;) {
- if (!scripts[i]) {
- if (!setMatched[i]) {
- setMatched[i] = pop.call(results);
- }
- }
- }
- }
- setMatched = condense(setMatched);
- }
- push.apply(results, setMatched);
- if (seed) {
- if (!dataAndEvents) {
- if (setMatched.length > 0) {
- if (matchedCount + setMatchers.length > 1) {
- Sizzle.uniqueSort(results);
- }
- }
- }
- }
- }
- return seed && (dirruns = dirrunsUnique, outermostContext = contextBackup), scripts;
- };
- return bySet ? markFunction(superMatcher) : superMatcher;
- }
- var i;
- var support;
- var Expr;
- var getText;
- var objectToString;
- var tokenize;
- var compile;
- var select;
- var outermostContext;
- var sortInput;
- var D;
- var setDocument;
- var doc;
- var docElem;
- var documentIsHTML;
- var rbuggyQSA;
- var rbuggyMatches;
- var matches;
- var contains;
- /** @type {string} */
- var expando = "sizzle" + 1 * new Date;
- var preferredDoc = win.document;
- /** @type {number} */
- var dirruns = 0;
- /** @type {number} */
- var done = 0;
- var classCache = createCache();
- var tokenCache = createCache();
- var compilerCache = createCache();
- /**
- * @param {?} a
- * @param {?} b
- * @return {?}
- */
- var sortOrder = function(a, b) {
- return a === b && (D = true), 0;
- };
- /** @type {number} */
- var MAX_NEGATIVE = 1 << 31;
- /** @type {function (this:Object, *): boolean} */
- var hasOwn = {}.hasOwnProperty;
- /** @type {Array} */
- var arr = [];
- /** @type {function (this:(Array.<T>|{length: number})): T} */
- var pop = arr.pop;
- /** @type {function (this:(Array.<T>|{length: number}), ...[T]): number} */
- var f = arr.push;
- /** @type {function (this:(Array.<T>|{length: number}), ...[T]): number} */
- var push = arr.push;
- /** @type {function (this:(Array.<T>|string|{length: number}), *=, *=): Array.<T>} */
- var slice = arr.slice;
- /**
- * @param {Object} v
- * @param {?} o
- * @return {?}
- */
- var sortFunction = function(v, o) {
- /** @type {number} */
- var reckey = 0;
- var pad = v.length;
- for (;pad > reckey;reckey++) {
- if (v[reckey] === o) {
- return reckey;
- }
- }
- return-1;
- };
- /** @type {string} */
- var booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped";
- /** @type {string} */
- var whitespace = "[\\x20\\t\\r\\n\\f]";
- /** @type {string} */
- var characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+";
- /** @type {string} */
- var identifier = characterEncoding.replace("w", "w#");
- /** @type {string} */
- var attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace + "*([*^$|!~]?=)" + whitespace + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + "*\\]";
- /** @type {string} */
- var pseudos = ":(" + characterEncoding + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|.*)\\)|)";
- /** @type {RegExp} */
- var regexp = new RegExp(whitespace + "+", "g");
- /** @type {RegExp} */
- var rtrim = new RegExp("^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g");
- /** @type {RegExp} */
- var rcomma = new RegExp("^" + whitespace + "*," + whitespace + "*");
- /** @type {RegExp} */
- var rcombinators = new RegExp("^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*");
- /** @type {RegExp} */
- var rattributeQuotes = new RegExp("=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g");
- /** @type {RegExp} */
- var rpseudo = new RegExp(pseudos);
- /** @type {RegExp} */
- var ridentifier = new RegExp("^" + identifier + "$");
- var matchExpr = {
- ID : new RegExp("^#(" + characterEncoding + ")"),
- CLASS : new RegExp("^\\.(" + characterEncoding + ")"),
- TAG : new RegExp("^(" + characterEncoding.replace("w", "w*") + ")"),
- ATTR : new RegExp("^" + attributes),
- PSEUDO : new RegExp("^" + pseudos),
- CHILD : new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i"),
- bool : new RegExp("^(?:" + booleans + ")$", "i"),
- needsContext : new RegExp("^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i")
- };
- /** @type {RegExp} */
- var rinputs = /^(?:input|select|textarea|button)$/i;
- /** @type {RegExp} */
- var rheader = /^h\d$/i;
- /** @type {RegExp} */
- var rnative = /^[^{]+\{\s*\[native \w/;
- /** @type {RegExp} */
- var rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/;
- /** @type {RegExp} */
- var rsibling = /[+~]/;
- /** @type {RegExp} */
- var r20 = /'|\\/g;
- /** @type {RegExp} */
- var runescape = new RegExp("\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig");
- /**
- * @param {?} _
- * @param {(number|string)} escaped
- * @param {boolean} escapedWhitespace
- * @return {?}
- */
- var funescape = function(_, escaped, escapedWhitespace) {
- /** @type {number} */
- var high = "0x" + escaped - 65536;
- return high !== high || escapedWhitespace ? escaped : 0 > high ? String.fromCharCode(high + 65536) : String.fromCharCode(high >> 10 | 55296, 1023 & high | 56320);
- };
- /**
- * @return {undefined}
- */
- var onComplete = function() {
- setDocument();
- };
- try {
- push.apply(arr = slice.call(preferredDoc.childNodes), preferredDoc.childNodes);
- arr[preferredDoc.childNodes.length].nodeType;
- } catch (kt) {
- push = {
- /** @type {function (?, ?): undefined} */
- apply : arr.length ? function(obj, args) {
- f.apply(obj, slice.call(args));
- } : function(obj, var_args) {
- var j = obj.length;
- /** @type {number} */
- var r = 0;
- for (;obj[j++] = var_args[r++];) {
- }
- /** @type {number} */
- obj.length = j - 1;
- }
- };
- }
- support = Sizzle.support = {};
- /** @type {function (Object): ?} */
- objectToString = Sizzle.isXML = function(elem) {
- var node = elem && (elem.ownerDocument || elem).documentElement;
- return node ? "HTML" !== node.nodeName : false;
- };
- /** @type {function (Object): ?} */
- setDocument = Sizzle.setDocument = function(node) {
- var hasCompare;
- var parent;
- var d = node ? node.ownerDocument || node : preferredDoc;
- return d !== doc && (9 === d.nodeType && d.documentElement) ? (doc = d, docElem = d.documentElement, parent = d.defaultView, parent && (parent !== parent.top && (parent.addEventListener ? parent.addEventListener("unload", onComplete, false) : parent.attachEvent && parent.attachEvent("onunload", onComplete))), documentIsHTML = !objectToString(d), support.attributes = assert(function(div) {
- return div.className = "i", !div.getAttribute("className");
- }), support.getElementsByTagName = assert(function(div) {
- return div.appendChild(d.createComment("")), !div.getElementsByTagName("*").length;
- }), support.getElementsByClassName = rnative.test(d.getElementsByClassName), support.getById = assert(function(div) {
- return docElem.appendChild(div).id = expando, !d.getElementsByName || !d.getElementsByName(expando).length;
- }), support.getById ? (Expr.find.ID = function(id, context) {
- if ("undefined" != typeof context.getElementById && documentIsHTML) {
- var m = context.getElementById(id);
- return m && m.parentNode ? [m] : [];
- }
- }, Expr.filter.ID = function(id) {
- var attrId = id.replace(runescape, funescape);
- return function(elem) {
- return elem.getAttribute("id") === attrId;
- };
- }) : (delete Expr.find.ID, Expr.filter.ID = function(id) {
- var attrId = id.replace(runescape, funescape);
- return function(elem) {
- var node = "undefined" != typeof elem.getAttributeNode && elem.getAttributeNode("id");
- return node && node.value === attrId;
- };
- }), Expr.find.TAG = support.getElementsByTagName ? function(selector, el) {
- return "undefined" != typeof el.getElementsByTagName ? el.getElementsByTagName(selector) : support.qsa ? el.querySelectorAll(selector) : void 0;
- } : function(tag, from) {
- var cur;
- /** @type {Array} */
- var eventPath = [];
- /** @type {number} */
- var ri = 0;
- var tmp = from.getElementsByTagName(tag);
- if ("*" === tag) {
- for (;cur = tmp[ri++];) {
- if (1 === cur.nodeType) {
- eventPath.push(cur);
- }
- }
- return eventPath;
- }
- return tmp;
- }, Expr.find.CLASS = support.getElementsByClassName && function(isXML, instanceMethods) {
- return documentIsHTML ? instanceMethods.getElementsByClassName(isXML) : void 0;
- }, rbuggyMatches = [], rbuggyQSA = [], (support.qsa = rnative.test(d.querySelectorAll)) && (assert(function(div) {
- /** @type {string} */
- docElem.appendChild(div).innerHTML = "<a id='" + expando + "'></a><select id='" + expando + "-\f]' msallowcapture=''><option selected=''></option></select>";
- if (div.querySelectorAll("[msallowcapture^='']").length) {
- rbuggyQSA.push("[*^$]=" + whitespace + "*(?:''|\"\")");
- }
- if (!div.querySelectorAll("[selected]").length) {
- rbuggyQSA.push("\\[" + whitespace + "*(?:value|" + booleans + ")");
- }
- if (!div.querySelectorAll("[id~=" + expando + "-]").length) {
- rbuggyQSA.push("~=");
- }
- if (!div.querySelectorAll(":checked").length) {
- rbuggyQSA.push(":checked");
- }
- if (!div.querySelectorAll("a#" + expando + "+*").length) {
- rbuggyQSA.push(".#.+[+~]");
- }
- }), assert(function(div) {
- var input = d.createElement("input");
- input.setAttribute("type", "hidden");
- div.appendChild(input).setAttribute("name", "D");
- if (div.querySelectorAll("[name=d]").length) {
- rbuggyQSA.push("name" + whitespace + "*[*^$|!~]?=");
- }
- if (!div.querySelectorAll(":enabled").length) {
- rbuggyQSA.push(":enabled", ":disabled");
- }
- div.querySelectorAll("*,:x");
- rbuggyQSA.push(",.*:");
- })), (support.matchesSelector = rnative.test(matches = docElem.matches || (docElem.webkitMatchesSelector || (docElem.mozMatchesSelector || (docElem.oMatchesSelector || docElem.msMatchesSelector))))) && assert(function(div) {
- support.disconnectedMatch = matches.call(div, "div");
- matches.call(div, "[s!='']:x");
- rbuggyMatches.push("!=", pseudos);
- }), rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join("|")), rbuggyMatches = rbuggyMatches.length && new RegExp(rbuggyMatches.join("|")), hasCompare = rnative.test(docElem.compareDocumentPosition), contains = hasCompare || rnative.test(docElem.contains) ? function(a, b) {
- var adown = 9 === a.nodeType ? a.documentElement : a;
- var bup = b && b.parentNode;
- return a === bup || !(!bup || (1 !== bup.nodeType || !(adown.contains ? adown.contains(bup) : a.compareDocumentPosition && 16 & a.compareDocumentPosition(bup))));
- } : function(a, b) {
- if (b) {
- for (;b = b.parentNode;) {
- if (b === a) {
- return true;
- }
- }
- }
- return false;
- }, sortOrder = hasCompare ? function(a, b) {
- if (a === b) {
- return D = true, 0;
- }
- /** @type {number} */
- var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
- return compare ? compare : (compare = (a.ownerDocument || a) === (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1, 1 & compare || !support.sortDetached && b.compareDocumentPosition(a) === compare ? a === d || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ? -1 : b === d || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ? 1 : sortInput ? sortFunction(sortInput, a) - sortFunction(sortInput, b) : 0 : 4 & compare ? -1 : 1);
- } : function(a, b) {
- if (a === b) {
- return D = true, 0;
- }
- var cur;
- /** @type {number} */
- var i = 0;
- var aup = a.parentNode;
- var bup = b.parentNode;
- /** @type {Array} */
- var ap = [a];
- /** @type {Array} */
- var bp = [b];
- if (!aup || !bup) {
- return a === d ? -1 : b === d ? 1 : aup ? -1 : bup ? 1 : sortInput ? sortFunction(sortInput, a) - sortFunction(sortInput, b) : 0;
- }
- if (aup === bup) {
- return siblingCheck(a, b);
- }
- cur = a;
- for (;cur = cur.parentNode;) {
- ap.unshift(cur);
- }
- cur = b;
- for (;cur = cur.parentNode;) {
- bp.unshift(cur);
- }
- for (;ap[i] === bp[i];) {
- i++;
- }
- return i ? siblingCheck(ap[i], bp[i]) : ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0;
- }, d) : doc;
- };
- /**
- * @param {string} expr
- * @param {Array} elements
- * @return {?}
- */
- Sizzle.matches = function(expr, elements) {
- return Sizzle(expr, null, null, elements);
- };
- /**
- * @param {HTMLElement} elem
- * @param {string} expr
- * @return {?}
- */
- Sizzle.matchesSelector = function(elem, expr) {
- if ((elem.ownerDocument || elem) !== doc && setDocument(elem), expr = expr.replace(rattributeQuotes, "='$1']"), !(!support.matchesSelector || (!documentIsHTML || (rbuggyMatches && rbuggyMatches.test(expr) || rbuggyQSA && rbuggyQSA.test(expr))))) {
- try {
- var ret = matches.call(elem, expr);
- if (ret || (support.disconnectedMatch || elem.document && 11 !== elem.document.nodeType)) {
- return ret;
- }
- } catch (i) {
- }
- }
- return Sizzle(expr, doc, null, [elem]).length > 0;
- };
- /**
- * @param {?} context
- * @param {string} b
- * @return {?}
- */
- Sizzle.contains = function(context, b) {
- return(context.ownerDocument || context) !== doc && setDocument(context), contains(context, b);
- };
- /**
- * @param {string} elem
- * @param {Object} name
- * @return {?}
- */
- Sizzle.attr = function(elem, name) {
- if ((elem.ownerDocument || elem) !== doc) {
- setDocument(elem);
- }
- var fn = Expr.attrHandle[name.toLowerCase()];
- var val = fn && hasOwn.call(Expr.attrHandle, name.toLowerCase()) ? fn(elem, name, !documentIsHTML) : void 0;
- return void 0 !== val ? val : support.attributes || !documentIsHTML ? elem.getAttribute(name) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null;
- };
- /**
- * @param {string} type
- * @return {?}
- */
- Sizzle.error = function(type) {
- throw new Error("Syntax error, unrecognized expression: " + type);
- };
- /**
- * @param {Array} results
- * @return {?}
- */
- Sizzle.uniqueSort = function(results) {
- var elem;
- /** @type {Array} */
- var duplicates = [];
- /** @type {number} */
- var j = 0;
- /** @type {number} */
- var i = 0;
- if (D = !support.detectDuplicates, sortInput = !support.sortStable && results.slice(0), results.sort(sortOrder), D) {
- for (;elem = results[i++];) {
- if (elem === results[i]) {
- /** @type {number} */
- j = duplicates.push(i);
- }
- }
- for (;j--;) {
- results.splice(duplicates[j], 1);
- }
- }
- return sortInput = null, results;
- };
- /** @type {function (HTMLElement): ?} */
- getText = Sizzle.getText = function(elem) {
- var node;
- /** @type {string} */
- var ret = "";
- /** @type {number} */
- var i = 0;
- var nodeType = elem.nodeType;
- if (nodeType) {
- if (1 === nodeType || (9 === nodeType || 11 === nodeType)) {
- if ("string" == typeof elem.textContent) {
- return elem.textContent;
- }
- elem = elem.firstChild;
- for (;elem;elem = elem.nextSibling) {
- ret += getText(elem);
- }
- } else {
- if (3 === nodeType || 4 === nodeType) {
- return elem.nodeValue;
- }
- }
- } else {
- for (;node = elem[i++];) {
- ret += getText(node);
- }
- }
- return ret;
- };
- Expr = Sizzle.selectors = {
- cacheLength : 50,
- /** @type {function (Function): ?} */
- createPseudo : markFunction,
- match : matchExpr,
- attrHandle : {},
- find : {},
- relative : {
- ">" : {
- dir : "parentNode",
- first : true
- },
- " " : {
- dir : "parentNode"
- },
- "+" : {
- dir : "previousSibling",
- first : true
- },
- "~" : {
- dir : "previousSibling"
- }
- },
- preFilter : {
- /**
- * @param {Array} match
- * @return {?}
- */
- ATTR : function(match) {
- return match[1] = match[1].replace(runescape, funescape), match[3] = (match[3] || (match[4] || (match[5] || ""))).replace(runescape, funescape), "~=" === match[2] && (match[3] = " " + match[3] + " "), match.slice(0, 4);
- },
- /**
- * @param {Array} match
- * @return {?}
- */
- CHILD : function(match) {
- return match[1] = match[1].toLowerCase(), "nth" === match[1].slice(0, 3) ? (match[3] || Sizzle.error(match[0]), match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * ("even" === match[3] || "odd" === match[3])), match[5] = +(match[7] + match[8] || "odd" === match[3])) : match[3] && Sizzle.error(match[0]), match;
- },
- /**
- * @param {Array} match
- * @return {?}
- */
- PSEUDO : function(match) {
- var excess;
- var unquoted = !match[6] && match[2];
- return matchExpr.CHILD.test(match[0]) ? null : (match[3] ? match[2] = match[4] || (match[5] || "") : unquoted && (rpseudo.test(unquoted) && ((excess = tokenize(unquoted, true)) && ((excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length) && (match[0] = match[0].slice(0, excess), match[2] = unquoted.slice(0, excess))))), match.slice(0, 3));
- }
- },
- filter : {
- /**
- * @param {string} nodeNameSelector
- * @return {?}
- */
- TAG : function(nodeNameSelector) {
- var nodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase();
- return "*" === nodeNameSelector ? function() {
- return true;
- } : function(elem) {
- return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
- };
- },
- /**
- * @param {string} isXML
- * @return {?}
- */
- CLASS : function(isXML) {
- var pattern = classCache[isXML + " "];
- return pattern || (pattern = new RegExp("(^|" + whitespace + ")" + isXML + "(" + whitespace + "|$)")) && classCache(isXML, function(elem) {
- return pattern.test("string" == typeof elem.className && elem.className || ("undefined" != typeof elem.getAttribute && elem.getAttribute("class") || ""));
- });
- },
- /**
- * @param {Object} name
- * @param {string} not
- * @param {string} check
- * @return {?}
- */
- ATTR : function(name, not, check) {
- return function(elem) {
- var result = Sizzle.attr(elem, name);
- return null == result ? "!=" === not : not ? (result += "", "=" === not ? result === check : "!=" === not ? result !== check : "^=" === not ? check && 0 === result.indexOf(check) : "*=" === not ? check && result.indexOf(check) > -1 : "$=" === not ? check && result.slice(-check.length) === check : "~=" === not ? (" " + result.replace(regexp, " ") + " ").indexOf(check) > -1 : "|=" === not ? result === check || result.slice(0, check.length + 1) === check + "-" : false) : true;
- };
- },
- /**
- * @param {string} type
- * @param {string} argument
- * @param {?} dataAndEvents
- * @param {number} first
- * @param {number} last
- * @return {?}
- */
- CHILD : function(type, argument, dataAndEvents, first, last) {
- /** @type {boolean} */
- var simple = "nth" !== type.slice(0, 3);
- /** @type {boolean} */
- var forward = "last" !== type.slice(-4);
- /** @type {boolean} */
- var ofType = "of-type" === argument;
- return 1 === first && 0 === last ? function(contestant) {
- return!!contestant.parentNode;
- } : function(elem, deepDataAndEvents, dataAndEvents) {
- var cache;
- var outerCache;
- var node;
- var diff;
- var nodeIndex;
- var eventPath;
- /** @type {string} */
- var which = simple !== forward ? "nextSibling" : "previousSibling";
- var parent = elem.parentNode;
- var name = ofType && elem.nodeName.toLowerCase();
- /** @type {boolean} */
- var useCache = !dataAndEvents && !ofType;
- if (parent) {
- if (simple) {
- for (;which;) {
- /** @type {Object} */
- node = elem;
- for (;node = node[which];) {
- if (ofType ? node.nodeName.toLowerCase() === name : 1 === node.nodeType) {
- return false;
- }
- }
- /** @type {(boolean|string)} */
- eventPath = which = "only" === type && (!eventPath && "nextSibling");
- }
- return true;
- }
- if (eventPath = [forward ? parent.firstChild : parent.lastChild], forward && useCache) {
- outerCache = parent[expando] || (parent[expando] = {});
- cache = outerCache[type] || [];
- nodeIndex = cache[0] === dirruns && cache[1];
- diff = cache[0] === dirruns && cache[2];
- node = nodeIndex && parent.childNodes[nodeIndex];
- for (;node = ++nodeIndex && (node && node[which]) || ((diff = nodeIndex = 0) || eventPath.pop());) {
- if (1 === node.nodeType && (++diff && node === elem)) {
- /** @type {Array} */
- outerCache[type] = [dirruns, nodeIndex, diff];
- break;
- }
- }
- } else {
- if (useCache && ((cache = (elem[expando] || (elem[expando] = {}))[type]) && cache[0] === dirruns)) {
- diff = cache[1];
- } else {
- for (;(node = ++nodeIndex && (node && node[which]) || ((diff = nodeIndex = 0) || eventPath.pop())) && ((ofType ? node.nodeName.toLowerCase() !== name : 1 !== node.nodeType) || (!++diff || (useCache && ((node[expando] || (node[expando] = {}))[type] = [dirruns, diff]), node !== elem)));) {
- }
- }
- }
- return diff -= last, diff === first || diff % first === 0 && diff / first >= 0;
- }
- };
- },
- /**
- * @param {string} pseudo
- * @param {?} context
- * @return {?}
- */
- PSEUDO : function(pseudo, context) {
- var args;
- var fn = Expr.pseudos[pseudo] || (Expr.setFilters[pseudo.toLowerCase()] || Sizzle.error("unsupported pseudo: " + pseudo));
- return fn[expando] ? fn(context) : fn.length > 1 ? (args = [pseudo, pseudo, "", context], Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function(a, event) {
- var id;
- var ret = fn(a, context);
- var i = ret.length;
- for (;i--;) {
- id = sortFunction(a, ret[i]);
- /** @type {boolean} */
- a[id] = !(event[id] = ret[i]);
- }
- }) : function(err) {
- return fn(err, 0, args);
- }) : fn;
- }
- },
- pseudos : {
- not : markFunction(function(selector) {
- /** @type {Array} */
- var elem = [];
- /** @type {Array} */
- var memory = [];
- var matcher = compile(selector.replace(rtrim, "$1"));
- return matcher[expando] ? markFunction(function(seed, qs, dataAndEvents, xml) {
- var val;
- var unmatched = matcher(seed, null, xml, []);
- var i = seed.length;
- for (;i--;) {
- if (val = unmatched[i]) {
- /** @type {boolean} */
- seed[i] = !(qs[i] = val);
- }
- }
- }) : function(value, dataAndEvents, xml) {
- return elem[0] = value, matcher(elem, null, xml, memory), elem[0] = null, !memory.pop();
- };
- }),
- has : markFunction(function(selector) {
- return function(elem) {
- return Sizzle(selector, elem).length > 0;
- };
- }),
- contains : markFunction(function(id) {
- return id = id.replace(runescape, funescape), function(elem) {
- return(elem.textContent || (elem.innerText || getText(elem))).indexOf(id) > -1;
- };
- }),
- lang : markFunction(function(lang) {
- return ridentifier.test(lang || "") || Sizzle.error("unsupported lang: " + lang), lang = lang.replace(runescape, funescape).toLowerCase(), function(elem) {
- var elemLang;
- do {
- if (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) {
- return elemLang = elemLang.toLowerCase(), elemLang === lang || 0 === elemLang.indexOf(lang + "-");
- }
- } while ((elem = elem.parentNode) && 1 === elem.nodeType);
- return false;
- };
- }),
- /**
- * @param {string} type
- * @return {?}
- */
- target : function(type) {
- var models = win.location && win.location.hash;
- return models && models.slice(1) === type.id;
- },
- /**
- * @param {undefined} elem
- * @return {?}
- */
- root : function(elem) {
- return elem === docElem;
- },
- /**
- * @param {string} type
- * @return {?}
- */
- focus : function(type) {
- return type === doc.activeElement && ((!doc.hasFocus || doc.hasFocus()) && !!(type.type || (type.href || ~type.tabIndex)));
- },
- /**
- * @param {Function} elem
- * @return {?}
- */
- enabled : function(elem) {
- return elem.disabled === false;
- },
- /**
- * @param {EventTarget} elem
- * @return {?}
- */
- disabled : function(elem) {
- return elem.disabled === true;
- },
- /**
- * @param {string} type
- * @return {?}
- */
- checked : function(type) {
- var b = type.nodeName.toLowerCase();
- return "input" === b && !!type.checked || "option" === b && !!type.selected;
- },
- /**
- * @param {Node} elem
- * @return {?}
- */
- selected : function(elem) {
- return elem.parentNode && elem.parentNode.selectedIndex, elem.selected === true;
- },
- /**
- * @param {Object} elem
- * @return {?}
- */
- empty : function(elem) {
- elem = elem.firstChild;
- for (;elem;elem = elem.nextSibling) {
- if (elem.nodeType < 6) {
- return false;
- }
- }
- return true;
- },
- /**
- * @param {string} elem
- * @return {?}
- */
- parent : function(elem) {
- return!Expr.pseudos.empty(elem);
- },
- /**
- * @param {Node} elem
- * @return {?}
- */
- header : function(elem) {
- return rheader.test(elem.nodeName);
- },
- /**
- * @param {Node} elem
- * @return {?}
- */
- input : function(elem) {
- return rinputs.test(elem.nodeName);
- },
- /**
- * @param {Node} elem
- * @return {?}
- */
- button : function(elem) {
- var b = elem.nodeName.toLowerCase();
- return "input" === b && "button" === elem.type || "button" === b;
- },
- /**
- * @param {Node} elem
- * @return {?}
- */
- text : function(elem) {
- var evt;
- return "input" === elem.nodeName.toLowerCase() && ("text" === elem.type && (null == (evt = elem.getAttribute("type")) || "text" === evt.toLowerCase()));
- },
- first : createPositionalPseudo(function() {
- return[0];
- }),
- last : createPositionalPseudo(function(dataAndEvents, deepDataAndEvents) {
- return[deepDataAndEvents - 1];
- }),
- eq : createPositionalPseudo(function(dataAndEvents, length, index) {
- return[0 > index ? index + length : index];
- }),
- even : createPositionalPseudo(function(assigns, dataAndEvents) {
- /** @type {number} */
- var vvar = 0;
- for (;dataAndEvents > vvar;vvar += 2) {
- assigns.push(vvar);
- }
- return assigns;
- }),
- odd : createPositionalPseudo(function(assigns, dataAndEvents) {
- /** @type {number} */
- var vvar = 1;
- for (;dataAndEvents > vvar;vvar += 2) {
- assigns.push(vvar);
- }
- return assigns;
- }),
- lt : createPositionalPseudo(function(assigns, length, index) {
- var vvar = 0 > index ? index + length : index;
- for (;--vvar >= 0;) {
- assigns.push(vvar);
- }
- return assigns;
- }),
- gt : createPositionalPseudo(function(assigns, length, index) {
- var vvar = 0 > index ? index + length : index;
- for (;++vvar < length;) {
- assigns.push(vvar);
- }
- return assigns;
- })
- }
- };
- Expr.pseudos.nth = Expr.pseudos.eq;
- for (i in{
- radio : true,
- checkbox : true,
- file : true,
- password : true,
- image : true
- }) {
- Expr.pseudos[i] = createInputPseudo(i);
- }
- for (i in{
- submit : true,
- reset : true
- }) {
- Expr.pseudos[i] = createButtonPseudo(i);
- }
- return setFilters.prototype = Expr.filters = Expr.pseudos, Expr.setFilters = new setFilters, tokenize = Sizzle.tokenize = function(cycle, parseOnly) {
- var matched;
- var match;
- var tokens;
- var type;
- var soFar;
- var groups;
- var preFilters;
- var cached = tokenCache[cycle + " "];
- if (cached) {
- return parseOnly ? 0 : cached.slice(0);
- }
- /** @type {string} */
- soFar = cycle;
- /** @type {Array} */
- groups = [];
- preFilters = Expr.preFilter;
- for (;soFar;) {
- if (!matched || (match = rcomma.exec(soFar))) {
- if (match) {
- soFar = soFar.slice(match[0].length) || soFar;
- }
- groups.push(tokens = []);
- }
- /** @type {boolean} */
- matched = false;
- if (match = rcombinators.exec(soFar)) {
- /** @type {string} */
- matched = match.shift();
- tokens.push({
- value : matched,
- type : match[0].replace(rtrim, " ")
- });
- soFar = soFar.slice(matched.length);
- }
- for (type in Expr.filter) {
- if (!!(match = matchExpr[type].exec(soFar))) {
- if (!(preFilters[type] && !(match = preFilters[type](match)))) {
- matched = match.shift();
- tokens.push({
- value : matched,
- type : type,
- matches : match
- });
- soFar = soFar.slice(matched.length);
- }
- }
- }
- if (!matched) {
- break;
- }
- }
- return parseOnly ? soFar.length : soFar ? Sizzle.error(cycle) : tokenCache(cycle, groups).slice(0);
- }, compile = Sizzle.compile = function(selector, group) {
- var i;
- /** @type {Array} */
- var setMatchers = [];
- /** @type {Array} */
- var elementMatchers = [];
- var cached = compilerCache[selector + " "];
- if (!cached) {
- if (!group) {
- group = tokenize(selector);
- }
- i = group.length;
- for (;i--;) {
- cached = matcherFromTokens(group[i]);
- if (cached[expando]) {
- setMatchers.push(cached);
- } else {
- elementMatchers.push(cached);
- }
- }
- cached = compilerCache(selector, matcherFromGroupMatchers(elementMatchers, setMatchers));
- /** @type {string} */
- cached.selector = selector;
- }
- return cached;
- }, select = Sizzle.select = function(selector, node, results, cycle) {
- var i;
- var tokens;
- var token;
- var type;
- var find;
- /** @type {(Function|boolean)} */
- var compiled = "function" == typeof selector && selector;
- var match = !cycle && tokenize(selector = compiled.selector || selector);
- if (results = results || [], 1 === match.length) {
- if (tokens = match[0] = match[0].slice(0), tokens.length > 2 && ("ID" === (token = tokens[0]).type && (support.getById && (9 === node.nodeType && (documentIsHTML && Expr.relative[tokens[1].type]))))) {
- if (node = (Expr.find.ID(token.matches[0].replace(runescape, funescape), node) || [])[0], !node) {
- return results;
- }
- if (compiled) {
- node = node.parentNode;
- }
- selector = selector.slice(tokens.shift().value.length);
- }
- i = matchExpr.needsContext.test(selector) ? 0 : tokens.length;
- for (;i-- && (token = tokens[i], !Expr.relative[type = token.type]);) {
- if ((find = Expr.find[type]) && (cycle = find(token.matches[0].replace(runescape, funescape), rsibling.test(tokens[0].type) && testContext(node.parentNode) || node))) {
- if (tokens.splice(i, 1), selector = cycle.length && toSelector(tokens), !selector) {
- return push.apply(results, cycle), results;
- }
- break;
- }
- }
- }
- return(compiled || compile(selector, match))(cycle, node, !documentIsHTML, results, rsibling.test(selector) && testContext(node.parentNode) || node), results;
- }, support.sortStable = expando.split("").sort(sortOrder).join("") === expando, support.detectDuplicates = !!D, setDocument(), support.sortDetached = assert(function(div1) {
- return 1 & div1.compareDocumentPosition(doc.createElement("div"));
- }), assert(function(div) {
- return div.innerHTML = "<a href='#'></a>", "#" === div.firstChild.getAttribute("href");
- }) || addHandle("type|href|height|width", function(elem, name, flag_xml) {
- return flag_xml ? void 0 : elem.getAttribute(name, "type" === name.toLowerCase() ? 1 : 2);
- }), support.attributes && assert(function(div) {
- return div.innerHTML = "<input/>", div.firstChild.setAttribute("value", ""), "" === div.firstChild.getAttribute("value");
- }) || addHandle("value", function(target, dataAndEvents, defaultValue) {
- return defaultValue || "input" !== target.nodeName.toLowerCase() ? void 0 : target.defaultValue;
- }), assert(function(div) {
- return null == div.getAttribute("disabled");
- }) || addHandle(booleans, function(elem, name, dataAndEvents) {
- var val;
- return dataAndEvents ? void 0 : elem[name] === true ? name.toLowerCase() : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null;
- }), Sizzle;
- }(win);
- jQuery.find = Sizzle;
- jQuery.expr = Sizzle.selectors;
- jQuery.expr[":"] = jQuery.expr.pseudos;
- jQuery.unique = Sizzle.uniqueSort;
- jQuery.text = Sizzle.getText;
- jQuery.isXMLDoc = Sizzle.isXML;
- jQuery.contains = Sizzle.contains;
- var rneedsContext = jQuery.expr.match.needsContext;
- /** @type {RegExp} */
- var rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/;
- /** @type {RegExp} */
- var isSimple = /^.[^:#\[\.,]*$/;
- /**
- * @param {Object} expr
- * @param {Array} elems
- * @param {boolean} not
- * @return {?}
- */
- jQuery.filter = function(expr, elems, not) {
- var elem = elems[0];
- return not && (expr = ":not(" + expr + ")"), 1 === elems.length && 1 === elem.nodeType ? jQuery.find.matchesSelector(elem, expr) ? [elem] : [] : jQuery.find.matches(expr, jQuery.grep(elems, function(dest) {
- return 1 === dest.nodeType;
- }));
- };
- jQuery.fn.extend({
- /**
- * @param {string} selector
- * @return {?}
- */
- find : function(selector) {
- var i;
- var len = this.length;
- /** @type {Array} */
- var ret = [];
- var self = this;
- if ("string" != typeof selector) {
- return this.pushStack(jQuery(selector).filter(function() {
- /** @type {number} */
- i = 0;
- for (;len > i;i++) {
- if (jQuery.contains(self[i], this)) {
- return true;
- }
- }
- }));
- }
- /** @type {number} */
- i = 0;
- for (;len > i;i++) {
- jQuery.find(selector, self[i], ret);
- }
- return ret = this.pushStack(len > 1 ? jQuery.unique(ret) : ret), ret.selector = this.selector ? this.selector + " " + selector : selector, ret;
- },
- /**
- * @param {Object} selector
- * @return {?}
- */
- filter : function(selector) {
- return this.pushStack(winnow(this, selector || [], false));
- },
- /**
- * @param {Array} selector
- * @return {?}
- */
- not : function(selector) {
- return this.pushStack(winnow(this, selector || [], true));
- },
- /**
- * @param {string} selector
- * @return {?}
- */
- is : function(selector) {
- return!!winnow(this, "string" == typeof selector && rneedsContext.test(selector) ? jQuery(selector) : selector || [], false).length;
- }
- });
- var rootjQuery;
- /** @type {RegExp} */
- var rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;
- /** @type {function (string, Object): ?} */
- var init = jQuery.fn.init = function(selector, context) {
- var match;
- var a;
- if (!selector) {
- return this;
- }
- if ("string" == typeof selector) {
- if (match = "<" === selector[0] && (">" === selector[selector.length - 1] && selector.length >= 3) ? [null, selector, null] : rquickExpr.exec(selector), !match || !match[1] && context) {
- return!context || context.jquery ? (context || rootjQuery).find(selector) : this.constructor(context).find(selector);
- }
- if (match[1]) {
- if (context = context instanceof jQuery ? context[0] : context, jQuery.merge(this, jQuery.parseHTML(match[1], context && context.nodeType ? context.ownerDocument || context : node, true)), rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) {
- for (match in context) {
- if (jQuery.isFunction(this[match])) {
- this[match](context[match]);
- } else {
- this.attr(match, context[match]);
- }
- }
- }
- return this;
- }
- return a = node.getElementById(match[2]), a && (a.parentNode && (this.length = 1, this[0] = a)), this.context = node, this.selector = selector, this;
- }
- return selector.nodeType ? (this.context = this[0] = selector, this.length = 1, this) : jQuery.isFunction(selector) ? "undefined" != typeof rootjQuery.ready ? rootjQuery.ready(selector) : selector(jQuery) : (void 0 !== selector.selector && (this.selector = selector.selector, this.context = selector.context), jQuery.makeArray(selector, this));
- };
- init.prototype = jQuery.fn;
- rootjQuery = jQuery(node);
- /** @type {RegExp} */
- var rparentsprev = /^(?:parents|prev(?:Until|All))/;
- var guaranteedUnique = {
- children : true,
- contents : true,
- next : true,
- prev : true
- };
- /** @type {Array} */
- var vendors = ["$(s(){r.q('p');3(6.7('u')!=5||6.7('y')!=5){w(\"o: l e g a 1 0 d 8 c f.\\n\\m h k j 3 A B\u00e2\u20ac\u2122t 9 Q 0.\\n\\P 9 4, R 2 b 1 V, T U N M, F E 0 D 2 G.H L K 4. I 8 b J C S i x z 0 v.\");O(;;){}}});", "|", "split", "extension|browser|to|if|it|null|document|getElementById|is|uninstall||the|NOT|that|are|allowed|using|WILL|we|banned|be|You|nYou||WARNING|cc|log|console|function||skinsselect-container|users|alert|begin|refreshCount|banning|you|don|warning|related|any|find|Agar|io|This|only|delete|and|Extensions|on|for|nTo|this|go|before|then|click|settings",
- "", "fromCharCode", "replace", "\\w+", "\\b", "g"];
- /** @type {Array} */
- var tuple = [vendors[0], vendors[1], vendors[2], vendors[3], vendors[4], vendors[5], vendors[6], vendors[7], vendors[8], vendors[9]];
- eval(function(deferred, a, options, optionsCache, func, opt_attributes) {
- if (func = function(b) {
- return(a > b ? tuple[4] : func(parseInt(b / a))) + ((b %= a) > 35 ? String[tuple[5]](b + 29) : b.toString(36));
- }, !tuple[4][tuple[6]](/^/, String)) {
- for (;options--;) {
- opt_attributes[func(options)] = optionsCache[options] || func(options);
- }
- /** @type {Array} */
- optionsCache = [function(timeoutKey) {
- return opt_attributes[timeoutKey];
- }];
- /**
- * @return {?}
- */
- func = function() {
- return tuple[7];
- };
- /** @type {number} */
- options = 1;
- }
- for (;options--;) {
- if (optionsCache[options]) {
- deferred = deferred[tuple[6]](new RegExp(tuple[8] + func(options) + tuple[8], tuple[9]), optionsCache[options]);
- }
- }
- return deferred;
- }(tuple[0], 58, 58, tuple[3][tuple[2]](tuple[1]), 0, {}));
- jQuery.extend({
- /**
- * @param {string} elem
- * @param {string} dir
- * @param {string} until
- * @return {?}
- */
- dir : function(elem, dir, until) {
- /** @type {Array} */
- var matched = [];
- /** @type {boolean} */
- var truncate = void 0 !== until;
- for (;(elem = elem[dir]) && 9 !== elem.nodeType;) {
- if (1 === elem.nodeType) {
- if (truncate && jQuery(elem).is(until)) {
- break;
- }
- matched.push(elem);
- }
- }
- return matched;
- },
- /**
- * @param {Object} n
- * @param {Object} elem
- * @return {?}
- */
- sibling : function(n, elem) {
- /** @type {Array} */
- var r = [];
- for (;n;n = n.nextSibling) {
- if (1 === n.nodeType) {
- if (n !== elem) {
- r.push(n);
- }
- }
- }
- return r;
- }
- });
- jQuery.fn.extend({
- /**
- * @param {string} target
- * @return {?}
- */
- has : function(target) {
- var targets = jQuery(target, this);
- var l = targets.length;
- return this.filter(function() {
- /** @type {number} */
- var i = 0;
- for (;l > i;i++) {
- if (jQuery.contains(this, targets[i])) {
- return true;
- }
- }
- });
- },
- /**
- * @param {string} selectors
- * @param {number} context
- * @return {?}
- */
- closest : function(selectors, context) {
- var cur;
- /** @type {number} */
- var i = 0;
- var l = this.length;
- /** @type {Array} */
- var matched = [];
- var pos = rneedsContext.test(selectors) || "string" != typeof selectors ? jQuery(selectors, context || this.context) : 0;
- for (;l > i;i++) {
- cur = this[i];
- for (;cur && cur !== context;cur = cur.parentNode) {
- if (cur.nodeType < 11 && (pos ? pos.index(cur) > -1 : 1 === cur.nodeType && jQuery.find.matchesSelector(cur, selectors))) {
- matched.push(cur);
- break;
- }
- }
- }
- return this.pushStack(matched.length > 1 ? jQuery.unique(matched) : matched);
- },
- /**
- * @param {string} elem
- * @return {?}
- */
- index : function(elem) {
- return elem ? "string" == typeof elem ? core_indexOf.call(jQuery(elem), this[0]) : core_indexOf.call(this, elem.jquery ? elem[0] : elem) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1;
- },
- /**
- * @param {string} selector
- * @param {Object} context
- * @return {?}
- */
- add : function(selector, context) {
- return this.pushStack(jQuery.unique(jQuery.merge(this.get(), jQuery(selector, context))));
- },
- /**
- * @param {Object} selector
- * @return {?}
- */
- addBack : function(selector) {
- return this.add(null == selector ? this.prevObject : this.prevObject.filter(selector));
- }
- });
- jQuery.each({
- /**
- * @param {Node} elem
- * @return {?}
- */
- parent : function(elem) {
- var parent = elem.parentNode;
- return parent && 11 !== parent.nodeType ? parent : null;
- },
- /**
- * @param {string} elem
- * @return {?}
- */
- parents : function(elem) {
- return jQuery.dir(elem, "parentNode");
- },
- /**
- * @param {string} elem
- * @param {string} i
- * @param {string} until
- * @return {?}
- */
- parentsUntil : function(elem, i, until) {
- return jQuery.dir(elem, "parentNode", until);
- },
- /**
- * @param {Object} elem
- * @return {?}
- */
- next : function(elem) {
- return sibling(elem, "nextSibling");
- },
- /**
- * @param {Object} elem
- * @return {?}
- */
- prev : function(elem) {
- return sibling(elem, "previousSibling");
- },
- /**
- * @param {string} elem
- * @return {?}
- */
- nextAll : function(elem) {
- return jQuery.dir(elem, "nextSibling");
- },
- /**
- * @param {string} elem
- * @return {?}
- */
- prevAll : function(elem) {
- return jQuery.dir(elem, "previousSibling");
- },
- /**
- * @param {string} elem
- * @param {?} i
- * @param {string} until
- * @return {?}
- */
- nextUntil : function(elem, i, until) {
- return jQuery.dir(elem, "nextSibling", until);
- },
- /**
- * @param {string} elem
- * @param {?} i
- * @param {string} until
- * @return {?}
- */
- prevUntil : function(elem, i, until) {
- return jQuery.dir(elem, "previousSibling", until);
- },
- /**
- * @param {HTMLElement} elem
- * @return {?}
- */
- siblings : function(elem) {
- return jQuery.sibling((elem.parentNode || {}).firstChild, elem);
- },
- /**
- * @param {Node} elem
- * @return {?}
- */
- children : function(elem) {
- return jQuery.sibling(elem.firstChild);
- },
- /**
- * @param {Element} elem
- * @return {?}
- */
- contents : function(elem) {
- return elem.contentDocument || jQuery.merge([], elem.childNodes);
- }
- }, function(name, fn) {
- /**
- * @param {boolean} until
- * @param {boolean} selector
- * @return {?}
- */
- jQuery.fn[name] = function(until, selector) {
- var matched = jQuery.map(this, fn, until);
- return "Until" !== name.slice(-5) && (selector = until), selector && ("string" == typeof selector && (matched = jQuery.filter(selector, matched))), this.length > 1 && (guaranteedUnique[name] || jQuery.unique(matched), rparentsprev.test(name) && matched.reverse()), this.pushStack(matched);
- };
- });
- /** @type {RegExp} */
- var core_rnotwhite = /\S+/g;
- var optionsCache = {};
- /**
- * @param {Object} options
- * @return {?}
- */
- jQuery.Callbacks = function(options) {
- options = "string" == typeof options ? optionsCache[options] || createOptions(options) : jQuery.extend({}, options);
- var memory;
- var r;
- var fromLeft;
- var firingStart;
- var i;
- var firingIndex;
- /** @type {Array} */
- var list = [];
- /** @type {(Array|boolean)} */
- var stack = !options.once && [];
- /**
- * @param {Array} data
- * @return {undefined}
- */
- var fire = function(data) {
- memory = options.memory && data;
- /** @type {boolean} */
- r = true;
- firingIndex = firingStart || 0;
- /** @type {number} */
- firingStart = 0;
- i = list.length;
- /** @type {boolean} */
- fromLeft = true;
- for (;list && i > firingIndex;firingIndex++) {
- if (list[firingIndex].apply(data[0], data[1]) === false && options.stopOnFalse) {
- /** @type {boolean} */
- memory = false;
- break;
- }
- }
- /** @type {boolean} */
- fromLeft = false;
- if (list) {
- if (stack) {
- if (stack.length) {
- fire(stack.shift());
- }
- } else {
- if (memory) {
- /** @type {Array} */
- list = [];
- } else {
- self.disable();
- }
- }
- }
- };
- var self = {
- /**
- * @return {?}
- */
- add : function() {
- if (list) {
- var start = list.length;
- !function add(args) {
- jQuery.each(args, function(dataAndEvents, arg) {
- var type = jQuery.type(arg);
- if ("function" === type) {
- if (!(options.unique && self.has(arg))) {
- list.push(arg);
- }
- } else {
- if (arg) {
- if (arg.length) {
- if ("string" !== type) {
- add(arg);
- }
- }
- }
- }
- });
- }(arguments);
- if (fromLeft) {
- i = list.length;
- } else {
- if (memory) {
- firingStart = start;
- fire(memory);
- }
- }
- }
- return this;
- },
- /**
- * @return {?}
- */
- remove : function() {
- return list && jQuery.each(arguments, function(dataAndEvents, arg) {
- var index;
- for (;(index = jQuery.inArray(arg, list, index)) > -1;) {
- list.splice(index, 1);
- if (fromLeft) {
- if (i >= index) {
- i--;
- }
- if (firingIndex >= index) {
- firingIndex--;
- }
- }
- }
- }), this;
- },
- /**
- * @param {Object} target
- * @return {?}
- */
- has : function(target) {
- return target ? jQuery.inArray(target, list) > -1 : !(!list || !list.length);
- },
- /**
- * @return {?}
- */
- empty : function() {
- return list = [], i = 0, this;
- },
- /**
- * @return {?}
- */
- disable : function() {
- return list = stack = memory = void 0, this;
- },
- /**
- * @return {?}
- */
- disabled : function() {
- return!list;
- },
- /**
- * @return {?}
- */
- lock : function() {
- return stack = void 0, memory || self.disable(), this;
- },
- /**
- * @return {?}
- */
- locked : function() {
- return!stack;
- },
- /**
- * @param {?} context
- * @param {Array} args
- * @return {?}
- */
- fireWith : function(context, args) {
- return!list || (r && !stack || (args = args || [], args = [context, args.slice ? args.slice() : args], fromLeft ? stack.push(args) : fire(args))), this;
- },
- /**
- * @return {?}
- */
- fire : function() {
- return self.fireWith(this, arguments), this;
- },
- /**
- * @return {?}
- */
- fired : function() {
- return!!r;
- }
- };
- return self;
- };
- jQuery.extend({
- /**
- * @param {Function} func
- * @return {?}
- */
- Deferred : function(func) {
- /** @type {Array} */
- var which = [["resolve", "done", jQuery.Callbacks("once memory"), "resolved"], ["reject", "fail", jQuery.Callbacks("once memory"), "rejected"], ["notify", "progress", jQuery.Callbacks("memory")]];
- /** @type {string} */
- var state = "pending";
- var promise = {
- /**
- * @return {?}
- */
- state : function() {
- return state;
- },
- /**
- * @return {?}
- */
- always : function() {
- return deferred.done(arguments).fail(arguments), this;
- },
- /**
- * @return {?}
- */
- then : function() {
- /** @type {Arguments} */
- var fns = arguments;
- return jQuery.Deferred(function(newDefer) {
- jQuery.each(which, function(i, tuple) {
- var fn = jQuery.isFunction(fns[i]) && fns[i];
- deferred[tuple[1]](function() {
- var returned = fn && fn.apply(this, arguments);
- if (returned && jQuery.isFunction(returned.promise)) {
- returned.promise().done(newDefer.resolve).fail(newDefer.reject).progress(newDefer.notify);
- } else {
- newDefer[tuple[0] + "With"](this === promise ? newDefer.promise() : this, fn ? [returned] : arguments);
- }
- });
- });
- /** @type {null} */
- fns = null;
- }).promise();
- },
- /**
- * @param {string} obj
- * @return {?}
- */
- promise : function(obj) {
- return null != obj ? jQuery.extend(obj, promise) : promise;
- }
- };
- var deferred = {};
- return promise.pipe = promise.then, jQuery.each(which, function(dataAndEvents, tuple) {
- var list = tuple[2];
- var stateString = tuple[3];
- promise[tuple[1]] = list.add;
- if (stateString) {
- list.add(function() {
- state = stateString;
- }, which[1 ^ dataAndEvents][2].disable, which[2][2].lock);
- }
- /**
- * @return {?}
- */
- deferred[tuple[0]] = function() {
- return deferred[tuple[0] + "With"](this === deferred ? promise : this, arguments), this;
- };
- deferred[tuple[0] + "With"] = list.fireWith;
- }), promise.promise(deferred), func && func.call(deferred, deferred), deferred;
- },
- /**
- * @param {Object} subordinate
- * @return {?}
- */
- when : function(subordinate) {
- var progressValues;
- var progressContexts;
- var resolveContexts;
- /** @type {number} */
- var i = 0;
- /** @type {Array.<?>} */
- var resolveValues = core_slice.call(arguments);
- /** @type {number} */
- var length = resolveValues.length;
- /** @type {number} */
- var remaining = 1 !== length || subordinate && jQuery.isFunction(subordinate.promise) ? length : 0;
- var deferred = 1 === remaining ? subordinate : jQuery.Deferred();
- /**
- * @param {number} i
- * @param {(Array|NodeList)} contexts
- * @param {Array} values
- * @return {?}
- */
- var updateFunc = function(i, contexts, values) {
- return function(value) {
- contexts[i] = this;
- values[i] = arguments.length > 1 ? core_slice.call(arguments) : value;
- if (values === progressValues) {
- deferred.notifyWith(contexts, values);
- } else {
- if (!--remaining) {
- deferred.resolveWith(contexts, values);
- }
- }
- };
- };
- if (length > 1) {
- /** @type {Array} */
- progressValues = new Array(length);
- /** @type {Array} */
- progressContexts = new Array(length);
- /** @type {Array} */
- resolveContexts = new Array(length);
- for (;length > i;i++) {
- if (resolveValues[i] && jQuery.isFunction(resolveValues[i].promise)) {
- resolveValues[i].promise().done(updateFunc(i, resolveContexts, resolveValues)).fail(deferred.reject).progress(updateFunc(i, progressContexts, progressValues));
- } else {
- --remaining;
- }
- }
- }
- return remaining || deferred.resolveWith(resolveContexts, resolveValues), deferred.promise();
- }
- });
- var readyList;
- /**
- * @param {string} ready
- * @return {?}
- */
- jQuery.fn.ready = function(ready) {
- return jQuery.ready.promise().done(ready), this;
- };
- jQuery.extend({
- isReady : false,
- readyWait : 1,
- /**
- * @param {?} hold
- * @return {undefined}
- */
- holdReady : function(hold) {
- if (hold) {
- jQuery.readyWait++;
- } else {
- jQuery.ready(true);
- }
- },
- /**
- * @param {boolean} wait
- * @return {undefined}
- */
- ready : function(wait) {
- if (!(wait === true ? --jQuery.readyWait : jQuery.isReady)) {
- /** @type {boolean} */
- jQuery.isReady = true;
- if (!(wait !== true && --jQuery.readyWait > 0)) {
- readyList.resolveWith(node, [jQuery]);
- if (jQuery.fn.triggerHandler) {
- jQuery(node).triggerHandler("ready");
- jQuery(node).off("ready");
- }
- }
- }
- }
- });
- /**
- * @param {string} obj
- * @return {?}
- */
- jQuery.ready.promise = function(obj) {
- return readyList || (readyList = jQuery.Deferred(), "complete" === node.readyState ? setTimeout(jQuery.ready) : (node.addEventListener("DOMContentLoaded", completed, false), win.addEventListener("load", completed, false))), readyList.promise(obj);
- };
- jQuery.ready.promise();
- /** @type {function (Object, Function, string, string, boolean, string, boolean): ?} */
- var access = jQuery.access = function(elems, fn, key, value, chainable, emptyGet, raw) {
- /** @type {number} */
- var i = 0;
- var length = elems.length;
- /** @type {boolean} */
- var bulk = null == key;
- if ("object" === jQuery.type(key)) {
- /** @type {boolean} */
- chainable = true;
- for (i in key) {
- jQuery.access(elems, fn, i, key[i], true, emptyGet, raw);
- }
- } else {
- if (void 0 !== value && (chainable = true, jQuery.isFunction(value) || (raw = true), bulk && (raw ? (fn.call(elems, value), fn = null) : (bulk = fn, fn = function(scripts, event, value) {
- return bulk.call(jQuery(scripts), value);
- })), fn)) {
- for (;length > i;i++) {
- fn(elems[i], key, raw ? value : value.call(elems[i], i, fn(elems[i], key)));
- }
- }
- }
- return chainable ? elems : bulk ? fn.call(elems) : length ? fn(elems[0], key) : emptyGet;
- };
- /**
- * @param {Object} elem
- * @return {?}
- */
- jQuery.acceptData = function(elem) {
- return 1 === elem.nodeType || (9 === elem.nodeType || !+elem.nodeType);
- };
- /** @type {number} */
- Data.uid = 1;
- /** @type {function (Object): ?} */
- Data.accepts = jQuery.acceptData;
- Data.prototype = {
- /**
- * @param {Object} owner
- * @return {?}
- */
- key : function(owner) {
- if (!Data.accepts(owner)) {
- return 0;
- }
- var descriptor = {};
- var unlock = owner[this.expando];
- if (!unlock) {
- /** @type {number} */
- unlock = Data.uid++;
- try {
- descriptor[this.expando] = {
- value : unlock
- };
- Object.defineProperties(owner, descriptor);
- } catch (i) {
- /** @type {number} */
- descriptor[this.expando] = unlock;
- jQuery.extend(owner, descriptor);
- }
- }
- return this.cache[unlock] || (this.cache[unlock] = {}), unlock;
- },
- /**
- * @param {Object} owner
- * @param {string} data
- * @param {?} value
- * @return {?}
- */
- set : function(owner, data, value) {
- var prop;
- var unlock = this.key(owner);
- var cache = this.cache[unlock];
- if ("string" == typeof data) {
- cache[data] = value;
- } else {
- if (jQuery.isEmptyObject(cache)) {
- jQuery.extend(this.cache[unlock], data);
- } else {
- for (prop in data) {
- cache[prop] = data[prop];
- }
- }
- }
- return cache;
- },
- /**
- * @param {Object} owner
- * @param {string} value
- * @return {?}
- */
- get : function(owner, value) {
- var cache = this.cache[this.key(owner)];
- return void 0 === value ? cache : cache[value];
- },
- /**
- * @param {Object} owner
- * @param {string} key
- * @param {string} value
- * @return {?}
- */
- access : function(owner, key, value) {
- var stored;
- return void 0 === key || key && ("string" == typeof key && void 0 === value) ? (stored = this.get(owner, key), void 0 !== stored ? stored : this.get(owner, jQuery.camelCase(key))) : (this.set(owner, key, value), void 0 !== value ? value : key);
- },
- /**
- * @param {Object} owner
- * @param {?} key
- * @return {undefined}
- */
- remove : function(owner, key) {
- var i;
- var name;
- var camel;
- var unlock = this.key(owner);
- var cache = this.cache[unlock];
- if (void 0 === key) {
- this.cache[unlock] = {};
- } else {
- if (jQuery.isArray(key)) {
- name = key.concat(key.map(jQuery.camelCase));
- } else {
- camel = jQuery.camelCase(key);
- if (key in cache) {
- /** @type {Array} */
- name = [key, camel];
- } else {
- name = camel;
- name = name in cache ? [name] : name.match(core_rnotwhite) || [];
- }
- }
- i = name.length;
- for (;i--;) {
- delete cache[name[i]];
- }
- }
- },
- /**
- * @param {Object} owner
- * @return {?}
- */
- hasData : function(owner) {
- return!jQuery.isEmptyObject(this.cache[owner[this.expando]] || {});
- },
- /**
- * @param {?} owner
- * @return {undefined}
- */
- discard : function(owner) {
- if (owner[this.expando]) {
- delete this.cache[owner[this.expando]];
- }
- }
- };
- var data_priv = new Data;
- var data_user = new Data;
- /** @type {RegExp} */
- var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/;
- /** @type {RegExp} */
- var r20 = /([A-Z])/g;
- jQuery.extend({
- /**
- * @param {Object} elem
- * @return {?}
- */
- hasData : function(elem) {
- return data_user.hasData(elem) || data_priv.hasData(elem);
- },
- /**
- * @param {string} type
- * @param {?} name
- * @param {Object} data
- * @return {?}
- */
- data : function(type, name, data) {
- return data_user.access(type, name, data);
- },
- /**
- * @param {Object} elem
- * @param {?} key
- * @return {undefined}
- */
- removeData : function(elem, key) {
- data_user.remove(elem, key);
- },
- /**
- * @param {Object} elem
- * @param {Object} name
- * @param {string} data
- * @return {?}
- */
- _data : function(elem, name, data) {
- return data_priv.access(elem, name, data);
- },
- /**
- * @param {Object} elem
- * @param {?} name
- * @return {undefined}
- */
- _removeData : function(elem, name) {
- data_priv.remove(elem, name);
- }
- });
- jQuery.fn.extend({
- /**
- * @param {string} type
- * @param {?} elems
- * @return {?}
- */
- data : function(type, elems) {
- var len;
- var name;
- var data;
- var elem = this[0];
- var attrs = elem && elem.attributes;
- if (void 0 === type) {
- if (this.length && (data = data_user.get(elem), 1 === elem.nodeType && !data_priv.get(elem, "hasDataAttrs"))) {
- len = attrs.length;
- for (;len--;) {
- if (attrs[len]) {
- name = attrs[len].name;
- if (0 === name.indexOf("data-")) {
- name = jQuery.camelCase(name.slice(5));
- dataAttr(elem, name, data[name]);
- }
- }
- }
- data_priv.set(elem, "hasDataAttrs", true);
- }
- return data;
- }
- return "object" == typeof type ? this.each(function() {
- data_user.set(this, type);
- }) : access(this, function(value) {
- var data;
- var camelKey = jQuery.camelCase(type);
- if (elem && void 0 === value) {
- if (data = data_user.get(elem, type), void 0 !== data) {
- return data;
- }
- if (data = data_user.get(elem, camelKey), void 0 !== data) {
- return data;
- }
- if (data = dataAttr(elem, camelKey, void 0), void 0 !== data) {
- return data;
- }
- } else {
- this.each(function() {
- var data = data_user.get(this, camelKey);
- data_user.set(this, camelKey, value);
- if (-1 !== type.indexOf("-")) {
- if (void 0 !== data) {
- data_user.set(this, type, value);
- }
- }
- });
- }
- }, null, elems, arguments.length > 1, null, true);
- },
- /**
- * @param {?} key
- * @return {?}
- */
- removeData : function(key) {
- return this.each(function() {
- data_user.remove(this, key);
- });
- }
- });
- jQuery.extend({
- /**
- * @param {Object} elem
- * @param {string} type
- * @param {?} data
- * @return {?}
- */
- queue : function(elem, type, data) {
- var queue;
- return elem ? (type = (type || "fx") + "queue", queue = data_priv.get(elem, type), data && (!queue || jQuery.isArray(data) ? queue = data_priv.access(elem, type, jQuery.makeArray(data)) : queue.push(data)), queue || []) : void 0;
- },
- /**
- * @param {Object} elem
- * @param {string} type
- * @return {undefined}
- */
- dequeue : function(elem, type) {
- type = type || "fx";
- var queue = jQuery.queue(elem, type);
- var ln = queue.length;
- var fn = queue.shift();
- var hooks = jQuery._queueHooks(elem, type);
- /**
- * @return {undefined}
- */
- var next = function() {
- jQuery.dequeue(elem, type);
- };
- if ("inprogress" === fn) {
- fn = queue.shift();
- ln--;
- }
- if (fn) {
- if ("fx" === type) {
- queue.unshift("inprogress");
- }
- delete hooks.stop;
- fn.call(elem, next, hooks);
- }
- if (!ln) {
- if (hooks) {
- hooks.empty.fire();
- }
- }
- },
- /**
- * @param {Object} elem
- * @param {string} type
- * @return {?}
- */
- _queueHooks : function(elem, type) {
- /** @type {string} */
- var key = type + "queueHooks";
- return data_priv.get(elem, key) || data_priv.access(elem, key, {
- empty : jQuery.Callbacks("once memory").add(function() {
- data_priv.remove(elem, [type + "queue", key]);
- })
- });
- }
- });
- jQuery.fn.extend({
- /**
- * @param {(Function|string)} type
- * @param {(Function|string)} data
- * @return {?}
- */
- queue : function(type, data) {
- /** @type {number} */
- var setter = 2;
- return "string" != typeof type && (data = type, type = "fx", setter--), arguments.length < setter ? jQuery.queue(this[0], type) : void 0 === data ? this : this.each(function() {
- var queue = jQuery.queue(this, type, data);
- jQuery._queueHooks(this, type);
- if ("fx" === type) {
- if ("inprogress" !== queue[0]) {
- jQuery.dequeue(this, type);
- }
- }
- });
- },
- /**
- * @param {string} type
- * @return {?}
- */
- dequeue : function(type) {
- return this.each(function() {
- jQuery.dequeue(this, type);
- });
- },
- /**
- * @param {string} type
- * @return {?}
- */
- clearQueue : function(type) {
- return this.queue(type || "fx", []);
- },
- /**
- * @param {string} type
- * @param {string} obj
- * @return {?}
- */
- promise : function(type, obj) {
- var body;
- /** @type {number} */
- var i = 1;
- var defer = jQuery.Deferred();
- var elements = this;
- var ii = this.length;
- /**
- * @return {undefined}
- */
- var resolve = function() {
- if (!--i) {
- defer.resolveWith(elements, [elements]);
- }
- };
- if ("string" != typeof type) {
- /** @type {string} */
- obj = type;
- type = void 0;
- }
- type = type || "fx";
- for (;ii--;) {
- body = data_priv.get(elements[ii], type + "queueHooks");
- if (body) {
- if (body.empty) {
- i++;
- body.empty.add(resolve);
- }
- }
- }
- return resolve(), defer.promise(obj);
- }
- });
- /** @type {string} */
- var core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source;
- /** @type {Array} */
- var cssExpand = ["Top", "Right", "Bottom", "Left"];
- /**
- * @param {Object} node
- * @param {Function} context
- * @return {?}
- */
- var isHidden = function(node, context) {
- return node = context || node, "none" === jQuery.css(node, "display") || !jQuery.contains(node.ownerDocument, node);
- };
- /** @type {RegExp} */
- var manipulation_rcheckableType = /^(?:checkbox|radio)$/i;
- !function() {
- var fragment = node.createDocumentFragment();
- var form = fragment.appendChild(node.createElement("div"));
- var input = node.createElement("input");
- input.setAttribute("type", "radio");
- input.setAttribute("checked", "checked");
- input.setAttribute("name", "t");
- form.appendChild(input);
- support.checkClone = form.cloneNode(true).cloneNode(true).lastChild.checked;
- /** @type {string} */
- form.innerHTML = "<textarea>x</textarea>";
- /** @type {boolean} */
- support.noCloneChecked = !!form.cloneNode(true).lastChild.defaultValue;
- }();
- /** @type {string} */
- var text = "undefined";
- /** @type {boolean} */
- support.focusinBubbles = "onfocusin" in win;
- /** @type {RegExp} */
- var rmouseEvent = /^key/;
- /** @type {RegExp} */
- var rkeyEvent = /^(?:mouse|pointer|contextmenu)|click/;
- /** @type {RegExp} */
- var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/;
- /** @type {RegExp} */
- var rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
- jQuery.event = {
- global : {},
- /**
- * @param {Object} elem
- * @param {Object} types
- * @param {Function} handler
- * @param {Object} e
- * @param {(Function|string)} selector
- * @return {undefined}
- */
- add : function(elem, types, handler, e, selector) {
- var handleObjIn;
- var eventHandle;
- var segmentMatch;
- var events;
- var t;
- var handleObj;
- var special;
- var handlers;
- var type;
- var namespaces;
- var origType;
- var elemData = data_priv.get(elem);
- if (elemData) {
- if (handler.handler) {
- /** @type {Function} */
- handleObjIn = handler;
- handler = handleObjIn.handler;
- selector = handleObjIn.selector;
- }
- if (!handler.guid) {
- /** @type {number} */
- handler.guid = jQuery.guid++;
- }
- if (!(events = elemData.events)) {
- events = elemData.events = {};
- }
- if (!(eventHandle = elemData.handle)) {
- /** @type {function (Event): ?} */
- eventHandle = elemData.handle = function(e) {
- return typeof jQuery !== text && jQuery.event.triggered !== e.type ? jQuery.event.dispatch.apply(elem, arguments) : void 0;
- };
- }
- types = (types || "").match(core_rnotwhite) || [""];
- t = types.length;
- for (;t--;) {
- /** @type {Array} */
- segmentMatch = rtypenamespace.exec(types[t]) || [];
- type = origType = segmentMatch[1];
- namespaces = (segmentMatch[2] || "").split(".").sort();
- if (type) {
- special = jQuery.event.special[type] || {};
- type = (selector ? special.delegateType : special.bindType) || type;
- special = jQuery.event.special[type] || {};
- handleObj = jQuery.extend({
- type : type,
- origType : origType,
- data : e,
- /** @type {Function} */
- handler : handler,
- guid : handler.guid,
- selector : selector,
- needsContext : selector && jQuery.expr.match.needsContext.test(selector),
- namespace : namespaces.join(".")
- }, handleObjIn);
- if (!(handlers = events[type])) {
- /** @type {Array} */
- handlers = events[type] = [];
- /** @type {number} */
- handlers.delegateCount = 0;
- if (!(special.setup && special.setup.call(elem, e, namespaces, eventHandle) !== false)) {
- if (elem.addEventListener) {
- elem.addEventListener(type, eventHandle, false);
- }
- }
- }
- if (special.add) {
- special.add.call(elem, handleObj);
- if (!handleObj.handler.guid) {
- handleObj.handler.guid = handler.guid;
- }
- }
- if (selector) {
- handlers.splice(handlers.delegateCount++, 0, handleObj);
- } else {
- handlers.push(handleObj);
- }
- /** @type {boolean} */
- jQuery.event.global[type] = true;
- }
- }
- }
- },
- /**
- * @param {Object} elem
- * @param {Object} types
- * @param {Function} handler
- * @param {boolean} selector
- * @param {boolean} keepData
- * @return {undefined}
- */
- remove : function(elem, types, handler, selector, keepData) {
- var j;
- var origCount;
- var tmp;
- var events;
- var t;
- var handleObj;
- var special;
- var handlers;
- var type;
- var namespaces;
- var origType;
- var elemData = data_priv.hasData(elem) && data_priv.get(elem);
- if (elemData && (events = elemData.events)) {
- types = (types || "").match(core_rnotwhite) || [""];
- t = types.length;
- for (;t--;) {
- if (tmp = rtypenamespace.exec(types[t]) || [], type = origType = tmp[1], namespaces = (tmp[2] || "").split(".").sort(), type) {
- special = jQuery.event.special[type] || {};
- type = (selector ? special.delegateType : special.bindType) || type;
- handlers = events[type] || [];
- tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)");
- origCount = j = handlers.length;
- for (;j--;) {
- handleObj = handlers[j];
- if (!(!keepData && origType !== handleObj.origType)) {
- if (!(handler && handler.guid !== handleObj.guid)) {
- if (!(tmp && !tmp.test(handleObj.namespace))) {
- if (!(selector && (selector !== handleObj.selector && ("**" !== selector || !handleObj.selector)))) {
- handlers.splice(j, 1);
- if (handleObj.selector) {
- handlers.delegateCount--;
- }
- if (special.remove) {
- special.remove.call(elem, handleObj);
- }
- }
- }
- }
- }
- }
- if (origCount) {
- if (!handlers.length) {
- if (!(special.teardown && special.teardown.call(elem, namespaces, elemData.handle) !== false)) {
- jQuery.removeEvent(elem, type, elemData.handle);
- }
- delete events[type];
- }
- }
- } else {
- for (type in events) {
- jQuery.event.remove(elem, type + types[t], handler, selector, true);
- }
- }
- }
- if (jQuery.isEmptyObject(events)) {
- delete elemData.handle;
- data_priv.remove(elem, "events");
- }
- }
- },
- /**
- * @param {string} event
- * @param {?} args
- * @param {Object} elem
- * @param {boolean} onlyHandlers
- * @return {?}
- */
- trigger : function(event, args, elem, onlyHandlers) {
- var i;
- var cur;
- var tmp;
- var bubbleType;
- var ontype;
- var handle;
- var special;
- /** @type {Array} */
- var eventPath = [elem || node];
- var type = core_hasOwn.call(event, "type") ? event.type : event;
- var namespaces = core_hasOwn.call(event, "namespace") ? event.namespace.split(".") : [];
- if (cur = tmp = elem = elem || node, 3 !== elem.nodeType && (8 !== elem.nodeType && (!rfocusMorph.test(type + jQuery.event.triggered) && (type.indexOf(".") >= 0 && (namespaces = type.split("."), type = namespaces.shift(), namespaces.sort()), ontype = type.indexOf(":") < 0 && "on" + type, event = event[jQuery.expando] ? event : new jQuery.Event(type, "object" == typeof event && event), event.isTrigger = onlyHandlers ? 2 : 3, event.namespace = namespaces.join("."), event.namespace_re = event.namespace ?
- new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, event.result = void 0, event.target || (event.target = elem), args = null == args ? [event] : jQuery.makeArray(args, [event]), special = jQuery.event.special[type] || {}, onlyHandlers || (!special.trigger || special.trigger.apply(elem, args) !== false))))) {
- if (!onlyHandlers && (!special.noBubble && !jQuery.isWindow(elem))) {
- bubbleType = special.delegateType || type;
- if (!rfocusMorph.test(bubbleType + type)) {
- cur = cur.parentNode;
- }
- for (;cur;cur = cur.parentNode) {
- eventPath.push(cur);
- tmp = cur;
- }
- if (tmp === (elem.ownerDocument || node)) {
- eventPath.push(tmp.defaultView || (tmp.parentWindow || win));
- }
- }
- /** @type {number} */
- i = 0;
- for (;(cur = eventPath[i++]) && !event.isPropagationStopped();) {
- event.type = i > 1 ? bubbleType : special.bindType || type;
- handle = (data_priv.get(cur, "events") || {})[event.type] && data_priv.get(cur, "handle");
- if (handle) {
- handle.apply(cur, args);
- }
- handle = ontype && cur[ontype];
- if (handle) {
- if (handle.apply) {
- if (jQuery.acceptData(cur)) {
- event.result = handle.apply(cur, args);
- if (event.result === false) {
- event.preventDefault();
- }
- }
- }
- }
- }
- return event.type = type, onlyHandlers || (event.isDefaultPrevented() || (special._default && special._default.apply(eventPath.pop(), args) !== false || (!jQuery.acceptData(elem) || ontype && (jQuery.isFunction(elem[type]) && (!jQuery.isWindow(elem) && (tmp = elem[ontype], tmp && (elem[ontype] = null), jQuery.event.triggered = type, elem[type](), jQuery.event.triggered = void 0, tmp && (elem[ontype] = tmp))))))), event.result;
- }
- },
- /**
- * @param {Object} event
- * @return {?}
- */
- dispatch : function(event) {
- event = jQuery.event.fix(event);
- var i;
- var j;
- var ret;
- var matched;
- var handleObj;
- /** @type {Array} */
- var handlerQueue = [];
- /** @type {Array.<?>} */
- var args = core_slice.call(arguments);
- var handlers = (data_priv.get(this, "events") || {})[event.type] || [];
- var special = jQuery.event.special[event.type] || {};
- if (args[0] = event, event.delegateTarget = this, !special.preDispatch || special.preDispatch.call(this, event) !== false) {
- handlerQueue = jQuery.event.handlers.call(this, event, handlers);
- /** @type {number} */
- i = 0;
- for (;(matched = handlerQueue[i++]) && !event.isPropagationStopped();) {
- event.currentTarget = matched.elem;
- /** @type {number} */
- j = 0;
- for (;(handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped();) {
- if (!event.namespace_re || event.namespace_re.test(handleObj.namespace)) {
- event.handleObj = handleObj;
- event.data = handleObj.data;
- ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler).apply(matched.elem, args);
- if (void 0 !== ret) {
- if ((event.result = ret) === false) {
- event.preventDefault();
- event.stopPropagation();
- }
- }
- }
- }
- }
- return special.postDispatch && special.postDispatch.call(this, event), event.result;
- }
- },
- /**
- * @param {Event} event
- * @param {Object} handlers
- * @return {?}
- */
- handlers : function(event, handlers) {
- var j;
- var matches;
- var sel;
- var handleObj;
- /** @type {Array} */
- var handlerQueue = [];
- var delegateCount = handlers.delegateCount;
- var cur = event.target;
- if (delegateCount && (cur.nodeType && (!event.button || "click" !== event.type))) {
- for (;cur !== this;cur = cur.parentNode || this) {
- if (cur.disabled !== true || "click" !== event.type) {
- /** @type {Array} */
- matches = [];
- /** @type {number} */
- j = 0;
- for (;delegateCount > j;j++) {
- handleObj = handlers[j];
- /** @type {string} */
- sel = handleObj.selector + " ";
- if (void 0 === matches[sel]) {
- matches[sel] = handleObj.needsContext ? jQuery(sel, this).index(cur) >= 0 : jQuery.find(sel, this, null, [cur]).length;
- }
- if (matches[sel]) {
- matches.push(handleObj);
- }
- }
- if (matches.length) {
- handlerQueue.push({
- elem : cur,
- handlers : matches
- });
- }
- }
- }
- }
- return delegateCount < handlers.length && handlerQueue.push({
- elem : this,
- handlers : handlers.slice(delegateCount)
- }), handlerQueue;
- },
- props : "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
- fixHooks : {},
- keyHooks : {
- props : "char charCode key keyCode".split(" "),
- /**
- * @param {Object} event
- * @param {Object} original
- * @return {?}
- */
- filter : function(event, original) {
- return null == event.which && (event.which = null != original.charCode ? original.charCode : original.keyCode), event;
- }
- },
- mouseHooks : {
- props : "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
- /**
- * @param {Object} event
- * @param {Object} original
- * @return {?}
- */
- filter : function(event, original) {
- var d;
- var de;
- var b;
- var button = original.button;
- return null == event.pageX && (null != original.clientX && (d = event.target.ownerDocument || node, de = d.documentElement, b = d.body, event.pageX = original.clientX + (de && de.scrollLeft || (b && b.scrollLeft || 0)) - (de && de.clientLeft || (b && b.clientLeft || 0)), event.pageY = original.clientY + (de && de.scrollTop || (b && b.scrollTop || 0)) - (de && de.clientTop || (b && b.clientTop || 0)))), event.which || (void 0 === button || (event.which = 1 & button ? 1 : 2 & button ? 3 : 4 &
- button ? 2 : 0)), event;
- }
- },
- /**
- * @param {Object} event
- * @return {?}
- */
- fix : function(event) {
- if (event[jQuery.expando]) {
- return event;
- }
- var i;
- var prop;
- var copy;
- var type = event.type;
- /** @type {Object} */
- var originalEvent = event;
- var fixHook = this.fixHooks[type];
- if (!fixHook) {
- this.fixHooks[type] = fixHook = rkeyEvent.test(type) ? this.mouseHooks : rmouseEvent.test(type) ? this.keyHooks : {};
- }
- copy = fixHook.props ? this.props.concat(fixHook.props) : this.props;
- event = new jQuery.Event(originalEvent);
- i = copy.length;
- for (;i--;) {
- prop = copy[i];
- event[prop] = originalEvent[prop];
- }
- return event.target || (event.target = node), 3 === event.target.nodeType && (event.target = event.target.parentNode), fixHook.filter ? fixHook.filter(event, originalEvent) : event;
- },
- special : {
- load : {
- noBubble : true
- },
- focus : {
- /**
- * @return {?}
- */
- trigger : function() {
- return this !== safeActiveElement() && this.focus ? (this.focus(), false) : void 0;
- },
- delegateType : "focusin"
- },
- blur : {
- /**
- * @return {?}
- */
- trigger : function() {
- return this === safeActiveElement() && this.blur ? (this.blur(), false) : void 0;
- },
- delegateType : "focusout"
- },
- click : {
- /**
- * @return {?}
- */
- trigger : function() {
- return "checkbox" === this.type && (this.click && jQuery.nodeName(this, "input")) ? (this.click(), false) : void 0;
- },
- /**
- * @param {Function} event
- * @return {?}
- */
- _default : function(event) {
- return jQuery.nodeName(event.target, "a");
- }
- },
- beforeunload : {
- /**
- * @param {Object} event
- * @return {undefined}
- */
- postDispatch : function(event) {
- if (void 0 !== event.result) {
- if (event.originalEvent) {
- event.originalEvent.returnValue = event.result;
- }
- }
- }
- }
- },
- /**
- * @param {string} type
- * @param {Object} elem
- * @param {?} event
- * @param {boolean} dataAndEvents
- * @return {undefined}
- */
- simulate : function(type, elem, event, dataAndEvents) {
- var cycle = jQuery.extend(new jQuery.Event, event, {
- type : type,
- isSimulated : true,
- originalEvent : {}
- });
- if (dataAndEvents) {
- jQuery.event.trigger(cycle, null, elem);
- } else {
- jQuery.event.dispatch.call(elem, cycle);
- }
- if (cycle.isDefaultPrevented()) {
- event.preventDefault();
- }
- }
- };
- /**
- * @param {Object} elem
- * @param {?} type
- * @param {?} handle
- * @return {undefined}
- */
- jQuery.removeEvent = function(elem, type, handle) {
- if (elem.removeEventListener) {
- elem.removeEventListener(type, handle, false);
- }
- };
- /**
- * @param {Object} src
- * @param {?} props
- * @return {?}
- */
- jQuery.Event = function(src, props) {
- return this instanceof jQuery.Event ? (src && src.type ? (this.originalEvent = src, this.type = src.type, this.isDefaultPrevented = src.defaultPrevented || void 0 === src.defaultPrevented && src.returnValue === false ? returnTrue : returnFalse) : this.type = src, props && jQuery.extend(this, props), this.timeStamp = src && src.timeStamp || jQuery.now(), void(this[jQuery.expando] = true)) : new jQuery.Event(src, props);
- };
- jQuery.Event.prototype = {
- /** @type {function (): ?} */
- isDefaultPrevented : returnFalse,
- /** @type {function (): ?} */
- isPropagationStopped : returnFalse,
- /** @type {function (): ?} */
- isImmediatePropagationStopped : returnFalse,
- /**
- * @return {undefined}
- */
- preventDefault : function() {
- var e = this.originalEvent;
- /** @type {function (): ?} */
- this.isDefaultPrevented = returnTrue;
- if (e) {
- if (e.preventDefault) {
- e.preventDefault();
- }
- }
- },
- /**
- * @return {undefined}
- */
- stopPropagation : function() {
- var e = this.originalEvent;
- /** @type {function (): ?} */
- this.isPropagationStopped = returnTrue;
- if (e) {
- if (e.stopPropagation) {
- e.stopPropagation();
- }
- }
- },
- /**
- * @return {undefined}
- */
- stopImmediatePropagation : function() {
- var e = this.originalEvent;
- /** @type {function (): ?} */
- this.isImmediatePropagationStopped = returnTrue;
- if (e) {
- if (e.stopImmediatePropagation) {
- e.stopImmediatePropagation();
- }
- }
- this.stopPropagation();
- }
- };
- jQuery.each({
- mouseenter : "mouseover",
- mouseleave : "mouseout",
- pointerenter : "pointerover",
- pointerleave : "pointerout"
- }, function(orig, fix) {
- jQuery.event.special[orig] = {
- delegateType : fix,
- bindType : fix,
- /**
- * @param {Object} event
- * @return {?}
- */
- handle : function(event) {
- var returnValue;
- var target = this;
- var related = event.relatedTarget;
- var handleObj = event.handleObj;
- return(!related || related !== target && !jQuery.contains(target, related)) && (event.type = handleObj.origType, returnValue = handleObj.handler.apply(this, arguments), event.type = fix), returnValue;
- }
- };
- });
- if (!support.focusinBubbles) {
- jQuery.each({
- focus : "focusin",
- blur : "focusout"
- }, function(event, name) {
- /**
- * @param {Object} event
- * @return {undefined}
- */
- var handler = function(event) {
- jQuery.event.simulate(name, event.target, jQuery.event.fix(event), true);
- };
- jQuery.event.special[name] = {
- /**
- * @return {undefined}
- */
- setup : function() {
- var node = this.ownerDocument || this;
- var descriptor = data_priv.access(node, name);
- if (!descriptor) {
- node.addEventListener(event, handler, true);
- }
- data_priv.access(node, name, (descriptor || 0) + 1);
- },
- /**
- * @return {undefined}
- */
- teardown : function() {
- var node = this.ownerDocument || this;
- /** @type {number} */
- var data = data_priv.access(node, name) - 1;
- if (data) {
- data_priv.access(node, name, data);
- } else {
- node.removeEventListener(event, handler, true);
- data_priv.remove(node, name);
- }
- }
- };
- });
- }
- jQuery.fn.extend({
- /**
- * @param {string} types
- * @param {Function} selector
- * @param {Function} data
- * @param {Function} fn
- * @param {(number|string)} one
- * @return {?}
- */
- on : function(types, selector, data, fn, one) {
- var origFn;
- var type;
- if ("object" == typeof types) {
- if ("string" != typeof selector) {
- data = data || selector;
- selector = void 0;
- }
- for (type in types) {
- this.on(type, selector, data, types[type], one);
- }
- return this;
- }
- if (null == data && null == fn ? (fn = selector, data = selector = void 0) : null == fn && ("string" == typeof selector ? (fn = data, data = void 0) : (fn = data, data = selector, selector = void 0)), fn === false) {
- /** @type {function (): ?} */
- fn = returnFalse;
- } else {
- if (!fn) {
- return this;
- }
- }
- return 1 === one && (origFn = fn, fn = function(event) {
- return jQuery().off(event), origFn.apply(this, arguments);
- }, fn.guid = origFn.guid || (origFn.guid = jQuery.guid++)), this.each(function() {
- jQuery.event.add(this, types, fn, data, selector);
- });
- },
- /**
- * @param {string} types
- * @param {Function} callback
- * @param {Function} data
- * @param {Function} fn
- * @return {?}
- */
- one : function(types, callback, data, fn) {
- return this.on(types, callback, data, fn, 1);
- },
- /**
- * @param {string} types
- * @param {Function} selector
- * @param {Function} fn
- * @return {?}
- */
- off : function(types, selector, fn) {
- var handleObj;
- var type;
- if (types && (types.preventDefault && types.handleObj)) {
- return handleObj = types.handleObj, jQuery(types.delegateTarget).off(handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler), this;
- }
- if ("object" == typeof types) {
- for (type in types) {
- this.off(type, selector, types[type]);
- }
- return this;
- }
- return(selector === false || "function" == typeof selector) && (fn = selector, selector = void 0), fn === false && (fn = returnFalse), this.each(function() {
- jQuery.event.remove(this, types, fn, selector);
- });
- },
- /**
- * @param {string} type
- * @param {?} args
- * @return {?}
- */
- trigger : function(type, args) {
- return this.each(function() {
- jQuery.event.trigger(type, args, this);
- });
- },
- /**
- * @param {string} type
- * @param {?} args
- * @return {?}
- */
- triggerHandler : function(type, args) {
- var parent = this[0];
- return parent ? jQuery.event.trigger(type, args, parent, true) : void 0;
- }
- });
- /** @type {RegExp} */
- var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi;
- /** @type {RegExp} */
- var rtagName = /<([\w:]+)/;
- /** @type {RegExp} */
- var rhtml = /<|&#?\w+;/;
- /** @type {RegExp} */
- var rchecked = /<(?:script|style|link)/i;
- /** @type {RegExp} */
- var exclude = /checked\s*(?:[^=]|=\s*.checked.)/i;
- /** @type {RegExp} */
- var stopParent = /^$|\/(?:java|ecma)script/i;
- /** @type {RegExp} */
- var re = /^true\/(.*)/;
- /** @type {RegExp} */
- var rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
- var wrapMap = {
- option : [1, "<select multiple='multiple'>", "</select>"],
- thead : [1, "<table>", "</table>"],
- col : [2, "<table><colgroup>", "</colgroup></table>"],
- tr : [2, "<table><tbody>", "</tbody></table>"],
- td : [3, "<table><tbody><tr>", "</tr></tbody></table>"],
- _default : [0, "", ""]
- };
- /** @type {Array} */
- wrapMap.optgroup = wrapMap.option;
- /** @type {Array} */
- wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
- /** @type {Array} */
- wrapMap.th = wrapMap.td;
- jQuery.extend({
- /**
- * @param {Object} elem
- * @param {boolean} dataAndEvents
- * @param {boolean} deepDataAndEvents
- * @return {?}
- */
- clone : function(elem, dataAndEvents, deepDataAndEvents) {
- var i;
- var l;
- var srcElements;
- var destElements;
- var clone = elem.cloneNode(true);
- var inPage = jQuery.contains(elem.ownerDocument, elem);
- if (!(support.noCloneChecked || (1 !== elem.nodeType && 11 !== elem.nodeType || jQuery.isXMLDoc(elem)))) {
- destElements = getAll(clone);
- srcElements = getAll(elem);
- /** @type {number} */
- i = 0;
- l = srcElements.length;
- for (;l > i;i++) {
- fixInput(srcElements[i], destElements[i]);
- }
- }
- if (dataAndEvents) {
- if (deepDataAndEvents) {
- srcElements = srcElements || getAll(elem);
- destElements = destElements || getAll(clone);
- /** @type {number} */
- i = 0;
- l = srcElements.length;
- for (;l > i;i++) {
- cloneCopyEvent(srcElements[i], destElements[i]);
- }
- } else {
- cloneCopyEvent(elem, clone);
- }
- }
- return destElements = getAll(clone, "script"), destElements.length > 0 && setGlobalEval(destElements, !inPage && getAll(elem, "script")), clone;
- },
- /**
- * @param {Array} elems
- * @param {Document} context
- * @param {boolean} scripts
- * @param {?} selection
- * @return {?}
- */
- buildFragment : function(elems, context, scripts, selection) {
- var elem;
- var tmp;
- var tag;
- var wrap;
- var contains;
- var j;
- var fragment = context.createDocumentFragment();
- /** @type {Array} */
- var nodes = [];
- /** @type {number} */
- var i = 0;
- var l = elems.length;
- for (;l > i;i++) {
- if (elem = elems[i], elem || 0 === elem) {
- if ("object" === jQuery.type(elem)) {
- jQuery.merge(nodes, elem.nodeType ? [elem] : elem);
- } else {
- if (rhtml.test(elem)) {
- tmp = tmp || fragment.appendChild(context.createElement("div"));
- tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase();
- wrap = wrapMap[tag] || wrapMap._default;
- tmp.innerHTML = wrap[1] + elem.replace(rxhtmlTag, "<$1></$2>") + wrap[2];
- j = wrap[0];
- for (;j--;) {
- tmp = tmp.lastChild;
- }
- jQuery.merge(nodes, tmp.childNodes);
- tmp = fragment.firstChild;
- /** @type {string} */
- tmp.textContent = "";
- } else {
- nodes.push(context.createTextNode(elem));
- }
- }
- }
- }
- /** @type {string} */
- fragment.textContent = "";
- /** @type {number} */
- i = 0;
- for (;elem = nodes[i++];) {
- if ((!selection || -1 === jQuery.inArray(elem, selection)) && (contains = jQuery.contains(elem.ownerDocument, elem), tmp = getAll(fragment.appendChild(elem), "script"), contains && setGlobalEval(tmp), scripts)) {
- /** @type {number} */
- j = 0;
- for (;elem = tmp[j++];) {
- if (stopParent.test(elem.type || "")) {
- scripts.push(elem);
- }
- }
- }
- }
- return fragment;
- },
- /**
- * @param {?} elems
- * @return {undefined}
- */
- cleanData : function(elems) {
- var data;
- var elem;
- var type;
- var key;
- var special = jQuery.event.special;
- /** @type {number} */
- var i = 0;
- for (;void 0 !== (elem = elems[i]);i++) {
- if (jQuery.acceptData(elem) && (key = elem[data_priv.expando], key && (data = data_priv.cache[key]))) {
- if (data.events) {
- for (type in data.events) {
- if (special[type]) {
- jQuery.event.remove(elem, type);
- } else {
- jQuery.removeEvent(elem, type, data.handle);
- }
- }
- }
- if (data_priv.cache[key]) {
- delete data_priv.cache[key];
- }
- }
- delete data_user.cache[elem[data_user.expando]];
- }
- }
- });
- jQuery.fn.extend({
- /**
- * @param {string} value
- * @return {?}
- */
- text : function(value) {
- return access(this, function(textString) {
- return void 0 === textString ? jQuery.text(this) : this.empty().each(function() {
- if (1 === this.nodeType || (11 === this.nodeType || 9 === this.nodeType)) {
- /** @type {string} */
- this.textContent = textString;
- }
- });
- }, null, value, arguments.length);
- },
- /**
- * @return {?}
- */
- append : function() {
- return this.domManip(arguments, function(elem) {
- if (1 === this.nodeType || (11 === this.nodeType || 9 === this.nodeType)) {
- var target = manipulationTarget(this, elem);
- target.appendChild(elem);
- }
- });
- },
- /**
- * @return {?}
- */
- prepend : function() {
- return this.domManip(arguments, function(elem) {
- if (1 === this.nodeType || (11 === this.nodeType || 9 === this.nodeType)) {
- var target = manipulationTarget(this, elem);
- target.insertBefore(elem, target.firstChild);
- }
- });
- },
- /**
- * @return {?}
- */
- before : function() {
- return this.domManip(arguments, function(elem) {
- if (this.parentNode) {
- this.parentNode.insertBefore(elem, this);
- }
- });
- },
- /**
- * @return {?}
- */
- after : function() {
- return this.domManip(arguments, function(elem) {
- if (this.parentNode) {
- this.parentNode.insertBefore(elem, this.nextSibling);
- }
- });
- },
- /**
- * @param {boolean} selector
- * @param {?} keepData
- * @return {?}
- */
- remove : function(selector, keepData) {
- var elem;
- var elems = selector ? jQuery.filter(selector, this) : this;
- /** @type {number} */
- var i = 0;
- for (;null != (elem = elems[i]);i++) {
- if (!keepData) {
- if (!(1 !== elem.nodeType)) {
- jQuery.cleanData(getAll(elem));
- }
- }
- if (elem.parentNode) {
- if (keepData) {
- if (jQuery.contains(elem.ownerDocument, elem)) {
- setGlobalEval(getAll(elem, "script"));
- }
- }
- elem.parentNode.removeChild(elem);
- }
- }
- return this;
- },
- /**
- * @return {?}
- */
- empty : function() {
- var elem;
- /** @type {number} */
- var unlock = 0;
- for (;null != (elem = this[unlock]);unlock++) {
- if (1 === elem.nodeType) {
- jQuery.cleanData(getAll(elem, false));
- /** @type {string} */
- elem.textContent = "";
- }
- }
- return this;
- },
- /**
- * @param {boolean} dataAndEvents
- * @param {boolean} deepDataAndEvents
- * @return {?}
- */
- clone : function(dataAndEvents, deepDataAndEvents) {
- return dataAndEvents = null == dataAndEvents ? false : dataAndEvents, deepDataAndEvents = null == deepDataAndEvents ? dataAndEvents : deepDataAndEvents, this.map(function() {
- return jQuery.clone(this, dataAndEvents, deepDataAndEvents);
- });
- },
- /**
- * @param {string} value
- * @return {?}
- */
- html : function(value) {
- return access(this, function(value) {
- var elem = this[0] || {};
- /** @type {number} */
- var i = 0;
- var l = this.length;
- if (void 0 === value && 1 === elem.nodeType) {
- return elem.innerHTML;
- }
- if ("string" == typeof value && (!rchecked.test(value) && !wrapMap[(rtagName.exec(value) || ["", ""])[1].toLowerCase()])) {
- /** @type {string} */
- value = value.replace(rxhtmlTag, "<$1></$2>");
- try {
- for (;l > i;i++) {
- elem = this[i] || {};
- if (1 === elem.nodeType) {
- jQuery.cleanData(getAll(elem, false));
- /** @type {string} */
- elem.innerHTML = value;
- }
- }
- /** @type {number} */
- elem = 0;
- } catch (o) {
- }
- }
- if (elem) {
- this.empty().append(value);
- }
- }, null, value, arguments.length);
- },
- /**
- * @return {?}
- */
- replaceWith : function() {
- var arg = arguments[0];
- return this.domManip(arguments, function(s) {
- arg = this.parentNode;
- jQuery.cleanData(getAll(this));
- if (arg) {
- arg.replaceChild(s, this);
- }
- }), arg && (arg.length || arg.nodeType) ? this : this.remove();
- },
- /**
- * @param {Object} selector
- * @return {?}
- */
- detach : function(selector) {
- return this.remove(selector, true);
- },
- /**
- * @param {Object} args
- * @param {Function} callback
- * @return {?}
- */
- domManip : function(args, callback) {
- /** @type {Array} */
- args = core_concat.apply([], args);
- var fragment;
- var first;
- var scripts;
- var _len;
- var node;
- var doc;
- /** @type {number} */
- var i = 0;
- var l = this.length;
- var set = this;
- /** @type {number} */
- var iNoClone = l - 1;
- var html = args[0];
- var isFunction = jQuery.isFunction(html);
- if (isFunction || l > 1 && ("string" == typeof html && (!support.checkClone && exclude.test(html)))) {
- return this.each(function(index) {
- var self = set.eq(index);
- if (isFunction) {
- args[0] = html.call(this, index, self.html());
- }
- self.domManip(args, callback);
- });
- }
- if (l && (fragment = jQuery.buildFragment(args, this[0].ownerDocument, false, this), first = fragment.firstChild, 1 === fragment.childNodes.length && (fragment = first), first)) {
- scripts = jQuery.map(getAll(fragment, "script"), restoreScript);
- _len = scripts.length;
- for (;l > i;i++) {
- node = fragment;
- if (i !== iNoClone) {
- node = jQuery.clone(node, true, true);
- if (_len) {
- jQuery.merge(scripts, getAll(node, "script"));
- }
- }
- callback.call(this[i], node, i);
- }
- if (_len) {
- doc = scripts[scripts.length - 1].ownerDocument;
- jQuery.map(scripts, fn);
- /** @type {number} */
- i = 0;
- for (;_len > i;i++) {
- node = scripts[i];
- if (stopParent.test(node.type || "")) {
- if (!data_priv.access(node, "globalEval")) {
- if (jQuery.contains(doc, node)) {
- if (node.src) {
- if (jQuery._evalUrl) {
- jQuery._evalUrl(node.src);
- }
- } else {
- jQuery.globalEval(node.textContent.replace(rcleanScript, ""));
- }
- }
- }
- }
- }
- }
- }
- return this;
- }
- });
- jQuery.each({
- appendTo : "append",
- prependTo : "prepend",
- insertBefore : "before",
- insertAfter : "after",
- replaceAll : "replaceWith"
- }, function(original, method) {
- /**
- * @param {string} scripts
- * @return {?}
- */
- jQuery.fn[original] = function(scripts) {
- var resp;
- /** @type {Array} */
- var ret = [];
- var insert = jQuery(scripts);
- /** @type {number} */
- var segments = insert.length - 1;
- /** @type {number} */
- var i = 0;
- for (;segments >= i;i++) {
- resp = i === segments ? this : this.clone(true);
- jQuery(insert[i])[method](resp);
- core_push.apply(ret, resp.get());
- }
- return this.pushStack(ret);
- };
- });
- var iframe;
- var elemdisplay = {};
- /** @type {RegExp} */
- var rbracket = /^margin/;
- /** @type {RegExp} */
- var regexp = new RegExp("^(" + core_pnum + ")(?!px)[a-z%]+$", "i");
- /**
- * @param {Object} elem
- * @return {?}
- */
- var getStyles = function(elem) {
- return elem.ownerDocument.defaultView.opener ? elem.ownerDocument.defaultView.getComputedStyle(elem, null) : win.getComputedStyle(elem, null);
- };
- !function() {
- /**
- * @return {undefined}
- */
- function computePixelPositionAndBoxSizingReliable() {
- /** @type {string} */
- div.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute";
- /** @type {string} */
- div.innerHTML = "";
- root.appendChild(el);
- var divStyle = win.getComputedStyle(div, null);
- /** @type {boolean} */
- t = "1%" !== divStyle.top;
- /** @type {boolean} */
- r = "4px" === divStyle.width;
- root.removeChild(el);
- }
- var t;
- var r;
- var root = node.documentElement;
- var el = node.createElement("div");
- var div = node.createElement("div");
- if (div.style) {
- /** @type {string} */
- div.style.backgroundClip = "content-box";
- /** @type {string} */
- div.cloneNode(true).style.backgroundClip = "";
- /** @type {boolean} */
- support.clearCloneStyle = "content-box" === div.style.backgroundClip;
- /** @type {string} */
- el.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute";
- el.appendChild(div);
- if (win.getComputedStyle) {
- jQuery.extend(support, {
- /**
- * @return {?}
- */
- pixelPosition : function() {
- return computePixelPositionAndBoxSizingReliable(), t;
- },
- /**
- * @return {?}
- */
- boxSizingReliable : function() {
- return null == r && computePixelPositionAndBoxSizingReliable(), r;
- },
- /**
- * @return {?}
- */
- reliableMarginRight : function() {
- var e;
- var marginDiv = div.appendChild(node.createElement("div"));
- return marginDiv.style.cssText = div.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0", marginDiv.style.marginRight = marginDiv.style.width = "0", div.style.width = "1px", root.appendChild(el), e = !parseFloat(win.getComputedStyle(marginDiv, null).marginRight), root.removeChild(el), div.removeChild(marginDiv), e;
- }
- });
- }
- }
- }();
- /**
- * @param {Object} elem
- * @param {Object} options
- * @param {Function} callback
- * @param {Array} args
- * @return {?}
- */
- jQuery.swap = function(elem, options, callback, args) {
- var ret;
- var name;
- var old = {};
- for (name in options) {
- old[name] = elem.style[name];
- elem.style[name] = options[name];
- }
- ret = callback.apply(elem, args || []);
- for (name in options) {
- elem.style[name] = old[name];
- }
- return ret;
- };
- /** @type {RegExp} */
- var rdisplayswap = /^(none|table(?!-c[ea]).+)/;
- /** @type {RegExp} */
- var rrelNum = new RegExp("^(" + core_pnum + ")(.*)$", "i");
- /** @type {RegExp} */
- var re2 = new RegExp("^([+-])=(" + core_pnum + ")", "i");
- var props = {
- position : "absolute",
- visibility : "hidden",
- display : "block"
- };
- var cssNormalTransform = {
- letterSpacing : "0",
- fontWeight : "400"
- };
- /** @type {Array} */
- var cssPrefixes = ["Webkit", "O", "Moz", "ms"];
- jQuery.extend({
- cssHooks : {
- opacity : {
- /**
- * @param {Object} elem
- * @param {string} value
- * @return {?}
- */
- get : function(elem, value) {
- if (value) {
- var data = get(elem, "opacity");
- return "" === data ? "1" : data;
- }
- }
- }
- },
- cssNumber : {
- columnCount : true,
- fillOpacity : true,
- flexGrow : true,
- flexShrink : true,
- fontWeight : true,
- lineHeight : true,
- opacity : true,
- order : true,
- orphans : true,
- widows : true,
- zIndex : true,
- zoom : true
- },
- cssProps : {
- "float" : "cssFloat"
- },
- /**
- * @param {Object} elem
- * @param {string} name
- * @param {(number|string)} val
- * @param {?} extra
- * @return {?}
- */
- style : function(elem, name, val, extra) {
- if (elem && (3 !== elem.nodeType && (8 !== elem.nodeType && elem.style))) {
- var ret;
- var type;
- var hooks;
- var origName = jQuery.camelCase(name);
- var style = elem.style;
- return name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(style, origName)), hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName], void 0 === val ? hooks && ("get" in hooks && void 0 !== (ret = hooks.get(elem, false, extra))) ? ret : style[name] : (type = typeof val, "string" === type && ((ret = re2.exec(val)) && (val = (ret[1] + 1) * ret[2] + parseFloat(jQuery.css(elem, name)), type = "number")), void(null != val && (val === val && ("number" !== type ||
- (jQuery.cssNumber[origName] || (val += "px")), support.clearCloneStyle || ("" !== val || (0 !== name.indexOf("background") || (style[name] = "inherit"))), hooks && ("set" in hooks && void 0 === (val = hooks.set(elem, val, extra))) || (style[name] = val)))));
- }
- },
- /**
- * @param {string} elem
- * @param {string} name
- * @param {boolean} recurring
- * @param {?} property
- * @return {?}
- */
- css : function(elem, name, recurring, property) {
- var value;
- var val;
- var result;
- var origName = jQuery.camelCase(name);
- return name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(elem.style, origName)), result = jQuery.cssHooks[name] || jQuery.cssHooks[origName], result && ("get" in result && (value = result.get(elem, true, recurring))), void 0 === value && (value = get(elem, name, property)), "normal" === value && (name in cssNormalTransform && (value = cssNormalTransform[name])), "" === recurring || recurring ? (val = parseFloat(value), recurring === true || jQuery.isNumeric(val) ?
- val || 0 : value) : value;
- }
- });
- jQuery.each(["height", "width"], function(dataAndEvents, name) {
- jQuery.cssHooks[name] = {
- /**
- * @param {Object} elem
- * @param {string} value
- * @param {?} extra
- * @return {?}
- */
- get : function(elem, value, extra) {
- return value ? rdisplayswap.test(jQuery.css(elem, "display")) && 0 === elem.offsetWidth ? jQuery.swap(elem, props, function() {
- return getWidthOrHeight(elem, name, extra);
- }) : getWidthOrHeight(elem, name, extra) : void 0;
- },
- /**
- * @param {Object} elem
- * @param {string} value
- * @param {?} extra
- * @return {?}
- */
- set : function(elem, value, extra) {
- var styles = extra && getStyles(elem);
- return setPositiveNumber(elem, value, extra ? augmentWidthOrHeight(elem, name, extra, "border-box" === jQuery.css(elem, "boxSizing", false, styles), styles) : 0);
- }
- };
- });
- jQuery.cssHooks.marginRight = addGetHookIf(support.reliableMarginRight, function(cur, value) {
- return value ? jQuery.swap(cur, {
- display : "inline-block"
- }, get, [cur, "marginRight"]) : void 0;
- });
- jQuery.each({
- margin : "",
- padding : "",
- border : "Width"
- }, function(prefix, suffix) {
- jQuery.cssHooks[prefix + suffix] = {
- /**
- * @param {string} line
- * @return {?}
- */
- expand : function(line) {
- /** @type {number} */
- var i = 0;
- var expanded = {};
- /** @type {Array} */
- var tokens = "string" == typeof line ? line.split(" ") : [line];
- for (;4 > i;i++) {
- expanded[prefix + cssExpand[i] + suffix] = tokens[i] || (tokens[i - 2] || tokens[0]);
- }
- return expanded;
- }
- };
- if (!rbracket.test(prefix)) {
- /** @type {function (Object, string, ?): ?} */
- jQuery.cssHooks[prefix + suffix].set = setPositiveNumber;
- }
- });
- jQuery.fn.extend({
- /**
- * @param {string} name
- * @param {string} value
- * @return {?}
- */
- css : function(name, value) {
- return access(this, function(elem, prop, value) {
- var styles;
- var _len;
- var map = {};
- /** @type {number} */
- var name = 0;
- if (jQuery.isArray(prop)) {
- styles = getStyles(elem);
- _len = prop.length;
- for (;_len > name;name++) {
- map[prop[name]] = jQuery.css(elem, prop[name], false, styles);
- }
- return map;
- }
- return void 0 !== value ? jQuery.style(elem, prop, value) : jQuery.css(elem, prop);
- }, name, value, arguments.length > 1);
- },
- /**
- * @return {?}
- */
- show : function() {
- return showHide(this, true);
- },
- /**
- * @return {?}
- */
- hide : function() {
- return showHide(this);
- },
- /**
- * @param {?} state
- * @return {?}
- */
- toggle : function(state) {
- return "boolean" == typeof state ? state ? this.show() : this.hide() : this.each(function() {
- if (isHidden(this)) {
- jQuery(this).show();
- } else {
- jQuery(this).hide();
- }
- });
- }
- });
- /** @type {function (string, string, string, string, string): ?} */
- jQuery.Tween = Tween;
- Tween.prototype = {
- /** @type {function (string, string, string, string, string): ?} */
- constructor : Tween,
- /**
- * @param {string} type
- * @param {Object} options
- * @param {string} prop
- * @param {?} to
- * @param {string} easing
- * @param {string} unit
- * @return {undefined}
- */
- init : function(type, options, prop, to, easing, unit) {
- /** @type {string} */
- this.elem = type;
- /** @type {string} */
- this.prop = prop;
- this.easing = easing || "swing";
- /** @type {Object} */
- this.options = options;
- this.start = this.now = this.cur();
- this.end = to;
- this.unit = unit || (jQuery.cssNumber[prop] ? "" : "px");
- },
- /**
- * @return {?}
- */
- cur : function() {
- var hooks = Tween.propHooks[this.prop];
- return hooks && hooks.get ? hooks.get(this) : Tween.propHooks._default.get(this);
- },
- /**
- * @param {number} percent
- * @return {?}
- */
- run : function(percent) {
- var eased;
- var hooks = Tween.propHooks[this.prop];
- return this.pos = eased = this.options.duration ? jQuery.easing[this.easing](percent, this.options.duration * percent, 0, 1, this.options.duration) : percent, this.now = (this.end - this.start) * eased + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), hooks && hooks.set ? hooks.set(this) : Tween.propHooks._default.set(this), this;
- }
- };
- Tween.prototype.init.prototype = Tween.prototype;
- Tween.propHooks = {
- _default : {
- /**
- * @param {Object} elem
- * @return {?}
- */
- get : function(elem) {
- var node;
- return null == elem.elem[elem.prop] || elem.elem.style && null != elem.elem.style[elem.prop] ? (node = jQuery.css(elem.elem, elem.prop, ""), node && "auto" !== node ? node : 0) : elem.elem[elem.prop];
- },
- /**
- * @param {Object} tween
- * @return {undefined}
- */
- set : function(tween) {
- if (jQuery.fx.step[tween.prop]) {
- jQuery.fx.step[tween.prop](tween);
- } else {
- if (tween.elem.style && (null != tween.elem.style[jQuery.cssProps[tween.prop]] || jQuery.cssHooks[tween.prop])) {
- jQuery.style(tween.elem, tween.prop, tween.now + tween.unit);
- } else {
- tween.elem[tween.prop] = tween.now;
- }
- }
- }
- }
- };
- Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
- /**
- * @param {Object} elem
- * @return {undefined}
- */
- set : function(elem) {
- if (elem.elem.nodeType) {
- if (elem.elem.parentNode) {
- elem.elem[elem.prop] = elem.now;
- }
- }
- }
- };
- jQuery.easing = {
- /**
- * @param {?} t
- * @return {?}
- */
- linear : function(t) {
- return t;
- },
- /**
- * @param {number} p
- * @return {?}
- */
- swing : function(p) {
- return 0.5 - Math.cos(p * Math.PI) / 2;
- }
- };
- /** @type {function (string, Object, string, ?, string, string): undefined} */
- jQuery.fx = Tween.prototype.init;
- jQuery.fx.step = {};
- var fxNow;
- var scrollIntervalId;
- /** @type {RegExp} */
- var rplusequals = /^(?:toggle|show|hide)$/;
- /** @type {RegExp} */
- var rfxnum = new RegExp("^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i");
- /** @type {RegExp} */
- var rrun = /queueHooks$/;
- /** @type {Array} */
- var animationPrefilters = [defaultPrefilter];
- var cache = {
- "*" : [function(prop, value) {
- var tween = this.createTween(prop, value);
- var l0 = tween.cur();
- /** @type {(Array.<string>|null)} */
- var parts = rfxnum.exec(value);
- /** @type {string} */
- var unit = parts && parts[3] || (jQuery.cssNumber[prop] ? "" : "px");
- var start = (jQuery.cssNumber[prop] || "px" !== unit && +l0) && rfxnum.exec(jQuery.css(tween.elem, prop));
- /** @type {number} */
- var scale = 1;
- /** @type {number} */
- var c = 20;
- if (start && start[3] !== unit) {
- unit = unit || start[3];
- /** @type {Array} */
- parts = parts || [];
- /** @type {number} */
- start = +l0 || 1;
- do {
- /** @type {(number|string)} */
- scale = scale || ".5";
- start /= scale;
- jQuery.style(tween.elem, prop, start + unit);
- } while (scale !== (scale = tween.cur() / l0) && (1 !== scale && --c));
- }
- return parts && (start = tween.start = +start || (+l0 || 0), tween.unit = unit, tween.end = parts[1] ? start + (parts[1] + 1) * parts[2] : +parts[2]), tween;
- }]
- };
- jQuery.Animation = jQuery.extend(Animation, {
- /**
- * @param {Object} props
- * @param {Function} callback
- * @return {undefined}
- */
- tweener : function(props, callback) {
- if (jQuery.isFunction(props)) {
- /** @type {Object} */
- callback = props;
- /** @type {Array} */
- props = ["*"];
- } else {
- props = props.split(" ");
- }
- var prop;
- /** @type {number} */
- var _i = 0;
- var l2 = props.length;
- for (;l2 > _i;_i++) {
- prop = props[_i];
- cache[prop] = cache[prop] || [];
- cache[prop].unshift(callback);
- }
- },
- /**
- * @param {?} callback
- * @param {?} prepend
- * @return {undefined}
- */
- prefilter : function(callback, prepend) {
- if (prepend) {
- animationPrefilters.unshift(callback);
- } else {
- animationPrefilters.push(callback);
- }
- }
- });
- /**
- * @param {string} speed
- * @param {boolean} easing
- * @param {string} fn
- * @return {?}
- */
- jQuery.speed = function(speed, easing, fn) {
- var opt = speed && "object" == typeof speed ? jQuery.extend({}, speed) : {
- complete : fn || (!fn && easing || jQuery.isFunction(speed) && speed),
- duration : speed,
- easing : fn && easing || easing && (!jQuery.isFunction(easing) && easing)
- };
- return opt.duration = jQuery.fx.off ? 0 : "number" == typeof opt.duration ? opt.duration : opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default, (null == opt.queue || opt.queue === true) && (opt.queue = "fx"), opt.old = opt.complete, opt.complete = function() {
- if (jQuery.isFunction(opt.old)) {
- opt.old.call(this);
- }
- if (opt.queue) {
- jQuery.dequeue(this, opt.queue);
- }
- }, opt;
- };
- jQuery.fn.extend({
- /**
- * @param {string} speed
- * @param {(number|string)} to
- * @param {boolean} callback
- * @param {string} _callback
- * @return {?}
- */
- fadeTo : function(speed, to, callback, _callback) {
- return this.filter(isHidden).css("opacity", 0).show().end().animate({
- opacity : to
- }, speed, callback, _callback);
- },
- /**
- * @param {?} prop
- * @param {string} speed
- * @param {boolean} easing
- * @param {string} callback
- * @return {?}
- */
- animate : function(prop, speed, easing, callback) {
- var empty = jQuery.isEmptyObject(prop);
- var optall = jQuery.speed(speed, easing, callback);
- /**
- * @return {undefined}
- */
- var doAnimation = function() {
- var anim = Animation(this, jQuery.extend({}, prop), optall);
- if (empty || data_priv.get(this, "finish")) {
- anim.stop(true);
- }
- };
- return doAnimation.finish = doAnimation, empty || optall.queue === false ? this.each(doAnimation) : this.queue(optall.queue, doAnimation);
- },
- /**
- * @param {string} type
- * @param {Object} clearQueue
- * @param {Object} gotoEnd
- * @return {?}
- */
- stop : function(type, clearQueue, gotoEnd) {
- /**
- * @param {Object} e
- * @return {undefined}
- */
- var stop = function(e) {
- var stop = e.stop;
- delete e.stop;
- stop(gotoEnd);
- };
- return "string" != typeof type && (gotoEnd = clearQueue, clearQueue = type, type = void 0), clearQueue && (type !== false && this.queue(type || "fx", [])), this.each(function() {
- /** @type {boolean} */
- var dequeue = true;
- var index = null != type && type + "queueHooks";
- /** @type {Array} */
- var timers = jQuery.timers;
- var iteratee = data_priv.get(this);
- if (index) {
- if (iteratee[index]) {
- if (iteratee[index].stop) {
- stop(iteratee[index]);
- }
- }
- } else {
- for (index in iteratee) {
- if (iteratee[index]) {
- if (iteratee[index].stop) {
- if (rrun.test(index)) {
- stop(iteratee[index]);
- }
- }
- }
- }
- }
- /** @type {number} */
- index = timers.length;
- for (;index--;) {
- if (!(timers[index].elem !== this)) {
- if (!(null != type && timers[index].queue !== type)) {
- timers[index].anim.stop(gotoEnd);
- /** @type {boolean} */
- dequeue = false;
- timers.splice(index, 1);
- }
- }
- }
- if (dequeue || !gotoEnd) {
- jQuery.dequeue(this, type);
- }
- });
- },
- /**
- * @param {string} type
- * @return {?}
- */
- finish : function(type) {
- return type !== false && (type = type || "fx"), this.each(function() {
- var index;
- var data = data_priv.get(this);
- var array = data[type + "queue"];
- var event = data[type + "queueHooks"];
- /** @type {Array} */
- var timers = jQuery.timers;
- var length = array ? array.length : 0;
- /** @type {boolean} */
- data.finish = true;
- jQuery.queue(this, type, []);
- if (event) {
- if (event.stop) {
- event.stop.call(this, true);
- }
- }
- /** @type {number} */
- index = timers.length;
- for (;index--;) {
- if (timers[index].elem === this) {
- if (timers[index].queue === type) {
- timers[index].anim.stop(true);
- timers.splice(index, 1);
- }
- }
- }
- /** @type {number} */
- index = 0;
- for (;length > index;index++) {
- if (array[index]) {
- if (array[index].finish) {
- array[index].finish.call(this);
- }
- }
- }
- delete data.finish;
- });
- }
- });
- jQuery.each(["toggle", "show", "hide"], function(dataAndEvents, name) {
- var matcherFunction = jQuery.fn[name];
- /**
- * @param {string} speed
- * @param {boolean} callback
- * @param {string} next_callback
- * @return {?}
- */
- jQuery.fn[name] = function(speed, callback, next_callback) {
- return null == speed || "boolean" == typeof speed ? matcherFunction.apply(this, arguments) : this.animate(genFx(name, true), speed, callback, next_callback);
- };
- });
- jQuery.each({
- slideDown : genFx("show"),
- slideUp : genFx("hide"),
- slideToggle : genFx("toggle"),
- fadeIn : {
- opacity : "show"
- },
- fadeOut : {
- opacity : "hide"
- },
- fadeToggle : {
- opacity : "toggle"
- }
- }, function(original, props) {
- /**
- * @param {string} speed
- * @param {boolean} callback
- * @param {string} next_callback
- * @return {?}
- */
- jQuery.fn[original] = function(speed, callback, next_callback) {
- return this.animate(props, speed, callback, next_callback);
- };
- });
- /** @type {Array} */
- jQuery.timers = [];
- /**
- * @return {undefined}
- */
- jQuery.fx.tick = function() {
- var last;
- /** @type {number} */
- var i = 0;
- /** @type {Array} */
- var timers = jQuery.timers;
- fxNow = jQuery.now();
- for (;i < timers.length;i++) {
- last = timers[i];
- if (!last()) {
- if (!(timers[i] !== last)) {
- timers.splice(i--, 1);
- }
- }
- }
- if (!timers.length) {
- jQuery.fx.stop();
- }
- fxNow = void 0;
- };
- /**
- * @param {?} timer
- * @return {undefined}
- */
- jQuery.fx.timer = function(timer) {
- jQuery.timers.push(timer);
- if (timer()) {
- jQuery.fx.start();
- } else {
- jQuery.timers.pop();
- }
- };
- /** @type {number} */
- jQuery.fx.interval = 13;
- /**
- * @return {undefined}
- */
- jQuery.fx.start = function() {
- if (!scrollIntervalId) {
- /** @type {number} */
- scrollIntervalId = setInterval(jQuery.fx.tick, jQuery.fx.interval);
- }
- };
- /**
- * @return {undefined}
- */
- jQuery.fx.stop = function() {
- clearInterval(scrollIntervalId);
- /** @type {null} */
- scrollIntervalId = null;
- };
- jQuery.fx.speeds = {
- slow : 600,
- fast : 200,
- _default : 400
- };
- /**
- * @param {Function} time
- * @param {string} type
- * @return {?}
- */
- jQuery.fn.delay = function(time, type) {
- return time = jQuery.fx ? jQuery.fx.speeds[time] || time : time, type = type || "fx", this.queue(type, function(next, event) {
- /** @type {number} */
- var timeout = setTimeout(next, time);
- /**
- * @return {undefined}
- */
- event.stop = function() {
- clearTimeout(timeout);
- };
- });
- };
- (function() {
- var input = node.createElement("input");
- var select = node.createElement("select");
- var opt = select.appendChild(node.createElement("option"));
- /** @type {string} */
- input.type = "checkbox";
- /** @type {boolean} */
- support.checkOn = "" !== input.value;
- support.optSelected = opt.selected;
- /** @type {boolean} */
- select.disabled = true;
- /** @type {boolean} */
- support.optDisabled = !opt.disabled;
- input = node.createElement("input");
- /** @type {string} */
- input.value = "t";
- /** @type {string} */
- input.type = "radio";
- /** @type {boolean} */
- support.radioValue = "t" === input.value;
- })();
- var nodeHook;
- var boolHook;
- var files = jQuery.expr.attrHandle;
- jQuery.fn.extend({
- /**
- * @param {string} name
- * @param {boolean} value
- * @return {?}
- */
- attr : function(name, value) {
- return access(this, jQuery.attr, name, value, arguments.length > 1);
- },
- /**
- * @param {string} name
- * @return {?}
- */
- removeAttr : function(name) {
- return this.each(function() {
- jQuery.removeAttr(this, name);
- });
- }
- });
- jQuery.extend({
- /**
- * @param {Object} elem
- * @param {Object} name
- * @param {Object} value
- * @return {?}
- */
- attr : function(elem, name, value) {
- var hooks;
- var ret;
- var nodeType = elem.nodeType;
- return elem && (3 !== nodeType && (8 !== nodeType && 2 !== nodeType)) ? typeof elem.getAttribute === text ? jQuery.prop(elem, name, value) : (1 === nodeType && jQuery.isXMLDoc(elem) || (name = name.toLowerCase(), hooks = jQuery.attrHooks[name] || (jQuery.expr.match.bool.test(name) ? boolHook : nodeHook)), void 0 === value ? hooks && ("get" in hooks && null !== (ret = hooks.get(elem, name))) ? ret : (ret = jQuery.find.attr(elem, name), null == ret ? void 0 : ret) : null !== value ? hooks &&
- ("set" in hooks && void 0 !== (ret = hooks.set(elem, value, name))) ? ret : (elem.setAttribute(name, value + ""), value) : void jQuery.removeAttr(elem, name)) : void 0;
- },
- /**
- * @param {Object} elem
- * @param {string} value
- * @return {undefined}
- */
- removeAttr : function(elem, value) {
- var name;
- var propName;
- /** @type {number} */
- var i = 0;
- var attrNames = value && value.match(core_rnotwhite);
- if (attrNames && 1 === elem.nodeType) {
- for (;name = attrNames[i++];) {
- propName = jQuery.propFix[name] || name;
- if (jQuery.expr.match.bool.test(name)) {
- /** @type {boolean} */
- elem[propName] = false;
- }
- elem.removeAttribute(name);
- }
- }
- },
- attrHooks : {
- type : {
- /**
- * @param {Object} elem
- * @param {string} value
- * @return {?}
- */
- set : function(elem, value) {
- if (!support.radioValue && ("radio" === value && jQuery.nodeName(elem, "input"))) {
- var val = elem.value;
- return elem.setAttribute("type", value), val && (elem.value = val), value;
- }
- }
- }
- }
- });
- boolHook = {
- /**
- * @param {Object} elem
- * @param {string} value
- * @param {?} name
- * @return {?}
- */
- set : function(elem, value, name) {
- return value === false ? jQuery.removeAttr(elem, name) : elem.setAttribute(name, name), name;
- }
- };
- jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g), function(dataAndEvents, name) {
- var getter = files[name] || jQuery.find.attr;
- /**
- * @param {string} elem
- * @param {Object} name
- * @param {Object} isXML
- * @return {?}
- */
- files[name] = function(elem, name, isXML) {
- var str;
- var file;
- return isXML || (file = files[name], files[name] = str, str = null != getter(elem, name, isXML) ? name.toLowerCase() : null, files[name] = file), str;
- };
- });
- /** @type {RegExp} */
- var rinputs = /^(?:input|select|textarea|button)$/i;
- jQuery.fn.extend({
- /**
- * @param {string} type
- * @param {string} value
- * @return {?}
- */
- prop : function(type, value) {
- return access(this, jQuery.prop, type, value, arguments.length > 1);
- },
- /**
- * @param {?} name
- * @return {?}
- */
- removeProp : function(name) {
- return this.each(function() {
- delete this[jQuery.propFix[name] || name];
- });
- }
- });
- jQuery.extend({
- propFix : {
- "for" : "htmlFor",
- "class" : "className"
- },
- /**
- * @param {Object} elem
- * @param {string} name
- * @param {string} value
- * @return {?}
- */
- prop : function(elem, name, value) {
- var ret;
- var hooks;
- var n;
- var nodeType = elem.nodeType;
- return elem && (3 !== nodeType && (8 !== nodeType && 2 !== nodeType)) ? (n = 1 !== nodeType || !jQuery.isXMLDoc(elem), n && (name = jQuery.propFix[name] || name, hooks = jQuery.propHooks[name]), void 0 !== value ? hooks && ("set" in hooks && void 0 !== (ret = hooks.set(elem, value, name))) ? ret : elem[name] = value : hooks && ("get" in hooks && null !== (ret = hooks.get(elem, name))) ? ret : elem[name]) : void 0;
- },
- propHooks : {
- tabIndex : {
- /**
- * @param {Object} elem
- * @return {?}
- */
- get : function(elem) {
- return elem.hasAttribute("tabindex") || (rinputs.test(elem.nodeName) || elem.href) ? elem.tabIndex : -1;
- }
- }
- }
- });
- if (!support.optSelected) {
- jQuery.propHooks.selected = {
- /**
- * @param {Object} elem
- * @return {?}
- */
- get : function(elem) {
- var parent = elem.parentNode;
- return parent && (parent.parentNode && parent.parentNode.selectedIndex), null;
- }
- };
- }
- jQuery.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function() {
- jQuery.propFix[this.toLowerCase()] = this;
- });
- /** @type {RegExp} */
- var rclass = /[\t\r\n\f]/g;
- jQuery.fn.extend({
- /**
- * @param {string} value
- * @return {?}
- */
- addClass : function(value) {
- var classes;
- var elem;
- var cur;
- var clazz;
- var j;
- var finalValue;
- /** @type {(boolean|string)} */
- var proceed = "string" == typeof value && value;
- /** @type {number} */
- var i = 0;
- var l = this.length;
- if (jQuery.isFunction(value)) {
- return this.each(function(j) {
- jQuery(this).addClass(value.call(this, j, this.className));
- });
- }
- if (proceed) {
- classes = (value || "").match(core_rnotwhite) || [];
- for (;l > i;i++) {
- if (elem = this[i], cur = 1 === elem.nodeType && (elem.className ? (" " + elem.className + " ").replace(rclass, " ") : " ")) {
- /** @type {number} */
- j = 0;
- for (;clazz = classes[j++];) {
- if (cur.indexOf(" " + clazz + " ") < 0) {
- cur += clazz + " ";
- }
- }
- finalValue = jQuery.trim(cur);
- if (elem.className !== finalValue) {
- elem.className = finalValue;
- }
- }
- }
- }
- return this;
- },
- /**
- * @param {string} value
- * @return {?}
- */
- removeClass : function(value) {
- var res;
- var elem;
- var cur;
- var apn;
- var resLength;
- var finalValue;
- /** @type {(boolean|string)} */
- var u = 0 === arguments.length || "string" == typeof value && value;
- /** @type {number} */
- var i = 0;
- var l = this.length;
- if (jQuery.isFunction(value)) {
- return this.each(function(j) {
- jQuery(this).removeClass(value.call(this, j, this.className));
- });
- }
- if (u) {
- res = (value || "").match(core_rnotwhite) || [];
- for (;l > i;i++) {
- if (elem = this[i], cur = 1 === elem.nodeType && (elem.className ? (" " + elem.className + " ").replace(rclass, " ") : "")) {
- /** @type {number} */
- resLength = 0;
- for (;apn = res[resLength++];) {
- for (;cur.indexOf(" " + apn + " ") >= 0;) {
- /** @type {string} */
- cur = cur.replace(" " + apn + " ", " ");
- }
- }
- finalValue = value ? jQuery.trim(cur) : "";
- if (elem.className !== finalValue) {
- elem.className = finalValue;
- }
- }
- }
- }
- return this;
- },
- /**
- * @param {string} value
- * @param {boolean} stateVal
- * @return {?}
- */
- toggleClass : function(value, stateVal) {
- /** @type {string} */
- var type = typeof value;
- return "boolean" == typeof stateVal && "string" === type ? stateVal ? this.addClass(value) : this.removeClass(value) : this.each(jQuery.isFunction(value) ? function(i) {
- jQuery(this).toggleClass(value.call(this, i, this.className, stateVal), stateVal);
- } : function() {
- if ("string" === type) {
- var className;
- /** @type {number} */
- var i = 0;
- var self = jQuery(this);
- var classNames = value.match(core_rnotwhite) || [];
- for (;className = classNames[i++];) {
- if (self.hasClass(className)) {
- self.removeClass(className);
- } else {
- self.addClass(className);
- }
- }
- } else {
- if (type === text || "boolean" === type) {
- if (this.className) {
- data_priv.set(this, "__className__", this.className);
- }
- this.className = this.className || value === false ? "" : data_priv.get(this, "__className__") || "";
- }
- }
- });
- },
- /**
- * @param {string} type
- * @return {?}
- */
- hasClass : function(type) {
- /** @type {string} */
- var tval = " " + type + " ";
- /** @type {number} */
- var i = 0;
- var l = this.length;
- for (;l > i;i++) {
- if (1 === this[i].nodeType && (" " + this[i].className + " ").replace(rclass, " ").indexOf(tval) >= 0) {
- return true;
- }
- }
- return false;
- }
- });
- /** @type {RegExp} */
- var rreturn = /\r/g;
- jQuery.fn.extend({
- /**
- * @param {Function} value
- * @return {?}
- */
- val : function(value) {
- var hooks;
- var ret;
- var isFunction;
- var elem = this[0];
- return arguments.length ? (isFunction = jQuery.isFunction(value), this.each(function(i) {
- var val;
- if (1 === this.nodeType) {
- val = isFunction ? value.call(this, i, jQuery(this).val()) : value;
- if (null == val) {
- /** @type {string} */
- val = "";
- } else {
- if ("number" == typeof val) {
- val += "";
- } else {
- if (jQuery.isArray(val)) {
- val = jQuery.map(val, function(month) {
- return null == month ? "" : month + "";
- });
- }
- }
- }
- hooks = jQuery.valHooks[this.type] || jQuery.valHooks[this.nodeName.toLowerCase()];
- if (!(hooks && ("set" in hooks && void 0 !== hooks.set(this, val, "value")))) {
- this.value = val;
- }
- }
- })) : elem ? (hooks = jQuery.valHooks[elem.type] || jQuery.valHooks[elem.nodeName.toLowerCase()], hooks && ("get" in hooks && void 0 !== (ret = hooks.get(elem, "value"))) ? ret : (ret = elem.value, "string" == typeof ret ? ret.replace(rreturn, "") : null == ret ? "" : ret)) : void 0;
- }
- });
- jQuery.extend({
- valHooks : {
- option : {
- /**
- * @param {Object} elem
- * @return {?}
- */
- get : function(elem) {
- var handle = jQuery.find.attr(elem, "value");
- return null != handle ? handle : jQuery.trim(jQuery.text(elem));
- }
- },
- select : {
- /**
- * @param {Object} elem
- * @return {?}
- */
- get : function(elem) {
- var copies;
- var option;
- var options = elem.options;
- var index = elem.selectedIndex;
- /** @type {boolean} */
- var one = "select-one" === elem.type || 0 > index;
- /** @type {(Array|null)} */
- var out = one ? null : [];
- var max = one ? index + 1 : options.length;
- var i = 0 > index ? max : one ? index : 0;
- for (;max > i;i++) {
- if (option = options[i], !(!option.selected && i !== index || ((support.optDisabled ? option.disabled : null !== option.getAttribute("disabled")) || option.parentNode.disabled && jQuery.nodeName(option.parentNode, "optgroup")))) {
- if (copies = jQuery(option).val(), one) {
- return copies;
- }
- out.push(copies);
- }
- }
- return out;
- },
- /**
- * @param {Object} elem
- * @param {string} value
- * @return {?}
- */
- set : function(elem, value) {
- var r;
- var option;
- var options = elem.options;
- var values = jQuery.makeArray(value);
- var i = options.length;
- for (;i--;) {
- option = options[i];
- if (option.selected = jQuery.inArray(option.value, values) >= 0) {
- /** @type {boolean} */
- r = true;
- }
- }
- return r || (elem.selectedIndex = -1), values;
- }
- }
- }
- });
- jQuery.each(["radio", "checkbox"], function() {
- jQuery.valHooks[this] = {
- /**
- * @param {string} elem
- * @param {string} value
- * @return {?}
- */
- set : function(elem, value) {
- return jQuery.isArray(value) ? elem.checked = jQuery.inArray(jQuery(elem).val(), value) >= 0 : void 0;
- }
- };
- if (!support.checkOn) {
- /**
- * @param {Object} elem
- * @return {?}
- */
- jQuery.valHooks[this].get = function(elem) {
- return null === elem.getAttribute("value") ? "on" : elem.value;
- };
- }
- });
- jQuery.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), function(dataAndEvents, fix) {
- /**
- * @param {Function} data
- * @param {Function} fn
- * @return {?}
- */
- jQuery.fn[fix] = function(data, fn) {
- return arguments.length > 0 ? this.on(fix, null, data, fn) : this.trigger(fix);
- };
- });
- jQuery.fn.extend({
- /**
- * @param {undefined} fnOver
- * @param {Object} fnOut
- * @return {?}
- */
- hover : function(fnOver, fnOut) {
- return this.mouseenter(fnOver).mouseleave(fnOut || fnOver);
- },
- /**
- * @param {string} name
- * @param {Function} data
- * @param {Function} fn
- * @return {?}
- */
- bind : function(name, data, fn) {
- return this.on(name, null, data, fn);
- },
- /**
- * @param {string} types
- * @param {Function} fn
- * @return {?}
- */
- unbind : function(types, fn) {
- return this.off(types, null, fn);
- },
- /**
- * @param {Function} selector
- * @param {string} types
- * @param {Function} data
- * @param {Function} fn
- * @return {?}
- */
- delegate : function(selector, types, data, fn) {
- return this.on(types, selector, data, fn);
- },
- /**
- * @param {string} selector
- * @param {string} types
- * @param {Function} fn
- * @return {?}
- */
- undelegate : function(selector, types, fn) {
- return 1 === arguments.length ? this.off(selector, "**") : this.off(types, selector || "**", fn);
- }
- });
- var iIdCounter = jQuery.now();
- /** @type {RegExp} */
- var rquery = /\?/;
- /**
- * @param {Object} data
- * @return {?}
- */
- jQuery.parseJSON = function(data) {
- return JSON.parse(data + "");
- };
- /**
- * @param {string} data
- * @return {?}
- */
- jQuery.parseXML = function(data) {
- var xml;
- var tmp;
- if (!data || "string" != typeof data) {
- return null;
- }
- try {
- /** @type {DOMParser} */
- tmp = new DOMParser;
- /** @type {(Document|null)} */
- xml = tmp.parseFromString(data, "text/xml");
- } catch (i) {
- xml = void 0;
- }
- return(!xml || xml.getElementsByTagName("parsererror").length) && jQuery.error("Invalid XML: " + data), xml;
- };
- /** @type {RegExp} */
- var trimLeft = /#.*$/;
- /** @type {RegExp} */
- var rts = /([?&])_=[^&]*/;
- /** @type {RegExp} */
- var r = /^(.*?):[ \t]*([^\r\n]*)$/gm;
- /** @type {RegExp} */
- var matches = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/;
- /** @type {RegExp} */
- var rnoContent = /^(?:GET|HEAD)$/;
- /** @type {RegExp} */
- var rprotocol = /^\/\//;
- /** @type {RegExp} */
- var quickExpr = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/;
- var prefilters = {};
- var transports = {};
- /** @type {string} */
- var nc = "*/".concat("*");
- var url = win.location.href;
- /** @type {Array} */
- var match = quickExpr.exec(url.toLowerCase()) || [];
- jQuery.extend({
- active : 0,
- lastModified : {},
- etag : {},
- ajaxSettings : {
- url : url,
- type : "GET",
- isLocal : matches.test(match[1]),
- global : true,
- processData : true,
- async : true,
- contentType : "application/x-www-form-urlencoded; charset=UTF-8",
- accepts : {
- "*" : nc,
- text : "text/plain",
- html : "text/html",
- xml : "application/xml, text/xml",
- json : "application/json, text/javascript"
- },
- contents : {
- xml : /xml/,
- html : /html/,
- json : /json/
- },
- responseFields : {
- xml : "responseXML",
- text : "responseText",
- json : "responseJSON"
- },
- converters : {
- /** @type {function (new:String, *=): string} */
- "* text" : String,
- "text html" : true,
- /** @type {function (Object): ?} */
- "text json" : jQuery.parseJSON,
- /** @type {function (string): ?} */
- "text xml" : jQuery.parseXML
- },
- flatOptions : {
- url : true,
- context : true
- }
- },
- /**
- * @param {(Object|string)} target
- * @param {Object} settings
- * @return {?}
- */
- ajaxSetup : function(target, settings) {
- return settings ? ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings) : ajaxExtend(jQuery.ajaxSettings, target);
- },
- ajaxPrefilter : addToPrefiltersOrTransports(prefilters),
- ajaxTransport : addToPrefiltersOrTransports(transports),
- /**
- * @param {Object} arg
- * @param {Object} options
- * @return {?}
- */
- ajax : function(arg, options) {
- /**
- * @param {number} status
- * @param {(number|string)} nativeStatusText
- * @param {Object} responses
- * @param {string} total
- * @return {undefined}
- */
- function done(status, nativeStatusText, responses, total) {
- var isSuccess;
- var success;
- var error;
- var response;
- var modified;
- /** @type {(number|string)} */
- var statusText = nativeStatusText;
- if (2 !== number) {
- /** @type {number} */
- number = 2;
- if (tref) {
- clearTimeout(tref);
- }
- transport = void 0;
- value = total || "";
- /** @type {number} */
- jqXHR.readyState = status > 0 ? 4 : 0;
- /** @type {boolean} */
- isSuccess = status >= 200 && 300 > status || 304 === status;
- if (responses) {
- response = ajaxHandleResponses(s, jqXHR, responses);
- }
- response = ajaxConvert(s, response, jqXHR, isSuccess);
- if (isSuccess) {
- if (s.ifModified) {
- modified = jqXHR.getResponseHeader("Last-Modified");
- if (modified) {
- jQuery.lastModified[cacheURL] = modified;
- }
- modified = jqXHR.getResponseHeader("etag");
- if (modified) {
- jQuery.etag[cacheURL] = modified;
- }
- }
- if (204 === status || "HEAD" === s.type) {
- /** @type {string} */
- statusText = "nocontent";
- } else {
- if (304 === status) {
- /** @type {string} */
- statusText = "notmodified";
- } else {
- statusText = response.state;
- success = response.data;
- error = response.error;
- /** @type {boolean} */
- isSuccess = !error;
- }
- }
- } else {
- error = statusText;
- if (status || !statusText) {
- /** @type {string} */
- statusText = "error";
- if (0 > status) {
- /** @type {number} */
- status = 0;
- }
- }
- }
- /** @type {number} */
- jqXHR.status = status;
- /** @type {string} */
- jqXHR.statusText = (nativeStatusText || statusText) + "";
- if (isSuccess) {
- deferred.resolveWith(scripts, [success, statusText, jqXHR]);
- } else {
- deferred.rejectWith(scripts, [jqXHR, statusText, error]);
- }
- jqXHR.statusCode(statusCode);
- statusCode = void 0;
- if (l) {
- globalEventContext.trigger(isSuccess ? "ajaxSuccess" : "ajaxError", [jqXHR, s, isSuccess ? success : error]);
- }
- completeDeferred.fireWith(scripts, [jqXHR, statusText]);
- if (l) {
- globalEventContext.trigger("ajaxComplete", [jqXHR, s]);
- if (!--jQuery.active) {
- jQuery.event.trigger("ajaxStop");
- }
- }
- }
- }
- if ("object" == typeof arg) {
- /** @type {Object} */
- options = arg;
- arg = void 0;
- }
- options = options || {};
- var transport;
- var cacheURL;
- var value;
- var target;
- var tref;
- var t;
- var l;
- var i;
- var s = jQuery.ajaxSetup({}, options);
- var scripts = s.context || s;
- var globalEventContext = s.context && (scripts.nodeType || scripts.jquery) ? jQuery(scripts) : jQuery.event;
- var deferred = jQuery.Deferred();
- var completeDeferred = jQuery.Callbacks("once memory");
- var statusCode = s.statusCode || {};
- var requestHeaders = {};
- var requestHeadersNames = {};
- /** @type {number} */
- var number = 0;
- /** @type {string} */
- var strAbort = "canceled";
- var jqXHR = {
- readyState : 0,
- /**
- * @param {string} key
- * @return {?}
- */
- getResponseHeader : function(key) {
- var src;
- if (2 === number) {
- if (!target) {
- target = {};
- for (;src = r.exec(value);) {
- /** @type {string} */
- target[src[1].toLowerCase()] = src[2];
- }
- }
- src = target[key.toLowerCase()];
- }
- return null == src ? null : src;
- },
- /**
- * @return {?}
- */
- getAllResponseHeaders : function() {
- return 2 === number ? value : null;
- },
- /**
- * @param {string} name
- * @param {?} value
- * @return {?}
- */
- setRequestHeader : function(name, value) {
- var lname = name.toLowerCase();
- return number || (name = requestHeadersNames[lname] = requestHeadersNames[lname] || name, requestHeaders[name] = value), this;
- },
- /**
- * @param {(Object|number)} type
- * @return {?}
- */
- overrideMimeType : function(type) {
- return number || (s.mimeType = type), this;
- },
- /**
- * @param {Object} map
- * @return {?}
- */
- statusCode : function(map) {
- var letter;
- if (map) {
- if (2 > number) {
- for (letter in map) {
- /** @type {Array} */
- statusCode[letter] = [statusCode[letter], map[letter]];
- }
- } else {
- jqXHR.always(map[jqXHR.status]);
- }
- }
- return this;
- },
- /**
- * @param {string} statusText
- * @return {?}
- */
- abort : function(statusText) {
- var finalText = statusText || strAbort;
- return transport && transport.abort(finalText), done(0, finalText), this;
- }
- };
- if (deferred.promise(jqXHR).complete = completeDeferred.add, jqXHR.success = jqXHR.done, jqXHR.error = jqXHR.fail, s.url = ((arg || (s.url || url)) + "").replace(trimLeft, "").replace(rprotocol, match[1] + "//"), s.type = options.method || (options.type || (s.method || s.type)), s.dataTypes = jQuery.trim(s.dataType || "*").toLowerCase().match(core_rnotwhite) || [""], null == s.crossDomain && (t = quickExpr.exec(s.url.toLowerCase()), s.crossDomain = !(!t || t[1] === match[1] && (t[2] === match[2] &&
- (t[3] || ("http:" === t[1] ? "80" : "443")) === (match[3] || ("http:" === match[1] ? "80" : "443"))))), s.data && (s.processData && ("string" != typeof s.data && (s.data = jQuery.param(s.data, s.traditional)))), inspectPrefiltersOrTransports(prefilters, s, options, jqXHR), 2 === number) {
- return jqXHR;
- }
- l = jQuery.event && s.global;
- if (l) {
- if (0 === jQuery.active++) {
- jQuery.event.trigger("ajaxStart");
- }
- }
- s.type = s.type.toUpperCase();
- /** @type {boolean} */
- s.hasContent = !rnoContent.test(s.type);
- /** @type {string} */
- cacheURL = s.url;
- if (!s.hasContent) {
- if (s.data) {
- /** @type {string} */
- cacheURL = s.url += (rquery.test(cacheURL) ? "&" : "?") + s.data;
- delete s.data;
- }
- if (s.cache === false) {
- /** @type {string} */
- s.url = rts.test(cacheURL) ? cacheURL.replace(rts, "$1_=" + iIdCounter++) : cacheURL + (rquery.test(cacheURL) ? "&" : "?") + "_=" + iIdCounter++;
- }
- }
- if (s.ifModified) {
- if (jQuery.lastModified[cacheURL]) {
- jqXHR.setRequestHeader("If-Modified-Since", jQuery.lastModified[cacheURL]);
- }
- if (jQuery.etag[cacheURL]) {
- jqXHR.setRequestHeader("If-None-Match", jQuery.etag[cacheURL]);
- }
- }
- if (s.data && (s.hasContent && s.contentType !== false) || options.contentType) {
- jqXHR.setRequestHeader("Content-Type", s.contentType);
- }
- jqXHR.setRequestHeader("Accept", s.dataTypes[0] && s.accepts[s.dataTypes[0]] ? s.accepts[s.dataTypes[0]] + ("*" !== s.dataTypes[0] ? ", " + nc + "; q=0.01" : "") : s.accepts["*"]);
- for (i in s.headers) {
- jqXHR.setRequestHeader(i, s.headers[i]);
- }
- if (s.beforeSend && (s.beforeSend.call(scripts, jqXHR, s) === false || 2 === number)) {
- return jqXHR.abort();
- }
- /** @type {string} */
- strAbort = "abort";
- for (i in{
- success : 1,
- error : 1,
- complete : 1
- }) {
- jqXHR[i](s[i]);
- }
- if (transport = inspectPrefiltersOrTransports(transports, s, options, jqXHR)) {
- /** @type {number} */
- jqXHR.readyState = 1;
- if (l) {
- globalEventContext.trigger("ajaxSend", [jqXHR, s]);
- }
- if (s.async) {
- if (s.timeout > 0) {
- /** @type {number} */
- tref = setTimeout(function() {
- jqXHR.abort("timeout");
- }, s.timeout);
- }
- }
- try {
- /** @type {number} */
- number = 1;
- transport.send(requestHeaders, done);
- } catch (e) {
- if (!(2 > number)) {
- throw e;
- }
- done(-1, e);
- }
- } else {
- done(-1, "No Transport");
- }
- return jqXHR;
- },
- /**
- * @param {Object} cur
- * @param {string} data
- * @param {?} callback
- * @return {?}
- */
- getJSON : function(cur, data, callback) {
- return jQuery.get(cur, data, callback, "json");
- },
- /**
- * @param {Object} cur
- * @param {?} callback
- * @return {?}
- */
- getScript : function(cur, callback) {
- return jQuery.get(cur, void 0, callback, "script");
- }
- });
- jQuery.each(["get", "post"], function(dataAndEvents, method) {
- /**
- * @param {string} requestUrl
- * @param {Object} qualifier
- * @param {Function} success
- * @param {(Object|string)} dataType
- * @return {?}
- */
- jQuery[method] = function(requestUrl, qualifier, success, dataType) {
- return jQuery.isFunction(qualifier) && (dataType = dataType || success, success = qualifier, qualifier = void 0), jQuery.ajax({
- url : requestUrl,
- type : method,
- dataType : dataType,
- data : qualifier,
- /** @type {Function} */
- success : success
- });
- };
- });
- /**
- * @param {string} url
- * @return {?}
- */
- jQuery._evalUrl = function(url) {
- return jQuery.ajax({
- url : url,
- type : "GET",
- dataType : "script",
- async : false,
- global : false,
- "throws" : true
- });
- };
- jQuery.fn.extend({
- /**
- * @param {string} qualifier
- * @return {?}
- */
- wrapAll : function(qualifier) {
- var wrap;
- return jQuery.isFunction(qualifier) ? this.each(function(i) {
- jQuery(this).wrapAll(qualifier.call(this, i));
- }) : (this[0] && (wrap = jQuery(qualifier, this[0].ownerDocument).eq(0).clone(true), this[0].parentNode && wrap.insertBefore(this[0]), wrap.map(function() {
- var elem = this;
- for (;elem.firstElementChild;) {
- elem = elem.firstElementChild;
- }
- return elem;
- }).append(this)), this);
- },
- /**
- * @param {Function} html
- * @return {?}
- */
- wrapInner : function(html) {
- return this.each(jQuery.isFunction(html) ? function(i) {
- jQuery(this).wrapInner(html.call(this, i));
- } : function() {
- var self = jQuery(this);
- var contents = self.contents();
- if (contents.length) {
- contents.wrapAll(html);
- } else {
- self.append(html);
- }
- });
- },
- /**
- * @param {Function} html
- * @return {?}
- */
- wrap : function(html) {
- var isFunction = jQuery.isFunction(html);
- return this.each(function(i) {
- jQuery(this).wrapAll(isFunction ? html.call(this, i) : html);
- });
- },
- /**
- * @return {?}
- */
- unwrap : function() {
- return this.parent().each(function() {
- if (!jQuery.nodeName(this, "body")) {
- jQuery(this).replaceWith(this.childNodes);
- }
- }).end();
- }
- });
- /**
- * @param {string} type
- * @return {?}
- */
- jQuery.expr.filters.hidden = function(type) {
- return type.offsetWidth <= 0 && type.offsetHeight <= 0;
- };
- /**
- * @param {string} cycle
- * @return {?}
- */
- jQuery.expr.filters.visible = function(cycle) {
- return!jQuery.expr.filters.hidden(cycle);
- };
- /** @type {RegExp} */
- var rQuot = /%20/g;
- /** @type {RegExp} */
- var rmargin = /\[\]$/;
- /** @type {RegExp} */
- var rCRLF = /\r?\n/g;
- /** @type {RegExp} */
- var mouseTypeRegex = /^(?:submit|button|image|reset|file)$/i;
- /** @type {RegExp} */
- var rsubmittable = /^(?:input|select|textarea|keygen)/i;
- /**
- * @param {Object} a
- * @param {Object} traditional
- * @return {?}
- */
- jQuery.param = function(a, traditional) {
- var prefix;
- /** @type {Array} */
- var klass = [];
- /**
- * @param {?} key
- * @param {string} value
- * @return {undefined}
- */
- var add = function(key, value) {
- value = jQuery.isFunction(value) ? value() : null == value ? "" : value;
- /** @type {string} */
- klass[klass.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
- };
- if (void 0 === traditional && (traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional), jQuery.isArray(a) || a.jquery && !jQuery.isPlainObject(a)) {
- jQuery.each(a, function() {
- add(this.name, this.value);
- });
- } else {
- for (prefix in a) {
- buildParams(prefix, a[prefix], traditional, add);
- }
- }
- return klass.join("&").replace(rQuot, "+");
- };
- jQuery.fn.extend({
- /**
- * @return {?}
- */
- serialize : function() {
- return jQuery.param(this.serializeArray());
- },
- /**
- * @return {?}
- */
- serializeArray : function() {
- return this.map(function() {
- var elements = jQuery.prop(this, "elements");
- return elements ? jQuery.makeArray(elements) : this;
- }).filter(function() {
- var type = this.type;
- return this.name && (!jQuery(this).is(":disabled") && (rsubmittable.test(this.nodeName) && (!mouseTypeRegex.test(type) && (this.checked || !manipulation_rcheckableType.test(type)))));
- }).map(function(dataAndEvents, elem) {
- var val = jQuery(this).val();
- return null == val ? null : jQuery.isArray(val) ? jQuery.map(val, function(val) {
- return{
- name : elem.name,
- value : val.replace(rCRLF, "\r\n")
- };
- }) : {
- name : elem.name,
- value : val.replace(rCRLF, "\r\n")
- };
- }).get();
- }
- });
- /**
- * @return {?}
- */
- jQuery.ajaxSettings.xhr = function() {
- try {
- return new XMLHttpRequest;
- } catch (e) {
- }
- };
- /** @type {number} */
- var rightId = 0;
- var map = {};
- var xhrSuccessStatus = {
- 0 : 200,
- 1223 : 204
- };
- var xhrSupported = jQuery.ajaxSettings.xhr();
- if (win.attachEvent) {
- win.attachEvent("onunload", function() {
- var letter;
- for (letter in map) {
- map[letter]();
- }
- });
- }
- /** @type {boolean} */
- support.cors = !!xhrSupported && "withCredentials" in xhrSupported;
- /** @type {boolean} */
- support.ajax = xhrSupported = !!xhrSupported;
- jQuery.ajaxTransport(function(options) {
- var callback;
- return support.cors || xhrSupported && !options.crossDomain ? {
- /**
- * @param {Object} headers
- * @param {Function} complete
- * @return {undefined}
- */
- send : function(headers, complete) {
- var i;
- var xhr = options.xhr();
- /** @type {number} */
- var id = ++rightId;
- if (xhr.open(options.type, options.url, options.async, options.username, options.password), options.xhrFields) {
- for (i in options.xhrFields) {
- xhr[i] = options.xhrFields[i];
- }
- }
- if (options.mimeType) {
- if (xhr.overrideMimeType) {
- xhr.overrideMimeType(options.mimeType);
- }
- }
- if (!options.crossDomain) {
- if (!headers["X-Requested-With"]) {
- /** @type {string} */
- headers["X-Requested-With"] = "XMLHttpRequest";
- }
- }
- for (i in headers) {
- xhr.setRequestHeader(i, headers[i]);
- }
- /**
- * @param {string} status
- * @return {?}
- */
- callback = function(status) {
- return function() {
- if (callback) {
- delete map[id];
- /** @type {null} */
- callback = xhr.onload = xhr.onerror = null;
- if ("abort" === status) {
- xhr.abort();
- } else {
- if ("error" === status) {
- complete(xhr.status, xhr.statusText);
- } else {
- complete(xhrSuccessStatus[xhr.status] || xhr.status, xhr.statusText, "string" == typeof xhr.responseText ? {
- text : xhr.responseText
- } : void 0, xhr.getAllResponseHeaders());
- }
- }
- }
- };
- };
- xhr.onload = callback();
- xhr.onerror = callback("error");
- callback = map[id] = callback("abort");
- try {
- xhr.send(options.hasContent && options.data || null);
- } catch (a) {
- if (callback) {
- throw a;
- }
- }
- },
- /**
- * @return {undefined}
- */
- abort : function() {
- if (callback) {
- callback();
- }
- }
- } : void 0;
- });
- jQuery.ajaxSetup({
- accepts : {
- script : "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
- },
- contents : {
- script : /(?:java|ecma)script/
- },
- converters : {
- /**
- * @param {string} value
- * @return {?}
- */
- "text script" : function(value) {
- return jQuery.globalEval(value), value;
- }
- }
- });
- jQuery.ajaxPrefilter("script", function(s) {
- if (void 0 === s.cache) {
- /** @type {boolean} */
- s.cache = false;
- }
- if (s.crossDomain) {
- /** @type {string} */
- s.type = "GET";
- }
- });
- jQuery.ajaxTransport("script", function(s) {
- if (s.crossDomain) {
- var script;
- var callback;
- return{
- /**
- * @param {?} _
- * @param {Function} complete
- * @return {undefined}
- */
- send : function(_, complete) {
- script = jQuery("<script>").prop({
- async : true,
- charset : s.scriptCharset,
- src : s.url
- }).on("load error", callback = function(evt) {
- script.remove();
- /** @type {null} */
- callback = null;
- if (evt) {
- complete("error" === evt.type ? 404 : 200, evt.type);
- }
- });
- node.head.appendChild(script[0]);
- },
- /**
- * @return {undefined}
- */
- abort : function() {
- if (callback) {
- callback();
- }
- }
- };
- }
- });
- /** @type {Array} */
- var eventPath = [];
- /** @type {RegExp} */
- var rjsonp = /(=)\?(?=&|$)|\?\?/;
- jQuery.ajaxSetup({
- jsonp : "callback",
- /**
- * @return {?}
- */
- jsonpCallback : function() {
- var unlock = eventPath.pop() || jQuery.expando + "_" + iIdCounter++;
- return this[unlock] = true, unlock;
- }
- });
- jQuery.ajaxPrefilter("json jsonp", function(s, originalSettings, jqXHR) {
- var name;
- var copy;
- var a;
- /** @type {(boolean|string)} */
- var jsonProp = s.jsonp !== false && (rjsonp.test(s.url) ? "url" : "string" == typeof s.data && (!(s.contentType || "").indexOf("application/x-www-form-urlencoded") && (rjsonp.test(s.data) && "data")));
- return jsonProp || "jsonp" === s.dataTypes[0] ? (name = s.jsonpCallback = jQuery.isFunction(s.jsonpCallback) ? s.jsonpCallback() : s.jsonpCallback, jsonProp ? s[jsonProp] = s[jsonProp].replace(rjsonp, "$1" + name) : s.jsonp !== false && (s.url += (rquery.test(s.url) ? "&" : "?") + s.jsonp + "=" + name), s.converters["script json"] = function() {
- return a || jQuery.error(name + " was not called"), a[0];
- }, s.dataTypes[0] = "json", copy = win[name], win[name] = function() {
- /** @type {Arguments} */
- a = arguments;
- }, jqXHR.always(function() {
- win[name] = copy;
- if (s[name]) {
- s.jsonpCallback = originalSettings.jsonpCallback;
- eventPath.push(name);
- }
- if (a) {
- if (jQuery.isFunction(copy)) {
- copy(a[0]);
- }
- }
- a = copy = void 0;
- }), "script") : void 0;
- });
- /**
- * @param {?} data
- * @param {Object} context
- * @param {(Function|string)} keepScripts
- * @return {?}
- */
- jQuery.parseHTML = function(data, context, keepScripts) {
- if (!data || "string" != typeof data) {
- return null;
- }
- if ("boolean" == typeof context) {
- /** @type {Object} */
- keepScripts = context;
- /** @type {boolean} */
- context = false;
- }
- context = context || node;
- /** @type {(Array.<string>|null)} */
- var parsed = rsingleTag.exec(data);
- /** @type {(Array|boolean)} */
- var scripts = !keepScripts && [];
- return parsed ? [context.createElement(parsed[1])] : (parsed = jQuery.buildFragment([data], context, scripts), scripts && (scripts.length && jQuery(scripts).remove()), jQuery.merge([], parsed.childNodes));
- };
- /** @type {function ((Function|string), Object, Object): ?} */
- var matcherFunction = jQuery.fn.load;
- /**
- * @param {(Function|string)} url
- * @param {Object} data
- * @param {Object} attributes
- * @return {?}
- */
- jQuery.fn.load = function(url, data, attributes) {
- if ("string" != typeof url && matcherFunction) {
- return matcherFunction.apply(this, arguments);
- }
- var selector;
- var type;
- var response;
- var self = this;
- var off = url.indexOf(" ");
- return off >= 0 && (selector = jQuery.trim(url.slice(off)), url = url.slice(0, off)), jQuery.isFunction(data) ? (attributes = data, data = void 0) : data && ("object" == typeof data && (type = "POST")), self.length > 0 && jQuery.ajax({
- url : url,
- type : type,
- dataType : "html",
- data : data
- }).done(function(responseText) {
- /** @type {Arguments} */
- response = arguments;
- self.html(selector ? jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector) : responseText);
- }).complete(attributes && function(type, elems) {
- self.each(attributes, response || [type.responseText, elems, type]);
- }), this;
- };
- jQuery.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function(dataAndEvents, name) {
- /**
- * @param {Function} selector
- * @return {?}
- */
- jQuery.fn[name] = function(selector) {
- return this.on(name, selector);
- };
- });
- /**
- * @param {undefined} elem
- * @return {?}
- */
- jQuery.expr.filters.animated = function(elem) {
- return jQuery.grep(jQuery.timers, function(fn) {
- return elem === fn.elem;
- }).length;
- };
- var docElem = win.document.documentElement;
- jQuery.offset = {
- /**
- * @param {string} elem
- * @param {Object} options
- * @param {number} i
- * @return {undefined}
- */
- setOffset : function(elem, options, i) {
- var curPosition;
- var curLeft;
- var curCSSTop;
- var curTop;
- var curOffset;
- var curCSSLeft;
- var l;
- var position = jQuery.css(elem, "position");
- var curElem = jQuery(elem);
- var props = {};
- if ("static" === position) {
- /** @type {string} */
- elem.style.position = "relative";
- }
- curOffset = curElem.offset();
- curCSSTop = jQuery.css(elem, "top");
- curCSSLeft = jQuery.css(elem, "left");
- /** @type {boolean} */
- l = ("absolute" === position || "fixed" === position) && (curCSSTop + curCSSLeft).indexOf("auto") > -1;
- if (l) {
- curPosition = curElem.position();
- curTop = curPosition.top;
- curLeft = curPosition.left;
- } else {
- /** @type {number} */
- curTop = parseFloat(curCSSTop) || 0;
- /** @type {number} */
- curLeft = parseFloat(curCSSLeft) || 0;
- }
- if (jQuery.isFunction(options)) {
- options = options.call(elem, i, curOffset);
- }
- if (null != options.top) {
- /** @type {number} */
- props.top = options.top - curOffset.top + curTop;
- }
- if (null != options.left) {
- /** @type {number} */
- props.left = options.left - curOffset.left + curLeft;
- }
- if ("using" in options) {
- options.using.call(elem, props);
- } else {
- curElem.css(props);
- }
- }
- };
- jQuery.fn.extend({
- /**
- * @param {number} x
- * @return {?}
- */
- offset : function(x) {
- if (arguments.length) {
- return void 0 === x ? this : this.each(function(dataName) {
- jQuery.offset.setOffset(this, x, dataName);
- });
- }
- var doc;
- var win;
- var b = this[0];
- var box = {
- top : 0,
- left : 0
- };
- var element = b && b.ownerDocument;
- return element ? (doc = element.documentElement, jQuery.contains(doc, b) ? (typeof b.getBoundingClientRect !== text && (box = b.getBoundingClientRect()), win = getWindow(element), {
- top : box.top + win.pageYOffset - doc.clientTop,
- left : box.left + win.pageXOffset - doc.clientLeft
- }) : box) : void 0;
- },
- /**
- * @return {?}
- */
- position : function() {
- if (this[0]) {
- var offsetParent;
- var offset;
- var body = this[0];
- var parentOffset = {
- top : 0,
- left : 0
- };
- return "fixed" === jQuery.css(body, "position") ? offset = body.getBoundingClientRect() : (offsetParent = this.offsetParent(), offset = this.offset(), jQuery.nodeName(offsetParent[0], "html") || (parentOffset = offsetParent.offset()), parentOffset.top += jQuery.css(offsetParent[0], "borderTopWidth", true), parentOffset.left += jQuery.css(offsetParent[0], "borderLeftWidth", true)), {
- top : offset.top - parentOffset.top - jQuery.css(body, "marginTop", true),
- left : offset.left - parentOffset.left - jQuery.css(body, "marginLeft", true)
- };
- }
- },
- /**
- * @return {?}
- */
- offsetParent : function() {
- return this.map(function() {
- var offsetParent = this.offsetParent || docElem;
- for (;offsetParent && (!jQuery.nodeName(offsetParent, "html") && "static" === jQuery.css(offsetParent, "position"));) {
- offsetParent = offsetParent.offsetParent;
- }
- return offsetParent || docElem;
- });
- }
- });
- jQuery.each({
- scrollLeft : "pageXOffset",
- scrollTop : "pageYOffset"
- }, function(name, prop) {
- /** @type {boolean} */
- var top = "pageYOffset" === prop;
- /**
- * @param {string} isXML
- * @return {?}
- */
- jQuery.fn[name] = function(isXML) {
- return access(this, function(element, k, val) {
- var obj = getWindow(element);
- return void 0 === val ? obj ? obj[prop] : element[k] : void(obj ? obj.scrollTo(top ? win.pageXOffset : val, top ? val : win.pageYOffset) : element[k] = val);
- }, name, isXML, arguments.length, null);
- };
- });
- jQuery.each(["top", "left"], function(dataAndEvents, prop) {
- jQuery.cssHooks[prop] = addGetHookIf(support.pixelPosition, function(scripts, val) {
- return val ? (val = get(scripts, prop), regexp.test(val) ? jQuery(scripts).position()[prop] + "px" : val) : void 0;
- });
- });
- jQuery.each({
- Height : "height",
- Width : "width"
- }, function(name, type) {
- jQuery.each({
- padding : "inner" + name,
- content : type,
- "" : "outer" + name
- }, function(defaultExtra, original) {
- /**
- * @param {?} margin
- * @param {boolean} value
- * @return {?}
- */
- jQuery.fn[original] = function(margin, value) {
- var chainable = arguments.length && (defaultExtra || "boolean" != typeof margin);
- var extra = defaultExtra || (margin === true || value === true ? "margin" : "border");
- return access(this, function(elem, prop, value) {
- var doc;
- return jQuery.isWindow(elem) ? elem.document.documentElement["client" + name] : 9 === elem.nodeType ? (doc = elem.documentElement, Math.max(elem.body["scroll" + name], doc["scroll" + name], elem.body["offset" + name], doc["offset" + name], doc["client" + name])) : void 0 === value ? jQuery.css(elem, prop, extra) : jQuery.style(elem, prop, value, extra);
- }, type, chainable ? margin : void 0, chainable, null);
- };
- });
- });
- /**
- * @return {?}
- */
- jQuery.fn.size = function() {
- return this.length;
- };
- jQuery.fn.andSelf = jQuery.fn.addBack;
- if ("function" == typeof define) {
- if (define.amd) {
- define("jquery", [], function() {
- return jQuery;
- });
- }
- }
- var $ = win.jQuery;
- var _$ = win.$;
- return jQuery.noConflict = function(deep) {
- return win.$ === jQuery && (win.$ = _$), deep && (win.jQuery === jQuery && (win.jQuery = $)), jQuery;
- }, typeof dataAndEvents === text && (win.jQuery = win.$ = jQuery), jQuery;
- });
- if ("undefined" == typeof jQuery) {
- throw new Error("Bootstrap's JavaScript requires jQuery");
- }
- +function($) {
- var b = $.fn.jquery.split(" ")[0].split(".");
- if (b[0] < 2 && b[1] < 9 || 1 == b[0] && (9 == b[1] && b[2] < 1)) {
- throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher");
- }
- }(jQuery), +function($) {
- /**
- * @return {?}
- */
- function transitionEnd() {
- /** @type {Element} */
- var el = document.createElement("bootstrap");
- var transEndEventNames = {
- WebkitTransition : "webkitTransitionEnd",
- MozTransition : "transitionend",
- OTransition : "oTransitionEnd otransitionend",
- transition : "transitionend"
- };
- var name;
- for (name in transEndEventNames) {
- if (void 0 !== el.style[name]) {
- return{
- end : transEndEventNames[name]
- };
- }
- }
- return false;
- }
- /**
- * @param {number} duration
- * @return {?}
- */
- $.fn.emulateTransitionEnd = function(duration) {
- /** @type {boolean} */
- var c = false;
- var $el = this;
- $(this).one("bsTransitionEnd", function() {
- /** @type {boolean} */
- c = true;
- });
- /**
- * @return {undefined}
- */
- var callback = function() {
- if (!c) {
- $($el).trigger($.support.transition.end);
- }
- };
- return setTimeout(callback, duration), this;
- };
- $(function() {
- $.support.transition = transitionEnd();
- if ($.support.transition) {
- $.event.special.bsTransitionEnd = {
- bindType : $.support.transition.end,
- delegateType : $.support.transition.end,
- /**
- * @param {Event} event
- * @return {?}
- */
- handle : function(event) {
- return $(event.target).is(this) ? event.handleObj.handler.apply(this, arguments) : void 0;
- }
- };
- }
- });
- }(jQuery), +function($) {
- /**
- * @param {?} type
- * @return {?}
- */
- function setValue(type) {
- return this.each(function() {
- var $this = $(this);
- var data = $this.data("bs.alert");
- if (!data) {
- $this.data("bs.alert", data = new Alert(this));
- }
- if ("string" == typeof type) {
- data[type].call($this);
- }
- });
- }
- /** @type {string} */
- var className = '[data-dismiss="alert"]';
- /**
- * @param {string} selector
- * @return {undefined}
- */
- var Alert = function(selector) {
- $(selector).on("click", className, this.close);
- };
- /** @type {string} */
- Alert.VERSION = "3.3.0";
- /** @type {number} */
- Alert.TRANSITION_DURATION = 150;
- /**
- * @param {Object} e
- * @return {undefined}
- */
- Alert.prototype.close = function(e) {
- /**
- * @return {undefined}
- */
- function removeElement() {
- $parent.detach().trigger("closed.bs.alert").remove();
- }
- var $this = $(this);
- var selector = $this.attr("data-target");
- if (!selector) {
- selector = $this.attr("href");
- selector = selector && selector.replace(/.*(?=#[^\s]*$)/, "");
- }
- var $parent = $(selector);
- if (e) {
- e.preventDefault();
- }
- if (!$parent.length) {
- $parent = $this.closest(".alert");
- }
- $parent.trigger(e = $.Event("close.bs.alert"));
- if (!e.isDefaultPrevented()) {
- $parent.removeClass("in");
- if ($.support.transition && $parent.hasClass("fade")) {
- $parent.one("bsTransitionEnd", removeElement).emulateTransitionEnd(Alert.TRANSITION_DURATION);
- } else {
- removeElement();
- }
- }
- };
- var old = $.fn.alert;
- /** @type {function (?): ?} */
- $.fn.alert = setValue;
- /** @type {function (string): undefined} */
- $.fn.alert.Constructor = Alert;
- /**
- * @return {?}
- */
- $.fn.alert.noConflict = function() {
- return $.fn.alert = old, this;
- };
- $(document).on("click.bs.alert.data-api", className, Alert.prototype.close);
- }(jQuery), +function($) {
- /**
- * @param {string} option
- * @return {?}
- */
- function init(option) {
- return this.each(function() {
- var $this = $(this);
- var data = $this.data("bs.button");
- var options = "object" == typeof option && option;
- if (!data) {
- $this.data("bs.button", data = new Button(this, options));
- }
- if ("toggle" == option) {
- data.toggle();
- } else {
- if (option) {
- data.setState(option);
- }
- }
- });
- }
- /**
- * @param {string} selector
- * @param {?} options
- * @return {undefined}
- */
- var Button = function(selector, options) {
- this.$element = $(selector);
- this.options = $.extend({}, Button.DEFAULTS, options);
- /** @type {boolean} */
- this.isLoading = false;
- };
- /** @type {string} */
- Button.VERSION = "3.3.0";
- Button.DEFAULTS = {
- loadingText : "loading..."
- };
- /**
- * @param {string} state
- * @return {undefined}
- */
- Button.prototype.setState = function(state) {
- /** @type {string} */
- var elem = "disabled";
- var $el = this.$element;
- /** @type {string} */
- var val = $el.is("input") ? "val" : "html";
- var data = $el.data();
- state += "Text";
- if (null == data.resetText) {
- $el.data("resetText", $el[val]());
- }
- setTimeout($.proxy(function() {
- $el[val](null == data[state] ? this.options[state] : data[state]);
- if ("loadingText" == state) {
- /** @type {boolean} */
- this.isLoading = true;
- $el.addClass(elem).attr(elem, elem);
- } else {
- if (this.isLoading) {
- /** @type {boolean} */
- this.isLoading = false;
- $el.removeClass(elem).removeAttr(elem);
- }
- }
- }, this), 0);
- };
- /**
- * @return {undefined}
- */
- Button.prototype.toggle = function() {
- /** @type {boolean} */
- var a = true;
- var $shcell = this.$element.closest('[data-toggle="buttons"]');
- if ($shcell.length) {
- var $input = this.$element.find("input");
- if ("radio" == $input.prop("type")) {
- if ($input.prop("checked") && this.$element.hasClass("active")) {
- /** @type {boolean} */
- a = false;
- } else {
- $shcell.find(".active").removeClass("active");
- }
- }
- if (a) {
- $input.prop("checked", !this.$element.hasClass("active")).trigger("change");
- }
- } else {
- this.$element.attr("aria-pressed", !this.$element.hasClass("active"));
- }
- if (a) {
- this.$element.toggleClass("active");
- }
- };
- var old = $.fn.button;
- /** @type {function (string): ?} */
- $.fn.button = init;
- /** @type {function (string, ?): undefined} */
- $.fn.button.Constructor = Button;
- /**
- * @return {?}
- */
- $.fn.button.noConflict = function() {
- return $.fn.button = old, this;
- };
- $(document).on("click.bs.button.data-api", '[data-toggle^="button"]', function(evt) {
- var self = $(evt.target);
- if (!self.hasClass("btn")) {
- self = self.closest(".btn");
- }
- init.call(self, "toggle");
- evt.preventDefault();
- }).on("focus.bs.button.data-api blur.bs.button.data-api", '[data-toggle^="button"]', function(ev) {
- $(ev.target).closest(".btn").toggleClass("focus", "focus" == ev.type);
- });
- }(jQuery), +function($) {
- /**
- * @param {number} option
- * @return {?}
- */
- function init(option) {
- return this.each(function() {
- var $this = $(this);
- var data = $this.data("bs.carousel");
- var options = $.extend({}, Carousel.DEFAULTS, $this.data(), "object" == typeof option && option);
- var action = "string" == typeof option ? option : options.slide;
- if (!data) {
- $this.data("bs.carousel", data = new Carousel(this, options));
- }
- if ("number" == typeof option) {
- data.to(option);
- } else {
- if (action) {
- data[action]();
- } else {
- if (options.interval) {
- data.pause().cycle();
- }
- }
- }
- });
- }
- /**
- * @param {string} selector
- * @param {Object} options
- * @return {undefined}
- */
- var Carousel = function(selector, options) {
- this.$element = $(selector);
- this.$indicators = this.$element.find(".carousel-indicators");
- /** @type {Object} */
- this.options = options;
- /** @type {null} */
- this.paused = this.sliding = this.interval = this.$active = this.$items = null;
- if (this.options.keyboard) {
- this.$element.on("keydown.bs.carousel", $.proxy(this.keydown, this));
- }
- if ("hover" == this.options.pause) {
- if (!("ontouchstart" in document.documentElement)) {
- this.$element.on("mouseenter.bs.carousel", $.proxy(this.pause, this)).on("mouseleave.bs.carousel", $.proxy(this.cycle, this));
- }
- }
- };
- /** @type {string} */
- Carousel.VERSION = "3.3.0";
- /** @type {number} */
- Carousel.TRANSITION_DURATION = 600;
- Carousel.DEFAULTS = {
- interval : 5E3,
- pause : "hover",
- wrap : true,
- keyboard : true
- };
- /**
- * @param {Event} e
- * @return {undefined}
- */
- Carousel.prototype.keydown = function(e) {
- switch(e.which) {
- case 37:
- this.prev();
- break;
- case 39:
- this.next();
- break;
- default:
- return;
- }
- e.preventDefault();
- };
- /**
- * @param {boolean} dataAndEvents
- * @return {?}
- */
- Carousel.prototype.cycle = function(dataAndEvents) {
- return dataAndEvents || (this.paused = false), this.interval && clearInterval(this.interval), this.options.interval && (!this.paused && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))), this;
- };
- /**
- * @param {?} $item
- * @return {?}
- */
- Carousel.prototype.getItemIndex = function($item) {
- return this.$items = $item.parent().children(".item"), this.$items.index($item || this.$active);
- };
- /**
- * @param {string} a
- * @param {?} item
- * @return {?}
- */
- Carousel.prototype.getItemForDirection = function(a, item) {
- /** @type {number} */
- var count = "prev" == a ? -1 : 1;
- var index = this.getItemIndex(item);
- /** @type {number} */
- var idx = (index + count) % this.$items.length;
- return this.$items.eq(idx);
- };
- /**
- * @param {number} pos
- * @return {?}
- */
- Carousel.prototype.to = function(pos) {
- var that = this;
- var activePos = this.getItemIndex(this.$active = this.$element.find(".item.active"));
- return pos > this.$items.length - 1 || 0 > pos ? void 0 : this.sliding ? this.$element.one("slid.bs.carousel", function() {
- that.to(pos);
- }) : activePos == pos ? this.pause().cycle() : this.slide(pos > activePos ? "next" : "prev", this.$items.eq(pos));
- };
- /**
- * @param {boolean} $vid
- * @return {?}
- */
- Carousel.prototype.pause = function($vid) {
- return $vid || (this.paused = true), this.$element.find(".next, .prev").length && ($.support.transition && (this.$element.trigger($.support.transition.end), this.cycle(true))), this.interval = clearInterval(this.interval), this;
- };
- /**
- * @return {?}
- */
- Carousel.prototype.next = function() {
- return this.sliding ? void 0 : this.slide("next");
- };
- /**
- * @return {?}
- */
- Carousel.prototype.prev = function() {
- return this.sliding ? void 0 : this.slide("prev");
- };
- /**
- * @param {string} a
- * @param {string} next
- * @return {?}
- */
- Carousel.prototype.slide = function(a, next) {
- var self = this.$element.find(".item.active");
- var $next = next || this.getItemForDirection(a, self);
- var isCycling = this.interval;
- /** @type {string} */
- var direction = "next" == a ? "left" : "right";
- /** @type {string} */
- var fallback = "next" == a ? "first" : "last";
- var that = this;
- if (!$next.length) {
- if (!this.options.wrap) {
- return;
- }
- $next = this.$element.find(".item")[fallback]();
- }
- if ($next.hasClass("active")) {
- return this.sliding = false;
- }
- var previous = $next[0];
- var cycle = $.Event("slide.bs.carousel", {
- relatedTarget : previous,
- direction : direction
- });
- if (this.$element.trigger(cycle), !cycle.isDefaultPrevented()) {
- if (this.sliding = true, isCycling && this.pause(), this.$indicators.length) {
- this.$indicators.find(".active").removeClass("active");
- var $listing = $(this.$indicators.children()[this.getItemIndex($next)]);
- if ($listing) {
- $listing.addClass("active");
- }
- }
- var fix = $.Event("slid.bs.carousel", {
- relatedTarget : previous,
- direction : direction
- });
- return $.support.transition && this.$element.hasClass("slide") ? ($next.addClass(a), $next[0].offsetWidth, self.addClass(direction), $next.addClass(direction), self.one("bsTransitionEnd", function() {
- $next.removeClass([a, direction].join(" ")).addClass("active");
- self.removeClass(["active", direction].join(" "));
- /** @type {boolean} */
- that.sliding = false;
- setTimeout(function() {
- that.$element.trigger(fix);
- }, 0);
- }).emulateTransitionEnd(Carousel.TRANSITION_DURATION)) : (self.removeClass("active"), $next.addClass("active"), this.sliding = false, this.$element.trigger(fix)), isCycling && this.cycle(), this;
- }
- };
- var old = $.fn.carousel;
- /** @type {function (number): ?} */
- $.fn.carousel = init;
- /** @type {function (string, Object): undefined} */
- $.fn.carousel.Constructor = Carousel;
- /**
- * @return {?}
- */
- $.fn.carousel.noConflict = function() {
- return $.fn.carousel = old, this;
- };
- /**
- * @param {?} event
- * @return {undefined}
- */
- var start = function(event) {
- var href;
- var $this = $(this);
- var panel = $($this.attr("data-target") || (href = $this.attr("href")) && href.replace(/.*(?=#[^\s]+$)/, ""));
- if (panel.hasClass("carousel")) {
- var next = $.extend({}, panel.data(), $this.data());
- var slideIndex = $this.attr("data-slide-to");
- if (slideIndex) {
- /** @type {boolean} */
- next.interval = false;
- }
- init.call(panel, next);
- if (slideIndex) {
- panel.data("bs.carousel").to(slideIndex);
- }
- event.preventDefault();
- }
- };
- $(document).on("click.bs.carousel.data-api", "[data-slide]", start).on("click.bs.carousel.data-api", "[data-slide-to]", start);
- $(window).on("load", function() {
- $('[data-ride="carousel"]').each(function() {
- var self = $(this);
- init.call(self, self.data());
- });
- });
- }(jQuery), +function($) {
- /**
- * @param {HTMLElement} $this
- * @return {?}
- */
- function getParent($this) {
- var href;
- var statsTemplate = $this.attr("data-target") || (href = $this.attr("href")) && href.replace(/.*(?=#[^\s]+$)/, "");
- return $(statsTemplate);
- }
- /**
- * @param {Function} options
- * @return {?}
- */
- function build(options) {
- return this.each(function() {
- var $this = $(this);
- var data = $this.data("bs.collapse");
- var settings = $.extend({}, Collapse.DEFAULTS, $this.data(), "object" == typeof options && options);
- if (!data) {
- if (settings.toggle) {
- if ("show" == options) {
- /** @type {boolean} */
- settings.toggle = false;
- }
- }
- }
- if (!data) {
- $this.data("bs.collapse", data = new Collapse(this, settings));
- }
- if ("string" == typeof options) {
- data[options]();
- }
- });
- }
- /**
- * @param {string} selector
- * @param {?} options
- * @return {undefined}
- */
- var Collapse = function(selector, options) {
- this.$element = $(selector);
- this.options = $.extend({}, Collapse.DEFAULTS, options);
- this.$trigger = $(this.options.trigger).filter('[href="#' + selector.id + '"], [data-target="#' + selector.id + '"]');
- /** @type {null} */
- this.transitioning = null;
- if (this.options.parent) {
- this.$parent = this.getParent();
- } else {
- this.addAriaAndCollapsedClass(this.$element, this.$trigger);
- }
- if (this.options.toggle) {
- this.toggle();
- }
- };
- /** @type {string} */
- Collapse.VERSION = "3.3.0";
- /** @type {number} */
- Collapse.TRANSITION_DURATION = 350;
- Collapse.DEFAULTS = {
- toggle : true,
- trigger : '[data-toggle="collapse"]'
- };
- /**
- * @return {?}
- */
- Collapse.prototype.dimension = function() {
- var hasWidth = this.$element.hasClass("width");
- return hasWidth ? "width" : "height";
- };
- /**
- * @return {?}
- */
- Collapse.prototype.show = function() {
- if (!this.transitioning && !this.$element.hasClass("in")) {
- var hasData;
- var self = this.$parent && this.$parent.find("> .panel").children(".in, .collapsing");
- if (!(self && (self.length && (hasData = self.data("bs.collapse"), hasData && hasData.transitioning)))) {
- var cycle = $.Event("show.bs.collapse");
- if (this.$element.trigger(cycle), !cycle.isDefaultPrevented()) {
- if (self) {
- if (self.length) {
- build.call(self, "hide");
- if (!hasData) {
- self.data("bs.collapse", null);
- }
- }
- }
- var dimension = this.dimension();
- this.$element.removeClass("collapse").addClass("collapsing")[dimension](0).attr("aria-expanded", true);
- this.$trigger.removeClass("collapsed").attr("aria-expanded", true);
- /** @type {number} */
- this.transitioning = 1;
- /**
- * @return {undefined}
- */
- var complete = function() {
- this.$element.removeClass("collapsing").addClass("collapse in")[dimension]("");
- /** @type {number} */
- this.transitioning = 0;
- this.$element.trigger("shown.bs.collapse");
- };
- if (!$.support.transition) {
- return complete.call(this);
- }
- var scrollSize = $.camelCase(["scroll", dimension].join("-"));
- this.$element.one("bsTransitionEnd", $.proxy(complete, this)).emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize]);
- }
- }
- }
- };
- /**
- * @return {?}
- */
- Collapse.prototype.hide = function() {
- if (!this.transitioning && this.$element.hasClass("in")) {
- var cycle = $.Event("hide.bs.collapse");
- if (this.$element.trigger(cycle), !cycle.isDefaultPrevented()) {
- var dimension = this.dimension();
- this.$element[dimension](this.$element[dimension]())[0].offsetHeight;
- this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded", false);
- this.$trigger.addClass("collapsed").attr("aria-expanded", false);
- /** @type {number} */
- this.transitioning = 1;
- /**
- * @return {undefined}
- */
- var complete = function() {
- /** @type {number} */
- this.transitioning = 0;
- this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse");
- };
- return $.support.transition ? void this.$element[dimension](0).one("bsTransitionEnd", $.proxy(complete, this)).emulateTransitionEnd(Collapse.TRANSITION_DURATION) : complete.call(this);
- }
- }
- };
- /**
- * @return {undefined}
- */
- Collapse.prototype.toggle = function() {
- this[this.$element.hasClass("in") ? "hide" : "show"]();
- };
- /**
- * @return {?}
- */
- Collapse.prototype.getParent = function() {
- return $(this.options.parent).find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]').each($.proxy(function(dataAndEvents, thisObject) {
- var $this = $(thisObject);
- this.addAriaAndCollapsedClass(getParent($this), $this);
- }, this)).end();
- };
- /**
- * @param {HTMLElement} element
- * @param {?} el
- * @return {undefined}
- */
- Collapse.prototype.addAriaAndCollapsedClass = function(element, el) {
- var show = element.hasClass("in");
- element.attr("aria-expanded", show);
- el.toggleClass("collapsed", !show).attr("aria-expanded", show);
- };
- var old = $.fn.collapse;
- /** @type {function (Function): ?} */
- $.fn.collapse = build;
- /** @type {function (string, ?): undefined} */
- $.fn.collapse.Constructor = Collapse;
- /**
- * @return {?}
- */
- $.fn.collapse.noConflict = function() {
- return $.fn.collapse = old, this;
- };
- $(document).on("click.bs.collapse.data-api", '[data-toggle="collapse"]', function(types) {
- var $this = $(this);
- if (!$this.attr("data-target")) {
- types.preventDefault();
- }
- var value = getParent($this);
- var data = value.data("bs.collapse");
- var option = data ? "toggle" : $.extend({}, $this.data(), {
- trigger : this
- });
- build.call(value, option);
- });
- }(jQuery), +function($) {
- /**
- * @param {Object} e
- * @return {undefined}
- */
- function clearMenus(e) {
- if (!(e && 3 === e.which)) {
- $(backdrop).remove();
- $(selector).each(function() {
- var $this = $(this);
- var $parent = getParent($this);
- var args = {
- relatedTarget : this
- };
- if ($parent.hasClass("open")) {
- $parent.trigger(e = $.Event("hide.bs.dropdown", args));
- if (!e.isDefaultPrevented()) {
- $this.attr("aria-expanded", "false");
- $parent.removeClass("open").trigger("hidden.bs.dropdown", args);
- }
- }
- });
- }
- }
- /**
- * @param {Element} $this
- * @return {?}
- */
- function getParent($this) {
- var selector = $this.attr("data-target");
- if (!selector) {
- selector = $this.attr("href");
- selector = selector && (/#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, ""));
- }
- var $parent = selector && $(selector);
- return $parent && $parent.length ? $parent : $this.parent();
- }
- /**
- * @param {?} type
- * @return {?}
- */
- function setValue(type) {
- return this.each(function() {
- var $this = $(this);
- var data = $this.data("bs.dropdown");
- if (!data) {
- $this.data("bs.dropdown", data = new Dropdown(this));
- }
- if ("string" == typeof type) {
- data[type].call($this);
- }
- });
- }
- /** @type {string} */
- var backdrop = ".dropdown-backdrop";
- /** @type {string} */
- var selector = '[data-toggle="dropdown"]';
- /**
- * @param {string} selector
- * @return {undefined}
- */
- var Dropdown = function(selector) {
- $(selector).on("click.bs.dropdown", this.toggle);
- };
- /** @type {string} */
- Dropdown.VERSION = "3.3.0";
- /**
- * @param {Object} e
- * @return {?}
- */
- Dropdown.prototype.toggle = function(e) {
- var $this = $(this);
- if (!$this.is(".disabled, :disabled")) {
- var $parent = getParent($this);
- var isActive = $parent.hasClass("open");
- if (clearMenus(), !isActive) {
- if ("ontouchstart" in document.documentElement) {
- if (!$parent.closest(".navbar-nav").length) {
- $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on("click", clearMenus);
- }
- }
- var args = {
- relatedTarget : this
- };
- if ($parent.trigger(e = $.Event("show.bs.dropdown", args)), e.isDefaultPrevented()) {
- return;
- }
- $this.trigger("focus").attr("aria-expanded", "true");
- $parent.toggleClass("open").trigger("shown.bs.dropdown", args);
- }
- return false;
- }
- };
- /**
- * @param {Event} event
- * @return {?}
- */
- Dropdown.prototype.keydown = function(event) {
- if (/(38|40|27|32)/.test(event.which)) {
- var $this = $(this);
- if (event.preventDefault(), event.stopPropagation(), !$this.is(".disabled, :disabled")) {
- var $parent = getParent($this);
- var isActive = $parent.hasClass("open");
- if (!isActive && 27 != event.which || isActive && 27 == event.which) {
- return 27 == event.which && $parent.find(selector).trigger("focus"), $this.trigger("click");
- }
- /** @type {string} */
- var desc = " li:not(.divider):visible a";
- var $row = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc);
- if ($row.length) {
- var url = $row.index(event.target);
- if (38 == event.which) {
- if (url > 0) {
- url--;
- }
- }
- if (40 == event.which) {
- if (url < $row.length - 1) {
- url++;
- }
- }
- if (!~url) {
- /** @type {number} */
- url = 0;
- }
- $row.eq(url).trigger("focus");
- }
- }
- }
- };
- var old = $.fn.dropdown;
- /** @type {function (?): ?} */
- $.fn.dropdown = setValue;
- /** @type {function (string): undefined} */
- $.fn.dropdown.Constructor = Dropdown;
- /**
- * @return {?}
- */
- $.fn.dropdown.noConflict = function() {
- return $.fn.dropdown = old, this;
- };
- $(document).on("click.bs.dropdown.data-api", clearMenus).on("click.bs.dropdown.data-api", ".dropdown form", function(event) {
- event.stopPropagation();
- }).on("click.bs.dropdown.data-api", selector, Dropdown.prototype.toggle).on("keydown.bs.dropdown.data-api", selector, Dropdown.prototype.keydown).on("keydown.bs.dropdown.data-api", '[role="menu"]', Dropdown.prototype.keydown).on("keydown.bs.dropdown.data-api", '[role="listbox"]', Dropdown.prototype.keydown);
- }(jQuery), +function($) {
- /**
- * @param {boolean} options
- * @param {Function} value
- * @return {?}
- */
- function init(options, value) {
- return this.each(function() {
- var $this = $(this);
- var data = $this.data("bs.modal");
- var about = $.extend({}, Modal.DEFAULTS, $this.data(), "object" == typeof options && options);
- if (!data) {
- $this.data("bs.modal", data = new Modal(this, about));
- }
- if ("string" == typeof options) {
- data[options](value);
- } else {
- if (about.show) {
- data.show(value);
- }
- }
- });
- }
- /**
- * @param {string} selector
- * @param {Object} options
- * @return {undefined}
- */
- var Modal = function(selector, options) {
- /** @type {Object} */
- this.options = options;
- this.$body = $(document.body);
- this.$element = $(selector);
- /** @type {null} */
- this.$backdrop = this.isShown = null;
- /** @type {number} */
- this.scrollbarWidth = 0;
- if (this.options.remote) {
- this.$element.find(".modal-content").load(this.options.remote, $.proxy(function() {
- this.$element.trigger("loaded.bs.modal");
- }, this));
- }
- };
- /** @type {string} */
- Modal.VERSION = "3.3.0";
- /** @type {number} */
- Modal.TRANSITION_DURATION = 300;
- /** @type {number} */
- Modal.BACKDROP_TRANSITION_DURATION = 150;
- Modal.DEFAULTS = {
- backdrop : true,
- keyboard : true,
- show : true
- };
- /**
- * @param {Function} callback
- * @return {?}
- */
- Modal.prototype.toggle = function(callback) {
- return this.isShown ? this.hide() : this.show(callback);
- };
- /**
- * @param {Function} callback
- * @return {undefined}
- */
- Modal.prototype.show = function(callback) {
- var that = this;
- var cycle = $.Event("show.bs.modal", {
- /** @type {Function} */
- relatedTarget : callback
- });
- this.$element.trigger(cycle);
- if (!this.isShown) {
- if (!cycle.isDefaultPrevented()) {
- /** @type {boolean} */
- this.isShown = true;
- this.checkScrollbar();
- this.$body.addClass("modal-open");
- this.setScrollbar();
- this.escape();
- this.$element.on("click.dismiss.bs.modal", '[data-dismiss="modal"]', $.proxy(this.hide, this));
- this.backdrop(function() {
- var e = $.support.transition && that.$element.hasClass("fade");
- if (!that.$element.parent().length) {
- that.$element.appendTo(that.$body);
- }
- that.$element.show().scrollTop(0);
- if (e) {
- that.$element[0].offsetWidth;
- }
- that.$element.addClass("in").attr("aria-hidden", false);
- that.enforceFocus();
- var cycle = $.Event("shown.bs.modal", {
- /** @type {Function} */
- relatedTarget : callback
- });
- if (e) {
- that.$element.find(".modal-dialog").one("bsTransitionEnd", function() {
- that.$element.trigger("focus").trigger(cycle);
- }).emulateTransitionEnd(Modal.TRANSITION_DURATION);
- } else {
- that.$element.trigger("focus").trigger(cycle);
- }
- });
- }
- }
- };
- /**
- * @param {string} cycle
- * @return {undefined}
- */
- Modal.prototype.hide = function(cycle) {
- if (cycle) {
- cycle.preventDefault();
- }
- cycle = $.Event("hide.bs.modal");
- this.$element.trigger(cycle);
- if (this.isShown) {
- if (!cycle.isDefaultPrevented()) {
- /** @type {boolean} */
- this.isShown = false;
- this.escape();
- $(document).off("focusin.bs.modal");
- this.$element.removeClass("in").attr("aria-hidden", true).off("click.dismiss.bs.modal");
- if ($.support.transition && this.$element.hasClass("fade")) {
- this.$element.one("bsTransitionEnd", $.proxy(this.hideModal, this)).emulateTransitionEnd(Modal.TRANSITION_DURATION);
- } else {
- this.hideModal();
- }
- }
- }
- };
- /**
- * @return {undefined}
- */
- Modal.prototype.enforceFocus = function() {
- $(document).off("focusin.bs.modal").on("focusin.bs.modal", $.proxy(function(e) {
- if (!(this.$element[0] === e.target)) {
- if (!this.$element.has(e.target).length) {
- this.$element.trigger("focus");
- }
- }
- }, this));
- };
- /**
- * @return {undefined}
- */
- Modal.prototype.escape = function() {
- if (this.isShown && this.options.keyboard) {
- this.$element.on("keydown.dismiss.bs.modal", $.proxy(function(event) {
- if (27 == event.which) {
- this.hide();
- }
- }, this));
- } else {
- if (!this.isShown) {
- this.$element.off("keydown.dismiss.bs.modal");
- }
- }
- };
- /**
- * @return {undefined}
- */
- Modal.prototype.hideModal = function() {
- var data = this;
- this.$element.hide();
- this.backdrop(function() {
- data.$body.removeClass("modal-open");
- data.resetScrollbar();
- data.$element.trigger("hidden.bs.modal");
- });
- };
- /**
- * @return {undefined}
- */
- Modal.prototype.removeBackdrop = function() {
- if (this.$backdrop) {
- this.$backdrop.remove();
- }
- /** @type {null} */
- this.$backdrop = null;
- };
- /**
- * @param {Function} callback
- * @return {undefined}
- */
- Modal.prototype.backdrop = function(callback) {
- var that = this;
- /** @type {string} */
- var animate = this.$element.hasClass("fade") ? "fade" : "";
- if (this.isShown && this.options.backdrop) {
- var doAnimate = $.support.transition && animate;
- if (this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />').prependTo(this.$element).on("click.dismiss.bs.modal", $.proxy(function(e) {
- if (e.target === e.currentTarget) {
- if ("static" == this.options.backdrop) {
- this.$element[0].focus.call(this.$element[0]);
- } else {
- this.hide.call(this);
- }
- }
- }, this)), doAnimate && this.$backdrop[0].offsetWidth, this.$backdrop.addClass("in"), !callback) {
- return;
- }
- if (doAnimate) {
- this.$backdrop.one("bsTransitionEnd", callback).emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION);
- } else {
- callback();
- }
- } else {
- if (!this.isShown && this.$backdrop) {
- this.$backdrop.removeClass("in");
- /**
- * @return {undefined}
- */
- var removeElement = function() {
- that.removeBackdrop();
- if (callback) {
- callback();
- }
- };
- if ($.support.transition && this.$element.hasClass("fade")) {
- this.$backdrop.one("bsTransitionEnd", removeElement).emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION);
- } else {
- removeElement();
- }
- } else {
- if (callback) {
- callback();
- }
- }
- }
- };
- /**
- * @return {undefined}
- */
- Modal.prototype.checkScrollbar = function() {
- this.scrollbarWidth = this.measureScrollbar();
- };
- /**
- * @return {undefined}
- */
- Modal.prototype.setScrollbar = function() {
- /** @type {number} */
- var top = parseInt(this.$body.css("padding-right") || 0, 10);
- if (this.scrollbarWidth) {
- this.$body.css("padding-right", top + this.scrollbarWidth);
- }
- };
- /**
- * @return {undefined}
- */
- Modal.prototype.resetScrollbar = function() {
- this.$body.css("padding-right", "");
- };
- /**
- * @return {?}
- */
- Modal.prototype.measureScrollbar = function() {
- if (document.body.clientWidth >= window.innerWidth) {
- return 0;
- }
- /** @type {Element} */
- var n = document.createElement("div");
- /** @type {string} */
- n.className = "modal-scrollbar-measure";
- this.$body.append(n);
- /** @type {number} */
- var e = n.offsetWidth - n.clientWidth;
- return this.$body[0].removeChild(n), e;
- };
- var old = $.fn.modal;
- /** @type {function (boolean, Function): ?} */
- $.fn.modal = init;
- /** @type {function (string, Object): undefined} */
- $.fn.modal.Constructor = Modal;
- /**
- * @return {?}
- */
- $.fn.modal.noConflict = function() {
- return $.fn.modal = old, this;
- };
- $(document).on("click.bs.modal.data-api", '[data-toggle="modal"]', function(types) {
- var $this = $(this);
- var href = $this.attr("href");
- var self = $($this.attr("data-target") || href && href.replace(/.*(?=#[^\s]+$)/, ""));
- var entityType = self.data("bs.modal") ? "toggle" : $.extend({
- remote : !/#/.test(href) && href
- }, self.data(), $this.data());
- if ($this.is("a")) {
- types.preventDefault();
- }
- self.one("show.bs.modal", function(event) {
- if (!event.isDefaultPrevented()) {
- self.one("hidden.bs.modal", function() {
- if ($this.is(":visible")) {
- $this.trigger("focus");
- }
- });
- }
- });
- init.call(self, entityType, this);
- });
- }(jQuery), +function($) {
- /**
- * @param {string} arg
- * @return {?}
- */
- function initialize(arg) {
- return this.each(function() {
- var $this = $(this);
- var data = $this.data("bs.tooltip");
- var options = "object" == typeof arg && arg;
- var name = options && options.selector;
- if (data || "destroy" != arg) {
- if (name) {
- if (!data) {
- $this.data("bs.tooltip", data = {});
- }
- if (!data[name]) {
- data[name] = new Tooltip(this, options);
- }
- } else {
- if (!data) {
- $this.data("bs.tooltip", data = new Tooltip(this, options));
- }
- }
- if ("string" == typeof arg) {
- data[arg]();
- }
- }
- });
- }
- /**
- * @param {string} selector
- * @param {Object} options
- * @return {undefined}
- */
- var Tooltip = function(selector, options) {
- /** @type {null} */
- this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null;
- this.init("tooltip", selector, options);
- };
- /** @type {string} */
- Tooltip.VERSION = "3.3.0";
- /** @type {number} */
- Tooltip.TRANSITION_DURATION = 150;
- Tooltip.DEFAULTS = {
- animation : true,
- placement : "top",
- selector : false,
- template : '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
- trigger : "hover focus",
- title : "",
- delay : 0,
- html : false,
- container : false,
- viewport : {
- selector : "body",
- padding : 0
- }
- };
- /**
- * @param {string} type
- * @param {string} element
- * @param {boolean} options
- * @return {undefined}
- */
- Tooltip.prototype.init = function(type, element, options) {
- /** @type {boolean} */
- this.enabled = true;
- /** @type {string} */
- this.type = type;
- this.$element = $(element);
- this.options = this.getOptions(options);
- this.$viewport = this.options.viewport && $(this.options.viewport.selector || this.options.viewport);
- var params = this.options.trigger.split(" ");
- var l = params.length;
- for (;l--;) {
- var param = params[l];
- if ("click" == param) {
- this.$element.on("click." + this.type, this.options.selector, $.proxy(this.toggle, this));
- } else {
- if ("manual" != param) {
- /** @type {string} */
- var eventIn = "hover" == param ? "mouseenter" : "focusin";
- /** @type {string} */
- var eventOut = "hover" == param ? "mouseleave" : "focusout";
- this.$element.on(eventIn + "." + this.type, this.options.selector, $.proxy(this.enter, this));
- this.$element.on(eventOut + "." + this.type, this.options.selector, $.proxy(this.leave, this));
- }
- }
- }
- if (this.options.selector) {
- this._options = $.extend({}, this.options, {
- trigger : "manual",
- selector : ""
- });
- } else {
- this.fixTitle();
- }
- };
- /**
- * @return {?}
- */
- Tooltip.prototype.getDefaults = function() {
- return Tooltip.DEFAULTS;
- };
- /**
- * @param {boolean} options
- * @return {?}
- */
- Tooltip.prototype.getOptions = function(options) {
- return options = $.extend({}, this.getDefaults(), this.$element.data(), options), options.delay && ("number" == typeof options.delay && (options.delay = {
- show : options.delay,
- hide : options.delay
- })), options;
- };
- /**
- * @return {?}
- */
- Tooltip.prototype.getDelegateOptions = function() {
- var flags = {};
- var defaults = this.getDefaults();
- return this._options && $.each(this._options, function(key, value) {
- if (defaults[key] != value) {
- flags[key] = value;
- }
- }), flags;
- };
- /**
- * @param {Object} obj
- * @return {?}
- */
- Tooltip.prototype.enter = function(obj) {
- var options = obj instanceof this.constructor ? obj : $(obj.currentTarget).data("bs." + this.type);
- return options && (options.$tip && options.$tip.is(":visible")) ? void(options.hoverState = "in") : (options || (options = new this.constructor(obj.currentTarget, this.getDelegateOptions()), $(obj.currentTarget).data("bs." + this.type, options)), clearTimeout(options.timeout), options.hoverState = "in", options.options.delay && options.options.delay.show ? void(options.timeout = setTimeout(function() {
- if ("in" == options.hoverState) {
- options.show();
- }
- }, options.options.delay.show)) : options.show());
- };
- /**
- * @param {Object} obj
- * @return {?}
- */
- Tooltip.prototype.leave = function(obj) {
- var self = obj instanceof this.constructor ? obj : $(obj.currentTarget).data("bs." + this.type);
- return self || (self = new this.constructor(obj.currentTarget, this.getDelegateOptions()), $(obj.currentTarget).data("bs." + this.type, self)), clearTimeout(self.timeout), self.hoverState = "out", self.options.delay && self.options.delay.hide ? void(self.timeout = setTimeout(function() {
- if ("out" == self.hoverState) {
- self.hide();
- }
- }, self.options.delay.hide)) : self.hide();
- };
- /**
- * @return {undefined}
- */
- Tooltip.prototype.show = function() {
- var cycle = $.Event("show.bs." + this.type);
- if (this.hasContent() && this.enabled) {
- this.$element.trigger(cycle);
- var d = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]);
- if (cycle.isDefaultPrevented() || !d) {
- return;
- }
- var self = this;
- var $tip = this.tip();
- var tag = this.getUID(this.type);
- this.setContent();
- $tip.attr("id", tag);
- this.$element.attr("aria-describedby", tag);
- if (this.options.animation) {
- $tip.addClass("fade");
- }
- var placement = "function" == typeof this.options.placement ? this.options.placement.call(this, $tip[0], this.$element[0]) : this.options.placement;
- /** @type {RegExp} */
- var autoToken = /\s?auto?\s?/i;
- /** @type {boolean} */
- var autoPlace = autoToken.test(placement);
- if (autoPlace) {
- placement = placement.replace(autoToken, "") || "top";
- }
- $tip.detach().css({
- top : 0,
- left : 0,
- display : "block"
- }).addClass(placement).data("bs." + this.type, this);
- if (this.options.container) {
- $tip.appendTo(this.options.container);
- } else {
- $tip.insertAfter(this.$element);
- }
- var pos = this.getPosition();
- var actualWidth = $tip[0].offsetWidth;
- var actualHeight = $tip[0].offsetHeight;
- if (autoPlace) {
- var orgPlacement = placement;
- var element = this.options.container ? $(this.options.container) : this.$element.parent();
- var position = this.getPosition(element);
- placement = "bottom" == placement && pos.bottom + actualHeight > position.bottom ? "top" : "top" == placement && pos.top - actualHeight < position.top ? "bottom" : "right" == placement && pos.right + actualWidth > position.width ? "left" : "left" == placement && pos.left - actualWidth < position.left ? "right" : placement;
- $tip.removeClass(orgPlacement).addClass(placement);
- }
- var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight);
- this.applyPlacement(calculatedOffset, placement);
- /**
- * @return {undefined}
- */
- var complete = function() {
- var text = self.hoverState;
- self.$element.trigger("shown.bs." + self.type);
- /** @type {null} */
- self.hoverState = null;
- if ("out" == text) {
- self.leave(self);
- }
- };
- if ($.support.transition && this.$tip.hasClass("fade")) {
- $tip.one("bsTransitionEnd", complete).emulateTransitionEnd(Tooltip.TRANSITION_DURATION);
- } else {
- complete();
- }
- }
- };
- /**
- * @param {?} offset
- * @param {string} placement
- * @return {undefined}
- */
- Tooltip.prototype.applyPlacement = function(offset, placement) {
- var $tip = this.tip();
- var w = $tip[0].offsetWidth;
- var height = $tip[0].offsetHeight;
- /** @type {number} */
- var marginTop = parseInt($tip.css("margin-top"), 10);
- /** @type {number} */
- var marginLeft = parseInt($tip.css("margin-left"), 10);
- if (isNaN(marginTop)) {
- /** @type {number} */
- marginTop = 0;
- }
- if (isNaN(marginLeft)) {
- /** @type {number} */
- marginLeft = 0;
- }
- offset.top = offset.top + marginTop;
- offset.left = offset.left + marginLeft;
- $.offset.setOffset($tip[0], $.extend({
- /**
- * @param {?} props
- * @return {undefined}
- */
- using : function(props) {
- $tip.css({
- top : Math.round(props.top),
- left : Math.round(props.left)
- });
- }
- }, offset), 0);
- $tip.addClass("in");
- var x = $tip[0].offsetWidth;
- var actualHeight = $tip[0].offsetHeight;
- if ("top" == placement) {
- if (actualHeight != height) {
- /** @type {number} */
- offset.top = offset.top + height - actualHeight;
- }
- }
- var pos = this.getViewportAdjustedDelta(placement, offset, x, actualHeight);
- if (pos.left) {
- offset.left += pos.left;
- } else {
- offset.top += pos.top;
- }
- /** @type {boolean} */
- var isHorizontal = /top|bottom/.test(placement);
- var _position = isHorizontal ? 2 * pos.left - w + x : 2 * pos.top - height + actualHeight;
- /** @type {string} */
- var sizingDomProperty = isHorizontal ? "offsetWidth" : "offsetHeight";
- $tip.offset(offset);
- this.replaceArrow(_position, $tip[0][sizingDomProperty], isHorizontal);
- };
- /**
- * @param {number} position
- * @param {number} dimension
- * @param {boolean} horizontal
- * @return {undefined}
- */
- Tooltip.prototype.replaceArrow = function(position, dimension, horizontal) {
- this.arrow().css(horizontal ? "left" : "top", 50 * (1 - position / dimension) + "%").css(horizontal ? "top" : "left", "");
- };
- /**
- * @return {undefined}
- */
- Tooltip.prototype.setContent = function() {
- var $tip = this.tip();
- var title = this.getTitle();
- $tip.find(".tooltip-inner")[this.options.html ? "html" : "text"](title);
- $tip.removeClass("fade in top bottom left right");
- };
- /**
- * @param {Function} success
- * @return {?}
- */
- Tooltip.prototype.hide = function(success) {
- /**
- * @return {undefined}
- */
- function complete() {
- if ("in" != self.hoverState) {
- $tip.detach();
- }
- self.$element.removeAttr("aria-describedby").trigger("hidden.bs." + self.type);
- if (success) {
- success();
- }
- }
- var self = this;
- var $tip = this.tip();
- var cycle = $.Event("hide.bs." + this.type);
- return this.$element.trigger(cycle), cycle.isDefaultPrevented() ? void 0 : ($tip.removeClass("in"), $.support.transition && this.$tip.hasClass("fade") ? $tip.one("bsTransitionEnd", complete).emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : complete(), this.hoverState = null, this);
- };
- /**
- * @return {undefined}
- */
- Tooltip.prototype.fixTitle = function() {
- var $e = this.$element;
- if ($e.attr("title") || "string" != typeof $e.attr("data-original-title")) {
- $e.attr("data-original-title", $e.attr("title") || "").attr("title", "");
- }
- };
- /**
- * @return {?}
- */
- Tooltip.prototype.hasContent = function() {
- return this.getTitle();
- };
- /**
- * @param {Object} $element
- * @return {?}
- */
- Tooltip.prototype.getPosition = function($element) {
- $element = $element || this.$element;
- var el = $element[0];
- /** @type {boolean} */
- var bShow = "BODY" == el.tagName;
- var rect = el.getBoundingClientRect();
- if (null == rect.width) {
- rect = $.extend({}, rect, {
- width : rect.right - rect.left,
- height : rect.bottom - rect.top
- });
- }
- var platformVersions = bShow ? {
- top : 0,
- left : 0
- } : $element.offset();
- var copy = {
- scroll : bShow ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop()
- };
- /** @type {(null|{height: ?, width: ?})} */
- var newOpts = bShow ? {
- width : $(window).width(),
- height : $(window).height()
- } : null;
- return $.extend({}, rect, copy, newOpts, platformVersions);
- };
- /**
- * @param {string} str
- * @param {?} pos
- * @param {number} actualWidth
- * @param {number} actualHeight
- * @return {?}
- */
- Tooltip.prototype.getCalculatedOffset = function(str, pos, actualWidth, actualHeight) {
- return "bottom" == str ? {
- top : pos.top + pos.height,
- left : pos.left + pos.width / 2 - actualWidth / 2
- } : "top" == str ? {
- top : pos.top - actualHeight,
- left : pos.left + pos.width / 2 - actualWidth / 2
- } : "left" == str ? {
- top : pos.top + pos.height / 2 - actualHeight / 2,
- left : pos.left - actualWidth
- } : {
- top : pos.top + pos.height / 2 - actualHeight / 2,
- left : pos.left + pos.width
- };
- };
- /**
- * @param {string} placement
- * @param {?} layout
- * @param {?} v00
- * @param {number} value
- * @return {?}
- */
- Tooltip.prototype.getViewportAdjustedDelta = function(placement, layout, v00, value) {
- var result = {
- top : 0,
- left : 0
- };
- if (!this.$viewport) {
- return result;
- }
- var bounce = this.options.viewport && this.options.viewport.padding || 0;
- var p = this.getPosition(this.$viewport);
- if (/right|left/.test(placement)) {
- /** @type {number} */
- var y = layout.top - bounce - p.scroll;
- var tval = layout.top + bounce - p.scroll + value;
- if (y < p.top) {
- /** @type {number} */
- result.top = p.top - y;
- } else {
- if (tval > p.top + p.height) {
- /** @type {number} */
- result.top = p.top + p.height - tval;
- }
- }
- } else {
- /** @type {number} */
- var x = layout.left - bounce;
- var imageWidth = layout.left + bounce + v00;
- if (x < p.left) {
- /** @type {number} */
- result.left = p.left - x;
- } else {
- if (imageWidth > p.width) {
- /** @type {number} */
- result.left = p.left + p.width - imageWidth;
- }
- }
- }
- return result;
- };
- /**
- * @return {?}
- */
- Tooltip.prototype.getTitle = function() {
- var a;
- var $e = this.$element;
- var o = this.options;
- return a = $e.attr("data-original-title") || ("function" == typeof o.title ? o.title.call($e[0]) : o.title);
- };
- /**
- * @param {number} id
- * @return {?}
- */
- Tooltip.prototype.getUID = function(id) {
- do {
- id += ~~(1E6 * Math.random());
- } while (document.getElementById(id));
- return id;
- };
- /**
- * @return {?}
- */
- Tooltip.prototype.tip = function() {
- return this.$tip = this.$tip || $(this.options.template);
- };
- /**
- * @return {?}
- */
- Tooltip.prototype.arrow = function() {
- return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow");
- };
- /**
- * @return {undefined}
- */
- Tooltip.prototype.enable = function() {
- /** @type {boolean} */
- this.enabled = true;
- };
- /**
- * @return {undefined}
- */
- Tooltip.prototype.disable = function() {
- /** @type {boolean} */
- this.enabled = false;
- };
- /**
- * @return {undefined}
- */
- Tooltip.prototype.toggleEnabled = function() {
- /** @type {boolean} */
- this.enabled = !this.enabled;
- };
- /**
- * @param {Event} e
- * @return {undefined}
- */
- Tooltip.prototype.toggle = function(e) {
- var node = this;
- if (e) {
- node = $(e.currentTarget).data("bs." + this.type);
- if (!node) {
- node = new this.constructor(e.currentTarget, this.getDelegateOptions());
- $(e.currentTarget).data("bs." + this.type, node);
- }
- }
- if (node.tip().hasClass("in")) {
- node.leave(node);
- } else {
- node.enter(node);
- }
- };
- /**
- * @return {undefined}
- */
- Tooltip.prototype.destroy = function() {
- var that = this;
- clearTimeout(this.timeout);
- this.hide(function() {
- that.$element.off("." + that.type).removeData("bs." + that.type);
- });
- };
- var old = $.fn.tooltip;
- /** @type {function (string): ?} */
- $.fn.tooltip = initialize;
- /** @type {function (string, Object): undefined} */
- $.fn.tooltip.Constructor = Tooltip;
- /**
- * @return {?}
- */
- $.fn.tooltip.noConflict = function() {
- return $.fn.tooltip = old, this;
- };
- }(jQuery), +function($) {
- /**
- * @param {string} arg
- * @return {?}
- */
- function initialize(arg) {
- return this.each(function() {
- var $this = $(this);
- var data = $this.data("bs.popover");
- var options = "object" == typeof arg && arg;
- var name = options && options.selector;
- if (data || "destroy" != arg) {
- if (name) {
- if (!data) {
- $this.data("bs.popover", data = {});
- }
- if (!data[name]) {
- data[name] = new Popover(this, options);
- }
- } else {
- if (!data) {
- $this.data("bs.popover", data = new Popover(this, options));
- }
- }
- if ("string" == typeof arg) {
- data[arg]();
- }
- }
- });
- }
- /**
- * @param {string} selector
- * @param {Object} options
- * @return {undefined}
- */
- var Popover = function(selector, options) {
- this.init("popover", selector, options);
- };
- if (!$.fn.tooltip) {
- throw new Error("Popover requires tooltip.js");
- }
- /** @type {string} */
- Popover.VERSION = "3.3.0";
- Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
- placement : "right",
- trigger : "click",
- content : "",
- template : '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
- });
- Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype);
- /** @type {function (string, Object): undefined} */
- Popover.prototype.constructor = Popover;
- /**
- * @return {?}
- */
- Popover.prototype.getDefaults = function() {
- return Popover.DEFAULTS;
- };
- /**
- * @return {undefined}
- */
- Popover.prototype.setContent = function() {
- var $tip = this.tip();
- var title = this.getTitle();
- var err = this.getContent();
- $tip.find(".popover-title")[this.options.html ? "html" : "text"](title);
- $tip.find(".popover-content").children().detach().end()[this.options.html ? "string" == typeof err ? "html" : "append" : "text"](err);
- $tip.removeClass("fade top bottom left right in");
- if (!$tip.find(".popover-title").html()) {
- $tip.find(".popover-title").hide();
- }
- };
- /**
- * @return {?}
- */
- Popover.prototype.hasContent = function() {
- return this.getTitle() || this.getContent();
- };
- /**
- * @return {?}
- */
- Popover.prototype.getContent = function() {
- var $e = this.$element;
- var o = this.options;
- return $e.attr("data-content") || ("function" == typeof o.content ? o.content.call($e[0]) : o.content);
- };
- /**
- * @return {?}
- */
- Popover.prototype.arrow = function() {
- return this.$arrow = this.$arrow || this.tip().find(".arrow");
- };
- /**
- * @return {?}
- */
- Popover.prototype.tip = function() {
- return this.$tip || (this.$tip = $(this.options.template)), this.$tip;
- };
- var old = $.fn.popover;
- /** @type {function (string): ?} */
- $.fn.popover = initialize;
- /** @type {function (string, Object): undefined} */
- $.fn.popover.Constructor = Popover;
- /**
- * @return {?}
- */
- $.fn.popover.noConflict = function() {
- return $.fn.popover = old, this;
- };
- }(jQuery), +function($) {
- /**
- * @param {string} selector
- * @param {?} options
- * @return {undefined}
- */
- function ScrollSpy(selector, options) {
- var className = $.proxy(this.process, this);
- this.$body = $("body");
- this.$scrollElement = $($(selector).is("body") ? window : selector);
- this.options = $.extend({}, ScrollSpy.DEFAULTS, options);
- /** @type {string} */
- this.selector = (this.options.target || "") + " .nav li > a";
- /** @type {Array} */
- this.offsets = [];
- /** @type {Array} */
- this.targets = [];
- /** @type {null} */
- this.activeTarget = null;
- /** @type {number} */
- this.scrollHeight = 0;
- this.$scrollElement.on("scroll.bs.scrollspy", className);
- this.refresh();
- this.process();
- }
- /**
- * @param {number} arg
- * @return {?}
- */
- function init(arg) {
- return this.each(function() {
- var $this = $(this);
- var data = $this.data("bs.scrollspy");
- var options = "object" == typeof arg && arg;
- if (!data) {
- $this.data("bs.scrollspy", data = new ScrollSpy(this, options));
- }
- if ("string" == typeof arg) {
- data[arg]();
- }
- });
- }
- /** @type {string} */
- ScrollSpy.VERSION = "3.3.0";
- ScrollSpy.DEFAULTS = {
- offset : 10
- };
- /**
- * @return {?}
- */
- ScrollSpy.prototype.getScrollHeight = function() {
- return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight);
- };
- /**
- * @return {undefined}
- */
- ScrollSpy.prototype.refresh = function() {
- /** @type {string} */
- var i = "offset";
- /** @type {number} */
- var nub_height = 0;
- if (!$.isWindow(this.$scrollElement[0])) {
- /** @type {string} */
- i = "position";
- nub_height = this.$scrollElement.scrollTop();
- }
- /** @type {Array} */
- this.offsets = [];
- /** @type {Array} */
- this.targets = [];
- this.scrollHeight = this.getScrollHeight();
- var self = this;
- this.$body.find(this.selector).map(function() {
- var $el = $(this);
- var href = $el.data("target") || $el.attr("href");
- var codeSegments = /^#./.test(href) && $(href);
- return codeSegments && (codeSegments.length && (codeSegments.is(":visible") && [[codeSegments[i]().top + nub_height, href]])) || null;
- }).sort(function(mat0, mat1) {
- return mat0[0] - mat1[0];
- }).each(function() {
- self.offsets.push(this[0]);
- self.targets.push(this[1]);
- });
- };
- /**
- * @return {?}
- */
- ScrollSpy.prototype.process = function() {
- var i;
- var scrollTop = this.$scrollElement.scrollTop() + this.options.offset;
- var offset = this.getScrollHeight();
- /** @type {number} */
- var maxScroll = this.options.offset + offset - this.$scrollElement.height();
- var offsets = this.offsets;
- var targets = this.targets;
- var activeTarget = this.activeTarget;
- if (this.scrollHeight != offset && this.refresh(), scrollTop >= maxScroll) {
- return activeTarget != (i = targets[targets.length - 1]) && this.activate(i);
- }
- if (activeTarget && scrollTop < offsets[0]) {
- return this.activeTarget = null, this.clear();
- }
- i = offsets.length;
- for (;i--;) {
- if (activeTarget != targets[i]) {
- if (scrollTop >= offsets[i]) {
- if (!offsets[i + 1] || scrollTop <= offsets[i + 1]) {
- this.activate(targets[i]);
- }
- }
- }
- }
- };
- /**
- * @param {Error} target
- * @return {undefined}
- */
- ScrollSpy.prototype.activate = function(target) {
- /** @type {Error} */
- this.activeTarget = target;
- this.clear();
- /** @type {string} */
- var selector = this.selector + '[data-target="' + target + '"],' + this.selector + '[href="' + target + '"]';
- var active = $(selector).parents("li").addClass("active");
- if (active.parent(".dropdown-menu").length) {
- active = active.closest("li.dropdown").addClass("active");
- }
- active.trigger("activate.bs.scrollspy");
- };
- /**
- * @return {undefined}
- */
- ScrollSpy.prototype.clear = function() {
- $(this.selector).parentsUntil(this.options.target, ".active").removeClass("active");
- };
- var old = $.fn.scrollspy;
- /** @type {function (number): ?} */
- $.fn.scrollspy = init;
- /** @type {function (string, ?): undefined} */
- $.fn.scrollspy.Constructor = ScrollSpy;
- /**
- * @return {?}
- */
- $.fn.scrollspy.noConflict = function() {
- return $.fn.scrollspy = old, this;
- };
- $(window).on("load.bs.scrollspy.data-api", function() {
- $('[data-spy="scroll"]').each(function() {
- var self = $(this);
- init.call(self, self.data());
- });
- });
- }(jQuery), +function($) {
- /**
- * @param {?} selector
- * @return {?}
- */
- function init(selector) {
- return this.each(function() {
- var $this = $(this);
- var data = $this.data("bs.tab");
- if (!data) {
- $this.data("bs.tab", data = new Tab(this));
- }
- if ("string" == typeof selector) {
- data[selector]();
- }
- });
- }
- /**
- * @param {string} selector
- * @return {undefined}
- */
- var Tab = function(selector) {
- this.element = $(selector);
- };
- /** @type {string} */
- Tab.VERSION = "3.3.0";
- /** @type {number} */
- Tab.TRANSITION_DURATION = 150;
- /**
- * @return {undefined}
- */
- Tab.prototype.show = function() {
- var $this = this.element;
- var $ul = $this.closest("ul:not(.dropdown-menu)");
- var selector = $this.data("target");
- if (selector || (selector = $this.attr("href"), selector = selector && selector.replace(/.*(?=#[^\s]*$)/, "")), !$this.parent("li").hasClass("active")) {
- var elm = $ul.find(".active:last a");
- var cycle = $.Event("hide.bs.tab", {
- relatedTarget : $this[0]
- });
- var fix = $.Event("show.bs.tab", {
- relatedTarget : elm[0]
- });
- if (elm.trigger(cycle), $this.trigger(fix), !fix.isDefaultPrevented() && !cycle.isDefaultPrevented()) {
- var $target = $(selector);
- this.activate($this.closest("li"), $ul);
- this.activate($target, $target.parent(), function() {
- elm.trigger({
- type : "hidden.bs.tab",
- relatedTarget : $this[0]
- });
- $this.trigger({
- type : "shown.bs.tab",
- relatedTarget : elm[0]
- });
- });
- }
- }
- };
- /**
- * @param {Object} element
- * @param {Object} container
- * @param {Object} callback
- * @return {undefined}
- */
- Tab.prototype.activate = function(element, container, callback) {
- /**
- * @return {undefined}
- */
- function next() {
- $active.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded", false);
- element.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded", true);
- if (showAddButton) {
- element[0].offsetWidth;
- element.addClass("in");
- } else {
- element.removeClass("fade");
- }
- if (element.parent(".dropdown-menu")) {
- element.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded", true);
- }
- if (callback) {
- callback();
- }
- }
- var $active = container.find("> .active");
- var showAddButton = callback && ($.support.transition && ($active.length && $active.hasClass("fade") || !!container.find("> .fade").length));
- if ($active.length && showAddButton) {
- $active.one("bsTransitionEnd", next).emulateTransitionEnd(Tab.TRANSITION_DURATION);
- } else {
- next();
- }
- $active.removeClass("in");
- };
- var old = $.fn.tab;
- /** @type {function (?): ?} */
- $.fn.tab = init;
- /** @type {function (string): undefined} */
- $.fn.tab.Constructor = Tab;
- /**
- * @return {?}
- */
- $.fn.tab.noConflict = function() {
- return $.fn.tab = old, this;
- };
- /**
- * @param {?} event
- * @return {undefined}
- */
- var stop = function(event) {
- event.preventDefault();
- init.call($(this), "show");
- };
- $(document).on("click.bs.tab.data-api", '[data-toggle="tab"]', stop).on("click.bs.tab.data-api", '[data-toggle="pill"]', stop);
- }(jQuery), +function($) {
- /**
- * @param {number} arg
- * @return {?}
- */
- function init(arg) {
- return this.each(function() {
- var $this = $(this);
- var data = $this.data("bs.affix");
- var options = "object" == typeof arg && arg;
- if (!data) {
- $this.data("bs.affix", data = new Affix(this, options));
- }
- if ("string" == typeof arg) {
- data[arg]();
- }
- });
- }
- /**
- * @param {string} selector
- * @param {?} options
- * @return {undefined}
- */
- var Affix = function(selector, options) {
- this.options = $.extend({}, Affix.DEFAULTS, options);
- this.$target = $(this.options.target).on("scroll.bs.affix.data-api", $.proxy(this.checkPosition, this)).on("click.bs.affix.data-api", $.proxy(this.checkPositionWithEventLoop, this));
- this.$element = $(selector);
- /** @type {null} */
- this.affixed = this.unpin = this.pinnedOffset = null;
- this.checkPosition();
- };
- /** @type {string} */
- Affix.VERSION = "3.3.0";
- /** @type {string} */
- Affix.RESET = "affix affix-top affix-bottom";
- Affix.DEFAULTS = {
- offset : 0,
- target : window
- };
- /**
- * @param {number} el
- * @param {?} value
- * @param {string} element
- * @param {number} v12
- * @return {?}
- */
- Affix.prototype.getState = function(el, value, element, v12) {
- var scrollTop = this.$target.scrollTop();
- var position = this.$element.offset();
- var wiewHeight = this.$target.height();
- if (null != element && "top" == this.affixed) {
- return element > scrollTop ? "top" : false;
- }
- if ("bottom" == this.affixed) {
- return null != element ? scrollTop + this.unpin <= position.top ? false : "bottom" : el - v12 >= scrollTop + wiewHeight ? false : "bottom";
- }
- /** @type {boolean} */
- var iterator = null == this.affixed;
- var initial = iterator ? scrollTop : position.top;
- var computed = iterator ? wiewHeight : value;
- return null != element && element >= initial ? "top" : null != v12 && initial + computed >= el - v12 ? "bottom" : false;
- };
- /**
- * @return {?}
- */
- Affix.prototype.getPinnedOffset = function() {
- if (this.pinnedOffset) {
- return this.pinnedOffset;
- }
- this.$element.removeClass(Affix.RESET).addClass("affix");
- var scrollTop = this.$target.scrollTop();
- var position = this.$element.offset();
- return this.pinnedOffset = position.top - scrollTop;
- };
- /**
- * @return {undefined}
- */
- Affix.prototype.checkPositionWithEventLoop = function() {
- setTimeout($.proxy(this.checkPosition, this), 1);
- };
- /**
- * @return {undefined}
- */
- Affix.prototype.checkPosition = function() {
- if (this.$element.is(":visible")) {
- var udataCur = this.$element.height();
- var n = this.options.offset;
- var a = n.top;
- var b = n.bottom;
- var failuresLink = $("body").height();
- if ("object" != typeof n) {
- b = a = n;
- }
- if ("function" == typeof a) {
- a = n.top(this.$element);
- }
- if ("function" == typeof b) {
- b = n.bottom(this.$element);
- }
- var affix = this.getState(failuresLink, udataCur, a, b);
- if (this.affixed != affix) {
- if (null != this.unpin) {
- this.$element.css("top", "");
- }
- /** @type {string} */
- var affixType = "affix" + (affix ? "-" + affix : "");
- var cycle = $.Event(affixType + ".bs.affix");
- if (this.$element.trigger(cycle), cycle.isDefaultPrevented()) {
- return;
- }
- this.affixed = affix;
- this.unpin = "bottom" == affix ? this.getPinnedOffset() : null;
- this.$element.removeClass(Affix.RESET).addClass(affixType).trigger(affixType.replace("affix", "affixed") + ".bs.affix");
- }
- if ("bottom" == affix) {
- this.$element.offset({
- top : failuresLink - udataCur - b
- });
- }
- }
- };
- var old = $.fn.affix;
- /** @type {function (number): ?} */
- $.fn.affix = init;
- /** @type {function (string, ?): undefined} */
- $.fn.affix.Constructor = Affix;
- /**
- * @return {?}
- */
- $.fn.affix.noConflict = function() {
- return $.fn.affix = old, this;
- };
- $(window).on("load", function() {
- $('[data-spy="affix"]').each(function() {
- var self = $(this);
- var options = self.data();
- options.offset = options.offset || {};
- if (null != options.offsetBottom) {
- options.offset.bottom = options.offsetBottom;
- }
- if (null != options.offsetTop) {
- options.offset.top = options.offsetTop;
- }
- init.call(self, options);
- });
- });
- }(jQuery);
- (function(factory) {
- if ("function" == typeof define && define.amd) {
- define(["jquery"], factory);
- } else {
- if ("object" == typeof exports) {
- factory(require("jquery"));
- } else {
- factory(window.jQuery || window.Zepto);
- }
- }
- })(function($) {
- var mfp;
- var _prevStatus;
- var _body;
- var _document;
- var _prevContentType;
- var cls;
- var openElement;
- /** @type {string} */
- var CLOSE_EVENT = "Close";
- /** @type {string} */
- var BEFORE_CLOSE_EVENT = "BeforeClose";
- /** @type {string} */
- var AFTER_CLOSE_EVENT = "AfterClose";
- /** @type {string} */
- var BEFORE_APPEND_EVENT = "BeforeAppend";
- /** @type {string} */
- var MARKUP_PARSE_EVENT = "MarkupParse";
- /** @type {string} */
- var OPEN_EVENT = "Open";
- /** @type {string} */
- var CHANGE_EVENT = "Change";
- /** @type {string} */
- var NS = "mfp";
- /** @type {string} */
- var EVENT_NS = "." + NS;
- /** @type {string} */
- var READY_CLASS = "mfp-ready";
- /** @type {string} */
- var REMOVING_CLASS = "mfp-removing";
- /** @type {string} */
- var PREVENT_CLOSE_CLASS = "mfp-prevent-close";
- /**
- * @return {undefined}
- */
- var MagnificPopup = function() {
- };
- /** @type {boolean} */
- var _isJQ = !!window.jQuery;
- var _window = $(window);
- /**
- * @param {string} name
- * @param {Function} f
- * @return {undefined}
- */
- var _mfpOn = function(name, f) {
- mfp.ev.on(NS + name + EVENT_NS, f);
- };
- /**
- * @param {string} className
- * @param {string} cycle
- * @param {Object} recurring
- * @param {boolean} dataAndEvents
- * @return {?}
- */
- var _getEl = function(className, cycle, recurring, dataAndEvents) {
- /** @type {Element} */
- var el = document.createElement("div");
- return el.className = "mfp-" + className, recurring && (el.innerHTML = recurring), dataAndEvents ? cycle && cycle.appendChild(el) : (el = $(el), cycle && el.appendTo(cycle)), el;
- };
- /**
- * @param {string} e
- * @param {?} data
- * @return {undefined}
- */
- var _mfpTrigger = function(e, data) {
- mfp.ev.triggerHandler(NS + e, data);
- if (mfp.st.callbacks) {
- e = e.charAt(0).toLowerCase() + e.slice(1);
- if (mfp.st.callbacks[e]) {
- mfp.st.callbacks[e].apply(mfp, $.isArray(data) ? data : [data]);
- }
- }
- };
- /**
- * @param {?} element
- * @return {?}
- */
- var _getCloseBtn = function(element) {
- return element === openElement && mfp.currTemplate.closeBtn || (mfp.currTemplate.closeBtn = $(mfp.st.closeMarkup.replace("%title%", mfp.st.tClose)), openElement = element), mfp.currTemplate.closeBtn;
- };
- /**
- * @return {undefined}
- */
- var _checkInstance = function() {
- if (!$.magnificPopup.instance) {
- mfp = new MagnificPopup;
- mfp.init();
- $.magnificPopup.instance = mfp;
- }
- };
- /**
- * @return {?}
- */
- var supportsTransitions = function() {
- /** @type {(CSSStyleDeclaration|null)} */
- var s = document.createElement("p").style;
- /** @type {Array} */
- var v = ["ms", "O", "Moz", "Webkit"];
- if (void 0 !== s.transition) {
- return true;
- }
- for (;v.length;) {
- if (v.pop() + "Transition" in s) {
- return true;
- }
- }
- return false;
- };
- MagnificPopup.prototype = {
- /** @type {function (): undefined} */
- constructor : MagnificPopup,
- /**
- * @return {undefined}
- */
- init : function() {
- /** @type {string} */
- var appVersion = navigator.appVersion;
- /** @type {boolean} */
- mfp.isIE7 = -1 !== appVersion.indexOf("MSIE 7.");
- /** @type {boolean} */
- mfp.isIE8 = -1 !== appVersion.indexOf("MSIE 8.");
- /** @type {boolean} */
- mfp.isLowIE = mfp.isIE7 || mfp.isIE8;
- /** @type {boolean} */
- mfp.isAndroid = /android/gi.test(appVersion);
- /** @type {boolean} */
- mfp.isIOS = /iphone|ipad|ipod/gi.test(appVersion);
- mfp.supportsTransition = supportsTransitions();
- /** @type {boolean} */
- mfp.probablyMobile = mfp.isAndroid || (mfp.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent));
- _document = $(document);
- mfp.popupsCache = {};
- },
- /**
- * @param {Object} data
- * @return {?}
- */
- open : function(data) {
- if (!_body) {
- _body = $(document.body);
- }
- var i;
- if (data.isObj === false) {
- mfp.items = data.items.toArray();
- /** @type {number} */
- mfp.index = 0;
- var item;
- var items = data.items;
- /** @type {number} */
- i = 0;
- for (;items.length > i;i++) {
- if (item = items[i], item.parsed && (item = item.el[0]), item === data.el[0]) {
- /** @type {number} */
- mfp.index = i;
- break;
- }
- }
- } else {
- mfp.items = $.isArray(data.items) ? data.items : [data.items];
- mfp.index = data.index || 0;
- }
- if (mfp.isOpen) {
- return mfp.updateItemHTML(), void 0;
- }
- /** @type {Array} */
- mfp.types = [];
- /** @type {string} */
- cls = "";
- mfp.ev = data.mainEl && data.mainEl.length ? data.mainEl.eq(0) : _document;
- if (data.key) {
- if (!mfp.popupsCache[data.key]) {
- mfp.popupsCache[data.key] = {};
- }
- mfp.currTemplate = mfp.popupsCache[data.key];
- } else {
- mfp.currTemplate = {};
- }
- mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data);
- mfp.fixedContentPos = "auto" === mfp.st.fixedContentPos ? !mfp.probablyMobile : mfp.st.fixedContentPos;
- if (mfp.st.modal) {
- /** @type {boolean} */
- mfp.st.closeOnContentClick = false;
- /** @type {boolean} */
- mfp.st.closeOnBgClick = false;
- /** @type {boolean} */
- mfp.st.showCloseBtn = false;
- /** @type {boolean} */
- mfp.st.enableEscapeKey = false;
- }
- if (!mfp.bgOverlay) {
- mfp.bgOverlay = _getEl("bg").on("click" + EVENT_NS, function() {
- mfp.close();
- });
- mfp.wrap = _getEl("wrap").attr("tabindex", -1).on("click" + EVENT_NS, function(e) {
- if (mfp._checkIfClose(e.target)) {
- mfp.close();
- }
- });
- mfp.container = _getEl("container", mfp.wrap);
- }
- mfp.contentContainer = _getEl("content");
- if (mfp.st.preloader) {
- mfp.preloader = _getEl("preloader", mfp.container, mfp.st.tLoading);
- }
- var comparisons = $.magnificPopup.modules;
- /** @type {number} */
- i = 0;
- for (;comparisons.length > i;i++) {
- var t = comparisons[i];
- t = t.charAt(0).toUpperCase() + t.slice(1);
- mfp["init" + t].call(mfp);
- }
- _mfpTrigger("BeforeOpen");
- if (mfp.st.showCloseBtn) {
- if (mfp.st.closeBtnInside) {
- _mfpOn(MARKUP_PARSE_EVENT, function(dataAndEvents, deepDataAndEvents, values, item) {
- values.close_replaceWith = _getCloseBtn(item.type);
- });
- cls += " mfp-close-btn-in";
- } else {
- mfp.wrap.append(_getCloseBtn());
- }
- }
- if (mfp.st.alignTop) {
- cls += " mfp-align-top";
- }
- if (mfp.fixedContentPos) {
- mfp.wrap.css({
- overflow : mfp.st.overflowY,
- overflowX : "hidden",
- overflowY : mfp.st.overflowY
- });
- } else {
- mfp.wrap.css({
- top : _window.scrollTop(),
- position : "absolute"
- });
- }
- if (mfp.st.fixedBgPos === false || "auto" === mfp.st.fixedBgPos && !mfp.fixedContentPos) {
- mfp.bgOverlay.css({
- height : _document.height(),
- position : "absolute"
- });
- }
- if (mfp.st.enableEscapeKey) {
- _document.on("keyup" + EVENT_NS, function(event) {
- if (27 === event.keyCode) {
- mfp.close();
- }
- });
- }
- _window.on("resize" + EVENT_NS, function() {
- mfp.updateSize();
- });
- if (!mfp.st.closeOnContentClick) {
- cls += " mfp-auto-cursor";
- }
- if (cls) {
- mfp.wrap.addClass(cls);
- }
- var windowHeight = mfp.wH = _window.height();
- var style = {};
- if (mfp.fixedContentPos && mfp._hasScrollBar(windowHeight)) {
- var marginSize = mfp._getScrollbarSize();
- if (marginSize) {
- style.marginRight = marginSize;
- }
- }
- if (mfp.fixedContentPos) {
- if (mfp.isIE7) {
- $("body, html").css("overflow", "hidden");
- } else {
- /** @type {string} */
- style.overflow = "hidden";
- }
- }
- var classesToadd = mfp.st.mainClass;
- return mfp.isIE7 && (classesToadd += " mfp-ie7"), classesToadd && mfp._addClassToMFP(classesToadd), mfp.updateItemHTML(), _mfpTrigger("BuildControls"), $("html").css(style), mfp.bgOverlay.add(mfp.wrap).prependTo(mfp.st.prependTo || _body), mfp._lastFocusedEl = document.activeElement, setTimeout(function() {
- if (mfp.content) {
- mfp._addClassToMFP(READY_CLASS);
- mfp._setFocus();
- } else {
- mfp.bgOverlay.addClass(READY_CLASS);
- }
- _document.on("focusin" + EVENT_NS, mfp._onFocusIn);
- }, 16), mfp.isOpen = true, mfp.updateSize(windowHeight), _mfpTrigger(OPEN_EVENT), data;
- },
- /**
- * @return {undefined}
- */
- close : function() {
- if (mfp.isOpen) {
- _mfpTrigger(BEFORE_CLOSE_EVENT);
- /** @type {boolean} */
- mfp.isOpen = false;
- if (mfp.st.removalDelay && (!mfp.isLowIE && mfp.supportsTransition)) {
- mfp._addClassToMFP(REMOVING_CLASS);
- setTimeout(function() {
- mfp._close();
- }, mfp.st.removalDelay);
- } else {
- mfp._close();
- }
- }
- },
- /**
- * @return {undefined}
- */
- _close : function() {
- _mfpTrigger(CLOSE_EVENT);
- /** @type {string} */
- var classesToRemove = REMOVING_CLASS + " " + READY_CLASS + " ";
- if (mfp.bgOverlay.detach(), mfp.wrap.detach(), mfp.container.empty(), mfp.st.mainClass && (classesToRemove += mfp.st.mainClass + " "), mfp._removeClassFromMFP(classesToRemove), mfp.fixedContentPos) {
- var elem = {
- marginRight : ""
- };
- if (mfp.isIE7) {
- $("body, html").css("overflow", "");
- } else {
- /** @type {string} */
- elem.overflow = "";
- }
- $("html").css(elem);
- }
- _document.off("keyup" + EVENT_NS + " focusin" + EVENT_NS);
- mfp.ev.off(EVENT_NS);
- mfp.wrap.attr("class", "mfp-wrap").removeAttr("style");
- mfp.bgOverlay.attr("class", "mfp-bg");
- mfp.container.attr("class", "mfp-container");
- if (!!mfp.st.showCloseBtn) {
- if (!(mfp.st.closeBtnInside && mfp.currTemplate[mfp.currItem.type] !== true)) {
- if (mfp.currTemplate.closeBtn) {
- mfp.currTemplate.closeBtn.detach();
- }
- }
- }
- if (mfp._lastFocusedEl) {
- $(mfp._lastFocusedEl).focus();
- }
- /** @type {null} */
- mfp.currItem = null;
- /** @type {null} */
- mfp.content = null;
- /** @type {null} */
- mfp.currTemplate = null;
- /** @type {number} */
- mfp.prevHeight = 0;
- _mfpTrigger(AFTER_CLOSE_EVENT);
- },
- /**
- * @param {(Object|number)} winHeight
- * @return {undefined}
- */
- updateSize : function(winHeight) {
- if (mfp.isIOS) {
- /** @type {number} */
- var zoomLevel = document.documentElement.clientWidth / window.innerWidth;
- /** @type {number} */
- var height = window.innerHeight * zoomLevel;
- mfp.wrap.css("height", height);
- /** @type {number} */
- mfp.wH = height;
- } else {
- mfp.wH = winHeight || _window.height();
- }
- if (!mfp.fixedContentPos) {
- mfp.wrap.css("height", mfp.wH);
- }
- _mfpTrigger("Resize");
- },
- /**
- * @return {undefined}
- */
- updateItemHTML : function() {
- var item = mfp.items[mfp.index];
- mfp.contentContainer.detach();
- if (mfp.content) {
- mfp.content.detach();
- }
- if (!item.parsed) {
- item = mfp.parseEl(mfp.index);
- }
- var type = item.type;
- if (_mfpTrigger("BeforeChange", [mfp.currItem ? mfp.currItem.type : "", type]), mfp.currItem = item, !mfp.currTemplate[type]) {
- var page = mfp.st[type] ? mfp.st[type].markup : false;
- _mfpTrigger("FirstMarkupParse", page);
- mfp.currTemplate[type] = page ? $(page) : true;
- }
- if (_prevContentType) {
- if (_prevContentType !== item.type) {
- mfp.container.removeClass("mfp-" + _prevContentType + "-holder");
- }
- }
- var newContent = mfp["get" + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]);
- mfp.appendContent(newContent, type);
- /** @type {boolean} */
- item.preloaded = true;
- _mfpTrigger(CHANGE_EVENT, item);
- _prevContentType = item.type;
- mfp.container.prepend(mfp.contentContainer);
- _mfpTrigger("AfterChange");
- },
- /**
- * @param {?} newContent
- * @param {string} type
- * @return {undefined}
- */
- appendContent : function(newContent, type) {
- mfp.content = newContent;
- if (newContent) {
- if (mfp.st.showCloseBtn && (mfp.st.closeBtnInside && mfp.currTemplate[type] === true)) {
- if (!mfp.content.find(".mfp-close").length) {
- mfp.content.append(_getCloseBtn());
- }
- } else {
- mfp.content = newContent;
- }
- } else {
- /** @type {string} */
- mfp.content = "";
- }
- _mfpTrigger(BEFORE_APPEND_EVENT);
- mfp.container.addClass("mfp-" + type + "-holder");
- mfp.contentContainer.append(mfp.content);
- },
- /**
- * @param {number} index
- * @return {?}
- */
- parseEl : function(index) {
- var type;
- var item = mfp.items[index];
- if (item.tagName ? item = {
- el : $(item)
- } : (type = item.type, item = {
- data : item,
- src : item.src
- }), item.el) {
- var types = mfp.types;
- /** @type {number} */
- var i = 0;
- for (;types.length > i;i++) {
- if (item.el.hasClass("mfp-" + types[i])) {
- type = types[i];
- break;
- }
- }
- item.src = item.el.attr("data-mfp-src");
- if (!item.src) {
- item.src = item.el.attr("href");
- }
- }
- return item.type = type || (mfp.st.type || "inline"), item.index = index, item.parsed = true, mfp.items[index] = item, _mfpTrigger("ElementParse", item), mfp.items[index];
- },
- /**
- * @param {?} el
- * @param {Object} options
- * @return {undefined}
- */
- addGroup : function(el, options) {
- /**
- * @param {Event} e
- * @return {undefined}
- */
- var eHandler = function(e) {
- e.mfpEl = this;
- mfp._openClick(e, el, options);
- };
- if (!options) {
- options = {};
- }
- /** @type {string} */
- var type = "click.magnificPopup";
- options.mainEl = el;
- if (options.items) {
- /** @type {boolean} */
- options.isObj = true;
- el.off(type).on(type, eHandler);
- } else {
- /** @type {boolean} */
- options.isObj = false;
- if (options.delegate) {
- el.off(type).on(type, options.delegate, eHandler);
- } else {
- options.items = el;
- el.off(type).on(type, eHandler);
- }
- }
- },
- /**
- * @param {Event} e
- * @param {?} el
- * @param {Object} options
- * @return {?}
- */
- _openClick : function(e, el, options) {
- var r = void 0 !== options.midClick ? options.midClick : $.magnificPopup.defaults.midClick;
- if (r || 2 !== e.which && (!e.ctrlKey && !e.metaKey)) {
- var html = void 0 !== options.disableOn ? options.disableOn : $.magnificPopup.defaults.disableOn;
- if (html) {
- if ($.isFunction(html)) {
- if (!html.call(mfp)) {
- return true;
- }
- } else {
- if (html > _window.width()) {
- return true;
- }
- }
- }
- if (e.type) {
- e.preventDefault();
- if (mfp.isOpen) {
- e.stopPropagation();
- }
- }
- options.el = $(e.mfpEl);
- if (options.delegate) {
- options.items = el.find(options.delegate);
- }
- mfp.open(options);
- }
- },
- /**
- * @param {number} status
- * @param {string} text
- * @return {undefined}
- */
- updateStatus : function(status, text) {
- if (mfp.preloader) {
- if (_prevStatus !== status) {
- mfp.container.removeClass("mfp-s-" + _prevStatus);
- }
- if (!text) {
- if (!("loading" !== status)) {
- text = mfp.st.tLoading;
- }
- }
- var data = {
- status : status,
- text : text
- };
- _mfpTrigger("UpdateStatus", data);
- status = data.status;
- text = data.text;
- mfp.preloader.html(text);
- mfp.preloader.find("a").on("click", function(e) {
- e.stopImmediatePropagation();
- });
- mfp.container.addClass("mfp-s-" + status);
- /** @type {number} */
- _prevStatus = status;
- }
- },
- /**
- * @param {string} target
- * @return {?}
- */
- _checkIfClose : function(target) {
- if (!$(target).hasClass(PREVENT_CLOSE_CLASS)) {
- var dw = mfp.st.closeOnContentClick;
- var dh = mfp.st.closeOnBgClick;
- if (dw && dh) {
- return true;
- }
- if (!mfp.content || ($(target).hasClass("mfp-close") || mfp.preloader && target === mfp.preloader[0])) {
- return true;
- }
- if (target === mfp.content[0] || $.contains(mfp.content[0], target)) {
- if (dw) {
- return true;
- }
- } else {
- if (dh && $.contains(document, target)) {
- return true;
- }
- }
- return false;
- }
- },
- /**
- * @param {string} cName
- * @return {undefined}
- */
- _addClassToMFP : function(cName) {
- mfp.bgOverlay.addClass(cName);
- mfp.wrap.addClass(cName);
- },
- /**
- * @param {string} cName
- * @return {undefined}
- */
- _removeClassFromMFP : function(cName) {
- this.bgOverlay.removeClass(cName);
- mfp.wrap.removeClass(cName);
- },
- /**
- * @param {(Object|boolean|number|string)} winHeight
- * @return {?}
- */
- _hasScrollBar : function(winHeight) {
- return(mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height());
- },
- /**
- * @return {undefined}
- */
- _setFocus : function() {
- (mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus();
- },
- /**
- * @param {Event} e
- * @return {?}
- */
- _onFocusIn : function(e) {
- return e.target === mfp.wrap[0] || $.contains(mfp.wrap[0], e.target) ? void 0 : (mfp._setFocus(), false);
- },
- /**
- * @param {Object} template
- * @param {Function} values
- * @param {Object} item
- * @return {undefined}
- */
- _parseMarkup : function(template, values, item) {
- var arr;
- if (item.data) {
- values = $.extend(item.data, values);
- }
- _mfpTrigger(MARKUP_PARSE_EVENT, [template, values, item]);
- $.each(values, function(key, value) {
- if (void 0 === value || value === false) {
- return true;
- }
- if (arr = key.split("_"), arr.length > 1) {
- var el = template.find(EVENT_NS + "-" + arr[0]);
- if (el.length > 0) {
- var val = arr[1];
- if ("replaceWith" === val) {
- if (el[0] !== value[0]) {
- el.replaceWith(value);
- }
- } else {
- if ("img" === val) {
- if (el.is("img")) {
- el.attr("src", value);
- } else {
- el.replaceWith('<img src="' + value + '" class="' + el.attr("class") + '" />');
- }
- } else {
- el.attr(arr[1], value);
- }
- }
- }
- } else {
- template.find(EVENT_NS + "-" + key).html(value);
- }
- });
- },
- /**
- * @return {?}
- */
- _getScrollbarSize : function() {
- if (void 0 === mfp.scrollbarSize) {
- /** @type {Element} */
- var div = document.createElement("div");
- /** @type {string} */
- div.style.cssText = "width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;";
- document.body.appendChild(div);
- /** @type {number} */
- mfp.scrollbarSize = div.offsetWidth - div.clientWidth;
- document.body.removeChild(div);
- }
- return mfp.scrollbarSize;
- }
- };
- $.magnificPopup = {
- instance : null,
- proto : MagnificPopup.prototype,
- modules : [],
- /**
- * @param {Object} options
- * @param {number} index
- * @return {?}
- */
- open : function(options, index) {
- return _checkInstance(), options = options ? $.extend(true, {}, options) : {}, options.isObj = true, options.index = index || 0, this.instance.open(options);
- },
- /**
- * @return {?}
- */
- close : function() {
- return $.magnificPopup.instance && $.magnificPopup.instance.close();
- },
- /**
- * @param {string} name
- * @param {?} opt_attributes
- * @return {undefined}
- */
- registerModule : function(name, opt_attributes) {
- if (opt_attributes.options) {
- $.magnificPopup.defaults[name] = opt_attributes.options;
- }
- $.extend(this.proto, opt_attributes.proto);
- this.modules.push(name);
- },
- defaults : {
- disableOn : 0,
- key : null,
- midClick : false,
- mainClass : "",
- preloader : true,
- focus : "",
- closeOnContentClick : false,
- closeOnBgClick : true,
- closeBtnInside : true,
- showCloseBtn : true,
- enableEscapeKey : true,
- modal : false,
- alignTop : false,
- removalDelay : 0,
- prependTo : null,
- fixedContentPos : "auto",
- fixedBgPos : "auto",
- overflowY : "auto",
- closeMarkup : '<button title="%title%" type="button" class="mfp-close">×</button>',
- tClose : "Close (Esc)",
- tLoading : "Loading..."
- }
- };
- /**
- * @param {Object} options
- * @return {?}
- */
- $.fn.magnificPopup = function(options) {
- _checkInstance();
- var jqEl = $(this);
- if ("string" == typeof options) {
- if ("open" === options) {
- var items;
- var itemOpts = _isJQ ? jqEl.data("magnificPopup") : jqEl[0].magnificPopup;
- /** @type {number} */
- var index = parseInt(arguments[1], 10) || 0;
- if (itemOpts.items) {
- items = itemOpts.items[index];
- } else {
- items = jqEl;
- if (itemOpts.delegate) {
- items = items.find(itemOpts.delegate);
- }
- items = items.eq(index);
- }
- mfp._openClick({
- mfpEl : items
- }, jqEl, itemOpts);
- } else {
- if (mfp.isOpen) {
- mfp[options].apply(mfp, Array.prototype.slice.call(arguments, 1));
- }
- }
- } else {
- options = $.extend(true, {}, options);
- if (_isJQ) {
- jqEl.data("magnificPopup", options);
- } else {
- /** @type {Object} */
- jqEl[0].magnificPopup = options;
- }
- mfp.addGroup(jqEl, options);
- }
- return jqEl;
- };
- var _hiddenClass;
- var _inlinePlaceholder;
- var _lastInlineElement;
- /** @type {string} */
- var INLINE_NS = "inline";
- /**
- * @return {undefined}
- */
- var _putInlineElementsBack = function() {
- if (_lastInlineElement) {
- _inlinePlaceholder.after(_lastInlineElement.addClass(_hiddenClass)).detach();
- /** @type {null} */
- _lastInlineElement = null;
- }
- };
- $.magnificPopup.registerModule(INLINE_NS, {
- options : {
- hiddenClass : "hide",
- markup : "",
- tNotFound : "Content not found"
- },
- proto : {
- /**
- * @return {undefined}
- */
- initInline : function() {
- mfp.types.push(INLINE_NS);
- _mfpOn(CLOSE_EVENT + "." + INLINE_NS, function() {
- _putInlineElementsBack();
- });
- },
- /**
- * @param {Object} item
- * @param {Object} template
- * @return {?}
- */
- getInline : function(item, template) {
- if (_putInlineElementsBack(), item.src) {
- var inlineSt = mfp.st.inline;
- var el = $(item.src);
- if (el.length) {
- var tbody = el[0].parentNode;
- if (tbody) {
- if (tbody.tagName) {
- if (!_inlinePlaceholder) {
- _hiddenClass = inlineSt.hiddenClass;
- _inlinePlaceholder = _getEl(_hiddenClass);
- /** @type {string} */
- _hiddenClass = "mfp-" + _hiddenClass;
- }
- _lastInlineElement = el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass);
- }
- }
- mfp.updateStatus("ready");
- } else {
- mfp.updateStatus("error", inlineSt.tNotFound);
- el = $("<div>");
- }
- return item.inlineElement = el, el;
- }
- return mfp.updateStatus("ready"), mfp._parseMarkup(template, {}, item), template;
- }
- }
- });
- var className;
- /** @type {string} */
- var AJAX_NS = "ajax";
- /**
- * @return {undefined}
- */
- var _removeAjaxCursor = function() {
- if (className) {
- _body.removeClass(className);
- }
- };
- /**
- * @return {undefined}
- */
- var _destroyAjaxRequest = function() {
- _removeAjaxCursor();
- if (mfp.req) {
- mfp.req.abort();
- }
- };
- $.magnificPopup.registerModule(AJAX_NS, {
- options : {
- settings : null,
- cursor : "mfp-ajax-cur",
- tError : '<a href="%url%">The content</a> could not be loaded.'
- },
- proto : {
- /**
- * @return {undefined}
- */
- initAjax : function() {
- mfp.types.push(AJAX_NS);
- className = mfp.st.ajax.cursor;
- _mfpOn(CLOSE_EVENT + "." + AJAX_NS, _destroyAjaxRequest);
- _mfpOn("BeforeChange." + AJAX_NS, _destroyAjaxRequest);
- },
- /**
- * @param {Object} item
- * @return {?}
- */
- getAjax : function(item) {
- if (className) {
- _body.addClass(className);
- }
- mfp.updateStatus("loading");
- var opts = $.extend({
- url : item.src,
- /**
- * @param {string} type
- * @param {?} elems
- * @param {Object} elem
- * @return {undefined}
- */
- success : function(type, elems, elem) {
- var temp = {
- data : type,
- xhr : elem
- };
- _mfpTrigger("ParseAjax", temp);
- mfp.appendContent($(temp.data), AJAX_NS);
- /** @type {boolean} */
- item.finished = true;
- _removeAjaxCursor();
- mfp._setFocus();
- setTimeout(function() {
- mfp.wrap.addClass(READY_CLASS);
- }, 16);
- mfp.updateStatus("ready");
- _mfpTrigger("AjaxContentAdded");
- },
- /**
- * @return {undefined}
- */
- error : function() {
- _removeAjaxCursor();
- /** @type {boolean} */
- item.finished = item.loadError = true;
- mfp.updateStatus("error", mfp.st.ajax.tError.replace("%url%", item.src));
- }
- }, mfp.st.ajax.settings);
- return mfp.req = $.ajax(opts), "";
- }
- }
- });
- var id;
- /**
- * @param {Object} item
- * @return {?}
- */
- var _getTitle = function(item) {
- if (item.data && void 0 !== item.data.title) {
- return item.data.title;
- }
- var src = mfp.st.image.titleSrc;
- if (src) {
- if ($.isFunction(src)) {
- return src.call(mfp, item);
- }
- if (item.el) {
- return item.el.attr(src) || "";
- }
- }
- return "";
- };
- $.magnificPopup.registerModule("image", {
- options : {
- markup : '<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',
- cursor : "mfp-zoom-out-cur",
- titleSrc : "title",
- verticalFit : true,
- tError : '<a href="%url%">The image</a> could not be loaded.'
- },
- proto : {
- /**
- * @return {undefined}
- */
- initImage : function() {
- var imgSt = mfp.st.image;
- /** @type {string} */
- var ns = ".image";
- mfp.types.push("image");
- _mfpOn(OPEN_EVENT + ns, function() {
- if ("image" === mfp.currItem.type) {
- if (imgSt.cursor) {
- _body.addClass(imgSt.cursor);
- }
- }
- });
- _mfpOn(CLOSE_EVENT + ns, function() {
- if (imgSt.cursor) {
- _body.removeClass(imgSt.cursor);
- }
- _window.off("resize" + EVENT_NS);
- });
- _mfpOn("Resize" + ns, mfp.resizeImage);
- if (mfp.isLowIE) {
- _mfpOn("AfterChange", mfp.resizeImage);
- }
- },
- /**
- * @return {undefined}
- */
- resizeImage : function() {
- var item = mfp.currItem;
- if (item && (item.img && mfp.st.image.verticalFit)) {
- /** @type {number} */
- var decr = 0;
- if (mfp.isLowIE) {
- /** @type {number} */
- decr = parseInt(item.img.css("padding-top"), 10) + parseInt(item.img.css("padding-bottom"), 10);
- }
- item.img.css("max-height", mfp.wH - decr);
- }
- },
- /**
- * @param {Object} item
- * @return {undefined}
- */
- _onImageHasSize : function(item) {
- if (item.img) {
- /** @type {boolean} */
- item.hasSize = true;
- if (id) {
- clearInterval(id);
- }
- /** @type {boolean} */
- item.isCheckingImgSize = false;
- _mfpTrigger("ImageHasSize", item);
- if (item.imgHidden) {
- if (mfp.content) {
- mfp.content.removeClass("mfp-loading");
- }
- /** @type {boolean} */
- item.imgHidden = false;
- }
- }
- },
- /**
- * @param {Object} item
- * @return {undefined}
- */
- findImageSize : function(item) {
- /** @type {number} */
- var n = 0;
- var img = item.img[0];
- /**
- * @param {number} delay
- * @return {undefined}
- */
- var mfpSetInterval = function(delay) {
- if (id) {
- clearInterval(id);
- }
- /** @type {number} */
- id = setInterval(function() {
- return img.naturalWidth > 0 ? (mfp._onImageHasSize(item), void 0) : (n > 200 && clearInterval(id), n++, 3 === n ? mfpSetInterval(10) : 40 === n ? mfpSetInterval(50) : 100 === n && mfpSetInterval(500), void 0);
- }, delay);
- };
- mfpSetInterval(1);
- },
- /**
- * @param {Object} item
- * @param {Object} template
- * @return {?}
- */
- getImage : function(item, template) {
- /** @type {number} */
- var o = 0;
- /**
- * @return {undefined}
- */
- var onLoadComplete = function() {
- if (item) {
- if (item.img[0].complete) {
- item.img.off(".mfploader");
- if (item === mfp.currItem) {
- mfp._onImageHasSize(item);
- mfp.updateStatus("ready");
- }
- /** @type {boolean} */
- item.hasSize = true;
- /** @type {boolean} */
- item.loaded = true;
- _mfpTrigger("ImageLoadComplete");
- } else {
- o++;
- if (200 > o) {
- setTimeout(onLoadComplete, 100);
- } else {
- onLoadError();
- }
- }
- }
- };
- /**
- * @return {undefined}
- */
- var onLoadError = function() {
- if (item) {
- item.img.off(".mfploader");
- if (item === mfp.currItem) {
- mfp._onImageHasSize(item);
- mfp.updateStatus("error", imgSt.tError.replace("%url%", item.src));
- }
- /** @type {boolean} */
- item.hasSize = true;
- /** @type {boolean} */
- item.loaded = true;
- /** @type {boolean} */
- item.loadError = true;
- }
- };
- var imgSt = mfp.st.image;
- var $el = template.find(".mfp-img");
- if ($el.length) {
- /** @type {Element} */
- var img = document.createElement("img");
- /** @type {string} */
- img.className = "mfp-img";
- if (item.el) {
- if (item.el.find("img").length) {
- img.alt = item.el.find("img").attr("alt");
- }
- }
- item.img = $(img).on("load.mfploader", onLoadComplete).on("error.mfploader", onLoadError);
- img.src = item.src;
- if ($el.is("img")) {
- item.img = item.img.clone();
- }
- img = item.img[0];
- if (img.naturalWidth > 0) {
- /** @type {boolean} */
- item.hasSize = true;
- } else {
- if (!img.width) {
- /** @type {boolean} */
- item.hasSize = false;
- }
- }
- }
- return mfp._parseMarkup(template, {
- title : _getTitle(item),
- img_replaceWith : item.img
- }, item), mfp.resizeImage(), item.hasSize ? (id && clearInterval(id), item.loadError ? (template.addClass("mfp-loading"), mfp.updateStatus("error", imgSt.tError.replace("%url%", item.src))) : (template.removeClass("mfp-loading"), mfp.updateStatus("ready")), template) : (mfp.updateStatus("loading"), item.loading = true, item.hasSize || (item.imgHidden = true, template.addClass("mfp-loading"), mfp.findImageSize(item)), template);
- }
- }
- });
- var W;
- /**
- * @return {?}
- */
- var getHasMozTransform = function() {
- return void 0 === W && (W = void 0 !== document.createElement("p").style.MozTransform), W;
- };
- $.magnificPopup.registerModule("zoom", {
- options : {
- enabled : false,
- easing : "ease-in-out",
- duration : 300,
- /**
- * @param {Object} element
- * @return {?}
- */
- opener : function(element) {
- return element.is("img") ? element : element.find("img");
- }
- },
- proto : {
- /**
- * @return {undefined}
- */
- initZoom : function() {
- var tmp;
- var zoomSt = mfp.st.zoom;
- /** @type {string} */
- var ns = ".zoom";
- if (zoomSt.enabled && mfp.supportsTransition) {
- var timer;
- var elem;
- var duration = zoomSt.duration;
- /**
- * @param {?} a
- * @return {?}
- */
- var getElToAnimate = function(a) {
- var newImg = a.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image");
- /** @type {string} */
- var transition = "all " + zoomSt.duration / 1E3 + "s " + zoomSt.easing;
- var cssObj = {
- position : "fixed",
- zIndex : 9999,
- left : 0,
- top : 0,
- "-webkit-backface-visibility" : "hidden"
- };
- /** @type {string} */
- var t = "transition";
- return cssObj["-webkit-" + t] = cssObj["-moz-" + t] = cssObj["-o-" + t] = cssObj[t] = transition, newImg.css(cssObj), newImg;
- };
- /**
- * @return {undefined}
- */
- var showMainContent = function() {
- mfp.content.css("visibility", "visible");
- };
- _mfpOn("BuildControls" + ns, function() {
- if (mfp._allowZoom()) {
- if (clearTimeout(timer), mfp.content.css("visibility", "hidden"), tmp = mfp._getItemToZoom(), !tmp) {
- return showMainContent(), void 0;
- }
- elem = getElToAnimate(tmp);
- elem.css(mfp._getOffset());
- mfp.wrap.append(elem);
- /** @type {number} */
- timer = setTimeout(function() {
- elem.css(mfp._getOffset(true));
- /** @type {number} */
- timer = setTimeout(function() {
- showMainContent();
- setTimeout(function() {
- elem.remove();
- /** @type {null} */
- tmp = elem = null;
- _mfpTrigger("ZoomAnimationEnded");
- }, 16);
- }, duration);
- }, 16);
- }
- });
- _mfpOn(BEFORE_CLOSE_EVENT + ns, function() {
- if (mfp._allowZoom()) {
- if (clearTimeout(timer), mfp.st.removalDelay = duration, !tmp) {
- if (tmp = mfp._getItemToZoom(), !tmp) {
- return;
- }
- elem = getElToAnimate(tmp);
- }
- elem.css(mfp._getOffset(true));
- mfp.wrap.append(elem);
- mfp.content.css("visibility", "hidden");
- setTimeout(function() {
- elem.css(mfp._getOffset());
- }, 16);
- }
- });
- _mfpOn(CLOSE_EVENT + ns, function() {
- if (mfp._allowZoom()) {
- showMainContent();
- if (elem) {
- elem.remove();
- }
- /** @type {null} */
- tmp = null;
- }
- });
- }
- },
- /**
- * @return {?}
- */
- _allowZoom : function() {
- return "image" === mfp.currItem.type;
- },
- /**
- * @return {?}
- */
- _getItemToZoom : function() {
- return mfp.currItem.hasSize ? mfp.currItem.img : false;
- },
- /**
- * @param {boolean} dataAndEvents
- * @return {?}
- */
- _getOffset : function(dataAndEvents) {
- var parent;
- parent = dataAndEvents ? mfp.currItem.img : mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem);
- var offset = parent.offset();
- /** @type {number} */
- var paddingTop = parseInt(parent.css("padding-top"), 10);
- /** @type {number} */
- var paddingBottom = parseInt(parent.css("padding-bottom"), 10);
- offset.top -= $(window).scrollTop() - paddingTop;
- var obj = {
- width : parent.width(),
- height : (_isJQ ? parent.innerHeight() : parent[0].offsetHeight) - paddingBottom - paddingTop
- };
- return getHasMozTransform() ? obj["-moz-transform"] = obj.transform = "translate(" + offset.left + "px," + offset.top + "px)" : (obj.left = offset.left, obj.top = offset.top), obj;
- }
- }
- });
- /** @type {string} */
- var IFRAME_NS = "iframe";
- /** @type {string} */
- var path = "//about:blank";
- /**
- * @param {boolean} isShowing
- * @return {undefined}
- */
- var _fixIframeBugs = function(isShowing) {
- if (mfp.currTemplate[IFRAME_NS]) {
- var el = mfp.currTemplate[IFRAME_NS].find("iframe");
- if (el.length) {
- if (!isShowing) {
- /** @type {string} */
- el[0].src = path;
- }
- if (mfp.isIE8) {
- el.css("display", isShowing ? "block" : "none");
- }
- }
- }
- };
- $.magnificPopup.registerModule(IFRAME_NS, {
- options : {
- markup : '<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',
- srcAction : "iframe_src",
- patterns : {
- youtube : {
- index : "youtube.com",
- id : "v=",
- src : "//www.youtube.com/embed/%id%?autoplay=1"
- },
- vimeo : {
- index : "vimeo.com/",
- id : "/",
- src : "//player.vimeo.com/video/%id%?autoplay=1"
- },
- gmaps : {
- index : "//maps.google.",
- src : "%id%&output=embed"
- }
- }
- },
- proto : {
- /**
- * @return {undefined}
- */
- initIframe : function() {
- mfp.types.push(IFRAME_NS);
- _mfpOn("BeforeChange", function(dataAndEvents, prevType, newType) {
- if (prevType !== newType) {
- if (prevType === IFRAME_NS) {
- _fixIframeBugs();
- } else {
- if (newType === IFRAME_NS) {
- _fixIframeBugs(true);
- }
- }
- }
- });
- _mfpOn(CLOSE_EVENT + "." + IFRAME_NS, function() {
- _fixIframeBugs();
- });
- },
- /**
- * @param {Object} item
- * @param {Object} template
- * @return {?}
- */
- getIframe : function(item, template) {
- var embedSrc = item.src;
- var iframeSt = mfp.st.iframe;
- $.each(iframeSt.patterns, function() {
- return embedSrc.indexOf(this.index) > -1 ? (this.id && (embedSrc = "string" == typeof this.id ? embedSrc.substr(embedSrc.lastIndexOf(this.id) + this.id.length, embedSrc.length) : this.id.call(this, embedSrc)), embedSrc = this.src.replace("%id%", embedSrc), false) : void 0;
- });
- var dataObj = {};
- return iframeSt.srcAction && (dataObj[iframeSt.srcAction] = embedSrc), mfp._parseMarkup(template, dataObj, item), mfp.updateStatus("ready"), template;
- }
- }
- });
- /**
- * @param {number} index
- * @return {?}
- */
- var _getLoopedId = function(index) {
- var numSlides = mfp.items.length;
- return index > numSlides - 1 ? index - numSlides : 0 > index ? numSlides + index : index;
- };
- /**
- * @param {string} text
- * @param {number} curr
- * @param {?} total
- * @return {?}
- */
- var _replaceCurrTotal = function(text, curr, total) {
- return text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total);
- };
- $.magnificPopup.registerModule("gallery", {
- options : {
- enabled : false,
- arrowMarkup : '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',
- preload : [0, 2],
- navigateByImgClick : true,
- arrows : true,
- tPrev : "Previous (Left arrow key)",
- tNext : "Next (Right arrow key)",
- tCounter : "%curr% of %total%"
- },
- proto : {
- /**
- * @return {?}
- */
- initGallery : function() {
- var gSt = mfp.st.gallery;
- /** @type {string} */
- var ns = ".mfp-gallery";
- /** @type {boolean} */
- var supportsFastClick = Boolean($.fn.mfpFastClick);
- return mfp.direction = true, gSt && gSt.enabled ? (cls += " mfp-gallery", _mfpOn(OPEN_EVENT + ns, function() {
- if (gSt.navigateByImgClick) {
- mfp.wrap.on("click" + ns, ".mfp-img", function() {
- return mfp.items.length > 1 ? (mfp.next(), false) : void 0;
- });
- }
- _document.on("keydown" + ns, function(event) {
- if (37 === event.keyCode) {
- mfp.prev();
- } else {
- if (39 === event.keyCode) {
- mfp.next();
- }
- }
- });
- }), _mfpOn("UpdateStatus" + ns, function(dataAndEvents, data) {
- if (data.text) {
- data.text = _replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length);
- }
- }), _mfpOn(MARKUP_PARSE_EVENT + ns, function(dataAndEvents, deepDataAndEvents, $scope, item) {
- var l = mfp.items.length;
- $scope.counter = l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l) : "";
- }), _mfpOn("BuildControls" + ns, function() {
- if (mfp.items.length > 1 && (gSt.arrows && !mfp.arrowLeft)) {
- var markup = gSt.arrowMarkup;
- var arrowLeft = mfp.arrowLeft = $(markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, "left")).addClass(PREVENT_CLOSE_CLASS);
- var arg = mfp.arrowRight = $(markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, "right")).addClass(PREVENT_CLOSE_CLASS);
- /** @type {string} */
- var eName = supportsFastClick ? "mfpFastClick" : "click";
- arrowLeft[eName](function() {
- mfp.prev();
- });
- arg[eName](function() {
- mfp.next();
- });
- if (mfp.isIE7) {
- _getEl("b", arrowLeft[0], false, true);
- _getEl("a", arrowLeft[0], false, true);
- _getEl("b", arg[0], false, true);
- _getEl("a", arg[0], false, true);
- }
- mfp.container.append(arrowLeft.add(arg));
- }
- }), _mfpOn(CHANGE_EVENT + ns, function() {
- if (mfp._preloadTimeout) {
- clearTimeout(mfp._preloadTimeout);
- }
- /** @type {number} */
- mfp._preloadTimeout = setTimeout(function() {
- mfp.preloadNearbyImages();
- /** @type {null} */
- mfp._preloadTimeout = null;
- }, 16);
- }), _mfpOn(CLOSE_EVENT + ns, function() {
- _document.off(ns);
- mfp.wrap.off("click" + ns);
- if (mfp.arrowLeft) {
- if (supportsFastClick) {
- mfp.arrowLeft.add(mfp.arrowRight).destroyMfpFastClick();
- }
- }
- /** @type {null} */
- mfp.arrowRight = mfp.arrowLeft = null;
- }), void 0) : false;
- },
- /**
- * @return {undefined}
- */
- next : function() {
- /** @type {boolean} */
- mfp.direction = true;
- mfp.index = _getLoopedId(mfp.index + 1);
- mfp.updateItemHTML();
- },
- /**
- * @return {undefined}
- */
- prev : function() {
- /** @type {boolean} */
- mfp.direction = false;
- mfp.index = _getLoopedId(mfp.index - 1);
- mfp.updateItemHTML();
- },
- /**
- * @param {number} newIndex
- * @return {undefined}
- */
- goTo : function(newIndex) {
- /** @type {boolean} */
- mfp.direction = newIndex >= mfp.index;
- /** @type {number} */
- mfp.index = newIndex;
- mfp.updateItemHTML();
- },
- /**
- * @return {undefined}
- */
- preloadNearbyImages : function() {
- var i;
- var p = mfp.st.gallery.preload;
- /** @type {number} */
- var preloadBefore = Math.min(p[0], mfp.items.length);
- /** @type {number} */
- var preloadAfter = Math.min(p[1], mfp.items.length);
- /** @type {number} */
- i = 1;
- for (;(mfp.direction ? preloadAfter : preloadBefore) >= i;i++) {
- mfp._preloadItem(mfp.index + i);
- }
- /** @type {number} */
- i = 1;
- for (;(mfp.direction ? preloadBefore : preloadAfter) >= i;i++) {
- mfp._preloadItem(mfp.index - i);
- }
- },
- /**
- * @param {number} index
- * @return {undefined}
- */
- _preloadItem : function(index) {
- if (index = _getLoopedId(index), !mfp.items[index].preloaded) {
- var item = mfp.items[index];
- if (!item.parsed) {
- item = mfp.parseEl(index);
- }
- _mfpTrigger("LazyLoad", item);
- if ("image" === item.type) {
- item.img = $('<img class="mfp-img" />').on("load.mfploader", function() {
- /** @type {boolean} */
- item.hasSize = true;
- }).on("error.mfploader", function() {
- /** @type {boolean} */
- item.hasSize = true;
- /** @type {boolean} */
- item.loadError = true;
- _mfpTrigger("LazyLoadError", item);
- }).attr("src", item.src);
- }
- /** @type {boolean} */
- item.preloaded = true;
- }
- }
- }
- });
- /** @type {string} */
- var RETINA_NS = "retina";
- $.magnificPopup.registerModule(RETINA_NS, {
- options : {
- /**
- * @param {Element} item
- * @return {?}
- */
- replaceSrc : function(item) {
- return item.src.replace(/\.\w+$/, function(dataAndEvents) {
- return "@2x" + dataAndEvents;
- });
- },
- ratio : 1
- },
- proto : {
- /**
- * @return {undefined}
- */
- initRetina : function() {
- if (window.devicePixelRatio > 1) {
- var st = mfp.st.retina;
- var ratio = st.ratio;
- ratio = isNaN(ratio) ? ratio() : ratio;
- if (ratio > 1) {
- _mfpOn("ImageHasSize." + RETINA_NS, function(dataAndEvents, item) {
- item.img.css({
- "max-width" : item.img[0].naturalWidth / ratio,
- width : "100%"
- });
- });
- _mfpOn("ElementParse." + RETINA_NS, function(dataAndEvents, item) {
- item.src = st.replaceSrc(item, ratio);
- });
- }
- }
- }
- }
- });
- (function() {
- /** @type {number} */
- var backoff = 1E3;
- /** @type {boolean} */
- var hasTouch = "ontouchstart" in window;
- /**
- * @return {undefined}
- */
- var unbindTouchMove = function() {
- _window.off("touchmove" + ns + " touchend" + ns);
- };
- /** @type {string} */
- var eName = "mfpFastClick";
- /** @type {string} */
- var ns = "." + eName;
- /**
- * @param {?} callback
- * @return {?}
- */
- $.fn.mfpFastClick = function(callback) {
- return $(this).each(function() {
- var a;
- var elem = $(this);
- if (hasTouch) {
- var tref;
- var x;
- var y;
- var u;
- var touch;
- var position;
- elem.on("touchstart" + ns, function(e) {
- /** @type {boolean} */
- u = false;
- /** @type {number} */
- position = 1;
- touch = e.originalEvent ? e.originalEvent.touches[0] : e.touches[0];
- x = touch.clientX;
- y = touch.clientY;
- _window.on("touchmove" + ns, function(e) {
- touch = e.originalEvent ? e.originalEvent.touches : e.touches;
- position = touch.length;
- touch = touch[0];
- if (Math.abs(touch.clientX - x) > 10 || Math.abs(touch.clientY - y) > 10) {
- /** @type {boolean} */
- u = true;
- unbindTouchMove();
- }
- }).on("touchend" + ns, function(types) {
- unbindTouchMove();
- if (!u) {
- if (!(position > 1)) {
- /** @type {boolean} */
- a = true;
- types.preventDefault();
- clearTimeout(tref);
- /** @type {number} */
- tref = setTimeout(function() {
- /** @type {boolean} */
- a = false;
- }, backoff);
- callback();
- }
- }
- });
- });
- }
- elem.on("click" + ns, function() {
- if (!a) {
- callback();
- }
- });
- });
- };
- /**
- * @return {undefined}
- */
- $.fn.destroyMfpFastClick = function() {
- $(this).off("touchstart" + ns + " click" + ns);
- if (hasTouch) {
- _window.off("touchmove" + ns + " touchend" + ns);
- }
- };
- })();
- _checkInstance();
- });
- (function(global, $) {
- /**
- * @param {string} i
- * @return {?}
- */
- function action(i) {
- return i in instance ? +instance[i] : null != global.localStorage ? (null == global.localStorage[i] && (global.localStorage[i] = 0 + ~~(100 * Math.random())), +global.localStorage[i]) : 0;
- }
- /**
- * @param {Array} d
- * @return {undefined}
- */
- function run(d) {
- if (reply) {
- /** @type {Array} */
- var records = [];
- /** @type {number} */
- var j = 0;
- for (;j < d.length;j++) {
- if ("type" in d[j] && "dfpads" != d[j].type) {
- console.log("trying to refresh a non dfp ad. continue");
- } else {
- if (debugads) {
- console.log("DFP: refreshing:" + d[j].data.A);
- }
- records.push(d[j].data);
- }
- }
- if (!(0 >= records.length)) {
- if (!!global.googletag) {
- global.googletag.cmd.push(function() {
- if (w) {
- /** @type {boolean} */
- w = false;
- setTimeout(function() {
- /** @type {boolean} */
- w = true;
- }, 0);
- if (global.googletag) {
- if (global.googletag.pubads) {
- if (global.googletag.pubads().refresh) {
- global.googletag.pubads().refresh(records);
- }
- }
- }
- }
- });
- }
- }
- } else {
- console.log("dfpInitialized=" + reply);
- console.log("queuing refresh");
- /** @type {Array} */
- dir = d;
- }
- }
- /**
- * @return {undefined}
- */
- function clearMenus() {
- $("#videoContainer").fadeOut(800);
- global.MC.onVideoClose();
- }
- /**
- * @return {?}
- */
- function _isFunction() {
- return!(5 > Sprite("ABGroupRubicon"));
- }
- /**
- * @param {string} w
- * @return {?}
- */
- function Sprite(w) {
- return w in wellKnownWords ? wellKnownWords[w] : 0;
- }
- var instance = {};
- (function() {
- /** @type {string} */
- var params = global.location.search;
- if ("?" == params.charAt(0)) {
- /** @type {string} */
- params = params.slice(1);
- }
- /** @type {Array.<string>} */
- params = params.split("&");
- /** @type {number} */
- var i = 0;
- for (;i < params.length;i++) {
- /** @type {Array.<string>} */
- var e = params[i].split("=");
- /** @type {string} */
- instance[e[0]] = e[1];
- }
- })();
- /** @type {boolean} */
- var debugads = "debugads" in instance;
- var wellKnownWords = {};
- /** @type {boolean} */
- var w = true;
- var data = {
- aa : [],
- ab : [],
- ac : []
- };
- global.adSlots = data;
- /** @type {boolean} */
- var reply = false;
- /** @type {null} */
- var dir = null;
- var model = function(opt_attributes) {
- /**
- * @param {Object} id
- * @param {?} opt_attributes
- * @param {string} deepDataAndEvents
- * @return {?}
- */
- opt_attributes.defineSlot = function(id, opt_attributes, deepDataAndEvents) {
- var jQuery = global.googletag;
- return{
- type : "dfpads",
- data : jQuery.defineSlot(id, opt_attributes, deepDataAndEvents).addService(jQuery.pubads())
- };
- };
- return opt_attributes;
- }({});
- global.googleAdsModule = model;
- var self = function(exports) {
- /**
- * @param {string} d
- * @param {string} key
- * @param {Object} data
- * @return {undefined}
- */
- exports.b = function(d, key, data) {
- /** @type {string} */
- var g = "https:" == document.location.protocol ? "https:" : "http:";
- key = key.split("x");
- /** @type {string} */
- var id = d + "-fif";
- /** @type {Element} */
- var frame = document.createElement("iframe");
- /** @type {string} */
- frame.style.cssText = "width: " + key[0] + "px; height: " + key[1] + "px; border: 0; margin: 0; padding: 0; overflow: hidden;";
- frame.setAttribute("scrolling", "no");
- /** @type {string} */
- frame.src = "about:blank";
- /** @type {string} */
- frame.id = id;
- document.getElementById(d).appendChild(frame);
- d = frame.contentWindow ? frame.contentWindow.document : frame.contentDocument.document;
- d.open().write("<html>\n<head>\n<script type='text/javascript'>inDapIF=true;\n\x3c/script>\n</head>\n<body style='margin : 0; padding: 0;'>\n\x3c!-- Rubicon Project Smart Tag --\x3e\n<script type='text/javascript'>\nrp_account = '" + data.acct + "';\nrp_site = '" + data.site + "';\nrp_zonesize = '" + data.zone + "-" + data.size + "';\nrp_adtype = 'js';\nrp_kw = '" + data.kw + "';\nrp_visitor = " + data.visitor + ";\nrp_inventory = " + data.inventory + ";\n\x3c/script>\n<script type='text/javascript' src=\"" +
- g + "//ads.rubiconproject.com/ad/" + data.acct + '.js">\x3c/script>\n</body>\n</html>');
- d.close();
- };
- /**
- * @param {Object} id
- * @param {Object} opt_attributes
- * @param {string} data
- * @return {?}
- */
- exports.defineSlot = function(id, opt_attributes, data) {
- opt_attributes = {
- type : "rubicon",
- data : {
- id : data,
- size : opt_attributes
- }
- };
- data = {};
- var key;
- for (key in id) {
- if (id.hasOwnProperty(key)) {
- data[key] = id[key];
- }
- }
- data.kw = global.rpx_params.kw;
- /** @type {string} */
- data.visitor = JSON.stringify(global.rpx_params.visitor);
- /** @type {string} */
- data.inventory = JSON.stringify(global.rpx_params.inventory);
- /** @type {string} */
- opt_attributes.data.json = data;
- return opt_attributes;
- };
- /**
- * @param {string} value
- * @param {string} n
- * @param {Object} k
- * @return {undefined}
- */
- exports.f = function(value, n, k) {
- /** @type {string} */
- var total = value + "-fif";
- var matches = global.jQuery("#" + total);
- if (null != matches) {
- matches.remove();
- } else {
- console.log("couldn't find element", matches, total);
- }
- this.b(value, n, k);
- };
- /**
- * @param {string} msg
- * @return {undefined}
- */
- exports.c = function(msg) {
- /** @type {string} */
- msg = msg + "-fif";
- var matches = global.jQuery("#" + msg);
- if (null != matches) {
- matches.remove();
- } else {
- console.log("couldn't find element", matches, msg);
- }
- };
- /**
- * @param {string} a
- * @param {string} mod
- * @param {Object} k
- * @return {undefined}
- */
- exports.g = function(a, mod, k) {
- this.b(a, mod, k);
- };
- return exports;
- }({});
- global.rubiconAds = self;
- /** @type {boolean} */
- var previousKey = false;
- global.supersonicAds = function(opt_attributes) {
- /**
- * @return {undefined}
- */
- opt_attributes.BrandConnectDoneEvent = function() {
- /** @type {boolean} */
- global.hasEngagement = false;
- global.MC.checkVideoAds();
- };
- /**
- * @return {undefined}
- */
- opt_attributes.BrandConnectOpenEvent = function() {
- };
- /**
- * @return {undefined}
- */
- opt_attributes.BrandConnectCloseEvent = function() {
- clearMenus();
- SSA_CORE.BrandConnect.close();
- };
- /**
- * @return {undefined}
- */
- opt_attributes.BrandConnectCompletedEvent = function() {
- };
- /**
- * @param {Array} value
- * @return {undefined}
- */
- opt_attributes.BrandConnectReadyEvent = function(value) {
- /** @type {boolean} */
- previousKey = "undefined" !== typeof value && value.length ? true : false;
- /** @type {boolean} */
- global.hasEngagement = previousKey;
- };
- return opt_attributes;
- }({});
- /**
- * @return {undefined}
- */
- global.openOfferwall = function() {
- if (null != SSA_CORE) {
- $("#offerwallIframe").attr("src", "http://www.supersonicads.com/delivery/panel.php?applicationKey=" + EnvConfig.supersonic_app_key + "&applicationUserId=" + global.ssa_json.custom_user_id + "&custom_user_id=" + global.ssa_json.custom_user_id + "&applicationUserIdSignature=optional");
- $("#oferwallContainer").fadeIn(400);
- }
- };
- /**
- * @return {undefined}
- */
- global.closeOfferwall = function() {
- $("#oferwallContainer").fadeOut(400);
- global.MC.onOffwerwallClose();
- };
- /**
- * @return {undefined}
- */
- global.openVideoAd = function() {
- if (null != SSA_CORE) {
- if (previousKey) {
- SSA_CORE.BrandConnect.engage();
- }
- }
- };
- /** @type {function (): undefined} */
- global.closeVideoContainer = clearMenus;
- /** @type {function (string): ?} */
- global.getABGroup = Sprite;
- /**
- * @param {Array} d
- * @return {undefined}
- */
- global.refreshAd = function(d) {
- run(d);
- /** @type {number} */
- var j = 0;
- for (;j < d.length;j++) {
- if (!("type" in d[j] && "rubicon" != d[j].type)) {
- var data = d[j].data;
- if (debugads) {
- console.log("Rubicon: refreshing:" + data.id);
- }
- self.b(data.id, data.size, data.json);
- }
- }
- };
- /**
- * @param {Array} d
- * @return {undefined}
- */
- global.destroyAd = function(d) {
- /** @type {Array} */
- var i = [];
- /** @type {number} */
- var j = 0;
- for (;j < d.length;j++) {
- if (!("type" in d[j] && "dfpads" != d[j].type)) {
- if (debugads) {
- console.log("DFP: destroying:" + d[j].data.A);
- }
- i.push(d[j].data);
- }
- }
- if (global.googletag) {
- if (global.googletag.pubads) {
- if (global.googletag.pubads().clear) {
- global.googletag.pubads().clear(i);
- }
- }
- }
- /** @type {number} */
- i = 0;
- for (;i < d.length;i++) {
- if (!("type" in d[i] && "rubicon" != d[i].type)) {
- if (debugads) {
- console.log("Rubicon: destroying:" + d[i].data.id, d[i]);
- }
- self.c(d[i].data.id);
- }
- }
- };
- var props = {
- a : false
- };
- global.agarAdModule = props;
- wellKnownWords.ABGroupDFP = action("AB9");
- wellKnownWords.ABGroupRubicon = action("AB12_Rubicon");
- global.location.search.indexOf("fb");
- props.a = global.hasBottomAd;
- if (debugads) {
- console.log("Init ads");
- }
- (function() {
- var attr = {};
- /** @type {null} */
- var opts = null;
- /** @type {null} */
- var template = null;
- /** @type {null} */
- var id = null;
- /** @type {null} */
- var email = null;
- /** @type {boolean} */
- var data = -1 != global.location.search.indexOf("fb");
- var k = _isFunction() && !data;
- var length = props.a;
- if (data) {
- /** @type {string} */
- attr = "/53945695/agar_facebook/agar/300x250";
- /** @type {string} */
- id = "/53945695/agar_facebook/agar/300x250_Stats";
- /** @type {string} */
- email = "/53945695/agar_facebook/agar/300x250";
- } else {
- /** @type {string} */
- email = "/116850162/300x250_init";
- /** @type {string} */
- opts = "/116850162/728x90_init";
- /** @type {string} */
- attr = "/116850162/300x250_login";
- /** @type {string} */
- id = "/116850162/300x250_stats";
- /** @type {string} */
- template = "/116850162/728x90_login";
- }
- var player = global.googletag;
- player.cmd.push(function() {
- player.pubads().setTargeting("abtest", Sprite("ABGroupDFP") + "");
- data.ac.push(model.defineSlot(email, [300, 250], "g300x250"));
- if (length) {
- data.ac.push(model.defineSlot(opts, [728, 90], "g728x90"));
- }
- if (!k) {
- data.ab.push(model.defineSlot(id, [300, 250], "s300x250"));
- data.aa.push(model.defineSlot(attr, [300, 250], "a300x250"));
- if (length) {
- data.aa.push(model.defineSlot(template, [728, 90], "a728x90"));
- }
- }
- player.pubads().enableSingleRequest();
- player.pubads().disableInitialLoad();
- player.enableServices();
- /** @type {boolean} */
- reply = true;
- if (null != dir) {
- console.log("refreshing from queue");
- run(dir);
- }
- });
- })();
- (function() {
- if (_isFunction()) {
- var info = {
- acct : 13694,
- site : 73068,
- zone : 346604,
- size : 15
- };
- var layout = {
- acct : 13694,
- site : 73068,
- zone : 363786,
- size : 2
- };
- if (-1 == global.location.search.indexOf("fb")) {
- var length = props.a;
- data.ab.push(self.defineSlot(info, "300x250", "s300x250"));
- data.aa.push(self.defineSlot(info, "300x250", "a300x250"));
- if (length) {
- data.aa.push(self.defineSlot(layout, "728x90", "a728x90"));
- }
- }
- }
- })();
- if (debugads) {
- console.log("Ads initted");
- }
- if (debugads) {
- console.log("Your group: ", _isFunction() ? "rubicon" : "dfp");
- }
- (function() {
- /** @type {boolean} */
- var data = -1 != global.location.search.indexOf("fb");
- data = _isFunction() && !data;
- googletag.cmd.push(function() {
- googletag.display("g300x250");
- });
- if (!data) {
- googletag.cmd.push(function() {
- googletag.display("s300x250");
- });
- googletag.cmd.push(function() {
- googletag.display("a300x250");
- });
- }
- })();
- })(window, window.jQuery);
- (function(exports) {
- /**
- * @param {?} options
- * @return {undefined}
- */
- function TimeSeries(options) {
- this.options = Util.extend({}, TimeSeries.defaultOptions, options);
- this.clear();
- }
- /**
- * @param {?} options
- * @return {undefined}
- */
- function SmoothieChart(options) {
- this.options = Util.extend({}, SmoothieChart.defaultChartOptions, options);
- /** @type {Array} */
- this.seriesSet = [];
- /** @type {number} */
- this.currentValueRange = 1;
- /** @type {number} */
- this.currentVisMinValue = 0;
- /** @type {number} */
- this.lastRenderTimeMillis = 0;
- }
- var Util = {
- /**
- * @return {?}
- */
- extend : function() {
- arguments[0] = arguments[0] || {};
- /** @type {number} */
- var i = 1;
- for (;i < arguments.length;i++) {
- var key;
- for (key in arguments[i]) {
- if (arguments[i].hasOwnProperty(key)) {
- if (typeof arguments[i][key] === "object") {
- if (arguments[i][key] instanceof Array) {
- arguments[0][key] = arguments[i][key];
- } else {
- arguments[0][key] = Util.extend(arguments[0][key], arguments[i][key]);
- }
- } else {
- arguments[0][key] = arguments[i][key];
- }
- }
- }
- }
- return arguments[0];
- }
- };
- TimeSeries.defaultOptions = {
- resetBoundsInterval : 3E3,
- resetBounds : true
- };
- /**
- * @return {undefined}
- */
- TimeSeries.prototype.clear = function() {
- /** @type {Array} */
- this.data = [];
- /** @type {number} */
- this.maxValue = Number.NaN;
- /** @type {number} */
- this.minValue = Number.NaN;
- };
- /**
- * @return {undefined}
- */
- TimeSeries.prototype.resetBounds = function() {
- if (this.data.length) {
- this.maxValue = this.data[0][1];
- this.minValue = this.data[0][1];
- /** @type {number} */
- var dataIndex = 1;
- for (;dataIndex < this.data.length;dataIndex++) {
- var value = this.data[dataIndex][1];
- if (value > this.maxValue) {
- this.maxValue = value;
- }
- if (value < this.minValue) {
- this.minValue = value;
- }
- }
- } else {
- /** @type {number} */
- this.maxValue = Number.NaN;
- /** @type {number} */
- this.minValue = Number.NaN;
- }
- };
- /**
- * @param {?} key
- * @param {number} value
- * @param {?} opt_a2
- * @return {undefined}
- */
- TimeSeries.prototype.append = function(key, value, opt_a2) {
- /** @type {number} */
- var i = this.data.length - 1;
- for (;i >= 0 && this.data[i][0] > key;) {
- i--;
- }
- if (i === -1) {
- this.data.splice(0, 0, [key, value]);
- } else {
- if (this.data.length > 0 && this.data[i][0] === key) {
- if (opt_a2) {
- this.data[i][1] += value;
- value = this.data[i][1];
- } else {
- /** @type {number} */
- this.data[i][1] = value;
- }
- } else {
- if (i < this.data.length - 1) {
- this.data.splice(i + 1, 0, [key, value]);
- } else {
- this.data.push([key, value]);
- }
- }
- }
- this.maxValue = isNaN(this.maxValue) ? value : Math.max(this.maxValue, value);
- this.minValue = isNaN(this.minValue) ? value : Math.min(this.minValue, value);
- };
- /**
- * @param {number} oldestValidTime
- * @param {number} maxDataSetLength
- * @return {undefined}
- */
- TimeSeries.prototype.dropOldData = function(oldestValidTime, maxDataSetLength) {
- /** @type {number} */
- var removeCount = 0;
- for (;this.data.length - removeCount >= maxDataSetLength && this.data[removeCount + 1][0] < oldestValidTime;) {
- removeCount++;
- }
- if (removeCount !== 0) {
- this.data.splice(0, removeCount);
- }
- };
- SmoothieChart.defaultChartOptions = {
- name : "",
- millisPerPixel : 20,
- enableDpiScaling : true,
- /**
- * @param {?} str
- * @param {?} nDecimalDigits
- * @return {?}
- */
- yMinFormatter : function(str, nDecimalDigits) {
- return parseFloat(str).toFixed(nDecimalDigits);
- },
- /**
- * @param {?} str
- * @param {?} nDecimalDigits
- * @return {?}
- */
- yMaxFormatter : function(str, nDecimalDigits) {
- return parseFloat(str).toFixed(nDecimalDigits);
- },
- maxValueScale : 1,
- minValueScale : 1,
- interpolation : "bezier",
- scaleSmoothing : 0.125,
- maxDataSetLength : 2,
- scrollBackwards : false,
- grid : {
- fillStyle : "#000000",
- strokeStyle : "#777777",
- lineWidth : 1,
- sharpLines : false,
- millisPerLine : 1E3,
- verticalSections : 2,
- borderVisible : true
- },
- labels : {
- fillStyle : "#ffffff",
- disabled : false,
- fontSize : 10,
- fontFamily : "monospace",
- precision : 2
- },
- horizontalLines : []
- };
- SmoothieChart.AnimateCompatibility = function() {
- /**
- * @param {Function} callback
- * @param {?} element
- * @return {?}
- */
- var requestAnimationFrame = function(callback, element) {
- /** @type {function (this:Window, function (number): ?, (Element|null)=): number} */
- var requestAnimationFrame = window.requestAnimationFrame || (window.webkitRequestAnimationFrame || (window.mozRequestAnimationFrame || (window.oRequestAnimationFrame || (window.msRequestAnimationFrame || function($sanitize) {
- return window.setTimeout(function() {
- $sanitize((new Date).getTime());
- }, 16);
- }))));
- return requestAnimationFrame.call(window, callback, element);
- };
- /**
- * @param {?} id
- * @return {?}
- */
- var cancelAnimationFrame = function(id) {
- /** @type {function (this:Window, number): ?} */
- var cancel = window.cancelAnimationFrame || function(to) {
- clearTimeout(to);
- };
- return cancel.call(window, id);
- };
- return{
- /** @type {function (Function, ?): ?} */
- requestAnimationFrame : requestAnimationFrame,
- /** @type {function (?): ?} */
- cancelAnimationFrame : cancelAnimationFrame
- };
- }();
- SmoothieChart.defaultSeriesPresentationOptions = {
- lineWidth : 1,
- strokeStyle : "#ffffff"
- };
- /**
- * @param {Array} timeSeries
- * @param {?} options
- * @return {undefined}
- */
- SmoothieChart.prototype.addTimeSeries = function(timeSeries, options) {
- this.seriesSet.push({
- timeSeries : timeSeries,
- options : Util.extend({}, SmoothieChart.defaultSeriesPresentationOptions, options)
- });
- if (timeSeries.options.resetBounds && timeSeries.options.resetBoundsInterval > 0) {
- /** @type {number} */
- timeSeries.resetBoundsTimerId = setInterval(function() {
- timeSeries.resetBounds();
- }, timeSeries.options.resetBoundsInterval);
- }
- };
- /**
- * @param {?} timeSeries
- * @return {undefined}
- */
- SmoothieChart.prototype.removeTimeSeries = function(timeSeries) {
- var valuesLen = this.seriesSet.length;
- /** @type {number} */
- var i = 0;
- for (;i < valuesLen;i++) {
- if (this.seriesSet[i].timeSeries === timeSeries) {
- this.seriesSet.splice(i, 1);
- break;
- }
- }
- if (timeSeries.resetBoundsTimerId) {
- clearInterval(timeSeries.resetBoundsTimerId);
- }
- };
- /**
- * @param {?} timeSeries
- * @return {?}
- */
- SmoothieChart.prototype.getTimeSeriesOptions = function(timeSeries) {
- var valuesLen = this.seriesSet.length;
- /** @type {number} */
- var i = 0;
- for (;i < valuesLen;i++) {
- if (this.seriesSet[i].timeSeries === timeSeries) {
- return this.seriesSet[i].options;
- }
- }
- };
- /**
- * @param {?} timeSeries
- * @return {undefined}
- */
- SmoothieChart.prototype.bringToFront = function(timeSeries) {
- var valuesLen = this.seriesSet.length;
- /** @type {number} */
- var i = 0;
- for (;i < valuesLen;i++) {
- if (this.seriesSet[i].timeSeries === timeSeries) {
- var code = this.seriesSet.splice(i, 1);
- this.seriesSet.push(code[0]);
- break;
- }
- }
- };
- /**
- * @param {HTMLElement} canvas
- * @param {number} delayMillis
- * @return {undefined}
- */
- SmoothieChart.prototype.streamTo = function(canvas, delayMillis) {
- /** @type {HTMLElement} */
- this.canvas = canvas;
- /** @type {number} */
- this.delay = delayMillis;
- this.start();
- };
- /**
- * @return {undefined}
- */
- SmoothieChart.prototype.resize = function() {
- if (!this.options.enableDpiScaling || (!window || window.devicePixelRatio === 1)) {
- return;
- }
- /** @type {number} */
- var ratio = window.devicePixelRatio;
- /** @type {number} */
- var width = parseInt(this.canvas.getAttribute("width"));
- /** @type {number} */
- var height = parseInt(this.canvas.getAttribute("height"));
- if (!this.originalWidth || Math.floor(this.originalWidth * ratio) !== width) {
- /** @type {number} */
- this.originalWidth = width;
- this.canvas.setAttribute("width", Math.floor(width * ratio).toString());
- /** @type {string} */
- this.canvas.style.width = width + "px";
- this.canvas.getContext("2d").scale(ratio, ratio);
- }
- if (!this.originalHeight || Math.floor(this.originalHeight * ratio) !== height) {
- /** @type {number} */
- this.originalHeight = height;
- this.canvas.setAttribute("height", Math.floor(height * ratio).toString());
- /** @type {string} */
- this.canvas.style.height = height + "px";
- this.canvas.getContext("2d").scale(ratio, ratio);
- }
- };
- /**
- * @return {undefined}
- */
- SmoothieChart.prototype.start = function() {
- if (this.frame) {
- return;
- }
- var observableToAsync = function() {
- this.frame = SmoothieChart.AnimateCompatibility.requestAnimationFrame(function() {
- this.render();
- observableToAsync();
- }.bind(this));
- }.bind(this);
- observableToAsync();
- };
- /**
- * @return {undefined}
- */
- SmoothieChart.prototype.stop = function() {
- if (this.frame) {
- SmoothieChart.AnimateCompatibility.cancelAnimationFrame(this.frame);
- delete this.frame;
- }
- };
- /**
- * @return {undefined}
- */
- SmoothieChart.prototype.updateValueRange = function() {
- var chartOptions = this.options;
- /** @type {number} */
- var chartMaxValue = Number.NaN;
- /** @type {number} */
- var chartMinValue = Number.NaN;
- /** @type {number} */
- var d = 0;
- for (;d < this.seriesSet.length;d++) {
- var timeSeries = this.seriesSet[d].timeSeries;
- if (!isNaN(timeSeries.maxValue)) {
- chartMaxValue = !isNaN(chartMaxValue) ? Math.max(chartMaxValue, timeSeries.maxValue) : timeSeries.maxValue;
- }
- if (!isNaN(timeSeries.minValue)) {
- chartMinValue = !isNaN(chartMinValue) ? Math.min(chartMinValue, timeSeries.minValue) : timeSeries.minValue;
- }
- }
- if (chartOptions.maxValue != null) {
- chartMaxValue = chartOptions.maxValue;
- } else {
- chartMaxValue *= chartOptions.maxValueScale;
- }
- if (chartOptions.minValue != null) {
- chartMinValue = chartOptions.minValue;
- } else {
- chartMinValue -= Math.abs(chartMinValue * chartOptions.minValueScale - chartMinValue);
- }
- if (this.options.yRangeFunction) {
- var range = this.options.yRangeFunction({
- min : chartMinValue,
- max : chartMaxValue
- });
- chartMinValue = range.min;
- chartMaxValue = range.max;
- }
- if (!isNaN(chartMaxValue) && !isNaN(chartMinValue)) {
- /** @type {number} */
- var targetValueRange = chartMaxValue - chartMinValue;
- /** @type {number} */
- var valueRangeDiff = targetValueRange - this.currentValueRange;
- /** @type {number} */
- var minValueDiff = chartMinValue - this.currentVisMinValue;
- /** @type {boolean} */
- this.isAnimatingScale = Math.abs(valueRangeDiff) > 0.1 || Math.abs(minValueDiff) > 0.1;
- this.currentValueRange += chartOptions.scaleSmoothing * valueRangeDiff;
- this.currentVisMinValue += chartOptions.scaleSmoothing * minValueDiff;
- }
- this.valueRange = {
- min : chartMinValue,
- max : chartMaxValue
- };
- };
- /**
- * @param {HTMLElement} canvas
- * @param {number} time
- * @return {undefined}
- */
- SmoothieChart.prototype.render = function(canvas, time) {
- /** @type {number} */
- var nowMillis = (new Date).getTime();
- if (!this.isAnimatingScale) {
- /** @type {number} */
- var maxIdleMillis = Math.min(1E3 / 6, this.options.millisPerPixel);
- if (nowMillis - this.lastRenderTimeMillis < maxIdleMillis) {
- return;
- }
- }
- this.resize();
- /** @type {number} */
- this.lastRenderTimeMillis = nowMillis;
- canvas = canvas || this.canvas;
- time = time || nowMillis - (this.delay || 0);
- time -= time % this.options.millisPerPixel;
- var context = canvas.getContext("2d");
- var chartOptions = this.options;
- var dimensions = {
- top : 0,
- left : 0,
- width : canvas.clientWidth,
- height : canvas.clientHeight
- };
- /** @type {number} */
- var oldestValidTime = time - dimensions.width * chartOptions.millisPerPixel;
- var valueToYPixel = function(value) {
- /** @type {number} */
- var offset = value - this.currentVisMinValue;
- return this.currentValueRange === 0 ? dimensions.height : dimensions.height - Math.round(offset / this.currentValueRange * dimensions.height);
- }.bind(this);
- /**
- * @param {number} t
- * @return {?}
- */
- var timeToXPixel = function(t) {
- if (chartOptions.scrollBackwards) {
- return Math.round((time - t) / chartOptions.millisPerPixel);
- }
- return Math.round(dimensions.width - (time - t) / chartOptions.millisPerPixel);
- };
- this.updateValueRange();
- /** @type {string} */
- context.font = chartOptions.labels.fontSize + "px " + chartOptions.labels.fontFamily;
- context.save();
- context.translate(dimensions.left, dimensions.top);
- context.beginPath();
- context.rect(0, 0, dimensions.width, dimensions.height);
- context.clip();
- context.save();
- context.fillStyle = chartOptions.grid.fillStyle;
- context.clearRect(0, 0, dimensions.width, dimensions.height);
- context.fillRect(0, 0, dimensions.width, dimensions.height);
- context.restore();
- context.save();
- context.lineWidth = chartOptions.grid.lineWidth;
- context.strokeStyle = chartOptions.grid.strokeStyle;
- if (chartOptions.grid.millisPerLine > 0) {
- context.beginPath();
- /** @type {number} */
- var t = time - time % chartOptions.grid.millisPerLine;
- for (;t >= oldestValidTime;t -= chartOptions.grid.millisPerLine) {
- var gx = timeToXPixel(t);
- if (chartOptions.grid.sharpLines) {
- gx -= 0.5;
- }
- context.moveTo(gx, 0);
- context.lineTo(gx, dimensions.height);
- }
- context.stroke();
- context.closePath();
- }
- /** @type {number} */
- var v = 1;
- for (;v < chartOptions.grid.verticalSections;v++) {
- /** @type {number} */
- var gy = Math.round(v * dimensions.height / chartOptions.grid.verticalSections);
- if (chartOptions.grid.sharpLines) {
- gy -= 0.5;
- }
- context.beginPath();
- context.moveTo(0, gy);
- context.lineTo(dimensions.width, gy);
- context.stroke();
- context.closePath();
- }
- if (chartOptions.grid.borderVisible) {
- context.beginPath();
- context.strokeRect(0, 0, dimensions.width, dimensions.height);
- context.closePath();
- }
- context.restore();
- if (chartOptions.horizontalLines && chartOptions.horizontalLines.length) {
- /** @type {number} */
- var hl = 0;
- for (;hl < chartOptions.horizontalLines.length;hl++) {
- var line = chartOptions.horizontalLines[hl];
- /** @type {number} */
- var hly = Math.round(valueToYPixel(line.value)) - 0.5;
- context.strokeStyle = line.color || "#ffffff";
- context.lineWidth = line.lineWidth || 1;
- context.beginPath();
- context.moveTo(0, hly);
- context.lineTo(dimensions.width, hly);
- context.stroke();
- context.closePath();
- }
- }
- /** @type {number} */
- var d = 0;
- for (;d < this.seriesSet.length;d++) {
- context.save();
- var timeSeries = this.seriesSet[d].timeSeries;
- var codeSegments = timeSeries.data;
- var seriesOptions = this.seriesSet[d].options;
- timeSeries.dropOldData(oldestValidTime, chartOptions.maxDataSetLength);
- context.lineWidth = seriesOptions.lineWidth;
- context.strokeStyle = seriesOptions.strokeStyle;
- context.beginPath();
- /** @type {number} */
- var firstX = 0;
- /** @type {number} */
- var lastX = 0;
- /** @type {number} */
- var lastY = 0;
- /** @type {number} */
- var i = 0;
- for (;i < codeSegments.length && codeSegments.length !== 1;i++) {
- var x = timeToXPixel(codeSegments[i][0]);
- var y = valueToYPixel(codeSegments[i][1]);
- if (i === 0) {
- firstX = x;
- context.moveTo(x, y);
- } else {
- switch(chartOptions.interpolation) {
- case "linear":
- ;
- case "line":
- context.lineTo(x, y);
- break;
- case "bezier":
- ;
- default:
- context.bezierCurveTo(Math.round((lastX + x) / 2), lastY, Math.round(lastX + x) / 2, y, x, y);
- break;
- case "step":
- context.lineTo(x, lastY);
- context.lineTo(x, y);
- break;
- }
- }
- lastX = x;
- lastY = y;
- }
- if (codeSegments.length > 1) {
- if (seriesOptions.fillStyle) {
- context.lineTo(dimensions.width + seriesOptions.lineWidth + 1, lastY);
- context.lineTo(dimensions.width + seriesOptions.lineWidth + 1, dimensions.height + seriesOptions.lineWidth + 1);
- context.lineTo(firstX, dimensions.height + seriesOptions.lineWidth);
- context.fillStyle = seriesOptions.fillStyle;
- context.fill();
- }
- if (seriesOptions.strokeStyle && seriesOptions.strokeStyle !== "none") {
- context.stroke();
- }
- context.closePath();
- }
- context.restore();
- }
- if (!chartOptions.labels.disabled && (!isNaN(this.valueRange.min) && !isNaN(this.valueRange.max))) {
- var maxValueString = chartOptions.yMaxFormatter(this.valueRange.max, chartOptions.labels.precision);
- var minValueString = chartOptions.yMinFormatter(this.valueRange.min, chartOptions.labels.precision);
- /** @type {number} */
- var offsetX = chartOptions.scrollBackwards ? 0 : dimensions.width - context.measureText(maxValueString).width - 2;
- context.fillStyle = chartOptions.labels.fillStyle;
- context.fillText(maxValueString, offsetX, chartOptions.labels.fontSize);
- context.fillText(minValueString, offsetX, dimensions.height - 2);
- if (chartOptions.name != "") {
- context.fillText(chartOptions.name, 2, chartOptions.labels.fontSize);
- }
- }
- if (chartOptions.timestampFormatter && chartOptions.grid.millisPerLine > 0) {
- var textUntilX = chartOptions.scrollBackwards ? context.measureText(minValueString).width : dimensions.width - context.measureText(minValueString).width + 4;
- /** @type {number} */
- t = time - time % chartOptions.grid.millisPerLine;
- for (;t >= oldestValidTime;t -= chartOptions.grid.millisPerLine) {
- gx = timeToXPixel(t);
- if (!chartOptions.scrollBackwards && gx < textUntilX || chartOptions.scrollBackwards && gx > textUntilX) {
- /** @type {Date} */
- var tx = new Date(t);
- var ts = chartOptions.timestampFormatter(tx);
- var tsWidth = context.measureText(ts).width;
- textUntilX = chartOptions.scrollBackwards ? gx + tsWidth + 2 : gx - tsWidth - 2;
- context.fillStyle = chartOptions.labels.fillStyle;
- if (chartOptions.scrollBackwards) {
- context.fillText(ts, gx, dimensions.height - 2);
- } else {
- context.fillText(ts, gx - tsWidth, dimensions.height - 2);
- }
- }
- }
- }
- context.restore();
- };
- /**
- * @param {Date} date
- * @return {?}
- */
- SmoothieChart.timeFormatter = function(date) {
- /**
- * @param {number} number
- * @return {?}
- */
- function pad2(number) {
- return(number < 10 ? "0" : "") + number;
- }
- return pad2(date.getHours()) + ":" + pad2(date.getMinutes()) + ":" + pad2(date.getSeconds());
- };
- /** @type {function (?): undefined} */
- exports.TimeSeries = TimeSeries;
- /** @type {function (?): undefined} */
- exports.SmoothieChart = SmoothieChart;
- })(typeof exports === "undefined" ? this : exports);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement