1 line
No EOL
69 KiB
JavaScript
1 line
No EOL
69 KiB
JavaScript
(function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory)}else if(typeof module==="object"&&typeof module.exports==="object"){module.exports=factory(require("jquery"))}else{factory(jQuery)}})(function(jQuery){(function($,window,document){"use strict";var ts=$.tablesorter||{};$.extend(true,ts.defaults,{fixedUrl:"",widgetOptions:{storage_fixedUrl:"",storage_group:"",storage_page:"",storage_storageType:"",storage_tableId:"",storage_useSessionStorage:""}});ts.storage=function(table,key,value,options){table=$(table)[0];var cookieIndex,cookies,date,hasStorage=false,values={},c=table.config,wo=c&&c.widgetOptions,debug=ts.debug(c,"storage"),storageType=(options&&options.storageType||wo&&wo.storage_storageType).toString().charAt(0).toLowerCase(),session=storageType?"":options&&options.useSessionStorage||wo&&wo.storage_useSessionStorage,$table=$(table),id=options&&options.id||$table.attr(options&&options.group||wo&&wo.storage_group||"data-table-group")||wo&&wo.storage_tableId||table.id||$(".tablesorter").index($table),url=options&&options.url||$table.attr(options&&options.page||wo&&wo.storage_page||"data-table-page")||wo&&wo.storage_fixedUrl||c&&c.fixedUrl||window.location.pathname;if(storageType!=="c"){storageType=storageType==="s"||session?"sessionStorage":"localStorage";if(storageType in window){try{window[storageType].setItem("_tmptest","temp");hasStorage=true;window[storageType].removeItem("_tmptest")}catch(error){console.warn(storageType+" is not supported in this browser")}}}if(debug){console.log("Storage >> Using",hasStorage?storageType:"cookies")}if(hasStorage){values=JSON.parse(window[storageType][key]||"null")||{}}else{cookies=document.cookie.split(/[;\s|=]/);cookieIndex=$.inArray(key,cookies)+1;values=cookieIndex!==0?JSON.parse(cookies[cookieIndex]||"null")||{}:{}}if(typeof value!=="undefined"&&window.JSON&&JSON.hasOwnProperty("stringify")){if(!values[url]){values[url]={}}values[url][id]=value;if(hasStorage){window[storageType][key]=JSON.stringify(values)}else{date=new Date;date.setTime(date.getTime()+31536e6);document.cookie=key+"="+JSON.stringify(values).replace(/\"/g,'"')+"; expires="+date.toGMTString()+"; path=/"}}else{return values&&values[url]?values[url][id]:""}}})(jQuery,window,document);(function($){"use strict";var ts=$.tablesorter||{};ts.themes={bootstrap:{table:"table table-bordered table-striped",caption:"caption",header:"bootstrap-header",sortNone:"",sortAsc:"",sortDesc:"",active:"",hover:"",icons:"",iconSortNone:"bootstrap-icon-unsorted",iconSortAsc:"glyphicon glyphicon-chevron-up",iconSortDesc:"glyphicon glyphicon-chevron-down",filterRow:"",footerRow:"",footerCells:"",even:"",odd:""},jui:{table:"ui-widget ui-widget-content ui-corner-all",caption:"ui-widget-content",header:"ui-widget-header ui-corner-all ui-state-default",sortNone:"",sortAsc:"",sortDesc:"",active:"ui-state-active",hover:"ui-state-hover",icons:"ui-icon",iconSortNone:"ui-icon-carat-2-n-s ui-icon-caret-2-n-s",iconSortAsc:"ui-icon-carat-1-n ui-icon-caret-1-n",iconSortDesc:"ui-icon-carat-1-s ui-icon-caret-1-s",filterRow:"",footerRow:"",footerCells:"",even:"ui-widget-content",odd:"ui-state-default"}};$.extend(ts.css,{wrapper:"tablesorter-wrapper"});ts.addWidget({id:"uitheme",priority:10,format:function(table,c,wo){var i,tmp,hdr,icon,time,$header,$icon,$tfoot,$h,oldtheme,oldremove,oldIconRmv,hasOldTheme,themesAll=ts.themes,$table=c.$table.add($(c.namespace+"_extra_table")),$headers=c.$headers.add($(c.namespace+"_extra_headers")),theme=c.theme||"jui",themes=themesAll[theme]||{},remove=[themes.sortNone,themes.sortDesc,themes.sortAsc,themes.active].join(" ").trim(),iconRmv=[themes.iconSortNone,themes.iconSortDesc,themes.iconSortAsc].join(" ").trim(),debug=ts.debug(c,"uitheme");if(debug){time=new Date}if(!$table.hasClass("tablesorter-"+theme)||c.theme!==c.appliedTheme||!wo.uitheme_applied){wo.uitheme_applied=true;oldtheme=themesAll[c.appliedTheme]||{};hasOldTheme=!$.isEmptyObject(oldtheme);oldremove=hasOldTheme?[oldtheme.sortNone,oldtheme.sortDesc,oldtheme.sortAsc,oldtheme.active].join(" "):"";oldIconRmv=hasOldTheme?[oldtheme.iconSortNone,oldtheme.iconSortDesc,oldtheme.iconSortAsc].join(" "):"";if(hasOldTheme){wo.zebra[0]=" "+wo.zebra[0].replace(" "+oldtheme.even,"").trim();wo.zebra[1]=" "+wo.zebra[1].replace(" "+oldtheme.odd,"").trim();c.$tbodies.children().removeClass([oldtheme.even,oldtheme.odd].join(" "))}if(themes.even){wo.zebra[0]+=" "+themes.even}if(themes.odd){wo.zebra[1]+=" "+themes.odd}$table.children("caption").removeClass(oldtheme.caption||"").addClass(themes.caption);$tfoot=$table.removeClass((c.appliedTheme?"tablesorter-"+(c.appliedTheme||""):"")+" "+(oldtheme.table||"")).addClass("tablesorter-"+theme+" "+(themes.table||"")).children("tfoot");c.appliedTheme=c.theme;if($tfoot.length){$tfoot.children("tr").removeClass(oldtheme.footerRow||"").addClass(themes.footerRow).children("th, td").removeClass(oldtheme.footerCells||"").addClass(themes.footerCells)}$headers.removeClass((hasOldTheme?[oldtheme.header,oldtheme.hover,oldremove].join(" "):"")||"").addClass(themes.header).not(".sorter-false").off("mouseenter.tsuitheme mouseleave.tsuitheme").on("mouseenter.tsuitheme mouseleave.tsuitheme",function(event){$(this)[event.type==="mouseenter"?"addClass":"removeClass"](themes.hover||"")});$headers.each(function(){var $this=$(this);if(!$this.find("."+ts.css.wrapper).length){$this.wrapInner('<div class="'+ts.css.wrapper+'" style="position:relative;height:100%;width:100%"></div>')}});if(c.cssIcon){$headers.find("."+ts.css.icon).removeClass(hasOldTheme?[oldtheme.icons,oldIconRmv].join(" "):"").addClass(themes.icons||"")}if(ts.hasWidget(c.table,"filter")){tmp=function(){$table.children("thead").children("."+ts.css.filterRow).removeClass(hasOldTheme?oldtheme.filterRow||"":"").addClass(themes.filterRow||"")};if(wo.filter_initialized){tmp()}else{$table.one("filterInit",function(){tmp()})}}}for(i=0;i<c.columns;i++){$header=c.$headers.add($(c.namespace+"_extra_headers")).not(".sorter-false").filter('[data-column="'+i+'"]');$icon=ts.css.icon?$header.find("."+ts.css.icon):$();$h=$headers.not(".sorter-false").filter('[data-column="'+i+'"]:last');if($h.length){$header.removeClass(remove);$icon.removeClass(iconRmv);if($h[0].sortDisabled){$icon.removeClass(themes.icons||"")}else{hdr=themes.sortNone;icon=themes.iconSortNone;if($h.hasClass(ts.css.sortAsc)){hdr=[themes.sortAsc,themes.active].join(" ");icon=themes.iconSortAsc}else if($h.hasClass(ts.css.sortDesc)){hdr=[themes.sortDesc,themes.active].join(" ");icon=themes.iconSortDesc}$header.addClass(hdr);$icon.addClass(icon||"")}}}if(debug){console.log("uitheme >> Applied "+theme+" theme"+ts.benchmark(time))}},remove:function(table,c,wo,refreshing){if(!wo.uitheme_applied){return}var $table=c.$table,theme=c.appliedTheme||"jui",themes=ts.themes[theme]||ts.themes.jui,$headers=$table.children("thead").children(),remove=themes.sortNone+" "+themes.sortDesc+" "+themes.sortAsc,iconRmv=themes.iconSortNone+" "+themes.iconSortDesc+" "+themes.iconSortAsc;$table.removeClass("tablesorter-"+theme+" "+themes.table);wo.uitheme_applied=false;if(refreshing){return}$table.find(ts.css.header).removeClass(themes.header);$headers.off("mouseenter.tsuitheme mouseleave.tsuitheme").removeClass(themes.hover+" "+remove+" "+themes.active).filter("."+ts.css.filterRow).removeClass(themes.filterRow);$headers.find("."+ts.css.icon).removeClass(themes.icons+" "+iconRmv)}})})(jQuery);(function($){"use strict";var ts=$.tablesorter||{};ts.addWidget({id:"columns",priority:65,options:{columns:["primary","secondary","tertiary"]},format:function(table,c,wo){var $tbody,tbodyIndex,$rows,rows,$row,$cells,remove,indx,$table=c.$table,$tbodies=c.$tbodies,sortList=c.sortList,len=sortList.length,css=wo&&wo.columns||["primary","secondary","tertiary"],last=css.length-1;remove=css.join(" ");for(tbodyIndex=0;tbodyIndex<$tbodies.length;tbodyIndex++){$tbody=ts.processTbody(table,$tbodies.eq(tbodyIndex),true);$rows=$tbody.children("tr");$rows.each(function(){$row=$(this);if(this.style.display!=="none"){$cells=$row.children().removeClass(remove);if(sortList&&sortList[0]){$cells.eq(sortList[0][0]).addClass(css[0]);if(len>1){for(indx=1;indx<len;indx++){$cells.eq(sortList[indx][0]).addClass(css[indx]||css[last])}}}}});ts.processTbody(table,$tbody,false)}rows=wo.columns_thead!==false?["thead tr"]:[];if(wo.columns_tfoot!==false){rows.push("tfoot tr")}if(rows.length){$rows=$table.find(rows.join(",")).children().removeClass(remove);if(len){for(indx=0;indx<len;indx++){$rows.filter('[data-column="'+sortList[indx][0]+'"]').addClass(css[indx]||css[last])}}}},remove:function(table,c,wo){var tbodyIndex,$tbody,$tbodies=c.$tbodies,remove=(wo.columns||["primary","secondary","tertiary"]).join(" ");c.$headers.removeClass(remove);c.$table.children("tfoot").children("tr").children("th, td").removeClass(remove);for(tbodyIndex=0;tbodyIndex<$tbodies.length;tbodyIndex++){$tbody=ts.processTbody(table,$tbodies.eq(tbodyIndex),true);$tbody.children("tr").each(function(){$(this).children().removeClass(remove)});ts.processTbody(table,$tbody,false)}}})})(jQuery);(function($){"use strict";var tsf,tsfRegex,ts=$.tablesorter||{},tscss=ts.css,tskeyCodes=ts.keyCodes;$.extend(tscss,{filterRow:"tablesorter-filter-row",filter:"tablesorter-filter",filterDisabled:"disabled",filterRowHide:"hideme"});$.extend(tskeyCodes,{backSpace:8,escape:27,space:32,left:37,down:40});ts.addWidget({id:"filter",priority:50,options:{filter_cellFilter:"",filter_childRows:false,filter_childByColumn:false,filter_childWithSibs:true,filter_columnAnyMatch:true,filter_columnFilters:true,filter_cssFilter:"",filter_defaultAttrib:"data-value",filter_defaultFilter:{},filter_excludeFilter:{},filter_external:"",filter_filteredRow:"filtered",filter_filterLabel:'Filter "{{label}}" column by...',filter_formatter:null,filter_functions:null,filter_hideEmpty:true,filter_hideFilters:false,filter_ignoreCase:true,filter_liveSearch:true,filter_matchType:{input:"exact",select:"exact"},filter_onlyAvail:"filter-onlyAvail",filter_placeholder:{search:"",select:""},filter_reset:null,filter_resetOnEsc:true,filter_saveFilters:false,filter_searchDelay:300,filter_searchFiltered:true,filter_selectSource:null,filter_selectSourceSeparator:"|",filter_serversideFiltering:false,filter_startsWith:false,filter_useParsedData:false},format:function(table,c,wo){if(!c.$table.hasClass("hasFilters")){tsf.init(table,c,wo)}},remove:function(table,c,wo,refreshing){var tbodyIndex,$tbody,$table=c.$table,$tbodies=c.$tbodies,events=("addRows updateCell update updateRows updateComplete appendCache filterReset "+"filterAndSortReset filterFomatterUpdate filterEnd search stickyHeadersInit ").split(" ").join(c.namespace+"filter ");$table.removeClass("hasFilters").off(events.replace(ts.regex.spaces," ")).find("."+tscss.filterRow).remove();wo.filter_initialized=false;if(refreshing){return}for(tbodyIndex=0;tbodyIndex<$tbodies.length;tbodyIndex++){$tbody=ts.processTbody(table,$tbodies.eq(tbodyIndex),true);$tbody.children().removeClass(wo.filter_filteredRow).show();ts.processTbody(table,$tbody,false)}if(wo.filter_reset){$(document).off("click"+c.namespace+"filter",wo.filter_reset)}}});tsf=ts.filter={regex:{regex:/^\/((?:\\\/|[^\/])+)\/([migyu]{0,5})?$/,child:/tablesorter-childRow/,filtered:/filtered/,type:/undefined|number/,exact:/(^[\"\'=]+)|([\"\'=]+$)/g,operators:/[<>=]/g,query:"(q|query)",wild01:/\?/g,wild0More:/\*/g,quote:/\"/g,isNeg1:/(>=?\s*-\d)/,isNeg2:/(<=?\s*\d)/},types:{or:function(c,data,vars){if((tsfRegex.orTest.test(data.iFilter)||tsfRegex.orSplit.test(data.filter))&&!tsfRegex.regex.test(data.filter)){var indx,filterMatched,query,regex,data2=$.extend({},data),filter=data.filter.split(tsfRegex.orSplit),iFilter=data.iFilter.split(tsfRegex.orSplit),len=filter.length;for(indx=0;indx<len;indx++){data2.nestedFilters=true;data2.filter=""+(tsf.parseFilter(c,filter[indx],data)||"");data2.iFilter=""+(tsf.parseFilter(c,iFilter[indx],data)||"");query="("+(tsf.parseFilter(c,data2.filter,data)||"")+")";try{regex=new RegExp(data.isMatch?query:"^"+query+"$",c.widgetOptions.filter_ignoreCase?"i":"");filterMatched=regex.test(data2.exact)||tsf.processTypes(c,data2,vars);if(filterMatched){return filterMatched}}catch(error){return null}}return filterMatched||false}return null},and:function(c,data,vars){if(tsfRegex.andTest.test(data.filter)){var indx,filterMatched,result,query,regex,data2=$.extend({},data),filter=data.filter.split(tsfRegex.andSplit),iFilter=data.iFilter.split(tsfRegex.andSplit),len=filter.length;for(indx=0;indx<len;indx++){data2.nestedFilters=true;data2.filter=""+(tsf.parseFilter(c,filter[indx],data)||"");data2.iFilter=""+(tsf.parseFilter(c,iFilter[indx],data)||"");query=("("+(tsf.parseFilter(c,data2.filter,data)||"")+")").replace(tsfRegex.wild01,"\\S{1}").replace(tsfRegex.wild0More,"\\S*");try{regex=new RegExp(data.isMatch?query:"^"+query+"$",c.widgetOptions.filter_ignoreCase?"i":"");result=regex.test(data2.exact)||tsf.processTypes(c,data2,vars);if(indx===0){filterMatched=result}else{filterMatched=filterMatched&&result}}catch(error){return null}}return filterMatched||false}return null},regex:function(c,data){if(tsfRegex.regex.test(data.filter)){var matches,regex=data.filter_regexCache[data.index]||tsfRegex.regex.exec(data.filter),isRegex=regex instanceof RegExp;try{if(!isRegex){data.filter_regexCache[data.index]=regex=new RegExp(regex[1],regex[2])}matches=regex.test(data.exact)}catch(error){matches=false}return matches}return null},operators:function(c,data){if(tsfRegex.operTest.test(data.iFilter)&&data.iExact!==""){var cachedValue,result,txt,table=c.table,parsed=data.parsed[data.index],query=ts.formatFloat(data.iFilter.replace(tsfRegex.operators,""),table),parser=c.parsers[data.index]||{},savedSearch=query;if(parsed||parser.type==="numeric"){txt=""+data.iFilter.replace(tsfRegex.operators,"").trim();result=tsf.parseFilter(c,txt,data,true);query=typeof result==="number"&&result!==""&&!isNaN(result)?result:query}if((parsed||parser.type==="numeric")&&!isNaN(query)&&typeof data.cache!=="undefined"){cachedValue=data.cache}else{txt=isNaN(data.iExact)?data.iExact.replace(ts.regex.nondigit,""):data.iExact;cachedValue=ts.formatFloat(txt,table)}if(tsfRegex.gtTest.test(data.iFilter)){result=tsfRegex.gteTest.test(data.iFilter)?cachedValue>=query:cachedValue>query}else if(tsfRegex.ltTest.test(data.iFilter)){result=tsfRegex.lteTest.test(data.iFilter)?cachedValue<=query:cachedValue<query}if(!result&&savedSearch===""){result=true}return result}return null},notMatch:function(c,data){if(tsfRegex.notTest.test(data.iFilter)){var indx,txt=data.iFilter.replace("!",""),filter=tsf.parseFilter(c,txt,data)||"";if(tsfRegex.exact.test(filter)){filter=filter.replace(tsfRegex.exact,"");return filter===""?true:filter.trim()!==data.iExact}else{indx=data.iExact.search(filter.trim());return filter===""?true:data.anyMatch?indx<0:!(c.widgetOptions.filter_startsWith?indx===0:indx>=0)}}return null},exact:function(c,data){if(tsfRegex.exact.test(data.iFilter)){var txt=data.iFilter.replace(tsfRegex.exact,""),filter=tsf.parseFilter(c,txt,data)||"";return data.anyMatch?$.inArray(filter,data.rowArray)>=0:filter==data.iExact}return null},range:function(c,data){if(tsfRegex.toTest.test(data.iFilter)){var result,tmp,range1,range2,table=c.table,index=data.index,parsed=data.parsed[index],query=data.iFilter.split(tsfRegex.toSplit);tmp=query[0].replace(ts.regex.nondigit,"")||"";range1=ts.formatFloat(tsf.parseFilter(c,tmp,data),table);tmp=query[1].replace(ts.regex.nondigit,"")||"";range2=ts.formatFloat(tsf.parseFilter(c,tmp,data),table);if(parsed||c.parsers[index].type==="numeric"){result=c.parsers[index].format(""+query[0],table,c.$headers.eq(index),index);range1=result!==""&&!isNaN(result)?result:range1;result=c.parsers[index].format(""+query[1],table,c.$headers.eq(index),index);range2=result!==""&&!isNaN(result)?result:range2}if((parsed||c.parsers[index].type==="numeric")&&!isNaN(range1)&&!isNaN(range2)){result=data.cache}else{tmp=isNaN(data.iExact)?data.iExact.replace(ts.regex.nondigit,""):data.iExact;result=ts.formatFloat(tmp,table)}if(range1>range2){tmp=range1;range1=range2;range2=tmp}return result>=range1&&result<=range2||(range1===""||range2==="")}return null},wild:function(c,data){if(tsfRegex.wildOrTest.test(data.iFilter)){var query=""+(tsf.parseFilter(c,data.iFilter,data)||"");if(!tsfRegex.wildTest.test(query)&&data.nestedFilters){query=data.isMatch?query:"^("+query+")$"}try{return new RegExp(query.replace(tsfRegex.wild01,"\\S{1}").replace(tsfRegex.wild0More,"\\S*"),c.widgetOptions.filter_ignoreCase?"i":"").test(data.exact)}catch(error){return null}}return null},fuzzy:function(c,data){if(tsfRegex.fuzzyTest.test(data.iFilter)){var indx,patternIndx=0,len=data.iExact.length,txt=data.iFilter.slice(1),pattern=tsf.parseFilter(c,txt,data)||"";for(indx=0;indx<len;indx++){if(data.iExact[indx]===pattern[patternIndx]){patternIndx+=1}}return patternIndx===pattern.length}return null}},init:function(table){ts.language=$.extend(true,{},{to:"to",or:"or",and:"and"},ts.language);var options,string,txt,$header,column,val,fxn,noSelect,c=table.config,wo=c.widgetOptions,processStr=function(prefix,str,suffix){str=str.trim();return str===""?"":(prefix||"")+str+(suffix||"")};c.$table.addClass("hasFilters");c.lastSearch=[];wo.filter_searchTimer=null;wo.filter_initTimer=null;wo.filter_formatterCount=0;wo.filter_formatterInit=[];wo.filter_anyColumnSelector='[data-column="all"],[data-column="any"]';wo.filter_multipleColumnSelector='[data-column*="-"],[data-column*=","]';val="\\{"+tsfRegex.query+"\\}";$.extend(tsfRegex,{child:new RegExp(c.cssChildRow),filtered:new RegExp(wo.filter_filteredRow),alreadyFiltered:new RegExp("(\\s+(-"+processStr("|",ts.language.or)+processStr("|",ts.language.to)+")\\s+)","i"),toTest:new RegExp("\\s+(-"+processStr("|",ts.language.to)+")\\s+","i"),toSplit:new RegExp("(?:\\s+(?:-"+processStr("|",ts.language.to)+")\\s+)","gi"),andTest:new RegExp("\\s+("+processStr("",ts.language.and,"|")+"&&)\\s+","i"),andSplit:new RegExp("(?:\\s+(?:"+processStr("",ts.language.and,"|")+"&&)\\s+)","gi"),orTest:new RegExp("(\\|"+processStr("|\\s+",ts.language.or,"\\s+")+")","i"),orSplit:new RegExp("(?:\\|"+processStr("|\\s+(?:",ts.language.or,")\\s+")+")","gi"),iQuery:new RegExp(val,"i"),igQuery:new RegExp(val,"ig"),operTest:/^[<>]=?/,gtTest:/>/,gteTest:/>=/,ltTest:/</,lteTest:/<=/,notTest:/^\!/,wildOrTest:/[\?\*\|]/,wildTest:/\?\*/,fuzzyTest:/^~/,exactTest:/[=\"\|!]/});val=c.$headers.filter(".filter-false, .parser-false").length;if(wo.filter_columnFilters!==false&&val!==c.$headers.length){tsf.buildRow(table,c,wo)}txt="addRows updateCell update updateRows updateComplete appendCache filterReset "+"filterAndSortReset filterResetSaved filterEnd search ".split(" ").join(c.namespace+"filter ");c.$table.on(txt,function(event,filter){val=wo.filter_hideEmpty&&$.isEmptyObject(c.cache)&&!(c.delayInit&&event.type==="appendCache");c.$table.find("."+tscss.filterRow).toggleClass(wo.filter_filteredRow,val);if(!/(search|filter)/.test(event.type)){event.stopPropagation();tsf.buildDefault(table,true)}if(event.type==="filterReset"||event.type==="filterAndSortReset"){c.$table.find("."+tscss.filter).add(wo.filter_$externalFilters).val("");if(event.type==="filterAndSortReset"){ts.sortReset(this.config,function(){tsf.searching(table,[])})}else{tsf.searching(table,[])}}else if(event.type==="filterResetSaved"){ts.storage(table,"tablesorter-filters","")}else if(event.type==="filterEnd"){tsf.buildDefault(table,true)}else{filter=event.type==="search"?filter:event.type==="updateComplete"?c.$table.data("lastSearch"):"";if(/(update|add)/.test(event.type)&&event.type!=="updateComplete"){c.lastCombinedFilter=null;c.lastSearch=[];setTimeout(function(){c.$table.triggerHandler("filterFomatterUpdate")},100)}tsf.searching(table,filter,true)}return false});if(wo.filter_reset){if(wo.filter_reset instanceof $){wo.filter_reset.on("click",function(){c.$table.triggerHandler("filterReset")})}else if($(wo.filter_reset).length){$(document).off("click"+c.namespace+"filter",wo.filter_reset).on("click"+c.namespace+"filter",wo.filter_reset,function(){c.$table.triggerHandler("filterReset")})}}if(wo.filter_functions){for(column=0;column<c.columns;column++){fxn=ts.getColumnData(table,wo.filter_functions,column);if(fxn){$header=c.$headerIndexed[column].removeClass("filter-select");noSelect=!($header.hasClass("filter-false")||$header.hasClass("parser-false"));options="";if(fxn===true&&noSelect){tsf.buildSelect(table,column)}else if(typeof fxn==="object"&&noSelect){for(string in fxn){if(typeof string==="string"){options+=options===""?'<option value="">'+($header.data("placeholder")||$header.attr("data-placeholder")||wo.filter_placeholder.select||"")+"</option>":"";val=string;txt=string;if(string.indexOf(wo.filter_selectSourceSeparator)>=0){val=string.split(wo.filter_selectSourceSeparator);txt=val[1];val=val[0]}options+="<option "+(txt===val?"":'data-function-name="'+string+'" ')+'value="'+val+'">'+txt+"</option>"}}c.$table.find("thead").find("select."+tscss.filter+'[data-column="'+column+'"]').append(options);txt=wo.filter_selectSource;fxn=typeof txt==="function"?true:ts.getColumnData(table,txt,column);if(fxn){tsf.buildSelect(c.table,column,"",true,$header.hasClass(wo.filter_onlyAvail))}}}}}tsf.buildDefault(table,true);tsf.bindSearch(table,c.$table.find("."+tscss.filter),true);if(wo.filter_external){tsf.bindSearch(table,wo.filter_external)}if(wo.filter_hideFilters){tsf.hideFilters(c)}if(c.showProcessing){txt="filterStart filterEnd ".split(" ").join(c.namespace+"filter-sp ");c.$table.off(txt.replace(ts.regex.spaces," ")).on(txt,function(event,columns){$header=columns?c.$table.find("."+tscss.header).filter("[data-column]").filter(function(){return columns[$(this).data("column")]!==""}):"";ts.isProcessing(table,event.type==="filterStart",columns?$header:"")})}c.filteredRows=c.totalRows;txt="tablesorter-initialized pagerBeforeInitialized ".split(" ").join(c.namespace+"filter ");c.$table.off(txt.replace(ts.regex.spaces," ")).on(txt,function(){tsf.completeInit(this)});if(c.pager&&c.pager.initialized&&!wo.filter_initialized){c.$table.triggerHandler("filterFomatterUpdate");setTimeout(function(){tsf.filterInitComplete(c)},100)}else if(!wo.filter_initialized){tsf.completeInit(table)}},completeInit:function(table){var c=table.config,wo=c.widgetOptions,filters=tsf.setDefaults(table,c,wo)||[];if(filters.length){if(!(c.delayInit&&filters.join("")==="")){ts.setFilters(table,filters,true)}}c.$table.triggerHandler("filterFomatterUpdate");setTimeout(function(){if(!wo.filter_initialized){tsf.filterInitComplete(c)}},100)},formatterUpdated:function($cell,column){var $table=$cell&&$cell.closest("table");var config=$table.length&&$table[0].config,wo=config&&config.widgetOptions;if(wo&&!wo.filter_initialized){wo.filter_formatterInit[column]=1}},filterInitComplete:function(c){var indx,len,wo=c.widgetOptions,count=0,completed=function(){wo.filter_initialized=true;c.lastSearch=c.$table.data("lastSearch");c.$table.triggerHandler("filterInit",c);tsf.findRows(c.table,c.lastSearch||[]);if(ts.debug(c,"filter")){console.log("Filter >> Widget initialized")}};if($.isEmptyObject(wo.filter_formatter)){completed()}else{len=wo.filter_formatterInit.length;for(indx=0;indx<len;indx++){if(wo.filter_formatterInit[indx]===1){count++}}clearTimeout(wo.filter_initTimer);if(!wo.filter_initialized&&count===wo.filter_formatterCount){completed()}else if(!wo.filter_initialized){wo.filter_initTimer=setTimeout(function(){completed()},500)}}},processFilters:function(filters,encode){var indx,result=[],mode=encode?encodeURIComponent:decodeURIComponent,len=filters.length;for(indx=0;indx<len;indx++){if(filters[indx]){result[indx]=mode(filters[indx])}}return result},setDefaults:function(table,c,wo){var isArray,saved,indx,col,$filters,filters=ts.getFilters(table)||[];if(wo.filter_saveFilters&&ts.storage){saved=ts.storage(table,"tablesorter-filters")||[];isArray=Array.isArray(saved);if(!(isArray&&saved.join("")===""||!isArray)){filters=tsf.processFilters(saved)}}if(filters.join("")===""){$filters=c.$headers.add(wo.filter_$externalFilters).filter("["+wo.filter_defaultAttrib+"]");for(indx=0;indx<=c.columns;indx++){col=indx===c.columns?"all":indx;filters[indx]=$filters.filter('[data-column="'+col+'"]').attr(wo.filter_defaultAttrib)||filters[indx]||""}}c.$table.data("lastSearch",filters);return filters},parseFilter:function(c,filter,data,parsed){return parsed||data.parsed[data.index]?c.parsers[data.index].format(filter,c.table,[],data.index):filter},buildRow:function(table,c,wo){var $filter,col,column,$header,makeSelect,disabled,name,ffxn,tmp,cellFilter=wo.filter_cellFilter,columns=c.columns,arry=Array.isArray(cellFilter),buildFilter='<tr role="search" class="'+tscss.filterRow+" "+c.cssIgnoreRow+'">';for(column=0;column<columns;column++){if(c.$headerIndexed[column].length){tmp=c.$headerIndexed[column]&&c.$headerIndexed[column][0].colSpan||0;if(tmp>1){buildFilter+='<td data-column="'+column+"-"+(column+tmp-1)+'" colspan="'+tmp+'"'}else{buildFilter+='<td data-column="'+column+'"'}if(arry){buildFilter+=cellFilter[column]?' class="'+cellFilter[column]+'"':""}else{buildFilter+=cellFilter!==""?' class="'+cellFilter+'"':""}buildFilter+="></td>"}}c.$filters=$(buildFilter+="</tr>").appendTo(c.$table.children("thead").eq(0)).children("td");for(column=0;column<columns;column++){disabled=false;$header=c.$headerIndexed[column];if($header&&$header.length){$filter=tsf.getColumnElm(c,c.$filters,column);ffxn=ts.getColumnData(table,wo.filter_functions,column);makeSelect=wo.filter_functions&&ffxn&&typeof ffxn!=="function"||$header.hasClass("filter-select");col=ts.getColumnData(table,c.headers,column);disabled=ts.getData($header[0],col,"filter")==="false"||ts.getData($header[0],col,"parser")==="false";if(makeSelect){buildFilter=$("<select>").appendTo($filter)}else{ffxn=ts.getColumnData(table,wo.filter_formatter,column);if(ffxn){wo.filter_formatterCount++;buildFilter=ffxn($filter,column);if(buildFilter&&buildFilter.length===0){buildFilter=$filter.children("input")}if(buildFilter&&(buildFilter.parent().length===0||buildFilter.parent().length&&buildFilter.parent()[0]!==$filter[0])){$filter.append(buildFilter)}}else{buildFilter=$('<input type="search">').appendTo($filter)}if(buildFilter){tmp=$header.data("placeholder")||$header.attr("data-placeholder")||wo.filter_placeholder.search||"";buildFilter.attr("placeholder",tmp)}}if(buildFilter){name=(Array.isArray(wo.filter_cssFilter)?typeof wo.filter_cssFilter[column]!=="undefined"?wo.filter_cssFilter[column]||"":"":wo.filter_cssFilter)||"";buildFilter.addClass(tscss.filter+" "+name);name=wo.filter_filterLabel;tmp=name.match(/{{([^}]+?)}}/g);if(!tmp){tmp=["{{label}}"]}$.each(tmp,function(indx,attr){var regex=new RegExp(attr,"g"),data=$header.attr("data-"+attr.replace(/{{|}}/g,"")),text=typeof data==="undefined"?$header.text():data;name=name.replace(regex,text.trim())});buildFilter.attr({"data-column":$filter.attr("data-column"),"aria-label":name});if(disabled){buildFilter.attr("placeholder","").addClass(tscss.filterDisabled)[0].disabled=true}}}}},bindSearch:function(table,$el,internal){table=$(table)[0];$el=$($el);if(!$el.length){return}var tmp,c=table.config,wo=c.widgetOptions,namespace=c.namespace+"filter",$ext=wo.filter_$externalFilters;if(internal!==true){tmp=wo.filter_anyColumnSelector+","+wo.filter_multipleColumnSelector;wo.filter_$anyMatch=$el.filter(tmp);if($ext&&$ext.length){wo.filter_$externalFilters=wo.filter_$externalFilters.add($el)}else{wo.filter_$externalFilters=$el}ts.setFilters(table,c.$table.data("lastSearch")||[],internal===false)}tmp="keypress keyup keydown search change input ".split(" ").join(namespace+" ");$el.attr("data-lastSearchTime",(new Date).getTime()).off(tmp.replace(ts.regex.spaces," ")).on("keydown"+namespace,function(event){if(event.which===tskeyCodes.escape&&!table.config.widgetOptions.filter_resetOnEsc){return false}}).on("keyup"+namespace,function(event){wo=table.config.widgetOptions;var column=parseInt($(this).attr("data-column"),10),liveSearch=typeof wo.filter_liveSearch==="boolean"?wo.filter_liveSearch:ts.getColumnData(table,wo.filter_liveSearch,column);if(typeof liveSearch==="undefined"){liveSearch=wo.filter_liveSearch.fallback||false}$(this).attr("data-lastSearchTime",(new Date).getTime());if(event.which===tskeyCodes.escape){this.value=wo.filter_resetOnEsc?"":c.lastSearch[column]}else if(this.value!==""&&(typeof liveSearch==="number"&&this.value.length<liveSearch||event.which!==tskeyCodes.enter&&event.which!==tskeyCodes.backSpace&&(event.which<tskeyCodes.space||event.which>=tskeyCodes.left&&event.which<=tskeyCodes.down))){return}else if(liveSearch===false){if(this.value!==""&&event.which!==tskeyCodes.enter){return}}tsf.searching(table,true,true,column)}).on("search change keypress input blur ".split(" ").join(namespace+" "),function(event){var column=parseInt($(this).attr("data-column"),10),eventType=event.type,liveSearch=typeof wo.filter_liveSearch==="boolean"?wo.filter_liveSearch:ts.getColumnData(table,wo.filter_liveSearch,column);if(table.config.widgetOptions.filter_initialized&&(event.which===tskeyCodes.enter||(eventType==="search"||eventType==="blur")||(eventType==="change"||eventType==="input")&&(liveSearch===true||liveSearch!==true&&event.target.nodeName!=="INPUT")&&this.value!==c.lastSearch[column])){event.preventDefault();$(this).attr("data-lastSearchTime",(new Date).getTime());tsf.searching(table,eventType!=="keypress"||event.which===tskeyCodes.enter,true,column)}})},searching:function(table,filter,skipFirst,column){var liveSearch,wo=table.config.widgetOptions;if(typeof column==="undefined"){liveSearch=false}else{liveSearch=typeof wo.filter_liveSearch==="boolean"?wo.filter_liveSearch:ts.getColumnData(table,wo.filter_liveSearch,column);if(typeof liveSearch==="undefined"){liveSearch=wo.filter_liveSearch.fallback||false}}clearTimeout(wo.filter_searchTimer);if(typeof filter==="undefined"||filter===true){wo.filter_searchTimer=setTimeout(function(){tsf.checkFilters(table,filter,skipFirst)},liveSearch?wo.filter_searchDelay:10)}else{tsf.checkFilters(table,filter,skipFirst)}},equalFilters:function(c,filter1,filter2){var indx,f1=[],f2=[],len=c.columns+1;filter1=Array.isArray(filter1)?filter1:[];filter2=Array.isArray(filter2)?filter2:[];for(indx=0;indx<len;indx++){f1[indx]=filter1[indx]||"";f2[indx]=filter2[indx]||""}return f1.join(",")===f2.join(",")},checkFilters:function(table,filter,skipFirst){var c=table.config,wo=c.widgetOptions,filterArray=Array.isArray(filter),filters=filterArray?filter:ts.getFilters(table,true),currentFilters=filters||[];if($.isEmptyObject(c.cache)){if(c.delayInit&&(!c.pager||c.pager&&c.pager.initialized)){ts.updateCache(c,function(){tsf.checkFilters(table,false,skipFirst)})}return}if(filterArray){ts.setFilters(table,filters,false,skipFirst!==true);if(!wo.filter_initialized){c.lastSearch=[];c.lastCombinedFilter=""}}if(wo.filter_hideFilters){c.$table.find("."+tscss.filterRow).triggerHandler(tsf.hideFiltersCheck(c)?"mouseleave":"mouseenter")}if(tsf.equalFilters(c,c.lastSearch,currentFilters)){if(filter!==false){return}else{c.lastCombinedFilter="";c.lastSearch=[]}}filters=filters||[];filters=Array.prototype.map?filters.map(String):filters.join("<22>").split("<22>");if(wo.filter_initialized){c.$table.triggerHandler("filterStart",[filters])}if(c.showProcessing){setTimeout(function(){tsf.findRows(table,filters,currentFilters);return false},30)}else{tsf.findRows(table,filters,currentFilters);return false}},hideFiltersCheck:function(c){if(typeof c.widgetOptions.filter_hideFilters==="function"){var val=c.widgetOptions.filter_hideFilters(c);if(typeof val==="boolean"){return val}}return ts.getFilters(c.$table).join("")===""},hideFilters:function(c,$table){var timer;($table||c.$table).find("."+tscss.filterRow).addClass(tscss.filterRowHide).on("mouseenter mouseleave",function(e){var event=e,$row=$(this);clearTimeout(timer);timer=setTimeout(function(){if(/enter|over/.test(event.type)){$row.removeClass(tscss.filterRowHide)}else{if($(document.activeElement).closest("tr")[0]!==$row[0]){$row.toggleClass(tscss.filterRowHide,tsf.hideFiltersCheck(c))}}},200)}).find("input, select").on("focus blur",function(e){var event=e,$row=$(this).closest("tr");clearTimeout(timer);timer=setTimeout(function(){clearTimeout(timer);$row.toggleClass(tscss.filterRowHide,tsf.hideFiltersCheck(c)&&event.type!=="focus")},200)})},defaultFilter:function(filter,mask){if(filter===""){return filter}var regex=tsfRegex.iQuery,maskLen=mask.match(tsfRegex.igQuery).length,query=maskLen>1?filter.trim().split(/\s/):[filter.trim()],len=query.length-1,indx=0,val=mask;if(len<1&&maskLen>1){query[1]=query[0]}while(regex.test(val)){val=val.replace(regex,query[indx++]||"");if(regex.test(val)&&indx<len&&(query[indx]||"")!==""){val=mask.replace(regex,val)}}return val},getLatestSearch:function($input){if($input){return $input.sort(function(a,b){return $(b).attr("data-lastSearchTime")-$(a).attr("data-lastSearchTime")})}return $input||$()},findRange:function(c,val,ignoreRanges){var temp,ranges,range,start,end,singles,i,indx,len,columns=[];if(/^[0-9]+$/.test(val)){return[parseInt(val,10)]}if(!ignoreRanges&&/-/.test(val)){ranges=val.match(/(\d+)\s*-\s*(\d+)/g);len=ranges?ranges.length:0;for(indx=0;indx<len;indx++){range=ranges[indx].split(/\s*-\s*/);start=parseInt(range[0],10)||0;end=parseInt(range[1],10)||c.columns-1;if(start>end){temp=start;start=end;end=temp}if(end>=c.columns){end=c.columns-1}for(;start<=end;start++){columns[columns.length]=start}val=val.replace(ranges[indx],"")}}if(!ignoreRanges&&/,/.test(val)){singles=val.split(/\s*,\s*/);len=singles.length;for(i=0;i<len;i++){if(singles[i]!==""){indx=parseInt(singles[i],10);if(indx<c.columns){columns[columns.length]=indx}}}}if(!columns.length){for(indx=0;indx<c.columns;indx++){columns[columns.length]=indx}}return columns},getColumnElm:function(c,$elements,column){return $elements.filter(function(){var cols=tsf.findRange(c,$(this).attr("data-column"));return $.inArray(column,cols)>-1})},multipleColumns:function(c,$input){var wo=c.widgetOptions,targets=wo.filter_initialized||!$input.filter(wo.filter_anyColumnSelector).length,val=(tsf.getLatestSearch($input).attr("data-column")||"").trim();return tsf.findRange(c,val,!targets)},processTypes:function(c,data,vars){var ffxn,filterMatched=null,matches=null;for(ffxn in tsf.types){if($.inArray(ffxn,vars.excludeMatch)<0&&matches===null){matches=tsf.types[ffxn](c,data,vars);if(matches!==null){data.matchedOn=ffxn;filterMatched=matches}}}return filterMatched},matchType:function(c,columnIndex){var isMatch,wo=c.widgetOptions,$el=c.$headerIndexed[columnIndex];if($el.hasClass("filter-exact")){isMatch=false}else if($el.hasClass("filter-match")){isMatch=true}else{if(wo.filter_columnFilters){$el=c.$filters.find("."+tscss.filter).add(wo.filter_$externalFilters).filter('[data-column="'+columnIndex+'"]')}else if(wo.filter_$externalFilters){$el=wo.filter_$externalFilters.filter('[data-column="'+columnIndex+'"]')}isMatch=$el.length?c.widgetOptions.filter_matchType[($el[0].nodeName||"").toLowerCase()]==="match":false}return isMatch},processRow:function(c,data,vars){var result,filterMatched,fxn,ffxn,txt,wo=c.widgetOptions,showRow=true,hasAnyMatchInput=wo.filter_$anyMatch&&wo.filter_$anyMatch.length,columnIndex=wo.filter_$anyMatch&&wo.filter_$anyMatch.length?tsf.multipleColumns(c,wo.filter_$anyMatch):[];data.$cells=data.$row.children();data.matchedOn=null;if(data.anyMatchFlag&&columnIndex.length>1||data.anyMatchFilter&&!hasAnyMatchInput){data.anyMatch=true;data.isMatch=true;data.rowArray=data.$cells.map(function(i){if($.inArray(i,columnIndex)>-1||data.anyMatchFilter&&!hasAnyMatchInput){if(data.parsed[i]){txt=data.cacheArray[i]}else{txt=data.rawArray[i];txt=wo.filter_ignoreCase?txt.toLowerCase().trim():txt.trim();if(c.sortLocaleCompare){txt=ts.replaceAccents(txt)}}return txt}}).get();data.filter=data.anyMatchFilter;data.iFilter=data.iAnyMatchFilter;data.exact=data.rowArray.join(" ");data.iExact=wo.filter_ignoreCase?data.exact.toLowerCase():data.exact;data.cache=data.cacheArray.slice(0,-1).join(" ");vars.excludeMatch=vars.noAnyMatch;filterMatched=tsf.processTypes(c,data,vars);if(filterMatched!==null){showRow=filterMatched}else{if(wo.filter_startsWith){showRow=false;columnIndex=Math.min(c.columns,data.rowArray.length);while(!showRow&&columnIndex>0){columnIndex--;showRow=showRow||data.rowArray[columnIndex].indexOf(data.iFilter)===0}}else{showRow=(data.iExact+data.childRowText).indexOf(data.iFilter)>=0}}data.anyMatch=false;if(data.filters.join("")===data.filter){return showRow}}for(columnIndex=0;columnIndex<c.columns;columnIndex++){data.filter=data.filters[columnIndex];data.index=columnIndex;vars.excludeMatch=vars.excludeFilter[columnIndex];if(data.filter){data.cache=data.cacheArray[columnIndex];result=data.parsed[columnIndex]?data.cache:data.rawArray[columnIndex]||"";data.exact=c.sortLocaleCompare?ts.replaceAccents(result):result;data.iExact=!tsfRegex.type.test(typeof data.exact)&&wo.filter_ignoreCase?data.exact.toLowerCase():data.exact;data.isMatch=tsf.matchType(c,columnIndex);result=showRow;ffxn=wo.filter_columnFilters?c.$filters.add(wo.filter_$externalFilters).filter('[data-column="'+columnIndex+'"]').find("select option:selected").attr("data-function-name")||"":"";if(c.sortLocaleCompare){data.filter=ts.replaceAccents(data.filter)}if(wo.filter_defaultFilter&&tsfRegex.iQuery.test(vars.defaultColFilter[columnIndex])){data.filter=tsf.defaultFilter(data.filter,vars.defaultColFilter[columnIndex])}data.iFilter=wo.filter_ignoreCase?(data.filter||"").toLowerCase():data.filter;fxn=vars.functions[columnIndex];filterMatched=null;if(fxn){if(typeof fxn==="function"){filterMatched=fxn(data.exact,data.cache,data.filter,columnIndex,data.$row,c,data)}else if(typeof fxn[ffxn||data.filter]==="function"){txt=ffxn||data.filter;filterMatched=fxn[txt](data.exact,data.cache,data.filter,columnIndex,data.$row,c,data)}}if(filterMatched===null){filterMatched=tsf.processTypes(c,data,vars);txt=fxn===true&&(data.matchedOn==="and"||data.matchedOn==="or");if(filterMatched!==null&&!txt){result=filterMatched}else{if(fxn===true){result=data.isMatch?(""+data.iExact).search(data.iFilter)>=0:data.filter===data.exact}else{txt=(data.iExact+data.childRowText).indexOf(tsf.parseFilter(c,data.iFilter,data));result=!wo.filter_startsWith&&txt>=0||wo.filter_startsWith&&txt===0}}}else{result=filterMatched}showRow=result?showRow:false}}return showRow},findRows:function(table,filters,currentFilters){if(tsf.equalFilters(table.config,table.config.lastSearch,currentFilters)||!table.config.widgetOptions.filter_initialized){return}var len,norm_rows,rowData,$rows,$row,rowIndex,tbodyIndex,$tbody,columnIndex,isChild,childRow,lastSearch,showRow,showParent,time,val,indx,notFiltered,searchFiltered,query,injected,res,id,txt,storedFilters=$.extend([],filters),c=table.config,wo=c.widgetOptions,debug=ts.debug(c,"filter"),data={anyMatch:false,filters:filters,filter_regexCache:[]},vars={noAnyMatch:["range","operators"],functions:[],excludeFilter:[],defaultColFilter:[],defaultAnyFilter:ts.getColumnData(table,wo.filter_defaultFilter,c.columns,true)||""};data.parsed=[];for(columnIndex=0;columnIndex<c.columns;columnIndex++){data.parsed[columnIndex]=wo.filter_useParsedData||(c.parsers&&c.parsers[columnIndex]&&c.parsers[columnIndex].parsed||ts.getData&&ts.getData(c.$headerIndexed[columnIndex],ts.getColumnData(table,c.headers,columnIndex),"filter")==="parsed"||c.$headerIndexed[columnIndex].hasClass("filter-parsed"));vars.functions[columnIndex]=ts.getColumnData(table,wo.filter_functions,columnIndex)||c.$headerIndexed[columnIndex].hasClass("filter-select");vars.defaultColFilter[columnIndex]=ts.getColumnData(table,wo.filter_defaultFilter,columnIndex)||"";vars.excludeFilter[columnIndex]=(ts.getColumnData(table,wo.filter_excludeFilter,columnIndex,true)||"").split(/\s+/)}if(debug){console.log("Filter >> Starting filter widget search",filters);time=new Date}c.filteredRows=0;c.totalRows=0;currentFilters=storedFilters||[];for(tbodyIndex=0;tbodyIndex<c.$tbodies.length;tbodyIndex++){$tbody=ts.processTbody(table,c.$tbodies.eq(tbodyIndex),true);columnIndex=c.columns;norm_rows=c.cache[tbodyIndex].normalized;$rows=$($.map(norm_rows,function(el){return el[columnIndex].$row.get()}));if(currentFilters.join("")===""||wo.filter_serversideFiltering){$rows.removeClass(wo.filter_filteredRow).not("."+c.cssChildRow).css("display","")}else{$rows=$rows.not("."+c.cssChildRow);len=$rows.length;if(wo.filter_$anyMatch&&wo.filter_$anyMatch.length||typeof filters[c.columns]!=="undefined"){data.anyMatchFlag=true;data.anyMatchFilter=""+(filters[c.columns]||wo.filter_$anyMatch&&tsf.getLatestSearch(wo.filter_$anyMatch).val()||"");if(wo.filter_columnAnyMatch){query=data.anyMatchFilter.split(tsfRegex.andSplit);injected=false;for(indx=0;indx<query.length;indx++){res=query[indx].split(":");if(res.length>1){if(isNaN(res[0])){$.each(c.headerContent,function(i,txt){if(txt.toLowerCase().indexOf(res[0])>-1){id=i;filters[id]=res[1]}})}else{id=parseInt(res[0],10)-1}if(id>=0&&id<c.columns){filters[id]=res[1];query.splice(indx,1);indx--;injected=true}}}if(injected){data.anyMatchFilter=query.join(" && ")}}}searchFiltered=wo.filter_searchFiltered;lastSearch=c.lastSearch||c.$table.data("lastSearch")||[];if(searchFiltered){for(indx=0;indx<columnIndex+1;indx++){val=filters[indx]||"";if(!searchFiltered){indx=columnIndex}searchFiltered=searchFiltered&&lastSearch.length&&val.indexOf(lastSearch[indx]||"")===0&&!tsfRegex.alreadyFiltered.test(val)&&!tsfRegex.exactTest.test(val)&&!(tsfRegex.isNeg1.test(val)||tsfRegex.isNeg2.test(val))&&!(val!==""&&c.$filters&&c.$filters.filter('[data-column="'+indx+'"]').find("select").length&&!tsf.matchType(c,indx))}}notFiltered=$rows.not("."+wo.filter_filteredRow).length;if(searchFiltered&¬Filtered===0){searchFiltered=false}if(debug){console.log("Filter >> Searching through "+(searchFiltered&¬Filtered<len?notFiltered:"all")+" rows")}if(data.anyMatchFlag){if(c.sortLocaleCompare){data.anyMatchFilter=ts.replaceAccents(data.anyMatchFilter)}if(wo.filter_defaultFilter&&tsfRegex.iQuery.test(vars.defaultAnyFilter)){data.anyMatchFilter=tsf.defaultFilter(data.anyMatchFilter,vars.defaultAnyFilter);searchFiltered=false}data.iAnyMatchFilter=!(wo.filter_ignoreCase&&c.ignoreCase)?data.anyMatchFilter:data.anyMatchFilter.toLowerCase()}for(rowIndex=0;rowIndex<len;rowIndex++){txt=$rows[rowIndex].className;isChild=rowIndex&&tsfRegex.child.test(txt);if(isChild||searchFiltered&&tsfRegex.filtered.test(txt)){continue}data.$row=$rows.eq(rowIndex);data.rowIndex=rowIndex;data.cacheArray=norm_rows[rowIndex];rowData=data.cacheArray[c.columns];data.rawArray=rowData.raw;data.childRowText="";if(!wo.filter_childByColumn){txt="";childRow=rowData.child;for(indx=0;indx<childRow.length;indx++){txt+=" "+childRow[indx].join(" ")||""}data.childRowText=wo.filter_childRows?wo.filter_ignoreCase?txt.toLowerCase():txt:""}showRow=false;showParent=tsf.processRow(c,data,vars);$row=rowData.$row;val=showParent?true:false;childRow=rowData.$row.filter(":gt(0)");if(wo.filter_childRows&&childRow.length){if(wo.filter_childByColumn){if(!wo.filter_childWithSibs){childRow.addClass(wo.filter_filteredRow);$row=$row.eq(0)}for(indx=0;indx<childRow.length;indx++){data.$row=childRow.eq(indx);data.cacheArray=rowData.child[indx];data.rawArray=data.cacheArray;val=tsf.processRow(c,data,vars);showRow=showRow||val;if(!wo.filter_childWithSibs&&val){childRow.eq(indx).removeClass(wo.filter_filteredRow)}}}showRow=showRow||showParent}else{showRow=val}$row.toggleClass(wo.filter_filteredRow,!showRow)[0].display=showRow?"":"none"}}c.filteredRows+=$rows.not("."+wo.filter_filteredRow).length;c.totalRows+=$rows.length;ts.processTbody(table,$tbody,false)}c.lastCombinedFilter=storedFilters.join("");c.lastSearch=storedFilters;c.$table.data("lastSearch",storedFilters);if(wo.filter_saveFilters&&ts.storage){ts.storage(table,"tablesorter-filters",tsf.processFilters(storedFilters,true))}if(debug){console.log("Filter >> Completed search"+ts.benchmark(time))}if(wo.filter_initialized){c.$table.triggerHandler("filterBeforeEnd",c);c.$table.triggerHandler("filterEnd",c)}setTimeout(function(){ts.applyWidget(c.table)},0)},getOptionSource:function(table,column,onlyAvail){table=$(table)[0];var c=table.config,wo=c.widgetOptions,arry=false,source=wo.filter_selectSource,last=c.$table.data("lastSearch")||[],fxn=typeof source==="function"?true:ts.getColumnData(table,source,column);if(onlyAvail&&last[column]!==""){onlyAvail=false}if(fxn===true){arry=source(table,column,onlyAvail)}else if(fxn instanceof $||$.type(fxn)==="string"&&fxn.indexOf("</option>")>=0){return fxn}else if(Array.isArray(fxn)){arry=fxn}else if($.type(source)==="object"&&fxn){arry=fxn(table,column,onlyAvail);if(arry===null){return null}}if(arry===false){arry=tsf.getOptions(table,column,onlyAvail)}return tsf.processOptions(table,column,arry)},processOptions:function(table,column,arry){if(!Array.isArray(arry)){return false}table=$(table)[0];var cts,txt,indx,len,parsedTxt,str,c=table.config,validColumn=typeof column!=="undefined"&&column!==null&&column>=0&&column<c.columns,direction=validColumn?c.$headerIndexed[column].hasClass("filter-select-sort-desc"):false,parsed=[];arry=$.grep(arry,function(value,indx){if(value.text){return true}return $.inArray(value,arry)===indx});if(validColumn&&c.$headerIndexed[column].hasClass("filter-select-nosort")){return arry}else{len=arry.length;for(indx=0;indx<len;indx++){txt=arry[indx];str=txt.text?txt.text:txt;parsedTxt=(validColumn&&c.parsers&&c.parsers.length&&c.parsers[column].format(str,table,[],column)||str).toString();parsedTxt=c.widgetOptions.filter_ignoreCase?parsedTxt.toLowerCase():parsedTxt;if(txt.text){txt.parsed=parsedTxt;parsed[parsed.length]=txt}else{parsed[parsed.length]={text:txt,parsed:parsedTxt}}}cts=c.textSorter||"";parsed.sort(function(a,b){var x=direction?b.parsed:a.parsed,y=direction?a.parsed:b.parsed;if(validColumn&&typeof cts==="function"){return cts(x,y,true,column,table)}else if(validColumn&&typeof cts==="object"&&cts.hasOwnProperty(column)){return cts[column](x,y,true,column,table)}else if(ts.sortNatural){return ts.sortNatural(x,y)}return true});arry=[];len=parsed.length;for(indx=0;indx<len;indx++){arry[arry.length]=parsed[indx]}return arry}},getOptions:function(table,column,onlyAvail){table=$(table)[0];var rowIndex,tbodyIndex,len,row,cache,indx,child,childLen,c=table.config,wo=c.widgetOptions,arry=[];for(tbodyIndex=0;tbodyIndex<c.$tbodies.length;tbodyIndex++){cache=c.cache[tbodyIndex];len=c.cache[tbodyIndex].normalized.length;for(rowIndex=0;rowIndex<len;rowIndex++){row=cache.row?cache.row[rowIndex]:cache.normalized[rowIndex][c.columns].$row[0];if(onlyAvail&&row.className.match(wo.filter_filteredRow)){continue}if(wo.filter_useParsedData||c.parsers[column].parsed||c.$headerIndexed[column].hasClass("filter-parsed")){arry[arry.length]=""+cache.normalized[rowIndex][column];if(wo.filter_childRows&&wo.filter_childByColumn){childLen=cache.normalized[rowIndex][c.columns].$row.length-1;for(indx=0;indx<childLen;indx++){arry[arry.length]=""+cache.normalized[rowIndex][c.columns].child[indx][column]}}}else{arry[arry.length]=cache.normalized[rowIndex][c.columns].raw[column];if(wo.filter_childRows&&wo.filter_childByColumn){childLen=cache.normalized[rowIndex][c.columns].$row.length;for(indx=1;indx<childLen;indx++){child=cache.normalized[rowIndex][c.columns].$row.eq(indx).children().eq(column);arry[arry.length]=""+ts.getElementText(c,child,column)}}}}}return arry},buildSelect:function(table,column,arry,updating,onlyAvail){table=$(table)[0];column=parseInt(column,10);if(!table.config.cache||$.isEmptyObject(table.config.cache)){return}var indx,val,txt,t,$filters,$filter,option,c=table.config,wo=c.widgetOptions,node=c.$headerIndexed[column],options='<option value="">'+(node.data("placeholder")||node.attr("data-placeholder")||wo.filter_placeholder.select||"")+"</option>",currentValue=c.$table.find("thead").find("select."+tscss.filter+'[data-column="'+column+'"]').val();if(typeof arry==="undefined"||arry===""){arry=tsf.getOptionSource(table,column,onlyAvail);if(arry===null){return}}if(Array.isArray(arry)){for(indx=0;indx<arry.length;indx++){option=arry[indx];if(option.text){option["data-function-name"]=typeof option.value==="undefined"?option.text:option.value;options+="<option";for(val in option){if(option.hasOwnProperty(val)&&val!=="text"){options+=" "+val+'="'+option[val].replace(tsfRegex.quote,""")+'"'}}if(!option.value){options+=' value="'+option.text.replace(tsfRegex.quote,""")+'"'}options+=">"+option.text.replace(tsfRegex.quote,""")+"</option>"}else if(""+option!=="[object Object]"){txt=option=(""+option).replace(tsfRegex.quote,""");val=txt;if(txt.indexOf(wo.filter_selectSourceSeparator)>=0){t=txt.split(wo.filter_selectSourceSeparator);val=t[0];txt=t[1]}options+=option!==""?"<option "+(val===txt?"":'data-function-name="'+option+'" ')+'value="'+val+'">'+txt+"</option>":""}}arry=[]}$filters=(c.$filters?c.$filters:c.$table.children("thead")).find("."+tscss.filter);if(wo.filter_$externalFilters){$filters=$filters&&$filters.length?$filters.add(wo.filter_$externalFilters):wo.filter_$externalFilters}$filter=$filters.filter('select[data-column="'+column+'"]');if($filter.length){$filter[updating?"html":"append"](options);if(!Array.isArray(arry)){$filter.append(arry).val(currentValue)}$filter.val(currentValue)}},buildDefault:function(table,updating){var columnIndex,$header,noSelect,c=table.config,wo=c.widgetOptions,columns=c.columns;for(columnIndex=0;columnIndex<columns;columnIndex++){$header=c.$headerIndexed[columnIndex];noSelect=!($header.hasClass("filter-false")||$header.hasClass("parser-false"));if(($header.hasClass("filter-select")||ts.getColumnData(table,wo.filter_functions,columnIndex)===true)&&noSelect){tsf.buildSelect(table,columnIndex,"",updating,$header.hasClass(wo.filter_onlyAvail))}}}};tsfRegex=tsf.regex;ts.getFilters=function(table,getRaw,setFilters,skipFirst){var i,$filters,$column,cols,filters=[],c=table?$(table)[0].config:"",wo=c?c.widgetOptions:"";if(getRaw!==true&&wo&&!wo.filter_columnFilters||Array.isArray(setFilters)&&tsf.equalFilters(c,setFilters,c.lastSearch)){return $(table).data("lastSearch")||[]}if(c){if(c.$filters){$filters=c.$filters.find("."+tscss.filter)}if(wo.filter_$externalFilters){$filters=$filters&&$filters.length?$filters.add(wo.filter_$externalFilters):wo.filter_$externalFilters}if($filters&&$filters.length){filters=setFilters||[];for(i=0;i<c.columns+1;i++){cols=i===c.columns?wo.filter_anyColumnSelector+","+wo.filter_multipleColumnSelector:'[data-column="'+i+'"]';$column=$filters.filter(cols);if($column.length){$column=tsf.getLatestSearch($column);if(Array.isArray(setFilters)){if(skipFirst&&$column.length>1){$column=$column.slice(1)}if(i===c.columns){cols=$column.filter(wo.filter_anyColumnSelector);$column=cols.length?cols:$column}$column.val(setFilters[i]).trigger("change"+c.namespace)}else{filters[i]=$column.val()||"";if(i===c.columns){$column.slice(1).filter('[data-column*="'+$column.attr("data-column")+'"]').val(filters[i])}else{$column.slice(1).val(filters[i])}}if(i===c.columns&&$column.length){wo.filter_$anyMatch=$column}}}}}return filters};ts.setFilters=function(table,filter,apply,skipFirst){var c=table?$(table)[0].config:"",valid=ts.getFilters(table,true,filter,skipFirst);if(typeof apply==="undefined"){apply=true}if(c&&apply){c.lastCombinedFilter=null;c.lastSearch=[];tsf.searching(c.table,filter,skipFirst);c.$table.triggerHandler("filterFomatterUpdate")}return valid.length!==0}})(jQuery);(function($,window){"use strict";var ts=$.tablesorter||{};$.extend(ts.css,{sticky:"tablesorter-stickyHeader",stickyVis:"tablesorter-sticky-visible",stickyHide:"tablesorter-sticky-hidden",stickyWrap:"tablesorter-sticky-wrapper"});ts.addHeaderResizeEvent=function(table,disable,settings){table=$(table)[0];if(!table.config){return}var defaults={timer:250},options=$.extend({},defaults,settings),c=table.config,wo=c.widgetOptions,checkSizes=function(triggerEvent){var index,headers,$header,sizes,width,height,len=c.$headers.length;wo.resize_flag=true;headers=[];for(index=0;index<len;index++){$header=c.$headers.eq(index);sizes=$header.data("savedSizes")||[0,0];width=$header[0].offsetWidth;height=$header[0].offsetHeight;if(width!==sizes[0]||height!==sizes[1]){$header.data("savedSizes",[width,height]);headers.push($header[0])}}if(headers.length&&triggerEvent!==false){c.$table.triggerHandler("resize",[headers])}wo.resize_flag=false};clearInterval(wo.resize_timer);if(disable){wo.resize_flag=false;return false}checkSizes(false);wo.resize_timer=setInterval(function(){if(wo.resize_flag){return}checkSizes()},options.timer)};function getStickyOffset(c,wo){var $el=isNaN(wo.stickyHeaders_offset)?$(wo.stickyHeaders_offset):[];return $el.length?$el.height()||0:parseInt(wo.stickyHeaders_offset,10)||0}ts.addWidget({id:"stickyHeaders",priority:54,options:{stickyHeaders:"",stickyHeaders_appendTo:null,stickyHeaders_attachTo:null,stickyHeaders_xScroll:null,stickyHeaders_yScroll:null,stickyHeaders_offset:0,stickyHeaders_filteredToTop:true,stickyHeaders_cloneId:"-sticky",stickyHeaders_addResizeEvent:true,stickyHeaders_includeCaption:true,stickyHeaders_zIndex:2},format:function(table,c,wo){if(c.$table.hasClass("hasStickyHeaders")||$.inArray("filter",c.widgets)>=0&&!c.$table.hasClass("hasFilters")){return}var index,len,$t,$table=c.$table,$attach=$(wo.stickyHeaders_attachTo||wo.stickyHeaders_appendTo),namespace=c.namespace+"stickyheaders ",$yScroll=$(wo.stickyHeaders_yScroll||wo.stickyHeaders_attachTo||window),$xScroll=$(wo.stickyHeaders_xScroll||wo.stickyHeaders_attachTo||window),$thead=$table.children("thead:first"),$header=$thead.children("tr").not(".sticky-false").children(),$tfoot=$table.children("tfoot"),stickyOffset=getStickyOffset(c,wo),$nestedSticky=$table.parent().closest("."+ts.css.table).hasClass("hasStickyHeaders")?$table.parent().closest("table.tablesorter")[0].config.widgetOptions.$sticky.parent():[],nestedStickyTop=$nestedSticky.length?$nestedSticky.height():0,$stickyTable=wo.$sticky=$table.clone().addClass("containsStickyHeaders "+ts.css.sticky+" "+wo.stickyHeaders+" "+c.namespace.slice(1)+"_extra_table").wrap('<div class="'+ts.css.stickyWrap+'">'),$stickyWrap=$stickyTable.parent().addClass(ts.css.stickyHide).css({position:$attach.length?"absolute":"fixed",padding:parseInt($stickyTable.parent().parent().css("padding-left"),10),top:stickyOffset+nestedStickyTop,left:0,visibility:"hidden",zIndex:wo.stickyHeaders_zIndex||2}),$stickyThead=$stickyTable.children("thead:first"),$stickyCells,laststate="",setWidth=function($orig,$clone){var index,width,border,$cell,$this,$cells=$orig.filter(":visible"),len=$cells.length;for(index=0;index<len;index++){$cell=$clone.filter(":visible").eq(index);$this=$cells.eq(index);if($this.css("box-sizing")==="border-box"){width=$this.outerWidth()}else{if($cell.css("border-collapse")==="collapse"){if(window.getComputedStyle){width=parseFloat(window.getComputedStyle($this[0],null).width)}else{border=parseFloat($this.css("border-width"));width=$this.outerWidth()-parseFloat($this.css("padding-left"))-parseFloat($this.css("padding-right"))-border}}else{width=$this.width()}}$cell.css({width:width,"min-width":width,"max-width":width})}},getLeftPosition=function(yWindow){if(yWindow===false&&$nestedSticky.length){return $table.position().left}return $attach.length?parseInt($attach.css("padding-left"),10)||0:$table.offset().left-parseInt($table.css("margin-left"),10)-$(window).scrollLeft()},resizeHeader=function(){$stickyWrap.css({left:getLeftPosition(),width:$table.outerWidth()});setWidth($table,$stickyTable);setWidth($header,$stickyCells)},scrollSticky=function(resizing){if(!$table.is(":visible")){return}nestedStickyTop=$nestedSticky.length?$nestedSticky.offset().top-$yScroll.scrollTop()+$nestedSticky.height():0;var tmp,offset=$table.offset(),stickyOffset=getStickyOffset(c,wo),yWindow=$.isWindow($yScroll[0]),yScroll=yWindow?$yScroll.scrollTop():$nestedSticky.length?parseInt($nestedSticky[0].style.top,10):$yScroll.offset().top,attachTop=$attach.length?yScroll:$yScroll.scrollTop(),captionHeight=wo.stickyHeaders_includeCaption?0:$table.children("caption").height()||0,scrollTop=attachTop+stickyOffset+nestedStickyTop-captionHeight,tableHeight=$table.height()-($stickyWrap.height()+($tfoot.height()||0))-captionHeight,isVisible=scrollTop>offset.top&&scrollTop<offset.top+tableHeight?"visible":"hidden",state=isVisible==="visible"?ts.css.stickyVis:ts.css.stickyHide,needsUpdating=!$stickyWrap.hasClass(state),cssSettings={visibility:isVisible};if($attach.length){needsUpdating=true;cssSettings.top=yWindow?scrollTop-$attach.offset().top:$attach.scrollTop()}tmp=getLeftPosition(yWindow);if(tmp!==parseInt($stickyWrap.css("left"),10)){needsUpdating=true;cssSettings.left=tmp}cssSettings.top=(cssSettings.top||0)+(!yWindow&&$nestedSticky.length?$nestedSticky.height():stickyOffset+nestedStickyTop);if(needsUpdating){$stickyWrap.removeClass(ts.css.stickyVis+" "+ts.css.stickyHide).addClass(state).css(cssSettings)}if(isVisible!==laststate||resizing){resizeHeader();laststate=isVisible}};if($attach.length&&!$attach.css("position")){$attach.css("position","relative")}if($stickyTable.attr("id")){$stickyTable[0].id+=wo.stickyHeaders_cloneId}$stickyTable.find("> thead:gt(0), tr.sticky-false").hide();$stickyTable.find("> tbody, > tfoot").remove();$stickyTable.find("caption").toggle(wo.stickyHeaders_includeCaption);$stickyCells=$stickyThead.children().children();$stickyTable.css({height:0,width:0,margin:0});$stickyCells.find("."+ts.css.resizer).remove();$table.addClass("hasStickyHeaders").on("pagerComplete"+namespace,function(){resizeHeader()});ts.bindEvents(table,$stickyThead.children().children("."+ts.css.header));if(wo.stickyHeaders_appendTo){$(wo.stickyHeaders_appendTo).append($stickyWrap)}else{$table.after($stickyWrap)}if(c.onRenderHeader){$t=$stickyThead.children("tr").children();len=$t.length;for(index=0;index<len;index++){c.onRenderHeader.apply($t.eq(index),[index,c,$stickyTable])}}$xScroll.add($yScroll).off("scroll resize ".split(" ").join(namespace).replace(/\s+/g," ")).on("scroll resize ".split(" ").join(namespace),function(event){scrollSticky(event.type==="resize")});c.$table.off("stickyHeadersUpdate"+namespace).on("stickyHeadersUpdate"+namespace,function(){scrollSticky(true)});if(wo.stickyHeaders_addResizeEvent){ts.addHeaderResizeEvent(table)}if($table.hasClass("hasFilters")&&wo.filter_columnFilters){$table.on("filterEnd"+namespace,function(){var $td=$(document.activeElement).closest("td"),column=$td.parent().children().index($td);if($stickyWrap.hasClass(ts.css.stickyVis)&&wo.stickyHeaders_filteredToTop){window.scrollTo(0,$table.position().top);if(column>=0&&c.$filters){c.$filters.eq(column).find("a, select, input").filter(":visible").trigger("focus")}}});ts.filter.bindSearch($table,$stickyCells.find("."+ts.css.filter));if(wo.filter_hideFilters){ts.filter.hideFilters(c,$stickyTable)}}if(wo.stickyHeaders_addResizeEvent){$table.on("resize"+c.namespace+"stickyheaders",function(){resizeHeader()})}scrollSticky(true);$table.triggerHandler("stickyHeadersInit")},remove:function(table,c,wo){var namespace=c.namespace+"stickyheaders ";c.$table.removeClass("hasStickyHeaders").off("pagerComplete resize filterEnd stickyHeadersUpdate ".split(" ").join(namespace).replace(/\s+/g," ")).next("."+ts.css.stickyWrap).remove();if(wo.$sticky&&wo.$sticky.length){wo.$sticky.remove()}$(window).add(wo.stickyHeaders_xScroll).add(wo.stickyHeaders_yScroll).add(wo.stickyHeaders_attachTo).off("scroll resize ".split(" ").join(namespace).replace(/\s+/g," "));ts.addHeaderResizeEvent(table,true)}})})(jQuery,window);(function($,window){"use strict";var ts=$.tablesorter||{};$.extend(ts.css,{resizableContainer:"tablesorter-resizable-container",resizableHandle:"tablesorter-resizable-handle",resizableNoSelect:"tablesorter-disableSelection",resizableStorage:"tablesorter-resizable"});$(function(){var s="<style>"+"body."+ts.css.resizableNoSelect+" { -ms-user-select: none; -moz-user-select: -moz-none;"+"-khtml-user-select: none; -webkit-user-select: none; user-select: none; }"+"."+ts.css.resizableContainer+" { position: relative; height: 1px; }"+"."+ts.css.resizableHandle+" { position: absolute; display: inline-block; width: 8px;"+"top: 1px; cursor: ew-resize; z-index: 3; user-select: none; -moz-user-select: none; }"+"</style>";$("head").append(s)});ts.resizable={init:function(c,wo){if(c.$table.hasClass("hasResizable")){return}c.$table.addClass("hasResizable");var noResize,$header,column,storedSizes,tmp,$table=c.$table,$parent=$table.parent(),marginTop=parseInt($table.css("margin-top"),10),vars=wo.resizable_vars={useStorage:ts.storage&&wo.resizable!==false,$wrap:$parent,mouseXPosition:0,$target:null,$next:null,overflow:$parent.css("overflow")==="auto"||$parent.css("overflow")==="scroll"||$parent.css("overflow-x")==="auto"||$parent.css("overflow-x")==="scroll",storedSizes:[]};ts.resizableReset(c.table,true);vars.tableWidth=$table.width();vars.fullWidth=Math.abs($parent.width()-vars.tableWidth)<20;if(vars.useStorage&&vars.overflow){ts.storage(c.table,"tablesorter-table-original-css-width",vars.tableWidth);tmp=ts.storage(c.table,"tablesorter-table-resized-width")||"auto";ts.resizable.setWidth($table,tmp,true)}wo.resizable_vars.storedSizes=storedSizes=(vars.useStorage?ts.storage(c.table,ts.css.resizableStorage):[])||[];ts.resizable.setWidths(c,wo,storedSizes);ts.resizable.updateStoredSizes(c,wo);wo.$resizable_container=$('<div class="'+ts.css.resizableContainer+'">').css({top:marginTop}).insertBefore($table);for(column=0;column<c.columns;column++){$header=c.$headerIndexed[column];tmp=ts.getColumnData(c.table,c.headers,column);noResize=ts.getData($header,tmp,"resizable")==="false";if(!noResize){$('<div class="'+ts.css.resizableHandle+'">').appendTo(wo.$resizable_container).attr({"data-column":column,unselectable:"on"}).data("header",$header).on("selectstart",false)}}ts.resizable.bindings(c,wo)},updateStoredSizes:function(c,wo){var column,$header,len=c.columns,vars=wo.resizable_vars;vars.storedSizes=[];for(column=0;column<len;column++){$header=c.$headerIndexed[column];vars.storedSizes[column]=$header.is(":visible")?$header.width():0}},setWidth:function($el,width,overflow){$el.css({width:width,"min-width":overflow?width:"","max-width":overflow?width:""})},setWidths:function(c,wo,storedSizes){var column,$temp,vars=wo.resizable_vars,$extra=$(c.namespace+"_extra_headers"),$col=c.$table.children("colgroup").children("col");storedSizes=storedSizes||vars.storedSizes||[];if(storedSizes.length){for(column=0;column<c.columns;column++){ts.resizable.setWidth(c.$headerIndexed[column],storedSizes[column],vars.overflow);if($extra.length){$temp=$extra.eq(column).add($col.eq(column));ts.resizable.setWidth($temp,storedSizes[column],vars.overflow)}}$temp=$(c.namespace+"_extra_table");if($temp.length&&!ts.hasWidget(c.table,"scroller")){ts.resizable.setWidth($temp,c.$table.outerWidth(),vars.overflow)}}},setHandlePosition:function(c,wo){var startPosition,tableHeight=c.$table.height(),$handles=wo.$resizable_container.children(),handleCenter=Math.floor($handles.width()/2);if(ts.hasWidget(c.table,"scroller")){tableHeight=0;c.$table.closest("."+ts.css.scrollerWrap).children().each(function(){var $this=$(this);tableHeight+=$this.filter('[style*="height"]').length?$this.height():$this.children("table").height()})}if(!wo.resizable_includeFooter&&c.$table.children("tfoot").length){tableHeight-=c.$table.children("tfoot").height()}startPosition=parseFloat($.fn.jquery)>=3.3?0:c.$table.position().left;$handles.each(function(){var $this=$(this),column=parseInt($this.attr("data-column"),10),columns=c.columns-1,$header=$this.data("header");if(!$header){return}if(!$header.is(":visible")||!wo.resizable_addLastColumn&&ts.resizable.checkVisibleColumns(c,column)){$this.hide()}else if(column<columns||column===columns&&wo.resizable_addLastColumn){$this.css({display:"inline-block",height:tableHeight,left:$header.position().left-startPosition+$header.outerWidth()-handleCenter})}})},checkVisibleColumns:function(c,column){var i,len=0;for(i=column+1;i<c.columns;i++){len+=c.$headerIndexed[i].is(":visible")?1:0}return len===0},toggleTextSelection:function(c,wo,toggle){var namespace=c.namespace+"tsresize";wo.resizable_vars.disabled=toggle;$("body").toggleClass(ts.css.resizableNoSelect,toggle);if(toggle){$("body").attr("unselectable","on").on("selectstart"+namespace,false)}else{$("body").removeAttr("unselectable").off("selectstart"+namespace)}},bindings:function(c,wo){var namespace=c.namespace+"tsresize";wo.$resizable_container.children().on("mousedown",function(event){var column,vars=wo.resizable_vars,$extras=$(c.namespace+"_extra_headers"),$header=$(event.target).data("header");column=parseInt($header.attr("data-column"),10);vars.$target=$header=$header.add($extras.filter('[data-column="'+column+'"]'));vars.target=column;vars.$next=event.shiftKey||wo.resizable_targetLast?$header.parent().children().not(".resizable-false").filter(":last"):$header.nextAll(":not(.resizable-false)").eq(0);column=parseInt(vars.$next.attr("data-column"),10);vars.$next=vars.$next.add($extras.filter('[data-column="'+column+'"]'));vars.next=column;vars.mouseXPosition=event.pageX;ts.resizable.updateStoredSizes(c,wo);ts.resizable.toggleTextSelection(c,wo,true)});$(document).on("mousemove"+namespace,function(event){var vars=wo.resizable_vars;if(!vars.disabled||vars.mouseXPosition===0||!vars.$target){return}if(wo.resizable_throttle){clearTimeout(vars.timer);vars.timer=setTimeout(function(){ts.resizable.mouseMove(c,wo,event)},isNaN(wo.resizable_throttle)?5:wo.resizable_throttle)}else{ts.resizable.mouseMove(c,wo,event)}}).on("mouseup"+namespace,function(){if(!wo.resizable_vars.disabled){return}ts.resizable.toggleTextSelection(c,wo,false);ts.resizable.stopResize(c,wo);ts.resizable.setHandlePosition(c,wo)});$(window).on("resize"+namespace+" resizeEnd"+namespace,function(){ts.resizable.setHandlePosition(c,wo)});c.$table.on("columnUpdate pagerComplete resizableUpdate ".split(" ").join(namespace+" "),function(){ts.resizable.setHandlePosition(c,wo)}).on("resizableReset"+namespace,function(){ts.resizableReset(c.table)}).find("thead:first").add($(c.namespace+"_extra_table").find("thead:first")).on("contextmenu"+namespace,function(){var allowClick=wo.resizable_vars.storedSizes.length===0;ts.resizableReset(c.table);ts.resizable.setHandlePosition(c,wo);wo.resizable_vars.storedSizes=[];return allowClick})},mouseMove:function(c,wo,event){if(wo.resizable_vars.mouseXPosition===0||!wo.resizable_vars.$target){return}var column,total=0,vars=wo.resizable_vars,$next=vars.$next,tar=vars.storedSizes[vars.target],leftEdge=event.pageX-vars.mouseXPosition;if(vars.overflow){if(tar+leftEdge>0){vars.storedSizes[vars.target]+=leftEdge;ts.resizable.setWidth(vars.$target,vars.storedSizes[vars.target],true);for(column=0;column<c.columns;column++){total+=vars.storedSizes[column]}ts.resizable.setWidth(c.$table.add($(c.namespace+"_extra_table")),total)}if(!$next.length){vars.$wrap[0].scrollLeft=c.$table.width()}}else if(vars.fullWidth){vars.storedSizes[vars.target]+=leftEdge;vars.storedSizes[vars.next]-=leftEdge;ts.resizable.setWidths(c,wo)}else{vars.storedSizes[vars.target]+=leftEdge;ts.resizable.setWidths(c,wo)}vars.mouseXPosition=event.pageX;c.$table.triggerHandler("stickyHeadersUpdate")},stopResize:function(c,wo){var vars=wo.resizable_vars;ts.resizable.updateStoredSizes(c,wo);if(vars.useStorage){ts.storage(c.table,ts.css.resizableStorage,vars.storedSizes);ts.storage(c.table,"tablesorter-table-resized-width",c.$table.width())}vars.mouseXPosition=0;vars.$target=vars.$next=null;c.$table.triggerHandler("stickyHeadersUpdate");c.$table.triggerHandler("resizableComplete")}};ts.addWidget({id:"resizable",priority:40,options:{resizable:true,resizable_addLastColumn:false,resizable_includeFooter:true,resizable_widths:[],resizable_throttle:false,resizable_targetLast:false},init:function(table,thisWidget,c,wo){ts.resizable.init(c,wo)},format:function(table,c,wo){ts.resizable.setHandlePosition(c,wo)},remove:function(table,c,wo,refreshing){if(wo.$resizable_container){var namespace=c.namespace+"tsresize";c.$table.add($(c.namespace+"_extra_table")).removeClass("hasResizable").children("thead").off("contextmenu"+namespace);wo.$resizable_container.remove();ts.resizable.toggleTextSelection(c,wo,false);ts.resizableReset(table,refreshing);$(document).off("mousemove"+namespace+" mouseup"+namespace)}}});ts.resizableReset=function(table,refreshing){$(table).each(function(){var index,$t,c=this.config,wo=c&&c.widgetOptions,vars=wo.resizable_vars;if(table&&c&&c.$headerIndexed.length){if(vars.overflow&&vars.tableWidth){ts.resizable.setWidth(c.$table,vars.tableWidth,true);if(vars.useStorage){ts.storage(table,"tablesorter-table-resized-width",vars.tableWidth)}}for(index=0;index<c.columns;index++){$t=c.$headerIndexed[index];if(wo.resizable_widths&&wo.resizable_widths[index]){ts.resizable.setWidth($t,wo.resizable_widths[index],vars.overflow)}else if(!$t.hasClass("resizable-false")){ts.resizable.setWidth($t,"",vars.overflow)}}c.$table.triggerHandler("stickyHeadersUpdate");if(ts.storage&&!refreshing){ts.storage(this,ts.css.resizableStorage,[])}}})}})(jQuery,window);(function($){"use strict";var ts=$.tablesorter||{};function getStoredSortList(c){var stored=ts.storage(c.table,"tablesorter-savesort");return stored&&stored.hasOwnProperty("sortList")&&Array.isArray(stored.sortList)?stored.sortList:[]}function sortListChanged(c,sortList){return(sortList||getStoredSortList(c)).join(",")!==c.sortList.join(",")}ts.addWidget({id:"saveSort",priority:20,options:{saveSort:true},init:function(table,thisWidget,c,wo){thisWidget.format(table,c,wo,true)},format:function(table,c,wo,init){var time,$table=c.$table,saveSort=wo.saveSort!==false,sortList={sortList:c.sortList},debug=ts.debug(c,"saveSort");if(debug){time=new Date}if($table.hasClass("hasSaveSort")){if(saveSort&&table.hasInitialized&&ts.storage&&sortListChanged(c)){ts.storage(table,"tablesorter-savesort",sortList);if(debug){console.log("saveSort >> Saving last sort: "+c.sortList+ts.benchmark(time))}}}else{$table.addClass("hasSaveSort");sortList="";if(ts.storage){sortList=getStoredSortList(c);if(debug){console.log('saveSort >> Last sort loaded: "'+sortList+'"'+ts.benchmark(time))}$table.on("saveSortReset",function(event){event.stopPropagation();ts.storage(table,"tablesorter-savesort","")})}if(init&&sortList&&sortList.length>0){c.sortList=sortList}else if(table.hasInitialized&&sortList&&sortList.length>0){if(sortListChanged(c,sortList)){ts.sortOn(c,sortList)}}}},remove:function(table,c){c.$table.removeClass("hasSaveSort");if(ts.storage){ts.storage(table,"tablesorter-savesort","")}}})})(jQuery);return jQuery.tablesorter}); |