/*! SearchPanes 1.3.0 2019-2021 SpryMedia Ltd - datatables.net/license */ (function(){function G(n){l=n;A=n.fn.dataTable}function H(n){p=n;B=n.fn.dataTable}var l,A,E=function(){function n(a,b,f,c,e,d){var g=this;void 0===d&&(d=null);if(!A||!A.versionCheck||!A.versionCheck("1.10.0"))throw Error("SearchPane requires DataTables 1.10 or newer");if(!A.select)throw Error("SearchPane requires Select");a=new A.Api(a);this.classes=l.extend(!0,{},n.classes);this.c=l.extend(!0,{},n.defaults,b);void 0!==b&&void 0!==b.hideCount&&void 0===b.viewCount&&(this.c.viewCount=!this.c.hideCount); this.customPaneSettings=d;this.s={cascadeRegen:!1,clearing:!1,colOpts:[],deselect:!1,displayed:!1,dt:a,dtPane:void 0,filteringActive:!1,forceViewTotal:!1,index:f,indexes:[],lastCascade:!1,lastSelect:!1,listSet:!1,name:void 0,redraw:!1,rowData:{arrayFilter:[],arrayOriginal:[],arrayTotals:[],bins:{},binsOriginal:{},binsTotal:{},filterMap:new Map,totalOptions:0},scrollTop:0,searchFunction:void 0,selectPresent:!1,serverSelect:[],serverSelecting:!1,showFiltered:!1,tableLength:null,updating:!1};b=a.columns().eq(0).toArray().length; this.colExists=this.s.index").addClass(this.classes.buttonGroup),clear:l('').addClass(this.classes.disabledButton).attr("disabled","true").addClass(this.classes.paneButton).addClass(this.classes.clearButton),container:l("
").addClass(this.classes.container).addClass(this.classes.layout+(10>b?c:c.split("-")[0]+"-9")),countButton:l('').addClass(this.classes.paneButton).addClass(this.classes.countButton), dtP:l("
"+(this.colExists?l(a.column(this.colExists?this.s.index:0).header()).text():this.customPaneSettings.header||"Custom Pane")+"
"),lower:l("
").addClass(this.classes.subRow2).addClass(this.classes.narrowButton),nameButton:l('').addClass(this.classes.paneButton).addClass(this.classes.nameButton),panesContainer:e,searchBox:l("").addClass(this.classes.paneInputButton).addClass(this.classes.search),searchButton:l('').addClass(this.classes.paneButton),searchCont:l("
").addClass(this.classes.searchCont),searchLabelCont:l("
").addClass(this.classes.searchLabelCont),topRow:l("
").addClass(this.classes.topRow),upper:l("
").addClass(this.classes.subRow1).addClass(this.classes.narrowSearch)};this.s.displayed=!1;a=this.s.dt;this.selections=[];this.s.colOpts=this.colExists?this._getOptions():this._getBonusOptions();var h=this.s.colOpts;c=l('').addClass(this.classes.paneButton); l(c).text(a.i18n("searchPanes.clearPane",this.c.i18n.clearPane));this.dom.container.addClass(h.className);this.dom.container.addClass(null!==this.customPaneSettings&&void 0!==this.customPaneSettings.className?this.customPaneSettings.className:"");this.s.name=void 0!==this.s.colOpts.name?this.s.colOpts.name:null!==this.customPaneSettings&&void 0!==this.customPaneSettings.name?this.customPaneSettings.name:this.colExists?l(a.column(this.s.index).header()).text():this.customPaneSettings.header||"Custom Pane"; l(e).append(this.dom.container);var m=a.table(0).node();this.s.searchFunction=function(k,r,v,t){if(0===g.selections.length||k.nTable!==m)return!0;k=null;g.colExists&&(k=r[g.s.index],"filter"!==h.orthogonal.filter&&(k=g.s.rowData.filterMap.get(v),k instanceof l.fn.dataTable.Api&&(k=k.toArray())));return g._search(k,v)};l.fn.dataTable.ext.search.push(this.s.searchFunction);if(this.c.clear)l(c).on("click",function(){g.dom.container.find("."+g.classes.search.replace(/\s+/g,".")).each(function(){l(this).val(""); l(this).trigger("input")});g.clearPane()});a.on("draw.dtsp",function(){g.adjustTopRow()});a.on("buttons-action",function(){g.adjustTopRow()});a.on("column-reorder.dtsp",function(k,r,v){g.s.index=v.mapping[g.s.index]});return this}n.prototype.addRow=function(a,b,f,c,e,d,g){for(var h,m=0,k=this.s.indexes;ml(a[0]).width()||252>l(c[0]).width())&&0!==l(a[0]).width()?(l(a[0]).addClass(this.classes.narrow),l(b[0]).addClass(this.classes.narrowSub).removeClass(this.classes.narrowSearch), l(f[0]).addClass(this.classes.narrowSub).removeClass(this.classes.narrowButton)):(l(a[0]).removeClass(this.classes.narrow),l(b[0]).removeClass(this.classes.narrowSub).addClass(this.classes.narrowSearch),l(f[0]).removeClass(this.classes.narrowSub).addClass(this.classes.narrowButton))};n.prototype.clearData=function(){this.s.rowData={arrayFilter:[],arrayOriginal:[],arrayTotals:[],bins:{},binsOriginal:{},binsTotal:{},filterMap:new Map,totalOptions:0}};n.prototype.clearPane=function(){this.s.dtPane.rows({selected:!0}).deselect(); this.updateTable();return this};n.prototype.destroy=function(){l(this.s.dtPane).off(".dtsp");l(this.s.dt).off(".dtsp");l(this.dom.nameButton).off(".dtsp");l(this.dom.countButton).off(".dtsp");l(this.dom.clear).off(".dtsp");l(this.dom.searchButton).off(".dtsp");l(this.dom.container).remove();for(var a=l.fn.dataTable.ext.search.indexOf(this.s.searchFunction);-1!==a;)l.fn.dataTable.ext.search.splice(a,1),a=l.fn.dataTable.ext.search.indexOf(this.s.searchFunction);void 0!==this.s.dtPane&&this.s.dtPane.destroy(); this.s.listSet=!1};n.prototype.emptyMessage=function(){var a=this.c.i18n.emptyMessage;this.c.emptyMessage&&(a=this.c.emptyMessage);!1!==this.s.colOpts.emptyMessage&&null!==this.s.colOpts.emptyMessage&&(a=this.s.colOpts.emptyMessage);return this.s.dt.i18n("searchPanes.emptyMessage",a)};n.prototype.getPaneCount=function(){return void 0!==this.s.dtPane?this.s.dtPane.rows({selected:!0}).data().toArray().length:0};n.prototype.rebuildPane=function(a,b,f,c){void 0===a&&(a=!1);void 0===b&&(b=null);void 0=== f&&(f=null);void 0===c&&(c=!1);this.clearData();var e=[];this.s.serverSelect=[];var d=null;void 0!==this.s.dtPane&&(c&&(this.s.dt.page.info().serverSide?this.s.serverSelect=this.s.dtPane.rows({selected:!0}).data().toArray():e=this.s.dtPane.rows({selected:!0}).data().toArray()),this.s.dtPane.clear().destroy(),d=l(this.dom.container).prev(),this.destroy(),this.s.dtPane=void 0,l.fn.dataTable.ext.search.push(this.s.searchFunction));this.dom.container.removeClass(this.classes.hidden);this.s.displayed= !1;this._buildPane(this.s.dt.page.info().serverSide?this.s.serverSelect:e,a,b,f,d);return this};n.prototype.removePane=function(){this.s.displayed=!1;l(this.dom.container).hide()};n.prototype.resize=function(a){this.c.layout=a;var b=parseInt(a.split("-")[1],10);l(this.dom.container).removeClass().addClass(this.classes.container).addClass(this.classes.layout+(10>b?a:a.split("-")[0]+"-9")).addClass(this.s.colOpts.className).addClass(null!==this.customPaneSettings&&void 0!==this.customPaneSettings.className? this.customPaneSettings.className:"").addClass(this.classes.show);this.adjustTopRow()};n.prototype.setCascadeRegen=function(a){this.s.cascadeRegen=a};n.prototype.setClear=function(a){this.s.clearing=a};n.prototype.updatePane=function(a){void 0===a&&(a=!1);this.s.updating=!0;this._updateCommon(a);this.s.updating=!1};n.prototype.updateTable=function(){this.selections=this.s.dtPane.rows({selected:!0}).data().toArray();this._searchExtras();(this.c.cascadePanes||this.c.viewTotal)&&this.updatePane()};n.prototype._setListeners= function(){var a=this,b=this.s.rowData,f;this.s.dtPane.on("select.dtsp",function(){clearTimeout(f);a.s.dt.page.info().serverSide&&!a.s.updating?a.s.serverSelecting||(a.s.serverSelect=a.s.dtPane.rows({selected:!0}).data().toArray(),a.s.scrollTop=l(a.s.dtPane.table().node()).parent()[0].scrollTop,a.s.selectPresent=!0,a.s.dt.draw(!1)):(l(a.dom.clear).removeClass(a.classes.disabledButton).removeAttr("disabled"),a.s.updating||(a.s.selectPresent=!0,a._makeSelection(),a.s.selectPresent=!1))});this.s.dtPane.on("deselect.dtsp", function(){f=setTimeout(function(){a.s.dt.page.info().serverSide&&!a.s.updating?a.s.serverSelecting||(a.s.serverSelect=a.s.dtPane.rows({selected:!0}).data().toArray(),a.s.deselect=!0,a.s.dt.draw(!1)):(a.s.deselect=!0,0===a.s.dtPane.rows({selected:!0}).data().toArray().length&&l(a.dom.clear).addClass(a.classes.disabledButton).attr("disabled","true"),a._makeSelection(),a.s.deselect=!1,a.s.dt.state.save())},50)});this.s.dt.on("stateSaveParams.dtsp",function(c,e,d){if(l.isEmptyObject(d))a.s.dtPane.state.clear(); else{c=[];if(void 0!==a.s.dtPane){c=a.s.dtPane.rows({selected:!0}).data().map(function(r){return r.filter.toString()}).toArray();var g=l(a.dom.searchBox).val();var h=a.s.dtPane.order();var m=b.binsOriginal;var k=b.arrayOriginal}void 0===d.searchPanes&&(d.searchPanes={});void 0===d.searchPanes.panes&&(d.searchPanes.panes=[]);for(e=0;ethis.c.threshold:b>m.threshold)||!0!==m.show&&1>=q)){this.dom.container.addClass(this.classes.hidden);this.s.displayed=!1;return}this.c.viewTotal&& 0===k.arrayTotals.length?(this.s.rowData.totalOptions=0,this._detailsPane()):k.binsTotal=k.bins;this.dom.container.addClass(this.classes.show);this.s.displayed=!0}else if(null!==f&&null!==f.searchPanes&&null!==f.searchPanes.options){if(void 0!==f.tableLength)this.s.tableLength=f.tableLength,this.s.rowData.totalOptions=this.s.tableLength;else if(null===this.s.tableLength||g.rows()[0].length>this.s.tableLength)this.s.tableLength=g.rows()[0].length,this.s.rowData.totalOptions=this.s.tableLength;b=g.column(this.s.index).dataSrc(); if(void 0!==f.searchPanes.options[b])for(q=0,b=f.searchPanes.options[b];qthis.c.threshold:b>m.threshold)||!0!==m.show&&1>= q)){this.dom.container.addClass(this.classes.hidden);this.s.displayed=!1;return}this.s.rowData.arrayOriginal=this.s.rowData.arrayFilter;this.s.rowData.binsOriginal=this.s.rowData.bins;this.s.displayed=!0}}else this.s.displayed=!0;this._displayPane();if(!this.s.listSet)this.dom.dtP.on("stateLoadParams.dt",function(x,C,y){l.isEmptyObject(g.state.loaded())&&l.each(y,function(z,I){delete y[z]})});null!==e&&0'+z+"";d.c.viewCount&&m.viewCount||(y="");return"filter"===C?"string"===typeof x&&null!==x.match(/<[^>]*>/)?x.replace(/<[^>]*>/g,""):x:'
]*>/)?x.replace(/<[^>]*>/g,""):x)+'" class="'+d.classes.name+'">'+x+""+y+"
"},targets:0,type:void 0!==g.settings()[0].aoColumns[this.s.index]?g.settings()[0].aoColumns[this.s.index]._sManualType: null},{className:"dtsp-countColumn "+this.classes.badgePill,data:"shown",orderData:[1,2],targets:1,visible:!1},{data:"total",targets:2,visible:!1}],deferRender:!0,dom:"t",info:!1,language:this.s.dt.settings()[0].oLanguage,paging:e?!0:!1,scrollX:!1,scrollY:"200px",scroller:e?!0:!1,select:!0,stateSave:g.settings()[0].oFeatures.bStateSave?!0:!1},this.c.dtOpts,void 0!==m?m.dtOpts:{},void 0===this.s.colOpts.options&&this.colExists?void 0:{createdRow:function(x,C,y){l(x).addClass(C.className)}},null!== this.customPaneSettings&&void 0!==this.customPaneSettings.dtOpts?this.customPaneSettings.dtOpts:{},l.fn.dataTable.versionCheck("2")?{layout:{bottomLeft:null,bottomRight:null,topLeft:null,topRight:null}}:{}));l(this.dom.dtP).addClass(this.classes.table);e="Custom Pane";this.customPaneSettings&&this.customPaneSettings.header?e=this.customPaneSettings.header:m.header?e=m.header:this.colExists&&(e=l.fn.dataTable.versionCheck("2")?g.column(this.s.index).title():g.settings()[0].aoColumns[this.s.index].sTitle); this.dom.searchBox.attr("placeholder",e);l.fn.dataTable.select.init(this.s.dtPane);l.fn.dataTable.ext.errMode=q;if(this.colExists){h=(h=h.search())?h.substr(1,h.length-2).split("|"):[];var w=0;k.arrayFilter.forEach(function(x){""===x.filter&&w++});q=0;for(e=k.arrayFilter.length;q]*>/g,""));this.s.rowData.filterMap.set(a,d);c[d]?c[d]++:(c[d]=1,this._addOption(d,f.oApi._fnGetCellData(f,a,this.s.index,e.orthogonal.display),f.oApi._fnGetCellData(f,a,this.s.index,e.orthogonal.sort),f.oApi._fnGetCellData(f,a,this.s.index,e.orthogonal.type),b,c));this.s.rowData.totalOptions++}};n.prototype._reloadSelect=function(a){if(void 0!==a){for(var b,f=0;f").replace(/"/g,'"'));if(Array.isArray(a)){if(-1!==a.indexOf(g.filter))return!0}else if("function"===typeof g.filter)if(g.filter.call(c,c.row(b).data(),b)){if("or"===f.combiner)return!0}else{if("and"===f.combiner)return!1}else if(a===g.filter||("string"!==typeof a||0!==a.length)&&a==g.filter||null===g.filter&&"string"===typeof a&&""===a)return!0}return"and"===f.combiner?!0:!1};n.prototype._searchContSetup= function(){this.c.controls&&this.s.colOpts.controls&&l(this.dom.searchButton).appendTo(this.dom.searchLabelCont);!1===this.c.dtOpts.searching||!1===this.s.colOpts.dtOpts.searching||null!==this.customPaneSettings&&void 0!==this.customPaneSettings.dtOpts&&void 0!==this.customPaneSettings.dtOpts.searching&&!this.customPaneSettings.dtOpts.searching||l(this.dom.searchLabelCont).appendTo(this.dom.searchCont)};n.prototype._searchExtras=function(){var a=this.s.updating;this.s.updating=!0;var b=this.s.dtPane.rows({selected:!0}).data().pluck("filter").toArray(), f=b.indexOf(this.emptyMessage()),c=l(this.s.dtPane.table().container());-1No data"},layout:"auto",name:void 0,orderable:!0,orthogonal:{display:"display",filter:"filter",hideCount:!1,search:"filter",show:void 0,sort:"sort",threshold:.6,type:"type",viewCount:!0},preSelect:[],threshold:.6, viewCount:!0,viewTotal:!1};return n}(),p,B,F=function(){function n(a,b,f){var c=this;void 0===f&&(f=!1);this.regenerating=!1;if(!B||!B.versionCheck||!B.versionCheck("1.10.0"))throw Error("SearchPane requires DataTables 1.10 or newer");if(!B.select)throw Error("SearchPane requires Select");var e=new B.Api(a);this.classes=p.extend(!0,{},n.classes);this.c=p.extend(!0,{},n.defaults,b);this.dom={clearAll:p('').addClass(this.classes.clearAll),container:p("
").addClass(this.classes.panes).text(e.i18n("searchPanes.loadMessage", this.c.i18n.loadMessage)),emptyMessage:p("
").addClass(this.classes.emptyMessage),options:p("
").addClass(this.classes.container),panes:p("
").addClass(this.classes.container),title:p("
").addClass(this.classes.title),titleRow:p("
").addClass(this.classes.titleRow),wrapper:p("
")};this.s={colOpts:[],dt:e,filterCount:0,filterPane:-1,page:0,panes:[],selectionList:[],serverData:{},stateRead:!1,updating:!1};if(void 0===e.settings()[0]._searchPanes){this._getState();if(this.s.dt.page.info().serverSide)e.on("preXhr.dt", function(d,g,h){void 0===h.searchPanes&&(h.searchPanes={});void 0===h.searchPanes_null&&(h.searchPanes_null={});d=0;for(g=c.s.selectionList;df&&(a=b,f=e);c=0!==f?c.slice(c.length-f,c.length):[];b=0;for(e=this.s.panes;bNo data",emptyPanes:"No SearchPanes",loadMessage:"Loading Search Panes...",title:"Filters Active - %d"},layout:"auto",order:[],panes:[],viewTotal:!1};return n}();(function(n){"function"===typeof define&&define.amd?define(["jquery", "datatables.net"],function(a){return n(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net")(a,b).$);return n(b,a,a.document)}:n(window.jQuery,window,document)})(function(n,a,b){function f(e,d,g){void 0===d&&(d=null);void 0===g&&(g=!1);e=new c.Api(e);d=d?d:e.init().searchPanes||c.defaults.searchPanes;return(new F(e,d,g)).getNode()}G(n);H(n);var c=n.fn.dataTable;n.fn.dataTable.SearchPanes=F;n.fn.DataTable.SearchPanes= F;n.fn.dataTable.SearchPane=E;n.fn.DataTable.SearchPane=E;a=n.fn.dataTable.Api.register;a("searchPanes()",function(){return this});a("searchPanes.clearSelections()",function(){return this.iterator("table",function(e){e._searchPanes&&e._searchPanes.clearSelections()})});a("searchPanes.rebuildPane()",function(e,d){return this.iterator("table",function(g){g._searchPanes&&g._searchPanes.rebuild(e,d)})});a("searchPanes.resizePanes()",function(){var e=this.context[0];return e._searchPanes?e._searchPanes.resizePanes(): null});a("searchPanes.container()",function(){var e=this.context[0];return e._searchPanes?e._searchPanes.getNode():null});n.fn.dataTable.ext.buttons.searchPanesClear={action:function(e,d,g,h){d.searchPanes.clearSelections()},text:"Clear Panes"};n.fn.dataTable.ext.buttons.searchPanes={action:function(e,d,g,h){e.stopPropagation();this.popover(h._panes.getNode(),{align:"dt-container"});h._panes.rebuild(void 0,!0)},config:{},init:function(e,d,g){var h=new n.fn.dataTable.SearchPanes(e,n.extend({filterChanged:function(k){e.button(d).text(e.i18n("searchPanes.collapse", h.c.i18n.collapse,k))}},g.config)),m=e.i18n("searchPanes.collapse",h.c.i18n.collapse,0);e.button(d).text(m);g._panes=h},text:"Search Panes"};n(b).on("preInit.dt.dtsp",function(e,d,g){"dt"===e.namespace&&(d.oInit.searchPanes||c.defaults.searchPanes)&&(d._searchPanes||f(d,null,!0))});c.ext.feature.push({cFeature:"P",fnInit:f});c.ext.features&&c.ext.features.register("searchPanes",f)})})();