text: // @preserve jQuery.floatThead 1.2.13 - http://mkoryak.github.io/floatThead/ - Copyright (c) 2012 - 2015 Misha Koryak
  // @license MIT
  !function(a){function b(a,b,c){if(8==j){var d=o.width(),e=h.debounce(function(){var a=o.width();d!=a&&(d=a,c())},a);o.on(b,e)}else o.on(b,h.debounce(c,a))}function c(a){window&&window.console&&window.console.log&&window.console.log("jQuery.floatThead: "+a)}function d(a){var b=a.getBoundingClientRect();return b.width||b.right-b.left}function e(){var b=a('<div style="width:50px;height:50px;overflow-y:scroll;position:absolute;top:-200px;left:-200px;"><div style="height:100px;width:100%"></div>');a("body").append(b);var c=b.innerWidth(),d=a("div",b).innerWidth();return b.remove(),c-d}function f(a){if(a.dataTableSettings)for(var b=0;b<a.dataTableSettings.length;b++){var c=a.dataTableSettings[b].nTable;if(a[0]==c)return!0}return!1}function g(a,b,c){var d=c?"outerWidth":"width";if(m&&a.css("max-width")){var e=0;c&&(e+=parseInt(a.css("borderLeft"),10),e+=parseInt(a.css("borderRight"),10));for(var f=0;f<b.length;f++)e+=b.get(f).offsetWidth;return e}return a[d]()}a.floatThead=a.floatThead||{},a.floatThead.defaults={cellTag:null,headerCellSelector:"tr:visible:first>*:visible",zIndex:1001,debounceResizeMs:10,useAbsolutePositioning:null,scrollingTop:0,scrollingBottom:0,scrollContainer:function(){return a([])},getSizingRow:function(a){return a.find("tbody tr:visible:first>*:visible")},floatTableClass:"floatThead-table",floatWrapperClass:"floatThead-wrapper",floatContainerClass:"floatThead-container",copyTableClass:!0,enableAria:!1,autoReflow:!1,debug:!1};var h=window._,i="undefined"!=typeof MutationObserver,j=function(){for(var a=3,b=document.createElement("b"),c=b.all||[];a=1+a,b.innerHTML="<!--[if gt IE "+a+"]><i><![endif]-->",c[0];);return a>4?a:document.documentMode}(),k=/Gecko\//.test(navigator.userAgent),l=/WebKit\//.test(navigator.userAgent),m=function(){if(l){var b=a('<div style="width:0px"><table style="max-width:100%"><tr><th><div style="min-width:100px;">X</div></th></tr></table></div>');a("body").append(b);var c=0==b.find("table").width();return b.remove(),c}return!1},n=!k&&!j,o=a(window);a.fn.floatThead=function(k){if(k=k||{},!h&&(h=window._||a.floatThead._,!h))throw new Error("jquery.floatThead-slim.js requires underscore. You should use the non-lite version since you do not have underscore.");if(8>j)return this;var p=null;if(h.isFunction(m)&&(m=m()),h.isString(k)){var q=k,r=this;return this.filter("table").each(function(){var b=a(this),c=b.data("floatThead-lazy");c&&b.floatThead(c);var d=b.data("floatThead-attached");if(d&&h.isFunction(d[q])){var e=d[q]();"undefined"!=typeof e&&(r=e)}}),r}var s=a.extend({},a.floatThead.defaults||{},k);if(a.each(k,function(b){b in a.floatThead.defaults||!s.debug||c("Used ["+b+"] key to init plugin, but that param is not an option for the plugin. Valid options are: "+h.keys(a.floatThead.defaults).join(", "))}),s.debug){var t=a.fn.jquery.split(".");1==parseInt(t[0],10)&&parseInt(t[1],10)<=7&&c("jQuery version "+a.fn.jquery+" detected! This plugin supports 1.8 or better, or 1.7.x with jQuery UI 1.8.24 -> http://jqueryui.com/resources/download/jquery-ui-1.8.24.zip")}return this.filter(":not(."+s.floatTableClass+")").each(function(){function c(a){return a+".fth-"+D+".floatTHead"}function k(){var b=0;if(F.children("tr:visible").each(function(){b+=a(this).outerHeight(!0)}),"collapse"==E.css("border-collapse")){var c=parseInt(E.css("border-top-width"),10),d=parseInt(E.find("thead tr:first").find(">*:first").css("border-top-width"),10);c>d&&(b-=c/2)}eb.outerHeight(b),fb.outerHeight(b)}function m(){var a=g(E,ib,!0),b=N.width()||a,c="hidden"!=N.css("overflow-y")?b-K.vertical:b;if(bb.width(c),O){var d=100*a/c;X.css("width",d+"%")}else X.outerWidth(a)}function q(){H=(h.isFunction(s.scrollingTop)?s.scrollingTop(E):s.scrollingTop)||0,I=(h.isFunction(s.scrollingBottom)?s.scrollingBottom(E):s.scrollingBottom)||0}function r(){var b,c;if($)b=Z.find("col").length;else{var d;if(d=null==s.cellTag&&s.headerCellSelector?s.headerCellSelector:"tr:first>"+s.cellTag,h.isNumber(d))return d;c=F.find(d),b=0,c.each(function(){b+=parseInt(a(this).attr("colspan")||1,10)})}if(b!=M){M=b;for(var e,f=[],g=[],i=[],j=0;b>j;j++)f.push(s.enableAria&&(e=c.eq(j).text())?'<th scope="col" class="floatThead-col">'+e+"</th>":'<th class="floatThead-col"/>'),g.push("<col/>"),i.push("<fthtd style='display:table-cell;height:0;width:auto;'/>");g=g.join(""),f=f.join(""),n&&(i=i.join(""),ab.html(i),ib=ab.find("fthtd")),eb.html(f),fb=eb.find("th"),$||Z.html(g),gb=Z.find("col"),Y.html(g),hb=Y.find("col")}return b}function t(){if(!J){if(J=!0,P){var a=g(E,ib,!0),b=V.width();a>b&&E.css("minWidth",a)}E.css(lb),X.css(lb),X.append(F),G.before(db),k()}}function u(){J&&(J=!1,P&&E.width(nb),db.detach(),E.prepend(F),E.css(mb),X.css(mb),E.css("minWidth",ob),E.css("minWidth",g(E,ib)))}function v(a){pb!=a&&(pb=a,E.triggerHandler("floatThead",[a,bb]))}function w(a){P!=a&&(P=a,bb.css({position:P?"absolute":"fixed"}))}function x(a,b,c,d){return n?c:d?s.getSizingRow(a,b,c):b}function y(){var a,b=r();return function(){gb=Z.find("col");var c=x(E,gb,ib,j);if(c.length==b&&b>0){if(!$)for(a=0;b>a;a++)gb.eq(a).css("width","");u();var e=[];for(a=0;b>a;a++)e[a]=d(c.get(a));for(a=0;b>a;a++)hb.eq(a).width(e[a]),gb.eq(a).width(e[a]);t()}else X.append(F),E.css(mb),X.css(mb),k()}}function z(a){var b=N.css("border-"+a+"-width"),c=0;return b&&~b.indexOf("px")&&(c=parseInt(b,10)),c}function A(){var a,b=N.scrollTop(),c=0,d=R?Q.outerHeight(!0):0,e=S?d:-d,f=bb.height(),g=E.offset(),h=0,i=0;if(O){var j=N.offset();c=g.top-j.top+b,R&&S&&(c+=d),h=z("left"),i=z("top"),c-=i}else a=g.top-H-f+I+K.horizontal;var k=o.scrollTop(),m=o.scrollLeft(),n=N.scrollLeft();return function(j){var p=E[0].offsetWidth<=0&&E[0].offsetHeight<=0;if(!p&&cb)return cb=!1,setTimeout(function(){E.triggerHandler("reflow")},1),null;if(p&&(cb=!0,!P))return null;if("windowScroll"==j?(k=o.scrollTop(),m=o.scrollLeft()):"containerScroll"==j?(b=N.scrollTop(),n=N.scrollLeft()):"init"!=j&&(k=o.scrollTop(),m=o.scrollLeft(),b=N.scrollTop(),n=N.scrollLeft()),!l||!(0>k||0>m)){if(W)w("windowScrollDone"==j?!0:!1);else if("windowScrollDone"==j)return null;g=E.offset(),R&&S&&(g.top+=d);var q,r,s=E.outerHeight();if(O&&P){if(c>=b){var x=c-b+i;q=x>0?x:0,v(!1)}else q=U?i:b,v(!0);r=h}else!O&&P?(k>a+s+e?q=s-f+e:g.top>=k+H?(q=0,u(),v(!1)):(q=H+k-g.top+c+(S?d:0),t(),v(!0)),r=0):O&&!P?(c>b||b-c>s?(q=g.top-k,u(),v(!1)):(q=g.top+b-k-c,t(),v(!0)),r=g.left+n-m):O||P||(k>a+s+e?q=s+H-k+a+e:g.top>k+H?(q=g.top-k,t(),v(!1)):(q=H,v(!0)),r=g.left-m);return{top:q,left:r}}}}function B(){var a=null,b=null,c=null;return function(d,e,f){null==d||a==d.top&&b==d.left||(bb.css({top:d.top,left:d.left}),a=d.top,b=d.left),e&&m(),f&&k();var g=N.scrollLeft();P&&c==g||(bb.scrollLeft(g),c=g)}}function C(){if(N.length)if(N.data().perfectScrollbar)K={horizontal:0,vertical:0};else{var a=N.width(),b=N.height(),c=E.height(),d=g(E,ib),e=d>a?L:0,f=c>b?L:0;K.horizontal=d>a-f?L:0,K.vertical=c>b-e?L:0}}var D=h.uniqueId(),E=a(this);if(E.data("floatThead-attached"))return!0;if(!E.is("table"))throw new Error('jQuery.floatThead must be run on a table element. ex: $("table").floatThead();');i=s.autoReflow&&i;var F=E.children("thead:first"),G=E.children("tbody:first");if(0==F.length||0==G.length)return E.data("floatThead-lazy",s),void E.unbind("reflow").one("reflow",function(){E.floatThead(s)});E.data("floatThead-lazy")&&E.unbind("reflow"),E.data("floatThead-lazy",!1);var H,I,J=!1,K={vertical:0,horizontal:0},L=e(),M=0,N=s.scrollContainer(E)||a([]),O=N.length>0,P=s.useAbsolutePositioning;null==P&&(P=O),P||(J=!0);var Q=E.find("caption"),R=1==Q.length;if(R)var S="top"===(Q.css("caption-side")||Q.attr("align")||"top");var T=a('<fthfoot style="display:table-footer-group;border-spacing:0;height:0;border-collapse:collapse;"/>'),U=!1,V=a([]),W=9>=j&&!O&&P,X=a("<table/>"),Y=a("<colgroup/>"),Z=E.children("colgroup:first"),$=!0;0==Z.length&&(Z=a("<colgroup/>"),$=!1);var ab=a('<fthtr style="display:table-row;border-spacing:0;height:0;border-collapse:collapse"/>'),bb=a('<div style="overflow: hidden;" aria-hidden="true" class="floatThead-floatContainer"></div>'),cb=!1,db=a("<thead/>"),eb=a('<tr class="size-row"/>'),fb=a([]),gb=a([]),hb=a([]),ib=a([]);db.append(eb),E.prepend(Z),n&&(T.append(ab),E.append(T)),X.append(Y),bb.append(X),s.copyTableClass&&X.attr("class",E.attr("class")),X.attr({cellpadding:E.attr("cellpadding"),cellspacing:E.attr("cellspacing"),border:E.attr("border")});var jb=E.css("display");if(X.css({borderCollapse:E.css("borderCollapse"),border:E.css("border"),display:jb}),"none"==jb&&(cb=!0),X.addClass(s.floatTableClass).css({margin:0,"border-bottom-width":0}),P){var kb=function(a,b){var c=a.css("position"),d="relative"==c||"absolute"==c;if(!d||b){var e={paddingLeft:a.css("paddingLeft"),paddingRight:a.css("paddingRight")};bb.css(e),a=a.wrap("<div class='"+s.floatWrapperClass+"' style='position: relative; clear:both;'></div>").parent(),U=!0}return a};O?(V=kb(N,!0),V.append(bb)):(V=kb(E),E.after(bb))}else E.after(bb);bb.css({position:P?"absolute":"fixed",marginTop:0,top:P?0:"auto",zIndex:s.zIndex}),bb.addClass(s.floatContainerClass),q();var lb={"table-layout":"fixed"},mb={"table-layout":E.css("tableLayout")||"auto"},nb=E[0].style.width||"",ob=E.css("minWidth")||"",pb=!1;C();var qb,rb=function(){(qb=y())()};rb();var sb=A(),tb=B();tb(sb("init"),!0);var ub=h.debounce(function(){tb(sb("windowScrollDone"),!1)},1),vb=function(){tb(sb("windowScroll"),!1),W&&ub()},wb=function(){tb(sb("containerScroll"),!1)},xb=function(){E.is(":hidden")||(q(),C(),rb(),sb=A(),(tb=B())(sb("resize"),!0,!0))},yb=h.debounce(function(){E.is(":hidden")||(C(),q(),rb(),sb=A(),tb(sb("reflow"),!0))},1);if(O?P?N.on(c("scroll"),wb):(N.on(c("scroll"),wb),o.on(c("scroll"),vb)):o.on(c("scroll"),vb),o.on(c("load"),yb),b(s.debounceResizeMs,c("resize"),xb),E.on("reflow",yb),f(E)&&E.on("filter",yb).on("sort",yb).on("page",yb),o.on(c("shown.bs.tab"),yb),o.on(c("tabsactivate"),yb),i){var zb=null;_.isFunction(s.autoReflow)&&(zb=s.autoReflow(E,N)),zb||(zb=N.length?N[0]:E[0]),p=new MutationObserver(function(a){for(var b=function(a){return a&&a[0]&&("THEAD"==a[0].nodeName||"TD"==a[0].nodeName||"TH"==a[0].nodeName)},c=0;c<a.length;c++)if(!b(a[c].addedNodes)&&!b(a[c].removedNodes)){yb();break}}),p.observe(zb,{childList:!0,subtree:!0})}E.data("floatThead-attached",{destroy:function(){var a=".fth-"+D;u(),E.css(mb),Z.remove(),n&&T.remove(),db.parent().length&&db.replaceWith(F),i&&(p.disconnect(),p=null),E.off("reflow"),N.off(a),U&&(N.length?N.unwrap():E.unwrap()),E.css("minWidth",ob),bb.remove(),E.data("floatThead-attached",!1),o.off(a)},reflow:function(){yb()},setHeaderHeight:function(){k()},getFloatContainer:function(){return bb},getRowGroups:function(){return J?bb.children("thead").add(E.children("tbody,tfoot")):E.children("thead,tbody,tfoot")}})}),this}}(jQuery),function(a){a.floatThead=a.floatThead||{},a.floatThead._=window._||function(){var b={},c=Object.prototype.hasOwnProperty,d=["Arguments","Function","String","Number","Date","RegExp"];b.has=function(a,b){return c.call(a,b)},b.keys=function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[];for(var d in a)b.has(a,d)&&c.push(d);return c};var e=0;return b.uniqueId=function(a){var b=++e+"";return a?a+b:b},a.each(d,function(){var a=this;b["is"+a]=function(b){return Object.prototype.toString.call(b)=="[object "+a+"]"}}),b.debounce=function(a,b,c){var d,e,f,g,h;return function(){f=this,e=arguments,g=new Date;var i=function(){var j=new Date-g;b>j?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e)))},j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e)),h}},b}()}(jQuery);