/*! Copyright 2018 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 SearchPane 0.0.2 2018 SpryMedia Ltd - datatables.net/license */ var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,d,e){a instanceof String&&(a=String(a));for(var k=a.length,g=0;g").addClass(this.classes.container)};this.c=a.extend(!0,{},g.defaults, c);this.s={dt:b};b.settings()[0].searchPane=this;b.columns(this.c.columns).eq(0).each(function(l){f._pane(l)});a(this.dom.container).on("click","li",function(){f._toggle(this)}).on("click","button."+this.classes.clear,function(){f._clear(a(this).closest("div."+f.classes.pane.container))});this._attach()}var p=a.fn.dataTable;a.extend(g.prototype,{rebuild:function(){var b=this;this.dom.container.empty();this.s.dt.columns(this.c.columns).eq(0).each(function(c){b._pane(c)})},_attach:function(){var b= this.c.container;b="function"===typeof b?b(this.s.dt):b;"prepend"===this.c.insert?a(this.dom.container).prependTo(b):a(this.dom.container).appendTo(b)},_binData:function(b){for(var c={},f=0,l=b.length;f"),h="function"===typeof n.options?n.options(l,b):n.options?new p.Api(null,n.options):m.data();l=this._binData(h.flatten());if(!(this._variance(l)").html(''+h[q]+"").data("filter",h[q]).append(a("").addClass(f.count).html(l[h[q]]));if(n.length){var v=h[q].replace?a.fn.dataTable.util.escapeRegex(h[q]): h[q];-1!==a.inArray(v,n)&&t.addClass(f.selected)}r.append(t)}f=a("
").data("column",b).addClass(c.container).addClass(n.length?c.active:"").append(a('').addClass(this.classes.clear)).append(a("
").addClass(c.title).html(a(m.header()).text())).append(a("
").addClass(c.scroller).append(r));c=this.dom.container;m=c.children().map(function(){if(a(this).data("column")==b)return this});m.length?m.replaceWith(f):a(c).append(f)}},_getOptions:function(b){return this.s.dt.settings()[0].aoColumns[b].searchPane|| {}},_toggle:function(b){var c=this.classes,f=c.item.selected,l=this.s.dt;b=a(b);var m=b.closest("div."+c.pane.container),n=m.data("column"),r=this._getOptions(n);b.toggleClass(f,!b.hasClass(f));b=m.find("li."+f);0===b.length?(m.removeClass(c.pane.active),l.column(n).search("").draw()):"any"===r.match?(m.addClass(c.pane.active),l.column(n).search("("+a.map(b,function(h){h=a(h).data("filter").toString();h=a("
").html(h).text();return a.fn.dataTable.util.escapeRegex(h)}).join("|")+")",!0,!1).draw()): (m.addClass(c.pane.active),l.column(n).search("^("+a.map(b,function(h){h=a(h).data("filter").toString();h=a("
").html(h).text();return a.fn.dataTable.util.escapeRegex(h)}).join("|")+")$",!0,!1).draw())},_variance:function(b){b=a.map(b,function(r,h){return r});for(var c=b.length,f=0,l=0,m=c;l