!function(){function n(t,i){if(!(this instanceof n))return new n(t,i);if(!t||"TABLE"!==t.tagName)throw new Error("Element must be a table");this.init(t,i||{})}var t=[],i=function(n){var t;return window.CustomEvent&&"function"==typeof CustomEvent?t=new CustomEvent(n):(t=document.createEvent("CustomEvent"),t.initCustomEvent(n,!1,!1,void 0)),t},r=function(n){return n.getAttribute("data-sort")||n.textContent||n.innerText||""},f=function(n,t){return n=n.trim().toLowerCase(),t=t.trim().toLowerCase(),n===t?0:n<t?1:-1},u=function(n,t){return function(i,r){var u=n(i.td,r.td);return 0===u?t?r.index-i.index:i.index-r.index:u}};n.extend=function(n,i,r){if("function"!=typeof i||"function"!=typeof r)throw new Error("Pattern and sort must be a function");t.push({name:n,pattern:i,sort:r})};n.prototype={init:function(n,t){var u,e,r,f,i=this,o;if(i.table=n,i.thead=!1,i.options=t,n.rows&&n.rows.length>0)if(n.tHead&&n.tHead.rows.length>0){for(r=0;r<n.tHead.rows.length;r++)if("thead"===n.tHead.rows[r].getAttribute("data-sort-method")){u=n.tHead.rows[r];break}u||(u=n.tHead.rows[n.tHead.rows.length-1]);i.thead=!0}else u=n.rows[0];if(u){for(o=function(){i.current&&i.current!==this&&i.current.removeAttribute("aria-sort");i.current=this;i.sortTable(this)},r=0;r<u.cells.length;r++)f=u.cells[r],f.setAttribute("role","columnheader"),"none"!==f.getAttribute("data-sort-method")&&(f.tabindex=0,f.addEventListener("click",o,!1),null!==f.getAttribute("data-sort-default")&&(e=f));e&&(i.current=e,i.sortTable(e))}},sortTable:function(n,e){var s=this,k=n.cellIndex,v=f,o="",y=[],h=s.thead?0:1,w=n.getAttribute("data-sort-method"),l=n.getAttribute("aria-sort");if(s.table.dispatchEvent(i("beforeSort")),e||(l="ascending"===l?"descending":"descending"===l?"ascending":s.options.descending?"descending":"ascending",n.setAttribute("aria-sort",l)),!(s.table.rows.length<2)){if(!w){for(;y.length<3&&h<s.table.tBodies[0].rows.length;)o=r(s.table.tBodies[0].rows[h].cells[k]),o=o.trim(),o.length>0&&y.push(o),h++;if(!y)return}for(h=0;h<t.length;h++)if(o=t[h],w){if(o.name===w){v=o.sort;break}}else if(y.every(o.pattern)){v=o.sort;break}for(s.col=k,h=0;h<s.table.tBodies.length;h++){var c,a=[],b={},p=0,d=0;if(!(s.table.tBodies[h].rows.length<2)){for(c=0;c<s.table.tBodies[h].rows.length;c++)o=s.table.tBodies[h].rows[c],"none"===o.getAttribute("data-sort-method")?b[p]=o:a.push({tr:o,td:r(o.cells[s.col]),index:p}),p++;for("descending"===l?a.sort(u(v,!0)):(a.sort(u(v,!1)),a.reverse()),c=0;c<p;c++)b[c]?(o=b[c],d++):o=a[c-d].tr,s.table.tBodies[h].appendChild(o)}}s.table.dispatchEvent(i("afterSort"))}},refresh:function(){void 0!==this.current&&this.sortTable(this.current,!0)}};"undefined"!=typeof module&&module.exports?module.exports=n:window.Tablesort=n}();!function(){var n=function(n){return n.replace(/[^\-?0-9.]/g,"")},t=function(n,t){return n=parseFloat(n),t=parseFloat(t),n=isNaN(n)?0:n,t=isNaN(t)?0:t,n-t};Tablesort.extend("number",function(n){return n.match(/^[-+]?[£\x24Û¢´€]?\d+\s*([,\.]\d{0,2})/)||n.match(/^[-+]?\d+\s*([,\.]\d{0,2})?[£\x24Û¢´€]/)||n.match(/^[-+]?(\d)*-?([,\.]){0,1}-?(\d)+([E,e][\-+][\d]+)?%?$/)},function(i,r){return i=n(i),r=n(r),t(r,i)})}()