\",\n options: {\n classes: {},\n disabled: false,\n // Callbacks\n create: null\n },\n _createWidget: function _createWidget(options, element) {\n element = $(element || this.defaultElement || this)[0];\n this.element = $(element);\n this.uuid = widgetUuid++;\n this.eventNamespace = \".\" + this.widgetName + this.uuid;\n this.bindings = $();\n this.hoverable = $();\n this.focusable = $();\n this.classesElementLookup = {};\n\n if (element !== this) {\n $.data(element, this.widgetFullName, this);\n\n this._on(true, this.element, {\n remove: function remove(event) {\n if (event.target === element) {\n this.destroy();\n }\n }\n });\n\n this.document = $(element.style ? // Element within the document\n element.ownerDocument : // Element is window or document\n element.document || element);\n this.window = $(this.document[0].defaultView || this.document[0].parentWindow);\n }\n\n this.options = $.widget.extend({}, this.options, this._getCreateOptions(), options);\n\n this._create();\n\n if (this.options.disabled) {\n this._setOptionDisabled(this.options.disabled);\n }\n\n this._trigger(\"create\", null, this._getCreateEventData());\n\n this._init();\n },\n _getCreateOptions: function _getCreateOptions() {\n return {};\n },\n _getCreateEventData: $.noop,\n _create: $.noop,\n _init: $.noop,\n destroy: function destroy() {\n var that = this;\n\n this._destroy();\n\n $.each(this.classesElementLookup, function (key, value) {\n that._removeClass(value, key);\n }); // We can probably remove the unbind calls in 2.0\n // all event bindings should go through this._on()\n\n this.element.off(this.eventNamespace).removeData(this.widgetFullName);\n this.widget().off(this.eventNamespace).removeAttr(\"aria-disabled\"); // Clean up events and states\n\n this.bindings.off(this.eventNamespace);\n },\n _destroy: $.noop,\n widget: function widget() {\n return this.element;\n },\n option: function option(key, value) {\n var options = key;\n var parts;\n var curOption;\n var i;\n\n if (arguments.length === 0) {\n // Don't return a reference to the internal hash\n return $.widget.extend({}, this.options);\n }\n\n if (typeof key === \"string\") {\n // Handle nested keys, e.g., \"foo.bar\" => { foo: { bar: ___ } }\n options = {};\n parts = key.split(\".\");\n key = parts.shift();\n\n if (parts.length) {\n curOption = options[key] = $.widget.extend({}, this.options[key]);\n\n for (i = 0; i < parts.length - 1; i++) {\n curOption[parts[i]] = curOption[parts[i]] || {};\n curOption = curOption[parts[i]];\n }\n\n key = parts.pop();\n\n if (arguments.length === 1) {\n return curOption[key] === undefined ? null : curOption[key];\n }\n\n curOption[key] = value;\n } else {\n if (arguments.length === 1) {\n return this.options[key] === undefined ? null : this.options[key];\n }\n\n options[key] = value;\n }\n }\n\n this._setOptions(options);\n\n return this;\n },\n _setOptions: function _setOptions(options) {\n var key;\n\n for (key in options) {\n this._setOption(key, options[key]);\n }\n\n return this;\n },\n _setOption: function _setOption(key, value) {\n if (key === \"classes\") {\n this._setOptionClasses(value);\n }\n\n this.options[key] = value;\n\n if (key === \"disabled\") {\n this._setOptionDisabled(value);\n }\n\n return this;\n },\n _setOptionClasses: function _setOptionClasses(value) {\n var classKey, elements, currentElements;\n\n for (classKey in value) {\n currentElements = this.classesElementLookup[classKey];\n\n if (value[classKey] === this.options.classes[classKey] || !currentElements || !currentElements.length) {\n continue;\n } // We are doing this to create a new jQuery object because the _removeClass() call\n // on the next line is going to destroy the reference to the current elements being\n // tracked. We need to save a copy of this collection so that we can add the new classes\n // below.\n\n\n elements = $(currentElements.get());\n\n this._removeClass(currentElements, classKey); // We don't use _addClass() here, because that uses this.options.classes\n // for generating the string of classes. We want to use the value passed in from\n // _setOption(), this is the new value of the classes option which was passed to\n // _setOption(). We pass this value directly to _classes().\n\n\n elements.addClass(this._classes({\n element: elements,\n keys: classKey,\n classes: value,\n add: true\n }));\n }\n },\n _setOptionDisabled: function _setOptionDisabled(value) {\n this._toggleClass(this.widget(), this.widgetFullName + \"-disabled\", null, !!value); // If the widget is becoming disabled, then nothing is interactive\n\n\n if (value) {\n this._removeClass(this.hoverable, null, \"ui-state-hover\");\n\n this._removeClass(this.focusable, null, \"ui-state-focus\");\n }\n },\n enable: function enable() {\n return this._setOptions({\n disabled: false\n });\n },\n disable: function disable() {\n return this._setOptions({\n disabled: true\n });\n },\n _classes: function _classes(options) {\n var full = [];\n var that = this;\n options = $.extend({\n element: this.element,\n classes: this.options.classes || {}\n }, options);\n\n function processClassString(classes, checkOption) {\n var current, i;\n\n for (i = 0; i < classes.length; i++) {\n current = that.classesElementLookup[classes[i]] || $();\n\n if (options.add) {\n current = $($.unique(current.get().concat(options.element.get())));\n } else {\n current = $(current.not(options.element).get());\n }\n\n that.classesElementLookup[classes[i]] = current;\n full.push(classes[i]);\n\n if (checkOption && options.classes[classes[i]]) {\n full.push(options.classes[classes[i]]);\n }\n }\n }\n\n this._on(options.element, {\n \"remove\": \"_untrackClassesElement\"\n });\n\n if (options.keys) {\n processClassString(options.keys.match(/\\S+/g) || [], true);\n }\n\n if (options.extra) {\n processClassString(options.extra.match(/\\S+/g) || []);\n }\n\n return full.join(\" \");\n },\n _untrackClassesElement: function _untrackClassesElement(event) {\n var that = this;\n $.each(that.classesElementLookup, function (key, value) {\n if ($.inArray(event.target, value) !== -1) {\n that.classesElementLookup[key] = $(value.not(event.target).get());\n }\n });\n },\n _removeClass: function _removeClass(element, keys, extra) {\n return this._toggleClass(element, keys, extra, false);\n },\n _addClass: function _addClass(element, keys, extra) {\n return this._toggleClass(element, keys, extra, true);\n },\n _toggleClass: function _toggleClass(element, keys, extra, add) {\n add = typeof add === \"boolean\" ? add : extra;\n var shift = typeof element === \"string\" || element === null,\n options = {\n extra: shift ? keys : extra,\n keys: shift ? element : keys,\n element: shift ? this.element : element,\n add: add\n };\n options.element.toggleClass(this._classes(options), add);\n return this;\n },\n _on: function _on(suppressDisabledCheck, element, handlers) {\n var delegateElement;\n var instance = this; // No suppressDisabledCheck flag, shuffle arguments\n\n if (typeof suppressDisabledCheck !== \"boolean\") {\n handlers = element;\n element = suppressDisabledCheck;\n suppressDisabledCheck = false;\n } // No element argument, shuffle and use this.element\n\n\n if (!handlers) {\n handlers = element;\n element = this.element;\n delegateElement = this.widget();\n } else {\n element = delegateElement = $(element);\n this.bindings = this.bindings.add(element);\n }\n\n $.each(handlers, function (event, handler) {\n function handlerProxy() {\n // Allow widgets to customize the disabled handling\n // - disabled as an array instead of boolean\n // - disabled class as method for disabling individual parts\n if (!suppressDisabledCheck && (instance.options.disabled === true || $(this).hasClass(\"ui-state-disabled\"))) {\n return;\n }\n\n return (typeof handler === \"string\" ? instance[handler] : handler).apply(instance, arguments);\n } // Copy the guid so direct unbinding works\n\n\n if (typeof handler !== \"string\") {\n handlerProxy.guid = handler.guid = handler.guid || handlerProxy.guid || $.guid++;\n }\n\n var match = event.match(/^([\\w:-]*)\\s*(.*)$/);\n var eventName = match[1] + instance.eventNamespace;\n var selector = match[2];\n\n if (selector) {\n delegateElement.on(eventName, selector, handlerProxy);\n } else {\n element.on(eventName, handlerProxy);\n }\n });\n },\n _off: function _off(element, eventName) {\n eventName = (eventName || \"\").split(\" \").join(this.eventNamespace + \" \") + this.eventNamespace;\n element.off(eventName).off(eventName); // Clear the stack to avoid memory leaks (#10056)\n\n this.bindings = $(this.bindings.not(element).get());\n this.focusable = $(this.focusable.not(element).get());\n this.hoverable = $(this.hoverable.not(element).get());\n },\n _delay: function _delay(handler, delay) {\n function handlerProxy() {\n return (typeof handler === \"string\" ? instance[handler] : handler).apply(instance, arguments);\n }\n\n var instance = this;\n return setTimeout(handlerProxy, delay || 0);\n },\n _hoverable: function _hoverable(element) {\n this.hoverable = this.hoverable.add(element);\n\n this._on(element, {\n mouseenter: function mouseenter(event) {\n this._addClass($(event.currentTarget), null, \"ui-state-hover\");\n },\n mouseleave: function mouseleave(event) {\n this._removeClass($(event.currentTarget), null, \"ui-state-hover\");\n }\n });\n },\n _focusable: function _focusable(element) {\n this.focusable = this.focusable.add(element);\n\n this._on(element, {\n focusin: function focusin(event) {\n this._addClass($(event.currentTarget), null, \"ui-state-focus\");\n },\n focusout: function focusout(event) {\n this._removeClass($(event.currentTarget), null, \"ui-state-focus\");\n }\n });\n },\n _trigger: function _trigger(type, event, data) {\n var prop, orig;\n var callback = this.options[type];\n data = data || {};\n event = $.Event(event);\n event.type = (type === this.widgetEventPrefix ? type : this.widgetEventPrefix + type).toLowerCase(); // The original event may come from any element\n // so we need to reset the target on the new event\n\n event.target = this.element[0]; // Copy original event properties over to the new event\n\n orig = event.originalEvent;\n\n if (orig) {\n for (prop in orig) {\n if (!(prop in event)) {\n event[prop] = orig[prop];\n }\n }\n }\n\n this.element.trigger(event, data);\n return !($.isFunction(callback) && callback.apply(this.element[0], [event].concat(data)) === false || event.isDefaultPrevented());\n }\n };\n $.each({\n show: \"fadeIn\",\n hide: \"fadeOut\"\n }, function (method, defaultEffect) {\n $.Widget.prototype[\"_\" + method] = function (element, options, callback) {\n if (typeof options === \"string\") {\n options = {\n effect: options\n };\n }\n\n var hasOptions;\n var effectName = !options ? method : options === true || typeof options === \"number\" ? defaultEffect : options.effect || defaultEffect;\n options = options || {};\n\n if (typeof options === \"number\") {\n options = {\n duration: options\n };\n }\n\n hasOptions = !$.isEmptyObject(options);\n options.complete = callback;\n\n if (options.delay) {\n element.delay(options.delay);\n }\n\n if (hasOptions && $.effects && $.effects.effect[effectName]) {\n element[method](options);\n } else if (effectName !== method && element[effectName]) {\n element[effectName](options.duration, options.easing, callback);\n } else {\n element.queue(function (next) {\n $(this)[method]();\n\n if (callback) {\n callback.call(element[0]);\n }\n\n next();\n });\n }\n };\n });\n var widget = $.widget;\n /*!\n * jQuery UI Position 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n *\n * http://api.jqueryui.com/position/\n */\n //>>label: Position\n //>>group: Core\n //>>description: Positions elements relative to other elements.\n //>>docs: http://api.jqueryui.com/position/\n //>>demos: http://jqueryui.com/position/\n\n (function () {\n var cachedScrollbarWidth,\n max = Math.max,\n abs = Math.abs,\n rhorizontal = /left|center|right/,\n rvertical = /top|center|bottom/,\n roffset = /[\\+\\-]\\d+(\\.[\\d]+)?%?/,\n rposition = /^\\w+/,\n rpercent = /%$/,\n _position = $.fn.position;\n\n function getOffsets(offsets, width, height) {\n return [parseFloat(offsets[0]) * (rpercent.test(offsets[0]) ? width / 100 : 1), parseFloat(offsets[1]) * (rpercent.test(offsets[1]) ? height / 100 : 1)];\n }\n\n function parseCss(element, property) {\n return parseInt($.css(element, property), 10) || 0;\n }\n\n function getDimensions(elem) {\n var raw = elem[0];\n\n if (raw.nodeType === 9) {\n return {\n width: elem.width(),\n height: elem.height(),\n offset: {\n top: 0,\n left: 0\n }\n };\n }\n\n if ($.isWindow(raw)) {\n return {\n width: elem.width(),\n height: elem.height(),\n offset: {\n top: elem.scrollTop(),\n left: elem.scrollLeft()\n }\n };\n }\n\n if (raw.preventDefault) {\n return {\n width: 0,\n height: 0,\n offset: {\n top: raw.pageY,\n left: raw.pageX\n }\n };\n }\n\n return {\n width: elem.outerWidth(),\n height: elem.outerHeight(),\n offset: elem.offset()\n };\n }\n\n $.position = {\n scrollbarWidth: function scrollbarWidth() {\n if (cachedScrollbarWidth !== undefined) {\n return cachedScrollbarWidth;\n }\n\n var w1,\n w2,\n div = $(\"
\"),\n innerDiv = div.children()[0];\n $(\"body\").append(div);\n w1 = innerDiv.offsetWidth;\n div.css(\"overflow\", \"scroll\");\n w2 = innerDiv.offsetWidth;\n\n if (w1 === w2) {\n w2 = div[0].clientWidth;\n }\n\n div.remove();\n return cachedScrollbarWidth = w1 - w2;\n },\n getScrollInfo: function getScrollInfo(within) {\n var overflowX = within.isWindow || within.isDocument ? \"\" : within.element.css(\"overflow-x\"),\n overflowY = within.isWindow || within.isDocument ? \"\" : within.element.css(\"overflow-y\"),\n hasOverflowX = overflowX === \"scroll\" || overflowX === \"auto\" && within.width < within.element[0].scrollWidth,\n hasOverflowY = overflowY === \"scroll\" || overflowY === \"auto\" && within.height < within.element[0].scrollHeight;\n return {\n width: hasOverflowY ? $.position.scrollbarWidth() : 0,\n height: hasOverflowX ? $.position.scrollbarWidth() : 0\n };\n },\n getWithinInfo: function getWithinInfo(element) {\n var withinElement = $(element || window),\n isWindow = $.isWindow(withinElement[0]),\n isDocument = !!withinElement[0] && withinElement[0].nodeType === 9,\n hasOffset = !isWindow && !isDocument;\n return {\n element: withinElement,\n isWindow: isWindow,\n isDocument: isDocument,\n offset: hasOffset ? $(element).offset() : {\n left: 0,\n top: 0\n },\n scrollLeft: withinElement.scrollLeft(),\n scrollTop: withinElement.scrollTop(),\n width: withinElement.outerWidth(),\n height: withinElement.outerHeight()\n };\n }\n };\n\n $.fn.position = function (options) {\n if (!options || !options.of) {\n return _position.apply(this, arguments);\n } // Make a copy, we don't want to modify arguments\n\n\n options = $.extend({}, options);\n var atOffset,\n targetWidth,\n targetHeight,\n targetOffset,\n basePosition,\n dimensions,\n target = $(options.of),\n within = $.position.getWithinInfo(options.within),\n scrollInfo = $.position.getScrollInfo(within),\n collision = (options.collision || \"flip\").split(\" \"),\n offsets = {};\n dimensions = getDimensions(target);\n\n if (target[0].preventDefault) {\n // Force left top to allow flipping\n options.at = \"left top\";\n }\n\n targetWidth = dimensions.width;\n targetHeight = dimensions.height;\n targetOffset = dimensions.offset; // Clone to reuse original targetOffset later\n\n basePosition = $.extend({}, targetOffset); // Force my and at to have valid horizontal and vertical positions\n // if a value is missing or invalid, it will be converted to center\n\n $.each([\"my\", \"at\"], function () {\n var pos = (options[this] || \"\").split(\" \"),\n horizontalOffset,\n verticalOffset;\n\n if (pos.length === 1) {\n pos = rhorizontal.test(pos[0]) ? pos.concat([\"center\"]) : rvertical.test(pos[0]) ? [\"center\"].concat(pos) : [\"center\", \"center\"];\n }\n\n pos[0] = rhorizontal.test(pos[0]) ? pos[0] : \"center\";\n pos[1] = rvertical.test(pos[1]) ? pos[1] : \"center\"; // Calculate offsets\n\n horizontalOffset = roffset.exec(pos[0]);\n verticalOffset = roffset.exec(pos[1]);\n offsets[this] = [horizontalOffset ? horizontalOffset[0] : 0, verticalOffset ? verticalOffset[0] : 0]; // Reduce to just the positions without the offsets\n\n options[this] = [rposition.exec(pos[0])[0], rposition.exec(pos[1])[0]];\n }); // Normalize collision option\n\n if (collision.length === 1) {\n collision[1] = collision[0];\n }\n\n if (options.at[0] === \"right\") {\n basePosition.left += targetWidth;\n } else if (options.at[0] === \"center\") {\n basePosition.left += targetWidth / 2;\n }\n\n if (options.at[1] === \"bottom\") {\n basePosition.top += targetHeight;\n } else if (options.at[1] === \"center\") {\n basePosition.top += targetHeight / 2;\n }\n\n atOffset = getOffsets(offsets.at, targetWidth, targetHeight);\n basePosition.left += atOffset[0];\n basePosition.top += atOffset[1];\n return this.each(function () {\n var collisionPosition,\n using,\n elem = $(this),\n elemWidth = elem.outerWidth(),\n elemHeight = elem.outerHeight(),\n marginLeft = parseCss(this, \"marginLeft\"),\n marginTop = parseCss(this, \"marginTop\"),\n collisionWidth = elemWidth + marginLeft + parseCss(this, \"marginRight\") + scrollInfo.width,\n collisionHeight = elemHeight + marginTop + parseCss(this, \"marginBottom\") + scrollInfo.height,\n position = $.extend({}, basePosition),\n myOffset = getOffsets(offsets.my, elem.outerWidth(), elem.outerHeight());\n\n if (options.my[0] === \"right\") {\n position.left -= elemWidth;\n } else if (options.my[0] === \"center\") {\n position.left -= elemWidth / 2;\n }\n\n if (options.my[1] === \"bottom\") {\n position.top -= elemHeight;\n } else if (options.my[1] === \"center\") {\n position.top -= elemHeight / 2;\n }\n\n position.left += myOffset[0];\n position.top += myOffset[1];\n collisionPosition = {\n marginLeft: marginLeft,\n marginTop: marginTop\n };\n $.each([\"left\", \"top\"], function (i, dir) {\n if ($.ui.position[collision[i]]) {\n $.ui.position[collision[i]][dir](position, {\n targetWidth: targetWidth,\n targetHeight: targetHeight,\n elemWidth: elemWidth,\n elemHeight: elemHeight,\n collisionPosition: collisionPosition,\n collisionWidth: collisionWidth,\n collisionHeight: collisionHeight,\n offset: [atOffset[0] + myOffset[0], atOffset[1] + myOffset[1]],\n my: options.my,\n at: options.at,\n within: within,\n elem: elem\n });\n }\n });\n\n if (options.using) {\n // Adds feedback as second argument to using callback, if present\n using = function using(props) {\n var left = targetOffset.left - position.left,\n right = left + targetWidth - elemWidth,\n top = targetOffset.top - position.top,\n bottom = top + targetHeight - elemHeight,\n feedback = {\n target: {\n element: target,\n left: targetOffset.left,\n top: targetOffset.top,\n width: targetWidth,\n height: targetHeight\n },\n element: {\n element: elem,\n left: position.left,\n top: position.top,\n width: elemWidth,\n height: elemHeight\n },\n horizontal: right < 0 ? \"left\" : left > 0 ? \"right\" : \"center\",\n vertical: bottom < 0 ? \"top\" : top > 0 ? \"bottom\" : \"middle\"\n };\n\n if (targetWidth < elemWidth && abs(left + right) < targetWidth) {\n feedback.horizontal = \"center\";\n }\n\n if (targetHeight < elemHeight && abs(top + bottom) < targetHeight) {\n feedback.vertical = \"middle\";\n }\n\n if (max(abs(left), abs(right)) > max(abs(top), abs(bottom))) {\n feedback.important = \"horizontal\";\n } else {\n feedback.important = \"vertical\";\n }\n\n options.using.call(this, props, feedback);\n };\n }\n\n elem.offset($.extend(position, {\n using: using\n }));\n });\n };\n\n $.ui.position = {\n fit: {\n left: function left(position, data) {\n var within = data.within,\n withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,\n outerWidth = within.width,\n collisionPosLeft = position.left - data.collisionPosition.marginLeft,\n overLeft = withinOffset - collisionPosLeft,\n overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,\n newOverRight; // Element is wider than within\n\n if (data.collisionWidth > outerWidth) {\n // Element is initially over the left side of within\n if (overLeft > 0 && overRight <= 0) {\n newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;\n position.left += overLeft - newOverRight; // Element is initially over right side of within\n } else if (overRight > 0 && overLeft <= 0) {\n position.left = withinOffset; // Element is initially over both left and right sides of within\n } else {\n if (overLeft > overRight) {\n position.left = withinOffset + outerWidth - data.collisionWidth;\n } else {\n position.left = withinOffset;\n }\n } // Too far left -> align with left edge\n\n } else if (overLeft > 0) {\n position.left += overLeft; // Too far right -> align with right edge\n } else if (overRight > 0) {\n position.left -= overRight; // Adjust based on position and margin\n } else {\n position.left = max(position.left - collisionPosLeft, position.left);\n }\n },\n top: function top(position, data) {\n var within = data.within,\n withinOffset = within.isWindow ? within.scrollTop : within.offset.top,\n outerHeight = data.within.height,\n collisionPosTop = position.top - data.collisionPosition.marginTop,\n overTop = withinOffset - collisionPosTop,\n overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,\n newOverBottom; // Element is taller than within\n\n if (data.collisionHeight > outerHeight) {\n // Element is initially over the top of within\n if (overTop > 0 && overBottom <= 0) {\n newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;\n position.top += overTop - newOverBottom; // Element is initially over bottom of within\n } else if (overBottom > 0 && overTop <= 0) {\n position.top = withinOffset; // Element is initially over both top and bottom of within\n } else {\n if (overTop > overBottom) {\n position.top = withinOffset + outerHeight - data.collisionHeight;\n } else {\n position.top = withinOffset;\n }\n } // Too far up -> align with top\n\n } else if (overTop > 0) {\n position.top += overTop; // Too far down -> align with bottom edge\n } else if (overBottom > 0) {\n position.top -= overBottom; // Adjust based on position and margin\n } else {\n position.top = max(position.top - collisionPosTop, position.top);\n }\n }\n },\n flip: {\n left: function left(position, data) {\n var within = data.within,\n withinOffset = within.offset.left + within.scrollLeft,\n outerWidth = within.width,\n offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,\n collisionPosLeft = position.left - data.collisionPosition.marginLeft,\n overLeft = collisionPosLeft - offsetLeft,\n overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,\n myOffset = data.my[0] === \"left\" ? -data.elemWidth : data.my[0] === \"right\" ? data.elemWidth : 0,\n atOffset = data.at[0] === \"left\" ? data.targetWidth : data.at[0] === \"right\" ? -data.targetWidth : 0,\n offset = -2 * data.offset[0],\n newOverRight,\n newOverLeft;\n\n if (overLeft < 0) {\n newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;\n\n if (newOverRight < 0 || newOverRight < abs(overLeft)) {\n position.left += myOffset + atOffset + offset;\n }\n } else if (overRight > 0) {\n newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;\n\n if (newOverLeft > 0 || abs(newOverLeft) < overRight) {\n position.left += myOffset + atOffset + offset;\n }\n }\n },\n top: function top(position, data) {\n var within = data.within,\n withinOffset = within.offset.top + within.scrollTop,\n outerHeight = within.height,\n offsetTop = within.isWindow ? within.scrollTop : within.offset.top,\n collisionPosTop = position.top - data.collisionPosition.marginTop,\n overTop = collisionPosTop - offsetTop,\n overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,\n top = data.my[1] === \"top\",\n myOffset = top ? -data.elemHeight : data.my[1] === \"bottom\" ? data.elemHeight : 0,\n atOffset = data.at[1] === \"top\" ? data.targetHeight : data.at[1] === \"bottom\" ? -data.targetHeight : 0,\n offset = -2 * data.offset[1],\n newOverTop,\n newOverBottom;\n\n if (overTop < 0) {\n newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;\n\n if (newOverBottom < 0 || newOverBottom < abs(overTop)) {\n position.top += myOffset + atOffset + offset;\n }\n } else if (overBottom > 0) {\n newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;\n\n if (newOverTop > 0 || abs(newOverTop) < overBottom) {\n position.top += myOffset + atOffset + offset;\n }\n }\n }\n },\n flipfit: {\n left: function left() {\n $.ui.position.flip.left.apply(this, arguments);\n $.ui.position.fit.left.apply(this, arguments);\n },\n top: function top() {\n $.ui.position.flip.top.apply(this, arguments);\n $.ui.position.fit.top.apply(this, arguments);\n }\n }\n };\n })();\n\n var position = $.ui.position;\n /*!\n * jQuery UI :data 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: :data Selector\n //>>group: Core\n //>>description: Selects elements which have data stored under the specified key.\n //>>docs: http://api.jqueryui.com/data-selector/\n\n var data = $.extend($.expr[\":\"], {\n data: $.expr.createPseudo ? $.expr.createPseudo(function (dataName) {\n return function (elem) {\n return !!$.data(elem, dataName);\n };\n }) : // Support: jQuery <1.8\n function (elem, i, match) {\n return !!$.data(elem, match[3]);\n }\n });\n /*!\n * jQuery UI Disable Selection 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: disableSelection\n //>>group: Core\n //>>description: Disable selection of text content within the set of matched elements.\n //>>docs: http://api.jqueryui.com/disableSelection/\n // This file is deprecated\n\n var disableSelection = $.fn.extend({\n disableSelection: function () {\n var eventType = \"onselectstart\" in document.createElement(\"div\") ? \"selectstart\" : \"mousedown\";\n return function () {\n return this.on(eventType + \".ui-disableSelection\", function (event) {\n event.preventDefault();\n });\n };\n }(),\n enableSelection: function enableSelection() {\n return this.off(\".ui-disableSelection\");\n }\n });\n /*!\n * jQuery UI Effects 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Effects Core\n //>>group: Effects\n // jscs:disable maximumLineLength\n //>>description: Extends the internal jQuery effects. Includes morphing and easing. Required by all other effects.\n // jscs:enable maximumLineLength\n //>>docs: http://api.jqueryui.com/category/effects-core/\n //>>demos: http://jqueryui.com/effect/\n\n var dataSpace = \"ui-effects-\",\n dataSpaceStyle = \"ui-effects-style\",\n dataSpaceAnimated = \"ui-effects-animated\",\n // Create a local jQuery because jQuery Color relies on it and the\n // global may not exist with AMD and a custom build (#10199)\n jQuery = $;\n $.effects = {\n effect: {}\n };\n /*!\n * jQuery Color Animations v2.1.2\n * https://github.com/jquery/jquery-color\n *\n * Copyright 2014 jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n *\n * Date: Wed Jan 16 08:47:09 2013 -0600\n */\n\n (function (jQuery, undefined) {\n var stepHooks = \"backgroundColor borderBottomColor borderLeftColor borderRightColor \" + \"borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor\",\n // Plusequals test for += 100 -= 100\n rplusequals = /^([\\-+])=\\s*(\\d+\\.?\\d*)/,\n // A set of RE's that can match strings and generate color tuples.\n stringParsers = [{\n re: /rgba?\\(\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*(?:,\\s*(\\d?(?:\\.\\d+)?)\\s*)?\\)/,\n parse: function parse(execResult) {\n return [execResult[1], execResult[2], execResult[3], execResult[4]];\n }\n }, {\n re: /rgba?\\(\\s*(\\d+(?:\\.\\d+)?)\\%\\s*,\\s*(\\d+(?:\\.\\d+)?)\\%\\s*,\\s*(\\d+(?:\\.\\d+)?)\\%\\s*(?:,\\s*(\\d?(?:\\.\\d+)?)\\s*)?\\)/,\n parse: function parse(execResult) {\n return [execResult[1] * 2.55, execResult[2] * 2.55, execResult[3] * 2.55, execResult[4]];\n }\n }, {\n // This regex ignores A-F because it's compared against an already lowercased string\n re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,\n parse: function parse(execResult) {\n return [parseInt(execResult[1], 16), parseInt(execResult[2], 16), parseInt(execResult[3], 16)];\n }\n }, {\n // This regex ignores A-F because it's compared against an already lowercased string\n re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,\n parse: function parse(execResult) {\n return [parseInt(execResult[1] + execResult[1], 16), parseInt(execResult[2] + execResult[2], 16), parseInt(execResult[3] + execResult[3], 16)];\n }\n }, {\n re: /hsla?\\(\\s*(\\d+(?:\\.\\d+)?)\\s*,\\s*(\\d+(?:\\.\\d+)?)\\%\\s*,\\s*(\\d+(?:\\.\\d+)?)\\%\\s*(?:,\\s*(\\d?(?:\\.\\d+)?)\\s*)?\\)/,\n space: \"hsla\",\n parse: function parse(execResult) {\n return [execResult[1], execResult[2] / 100, execResult[3] / 100, execResult[4]];\n }\n }],\n // JQuery.Color( )\n color = jQuery.Color = function (color, green, blue, alpha) {\n return new jQuery.Color.fn.parse(color, green, blue, alpha);\n },\n spaces = {\n rgba: {\n props: {\n red: {\n idx: 0,\n type: \"byte\"\n },\n green: {\n idx: 1,\n type: \"byte\"\n },\n blue: {\n idx: 2,\n type: \"byte\"\n }\n }\n },\n hsla: {\n props: {\n hue: {\n idx: 0,\n type: \"degrees\"\n },\n saturation: {\n idx: 1,\n type: \"percent\"\n },\n lightness: {\n idx: 2,\n type: \"percent\"\n }\n }\n }\n },\n propTypes = {\n \"byte\": {\n floor: true,\n max: 255\n },\n \"percent\": {\n max: 1\n },\n \"degrees\": {\n mod: 360,\n floor: true\n }\n },\n support = color.support = {},\n // Element for support tests\n supportElem = jQuery(\"
\")[0],\n // Colors = jQuery.Color.names\n colors,\n // Local aliases of functions called often\n each = jQuery.each; // Determine rgba support immediately\n\n\n supportElem.style.cssText = \"background-color:rgba(1,1,1,.5)\";\n support.rgba = supportElem.style.backgroundColor.indexOf(\"rgba\") > -1; // Define cache name and alpha properties\n // for rgba and hsla spaces\n\n each(spaces, function (spaceName, space) {\n space.cache = \"_\" + spaceName;\n space.props.alpha = {\n idx: 3,\n type: \"percent\",\n def: 1\n };\n });\n\n function clamp(value, prop, allowEmpty) {\n var type = propTypes[prop.type] || {};\n\n if (value == null) {\n return allowEmpty || !prop.def ? null : prop.def;\n } // ~~ is an short way of doing floor for positive numbers\n\n\n value = type.floor ? ~~value : parseFloat(value); // IE will pass in empty strings as value for alpha,\n // which will hit this case\n\n if (isNaN(value)) {\n return prop.def;\n }\n\n if (type.mod) {\n // We add mod before modding to make sure that negatives values\n // get converted properly: -10 -> 350\n return (value + type.mod) % type.mod;\n } // For now all property types without mod have min and max\n\n\n return 0 > value ? 0 : type.max < value ? type.max : value;\n }\n\n function stringParse(string) {\n var inst = color(),\n rgba = inst._rgba = [];\n string = string.toLowerCase();\n each(stringParsers, function (i, parser) {\n var parsed,\n match = parser.re.exec(string),\n values = match && parser.parse(match),\n spaceName = parser.space || \"rgba\";\n\n if (values) {\n parsed = inst[spaceName](values); // If this was an rgba parse the assignment might happen twice\n // oh well....\n\n inst[spaces[spaceName].cache] = parsed[spaces[spaceName].cache];\n rgba = inst._rgba = parsed._rgba; // Exit each( stringParsers ) here because we matched\n\n return false;\n }\n }); // Found a stringParser that handled it\n\n if (rgba.length) {\n // If this came from a parsed string, force \"transparent\" when alpha is 0\n // chrome, (and maybe others) return \"transparent\" as rgba(0,0,0,0)\n if (rgba.join() === \"0,0,0,0\") {\n jQuery.extend(rgba, colors.transparent);\n }\n\n return inst;\n } // Named colors\n\n\n return colors[string];\n }\n\n color.fn = jQuery.extend(color.prototype, {\n parse: function parse(red, green, blue, alpha) {\n if (red === undefined) {\n this._rgba = [null, null, null, null];\n return this;\n }\n\n if (red.jquery || red.nodeType) {\n red = jQuery(red).css(green);\n green = undefined;\n }\n\n var inst = this,\n type = jQuery.type(red),\n rgba = this._rgba = []; // More than 1 argument specified - assume ( red, green, blue, alpha )\n\n if (green !== undefined) {\n red = [red, green, blue, alpha];\n type = \"array\";\n }\n\n if (type === \"string\") {\n return this.parse(stringParse(red) || colors._default);\n }\n\n if (type === \"array\") {\n each(spaces.rgba.props, function (key, prop) {\n rgba[prop.idx] = clamp(red[prop.idx], prop);\n });\n return this;\n }\n\n if (type === \"object\") {\n if (red instanceof color) {\n each(spaces, function (spaceName, space) {\n if (red[space.cache]) {\n inst[space.cache] = red[space.cache].slice();\n }\n });\n } else {\n each(spaces, function (spaceName, space) {\n var cache = space.cache;\n each(space.props, function (key, prop) {\n // If the cache doesn't exist, and we know how to convert\n if (!inst[cache] && space.to) {\n // If the value was null, we don't need to copy it\n // if the key was alpha, we don't need to copy it either\n if (key === \"alpha\" || red[key] == null) {\n return;\n }\n\n inst[cache] = space.to(inst._rgba);\n } // This is the only case where we allow nulls for ALL properties.\n // call clamp with alwaysAllowEmpty\n\n\n inst[cache][prop.idx] = clamp(red[key], prop, true);\n }); // Everything defined but alpha?\n\n if (inst[cache] && jQuery.inArray(null, inst[cache].slice(0, 3)) < 0) {\n // Use the default of 1\n inst[cache][3] = 1;\n\n if (space.from) {\n inst._rgba = space.from(inst[cache]);\n }\n }\n });\n }\n\n return this;\n }\n },\n is: function is(compare) {\n var is = color(compare),\n same = true,\n inst = this;\n each(spaces, function (_, space) {\n var localCache,\n isCache = is[space.cache];\n\n if (isCache) {\n localCache = inst[space.cache] || space.to && space.to(inst._rgba) || [];\n each(space.props, function (_, prop) {\n if (isCache[prop.idx] != null) {\n same = isCache[prop.idx] === localCache[prop.idx];\n return same;\n }\n });\n }\n\n return same;\n });\n return same;\n },\n _space: function _space() {\n var used = [],\n inst = this;\n each(spaces, function (spaceName, space) {\n if (inst[space.cache]) {\n used.push(spaceName);\n }\n });\n return used.pop();\n },\n transition: function transition(other, distance) {\n var end = color(other),\n spaceName = end._space(),\n space = spaces[spaceName],\n startColor = this.alpha() === 0 ? color(\"transparent\") : this,\n start = startColor[space.cache] || space.to(startColor._rgba),\n result = start.slice();\n\n end = end[space.cache];\n each(space.props, function (key, prop) {\n var index = prop.idx,\n startValue = start[index],\n endValue = end[index],\n type = propTypes[prop.type] || {}; // If null, don't override start value\n\n if (endValue === null) {\n return;\n } // If null - use end\n\n\n if (startValue === null) {\n result[index] = endValue;\n } else {\n if (type.mod) {\n if (endValue - startValue > type.mod / 2) {\n startValue += type.mod;\n } else if (startValue - endValue > type.mod / 2) {\n startValue -= type.mod;\n }\n }\n\n result[index] = clamp((endValue - startValue) * distance + startValue, prop);\n }\n });\n return this[spaceName](result);\n },\n blend: function blend(opaque) {\n // If we are already opaque - return ourself\n if (this._rgba[3] === 1) {\n return this;\n }\n\n var rgb = this._rgba.slice(),\n a = rgb.pop(),\n blend = color(opaque)._rgba;\n\n return color(jQuery.map(rgb, function (v, i) {\n return (1 - a) * blend[i] + a * v;\n }));\n },\n toRgbaString: function toRgbaString() {\n var prefix = \"rgba(\",\n rgba = jQuery.map(this._rgba, function (v, i) {\n return v == null ? i > 2 ? 1 : 0 : v;\n });\n\n if (rgba[3] === 1) {\n rgba.pop();\n prefix = \"rgb(\";\n }\n\n return prefix + rgba.join() + \")\";\n },\n toHslaString: function toHslaString() {\n var prefix = \"hsla(\",\n hsla = jQuery.map(this.hsla(), function (v, i) {\n if (v == null) {\n v = i > 2 ? 1 : 0;\n } // Catch 1 and 2\n\n\n if (i && i < 3) {\n v = Math.round(v * 100) + \"%\";\n }\n\n return v;\n });\n\n if (hsla[3] === 1) {\n hsla.pop();\n prefix = \"hsl(\";\n }\n\n return prefix + hsla.join() + \")\";\n },\n toHexString: function toHexString(includeAlpha) {\n var rgba = this._rgba.slice(),\n alpha = rgba.pop();\n\n if (includeAlpha) {\n rgba.push(~~(alpha * 255));\n }\n\n return \"#\" + jQuery.map(rgba, function (v) {\n // Default to 0 when nulls exist\n v = (v || 0).toString(16);\n return v.length === 1 ? \"0\" + v : v;\n }).join(\"\");\n },\n toString: function toString() {\n return this._rgba[3] === 0 ? \"transparent\" : this.toRgbaString();\n }\n });\n color.fn.parse.prototype = color.fn; // Hsla conversions adapted from:\n // https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021\n\n function hue2rgb(p, q, h) {\n h = (h + 1) % 1;\n\n if (h * 6 < 1) {\n return p + (q - p) * h * 6;\n }\n\n if (h * 2 < 1) {\n return q;\n }\n\n if (h * 3 < 2) {\n return p + (q - p) * (2 / 3 - h) * 6;\n }\n\n return p;\n }\n\n spaces.hsla.to = function (rgba) {\n if (rgba[0] == null || rgba[1] == null || rgba[2] == null) {\n return [null, null, null, rgba[3]];\n }\n\n var r = rgba[0] / 255,\n g = rgba[1] / 255,\n b = rgba[2] / 255,\n a = rgba[3],\n max = Math.max(r, g, b),\n min = Math.min(r, g, b),\n diff = max - min,\n add = max + min,\n l = add * 0.5,\n h,\n s;\n\n if (min === max) {\n h = 0;\n } else if (r === max) {\n h = 60 * (g - b) / diff + 360;\n } else if (g === max) {\n h = 60 * (b - r) / diff + 120;\n } else {\n h = 60 * (r - g) / diff + 240;\n } // Chroma (diff) == 0 means greyscale which, by definition, saturation = 0%\n // otherwise, saturation is based on the ratio of chroma (diff) to lightness (add)\n\n\n if (diff === 0) {\n s = 0;\n } else if (l <= 0.5) {\n s = diff / add;\n } else {\n s = diff / (2 - add);\n }\n\n return [Math.round(h) % 360, s, l, a == null ? 1 : a];\n };\n\n spaces.hsla.from = function (hsla) {\n if (hsla[0] == null || hsla[1] == null || hsla[2] == null) {\n return [null, null, null, hsla[3]];\n }\n\n var h = hsla[0] / 360,\n s = hsla[1],\n l = hsla[2],\n a = hsla[3],\n q = l <= 0.5 ? l * (1 + s) : l + s - l * s,\n p = 2 * l - q;\n return [Math.round(hue2rgb(p, q, h + 1 / 3) * 255), Math.round(hue2rgb(p, q, h) * 255), Math.round(hue2rgb(p, q, h - 1 / 3) * 255), a];\n };\n\n each(spaces, function (spaceName, space) {\n var props = space.props,\n cache = space.cache,\n to = space.to,\n from = space.from; // Makes rgba() and hsla()\n\n color.fn[spaceName] = function (value) {\n // Generate a cache for this space if it doesn't exist\n if (to && !this[cache]) {\n this[cache] = to(this._rgba);\n }\n\n if (value === undefined) {\n return this[cache].slice();\n }\n\n var ret,\n type = jQuery.type(value),\n arr = type === \"array\" || type === \"object\" ? value : arguments,\n local = this[cache].slice();\n each(props, function (key, prop) {\n var val = arr[type === \"object\" ? key : prop.idx];\n\n if (val == null) {\n val = local[prop.idx];\n }\n\n local[prop.idx] = clamp(val, prop);\n });\n\n if (from) {\n ret = color(from(local));\n ret[cache] = local;\n return ret;\n } else {\n return color(local);\n }\n }; // Makes red() green() blue() alpha() hue() saturation() lightness()\n\n\n each(props, function (key, prop) {\n // Alpha is included in more than one space\n if (color.fn[key]) {\n return;\n }\n\n color.fn[key] = function (value) {\n var vtype = jQuery.type(value),\n fn = key === \"alpha\" ? this._hsla ? \"hsla\" : \"rgba\" : spaceName,\n local = this[fn](),\n cur = local[prop.idx],\n match;\n\n if (vtype === \"undefined\") {\n return cur;\n }\n\n if (vtype === \"function\") {\n value = value.call(this, cur);\n vtype = jQuery.type(value);\n }\n\n if (value == null && prop.empty) {\n return this;\n }\n\n if (vtype === \"string\") {\n match = rplusequals.exec(value);\n\n if (match) {\n value = cur + parseFloat(match[2]) * (match[1] === \"+\" ? 1 : -1);\n }\n }\n\n local[prop.idx] = value;\n return this[fn](local);\n };\n });\n }); // Add cssHook and .fx.step function for each named hook.\n // accept a space separated string of properties\n\n color.hook = function (hook) {\n var hooks = hook.split(\" \");\n each(hooks, function (i, hook) {\n jQuery.cssHooks[hook] = {\n set: function set(elem, value) {\n var parsed,\n curElem,\n backgroundColor = \"\";\n\n if (value !== \"transparent\" && (jQuery.type(value) !== \"string\" || (parsed = stringParse(value)))) {\n value = color(parsed || value);\n\n if (!support.rgba && value._rgba[3] !== 1) {\n curElem = hook === \"backgroundColor\" ? elem.parentNode : elem;\n\n while ((backgroundColor === \"\" || backgroundColor === \"transparent\") && curElem && curElem.style) {\n try {\n backgroundColor = jQuery.css(curElem, \"backgroundColor\");\n curElem = curElem.parentNode;\n } catch (e) {}\n }\n\n value = value.blend(backgroundColor && backgroundColor !== \"transparent\" ? backgroundColor : \"_default\");\n }\n\n value = value.toRgbaString();\n }\n\n try {\n elem.style[hook] = value;\n } catch (e) {// Wrapped to prevent IE from throwing errors on \"invalid\" values like\n // 'auto' or 'inherit'\n }\n }\n };\n\n jQuery.fx.step[hook] = function (fx) {\n if (!fx.colorInit) {\n fx.start = color(fx.elem, hook);\n fx.end = color(fx.end);\n fx.colorInit = true;\n }\n\n jQuery.cssHooks[hook].set(fx.elem, fx.start.transition(fx.end, fx.pos));\n };\n });\n };\n\n color.hook(stepHooks);\n jQuery.cssHooks.borderColor = {\n expand: function expand(value) {\n var expanded = {};\n each([\"Top\", \"Right\", \"Bottom\", \"Left\"], function (i, part) {\n expanded[\"border\" + part + \"Color\"] = value;\n });\n return expanded;\n }\n }; // Basic color names only.\n // Usage of any of the other color names requires adding yourself or including\n // jquery.color.svg-names.js.\n\n colors = jQuery.Color.names = {\n // 4.1. Basic color keywords\n aqua: \"#00ffff\",\n black: \"#000000\",\n blue: \"#0000ff\",\n fuchsia: \"#ff00ff\",\n gray: \"#808080\",\n green: \"#008000\",\n lime: \"#00ff00\",\n maroon: \"#800000\",\n navy: \"#000080\",\n olive: \"#808000\",\n purple: \"#800080\",\n red: \"#ff0000\",\n silver: \"#c0c0c0\",\n teal: \"#008080\",\n white: \"#ffffff\",\n yellow: \"#ffff00\",\n // 4.2.3. \"transparent\" color keyword\n transparent: [null, null, null, 0],\n _default: \"#ffffff\"\n };\n })(jQuery);\n /******************************************************************************/\n\n /****************************** CLASS ANIMATIONS ******************************/\n\n /******************************************************************************/\n\n\n (function () {\n var classAnimationActions = [\"add\", \"remove\", \"toggle\"],\n shorthandStyles = {\n border: 1,\n borderBottom: 1,\n borderColor: 1,\n borderLeft: 1,\n borderRight: 1,\n borderTop: 1,\n borderWidth: 1,\n margin: 1,\n padding: 1\n };\n $.each([\"borderLeftStyle\", \"borderRightStyle\", \"borderBottomStyle\", \"borderTopStyle\"], function (_, prop) {\n $.fx.step[prop] = function (fx) {\n if (fx.end !== \"none\" && !fx.setAttr || fx.pos === 1 && !fx.setAttr) {\n jQuery.style(fx.elem, prop, fx.end);\n fx.setAttr = true;\n }\n };\n });\n\n function getElementStyles(elem) {\n var key,\n len,\n style = elem.ownerDocument.defaultView ? elem.ownerDocument.defaultView.getComputedStyle(elem, null) : elem.currentStyle,\n styles = {};\n\n if (style && style.length && style[0] && style[style[0]]) {\n len = style.length;\n\n while (len--) {\n key = style[len];\n\n if (typeof style[key] === \"string\") {\n styles[$.camelCase(key)] = style[key];\n }\n } // Support: Opera, IE <9\n\n } else {\n for (key in style) {\n if (typeof style[key] === \"string\") {\n styles[key] = style[key];\n }\n }\n }\n\n return styles;\n }\n\n function styleDifference(oldStyle, newStyle) {\n var diff = {},\n name,\n value;\n\n for (name in newStyle) {\n value = newStyle[name];\n\n if (oldStyle[name] !== value) {\n if (!shorthandStyles[name]) {\n if ($.fx.step[name] || !isNaN(parseFloat(value))) {\n diff[name] = value;\n }\n }\n }\n }\n\n return diff;\n } // Support: jQuery <1.8\n\n\n if (!$.fn.addBack) {\n $.fn.addBack = function (selector) {\n return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector));\n };\n }\n\n $.effects.animateClass = function (value, duration, easing, callback) {\n var o = $.speed(duration, easing, callback);\n return this.queue(function () {\n var animated = $(this),\n baseClass = animated.attr(\"class\") || \"\",\n applyClassChange,\n allAnimations = o.children ? animated.find(\"*\").addBack() : animated; // Map the animated objects to store the original styles.\n\n allAnimations = allAnimations.map(function () {\n var el = $(this);\n return {\n el: el,\n start: getElementStyles(this)\n };\n }); // Apply class change\n\n applyClassChange = function applyClassChange() {\n $.each(classAnimationActions, function (i, action) {\n if (value[action]) {\n animated[action + \"Class\"](value[action]);\n }\n });\n };\n\n applyClassChange(); // Map all animated objects again - calculate new styles and diff\n\n allAnimations = allAnimations.map(function () {\n this.end = getElementStyles(this.el[0]);\n this.diff = styleDifference(this.start, this.end);\n return this;\n }); // Apply original class\n\n animated.attr(\"class\", baseClass); // Map all animated objects again - this time collecting a promise\n\n allAnimations = allAnimations.map(function () {\n var styleInfo = this,\n dfd = $.Deferred(),\n opts = $.extend({}, o, {\n queue: false,\n complete: function complete() {\n dfd.resolve(styleInfo);\n }\n });\n this.el.animate(this.diff, opts);\n return dfd.promise();\n }); // Once all animations have completed:\n\n $.when.apply($, allAnimations.get()).done(function () {\n // Set the final class\n applyClassChange(); // For each animated element,\n // clear all css properties that were animated\n\n $.each(arguments, function () {\n var el = this.el;\n $.each(this.diff, function (key) {\n el.css(key, \"\");\n });\n }); // This is guarnteed to be there if you use jQuery.speed()\n // it also handles dequeuing the next anim...\n\n o.complete.call(animated[0]);\n });\n });\n };\n\n $.fn.extend({\n addClass: function (orig) {\n return function (classNames, speed, easing, callback) {\n return speed ? $.effects.animateClass.call(this, {\n add: classNames\n }, speed, easing, callback) : orig.apply(this, arguments);\n };\n }($.fn.addClass),\n removeClass: function (orig) {\n return function (classNames, speed, easing, callback) {\n return arguments.length > 1 ? $.effects.animateClass.call(this, {\n remove: classNames\n }, speed, easing, callback) : orig.apply(this, arguments);\n };\n }($.fn.removeClass),\n toggleClass: function (orig) {\n return function (classNames, force, speed, easing, callback) {\n if (typeof force === \"boolean\" || force === undefined) {\n if (!speed) {\n // Without speed parameter\n return orig.apply(this, arguments);\n } else {\n return $.effects.animateClass.call(this, force ? {\n add: classNames\n } : {\n remove: classNames\n }, speed, easing, callback);\n }\n } else {\n // Without force parameter\n return $.effects.animateClass.call(this, {\n toggle: classNames\n }, force, speed, easing);\n }\n };\n }($.fn.toggleClass),\n switchClass: function switchClass(remove, add, speed, easing, callback) {\n return $.effects.animateClass.call(this, {\n add: add,\n remove: remove\n }, speed, easing, callback);\n }\n });\n })();\n /******************************************************************************/\n\n /*********************************** EFFECTS **********************************/\n\n /******************************************************************************/\n\n\n (function () {\n if ($.expr && $.expr.filters && $.expr.filters.animated) {\n $.expr.filters.animated = function (orig) {\n return function (elem) {\n return !!$(elem).data(dataSpaceAnimated) || orig(elem);\n };\n }($.expr.filters.animated);\n }\n\n if ($.uiBackCompat !== false) {\n $.extend($.effects, {\n // Saves a set of properties in a data storage\n save: function save(element, set) {\n var i = 0,\n length = set.length;\n\n for (; i < length; i++) {\n if (set[i] !== null) {\n element.data(dataSpace + set[i], element[0].style[set[i]]);\n }\n }\n },\n // Restores a set of previously saved properties from a data storage\n restore: function restore(element, set) {\n var val,\n i = 0,\n length = set.length;\n\n for (; i < length; i++) {\n if (set[i] !== null) {\n val = element.data(dataSpace + set[i]);\n element.css(set[i], val);\n }\n }\n },\n setMode: function setMode(el, mode) {\n if (mode === \"toggle\") {\n mode = el.is(\":hidden\") ? \"show\" : \"hide\";\n }\n\n return mode;\n },\n // Wraps the element around a wrapper that copies position properties\n createWrapper: function createWrapper(element) {\n // If the element is already wrapped, return it\n if (element.parent().is(\".ui-effects-wrapper\")) {\n return element.parent();\n } // Wrap the element\n\n\n var props = {\n width: element.outerWidth(true),\n height: element.outerHeight(true),\n \"float\": element.css(\"float\")\n },\n wrapper = $(\"
\").addClass(\"ui-effects-wrapper\").css({\n fontSize: \"100%\",\n background: \"transparent\",\n border: \"none\",\n margin: 0,\n padding: 0\n }),\n // Store the size in case width/height are defined in % - Fixes #5245\n size = {\n width: element.width(),\n height: element.height()\n },\n active = document.activeElement; // Support: Firefox\n // Firefox incorrectly exposes anonymous content\n // https://bugzilla.mozilla.org/show_bug.cgi?id=561664\n\n try {\n active.id;\n } catch (e) {\n active = document.body;\n }\n\n element.wrap(wrapper); // Fixes #7595 - Elements lose focus when wrapped.\n\n if (element[0] === active || $.contains(element[0], active)) {\n $(active).trigger(\"focus\");\n } // Hotfix for jQuery 1.4 since some change in wrap() seems to actually\n // lose the reference to the wrapped element\n\n\n wrapper = element.parent(); // Transfer positioning properties to the wrapper\n\n if (element.css(\"position\") === \"static\") {\n wrapper.css({\n position: \"relative\"\n });\n element.css({\n position: \"relative\"\n });\n } else {\n $.extend(props, {\n position: element.css(\"position\"),\n zIndex: element.css(\"z-index\")\n });\n $.each([\"top\", \"left\", \"bottom\", \"right\"], function (i, pos) {\n props[pos] = element.css(pos);\n\n if (isNaN(parseInt(props[pos], 10))) {\n props[pos] = \"auto\";\n }\n });\n element.css({\n position: \"relative\",\n top: 0,\n left: 0,\n right: \"auto\",\n bottom: \"auto\"\n });\n }\n\n element.css(size);\n return wrapper.css(props).show();\n },\n removeWrapper: function removeWrapper(element) {\n var active = document.activeElement;\n\n if (element.parent().is(\".ui-effects-wrapper\")) {\n element.parent().replaceWith(element); // Fixes #7595 - Elements lose focus when wrapped.\n\n if (element[0] === active || $.contains(element[0], active)) {\n $(active).trigger(\"focus\");\n }\n }\n\n return element;\n }\n });\n }\n\n $.extend($.effects, {\n version: \"1.12.1\",\n define: function define(name, mode, effect) {\n if (!effect) {\n effect = mode;\n mode = \"effect\";\n }\n\n $.effects.effect[name] = effect;\n $.effects.effect[name].mode = mode;\n return effect;\n },\n scaledDimensions: function scaledDimensions(element, percent, direction) {\n if (percent === 0) {\n return {\n height: 0,\n width: 0,\n outerHeight: 0,\n outerWidth: 0\n };\n }\n\n var x = direction !== \"horizontal\" ? (percent || 100) / 100 : 1,\n y = direction !== \"vertical\" ? (percent || 100) / 100 : 1;\n return {\n height: element.height() * y,\n width: element.width() * x,\n outerHeight: element.outerHeight() * y,\n outerWidth: element.outerWidth() * x\n };\n },\n clipToBox: function clipToBox(animation) {\n return {\n width: animation.clip.right - animation.clip.left,\n height: animation.clip.bottom - animation.clip.top,\n left: animation.clip.left,\n top: animation.clip.top\n };\n },\n // Injects recently queued functions to be first in line (after \"inprogress\")\n unshift: function unshift(element, queueLength, count) {\n var queue = element.queue();\n\n if (queueLength > 1) {\n queue.splice.apply(queue, [1, 0].concat(queue.splice(queueLength, count)));\n }\n\n element.dequeue();\n },\n saveStyle: function saveStyle(element) {\n element.data(dataSpaceStyle, element[0].style.cssText);\n },\n restoreStyle: function restoreStyle(element) {\n element[0].style.cssText = element.data(dataSpaceStyle) || \"\";\n element.removeData(dataSpaceStyle);\n },\n mode: function mode(element, _mode) {\n var hidden = element.is(\":hidden\");\n\n if (_mode === \"toggle\") {\n _mode = hidden ? \"show\" : \"hide\";\n }\n\n if (hidden ? _mode === \"hide\" : _mode === \"show\") {\n _mode = \"none\";\n }\n\n return _mode;\n },\n // Translates a [top,left] array into a baseline value\n getBaseline: function getBaseline(origin, original) {\n var y, x;\n\n switch (origin[0]) {\n case \"top\":\n y = 0;\n break;\n\n case \"middle\":\n y = 0.5;\n break;\n\n case \"bottom\":\n y = 1;\n break;\n\n default:\n y = origin[0] / original.height;\n }\n\n switch (origin[1]) {\n case \"left\":\n x = 0;\n break;\n\n case \"center\":\n x = 0.5;\n break;\n\n case \"right\":\n x = 1;\n break;\n\n default:\n x = origin[1] / original.width;\n }\n\n return {\n x: x,\n y: y\n };\n },\n // Creates a placeholder element so that the original element can be made absolute\n createPlaceholder: function createPlaceholder(element) {\n var placeholder,\n cssPosition = element.css(\"position\"),\n position = element.position(); // Lock in margins first to account for form elements, which\n // will change margin if you explicitly set height\n // see: http://jsfiddle.net/JZSMt/3/ https://bugs.webkit.org/show_bug.cgi?id=107380\n // Support: Safari\n\n element.css({\n marginTop: element.css(\"marginTop\"),\n marginBottom: element.css(\"marginBottom\"),\n marginLeft: element.css(\"marginLeft\"),\n marginRight: element.css(\"marginRight\")\n }).outerWidth(element.outerWidth()).outerHeight(element.outerHeight());\n\n if (/^(static|relative)/.test(cssPosition)) {\n cssPosition = \"absolute\";\n placeholder = $(\"<\" + element[0].nodeName + \">\").insertAfter(element).css({\n // Convert inline to inline block to account for inline elements\n // that turn to inline block based on content (like img)\n display: /^(inline|ruby)/.test(element.css(\"display\")) ? \"inline-block\" : \"block\",\n visibility: \"hidden\",\n // Margins need to be set to account for margin collapse\n marginTop: element.css(\"marginTop\"),\n marginBottom: element.css(\"marginBottom\"),\n marginLeft: element.css(\"marginLeft\"),\n marginRight: element.css(\"marginRight\"),\n \"float\": element.css(\"float\")\n }).outerWidth(element.outerWidth()).outerHeight(element.outerHeight()).addClass(\"ui-effects-placeholder\");\n element.data(dataSpace + \"placeholder\", placeholder);\n }\n\n element.css({\n position: cssPosition,\n left: position.left,\n top: position.top\n });\n return placeholder;\n },\n removePlaceholder: function removePlaceholder(element) {\n var dataKey = dataSpace + \"placeholder\",\n placeholder = element.data(dataKey);\n\n if (placeholder) {\n placeholder.remove();\n element.removeData(dataKey);\n }\n },\n // Removes a placeholder if it exists and restores\n // properties that were modified during placeholder creation\n cleanUp: function cleanUp(element) {\n $.effects.restoreStyle(element);\n $.effects.removePlaceholder(element);\n },\n setTransition: function setTransition(element, list, factor, value) {\n value = value || {};\n $.each(list, function (i, x) {\n var unit = element.cssUnit(x);\n\n if (unit[0] > 0) {\n value[x] = unit[0] * factor + unit[1];\n }\n });\n return value;\n }\n }); // Return an effect options object for the given parameters:\n\n function _normalizeArguments(effect, options, speed, callback) {\n // Allow passing all options as the first parameter\n if ($.isPlainObject(effect)) {\n options = effect;\n effect = effect.effect;\n } // Convert to an object\n\n\n effect = {\n effect: effect\n }; // Catch (effect, null, ...)\n\n if (options == null) {\n options = {};\n } // Catch (effect, callback)\n\n\n if ($.isFunction(options)) {\n callback = options;\n speed = null;\n options = {};\n } // Catch (effect, speed, ?)\n\n\n if (typeof options === \"number\" || $.fx.speeds[options]) {\n callback = speed;\n speed = options;\n options = {};\n } // Catch (effect, options, callback)\n\n\n if ($.isFunction(speed)) {\n callback = speed;\n speed = null;\n } // Add options to effect\n\n\n if (options) {\n $.extend(effect, options);\n }\n\n speed = speed || options.duration;\n effect.duration = $.fx.off ? 0 : typeof speed === \"number\" ? speed : speed in $.fx.speeds ? $.fx.speeds[speed] : $.fx.speeds._default;\n effect.complete = callback || options.complete;\n return effect;\n }\n\n function standardAnimationOption(option) {\n // Valid standard speeds (nothing, number, named speed)\n if (!option || typeof option === \"number\" || $.fx.speeds[option]) {\n return true;\n } // Invalid strings - treat as \"normal\" speed\n\n\n if (typeof option === \"string\" && !$.effects.effect[option]) {\n return true;\n } // Complete callback\n\n\n if ($.isFunction(option)) {\n return true;\n } // Options hash (but not naming an effect)\n\n\n if (_typeof(option) === \"object\" && !option.effect) {\n return true;\n } // Didn't match any standard API\n\n\n return false;\n }\n\n $.fn.extend({\n effect: function effect()\n /* effect, options, speed, callback */\n {\n var args = _normalizeArguments.apply(this, arguments),\n effectMethod = $.effects.effect[args.effect],\n defaultMode = effectMethod.mode,\n queue = args.queue,\n queueName = queue || \"fx\",\n complete = args.complete,\n mode = args.mode,\n modes = [],\n prefilter = function prefilter(next) {\n var el = $(this),\n normalizedMode = $.effects.mode(el, mode) || defaultMode; // Sentinel for duck-punching the :animated psuedo-selector\n\n el.data(dataSpaceAnimated, true); // Save effect mode for later use,\n // we can't just call $.effects.mode again later,\n // as the .show() below destroys the initial state\n\n modes.push(normalizedMode); // See $.uiBackCompat inside of run() for removal of defaultMode in 1.13\n\n if (defaultMode && (normalizedMode === \"show\" || normalizedMode === defaultMode && normalizedMode === \"hide\")) {\n el.show();\n }\n\n if (!defaultMode || normalizedMode !== \"none\") {\n $.effects.saveStyle(el);\n }\n\n if ($.isFunction(next)) {\n next();\n }\n };\n\n if ($.fx.off || !effectMethod) {\n // Delegate to the original method (e.g., .show()) if possible\n if (mode) {\n return this[mode](args.duration, complete);\n } else {\n return this.each(function () {\n if (complete) {\n complete.call(this);\n }\n });\n }\n }\n\n function run(next) {\n var elem = $(this);\n\n function cleanup() {\n elem.removeData(dataSpaceAnimated);\n $.effects.cleanUp(elem);\n\n if (args.mode === \"hide\") {\n elem.hide();\n }\n\n done();\n }\n\n function done() {\n if ($.isFunction(complete)) {\n complete.call(elem[0]);\n }\n\n if ($.isFunction(next)) {\n next();\n }\n } // Override mode option on a per element basis,\n // as toggle can be either show or hide depending on element state\n\n\n args.mode = modes.shift();\n\n if ($.uiBackCompat !== false && !defaultMode) {\n if (elem.is(\":hidden\") ? mode === \"hide\" : mode === \"show\") {\n // Call the core method to track \"olddisplay\" properly\n elem[mode]();\n done();\n } else {\n effectMethod.call(elem[0], args, done);\n }\n } else {\n if (args.mode === \"none\") {\n // Call the core method to track \"olddisplay\" properly\n elem[mode]();\n done();\n } else {\n effectMethod.call(elem[0], args, cleanup);\n }\n }\n } // Run prefilter on all elements first to ensure that\n // any showing or hiding happens before placeholder creation,\n // which ensures that any layout changes are correctly captured.\n\n\n return queue === false ? this.each(prefilter).each(run) : this.queue(queueName, prefilter).queue(queueName, run);\n },\n show: function (orig) {\n return function (option) {\n if (standardAnimationOption(option)) {\n return orig.apply(this, arguments);\n } else {\n var args = _normalizeArguments.apply(this, arguments);\n\n args.mode = \"show\";\n return this.effect.call(this, args);\n }\n };\n }($.fn.show),\n hide: function (orig) {\n return function (option) {\n if (standardAnimationOption(option)) {\n return orig.apply(this, arguments);\n } else {\n var args = _normalizeArguments.apply(this, arguments);\n\n args.mode = \"hide\";\n return this.effect.call(this, args);\n }\n };\n }($.fn.hide),\n toggle: function (orig) {\n return function (option) {\n if (standardAnimationOption(option) || typeof option === \"boolean\") {\n return orig.apply(this, arguments);\n } else {\n var args = _normalizeArguments.apply(this, arguments);\n\n args.mode = \"toggle\";\n return this.effect.call(this, args);\n }\n };\n }($.fn.toggle),\n cssUnit: function cssUnit(key) {\n var style = this.css(key),\n val = [];\n $.each([\"em\", \"px\", \"%\", \"pt\"], function (i, unit) {\n if (style.indexOf(unit) > 0) {\n val = [parseFloat(style), unit];\n }\n });\n return val;\n },\n cssClip: function cssClip(clipObj) {\n if (clipObj) {\n return this.css(\"clip\", \"rect(\" + clipObj.top + \"px \" + clipObj.right + \"px \" + clipObj.bottom + \"px \" + clipObj.left + \"px)\");\n }\n\n return parseClip(this.css(\"clip\"), this);\n },\n transfer: function transfer(options, done) {\n var element = $(this),\n target = $(options.to),\n targetFixed = target.css(\"position\") === \"fixed\",\n body = $(\"body\"),\n fixTop = targetFixed ? body.scrollTop() : 0,\n fixLeft = targetFixed ? body.scrollLeft() : 0,\n endPosition = target.offset(),\n animation = {\n top: endPosition.top - fixTop,\n left: endPosition.left - fixLeft,\n height: target.innerHeight(),\n width: target.innerWidth()\n },\n startPosition = element.offset(),\n transfer = $(\"
\").appendTo(\"body\").addClass(options.className).css({\n top: startPosition.top - fixTop,\n left: startPosition.left - fixLeft,\n height: element.innerHeight(),\n width: element.innerWidth(),\n position: targetFixed ? \"fixed\" : \"absolute\"\n }).animate(animation, options.duration, options.easing, function () {\n transfer.remove();\n\n if ($.isFunction(done)) {\n done();\n }\n });\n }\n });\n\n function parseClip(str, element) {\n var outerWidth = element.outerWidth(),\n outerHeight = element.outerHeight(),\n clipRegex = /^rect\\((-?\\d*\\.?\\d*px|-?\\d+%|auto),?\\s*(-?\\d*\\.?\\d*px|-?\\d+%|auto),?\\s*(-?\\d*\\.?\\d*px|-?\\d+%|auto),?\\s*(-?\\d*\\.?\\d*px|-?\\d+%|auto)\\)$/,\n values = clipRegex.exec(str) || [\"\", 0, outerWidth, outerHeight, 0];\n return {\n top: parseFloat(values[1]) || 0,\n right: values[2] === \"auto\" ? outerWidth : parseFloat(values[2]),\n bottom: values[3] === \"auto\" ? outerHeight : parseFloat(values[3]),\n left: parseFloat(values[4]) || 0\n };\n }\n\n $.fx.step.clip = function (fx) {\n if (!fx.clipInit) {\n fx.start = $(fx.elem).cssClip();\n\n if (typeof fx.end === \"string\") {\n fx.end = parseClip(fx.end, fx.elem);\n }\n\n fx.clipInit = true;\n }\n\n $(fx.elem).cssClip({\n top: fx.pos * (fx.end.top - fx.start.top) + fx.start.top,\n right: fx.pos * (fx.end.right - fx.start.right) + fx.start.right,\n bottom: fx.pos * (fx.end.bottom - fx.start.bottom) + fx.start.bottom,\n left: fx.pos * (fx.end.left - fx.start.left) + fx.start.left\n });\n };\n })();\n /******************************************************************************/\n\n /*********************************** EASING ***********************************/\n\n /******************************************************************************/\n\n\n (function () {\n // Based on easing equations from Robert Penner (http://www.robertpenner.com/easing)\n var baseEasings = {};\n $.each([\"Quad\", \"Cubic\", \"Quart\", \"Quint\", \"Expo\"], function (i, name) {\n baseEasings[name] = function (p) {\n return Math.pow(p, i + 2);\n };\n });\n $.extend(baseEasings, {\n Sine: function Sine(p) {\n return 1 - Math.cos(p * Math.PI / 2);\n },\n Circ: function Circ(p) {\n return 1 - Math.sqrt(1 - p * p);\n },\n Elastic: function Elastic(p) {\n return p === 0 || p === 1 ? p : -Math.pow(2, 8 * (p - 1)) * Math.sin(((p - 1) * 80 - 7.5) * Math.PI / 15);\n },\n Back: function Back(p) {\n return p * p * (3 * p - 2);\n },\n Bounce: function Bounce(p) {\n var pow2,\n bounce = 4;\n\n while (p < ((pow2 = Math.pow(2, --bounce)) - 1) / 11) {}\n\n return 1 / Math.pow(4, 3 - bounce) - 7.5625 * Math.pow((pow2 * 3 - 2) / 22 - p, 2);\n }\n });\n $.each(baseEasings, function (name, easeIn) {\n $.easing[\"easeIn\" + name] = easeIn;\n\n $.easing[\"easeOut\" + name] = function (p) {\n return 1 - easeIn(1 - p);\n };\n\n $.easing[\"easeInOut\" + name] = function (p) {\n return p < 0.5 ? easeIn(p * 2) / 2 : 1 - easeIn(p * -2 + 2) / 2;\n };\n });\n })();\n\n var effect = $.effects;\n /*!\n * jQuery UI Effects Blind 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Blind Effect\n //>>group: Effects\n //>>description: Blinds the element.\n //>>docs: http://api.jqueryui.com/blind-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effectsEffectBlind = $.effects.define(\"blind\", \"hide\", function (options, done) {\n var map = {\n up: [\"bottom\", \"top\"],\n vertical: [\"bottom\", \"top\"],\n down: [\"top\", \"bottom\"],\n left: [\"right\", \"left\"],\n horizontal: [\"right\", \"left\"],\n right: [\"left\", \"right\"]\n },\n element = $(this),\n direction = options.direction || \"up\",\n start = element.cssClip(),\n animate = {\n clip: $.extend({}, start)\n },\n placeholder = $.effects.createPlaceholder(element);\n animate.clip[map[direction][0]] = animate.clip[map[direction][1]];\n\n if (options.mode === \"show\") {\n element.cssClip(animate.clip);\n\n if (placeholder) {\n placeholder.css($.effects.clipToBox(animate));\n }\n\n animate.clip = start;\n }\n\n if (placeholder) {\n placeholder.animate($.effects.clipToBox(animate), options.duration, options.easing);\n }\n\n element.animate(animate, {\n queue: false,\n duration: options.duration,\n easing: options.easing,\n complete: done\n });\n });\n /*!\n * jQuery UI Effects Bounce 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Bounce Effect\n //>>group: Effects\n //>>description: Bounces an element horizontally or vertically n times.\n //>>docs: http://api.jqueryui.com/bounce-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effectsEffectBounce = $.effects.define(\"bounce\", function (options, done) {\n var upAnim,\n downAnim,\n refValue,\n element = $(this),\n // Defaults:\n mode = options.mode,\n hide = mode === \"hide\",\n show = mode === \"show\",\n direction = options.direction || \"up\",\n distance = options.distance,\n times = options.times || 5,\n // Number of internal animations\n anims = times * 2 + (show || hide ? 1 : 0),\n speed = options.duration / anims,\n easing = options.easing,\n // Utility:\n ref = direction === \"up\" || direction === \"down\" ? \"top\" : \"left\",\n motion = direction === \"up\" || direction === \"left\",\n i = 0,\n queuelen = element.queue().length;\n $.effects.createPlaceholder(element);\n refValue = element.css(ref); // Default distance for the BIGGEST bounce is the outer Distance / 3\n\n if (!distance) {\n distance = element[ref === \"top\" ? \"outerHeight\" : \"outerWidth\"]() / 3;\n }\n\n if (show) {\n downAnim = {\n opacity: 1\n };\n downAnim[ref] = refValue; // If we are showing, force opacity 0 and set the initial position\n // then do the \"first\" animation\n\n element.css(\"opacity\", 0).css(ref, motion ? -distance * 2 : distance * 2).animate(downAnim, speed, easing);\n } // Start at the smallest distance if we are hiding\n\n\n if (hide) {\n distance = distance / Math.pow(2, times - 1);\n }\n\n downAnim = {};\n downAnim[ref] = refValue; // Bounces up/down/left/right then back to 0 -- times * 2 animations happen here\n\n for (; i < times; i++) {\n upAnim = {};\n upAnim[ref] = (motion ? \"-=\" : \"+=\") + distance;\n element.animate(upAnim, speed, easing).animate(downAnim, speed, easing);\n distance = hide ? distance * 2 : distance / 2;\n } // Last Bounce when Hiding\n\n\n if (hide) {\n upAnim = {\n opacity: 0\n };\n upAnim[ref] = (motion ? \"-=\" : \"+=\") + distance;\n element.animate(upAnim, speed, easing);\n }\n\n element.queue(done);\n $.effects.unshift(element, queuelen, anims + 1);\n });\n /*!\n * jQuery UI Effects Clip 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Clip Effect\n //>>group: Effects\n //>>description: Clips the element on and off like an old TV.\n //>>docs: http://api.jqueryui.com/clip-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effectsEffectClip = $.effects.define(\"clip\", \"hide\", function (options, done) {\n var start,\n animate = {},\n element = $(this),\n direction = options.direction || \"vertical\",\n both = direction === \"both\",\n horizontal = both || direction === \"horizontal\",\n vertical = both || direction === \"vertical\";\n start = element.cssClip();\n animate.clip = {\n top: vertical ? (start.bottom - start.top) / 2 : start.top,\n right: horizontal ? (start.right - start.left) / 2 : start.right,\n bottom: vertical ? (start.bottom - start.top) / 2 : start.bottom,\n left: horizontal ? (start.right - start.left) / 2 : start.left\n };\n $.effects.createPlaceholder(element);\n\n if (options.mode === \"show\") {\n element.cssClip(animate.clip);\n animate.clip = start;\n }\n\n element.animate(animate, {\n queue: false,\n duration: options.duration,\n easing: options.easing,\n complete: done\n });\n });\n /*!\n * jQuery UI Effects Drop 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Drop Effect\n //>>group: Effects\n //>>description: Moves an element in one direction and hides it at the same time.\n //>>docs: http://api.jqueryui.com/drop-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effectsEffectDrop = $.effects.define(\"drop\", \"hide\", function (options, done) {\n var distance,\n element = $(this),\n mode = options.mode,\n show = mode === \"show\",\n direction = options.direction || \"left\",\n ref = direction === \"up\" || direction === \"down\" ? \"top\" : \"left\",\n motion = direction === \"up\" || direction === \"left\" ? \"-=\" : \"+=\",\n oppositeMotion = motion === \"+=\" ? \"-=\" : \"+=\",\n animation = {\n opacity: 0\n };\n $.effects.createPlaceholder(element);\n distance = options.distance || element[ref === \"top\" ? \"outerHeight\" : \"outerWidth\"](true) / 2;\n animation[ref] = motion + distance;\n\n if (show) {\n element.css(animation);\n animation[ref] = oppositeMotion + distance;\n animation.opacity = 1;\n } // Animate\n\n\n element.animate(animation, {\n queue: false,\n duration: options.duration,\n easing: options.easing,\n complete: done\n });\n });\n /*!\n * jQuery UI Effects Explode 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Explode Effect\n //>>group: Effects\n // jscs:disable maximumLineLength\n //>>description: Explodes an element in all directions into n pieces. Implodes an element to its original wholeness.\n // jscs:enable maximumLineLength\n //>>docs: http://api.jqueryui.com/explode-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effectsEffectExplode = $.effects.define(\"explode\", \"hide\", function (options, done) {\n var i,\n j,\n left,\n top,\n mx,\n my,\n rows = options.pieces ? Math.round(Math.sqrt(options.pieces)) : 3,\n cells = rows,\n element = $(this),\n mode = options.mode,\n show = mode === \"show\",\n // Show and then visibility:hidden the element before calculating offset\n offset = element.show().css(\"visibility\", \"hidden\").offset(),\n // Width and height of a piece\n width = Math.ceil(element.outerWidth() / cells),\n height = Math.ceil(element.outerHeight() / rows),\n pieces = []; // Children animate complete:\n\n function childComplete() {\n pieces.push(this);\n\n if (pieces.length === rows * cells) {\n animComplete();\n }\n } // Clone the element for each row and cell.\n\n\n for (i = 0; i < rows; i++) {\n // ===>\n top = offset.top + i * height;\n my = i - (rows - 1) / 2;\n\n for (j = 0; j < cells; j++) {\n // |||\n left = offset.left + j * width;\n mx = j - (cells - 1) / 2; // Create a clone of the now hidden main element that will be absolute positioned\n // within a wrapper div off the -left and -top equal to size of our pieces\n\n element.clone().appendTo(\"body\").wrap(\"
\").css({\n position: \"absolute\",\n visibility: \"visible\",\n left: -j * width,\n top: -i * height\n }) // Select the wrapper - make it overflow: hidden and absolute positioned based on\n // where the original was located +left and +top equal to the size of pieces\n .parent().addClass(\"ui-effects-explode\").css({\n position: \"absolute\",\n overflow: \"hidden\",\n width: width,\n height: height,\n left: left + (show ? mx * width : 0),\n top: top + (show ? my * height : 0),\n opacity: show ? 0 : 1\n }).animate({\n left: left + (show ? 0 : mx * width),\n top: top + (show ? 0 : my * height),\n opacity: show ? 1 : 0\n }, options.duration || 500, options.easing, childComplete);\n }\n }\n\n function animComplete() {\n element.css({\n visibility: \"visible\"\n });\n $(pieces).remove();\n done();\n }\n });\n /*!\n * jQuery UI Effects Fade 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Fade Effect\n //>>group: Effects\n //>>description: Fades the element.\n //>>docs: http://api.jqueryui.com/fade-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effectsEffectFade = $.effects.define(\"fade\", \"toggle\", function (options, done) {\n var show = options.mode === \"show\";\n $(this).css(\"opacity\", show ? 0 : 1).animate({\n opacity: show ? 1 : 0\n }, {\n queue: false,\n duration: options.duration,\n easing: options.easing,\n complete: done\n });\n });\n /*!\n * jQuery UI Effects Fold 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Fold Effect\n //>>group: Effects\n //>>description: Folds an element first horizontally and then vertically.\n //>>docs: http://api.jqueryui.com/fold-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effectsEffectFold = $.effects.define(\"fold\", \"hide\", function (options, done) {\n // Create element\n var element = $(this),\n mode = options.mode,\n show = mode === \"show\",\n hide = mode === \"hide\",\n size = options.size || 15,\n percent = /([0-9]+)%/.exec(size),\n horizFirst = !!options.horizFirst,\n ref = horizFirst ? [\"right\", \"bottom\"] : [\"bottom\", \"right\"],\n duration = options.duration / 2,\n placeholder = $.effects.createPlaceholder(element),\n start = element.cssClip(),\n animation1 = {\n clip: $.extend({}, start)\n },\n animation2 = {\n clip: $.extend({}, start)\n },\n distance = [start[ref[0]], start[ref[1]]],\n queuelen = element.queue().length;\n\n if (percent) {\n size = parseInt(percent[1], 10) / 100 * distance[hide ? 0 : 1];\n }\n\n animation1.clip[ref[0]] = size;\n animation2.clip[ref[0]] = size;\n animation2.clip[ref[1]] = 0;\n\n if (show) {\n element.cssClip(animation2.clip);\n\n if (placeholder) {\n placeholder.css($.effects.clipToBox(animation2));\n }\n\n animation2.clip = start;\n } // Animate\n\n\n element.queue(function (next) {\n if (placeholder) {\n placeholder.animate($.effects.clipToBox(animation1), duration, options.easing).animate($.effects.clipToBox(animation2), duration, options.easing);\n }\n\n next();\n }).animate(animation1, duration, options.easing).animate(animation2, duration, options.easing).queue(done);\n $.effects.unshift(element, queuelen, 4);\n });\n /*!\n * jQuery UI Effects Highlight 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Highlight Effect\n //>>group: Effects\n //>>description: Highlights the background of an element in a defined color for a custom duration.\n //>>docs: http://api.jqueryui.com/highlight-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effectsEffectHighlight = $.effects.define(\"highlight\", \"show\", function (options, done) {\n var element = $(this),\n animation = {\n backgroundColor: element.css(\"backgroundColor\")\n };\n\n if (options.mode === \"hide\") {\n animation.opacity = 0;\n }\n\n $.effects.saveStyle(element);\n element.css({\n backgroundImage: \"none\",\n backgroundColor: options.color || \"#ffff99\"\n }).animate(animation, {\n queue: false,\n duration: options.duration,\n easing: options.easing,\n complete: done\n });\n });\n /*!\n * jQuery UI Effects Size 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Size Effect\n //>>group: Effects\n //>>description: Resize an element to a specified width and height.\n //>>docs: http://api.jqueryui.com/size-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effectsEffectSize = $.effects.define(\"size\", function (options, done) {\n // Create element\n var baseline,\n factor,\n temp,\n element = $(this),\n // Copy for children\n cProps = [\"fontSize\"],\n vProps = [\"borderTopWidth\", \"borderBottomWidth\", \"paddingTop\", \"paddingBottom\"],\n hProps = [\"borderLeftWidth\", \"borderRightWidth\", \"paddingLeft\", \"paddingRight\"],\n // Set options\n mode = options.mode,\n restore = mode !== \"effect\",\n scale = options.scale || \"both\",\n origin = options.origin || [\"middle\", \"center\"],\n position = element.css(\"position\"),\n pos = element.position(),\n original = $.effects.scaledDimensions(element),\n from = options.from || original,\n to = options.to || $.effects.scaledDimensions(element, 0);\n $.effects.createPlaceholder(element);\n\n if (mode === \"show\") {\n temp = from;\n from = to;\n to = temp;\n } // Set scaling factor\n\n\n factor = {\n from: {\n y: from.height / original.height,\n x: from.width / original.width\n },\n to: {\n y: to.height / original.height,\n x: to.width / original.width\n }\n }; // Scale the css box\n\n if (scale === \"box\" || scale === \"both\") {\n // Vertical props scaling\n if (factor.from.y !== factor.to.y) {\n from = $.effects.setTransition(element, vProps, factor.from.y, from);\n to = $.effects.setTransition(element, vProps, factor.to.y, to);\n } // Horizontal props scaling\n\n\n if (factor.from.x !== factor.to.x) {\n from = $.effects.setTransition(element, hProps, factor.from.x, from);\n to = $.effects.setTransition(element, hProps, factor.to.x, to);\n }\n } // Scale the content\n\n\n if (scale === \"content\" || scale === \"both\") {\n // Vertical props scaling\n if (factor.from.y !== factor.to.y) {\n from = $.effects.setTransition(element, cProps, factor.from.y, from);\n to = $.effects.setTransition(element, cProps, factor.to.y, to);\n }\n } // Adjust the position properties based on the provided origin points\n\n\n if (origin) {\n baseline = $.effects.getBaseline(origin, original);\n from.top = (original.outerHeight - from.outerHeight) * baseline.y + pos.top;\n from.left = (original.outerWidth - from.outerWidth) * baseline.x + pos.left;\n to.top = (original.outerHeight - to.outerHeight) * baseline.y + pos.top;\n to.left = (original.outerWidth - to.outerWidth) * baseline.x + pos.left;\n }\n\n element.css(from); // Animate the children if desired\n\n if (scale === \"content\" || scale === \"both\") {\n vProps = vProps.concat([\"marginTop\", \"marginBottom\"]).concat(cProps);\n hProps = hProps.concat([\"marginLeft\", \"marginRight\"]); // Only animate children with width attributes specified\n // TODO: is this right? should we include anything with css width specified as well\n\n element.find(\"*[width]\").each(function () {\n var child = $(this),\n childOriginal = $.effects.scaledDimensions(child),\n childFrom = {\n height: childOriginal.height * factor.from.y,\n width: childOriginal.width * factor.from.x,\n outerHeight: childOriginal.outerHeight * factor.from.y,\n outerWidth: childOriginal.outerWidth * factor.from.x\n },\n childTo = {\n height: childOriginal.height * factor.to.y,\n width: childOriginal.width * factor.to.x,\n outerHeight: childOriginal.height * factor.to.y,\n outerWidth: childOriginal.width * factor.to.x\n }; // Vertical props scaling\n\n if (factor.from.y !== factor.to.y) {\n childFrom = $.effects.setTransition(child, vProps, factor.from.y, childFrom);\n childTo = $.effects.setTransition(child, vProps, factor.to.y, childTo);\n } // Horizontal props scaling\n\n\n if (factor.from.x !== factor.to.x) {\n childFrom = $.effects.setTransition(child, hProps, factor.from.x, childFrom);\n childTo = $.effects.setTransition(child, hProps, factor.to.x, childTo);\n }\n\n if (restore) {\n $.effects.saveStyle(child);\n } // Animate children\n\n\n child.css(childFrom);\n child.animate(childTo, options.duration, options.easing, function () {\n // Restore children\n if (restore) {\n $.effects.restoreStyle(child);\n }\n });\n });\n } // Animate\n\n\n element.animate(to, {\n queue: false,\n duration: options.duration,\n easing: options.easing,\n complete: function complete() {\n var offset = element.offset();\n\n if (to.opacity === 0) {\n element.css(\"opacity\", from.opacity);\n }\n\n if (!restore) {\n element.css(\"position\", position === \"static\" ? \"relative\" : position).offset(offset); // Need to save style here so that automatic style restoration\n // doesn't restore to the original styles from before the animation.\n\n $.effects.saveStyle(element);\n }\n\n done();\n }\n });\n });\n /*!\n * jQuery UI Effects Scale 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Scale Effect\n //>>group: Effects\n //>>description: Grows or shrinks an element and its content.\n //>>docs: http://api.jqueryui.com/scale-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effectsEffectScale = $.effects.define(\"scale\", function (options, done) {\n // Create element\n var el = $(this),\n mode = options.mode,\n percent = parseInt(options.percent, 10) || (parseInt(options.percent, 10) === 0 ? 0 : mode !== \"effect\" ? 0 : 100),\n newOptions = $.extend(true, {\n from: $.effects.scaledDimensions(el),\n to: $.effects.scaledDimensions(el, percent, options.direction || \"both\"),\n origin: options.origin || [\"middle\", \"center\"]\n }, options); // Fade option to support puff\n\n if (options.fade) {\n newOptions.from.opacity = 1;\n newOptions.to.opacity = 0;\n }\n\n $.effects.effect.size.call(this, newOptions, done);\n });\n /*!\n * jQuery UI Effects Puff 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Puff Effect\n //>>group: Effects\n //>>description: Creates a puff effect by scaling the element up and hiding it at the same time.\n //>>docs: http://api.jqueryui.com/puff-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effectsEffectPuff = $.effects.define(\"puff\", \"hide\", function (options, done) {\n var newOptions = $.extend(true, {}, options, {\n fade: true,\n percent: parseInt(options.percent, 10) || 150\n });\n $.effects.effect.scale.call(this, newOptions, done);\n });\n /*!\n * jQuery UI Effects Pulsate 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Pulsate Effect\n //>>group: Effects\n //>>description: Pulsates an element n times by changing the opacity to zero and back.\n //>>docs: http://api.jqueryui.com/pulsate-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effectsEffectPulsate = $.effects.define(\"pulsate\", \"show\", function (options, done) {\n var element = $(this),\n mode = options.mode,\n show = mode === \"show\",\n hide = mode === \"hide\",\n showhide = show || hide,\n // Showing or hiding leaves off the \"last\" animation\n anims = (options.times || 5) * 2 + (showhide ? 1 : 0),\n duration = options.duration / anims,\n animateTo = 0,\n i = 1,\n queuelen = element.queue().length;\n\n if (show || !element.is(\":visible\")) {\n element.css(\"opacity\", 0).show();\n animateTo = 1;\n } // Anims - 1 opacity \"toggles\"\n\n\n for (; i < anims; i++) {\n element.animate({\n opacity: animateTo\n }, duration, options.easing);\n animateTo = 1 - animateTo;\n }\n\n element.animate({\n opacity: animateTo\n }, duration, options.easing);\n element.queue(done);\n $.effects.unshift(element, queuelen, anims + 1);\n });\n /*!\n * jQuery UI Effects Shake 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Shake Effect\n //>>group: Effects\n //>>description: Shakes an element horizontally or vertically n times.\n //>>docs: http://api.jqueryui.com/shake-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effectsEffectShake = $.effects.define(\"shake\", function (options, done) {\n var i = 1,\n element = $(this),\n direction = options.direction || \"left\",\n distance = options.distance || 20,\n times = options.times || 3,\n anims = times * 2 + 1,\n speed = Math.round(options.duration / anims),\n ref = direction === \"up\" || direction === \"down\" ? \"top\" : \"left\",\n positiveMotion = direction === \"up\" || direction === \"left\",\n animation = {},\n animation1 = {},\n animation2 = {},\n queuelen = element.queue().length;\n $.effects.createPlaceholder(element); // Animation\n\n animation[ref] = (positiveMotion ? \"-=\" : \"+=\") + distance;\n animation1[ref] = (positiveMotion ? \"+=\" : \"-=\") + distance * 2;\n animation2[ref] = (positiveMotion ? \"-=\" : \"+=\") + distance * 2; // Animate\n\n element.animate(animation, speed, options.easing); // Shakes\n\n for (; i < times; i++) {\n element.animate(animation1, speed, options.easing).animate(animation2, speed, options.easing);\n }\n\n element.animate(animation1, speed, options.easing).animate(animation, speed / 2, options.easing).queue(done);\n $.effects.unshift(element, queuelen, anims + 1);\n });\n /*!\n * jQuery UI Effects Slide 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Slide Effect\n //>>group: Effects\n //>>description: Slides an element in and out of the viewport.\n //>>docs: http://api.jqueryui.com/slide-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effectsEffectSlide = $.effects.define(\"slide\", \"show\", function (options, done) {\n var startClip,\n startRef,\n element = $(this),\n map = {\n up: [\"bottom\", \"top\"],\n down: [\"top\", \"bottom\"],\n left: [\"right\", \"left\"],\n right: [\"left\", \"right\"]\n },\n mode = options.mode,\n direction = options.direction || \"left\",\n ref = direction === \"up\" || direction === \"down\" ? \"top\" : \"left\",\n positiveMotion = direction === \"up\" || direction === \"left\",\n distance = options.distance || element[ref === \"top\" ? \"outerHeight\" : \"outerWidth\"](true),\n animation = {};\n $.effects.createPlaceholder(element);\n startClip = element.cssClip();\n startRef = element.position()[ref]; // Define hide animation\n\n animation[ref] = (positiveMotion ? -1 : 1) * distance + startRef;\n animation.clip = element.cssClip();\n animation.clip[map[direction][1]] = animation.clip[map[direction][0]]; // Reverse the animation if we're showing\n\n if (mode === \"show\") {\n element.cssClip(animation.clip);\n element.css(ref, animation[ref]);\n animation.clip = startClip;\n animation[ref] = startRef;\n } // Actually animate\n\n\n element.animate(animation, {\n queue: false,\n duration: options.duration,\n easing: options.easing,\n complete: done\n });\n });\n /*!\n * jQuery UI Effects Transfer 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Transfer Effect\n //>>group: Effects\n //>>description: Displays a transfer effect from one element to another.\n //>>docs: http://api.jqueryui.com/transfer-effect/\n //>>demos: http://jqueryui.com/effect/\n\n var effect;\n\n if ($.uiBackCompat !== false) {\n effect = $.effects.define(\"transfer\", function (options, done) {\n $(this).transfer(options, done);\n });\n }\n\n var effectsEffectTransfer = effect;\n /*!\n * jQuery UI Focusable 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: :focusable Selector\n //>>group: Core\n //>>description: Selects elements which can be focused.\n //>>docs: http://api.jqueryui.com/focusable-selector/\n // Selectors\n\n $.ui.focusable = function (element, hasTabindex) {\n var map,\n mapName,\n img,\n focusableIfVisible,\n fieldset,\n nodeName = element.nodeName.toLowerCase();\n\n if (\"area\" === nodeName) {\n map = element.parentNode;\n mapName = map.name;\n\n if (!element.href || !mapName || map.nodeName.toLowerCase() !== \"map\") {\n return false;\n }\n\n img = $(\"img[usemap='#\" + mapName + \"']\");\n return img.length > 0 && img.is(\":visible\");\n }\n\n if (/^(input|select|textarea|button|object)$/.test(nodeName)) {\n focusableIfVisible = !element.disabled;\n\n if (focusableIfVisible) {\n // Form controls within a disabled fieldset are disabled.\n // However, controls within the fieldset's legend do not get disabled.\n // Since controls generally aren't placed inside legends, we skip\n // this portion of the check.\n fieldset = $(element).closest(\"fieldset\")[0];\n\n if (fieldset) {\n focusableIfVisible = !fieldset.disabled;\n }\n }\n } else if (\"a\" === nodeName) {\n focusableIfVisible = element.href || hasTabindex;\n } else {\n focusableIfVisible = hasTabindex;\n }\n\n return focusableIfVisible && $(element).is(\":visible\") && visible($(element));\n }; // Support: IE 8 only\n // IE 8 doesn't resolve inherit to visible/hidden for computed values\n\n\n function visible(element) {\n var visibility = element.css(\"visibility\");\n\n while (visibility === \"inherit\") {\n element = element.parent();\n visibility = element.css(\"visibility\");\n }\n\n return visibility !== \"hidden\";\n }\n\n $.extend($.expr[\":\"], {\n focusable: function focusable(element) {\n return $.ui.focusable(element, $.attr(element, \"tabindex\") != null);\n }\n });\n var focusable = $.ui.focusable; // Support: IE8 Only\n // IE8 does not support the form attribute and when it is supplied. It overwrites the form prop\n // with a string, so we need to find the proper form.\n\n var form = $.fn.form = function () {\n return typeof this[0].form === \"string\" ? this.closest(\"form\") : $(this[0].form);\n };\n /*!\n * jQuery UI Form Reset Mixin 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Form Reset Mixin\n //>>group: Core\n //>>description: Refresh input widgets when their form is reset\n //>>docs: http://api.jqueryui.com/form-reset-mixin/\n\n\n var formResetMixin = $.ui.formResetMixin = {\n _formResetHandler: function _formResetHandler() {\n var form = $(this); // Wait for the form reset to actually happen before refreshing\n\n setTimeout(function () {\n var instances = form.data(\"ui-form-reset-instances\");\n $.each(instances, function () {\n this.refresh();\n });\n });\n },\n _bindFormResetHandler: function _bindFormResetHandler() {\n this.form = this.element.form();\n\n if (!this.form.length) {\n return;\n }\n\n var instances = this.form.data(\"ui-form-reset-instances\") || [];\n\n if (!instances.length) {\n // We don't use _on() here because we use a single event handler per form\n this.form.on(\"reset.ui-form-reset\", this._formResetHandler);\n }\n\n instances.push(this);\n this.form.data(\"ui-form-reset-instances\", instances);\n },\n _unbindFormResetHandler: function _unbindFormResetHandler() {\n if (!this.form.length) {\n return;\n }\n\n var instances = this.form.data(\"ui-form-reset-instances\");\n instances.splice($.inArray(this, instances), 1);\n\n if (instances.length) {\n this.form.data(\"ui-form-reset-instances\", instances);\n } else {\n this.form.removeData(\"ui-form-reset-instances\").off(\"reset.ui-form-reset\");\n }\n }\n };\n /*!\n * jQuery UI Support for jQuery core 1.7.x 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n *\n */\n //>>label: jQuery 1.7 Support\n //>>group: Core\n //>>description: Support version 1.7.x of jQuery core\n // Support: jQuery 1.7 only\n // Not a great way to check versions, but since we only support 1.7+ and only\n // need to detect <1.8, this is a simple check that should suffice. Checking\n // for \"1.7.\" would be a bit safer, but the version string is 1.7, not 1.7.0\n // and we'll never reach 1.70.0 (if we do, we certainly won't be supporting\n // 1.7 anymore). See #11197 for why we're not using feature detection.\n\n if ($.fn.jquery.substring(0, 3) === \"1.7\") {\n // Setters for .innerWidth(), .innerHeight(), .outerWidth(), .outerHeight()\n // Unlike jQuery Core 1.8+, these only support numeric values to set the\n // dimensions in pixels\n $.each([\"Width\", \"Height\"], function (i, name) {\n var side = name === \"Width\" ? [\"Left\", \"Right\"] : [\"Top\", \"Bottom\"],\n type = name.toLowerCase(),\n orig = {\n innerWidth: $.fn.innerWidth,\n innerHeight: $.fn.innerHeight,\n outerWidth: $.fn.outerWidth,\n outerHeight: $.fn.outerHeight\n };\n\n function reduce(elem, size, border, margin) {\n $.each(side, function () {\n size -= parseFloat($.css(elem, \"padding\" + this)) || 0;\n\n if (border) {\n size -= parseFloat($.css(elem, \"border\" + this + \"Width\")) || 0;\n }\n\n if (margin) {\n size -= parseFloat($.css(elem, \"margin\" + this)) || 0;\n }\n });\n return size;\n }\n\n $.fn[\"inner\" + name] = function (size) {\n if (size === undefined) {\n return orig[\"inner\" + name].call(this);\n }\n\n return this.each(function () {\n $(this).css(type, reduce(this, size) + \"px\");\n });\n };\n\n $.fn[\"outer\" + name] = function (size, margin) {\n if (typeof size !== \"number\") {\n return orig[\"outer\" + name].call(this, size);\n }\n\n return this.each(function () {\n $(this).css(type, reduce(this, size, true, margin) + \"px\");\n });\n };\n });\n\n $.fn.addBack = function (selector) {\n return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector));\n };\n }\n\n ;\n /*!\n * jQuery UI Keycode 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Keycode\n //>>group: Core\n //>>description: Provide keycodes as keynames\n //>>docs: http://api.jqueryui.com/jQuery.ui.keyCode/\n\n var keycode = $.ui.keyCode = {\n BACKSPACE: 8,\n COMMA: 188,\n DELETE: 46,\n DOWN: 40,\n END: 35,\n ENTER: 13,\n ESCAPE: 27,\n HOME: 36,\n LEFT: 37,\n PAGE_DOWN: 34,\n PAGE_UP: 33,\n PERIOD: 190,\n RIGHT: 39,\n SPACE: 32,\n TAB: 9,\n UP: 38\n }; // Internal use only\n\n var escapeSelector = $.ui.escapeSelector = function () {\n var selectorEscape = /([!\"#$%&'()*+,./:;<=>?@[\\]^`{|}~])/g;\n return function (selector) {\n return selector.replace(selectorEscape, \"\\\\$1\");\n };\n }();\n /*!\n * jQuery UI Labels 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: labels\n //>>group: Core\n //>>description: Find all the labels associated with a given input\n //>>docs: http://api.jqueryui.com/labels/\n\n\n var labels = $.fn.labels = function () {\n var ancestor, selector, id, labels, ancestors; // Check control.labels first\n\n if (this[0].labels && this[0].labels.length) {\n return this.pushStack(this[0].labels);\n } // Support: IE <= 11, FF <= 37, Android <= 2.3 only\n // Above browsers do not support control.labels. Everything below is to support them\n // as well as document fragments. control.labels does not work on document fragments\n\n\n labels = this.eq(0).parents(\"label\"); // Look for the label based on the id\n\n id = this.attr(\"id\");\n\n if (id) {\n // We don't search against the document in case the element\n // is disconnected from the DOM\n ancestor = this.eq(0).parents().last(); // Get a full set of top level ancestors\n\n ancestors = ancestor.add(ancestor.length ? ancestor.siblings() : this.siblings()); // Create a selector for the label based on the id\n\n selector = \"label[for='\" + $.ui.escapeSelector(id) + \"']\";\n labels = labels.add(ancestors.find(selector).addBack(selector));\n } // Return whatever we have found for labels\n\n\n return this.pushStack(labels);\n };\n /*!\n * jQuery UI Scroll Parent 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: scrollParent\n //>>group: Core\n //>>description: Get the closest ancestor element that is scrollable.\n //>>docs: http://api.jqueryui.com/scrollParent/\n\n\n var scrollParent = $.fn.scrollParent = function (includeHidden) {\n var position = this.css(\"position\"),\n excludeStaticParent = position === \"absolute\",\n overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/,\n scrollParent = this.parents().filter(function () {\n var parent = $(this);\n\n if (excludeStaticParent && parent.css(\"position\") === \"static\") {\n return false;\n }\n\n return overflowRegex.test(parent.css(\"overflow\") + parent.css(\"overflow-y\") + parent.css(\"overflow-x\"));\n }).eq(0);\n return position === \"fixed\" || !scrollParent.length ? $(this[0].ownerDocument || document) : scrollParent;\n };\n /*!\n * jQuery UI Tabbable 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: :tabbable Selector\n //>>group: Core\n //>>description: Selects elements which can be tabbed to.\n //>>docs: http://api.jqueryui.com/tabbable-selector/\n\n\n var tabbable = $.extend($.expr[\":\"], {\n tabbable: function tabbable(element) {\n var tabIndex = $.attr(element, \"tabindex\"),\n hasTabindex = tabIndex != null;\n return (!hasTabindex || tabIndex >= 0) && $.ui.focusable(element, hasTabindex);\n }\n });\n /*!\n * jQuery UI Unique ID 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: uniqueId\n //>>group: Core\n //>>description: Functions to generate and remove uniqueId's\n //>>docs: http://api.jqueryui.com/uniqueId/\n\n var uniqueId = $.fn.extend({\n uniqueId: function () {\n var uuid = 0;\n return function () {\n return this.each(function () {\n if (!this.id) {\n this.id = \"ui-id-\" + ++uuid;\n }\n });\n };\n }(),\n removeUniqueId: function removeUniqueId() {\n return this.each(function () {\n if (/^ui-id-\\d+$/.test(this.id)) {\n $(this).removeAttr(\"id\");\n }\n });\n }\n });\n /*!\n * jQuery UI Accordion 1.12.1\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n //>>label: Accordion\n //>>group: Widgets\n // jscs:disable maximumLineLength\n //>>description: Displays collapsible content panels for presenting information in a limited amount of space.\n // jscs:enable maximumLineLength\n //>>docs: http://api.jqueryui.com/accordion/\n //>>demos: http://jqueryui.com/accordion/\n //>>css.structure: ../../themes/base/core.css\n //>>css.structure: ../../themes/base/accordion.css\n //>>css.theme: ../../themes/base/theme.css\n\n var widgetsAccordion = $.widget(\"ui.accordion\", {\n version: \"1.12.1\",\n options: {\n active: 0,\n animate: {},\n classes: {\n \"ui-accordion-header\": \"ui-corner-top\",\n \"ui-accordion-header-collapsed\": \"ui-corner-all\",\n \"ui-accordion-content\": \"ui-corner-bottom\"\n },\n collapsible: false,\n event: \"click\",\n header: \"> li > :first-child, > :not(li):even\",\n heightStyle: \"auto\",\n icons: {\n activeHeader: \"ui-icon-triangle-1-s\",\n header: \"ui-icon-triangle-1-e\"\n },\n // Callbacks\n activate: null,\n beforeActivate: null\n },\n hideProps: {\n borderTopWidth: \"hide\",\n borderBottomWidth: \"hide\",\n paddingTop: \"hide\",\n paddingBottom: \"hide\",\n height: \"hide\"\n },\n showProps: {\n borderTopWidth: \"show\",\n borderBottomWidth: \"show\",\n paddingTop: \"show\",\n paddingBottom: \"show\",\n height: \"show\"\n },\n _create: function _create() {\n var options = this.options;\n this.prevShow = this.prevHide = $();\n\n this._addClass(\"ui-accordion\", \"ui-widget ui-helper-reset\");\n\n this.element.attr(\"role\", \"tablist\"); // Don't allow collapsible: false and active: false / null\n\n if (!options.collapsible && (options.active === false || options.active == null)) {\n options.active = 0;\n }\n\n this._processPanels(); // handle negative values\n\n\n if (options.active < 0) {\n options.active += this.headers.length;\n }\n\n this._refresh();\n },\n _getCreateEventData: function _getCreateEventData() {\n return {\n header: this.active,\n panel: !this.active.length ? $() : this.active.next()\n };\n },\n _createIcons: function _createIcons() {\n var icon,\n children,\n icons = this.options.icons;\n\n if (icons) {\n icon = $(\"
\");\n\n this._addClass(icon, \"ui-accordion-header-icon\", \"ui-icon \" + icons.header);\n\n icon.prependTo(this.headers);\n children = this.active.children(\".ui-accordion-header-icon\");\n\n this._removeClass(children, icons.header)._addClass(children, null, icons.activeHeader)._addClass(this.headers, \"ui-accordion-icons\");\n }\n },\n _destroyIcons: function _destroyIcons() {\n this._removeClass(this.headers, \"ui-accordion-icons\");\n\n this.headers.children(\".ui-accordion-header-icon\").remove();\n },\n _destroy: function _destroy() {\n var contents; // Clean up main element\n\n this.element.removeAttr(\"role\"); // Clean up headers\n\n this.headers.removeAttr(\"role aria-expanded aria-selected aria-controls tabIndex\").removeUniqueId();\n\n this._destroyIcons(); // Clean up content panels\n\n\n contents = this.headers.next().css(\"display\", \"\").removeAttr(\"role aria-hidden aria-labelledby\").removeUniqueId();\n\n if (this.options.heightStyle !== \"content\") {\n contents.css(\"height\", \"\");\n }\n },\n _setOption: function _setOption(key, value) {\n if (key === \"active\") {\n // _activate() will handle invalid values and update this.options\n this._activate(value);\n\n return;\n }\n\n if (key === \"event\") {\n if (this.options.event) {\n this._off(this.headers, this.options.event);\n }\n\n this._setupEvents(value);\n }\n\n this._super(key, value); // Setting collapsible: false while collapsed; open first panel\n\n\n if (key === \"collapsible\" && !value && this.options.active === false) {\n this._activate(0);\n }\n\n if (key === \"icons\") {\n this._destroyIcons();\n\n if (value) {\n this._createIcons();\n }\n }\n },\n _setOptionDisabled: function _setOptionDisabled(value) {\n this._super(value);\n\n this.element.attr(\"aria-disabled\", value); // Support: IE8 Only\n // #5332 / #6059 - opacity doesn't cascade to positioned elements in IE\n // so we need to add the disabled class to the headers and panels\n\n this._toggleClass(null, \"ui-state-disabled\", !!value);\n\n this._toggleClass(this.headers.add(this.headers.next()), null, \"ui-state-disabled\", !!value);\n },\n _keydown: function _keydown(event) {\n if (event.altKey || event.ctrlKey) {\n return;\n }\n\n var keyCode = $.ui.keyCode,\n length = this.headers.length,\n currentIndex = this.headers.index(event.target),\n toFocus = false;\n\n switch (event.keyCode) {\n case keyCode.RIGHT:\n case keyCode.DOWN:\n toFocus = this.headers[(currentIndex + 1) % length];\n break;\n\n case keyCode.LEFT:\n case keyCode.UP:\n toFocus = this.headers[(currentIndex - 1 + length) % length];\n break;\n\n case keyCode.SPACE:\n case keyCode.ENTER:\n this._eventHandler(event);\n\n break;\n\n case keyCode.HOME:\n toFocus = this.headers[0];\n break;\n\n case keyCode.END:\n toFocus = this.headers[length - 1];\n break;\n }\n\n if (toFocus) {\n $(event.target).attr(\"tabIndex\", -1);\n $(toFocus).attr(\"tabIndex\", 0);\n $(toFocus).trigger(\"focus\");\n event.preventDefault();\n }\n },\n _panelKeyDown: function _panelKeyDown(event) {\n if (event.keyCode === $.ui.keyCode.UP && event.ctrlKey) {\n $(event.currentTarget).prev().trigger(\"focus\");\n }\n },\n refresh: function refresh() {\n var options = this.options;\n\n this._processPanels(); // Was collapsed or no panel\n\n\n if (options.active === false && options.collapsible === true || !this.headers.length) {\n options.active = false;\n this.active = $(); // active false only when collapsible is true\n } else if (options.active === false) {\n this._activate(0); // was active, but active panel is gone\n\n } else if (this.active.length && !$.contains(this.element[0], this.active[0])) {\n // all remaining panel are disabled\n if (this.headers.length === this.headers.find(\".ui-state-disabled\").length) {\n options.active = false;\n this.active = $(); // activate previous panel\n } else {\n this._activate(Math.max(0, options.active - 1));\n } // was active, active panel still exists\n\n } else {\n // make sure active index is correct\n options.active = this.headers.index(this.active);\n }\n\n this._destroyIcons();\n\n this._refresh();\n },\n _processPanels: function _processPanels() {\n var prevHeaders = this.headers,\n prevPanels = this.panels;\n this.headers = this.element.find(this.options.header);\n\n this._addClass(this.headers, \"ui-accordion-header ui-accordion-header-collapsed\", \"ui-state-default\");\n\n this.panels = this.headers.next().filter(\":not(.ui-accordion-content-active)\").hide();\n\n this._addClass(this.panels, \"ui-accordion-content\", \"ui-helper-reset ui-widget-content\"); // Avoid memory leaks (#10056)\n\n\n if (prevPanels) {\n this._off(prevHeaders.not(this.headers));\n\n this._off(prevPanels.not(this.panels));\n }\n },\n _refresh: function _refresh() {\n var maxHeight,\n options = this.options,\n heightStyle = options.heightStyle,\n parent = this.element.parent();\n this.active = this._findActive(options.active);\n\n this._addClass(this.active, \"ui-accordion-header-active\", \"ui-state-active\")._removeClass(this.active, \"ui-accordion-header-collapsed\");\n\n this._addClass(this.active.next(), \"ui-accordion-content-active\");\n\n this.active.next().show();\n this.headers.attr(\"role\", \"tab\").each(function () {\n var header = $(this),\n headerId = header.uniqueId().attr(\"id\"),\n panel = header.next(),\n panelId = panel.uniqueId().attr(\"id\");\n header.attr(\"aria-controls\", panelId);\n panel.attr(\"aria-labelledby\", headerId);\n }).next().attr(\"role\", \"tabpanel\");\n this.headers.not(this.active).attr({\n \"aria-selected\": \"false\",\n \"aria-expanded\": \"false\",\n tabIndex: -1\n }).next().attr({\n \"aria-hidden\": \"true\"\n }).hide(); // Make sure at least one header is in the tab order\n\n if (!this.active.length) {\n this.headers.eq(0).attr(\"tabIndex\", 0);\n } else {\n this.active.attr({\n \"aria-selected\": \"true\",\n \"aria-expanded\": \"true\",\n tabIndex: 0\n }).next().attr({\n \"aria-hidden\": \"false\"\n });\n }\n\n this._createIcons();\n\n this._setupEvents(options.event);\n\n if (heightStyle === \"fill\") {\n maxHeight = parent.height();\n this.element.siblings(\":visible\").each(function () {\n var elem = $(this),\n position = elem.css(\"position\");\n\n if (position === \"absolute\" || position === \"fixed\") {\n return;\n }\n\n maxHeight -= elem.outerHeight(true);\n });\n this.headers.each(function () {\n maxHeight -= $(this).outerHeight(true);\n });\n this.headers.next().each(function () {\n $(this).height(Math.max(0, maxHeight - $(this).innerHeight() + $(this).height()));\n }).css(\"overflow\", \"auto\");\n } else if (heightStyle === \"auto\") {\n maxHeight = 0;\n this.headers.next().each(function () {\n var isVisible = $(this).is(\":visible\");\n\n if (!isVisible) {\n $(this).show();\n }\n\n maxHeight = Math.max(maxHeight, $(this).css(\"height\", \"\").height());\n\n if (!isVisible) {\n $(this).hide();\n }\n }).height(maxHeight);\n }\n },\n _activate: function _activate(index) {\n var active = this._findActive(index)[0]; // Trying to activate the already active panel\n\n\n if (active === this.active[0]) {\n return;\n } // Trying to collapse, simulate a click on the currently active header\n\n\n active = active || this.active[0];\n\n this._eventHandler({\n target: active,\n currentTarget: active,\n preventDefault: $.noop\n });\n },\n _findActive: function _findActive(selector) {\n return typeof selector === \"number\" ? this.headers.eq(selector) : $();\n },\n _setupEvents: function _setupEvents(event) {\n var events = {\n keydown: \"_keydown\"\n };\n\n if (event) {\n $.each(event.split(\" \"), function (index, eventName) {\n events[eventName] = \"_eventHandler\";\n });\n }\n\n this._off(this.headers.add(this.headers.next()));\n\n this._on(this.headers, events);\n\n this._on(this.headers.next(), {\n keydown: \"_panelKeyDown\"\n });\n\n this._hoverable(this.headers);\n\n this._focusable(this.headers);\n },\n _eventHandler: function _eventHandler(event) {\n var activeChildren,\n clickedChildren,\n options = this.options,\n active = this.active,\n clicked = $(event.currentTarget),\n clickedIsActive = clicked[0] === active[0],\n collapsing = clickedIsActive && options.collapsible,\n toShow = collapsing ? $() : clicked.next(),\n toHide = active.next(),\n eventData = {\n oldHeader: active,\n oldPanel: toHide,\n newHeader: collapsing ? $() : clicked,\n newPanel: toShow\n };\n event.preventDefault();\n\n if ( // click on active header, but not collapsible\n clickedIsActive && !options.collapsible || // allow canceling activation\n this._trigger(\"beforeActivate\", event, eventData) === false) {\n return;\n }\n\n options.active = collapsing ? false : this.headers.index(clicked); // When the call to ._toggle() comes after the class changes\n // it causes a very odd bug in IE 8 (see #6720)\n\n this.active = clickedIsActive ? $() : clicked;\n\n this._toggle(eventData); // Switch classes\n // corner classes on the previously active header stay after the animation\n\n\n this._removeClass(active, \"ui-accordion-header-active\", \"ui-state-active\");\n\n if (options.icons) {\n activeChildren = active.children(\".ui-accordion-header-icon\");\n\n this._removeClass(activeChildren, null, options.icons.activeHeader)._addClass(activeChildren, null, options.icons.header);\n }\n\n if (!clickedIsActive) {\n this._removeClass(clicked, \"ui-accordion-header-collapsed\")._addClass(clicked, \"ui-accordion-header-active\", \"ui-state-active\");\n\n if (options.icons) {\n clickedChildren = clicked.children(\".ui-accordion-header-icon\");\n\n this._removeClass(clickedChildren, null, options.icons.header)._addClass(clickedChildren, null, options.icons.activeHeader);\n }\n\n this._addClass(clicked.next(), \"ui-accordion-content-active\");\n }\n },\n _toggle: function _toggle(data) {\n var toShow = data.newPanel,\n toHide = this.prevShow.length ? this.prevShow : data.oldPanel; // Handle activating a panel during the animation for another activation\n\n this.prevShow.add(this.prevHide).stop(true, true);\n this.prevShow = toShow;\n this.prevHide = toHide;\n\n if (this.options.animate) {\n this._animate(toShow, toHide, data);\n } else {\n toHide.hide();\n toShow.show();\n\n this._toggleComplete(data);\n }\n\n toHide.attr({\n \"aria-hidden\": \"true\"\n });\n toHide.prev().attr({\n \"aria-selected\": \"false\",\n \"aria-expanded\": \"false\"\n }); // if we're switching panels, remove the old header from the tab order\n // if we're opening from collapsed state, remove the previous header from the tab order\n // if we're collapsing, then keep the collapsing header in the tab order\n\n if (toShow.length && toHide.length) {\n toHide.prev().attr({\n \"tabIndex\": -1,\n \"aria-expanded\": \"false\"\n });\n } else if (toShow.length) {\n this.headers.filter(function () {\n return parseInt($(this).attr(\"tabIndex\"), 10) === 0;\n }).attr(\"tabIndex\", -1);\n }\n\n toShow.attr(\"aria-hidden\", \"false\").prev().attr({\n \"aria-selected\": \"true\",\n \"aria-expanded\": \"true\",\n tabIndex: 0\n });\n },\n _animate: function _animate(toShow, toHide, data) {\n var total,\n easing,\n duration,\n that = this,\n adjust = 0,\n boxSizing = toShow.css(\"box-sizing\"),\n down = toShow.length && (!toHide.length || toShow.index() < toHide.index()),\n animate = this.options.animate || {},\n options = down && animate.down || animate,\n complete = function complete() {\n that._toggleComplete(data);\n };\n\n if (typeof options === \"number\") {\n duration = options;\n }\n\n if (typeof options === \"string\") {\n easing = options;\n } // fall back from options to animation in case of partial down settings\n\n\n easing = easing || options.easing || animate.easing;\n duration = duration || options.duration || animate.duration;\n\n if (!toHide.length) {\n return toShow.animate(this.showProps, duration, easing, complete);\n }\n\n if (!toShow.length) {\n return toHide.animate(this.hideProps, duration, easing, complete);\n }\n\n total = toShow.show().outerHeight();\n toHide.animate(this.hideProps, {\n duration: duration,\n easing: easing,\n step: function step(now, fx) {\n fx.now = Math.round(now);\n }\n });\n toShow.hide().animate(this.showProps, {\n duration: duration,\n easing: easing,\n complete: complete,\n step: function step(now, fx) {\n fx.now = Math.round(now);\n\n if (fx.prop !== \"height\") {\n if (boxSizing === \"content-box\") {\n adjust += fx.now;\n }\n } else if (that.options.heightStyle !== \"content\") {\n fx.now = Math.round(total - toHide.outerHeight() - adjust);\n adjust = 0;\n }\n }\n });\n },\n _toggleComplete: function _toggleComplete(data) {\n var toHide = data.oldPanel,\n prev = toHide.prev();\n\n this._removeClass(toHide, \"ui-accordion-content-active\");\n\n this._removeClass(prev, \"ui-accordion-header-active\")._addClass(prev, \"ui-accordion-header-collapsed\"); // Work around for rendering bug in IE (#5421)\n\n\n if (toHide.length) {\n toHide.parent()[0].className = toHide.parent()[0].className;\n }\n\n this._trigger(\"activate\", null, data);\n }\n });\n\n var safeActiveElement = $.ui.safeActiveElement = function (document) {\n var activeElement; // Support: IE 9 only\n // IE9 throws an \"Unspecified error\" accessing document.activeElement from an