diff --git a/.gitignore b/.gitignore index c2487ca8f..5bae0e95c 100644 --- a/.gitignore +++ b/.gitignore @@ -40,7 +40,6 @@ coverage.html *.bk apidocs /docs/*.html -/public/js/ app.css.map *.diff private/ diff --git a/package.json b/package.json index 494e3c446..4d64d8cf6 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "codacy": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --recursive -R spec && cat ./coverage/lcov.info | cross-env CODACY_PROJECT_TOKEN=65070aca43cc4fba96eaabd4033c9528 codacy-coverage && rm -rf ./coverage", "webpackwatch": "webpack --config webpack.config.js --watch", "webpackdev": "webpack --config webpack.config.js", - "webpackdist": "webpack --env.production -p --config webpack.config.js", + "webpackdist": "rimraf public/js/* && webpack --env.production -p --config webpack.config.js", "snyk-protect": "snyk protect" }, "dependencies": { diff --git a/public/js/0.js b/public/js/0.js new file mode 100644 index 000000000..720c7be97 --- /dev/null +++ b/public/js/0.js @@ -0,0 +1,153 @@ +;(window.webpackJsonp = window.webpackJsonp || []).push([ + [0], + { + 50: function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__ + ;(__WEBPACK_AMD_DEFINE_ARRAY__ = [ + __webpack_require__(0), + __webpack_require__(1), + __webpack_require__(37), + __webpack_require__(52), + __webpack_require__(8), + __webpack_require__(22) + ]), + void 0 === + (__WEBPACK_AMD_DEFINE_RESULT__ = function ($, _, socketClient, md, helpers) { + var st = {} + function onRemoveAttachmentClick (e) { + var self = $(e.currentTarget) + if (_.isUndefined(self)) return !0 + var ticketId = $('#__ticketId').html(), + attachmentId = self.attr('data-attachmentId') + attachmentId.length > 0 && + ticketId.length > 0 && + $.ajax({ + url: '/api/v1/tickets/' + ticketId + '/attachments/remove/' + attachmentId, + type: 'DELETE', + success: function () { + socketClient.ui.refreshTicketAttachments(ticketId) + }, + error: function (err) { + var res = err.responseJSON + console.log('[trudesk:singleTicket:onRemoveAttachmentClick] - ' + res.error), + helpers.UI.showSnackbar(res.err, !0) + } + }) + } + function onRemoveCommentClick (e) { + var self = $(e.currentTarget) + if (_.isUndefined(self)) return !0 + var ticketId = $('#__ticketId').html(), + commentId = self.attr('data-commentId') + commentId.length > 0 && ticketId.length > 0 && socketClient.ui.removeComment(ticketId, commentId) + } + function onRemoveNoteClick (e) { + var self = $(e.currentTarget) + if (_.isUndefined(self)) return !0 + var ticketId = $('#__ticketId').html(), + noteId = self.attr('data-noteid') + noteId.length > 0 && ticketId.length > 0 && socketClient.ui.removeNote(ticketId, noteId) + } + return ( + (st.init = function (callback) { + $(document).ready(function () { + function setupImageLink (el) { + var $this = $(el), + src = $this.attr('src') + $this.addClass('hasLinked') + var a = $('') + .addClass('no-ajaxy') + .attr('href', src) + .attr('target', '_blank') + $this.wrap(a) + } + socketClient.chat.updateOnlineBubbles(), + helpers.setupTruTabs($('.tru-tab-selectors').find('.tru-tab-selector')), + $('.off-canvas-bottom').DivResizer({}), + $('.issue-body img:not(.hasLinked)').each(function () { + setupImageLink(this) + }), + $('.comment-body img:not(.hasLinked)').each(function () { + setupImageLink(this) + }), + $('.remove-attachment').each(function () { + var self = $(this) + self.off('click', onRemoveAttachmentClick), self.on('click', onRemoveAttachmentClick) + }), + $('.remove-comment').each(function () { + var self = $(this) + self.off('click', onRemoveCommentClick), self.on('click', onRemoveCommentClick) + }), + $('.remove-note').each(function () { + var self = $(this) + self.off('click', onRemoveNoteClick), self.on('click', onRemoveNoteClick) + }) + var issueText = $('.issue-text') + .find('div.issue-body') + .html() + _.isUndefined(issueText) || + ((issueText = (issueText = md(issueText)).trim()), $('#issueText').val(issueText)) + var editCommentForm = $('div.edit-comment-form') + editCommentForm.find('form').each(function (idx, f) { + var form = $(f) + form.unbind('submit'), + form.submit(function ($event) { + if (($event.preventDefault(), !form.isValid(null, null, !1))) return !0 + var id = $('#__ticketId').html() + if (id.length > 0) { + var comment = $($event.currentTarget) + .find('textarea#commentText') + .val(), + commentId = $($event.currentTarget).attr('data-commentId') + socketClient.ui.setCommentText(id, commentId, comment) + } + }) + }), + editCommentForm.find('.resetForm').each(function (idx, item) { + var button = $(item) + button.off('click'), + button.on('click', function ($event) { + $event.preventDefault() + var grandParent = button.parents('div.edit-comment-form'), + comment = button.parents('div.ticket-comment').find('.comment-body') + grandParent.length > 0 && (grandParent.addClass('hide'), comment.removeClass('hide')) + }) + }) + var editNoteForm = $('div.edit-note-form') + if ( + (editNoteForm.find('form').each(function (idx, f) { + var form = $(f) + form.off('submit'), + form.on('submit', function ($event) { + if (($event.preventDefault(), !form.isValid(null, null, !1))) return !0 + var id = $('#__ticketId').text() + if (id.length > 0) { + var note = $($event.currentTarget) + .find('textarea#noteText') + .val(), + noteId = $($event.currentTarget).attr('data-noteId') + socketClient.ui.setNoteText(id, noteId, note) + } + }) + }), + editNoteForm.find('.resetForm').each(function (idx, item) { + var button = $(item) + button.off('click'), + button.on('click', function ($event) { + $event.preventDefault() + var grandParent = button.parents('div.edit-note-form'), + note = button.parents('div.ticket-note').find('.comment-body') + grandParent.length > 0 && (grandParent.addClass('hide'), note.removeClass('hide')) + }) + }), + 'function' == typeof callback) + ) + return callback() + }) + }), + st + ) + }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) || (module.exports = __WEBPACK_AMD_DEFINE_RESULT__) + } + } +]) diff --git a/public/js/1.js b/public/js/1.js new file mode 100644 index 000000000..0ee2e26fc --- /dev/null +++ b/public/js/1.js @@ -0,0 +1,39073 @@ +;(window.webpackJsonp = window.webpackJsonp || []).push([ + [1], + [ + function (module, exports, __webpack_require__) { + var __WEBPACK_AMD_DEFINE_RESULT__, global, factory + /*! + * jQuery JavaScript Library v2.2.4 + * http://jquery.com/ + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-05-20T17:23Z + */ + /*! + * jQuery JavaScript Library v2.2.4 + * http://jquery.com/ + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-05-20T17:23Z + */ + ;(global = 'undefined' != typeof window ? window : this), + (factory = function (window, noGlobal) { + var arr = [], + document = window.document, + slice = arr.slice, + concat = arr.concat, + push = arr.push, + indexOf = arr.indexOf, + class2type = {}, + toString = class2type.toString, + hasOwn = class2type.hasOwnProperty, + support = {}, + jQuery = function (selector, context) { + return new jQuery.fn.init(selector, context) + }, + rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, + rmsPrefix = /^-ms-/, + rdashAlpha = /-([\da-z])/gi, + fcamelCase = function (all, letter) { + return letter.toUpperCase() + } + function isArrayLike (obj) { + var length = !!obj && 'length' in obj && obj.length, + type = jQuery.type(obj) + return ( + 'function' !== type && + !jQuery.isWindow(obj) && + ('array' === type || 0 === length || ('number' == typeof length && length > 0 && length - 1 in obj)) + ) + } + ;(jQuery.fn = jQuery.prototype = { + jquery: '2.2.4', + constructor: jQuery, + selector: '', + length: 0, + toArray: function () { + return slice.call(this) + }, + get: function (num) { + return null != num ? (num < 0 ? this[num + this.length] : this[num]) : slice.call(this) + }, + pushStack: function (elems) { + var ret = jQuery.merge(this.constructor(), elems) + return (ret.prevObject = this), (ret.context = this.context), ret + }, + each: function (callback) { + return jQuery.each(this, callback) + }, + map: function (callback) { + return this.pushStack( + jQuery.map(this, function (elem, i) { + return callback.call(elem, i, elem) + }) + ) + }, + slice: function () { + return this.pushStack(slice.apply(this, arguments)) + }, + first: function () { + return this.eq(0) + }, + last: function () { + return this.eq(-1) + }, + eq: function (i) { + var len = this.length, + j = +i + (i < 0 ? len : 0) + return this.pushStack(j >= 0 && j < len ? [this[j]] : []) + }, + end: function () { + return this.prevObject || this.constructor() + }, + push, + sort: arr.sort, + splice: arr.splice + }), + (jQuery.extend = jQuery.fn.extend = function () { + var options, + name, + src, + copy, + copyIsArray, + clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = !1 + for ( + 'boolean' == typeof target && ((deep = target), (target = arguments[i] || {}), i++), + 'object' == typeof target || jQuery.isFunction(target) || (target = {}), + i === length && ((target = this), i--); + i < length; + i++ + ) + if (null != (options = arguments[i])) + for (name in options) + (src = target[name]), + target !== (copy = options[name]) && + (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy))) + ? (copyIsArray + ? ((copyIsArray = !1), (clone = src && jQuery.isArray(src) ? src : [])) + : (clone = src && jQuery.isPlainObject(src) ? src : {}), + (target[name] = jQuery.extend(deep, clone, copy))) + : void 0 !== copy && (target[name] = copy)) + return target + }), + jQuery.extend({ + expando: 'jQuery' + ('2.2.4' + Math.random()).replace(/\D/g, ''), + isReady: !0, + error: function (msg) { + throw new Error(msg) + }, + noop: function () {}, + isFunction: function (obj) { + return 'function' === jQuery.type(obj) + }, + isArray: Array.isArray, + isWindow: function (obj) { + return null != obj && obj === obj.window + }, + isNumeric: function (obj) { + var realStringObj = obj && obj.toString() + return !jQuery.isArray(obj) && realStringObj - parseFloat(realStringObj) + 1 >= 0 + }, + isPlainObject: function (obj) { + var key + if ('object' !== jQuery.type(obj) || obj.nodeType || jQuery.isWindow(obj)) return !1 + if ( + obj.constructor && + !hasOwn.call(obj, 'constructor') && + !hasOwn.call(obj.constructor.prototype || {}, 'isPrototypeOf') + ) + return !1 + for (key in obj); + return void 0 === key || hasOwn.call(obj, key) + }, + isEmptyObject: function (obj) { + var name + for (name in obj) return !1 + return !0 + }, + type: function (obj) { + return null == obj + ? obj + '' + : 'object' == typeof obj || 'function' == typeof obj + ? class2type[toString.call(obj)] || 'object' + : typeof obj + }, + globalEval: function (code) { + var script, + indirect = eval + ;(code = jQuery.trim(code)) && + (1 === code.indexOf('use strict') + ? (((script = document.createElement('script')).text = code), + document.head.appendChild(script).parentNode.removeChild(script)) + : indirect(code)) + }, + camelCase: function (string) { + return string.replace(rmsPrefix, 'ms-').replace(rdashAlpha, fcamelCase) + }, + nodeName: function (elem, name) { + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase() + }, + each: function (obj, callback) { + var length, + i = 0 + if (isArrayLike(obj)) + for (length = obj.length; i < length && !1 !== callback.call(obj[i], i, obj[i]); i++); + else for (i in obj) if (!1 === callback.call(obj[i], i, obj[i])) break + return obj + }, + trim: function (text) { + return null == text ? '' : (text + '').replace(rtrim, '') + }, + makeArray: function (arr, results) { + var ret = results || [] + return ( + null != arr && + (isArrayLike(Object(arr)) + ? jQuery.merge(ret, 'string' == typeof arr ? [arr] : arr) + : push.call(ret, arr)), + ret + ) + }, + inArray: function (elem, arr, i) { + return null == arr ? -1 : indexOf.call(arr, elem, i) + }, + merge: function (first, second) { + for (var len = +second.length, j = 0, i = first.length; j < len; j++) first[i++] = second[j] + return (first.length = i), first + }, + grep: function (elems, callback, invert) { + for (var matches = [], i = 0, length = elems.length, callbackExpect = !invert; i < length; i++) + !callback(elems[i], i) !== callbackExpect && matches.push(elems[i]) + return matches + }, + map: function (elems, callback, arg) { + var length, + value, + i = 0, + ret = [] + if (isArrayLike(elems)) + for (length = elems.length; i < length; i++) + null != (value = callback(elems[i], i, arg)) && ret.push(value) + else for (i in elems) null != (value = callback(elems[i], i, arg)) && ret.push(value) + return concat.apply([], ret) + }, + guid: 1, + proxy: function (fn, context) { + var tmp, args, proxy + if ( + ('string' == typeof context && ((tmp = fn[context]), (context = fn), (fn = tmp)), + jQuery.isFunction(fn)) + ) + return ( + (args = slice.call(arguments, 2)), + ((proxy = function () { + return fn.apply(context || this, args.concat(slice.call(arguments))) + }).guid = fn.guid = fn.guid || jQuery.guid++), + proxy + ) + }, + now: Date.now, + support + }), + 'function' == typeof Symbol && (jQuery.fn[Symbol.iterator] = arr[Symbol.iterator]), + jQuery.each('Boolean Number String Function Array Date RegExp Object Error Symbol'.split(' '), function ( + i, + name + ) { + class2type['[object ' + name + ']'] = name.toLowerCase() + }) + var Sizzle = + /*! + * Sizzle CSS Selector Engine v2.2.1 + * http://sizzlejs.com/ + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2015-10-17 + */ + (function (window) { + var i, + support, + Expr, + getText, + isXML, + tokenize, + compile, + select, + outermostContext, + sortInput, + hasDuplicate, + setDocument, + document, + docElem, + documentIsHTML, + rbuggyQSA, + rbuggyMatches, + matches, + contains, + expando = 'sizzle' + 1 * new Date(), + preferredDoc = window.document, + dirruns = 0, + done = 0, + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + sortOrder = function (a, b) { + return a === b && (hasDuplicate = !0), 0 + }, + MAX_NEGATIVE = 1 << 31, + hasOwn = {}.hasOwnProperty, + arr = [], + pop = arr.pop, + push_native = arr.push, + push = arr.push, + slice = arr.slice, + indexOf = function (list, elem) { + for (var i = 0, len = list.length; i < len; i++) if (list[i] === elem) return i + return -1 + }, + booleans = + 'checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped', + whitespace = '[\\x20\\t\\r\\n\\f]', + identifier = '(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+', + attributes = + '\\[' + + whitespace + + '*(' + + identifier + + ')(?:' + + whitespace + + '*([*^$|!~]?=)' + + whitespace + + '*(?:\'((?:\\\\.|[^\\\\\'])*)\'|"((?:\\\\.|[^\\\\"])*)"|(' + + identifier + + '))|)' + + whitespace + + '*\\]', + pseudos = + ':(' + + identifier + + ')(?:\\(((\'((?:\\\\.|[^\\\\\'])*)\'|"((?:\\\\.|[^\\\\"])*)")|((?:\\\\.|[^\\\\()[\\]]|' + + attributes + + ')*)|.*)\\)|)', + rwhitespace = new RegExp(whitespace + '+', 'g'), + rtrim = new RegExp('^' + whitespace + '+|((?:^|[^\\\\])(?:\\\\.)*)' + whitespace + '+$', 'g'), + rcomma = new RegExp('^' + whitespace + '*,' + whitespace + '*'), + rcombinators = new RegExp('^' + whitespace + '*([>+~]|' + whitespace + ')' + whitespace + '*'), + rattributeQuotes = new RegExp('=' + whitespace + '*([^\\]\'"]*?)' + whitespace + '*\\]', 'g'), + rpseudo = new RegExp(pseudos), + ridentifier = new RegExp('^' + identifier + '$'), + matchExpr = { + ID: new RegExp('^#(' + identifier + ')'), + CLASS: new RegExp('^\\.(' + identifier + ')'), + TAG: new RegExp('^(' + identifier + '|[*])'), + 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' + ) + }, + rinputs = /^(?:input|select|textarea|button)$/i, + rheader = /^h\d$/i, + rnative = /^[^{]+\{\s*\[native \w/, + rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, + rsibling = /[+~]/, + rescape = /'|\\/g, + runescape = new RegExp('\\\\([\\da-f]{1,6}' + whitespace + '?|(' + whitespace + ')|.)', 'ig'), + funescape = function (_, escaped, escapedWhitespace) { + var high = '0x' + escaped - 65536 + return high != high || escapedWhitespace + ? escaped + : high < 0 + ? String.fromCharCode(high + 65536) + : String.fromCharCode((high >> 10) | 55296, (1023 & high) | 56320) + }, + unloadHandler = function () { + setDocument() + } + try { + push.apply((arr = slice.call(preferredDoc.childNodes)), preferredDoc.childNodes), + arr[preferredDoc.childNodes.length].nodeType + } catch (e) { + push = { + apply: arr.length + ? function (target, els) { + push_native.apply(target, slice.call(els)) + } + : function (target, els) { + for (var j = target.length, i = 0; (target[j++] = els[i++]); ); + target.length = j - 1 + } + } + } + function Sizzle (selector, context, results, seed) { + var m, + i, + elem, + nid, + nidselect, + match, + groups, + newSelector, + newContext = context && context.ownerDocument, + nodeType = context ? context.nodeType : 9 + if ( + ((results = results || []), + 'string' != typeof selector || !selector || (1 !== nodeType && 9 !== nodeType && 11 !== nodeType)) + ) + return results + if ( + !seed && + ((context ? context.ownerDocument || context : preferredDoc) !== document && setDocument(context), + (context = context || document), + documentIsHTML) + ) { + if (11 !== nodeType && (match = rquickExpr.exec(selector))) + if ((m = match[1])) { + if (9 === nodeType) { + if (!(elem = context.getElementById(m))) return results + if (elem.id === m) return results.push(elem), results + } else if ( + newContext && + (elem = newContext.getElementById(m)) && + contains(context, elem) && + elem.id === m + ) + return results.push(elem), results + } else { + if (match[2]) return push.apply(results, context.getElementsByTagName(selector)), results + if ((m = match[3]) && support.getElementsByClassName && context.getElementsByClassName) + return push.apply(results, context.getElementsByClassName(m)), results + } + if (support.qsa && !compilerCache[selector + ' '] && (!rbuggyQSA || !rbuggyQSA.test(selector))) { + if (1 !== nodeType) (newContext = context), (newSelector = selector) + else if ('object' !== context.nodeName.toLowerCase()) { + for ( + (nid = context.getAttribute('id')) + ? (nid = nid.replace(rescape, '\\$&')) + : context.setAttribute('id', (nid = expando)), + i = (groups = tokenize(selector)).length, + nidselect = ridentifier.test(nid) ? '#' + nid : "[id='" + nid + "']"; + i--; + + ) + groups[i] = nidselect + ' ' + toSelector(groups[i]) + ;(newSelector = groups.join(',')), + (newContext = (rsibling.test(selector) && testContext(context.parentNode)) || context) + } + if (newSelector) + try { + return push.apply(results, newContext.querySelectorAll(newSelector)), results + } catch (qsaError) { + } finally { + nid === expando && context.removeAttribute('id') + } + } + } + return select(selector.replace(rtrim, '$1'), context, results, seed) + } + function createCache () { + var keys = [] + return function cache (key, value) { + return ( + keys.push(key + ' ') > Expr.cacheLength && delete cache[keys.shift()], (cache[key + ' '] = value) + ) + } + } + function markFunction (fn) { + return (fn[expando] = !0), fn + } + function assert (fn) { + var div = document.createElement('div') + try { + return !!fn(div) + } catch (e) { + return !1 + } finally { + div.parentNode && div.parentNode.removeChild(div), (div = null) + } + } + function addHandle (attrs, handler) { + for (var arr = attrs.split('|'), i = arr.length; i--; ) Expr.attrHandle[arr[i]] = handler + } + function siblingCheck (a, b) { + var cur = b && a, + 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 + } + function createInputPseudo (type) { + return function (elem) { + return 'input' === elem.nodeName.toLowerCase() && elem.type === type + } + } + function createButtonPseudo (type) { + return function (elem) { + var name = elem.nodeName.toLowerCase() + return ('input' === name || 'button' === name) && elem.type === type + } + } + function createPositionalPseudo (fn) { + return markFunction(function (argument) { + return ( + (argument = +argument), + markFunction(function (seed, matches) { + for (var j, matchIndexes = fn([], seed.length, argument), i = matchIndexes.length; i--; ) + seed[(j = matchIndexes[i])] && (seed[j] = !(matches[j] = seed[j])) + }) + ) + }) + } + function testContext (context) { + return context && void 0 !== context.getElementsByTagName && context + } + for (i in ((support = Sizzle.support = {}), + (isXML = Sizzle.isXML = function (elem) { + var documentElement = elem && (elem.ownerDocument || elem).documentElement + return !!documentElement && 'HTML' !== documentElement.nodeName + }), + (setDocument = Sizzle.setDocument = function (node) { + var hasCompare, + parent, + doc = node ? node.ownerDocument || node : preferredDoc + return doc !== document && 9 === doc.nodeType && doc.documentElement + ? ((docElem = (document = doc).documentElement), + (documentIsHTML = !isXML(document)), + (parent = document.defaultView) && + parent.top !== parent && + (parent.addEventListener + ? parent.addEventListener('unload', unloadHandler, !1) + : parent.attachEvent && parent.attachEvent('onunload', unloadHandler)), + (support.attributes = assert(function (div) { + return (div.className = 'i'), !div.getAttribute('className') + })), + (support.getElementsByTagName = assert(function (div) { + return div.appendChild(document.createComment('')), !div.getElementsByTagName('*').length + })), + (support.getElementsByClassName = rnative.test(document.getElementsByClassName)), + (support.getById = assert(function (div) { + return ( + (docElem.appendChild(div).id = expando), + !document.getElementsByName || !document.getElementsByName(expando).length + ) + })), + support.getById + ? ((Expr.find.ID = function (id, context) { + if (void 0 !== context.getElementById && documentIsHTML) { + var m = context.getElementById(id) + return m ? [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 = void 0 !== elem.getAttributeNode && elem.getAttributeNode('id') + return node && node.value === attrId + } + })), + (Expr.find.TAG = support.getElementsByTagName + ? function (tag, context) { + return void 0 !== context.getElementsByTagName + ? context.getElementsByTagName(tag) + : support.qsa + ? context.querySelectorAll(tag) + : void 0 + } + : function (tag, context) { + var elem, + tmp = [], + i = 0, + results = context.getElementsByTagName(tag) + if ('*' === tag) { + for (; (elem = results[i++]); ) 1 === elem.nodeType && tmp.push(elem) + return tmp + } + return results + }), + (Expr.find.CLASS = + support.getElementsByClassName && + function (className, context) { + if (void 0 !== context.getElementsByClassName && documentIsHTML) + return context.getElementsByClassName(className) + }), + (rbuggyMatches = []), + (rbuggyQSA = []), + (support.qsa = rnative.test(document.querySelectorAll)) && + (assert(function (div) { + ;(docElem.appendChild(div).innerHTML = + ""), + div.querySelectorAll("[msallowcapture^='']").length && + rbuggyQSA.push('[*^$]=' + whitespace + '*(?:\'\'|"")'), + div.querySelectorAll('[selected]').length || + rbuggyQSA.push('\\[' + whitespace + '*(?:value|' + booleans + ')'), + div.querySelectorAll('[id~=' + expando + '-]').length || rbuggyQSA.push('~='), + div.querySelectorAll(':checked').length || rbuggyQSA.push(':checked'), + div.querySelectorAll('a#' + expando + '+*').length || rbuggyQSA.push('.#.+[+~]') + }), + assert(function (div) { + var input = document.createElement('input') + input.setAttribute('type', 'hidden'), + div.appendChild(input).setAttribute('name', 'D'), + div.querySelectorAll('[name=d]').length && + rbuggyQSA.push('name' + whitespace + '*[*^$|!~]?='), + 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, + 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 !0 + return !1 + }), + (sortOrder = hasCompare + ? function (a, b) { + if (a === b) return (hasDuplicate = !0), 0 + var compare = !a.compareDocumentPosition - !b.compareDocumentPosition + return ( + compare || + (1 & + (compare = + (a.ownerDocument || a) === (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1) || + (!support.sortDetached && b.compareDocumentPosition(a) === compare) + ? a === document || (a.ownerDocument === preferredDoc && contains(preferredDoc, a)) + ? -1 + : b === document || (b.ownerDocument === preferredDoc && contains(preferredDoc, b)) + ? 1 + : sortInput + ? indexOf(sortInput, a) - indexOf(sortInput, b) + : 0 + : 4 & compare + ? -1 + : 1) + ) + } + : function (a, b) { + if (a === b) return (hasDuplicate = !0), 0 + var cur, + i = 0, + aup = a.parentNode, + bup = b.parentNode, + ap = [a], + bp = [b] + if (!aup || !bup) + return a === document + ? -1 + : b === document + ? 1 + : aup + ? -1 + : bup + ? 1 + : sortInput + ? indexOf(sortInput, a) - indexOf(sortInput, b) + : 0 + if (aup === bup) return siblingCheck(a, b) + for (cur = a; (cur = cur.parentNode); ) ap.unshift(cur) + for (cur = b; (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 + }), + document) + : document + }), + (Sizzle.matches = function (expr, elements) { + return Sizzle(expr, null, null, elements) + }), + (Sizzle.matchesSelector = function (elem, expr) { + if ( + ((elem.ownerDocument || elem) !== document && setDocument(elem), + (expr = expr.replace(rattributeQuotes, "='$1']")), + support.matchesSelector && + documentIsHTML && + !compilerCache[expr + ' '] && + (!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 (e) {} + return Sizzle(expr, document, null, [elem]).length > 0 + }), + (Sizzle.contains = function (context, elem) { + return (context.ownerDocument || context) !== document && setDocument(context), contains(context, elem) + }), + (Sizzle.attr = function (elem, name) { + ;(elem.ownerDocument || elem) !== document && setDocument(elem) + var fn = Expr.attrHandle[name.toLowerCase()], + 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 + }), + (Sizzle.error = function (msg) { + throw new Error('Syntax error, unrecognized expression: ' + msg) + }), + (Sizzle.uniqueSort = function (results) { + var elem, + duplicates = [], + j = 0, + i = 0 + if ( + ((hasDuplicate = !support.detectDuplicates), + (sortInput = !support.sortStable && results.slice(0)), + results.sort(sortOrder), + hasDuplicate) + ) { + for (; (elem = results[i++]); ) elem === results[i] && (j = duplicates.push(i)) + for (; j--; ) results.splice(duplicates[j], 1) + } + return (sortInput = null), results + }), + (getText = Sizzle.getText = function (elem) { + var node, + ret = '', + i = 0, + nodeType = elem.nodeType + if (nodeType) { + if (1 === nodeType || 9 === nodeType || 11 === nodeType) { + if ('string' == typeof elem.textContent) return elem.textContent + for (elem = elem.firstChild; 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, + createPseudo: markFunction, + match: matchExpr, + attrHandle: {}, + find: {}, + relative: { + '>': { dir: 'parentNode', first: !0 }, + ' ': { dir: 'parentNode' }, + '+': { dir: 'previousSibling', first: !0 }, + '~': { dir: 'previousSibling' } + }, + preFilter: { + 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) + ) + }, + 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 + ) + }, + PSEUDO: function (match) { + var excess, + 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, !0)) && + (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: { + TAG: function (nodeNameSelector) { + var nodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase() + return '*' === nodeNameSelector + ? function () { + return !0 + } + : function (elem) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName + } + }, + CLASS: function (className) { + var pattern = classCache[className + ' '] + return ( + pattern || + ((pattern = new RegExp('(^|' + whitespace + ')' + className + '(' + whitespace + '|$)')) && + classCache(className, function (elem) { + return pattern.test( + ('string' == typeof elem.className && elem.className) || + (void 0 !== elem.getAttribute && elem.getAttribute('class')) || + '' + ) + })) + ) + }, + ATTR: function (name, operator, check) { + return function (elem) { + var result = Sizzle.attr(elem, name) + return null == result + ? '!=' === operator + : !operator || + ((result += ''), + '=' === operator + ? result === check + : '!=' === operator + ? result !== check + : '^=' === operator + ? check && 0 === result.indexOf(check) + : '*=' === operator + ? check && result.indexOf(check) > -1 + : '$=' === operator + ? check && result.slice(-check.length) === check + : '~=' === operator + ? (' ' + result.replace(rwhitespace, ' ') + ' ').indexOf(check) > -1 + : '|=' === operator && + (result === check || result.slice(0, check.length + 1) === check + '-')) + } + }, + CHILD: function (type, what, argument, first, last) { + var simple = 'nth' !== type.slice(0, 3), + forward = 'last' !== type.slice(-4), + ofType = 'of-type' === what + return 1 === first && 0 === last + ? function (elem) { + return !!elem.parentNode + } + : function (elem, context, xml) { + var cache, + uniqueCache, + outerCache, + node, + nodeIndex, + start, + dir = simple !== forward ? 'nextSibling' : 'previousSibling', + parent = elem.parentNode, + name = ofType && elem.nodeName.toLowerCase(), + useCache = !xml && !ofType, + diff = !1 + if (parent) { + if (simple) { + for (; dir; ) { + for (node = elem; (node = node[dir]); ) + if (ofType ? node.nodeName.toLowerCase() === name : 1 === node.nodeType) return !1 + start = dir = 'only' === type && !start && 'nextSibling' + } + return !0 + } + if (((start = [forward ? parent.firstChild : parent.lastChild]), forward && useCache)) { + for ( + diff = + (nodeIndex = + (cache = + (uniqueCache = + (outerCache = (node = parent)[expando] || (node[expando] = {}))[ + node.uniqueID + ] || (outerCache[node.uniqueID] = {}))[type] || [])[0] === dirruns && + cache[1]) && cache[2], + node = nodeIndex && parent.childNodes[nodeIndex]; + (node = (++nodeIndex && node && node[dir]) || (diff = nodeIndex = 0) || start.pop()); + + ) + if (1 === node.nodeType && ++diff && node === elem) { + uniqueCache[type] = [dirruns, nodeIndex, diff] + break + } + } else if ( + (useCache && + (diff = nodeIndex = + (cache = + (uniqueCache = + (outerCache = (node = elem)[expando] || (node[expando] = {}))[node.uniqueID] || + (outerCache[node.uniqueID] = {}))[type] || [])[0] === dirruns && cache[1]), + !1 === diff) + ) + for ( + ; + (node = (++nodeIndex && node && node[dir]) || (diff = nodeIndex = 0) || start.pop()) && + ((ofType ? node.nodeName.toLowerCase() !== name : 1 !== node.nodeType) || + !++diff || + (useCache && + ((uniqueCache = + (outerCache = node[expando] || (node[expando] = {}))[node.uniqueID] || + (outerCache[node.uniqueID] = {}))[type] = [dirruns, diff]), + node !== elem)); + + ); + return (diff -= last) === first || (diff % first == 0 && diff / first >= 0) + } + } + }, + PSEUDO: function (pseudo, argument) { + var args, + fn = + Expr.pseudos[pseudo] || + Expr.setFilters[pseudo.toLowerCase()] || + Sizzle.error('unsupported pseudo: ' + pseudo) + return fn[expando] + ? fn(argument) + : fn.length > 1 + ? ((args = [pseudo, pseudo, '', argument]), + Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) + ? markFunction(function (seed, matches) { + for (var idx, matched = fn(seed, argument), i = matched.length; i--; ) + seed[(idx = indexOf(seed, matched[i]))] = !(matches[idx] = matched[i]) + }) + : function (elem) { + return fn(elem, 0, args) + }) + : fn + } + }, + pseudos: { + not: markFunction(function (selector) { + var input = [], + results = [], + matcher = compile(selector.replace(rtrim, '$1')) + return matcher[expando] + ? markFunction(function (seed, matches, context, xml) { + for (var elem, unmatched = matcher(seed, null, xml, []), i = seed.length; i--; ) + (elem = unmatched[i]) && (seed[i] = !(matches[i] = elem)) + }) + : function (elem, context, xml) { + return ( + (input[0] = elem), matcher(input, null, xml, results), (input[0] = null), !results.pop() + ) + } + }), + has: markFunction(function (selector) { + return function (elem) { + return Sizzle(selector, elem).length > 0 + } + }), + contains: markFunction(function (text) { + return ( + (text = text.replace(runescape, funescape)), + function (elem) { + return (elem.textContent || elem.innerText || getText(elem)).indexOf(text) > -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()) === lang || 0 === elemLang.indexOf(lang + '-') + } while ((elem = elem.parentNode) && 1 === elem.nodeType) + return !1 + } + ) + }), + target: function (elem) { + var hash = window.location && window.location.hash + return hash && hash.slice(1) === elem.id + }, + root: function (elem) { + return elem === docElem + }, + focus: function (elem) { + return ( + elem === document.activeElement && + (!document.hasFocus || document.hasFocus()) && + !!(elem.type || elem.href || ~elem.tabIndex) + ) + }, + enabled: function (elem) { + return !1 === elem.disabled + }, + disabled: function (elem) { + return !0 === elem.disabled + }, + checked: function (elem) { + var nodeName = elem.nodeName.toLowerCase() + return ('input' === nodeName && !!elem.checked) || ('option' === nodeName && !!elem.selected) + }, + selected: function (elem) { + return elem.parentNode && elem.parentNode.selectedIndex, !0 === elem.selected + }, + empty: function (elem) { + for (elem = elem.firstChild; elem; elem = elem.nextSibling) if (elem.nodeType < 6) return !1 + return !0 + }, + parent: function (elem) { + return !Expr.pseudos.empty(elem) + }, + header: function (elem) { + return rheader.test(elem.nodeName) + }, + input: function (elem) { + return rinputs.test(elem.nodeName) + }, + button: function (elem) { + var name = elem.nodeName.toLowerCase() + return ('input' === name && 'button' === elem.type) || 'button' === name + }, + text: function (elem) { + var attr + return ( + 'input' === elem.nodeName.toLowerCase() && + 'text' === elem.type && + (null == (attr = elem.getAttribute('type')) || 'text' === attr.toLowerCase()) + ) + }, + first: createPositionalPseudo(function () { + return [0] + }), + last: createPositionalPseudo(function (matchIndexes, length) { + return [length - 1] + }), + eq: createPositionalPseudo(function (matchIndexes, length, argument) { + return [argument < 0 ? argument + length : argument] + }), + even: createPositionalPseudo(function (matchIndexes, length) { + for (var i = 0; i < length; i += 2) matchIndexes.push(i) + return matchIndexes + }), + odd: createPositionalPseudo(function (matchIndexes, length) { + for (var i = 1; i < length; i += 2) matchIndexes.push(i) + return matchIndexes + }), + lt: createPositionalPseudo(function (matchIndexes, length, argument) { + for (var i = argument < 0 ? argument + length : argument; --i >= 0; ) matchIndexes.push(i) + return matchIndexes + }), + gt: createPositionalPseudo(function (matchIndexes, length, argument) { + for (var i = argument < 0 ? argument + length : argument; ++i < length; ) matchIndexes.push(i) + return matchIndexes + }) + } + }).pseudos.nth = Expr.pseudos.eq), + { radio: !0, checkbox: !0, file: !0, password: !0, image: !0 })) + Expr.pseudos[i] = createInputPseudo(i) + for (i in { submit: !0, reset: !0 }) Expr.pseudos[i] = createButtonPseudo(i) + function setFilters () {} + function toSelector (tokens) { + for (var i = 0, len = tokens.length, selector = ''; i < len; i++) selector += tokens[i].value + return selector + } + function addCombinator (matcher, combinator, base) { + var dir = combinator.dir, + checkNonElements = base && 'parentNode' === dir, + doneName = done++ + return combinator.first + ? function (elem, context, xml) { + for (; (elem = elem[dir]); ) + if (1 === elem.nodeType || checkNonElements) return matcher(elem, context, xml) + } + : function (elem, context, xml) { + var oldCache, + uniqueCache, + outerCache, + newCache = [dirruns, doneName] + if (xml) { + for (; (elem = elem[dir]); ) + if ((1 === elem.nodeType || checkNonElements) && matcher(elem, context, xml)) return !0 + } else + for (; (elem = elem[dir]); ) + if (1 === elem.nodeType || checkNonElements) { + if ( + (oldCache = (uniqueCache = + (outerCache = elem[expando] || (elem[expando] = {}))[elem.uniqueID] || + (outerCache[elem.uniqueID] = {}))[dir]) && + oldCache[0] === dirruns && + oldCache[1] === doneName + ) + return (newCache[2] = oldCache[2]) + if (((uniqueCache[dir] = newCache), (newCache[2] = matcher(elem, context, xml)))) return !0 + } + } + } + function elementMatcher (matchers) { + return matchers.length > 1 + ? function (elem, context, xml) { + for (var i = matchers.length; i--; ) if (!matchers[i](elem, context, xml)) return !1 + return !0 + } + : matchers[0] + } + function condense (unmatched, map, filter, context, xml) { + for (var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = null != map; i < len; i++) + (elem = unmatched[i]) && + ((filter && !filter(elem, context, xml)) || (newUnmatched.push(elem), mapped && map.push(i))) + return newUnmatched + } + 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 temp, + i, + elem, + preMap = [], + postMap = [], + preexisting = results.length, + elems = + seed || + (function (selector, contexts, results) { + for (var i = 0, len = contexts.length; i < len; i++) Sizzle(selector, contexts[i], results) + return results + })(selector || '*', context.nodeType ? [context] : context, []), + matcherIn = + !preFilter || (!seed && selector) ? elems : condense(elems, preMap, preFilter, context, xml), + matcherOut = matcher + ? postFinder || (seed ? preFilter : preexisting || postFilter) + ? [] + : results + : matcherIn + if ((matcher && matcher(matcherIn, matcherOut, context, xml), postFilter)) + for ( + temp = condense(matcherOut, postMap), postFilter(temp, [], context, xml), i = temp.length; + i--; + + ) + (elem = temp[i]) && (matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem)) + if (seed) { + if (postFinder || preFilter) { + if (postFinder) { + for (temp = [], i = matcherOut.length; i--; ) + (elem = matcherOut[i]) && temp.push((matcherIn[i] = elem)) + postFinder(null, (matcherOut = []), temp, xml) + } + for (i = matcherOut.length; i--; ) + (elem = matcherOut[i]) && + (temp = postFinder ? indexOf(seed, elem) : preMap[i]) > -1 && + (seed[temp] = !(results[temp] = elem)) + } + } else (matcherOut = condense(matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut)), postFinder ? postFinder(null, results, matcherOut, xml) : push.apply(results, matcherOut) + }) + ) + } + function matcherFromTokens (tokens) { + for ( + var checkContext, + matcher, + j, + len = tokens.length, + leadingRelative = Expr.relative[tokens[0].type], + implicitRelative = leadingRelative || Expr.relative[' '], + i = leadingRelative ? 1 : 0, + matchContext = addCombinator( + function (elem) { + return elem === checkContext + }, + implicitRelative, + !0 + ), + matchAnyContext = addCombinator( + function (elem) { + return indexOf(checkContext, elem) > -1 + }, + implicitRelative, + !0 + ), + matchers = [ + function (elem, context, xml) { + var ret = + (!leadingRelative && (xml || context !== outermostContext)) || + ((checkContext = context).nodeType + ? matchContext(elem, context, xml) + : matchAnyContext(elem, context, xml)) + return (checkContext = null), ret + } + ]; + i < len; + i++ + ) + if ((matcher = Expr.relative[tokens[i].type])) + matchers = [addCombinator(elementMatcher(matchers), matcher)] + else { + if ((matcher = Expr.filter[tokens[i].type].apply(null, tokens[i].matches))[expando]) { + for (j = ++i; j < len && !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, + i < j && matcherFromTokens(tokens.slice(i, j)), + j < len && matcherFromTokens((tokens = tokens.slice(j))), + j < len && toSelector(tokens) + ) + } + matchers.push(matcher) + } + return elementMatcher(matchers) + } + return ( + (setFilters.prototype = Expr.filters = Expr.pseudos), + (Expr.setFilters = new setFilters()), + (tokenize = Sizzle.tokenize = function (selector, parseOnly) { + var matched, + match, + tokens, + type, + soFar, + groups, + preFilters, + cached = tokenCache[selector + ' '] + if (cached) return parseOnly ? 0 : cached.slice(0) + for (soFar = selector, groups = [], preFilters = Expr.preFilter; soFar; ) { + for (type in ((matched && !(match = rcomma.exec(soFar))) || + (match && (soFar = soFar.slice(match[0].length) || soFar), groups.push((tokens = []))), + (matched = !1), + (match = rcombinators.exec(soFar)) && + ((matched = match.shift()), + tokens.push({ value: matched, type: match[0].replace(rtrim, ' ') }), + (soFar = soFar.slice(matched.length))), + Expr.filter)) + !(match = matchExpr[type].exec(soFar)) || + (preFilters[type] && !(match = preFilters[type](match))) || + ((matched = match.shift()), + tokens.push({ value: matched, type, matches: match }), + (soFar = soFar.slice(matched.length))) + if (!matched) break + } + return parseOnly + ? soFar.length + : soFar + ? Sizzle.error(selector) + : tokenCache(selector, groups).slice(0) + }), + (compile = Sizzle.compile = function (selector, match) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[selector + ' '] + if (!cached) { + for (match || (match = tokenize(selector)), i = match.length; i--; ) + (cached = matcherFromTokens(match[i]))[expando] + ? setMatchers.push(cached) + : elementMatchers.push(cached) + ;(cached = compilerCache( + selector, + (function (elementMatchers, setMatchers) { + var bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function (seed, context, xml, results, outermost) { + var elem, + j, + matcher, + matchedCount = 0, + i = '0', + unmatched = seed && [], + setMatched = [], + contextBackup = outermostContext, + elems = seed || (byElement && Expr.find.TAG('*', outermost)), + dirrunsUnique = (dirruns += null == contextBackup ? 1 : Math.random() || 0.1), + len = elems.length + for ( + outermost && (outermostContext = context === document || context || outermost); + i !== len && null != (elem = elems[i]); + i++ + ) { + if (byElement && elem) { + for ( + j = 0, + context || + elem.ownerDocument === document || + (setDocument(elem), (xml = !documentIsHTML)); + (matcher = elementMatchers[j++]); + + ) + if (matcher(elem, context || document, xml)) { + results.push(elem) + break + } + outermost && (dirruns = dirrunsUnique) + } + bySet && ((elem = !matcher && elem) && matchedCount--, seed && unmatched.push(elem)) + } + if (((matchedCount += i), bySet && i !== matchedCount)) { + for (j = 0; (matcher = setMatchers[j++]); ) matcher(unmatched, setMatched, context, xml) + if (seed) { + if (matchedCount > 0) + for (; i--; ) unmatched[i] || setMatched[i] || (setMatched[i] = pop.call(results)) + setMatched = condense(setMatched) + } + push.apply(results, setMatched), + outermost && + !seed && + setMatched.length > 0 && + matchedCount + setMatchers.length > 1 && + Sizzle.uniqueSort(results) + } + return ( + outermost && ((dirruns = dirrunsUnique), (outermostContext = contextBackup)), unmatched + ) + } + return bySet ? markFunction(superMatcher) : superMatcher + })(elementMatchers, setMatchers) + )).selector = selector + } + return cached + }), + (select = Sizzle.select = function (selector, context, results, seed) { + var i, + tokens, + token, + type, + find, + compiled = 'function' == typeof selector && selector, + match = !seed && tokenize((selector = compiled.selector || selector)) + if (((results = results || []), 1 === match.length)) { + if ( + (tokens = match[0] = match[0].slice(0)).length > 2 && + 'ID' === (token = tokens[0]).type && + support.getById && + 9 === context.nodeType && + documentIsHTML && + Expr.relative[tokens[1].type] + ) { + if (!(context = (Expr.find.ID(token.matches[0].replace(runescape, funescape), context) || [])[0])) + return results + compiled && (context = context.parentNode), + (selector = selector.slice(tokens.shift().value.length)) + } + for ( + i = matchExpr.needsContext.test(selector) ? 0 : tokens.length; + i-- && ((token = tokens[i]), !Expr.relative[(type = token.type)]); + + ) + if ( + (find = Expr.find[type]) && + (seed = find( + token.matches[0].replace(runescape, funescape), + (rsibling.test(tokens[0].type) && testContext(context.parentNode)) || context + )) + ) { + if ((tokens.splice(i, 1), !(selector = seed.length && toSelector(tokens)))) + return push.apply(results, seed), results + break + } + } + return ( + (compiled || compile(selector, match))( + seed, + context, + !documentIsHTML, + results, + !context || (rsibling.test(selector) && testContext(context.parentNode)) || context + ), + results + ) + }), + (support.sortStable = + expando + .split('') + .sort(sortOrder) + .join('') === expando), + (support.detectDuplicates = !!hasDuplicate), + setDocument(), + (support.sortDetached = assert(function (div1) { + return 1 & div1.compareDocumentPosition(document.createElement('div')) + })), + assert(function (div) { + return (div.innerHTML = ""), '#' === div.firstChild.getAttribute('href') + }) || + addHandle('type|href|height|width', function (elem, name, isXML) { + if (!isXML) return elem.getAttribute(name, 'type' === name.toLowerCase() ? 1 : 2) + }), + (support.attributes && + assert(function (div) { + return ( + (div.innerHTML = ''), + div.firstChild.setAttribute('value', ''), + '' === div.firstChild.getAttribute('value') + ) + })) || + addHandle('value', function (elem, name, isXML) { + if (!isXML && 'input' === elem.nodeName.toLowerCase()) return elem.defaultValue + }), + assert(function (div) { + return null == div.getAttribute('disabled') + }) || + addHandle(booleans, function (elem, name, isXML) { + var val + if (!isXML) + return !0 === elem[name] + ? name.toLowerCase() + : (val = elem.getAttributeNode(name)) && val.specified + ? val.value + : null + }), + Sizzle + ) + })(window) + ;(jQuery.find = Sizzle), + (jQuery.expr = Sizzle.selectors), + (jQuery.expr[':'] = jQuery.expr.pseudos), + (jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort), + (jQuery.text = Sizzle.getText), + (jQuery.isXMLDoc = Sizzle.isXML), + (jQuery.contains = Sizzle.contains) + var dir = function (elem, dir, until) { + for (var matched = [], truncate = void 0 !== until; (elem = elem[dir]) && 9 !== elem.nodeType; ) + if (1 === elem.nodeType) { + if (truncate && jQuery(elem).is(until)) break + matched.push(elem) + } + return matched + }, + siblings = function (n, elem) { + for (var matched = []; n; n = n.nextSibling) 1 === n.nodeType && n !== elem && matched.push(n) + return matched + }, + rneedsContext = jQuery.expr.match.needsContext, + rsingleTag = /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/, + risSimple = /^.[^:#\[\.,]*$/ + 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 (risSimple.test(qualifier)) return jQuery.filter(qualifier, elements, not) + qualifier = jQuery.filter(qualifier, elements) + } + return jQuery.grep(elements, function (elem) { + return indexOf.call(qualifier, elem) > -1 !== not + }) + } + ;(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 (elem) { + return 1 === elem.nodeType + }) + ) + ) + }), + jQuery.fn.extend({ + find: function (selector) { + var i, + len = this.length, + ret = [], + self = this + if ('string' != typeof selector) + return this.pushStack( + jQuery(selector).filter(function () { + for (i = 0; i < len; i++) if (jQuery.contains(self[i], this)) return !0 + }) + ) + for (i = 0; i < len; i++) jQuery.find(selector, self[i], ret) + return ( + ((ret = this.pushStack(len > 1 ? jQuery.unique(ret) : ret)).selector = this.selector + ? this.selector + ' ' + selector + : selector), + ret + ) + }, + filter: function (selector) { + return this.pushStack(winnow(this, selector || [], !1)) + }, + not: function (selector) { + return this.pushStack(winnow(this, selector || [], !0)) + }, + is: function (selector) { + return !!winnow( + this, + 'string' == typeof selector && rneedsContext.test(selector) ? jQuery(selector) : selector || [], + !1 + ).length + } + }) + var rootjQuery, + rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/ + ;((jQuery.fn.init = function (selector, context, root) { + var match, elem + if (!selector) return this + if (((root = root || rootjQuery), 'string' == typeof selector)) { + if ( + !(match = + '<' === selector[0] && '>' === selector[selector.length - 1] && selector.length >= 3 + ? [null, selector, null] + : rquickExpr.exec(selector)) || + (!match[1] && context) + ) + return !context || context.jquery + ? (context || root).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 : document, + !0 + ) + ), + rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) + ) + for (match in context) + jQuery.isFunction(this[match]) ? this[match](context[match]) : this.attr(match, context[match]) + return this + } + return ( + (elem = document.getElementById(match[2])) && elem.parentNode && ((this.length = 1), (this[0] = elem)), + (this.context = document), + (this.selector = selector), + this + ) + } + return selector.nodeType + ? ((this.context = this[0] = selector), (this.length = 1), this) + : jQuery.isFunction(selector) + ? void 0 !== root.ready + ? root.ready(selector) + : selector(jQuery) + : (void 0 !== selector.selector && + ((this.selector = selector.selector), (this.context = selector.context)), + jQuery.makeArray(selector, this)) + }).prototype = jQuery.fn), + (rootjQuery = jQuery(document)) + var rparentsprev = /^(?:parents|prev(?:Until|All))/, + guaranteedUnique = { children: !0, contents: !0, next: !0, prev: !0 } + function sibling (cur, dir) { + for (; (cur = cur[dir]) && 1 !== cur.nodeType; ); + return cur + } + jQuery.fn.extend({ + has: function (target) { + var targets = jQuery(target, this), + l = targets.length + return this.filter(function () { + for (var i = 0; i < l; i++) if (jQuery.contains(this, targets[i])) return !0 + }) + }, + closest: function (selectors, context) { + for ( + var cur, + i = 0, + l = this.length, + matched = [], + pos = + rneedsContext.test(selectors) || 'string' != typeof selectors + ? jQuery(selectors, context || this.context) + : 0; + i < l; + i++ + ) + for (cur = this[i]; 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.uniqueSort(matched) : matched) + }, + index: function (elem) { + return elem + ? 'string' == typeof elem + ? indexOf.call(jQuery(elem), this[0]) + : indexOf.call(this, elem.jquery ? elem[0] : elem) + : this[0] && this[0].parentNode + ? this.first().prevAll().length + : -1 + }, + add: function (selector, context) { + return this.pushStack(jQuery.uniqueSort(jQuery.merge(this.get(), jQuery(selector, context)))) + }, + addBack: function (selector) { + return this.add(null == selector ? this.prevObject : this.prevObject.filter(selector)) + } + }), + jQuery.each( + { + parent: function (elem) { + var parent = elem.parentNode + return parent && 11 !== parent.nodeType ? parent : null + }, + parents: function (elem) { + return dir(elem, 'parentNode') + }, + parentsUntil: function (elem, i, until) { + return dir(elem, 'parentNode', until) + }, + next: function (elem) { + return sibling(elem, 'nextSibling') + }, + prev: function (elem) { + return sibling(elem, 'previousSibling') + }, + nextAll: function (elem) { + return dir(elem, 'nextSibling') + }, + prevAll: function (elem) { + return dir(elem, 'previousSibling') + }, + nextUntil: function (elem, i, until) { + return dir(elem, 'nextSibling', until) + }, + prevUntil: function (elem, i, until) { + return dir(elem, 'previousSibling', until) + }, + siblings: function (elem) { + return siblings((elem.parentNode || {}).firstChild, elem) + }, + children: function (elem) { + return siblings(elem.firstChild) + }, + contents: function (elem) { + return elem.contentDocument || jQuery.merge([], elem.childNodes) + } + }, + function (name, fn) { + 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.uniqueSort(matched), + rparentsprev.test(name) && matched.reverse()), + this.pushStack(matched) + ) + } + } + ) + var readyList, + rnotwhite = /\S+/g + function completed () { + document.removeEventListener('DOMContentLoaded', completed), + window.removeEventListener('load', completed), + jQuery.ready() + } + ;(jQuery.Callbacks = function (options) { + options = + 'string' == typeof options + ? (function (options) { + var object = {} + return ( + jQuery.each(options.match(rnotwhite) || [], function (_, flag) { + object[flag] = !0 + }), + object + ) + })(options) + : jQuery.extend({}, options) + var firing, + memory, + fired, + locked, + list = [], + queue = [], + firingIndex = -1, + fire = function () { + for (locked = options.once, fired = firing = !0; queue.length; firingIndex = -1) + for (memory = queue.shift(); ++firingIndex < list.length; ) + !1 === list[firingIndex].apply(memory[0], memory[1]) && + options.stopOnFalse && + ((firingIndex = list.length), (memory = !1)) + options.memory || (memory = !1), (firing = !1), locked && (list = memory ? [] : '') + }, + self = { + add: function () { + return ( + list && + (memory && !firing && ((firingIndex = list.length - 1), queue.push(memory)), + (function add (args) { + jQuery.each(args, function (_, arg) { + jQuery.isFunction(arg) + ? (options.unique && self.has(arg)) || list.push(arg) + : arg && arg.length && 'string' !== jQuery.type(arg) && add(arg) + }) + })(arguments), + memory && !firing && fire()), + this + ) + }, + remove: function () { + return ( + jQuery.each(arguments, function (_, arg) { + for (var index; (index = jQuery.inArray(arg, list, index)) > -1; ) + list.splice(index, 1), index <= firingIndex && firingIndex-- + }), + this + ) + }, + has: function (fn) { + return fn ? jQuery.inArray(fn, list) > -1 : list.length > 0 + }, + empty: function () { + return list && (list = []), this + }, + disable: function () { + return (locked = queue = []), (list = memory = ''), this + }, + disabled: function () { + return !list + }, + lock: function () { + return (locked = queue = []), memory || (list = memory = ''), this + }, + locked: function () { + return !!locked + }, + fireWith: function (context, args) { + return ( + locked || + ((args = [context, (args = args || []).slice ? args.slice() : args]), + queue.push(args), + firing || fire()), + this + ) + }, + fire: function () { + return self.fireWith(this, arguments), this + }, + fired: function () { + return !!fired + } + } + return self + }), + jQuery.extend({ + Deferred: function (func) { + var tuples = [ + ['resolve', 'done', jQuery.Callbacks('once memory'), 'resolved'], + ['reject', 'fail', jQuery.Callbacks('once memory'), 'rejected'], + ['notify', 'progress', jQuery.Callbacks('memory')] + ], + state = 'pending', + promise = { + state: function () { + return state + }, + always: function () { + return deferred.done(arguments).fail(arguments), this + }, + then: function () { + var fns = arguments + return jQuery + .Deferred(function (newDefer) { + jQuery.each(tuples, function (i, tuple) { + var fn = jQuery.isFunction(fns[i]) && fns[i] + deferred[tuple[1]](function () { + var returned = fn && fn.apply(this, arguments) + returned && jQuery.isFunction(returned.promise) + ? returned + .promise() + .progress(newDefer.notify) + .done(newDefer.resolve) + .fail(newDefer.reject) + : newDefer[tuple[0] + 'With']( + this === promise ? newDefer.promise() : this, + fn ? [returned] : arguments + ) + }) + }), + (fns = null) + }) + .promise() + }, + promise: function (obj) { + return null != obj ? jQuery.extend(obj, promise) : promise + } + }, + deferred = {} + return ( + (promise.pipe = promise.then), + jQuery.each(tuples, function (i, tuple) { + var list = tuple[2], + stateString = tuple[3] + ;(promise[tuple[1]] = list.add), + stateString && + list.add( + function () { + state = stateString + }, + tuples[1 ^ i][2].disable, + tuples[2][2].lock + ), + (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 + ) + }, + when: function (subordinate) { + var progressValues, + progressContexts, + resolveContexts, + i = 0, + resolveValues = slice.call(arguments), + length = resolveValues.length, + remaining = 1 !== length || (subordinate && jQuery.isFunction(subordinate.promise)) ? length : 0, + deferred = 1 === remaining ? subordinate : jQuery.Deferred(), + updateFunc = function (i, contexts, values) { + return function (value) { + ;(contexts[i] = this), + (values[i] = arguments.length > 1 ? slice.call(arguments) : value), + values === progressValues + ? deferred.notifyWith(contexts, values) + : --remaining || deferred.resolveWith(contexts, values) + } + } + if (length > 1) + for ( + progressValues = new Array(length), + progressContexts = new Array(length), + resolveContexts = new Array(length); + i < length; + i++ + ) + resolveValues[i] && jQuery.isFunction(resolveValues[i].promise) + ? resolveValues[i] + .promise() + .progress(updateFunc(i, progressContexts, progressValues)) + .done(updateFunc(i, resolveContexts, resolveValues)) + .fail(deferred.reject) + : --remaining + return remaining || deferred.resolveWith(resolveContexts, resolveValues), deferred.promise() + } + }), + (jQuery.fn.ready = function (fn) { + return jQuery.ready.promise().done(fn), this + }), + jQuery.extend({ + isReady: !1, + readyWait: 1, + holdReady: function (hold) { + hold ? jQuery.readyWait++ : jQuery.ready(!0) + }, + ready: function (wait) { + ;(!0 === wait ? --jQuery.readyWait : jQuery.isReady) || + ((jQuery.isReady = !0), + (!0 !== wait && --jQuery.readyWait > 0) || + (readyList.resolveWith(document, [jQuery]), + jQuery.fn.triggerHandler && + (jQuery(document).triggerHandler('ready'), jQuery(document).off('ready')))) + } + }), + (jQuery.ready.promise = function (obj) { + return ( + readyList || + ((readyList = jQuery.Deferred()), + 'complete' === document.readyState || + ('loading' !== document.readyState && !document.documentElement.doScroll) + ? window.setTimeout(jQuery.ready) + : (document.addEventListener('DOMContentLoaded', completed), + window.addEventListener('load', completed))), + readyList.promise(obj) + ) + }), + jQuery.ready.promise() + var access = function (elems, fn, key, value, chainable, emptyGet, raw) { + var i = 0, + len = elems.length, + bulk = null == key + if ('object' === jQuery.type(key)) + for (i in ((chainable = !0), key)) access(elems, fn, i, key[i], !0, emptyGet, raw) + else if ( + void 0 !== value && + ((chainable = !0), + jQuery.isFunction(value) || (raw = !0), + bulk && + (raw + ? (fn.call(elems, value), (fn = null)) + : ((bulk = fn), + (fn = function (elem, key, value) { + return bulk.call(jQuery(elem), value) + }))), + fn) + ) + for (; i < len; i++) fn(elems[i], key, raw ? value : value.call(elems[i], i, fn(elems[i], key))) + return chainable ? elems : bulk ? fn.call(elems) : len ? fn(elems[0], key) : emptyGet + }, + acceptData = function (owner) { + return 1 === owner.nodeType || 9 === owner.nodeType || !+owner.nodeType + } + function Data () { + this.expando = jQuery.expando + Data.uid++ + } + ;(Data.uid = 1), + (Data.prototype = { + register: function (owner, initial) { + var value = initial || {} + return ( + owner.nodeType + ? (owner[this.expando] = value) + : Object.defineProperty(owner, this.expando, { value, writable: !0, configurable: !0 }), + owner[this.expando] + ) + }, + cache: function (owner) { + if (!acceptData(owner)) return {} + var value = owner[this.expando] + return ( + value || + ((value = {}), + acceptData(owner) && + (owner.nodeType + ? (owner[this.expando] = value) + : Object.defineProperty(owner, this.expando, { value, configurable: !0 }))), + value + ) + }, + set: function (owner, data, value) { + var prop, + cache = this.cache(owner) + if ('string' == typeof data) cache[data] = value + else for (prop in data) cache[prop] = data[prop] + return cache + }, + get: function (owner, key) { + return void 0 === key ? this.cache(owner) : owner[this.expando] && owner[this.expando][key] + }, + access: function (owner, key, value) { + var stored + return void 0 === key || (key && 'string' == typeof key && void 0 === value) + ? void 0 !== (stored = this.get(owner, key)) + ? stored + : this.get(owner, jQuery.camelCase(key)) + : (this.set(owner, key, value), void 0 !== value ? value : key) + }, + remove: function (owner, key) { + var i, + name, + camel, + cache = owner[this.expando] + if (void 0 !== cache) { + if (void 0 === key) this.register(owner) + else { + jQuery.isArray(key) + ? (name = key.concat(key.map(jQuery.camelCase))) + : ((camel = jQuery.camelCase(key)), + (name = + key in cache + ? [key, camel] + : (name = camel) in cache + ? [name] + : name.match(rnotwhite) || [])), + (i = name.length) + for (; i--; ) delete cache[name[i]] + } + ;(void 0 === key || jQuery.isEmptyObject(cache)) && + (owner.nodeType ? (owner[this.expando] = void 0) : delete owner[this.expando]) + } + }, + hasData: function (owner) { + var cache = owner[this.expando] + return void 0 !== cache && !jQuery.isEmptyObject(cache) + } + }) + var dataPriv = new Data(), + dataUser = new Data(), + rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, + rmultiDash = /[A-Z]/g + function dataAttr (elem, key, data) { + var name + if (void 0 === data && 1 === elem.nodeType) + if ( + ((name = 'data-' + key.replace(rmultiDash, '-$&').toLowerCase()), + 'string' == typeof (data = elem.getAttribute(name))) + ) { + try { + data = + 'true' === data || + ('false' !== data && + ('null' === data + ? null + : +data + '' === data + ? +data + : rbrace.test(data) + ? jQuery.parseJSON(data) + : data)) + } catch (e) {} + dataUser.set(elem, key, data) + } else data = void 0 + return data + } + jQuery.extend({ + hasData: function (elem) { + return dataUser.hasData(elem) || dataPriv.hasData(elem) + }, + data: function (elem, name, data) { + return dataUser.access(elem, name, data) + }, + removeData: function (elem, name) { + dataUser.remove(elem, name) + }, + _data: function (elem, name, data) { + return dataPriv.access(elem, name, data) + }, + _removeData: function (elem, name) { + dataPriv.remove(elem, name) + } + }), + jQuery.fn.extend({ + data: function (key, value) { + var i, + name, + data, + elem = this[0], + attrs = elem && elem.attributes + if (void 0 === key) { + if ( + this.length && + ((data = dataUser.get(elem)), 1 === elem.nodeType && !dataPriv.get(elem, 'hasDataAttrs')) + ) { + for (i = attrs.length; i--; ) + attrs[i] && + 0 === (name = attrs[i].name).indexOf('data-') && + ((name = jQuery.camelCase(name.slice(5))), dataAttr(elem, name, data[name])) + dataPriv.set(elem, 'hasDataAttrs', !0) + } + return data + } + return 'object' == typeof key + ? this.each(function () { + dataUser.set(this, key) + }) + : access( + this, + function (value) { + var data, camelKey + if (elem && void 0 === value) + return void 0 !== + (data = + dataUser.get(elem, key) || + dataUser.get(elem, key.replace(rmultiDash, '-$&').toLowerCase())) + ? data + : ((camelKey = jQuery.camelCase(key)), + void 0 !== (data = dataUser.get(elem, camelKey)) + ? data + : void 0 !== (data = dataAttr(elem, camelKey, void 0)) + ? data + : void 0) + ;(camelKey = jQuery.camelCase(key)), + this.each(function () { + var data = dataUser.get(this, camelKey) + dataUser.set(this, camelKey, value), + key.indexOf('-') > -1 && void 0 !== data && dataUser.set(this, key, value) + }) + }, + null, + value, + arguments.length > 1, + null, + !0 + ) + }, + removeData: function (key) { + return this.each(function () { + dataUser.remove(this, key) + }) + } + }), + jQuery.extend({ + queue: function (elem, type, data) { + var queue + if (elem) + return ( + (type = (type || 'fx') + 'queue'), + (queue = dataPriv.get(elem, type)), + data && + (!queue || jQuery.isArray(data) + ? (queue = dataPriv.access(elem, type, jQuery.makeArray(data))) + : queue.push(data)), + queue || [] + ) + }, + dequeue: function (elem, type) { + type = type || 'fx' + var queue = jQuery.queue(elem, type), + startLength = queue.length, + fn = queue.shift(), + hooks = jQuery._queueHooks(elem, type) + 'inprogress' === fn && ((fn = queue.shift()), startLength--), + fn && + ('fx' === type && queue.unshift('inprogress'), + delete hooks.stop, + fn.call( + elem, + function () { + jQuery.dequeue(elem, type) + }, + hooks + )), + !startLength && hooks && hooks.empty.fire() + }, + _queueHooks: function (elem, type) { + var key = type + 'queueHooks' + return ( + dataPriv.get(elem, key) || + dataPriv.access(elem, key, { + empty: jQuery.Callbacks('once memory').add(function () { + dataPriv.remove(elem, [type + 'queue', key]) + }) + }) + ) + } + }), + jQuery.fn.extend({ + queue: function (type, data) { + 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), + 'fx' === type && 'inprogress' !== queue[0] && jQuery.dequeue(this, type) + }) + ) + }, + dequeue: function (type) { + return this.each(function () { + jQuery.dequeue(this, type) + }) + }, + clearQueue: function (type) { + return this.queue(type || 'fx', []) + }, + promise: function (type, obj) { + var tmp, + count = 1, + defer = jQuery.Deferred(), + elements = this, + i = this.length, + resolve = function () { + --count || defer.resolveWith(elements, [elements]) + } + for ('string' != typeof type && ((obj = type), (type = void 0)), type = type || 'fx'; i--; ) + (tmp = dataPriv.get(elements[i], type + 'queueHooks')) && + tmp.empty && + (count++, tmp.empty.add(resolve)) + return resolve(), defer.promise(obj) + } + }) + var pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, + rcssNum = new RegExp('^(?:([+-])=|)(' + pnum + ')([a-z%]*)$', 'i'), + cssExpand = ['Top', 'Right', 'Bottom', 'Left'], + isHidden = function (elem, el) { + return ( + (elem = el || elem), + 'none' === jQuery.css(elem, 'display') || !jQuery.contains(elem.ownerDocument, elem) + ) + } + function adjustCSS (elem, prop, valueParts, tween) { + var adjusted, + scale = 1, + maxIterations = 20, + currentValue = tween + ? function () { + return tween.cur() + } + : function () { + return jQuery.css(elem, prop, '') + }, + initial = currentValue(), + unit = (valueParts && valueParts[3]) || (jQuery.cssNumber[prop] ? '' : 'px'), + initialInUnit = + (jQuery.cssNumber[prop] || ('px' !== unit && +initial)) && rcssNum.exec(jQuery.css(elem, prop)) + if (initialInUnit && initialInUnit[3] !== unit) { + ;(unit = unit || initialInUnit[3]), (valueParts = valueParts || []), (initialInUnit = +initial || 1) + do { + ;(initialInUnit /= scale = scale || '.5'), jQuery.style(elem, prop, initialInUnit + unit) + } while (scale !== (scale = currentValue() / initial) && 1 !== scale && --maxIterations) + } + return ( + valueParts && + ((initialInUnit = +initialInUnit || +initial || 0), + (adjusted = valueParts[1] ? initialInUnit + (valueParts[1] + 1) * valueParts[2] : +valueParts[2]), + tween && ((tween.unit = unit), (tween.start = initialInUnit), (tween.end = adjusted))), + adjusted + ) + } + var rcheckableType = /^(?:checkbox|radio)$/i, + rtagName = /<([\w:-]+)/, + rscriptType = /^$|\/(?:java|ecma)script/i, + wrapMap = { + option: [1, "'], + thead: [1, '', '
'], + col: [2, '', '
'], + tr: [2, '', '
'], + td: [3, '', '
'], + _default: [0, '', ''] + } + function getAll (context, tag) { + var ret = + void 0 !== context.getElementsByTagName + ? context.getElementsByTagName(tag || '*') + : void 0 !== context.querySelectorAll + ? context.querySelectorAll(tag || '*') + : [] + return void 0 === tag || (tag && jQuery.nodeName(context, tag)) ? jQuery.merge([context], ret) : ret + } + function setGlobalEval (elems, refElements) { + for (var i = 0, l = elems.length; i < l; i++) + dataPriv.set(elems[i], 'globalEval', !refElements || dataPriv.get(refElements[i], 'globalEval')) + } + ;(wrapMap.optgroup = wrapMap.option), + (wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead), + (wrapMap.th = wrapMap.td) + var div, + input, + rhtml = /<|&#?\w+;/ + function buildFragment (elems, context, scripts, selection, ignored) { + for ( + var elem, + tmp, + tag, + wrap, + contains, + j, + fragment = context.createDocumentFragment(), + nodes = [], + i = 0, + l = elems.length; + i < l; + i++ + ) + if ((elem = elems[i]) || 0 === elem) + if ('object' === jQuery.type(elem)) jQuery.merge(nodes, elem.nodeType ? [elem] : elem) + else if (rhtml.test(elem)) { + for ( + tmp = tmp || fragment.appendChild(context.createElement('div')), + tag = (rtagName.exec(elem) || ['', ''])[1].toLowerCase(), + wrap = wrapMap[tag] || wrapMap._default, + tmp.innerHTML = wrap[1] + jQuery.htmlPrefilter(elem) + wrap[2], + j = wrap[0]; + j--; + + ) + tmp = tmp.lastChild + jQuery.merge(nodes, tmp.childNodes), ((tmp = fragment.firstChild).textContent = '') + } else nodes.push(context.createTextNode(elem)) + for (fragment.textContent = '', i = 0; (elem = nodes[i++]); ) + if (selection && jQuery.inArray(elem, selection) > -1) ignored && ignored.push(elem) + else if ( + ((contains = jQuery.contains(elem.ownerDocument, elem)), + (tmp = getAll(fragment.appendChild(elem), 'script')), + contains && setGlobalEval(tmp), + scripts) + ) + for (j = 0; (elem = tmp[j++]); ) rscriptType.test(elem.type || '') && scripts.push(elem) + return fragment + } + ;(div = document.createDocumentFragment().appendChild(document.createElement('div'))), + (input = document.createElement('input')).setAttribute('type', 'radio'), + input.setAttribute('checked', 'checked'), + input.setAttribute('name', 't'), + div.appendChild(input), + (support.checkClone = div.cloneNode(!0).cloneNode(!0).lastChild.checked), + (div.innerHTML = ''), + (support.noCloneChecked = !!div.cloneNode(!0).lastChild.defaultValue) + var rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, + rtypenamespace = /^([^.]*)(?:\.(.+)|)/ + function returnTrue () { + return !0 + } + function returnFalse () { + return !1 + } + function safeActiveElement () { + try { + return document.activeElement + } catch (err) {} + } + function on (elem, types, selector, data, fn, one) { + var origFn, type + if ('object' == typeof types) { + for (type in ('string' != typeof selector && ((data = data || selector), (selector = void 0)), types)) + on(elem, type, selector, data, types[type], one) + return elem + } + 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))), + !1 === fn) + ) + fn = returnFalse + else if (!fn) return elem + return ( + 1 === one && + ((origFn = fn), + ((fn = function (event) { + return jQuery().off(event), origFn.apply(this, arguments) + }).guid = origFn.guid || (origFn.guid = jQuery.guid++))), + elem.each(function () { + jQuery.event.add(this, types, fn, data, selector) + }) + ) + } + ;(jQuery.event = { + global: {}, + add: function (elem, types, handler, data, selector) { + var handleObjIn, + eventHandle, + tmp, + events, + t, + handleObj, + special, + handlers, + type, + namespaces, + origType, + elemData = dataPriv.get(elem) + if (elemData) + for ( + handler.handler && ((handler = (handleObjIn = handler).handler), (selector = handleObjIn.selector)), + handler.guid || (handler.guid = jQuery.guid++), + (events = elemData.events) || (events = elemData.events = {}), + (eventHandle = elemData.handle) || + (eventHandle = elemData.handle = function (e) { + return void 0 !== jQuery && jQuery.event.triggered !== e.type + ? jQuery.event.dispatch.apply(elem, arguments) + : void 0 + }), + t = (types = (types || '').match(rnotwhite) || ['']).length; + t--; + + ) + (type = origType = (tmp = rtypenamespace.exec(types[t]) || [])[1]), + (namespaces = (tmp[2] || '').split('.').sort()), + type && + ((special = jQuery.event.special[type] || {}), + (type = (selector ? special.delegateType : special.bindType) || type), + (special = jQuery.event.special[type] || {}), + (handleObj = jQuery.extend( + { + type, + origType, + data, + handler, + guid: handler.guid, + selector, + needsContext: selector && jQuery.expr.match.needsContext.test(selector), + namespace: namespaces.join('.') + }, + handleObjIn + )), + (handlers = events[type]) || + (((handlers = events[type] = []).delegateCount = 0), + (special.setup && !1 !== special.setup.call(elem, data, namespaces, eventHandle)) || + (elem.addEventListener && elem.addEventListener(type, eventHandle))), + special.add && + (special.add.call(elem, handleObj), + handleObj.handler.guid || (handleObj.handler.guid = handler.guid)), + selector ? handlers.splice(handlers.delegateCount++, 0, handleObj) : handlers.push(handleObj), + (jQuery.event.global[type] = !0)) + }, + remove: function (elem, types, handler, selector, mappedTypes) { + var j, + origCount, + tmp, + events, + t, + handleObj, + special, + handlers, + type, + namespaces, + origType, + elemData = dataPriv.hasData(elem) && dataPriv.get(elem) + if (elemData && (events = elemData.events)) { + for (t = (types = (types || '').match(rnotwhite) || ['']).length; t--; ) + if ( + ((type = origType = (tmp = rtypenamespace.exec(types[t]) || [])[1]), + (namespaces = (tmp[2] || '').split('.').sort()), + type) + ) { + for ( + special = jQuery.event.special[type] || {}, + handlers = events[(type = (selector ? special.delegateType : special.bindType) || type)] || [], + tmp = tmp[2] && new RegExp('(^|\\.)' + namespaces.join('\\.(?:.*\\.|)') + '(\\.|$)'), + origCount = j = handlers.length; + j--; + + ) + (handleObj = handlers[j]), + (!mappedTypes && origType !== handleObj.origType) || + (handler && handler.guid !== handleObj.guid) || + (tmp && !tmp.test(handleObj.namespace)) || + (selector && selector !== handleObj.selector && ('**' !== selector || !handleObj.selector)) || + (handlers.splice(j, 1), + handleObj.selector && handlers.delegateCount--, + special.remove && special.remove.call(elem, handleObj)) + origCount && + !handlers.length && + ((special.teardown && !1 !== special.teardown.call(elem, namespaces, elemData.handle)) || + jQuery.removeEvent(elem, type, elemData.handle), + delete events[type]) + } else for (type in events) jQuery.event.remove(elem, type + types[t], handler, selector, !0) + jQuery.isEmptyObject(events) && dataPriv.remove(elem, 'handle events') + } + }, + dispatch: function (event) { + event = jQuery.event.fix(event) + var i, + j, + ret, + matched, + handleObj, + handlerQueue, + args = slice.call(arguments), + handlers = (dataPriv.get(this, 'events') || {})[event.type] || [], + special = jQuery.event.special[event.type] || {} + if ( + ((args[0] = event), + (event.delegateTarget = this), + !special.preDispatch || !1 !== special.preDispatch.call(this, event)) + ) { + for ( + handlerQueue = jQuery.event.handlers.call(this, event, handlers), i = 0; + (matched = handlerQueue[i++]) && !event.isPropagationStopped(); + + ) + for ( + event.currentTarget = matched.elem, j = 0; + (handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped(); + + ) + (event.rnamespace && !event.rnamespace.test(handleObj.namespace)) || + ((event.handleObj = handleObj), + (event.data = handleObj.data), + void 0 !== + (ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler).apply( + matched.elem, + args + )) && + !1 === (event.result = ret) && + (event.preventDefault(), event.stopPropagation())) + return special.postDispatch && special.postDispatch.call(this, event), event.result + } + }, + handlers: function (event, handlers) { + var i, + matches, + sel, + handleObj, + handlerQueue = [], + delegateCount = handlers.delegateCount, + cur = event.target + if (delegateCount && cur.nodeType && ('click' !== event.type || isNaN(event.button) || event.button < 1)) + for (; cur !== this; cur = cur.parentNode || this) + if (1 === cur.nodeType && (!0 !== cur.disabled || 'click' !== event.type)) { + for (matches = [], i = 0; i < delegateCount; i++) + void 0 === matches[(sel = (handleObj = handlers[i]).selector + ' ')] && + (matches[sel] = handleObj.needsContext + ? jQuery(sel, this).index(cur) > -1 + : jQuery.find(sel, this, null, [cur]).length), + matches[sel] && matches.push(handleObj) + 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 detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which'.split( + ' ' + ), + fixHooks: {}, + keyHooks: { + props: 'char charCode key keyCode'.split(' '), + 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(' '), + filter: function (event, original) { + var eventDoc, + doc, + body, + button = original.button + return ( + null == event.pageX && + null != original.clientX && + ((doc = (eventDoc = event.target.ownerDocument || document).documentElement), + (body = eventDoc.body), + (event.pageX = + original.clientX + + ((doc && doc.scrollLeft) || (body && body.scrollLeft) || 0) - + ((doc && doc.clientLeft) || (body && body.clientLeft) || 0)), + (event.pageY = + original.clientY + + ((doc && doc.scrollTop) || (body && body.scrollTop) || 0) - + ((doc && doc.clientTop) || (body && body.clientTop) || 0))), + event.which || + void 0 === button || + (event.which = 1 & button ? 1 : 2 & button ? 3 : 4 & button ? 2 : 0), + event + ) + } + }, + fix: function (event) { + if (event[jQuery.expando]) return event + var i, + prop, + copy, + type = event.type, + originalEvent = event, + fixHook = this.fixHooks[type] + for ( + fixHook || + (this.fixHooks[type] = fixHook = rmouseEvent.test(type) + ? this.mouseHooks + : rkeyEvent.test(type) + ? this.keyHooks + : {}), + copy = fixHook.props ? this.props.concat(fixHook.props) : this.props, + event = new jQuery.Event(originalEvent), + i = copy.length; + i--; + + ) + event[(prop = copy[i])] = originalEvent[prop] + return ( + event.target || (event.target = document), + 3 === event.target.nodeType && (event.target = event.target.parentNode), + fixHook.filter ? fixHook.filter(event, originalEvent) : event + ) + }, + special: { + load: { noBubble: !0 }, + focus: { + trigger: function () { + if (this !== safeActiveElement() && this.focus) return this.focus(), !1 + }, + delegateType: 'focusin' + }, + blur: { + trigger: function () { + if (this === safeActiveElement() && this.blur) return this.blur(), !1 + }, + delegateType: 'focusout' + }, + click: { + trigger: function () { + if ('checkbox' === this.type && this.click && jQuery.nodeName(this, 'input')) return this.click(), !1 + }, + _default: function (event) { + return jQuery.nodeName(event.target, 'a') + } + }, + beforeunload: { + postDispatch: function (event) { + void 0 !== event.result && event.originalEvent && (event.originalEvent.returnValue = event.result) + } + } + } + }), + (jQuery.removeEvent = function (elem, type, handle) { + elem.removeEventListener && elem.removeEventListener(type, handle) + }), + (jQuery.Event = function (src, props) { + if (!(this instanceof jQuery.Event)) return new jQuery.Event(src, props) + src && src.type + ? ((this.originalEvent = src), + (this.type = src.type), + (this.isDefaultPrevented = + src.defaultPrevented || (void 0 === src.defaultPrevented && !1 === src.returnValue) + ? returnTrue + : returnFalse)) + : (this.type = src), + props && jQuery.extend(this, props), + (this.timeStamp = (src && src.timeStamp) || jQuery.now()), + (this[jQuery.expando] = !0) + }), + (jQuery.Event.prototype = { + constructor: jQuery.Event, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse, + isSimulated: !1, + preventDefault: function () { + var e = this.originalEvent + ;(this.isDefaultPrevented = returnTrue), e && !this.isSimulated && e.preventDefault() + }, + stopPropagation: function () { + var e = this.originalEvent + ;(this.isPropagationStopped = returnTrue), e && !this.isSimulated && e.stopPropagation() + }, + stopImmediatePropagation: function () { + var e = this.originalEvent + ;(this.isImmediatePropagationStopped = returnTrue), + e && !this.isSimulated && 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, + handle: function (event) { + var ret, + related = event.relatedTarget, + handleObj = event.handleObj + return ( + (related && (related === this || jQuery.contains(this, related))) || + ((event.type = handleObj.origType), + (ret = handleObj.handler.apply(this, arguments)), + (event.type = fix)), + ret + ) + } + } + } + ), + jQuery.fn.extend({ + on: function (types, selector, data, fn) { + return on(this, types, selector, data, fn) + }, + one: function (types, selector, data, fn) { + return on(this, types, selector, data, fn, 1) + }, + off: function (types, selector, fn) { + var handleObj, 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 ( + (!1 !== selector && 'function' != typeof selector) || ((fn = selector), (selector = void 0)), + !1 === fn && (fn = returnFalse), + this.each(function () { + jQuery.event.remove(this, types, fn, selector) + }) + ) + } + }) + var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi, + rnoInnerhtml = /\s*$/g + 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 + } + function disableScript (elem) { + return (elem.type = (null !== elem.getAttribute('type')) + '/' + elem.type), elem + } + function restoreScript (elem) { + var match = rscriptTypeMasked.exec(elem.type) + return match ? (elem.type = match[1]) : elem.removeAttribute('type'), elem + } + function cloneCopyEvent (src, dest) { + var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events + if (1 === dest.nodeType) { + if ( + dataPriv.hasData(src) && + ((pdataOld = dataPriv.access(src)), + (pdataCur = dataPriv.set(dest, pdataOld)), + (events = pdataOld.events)) + ) + for (type in (delete pdataCur.handle, (pdataCur.events = {}), events)) + for (i = 0, l = events[type].length; i < l; i++) jQuery.event.add(dest, type, events[type][i]) + dataUser.hasData(src) && + ((udataOld = dataUser.access(src)), + (udataCur = jQuery.extend({}, udataOld)), + dataUser.set(dest, udataCur)) + } + } + function domManip (collection, args, callback, ignored) { + args = concat.apply([], args) + var fragment, + first, + scripts, + hasScripts, + node, + doc, + i = 0, + l = collection.length, + iNoClone = l - 1, + value = args[0], + isFunction = jQuery.isFunction(value) + if (isFunction || (l > 1 && 'string' == typeof value && !support.checkClone && rchecked.test(value))) + return collection.each(function (index) { + var self = collection.eq(index) + isFunction && (args[0] = value.call(this, index, self.html())), domManip(self, args, callback, ignored) + }) + if ( + l && + ((first = (fragment = buildFragment(args, collection[0].ownerDocument, !1, collection, ignored)) + .firstChild), + 1 === fragment.childNodes.length && (fragment = first), + first || ignored) + ) { + for (hasScripts = (scripts = jQuery.map(getAll(fragment, 'script'), disableScript)).length; i < l; i++) + (node = fragment), + i !== iNoClone && + ((node = jQuery.clone(node, !0, !0)), hasScripts && jQuery.merge(scripts, getAll(node, 'script'))), + callback.call(collection[i], node, i) + if (hasScripts) + for ( + doc = scripts[scripts.length - 1].ownerDocument, jQuery.map(scripts, restoreScript), i = 0; + i < hasScripts; + i++ + ) + (node = scripts[i]), + rscriptType.test(node.type || '') && + !dataPriv.access(node, 'globalEval') && + jQuery.contains(doc, node) && + (node.src + ? jQuery._evalUrl && jQuery._evalUrl(node.src) + : jQuery.globalEval(node.textContent.replace(rcleanScript, ''))) + } + return collection + } + function remove (elem, selector, keepData) { + for ( + var node, nodes = selector ? jQuery.filter(selector, elem) : elem, i = 0; + null != (node = nodes[i]); + i++ + ) + keepData || 1 !== node.nodeType || jQuery.cleanData(getAll(node)), + node.parentNode && + (keepData && jQuery.contains(node.ownerDocument, node) && setGlobalEval(getAll(node, 'script')), + node.parentNode.removeChild(node)) + return elem + } + jQuery.extend({ + htmlPrefilter: function (html) { + return html.replace(rxhtmlTag, '<$1>') + }, + clone: function (elem, dataAndEvents, deepDataAndEvents) { + var i, + l, + srcElements, + destElements, + src, + dest, + nodeName, + clone = elem.cloneNode(!0), + inPage = jQuery.contains(elem.ownerDocument, elem) + if (!(support.noCloneChecked || (1 !== elem.nodeType && 11 !== elem.nodeType) || jQuery.isXMLDoc(elem))) + for (destElements = getAll(clone), i = 0, l = (srcElements = getAll(elem)).length; i < l; i++) + (src = srcElements[i]), + (dest = destElements[i]), + (nodeName = void 0), + 'input' === (nodeName = dest.nodeName.toLowerCase()) && rcheckableType.test(src.type) + ? (dest.checked = src.checked) + : ('input' !== nodeName && 'textarea' !== nodeName) || (dest.defaultValue = src.defaultValue) + if (dataAndEvents) + if (deepDataAndEvents) + for ( + srcElements = srcElements || getAll(elem), + destElements = destElements || getAll(clone), + i = 0, + l = srcElements.length; + i < l; + i++ + ) + cloneCopyEvent(srcElements[i], destElements[i]) + else cloneCopyEvent(elem, clone) + return ( + (destElements = getAll(clone, 'script')).length > 0 && + setGlobalEval(destElements, !inPage && getAll(elem, 'script')), + clone + ) + }, + cleanData: function (elems) { + for (var data, elem, type, special = jQuery.event.special, i = 0; void 0 !== (elem = elems[i]); i++) + if (acceptData(elem)) { + if ((data = elem[dataPriv.expando])) { + if (data.events) + for (type in data.events) + special[type] ? jQuery.event.remove(elem, type) : jQuery.removeEvent(elem, type, data.handle) + elem[dataPriv.expando] = void 0 + } + elem[dataUser.expando] && (elem[dataUser.expando] = void 0) + } + } + }), + jQuery.fn.extend({ + domManip, + detach: function (selector) { + return remove(this, selector, !0) + }, + remove: function (selector) { + return remove(this, selector) + }, + text: function (value) { + return access( + this, + function (value) { + return void 0 === value + ? jQuery.text(this) + : this.empty().each(function () { + ;(1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType) || + (this.textContent = value) + }) + }, + null, + value, + arguments.length + ) + }, + append: function () { + return domManip(this, arguments, function (elem) { + ;(1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType) || + manipulationTarget(this, elem).appendChild(elem) + }) + }, + prepend: function () { + return domManip(this, arguments, function (elem) { + if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { + var target = manipulationTarget(this, elem) + target.insertBefore(elem, target.firstChild) + } + }) + }, + before: function () { + return domManip(this, arguments, function (elem) { + this.parentNode && this.parentNode.insertBefore(elem, this) + }) + }, + after: function () { + return domManip(this, arguments, function (elem) { + this.parentNode && this.parentNode.insertBefore(elem, this.nextSibling) + }) + }, + empty: function () { + for (var elem, i = 0; null != (elem = this[i]); i++) + 1 === elem.nodeType && (jQuery.cleanData(getAll(elem, !1)), (elem.textContent = '')) + return this + }, + clone: function (dataAndEvents, deepDataAndEvents) { + return ( + (dataAndEvents = null != dataAndEvents && dataAndEvents), + (deepDataAndEvents = null == deepDataAndEvents ? dataAndEvents : deepDataAndEvents), + this.map(function () { + return jQuery.clone(this, dataAndEvents, deepDataAndEvents) + }) + ) + }, + html: function (value) { + return access( + this, + function (value) { + var elem = this[0] || {}, + i = 0, + l = this.length + if (void 0 === value && 1 === elem.nodeType) return elem.innerHTML + if ( + 'string' == typeof value && + !rnoInnerhtml.test(value) && + !wrapMap[(rtagName.exec(value) || ['', ''])[1].toLowerCase()] + ) { + value = jQuery.htmlPrefilter(value) + try { + for (; i < l; i++) + 1 === (elem = this[i] || {}).nodeType && + (jQuery.cleanData(getAll(elem, !1)), (elem.innerHTML = value)) + elem = 0 + } catch (e) {} + } + elem && this.empty().append(value) + }, + null, + value, + arguments.length + ) + }, + replaceWith: function () { + var ignored = [] + return domManip( + this, + arguments, + function (elem) { + var parent = this.parentNode + jQuery.inArray(this, ignored) < 0 && + (jQuery.cleanData(getAll(this)), parent && parent.replaceChild(elem, this)) + }, + ignored + ) + } + }), + jQuery.each( + { + appendTo: 'append', + prependTo: 'prepend', + insertBefore: 'before', + insertAfter: 'after', + replaceAll: 'replaceWith' + }, + function (name, original) { + jQuery.fn[name] = function (selector) { + for (var elems, ret = [], insert = jQuery(selector), last = insert.length - 1, i = 0; i <= last; i++) + (elems = i === last ? this : this.clone(!0)), + jQuery(insert[i])[original](elems), + push.apply(ret, elems.get()) + return this.pushStack(ret) + } + } + ) + var iframe, + elemdisplay = { HTML: 'block', BODY: 'block' } + function actualDisplay (name, doc) { + var elem = jQuery(doc.createElement(name)).appendTo(doc.body), + display = jQuery.css(elem[0], 'display') + return elem.detach(), display + } + function defaultDisplay (nodeName) { + var doc = document, + display = elemdisplay[nodeName] + return ( + display || + (('none' !== (display = actualDisplay(nodeName, doc)) && display) || + ((doc = (iframe = (iframe || jQuery("' + )), + this.preview.append(this.iframe), + this.iframe[0].contentWindow.document.open(), + this.iframe[0].contentWindow.document.close(), + (this.preview.container = UI.$(this.iframe[0].contentWindow.document).find('body')), + 'string' == typeof this.options.iframe && + this.preview.container + .parent() + .append('')) + : (this.preview.container = this.preview), + UI.$win.on( + 'resize load', + UI.Utils.debounce(function () { + $this.fit() + }, 200) + ) + var previewContainer = this.iframe ? this.preview.container : $this.preview.parent(), + codeContent = this.code.find('.CodeMirror-sizer'), + codeScroll = this.code.find('.CodeMirror-scroll').on( + 'scroll', + UI.Utils.debounce(function () { + if ('tab' != $this.htmleditor.attr('data-mode')) { + var codeHeight = codeContent.height() - codeScroll.height(), + ratio = + (previewContainer[0].scrollHeight - + ($this.iframe ? $this.iframe.height() : previewContainer.height())) / + codeHeight, + previewPosition = codeScroll.scrollTop() * ratio + previewContainer.scrollTop(previewPosition) + } + }, 10) + ) + this.htmleditor.on('click', '.uk-htmleditor-button-code, .uk-htmleditor-button-preview', function ( + e + ) { + e.preventDefault(), + 'tab' == $this.htmleditor.attr('data-mode') && + ($this.htmleditor + .find('.uk-htmleditor-button-code, .uk-htmleditor-button-preview') + .removeClass('uk-active') + .filter(this) + .addClass('uk-active'), + ($this.activetab = UI.$(this).hasClass('uk-htmleditor-button-code') ? 'code' : 'preview'), + $this.htmleditor.attr('data-active-tab', $this.activetab), + $this.editor.refresh()) + }), + this.htmleditor.on('click', 'a[data-htmleditor-button]', function () { + $this.code.is(':visible') && + $this.trigger('action.' + UI.$(this).data('htmleditor-button'), [$this.editor]) + }), + this.preview.parent().css('height', this.code.height()), + this.options.autocomplete && + this.CodeMirror.showHint && + this.CodeMirror.hint && + this.CodeMirror.hint.html && + this.editor.on( + 'inputRead', + UI.Utils.debounce(function () { + var POS = $this.editor.getDoc().getCursor() + if ( + 'xml' == + $this.CodeMirror.innerMode($this.editor.getMode(), $this.editor.getTokenAt(POS).state).mode + .name + ) { + var cur = $this.editor.getCursor(), + token = $this.editor.getTokenAt(cur) + ;('<' != token.string.charAt(0) && 'attribute' != token.type) || + $this.CodeMirror.showHint($this.editor, $this.CodeMirror.hint.html, { + completeSingle: !1 + }) + } + }, 100) + ), + (this.debouncedRedraw = UI.Utils.debounce(function () { + $this.redraw() + }, 5)), + this.on('init.uk.component', function () { + $this.debouncedRedraw() + }), + this.element.attr('data-uk-check-display', 1).on( + 'display.uk.check', + function (e) { + this.htmleditor.is(':visible') && this.fit() + }.bind(this) + ), + editors.push(this) + }, + addButton: function (name, button) { + this.buttons[name] = button + }, + addButtons: function (buttons) { + UI.$.extend(this.buttons, buttons) + }, + replaceInPreview: function (regexp, callback) { + var editor = this.editor, + results = [], + value = editor.getValue(), + offset = -1, + index = 0 + function translateOffset (offset) { + var result = editor + .getValue() + .substring(0, offset) + .split('\n') + return { line: result.length - 1, ch: result[result.length - 1].length } + } + return ( + (this.currentvalue = this.currentvalue.replace(regexp, function () { + var match = { + matches: arguments, + from: translateOffset((offset = value.indexOf(arguments[0], ++offset))), + to: translateOffset(offset + arguments[0].length), + replace: function (value) { + editor.replaceRange(value, match.from, match.to) + }, + inRange: function (cursor) { + return cursor.line === match.from.line && cursor.line === match.to.line + ? cursor.ch >= match.from.ch && cursor.ch < match.to.ch + : (cursor.line === match.from.line && cursor.ch >= match.from.ch) || + (cursor.line > match.from.line && cursor.line < match.to.line) || + (cursor.line === match.to.line && cursor.ch < match.to.ch) + } + }, + result = callback(match, index) + return result ? (index++, results.push(match), result) : arguments[0] + })), + results + ) + }, + _buildtoolbar: function () { + if (this.options.toolbar && this.options.toolbar.length) { + var $this = this, + bar = [] + this.toolbar.empty(), + this.options.toolbar.forEach(function (button) { + if ($this.buttons[button]) { + var title = $this.buttons[button].title ? $this.buttons[button].title : button + bar.push( + '
  • ' + + $this.buttons[button].label + + '
  • ' + ) + } + }), + this.toolbar.html(bar.join('\n')) + } + }, + fit: function () { + var mode = this.options.mode + 'split' == mode && this.htmleditor.width() < this.options.maxsplitsize && (mode = 'tab'), + 'tab' == mode && + (this.activetab || + ((this.activetab = 'code'), this.htmleditor.attr('data-active-tab', this.activetab)), + this.htmleditor + .find('.uk-htmleditor-button-code, .uk-htmleditor-button-preview') + .removeClass('uk-active') + .filter( + 'code' == this.activetab ? '.uk-htmleditor-button-code' : '.uk-htmleditor-button-preview' + ) + .addClass('uk-active')), + this.editor.refresh(), + this.preview.parent().css('height', this.code.height()), + this.htmleditor.attr('data-mode', mode) + }, + redraw: function () { + this._buildtoolbar(), this.render(), this.fit() + }, + getMode: function () { + return this.editor.getOption('mode') + }, + getCursorMode: function () { + var param = { mode: 'html' } + return this.trigger('cursorMode', [param]), param.mode + }, + render: function () { + if (((this.currentvalue = this.editor.getValue()), !this.currentvalue)) + return this.element.val(''), void this.preview.container.html('') + this.trigger('render', [this]), + this.trigger('renderLate', [this]), + this.preview.container.html(this.currentvalue) + }, + addShortcut: function (name, callback) { + var map = {} + return ( + UI.$.isArray(name) || (name = [name]), + name.forEach(function (key) { + map[key] = callback + }), + this.editor.addKeyMap(map), + map + ) + }, + addShortcutAction: function (action, shortcuts) { + var editor = this + this.addShortcut(shortcuts, function () { + editor.element.trigger('action.' + action, [editor.editor]) + }) + }, + replaceSelection: function (replace) { + var text = this.editor.getSelection() + if (!text.length) { + for ( + var cur = this.editor.getCursor(), + curLine = this.editor.getLine(cur.line), + start = cur.ch, + end = start; + end < curLine.length && /[\w$]+/.test(curLine.charAt(end)); + + ) + ++end + for (; start && /[\w$]+/.test(curLine.charAt(start - 1)); ) --start + var curWord = start != end && curLine.slice(start, end) + curWord && + (this.editor.setSelection({ line: cur.line, ch: start }, { line: cur.line, ch: end }), + (text = curWord)) + } + var html = replace.replace('$1', text) + this.editor.replaceSelection(html, 'end'), this.editor.focus() + }, + replaceLine: function (replace) { + var pos = this.editor.getDoc().getCursor(), + text = this.editor.getLine(pos.line), + html = replace.replace('$1', text) + this.editor.replaceRange(html, { line: pos.line, ch: 0 }, { line: pos.line, ch: text.length }), + this.editor.setCursor({ line: pos.line, ch: html.length }), + this.editor.focus() + }, + save: function () { + this.editor.save() + } + }), + (UI.components.htmleditor.template = [ + '
    ', + '
    ', + '
      ', + '
      ', + '', + '
      ', + '
      ', + '
      ', + '
      ', + '
      ', + '
      ', + '
      ' + ].join('')), + UI.plugin('htmleditor', 'base', { + init: function (editor) { + editor.addButtons({ + fullscreen: { title: 'Fullscreen', label: '' }, + bold: { title: 'Bold', label: '' }, + italic: { title: 'Italic', label: '' }, + strike: { title: 'Strikethrough', label: '' }, + blockquote: { title: 'Blockquote', label: '' }, + link: { title: 'Link', label: '' }, + image: { title: 'Image', label: '' }, + listUl: { title: 'Unordered List', label: '' }, + listOl: { title: 'Ordered List', label: '' } + }), + addAction('bold', '$1'), + addAction('italic', '$1'), + addAction('strike', '$1'), + addAction('blockquote', '

      $1

      ', 'replaceLine'), + addAction('link', '$1'), + addAction('image', '$1') + var listfn = function () { + if ('html' == editor.getCursorMode()) { + for ( + var cm = editor.editor, + pos = cm.getDoc().getCursor(!0), + posend = cm.getDoc().getCursor(!1), + i = pos.line; + i < posend.line + 1; + i++ + ) + cm.replaceRange( + '
    • ' + cm.getLine(i) + '
    • ', + { line: i, ch: 0 }, + { line: i, ch: cm.getLine(i).length } + ) + cm.setCursor({ line: posend.line, ch: cm.getLine(posend.line).length }), cm.focus() + } + } + function addAction (name, replace, mode) { + editor.on('action.' + name, function () { + 'html' == editor.getCursorMode() && + editor['replaceLine' == mode ? 'replaceLine' : 'replaceSelection'](replace) + }) + } + editor.on('action.listUl', function () { + listfn() + }), + editor.on('action.listOl', function () { + listfn() + }), + editor.htmleditor.on('click', 'a[data-htmleditor-button="fullscreen"]', function () { + editor.htmleditor.toggleClass('uk-htmleditor-fullscreen') + var wrap = editor.editor.getWrapperElement() + if (editor.htmleditor.hasClass('uk-htmleditor-fullscreen')) + (editor.editor.state.fullScreenRestore = { + scrollTop: window.pageYOffset, + scrollLeft: window.pageXOffset, + width: wrap.style.width, + height: wrap.style.height + }), + (wrap.style.width = ''), + (wrap.style.height = editor.content.height() + 'px'), + (document.documentElement.style.overflow = 'hidden') + else { + document.documentElement.style.overflow = '' + var info = editor.editor.state.fullScreenRestore + ;(wrap.style.width = info.width), + (wrap.style.height = info.height), + window.scrollTo(info.scrollLeft, info.scrollTop) + } + setTimeout(function () { + editor.fit(), UI.$win.trigger('resize') + }, 50) + }), + editor.addShortcut(['Ctrl-S', 'Cmd-S'], function () { + editor.element.trigger('htmleditor-save', [editor]) + }), + editor.addShortcutAction('bold', ['Ctrl-B', 'Cmd-B']) + } + }), + UI.plugin('htmleditor', 'markdown', { + init: function (editor) { + var parser = editor.options.mdparser || marked || null + function enableMarkdown () { + editor.editor.setOption('mode', 'gfm'), + editor.htmleditor.find('.uk-htmleditor-button-code a').html(editor.options.lblMarkedview) + } + function addAction (name, replace, mode) { + editor.on('action.' + name, function () { + 'markdown' == editor.getCursorMode() && + editor['replaceLine' == mode ? 'replaceLine' : 'replaceSelection'](replace) + }) + } + parser && + (editor.options.markdown && enableMarkdown(), + addAction('bold', '**$1**'), + addAction('italic', '*$1*'), + addAction('strike', '~~$1~~'), + addAction('blockquote', '> $1', 'replaceLine'), + addAction('link', '[$1](http://)'), + addAction('image', '![$1](http://)'), + editor.on('action.listUl', function () { + if ('markdown' == editor.getCursorMode()) { + for ( + var cm = editor.editor, + pos = cm.getDoc().getCursor(!0), + posend = cm.getDoc().getCursor(!1), + i = pos.line; + i < posend.line + 1; + i++ + ) + cm.replaceRange( + '* ' + cm.getLine(i), + { line: i, ch: 0 }, + { line: i, ch: cm.getLine(i).length } + ) + cm.setCursor({ line: posend.line, ch: cm.getLine(posend.line).length }), cm.focus() + } + }), + editor.on('action.listOl', function () { + if ('markdown' == editor.getCursorMode()) { + var matches, + cm = editor.editor, + pos = cm.getDoc().getCursor(!0), + posend = cm.getDoc().getCursor(!1), + prefix = 1 + 0 < pos.line && + (matches = cm.getLine(pos.line - 1).match(/^(\d+)\./)) && + (prefix = Number(matches[1]) + 1) + for (var i = pos.line; i < posend.line + 1; i++) + cm.replaceRange( + prefix + '. ' + cm.getLine(i), + { line: i, ch: 0 }, + { line: i, ch: cm.getLine(i).length } + ), + prefix++ + cm.setCursor({ line: posend.line, ch: cm.getLine(posend.line).length }), cm.focus() + } + }), + editor.on('renderLate', function () { + 'gfm' == editor.editor.options.mode && (editor.currentvalue = parser(editor.currentvalue)) + }), + editor.on('cursorMode', function (e, param) { + if ('gfm' == editor.editor.options.mode) { + var pos = editor.editor.getDoc().getCursor() + editor.editor.getTokenAt(pos).state.base.htmlState || (param.mode = 'markdown') + } + }), + UI.$.extend(editor, { + enableMarkdown: function () { + enableMarkdown(), this.render() + }, + disableMarkdown: function () { + this.editor.setOption('mode', 'htmlmixed'), + this.htmleditor.find('.uk-htmleditor-button-code a').html(this.options.lblCodeview), + this.render() + } + }), + editor.on({ + enableMarkdown: function () { + editor.enableMarkdown() + }, + disableMarkdown: function () { + editor.disableMarkdown() + } + })) + } + }), + UI.htmleditor + ) + }), + (function (addon) { + var component + window.UIkit && (component = addon(UIkit)), + void 0 === + (__WEBPACK_AMD_DEFINE_RESULT__ = function () { + return component || addon(UIkit) + }.apply(exports, [__WEBPACK_LOCAL_MODULE_0__])) || (module.exports = __WEBPACK_AMD_DEFINE_RESULT__) + })(function (UI) { + 'use strict' + var modal, + cache = {} + return ( + UI.component('lightbox', { + defaults: { group: !1, duration: 400, keyboard: !0 }, + index: 0, + items: !1, + boot: function () { + UI.$html.on('click', '[data-uk-lightbox]', function (e) { + e.preventDefault() + var link = UI.$(this) + link.data('lightbox') || UI.lightbox(link, UI.Utils.options(link.attr('data-uk-lightbox'))), + link.data('lightbox').show(link) + }), + UI.$doc.on('keyup', function (e) { + if (modal && modal.is(':visible') && modal.lightbox.options.keyboard) + switch ((e.preventDefault(), e.keyCode)) { + case 37: + modal.lightbox.previous() + break + case 39: + modal.lightbox.next() + } + }) + }, + init: function () { + var siblings = [] + if (((this.index = 0), (this.siblings = []), this.element && this.element.length)) { + var domSiblings = this.options.group + ? UI.$( + [ + '[data-uk-lightbox*="' + this.options.group + '"]', + "[data-uk-lightbox*='" + this.options.group + "']" + ].join(',') + ) + : this.element + domSiblings.each(function () { + var ele = UI.$(this) + siblings.push({ + source: ele.attr('href'), + title: ele.attr('data-title') || ele.attr('title'), + type: ele.attr('data-lightbox-type') || 'auto', + link: ele + }) + }), + (this.index = domSiblings.index(this.element)), + (this.siblings = siblings) + } else this.options.group && this.options.group.length && (this.siblings = this.options.group) + this.trigger('lightbox-init', [this]) + }, + show: function (index) { + ;(this.modal = (function (lightbox) { + return modal + ? ((modal.lightbox = lightbox), modal) + : (((modal = UI.$( + [ + '
      ', + '
      ', + '', + '
      ', + '
      ', + '
      ', + '
      ' + ].join('') + ).appendTo('body')).dialog = modal.find('.uk-modal-dialog:first')), + (modal.content = modal.find('.uk-lightbox-content:first')), + (modal.loader = modal.find('.uk-modal-spinner:first')), + (modal.closer = modal.find('.uk-close.uk-close-alt')), + (modal.modal = UI.modal(modal, { modal: !1 })), + modal + .on('swipeRight swipeLeft', function (e) { + modal.lightbox['swipeLeft' == e.type ? 'next' : 'previous']() + }) + .on('click', '[data-lightbox-previous], [data-lightbox-next]', function (e) { + e.preventDefault(), + modal.lightbox[UI.$(this).is('[data-lightbox-next]') ? 'next' : 'previous']() + }), + modal.on('hide.uk.modal', function (e) { + modal.content.html('') + }), + UI.$win.on( + 'load resize orientationchange', + UI.Utils.debounce( + function (e) { + modal.is(':visible') && !UI.Utils.isFullscreen() && modal.lightbox.fitSize() + }.bind(this), + 100 + ) + ), + (modal.lightbox = lightbox), + modal) + })(this)), + this.modal.dialog.stop(), + this.modal.content.stop() + var data, + item, + $this = this, + promise = UI.$.Deferred() + 'object' == typeof (index = index || 0) && + this.siblings.forEach(function (s, idx) { + index[0] === s.link[0] && (index = idx) + }), + index < 0 ? (index = this.siblings.length - index) : this.siblings[index] || (index = 0), + (item = this.siblings[index]), + (data = { + lightbox: $this, + source: item.source, + type: item.type, + index, + promise, + title: item.title, + item, + meta: { content: '', width: null, height: null } + }), + (this.index = index), + this.modal.content.empty(), + this.modal.is(':visible') || + (this.modal.content.css({ width: '', height: '' }).empty(), this.modal.modal.show()), + this.modal.loader.removeClass('uk-hidden'), + promise + .promise() + .done(function () { + ;($this.data = data), $this.fitSize(data) + }) + .fail(function () { + ;(data.meta.content = + '
      Loading resource failed!
      '), + (data.meta.width = 400), + (data.meta.height = 300), + ($this.data = data), + $this.fitSize(data) + }), + $this.trigger('showitem.uk.lightbox', [data]) + }, + fitSize: function () { + var $this = this, + data = this.data, + pad = this.modal.dialog.outerWidth() - this.modal.dialog.width(), + dpad = + parseInt(this.modal.dialog.css('margin-top'), 10) + + parseInt(this.modal.dialog.css('margin-bottom'), 10), + content = data.meta.content, + duration = $this.options.duration + 1 < this.siblings.length && + (content = [ + content, + '', + '' + ].join('')) + var maxwidth, + maxheight, + tmp = UI.$('
       
      ').css({ + opacity: 0, + position: 'absolute', + top: 0, + left: 0, + width: '100%', + 'max-width': $this.modal.dialog.css('max-width'), + padding: $this.modal.dialog.css('padding'), + margin: $this.modal.dialog.css('margin') + }), + w = data.meta.width, + h = data.meta.height + tmp.appendTo('body').width(), + (maxwidth = tmp.width()), + (maxheight = window.innerHeight - dpad), + tmp.remove(), + this.modal.dialog.find('.uk-modal-caption').remove(), + data.title && + (this.modal.dialog.append('
      ' + data.title + '
      '), + (maxheight -= this.modal.dialog.find('.uk-modal-caption').outerHeight())), + maxwidth < data.meta.width && ((h = Math.floor(h * (maxwidth / w))), (w = maxwidth)), + maxheight < h && + ((h = Math.floor(maxheight)), (w = Math.ceil(data.meta.width * (maxheight / data.meta.height)))), + this.modal.content + .css('opacity', 0) + .width(w) + .html(content), + 'iframe' == data.type && this.modal.content.find('iframe:first').height(h) + var dh = h + pad, + t = Math.floor(window.innerHeight / 2 - dh / 2) - dpad + t < 0 && (t = 0), + this.modal.closer.addClass('uk-hidden'), + $this.modal.data('mwidth') == w && $this.modal.data('mheight') == h && (duration = 0), + this.modal.dialog.animate( + { width: w + pad, height: h + pad, top: t }, + duration, + 'swing', + function () { + $this.modal.loader.addClass('uk-hidden'), + $this.modal.content.css({ width: '' }).animate({ opacity: 1 }, function () { + $this.modal.closer.removeClass('uk-hidden') + }), + $this.modal.data({ mwidth: w, mheight: h }) + } + ) + }, + next: function () { + this.show(this.siblings[this.index + 1] ? this.index + 1 : 0) + }, + previous: function () { + this.show(this.siblings[this.index - 1] ? this.index - 1 : this.siblings.length - 1) + } + }), + UI.plugin('lightbox', 'image', { + init: function (lightbox) { + lightbox.on('showitem.uk.lightbox', function (e, data) { + if ('image' == data.type || (data.source && data.source.match(/\.(jpg|jpeg|png|gif|svg)$/i))) { + var resolve = function (source, width, height) { + ;(data.meta = { + content: + '', + width, + height + }), + (data.type = 'image'), + data.promise.resolve() + } + if (cache[data.source]) resolve(data.source, cache[data.source].width, cache[data.source].height) + else { + var img = new Image() + ;(img.onerror = function () { + data.promise.reject('Loading image failed') + }), + (img.onload = function () { + ;(cache[data.source] = { width: img.width, height: img.height }), + resolve(data.source, cache[data.source].width, cache[data.source].height) + }), + (img.src = data.source) + } + } + }) + } + }), + UI.plugin('lightbox', 'youtube', { + init: function (lightbox) { + var youtubeRegExp = /(\/\/.*?youtube\.[a-z]+)\/watch\?v=([^&]+)&?(.*)/, + youtubeRegExpShort = /youtu\.be\/(.*)/ + lightbox.on('showitem.uk.lightbox', function (e, data) { + var id, + matches, + resolve = function (id, width, height) { + ;(data.meta = { + content: + '', + width, + height + }), + (data.type = 'iframe'), + data.promise.resolve() + } + if ( + ((matches = data.source.match(youtubeRegExp)) && (id = matches[2]), + (matches = data.source.match(youtubeRegExpShort)) && (id = matches[1]), + id) + ) { + if (cache[id]) resolve(id, cache[id].width, cache[id].height) + else { + var img = new Image(), + lowres = !1 + ;(img.onerror = function () { + ;(cache[id] = { width: 640, height: 320 }), resolve(id, cache[id].width, cache[id].height) + }), + (img.onload = function () { + 120 == img.width && 90 == img.height + ? lowres + ? ((cache[id] = { width: 640, height: 320 }), + resolve(id, cache[id].width, cache[id].height)) + : ((lowres = !0), (img.src = '//img.youtube.com/vi/' + id + '/0.jpg')) + : ((cache[id] = { width: img.width, height: img.height }), + resolve(id, img.width, img.height)) + }), + (img.src = '//img.youtube.com/vi/' + id + '/maxresdefault.jpg') + } + e.stopImmediatePropagation() + } + }) + } + }), + UI.plugin('lightbox', 'vimeo', { + init: function (lightbox) { + var matches, + regex = /(\/\/.*?)vimeo\.[a-z]+\/([0-9]+).*?/ + lightbox.on('showitem.uk.lightbox', function (e, data) { + var id, + resolve = function (id, width, height) { + ;(data.meta = { + content: + '', + width, + height + }), + (data.type = 'iframe'), + data.promise.resolve() + } + ;(matches = data.source.match(regex)) && + ((id = matches[2]), + cache[id] + ? resolve(id, cache[id].width, cache[id].height) + : UI.$.ajax({ + type: 'GET', + url: 'http://vimeo.com/api/oembed.json?url=' + encodeURI(data.source), + jsonp: 'callback', + dataType: 'jsonp', + success: function (data) { + ;(cache[id] = { width: data.width, height: data.height }), + resolve(id, cache[id].width, cache[id].height) + } + }), + e.stopImmediatePropagation()) + }) + } + }), + UI.plugin('lightbox', 'video', { + init: function (lightbox) { + lightbox.on('showitem.uk.lightbox', function (e, data) { + var resolve = function (source, width, height) { + ;(data.meta = { + content: + '', + width, + height + }), + (data.type = 'video'), + data.promise.resolve() + } + if ('video' == data.type || data.source.match(/\.(mp4|webm|ogv)$/i)) + if (cache[data.source]) resolve(data.source, cache[data.source].width, cache[data.source].height) + else + var vid = UI.$('') + .attr('src', data.source) + .appendTo('body'), + idle = setInterval(function () { + vid[0].videoWidth && + (clearInterval(idle), + (cache[data.source] = { width: vid[0].videoWidth, height: vid[0].videoHeight }), + resolve(data.source, cache[data.source].width, cache[data.source].height), + vid.remove()) + }, 20) + }) + } + }), + (UI.lightbox.create = function (items, options) { + if (items) { + var group = [] + return ( + items.forEach(function (item) { + group.push( + UI.$.extend( + { source: '', title: '', type: 'auto', link: !1 }, + 'string' == typeof item ? { source: item } : item + ) + ) + }), + UI.lightbox(UI.$.extend({}, options, { group })) + ) + } + }), + UI.lightbox + ) + }), + (function (addon) { + var component + window.UIkit && (component = addon(UIkit)), + void 0 === + (__WEBPACK_AMD_DEFINE_RESULT__ = function () { + return component || addon(UIkit) + }.apply(exports, [__WEBPACK_LOCAL_MODULE_0__])) || (module.exports = __WEBPACK_AMD_DEFINE_RESULT__) + })(function (UI) { + 'use strict' + var draggingElement, + hasTouch = 'ontouchstart' in window, + html = UI.$html, + touchedlists = [], + $win = UI.$win, + eStart = hasTouch ? 'touchstart' : 'mousedown', + eMove = hasTouch ? 'touchmove' : 'mousemove', + eEnd = hasTouch ? 'touchend' : 'mouseup', + eCancel = hasTouch ? 'touchcancel' : 'mouseup' + return ( + UI.component('nestable', { + defaults: { + listBaseClass: 'uk-nestable', + listClass: 'uk-nestable-list', + listItemClass: 'uk-nestable-item', + dragClass: 'uk-nestable-dragged', + movingClass: 'uk-nestable-moving', + noChildrenClass: 'uk-nestable-nochildren', + emptyClass: 'uk-nestable-empty', + handleClass: '', + collapsedClass: 'uk-collapsed', + placeholderClass: 'uk-nestable-placeholder', + noDragClass: 'uk-nestable-nodrag', + group: !1, + maxDepth: 10, + threshold: 20, + idlethreshold: 10 + }, + boot: function () { + UI.$html.on('mousemove touchmove', function (e) { + if (draggingElement) { + var top = draggingElement.offset().top + top < UI.$win.scrollTop() + ? UI.$win.scrollTop(UI.$win.scrollTop() - Math.ceil(draggingElement.height() / 2)) + : top + draggingElement.height() > window.innerHeight + UI.$win.scrollTop() && + UI.$win.scrollTop(UI.$win.scrollTop() + Math.ceil(draggingElement.height() / 2)) + } + }), + UI.ready(function (context) { + UI.$('[data-uk-nestable]', context).each(function () { + var ele = UI.$(this) + ele.data('nestable') || UI.nestable(ele, UI.Utils.options(ele.attr('data-uk-nestable'))) + }) + }) + }, + init: function () { + var $this = this + Object.keys(this.options).forEach(function (key) { + ;-1 != String(key).indexOf('Class') && ($this.options['_' + key] = '.' + $this.options[key]) + }), + this.find(this.options._listItemClass) + .find('>ul') + .addClass(this.options.listClass), + this.checkEmptyList(), + this.reset(), + this.element.data('nestable-group', this.options.group || UI.Utils.uid('nestable-group')), + this.find(this.options._listItemClass).each(function () { + $this.setParent(UI.$(this)) + }), + this.on('click', '[data-nestable-action]', function (e) { + if (!$this.dragEl && (hasTouch || 0 === e.button)) { + e.preventDefault() + var target = UI.$(e.currentTarget), + action = target.data('nestableAction'), + item = target.closest($this.options._listItemClass) + 'collapse' === action && $this.collapseItem(item), + 'expand' === action && $this.expandItem(item), + 'toggle' === action && $this.toggleItem(item) + } + }) + var onStartEvent = function (e) { + var handle = UI.$(e.target) + e.target !== $this.element[0] && + (handle.is($this.options._noDragClass) || + handle.closest($this.options._noDragClass).length || + handle.is('[data-nestable-action]') || + handle.closest('[data-nestable-action]').length || + ($this.options.handleClass && + !handle.hasClass($this.options.handleClass) && + $this.options.handleClass && + (handle = handle.closest($this.options._handleClass)), + !handle.length || + $this.dragEl || + (!hasTouch && 0 !== e.button) || + (hasTouch && 1 !== e.touches.length) || + (e.originalEvent && e.originalEvent.touches && (e = evt.originalEvent.touches[0]), + ($this.delayMove = function (evt) { + evt.preventDefault(), + $this.dragStart(e), + $this.trigger('start.uk.nestable', [$this]), + ($this.delayMove = !1) + }), + ($this.delayMove.x = parseInt(e.pageX, 10)), + ($this.delayMove.y = parseInt(e.pageY, 10)), + ($this.delayMove.threshold = $this.options.idlethreshold), + e.preventDefault()))) + }, + onMoveEvent = function (e) { + e.originalEvent && e.originalEvent.touches && (e = e.originalEvent.touches[0]), + $this.delayMove && + (Math.abs(e.pageX - $this.delayMove.x) > $this.delayMove.threshold || + Math.abs(e.pageY - $this.delayMove.y) > $this.delayMove.threshold) && + (window.getSelection().toString() ? ($this.delayMove = !1) : $this.delayMove(e)), + $this.dragEl && + (e.preventDefault(), $this.dragMove(e), $this.trigger('move.uk.nestable', [$this])) + }, + onEndEvent = function (e) { + $this.dragEl && (e.preventDefault(), $this.dragStop(hasTouch ? e.touches[0] : e)), + (draggingElement = !1), + ($this.delayMove = !1) + } + hasTouch + ? (this.element[0].addEventListener(eStart, onStartEvent, !1), + window.addEventListener(eMove, onMoveEvent, !1), + window.addEventListener(eEnd, onEndEvent, !1), + window.addEventListener(eCancel, onEndEvent, !1)) + : (this.on(eStart, onStartEvent), $win.on(eMove, onMoveEvent), $win.on(eEnd, onEndEvent)) + }, + serialize: function () { + var list = this, + step = function (level, depth) { + var array = [] + return ( + level.children(list.options._listItemClass).each(function () { + for ( + var attribute, + li = UI.$(this), + item = {}, + sub = li.children(list.options._listClass), + i = 0; + i < li[0].attributes.length; + i++ + ) + 0 === (attribute = li[0].attributes[i]).name.indexOf('data-') && + (item[attribute.name.substr(5)] = UI.Utils.str2json(attribute.value)) + sub.length && (item.children = step(sub, depth + 1)), array.push(item) + }), + array + ) + } + return step(list.element, 0) + }, + list: function (options) { + var data = [], + step = function (level, depth, parent) { + level.children(options._listItemClass).each(function (index) { + var li = UI.$(this), + item = UI.$.extend({ parent_id: parent || null, depth, order: index }, li.data()), + sub = li.children(options._listClass) + data.push(item), sub.length && step(sub, depth + 1, li.data(options.idProperty || 'id')) + }) + } + return (options = UI.$.extend({}, this.options, options)), step(this.element, 0), data + }, + reset: function () { + ;(this.mouse = { + offsetX: 0, + offsetY: 0, + startX: 0, + startY: 0, + lastX: 0, + lastY: 0, + nowX: 0, + nowY: 0, + distX: 0, + distY: 0, + dirAx: 0, + dirX: 0, + dirY: 0, + lastDirX: 0, + lastDirY: 0, + distAxX: 0, + distAxY: 0 + }), + (this.moving = !1), + (this.dragEl = null), + (this.dragRootEl = null), + (this.dragDepth = 0), + (this.hasNewRoot = !1), + (this.pointEl = null) + for (var i = 0; i < touchedlists.length; i++) this.checkEmptyList(touchedlists[i]) + touchedlists = [] + }, + toggleItem: function (li) { + this[li.hasClass(this.options.collapsedClass) ? 'expandItem' : 'collapseItem'](li) + }, + expandItem: function (li) { + li.removeClass(this.options.collapsedClass) + }, + collapseItem: function (li) { + li.children(this.options._listClass).length && li.addClass(this.options.collapsedClass) + }, + expandAll: function () { + var list = this + this.find(list.options._listItemClass).each(function () { + list.expandItem(UI.$(this)) + }) + }, + collapseAll: function () { + var list = this + this.find(list.options._listItemClass).each(function () { + list.collapseItem(UI.$(this)) + }) + }, + setParent: function (li) { + li.children(this.options._listClass).length && li.addClass('uk-parent') + }, + unsetParent: function (li) { + li.removeClass('uk-parent ' + this.options.collapsedClass), + li.children(this.options._listClass).remove() + }, + dragStart: function (e) { + var mouse = this.mouse, + dragItem = UI.$(e.target).closest(this.options._listItemClass), + offset = dragItem.offset() + ;(this.placeEl = dragItem), + (mouse.offsetX = e.pageX - offset.left), + (mouse.offsetY = e.pageY - offset.top), + (mouse.startX = mouse.lastX = offset.left), + (mouse.startY = mouse.lastY = offset.top), + (this.dragRootEl = this.element), + (this.dragEl = UI.$('') + .addClass(this.options.listClass + ' ' + this.options.dragClass) + .append(dragItem.clone())), + this.dragEl.css('width', dragItem.width()), + this.placeEl.addClass(this.options.placeholderClass), + (draggingElement = this.dragEl), + (this.tmpDragOnSiblings = [dragItem[0].previousSibling, dragItem[0].nextSibling]), + UI.$body.append(this.dragEl), + this.dragEl.css({ left: offset.left, top: offset.top }) + var i, + depth, + items = this.dragEl.find(this.options._listItemClass) + for (i = 0; i < items.length; i++) + (depth = UI.$(items[i]).parents(this.options._listClass + ',' + this.options._listBaseClass) + .length) > this.dragDepth && (this.dragDepth = depth) + html.addClass(this.options.movingClass) + }, + dragStop: function (e) { + var el = UI.$(this.placeEl), + root = this.placeEl.parents(this.options._listBaseClass + ':first') + this.placeEl.removeClass(this.options.placeholderClass), + this.dragEl.remove(), + this.element[0] !== root[0] + ? (root.trigger('change.uk.nestable', [root.data('nestable'), el, 'added']), + this.element.trigger('change.uk.nestable', [this, el, 'removed'])) + : this.element.trigger('change.uk.nestable', [this, el, 'moved']), + this.trigger('stop.uk.nestable', [this, el]), + this.reset(), + html.removeClass(this.options.movingClass) + }, + dragMove: function (e) { + var list, + parent, + prev, + opt = this.options, + mouse = this.mouse, + maxDepth = this.dragRootEl ? this.dragRootEl.data('nestable').options.maxDepth : opt.maxDepth + this.dragEl.css({ left: e.pageX - mouse.offsetX, top: e.pageY - mouse.offsetY }), + (mouse.lastX = mouse.nowX), + (mouse.lastY = mouse.nowY), + (mouse.nowX = e.pageX), + (mouse.nowY = e.pageY), + (mouse.distX = mouse.nowX - mouse.lastX), + (mouse.distY = mouse.nowY - mouse.lastY), + (mouse.lastDirX = mouse.dirX), + (mouse.lastDirY = mouse.dirY), + (mouse.dirX = 0 === mouse.distX ? 0 : 0 < mouse.distX ? 1 : -1), + (mouse.dirY = 0 === mouse.distY ? 0 : 0 < mouse.distY ? 1 : -1) + var newAx = Math.abs(mouse.distX) > Math.abs(mouse.distY) ? 1 : 0 + if (!mouse.moving) return (mouse.dirAx = newAx), void (mouse.moving = !0) + if ( + (mouse.dirAx !== newAx + ? ((mouse.distAxX = 0), (mouse.distAxY = 0)) + : ((mouse.distAxX += Math.abs(mouse.distX)), + 0 !== mouse.dirX && mouse.dirX !== mouse.lastDirX && (mouse.distAxX = 0), + (mouse.distAxY += Math.abs(mouse.distY)), + 0 !== mouse.dirY && mouse.dirY !== mouse.lastDirY && (mouse.distAxY = 0)), + (mouse.dirAx = newAx), + mouse.dirAx && + mouse.distAxX >= opt.threshold && + ((mouse.distAxX = 0), + (prev = this.placeEl.prev('li')), + 0 < mouse.distX && + prev.length && + !prev.hasClass(opt.collapsedClass) && + !prev.hasClass(opt.noChildrenClass) && + ((list = prev.find(opt._listClass).last()), + this.placeEl.parents(opt._listClass + ',' + opt._listBaseClass).length + this.dragDepth <= + maxDepth && + (list.length + ? (list = prev.children(opt._listClass).last()).append(this.placeEl) + : ((list = UI.$('