(function(n){"use strict";var o=null,i=function(n){var i=arguments,t=!0,r=1;return n=n.replace(/%s/g,function(){var n=i[r++];return typeof n=="undefined"?(t=!1,""):n}),t?n:""},v=function(t,i,r,u){var f="";return n.each(t,function(n,t){return t[i]===u?(f=t[r],!1):!0}),f},u=function(t,i){var r=-1;return n.each(t,function(n,t){return t.field===i?(r=n,!1):!0}),r},y=function(t){for(var r,u,s=0,f=[],i=0;i").addClass("fixed-table-scroll-inner"),t=n("
").addClass("fixed-table-scroll-outer"),u,i;t.append(r);n("body").append(t);u=r[0].offsetWidth;t.css("overflow","scroll");i=r[0].offsetWidth;u===i&&(i=t[0].clientWidth);t.remove();o=u-i}return o},r=function(t,r,u,f){var e=r,o;return(typeof r=="string"&&(o=r.split("."),o.length>1?(e=window,n.each(o,function(n,t){e=e[t]})):e=window[r]),typeof e=="object")?e:typeof e=="function"?e.apply(t,u||[]):!e&&typeof r=="string"&&i.apply(this,[r].concat(u))?i.apply(this,[r].concat(u)):f},c=function(t,i,r){var e=Object.getOwnPropertyNames(t),o=Object.getOwnPropertyNames(i),u="",f;if(r&&e.length!==o.length)return!1;for(f=0;f-1&&t[u]!==i[u])return!1;return!0},f=function(n){return typeof n=="string"?n.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/`/g,"`"):n},l=function(n){var t,i;for(t in n)i=t.split(/(?=[A-Z])/).join("-").toLowerCase(),i!==t&&(n[i]=n[t],delete n[t]);return n},e=function(n,t,i){var r=n,u,e;if(typeof t!="string"||n.hasOwnProperty(t))return i?f(n[t]):n[t];u=t.split(".");for(e in u)u.hasOwnProperty(e)&&(r=r&&r[u[e]]);return i?f(r):r},a=function(){return!!(navigator.userAgent.indexOf("MSIE ")>0||!!navigator.userAgent.match(/Trident.*rv\:11\./))},p=function(){Object.keys||(Object.keys=function(){var t=Object.prototype.hasOwnProperty,i=!{toString:null}.propertyIsEnumerable("toString"),n=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],r=n.length;return function(u){if(typeof u!="object"&&(typeof u!="function"||u===null))throw new TypeError("Object.keys called on non-object");var e=[],o,f;for(o in u)t.call(u,o)&&e.push(o);if(i)for(f=0;f','
<\/div>',this.options.paginationVAlign==="top"||this.options.paginationVAlign==="both"?'
<\/div>':"",'
','
<\/table><\/div>','
','
',this.options.formatLoadingMessage(),"<\/div>","<\/div>",'
<\/tr><\/table><\/div>',this.options.paginationVAlign==="bottom"||this.options.paginationVAlign==="both"?'
<\/div>':"","<\/div>","<\/div>"].join(""));this.$container.insertAfter(this.$el);this.$tableContainer=this.$container.find(".fixed-table-container");this.$tableHeader=this.$container.find(".fixed-table-header");this.$tableBody=this.$container.find(".fixed-table-body");this.$tableLoading=this.$container.find(".fixed-table-loading");this.$tableFooter=this.$container.find(".fixed-table-footer");this.$toolbar=this.$container.find(".fixed-table-toolbar");this.$pagination=this.$container.find(".fixed-table-pagination");this.$tableBody.append(this.$el);this.$el.addClass(this.options.classes);this.options.striped&&this.$el.addClass("table-striped");n.inArray("table-no-bordered",this.options.classes.split(" "))!==-1&&this.$tableContainer.addClass("table-no-bordered")};t.prototype.initTable=function(){var r=this,f=[],u=[],i;(this.$header=this.$el.find(">thead"),this.$header.length||(this.$header=n("
<\/thead>").appendTo(this.$el)),this.$header.find("tr").each(function(){var t=[];n(this).find("th").each(function(){typeof n(this).data("field")!="undefined"&&n(this).data("field",n(this).data("field")+"");t.push(n.extend({},{title:n(this).html(),"class":n(this).attr("class"),titleTooltip:n(this).attr("title"),rowspan:n(this).attr("rowspan")?+n(this).attr("rowspan"):undefined,colspan:n(this).attr("colspan")?+n(this).attr("colspan"):undefined},n(this).data()))});f.push(t)}),n.isArray(this.options.columns[0])||(this.options.columns=[this.options.columns]),this.options.columns=n.extend(!0,[],f,this.options.columns),this.columns=[],y(this.options.columns),n.each(this.options.columns,function(i,u){n.each(u,function(u,f){f=n.extend({},t.COLUMN_DEFAULTS,f);typeof f.fieldIndex!="undefined"&&(r.columns[f.fieldIndex]=f);r.options.columns[i][u]=f})}),this.options.data.length)||(i=[],this.$el.find(">tbody>tr").each(function(t){var f={};f._id=n(this).attr("id");f._class=n(this).attr("class");f._data=l(n(this).data());n(this).find(">td").each(function(u){for(var h=n(this),c=+h.attr("colspan")||1,a=+h.attr("rowspan")||1,s,o,e;i[t]&&i[t][u];u++);for(s=u;s");e===0&&!t.options.cardView&&t.options.detailView&&r.push(i('<\/tbody>").appendTo(this.$el)),this.options.pagination&&this.options.sidePagination!=="server"||(this.pageFrom=1,this.pageTo=o.length),s=n(document.createDocumentFragment()),h=this.pageFrom-1;h'+i('
<\/div><\/th>',t.options.columns.length));n.each(o,function(n,e){var o="",c="",l="",s="",a=i(' class="%s"',e["class"]),y=t.options.sortOrder||e.order,v="px",h=e.width;if(e.width===undefined||t.options.cardView||typeof e.width=="string"&&e.width.indexOf("%")!==-1&&(v="%"),e.width&&typeof e.width=="string"&&(h=e.width.replace("%","").replace("px","")),c=i("text-align: %s; ",e.halign?e.halign:e.align),l=i("text-align: %s; ",e.align),s=i("vertical-align: %s; ",e.valign),s+=i("width: %s; ",(e.checkbox||e.radio)&&!h?"36px":h?h+v:undefined),typeof e.fieldIndex!="undefined"){if(t.header.fields[e.fieldIndex]=e.field,t.header.styles[e.fieldIndex]=l+s,t.header.classes[e.fieldIndex]=a,t.header.formatters[e.fieldIndex]=e.formatter,t.header.events[e.fieldIndex]=e.events,t.header.sorters[e.fieldIndex]=e.sorter,t.header.sortNames[e.fieldIndex]=e.sortName,t.header.cellStyles[e.fieldIndex]=e.cellStyle,t.header.searchables[e.fieldIndex]=e.searchable,!e.visible)return;if(t.options.cardView&&!e.cardVisible)return;u[e.field]=e}r.push("");r.push(i('
',t.options.sortable&&e.sortable?"sortable both":""));o=t.options.escape?f(e.title):e.title;e.checkbox&&(!t.options.singleSelect&&t.options.checkboxHeader&&(o=''),t.header.stateField=e.field);e.radio&&(o="",t.header.stateField=e.field,t.options.singleSelect=!0);r.push(o);r.push("<\/div>");r.push('
<\/div>');r.push("<\/div>");r.push("<\/th>")});r.push("<\/tr>")});this.$header.html(r.join(""));this.$header.find("th[data-field]").each(function(){n(this).data(u[n(this).data("field")])});this.$container.off("click",".th-inner").on("click",".th-inner",function(i){var r=n(this);if(t.options.detailView&&r.closest(".bootstrap-table")[0]!==t.$container[0])return!1;if(t.options.sortable&&r.parent().data().sortable)t.onSort(i)});this.$header.children().children().off("keypress").on("keypress",function(i){if(t.options.sortable&&n(this).data().sortable){var r=i.keyCode||i.which;if(r==13)t.onSort(i)}});if(n(window).off("resize.bootstrap-table"),!this.options.showHeader||this.options.cardView)this.$header.hide(),this.$tableHeader.hide(),this.$tableLoading.css("top",0);else{this.$header.show();this.$tableHeader.show();this.$tableLoading.css("top",this.$header.outerHeight()+1);this.getCaret();n(window).on("resize.bootstrap-table",n.proxy(this.resetWidth,this))}this.$selectAll=this.$header.find('[name="btSelectAll"]');this.$selectAll.off("click").on("click",function(){var i=n(this).prop("checked");t[i?"checkAll":"uncheckAll"]();t.updateSelected()})};t.prototype.initFooter=function(){!this.options.showFooter||this.options.cardView?this.$tableFooter.hide():this.$tableFooter.show()};t.prototype.initData=function(n,t){(this.data=t==="append"?this.data.concat(n):t==="prepend"?[].concat(n).concat(this.data):n||this.options.data,this.options.data=t==="append"?this.options.data.concat(n):t==="prepend"?[].concat(n).concat(this.options.data):this.data,this.options.sidePagination!=="server")&&this.initSort()};t.prototype.initSort=function(){var t=this,o=this.options.sortName,u=this.options.sortOrder==="desc"?-1:1,f=n.inArray(this.options.sortName,this.header.fields),s=0;if(this.options.customSort!==n.noop){this.options.customSort.apply(this,[this.options.sortName,this.options.sortOrder]);return}f!==-1&&(this.options.sortStable&&n.each(this.data,function(n,t){t.hasOwnProperty("_position")||(t._position=n)}),this.data.sort(function(i,s){t.header.sortNames[f]&&(o=t.header.sortNames[f]);var h=e(i,o,t.options.escape),c=e(s,o,t.options.escape),l=r(t.header,t.header.sorters[f],[h,c]);return l!==undefined?u*l:((h===undefined||h===null)&&(h=""),(c===undefined||c===null)&&(c=""),t.options.sortStable&&h===c&&(h=i._position,c=s._position),n.isNumeric(h)&&n.isNumeric(c))?(h=parseFloat(h),c=parseFloat(c),h<\/div>',this.options.toolbarAlign)).appendTo(this.$toolbar).append(n(this.options.toolbar)),t=[i('
',this.options.buttonsAlign,this.options.buttonsAlign)],typeof this.options.icons=="string"&&(this.options.icons=r(null,this.options.icons)),this.options.showPaginationSwitch&&t.push(i('
',this.header.fields.length)),!this.options.cardView&&this.options.detailView&&h.push("
",'',i('<\/i>',this.options.iconsPrefix,this.options.icons.detailOpen),"<\/a>","<\/td>"),n.each(this.header.fields,function(c,l){var d="",w=e(t,l,o.options.escape),y="",k="",b={},it="",g=o.header.classes[c],rt="",ut="",ft="",et="",p=o.columns[c],nt,tt;if((!o.fromHtml||typeof w!="undefined")&&p.visible&&(!o.options.cardView||p.cardVisible)){if(p.escape&&(w=f(w)),s=i('style="%s"',a.concat(o.header.styles[c]).join("; ")),t["_"+l+"_id"]&&(it=i(' id="%s"',t["_"+l+"_id"])),t["_"+l+"_class"]&&(g=i(' class="%s"',t["_"+l+"_class"])),t["_"+l+"_rowspan"]&&(ut=i(' rowspan="%s"',t["_"+l+"_rowspan"])),t["_"+l+"_colspan"]&&(ft=i(' colspan="%s"',t["_"+l+"_colspan"])),t["_"+l+"_title"]&&(et=i(' title="%s"',t["_"+l+"_title"])),b=r(o.header,o.header.cellStyles[c],[w,t,u,l],b),b.classes&&(g=i(' class="%s"',b.classes)),b.css){nt=[];for(tt in b.css)nt.push(tt+": "+b.css[tt]);s=i('style="%s"',nt.concat(o.header.styles[c]).join("; "))}y=r(p,o.header.formatters[c],[w,t,u],w);t["_"+l+"_data"]&&!n.isEmptyObject(t["_"+l+"_data"])&&n.each(t["_"+l+"_data"],function(n,t){n!=="index"&&(rt+=i(' data-%s="%s"',n,t))});p.checkbox||p.radio?(k=p.checkbox?"checkbox":k,k=p.radio?"radio":k,d=[i(o.options.cardView?'
':'
',p["class"]||""),"",o.header.formatters[c]&&typeof y=="string"?y:"",o.options.cardView?"<\/div>":"<\/td>"].join(""),t[o.header.stateField]=y===!0||y&&y.checked):(y=typeof y=="undefined"||y===null?o.options.undefinedText:y,d=o.options.cardView?['
',o.options.showHeader?i('%s<\/span>',s,v(o.columns,"field","title",l)):"",i('%s<\/span>',y),"<\/div>"].join(""):[i("",it,g,s,rt,ut,ft,et),y,"<\/td>"].join(""),o.options.cardView&&o.options.smartDisplay&&y===""&&(d='
<\/div>'));h.push(d)}}),this.options.cardView&&h.push("<\/div><\/td>"),h.push("<\/tr>"),h.join(" ")}};t.prototype.initBody=function(t){var f=this,o=this.getData(),s,l,h,a,c;for(this.trigger("pre-body",o),this.$body=this.$el.find(">tbody"),this.$body.length||(this.$body=n("
%s<\/td>',this.$header.find("th").length,this.options.formatNoMatches())+"<\/tr>");this.$body.html(s);t||this.scrollTo(0);this.$body.find("> tr[data-index] > td").off("click dblclick").on("click dblclick",function(t){var r=n(this),s=r.parent(),h=f.data[s.data("index")],l=r[0].cellIndex,a=f.getVisibleFields(),o=a[f.options.detailView&&!f.options.cardView?l-1:l],v=f.columns[u(f.columns,o)],y=e(h,o,f.options.escape),c;r.find(".detail-icon").length||(f.trigger(t.type==="click"?"click-cell":"dbl-click-cell",o,y,h,r),f.trigger(t.type==="click"?"click-row":"dbl-click-row",h,s,o),t.type==="click"&&f.options.clickToSelect&&v.clickToSelect&&(c=s.find(i('[name="%s"]',f.options.selectItemName)),c.length&&c[0].click()))});this.$body.find("> tr[data-index] > td > .detail-icon").off("click").on("click",function(){var s=n(this),t=s.parent().parent(),e=t.data("index"),h=o[e],u,c;return t.next().is("tr.detail-view")?(s.find("i").attr("class",i("%s %s",f.options.iconsPrefix,f.options.icons.detailOpen)),t.next().remove(),f.trigger("collapse-row",e,h)):(s.find("i").attr("class",i("%s %s",f.options.iconsPrefix,f.options.icons.detailClose)),t.after(i('
<\/td><\/tr>',t.find("td").length)),u=t.next().find("td"),c=r(f.options,f.options.detailFormatter,[e,h,u],""),u.length===1&&u.append(c),f.trigger("expand-row",e,h,u)),f.resetView(),!1});this.$selectItem=this.$body.find(i('[name="%s"]',this.options.selectItemName));this.$selectItem.off("click").on("click",function(t){t.stopImmediatePropagation();var i=n(this),r=i.prop("checked"),u=f.data[i.data("index")];f.options.maintainSelected&&n(this).is(":radio")&&n.each(f.options.data,function(n,t){t[f.header.stateField]=!1});u[f.header.stateField]=r;f.options.singleSelect&&(f.$selectItem.not(this).each(function(){f.data[n(this).data("index")][f.header.stateField]=!1}),f.$selectItem.filter(":checked").not(this).prop("checked",!1));f.updateSelected();f.trigger(r?"check":"uncheck",u,i)});n.each(this.header.events,function(t,i){var e,o,u;if(i){typeof i=="string"&&(i=r(null,i));e=f.header.fields[t];o=n.inArray(e,f.getVisibleFields());f.options.detailView&&!f.options.cardView&&(o+=1);for(u in i)f.$body.find(">tr:not(.no-records-found)").each(function(){var t=n(this),h=t.find(f.options.cardView?".card-view":"td").eq(o),r=u.indexOf(" "),s=u.substring(0,r),c=u.substring(r+1),l=i[u];h.find(c).off(s).on(s,function(n){var i=t.data("index"),r=f.data[i],u=r[e];l.apply(this,[n,u,r,i])})})}});this.updateSelected();this.resetView();this.trigger("post-body",o)};t.prototype.initServer=function(t,i,u){var e=this,o={},f={searchText:this.searchText,sortName:this.options.sortName,sortOrder:this.options.sortOrder},s;(this.options.pagination&&(f.pageSize=this.options.pageSize===this.options.formatAllRows()?this.options.totalRows:this.options.pageSize,f.pageNumber=this.options.pageNumber),u||this.options.url||this.options.ajax)&&(this.options.queryParamsType==="limit"&&(f={search:f.searchText,sort:f.sortName,order:f.sortOrder},this.options.pagination&&(f.offset=this.options.pageSize===this.options.formatAllRows()?0:this.options.pageSize*(this.options.pageNumber-1),f.limit=this.options.pageSize===this.options.formatAllRows()?this.options.totalRows:this.options.pageSize)),n.isEmptyObject(this.filterColumnsPartial)||(f.filter=JSON.stringify(this.filterColumnsPartial,null)),o=r(this.options,this.options.queryParams,[f],o),n.extend(o,i||{}),o!==!1)&&(t||this.$tableLoading.show(),s=n.extend({},r(null,this.options.ajaxOptions),{type:this.options.method,url:u||this.options.url,data:this.options.contentType==="application/json"&&this.options.method==="post"?JSON.stringify(o):o,cache:this.options.cache,contentType:this.options.contentType,dataType:this.options.dataType,success:function(n){n=r(e.options,e.options.responseHandler,[n],n);e.load(n);e.trigger("load-success",n);t||e.$tableLoading.hide()},error:function(n){e.trigger("load-error",n.status,n);t||e.$tableLoading.hide()}}),this.options.ajax?r(this,this.options.ajax,[s],null):(this._xhr&&this._xhr.readyState!==4&&this._xhr.abort(),this._xhr=n.ajax(s)))};t.prototype.initSearchText=function(){if(this.options.search&&this.options.searchText!==""){var n=this.$toolbar.find(".search input");n.val(this.options.searchText);this.onSearch({currentTarget:n})}};t.prototype.getCaret=function(){var t=this;n.each(this.$header.find("th"),function(i,r){n(r).find(".sortable").removeClass("desc asc").addClass(n(r).data("field")===t.options.sortName?t.options.sortOrder:"both")})};t.prototype.updateSelected=function(){var t=this.$selectItem.filter(":enabled").length&&this.$selectItem.filter(":enabled").length===this.$selectItem.filter(":enabled").filter(":checked").length;this.$selectAll.add(this.$selectAll_).prop("checked",t);this.$selectItem.each(function(){n(this).closest("tr")[n(this).prop("checked")?"addClass":"removeClass"]("selected")});this.$fixedBodyColumns!=undefined&&this.$fixedBodyColumns.eq(0).find("input[name=btSelectItem]").each(function(){n(this).closest("tr")[n(this).prop("checked")?"addClass":"removeClass"]("selected")})};t.prototype.updateRows=function(){var t=this;this.$selectItem.each(function(){t.data[n(this).data("index")][t.header.stateField]=n(this).prop("checked")});this.$fixedBodyColumns!=undefined&&this.$fixedBodyColumns.eq(0).find("input[name=btSelectItem]").each(function(){t.data[n(this).data("index")][t.header.stateField]=n(this).prop("checked")})};t.prototype.resetRows=function(){var t=this;n.each(this.data,function(n,i){t.$selectAll.prop("checked",!1);t.$selectItem.prop("checked",!1);t.header.stateField&&(i[t.header.stateField]=!1)});this.initHiddenRows()};t.prototype.trigger=function(i){var r=Array.prototype.slice.call(arguments,1);i+=".bs.table";this.options[t.EVENTS[i]].apply(this.options,r);this.$el.trigger(n.Event(i),r);this.options.onAll(i,r);this.$el.trigger(n.Event("all.bs.table"),[i,r])};t.prototype.resetHeader=function(){clearTimeout(this.timeoutId_);this.timeoutId_=setTimeout(n.proxy(this.fitHeader,this),this.$el.is(":hidden")?100:0)};t.prototype.fitHeader=function(){var t=this,r,c,u,f,e,o,s,l,a;if(t.$el.is(":hidden")){t.timeoutId_=setTimeout(n.proxy(t.fitHeader,t),100);return}r=this.$tableBody.get(0);c=r.scrollWidth>r.clientWidth&&r.scrollHeight>r.clientHeight+this.$header.outerHeight()?h():0;this.$el.css("margin-top",-this.$header.outerHeight());u=n(":focus");u.length>0&&(e=u.parents("th"),e.length>0&&(o=e.attr("data-field"),o!==undefined&&(s=this.$header.find("[data-field='"+o+"']"),s.length>0&&s.find(":input").addClass("focus-temp"))));this.$header_=this.$header.clone(!0,!0);this.$selectAll_=this.$header_.find('[name="btSelectAll"]');this.$tableHeader.css({"margin-right":c}).find("table").css("width",this.$el.outerWidth()).html("").attr("class",this.$el.attr("class")).append(this.$header_);f=n(".focus-temp:visible:eq(0)");f.length>0&&(f.focus(),this.$header.find(".focus-temp").removeClass("focus-temp"));this.$header.find("th[data-field]").each(function(){t.$header_.find(i('th[data-field="%s"]',n(this).data("field"))).data(n(this).data())});l=this.getVisibleFields();a=this.$header_.find("th");this.$body.find(">tr:first-child:not(.no-records-found) > *").each(function(r){var f=n(this),e=r,u;t.options.detailView&&!t.options.cardView&&(r===0&&t.$header_.find("th.detail").find(".fht-cell").width(f.innerWidth()),e=r-1);u=t.$header_.find(i('th[data-field="%s"]',l[e]));u.length>1&&(u=n(a[f[0].cellIndex]));u.find(".fht-cell").width(f.innerWidth())});this.$tableBody.off("scroll").on("scroll",function(){t.$tableHeader.scrollLeft(n(this).scrollLeft());t.options.showFooter&&!t.options.cardView&&t.$tableFooter.scrollLeft(n(this).scrollLeft())});t.trigger("post-header")};t.prototype.resetFooter=function(){var u=this,f=u.getData(),t=[];this.options.showFooter&&!this.options.cardView&&(!this.options.cardView&&this.options.detailView&&t.push('
 <\/div>
<\/div><\/td>'),n.each(this.columns,function(n,e){var s,h="",c="",l=[],o={},a=i(' class="%s"',e["class"]);if(e.visible&&(!u.options.cardView||e.cardVisible)){if(h=i("text-align: %s; ",e.falign?e.falign:e.align),c=i("vertical-align: %s; ",e.valign),o=r(null,u.options.footerStyle),o&&o.css)for(s in o.css)l.push(s+": "+o.css[s]);t.push("");t.push('
');t.push(r(e,e.footerFormatter,[f]," ")||" ");t.push("<\/div>");t.push('
<\/div>');t.push("<\/div>");t.push("<\/td>")}}),this.$tableFooter.find("tr").html(t.join("")),this.$tableFooter.show(),clearTimeout(this.timeoutFooter_),this.timeoutFooter_=setTimeout(n.proxy(this.fitFooter,this),this.$el.is(":hidden")?100:0))};t.prototype.fitFooter=function(){var u=this,i,t,r;if(clearTimeout(this.timeoutFooter_),this.$el.is(":hidden")){this.timeoutFooter_=setTimeout(n.proxy(this.fitFooter,this),100);return}t=this.$el.css("width");r=t>this.$tableBody.width()?h():0;this.$tableFooter.css({"margin-right":r}).find("table").css("width",t).attr("class",this.$el.attr("class"));i=this.$tableFooter.find("td");this.$body.find(">tr:first-child:not(.no-records-found) > *").each(function(t){var r=n(this);i.eq(t).find(".fht-cell").width(r.innerWidth())})};t.prototype.toggleColumn=function(n,t,r){if(n!==-1&&(this.columns[n].visible=t,this.initHeader(),this.initSearch(),this.initPagination(),this.initBody(),this.options.showColumns)){var u=this.$toolbar.find(".keep-open input").prop("disabled",!1);r&&u.filter(i('[value="%s"]',n)).prop("checked",t);u.filter(":checked").length<=this.options.minimumCountColumns&&u.filter(":checked").prop("disabled",!0)}};t.prototype.getVisibleFields=function(){var t=this,i=[];return n.each(this.header.fields,function(n,r){var f=t.columns[u(t.columns,r)];f.visible&&i.push(r)}),i};t.prototype.resetView=function(t){var i=0;if(t&&t.height&&(this.options.height=t.height),this.$selectAll.prop("checked",this.$selectItem.length>0&&this.$selectItem.length===this.$selectItem.filter(":checked").length),this.options.height)if(this.options.height=="auto")this.$tableContainer.css("height",n(window).height()-n(n(this.$el).parent().parent()).offset().top-this.$toolbar.outerHeight(!0)+this.options.heightOffset-60+"px");else if(this.options.height=="newAuto")this.$tableContainer.css("height",n(window).height()-n(n(this.$el).parent().parent()).offset().top-this.$toolbar.outerHeight(!0)+this.options.heightOffset-90+"px");else if(this.options.height=="newAutoPool")this.$tableContainer.css("height",n(window).height()-n(n(this.$el).parent().parent()).offset().top-this.$toolbar.outerHeight(!0)+this.options.heightOffset-110+"px");else{var r=this.$toolbar.outerHeight(!0),u=this.$pagination.outerHeight(!0),f=this.options.height-r-u;this.$tableContainer.css("height",f+"px")}if(this.options.cardView){this.$el.css("margin-top","0");this.$tableContainer.css("padding-bottom","0");this.$tableFooter.hide();return}this.options.showHeader&&this.options.height?(this.$tableHeader.show(),this.resetHeader(),i+=this.$header.outerHeight()):(this.$tableHeader.hide(),this.trigger("post-header"));this.options.showFooter&&(this.resetFooter(),this.options.height&&(i+=this.$tableFooter.outerHeight()+1));this.getCaret();this.$tableContainer.css("padding-bottom","32px");this.trigger("reset-view")};t.prototype.getData=function(t){return this.searchText||!n.isEmptyObject(this.filterColumns)||!n.isEmptyObject(this.filterColumnsPartial)?t?this.data.slice(this.pageFrom-1,this.pageTo):this.data:t?this.options.data.slice(this.pageFrom-1,this.pageTo):this.options.data};t.prototype.load=function(t){var i=!1;this.options.sidePagination==="server"?(this.options.totalRows=t[this.options.totalField],i=t.fixedScroll,t=t[this.options.dataField]):n.isArray(t)||(i=t.fixedScroll,t=t.data);t==null?this.initData([]):this.initData(t);this.initSearch();this.initPagination();this.initBody(i)};t.prototype.append=function(n){this.initData(n,"append");this.initSearch();this.initPagination();this.initSort();this.initBody(!0)};t.prototype.prepend=function(n){this.initData(n,"prepend");this.initSearch();this.initPagination();this.initSort();this.initBody(!0)};t.prototype.remove=function(t){var u=this.options.data.length,i,r;if(t.hasOwnProperty("field")&&t.hasOwnProperty("values")){for(i=u-1;i>=0;i--)(r=this.options.data[i],r.hasOwnProperty(t.field))&&n.inArray(r[t.field],t.values)!==-1&&(this.options.data.splice(i,1),this.options.sidePagination==="server"&&(this.options.totalRows-=1));u!==this.options.data.length&&(this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0))}};t.prototype.removeAll=function(){this.options.data.length>0&&(this.options.data.splice(0,this.options.data.length),this.initSearch(),this.initPagination(),this.initBody(!0))};t.prototype.getRowByUniqueId=function(n){for(var r=this.options.uniqueId,e=this.options.data.length,f=null,i,t,u=e-1;u>=0;u--){if(i=this.options.data[u],i.hasOwnProperty(r))t=i[r];else if(i._data.hasOwnProperty(r))t=i._data[r];else continue;if(typeof t=="string"?n=n.toString():typeof t=="number"&&(Number(t)===t&&t%1==0?n=parseInt(n):t===Number(t)&&t!==0&&(n=parseFloat(n))),t===n){f=i;break}}return f};t.prototype.removeByUniqueId=function(n){var i=this.options.data.length,t=this.getRowByUniqueId(n);(t&&this.options.data.splice(this.options.data.indexOf(t),1),i!==this.options.data.length)&&(this.initSearch(),this.initPagination(),this.initBody(!0))};t.prototype.updateByUniqueId=function(t){var i=this,r=n.isArray(t)?t:[t];n.each(r,function(t,r){var u;r.hasOwnProperty("id")&&r.hasOwnProperty("row")&&(u=n.inArray(i.getRowByUniqueId(r.id),i.options.data),u!==-1)&&n.extend(i.options.data[u],r.row)});this.initSearch();this.initPagination();this.initSort();this.initBody(!0)};t.prototype.insertRow=function(n){n.hasOwnProperty("index")&&n.hasOwnProperty("row")&&(this.data.splice(n.index,0,n.row),this.initSearch(),this.initPagination(),this.initSort(),this.initBody(!0))};t.prototype.updateRow=function(t){var i=this,r=n.isArray(t)?t:[t];n.each(r,function(t,r){r.hasOwnProperty("index")&&r.hasOwnProperty("row")&&n.extend(i.options.data[r.index],r.row)});this.initSearch();this.initPagination();this.initSort();this.initBody(!0)};t.prototype.initHiddenRows=function(){this.hiddenRows=[]};t.prototype.showRow=function(n){this.toggleRow(n,!0)};t.prototype.hideRow=function(n){this.toggleRow(n,!1)};t.prototype.toggleRow=function(t,i){var r,u;(t.hasOwnProperty("index")?r=this.getData()[t.index]:t.hasOwnProperty("uniqueId")&&(r=this.getRowByUniqueId(t.uniqueId)),r)&&(u=n.inArray(r,this.hiddenRows),i||u!==-1?i&&u>-1&&this.hiddenRows.splice(u,1):this.hiddenRows.push(r),this.initBody(!0))};t.prototype.getHiddenRows=function(){var i=this,r=this.getData(),t=[];return n.each(r,function(r,u){n.inArray(u,i.hiddenRows)>-1&&t.push(u)}),this.hiddenRows=t,t};t.prototype.mergeCells=function(t){var i=t.index,r=n.inArray(t.field,this.getVisibleFields()),e=t.rowspan||1,o=t.colspan||1,u,f,s=this.$body.find(">tr"),h;if(this.options.detailView&&!this.options.cardView&&(r+=1),h=s.eq(i).find(">td").eq(r),!(i<0)&&!(r<0)&&!(i>=this.data.length)){for(u=i;utd").eq(f).hide();h.attr("rowspan",e).attr("colspan",o).show()}};t.prototype.updateCell=function(n){n.hasOwnProperty("index")&&n.hasOwnProperty("field")&&n.hasOwnProperty("value")&&(this.data[n.index][n.field]=n.value,n.reinit!==!1)&&(this.initSort(),this.initBody(!0))};t.prototype.getOptions=function(){return this.options};t.prototype.getSelections=function(){var t=this;return n.grep(this.options.data,function(n){return n[t.header.stateField]===!0})};t.prototype.getAllSelections=function(){var t=this;return n.grep(this.options.data,function(n){return n[t.header.stateField]})};t.prototype.checkAll=function(){this.checkAll_(!0)};t.prototype.uncheckAll=function(){this.checkAll_(!1)};t.prototype.checkInvert=function(){var t=this,r=t.$selectItem.filter(":enabled"),i=r.filter(":checked");r.each(function(){n(this).prop("checked",!n(this).prop("checked"))});t.updateRows();t.updateSelected();t.trigger("uncheck-some",i);i=t.getSelections();t.trigger("check-some",i)};t.prototype.checkAll_=function(n){var t;n||(t=this.getSelections());this.$selectAll.add(this.$selectAll_).prop("checked",n);this.$selectItem.filter(":enabled").prop("checked",n);this.$fixedBodyColumns!=undefined&&this.$fixedBodyColumns.eq(0).find("input[name=btSelectItem]").filter(":enabled").prop("checked",n);this.updateRows();n&&(t=this.getSelections());this.trigger(n?"check-all":"uncheck-all",t)};t.prototype.check=function(n){this.check_(!0,n)};t.prototype.uncheck=function(n){this.check_(!1,n)};t.prototype.check_=function(n,t){var r=this.$selectItem.filter(i('[data-index="%s"]',t)).prop("checked",n);this.data[t][this.header.stateField]=n;this.updateSelected();this.trigger(n?"check":"uncheck",this.data[t],r)};t.prototype.checkBy=function(n){this.checkBy_(!0,n)};t.prototype.uncheckBy=function(n){this.checkBy_(!1,n)};t.prototype.checkBy_=function(t,r){if(r.hasOwnProperty("field")&&r.hasOwnProperty("values")){var u=this,f=[];n.each(this.options.data,function(e,o){if(!o.hasOwnProperty(r.field))return!1;if(n.inArray(o[r.field],r.values)!==-1){var s=u.$selectItem.filter(":enabled").filter(i('[data-index="%s"]',e)).prop("checked",t);o[u.header.stateField]=t;f.push(o);u.trigger(t?"check":"uncheck",o,s)}});this.updateSelected();this.trigger(t?"check-some":"uncheck-some",f)}};t.prototype.destroy=function(){this.$el.insertBefore(this.$container);n(this.options.toolbar).insertBefore(this.$el);this.$container.next().not(".sumNumWrap").remove();this.$container.remove();this.$el.html(this.$el_.html()).css("margin-top","0").attr("class",this.$el_.attr("class")||"")};t.prototype.showLoading=function(){this.$tableLoading.show()};t.prototype.hideLoading=function(){this.$tableLoading.hide()};t.prototype.togglePagination=function(){this.options.pagination=!this.options.pagination;var n=this.$toolbar.find('button[name="paginationSwitch"] i');this.options.pagination?n.attr("class",this.options.iconsPrefix+" "+this.options.icons.paginationSwitchDown):n.attr("class",this.options.iconsPrefix+" "+this.options.icons.paginationSwitchUp);this.updatePagination()};t.prototype.refresh=function(n){n&&n.url&&(this.options.url=n.url);n&&n.pageNumber&&(this.options.pageNumber=n.pageNumber);n&&n.pageSize&&(this.options.pageSize=n.pageSize);this.initServer(n&&n.silent,n&&n.query,n&&n.url);this.trigger("refresh",n)};t.prototype.resetWidth=function(){this.options.showHeader&&this.options.height&&this.fitHeader();this.options.showFooter&&this.fitFooter()};t.prototype.showColumn=function(n){this.toggleColumn(u(this.columns,n),!0,!0)};t.prototype.hideColumn=function(n){this.toggleColumn(u(this.columns,n),!1,!0)};t.prototype.getHiddenColumns=function(){return n.grep(this.columns,function(n){return!n.visible})};t.prototype.getVisibleColumns=function(){return n.grep(this.columns,function(n){return n.visible})};t.prototype.toggleAllColumns=function(t){if(n.each(this.columns,function(n){this.columns[n].visible=t}),this.initHeader(),this.initSearch(),this.initPagination(),this.initBody(),this.options.showColumns){var i=this.$toolbar.find(".keep-open input").prop("disabled",!1);i.filter(":checked").length<=this.options.minimumCountColumns&&i.filter(":checked").prop("disabled",!0)}};t.prototype.showAllColumns=function(){this.toggleAllColumns(!0)};t.prototype.hideAllColumns=function(){this.toggleAllColumns(!1)};t.prototype.filterBy=function(t){this.filterColumns=n.isEmptyObject(t)?{}:t;this.options.pageNumber=1;this.initSearch();this.updatePagination()};t.prototype.scrollTo=function(n){return typeof n=="string"&&(n=n==="bottom"?this.$tableBody[0].scrollHeight:0),typeof n=="number"&&this.$tableBody.scrollTop(n),typeof n=="undefined"?this.$tableBody.scrollTop():void 0};t.prototype.getScrollPosition=function(){return this.scrollTo()};t.prototype.selectPage=function(n){n>0&&n<=this.options.totalPages&&(this.options.pageNumber=n,this.updatePagination())};t.prototype.prevPage=function(){this.options.pageNumber>1&&(this.options.pageNumber--,this.updatePagination())};t.prototype.nextPage=function(){this.options.pageNumber tr[data-index="%s"]',t));r.next().is("tr.detail-view")===(n?!1:!0)&&r.find("> td > .detail-icon").click()};t.prototype.expandRow=function(n){this.expandRow_(!0,n)};t.prototype.collapseRow=function(n){this.expandRow_(!1,n)};t.prototype.expandAllRows=function(t){var s,u;if(t){var r=this.$body.find(i('> tr[data-index="%s"]',0)),h=this,f=null,e=!1,o=-1;if(r.next().is("tr.detail-view")?r.next().next().is("tr.detail-view")||(r.next().find(".detail-icon").click(),e=!0):(r.find("> td > .detail-icon").click(),e=!0),e)try{o=setInterval(function(){f=h.$body.find("tr.detail-view").last().find(".detail-icon");f.length>0?f.click():clearInterval(o)},1)}catch(c){clearInterval(o)}}else for(s=this.$body.children(),u=0;u