/*! Copyright 2015-2020 SpryMedia Ltd. This source file is free software, available under the following license: MIT license - http://datatables.net/license/mit This source file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details. For details please refer to: http://www.datatables.net RowReorder 1.2.7 2015-2020 SpryMedia Ltd - datatables.net/license */ var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,f,d){a instanceof String&&(a=String(a));for(var k=a.length,g=0;g").append(b.clone(!1)),c=b.outerWidth(),d=b.outerHeight(),f=b.children().map(function(){return a(this).width()});e.width(c).height(d).find("tr").children().each(function(a){this.style.width=f[a]+"px"});e.appendTo("body");this.dom.clone=e;this.s.domCloneOuterHeight=e.outerHeight()},_clonePosition:function(a){var b=this.s.start,c=this._eventToPage(a,"Y")-b.top;a=this._eventToPage(a,"X")- b.left;var d=this.c.snapX;c+=b.offsetTop;b=!0===d?b.offsetLeft:"number"===typeof d?b.offsetLeft+d:a+b.offsetLeft;0>c?c=0:c+this.s.domCloneOuterHeight>this.s.documentOuterHeight&&(c=this.s.documentOuterHeight-this.s.domCloneOuterHeight);this.dom.clone.css({top:c,left:b})},_emitEvent:function(b,e){this.s.dt.iterator("table",function(c,d){a(c.nTable).triggerHandler(b+".dt",e)})},_eventToPage:function(a,e){return-1!==a.type.indexOf("touch")?a.originalEvent.touches[0]["page"+e]:a["page"+e]},_mouseDown:function(b, e){var c=this,w=this.s.dt,g=this.s.start,n=e.offset();g.top=this._eventToPage(b,"Y");g.left=this._eventToPage(b,"X");g.offsetTop=n.top;g.offsetLeft=n.left;g.nodes=a.unique(w.rows({page:"current"}).nodes().toArray());this._cachePositions();this._clone(e);this._clonePosition(b);this.dom.target=e;e.addClass("dt-rowReorder-moving");a(d).on("mouseup.rowReorder touchend.rowReorder",function(a){c._mouseUp(a)}).on("mousemove.rowReorder touchmove.rowReorder",function(a){c._mouseMove(a)});a(f).width()===a(d).width()&& a(d.body).addClass("dt-rowReorder-noOverflow");b=this.dom.dtScroll;this.s.scroll={windowHeight:a(f).height(),windowWidth:a(f).width(),dtTop:b.length?b.offset().top:null,dtLeft:b.length?b.offset().left:null,dtHeight:b.length?b.outerHeight():null,dtWidth:b.length?b.outerWidth():null}},_mouseMove:function(b){this._clonePosition(b);for(var e=this._eventToPage(b,"Y")-this.s.bodyTop,c=this.s.middles,d=null,f=this.s.dt,g=0,m=c.length;gthis.s.lastInsert?this.dom.target.insertAfter(e[d-1]):this.dom.target.insertBefore(e[d]),this._cachePositions(),this.s.lastInsert=d;this._shiftScroll(b)},_mouseUp:function(b){var e=this,c=this.s.dt,f,g=this.c.dataSrc;this.dom.clone.remove();this.dom.clone=null;this.dom.target.removeClass("dt-rowReorder-moving");a(d).off(".rowReorder");a(d.body).removeClass("dt-rowReorder-noOverflow");clearInterval(this.s.scrollInterval); this.s.scrollInterval=null;var n=this.s.start.nodes,m=a.unique(c.rows({page:"current"}).nodes().toArray()),k={},h=[],p=[],q=this.s.getDataFn,x=this.s.setDataFn;var l=0;for(f=n.length;lc.windowHeight+a(f).scrollTop()-65&&(k=5);null!==c.dtTop&&b.pageYc.dtTop+c.dtHeight-65&&(m=5);k||m?(c.windowVert=k,c.dtVert=m,g=!0):this.s.scrollInterval&&(clearInterval(this.s.scrollInterval), this.s.scrollInterval=null);!this.s.scrollInterval&&g&&(this.s.scrollInterval=setInterval(function(){if(c.windowVert){var b=a(d).scrollTop();a(d).scrollTop(b+c.windowVert);b!==a(d).scrollTop()&&(b=parseFloat(e.dom.clone.css("top")),e.dom.clone.css("top",b+c.windowVert))}c.dtVert&&(b=e.dom.dtScroll[0],c.dtVert&&(b.scrollTop+=c.dtVert))},20))}});h.defaults={dataSrc:0,editor:null,enable:!0,formOptions:{},selector:"td:first-child",snapX:!1,update:!0,excludedChildren:"a"};var p=a.fn.dataTable.Api;p.register("rowReorder()", function(){return this});p.register("rowReorder.enable()",function(a){a===k&&(a=!0);return this.iterator("table",function(b){b.rowreorder&&(b.rowreorder.c.enable=a)})});p.register("rowReorder.disable()",function(){return this.iterator("table",function(a){a.rowreorder&&(a.rowreorder.c.enable=!1)})});h.version="1.2.6";a.fn.dataTable.RowReorder=h;a.fn.DataTable.RowReorder=h;a(d).on("init.dt.dtr",function(b,d,c){"dt"===b.namespace&&(b=d.oInit.rowReorder,c=g.defaults.rowReorder,b||c)&&(c=a.extend({},b, c),!1!==b&&new h(d,c))});return h});