From 373004a86e3bdfdbf343dc0e5518fd25f9045cd3 Mon Sep 17 00:00:00 2001 From: Jordi Sala Morales Date: Wed, 28 Apr 2021 08:06:13 +0200 Subject: [PATCH] Move Sonata javascript to assets directory (#7106) * Move files and adjust spaces to 2 * lint files * use noframework of waypoints --- .eslintrc.js | 4 - .eslintrc.json | 8 + assets/js/Admin.js | 857 ++++++++++++++++++ assets/js/app.js | 11 +- assets/js/base.js | 27 + assets/js/jquery.confirmExit.js | 43 + .../Resources/public => assets/js}/sidebar.js | 12 +- assets/js/treeview.js | 106 +++ src/DependencyInjection/Configuration.php | 5 - src/Resources/public/Admin.js | 857 ------------------ src/Resources/public/base.js | 27 - src/Resources/public/dist/app.js | 2 +- src/Resources/public/jquery.confirmExit.js | 43 - src/Resources/public/treeview.js | 108 --- webpack.config.js | 4 +- 15 files changed, 1060 insertions(+), 1054 deletions(-) delete mode 100644 .eslintrc.js create mode 100644 .eslintrc.json create mode 100644 assets/js/Admin.js create mode 100644 assets/js/base.js create mode 100644 assets/js/jquery.confirmExit.js rename {src/Resources/public => assets/js}/sidebar.js (51%) create mode 100644 assets/js/treeview.js delete mode 100644 src/Resources/public/Admin.js delete mode 100644 src/Resources/public/base.js delete mode 100644 src/Resources/public/jquery.confirmExit.js delete mode 100644 src/Resources/public/treeview.js diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 7697896258..0000000000 --- a/.eslintrc.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - parser: '@babel/eslint-parser', - extends: ['eslint:recommended'] -} diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000000..9981a0faeb --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,8 @@ +{ + "parser": "@babel/eslint-parser", + "extends": ["eslint:recommended"], + "env": { + "browser": true, + "jquery": true + } +} diff --git a/assets/js/Admin.js b/assets/js/Admin.js new file mode 100644 index 0000000000..efd830204a --- /dev/null +++ b/assets/js/Admin.js @@ -0,0 +1,857 @@ +/* + + This file is part of the Sonata package. + + (c) Thomas Rabaix + + For the full copyright and license information, please view the LICENSE + file that was distributed with this source code. + + */ + +var Admin = { + + collectionCounters: [], + config: null, + translations: null, + + /** + * This function must be called when an ajax call is done, to ensure + * the retrieved html is properly setup + * + * @param subject + */ + shared_setup: function(subject) { + Admin.read_config(); + Admin.log("[core|shared_setup] Register services on", subject); + Admin.setup_ie10_polyfill(); + Admin.set_object_field_value(subject); + Admin.add_filters(subject); + Admin.setup_select2(subject); + Admin.setup_icheck(subject); + Admin.setup_checkbox_range_selection(subject); + Admin.setup_xeditable(subject); + Admin.setup_form_tabs_for_errors(subject); + Admin.setup_inline_form_errors(subject); + Admin.setup_tree_view(subject); + Admin.setup_collection_counter(subject); + Admin.setup_sticky_elements(subject); + Admin.setup_readmore_elements(subject); + Admin.setup_form_submit(subject); + + // Admin.setup_list_modal(subject); + }, + setup_ie10_polyfill: function() { + // http://getbootstrap.com/getting-started/#support-ie10-width + if (navigator.userAgent.match(/IEMobile\/10\.0/)) { + var msViewportStyle = document.createElement('style'); + msViewportStyle.appendChild(document.createTextNode('@-ms-viewport{width:auto!important}')); + document.querySelector('head').appendChild(msViewportStyle); + } + }, + read_config: function() { + var data = $('[data-sonata-admin]').data('sonata-admin'); + + this.config = data.config; + this.translations = data.translations; + }, + get_config: function(key) { + if (this.config == null) { + this.read_config(); + } + + return this.config[key]; + }, + get_translations: function(key) { + if (this.translations == null) { + this.read_config(); + } + + return this.translations[key]; + }, + setup_list_modal: function(modal) { + Admin.log('[core|setup_list_modal] configure modal on', modal); + // this will force relation modal to open list of entity in a wider modal + // to improve readability + jQuery('div.modal-dialog', modal).css({ + width: '90%', //choose your width + height: '85%', + padding: 0 + }); + jQuery('div.modal-content', modal).css({ + 'border-radius':'0', + height: '100%', + padding: 0 + }); + jQuery('.modal-body', modal).css({ + width: 'auto', + height: '90%', + padding: 15, + overflow: 'auto' + }); + + jQuery(modal).trigger('sonata-admin-setup-list-modal'); + }, + setup_select2: function(subject) { + if (Admin.get_config('USE_SELECT2')) { + Admin.log('[core|setup_select2] configure Select2 on', subject); + + jQuery('select:not([data-sonata-select2="false"])', subject).each(function() { + var select = jQuery(this); + var allowClearEnabled = false; + var popover = select.data('popover'); + var maximumSelectionSize = null; + var minimumResultsForSearch = 10; + + select.removeClass('form-control'); + + if (select.find('option[value=""]').length || select.attr('data-sonata-select2-allow-clear')==='true') { + allowClearEnabled = true; + } else if (select.attr('data-sonata-select2-allow-clear')==='false') { + allowClearEnabled = false; + } + + if (select.attr('data-sonata-select2-maximumSelectionSize')) { + maximumSelectionSize = select.attr('data-sonata-select2-maximumSelectionSize'); + } + + if (select.attr('data-sonata-select2-minimumResultsForSearch')) { + minimumResultsForSearch = select.attr('data-sonata-select2-minimumResultsForSearch'); + } + + select.select2({ + width: function() { + return Admin.get_select2_width(select); + }, + theme: 'bootstrap', + dropdownAutoWidth: true, + minimumResultsForSearch: minimumResultsForSearch, + placeholder: allowClearEnabled ? ' ' : '', // allowClear needs placeholder to work properly + allowClear: allowClearEnabled, + maximumSelectionSize: maximumSelectionSize + }); + + if (undefined !== popover) { + select + .select2('container') + .popover(popover.options) + ; + } + }); + } + }, + setup_icheck: function(subject) { + if (Admin.get_config('USE_ICHECK')) { + Admin.log('[core|setup_icheck] configure iCheck on', subject); + + var inputs = jQuery('input[type="checkbox"]:not(label.btn > input, [data-sonata-icheck="false"]), input[type="radio"]:not(label.btn > input, [data-sonata-icheck="false"])', subject); + inputs + .iCheck({ + checkboxClass: 'icheckbox_square-blue', + radioClass: 'iradio_square-blue' + }) + // See https://github.com/fronteed/iCheck/issues/244 + .on('ifToggled', function (e) { + $(e.target).trigger('change'); + }); + + // In case some checkboxes were already checked (for instance after moving back in the browser's session history), update iCheck checkboxes. + if (subject === window.document) { + setTimeout(function () { inputs.iCheck('update'); }, 0); + } + } + }, + /** + * Setup checkbox range selection + * + * Clicking on a first checkbox then another with shift + click + * will check / uncheck all checkboxes between them + * + * @param {string|Object} subject The html selector or object on which function should be applied + */ + setup_checkbox_range_selection: function(subject) { + Admin.log('[core|setup_checkbox_range_selection] configure checkbox range selection on', subject); + + var previousIndex, + useICheck = Admin.get_config('USE_ICHECK') + ; + + // When a checkbox or an iCheck helper is clicked + jQuery('tbody input[type="checkbox"], tbody .iCheck-helper', subject).click(function (event) { + var input; + + if (useICheck) { + input = jQuery(this).prev('input[type="checkbox"]'); + } else { + input = jQuery(this); + } + + if (input.length) { + var currentIndex = input.closest('tr').index(); + + if (event.shiftKey && previousIndex >= 0) { + var isChecked = jQuery('tbody input[type="checkbox"]:nth(' + currentIndex + ')', subject).prop('checked'); + + // Check all checkbox between previous and current one clicked + jQuery('tbody input[type="checkbox"]', subject).each(function (i, e) { + if (i > previousIndex && i < currentIndex || i > currentIndex && i < previousIndex) { + if (useICheck) { + jQuery(e).iCheck(isChecked ? 'check' : 'uncheck'); + + return; + } + + jQuery(e).prop('checked', isChecked); + } + }); + } + + previousIndex = currentIndex; + } + }); + }, + + setup_xeditable: function(subject) { + Admin.log('[core|setup_xeditable] configure xeditable on', subject); + jQuery('.x-editable', subject).editable({ + emptyclass: 'editable-empty btn btn-sm btn-default', + emptytext: '', + container: 'body', + placement: 'auto', + success: function(response) { + var html = jQuery(response); + Admin.setup_xeditable(html); + jQuery(this) + .closest('td') + .replaceWith(html); + }, + error: function(xhr) { + // On some error responses, we return JSON. + if ('application/json' === xhr.getResponseHeader('Content-Type')) { + return JSON.parse(xhr.responseText); + } + + return xhr.responseText; + } + }); + }, + + /** + * render log message + * @param mixed + */ + log: function() { + if (!Admin.get_config('DEBUG')) { + return; + } + + var msg = '[Sonata.Admin] ' + Array.prototype.join.call(arguments,', '); + if (window.console && window.console.log) { + window.console.log(msg); + } else if (window.opera && window.opera.postError) { + window.opera.postError(msg); + } + }, + + stopEvent: function(event) { + event.preventDefault(); + + return event.target; + }, + + add_filters: function(subject) { + Admin.log('[core|add_filters] configure filters on', subject); + + function updateCounter() { + var count = jQuery('a.sonata-toggle-filter .fa-check-square-o', subject).length; + + jQuery('.sonata-filter-count', subject).text(count); + } + + jQuery('a.sonata-toggle-filter', subject).on('click', function(e) { + e.preventDefault(); + e.stopPropagation(); + + if (jQuery(e.target).attr('sonata-filter') == 'false') { + return; + } + + Admin.log('[core|add_filters] handle filter container: ', jQuery(e.target).attr('filter-container')) + + var filters_container = jQuery('#' + jQuery(e.currentTarget).attr('filter-container')); + + if (jQuery('div[sonata-filter="true"]:visible', filters_container).length == 0) { + jQuery(filters_container).slideDown(); + } + + var targetSelector = jQuery(e.currentTarget).attr('filter-target'), + target = jQuery('div[id="' + targetSelector + '"]', filters_container), + filterToggler = jQuery('i', '.sonata-toggle-filter[filter-target="' + targetSelector + '"]') + ; + + if (jQuery(target).is(":visible")) { + filterToggler + .filter(':not(.fa-minus-circle)') + .removeClass('fa-check-square-o') + .addClass('fa-square-o') + ; + + target.hide(); + + } else { + filterToggler + .filter(':not(.fa-minus-circle)') + .removeClass('fa-square-o') + .addClass('fa-check-square-o') + ; + + target.show(); + } + + if (jQuery('div[sonata-filter="true"]:visible', filters_container).length > 0) { + jQuery(filters_container).slideDown(); + } else { + jQuery(filters_container).slideUp(); + } + + updateCounter(); + }); + + jQuery('.sonata-filter-form', subject).on('submit', function () { + var $form = jQuery(this); + $form.find('[sonata-filter="true"]:hidden :input').val(''); + + if (!this.dataset.defaultValues) { + return; + } + + var defaults = Admin.convert_query_string_to_object( + $.param({'filter': JSON.parse(this.dataset.defaultValues)}) + ); + + // Keep only changed values + $form.find('[name*=filter]').each(function (i, field) { + if (JSON.stringify(defaults[field.name] || '') === JSON.stringify($(field).val())) { + field.removeAttribute('name'); + } + }); + }); + + /* Advanced filters */ + if (jQuery('.advanced-filter :input:visible', subject).filter(function () { return jQuery(this).val() }).length === 0) { + jQuery('.advanced-filter').hide(); + } + + jQuery('[data-toggle="advanced-filter"]', subject).click(function() { + jQuery('.advanced-filter').toggle(); + }); + + updateCounter(); + }, + + /** + * Change object field value + * @param subject + */ + set_object_field_value: function(subject) { + Admin.log('[core|set_object_field_value] set value field on', subject); + + this.log(jQuery('a.sonata-ba-edit-inline', subject)); + jQuery('a.sonata-ba-edit-inline', subject).click(function(event) { + Admin.stopEvent(event); + var subject = jQuery(this); + jQuery.ajax({ + url: subject.attr('href'), + type: 'POST', + success: function(response) { + var elm = jQuery(subject).parent(); + elm.children().remove(); + // fix issue with html comment ... + elm.html(jQuery(response.replace(//g, "")).html()); + elm.effect("highlight", {'color' : '#57A957'}, 2000); + Admin.set_object_field_value(elm); + }, + error: function() { + jQuery(subject).parent().effect("highlight", {'color' : '#C43C35'}, 2000); + } + }); + }); + }, + + setup_collection_counter: function(subject) { + Admin.log('[core|setup_collection_counter] setup collection counter', subject); + + // Count and save element of each collection + var highestCounterRegexp = new RegExp('_([0-9]+)[^0-9]*$'); + jQuery(subject).find('[data-prototype]').each(function() { + var collection = jQuery(this); + var counter = -1; + collection.children().each(function() { + var matches = highestCounterRegexp.exec(jQuery('[id^="sonata-ba-field-container"]', this).attr('id')); + if (matches && matches[1] && matches[1] > counter) { + counter = parseInt(matches[1], 10); + } + }); + Admin.collectionCounters[collection.attr('id')] = counter; + }); + }, + + setup_collection_buttons: function(subject) { + + jQuery(subject).on('click', '.sonata-collection-add', function(event) { + Admin.stopEvent(event); + + var container = jQuery(this).closest('[data-prototype]'); + var counter = ++Admin.collectionCounters[container.attr('id')]; + var proto = container.attr('data-prototype'); + var protoName = container.attr('data-prototype-name') || '__name__'; + // Set field id + var idRegexp = new RegExp(container.attr('id')+'_'+protoName,'g'); + proto = proto.replace(idRegexp, container.attr('id')+'_'+counter); + + // Set field name + var parts = container.attr('id').split('_'); + var nameRegexp = new RegExp(parts[parts.length-1]+'\\]\\['+protoName,'g'); + proto = proto.replace(nameRegexp, parts[parts.length-1]+']['+counter); + jQuery(proto) + .insertBefore(jQuery(this).parent()) + .trigger('sonata-admin-append-form-element') + ; + + jQuery(this).trigger('sonata-collection-item-added'); + }); + + jQuery(subject).on('click', '.sonata-collection-delete', function(event) { + Admin.stopEvent(event); + + jQuery(this).trigger('sonata-collection-item-deleted'); + + jQuery(this).closest('.sonata-collection-row').remove(); + + jQuery(document).trigger('sonata-collection-item-deleted-successful'); + }); + }, + + setup_per_page_switcher: function(subject) { + Admin.log('[core|setup_per_page_switcher] setup page switcher', subject); + + jQuery('select.per-page').change(function() { + jQuery('input[type=submit]').hide(); + + window.top.location.href=this.options[this.selectedIndex].value; + }); + }, + + setup_form_tabs_for_errors: function(subject) { + Admin.log('[core|setup_form_tabs_for_errors] setup form tab\'s errors', subject); + + // Switch to first tab with server side validation errors on page load + jQuery('form', subject).each(function() { + Admin.show_form_first_tab_with_errors(jQuery(this), '.sonata-ba-field-error'); + }); + + // Switch to first tab with HTML5 errors on form submit + jQuery(subject) + .on('click', 'form [type="submit"]', function() { + Admin.show_form_first_tab_with_errors(jQuery(this).closest('form'), ':invalid'); + }) + .on('keypress', 'form [type="text"]', function(e) { + if (13 === e.which) { + Admin.show_form_first_tab_with_errors(jQuery(this), ':invalid'); + } + }) + ; + }, + + show_form_first_tab_with_errors: function(form, errorSelector) { + Admin.log('[core|show_form_first_tab_with_errors] show first tab with errors', form); + + var tabs = form.find('.nav-tabs a'), firstTabWithErrors; + + tabs.each(function() { + var id = jQuery(this).attr('href'), + tab = jQuery(this), + icon = tab.find('.has-errors'); + + if (jQuery(id).find(errorSelector).length > 0) { + // Only show first tab with errors + if (!firstTabWithErrors) { + tab.tab('show'); + firstTabWithErrors = tab; + } + + icon.removeClass('hide'); + } else { + icon.addClass('hide'); + } + }); + }, + + setup_inline_form_errors: function(subject) { + Admin.log('[core|setup_inline_form_errors] show first tab with errors', subject); + + var deleteCheckboxSelector = '.sonata-ba-field-inline-table [id$="_delete"][type="checkbox"]'; + + jQuery(deleteCheckboxSelector, subject).each(function() { + Admin.switch_inline_form_errors(jQuery(this)); + }); + + jQuery(subject).on('change', deleteCheckboxSelector, function() { + Admin.switch_inline_form_errors(jQuery(this)); + }); + }, + + /** + * Disable inline form errors when the row is marked for deletion + */ + switch_inline_form_errors: function(subject) { + Admin.log('[core|switch_inline_form_errors] switch_inline_form_errors', subject); + + var row = subject.closest('.sonata-ba-field-inline-table'), + errors = row.find('.sonata-ba-field-error-messages') + ; + + if (subject.is(':checked')) { + row + .find('[required]') + .removeAttr('required') + .attr('data-required', 'required') + ; + + errors.hide(); + } else { + row + .find('[data-required]') + .attr('required', 'required') + ; + + errors.show(); + } + }, + + setup_tree_view: function(subject) { + Admin.log('[core|setup_tree_view] setup tree view', subject); + + jQuery('ul.js-treeview', subject).treeView(); + }, + + /** Return the width for simple and sortable select2 element **/ + get_select2_width: function(element){ + var ereg = /width:(auto|(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc)))/i; + + // this code is an adaptation of select2 code (initContainerWidth function) + var style = element.attr('style'); + //console.log("main style", style); + + if (style !== undefined) { + var attrs = style.split(';'); + + for (var i = 0, l = attrs.length; i < l; i = i + 1) { + var matches = attrs[i].replace(/\s/g, '').match(ereg); + if (matches !== null && matches.length >= 1) + return matches[1]; + } + } + + style = element.css('width'); + if (style.indexOf("%") > 0) { + return style; + } + + return '100%'; + }, + + setup_sortable_select2: function(subject, data, customOptions) { + var transformedData = []; + for (var i = 0 ; i < data.length ; i++) { + transformedData[i] = {id: data[i].data, text: data[i].label}; + } + + var options = Object.assign({ + theme: 'bootstrap', + width: function(){ + return Admin.get_select2_width(subject); + }, + dropdownAutoWidth: true, + data: transformedData, + multiple: true + }, customOptions); + + subject.select2(options); + + subject.select2("container").find("ul.select2-choices").sortable({ + containment: 'parent', + start: function () { + subject.select2("onSortStart"); + }, + update: function () { + subject.select2("onSortEnd"); + } + }); + + // On form submit, transform value to match what is expected by server + subject.parents('form:first').submit(function () { + var values = subject.val().trim(); + if (values !== '') { + var baseName = subject.attr('name'); + values = values.split(','); + baseName = baseName.substring(0, baseName.length-1); + for (var i=0; i') + .attr('type', 'hidden') + .attr('name', baseName+i+']') + .val(values[i]) + .appendTo(subject.parents('form:first')); + } + } + subject.remove(); + }); + }, + + setup_sticky_elements: function(subject) { + if (Admin.get_config('USE_STICKYFORMS')) { + Admin.log('[core|setup_sticky_elements] setup sticky elements on', subject); + + var topNavbar = jQuery(subject).find('.navbar-static-top'); + var wrapper = jQuery(subject).find('.content-wrapper'); + var navbar = jQuery(wrapper).find('nav.navbar'); + var footer = jQuery(wrapper).find('.sonata-ba-form-actions'); + + if (navbar.length) { + new window.Waypoint.Sticky({ + element: navbar[0], + offset: function() { + Admin.refreshNavbarStuckClass(topNavbar); + + return jQuery(topNavbar).outerHeight(); + }, + handler: function( direction ) { + if (direction == 'up') { + jQuery(navbar).width('auto'); + } else { + jQuery(navbar).width(jQuery(wrapper).outerWidth()); + } + + Admin.refreshNavbarStuckClass(topNavbar); + } + }); + } + + if (footer.length) { + new window.Waypoint({ + element: wrapper[0], + offset: 'bottom-in-view', + handler: function(direction) { + var position = jQuery('.sonata-ba-form form > .row').outerHeight() + jQuery(footer).outerHeight() - 2; + + if (position < jQuery(footer).offset().top) { + jQuery(footer).removeClass('stuck'); + } + + if (direction == 'up') { + jQuery(footer).addClass('stuck'); + } + } + }); + } + + Admin.handleScroll(footer, navbar, wrapper); + } + }, + + handleScroll: function(footer, navbar, wrapper) { + if (footer.length && jQuery(window).scrollTop() + jQuery(window).height() != jQuery(document).height()) { + jQuery(footer).addClass('stuck'); + } + + jQuery(window).scroll( + Admin.debounce(function() { + if (footer.length && Math.round(jQuery(window).scrollTop() + jQuery(window).height()) >= jQuery(document).height()) { + jQuery(footer).removeClass('stuck'); + } + + if (navbar.length && jQuery(window).scrollTop() === 0) { + jQuery(navbar).removeClass('stuck'); + } + }, 250) + ); + + jQuery('body').on('expanded.pushMenu collapsed.pushMenu', function() { + setTimeout(function() { + Admin.handleResize(footer, navbar, wrapper); + }, 350); // the animation takes 0.3s to execute, so we have to take the width, just after the animation ended + }); + + jQuery(window).resize( + Admin.debounce(function() { + Admin.handleResize(footer, navbar, wrapper); + }, 250) + ); + }, + + handleResize: function(footer, navbar, wrapper) { + if (navbar.length && jQuery(navbar).hasClass('stuck')) { + jQuery(navbar).width(jQuery(wrapper).outerWidth()); + } + + if (footer.length && jQuery(footer).hasClass('stuck')) { + jQuery(footer).width(jQuery(wrapper).outerWidth()); + } + }, + + refreshNavbarStuckClass: function(topNavbar) { + var stuck = jQuery('#navbar-stuck'); + + if (!stuck.length) { + stuck = jQuery('").appendTo(a)),r.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",r.opacity)),r.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",r.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!i)for(s=this.containers.length-1;s>=0;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!r.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var n,i,s,a,r=this.options,o=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY=0;n--)if(s=(i=this.items[n]).item[0],(a=this._intersectsWithPointer(i))&&i.instance===this.currentContainer&&!(s===this.currentItem[0]||this.placeholder[1===a?"next":"prev"]()[0]===s||e.contains(this.placeholder[0],s)||"semi-dynamic"===this.options.type&&e.contains(this.element[0],s))){if(this.direction=1===a?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(i))break;this._rearrange(t,i),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,n){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var i=this,s=this.placeholder.offset(),a=this.options.axis,r={};a&&"x"!==a||(r.left=s.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),a&&"y"!==a||(r.top=s.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(r,parseInt(this.options.revert,10)||500,(function(){i._clear(t)}))}else this._clear(t,n);return!1}},cancel:function(){if(this.dragging){this._mouseUp(new e.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var n=this._getItemsAsjQuery(t&&t.connected),i=[];return t=t||{},e(n).each((function(){var n=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);n&&i.push((t.key||n[1]+"[]")+"="+(t.key&&t.expression?n[1]:n[2]))})),!i.length&&t.key&&i.push(t.key+"="),i.join("&")},toArray:function(t){var n=this._getItemsAsjQuery(t&&t.connected),i=[];return t=t||{},n.each((function(){i.push(e(t.item||this).attr(t.attribute||"id")||"")})),i},_intersectsWith:function(e){var t=this.positionAbs.left,n=t+this.helperProportions.width,i=this.positionAbs.top,s=i+this.helperProportions.height,a=e.left,r=a+e.width,o=e.top,d=o+e.height,l=this.offset.click.top,u=this.offset.click.left,c="x"===this.options.axis||i+l>o&&i+la&&t+ue[this.floating?"width":"height"]?p:a0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){var n,i,s,a,r=[],o=[],d=this._connectWith();if(d&&t)for(n=d.length-1;n>=0;n--)for(i=(s=e(d[n],this.document[0])).length-1;i>=0;i--)(a=e.data(s[i],this.widgetFullName))&&a!==this&&!a.options.disabled&&o.push([e.isFunction(a.options.items)?a.options.items.call(a.element):e(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);function l(){r.push(this)}for(o.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),n=o.length-1;n>=0;n--)o[n][0].each(l);return e(r)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,(function(e){for(var n=0;n=0;n--)for(i=(s=e(h[n],this.document[0])).length-1;i>=0;i--)(a=e.data(s[i],this.widgetFullName))&&a!==this&&!a.options.disabled&&(c.push([e.isFunction(a.options.items)?a.options.items.call(a.element[0],t,{item:this.currentItem}):e(a.options.items,a.element),a]),this.containers.push(a));for(n=c.length-1;n>=0;n--)for(r=c[n][1],i=0,l=(o=c[n][0]).length;i=0;n--)(i=this.items[n]).instance!==this.currentContainer&&this.currentContainer&&i.item[0]!==this.currentItem[0]||(s=this.options.toleranceElement?e(this.options.toleranceElement,i.item):i.item,t||(i.width=s.outerWidth(),i.height=s.outerHeight()),a=s.offset(),i.left=a.left,i.top=a.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(n=this.containers.length-1;n>=0;n--)a=this.containers[n].element.offset(),this.containers[n].containerCache.left=a.left,this.containers[n].containerCache.top=a.top,this.containers[n].containerCache.width=this.containers[n].element.outerWidth(),this.containers[n].containerCache.height=this.containers[n].element.outerHeight();return this},_createPlaceholder:function(t){var n,i=(t=t||this).options;i.placeholder&&i.placeholder.constructor!==String||(n=i.placeholder,i.placeholder={element:function(){var i=t.currentItem[0].nodeName.toLowerCase(),s=e("<"+i+">",t.document[0]);return t._addClass(s,"ui-sortable-placeholder",n||t.currentItem[0].className)._removeClass(s,"ui-sortable-helper"),"tbody"===i?t._createTrPlaceholder(t.currentItem.find("tr").eq(0),e("",t.document[0]).appendTo(s)):"tr"===i?t._createTrPlaceholder(t.currentItem,s):"img"===i&&s.attr("src",t.currentItem.attr("src")),n||s.css("visibility","hidden"),s},update:function(e,s){n&&!i.forcePlaceholderSize||(s.height()||s.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),s.width()||s.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(i.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),i.placeholder.update(t,t.placeholder)},_createTrPlaceholder:function(t,n){var i=this;t.children().each((function(){e(" ",i.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(n)}))},_contactContainers:function(t){var n,i,s,a,r,o,d,l,u,c,h=null,p=null;for(n=this.containers.length-1;n>=0;n--)if(!e.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(h&&e.contains(this.containers[n].element[0],h.element[0]))continue;h=this.containers[n],p=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",t,this._uiHash(this)),this.containers[n].containerCache.over=0);if(h)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(s=1e4,a=null,r=(u=h.floating||this._isFloating(this.currentItem))?"left":"top",o=u?"width":"height",c=u?"pageX":"pageY",i=this.items.length-1;i>=0;i--)e.contains(this.containers[p].element[0],this.items[i].item[0])&&this.items[i].item[0]!==this.currentItem[0]&&(d=this.items[i].item.offset()[r],l=!1,t[c]-d>this.items[i][o]/2&&(l=!0),Math.abs(t[c]-d)this.containment[2]&&(a=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(r=this.containment[3]+this.offset.click.top)),s.grid&&(n=this.originalPageY+Math.round((r-this.originalPageY)/s.grid[1])*s.grid[1],r=this.containment?n-this.offset.click.top>=this.containment[1]&&n-this.offset.click.top<=this.containment[3]?n:n-this.offset.click.top>=this.containment[1]?n-s.grid[1]:n+s.grid[1]:n,i=this.originalPageX+Math.round((a-this.originalPageX)/s.grid[0])*s.grid[0],a=this.containment?i-this.offset.click.left>=this.containment[0]&&i-this.offset.click.left<=this.containment[2]?i:i-this.offset.click.left>=this.containment[0]?i-s.grid[0]:i+s.grid[0]:i)),{top:r-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():d?0:o.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():d?0:o.scrollLeft())}},_rearrange:function(e,t,n,i){n?n[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var s=this.counter;this._delay((function(){s===this.counter&&this.refreshPositions(!i)}))},_clear:function(e,t){this.reverting=!1;var n,i=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(n in this._storedCSS)"auto"!==this._storedCSS[n]&&"static"!==this._storedCSS[n]||(this._storedCSS[n]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();function s(e,t,n){return function(i){n._trigger(e,i,t._uiHash(t))}}for(this.fromOutside&&!t&&i.push((function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))})),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||i.push((function(e){this._trigger("update",e,this._uiHash())})),this!==this.currentContainer&&(t||(i.push((function(e){this._trigger("remove",e,this._uiHash())})),i.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),i.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),n=this.containers.length-1;n>=0;n--)t||i.push(s("deactivate",this,this.containers[n])),this.containers[n].containerCache.over&&(i.push(s("out",this,this.containers[n])),this.containers[n].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!t){for(n=0;n1;return d&&(r/=2),o.offset=s(o.offset),o.over=s(o.over),this.each((function(){if(null!==a){var l,u=n(this),c=u?this.contentWindow||window:this,h=e(c),p=a,m={};switch(typeof p){case"number":case"string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(p)){p=s(p);break}p=u?e(p):e(p,c);case"object":if(0===p.length)return;(p.is||p.style)&&(l=(p=e(p)).offset())}var f=i(o.offset)&&o.offset(c,p)||o.offset;e.each(o.axis.split(""),(function(e,n){var i="x"===n?"Left":"Top",s=i.toLowerCase(),a="scroll"+i,r=h[a](),g=t.max(c,n);if(l)m[a]=l[s]+(u?0:r-h.offset()[s]),o.margin&&(m[a]-=parseInt(p.css("margin"+i),10)||0,m[a]-=parseInt(p.css("border"+i+"Width"),10)||0),m[a]+=f[s]||0,o.over[s]&&(m[a]+=p["x"===n?"width":"height"]()*o.over[s]);else{var y=p[s];m[a]=y.slice&&"%"===y.slice(-1)?parseFloat(y)/100*g:y}o.limit&&/^\d+$/.test(m[a])&&(m[a]=m[a]<=0?0:Math.min(m[a],g)),!e&&o.axis.length>1&&(r===m[a]?m={}:d&&(_(o.onAfterFirst),m={}))})),_(o.onAfter)}function _(t){var n=e.extend({},o,{queue:!0,duration:r,complete:t&&function(){t.call(c,p,o)}});h.animate(m,n)}}))},t.max=function(t,i){var s="x"===i?"Width":"Height",a="scroll"+s;if(!n(t))return t[a]-e(t)[s.toLowerCase()]();var r="client"+s,o=t.ownerDocument||t.document,d=o.documentElement,l=o.body;return Math.max(d[a],l[a])-Math.min(d[r],l[r])},e.Tween.propHooks.scrollLeft=e.Tween.propHooks.scrollTop={get:function(t){return e(t.elem)[t.prop]()},set:function(t){var n=this.get(t);if(t.options.interrupt&&t._last&&t._last!==n)return e(t.elem).stop();var i=Math.round(t.now);n!==i&&(e(t.elem)[t.prop](i),t._last=this.get(t))}},t})?i.apply(t,s):i)||(e.exports=a)}()},9755:function(e,t){var n,i,s;i="undefined"!=typeof window?window:this,s=function(i,s){var a=[],r=i.document,o=a.slice,d=a.concat,l=a.push,u=a.indexOf,c={},h=c.toString,p=c.hasOwnProperty,m={},f="2.2.4",_=function(e,t){return new _.fn.init(e,t)},g=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,y=/^-ms-/,v=/-([\da-z])/gi,M=function(e,t){return t.toUpperCase()};function b(e){var t=!!e&&"length"in e&&e.length,n=_.type(e);return"function"!==n&&!_.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}_.fn=_.prototype={jquery:f,constructor:_,selector:"",length:0,toArray:function(){return o.call(this)},get:function(e){return null!=e?e<0?this[e+this.length]:this[e]:o.call(this)},pushStack:function(e){var t=_.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e){return _.each(this,e)},map:function(e){return this.pushStack(_.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n=0},isPlainObject:function(e){var t;if("object"!==_.type(e)||e.nodeType||_.isWindow(e))return!1;if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype||{},"isPrototypeOf"))return!1;for(t in e);return void 0===t||p.call(e,t)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[h.call(e)]||"object":typeof e},globalEval:function(e){var t,n=eval;(e=_.trim(e))&&(1===e.indexOf("use strict")?((t=r.createElement("script")).text=e,r.head.appendChild(t).parentNode.removeChild(t)):n(e))},camelCase:function(e){return e.replace(y,"ms-").replace(v,M)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var n,i=0;if(b(e))for(n=e.length;i+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),q=new RegExp("=[\\x20\\t\\r\\n\\f]*([^\\]'\"]*?)[\\x20\\t\\r\\n\\f]*\\]","g"),V=new RegExp(N),J=new RegExp("^"+W+"$"),B={ID:new RegExp("^#("+W+")"),CLASS:new RegExp("^\\.("+W+")"),TAG:new RegExp("^("+W+"|[*])"),ATTR:new RegExp("^"+F),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},G=/^(?:input|select|textarea|button)$/i,K=/^h\d$/i,X=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Q=/[+~]/,ee=/'|\\/g,te=new RegExp("\\\\([\\da-f]{1,6}[\\x20\\t\\r\\n\\f]?|([\\x20\\t\\r\\n\\f])|.)","ig"),ne=function(e,t,n){var i="0x"+t-65536;return i!=i||n?t:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)},ie=function(){h()};try{E.apply(H=O.call(b.childNodes),b.childNodes),H[b.childNodes.length].nodeType}catch(e){E={apply:H.length?function(e,t){C.apply(e,O.call(t))}:function(e,t){for(var n=e.length,i=0;e[n++]=t[i++];);e.length=n-1}}}function se(e,t,i,s){var a,o,l,u,c,m,g,y,w=t&&t.ownerDocument,L=t?t.nodeType:9;if(i=i||[],"string"!=typeof e||!e||1!==L&&9!==L&&11!==L)return i;if(!s&&((t?t.ownerDocument||t:b)!==p&&h(t),t=t||p,f)){if(11!==L&&(m=Z.exec(e)))if(a=m[1]){if(9===L){if(!(l=t.getElementById(a)))return i;if(l.id===a)return i.push(l),i}else if(w&&(l=w.getElementById(a))&&v(t,l)&&l.id===a)return i.push(l),i}else{if(m[2])return E.apply(i,t.getElementsByTagName(e)),i;if((a=m[3])&&n.getElementsByClassName&&t.getElementsByClassName)return E.apply(i,t.getElementsByClassName(a)),i}if(n.qsa&&!D[e+" "]&&(!_||!_.test(e))){if(1!==L)w=t,y=e;else if("object"!==t.nodeName.toLowerCase()){for((u=t.getAttribute("id"))?u=u.replace(ee,"\\$&"):t.setAttribute("id",u=M),o=(g=r(e)).length,c=J.test(u)?"#"+u:"[id='"+u+"']";o--;)g[o]=c+" "+fe(g[o]);y=g.join(","),w=Q.test(e)&&pe(t.parentNode)||t}if(y)try{return E.apply(i,w.querySelectorAll(y)),i}catch(e){}finally{u===M&&t.removeAttribute("id")}}}return d(e.replace(z,"$1"),t,i,s)}function ae(){var e=[];return function t(n,s){return e.push(n+" ")>i.cacheLength&&delete t[e.shift()],t[n+" "]=s}}function re(e){return e[M]=!0,e}function oe(e){var t=p.createElement("div");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function de(e,t){for(var n=e.split("|"),s=n.length;s--;)i.attrHandle[n[s]]=t}function le(e,t){var n=t&&e,i=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||x)-(~e.sourceIndex||x);if(i)return i;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function ue(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function ce(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function he(e){return re((function(t){return t=+t,re((function(n,i){for(var s,a=e([],n.length,t),r=a.length;r--;)n[s=a[r]]&&(n[s]=!(i[s]=n[s]))}))}))}function pe(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=se.support={},a=se.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},h=se.setDocument=function(e){var t,s,r=e?e.ownerDocument||e:b;return r!==p&&9===r.nodeType&&r.documentElement?(m=(p=r).documentElement,f=!a(p),(s=p.defaultView)&&s.top!==s&&(s.addEventListener?s.addEventListener("unload",ie,!1):s.attachEvent&&s.attachEvent("onunload",ie)),n.attributes=oe((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=oe((function(e){return e.appendChild(p.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=X.test(p.getElementsByClassName),n.getById=oe((function(e){return m.appendChild(e).id=M,!p.getElementsByName||!p.getElementsByName(M).length})),n.getById?(i.find.ID=function(e,t){if(void 0!==t.getElementById&&f){var n=t.getElementById(e);return n?[n]:[]}},i.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}}):(delete i.find.ID,i.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,i=[],s=0,a=t.getElementsByTagName(e);if("*"===e){for(;n=a[s++];)1===n.nodeType&&i.push(n);return i}return a},i.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&f)return t.getElementsByClassName(e)},g=[],_=[],(n.qsa=X.test(p.querySelectorAll))&&(oe((function(e){m.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&_.push("[*^$]=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),e.querySelectorAll("[selected]").length||_.push("\\[[\\x20\\t\\r\\n\\f]*(?:value|"+P+")"),e.querySelectorAll("[id~="+M+"-]").length||_.push("~="),e.querySelectorAll(":checked").length||_.push(":checked"),e.querySelectorAll("a#"+M+"+*").length||_.push(".#.+[+~]")})),oe((function(e){var t=p.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&_.push("name[\\x20\\t\\r\\n\\f]*[*^$|!~]?="),e.querySelectorAll(":enabled").length||_.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),_.push(",.*:")}))),(n.matchesSelector=X.test(y=m.matches||m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&oe((function(e){n.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),g.push("!=",N)})),_=_.length&&new RegExp(_.join("|")),g=g.length&&new RegExp(g.join("|")),t=X.test(m.compareDocumentPosition),v=t||X.test(m.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):e.compareDocumentPosition&&16&e.compareDocumentPosition(i)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},T=t?function(e,t){if(e===t)return c=!0,0;var i=!e.compareDocumentPosition-!t.compareDocumentPosition;return i||(1&(i=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===i?e===p||e.ownerDocument===b&&v(b,e)?-1:t===p||t.ownerDocument===b&&v(b,t)?1:u?A(u,e)-A(u,t):0:4&i?-1:1)}:function(e,t){if(e===t)return c=!0,0;var n,i=0,s=e.parentNode,a=t.parentNode,r=[e],o=[t];if(!s||!a)return e===p?-1:t===p?1:s?-1:a?1:u?A(u,e)-A(u,t):0;if(s===a)return le(e,t);for(n=e;n=n.parentNode;)r.unshift(n);for(n=t;n=n.parentNode;)o.unshift(n);for(;r[i]===o[i];)i++;return i?le(r[i],o[i]):r[i]===b?-1:o[i]===b?1:0},p):p},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&h(e),t=t.replace(q,"='$1']"),n.matchesSelector&&f&&!D[t+" "]&&(!g||!g.test(t))&&(!_||!_.test(t)))try{var i=y.call(e,t);if(i||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return i}catch(e){}return se(t,p,null,[e]).length>0},se.contains=function(e,t){return(e.ownerDocument||e)!==p&&h(e),v(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!==p&&h(e);var s=i.attrHandle[t.toLowerCase()],a=s&&S.call(i.attrHandle,t.toLowerCase())?s(e,t,!f):void 0;return void 0!==a?a:n.attributes||!f?e.getAttribute(t):(a=e.getAttributeNode(t))&&a.specified?a.value:null},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,i=[],s=0,a=0;if(c=!n.detectDuplicates,u=!n.sortStable&&e.slice(0),e.sort(T),c){for(;t=e[a++];)t===e[a]&&(s=i.push(a));for(;s--;)e.splice(i[s],1)}return u=null,e},s=se.getText=function(e){var t,n="",i=0,a=e.nodeType;if(a){if(1===a||9===a||11===a){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(3===a||4===a)return e.nodeValue}else for(;t=e[i++];)n+=s(t);return n},(i=se.selectors={cacheLength:50,createPseudo:re,match:B,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return B.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&V.test(n)&&(t=r(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=k[e+" "];return t||(t=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+e+"("+$+"|$)"))&&k(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(i){var s=se.attr(i,e);return null==s?"!="===t:!t||(s+="","="===t?s===n:"!="===t?s!==n:"^="===t?n&&0===s.indexOf(n):"*="===t?n&&s.indexOf(n)>-1:"$="===t?n&&s.slice(-n.length)===n:"~="===t?(" "+s.replace(I," ")+" ").indexOf(n)>-1:"|="===t&&(s===n||s.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,i,s){var a="nth"!==e.slice(0,3),r="last"!==e.slice(-4),o="of-type"===t;return 1===i&&0===s?function(e){return!!e.parentNode}:function(t,n,d){var l,u,c,h,p,m,f=a!==r?"nextSibling":"previousSibling",_=t.parentNode,g=o&&t.nodeName.toLowerCase(),y=!d&&!o,v=!1;if(_){if(a){for(;f;){for(h=t;h=h[f];)if(o?h.nodeName.toLowerCase()===g:1===h.nodeType)return!1;m=f="only"===e&&!m&&"nextSibling"}return!0}if(m=[r?_.firstChild:_.lastChild],r&&y){for(v=(p=(l=(u=(c=(h=_)[M]||(h[M]={}))[h.uniqueID]||(c[h.uniqueID]={}))[e]||[])[0]===w&&l[1])&&l[2],h=p&&_.childNodes[p];h=++p&&h&&h[f]||(v=p=0)||m.pop();)if(1===h.nodeType&&++v&&h===t){u[e]=[w,p,v];break}}else if(y&&(v=p=(l=(u=(c=(h=t)[M]||(h[M]={}))[h.uniqueID]||(c[h.uniqueID]={}))[e]||[])[0]===w&&l[1]),!1===v)for(;(h=++p&&h&&h[f]||(v=p=0)||m.pop())&&((o?h.nodeName.toLowerCase()!==g:1!==h.nodeType)||!++v||(y&&((u=(c=h[M]||(h[M]={}))[h.uniqueID]||(c[h.uniqueID]={}))[e]=[w,v]),h!==t)););return(v-=s)===i||v%i==0&&v/i>=0}}},PSEUDO:function(e,t){var n,s=i.pseudos[e]||i.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return s[M]?s(t):s.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?re((function(e,n){for(var i,a=s(e,t),r=a.length;r--;)e[i=A(e,a[r])]=!(n[i]=a[r])})):function(e){return s(e,0,n)}):s}},pseudos:{not:re((function(e){var t=[],n=[],i=o(e.replace(z,"$1"));return i[M]?re((function(e,t,n,s){for(var a,r=i(e,null,s,[]),o=e.length;o--;)(a=r[o])&&(e[o]=!(t[o]=a))})):function(e,s,a){return t[0]=e,i(t,null,a,n),t[0]=null,!n.pop()}})),has:re((function(e){return function(t){return se(e,t).length>0}})),contains:re((function(e){return e=e.replace(te,ne),function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}})),lang:re((function(e){return J.test(e||"")||se.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=f?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===m},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return K.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he((function(){return[0]})),last:he((function(e,t){return[t-1]})),eq:he((function(e,t,n){return[n<0?n+t:n]})),even:he((function(e,t){for(var n=0;n=0;)e.push(i);return e})),gt:he((function(e,t,n){for(var i=n<0?n+t:n;++i1?function(t,n,i){for(var s=e.length;s--;)if(!e[s](t,n,i))return!1;return!0}:e[0]}function ye(e,t,n,i,s){for(var a,r=[],o=0,d=e.length,l=null!=t;o-1&&(a[l]=!(r[l]=c))}}else g=ye(g===r?g.splice(m,g.length):g),s?s(null,r,g,d):E.apply(r,g)}))}function Me(e){for(var t,n,s,a=e.length,r=i.relative[e[0].type],o=r||i.relative[" "],d=r?1:0,u=_e((function(e){return e===t}),o,!0),c=_e((function(e){return A(t,e)>-1}),o,!0),h=[function(e,n,i){var s=!r&&(i||n!==l)||((t=n).nodeType?u(e,n,i):c(e,n,i));return t=null,s}];d1&&ge(h),d>1&&fe(e.slice(0,d-1).concat({value:" "===e[d-2].type?"*":""})).replace(z,"$1"),n,d0,s=e.length>0,a=function(a,r,o,d,u){var c,m,_,g=0,y="0",v=a&&[],M=[],b=l,L=a||s&&i.find.TAG("*",u),k=w+=null==b?1:Math.random()||.1,Y=L.length;for(u&&(l=r===p||r||u);y!==Y&&null!=(c=L[y]);y++){if(s&&c){for(m=0,r||c.ownerDocument===p||(h(c),o=!f);_=e[m++];)if(_(c,r||p,o)){d.push(c);break}u&&(w=k)}n&&((c=!_&&c)&&g--,a&&v.push(c))}if(g+=y,n&&y!==g){for(m=0;_=t[m++];)_(v,M,r,o);if(a){if(g>0)for(;y--;)v[y]||M[y]||(M[y]=j.call(d));M=ye(M)}E.apply(d,M),u&&!a&&M.length>0&&g+t.length>1&&se.uniqueSort(d)}return u&&(w=k,l=b),v};return n?re(a):a}(a,s))).selector=e}return o},d=se.select=function(e,t,s,a){var d,l,u,c,h,p="function"==typeof e&&e,m=!a&&r(e=p.selector||e);if(s=s||[],1===m.length){if((l=m[0]=m[0].slice(0)).length>2&&"ID"===(u=l[0]).type&&n.getById&&9===t.nodeType&&f&&i.relative[l[1].type]){if(!(t=(i.find.ID(u.matches[0].replace(te,ne),t)||[])[0]))return s;p&&(t=t.parentNode),e=e.slice(l.shift().value.length)}for(d=B.needsContext.test(e)?0:l.length;d--&&(u=l[d],!i.relative[c=u.type]);)if((h=i.find[c])&&(a=h(u.matches[0].replace(te,ne),Q.test(l[0].type)&&pe(t.parentNode)||t))){if(l.splice(d,1),!(e=a.length&&fe(l)))return E.apply(s,a),s;break}}return(p||o(e,m))(a,t,!f,s,!t||Q.test(e)&&pe(t.parentNode)||t),s},n.sortStable=M.split("").sort(T).join("")===M,n.detectDuplicates=!!c,h(),n.sortDetached=oe((function(e){return 1&e.compareDocumentPosition(p.createElement("div"))})),oe((function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")}))||de("type|href|height|width",(function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),n.attributes&&oe((function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||de("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),oe((function(e){return null==e.getAttribute("disabled")}))||de(P,(function(e,t,n){var i;if(!n)return!0===e[t]?t.toLowerCase():(i=e.getAttributeNode(t))&&i.specified?i.value:null})),se}(i);_.find=w,_.expr=w.selectors,_.expr[":"]=_.expr.pseudos,_.uniqueSort=_.unique=w.uniqueSort,_.text=w.getText,_.isXMLDoc=w.isXML,_.contains=w.contains;var L=function(e,t,n){for(var i=[],s=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(s&&_(e).is(n))break;i.push(e)}return i},k=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},Y=_.expr.match.needsContext,D=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,T=/^.[^:#\[\.,]*$/;function x(e,t,n){if(_.isFunction(t))return _.grep(e,(function(e,i){return!!t.call(e,i,e)!==n}));if(t.nodeType)return _.grep(e,(function(e){return e===t!==n}));if("string"==typeof t){if(T.test(t))return _.filter(t,e,n);t=_.filter(t,e)}return _.grep(e,(function(e){return u.call(t,e)>-1!==n}))}_.filter=function(e,t,n){var i=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===i.nodeType?_.find.matchesSelector(i,e)?[i]:[]:_.find.matches(e,_.grep(t,(function(e){return 1===e.nodeType})))},_.fn.extend({find:function(e){var t,n=this.length,i=[],s=this;if("string"!=typeof e)return this.pushStack(_(e).filter((function(){for(t=0;t1?_.unique(i):i)).selector=this.selector?this.selector+" "+e:e,i},filter:function(e){return this.pushStack(x(this,e||[],!1))},not:function(e){return this.pushStack(x(this,e||[],!0))},is:function(e){return!!x(this,"string"==typeof e&&Y.test(e)?_(e):e||[],!1).length}});var S,H=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(_.fn.init=function(e,t,n){var i,s;if(!e)return this;if(n=n||S,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:H.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof _?t[0]:t,_.merge(this,_.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:r,!0)),D.test(i[1])&&_.isPlainObject(t))for(i in t)_.isFunction(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(s=r.getElementById(i[2]))&&s.parentNode&&(this.length=1,this[0]=s),this.context=r,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):_.isFunction(e)?void 0!==n.ready?n.ready(e):e(_):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),_.makeArray(e,this))}).prototype=_.fn,S=_(r);var j=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};function E(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}_.fn.extend({has:function(e){var t=_(e,this),n=t.length;return this.filter((function(){for(var e=0;e-1:1===n.nodeType&&_.find.matchesSelector(n,e))){a.push(n);break}return this.pushStack(a.length>1?_.uniqueSort(a):a)},index:function(e){return e?"string"==typeof e?u.call(_(e),this[0]):u.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(_.uniqueSort(_.merge(this.get(),_(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),_.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return L(e,"parentNode")},parentsUntil:function(e,t,n){return L(e,"parentNode",n)},next:function(e){return E(e,"nextSibling")},prev:function(e){return E(e,"previousSibling")},nextAll:function(e){return L(e,"nextSibling")},prevAll:function(e){return L(e,"previousSibling")},nextUntil:function(e,t,n){return L(e,"nextSibling",n)},prevUntil:function(e,t,n){return L(e,"previousSibling",n)},siblings:function(e){return k((e.parentNode||{}).firstChild,e)},children:function(e){return k(e.firstChild)},contents:function(e){return e.contentDocument||_.merge([],e.childNodes)}},(function(e,t){_.fn[e]=function(n,i){var s=_.map(this,t,n);return"Until"!==e.slice(-5)&&(i=n),i&&"string"==typeof i&&(s=_.filter(i,s)),this.length>1&&(C[e]||_.uniqueSort(s),j.test(e)&&s.reverse()),this.pushStack(s)}}));var O,A=/\S+/g;function P(){r.removeEventListener("DOMContentLoaded",P),i.removeEventListener("load",P),_.ready()}_.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return _.each(e.match(A)||[],(function(e,n){t[n]=!0})),t}(e):_.extend({},e);var t,n,i,s,a=[],r=[],o=-1,d=function(){for(s=e.once,i=t=!0;r.length;o=-1)for(n=r.shift();++o-1;)a.splice(n,1),n<=o&&o--})),this},has:function(e){return e?_.inArray(e,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return s=r=[],a=n="",this},disabled:function(){return!a},lock:function(){return s=r=[],n||(a=n=""),this},locked:function(){return!!s},fireWith:function(e,n){return s||(n=[e,(n=n||[]).slice?n.slice():n],r.push(n),t||d()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!i}};return l},_.extend({Deferred:function(e){var t=[["resolve","done",_.Callbacks("once memory"),"resolved"],["reject","fail",_.Callbacks("once memory"),"rejected"],["notify","progress",_.Callbacks("memory")]],n="pending",i={state:function(){return n},always:function(){return s.done(arguments).fail(arguments),this},then:function(){var e=arguments;return _.Deferred((function(n){_.each(t,(function(t,a){var r=_.isFunction(e[t])&&e[t];s[a[1]]((function(){var e=r&&r.apply(this,arguments);e&&_.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[a[0]+"With"](this===i?n.promise():this,r?[e]:arguments)}))})),e=null})).promise()},promise:function(e){return null!=e?_.extend(e,i):i}},s={};return i.pipe=i.then,_.each(t,(function(e,a){var r=a[2],o=a[3];i[a[1]]=r.add,o&&r.add((function(){n=o}),t[1^e][2].disable,t[2][2].lock),s[a[0]]=function(){return s[a[0]+"With"](this===s?i:this,arguments),this},s[a[0]+"With"]=r.fireWith})),i.promise(s),e&&e.call(s,s),s},when:function(e){var t,n,i,s=0,a=o.call(arguments),r=a.length,d=1!==r||e&&_.isFunction(e.promise)?r:0,l=1===d?e:_.Deferred(),u=function(e,n,i){return function(s){n[e]=this,i[e]=arguments.length>1?o.call(arguments):s,i===t?l.notifyWith(n,i):--d||l.resolveWith(n,i)}};if(r>1)for(t=new Array(r),n=new Array(r),i=new Array(r);s0||(O.resolveWith(r,[_]),_.fn.triggerHandler&&(_(r).triggerHandler("ready"),_(r).off("ready"))))}}),_.ready.promise=function(e){return O||(O=_.Deferred(),"complete"===r.readyState||"loading"!==r.readyState&&!r.documentElement.doScroll?i.setTimeout(_.ready):(r.addEventListener("DOMContentLoaded",P),i.addEventListener("load",P))),O.promise(e)},_.ready.promise();var $=function(e,t,n,i,s,a,r){var o=0,d=e.length,l=null==n;if("object"===_.type(n))for(o in s=!0,n)$(e,t,o,n[o],!0,a,r);else if(void 0!==i&&(s=!0,_.isFunction(i)||(r=!0),l&&(r?(t.call(e,i),t=null):(l=t,t=function(e,t,n){return l.call(_(e),n)})),t))for(;o-1&&void 0!==n&&I.set(this,e,t)}))}),null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each((function(){I.remove(this,e)}))}}),_.extend({queue:function(e,t,n){var i;if(e)return t=(t||"fx")+"queue",i=N.get(e,t),n&&(!i||_.isArray(n)?i=N.access(e,t,_.makeArray(n)):i.push(n)),i||[]},dequeue:function(e,t){t=t||"fx";var n=_.queue(e,t),i=n.length,s=n.shift(),a=_._queueHooks(e,t);"inprogress"===s&&(s=n.shift(),i--),s&&("fx"===t&&n.unshift("inprogress"),delete a.stop,s.call(e,(function(){_.dequeue(e,t)}),a)),!i&&a&&a.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return N.get(e,n)||N.access(e,n,{empty:_.Callbacks("once memory").add((function(){N.remove(e,[t+"queue",n])}))})}}),_.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length",""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ee(e,t){var n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&_.nodeName(e,t)?_.merge([e],n):n}function te(e,t){for(var n=0,i=e.length;n-1)s&&s.push(a);else if(l=_.contains(a.ownerDocument,a),r=ee(c.appendChild(a),"script"),l&&te(r),n)for(u=0;a=r[u++];)Z.test(a.type||"")&&n.push(a);return c}ne=r.createDocumentFragment().appendChild(r.createElement("div")),(ie=r.createElement("input")).setAttribute("type","radio"),ie.setAttribute("checked","checked"),ie.setAttribute("name","t"),ne.appendChild(ie),m.checkClone=ne.cloneNode(!0).cloneNode(!0).lastChild.checked,ne.innerHTML="",m.noCloneChecked=!!ne.cloneNode(!0).lastChild.defaultValue;var re=/^key/,oe=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,de=/^([^.]*)(?:\.(.+)|)/;function le(){return!0}function ue(){return!1}function ce(){try{return r.activeElement}catch(e){}}function he(e,t,n,i,s,a){var r,o;if("object"==typeof t){for(o in"string"!=typeof n&&(i=i||n,n=void 0),t)he(e,o,n,i,t[o],a);return e}if(null==i&&null==s?(s=n,i=n=void 0):null==s&&("string"==typeof n?(s=i,i=void 0):(s=i,i=n,n=void 0)),!1===s)s=ue;else if(!s)return e;return 1===a&&(r=s,(s=function(e){return _().off(e),r.apply(this,arguments)}).guid=r.guid||(r.guid=_.guid++)),e.each((function(){_.event.add(this,t,s,i,n)}))}_.event={global:{},add:function(e,t,n,i,s){var a,r,o,d,l,u,c,h,p,m,f,g=N.get(e);if(g)for(n.handler&&(n=(a=n).handler,s=a.selector),n.guid||(n.guid=_.guid++),(d=g.events)||(d=g.events={}),(r=g.handle)||(r=g.handle=function(t){return void 0!==_&&_.event.triggered!==t.type?_.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(A)||[""]).length;l--;)p=f=(o=de.exec(t[l])||[])[1],m=(o[2]||"").split(".").sort(),p&&(c=_.event.special[p]||{},p=(s?c.delegateType:c.bindType)||p,c=_.event.special[p]||{},u=_.extend({type:p,origType:f,data:i,handler:n,guid:n.guid,selector:s,needsContext:s&&_.expr.match.needsContext.test(s),namespace:m.join(".")},a),(h=d[p])||((h=d[p]=[]).delegateCount=0,c.setup&&!1!==c.setup.call(e,i,m,r)||e.addEventListener&&e.addEventListener(p,r)),c.add&&(c.add.call(e,u),u.handler.guid||(u.handler.guid=n.guid)),s?h.splice(h.delegateCount++,0,u):h.push(u),_.event.global[p]=!0)},remove:function(e,t,n,i,s){var a,r,o,d,l,u,c,h,p,m,f,g=N.hasData(e)&&N.get(e);if(g&&(d=g.events)){for(l=(t=(t||"").match(A)||[""]).length;l--;)if(p=f=(o=de.exec(t[l])||[])[1],m=(o[2]||"").split(".").sort(),p){for(c=_.event.special[p]||{},h=d[p=(i?c.delegateType:c.bindType)||p]||[],o=o[2]&&new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"),r=a=h.length;a--;)u=h[a],!s&&f!==u.origType||n&&n.guid!==u.guid||o&&!o.test(u.namespace)||i&&i!==u.selector&&("**"!==i||!u.selector)||(h.splice(a,1),u.selector&&h.delegateCount--,c.remove&&c.remove.call(e,u));r&&!h.length&&(c.teardown&&!1!==c.teardown.call(e,m,g.handle)||_.removeEvent(e,p,g.handle),delete d[p])}else for(p in d)_.event.remove(e,p+t[l],n,i,!0);_.isEmptyObject(d)&&N.remove(e,"handle events")}},dispatch:function(e){e=_.event.fix(e);var t,n,i,s,a,r=[],d=o.call(arguments),l=(N.get(this,"events")||{})[e.type]||[],u=_.event.special[e.type]||{};if(d[0]=e,e.delegateTarget=this,!u.preDispatch||!1!==u.preDispatch.call(this,e)){for(r=_.event.handlers.call(this,e,l),t=0;(s=r[t++])&&!e.isPropagationStopped();)for(e.currentTarget=s.elem,n=0;(a=s.handlers[n++])&&!e.isImmediatePropagationStopped();)e.rnamespace&&!e.rnamespace.test(a.namespace)||(e.handleObj=a,e.data=a.data,void 0!==(i=((_.event.special[a.origType]||{}).handle||a.handler).apply(s.elem,d))&&!1===(e.result=i)&&(e.preventDefault(),e.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,i,s,a,r=[],o=t.delegateCount,d=e.target;if(o&&d.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;d!==this;d=d.parentNode||this)if(1===d.nodeType&&(!0!==d.disabled||"click"!==e.type)){for(i=[],n=0;n-1:_.find(s,this,null,[d]).length),i[s]&&i.push(a);i.length&&r.push({elem:d,handlers:i})}return o]*)\/>/gi,me=/\s*$/g;function ye(e,t){return _.nodeName(e,"table")&&_.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function ve(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Me(e){var t=_e.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function be(e,t){var n,i,s,a,r,o,d,l;if(1===t.nodeType){if(N.hasData(e)&&(a=N.access(e),r=N.set(t,a),l=a.events))for(s in delete r.handle,r.events={},l)for(n=0,i=l[s].length;n1&&"string"==typeof f&&!m.checkClone&&fe.test(f))return e.each((function(s){var a=e.eq(s);g&&(t[0]=f.call(this,s,a.html())),we(a,t,n,i)}));if(h&&(a=(s=ae(t,e[0].ownerDocument,!1,e,i)).firstChild,1===s.childNodes.length&&(s=a),a||i)){for(o=(r=_.map(ee(s,"script"),ve)).length;c")},clone:function(e,t,n){var i,s,a,r,o,d,l,u=e.cloneNode(!0),c=_.contains(e.ownerDocument,e);if(!(m.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||_.isXMLDoc(e)))for(r=ee(u),i=0,s=(a=ee(e)).length;i0&&te(r,!c&&ee(e,"script")),u},cleanData:function(e){for(var t,n,i,s=_.event.special,a=0;void 0!==(n=e[a]);a++)if(W(n)){if(t=n[N.expando]){if(t.events)for(i in t.events)s[i]?_.event.remove(n,i):_.removeEvent(n,i,t.handle);n[N.expando]=void 0}n[I.expando]&&(n[I.expando]=void 0)}}}),_.fn.extend({domManip:we,detach:function(e){return Le(this,e,!0)},remove:function(e){return Le(this,e)},text:function(e){return $(this,(function(e){return void 0===e?_.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return we(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||ye(this,e).appendChild(e)}))},prepend:function(){return we(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=ye(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return we(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return we(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(_.cleanData(ee(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return _.clone(this,e,t)}))},html:function(e){return $(this,(function(e){var t=this[0]||{},n=0,i=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!me.test(e)&&!Q[(X.exec(e)||["",""])[1].toLowerCase()]){e=_.htmlPrefilter(e);try{for(;n")).appendTo(t.documentElement))[0].contentDocument).write(),t.close(),n=De(e,t),ke.detach()),Ye[e]=n),n}var xe=/^margin/,Se=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),He=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=i),t.getComputedStyle(e)},je=function(e,t,n,i){var s,a,r={};for(a in t)r[a]=e.style[a],e.style[a]=t[a];for(a in s=n.apply(e,i||[]),t)e.style[a]=r[a];return s},Ce=r.documentElement;function Ee(e,t,n){var i,s,a,r,o=e.style;return""!==(r=(n=n||He(e))?n.getPropertyValue(t)||n[t]:void 0)&&void 0!==r||_.contains(e.ownerDocument,e)||(r=_.style(e,t)),n&&!m.pixelMarginRight()&&Se.test(r)&&xe.test(t)&&(i=o.width,s=o.minWidth,a=o.maxWidth,o.minWidth=o.maxWidth=o.width=r,r=n.width,o.width=i,o.minWidth=s,o.maxWidth=a),void 0!==r?r+"":r}function Oe(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){var e,t,n,s,a=r.createElement("div"),o=r.createElement("div");function d(){o.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",o.innerHTML="",Ce.appendChild(a);var r=i.getComputedStyle(o);e="1%"!==r.top,s="2px"===r.marginLeft,t="4px"===r.width,o.style.marginRight="50%",n="4px"===r.marginRight,Ce.removeChild(a)}o.style&&(o.style.backgroundClip="content-box",o.cloneNode(!0).style.backgroundClip="",m.clearCloneStyle="content-box"===o.style.backgroundClip,a.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",a.appendChild(o),_.extend(m,{pixelPosition:function(){return d(),e},boxSizingReliable:function(){return null==t&&d(),t},pixelMarginRight:function(){return null==t&&d(),n},reliableMarginLeft:function(){return null==t&&d(),s},reliableMarginRight:function(){var e,t=o.appendChild(r.createElement("div"));return t.style.cssText=o.style.cssText="-webkit-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",t.style.marginRight=t.style.width="0",o.style.width="1px",Ce.appendChild(a),e=!parseFloat(i.getComputedStyle(t).marginRight),Ce.removeChild(a),o.removeChild(t),e}}))}();var Ae=/^(none|table(?!-c[ea]).+)/,Pe={position:"absolute",visibility:"hidden",display:"block"},$e={letterSpacing:"0",fontWeight:"400"},We=["Webkit","O","Moz","ms"],Fe=r.createElement("div").style;function Ne(e){if(e in Fe)return e;for(var t=e[0].toUpperCase()+e.slice(1),n=We.length;n--;)if((e=We[n]+t)in Fe)return e}function Ie(e,t,n){var i=V.exec(t);return i?Math.max(0,i[2]-(n||0))+(i[3]||"px"):t}function ze(e,t,n,i,s){for(var a=n===(i?"border":"content")?4:"width"===t?1:0,r=0;a<4;a+=2)"margin"===n&&(r+=_.css(e,n+J[a],!0,s)),i?("content"===n&&(r-=_.css(e,"padding"+J[a],!0,s)),"margin"!==n&&(r-=_.css(e,"border"+J[a]+"Width",!0,s))):(r+=_.css(e,"padding"+J[a],!0,s),"padding"!==n&&(r+=_.css(e,"border"+J[a]+"Width",!0,s)));return r}function Re(e,t,n){var i=!0,s="width"===t?e.offsetWidth:e.offsetHeight,a=He(e),r="border-box"===_.css(e,"boxSizing",!1,a);if(s<=0||null==s){if(((s=Ee(e,t,a))<0||null==s)&&(s=e.style[t]),Se.test(s))return s;i=r&&(m.boxSizingReliable()||s===e.style[t]),s=parseFloat(s)||0}return s+ze(e,t,n||(r?"border":"content"),i,a)+"px"}function Ue(e,t){for(var n,i,s,a=[],r=0,o=e.length;r1)},show:function(){return Ue(this,!0)},hide:function(){return Ue(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each((function(){B(this)?_(this).show():_(this).hide()}))}}),_.Tween=qe,qe.prototype={constructor:qe,init:function(e,t,n,i,s,a){this.elem=e,this.prop=n,this.easing=s||_.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=i,this.unit=a||(_.cssNumber[n]?"":"px")},cur:function(){var e=qe.propHooks[this.prop];return e&&e.get?e.get(this):qe.propHooks._default.get(this)},run:function(e){var t,n=qe.propHooks[this.prop];return this.options.duration?this.pos=t=_.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):qe.propHooks._default.set(this),this}},qe.prototype.init.prototype=qe.prototype,qe.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=_.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){_.fx.step[e.prop]?_.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[_.cssProps[e.prop]]&&!_.cssHooks[e.prop]?e.elem[e.prop]=e.now:_.style(e.elem,e.prop,e.now+e.unit)}}},qe.propHooks.scrollTop=qe.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},_.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},_.fx=qe.prototype.init,_.fx.step={};var Ve,Je,Be=/^(?:toggle|show|hide)$/,Ge=/queueHooks$/;function Ke(){return i.setTimeout((function(){Ve=void 0})),Ve=_.now()}function Xe(e,t){var n,i=0,s={height:e};for(t=t?1:0;i<4;i+=2-t)s["margin"+(n=J[i])]=s["padding"+n]=e;return t&&(s.opacity=s.width=e),s}function Ze(e,t,n){for(var i,s=(Qe.tweeners[t]||[]).concat(Qe.tweeners["*"]),a=0,r=s.length;a1)},removeAttr:function(e){return this.each((function(){_.removeAttr(this,e)}))}}),_.extend({attr:function(e,t,n){var i,s,a=e.nodeType;if(3!==a&&8!==a&&2!==a)return void 0===e.getAttribute?_.prop(e,t,n):(1===a&&_.isXMLDoc(e)||(t=t.toLowerCase(),s=_.attrHooks[t]||(_.expr.match.bool.test(t)?et:void 0)),void 0!==n?null===n?void _.removeAttr(e,t):s&&"set"in s&&void 0!==(i=s.set(e,n,t))?i:(e.setAttribute(t,n+""),n):s&&"get"in s&&null!==(i=s.get(e,t))?i:null==(i=_.find.attr(e,t))?void 0:i)},attrHooks:{type:{set:function(e,t){if(!m.radioValue&&"radio"===t&&_.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,i,s=0,a=t&&t.match(A);if(a&&1===e.nodeType)for(;n=a[s++];)i=_.propFix[n]||n,_.expr.match.bool.test(n)&&(e[i]=!1),e.removeAttribute(n)}}),et={set:function(e,t,n){return!1===t?_.removeAttr(e,n):e.setAttribute(n,n),n}},_.each(_.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=tt[t]||_.find.attr;tt[t]=function(e,t,i){var s,a;return i||(a=tt[t],tt[t]=s,s=null!=n(e,t,i)?t.toLowerCase():null,tt[t]=a),s}}));var nt=/^(?:input|select|textarea|button)$/i,it=/^(?:a|area)$/i;_.fn.extend({prop:function(e,t){return $(this,_.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[_.propFix[e]||e]}))}}),_.extend({prop:function(e,t,n){var i,s,a=e.nodeType;if(3!==a&&8!==a&&2!==a)return 1===a&&_.isXMLDoc(e)||(t=_.propFix[t]||t,s=_.propHooks[t]),void 0!==n?s&&"set"in s&&void 0!==(i=s.set(e,n,t))?i:e[t]=n:s&&"get"in s&&null!==(i=s.get(e,t))?i:e[t]},propHooks:{tabIndex:{get:function(e){var t=_.find.attr(e,"tabindex");return t?parseInt(t,10):nt.test(e.nodeName)||it.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),m.optSelected||(_.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),_.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){_.propFix[this.toLowerCase()]=this}));var st=/[\t\r\n\f]/g;function at(e){return e.getAttribute&&e.getAttribute("class")||""}_.fn.extend({addClass:function(e){var t,n,i,s,a,r,o,d=0;if(_.isFunction(e))return this.each((function(t){_(this).addClass(e.call(this,t,at(this)))}));if("string"==typeof e&&e)for(t=e.match(A)||[];n=this[d++];)if(s=at(n),i=1===n.nodeType&&(" "+s+" ").replace(st," ")){for(r=0;a=t[r++];)i.indexOf(" "+a+" ")<0&&(i+=a+" ");s!==(o=_.trim(i))&&n.setAttribute("class",o)}return this},removeClass:function(e){var t,n,i,s,a,r,o,d=0;if(_.isFunction(e))return this.each((function(t){_(this).removeClass(e.call(this,t,at(this)))}));if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(A)||[];n=this[d++];)if(s=at(n),i=1===n.nodeType&&(" "+s+" ").replace(st," ")){for(r=0;a=t[r++];)for(;i.indexOf(" "+a+" ")>-1;)i=i.replace(" "+a+" "," ");s!==(o=_.trim(i))&&n.setAttribute("class",o)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):_.isFunction(e)?this.each((function(n){_(this).toggleClass(e.call(this,n,at(this),t),t)})):this.each((function(){var t,i,s,a;if("string"===n)for(i=0,s=_(this),a=e.match(A)||[];t=a[i++];)s.hasClass(t)?s.removeClass(t):s.addClass(t);else void 0!==e&&"boolean"!==n||((t=at(this))&&N.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":N.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,i=0;for(t=" "+e+" ";n=this[i++];)if(1===n.nodeType&&(" "+at(n)+" ").replace(st," ").indexOf(t)>-1)return!0;return!1}});var rt=/\r/g,ot=/[\x20\t\r\n\f]+/g;_.fn.extend({val:function(e){var t,n,i,s=this[0];return arguments.length?(i=_.isFunction(e),this.each((function(n){var s;1===this.nodeType&&(null==(s=i?e.call(this,n,_(this).val()):e)?s="":"number"==typeof s?s+="":_.isArray(s)&&(s=_.map(s,(function(e){return null==e?"":e+""}))),(t=_.valHooks[this.type]||_.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,s,"value")||(this.value=s))}))):s?(t=_.valHooks[s.type]||_.valHooks[s.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(s,"value"))?n:"string"==typeof(n=s.value)?n.replace(rt,""):null==n?"":n:void 0}}),_.extend({valHooks:{option:{get:function(e){var t=_.find.attr(e,"value");return null!=t?t:_.trim(_.text(e)).replace(ot," ")}},select:{get:function(e){for(var t,n,i=e.options,s=e.selectedIndex,a="select-one"===e.type||s<0,r=a?null:[],o=a?s+1:i.length,d=s<0?o:a?s:0;d-1)&&(n=!0);return n||(e.selectedIndex=-1),a}}}}),_.each(["radio","checkbox"],(function(){_.valHooks[this]={set:function(e,t){if(_.isArray(t))return e.checked=_.inArray(_(e).val(),t)>-1}},m.checkOn||(_.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}));var dt=/^(?:focusinfocus|focusoutblur)$/;_.extend(_.event,{trigger:function(e,t,n,s){var a,o,d,l,u,c,h,m=[n||r],f=p.call(e,"type")?e.type:e,g=p.call(e,"namespace")?e.namespace.split("."):[];if(o=d=n=n||r,3!==n.nodeType&&8!==n.nodeType&&!dt.test(f+_.event.triggered)&&(f.indexOf(".")>-1&&(g=f.split("."),f=g.shift(),g.sort()),u=f.indexOf(":")<0&&"on"+f,(e=e[_.expando]?e:new _.Event(f,"object"==typeof e&&e)).isTrigger=s?2:3,e.namespace=g.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:_.makeArray(t,[e]),h=_.event.special[f]||{},s||!h.trigger||!1!==h.trigger.apply(n,t))){if(!s&&!h.noBubble&&!_.isWindow(n)){for(l=h.delegateType||f,dt.test(l+f)||(o=o.parentNode);o;o=o.parentNode)m.push(o),d=o;d===(n.ownerDocument||r)&&m.push(d.defaultView||d.parentWindow||i)}for(a=0;(o=m[a++])&&!e.isPropagationStopped();)e.type=a>1?l:h.bindType||f,(c=(N.get(o,"events")||{})[e.type]&&N.get(o,"handle"))&&c.apply(o,t),(c=u&&o[u])&&c.apply&&W(o)&&(e.result=c.apply(o,t),!1===e.result&&e.preventDefault());return e.type=f,s||e.isDefaultPrevented()||h._default&&!1!==h._default.apply(m.pop(),t)||!W(n)||u&&_.isFunction(n[f])&&!_.isWindow(n)&&((d=n[u])&&(n[u]=null),_.event.triggered=f,n[f](),_.event.triggered=void 0,d&&(n[u]=d)),e.result}},simulate:function(e,t,n){var i=_.extend(new _.Event,n,{type:e,isSimulated:!0});_.event.trigger(i,null,t)}}),_.fn.extend({trigger:function(e,t){return this.each((function(){_.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return _.event.trigger(e,t,n,!0)}}),_.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),(function(e,t){_.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}})),_.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),m.focusin="onfocusin"in i,m.focusin||_.each({focus:"focusin",blur:"focusout"},(function(e,t){var n=function(e){_.event.simulate(t,e.target,_.event.fix(e))};_.event.special[t]={setup:function(){var i=this.ownerDocument||this,s=N.access(i,t);s||i.addEventListener(e,n,!0),N.access(i,t,(s||0)+1)},teardown:function(){var i=this.ownerDocument||this,s=N.access(i,t)-1;s?N.access(i,t,s):(i.removeEventListener(e,n,!0),N.remove(i,t))}}}));var lt=i.location,ut=_.now(),ct=/\?/;_.parseJSON=function(e){return JSON.parse(e+"")},_.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new i.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||_.error("Invalid XML: "+e),t};var ht=/#.*$/,pt=/([?&])_=[^&]*/,mt=/^(.*?):[ \t]*([^\r\n]*)$/gm,ft=/^(?:GET|HEAD)$/,_t=/^\/\//,gt={},yt={},vt="*/".concat("*"),Mt=r.createElement("a");function bt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var i,s=0,a=t.toLowerCase().match(A)||[];if(_.isFunction(n))for(;i=a[s++];)"+"===i[0]?(i=i.slice(1)||"*",(e[i]=e[i]||[]).unshift(n)):(e[i]=e[i]||[]).push(n)}}function wt(e,t,n,i){var s={},a=e===yt;function r(o){var d;return s[o]=!0,_.each(e[o]||[],(function(e,o){var l=o(t,n,i);return"string"!=typeof l||a||s[l]?a?!(d=l):void 0:(t.dataTypes.unshift(l),r(l),!1)})),d}return r(t.dataTypes[0])||!s["*"]&&r("*")}function Lt(e,t){var n,i,s=_.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((s[n]?e:i||(i={}))[n]=t[n]);return i&&_.extend(!0,e,i),e}Mt.href=lt.href,_.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:lt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(lt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":vt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":_.parseJSON,"text xml":_.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Lt(Lt(e,_.ajaxSettings),t):Lt(_.ajaxSettings,e)},ajaxPrefilter:bt(gt),ajaxTransport:bt(yt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,s,a,o,d,l,u,c,h=_.ajaxSetup({},t),p=h.context||h,m=h.context&&(p.nodeType||p.jquery)?_(p):_.event,f=_.Deferred(),g=_.Callbacks("once memory"),y=h.statusCode||{},v={},M={},b=0,w="canceled",L={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!o)for(o={};t=mt.exec(a);)o[t[1].toLowerCase()]=t[2];t=o[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=M[n]=M[n]||e,v[e]=t),this},overrideMimeType:function(e){return b||(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(b<2)for(t in e)y[t]=[y[t],e[t]];else L.always(e[L.status]);return this},abort:function(e){var t=e||w;return n&&n.abort(t),k(0,t),this}};if(f.promise(L).complete=g.add,L.success=L.done,L.error=L.fail,h.url=((e||h.url||lt.href)+"").replace(ht,"").replace(_t,lt.protocol+"//"),h.type=t.method||t.type||h.method||h.type,h.dataTypes=_.trim(h.dataType||"*").toLowerCase().match(A)||[""],null==h.crossDomain){l=r.createElement("a");try{l.href=h.url,l.href=l.href,h.crossDomain=Mt.protocol+"//"+Mt.host!=l.protocol+"//"+l.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=_.param(h.data,h.traditional)),wt(gt,h,t,L),2===b)return L;for(c in(u=_.event&&h.global)&&0==_.active++&&_.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!ft.test(h.type),s=h.url,h.hasContent||(h.data&&(s=h.url+=(ct.test(s)?"&":"?")+h.data,delete h.data),!1===h.cache&&(h.url=pt.test(s)?s.replace(pt,"$1_="+ut++):s+(ct.test(s)?"&":"?")+"_="+ut++)),h.ifModified&&(_.lastModified[s]&&L.setRequestHeader("If-Modified-Since",_.lastModified[s]),_.etag[s]&&L.setRequestHeader("If-None-Match",_.etag[s])),(h.data&&h.hasContent&&!1!==h.contentType||t.contentType)&&L.setRequestHeader("Content-Type",h.contentType),L.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+vt+"; q=0.01":""):h.accepts["*"]),h.headers)L.setRequestHeader(c,h.headers[c]);if(h.beforeSend&&(!1===h.beforeSend.call(p,L,h)||2===b))return L.abort();for(c in w="abort",{success:1,error:1,complete:1})L[c](h[c]);if(n=wt(yt,h,t,L)){if(L.readyState=1,u&&m.trigger("ajaxSend",[L,h]),2===b)return L;h.async&&h.timeout>0&&(d=i.setTimeout((function(){L.abort("timeout")}),h.timeout));try{b=1,n.send(v,k)}catch(e){if(!(b<2))throw e;k(-1,e)}}else k(-1,"No Transport");function k(e,t,r,o){var l,c,v,M,w,k=t;2!==b&&(b=2,d&&i.clearTimeout(d),n=void 0,a=o||"",L.readyState=e>0?4:0,l=e>=200&&e<300||304===e,r&&(M=function(e,t,n){for(var i,s,a,r,o=e.contents,d=e.dataTypes;"*"===d[0];)d.shift(),void 0===i&&(i=e.mimeType||t.getResponseHeader("Content-Type"));if(i)for(s in o)if(o[s]&&o[s].test(i)){d.unshift(s);break}if(d[0]in n)a=d[0];else{for(s in n){if(!d[0]||e.converters[s+" "+d[0]]){a=s;break}r||(r=s)}a=a||r}if(a)return a!==d[0]&&d.unshift(a),n[a]}(h,L,r)),M=function(e,t,n,i){var s,a,r,o,d,l={},u=e.dataTypes.slice();if(u[1])for(r in e.converters)l[r.toLowerCase()]=e.converters[r];for(a=u.shift();a;)if(e.responseFields[a]&&(n[e.responseFields[a]]=t),!d&&i&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),d=a,a=u.shift())if("*"===a)a=d;else if("*"!==d&&d!==a){if(!(r=l[d+" "+a]||l["* "+a]))for(s in l)if((o=s.split(" "))[1]===a&&(r=l[d+" "+o[0]]||l["* "+o[0]])){!0===r?r=l[s]:!0!==l[s]&&(a=o[0],u.unshift(o[1]));break}if(!0!==r)if(r&&e.throws)t=r(t);else try{t=r(t)}catch(e){return{state:"parsererror",error:r?e:"No conversion from "+d+" to "+a}}}return{state:"success",data:t}}(h,M,L,l),l?(h.ifModified&&((w=L.getResponseHeader("Last-Modified"))&&(_.lastModified[s]=w),(w=L.getResponseHeader("etag"))&&(_.etag[s]=w)),204===e||"HEAD"===h.type?k="nocontent":304===e?k="notmodified":(k=M.state,c=M.data,l=!(v=M.error))):(v=k,!e&&k||(k="error",e<0&&(e=0))),L.status=e,L.statusText=(t||k)+"",l?f.resolveWith(p,[c,k,L]):f.rejectWith(p,[L,k,v]),L.statusCode(y),y=void 0,u&&m.trigger(l?"ajaxSuccess":"ajaxError",[L,h,l?c:v]),g.fireWith(p,[L,k]),u&&(m.trigger("ajaxComplete",[L,h]),--_.active||_.event.trigger("ajaxStop")))}return L},getJSON:function(e,t,n){return _.get(e,t,n,"json")},getScript:function(e,t){return _.get(e,void 0,t,"script")}}),_.each(["get","post"],(function(e,t){_[t]=function(e,n,i,s){return _.isFunction(n)&&(s=s||i,i=n,n=void 0),_.ajax(_.extend({url:e,type:t,dataType:s,data:n,success:i},_.isPlainObject(e)&&e))}})),_._evalUrl=function(e){return _.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})},_.fn.extend({wrapAll:function(e){var t;return _.isFunction(e)?this.each((function(t){_(this).wrapAll(e.call(this,t))})):(this[0]&&(t=_(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this)},wrapInner:function(e){return _.isFunction(e)?this.each((function(t){_(this).wrapInner(e.call(this,t))})):this.each((function(){var t=_(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=_.isFunction(e);return this.each((function(n){_(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(){return this.parent().each((function(){_.nodeName(this,"body")||_(this).replaceWith(this.childNodes)})).end()}}),_.expr.filters.hidden=function(e){return!_.expr.filters.visible(e)},_.expr.filters.visible=function(e){return e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0};var kt=/%20/g,Yt=/\[\]$/,Dt=/\r?\n/g,Tt=/^(?:submit|button|image|reset|file)$/i,xt=/^(?:input|select|textarea|keygen)/i;function St(e,t,n,i){var s;if(_.isArray(t))_.each(t,(function(t,s){n||Yt.test(e)?i(e,s):St(e+"["+("object"==typeof s&&null!=s?t:"")+"]",s,n,i)}));else if(n||"object"!==_.type(t))i(e,t);else for(s in t)St(e+"["+s+"]",t[s],n,i)}_.param=function(e,t){var n,i=[],s=function(e,t){t=_.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=_.ajaxSettings&&_.ajaxSettings.traditional),_.isArray(e)||e.jquery&&!_.isPlainObject(e))_.each(e,(function(){s(this.name,this.value)}));else for(n in e)St(n,e[n],t,s);return i.join("&").replace(kt,"+")},_.fn.extend({serialize:function(){return _.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=_.prop(this,"elements");return e?_.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!_(this).is(":disabled")&&xt.test(this.nodeName)&&!Tt.test(e)&&(this.checked||!K.test(e))})).map((function(e,t){var n=_(this).val();return null==n?null:_.isArray(n)?_.map(n,(function(e){return{name:t.name,value:e.replace(Dt,"\r\n")}})):{name:t.name,value:n.replace(Dt,"\r\n")}})).get()}}),_.ajaxSettings.xhr=function(){try{return new i.XMLHttpRequest}catch(e){}};var Ht={0:200,1223:204},jt=_.ajaxSettings.xhr();m.cors=!!jt&&"withCredentials"in jt,m.ajax=jt=!!jt,_.ajaxTransport((function(e){var t,n;if(m.cors||jt&&!e.crossDomain)return{send:function(s,a){var r,o=e.xhr();if(o.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(r in e.xhrFields)o[r]=e.xhrFields[r];for(r in e.mimeType&&o.overrideMimeType&&o.overrideMimeType(e.mimeType),e.crossDomain||s["X-Requested-With"]||(s["X-Requested-With"]="XMLHttpRequest"),s)o.setRequestHeader(r,s[r]);t=function(e){return function(){t&&(t=n=o.onload=o.onerror=o.onabort=o.onreadystatechange=null,"abort"===e?o.abort():"error"===e?"number"!=typeof o.status?a(0,"error"):a(o.status,o.statusText):a(Ht[o.status]||o.status,o.statusText,"text"!==(o.responseType||"text")||"string"!=typeof o.responseText?{binary:o.response}:{text:o.responseText},o.getAllResponseHeaders()))}},o.onload=t(),n=o.onerror=t("error"),void 0!==o.onabort?o.onabort=n:o.onreadystatechange=function(){4===o.readyState&&i.setTimeout((function(){t&&n()}))},t=t("abort");try{o.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}})),_.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return _.globalEval(e),e}}}),_.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),_.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain)return{send:function(i,s){t=_("