importjQueryfrom"jquery";importDataTablefrom"datatables.net";let$=jQuery;classMarkDataTables{instance;options;intervalThreshold;intervalMs;constructor(t,a){if(!$.fn.mark||!$.fn.unmark)thrownewError("jquery.mark.js is necessary for datatables.mark.js");this.instance=t,this.options="object"==typeofa?a:{},this.intervalThreshold=49,this.intervalMs=300,this.initMarkListener()}initMarkListener(){lett="draw.dt.dth column-visibility.dt.dth column-reorder.dt.dth",a=(t+=" responsive-display.dt.dth",null);this.instance.on(t,()=>{this.instance.rows({filter:"applied",page:"current"}).nodes().length>this.intervalThreshold?(clearTimeout(a),a=setTimeout(()=>{this.mark()},this.intervalMs)):this.mark()}),this.instance.on("destroy",()=>{this.instance.off(t)}),this.mark()}mark(){consti=this.instance.search();vart=$(this.instance.table().body());t.unmark(this.options),this.instance.table().rows({search:"applied"}).data().length&&t.mark(i,this.options),this.instance.columns({search:"applied",page:"current"}).nodes().each((t,a)=>{conste=this.instance.column(a).search(),s=e||i;s&&t.forEach(t=>{$(t).unmark(this.options).mark(s,this.options)})})}}$(document).on("init.dt.dth",(a,e)=>{if("dt"===a.namespace){a=newDataTable.Api(e);lett=!1;a.init().mark?t=a.init().mark:DataTable.defaults.mark&&(t=DataTable.defaults.mark),t&&newMarkDataTables(a,t)}});exportdefaultDataTable;