/*

 jQuery UI 1.8.11

 Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
 Dual licensed under the MIT or GPL Version 2 licenses.
 http://jquery.org/license

 http://docs.jquery.com/UI
*/
(function(c,a){function b(b){return!c(b).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};c.ui.version||(c.extend(c.ui,{version:"1.8.11",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,
PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),c.fn.extend({_focus:c.fn.focus,focus:function(b,a){return typeof b==="number"?this.each(function(){var f=this;setTimeout(function(){c(f).focus();a&&a.call(f)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;b=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,
"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!b.length?c(document):b},zIndex:function(b){if(b!==a)return this.css("zIndex",b);if(this.length)for(var b=c(this[0]),e;b.length&&b[0]!==document;){e=b.css("position");if(e===
"absolute"||e==="relative"||e==="fixed")if(e=parseInt(b.css("zIndex"),10),!isNaN(e)&&e!==0)return e;b=b.parent()}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(b){b.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),c.each(["Width","Height"],function(b,e){function f(b,a,e,f){c.each(h,function(){a-=parseFloat(c.curCSS(b,"padding"+this,!0))||0;e&&(a-=parseFloat(c.curCSS(b,
"border"+this+"Width",!0))||0);f&&(a-=parseFloat(c.curCSS(b,"margin"+this,!0))||0)});return a}var h=e==="Width"?["Left","Right"]:["Top","Bottom"],g=e.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+e]=function(b){return b===a?i["inner"+e].call(this):this.each(function(){c(this).css(g,f(this,b)+"px")})};c.fn["outer"+e]=function(b,a){return typeof b!=="number"?i["outer"+e].call(this,b):this.each(function(){c(this).css(g,
f(this,b,!0,a)+"px")})}}),c.extend(c.expr[":"],{data:function(b,a,f){return!!c.data(b,f[3])},focusable:function(a){var e=a.nodeName.toLowerCase(),f=c.attr(a,"tabindex");if("area"===e){e=a.parentNode;f=e.name;if(!a.href||!f||e.nodeName.toLowerCase()!=="map")return!1;a=c("img[usemap=#"+f+"]")[0];return!!a&&b(a)}return(/input|select|textarea|button|object/.test(e)?!a.disabled:"a"==e?a.href||!isNaN(f):!isNaN(f))&&b(a)},tabbable:function(b){var a=c.attr(b,"tabindex");return(isNaN(a)||a>=0)&&c(b).is(":focusable")}}),
c(function(){var b=document.body,a=b.appendChild(a=document.createElement("div"));c.extend(a.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=a.offsetHeight===100;c.support.selectstart="onselectstart"in a;b.removeChild(a).style.display="none"}),c.extend(c.ui,{plugin:{add:function(b,a,f){var b=c.ui[b].prototype,h;for(h in f)b.plugins[h]=b.plugins[h]||[],b.plugins[h].push([a,f[h]])},call:function(b,a,c){if((a=b.plugins[a])&&b.element[0].parentNode)for(var h=0;h<a.length;h++)b.options[a[h][0]]&&
a[h][1].apply(b.element,c)}},contains:function(b,a){return document.compareDocumentPosition?b.compareDocumentPosition(a)&16:b!==a&&b.contains(a)},hasScroll:function(b,a){if(c(b).css("overflow")==="hidden")return!1;var f=a&&a==="left"?"scrollLeft":"scrollTop",h=!1;if(b[f]>0)return!0;b[f]=1;h=b[f]>0;b[f]=0;return h},isOverAxis:function(b,a,c){return b>a&&b<a+c},isOver:function(b,a,f,h,g,i){return c.ui.isOverAxis(b,f,g)&&c.ui.isOverAxis(a,h,i)}}))})(jQuery);
(function(c,a){if(c.cleanData){var b=c.cleanData;c.cleanData=function(a){for(var f=0,d;(d=a[f])!=null;f++)c(d).triggerHandler("remove");b(a)}}else{var d=c.fn.remove;c.fn.remove=function(b,a){return this.each(function(){a||(!b||c.filter(b,[this]).length)&&c("*",this).add([this]).each(function(){c(this).triggerHandler("remove")});return d.call(c(this),b,a)})}}c.widget=function(b,a,d){var g=b.split(".")[0],i,b=b.split(".")[1];i=g+"-"+b;if(!d)d=a,a=c.Widget;c.expr[":"][i]=function(a){return!!c.data(a,
b)};c[g]=c[g]||{};c[g][b]=function(b,a){arguments.length&&this._createWidget(b,a)};a=new a;a.options=c.extend(!0,{},a.options);c[g][b].prototype=c.extend(!0,a,{namespace:g,widgetName:b,widgetEventPrefix:c[g][b].prototype.widgetEventPrefix||b,widgetBaseClass:i},d);c.widget.bridge(b,c[g][b])};c.widget.bridge=function(b,f){c.fn[b]=function(d){var g=typeof d==="string",i=Array.prototype.slice.call(arguments,1),j=this,d=!g&&i.length?c.extend.apply(null,[!0,d].concat(i)):d;if(g&&d.charAt(0)==="_")return j;
g?this.each(function(){var f=c.data(this,b),g=f&&c.isFunction(f[d])?f[d].apply(f,i):f;if(g!==f&&g!==a)return j=g,!1}):this.each(function(){var a=c.data(this,b);a?a.option(d||{})._init():c.data(this,b,new f(d,this))});return j}};c.Widget=function(b,a){arguments.length&&this._createWidget(b,a)};c.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(b,a){c.data(a,this.widgetName,this);this.element=c(a);this.options=c.extend(!0,{},this.options,this._getCreateOptions(),
b);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return c.metadata&&c.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},widget:function(){return this.element},
option:function(b,f){var d=b;if(arguments.length===0)return c.extend({},this.options);if(typeof b==="string"){if(f===a)return this.options[b];d={};d[b]=f}this._setOptions(d);return this},_setOptions:function(b){var a=this;c.each(b,function(b,c){a._setOption(b,c)});return this},_setOption:function(b,a){this.options[b]=a;b==="disabled"&&this.widget()[a?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",a);return this},enable:function(){return this._setOption("disabled",
!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(b,a,d){var g=this.options[b],a=c.Event(a);a.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase();d=d||{};if(a.originalEvent)for(var b=c.event.props.length,i;b;)i=c.event.props[--b],a[i]=a.originalEvent[i];this.element.trigger(a,d);return!(c.isFunction(g)&&g.call(this.element[0],a,d)===!1||a.isDefaultPrevented())}}})(jQuery);
(function(c){c.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(b){return a._mouseDown(b)}).bind("click."+this.widgetName,function(b){if(!0===c.data(b.target,a.widgetName+".preventClickEvent"))return c.removeData(b.target,a.widgetName+".preventClickEvent"),b.stopImmediatePropagation(),!1});this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(a){a.originalEvent=
a.originalEvent||{};if(!a.originalEvent.mouseHandled){this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=a;var b=this,d=a.which==1,e=typeof this.options.cancel=="string"?c(a.target).parents().add(a.target).filter(this.options.cancel).length:!1;if(!d||e||!this._mouseCapture(a))return!0;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){b.mouseDelayMet=!0},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)&&(this._mouseStarted=
this._mouseStart(a)!==!1,!this._mouseStarted))return a.preventDefault(),!0;!0===c.data(a.target,this.widgetName+".preventClickEvent")&&c.removeData(a.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(a){return b._mouseMove(a)};this._mouseUpDelegate=function(a){return b._mouseUp(a)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.preventDefault();return a.originalEvent.mouseHandled=!0}},_mouseMove:function(a){if(c.browser.msie&&
!(document.documentMode>=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted)return this._mouseDrag(a),a.preventDefault();if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==!1)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted)this._mouseStarted=
!1,a.target==this._mouseDownEvent.target&&c.data(a.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(a);return!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);
(function(c){c.ui=c.ui||{};var a=/left|center|right/,b=/top|center|bottom/,d=c.fn.position,e=c.fn.offset;c.fn.position=function(f){if(!f||!f.of)return d.apply(this,arguments);var f=c.extend({},f),e=c(f.of),g=e[0],i=(f.collision||"flip").split(" "),j=f.offset?f.offset.split(" "):[0,0],k,n,m;g.nodeType===9?(k=e.width(),n=e.height(),m={top:0,left:0}):g.setTimeout?(k=e.width(),n=e.height(),m={top:e.scrollTop(),left:e.scrollLeft()}):g.preventDefault?(f.at="left top",k=n=0,m={top:f.of.pageY,left:f.of.pageX}):
(k=e.outerWidth(),n=e.outerHeight(),m=e.offset());c.each(["my","at"],function(){var c=(f[this]||"").split(" ");c.length===1&&(c=a.test(c[0])?c.concat(["center"]):b.test(c[0])?["center"].concat(c):["center","center"]);c[0]=a.test(c[0])?c[0]:"center";c[1]=b.test(c[1])?c[1]:"center";f[this]=c});i.length===1&&(i[1]=i[0]);j[0]=parseInt(j[0],10)||0;j.length===1&&(j[1]=j[0]);j[1]=parseInt(j[1],10)||0;f.at[0]==="right"?m.left+=k:f.at[0]==="center"&&(m.left+=k/2);f.at[1]==="bottom"?m.top+=n:f.at[1]==="center"&&
(m.top+=n/2);m.left+=j[0];m.top+=j[1];return this.each(function(){var b=c(this),a=b.outerWidth(),d=b.outerHeight(),e=parseInt(c.curCSS(this,"marginLeft",!0))||0,h=parseInt(c.curCSS(this,"marginTop",!0))||0,g=a+e+(parseInt(c.curCSS(this,"marginRight",!0))||0),p=d+h+(parseInt(c.curCSS(this,"marginBottom",!0))||0),l=c.extend({},m),o;f.my[0]==="right"?l.left-=a:f.my[0]==="center"&&(l.left-=a/2);f.my[1]==="bottom"?l.top-=d:f.my[1]==="center"&&(l.top-=d/2);l.left=Math.round(l.left);l.top=Math.round(l.top);
o={left:l.left-e,top:l.top-h};c.each(["left","top"],function(b,e){if(c.ui.position[i[b]])c.ui.position[i[b]][e](l,{targetWidth:k,targetHeight:n,elemWidth:a,elemHeight:d,collisionPosition:o,collisionWidth:g,collisionHeight:p,offset:j,my:f.my,at:f.at})});c.fn.bgiframe&&b.bgiframe();b.offset(c.extend(l,{using:f.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window),d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left=d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,
b.left)},top:function(b,a){var d=c(window),d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window),d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft(),e=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,j=a.at[0]==="left"?a.targetWidth:-a.targetWidth,k=-2*a.offset[0];b.left+=a.collisionPosition.left<0?e+j+k:d>0?e+j+k:0}},top:function(b,
a){if(a.at[1]!=="center"){var d=c(window),d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop(),e=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,j=a.at[1]==="top"?a.targetHeight:-a.targetHeight,k=-2*a.offset[1];b.top+=a.collisionPosition.top<0?e+j+k:d>0?e+j+k:0}}}};if(!c.offset.setOffset)c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b),e=d.offset(),j=parseInt(c.curCSS(b,"top",!0),10)||0,k=parseInt(c.curCSS(b,
"left",!0),10)||0,e={top:a.top-e.top+j,left:a.left-e.left+k};"using"in a?a.using.call(b,e):d.css(e)},c.fn.offset=function(b){var a=this[0];return!a||!a.ownerDocument?null:b?this.each(function(){c.offset.setOffset(this,b)}):e.call(this)}})(jQuery);
(function(c){c.widget("ui.sortable",c.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=
this.items.length?/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){a==="disabled"?(this.options[a]=b,this.widget()[b?
"addClass":"removeClass"]("ui-sortable-disabled")):c.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(a,b){if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(a);var d=null,e=this;c(a.target).parents().each(function(){if(c.data(this,"sortable-item")==e)return d=c(this),!1});c.data(a.target,"sortable-item")==e&&(d=c(a.target));if(!d)return!1;if(this.options.handle&&!b){var f=!1;c(this.options.handle,d).find("*").andSelf().each(function(){this==
a.target&&(f=!0)});if(!f)return!1}this.currentItem=d;this._removeCurrentsFromItems();return!0},_mouseStart:function(a,b,d){b=this.options;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=
this.helper.css("position");c.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();
b.containment&&this._setContainment();if(b.cursor){if(c("body").css("cursor"))this._storedCursor=c("body").css("cursor");c("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();
this._trigger("start",a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(d=this.containers.length-1;d>=0;d--)this.containers[d]._trigger("activate",a,this._uiHash(this));if(c.ui.ddmanager)c.ui.ddmanager.current=this;c.ui.ddmanager&&!b.dropBehaviour&&c.ui.ddmanager.prepareOffsets(this,a);this.dragging=!0;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a);return!0},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");
if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,d=!1;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY<b.scrollSensitivity)this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop+b.scrollSpeed;else if(a.pageY-this.overflowOffset.top<b.scrollSensitivity)this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop-b.scrollSpeed;if(this.overflowOffset.left+
this.scrollParent[0].offsetWidth-a.pageX<b.scrollSensitivity)this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft+b.scrollSpeed;else if(a.pageX-this.overflowOffset.left<b.scrollSensitivity)this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft-b.scrollSpeed}else a.pageY-c(document).scrollTop()<b.scrollSensitivity?d=c(document).scrollTop(c(document).scrollTop()-b.scrollSpeed):c(window).height()-(a.pageY-c(document).scrollTop())<b.scrollSensitivity&&(d=c(document).scrollTop(c(document).scrollTop()+
b.scrollSpeed)),a.pageX-c(document).scrollLeft()<b.scrollSensitivity?d=c(document).scrollLeft(c(document).scrollLeft()-b.scrollSpeed):c(window).width()-(a.pageX-c(document).scrollLeft())<b.scrollSensitivity&&(d=c(document).scrollLeft(c(document).scrollLeft()+b.scrollSpeed));d!==!1&&c.ui.ddmanager&&!b.dropBehaviour&&c.ui.ddmanager.prepareOffsets(this,a)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";
if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(b=this.items.length-1;b>=0;b--){var d=this.items[b],e=d.item[0],f=this._intersectsWithPointer(d);if(f&&e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!c.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!c.ui.contains(this.element[0],e):1)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(d))this._rearrange(a,d);
else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);c.ui.ddmanager&&c.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return!1},_mouseStop:function(a,b){if(a){c.ui.ddmanager&&!this.options.dropBehaviour&&c.ui.ddmanager.drop(this,a);if(this.options.revert){var d=this,e=d.placeholder.offset();d.reverting=!0;c(this.helper).animate({left:e.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?
0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(a)})}else this._clear(a,b);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var a=this.containers.length-1;a>=0;a--)if(this.containers[a]._trigger("deactivate",
null,this._uiHash(this)),this.containers[a].containerCache.over)this.containers[a]._trigger("out",null,this._uiHash(this)),this.containers[a].containerCache.over=0}this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),c.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?c(this.domPosition.prev).after(this.currentItem):
c(this.domPosition.parent).prepend(this.currentItem));return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),d=[],a=a||{};c(b).each(function(){var b=(c(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);b&&d.push((a.key||b[1]+"[]")+"="+(a.key&&a.expression?b[1]:b[2]))});!d.length&&a.key&&d.push(a.key+"=");return d.join("&")},toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),d=[],a=a||{};b.each(function(){d.push(c(a.item||this).attr(a.attribute||
"id")||"")});return d},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,h=a.left,g=h+a.width,i=a.top,j=i+a.height,k=this.offset.click.top,n=this.offset.click.left;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?e+k>i&&e+k<j&&b+n>h&&b+n<g:h<b+this.helperProportions.width/
2&&c-this.helperProportions.width/2<g&&i<e+this.helperProportions.height/2&&f-this.helperProportions.height/2<j},_intersectsWithPointer:function(a){var b=c.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top,a.height),a=c.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left,a.width),b=b&&a,a=this._getDragVerticalDirection(),d=this._getDragHorizontalDirection();return!b?!1:this.floating?d&&d=="right"||a=="down"?2:1:a&&(a=="down"?2:1)},_intersectsWithSides:function(a){var b=
c.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,a.top+a.height/2,a.height),a=c.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,a.left+a.width/2,a.width),d=this._getDragVerticalDirection(),e=this._getDragHorizontalDirection();return this.floating&&e?e=="right"&&a||e=="left"&&!a:d&&(d=="down"&&b||d=="up"&&!b)},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-
this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],d=[],e=this._connectWith();if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=c(e[a]),h=f.length-1;h>=0;h--){var g=c.data(f[h],"sortable");g&&g!=this&&!g.options.disabled&&d.push([c.isFunction(g.options.items)?g.options.items.call(g.element):
c(g.options.items,g.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),g])}d.push([c.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):c(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(a=d.length-1;a>=0;a--)d[a][0].each(function(){b.push(this)});return c(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"),b=0;b<this.items.length;b++)for(var c=
0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(a){this.items=[];this.containers=[this];var b=this.items,d=[[c.isFunction(this.options.items)?this.options.items.call(this.element[0],a,{item:this.currentItem}):c(this.options.items,this.element),this]],e=this._connectWith();if(e)for(var f=e.length-1;f>=0;f--)for(var h=c(e[f]),g=h.length-1;g>=0;g--){var i=c.data(h[g],"sortable");i&&i!=this&&!i.options.disabled&&(d.push([c.isFunction(i.options.items)?i.options.items.call(i.element[0],
a,{item:this.currentItem}):c(i.options.items,i.element),i]),this.containers.push(i))}for(f=d.length-1;f>=0;f--){a=d[f][1];e=d[f][0];g=0;for(h=e.length;g<h;g++)i=c(e[g]),i.data("sortable-item",a),b.push({item:i,instance:a,width:0,height:0,left:0,top:0})}},refreshPositions:function(a){if(this.offsetParent&&this.helper)this.offset.parent=this._getParentOffset();for(var b=this.items.length-1;b>=0;b--){var d=this.items[b],e=this.options.toleranceElement?c(this.options.toleranceElement,d.item):d.item;if(!a)d.width=
e.outerWidth(),d.height=e.outerHeight();e=e.offset();d.left=e.left;d.top=e.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b=this.containers.length-1;b>=0;b--)e=this.containers[b].element.offset(),this.containers[b].containerCache.left=e.left,this.containers[b].containerCache.top=e.top,this.containers[b].containerCache.width=this.containers[b].element.outerWidth(),this.containers[b].containerCache.height=this.containers[b].element.outerHeight();
return this},_createPlaceholder:function(a){var b=a||this,d=b.options;if(!d.placeholder||d.placeholder.constructor==String){var e=d.placeholder;d.placeholder={element:function(){var a=c(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)a.style.visibility="hidden";return a},update:function(a,c){if(!e||d.forcePlaceholderSize)c.height()||c.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||
0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10)),c.width()||c.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}b.placeholder=c(d.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);d.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,d=null,e=this.containers.length-1;e>=0;e--)if(!c.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!b||
!c.ui.contains(this.containers[e].element[0],b.element[0]))b=this.containers[e],d=e}else if(this.containers[e].containerCache.over)this.containers[e]._trigger("out",a,this._uiHash(this)),this.containers[e].containerCache.over=0;if(b)if(this.containers.length===1)this.containers[d]._trigger("over",a,this._uiHash(this)),this.containers[d].containerCache.over=1;else if(this.currentContainer!=this.containers[d]){for(var b=1E4,e=null,f=this.positionAbs[this.containers[d].floating?"left":"top"],h=this.items.length-
1;h>=0;h--)if(c.ui.contains(this.containers[d].element[0],this.items[h].item[0])){var g=this.items[h][this.containers[d].floating?"left":"top"];Math.abs(g-f)<b&&(b=Math.abs(g-f),e=this.items[h])}if(e||this.options.dropOnEmpty)this.currentContainer=this.containers[d],e?this._rearrange(a,e,null,!0):this._rearrange(a,null,this.containers[d].element,!0),this._trigger("change",a,this._uiHash()),this.containers[d]._trigger("change",a,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,
this.placeholder),this.containers[d]._trigger("over",a,this._uiHash(this)),this.containers[d].containerCache.over=1}},_createHelper:function(a){var b=this.options,a=c.isFunction(b.helper)?c(b.helper.apply(this.element[0],[a,this.currentItem])):b.helper=="clone"?this.currentItem.clone():this.currentItem;a.parents("body").length||c(b.appendTo!="parent"?b.appendTo:this.currentItem[0].parentNode)[0].appendChild(a[0]);if(a[0]==this.currentItem[0])this._storedCSS={width:this.currentItem[0].style.width,
height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")};(a[0].style.width==""||b.forceHelperSize)&&a.width(this.currentItem.width());(a[0].style.height==""||b.forceHelperSize)&&a.height(this.currentItem.height());return a},_adjustOffsetFromHelper:function(a){typeof a=="string"&&(a=a.split(" "));c.isArray(a)&&(a={left:+a[0],top:+a[1]||0});if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in
a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&c.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(a.left+=this.scrollParent.scrollLeft(),a.top+=
this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&c.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),
left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;
if(a.containment=="document"||a.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,c(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(c(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)){var b=c(a.containment)[0],a=c(a.containment).offset(),
d=c(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(c(b).css("borderLeftWidth"),10)||0)+(parseInt(c(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(c(b).css("borderTopWidth"),10)||0)+(parseInt(c(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(d?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(c(b).css("borderLeftWidth"),10)||0)-(parseInt(c(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,a.top+(d?Math.max(b.scrollHeight,
b.offsetHeight):b.offsetHeight)-(parseInt(c(b).css("borderTopWidth"),10)||0)-(parseInt(c(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(a,b){if(!b)b=this.position;var d=a=="absolute"?1:-1,e=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&c.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(e[0].tagName);return{top:b.top+this.offset.relative.top*d+this.offset.parent.top*
d-(c.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:e.scrollTop())*d),left:b.left+this.offset.relative.left*d+this.offset.parent.left*d-(c.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:e.scrollLeft())*d)}},_generatePosition:function(a){var b=this.options,d=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&c.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:
this.scrollParent,e=/(html|body)/i.test(d[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]))this.offset.relative=this._getRelativeOffset();var f=a.pageX,h=a.pageY;this.originalPosition&&(this.containment&&(a.pageX-this.offset.click.left<this.containment[0]&&(f=this.containment[0]+this.offset.click.left),a.pageY-this.offset.click.top<this.containment[1]&&(h=this.containment[1]+this.offset.click.top),a.pageX-this.offset.click.left>
this.containment[2]&&(f=this.containment[2]+this.offset.click.left),a.pageY-this.offset.click.top>this.containment[3]&&(h=this.containment[3]+this.offset.click.top)),b.grid&&(h=this.originalPageY+Math.round((h-this.originalPageY)/b.grid[1])*b.grid[1],h=this.containment?!(h-this.offset.click.top<this.containment[1]||h-this.offset.click.top>this.containment[3])?h:!(h-this.offset.click.top<this.containment[1])?h-b.grid[1]:h+b.grid[1]:h,f=this.originalPageX+Math.round((f-this.originalPageX)/b.grid[0])*
b.grid[0],f=this.containment?!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:!(f-this.offset.click.left<this.containment[0])?f-b.grid[0]:f+b.grid[0]:f));return{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(c.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(c.browser.safari&&
this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_rearrange:function(a,b,c,e){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?b.item[0]:b.item[0].nextSibling);this.counter=this.counter?++this.counter:1;var f=this,h=this.counter;window.setTimeout(function(){h==f.counter&&f.refreshPositions(!e)},0)},_clear:function(a,b){this.reverting=!1;var d=[];!this._noFinalSort&&this.currentItem[0].parentNode&&
this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var e in this._storedCSS)if(this._storedCSS[e]=="auto"||this._storedCSS[e]=="static")this._storedCSS[e]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!b&&d.push(function(b){this._trigger("receive",b,this._uiHash(this.fromOutside))});(this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||
this.domPosition.parent!=this.currentItem.parent()[0])&&!b&&d.push(function(b){this._trigger("update",b,this._uiHash())});if(!c.ui.contains(this.element[0],this.currentItem[0])){b||d.push(function(b){this._trigger("remove",b,this._uiHash())});for(e=this.containers.length-1;e>=0;e--)c.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!b&&(d.push(function(b){return function(a){b._trigger("receive",a,this._uiHash(this))}}.call(this,this.containers[e])),d.push(function(b){return function(a){b._trigger("update",
a,this._uiHash(this))}}.call(this,this.containers[e])))}for(e=this.containers.length-1;e>=0;e--)if(b||d.push(function(b){return function(a){b._trigger("deactivate",a,this._uiHash(this))}}.call(this,this.containers[e])),this.containers[e].containerCache.over)d.push(function(b){return function(a){b._trigger("out",a,this._uiHash(this))}}.call(this,this.containers[e])),this.containers[e].containerCache.over=0;this._storedCursor&&c("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",
this._storedOpacity);this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=!1;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop",a,this._uiHash());for(e=0;e<d.length;e++)d[e].call(this,a);this._trigger("stop",a,this._uiHash())}return!1}b||this._trigger("beforeStop",a,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.helper[0]!=this.currentItem[0]&&this.helper.remove();this.helper=null;if(!b){for(e=
0;e<d.length;e++)d[e].call(this,a);this._trigger("stop",a,this._uiHash())}this.fromOutside=!1;return!0},_trigger:function(){c.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(a){var b=a||this;return{helper:b.helper,placeholder:b.placeholder||c([]),position:b.position,originalPosition:b.originalPosition,offset:b.positionAbs,item:b.currentItem,sender:a?a.element:null}}});c.extend(c.ui.sortable,{version:"1.8.11"})})(jQuery);
(function(c){var a=0;c.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var b=this,a=this.element[0].ownerDocument,e;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(a){if(!b.options.disabled&&!b.element.attr("readonly")){e=!1;var d=
c.ui.keyCode;switch(a.keyCode){case d.PAGE_UP:b._move("previousPage",a);break;case d.PAGE_DOWN:b._move("nextPage",a);break;case d.UP:b._move("previous",a);a.preventDefault();break;case d.DOWN:b._move("next",a);a.preventDefault();break;case d.ENTER:case d.NUMPAD_ENTER:b.menu.active&&(e=!0,a.preventDefault());case d.TAB:if(!b.menu.active)break;b.menu.select(a);break;case d.ESCAPE:b.element.val(b.term);b.close(a);break;default:clearTimeout(b.searching),b.searching=setTimeout(function(){if(b.term!=b.element.val())b.selectedItem=
null,b.search(null,a)},b.options.delay)}}}).bind("keypress.autocomplete",function(b){e&&(e=!1,b.preventDefault())}).bind("focus.autocomplete",function(){if(!b.options.disabled)b.selectedItem=null,b.previous=b.element.val()}).bind("blur.autocomplete",function(a){if(!b.options.disabled)clearTimeout(b.searching),b.closing=setTimeout(function(){b.close(a);b._change(a)},150)});this._initSource();this.response=function(){return b._response.apply(b,arguments)};this.menu=c("<ul></ul>").addClass("ui-autocomplete").appendTo(c(this.options.appendTo||
"body",a)[0]).mousedown(function(a){var d=b.menu.element[0];c(a.target).closest(".ui-menu-item").length||setTimeout(function(){c(document).one("mousedown",function(a){a.target!==b.element[0]&&a.target!==d&&!c.ui.contains(d,a.target)&&b.close()})},1);setTimeout(function(){clearTimeout(b.closing)},13)}).menu({focus:function(a,c){var d=c.item.data("item.autocomplete");!1!==b._trigger("focus",a,{item:d})&&/^key/.test(a.originalEvent.type)&&b.element.val(d.value)},selected:function(c,e){var g=e.item.data("item.autocomplete"),
i=b.previous;if(b.element[0]!==a.activeElement)b.element.focus(),b.previous=i,setTimeout(function(){b.previous=i;b.selectedItem=g},1);!1!==b._trigger("select",c,{item:g})&&b.element.val(g.value);b.term=b.element.val();b.close(c);b.selectedItem=g},blur:function(){b.menu.element.is(":visible")&&b.element.val()!==b.term&&b.element.val(b.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");c.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");
this.menu.element.remove();c.Widget.prototype.destroy.call(this)},_setOption:function(a,d){c.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource();a==="appendTo"&&this.menu.element.appendTo(c(d||"body",this.element[0].ownerDocument)[0]);a==="disabled"&&d&&this.xhr&&this.xhr.abort()},_initSource:function(){var b=this,d,e;c.isArray(this.options.source)?(d=this.options.source,this.source=function(a,b){b(c.ui.autocomplete.filter(d,a.term))}):typeof this.options.source==="string"?
(e=this.options.source,this.source=function(d,h){b.xhr&&b.xhr.abort();b.xhr=c.ajax({url:e,data:d,dataType:"json",autocompleteRequest:++a,success:function(b){this.autocompleteRequest===a&&h(b)},error:function(){this.autocompleteRequest===a&&h([])}})}):this.source=this.options.source},search:function(a,c){a=a!=null?a:this.element.val();this.term=this.element.val();if(a.length<this.options.minLength)return this.close(c);clearTimeout(this.closing);return this._trigger("search",c)===!1?void 0:this._search(a)},
_search:function(a){this.pending++;this.element.addClass("ui-autocomplete-loading");this.source({term:a},this.response)},_response:function(a){!this.options.disabled&&a&&a.length?(a=this._normalize(a),this._suggest(a),this._trigger("open")):this.close();this.pending--;this.pending||this.element.removeClass("ui-autocomplete-loading")},close:function(a){clearTimeout(this.closing);this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.deactivate(),this._trigger("close",a))},_change:function(a){this.previous!==
this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(a){return a.length&&a[0].label&&a[0].value?a:c.map(a,function(a){return typeof a==="string"?{label:a,value:a}:c.extend({label:a.label||a.value,value:a.value||a.label},a)})},_suggest:function(a){var d=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(d,a);this.menu.deactivate();this.menu.refresh();d.show();this._resizeMenu();d.position(c.extend({of:this.element},this.options.position));
this.options.autoFocus&&this.menu.next(new c.Event("mouseover"))},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth(),this.element.outerWidth()))},_renderMenu:function(a,d){var e=this;c.each(d,function(c,d){e._renderItem(a,d)})},_renderItem:function(a,d){return c("<li></li>").data("item.autocomplete",d).append(c("<a></a>").text(d.label)).appendTo(a)},_move:function(a,c){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&
/^next/.test(a))this.element.val(this.term),this.menu.deactivate();else this.menu[a](c);else this.search(null,c)},widget:function(){return this.menu.element}});c.extend(c.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(a,d){var e=RegExp(c.ui.autocomplete.escapeRegex(d),"i");return c.grep(a,function(a){return e.test(a.label||a.value||a)})}})})(jQuery);
(function(c){c.widget("ui.menu",{_create:function(){var a=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(b){c(b.target).closest(".ui-menu-item a").length&&(b.preventDefault(),a.select(b))});this.refresh()},refresh:function(){var a=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex",
-1).mouseenter(function(b){a.activate(b,c(this).parent())}).mouseleave(function(){a.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,e=this.element.attr("scrollTop"),f=this.element.height();c<0?this.element.attr("scrollTop",e+c):c>=f&&this.element.attr("scrollTop",e+c-f+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",a,{item:b})},deactivate:function(){if(this.active)this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),
this._trigger("blur"),this.active=null},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,c){this.active?(a=this.active[a+"All"](".ui-menu-item").eq(0),a.length?this.activate(c,a):this.activate(c,this.element.children(b))):this.activate(c,this.element.children(b))},
nextPage:function(a){if(this.hasScroll())if(!this.active||this.last())this.activate(a,this.element.children(".ui-menu-item:first"));else{var b=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var a=c(this).offset().top-b-d+c(this).height();return a<10&&a>-10});e.length||(e=this.element.children(".ui-menu-item:last"));this.activate(a,e)}else this.activate(a,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},
previousPage:function(a){if(this.hasScroll())if(!this.active||this.first())this.activate(a,this.element.children(".ui-menu-item:last"));else{var b=this.active.offset().top,d=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var a=c(this).offset().top-b+d-c(this).height();return a<10&&a>-10});result.length||(result=this.element.children(".ui-menu-item:first"));this.activate(a,result)}else this.activate(a,this.element.children(".ui-menu-item").filter(!this.active||
this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element.attr("scrollHeight")},select:function(a){this._trigger("selected",a,{item:this.active})}})})(jQuery);
