/*! RowGroup 1.5.0 * © SpryMedia Ltd - datatables.net/license */ import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;var RowGroup=function(t,r){if(!DataTable.versionCheck||!DataTable.versionCheck("1.11"))throw"RowGroup requires DataTables 1.11 or newer";this.c=$.extend(!0,{},DataTable.defaults.rowGroup,RowGroup.defaults,r),this.s={dt:new DataTable.Api(t)},this.dom={};r=this.s.dt.settings()[0],t=r.rowGroup;if(t)return t;(r.rowGroup=this)._constructor()};$.extend(RowGroup.prototype,{dataSrc:function(t){var r;return void 0===t?this.c.dataSrc:(r=this.s.dt,this.c.dataSrc=t,$(r.table().node()).triggerHandler("rowgroup-datasrc.dt",[r,t]),this)},disable:function(){return this.c.enable=!1,this},enable:function(t){return!1===t?this.disable():(this.c.enable=!0,this)},enabled:function(){return this.c.enable},_constructor:function(){var e=this,t=this.s.dt,a=t.settings()[0];t.on("draw.dtrg",function(t,r){e.c.enable&&a===r&&e._draw()}),t.on("column-visibility.dt.dtrg responsive-resize.dt.dtrg",function(){e._adjustColspan()}),t.on("destroy",function(){t.off(".dtrg")})},_adjustColspan:function(){$("tr."+this.c.className,this.s.dt.table().body()).find("th:visible, td:visible").attr("colspan",this._colspan())},_colspan:function(){return this.s.dt.columns().visible().reduce(function(t,r){return t+r},0)},_draw:function(){var t=this.s.dt,t=this._group(0,t.rows({page:"current"}).indexes());this._groupDisplay(0,t)},_group:function(t,r){for(var e,a=Array.isArray(this.c.dataSrc)?this.c.dataSrc:[this.c.dataSrc],o=DataTable.util.get(a[t]),n=this.s.dt,s=[],i=0,u=r.length;i").append($("").attr("colspan",this._colspan()).attr("scope","row").append(t))).addClass(this.c.className).addClass(r).addClass("dtrg-level-"+e)}}),RowGroup.defaults={className:"dtrg-group",dataSrc:0,emptyDataGroup:"No group",enable:!0,endClassName:"dtrg-end",endRender:null,startClassName:"dtrg-start",startRender:function(t,r){return r}},RowGroup.version="1.5.0",$.fn.dataTable.RowGroup=RowGroup,$.fn.DataTable.RowGroup=RowGroup,DataTable.Api.register("rowGroup()",function(){return this}),DataTable.Api.register("rowGroup().disable()",function(){return this.iterator("table",function(t){t.rowGroup&&t.rowGroup.enable(!1)})}),DataTable.Api.register("rowGroup().enable()",function(r){return this.iterator("table",function(t){t.rowGroup&&t.rowGroup.enable(void 0===r||r)})}),DataTable.Api.register("rowGroup().enabled()",function(){var t=this.context;return!(!t.length||!t[0].rowGroup)&&t[0].rowGroup.enabled()}),DataTable.Api.register("rowGroup().dataSrc()",function(r){return void 0===r?this.context[0].rowGroup.dataSrc():this.iterator("table",function(t){t.rowGroup&&t.rowGroup.dataSrc(r)})}),$(document).on("preInit.dt.dtrg",function(t,r,e){var a,o;"dt"===t.namespace&&(t=r.oInit.rowGroup,a=DataTable.defaults.rowGroup,t||a)&&(o=$.extend({},a,t),!1!==t)&&new RowGroup(r,o)});export default DataTable;