!function(w){w.extend(!0,window,{Slick:{RowMoveManager:function(i){var s,r,c,n=this,a=null,o=new Slick.EventHandler,t={columnId:"_move",cssClass:null,cancelEditOnDrag:!1,disableRowSelection:!1,singleRowMove:!1,width:40};i&&"function"==typeof i.usabilityOverride&&f(i.usabilityOverride);function d(e){e.stopImmediatePropagation()}function l(e,o){var t=s.getCellFromEvent(e),n=t&&t.row;if(v(n,s.getDataItem(n),s)){if(i.cancelEditOnDrag&&s.getEditorLock().isActive()&&s.getEditorLock().cancelCurrentEdit(),s.getEditorLock().isActive()||!/move|selectAndMove/.test(s.getColumns()[t.cell].behavior))return!1;c=!0,e.stopImmediatePropagation();e=i.singleRowMove?[t.row]:s.getSelectedRows();0!==e.length&&-1!=w.inArray(t.row,e)||(e=[t.row],i.disableRowSelection||s.setSelectedRows(e));t=s.getOptions().rowHeight;o.selectedRows=e,o.selectionProxy=w("
").css("position","absolute").css("zIndex","99999").css("width",w(r).innerWidth()).css("height",t*e.length).appendTo(r),o.guide=w("").css("position","absolute").css("zIndex","99998").css("width",w(r).innerWidth()).css("top",-1e3).appendTo(r),o.insertBefore=-1}}function u(e,o){var t;c&&(e.stopImmediatePropagation(),t=e.pageY-w(r).offset().top,o.selectionProxy.css("top",t-5),(e=Math.max(0,Math.min(Math.round(t/s.getOptions().rowHeight),s.getDataLength())))!==o.insertBefore&&(!(t={grid:s,rows:o.selectedRows,insertBefore:e})===n.onBeforeMoveRows.notify(t)?o.canMove=!1:o.canMove=!0,a&&(t=s.getDataItem(e),o.canMove=v(e,t,s)),o.canMove?o.guide.css("top",e*s.getOptions().rowHeight):o.guide.css("top",-1e3),o.insertBefore=e))}function g(e,o){c&&(c=!1,e.stopImmediatePropagation(),o.guide.remove(),o.selectionProxy.remove(),o.canMove&&(o={grid:s,rows:o.selectedRows,insertBefore:o.insertBefore},n.onMoveRows.notify(o)))}function e(e,o,t,n,i,s){return v(e,i,s)?{addClasses:"cell-reorder dnd",text:""}:null}function v(e,o,t){return"function"!=typeof a||a(e,o,t)}function f(e){a=e}w.extend(this,{onBeforeMoveRows:new Slick.Event,onMoveRows:new Slick.Event,init:function(e){i=w.extend(!0,{},t,i),r=(s=e).getCanvasNode(),o.subscribe(s.onDragInit,d).subscribe(s.onDragStart,l).subscribe(s.onDrag,u).subscribe(s.onDragEnd,g)},destroy:function(){o.unsubscribeAll()},getColumnDefinition:function(){return{id:i.columnId||"_move",name:"",field:"move",width:i.width||40,behavior:"selectAndMove",selectable:!1,resizable:!1,cssClass:i.cssClass,formatter:e}},setOptions:function(e){i=w.extend({},i,e)},usabilityOverride:f,pluginName:"RowMoveManager"})}}})}(jQuery);