/*! jQuery UI - v1.12.1 - 2017-11-15 * http://jqueryui.com * Includes: widget.js, data.js, disable-selection.js, scroll-parent.js, widgets/draggable.js, widgets/mouse.js * Copyright jQuery Foundation and other contributors; Licensed MIT */ (function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a)}else{a(jQuery)}}(function(e){e.ui=e.ui||{};var i=e.ui.version="1.12.1"; /*! * jQuery UI Widget 1.12.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ var d=0;var j=Array.prototype.slice;e.cleanData=(function(p){return function(q){var s,t,r;for(r=0;(t=q[r])!=null;r++){try{s=e._data(t,"events");if(s&&s.remove){e(t).triggerHandler("remove")}}catch(u){}}p(q)}})(e.cleanData);e.widget=function(p,q,x){var v,s,w;var r={};var u=p.split(".")[0];p=p.split(".")[1];var t=u+"-"+p;if(!x){x=q;q=e.Widget}if(e.isArray(x)){x=e.extend.apply(null,[{}].concat(x))}e.expr[":"][t.toLowerCase()]=function(y){return !!e.data(y,t)};e[u]=e[u]||{};v=e[u][p];s=e[u][p]=function(y,z){if(!this._createWidget){return new s(y,z)}if(arguments.length){this._createWidget(y,z)}};e.extend(s,v,{version:x.version,_proto:e.extend({},x),_childConstructors:[]});w=new q();w.options=e.widget.extend({},w.options);e.each(x,function(z,y){if(!e.isFunction(y)){r[z]=y;return}r[z]=(function(){function A(){return q.prototype[z].apply(this,arguments)}function B(C){return q.prototype[z].apply(this,C)}return function(){var E=this._super;var C=this._superApply;var D;this._super=A;this._superApply=B;D=y.apply(this,arguments);this._super=E;this._superApply=C;return D}})()});s.prototype=e.widget.extend(w,{widgetEventPrefix:v?(w.widgetEventPrefix||p):p},r,{constructor:s,namespace:u,widgetName:p,widgetFullName:t});if(v){e.each(v._childConstructors,function(z,A){var y=A.prototype;e.widget(y.namespace+"."+y.widgetName,s,A._proto)});delete v._childConstructors}else{q._childConstructors.push(s)}e.widget.bridge(p,s);return s};e.widget.extend=function(u){var q=j.call(arguments,1);var t=0;var p=q.length;var r;var s;for(;t",options:{classes:{},disabled:false,create:null},_createWidget:function(p,q){q=e(q||this.defaultElement||this)[0];this.element=e(q);this.uuid=d++;this.eventNamespace="."+this.widgetName+this.uuid;this.bindings=e();this.hoverable=e();this.focusable=e();this.classesElementLookup={};if(q!==this){e.data(q,this.widgetFullName,this);this._on(true,this.element,{remove:function(r){if(r.target===q){this.destroy()}}});this.document=e(q.style?q.ownerDocument:q.document||q);this.window=e(this.document[0].defaultView||this.document[0].parentWindow)}this.options=e.widget.extend({},this.options,this._getCreateOptions(),p);this._create();if(this.options.disabled){this._setOptionDisabled(this.options.disabled)}this._trigger("create",null,this._getCreateEventData());this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){var p=this;this._destroy();e.each(this.classesElementLookup,function(q,r){p._removeClass(r,q)});this.element.off(this.eventNamespace).removeData(this.widgetFullName);this.widget().off(this.eventNamespace).removeAttr("aria-disabled");this.bindings.off(this.eventNamespace)},_destroy:e.noop,widget:function(){return this.element},option:function(s,t){var p=s;var u;var r;var q;if(arguments.length===0){return e.widget.extend({},this.options)}if(typeof s==="string"){p={};u=s.split(".");s=u.shift();if(u.length){r=p[s]=e.widget.extend({},this.options[s]);for(q=0;q=this.options.distance)},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}});var h=e.ui.plugin={add:function(q,r,t){var p,s=e.ui[q].prototype;for(p in t){s.plugins[p]=s.plugins[p]||[];s.plugins[p].push([r,t[p]])}},call:function(p,s,r,q){var t,u=p.plugins[s];if(!u){return}if(!q&&(!p.element[0].parentNode||p.element[0].parentNode.nodeType===11)){return}for(t=0;t0){return false}this.handle=this._getHandle(p);if(!this.handle){return false}this._blurActiveElement(p);this._blockFrames(q.iframeFix===true?"iframe":q.iframeFix);return true},_blockFrames:function(p){this.iframeBlocks=this.document.find(p).map(function(){var q=e(this);return e("
").css("position","absolute").appendTo(q.parent()).outerWidth(q.outerWidth()).outerHeight(q.outerHeight()).offset(q.offset())[0]})},_unblockFrames:function(){if(this.iframeBlocks){this.iframeBlocks.remove();delete this.iframeBlocks}},_blurActiveElement:function(q){var p=e.ui.safeActiveElement(this.document[0]),r=e(q.target);if(r.closest(p).length){return}e.ui.safeBlur(p)},_mouseStart:function(p){var q=this.options;this.helper=this._createHelper(p);this._addClass(this.helper,"ui-draggable-dragging");this._cacheHelperProportions();if(e.ui.ddmanager){e.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent(true);this.offsetParent=this.helper.offsetParent();this.hasFixedAncestor=this.helper.parents().filter(function(){return e(this).css("position")==="fixed"}).length>0;this.positionAbs=this.element.offset();this._refreshOffsets(p);this.originalPosition=this.position=this._generatePosition(p,false);this.originalPageX=p.pageX;this.originalPageY=p.pageY;(q.cursorAt&&this._adjustOffsetFromHelper(q.cursorAt));this._setContainment();if(this._trigger("start",p)===false){this._clear();return false}this._cacheHelperProportions();if(e.ui.ddmanager&&!q.dropBehaviour){e.ui.ddmanager.prepareOffsets(this,p)}this._mouseDrag(p,true);if(e.ui.ddmanager){e.ui.ddmanager.dragStart(this,p)}return true},_refreshOffsets:function(p){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:false,parent:this._getParentOffset(),relative:this._getRelativeOffset()};this.offset.click={left:p.pageX-this.offset.left,top:p.pageY-this.offset.top}},_mouseDrag:function(p,r){if(this.hasFixedAncestor){this.offset.parent=this._getParentOffset()}this.position=this._generatePosition(p,true);this.positionAbs=this._convertPositionTo("absolute");if(!r){var q=this._uiHash();if(this._trigger("drag",p,q)===false){this._mouseUp(new e.Event("mouseup",p));return false}this.position=q.position}this.helper[0].style.left=this.position.left+"px";this.helper[0].style.top=this.position.top+"px";if(e.ui.ddmanager){e.ui.ddmanager.drag(this,p)}return false},_mouseStop:function(q){var p=this,r=false;if(e.ui.ddmanager&&!this.options.dropBehaviour){r=e.ui.ddmanager.drop(this,q)}if(this.dropped){r=this.dropped;this.dropped=false}if((this.options.revert==="invalid"&&!r)||(this.options.revert==="valid"&&r)||this.options.revert===true||(e.isFunction(this.options.revert)&&this.options.revert.call(this.element,r))){e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(p._trigger("stop",q)!==false){p._clear()}})}else{if(this._trigger("stop",q)!==false){this._clear()}}return false},_mouseUp:function(p){this._unblockFrames();if(e.ui.ddmanager){e.ui.ddmanager.dragStop(this,p)}if(this.handleElement.is(p.target)){this.element.trigger("focus")}return e.ui.mouse.prototype._mouseUp.call(this,p)},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp(new e.Event("mouseup",{target:this.element[0]}))}else{this._clear()}return this},_getHandle:function(p){return this.options.handle?!!e(p.target).closest(this.element.find(this.options.handle)).length:true},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element;this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(q){var s=this.options,r=e.isFunction(s.helper),p=r?e(s.helper.apply(this.element[0],[q])):(s.helper==="clone"?this.element.clone().removeAttr("id"):this.element);if(!p.parents("body").length){p.appendTo((s.appendTo==="parent"?this.element[0].parentNode:s.appendTo))}if(r&&p[0]===this.element[0]){this._setPositionRelative()}if(p[0]!==this.element[0]&&!(/(fixed|absolute)/).test(p.css("position"))){p.css("position","absolute")}return p},_setPositionRelative:function(){if(!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}},_adjustOffsetFromHelper:function(p){if(typeof p==="string"){p=p.split(" ")}if(e.isArray(p)){p={left:+p[0],top:+p[1]||0}}if("left" in p){this.offset.click.left=p.left+this.margins.left}if("right" in p){this.offset.click.left=this.helperProportions.width-p.right+this.margins.left}if("top" in p){this.offset.click.top=p.top+this.margins.top}if("bottom" in p){this.offset.click.top=this.helperProportions.height-p.bottom+this.margins.top}},_isRootNode:function(p){return(/(html|body)/i).test(p.tagName)||p===this.document[0]},_getParentOffset:function(){var q=this.offsetParent.offset(),p=this.document[0];if(this.cssPosition==="absolute"&&this.scrollParent[0]!==p&&e.contains(this.scrollParent[0],this.offsetParent[0])){q.left+=this.scrollParent.scrollLeft();q.top+=this.scrollParent.scrollTop()}if(this._isRootNode(this.offsetParent[0])){q={top:0,left:0}}return{top:q.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:q.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition!=="relative"){return{top:0,left:0}}var q=this.element.position(),r=this._isRootNode(this.scrollParent[0]);return{top:q.top-(parseInt(this.helper.css("top"),10)||0)+(!r?this.scrollParent.scrollTop():0),left:q.left-(parseInt(this.helper.css("left"),10)||0)+(!r?this.scrollParent.scrollLeft():0)}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0),right:(parseInt(this.element.css("marginRight"),10)||0),bottom:(parseInt(this.element.css("marginBottom"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var q,t,r,s=this.options,p=this.document[0];this.relativeContainer=null;if(!s.containment){this.containment=null;return}if(s.containment==="window"){this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||p.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(s.containment==="document"){this.containment=[0,0,e(p).width()-this.helperProportions.width-this.margins.left,(e(p).height()||p.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(s.containment.constructor===Array){this.containment=s.containment;return}if(s.containment==="parent"){s.containment=this.helper[0].parentNode}t=e(s.containment);r=t[0];if(!r){return}q=/(scroll|auto)/.test(t.css("overflow"));this.containment=[(parseInt(t.css("borderLeftWidth"),10)||0)+(parseInt(t.css("paddingLeft"),10)||0),(parseInt(t.css("borderTopWidth"),10)||0)+(parseInt(t.css("paddingTop"),10)||0),(q?Math.max(r.scrollWidth,r.offsetWidth):r.offsetWidth)-(parseInt(t.css("borderRightWidth"),10)||0)-(parseInt(t.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(q?Math.max(r.scrollHeight,r.offsetHeight):r.offsetHeight)-(parseInt(t.css("borderBottomWidth"),10)||0)-(parseInt(t.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relativeContainer=t},_convertPositionTo:function(q,s){if(!s){s=this.position}var p=q==="absolute"?1:-1,r=this._isRootNode(this.scrollParent[0]);return{top:(s.top+this.offset.relative.top*p+this.offset.parent.top*p-((this.cssPosition==="fixed"?-this.offset.scroll.top:(r?0:this.offset.scroll.top))*p)),left:(s.left+this.offset.relative.left*p+this.offset.parent.left*p-((this.cssPosition==="fixed"?-this.offset.scroll.left:(r?0:this.offset.scroll.left))*p))}},_generatePosition:function(q,w){var p,x,y,s,r=this.options,v=this._isRootNode(this.scrollParent[0]),u=q.pageX,t=q.pageY;if(!v||!this.offset.scroll){this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}}if(w){if(this.containment){if(this.relativeContainer){x=this.relativeContainer.offset();p=[this.containment[0]+x.left,this.containment[1]+x.top,this.containment[2]+x.left,this.containment[3]+x.top]}else{p=this.containment}if(q.pageX-this.offset.click.leftp[2]){u=p[2]+this.offset.click.left}if(q.pageY-this.offset.click.top>p[3]){t=p[3]+this.offset.click.top}}if(r.grid){y=r.grid[1]?this.originalPageY+Math.round((t-this.originalPageY)/r.grid[1])*r.grid[1]:this.originalPageY;t=p?((y-this.offset.click.top>=p[1]||y-this.offset.click.top>p[3])?y:((y-this.offset.click.top>=p[1])?y-r.grid[1]:y+r.grid[1])):y;s=r.grid[0]?this.originalPageX+Math.round((u-this.originalPageX)/r.grid[0])*r.grid[0]:this.originalPageX;u=p?((s-this.offset.click.left>=p[0]||s-this.offset.click.left>p[2])?s:((s-this.offset.click.left>=p[0])?s-r.grid[0]:s+r.grid[0])):s}if(r.axis==="y"){u=this.originalPageX}if(r.axis==="x"){t=this.originalPageY}}return{top:(t-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.offset.scroll.top:(v?0:this.offset.scroll.top))),left:(u-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-this.offset.scroll.left:(v?0:this.offset.scroll.left)))}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging");if(this.helper[0]!==this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false;if(this.destroyOnClear){this.destroy()}},_trigger:function(p,q,r){r=r||this._uiHash();e.ui.plugin.call(this,p,[q,r,this],true);if(/^(drag|start|stop)/.test(p)){this.positionAbs=this._convertPositionTo("absolute");r.offset=this.positionAbs}return e.Widget.prototype._trigger.call(this,p,q,r)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});e.ui.plugin.add("draggable","connectToSortable",{start:function(r,s,p){var q=e.extend({},s,{item:p.element});p.sortables=[];e(p.options.connectToSortable).each(function(){var t=e(this).sortable("instance");if(t&&!t.options.disabled){p.sortables.push(t);t.refreshPositions();t._trigger("activate",r,q)}})},stop:function(r,s,p){var q=e.extend({},s,{item:p.element});p.cancelHelperRemoval=false;e.each(p.sortables,function(){var t=this;if(t.isOver){t.isOver=0;p.cancelHelperRemoval=true;t.cancelHelperRemoval=false;t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")};t._mouseStop(r);t.options.helper=t.options._helper}else{t.cancelHelperRemoval=true;t._trigger("deactivate",r,q)}})},drag:function(q,r,p){e.each(p.sortables,function(){var s=false,t=this;t.positionAbs=p.positionAbs;t.helperProportions=p.helperProportions;t.offset.click=p.offset.click;if(t._intersectsWith(t.containerCache)){s=true;e.each(p.sortables,function(){this.positionAbs=p.positionAbs;this.helperProportions=p.helperProportions;this.offset.click=p.offset.click;if(this!==t&&this._intersectsWith(this.containerCache)&&e.contains(t.element[0],this.element[0])){s=false}return s})}if(s){if(!t.isOver){t.isOver=1;p._parent=r.helper.parent();t.currentItem=r.helper.appendTo(t.element).data("ui-sortable-item",true);t.options._helper=t.options.helper;t.options.helper=function(){return r.helper[0]};q.target=t.currentItem[0];t._mouseCapture(q,true);t._mouseStart(q,true,true);t.offset.click.top=p.offset.click.top;t.offset.click.left=p.offset.click.left;t.offset.parent.left-=p.offset.parent.left-t.offset.parent.left;t.offset.parent.top-=p.offset.parent.top-t.offset.parent.top;p._trigger("toSortable",q);p.dropped=t.element;e.each(p.sortables,function(){this.refreshPositions()});p.currentItem=p.element;t.fromOutside=p}if(t.currentItem){t._mouseDrag(q);r.position=t.position}}else{if(t.isOver){t.isOver=0;t.cancelHelperRemoval=true;t.options._revert=t.options.revert;t.options.revert=false;t._trigger("out",q,t._uiHash(t));t._mouseStop(q,true);t.options.revert=t.options._revert;t.options.helper=t.options._helper;if(t.placeholder){t.placeholder.remove()}r.helper.appendTo(p._parent);p._refreshOffsets(q);r.position=p._generatePosition(q,true);p._trigger("fromSortable",q);p.dropped=false;e.each(p.sortables,function(){this.refreshPositions()})}}})}});e.ui.plugin.add("draggable","cursor",{start:function(r,s,p){var q=e("body"),u=p.options;if(q.css("cursor")){u._cursor=q.css("cursor")}q.css("cursor",u.cursor)},stop:function(q,r,p){var s=p.options;if(s._cursor){e("body").css("cursor",s._cursor)}}});e.ui.plugin.add("draggable","opacity",{start:function(r,s,p){var q=e(s.helper),u=p.options;if(q.css("opacity")){u._opacity=q.css("opacity")}q.css("opacity",u.opacity)},stop:function(q,r,p){var s=p.options;if(s._opacity){e(r.helper).css("opacity",s._opacity)}}});e.ui.plugin.add("draggable","scroll",{start:function(q,r,p){if(!p.scrollParentNotHidden){p.scrollParentNotHidden=p.helper.scrollParent(false)}if(p.scrollParentNotHidden[0]!==p.document[0]&&p.scrollParentNotHidden[0].tagName!=="HTML"){p.overflowOffset=p.scrollParentNotHidden.offset()}},drag:function(s,t,r){var u=r.options,q=false,v=r.scrollParentNotHidden[0],p=r.document[0];if(v!==p&&v.tagName!=="HTML"){if(!u.axis||u.axis!=="x"){if((r.overflowOffset.top+v.offsetHeight)-s.pageY=0;E--){C=u.snapElements[E].left-u.margins.left;z=C+u.snapElements[E].width;y=u.snapElements[E].top-u.margins.top;J=y+u.snapElements[E].height;if(Fz+H||qJ+H||!e.contains(u.snapElements[E].item.ownerDocument,u.snapElements[E].item)){if(u.snapElements[E].snapping){(u.options.snap.release&&u.options.snap.release.call(u.element,D,e.extend(u._uiHash(),{snapItem:u.snapElements[E].item})))}u.snapElements[E].snapping=false;continue}if(B.snapMode!=="inner"){p=Math.abs(y-q)<=H;I=Math.abs(J-s)<=H;w=Math.abs(C-F)<=H;x=Math.abs(z-G)<=H;if(p){A.position.top=u._convertPositionTo("relative",{top:y-u.helperProportions.height,left:0}).top}if(I){A.position.top=u._convertPositionTo("relative",{top:J,left:0}).top}if(w){A.position.left=u._convertPositionTo("relative",{top:0,left:C-u.helperProportions.width}).left}if(x){A.position.left=u._convertPositionTo("relative",{top:0,left:z}).left}}v=(p||I||w||x);if(B.snapMode!=="outer"){p=Math.abs(y-s)<=H;I=Math.abs(J-q)<=H;w=Math.abs(C-G)<=H;x=Math.abs(z-F)<=H;if(p){A.position.top=u._convertPositionTo("relative",{top:y,left:0}).top}if(I){A.position.top=u._convertPositionTo("relative",{top:J-u.helperProportions.height,left:0}).top}if(w){A.position.left=u._convertPositionTo("relative",{top:0,left:C}).left}if(x){A.position.left=u._convertPositionTo("relative",{top:0,left:z-u.helperProportions.width}).left}}if(!u.snapElements[E].snapping&&(p||I||w||x||v)){(u.options.snap.snap&&u.options.snap.snap.call(u.element,D,e.extend(u._uiHash(),{snapItem:u.snapElements[E].item})))}u.snapElements[E].snapping=(p||I||w||x||v)}}});e.ui.plugin.add("draggable","stack",{start:function(r,s,p){var q,u=p.options,t=e.makeArray(e(u.stack)).sort(function(w,v){return(parseInt(e(w).css("zIndex"),10)||0)-(parseInt(e(v).css("zIndex"),10)||0)});if(!t.length){return}q=parseInt(e(t[0]).css("zIndex"),10)||0;e(t).each(function(v){e(this).css("zIndex",q+v)});this.css("zIndex",(q+t.length))}});e.ui.plugin.add("draggable","zIndex",{start:function(r,s,p){var q=e(s.helper),u=p.options;if(q.css("zIndex")){u._zIndex=q.css("zIndex")}q.css("zIndex",u.zIndex)},stop:function(q,r,p){var s=p.options;if(s._zIndex){e(r.helper).css("zIndex",s._zIndex)}}});var n=e.ui.draggable}));