/* Tabulator v4.6.3 (c) Oliver Folkerd */ var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Format=function(e){this.table=e};Format.prototype.initializeColumn=function(e){e.modules.format=this.lookupFormatter(e,""),void 0!==e.definition.formatterPrint&&(e.modules.format.print=this.lookupFormatter(e,"Print")),void 0!==e.definition.formatterClipboard&&(e.modules.format.clipboard=this.lookupFormatter(e,"Clipboard")),void 0!==e.definition.formatterHtmlOutput&&(e.modules.format.htmlOutput=this.lookupFormatter(e,"HtmlOutput"))},Format.prototype.lookupFormatter=function(e,t){var o={params:e.definition["formatter"+t+"Params"]||{}},r=e.definition["formatter"+t];switch(void 0===r?"undefined":_typeof(r)){case"string":"tick"===r&&(r="tickCross",void 0===o.params.crossElement&&(o.params.crossElement=!1),console.warn("DEPRECATION WARNING - the tick formatter has been deprecated, please use the tickCross formatter with the crossElement param set to false")),this.formatters[r]?o.formatter=this.formatters[r]:(console.warn("Formatter Error - No such formatter found: ",r),o.formatter=this.formatters.plaintext);break;case"function":o.formatter=r;break;default:o.formatter=this.formatters.plaintext}return o},Format.prototype.cellRendered=function(e){e.modules.format&&e.modules.format.renderedCallback&&e.modules.format.renderedCallback()},Format.prototype.formatValue=function(e){function t(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t}var o=e.getComponent(),r="function"==typeof e.column.modules.format.params?e.column.modules.format.params(o):e.column.modules.format.params;return e.column.modules.format.formatter.call(this,o,r,t)},Format.prototype.formatExportValue=function(e,t){var o,r=e.column.modules.format[t];if(r){var a=function(t){e.modules.format||(e.modules.format={}),e.modules.format.renderedCallback=t};return o="function"==typeof r.params?r.params(component):r.params,r.formatter.call(this,e.getComponent(),o,a)}return this.formatValue(e)},Format.prototype.sanitizeHTML=function(e){if(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(e).replace(/[&<>"'`=\/]/g,function(e){return t[e]})}return e},Format.prototype.emptyToSpace=function(e){return null===e||void 0===e||""===e?" ":e},Format.prototype.getFormatter=function(e){var e;switch(void 0===e?"undefined":_typeof(e)){case"string":this.formatters[e]?e=this.formatters[e]:(console.warn("Formatter Error - No such formatter found: ",e),e=this.formatters.plaintext);break;case"function":e=e;break;default:e=this.formatters.plaintext}return e},Format.prototype.formatters={plaintext:function(e,t,o){return this.emptyToSpace(this.sanitizeHTML(e.getValue()))},html:function(e,t,o){return e.getValue()},textarea:function(e,t,o){return e.getElement().style.whiteSpace="pre-wrap",this.emptyToSpace(this.sanitizeHTML(e.getValue()))},money:function(e,t,o){var r,a,l,n,i=parseFloat(e.getValue()),s=t.decimal||".",c=t.thousand||",",u=t.symbol||"",d=!!t.symbolAfter,m=void 0!==t.precision?t.precision:2;if(isNaN(i))return this.emptyToSpace(this.sanitizeHTML(e.getValue()));for(r=!1!==m?i.toFixed(m):i,r=String(r).split("."),a=r[0],l=r.length>1?s+r[1]:"",n=/(\d+)(\d{3})/;n.test(a);)a=a.replace(n,"$1"+c+"$2");return d?a+l+u:u+a+l},link:function(e,t,o){var r,a=e.getValue(),l=t.urlPrefix||"",n=t.download,i=a,s=document.createElement("a");if(t.labelField&&(r=e.getData(),i=r[t.labelField]),t.label)switch(_typeof(t.label)){case"string":i=t.label;break;case"function":i=t.label(e)}if(i){if(t.urlField&&(r=e.getData(),a=r[t.urlField]),t.url)switch(_typeof(t.url)){case"string":a=t.url;break;case"function":a=t.url(e)}return s.setAttribute("href",l+a),t.target&&s.setAttribute("target",t.target),t.download&&(n="function"==typeof n?n(e):!0===n?"":n,s.setAttribute("download",n)),s.innerHTML=this.emptyToSpace(this.sanitizeHTML(i)),s}return" "},image:function(e,t,o){var r=document.createElement("img");switch(r.setAttribute("src",e.getValue()),_typeof(t.height)){case"number":r.style.height=t.height+"px";break;case"string":r.style.height=t.height}switch(_typeof(t.width)){case"number":r.style.width=t.width+"px";break;case"string":r.style.width=t.width}return r.addEventListener("load",function(){e.getRow().normalizeHeight()}),r},tickCross:function(e,t,o){var r=e.getValue(),a=e.getElement(),l=t.allowEmpty,n=t.allowTruthy,i=void 0!==t.tickElement?t.tickElement:'',s=void 0!==t.crossElement?t.crossElement:'';return n&&r||!0===r||"true"===r||"True"===r||1===r||"1"===r?(a.setAttribute("aria-checked",!0),i||""):!l||"null"!==r&&""!==r&&null!==r&&void 0!==r?(a.setAttribute("aria-checked",!1),s||""):(a.setAttribute("aria-checked","mixed"),"")},datetime:function(e,t,o){var r=t.inputFormat||"YYYY-MM-DD hh:mm:ss",a=t.outputFormat||"DD/MM/YYYY hh:mm:ss",l=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",n=e.getValue(),i=moment(n,r);return i.isValid()?i.format(a):!0===l?n:"function"==typeof l?l(n):l},datetimediff:function(e,t,o){var r=t.inputFormat||"YYYY-MM-DD hh:mm:ss",a=void 0!==t.invalidPlaceholder?t.invalidPlaceholder:"",l=void 0!==t.suffix&&t.suffix,n=void 0!==t.unit?t.unit:void 0,i=void 0!==t.humanize&&t.humanize,s=void 0!==t.date?t.date:moment(),c=e.getValue(),u=moment(c,r);return u.isValid()?i?moment.duration(u.diff(s)).humanize(l):u.diff(s,n)+(l?" "+l:""):!0===a?c:"function"==typeof a?a(c):a},lookup:function(e,t,o){var r=e.getValue();return void 0===t[r]?(console.warn("Missing display value for "+r),r):t[r]},star:function(e,t,o){var r=e.getValue(),a=e.getElement(),l=t&&t.stars?t.stars:5,n=document.createElement("span"),i=document.createElementNS("http://www.w3.org/2000/svg","svg");n.style.verticalAlign="middle",i.setAttribute("width","14"),i.setAttribute("height","14"),i.setAttribute("viewBox","0 0 512 512"),i.setAttribute("xml:space","preserve"),i.style.padding="0 1px",r=r&&!isNaN(r)?parseInt(r):0,r=Math.max(0,Math.min(r,l));for(var s=1;s<=l;s++){var c=i.cloneNode(!0);c.innerHTML=s<=r?'':'',n.appendChild(c)}return a.style.whiteSpace="nowrap",a.style.overflow="hidden",a.style.textOverflow="ellipsis",a.setAttribute("aria-label",r),n},traffic:function(e,t,o){var r,a,l=this.sanitizeHTML(e.getValue())||0,n=document.createElement("span"),i=t&&t.max?t.max:100,s=t&&t.min?t.min:0,c=t&&void 0!==t.color?t.color:["red","orange","green"],u="#666666";if(!isNaN(l)&&void 0!==e.getValue()){switch(n.classList.add("tabulator-traffic-light"),a=parseFloat(l)<=i?parseFloat(l):i,a=parseFloat(a)>=s?parseFloat(a):s,r=(i-s)/100,a=Math.round((a-s)/r),void 0===c?"undefined":_typeof(c)){case"string":u=c;break;case"function":u=c(l);break;case"object":if(Array.isArray(c)){var d=100/c.length,m=Math.floor(a/d);m=Math.min(m,c.length-1),m=Math.max(m,0),u=c[m];break}}return n.style.backgroundColor=u,n}},progress:function(e,t,o){var r,a,l,n,i,s=this.sanitizeHTML(e.getValue())||0,c=e.getElement(),u=t&&t.max?t.max:100,d=t&&t.min?t.min:0,m=t&&t.legendAlign?t.legendAlign:"center";switch(a=parseFloat(s)<=u?parseFloat(s):u,a=parseFloat(a)>=d?parseFloat(a):d,r=(u-d)/100,a=Math.round((a-d)/r),_typeof(t.color)){case"string":l=t.color;break;case"function":l=t.color(s);break;case"object":if(Array.isArray(t.color)){var p=100/t.color.length,f=Math.floor(a/p);f=Math.min(f,t.color.length-1),f=Math.max(f,0),l=t.color[f];break}default:l="#2DC214"}switch(_typeof(t.legend)){case"string":n=t.legend;break;case"function":n=t.legend(s);break;case"boolean":n=s;break;default:n=!1}switch(_typeof(t.legendColor)){case"string":i=t.legendColor;break;case"function":i=t.legendColor(s);break;case"object":if(Array.isArray(t.legendColor)){var p=100/t.legendColor.length,f=Math.floor(a/p);f=Math.min(f,t.legendColor.length-1),f=Math.max(f,0),i=t.legendColor[f]}break;default:i="#000"}c.style.minWidth="30px",c.style.position="relative",c.setAttribute("aria-label",a);var h=document.createElement("div");if(h.style.display="inline-block",h.style.position="relative",h.style.width=a+"%",h.style.backgroundColor=l,h.style.height="100%",h.setAttribute("data-max",u),h.setAttribute("data-min",d),n){var g=document.createElement("div");g.style.position="absolute",g.style.top="4px",g.style.left=0,g.style.textAlign=m,g.style.width="100%",g.style.color=i,g.innerHTML=n}return o(function(){if(!(e instanceof CellComponent)){var t=document.createElement("div");t.style.position="absolute",t.style.top="4px",t.style.bottom="4px",t.style.left="4px",t.style.right="4px",c.appendChild(t),c=t}c.appendChild(h),n&&c.appendChild(g)}),""},color:function(e,t,o){return e.getElement().style.backgroundColor=this.sanitizeHTML(e.getValue()),""},buttonTick:function(e,t,o){return''},buttonCross:function(e,t,o){return''},rownum:function(e,t,o){return this.table.rowManager.activeRows.indexOf(e.getRow()._getSelf())+1},handle:function(e,t,o){return e.getElement().classList.add("tabulator-row-handle"),"
"},responsiveCollapse:function(e,t,o){function r(e){var t=l.element;l.open=e,t&&(l.open?(a.classList.add("open"),t.style.display=""):(a.classList.remove("open"),t.style.display="none"))}var a=document.createElement("div"),l=e.getRow()._row.modules.responsiveLayout;return a.classList.add("tabulator-responsive-collapse-toggle"),a.innerHTML="+-",e.getElement().classList.add("tabulator-row-handle"),a.addEventListener("click",function(e){e.stopImmediatePropagation(),r(!l.open)}),r(l.open),a},rowSelection:function(e){var t=this,o=document.createElement("input");if(o.type="checkbox",this.table.modExists("selectRow",!0))if(o.addEventListener("click",function(e){e.stopPropagation()}),"function"==typeof e.getRow){var r=e.getRow();o.addEventListener("change",function(e){r.toggleSelect()}),o.checked=r.isSelected(),this.table.modules.selectRow.registerRowSelectCheckbox(r,o)}else o.addEventListener("change",function(e){t.table.modules.selectRow.selectedRows.length?t.table.deselectRow():t.table.selectRow()}),this.table.modules.selectRow.registerHeaderSelectCheckbox(o);return o}},Tabulator.prototype.registerModule("format",Format);