/*https://web.agile-labs.com/minZIP/*//*version=3.9.1*/function ownKeys(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,a)}return i}function _objectSpread(e){for(var t=1;te.length)&&(t=e.length);for(var i=0,a=new Array(t);i]/,custBtnIVIR="",svHtmlGeneratorRef,saveViewActionRef,cancelViewActionRef,onContentReadyRef,onCloseRef,isOpenSmartStepper=!1,dateOptions=["Custom","Today","Yesterday","Tomorrow","This week","Last week","Next week","This month","Last month","Next month","This quarter","Last quarter","Next quarter","This year","Last year","Next year"],dateOptionsId=["customOption","todayOption","yesterdayOption","tomorrowOption","this_weekOption","last_weekOption","next_weekOption","this_monthOption","last_monthOption","next_monthOption","this_quarterOption","last_quarterOption","next_quarterOption","this_yearOption","last_yearOption","next_yearOption"],dateOptionsCaption=callParentNew("lcm")[445],errorMessages={emptyField:eval(callParent("lcm[13]")),invalidName:eval(callParent("lcm[14]")),integerChk:eval(callParent("lcm[15]")),emptySelect:eval(callParent("lcm[16]")),chartSelection:eval(callParent("lcm[17]")),columnSelection:eval(callParent("lcm[18]")),downloadSelection:eval(callParent("lcm[19]")),maxPills:eval(callParent("lcm[20]")),duplicateFld:eval(callParent("lcm[21]")),dependentColumns:eval(callParent("lcm[22]")),noChartWhileGrpng:"When grouping is enabled chart cannot be viewed."},advFiltersObjectToApply={},regexes={validName:"^[a-zA-Z0-9][a-zA-Z0-9 ,.'_-]{0,}$"},isSpecialRow=!1,colTypes={c:"string",n:"num-fmt",d:"date"},colAlign={Left:"dt-left",Right:"dt-right",Center:"dt-center"};$("body").attr("dir")&&"rtl"==$("body").attr("dir")&&(colAlign={Right:"dt-left",Left:"dt-right",Center:"dt-center"});var btnFilterApplyVal=callParentNew("lcm")[399],btnFilterApplyEditVal=callParentNew("lcm")[442],widthIncrement=0,newBtnGroup={params:{name:"params",task:"",type:"paramFilter",stage:"[data-dropdown-value=paramFilter]:eq(0)",caption:callParentNew("lcm")[478],icon:"search",open:function(){$(this.stage).click()},clear:function(e){$("#button2").click(),setTimeout(function(){e.prev("input").val($j("#hdnparamValues").val())},0)},apply:function(){},html:function(e){return svHtmlGeneratorRef(this,$('')),e)},get visible(){return!1},get value(){return $j("#hdnparamValues").val()}},charts:{name:"charts",task:"chart",type:"chart",stage:"#chartActionLi[data-dropdown-value=chart]:eq(0)",caption:callParentNew("lcm")[402],icon:"pie_chart",open:function(){$(this.stage).click()},clear:function(){},apply:function(e,t){ivirCreateChart(e,t)},html:function(e){return svHtmlGeneratorRef(this,$('')),e)},get visible(){return!1},get value(){return ivirMainObj.chart&&ivirMainObj.chart[0]&&JSON.stringify(ivirMainObj.chart[0])||""}},filters:{name:"filters",task:"filter",type:"moreFilters",stage:"[data-dropdown-value=moreFilters]:eq(0)",caption:callParentNew("lcm")[409],icon:"filter_alt",open:function(){var e=$("[onclick=editThePill\\(\\'filter\\'\\,0\\)]");e.length?e.click():$(this.stage).click()},clear:function(e){resetMoreFilters(),delete ivirMainObj.filter;var t=$("#newViewTabId").find(".filter-body-cont");t.length>0&&t.data("pillindex",-1)},apply:function(){$("#btnFilterApply").click()},html:function(e){return svHtmlGeneratorRef(this,$('')),e)},get visible(){return!0},get value(){return ivirMainObj.filter&&ivirMainObj.filter[0]&&JSON.stringify(ivirMainObj.filter[0])||""}},sort:{name:"sort",task:"sort",type:"sort",stage:"[data-dropdown-value=sort]:eq(0)",caption:callParentNew("lcm")[403],icon:"sort",open:function(){$(this.stage).click()},clear:function(e){$("#clearSorting").click(),delete ivirMainObj.sorting},apply:function(){ivirSortColumns()},html:function(e){return svHtmlGeneratorRef(this,$('')),e)},get visible(){return"inmemdb"!=iName},get value(){return ivirMainObj.sorting&&ivirMainObj.sorting.length>0&&JSON.stringify(ivirMainObj.sorting)||""}},rowGrouping:{name:"rowGrouping",task:"group",type:"rowGrouping",stage:"[data-dropdown-value=rowGrouping]:eq(0)",caption:callParentNew("lcm")[404],icon:"table_rows",open:function(){var e=$("[onclick=editThePill\\(\\'group\\'\\,0\\)]");e.length?e.click():$(this.stage).click()},clear:function(e){delete ivirMainObj.group},apply:function(e,t){ivirRowGrouping(e,t)},html:function(e){return svHtmlGeneratorRef(this,$('')),e)},get visible(){return"inmemdb"!=iName&&!isListView&&!enableCardsUi},get value(){return ivirMainObj.group&&ivirMainObj.group[0]&&JSON.stringify(ivirMainObj.group[0])||""}},columns:{name:"columns",task:"column",type:"SHcolumns",stage:"[data-dropdown-value=SHcolumns]:eq(0)",caption:callParentNew("lcm")[401],icon:"view_week",open:function(){$(this.stage).click()},clear:function(e){isListView&&""!=$("#hdnListViewFieldsJSON").val()?ivirMainObj.visibleColumns=[]:ivirMainObj.hiddenColumns=[]},apply:function(){ivirshowHideColumns()},html:function(e){return svHtmlGeneratorRef(this,$('')),e)},get visible(){return"inmemdb"!=iName&&!enableCardsUi},get value(){return isListView&&""!=$("#hdnListViewFieldsJSON").val()?ivirMainObj.visibleColumns&&ivirMainObj.visibleColumns.length>0&&JSON.stringify({visible:ivirMainObj.visibleColumns})||"":ivirMainObj.hiddenColumns&&ivirMainObj.hiddenColumns.length>0&&JSON.stringify({hidden:ivirMainObj.hiddenColumns})||""}},design:{name:"design",task:"design",type:"design",stage:"[data-dropdown-value=design]:eq(0)",caption:"Design",icon:"design_services",open:function(){$(this.stage).click()},clear:function(e){delete ivirMainObj.design},apply:function(){ivirDesignColumn()},html:function(e){return svHtmlGeneratorRef(this,$('')),e)},get visible(){return!("inmemdb"==iName||!isListView||enableCardsUi)},get value(){return ivirMainObj.design&&ivirMainObj.design.length>0&&JSON.stringify(ivirMainObj.design)||""}},highlight:{name:"highlight",task:"highlight",type:"highlighting",stage:"[data-dropdown-value=highlighting]:eq(0)",caption:callParentNew("lcm")[396],icon:"highlight",open:function(){var e=$("[onclick=editThePill\\(\\'highlight\\'\\,0\\)]");e.length?e.click():$(this.stage).click()},clear:function(e){delete ivirMainObj.highlight},apply:function(e,t){ivirHighlightRow(e,t)},html:function(e){return svHtmlGeneratorRef(this,$('')),e)},get visible(){return"inmemdb"!=iName},get value(){return ivirMainObj.highlight&&ivirMainObj.highlight[0]&&JSON.stringify(ivirMainObj.highlight[0])||""}}};function generateAdvFilterDates(e){var t={from:"",to:""},i="en-us"==dtCulture?"MM/DD/YYYY":"DD/MM/YYYY";switch(e){case"customOption":break;case"todayOption":var a=new Date;t.from=t.to=moment(a).format(i);break;case"yesterdayOption":(a=new Date).setDate(a.getDate()-1),t.from=t.to=moment(a).format(i);break;case"tomorrowOption":(a=new Date).setDate(a.getDate()+1),t.from=t.to=moment(a).format(i);break;case"this_weekOption":a=getFirstDayOfWeek(new Date);t.from=moment(a).format(i),a.setDate(a.getDate()+6),t.to=moment(a).format(i);break;case"last_weekOption":(a=getFirstDayOfWeek(new Date)).setDate(a.getDate()-7),t.from=moment(a).format(i),a.setDate(a.getDate()+6),t.to=moment(a).format(i);break;case"next_weekOption":(a=getFirstDayOfWeek(new Date)).setDate(a.getDate()+7),t.from=moment(a).format(i),a.setDate(a.getDate()+6),t.to=moment(a).format(i);break;case"this_monthOption":(a=getFirstDayOfWeek(new Date)).setDate(1),t.from=moment(a).format(i),a.setMonth(a.getMonth()+1),a.setDate(0),t.to=moment(a).format(i);break;case"last_monthOption":(a=getFirstDayOfWeek(new Date)).setDate(1),a.setMonth(a.getMonth()-1),t.from=moment(a).format(i),a.setMonth(a.getMonth()+1),a.setDate(0),t.to=moment(a).format(i);break;case"next_monthOption":(a=getFirstDayOfWeek(new Date)).setDate(1),a.setMonth(a.getMonth()+1),t.from=moment(a).format(i),a.setMonth(a.getMonth()+1),a.setDate(0),t.to=moment(a).format(i);break;case"this_quarterOption":a=new Date;var r=Math.floor((a.getMonth()+3)/3);a.setDate(1),a.setMonth(3*r-3),t.from=moment(a).format(i),a.setMonth(a.getMonth()+3),a.setDate(0),t.to=moment(a).format(i);break;case"last_quarterOption":a=new Date;0==(r=Math.floor((a.getMonth()+3)/3)-1)&&(r=4,a.setFullYear(a.getFullYear()-1)),a.setDate(1),a.setMonth(3*r-3),t.from=moment(a).format(i),a.setMonth(a.getMonth()+3),a.setDate(0),t.to=moment(a).format(i);break;case"next_quarterOption":a=new Date;5==(r=Math.floor((a.getMonth()+3)/3)+1)&&(r=1,a.setFullYear(a.getFullYear()+1)),a.setDate(1),a.setMonth(3*r-3),t.from=moment(a).format(i),a.setMonth(a.getMonth()+3),a.setDate(0),t.to=moment(a).format(i);break;case"this_yearOption":(a=new Date).setDate(1),a.setMonth(0),t.from=moment(a).format(i),a.setFullYear(a.getFullYear()+1),a.setMonth(0),a.setDate(0),t.to=moment(a).format(i);break;case"last_yearOption":(a=new Date).setFullYear(a.getFullYear()-1),a.setDate(1),a.setMonth(0),t.from=moment(a).format(i),a.setFullYear(a.getFullYear()+1),a.setMonth(0),a.setDate(0),t.to=moment(a).format(i);break;case"next_yearOption":(a=new Date).setFullYear(a.getFullYear()+1),a.setDate(1),a.setMonth(0),t.from=moment(a).format(i),a.setFullYear(a.getFullYear()+1),a.setMonth(0),a.setDate(0),t.to=moment(a).format(i)}return t}function generateUniqueColumnVals(e,t){var i=[];try{ivirDataTableApi.cells(ivirDataTableApi.rows(":not(.specialRow)").nodes(),t,{search:"applied"}).data().unique().sort().each(function(t,a){if("n"==e)t=(t="object"==_typeof(t)&&null!=t?t.display:null!=t?t:"").replace(/,/g,""),i.push(t);else if("d"==e){getAjaxIviewData&&(t=getDateBasedOnCulture(t));var r=getDateStamp(t);i.push(r)}})}catch(a){}return i}function getDateStamp(e){try{var t=dtFormat.substring(0,dtFormat.length-2).split(/-|\//),i=e.split(/-|\//);if(t[0].toLowerCase().startsWith("d")){var a=[i[1],i[0],i[2]];i[0]=a[0],i[1]=a[1],i[2]=a[2]}return parseInt(new Date(i.join("/")).getTime(),10)||e}catch(r){}}function enableDisableDateField(e,t){"disable"==t&&(e.prop("disabled",!0),e.parent().addClass("pe-none opacity-50 shadow-none"))}function getFirstDayOfWeek(e){var t=(e=new Date(e)).getDay(),i=e.getDate()-t+(0==t?-6:1);return new Date(e.setDate(i))}function isNumberBetweenScope(e,t,i){return isNaN(e)&&isNaN(t)||isNaN(e)&&i<=t||e<=i&&isNaN(t)||e<=i&&i<=t}function generateFilterPill(e,t,i,a){var r,n=!1,l=!1,o=t;if(requestJSON&&"old"!=iviewButtonStyle&&(maxNoOfPills=1),i===undefined){if(jQuery.isEmptyObject(ivirMainObj)){var s=ivirMainObj.filter=[];l=!0,r=0}else if(ivirMainObj.filter===undefined){s=ivirMainObj.filter=[];r=0}else{l=!1,(s=ivirMainObj.filter).length>=maxNoOfPills&&(n=!0),r=s.length}var c=new Object}else{c=ivirMainObj.filter[i];r=i}n?showAlertDialog("warning",appGlobalVarsObject.lcm[23]):(c.n=o,c.data=JSON.parse(e),i===undefined?(s.push(c),l||0==$("#ivirFilteredAccordion").length?0==$("#ivirFilteredAccordion").length?createPills("all","first"):($("[id^='filterpillCB']").prop("checked",!1).removeAttr("checked"),createPills("all","last")):$("#ivirFilteredAccordion").length>0&&($("[id^='filterpillCB']").prop("checked",!1).removeAttr("checked"),upateThePills("filter",r,o))):($("[id^='filterpillCB']").prop("checked",!1).removeAttr("checked"),$("#filterpillCB"+i).prop("checked",!0).attr("checked","checked"),$("#filterpillCB"+i).parent().next().find(".ivirCndtnName").attr("title","Edit "+o).text(o)));try{advFiltersObjectToApply=ivirMainObj.filter[r].data}catch(d){}return setSmartViewHeight(),!0}function fireTheCustomAction(e){$("#"+e).click(),__doPostBack(e,"")}function ivirShowChart(e,t,i){"chart"!==e&&($(".chartCndtnWrapper").hide(),$("#ivir"+e).show()),$("#ivirChartsRow span.customError").remove(),$(".ivirChartButton").removeClass("active btn-active-light-primary"),$(i).addClass("active btn-active-light-primary"),$("#ivir"+e+" .form-control").first().focus()}function ivirCreateChart(e,t,i,a){var r,n=[],l=[],o=$("#ivirChartCol").find("option:selected").data("index"),s=$("#ivirChartCol").find("option:selected").val(),c=$(ivirDataTableApi.column(o).header()).text().trim(),d=$("#ivirChartVal").find("option:selected").data("index"),p=$("#ivirChartVal").find("option:selected").val(),h=$("#ivirChartName").val(),u=$("#ivirChartsRow .ivirChartButton.active").data("type"),v=!1;if(i===undefined)var m=h,g=getPropertyAccess(s),b=getPropertyAccess(p),f=u;else{var w=ivirMainObj.chart[e];m=w.n,g=w.cl,b=w.v,f=w.t;d=void 0===d?FieldName.indexOf(b):d}if(a){h=(k=ivirMainObj.chart[e]).n,o=k.cl,d=k.v,f=k.t,d=void 0===d?FieldName.indexOf(d):d}else{if(""==m)return ivirCustomErrMsg($("#ivirChartName"),errorMessages.emptyField),!1;if(!testRegex("validName",m))return ivirCustomErrMsg($("#ivirChartName"),errorMessages.invalidName),!1;if(g==undefined||""===g)return ivirCustomErrMsg($("#ivirChartCol"),errorMessages.emptySelect),!1;if(b==undefined||""===b)return ivirCustomErrMsg($("#ivirChartVal"),errorMessages.emptySelect),!1;if(!f)return ivirCustomErrMsg($("#ivirChartsRow"),errorMessages.emptySelect),!1}if(r=0!=$('input[name="chkItem"]:checked').length,e===undefined||t){var C=!1;ivirDataTableApi.rows(":not(.specialRow)",{search:"applied"}).every(function(e,t,i){var a=ivirDataTableApi.rows(e).data()[0],o=this.node(),s=$(o).find("td");if(!r||s.eq(0).find("input[name=chkItem]").is(":checked")){var c="",d="";c=isNaN(parseFloat(g))?a[g]:a[Object.keys(a)[g]],d=isNaN(parseFloat(b))?a[b]:a[Object.keys(a)[b]],"n"==ColumnType[FieldName.indexOf(p)]&&(d=d.replace(/,/g,"")),anchorRegexPatter.test(c)&&(c=$(c).text()),anchorRegexPatter.test(d)&&(d=parseFloat($(d).text()));var h=$.inArray(c,n);if(-1==h){n.push(c);var u={};u.name=c,0!==(d=parseFloat(d))&&d&&""!==d&&(C=!0),"pie"==f||"donut"==f?u.y=d:"bar"!=f&&"column"!=f||(u.data=[d]),l.push(u)}else{var v=l[h];if("pie"==f||"donut"==f){var m=v.y;m=parseFloat(m),d=parseFloat(d),v.y=m+d}else if("column"==f||"bar"==f){m=v.data[0];v.data=[parseFloat(m)+parseFloat(d)]}}}})}var y=t;if(e===undefined){if(ivirMainObj.chart===undefined){var x=ivirMainObj.chart=[];indexOfChartArry=0}else{!1,(x=ivirMainObj.chart).length>=maxNoOfPills&&(v=!0),indexOfChartArry=x.length}var k=new Object}else{k=ivirMainObj.chart[e];indexOfChartArry=e,y&&requestJSON&&"old"!=iviewButtonStyle&&("undefined"==typeof k.checked||k.checked)||(y=!1)}if(e===undefined||y)if("pie"==f)pieChart(C,JSON.stringify(l),m,indexOfChartArry,d);else if("donut"==f)pieChart(C,JSON.stringify(l),m,indexOfChartArry,d,!0);else if("bar"==f||"column"==f){var T='["'+c+'"]~'+JSON.stringify(l);columnChart(C,T,m,indexOfChartArry,f,d)}return v?showAlertDialog("warning",appGlobalVarsObject.lcm[23]):(k.n=m,k.t=f,k.cl=g,k.v=b,e===undefined?(x.push(k),requestJSON&&"old"!=iviewButtonStyle&&ivirMainObj&&ivirMainObj.chart&&ivirMainObj.chart.length>0&&$("#ivirMainDataTableWrapper").show(),$("#ivirChartPills").hasClass("pillsAdded")?upateTheChartPills(indexOfChartArry,m):createChartPills()):(y?(requestJSON&&"old"!=iviewButtonStyle||$(".ivirChartCheckBox").prop("checked",!1).removeAttr("checked"),$("#chartpillCB"+e).prop("checked",!0).attr("checked","checked")):$("#chartpillCB"+e).prop("checked",!1).removeAttr("checked"),$("#ivirchart"+e+"CndtnPill .ivirCndtnName").attr("title","Edit "+m).text(m))),setSmartViewHeight(),!0}$j(document).ready(function(e){e.fn.dataTableExt.ofnSearch["alt-status"]=function(e){},e.fn.dataTable.ext.errMode="none",Highcharts.setOptions({lang:{decimalPoint:".",thousandsSep:","}}),svHtmlGeneratorRef=function(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this,a=arguments.length>2&&arguments[2]!==undefined&&arguments[2];isOpenSmartStepper=!0,(e("#ivirCButtonsWrapper").is(":visible")&&!e("#ivirCButtonsWrapper a.active").hasClass("grdView")||e("#pinnedivirCButtonsWrapper").is(":visible")&&!e("#pinnedivirCButtonsWrapper a.active").hasClass("grdView"))&&toggleGridView("grid");var r="",n=e(i).val();if(n&&""!=n){if("SHcolumns"==n&&"inmemdb"!=iName){requestTstructFieldsObj(),isListView&&""!=e("#hdnListViewFieldsJSON").val()||(r='
',r+='',r+='",r+="
",r+="
"),r+='
';var l=0;""!=fixedColumnsObj&&(l=fixedColumnsObj.s.iLeftColumns);var o=[],s=[];if(""!=groupingCol)!0,o=checkForPillDependentFlds("group",e("[id^='grouppillCB']:checked").data("index"),!0);var c=e("[id^='chartpillCB']:checked").data("index");if(c>=0&&(s=checkForPillDependentFlds("chart",c,!0)),isListView&&""!=e("#hdnListViewFieldsJSON").val()){var d="";if(""!=e("#hdnListViewFieldsJSON").val())try{var p=JSON.parse(e("#hdnListViewFieldsJSON").val());r+=Object.keys(p).map(function(t){var i=p[t];return'\n
\n
\n \n \x3c!-- --\x3e\n \n
\n
\n ').concat(i.fields.map(function(i){return i.visible&&i.save?'\n
\n 0&&ivirMainObj.visibleColumns[0].dcs&&ivirMainObj.visibleColumns[0].dcs[t]&&"undefined"!=typeof ivirMainObj.visibleColumns[0].dcs[t].fields&&(checkIt=ivirMainObj.visibleColumns[0].dcs[t].fields.indexOf(i.name)>-1)||FieldName.indexOf(i.name)>-1&&("undefined"==typeof checkIt||checkIt))?(d+=""))&&'checked="checked"':"",'\n value="').concat(i.name,'" ').concat(Object.keys(i).map(function(e){return"data-".concat(e,'="').concat(i[e],'"')}).join(" "),' />\n \n
\n "):""}).join(""),'\n
\n
\n
')}).join(""),r+='
\n \n \n
")}catch($){}}else for(var h=(y=ivirDataTableApi.columns())[0].length,u=o.concat(s),v=0;v';var g="",b=!0===ivirDataTableApi.column(v).visible();if(e("#newViewTabId").is(":visible")||isOpenSmartStepper)try{ivirMainObj.hiddenColumns&&(b=!(ivirMainObj.hiddenColumns.indexOf(FieldName[HeaderText.indexOf(m)])>-1))}catch($){}(v':'',r+='",r+="
"}return r+=""}if("design"==n&&"inmemdb"!=iName&&isListView){return r='\n
\n
\n '}else{if("sort"==n&&"inmemdb"!=iName){r+='
',r+='',r+='',r+='',r+="
",r+="
",r+='
';var f=ivirDataTableApi.order(),w=[];for(v=0;v',r+=''+m+"",r+='',"asc"==w[C+1]?(r+='',r+=''):(r+='',r+=''),r+="",r+="
")}for(var y=ivirDataTableApi.columns(),x=0;x',r+=''+(m=e(ivirDataTableApi.columns(x).header()).text().trim())+"",r+='',r+='',r+='',r+="",r+=""}return r+=""}if("rowGrouping"==n&&"inmemdb"!=iName){if(!checkForPillsLength("group"))return getGroupHtml();if(a)return getGroupHtml(a)}else if("highlighting"==n&&"inmemdb"!=iName){if(!checkForPillsLength("highlight"))return getHighlightHtml();if(a)return getHighlightHtml("highlight",0,a)}else{if("download"==n)return r+="
",r+="
",r+='
',r+='
',r+='
',r+='
',r+='
',r+='
',r+="
",r+="
",r+="
",r+="
";if("chart"==n&&"inmemdb"!=iName)checkForPillsLength("chart")||smartCharts();else if("save"==n&&"inmemdb"!=iName)requestJSON&&"old"!=iviewButtonStyle?ivirMainObj.groupName?hasBuildAccess?saveInSessionBeforeSaveNew(ivirMainObj.groupName,ivirMainObj.caption||ivirMainObj.groupName,ivirMainObj.applyTo):saveInSessionBeforeSaveNew(ivirMainObj.groupName,ivirMainObj.caption||ivirMainObj.groupName,callParentNew("mainUserName")):getViewName():saveInSessionBeforeSave();else if("saveAs"==n&&"inmemdb"!=iName)newViewTabClick(e(i));else{if("moreFilters"==n)return ivirMoreFilters(a&&ivirMainObj.filter?0:-1);"clearFilters"==n?clearFilters():"paramFilter"==n&&e("#Filterscollapse").collapse("toggle")}}}}},e(document).on("keydown","#ivirCndtnToggleBtn",function(e){32!=e.keyCode&&13!=e.keyCode||toggleIvirPills()}),e(document).on("change","#IvirCustomActions",function(t){var i=e(this).val();""!=i&&(i.startsWith("custBtn")&&fireTheCustomAction(i.split(",")[0].substr(7)))}),e.fn.dataTable.ext.search.push(function(t,i,a,r,n){var l=!1,o=[];e.isEmptyObject(advFiltersObjectToApply)||advFiltersObjectToApply.somedummyfilterjsobjectkey?(l=!1,advFiltersObjectToApply.somedummyfilterjsobjectkey||(o=e("#newViewTabId .filter-bodyAndFooter-cont table tbody tr"))):(l=!0,o=e(Object.keys(advFiltersObjectToApply)));var s=[];return e(o).each(function(t){var i="";if(l){i=o[t];var a=ivirColumnTypeObj[i]}else a=e(this).data("coltype");switch(a){case"c":if(l)var n=advFiltersObjectToApply[i].split("`"),c=getPropertyAccess(i);else n=e(this).find(".moreFiltersInput.characterFilter:nth(0)").val(),c=getPropertyAccess(e(this).find(".moreFiltersInput.characterFilter").data("field"));var d="object"==_typeof(r[c])&&null!=r[c]?r[c].display:null!=r[c]?r[c]:"",p=d=e(e.parseHTML(d)).text().trim();requestJSON,""!=n&&s.push(n.filter(function(e,t){return p.indexOf(e)>-1}).length>0);break;case"n":var h=0,u=0;if(l){c=getPropertyAccess(i);if(""!=advFiltersObjectToApply[i].min.toString()||""!=advFiltersObjectToApply[i].max.toString()){var v=[];try{v=generateUniqueColumnVals(a,c+":name"),""==advFiltersObjectToApply[i].min.toString()&&(advFiltersObjectToApply[i].min=Math.min.apply(Math,_toConsumableArray(v))||h),""==advFiltersObjectToApply[i].max.toString()&&(advFiltersObjectToApply[i].max=Math.max.apply(Math,_toConsumableArray(v))||u)}catch(g){}try{h=parseFloat(advFiltersObjectToApply[i].min.toString().replace(/,/g,""))||h}catch(g){}try{u=parseFloat(advFiltersObjectToApply[i].max.toString().replace(/,/g,""))||u}catch(g){}}}else{c=getPropertyAccess(e(this).find(".moreFiltersInput.numericFilter:nth(0)").data("field"));if(""!=e(this).find(".moreFiltersInput.numericFilter:nth(0)").val()||""!=e(this).find(".moreFiltersInput.numericFilter:nth(1)").val()){v=[];try{v=generateUniqueColumnVals(a,c+":name"),""==e(this).find(".moreFiltersInput.numericFilter:nth(0)").val()&&e(this).find(".moreFiltersInput.numericFilter:nth(0)").val(Math.min.apply(Math,_toConsumableArray(v))||h),""==e(this).find(".moreFiltersInput.numericFilter:nth(1)").val()&&e(this).find(".moreFiltersInput.numericFilter:nth(1)").val(Math.max.apply(Math,_toConsumableArray(v))||u)}catch(g){}h=parseFloat(e(this).find(".moreFiltersInput.numericFilter:nth(0)").val().toString().replace(/,/g,""))||h,u=parseFloat(e(this).find(".moreFiltersInput.numericFilter:nth(1)").val().toString().replace(/,/g,""))||u}}d="object"==_typeof(r[c])&&null!=r[c]?r[c].display:null!=r[c]?r[c]:"";d=checkFroNegativeValue(e(e.parseHTML(d)).text().trim()),""!=(p=isInValidNumber(p=parseFloat(d.toString().replace(/,/g,"")))?"":p)&&(0!=h||0!=u)&&s.push(isNumberBetweenScope(h,u,p));break;case"d":h=0,u=0;if(l){c=getPropertyAccess(i);if("undefined"==typeof advFiltersObjectToApply[i].min||""==advFiltersObjectToApply[i].min.toString()&&""==advFiltersObjectToApply[i].max.toString()){var m=generateAdvFilterDates(advFiltersObjectToApply[i]);h=getDateStamp(m.from),u=getDateStamp(m.to)}else{v=[];try{v=generateUniqueColumnVals(a,c+":name"),""==advFiltersObjectToApply[i].min.toString()&&(advFiltersObjectToApply[i].min=new Date(Math.min.apply(Math,_toConsumableArray(v))||h)),""==advFiltersObjectToApply[i].max.toString()&&(advFiltersObjectToApply[i].max=new Date(Math.max.apply(Math,_toConsumableArray(v))||u))}catch(g){}try{if(advFiltersObjectToApply[i].min)h=getDateStamp(advFiltersObjectToApply[i].min)||h;else;}catch(g){}try{if(advFiltersObjectToApply[i].max)u=getDateStamp(advFiltersObjectToApply[i].max)||u;else;}catch(g){}}}else{c=getPropertyAccess(e(this).find("input.moreFiltersInput.dateFilter:nth(0)").data("field"));if(""!=e(this).find("input.moreFiltersInput.dateFilter:nth(0)").val()||""!=e(this).find("input.moreFiltersInput.dateFilter:nth(1)").val()){v=[];try{v=generateUniqueColumnVals(a,c+":name"),""==e(this).find("input.moreFiltersInput.dateFilter:nth(0)").val()&&e(this).find("input.moreFiltersInput.dateFilter:nth(0)").datepicker("setDate",new Date(Math.min.apply(Math,_toConsumableArray(v))||h)),""==e(this).find("input.moreFiltersInput.dateFilter:nth(1)").val()&&e(this).find("input.moreFiltersInput.dateFilter:nth(1)").datepicker("setDate",new Date(Math.max.apply(Math,_toConsumableArray(v))||u))}catch(g){}try{h=parseInt(e(this).find("input.moreFiltersInput.dateFilter:nth(0)").datepicker("getDate").getTime(),10)||h}catch(g){}try{u=parseInt(e(this).find("input.moreFiltersInput.dateFilter:nth(1)").datepicker("getDate").getTime(),10)||u}catch(g){}}}p="";try{d="object"==_typeof(r[c])&&null!=r[c]?r[c].display:null!=r[c]?r[c]:"";d=e(e.parseHTML(d)).text().trim(),getAjaxIviewData&&(d=getDateBasedOnCulture(d)),p=getDateStamp(d)}catch(g){}""!=p&&(0!=h||0!=u)&&s.push(isNumberBetweenScope(h,u,p))}}),s.every(function(e){return e})}),e(document).on("dblclick","th.sorting, th.sorting_asc, th.sorting_desc, th.dt-right, th.dt-left",function(){try{ivirDataTableApi.order.neutral().draw()}catch(e){}}),e(document).on("click","#btnFilter",function(){e('[data-dropdown-value="moreFilters"]').attr("data-filter-type","search"),advFiltersObjectToApply={},ivirDataTableApi.draw(),setFilterInfo()}),e(document).on("click","#btnFilterApply",function(){var t=e("#advSearchName").val()||"a";if(-1!=e("#newViewTabId").find(".filter-body-cont").data("pillindex")||!checkForPillsLength("filter")||e("#newViewTabId").is(":visible")||isOpenSmartStepper)if(t){var i=getFiltersPillIndex(),a=i!=undefined;if(!e("#newViewTabId").is(":visible")&&!isOpenSmartStepper&&!ivirDuplicateCheck("filter",a,i))return!1;var r=JSON.stringify(generateSearchString("JSON"));if("{}"!=r)if(e("#newViewTabId").is(":visible")||isOpenSmartStepper){var n=[{n:t,data:JSON.parse(r)}];ivirMainObj.filter=n}else generateFilterPill(r,t,i),ivirDataTableApi.draw(),setFilterInfo(),e('[data-dropdown-value="moreFilters"]').attr("data-filter-type","filter");else showAlertDialog("info","Filter fields cannot be empty.")}else showAlertDialog("warning","Enter your filter name.")}),e(document).on("change","select.dateFilter",function(){var t=e(this).parent().nextAll(),i=e(t[0]).find("input.moreFiltersInput"),a=e(t[1]).find("input.moreFiltersInput"),r=generateAdvFilterDates(e(this).val());i.val(r.from),a.val(r.to),enableDisableDateField(t.find("input.moreFiltersInput"),"customOption"==e(this).val()?"enable":"disable")}),GetProcessTime(),GetTotalElapsTime()});var nxtScrollSize=100,defaultRecsPerPage=100,checkNextDBRowsExist=!0,dtPageNo=1,dtTotalRecords=0,dtDbTotalRecords=0,autoAppendRecords=!1,pageScrollToEnd=!1,scrollTopPosition=0;function createIvirDataTable(e,t,a,r){var n=$(".iviewTableWrapper")[0].offsetHeight+"px",l={},o="";if("clear"!=e&&"groupApply"!=e&&"group"!=e||(o=$("#pillsWrapper").html()),l.scrollY=n,l.scrollX=!0,l.dom="<'#ivirCustomContainer.container-fluid'<'row'<'#pillsWrapper.col-md-6 col-sm-6'><'col-md-6 col-sm-6 pull-right'l>>><'#ivirMainDataTableWrapper'<'iviewPreTableCustom'>t<'iviewPostTableCustom'>>",l.scrollCollapse=!0,l.colReorder=!1,l.language={search:"_INPUT_",searchPlaceholder:"Search...",lengthMenu:"Show _MENU_ rows",paginate:{next:'navigate_next',previous:'navigate_before'}},l.lengthMenu=[10,25,50,75,100,250,500],l.lengthChange=!1,l.buttons=[{extend:"copyHtml5",text:"Copy",title:IVIRCaption,exportOptions:{stripHtml:!0,trim:!1,stripNewlines:!1,decodeEntities:!1,columns:function(e,t,i){var a=ivirDataTableApi.column(e).visible(),r=!0;return("true"==isChkBox&&0==e||!a)&&(r=!1),r},rows:""}},{extend:"csvHtml5",text:"CSV",title:IVIRCaption,exportOptions:{stripHtml:!1,trim:!1,stripNewlines:!1,decodeEntities:!1,columns:function(e,t,i){var a=ivirDataTableApi.column(e).visible(),r=!0;return("true"==isChkBox&&0==e||!a)&&(r=!1),r},rows:""}},{extend:"excelHtml5",text:"Excel",title:IVIRCaption,exportHF:ivExportHF,exportOptions:{stripHtml:!1,trim:!1,stripNewlines:!1,decodeEntities:!1,columns:function(e,t,i){var a=ivirDataTableApi.column(e).visible(),r=!0;return("true"==isChkBox&&0==e||!a)&&(r=!1),r},rows:""},createEmptyCells:!0},{extend:"pdfHtml5",text:"PDF",title:IVIRCaption,exportHF:ivExportHF,exportOptions:{stripHtml:!1,trim:!1,stripNewlines:!1,decodeEntities:!1,columns:function(e,t,i){var a=ivirDataTableApi.column(e).visible(),r=!0;return("true"==isChkBox&&0==e||!a)&&(r=!1),r},rows:""},customize:function(e){e.defaultStyle.fontSize=8,e.styles.tableHeader.fontSize=8,e.content.filter(function(e){return e.table})[0].table.widths=Array(e.content.filter(function(e){return e.table})[0].table.body[0].length+1).join("%").split("")}},{extend:"print",text:"Print",title:"",exportHF:ivExportHF,exportOptions:{stripHtml:!1,trim:!1,stripNewlines:!1,decodeEntities:!1,columns:function(e,t,i){var a=ivirDataTableApi.column(e).visible(),r=!0;return("true"==isChkBox&&0==e||!a)&&(r=!1),r},rows:""}},{extend:"print",text:"HTML",title:"",exportHF:ivExportHF,exportOptions:{stripHtml:!1,trim:!1,stripNewlines:!1,decodeEntities:!1,columns:function(e,t,i){var a=ivirDataTableApi.column(e).visible(),r=!0;return("true"==isChkBox&&0==e||!a)&&(r=!1),r},rows:""},htmlExport:!0},{text:"JSON",title:IVIRCaption,action:function(e,t,i,a){this.processing(!0);var r=t.buttons.exportData();$.fn.dataTable.fileSave(new Blob([JSON.stringify(r)]),"".concat(IVIRCaption,".json")),this.processing(!1)}}],l.select={style:"multi"},l.paging=!0,l.pageLength=pageLength=-1,l.aaSorting=[],l.orderClasses=!1,l.initComplete=function(e,t){try{axDatatablePreInitComplete(e,t)}catch(r){}"hidden"!=$("#hdnIsParaVisible").val()&&$("[id=dvSelectedFilters]").removeClass("d-none"),$("#ivirCButtonsWrapper").removeClass("d-none"),appGlobalVarsObject._CONSTANTS.compressedMode&&appGlobalVarsObject.methods.toggleCompressModeUI($("body")),$(".animationLoading").hide();var i=$(".dataTables_scrollBody").hasScrollBar();($.isEmptyObject(advFiltersObjectToApply)||advFiltersObjectToApply.somedummyfilterjsobjectkey)&&(i?$("#requestNextRecords").hide():$("#requestNextRecords").show());var a=getSpecialRowCount();getAjaxIviewData&&(dtDbTotalRecords>nxtScrollSize||a>0)&&ivDatas.length>nxtScrollSize&&ivDatas.length!=undefined&&setTimeout(function(){var e=nxtScrollSize;defaultRecsPerPage=iviewDataWSRows;var t=0;if(dtDbTotalRecords>iviewDataWSRows)nxtScrollSize=t=defaultRecsPerPage,autoAppendRecords=!0;else{nxtScrollSize+=defaultRecsPerPage;var i=getSpecialRowCount();t=nxtScrollSize>dtDbTotalRecords?i>0?ivDatas.length:dtDbTotalRecords:nxtScrollSize}if(e=1e3&&(lazyBinding=!0,ivirDatatable.DataTable.settings[0].oInit.scroller=!0,$(ivirTable).trigger($.Event("preInit.dt"),ivirDatatable.DataTable.settings),$(ivirTable).trigger($.Event("init.dt"),ivirDatatable.DataTable.settings),setSmartViewHeight()),ivirDataTableApi.rows.add(a).draw(!1)}},0),autoSplitChecker(),responsiveColumnWidth;try{recordsExist=this.fnSettings().fnRecordsTotal()>0}catch(r){}try{axDatatablePostInitComplete(e,t)}catch(r){}setTimeout(function(){$(window).trigger("resize"),responsiveColumnWidth||forceColumnWidth()},0)},getAjaxIviewData){var s='\n \n question_mark\n \n ';l.preDrawCallback=function(e){scrollTopPosition=Math.round($(".dataTables_scrollBody").scrollTop())},l.drawCallback=function(e){try{axDatatablePreInDrawCallBack(e)}catch(t){}$("#GridView1 tbody").append($("#GridView1 tr.gtot-no-sort").detach()),enableMobileCards(),f(),b(),responsiveColumnWidth||forceColumnWidth();try{axDatatablePostInDrawCallBack(e)}catch(t){}}}else l.drawCallback=function(e){try{axDatatablePreInDrawCallBack(e)}catch(t){}enableMobileCards(),f(),responsiveColumnWidth||forceColumnWidth();try{axDatatablePostInDrawCallBack(e)}catch(t){}};if("true"==isChkBox||rowOptionsExist?l.columnDefs=[{targets:0,orderable:!1}]:l.columnDefs=[],e==undefined&&(getAllNumericColumns(),l.columnDefs.push({className:"dt-right",targets:numericColumns})),responsiveColumnWidth||(l.autoWidth=!1),getAjaxIviewData){if(l.columnDefs.push({targets:"_all",createdCell:createdCell}),l.createdRow=function(e,t,i){saveSubHeadInfo(e,t,i),"undefined"!=typeof rowRefreshIndex&&(i=rowRefreshIndex);try{if(cardTemplatingHTML)return cardTemplatingHTML=getLayoutHTML(cardTemplatingHTML),renderRowTemplete(cardTemplatingHTML,e,t,i),void(rowRefreshIndex=undefined)}catch(a){}!t[getPropertyAccess("axrowtype")]||"stot"!=t[getPropertyAccess("axrowtype")]&&"subhead"!=t[getPropertyAccess("axrowtype")]&&"gtot"!=t[getPropertyAccess("axrowtype")]||$(e).addClass("specialRow"),t[getPropertyAccess("axrowtype")]&&"gtot"==t[getPropertyAccess("axrowtype")]&&$(e).addClass("gtot-no-sort"),cellHeaderConf.root_class_index&&$(e).addClass(t[getPropertyAccess(cellHeaderConf.root_class_index)]?t[getPropertyAccess(cellHeaderConf.root_class_index)].toString():"");try{createdRowEndCustom(e,t,i)}catch(a){}rowRefreshIndex=undefined},tableWidth=0,visibleTableWidth=0,!responsiveColumnWidth)try{horizontalScrollExist=!0,$("#GridView1 thead tr th:eq(0)").removeClass("sorting_disabled"),widthIncrement=$("#GridView1 thead tr th:eq(0)").outerWidth()-$("#GridView1 thead tr th:eq(0)").width()||0}catch(F){widthIncrement=0}l.columns=FieldName.map(function(e,t){var i,a,r,n,l=(null===(i=ivirMainObj)||void 0===i?void 0:null===(a=i.design)||void 0===a?void 0:null===(r=a.filter(function(t){return t.name==e}))||void 0===r?void 0:null===(n=r[0])||void 0===n?void 0:n.width)||ivHeadRows[e]["@width"]||(isListView&&0==t?listViewCheckBoxSize:minCellWidth);return responsiveColumnWidth?"false"==(ivHeadRows[e]["@hide"].toString()||"true")&&(tableWidth+=parseInt(l,10)+widthIncrement):("false"==(ivHeadRows[e]["@hide"].toString()||"true")&&(visibleTableWidth+=parseInt(l,10)+widthIncrement),tableWidth+=parseInt(l,10)+widthIncrement),{data:getPropertyAccess(e),name:getPropertyAccess(e),width:"".concat(l,"px"),className:colAlign[ivHeadRows[e]["@align"]||("rowno"!=e||enableCardsUi?"Left":"Center")]}}),responsiveColumnWidth,$(ivirTable).css({width:"".concat(tableWidth,"px")}),l.data=ivDatas.length!=undefined?ivDatas.slice(0,nxtScrollSize):ivDatas,l.deferRender=!0}else l.columnDefs.push({targets:"_all",createdCell:function(e,t,i,a,r){isSpecialRow=!1;var n=FieldName[r];getPropertyAccess(n);""!=t&&" "!=t&&0!=r&&""!=HeaderText[r]&&"$nbsp;"!=HeaderText[r]&&enableCardsUi&&!cardTemplatingHTML&&($(e).children().wrap('
'),$(e).prepend(""));try{createdCellEndCustom(e,t,i,a,r)}catch(F){}$(e).attr("data-field-name",n)}});if(responsiveColumnWidth){var c=tableWidth||$("table#GridView1")[0].offsetWidth,d=$(window).width();("Iview"==document.title&&"undefined"!=typeof axpResp&&"true"==axpResp||c<=d)&&$(".gridData").css({width:"100%","min-width":"100%"})}if(r&&0!=r.length?(l.footerCallback=function(e,t,i,a,n){for(var l=this.api(),o=function(e){return"string"==typeof e?1*e.replace(/[\$,]/g,""):"number"==typeof e?e:0},s=0;s"+(checkNextDBRowsExist?"Running":"Grand")+" Total : "+commaSeparateNumber(total.toFixed(2)))}},ivirDataTableApi.fixedColumns().relayout(),$("#iviewFrame").removeClass("hideDatatableFooter")):$("#iviewFrame").addClass("hideDatatableFooter"),ivirVisibleColumns.length>0){if("group"==e||"groupApply"==e){v="groupApply"!=e?t:ivirMainObj.group[t].cl;var p=ivirVisibleColumns.indexOf(v);ivirVisibleColumns.splice(p,1);var h=$("[id^='grouppillCB']:checked");if(h.length){var u=h.data("index");u=ivirMainObj.group[u].cl,-1===$.inArray(u,ivirVisibleColumns)&&ivirVisibleColumns.push(u)}}("true"==isChkBox||rowOptionsExist)&&ivirVisibleColumns.push(0),l.columnDefs.push({targets:ivirVisibleColumns,visible:!0}),l.columnDefs.push({targets:"_all",visible:!1,searchable:searchHiddenColumnsInReports}),l.columnDefs.push({targets:0,searchable:!1})}if(e==undefined||"clear"==e){"clear"==e&&(groupingCol="",$(".rightClickMenu li.freeze").removeClass("d-none"),ivirDatatable.fnDestroy(),$(ivirTable+" tfoot td").html("")),l.columnDefs.push({targets:hiddenColumnIndex,visible:!1,searchable:searchHiddenColumnsInReports}),l.columnDefs.push({targets:0,searchable:!1}),$.fn.dataTable.moment("DD/MM/YYYY"),$.fn.dataTable.ext.errMode="none",$.fn.dataTable.Api.register("order.neutral()",function(){return this.iterator("table",function(e){e.aaSorting.length=0,e.aiDisplay.sort(function(e,t){return e-t}),e.aiDisplayMaster.sort(function(e,t){return e-t})})});try{l=$.isEmptyObject(newDtConfig=axUpdateDtConfig(l))?l:newDtConfig}catch(F){}ivirDataTableApi=$(ivirTable).DataTable(l),"clear"==e&&""!=o&&$("#pillsWrapper").html(o)}else if("group"==e||"groupApply"==e){var v="";"groupApply"!=e?v=t:(v=ivirMainObj.group[t].cl,a=ivirMainObj.group[t].t),groupingCol=v,$(".rightClickMenu li.freeze").addClass("d-none");var m=ivirDataTableApi.columns()[0].length;l.columnDefs.push({targets:v,visible:!1,searchable:!1}),l.columnDefs.push({targets:0,searchable:!1}),l.order=[[v,"asc"]],l.drawCallback=function(e){try{axDatatablePreInDrawCallBack(e)}catch(F){}enableMobileCards(),f();var t=this.api(),i=t.rows({page:"current"}).nodes(),r=null,n=e.aaSorting,l=[],o="",s=0;t.column(v,{page:"current"}).data().each(function(e,c){var d=e;if(anchorRegexPatter.test(e)&&(e=$(e).text()),r!==e){var p="";if(p+='',a==undefined||0==a.length)p+=''+d+"";else{p+=''+d+"";for(var h=0;h'+g+""}else p+='';else 0!==h&&(p+="")}}p+="",$(i).eq(c).before(p),r=e}if(n[n.length-1][0]==v&&a){var f=function(){for(var e=1;e<=a.length;e+=2){var t=a[e-1],i=a[e],r=$("#groupTotal"+o.replace(/[^a-z0-9\s]/gi,"").replace(/[_\s]/g,"")+i).text();"0.00"!==r&&""!==r||(r="0"),"avg"===t?(r/=s+1,$("#groupTotal"+o.replace(/[^a-z0-9\s]/gi,"").replace(/[_\s]/g,"")+i).text(r)):$("#groupTotal"+o.replace(/[^a-z0-9\s]/gi,"").replace(/[_\s]/g,"")+i).text(commaSeparateNumber(r))}};val=t.row(t.row($(i).eq(c)).index()).data(),""==o?o=e:o!==e?(f(),s=0,o=e):s++;var w=a[0],C=a[1],y=getPropertyAccess(a[2]);val=t.row(t.row($(i).eq(c)).index()).data();var x;x=y,val[x]="object"==_typeof(val[x])&&null!=val[x]?val[x].display:null!=val[x]?val[x]:"";var k=val[x].replace(/,/g,"");if(anchorRegexPatter.test(k)&&(k=$(k).text()),""!==(k=checkFroNegativeValue(k)))if(k=k||0,k=parseFloat(k),"sum"==w||"avg"==w)0!=l.length&&-1!=$.inArray(C,l)||l.push(C),$("#groupTotal"+e.replace(/[^a-z0-9\s]/gi,"").replace(/[_\s]/g,"")+C).text(parseFloat($("#groupTotal"+e.replace(/[^a-z0-9\s]/gi,"").replace(/[_\s]/g,"")+C).text())+k);else if("count"==w){var T=parseInt($("#groupTotal"+e.replace(/[^a-z0-9\s]/gi,"").replace(/[_\s]/g,"")+C).text())+1;$("#groupTotal"+e.replace(/[^a-z0-9\s]/gi,"").replace(/[_\s]/g,"")+C).text(T)}else if("max"==w){""===(S=$("#groupTotal"+e.replace(/[^a-z0-9\s]/gi,"").replace(/[_\s]/g,"")+C).text())&&(S=k-1),k>(S=parseInt(S))&&$("#groupTotal"+e.replace(/[^a-z0-9\s]/gi,"").replace(/[_\s]/g,"")+C).text(k)}else if("min"==w){var S;""===(S=$("#groupTotal"+e.replace(/[^a-z0-9\s]/gi,"").replace(/[_\s]/g,"")+C).text())&&(S=k+1),k<(S=parseInt(S))&&$("#groupTotal"+e.replace(/[^a-z0-9\s]/gi,"").replace(/[_\s]/g,"")+C).text(k)}(ivirDataTableApi.page.info().length-1==c||ivirDataTableApi.rows().count()-1==c&&0!==s)&&f()}}),b(),responsiveColumnWidth||forceColumnWidth();try{axDatatablePostInDrawCallBack(e)}catch(F){}},ivirDatatable.fnDestroy(),$(ivirTable+" tfoot td").html("");try{l=$.isEmptyObject(newDtConfig=axUpdateDtConfig(l))?l:newDtConfig}catch(F){}ivirDataTableApi=$(ivirTable).DataTable(l),""!=o&&$("#pillsWrapper").html(o),$(ivirTable+" tbody").off("click.grpClick"),$(ivirTable+" tbody").on("click.grpClick","tr.group",function(){var e=ivirDataTableApi.order()[0];e[0]===v&&"asc"===e[1]?ivirDataTableApi.order([v,"desc"]).draw():ivirDataTableApi.order([v,"asc"]).draw()})}if(ivirDataTableApi.on("buttons-processing",function(e,t){t||ShowDimmer(!1)}),ivirDatatable=$(ivirTable).dataTable(),getAjaxIviewData){var g=0;$(".dataTables_scrollBody").on("scroll",function(e){var t=Math.round($(this).scrollTop());if(t>g){var i=$(e.currentTarget),a=$(this).hasScrollBar()?i[0].scrollHeight-Math.round(i.scrollTop())<=i.outerHeight():i[0].scrollHeight-Math.round(i.scrollTop())iviewDataWSRows&&dtDbTotalRecords>nxtScrollSize)e=s=dtDbTotalRecords,autoAppendRecords&&setTimeout(function(){w()},0);else if(checkNextDBRowsExist){if(iviewDataWSRows<=nxtScrollSize){$("#rowsTxtCount").length?0==$("#requestNextRecords").length&&$("#rowsTxtCount").append("chevron_right"):0==$("#requestNextRecords").length&&$("#rowsTxtCountNew").append("chevron_right"),setSmartViewHeight();var t=$(".dataTables_scrollBody").hasScrollBar();($.isEmptyObject(advFiltersObjectToApply)||advFiltersObjectToApply.somedummyfilterjsobjectkey)&&(t?$("#requestNextRecords").hide():$("#requestNextRecords").show()),checkNextDBRowsExist||(s=dtDbTotalRecords)}}else s=dtDbTotalRecords;$("#lblCurPage").html("Rows: 1-"+e+" of "+(""==totRowCount?s:"")),hideDataTableLoading()}setSmartViewHeight()}function f(){enableCardsUi&&($("#GridView1 tbody td:visible").addClass("visibleMobileCol"),$("#GridView1 tbody td:hidden").addClass("hiddenMobileCol"),$("#GridView1").off("click.expandCollapse").on("click.expandCollapse","td:not(.isHyperlinkUI)",function(e){if($(e.target).parents(".rowOptionsExist").length>0)return!0;$(this).parents("tr").children("td").toggleClass("forceShow"),setSmartViewHeight()}),$("#GridView1 tbody tr").css("height",""))}function w(){showDataTableLoading();var e=nxtScrollSize;nxtScrollSize+=defaultRecsPerPage;var t=0;autoAppendRecords?(t=dtDbTotalRecords,autoAppendRecords=!1):(t=nxtScrollSize>dtDbTotalRecords?dtDbTotalRecords:nxtScrollSize,checkNextDBRowsExist=!0),ivirDataTableApi.rows.add(ivDatas.slice(e,t)).draw(!1)}setSmartViewHeight(),""!==fixedColumnsObj&&"group"!=e&&"groupApply"!=e&&(fixedColumnsObj=new $.fn.dataTable.FixedColumns(ivirDataTableApi,{iLeftColumns:fixedColumnsObj.s.iLeftColumns})),constuctDataButton(e);var C="";1==requestJSON&&"old"!=iviewButtonStyle?(C+="group"==e||"groupApply"==e?'\n \n ':"\n ".concat("modern"!=iviewButtonStyle?'':""),$("#ivirCButtonsWrapper").html("\n ".concat((iviewButtonStyle,""),"\n ").concat(C,"\n "))):("group"==e||"groupApply"==e?(C+='',C+=''):(C+='',C+=''),C+="",$("#ivirCButtonsWrapper").html(C)),ivirMainObj.chart==undefined?($("#ivirCButtonsWrapper").hide(),$("#pinnedivirCButtonsWrapper").hide()):($("#ivirCButtonsWrapper").show(),$("#PinnedivirCButtonsWrapper").show()),$("#iconsUl #myFiltersLi").hasClass("hidden")||$("#accordion")&&($("#accordion").find(".panel-collapse.collapse").removeClass("in"),requestJSON&&"old"!=iviewButtonStyle||$("#ivirCustomContainer").append($("#accordion")));ivirDataTableApi.columns();var y="",x="";if(0!==custBtnIVIR.length){y+='"}$("#customActionBtn").html(y+x),$("div.dataTables_filter input").addClass("ivirSearchFld form-control"),createMainEventsOnGrid(),ExecuteDatatableExport(),setSmartViewHeight()}function enableMobileCards(){(enableCardsUi||cardTemplatingHTML)&&$(".ivirMainGrid thead").hide(),enableCardsUi&&($("#GridView1").css({width:"calc(100vw - 20px)"}).addClass("cards"),$("#ivirMainDataTableWrapper").addClass("cardsWrapper")),cardTemplatingHTML&&$("#GridView1").css({"border-bottom":"initial"})}function autoSplitChecker(){var e="";if(getAjaxIviewData){if(ivConfigurations&&(!isMobile||isiPad))try{e=getCaseInSensitiveJsonProperty(ivConfigurations.filter(function(e,t){var i=getCaseInSensitiveJsonProperty(e,"PROPS");return i&&i.toString()&&"autosplit"==i.toString().toLowerCase()})[0],["PROPSVAL"]).toString()}catch(t){}}else e=$("#hdnAutoSplit").val();e!=undefined&&"true"==e.toLowerCase()&&callParentNew("assocateIframe(".concat(!0,")"),"function")}function getPropertyAccess(e){return isPerf&&!e.startsWith("@")?"@"+e.toUpperCase():e}function getColumnName(e){return isPerf&&e.startsWith("@")?e.substr(1).toLowerCase():e}function generateCellCheckbox(e){var t=e.td,i=(e.cellData,e.rowData),a=e.row,r=(e.col,e.colID,e.rowDataAccess,i[getPropertyAccess("rowno")]),n=!1;"undefined"!=typeof rowRefreshIndex&&"true"==isChkBox&&isCheckedRowRefresh&&(n=!0,isCheckedRowRefresh=!1);var l="";if(rowOptionsExist){var o=i.axrowoptions;l+='\n
\n \n arrow_drop_down\n \n \n
\n ")}return l+='
').concat("","
")}function generateFieldCheckbox(e){e.td;var t,i=e.cellData,a=(e.rowData,e.row,e.col,e.colID);e.rowDataAccess;return t="T"==i,'
')}function generateCellOnClick(e,t,i,a,r){var n="";try{r=void 0===r?ivDatas[parseInt(a)-1]:r}catch(o){r=[]}switch(t.toLowerCase()){case"action":case"script":n="javascript:callHLaction('".concat(i,"',").concat(a,",'").concat(iName,"','');setRefreshParent('false');");break;case"hyperlink":try{if(ivHyperlinks&&ivHyperlinks[i]){var l=ivHyperlinks[i]["@source"];l&&(n=$(generateCellHyperlink({td:e,cellData:r[l],rowData:r,row:a,col:FieldName.indexOf(l),colID:l,rowDataAccess:getPropertyAccess(l)})).attr("onclick")||"")}}catch(o){}}return n}function generateViewNavigation(e){e.td,e.cellData,e.rowData;var t=e.row,i=(e.col,e.colID,e.rowDataAccess,t+1),a="";return a=1==i&&1==dtDbTotalRecords?"single":1==i?"first":i!=dtDbTotalRecords||checkNextDBRowsExist?"middle":"last","&recPos=".concat(i,"&curPage=").concat(dtPageNo,"&pageType=").concat(a,"&openerIV=").concat(iName)}function htmlEncode(e){return $("
").text(e).html()}function htmlDecode(e){return $("
").html(e).text()}function generateExpColTree(e){var t=e.td,i=(e.cellData,e.rowData),a=(e.row,e.col,e.colID,e.rowDataAccess),r=$(t).html();if(cellHeaderConf.root_atype_index&&cellHeaderConf.root_account_index&&getPropertyAccess(cellHeaderConf.root_account_index)==a&&"group"==i[getPropertyAccess(cellHeaderConf.root_atype_index)].toString().toLowerCase()){var n=i[a].match(/^([\s]+)/g);n=null!=n?n[0].replace(/ /g," "):"",r="".concat(n,"").concat(r,"")}return r}function processCellData(e){var t=e.td,i=e.cellData,a=e.rowData,r=e.row,n=e.col,l=e.colID,o=e.rowDataAccess;if((i=void 0!==i&&null!=i?i.toString():"").indexOf("~")>-1&&(i=i.replace(/~/g,"
"))," "!=i&&0!=n){var s=i;-1!=s.indexOf(" ")&&(s=s.replace(/ /g," "))}else 0==n&&(i=(r+1).toString(),a[getPropertyAccess("rowno")]=i);switch(ColumnType[n]){case"c":i=trimIviewData?i.trim():i.replace(/ /g," ");break;case"n":if(""!=i&&" "!=i&&!i.toString().startsWith("("))if(isInValidNumber(i))i="0";else if("0"!=i&&isPerf&&ivHeadRows[l]["@dec"]&&(decimalVal=parseInt(ivHeadRows[l]["@dec"],10))&&!isInValidNumber(decimalVal)){var c=Number(i.toString().replace(/,/g,"")).toFixed(decimalVal),d="";c.indexOf(".")>-1&&(d=c.substr(c.indexOf(".")+1)||"",i.indexOf(".")>-1&&(i=i.substr(0,i.indexOf("."))),i=i+"."+d),i=Number(i).toFixed(decimalVal)}break;case"d":i=dateCellProcessor(i),a[o]=i}if(!a[getPropertyAccess("axrowtype")]||"stot"!=a[getPropertyAccess("axrowtype")]&&"subhead"!=a[getPropertyAccess("axrowtype")]&&"gtot"!=a[getPropertyAccess("axrowtype")]){if(bulkDownloadEnabled)if("axp_attach"==FieldName[n]){var p=/(dc[0-9]+_image+)|(axp_nga_){1}[a-zA-Z0-9]+/i;i=i.split(",").map(function(e){e=e.trim();var t=a[getPropertyAccess("transid")]||"",i=a[getPropertyAccess("fieldname")]||"",n="true"==(a[getPropertyAccess("isdbattach")]||""),l="";p.test(a[getPropertyAccess("fieldname")]||"")?l="gridattach":""==t&&""==i&&""!=e?(l="fullpath",t="-",i="-"):l=""==i?"header":"image";var o="gridattach"==l?(a[getPropertyAccess("recordid")]||"")+"-"+e:a[getPropertyAccess("recordid")]||"";if("fullpath"==l){o=CheckUrlSpecialChars(CheckUrlSpecialChars(e));var s=e.split(/\\|\//g);e=s[s.length-1]}if(resolveAttachmentPath)try{var c=SetFileToDownload(proj||"",t,i,o,l,a[getPropertyAccess("recordid")]||"",e,n,!0);c.length&&(e=c.filter(function(e){return e.indexOf("Error:")}).join(",")||"")}catch(d){}else e='"+e+"";return e}).join(",")}else if(requestJSON&&0==FieldName[n].toLowerCase().indexOf("axpfile_")){i=i.split(",").map(function(e,t,i){e=e.trim();var l=FieldName[n].substring(8),o=FieldName[n].substring(0,7),s=getCaseInSensitiveJsonProperty(a,getPropertyAccess(o+"Path_"+l)).toString().replace(/\*/g,"\\\\").split("\\").filter(function(e){return e}).join("\\\\")||"";s&&(s+="\\\\"),attachFileName=CheckUrlSpecialChars(CheckUrlSpecialChars(e));return e='"+e+""}).join(",");var h=$(i),u=$("
");h.filter(function(e,t){e<2?u.append(t):(0==u.find(".popover").length&&u.append('+'+(h.filter(function(e,t){return $(t).is("a")}).length-1)+'
'),","==$(t).text()&&(t=$("
")),u.find("a.axpFilePopOver .popover").append(t))}),i=u.html()}}else{switch(isSpecialRow=!0,SetAxFontCondition($(t),"fontstyle=b"),a[getPropertyAccess("axrowtype")]){case"stot":$(t).addClass("fontBlue");break;case"subhead":$(t).addClass("fontBlack");break;case"gtot":$(t).addClass("fontGreen")}"true"!=isChkBox&&!rowOptionsExist||0!=n||(i="")}return i}function dateCellProcessor(e){if(""!=e&&" "!=e)if(isPerf&&e.indexOf("T")>-1&&e.indexOf("-")>-1){var t=(e=e.split("T")[0]).split("-");e=t[2]+"/"+t[1]+"/"+t[0]}else e=getDateBasedOnCulture(e);else e="";return e}function tryParseNumeric(e,t){return null!==(e=e.toString().replace(/,/g,""))&&e.length>0&&!isNaN(e)&&(t=parseFloat(e)),t}function isInValidNumber(e){var t;return!(t=tryParseNumeric(e,""))&&0!==t}function getDateBasedOnCulture(e){if(""!=e){var t,i=e.split(" ");if(e=i[0],"en-us"==dtCulture)(t=e.split("/")).length>2&&(e=isPerf&&4==t[0].length?t[2]+"/"+t[0]+"/"+t[1]:t[1]+"/"+t[0]+"/"+t[2]);else(t=e.split("-")).length>2&&isPerf&&4==t[0].length&&(e=t[2]+"/"+t[1]+"/"+t[0]);i[1]&&(e="".concat(e," ").concat(i[1]))}return e}function generateCellHyperlink(e){var t,i=e.td,a=e.cellData,r=e.rowData,n=e.row,l=e.col,o=e.colID,s=e.rowDataAccess,c=$($(i).html()).find("input").hasClass("listViewDisabledCb"),d=a;if(d&&"false"==HideColumn[l]){var p="",h="",u="",v="",m="";if(ivConfigurations)try{m=getCaseInSensitiveJsonProperty(ivConfigurations.filter(function(e,t){var i=getCaseInSensitiveJsonProperty(e,"HLINK");return i&&i.toString()&&i.toString()==o&&"navigation"==getCaseInSensitiveJsonProperty(e,"PROPS").toString().toLowerCase()})[0],["PROPSVAL"]).toString()}catch(D){}ivHeadRows[o]["@map"]&&ivHeadRows[o]["@map"].split(",").forEach(function(e,t){if(e.indexOf("=:")>-1){var i=e.split("=:");h=i[0].indexOf(".")>-1?i[0].split(".")[1]:i[0],u=i[1],isListView&&"recordid"==u&&(h="recordid");var a=r[getPropertyAccess(u)];if(""!=(v=a||getParamsValueArray()[u]||"")&&(v=ReverseCheckSpecialChars(v),v=CheckUrlSpecialChars(v)),a&&ivHeadRows[u]["@type"]&&"d"==ivHeadRows[u]["@type"]&&""!=v){if((v=v.split(" ")[0]).split("-").length>2)var n=v.split("-");var l=Date.parse(n);!isNaN(l)&&l>0&&(v=n[0]+"/"+n[1]+"/"+n[2])}}p+="&"+h+"="+v}),p=(p=(p=p.split("#").map(function(e,t){return e.endsWith("&")&&t!=p.split("#").length-1?e+"#":t!=p.split("#").length-1?e+"%23":e}).join("")).replace(/\+/g,"%2b")).replace(/%3C/g,"l%3tC;"),0==(a=a.replace(/ /g," ")).indexOf("<")&&a.indexOf(">")==a.length-1||a.indexOf("<")>-1&&(a.indexOf("-1||a.indexOf("/>")>-1)||(a=CheckSpecialChars(a));var g="",b="false",f="false",w=c?'$(this).find("input:checkbox").prop("checked", !$(this).find("input:checkbox").prop("checked"));':"";if("undefined"!=typeof axp_refresh&&axp_refresh&&"true"==axp_refresh?g="&axp_refresh="+Convert.ToString(iviewObj.Axp_refresh):ivHeadRows[o]["@refresh"]?b=ivHeadRows[o]["@refresh"].toLowerCase():ivHeadRows[o]["@parentrefresh"]&&(b=ivHeadRows[o]["@parentrefresh"].toLowerCase()),t=ivHeadRows[o]["@hlaction"]){if("0"!=d.toString()){try{ivActions&&ivActions[t]?f=ivActions[t].r1.param1.Refresh.toLowerCase():ivScripts&&ivScripts[t]&&(f=ivScripts[t].r1.param1.Refresh.toLowerCase())}catch(D){}d='"+(c?$(i).html():a)+""}}else if(!(t=ivHeadRows[o]["@hlink"])||"Grand Total"==d||"stot"==r[getPropertyAccess("axrowtype")]&&"subhead"==r[getPropertyAccess("axrowtype")])"flist"==iName&&"reportname"==o?d="'+(c?$(i).html():a)+"":"response"==iName&&"rname"==o&&(d='').concat(c?$(i).html():a,""));else{var C="";C="subhead"==r[getPropertyAccess("axrowtype")]?" class=ivHeaderLink":" class=l2";var y=!!ivHeadRows[o]["@pop"]&&"true"==ivHeadRows[o]["@pop"].toLowerCase(),x="&hltype="+ivHeadRows[o]["@hltype"],k=t.substr(0,1);if(t=t.substr(1),":"==k){try{t=r[getPropertyAccess(t)]}catch(D){}k="",t&&(k=t.substr(0,1),t=t.substr(1))}if("0"!=d.toString())switch(k){case"t":var T="";T=isListView?"tstruct.aspx?transid=":"ivtstload.aspx?tstname=";var S=generateViewNavigation({td:i,cellData:a,rowData:r,row:n,col:l,colID:o,rowDataAccess:s}),O=T+""+t+p+x+"&torecid=false"+S;y?(O+=g,!viewNavigationData[o]&&(viewNavigationData[o]=[]),viewNavigationData[o][n]=O.replace("ivtstload.aspx?","tstruct.aspx?"),d="'+(c?$(i).html():a)+""):(!viewNavigationData[o]&&(viewNavigationData[o]=[]),viewNavigationData[o][n]=O.replace("ivtstload.aspx?","tstruct.aspx?"),d=""+(c?$(i).html():a)+"");break;case"i":if(y)d="'+(c?$(i).html():a)+"";else d=""+(c?$(i).html():a)+""}}}return d.startsWith("1&&arguments[1]!==undefined)||arguments[1],n="";if(i[getPropertyAccess("axp__font")]&&i[getPropertyAccess("axp__font")].split("~").forEach(function(e,t){if(e.startsWith(a+",")){var i=e.split(",");n+=i.reduce(function(e,t,i){switch(i){case 1:e+="fontname=".concat(t,",");break;case 2:e+="fontsize=".concat(t,",fontstyle=");break;case 3:e+="t"==t?"b":"";break;case 4:e+="t"==t?"i":"";break;case 5:e+="t"==t?"u":"";break;case 6:e+="t"==t?"s":"";break;case 7:e+=",fontcolor=".concat(t)}return e},"")}}),i[getPropertyAccess("axp__color")]&&i[getPropertyAccess("axp__color")].split("~").forEach(function(e,t){if(e.startsWith(a+",")){var i="",r=e.split(",");(i=(color=r[1])&&0==r[1].indexOf("$")&&9==color.length?"#"+[color[7],color[8],color[5],color[6],color[3],color[4]].join(""):r[1])&&(n&&(n+=","),n+="backcolor=".concat(i))}else if(isSpecialRow&&e.startsWith("$")){var l="";(l=0==e.indexOf("$")&&9==e.length?"#"+[e[7],e[8],e[5],e[6],e[3],e[4]].join("").toUpperCase():e)&&(n+=",fontcolor=".concat(l))}}),n&&r){var l=$(t);l.children().length&&SetAxFontCondition(l.children(),n),SetAxFontCondition(l,n)}return n}function getParamsValueArray(){var e=$("#hdnparamValues").val(),t=[];return"string"==typeof e&&e.replace(/¿/g,"♣").split("♣").forEach(function(e,i){if(e){var a=e.split("~");try{$("#".concat(CheckSpecialCharsInStr(a[0]))).hasClass("multiFldChk")&&_.isEqual(_.sortBy(_toConsumableArray(new Set(a[1].toString().split("`"))).filter(function(e){return""!=e})),_.sortBy(_toConsumableArray(new Set($("#".concat(CheckSpecialCharsInStr(a[0]))).data("valuelist").split($("#".concat(CheckSpecialCharsInStr(a[0]))).data("separator")))).filter(function(e){return""!=e})))&&(a[1]="ALL")}catch(r){}t[CheckSpecialCharsInStr(a[0])]=CheckSpecialCharsInStr(a[1].toString()).replace(/&grave;/g,"~")}}),t}function setSmartViewHeight(){var e=0;try{$(".dataTables_scrollFoot").length&&(e=$(".dataTables_scrollFoot")[0].offsetHeight)}catch(o){}var t=$(".iviewTableWrapper ").outerHeight(!0)-$(".iviewTableWrapper ").height(),i=0;if(!requestJSON||"old"==iviewButtonStyle)try{$("#dvPills").length&&(i=$("#dvPills")[0].offsetHeight)}catch(o){}var a=0;try{$(".ivcaptions").length&&(a=$(".ivcaptions").toArray().reduce(function(e,t){return e+$(t).outerHeight(!0)},0))}catch(o){}var r=0;try{$(".pageInformationNew").length&&(r=$(".pageInformationNew").outerHeight(!0)+$(".pageInformationNew").next().outerHeight(!0))}catch(o){}var n=0;try{$("#viewTabs").length&&(n=$("#viewTabs").outerHeight(!0))}catch(o){}var l=Math.round($("#breadcrumb-panel").outerHeight(!0)+$("#ivContainer").outerHeight(!0)+$(".iviewPreTableCustom").outerHeight(!0)+$(".iviewPostTableCustom").outerHeight(!0)+$(".dataTables_scrollHead").outerHeight(!0)+e+0+i+a+r+n+t);requestJSON&&"old"!=iviewButtonStyle||$("#ivContainer").outerHeight(!0)||(l-=14),$(".dataTables_scrollBody").height()>l?$(".dataTables_scrollBody").css({"max-height":"calc(100vh - ".concat(l,"px)"),height:"calc(100vh - ".concat(l,"px)")}):$(".dataTables_scrollBody").css({height:"calc(100vh - ".concat(l,"px)"),"max-height":"calc(100vh - ".concat(l,"px)")});try{lazyBinding&&$(".dataTables_scrollBody table + div").height($(".dataTables_scrollBody tbody").height()/$(".dataTables_scrollBody tbody tr").length*($(".dataTables_scrollBody tbody tr").length+(checkNextDBRowsExist?len=(ivDatas.length-$(".dataTables_scrollBody tbody tr").length)/4>1?len:1:0)))}catch(o){}}function ivirMoreFilters(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:-1;$("#newViewTabId span.customError").remove();var t=ivirDataTableApi.columns(),i=t[0].length,a="",r=$("#newViewTabId .filter-body-cont").parent();return 1==r.length?(r.find(".filter-body-cont").attr("data-pillindex",e).data("pillindex",e),a=r.detach(),initAdvFilters=!1):(initAdvFilters=!0,i>0?(a+='
'+'')+'
')+'',t.every(function(e){if(-1==hiddenColumnIndex.indexOf(e)){var t=$(this.header()).text().trim(),i=$(this.header()).attr("id").replace("GridView1_ctl01_","");if(""!=i&&"rowno"!=i){var r=ivirColumnTypeObj[i];a+='")}}}),a+='
').concat(getInnerAdvFilter(i,r,e),"
"):a+="No Columns to filter."),a}function getInnerAdvFilter(e,t,i){var a="";switch(t){case"c":a+='
');break;case"n":a+='
');break;case"d":a+='
calendar_today
calendar_today
');break;case"t":a+="Time"}return a}function initMoreFiltersAddOns(){var e=$('[data-dropdown-value="moreFilters"]').attr("data-filter-type"),t=$("#newViewTabId .filter-body-cont").parent().find(".filter-body-cont").data("pillindex");openFilters||"filter"!=e&&-1!=t&&e!=undefined||resetMoreFilters(),($("#newViewTabId").is(":visible")||isOpenSmartStepper)&&"undefined"==typeof ivirMainObj.filter&&void 0!==t&&(t=-1),initAdvFilters&&($(".moreFiltersInput.characterFilter").each(function(){var e=_toConsumableArray(new Set(ivirDataTableApi.cells(ivirDataTableApi.rows(":not(.specialRow)").nodes(),parseInt($(this).data("index"),10)).data().toArray().map(function(e){return $($.parseHTML(e)).text()})));e.indexOf("")>-1&&e.splice(e.indexOf(""),1);var t=$.map(e,function(e,t){return{id:e,text:e}});$(this).select2({allowClear:!0,data:t,placeholder:appGlobalVarsObject.lcm[441]}).on("select2:select",function(e){})}),AddDatePicker("newViewTabId")),-1!=t?(pushSearchStringtoFilters(ivirMainObj.filter[t].data,"JSON"),$("#advSearchName").val(ivirMainObj.filter[t].n),$("#btnFilterApply").val(btnFilterApplyEditVal),$("#btnFilter").hide()):($("#newViewTabId").is(":visible")||isOpenSmartStepper)&&ivirMainObj.filter&&ivirMainObj.filter.length>0?(pushSearchStringtoFilters(ivirMainObj.filter[0].data,"JSON"),$("#advSearchName").val(ivirMainObj.filter[0].n),$("#btnFilterApply").val(btnFilterApplyEditVal),$("#btnFilter").hide()):($("#btnFilterApply").val(btnFilterApplyVal),$("#btnFilter").show()),openFilters&&(openFilters=!1,pushSearchStringtoFilters($("#myFiltersPillInfo").data("filterJsonObj"),"JSON")),$("#resetMoreFilters").show(),$("#btnFilter").show(),($("#newViewTabId").is(":visible")||isOpenSmartStepper)&&($("#resetMoreFilters").hide(),$("#btnFilter").hide()),ivirbindEvents("filter")}function pushSearchStringtoInput(){var e=$("#ivInSearchInput");e.val(generateSearchString()),e.trigger("keyup")}function generateSearchString(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"string",t="",i={};return $("tr[data-coltype]").each(function(){switch($(this).data("coltype")){case"c":var e=$(this).find(".moreFiltersInput.characterFilter:nth(0)"),a=e.select2("data").map(function(e){return e.text}).join("`");""!=a&&(t+="".concat(e.data("field"),":=>").concat(a,":::"),i["".concat(e.data("field"))]=a);break;case"n":var r=0,n=0,l=$(this).find(".moreFiltersInput.numericFilter:nth(0)"),o=$(this).find(".moreFiltersInput.numericFilter:nth(1)");if(""!=l.val()||""!=o.val()){var s=[];try{var c=getPropertyAccess(l.data("field"));s=generateUniqueColumnVals($(this).data("coltype"),c+":name"),""==l.val()&&l.val(Math.min.apply(Math,_toConsumableArray(s))||r),""==o.val()&&o.val(Math.max.apply(Math,_toConsumableArray(s))||n)}catch(p){}}r=parseFloat(l.val())||r,n=parseFloat(o.val())||n,0==r&&0==n||(t+="".concat(l.data("field"),":=><=").concat(r,"=><=").concat(n,"=>:::"),i["".concat(l.data("field"))]={},i["".concat(l.data("field"))].min=r,i["".concat(l.data("field"))].max=n);break;case"d":r="",n="",l=$(this).find("input.moreFiltersInput.dateFilter:nth(0)"),o=$(this).find("input.moreFiltersInput.dateFilter:nth(1)");if(""!=l.val()||""!=o.val()){s=[];try{c=getPropertyAccess(l.data("field"));s=generateUniqueColumnVals($(this).data("coltype"),c+":name"),""==l.val()&&l.datepicker("setDate",new Date(Math.min.apply(Math,_toConsumableArray(s))||r)),""==o.val()&&o.datepicker("setDate",new Date(Math.max.apply(Math,_toConsumableArray(s))||n))}catch(p){}}r=l.val()||r,n=o.val()||n;var d=$(this).find("select.moreFiltersInput.dateFilter");"customOption"!=d.val()?(t+="".concat(l.data("field"),":=>").concat(d.val(),":::"),i["".concat(l.data("field"))]=d.val()):""==r&&""==n||(t+="".concat(l.data("field"),":=><=").concat(r,"=><=").concat(n,"=>:::"),i["".concat(l.data("field"))]={},i["".concat(l.data("field"))].min=r,i["".concat(l.data("field"))].max=n)}}),t=t.endsWith(":::")?t.substr(0,t.length-3):t,"string"==e?t:"JSON"==e?i:""}function pushSearchStringtoFilters(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"string",i=$("#ivInSearchInput"),a="string"==t?i.val().split(":::").sort():Object.keys(e);$(a).each(function(i,a){if("string"==t)var r=(a=a.trim()).split(":=>"),n=r[0],l=r[1];else l="string"==typeof e[n=a]?e[n].trim():e[n];$("tr[data-field]").filterByData("field",n).each(function(e,t){if($(t).data("field")==n)switch($(t).data("coltype")){case"c":var i=$(t).find(".moreFiltersInput.characterFilter:nth(0)");l=l.split("`"),requestJSON,i.val(l).trigger("change");break;case"n":var a=$(this).find("input.moreFiltersInput.numericFilter:nth(0)"),r=$(this).find("input.moreFiltersInput.numericFilter:nth(1)");if("object"==_typeof(l))a.val(l.min),r.val(l.max);else{var o=l.substr(2,l.length-4).split("=><=");a.val(o[0]),r.val(o[1])}break;case"d":a=$(this).find("input.moreFiltersInput.dateFilter:nth(0)"),r=$(this).find("input.moreFiltersInput.dateFilter:nth(1)");var s=$(this).find("select.moreFiltersInput.dateFilter");if("object"==_typeof(l))a.val(l.min),r.val(l.max),s.val("customOption");else if(l.indexOf("=><=")>-1){o=l.substr(2,l.length-4).split("=><=");a.val(o[0]),r.val(o[1]),s.val("customOption")}else s.val(l);"customOption"!=s.val()&&s.trigger("change")}})})}function resetMoreFilters(){$("input.moreFiltersInput").val(""),$("select.moreFiltersInput.characterFilter").each(function(){$(this).val("").trigger("change")}),$("select.moreFiltersInput.dateFilter option:first-child").prop("selected",!0),$("select.moreFiltersInput.dateFilter").trigger("change"),$("#btnFilterApply").val(btnFilterApplyVal),$("#btnFilter").show()}function checkFroNegativeValue(e){return e&&"("===(e=e.trim()).substr(0,1)&&")"===e.substr(-1,1)&&(e=e.substring(1,e.length-1),e=-parseInt(e)),e}function createMainEventsOnGrid(){$(".dataTables_scrollHead thead th").off("contextmenu"),$(".dataTables_scrollHead thead th").on("contextmenu",function(e){if(3==e.which){e.preventDefault();var t=$(e.target).find(".rightClickMenuIcn");createRightClick(e,ivirDataTableApi.column(t.parents("th")).index())}}),$(".dataTables_scrollHead thead th .rightClickMenuIcn").off("click"),$(".DTFC_LeftHeadWrapper thead th .rightClickMenuIcn").off("click"),$(".DTFC_LeftHeadWrapper thead th .rightClickMenuIcn").on("click",function(e){e.preventDefault(),e.stopPropagation();var t=$(this);createRightClick(e,ivirDataTableApi.fixedColumns().cellIndex(t.parents("th")).column)}),$(".dataTables_scrollHead thead th .rightClickMenuIcn").on("click",function(e){e.preventDefault(),e.stopPropagation();var t=$(this);createRightClick(e,ivirDataTableApi.column(t.parents("th")).index())}),$(".dataTables_scrollHead thead th .rightClickMenuIcn").off("keydown"),$(".dataTables_scrollHead thead th .rightClickMenuIcn").on("keydown",function(e){if(32==(e.keyCode||e.which)){e.preventDefault();var t=$(this),i=(e=t.offset(),{});i.pageX=e.left,i.pageY=e.top,createRightClick(i,ivirDataTableApi.column(t.parents("th")).index())}}),$(ivirTable).on("draw.dt",function(){$("#divModalAdvancedFilters").is(":visible")&&$("#btnModalClose").click()})}function getAllNumericColumns(){numericColumns=[],$(ivirTable+" thead tr:last th").each(function(e,t){headerCaption=$(this).text().trim(),headerName=$(this).attr("id").replace("GridView1_ctl01_",""),"n"==ivirColumnTypeObj[headerName]&&numericColumns.push(e)})}function freezeColumn(e){if(e+=1,fixedColumnsObj&&e==fixedColumnsObj.s.iLeftColumns)return fixedColumnsObj="",allGrandTotal&&allGrandTotal.length>0?createIvirDataTable("clear","","",allGrandTotal):createIvirDataTable("clear"),!1;$(".rightClickMenu li.freeze i").not("#rightClickMenu"+(e-1)+" li i").removeClass("icon icon-arrows-check"),""!=fixedColumnsObj?(fixedColumnsObj.s.iLeftColumns=e,fixedColumnsObj.fnRedrawLayout()):fixedColumnsObj=new $.fn.dataTable.FixedColumns(ivirDataTableApi,{iLeftColumns:e}),$(".DTFC_LeftBodyWrapper .ivirCustomHighlight,.DTFC_LeftBodyWrapper .ivirCustomHighlightCell").removeClass("ivirCustomHighlight").css({"background-color":"",color:""}),$(".DTFC_LeftHeadWrapper thead th .rightClickMenuIcn").off("click"),$(".DTFC_LeftHeadWrapper thead th .rightClickMenuIcn").on("click",function(e){e.preventDefault(),e.stopPropagation();var t=$(this);createRightClick(e,ivirDataTableApi.fixedColumns().cellIndex(t.parents("th")).column)}),$(".DTFC_LeftHeadWrapper thead th").off("contextmenu"),$(".DTFC_LeftHeadWrapper thead th").on("contextmenu",function(e){3==e.which&&(e.preventDefault(),$(e.target).find(".rightClickMenuIcn").click())})}function colAscDsc(e,t){ivirDatatable.fnSort([t,e]),"asc"==e?$("#rightClickMenu"+t+" li.desc i").removeClass("icon-arrows-check"):$("#rightClickMenu"+t+" li.asc i").removeClass("icon-arrows-check")}function toggleGrandTotal(e){if($("#rightClickMenu"+e+" li.columnGrndTotal i").hasClass("icon-arrows-check")){var t=allGrandTotal.indexOf(e);allGrandTotal.splice(t,1)}else-1===$.inArray(e,allGrandTotal)&&allGrandTotal.push(e);""===groupingCol?createIvirDataTable("clear","","",allGrandTotal):createIvirDataTable("groupApply",$("[id^='grouppillCB']:checked").data("index"),"",allGrandTotal)}function createRightClick(e,t){if(void 0===t||"0"==t)return!1;var i=$("#rightClickMenu"+t);if(0==i.length){var a='",$("body").append(a),i=$("#rightClickMenu"+t)}if(i.is(":visible")&&i.data("index")==t)i.hide();else{""!=groupingCol&&i.find("li.freeze").addClass("d-none");var n=getTheOrderOfCol(t);"empty"!=n&&(i.find("li.asc i,li.desc i").removeClass("icon-arrows-check"),"asc"==n?i.find("li.asc i").addClass("icon-arrows-check"):i.find("li.desc i").addClass("icon-arrows-check")),-1!==$.inArray(t,allGrandTotal)?i.find("li.columnGrndTotal i").addClass("icon-arrows-check"):i.find("li.columnGrndTotal i").removeClass("icon-arrows-check"),$(".rightClickMenu").hide(),i.data("index",t);var l=e.pageX,o=e.pageY;i.css({top:o,left:l});var s=i.width(),c=i.height(),d=$(window).width(),p=$(window).height(),h=Math.round($(window).scrollTop());l+s>d&&i.css({left:l-s}),o+c>p+h&&i.css({top:o-c}),i.show(),$(document).unbind("keydown.upDownEvents"),highlightAndBindUpDown(i,t,".rightClickMenu ul li")}}function highlightAndBindUpDown(e,t,i){var a=e.find("ul li").not(".subHeader"),r=a;if(r.siblings().removeClass("highlightOption"),".js-dropdown ul li"===i){var n=!0,l=e.find(".js-dropdown__input").val().toLowerCase();r.each(function(e,t){var i=$(t).data("dropdown-value");if(i=i.toLowerCase(),l===i)return $(this).addClass("highlightOption"),r=$(this),n=!1,!1}),n&&(r.first().addClass("highlightOption"),r=r.first()),a.off("mouseover.drpListHover"),a.on("mouseover.drpListHover",function(){$(".highlightOption").removeClass("highlightOption"),r=$(this),$(this).addClass("highlightOption")})}else r.first().addClass("highlightOption"),r=r.first();$(document).unbind("keydown.upDownEvents"),$(document).bind("keydown.upDownEvents",i,function(e){switch(e.which){case 38:r.is(":first-child")||1===r.index()&&1===r.prev(".subHeader").length||(e.preventDefault(),r.hasClass("highlightOption")&&(r.removeClass("highlightOption"),(r=r.prevAll().not(".subHeader").first()).addClass("highlightOption")));break;case 13:case 32:if(r.hasClass("highlightOption"))if(r.hasClass("desc"))colAscDsc("desc",t);else if(r.hasClass("asc"))colAscDsc("asc",t);else if(r.hasClass("freeze"))freezeColumn(t);else if(r.hasClass("columnGrndTotal"))toggleGrandTotal(t);else if(r.hasClass("dropDownButton__item")){var i=r,a=i.parents(".js-dropdown");a.find(".js-dropdown__input").data("index",i.data("index")).val(i.data("dropdown-value")).change(),a.hasClass("ivirActionDrpDwn")?a.find(".js-dropdown__current").text("Options"):a.find(".js-dropdown__current").attr("title","Search "+i.text()).text(i.text()),a.removeClass("is-open"),$(document).unbind("keydown.upDownEvents"),e.preventDefault(),e.stopPropagation()}break;case 40:r.is(":last-child")||(e.preventDefault(),r.hasClass("highlightOption")&&(r.removeClass("highlightOption"),(r=r.nextAll().not(".subHeader").first()).addClass("highlightOption")));break;case 9:r.parents(".js-dropdown").hasClass("is-open")&&(r.parents(".js-dropdown").removeClass("is-open"),$(document).unbind("keydown.upDownEvents"));break;default:return}})}function getTheOrderOfCol(e){var t=ivirDataTableApi.order(),i=t.length,a="empty";if(i>0)for(var r=0;r]*>([\s\S]*?)/g.test("object"==_typeof(a[r])&&null!=a[r]?a[r].display:null!=a[r]?a[r]:"")&&(initialChkup.isAnchor=r)}})}function highlightBindEvents(){$(document).on("focusout","#ivirbgColorValue",function(){var e=$(this).val(),t=tinycolor(e);t.isValid()&&$("#ivirbgColor").spectrum("set",t)}),$(document).on("focusout","#ivirtxtColorValue",function(){var e=$(this).val(),t=tinycolor(e);t.isValid()&&$("#ivirtxtColor").spectrum("set",t)})}function highlightUnBindEvents(){$(document).off("focusout","#ivirbgColorValue"),$(document).off("focusout","#ivirtxtColorValue")}function checkDuplicateViewName(){var e=$("#viewCaption").val();return!($("#viewTabs").find("a span[data-caption="+e.replace(/ /g,"\\ ")+"]").length>0)||(ivirCustomErrMsg($("#viewCaption"),errorMessages.duplicateFld.replace("{0}","View")),!1)}function validateViewName(){var e=$("#viewCaption").val();return!!/^[0-9a-zA-Z\_ ]+$/.test(e)||(ivirCustomErrMsg($("#viewCaption"),errorMessages.invalidName),!1)}function highlightTheFirstFld(){for(var e=$(".jconfirm-box-container").find(":focusable"),t=0;t=maxNoOfPills){if(maxNoOfPills<1){var i=errorMessages.maxPills.replace(/_type_/g,e);showAlertDialog("warning",i)}return $("#IvirActions").val(""),requestJSON&&"old"!=iviewButtonStyle&&"chart"!=e&&(maxNoOfPills=5),!0}}}function ivirbindEvents(e){var t=e.toLowerCase();jQuery(document).bind("keyup.cnfrmPopupKU",function(e){}),jQuery(document).bind("keydown.cnfrmPopupKD",function(e){var t='button[tabindex!="-1"],a[tabindex!="-1"],input[tabindex!="-1"],select[tabindex!="-1"],textarea[tabindex!="-1"]';e.shiftKey||9!=e.keyCode?e.shiftKey&&9==e.keyCode?$(document.activeElement)[0]==$(".jconfirm-box").find(t).first()[0]&&(e.preventDefault(),$(".jconfirm-box").find(t).last().focus()):27==e.keyCode&&(e.preventDefault(),$(".jconfirm-box .jconfirm-buttons .coldbtntiny").click()):$(document.activeElement)[0]==$(".jconfirm-buttons button:last")[0]&&(e.preventDefault(),$(".jconfirm-box").find(t).first().focus())}),$("#ivirHighlightWrapper .colorPicker").on("blur.accessColor",function(){$(this).val($($(this).next()).spectrum("get").toHexString())}),$(".dialogInptFld").on("keydown.dlgKD",function(){var e=$(this);e.next().hasClass("customError")&&e.next("span.customError").remove()}),$(".dialogSlctFld").on("change.dlgKD",function(){var e=$(this);e.next().hasClass("customError")&&e.next("span.customError").remove()}),"column"==t?($(document).on("change","#showAllColumns, .showAllColumns",function(e){if(isListView&&""!=$("#hdnListViewFieldsJSON").val()){var t=$(this).parents(".lstColSelWrapper"),i=$(this).data("isgrid");$(this).is(":checked")?t.find(".ivirLabelWrapper input:checkbox:not('.disabled')").prop("checked",!0):(t.find(".ivirLabelWrapper input:checkbox:not('.disabled')").prop("checked",!1),0!==t.find(".ivirLabelWrapper input:checkbox:checked").length||i||t.find(".ivirLabelWrapper input:checkbox:not('.disabled'):first").prop("checked",!0)),i&&$(this).is(":checked")&&$(".lstColSelWrapper").each(function(e,i){!$(i).is(t)&&$(i).find(".showAllColumns").data("isgrid")&&$(i).find("input:checkbox:not('.disabled')").prop("checked",!1)}),$("#selColHypOpts").html($(".lstColSelWrapper").map(function(e,t){return $(t).find(".ivirLabelWrapper input:checkbox:checked").map(function(e,t){return"")}).toArray().join("")}).toArray().join(""))}else $(this).is(":checked")?$("#ivirshowHideColumnWrapper div.checkbox input:not('.disabled')").prop("checked",!0):($("#ivirshowHideColumnWrapper .customCheckBox:not('.disabled')").prop("checked",!1),0===$("#ivirshowHideColumnWrapper .customCheckBox:checked").length&&$("#ivirshowHideColumnWrapper .customCheckBox:not('.disabled'):first").prop("checked",!0))}),$(document).on("change","#ivirshowHideColumnWrapper .customCheckBox",function(e){if(isListView&&""!=$("#hdnListViewFieldsJSON").val()){var t=$(this).parents(".lstColSelWrapper"),i=t.find(".showAllColumns"),a=i.data("isgrid");$(this).is(":checked")?t.find(".ivirLabelWrapper input:checkbox:not(:checked)").length>0?i.prop("checked",!1):i.prop("checked",!0):(i.prop("checked",!1),0!==t.find(".ivirLabelWrapper input:checkbox:checked").length||a||t.find(".ivirLabelWrapper input:checkbox:not('.disabled'):first").prop("checked",!0)),a&&$(this).is(":checked")&&$(".lstColSelWrapper").each(function(e,i){!$(i).is(t)&&$(i).find(".showAllColumns").data("isgrid")&&$(i).find("input:checkbox:not('.disabled')").prop("checked",!1)}),$("#selColHypOpts").html($(".lstColSelWrapper").map(function(e,t){return $(t).find(".ivirLabelWrapper input:checkbox:checked").map(function(e,t){return"")}).toArray().join("")}).toArray().join(""))}else $(this).is(":checked")?$(".ivirLabelWrapper input:checkbox:not(:checked)").length>0?$("#showAllColumns").prop("checked",!1):$("#showAllColumns").prop("checked",!0):$("#showAllColumns").prop("checked",!1)})):"sort"==t?($(document).on("click","#ivirSortColumnWrapper .ascDscWrapper button",function(e){var t=$(this),i=$($(this).parent());i.find("button span").removeClass("active"),t.find("span").addClass("active"),i.parent().find('input[type="checkbox"]').prop("checked",!0)}),$(document).on("click","#clearSorting",function(e){$("#ivirSortColumnWrapper .labelSelected").removeClass("labelSelected"),$("#ivirSortColumnWrapper input[type='checkbox']").prop("checked",!1),$("#ivirSortColumnWrapper .ascDscWrapper button span").removeClass("active")}),$(document).on("click",".ivirSortLabel",function(e){var t=$(this).parent(".ivirLabelWrapper");$("#ivirSortColumnWrapper .labelSelected").removeClass("labelSelected"),t.hasClass("labelSelected")?t.removeClass("labelSelected"):t.addClass("labelSelected")}),$(document).on("change",'#ivirSortColumnWrapper input[type="checkbox"]',function(e){$(this).is(":checked")?$(this).parent().find("span.ascDscWrapper").find("button span:first").addClass("active"):$(this).parent().find("span.ascDscWrapper").find("button span").removeClass("active")}),assignKeyDownDrag("ivirSortColumnWrapper")):"highlight"==t?$(document).on("change","#ivirHighlightCol",function(e){var t=$(this).data("lastColType"),i=$(this).find("option:selected").data("type");if("d"==i?$("#ivirHltValue").attr("type","date"):$("#ivirHltValue").attr("type","text"),$(this).data("lastColType",i),t==undefined||t!=i){var a="";"c"==i?(a+="",a+="",a+="",a+="",a+=""):"n"!=i&&"d"!=i||(a+="",a+="",a+="",a+="",a+="",a+=""),$("#ivirHighlightCndtn").html(a)}}):"group"==t&&$(document).on("change","#grpColName",function(e){var t,i=$(this);tmpGroupObj={},htmlToShow='
',htmlToShow+=getRowGroupingCondtionHtml(),htmlToShow+="
",$("#ivirTotalCndtnWrapper").data("cndtns",[1]).attr("data-cndtns","[1]").html(htmlToShow),""===i.val()?$("#ivirTotalCndtnWrapper").hide():($("#ivirTotalCndtnWrapper").show(),tmpGroupObj.groupIndex=$(this).find("option:selected").data("index")),$("select.stepperSelect.totalAggrFunction, select.stepperSelect.totalSource").select2({allowClear:!0,placeholder:appGlobalVarsObject.lcm[441]}),null===(t=KTApp)||void 0===t||t.initBootstrapTooltips()})}function ivirRemovebindEvents(e){jQuery(document).unbind("keydown.cnfrmPopupKD"),jQuery(document).unbind("keyup.cnfrmPopupKU"),$(".dialogInptFld").off("keydown.dlgKD"),$(".dialogInptFld").off("change.dlgKD");var t=e.toLowerCase();"column"==t?$(document).off("change","#showAllColumns, .showAllColumns"):"sort"==t?($(document).off("click","#ivirSortColumnWrapper .ascDscWrapper button"),$(document).off("click","#clearSorting"),$(document).off("click",".ivirSortLabel"),$(document).off("change",'#ivirSortColumnWrapper input[type="checkbox"]'),$(document).off("keydown.upAndDown")):"highlight"==t?($("#ivirHighlightWrapper .colorPicker").off("blur.accessColor"),$(document).off("change","#ivirHighlightCol")):"group"==t&&$(document).off("change","#grpColName")}function assignKeyDownDrag(e){$(document).on("keydown.upAndDown",function(e){var t=$("#ivirSortColumnWrapper .ivirLabelWrapper.labelSelected");38==e.keyCode?0!=t.index()&&(t.prev().addClass("labelSelected"),t.removeClass("labelSelected")):40==e.keyCode?t.index()!=t.parent().find(".ivirLabelWrapper").last().index()&&(t.next().addClass("labelSelected"),t.removeClass("labelSelected")):32==e.keyCode&&(e.preventDefault(),$("#ivirSortColumnWrapper .ivirLabelWrapper.labelSelected .ascDscWrapper button span:not('.active')").first().click())})}function ivirMoveUpDown(e,t){var i=$("#"+t).find("div.labelSelected");"up"==e?0!=i.index()&&i.insertBefore(i.prev()):"down"==e&&i.index()!=i.parent().find(".ivirLabelWrapper").last().index()&&i.insertAfter(i.next())}function ivirshowHideColumns(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(requestTstructFieldsObj(),isListView&&""!=$("#hdnListViewFieldsJSON").val()){if(0==$("#ivirshowHideColumnWrapper div.checkbox input:checked").length&&0==e.length)return showAlertDialog("warning",errorMessages.columnSelection),!1;if(e=[],$("#ivirshowHideColumnWrapper div.checkbox:visible").length>0){if((e=[]).push({hyperlink:$("#selColHypOpts").val(),dcs:$("#ivirshowHideColumnWrapper div.checkbox:visible input:checked").toArray().reduce(function(e,t,i){return e[$(t).data("dcno")]||(e[$(t).data("dcno")]={},e[$(t).data("dcno")].fields=[],e[$(t).data("dcno")].isGrid=$(t).data("isgridfield")),e[$(t).data("dcno")].fields.push($(t).data("name")),e},{})}),e){var t=_.map(e[0].dcs,function(e){return e.fields}).reduce(function(e,t){return e=[].concat(_toConsumableArray(e),_toConsumableArray(t))},[]).join(",");if($("#hdnLvSelectedCols").val()!=t||$("#hdnLvSelectedHyperlink").val()!=e[0].hyperlink){$("#hdnLvSelectedCols").val(t),$("#hdnLvSelectedHyperlink").val(e[0].hyperlink),$("#hdnLvChangedStructure").val("");var i=$(".viewtabEdit").parents("li.active").find(".viewtabEdit").data("name")||"main";loadViewName=i,$("#button1").trigger("click")}}viewLoadedColumns=!1}else e.length>0?viewLoadedColumns=!0:viewLoadedColumns=!1;requestJSON&&"old"!=iviewButtonStyle&&(1==e.length&&"!"==e[0]&&(e=[],viewLoadedColumns=!1),e.length>0?ivirMainObj.visibleColumns=e:0==e.length&&(delete ivirMainObj.visibleColumns,$("#newViewcolumns").val("")),($("#newViewTabId").is(":visible")||isOpenSmartStepper)&&ivirMainObj.visibleColumns&&ivirMainObj.visibleColumns.length>0&&$("#newViewcolumns").val(JSON.stringify({visible:ivirMainObj.visibleColumns})))}else{if(0==$("#ivirshowHideColumnWrapper div.checkbox input:checked").length&&0==e.length)return showAlertDialog("warning",errorMessages.columnSelection),!1;if($("#ivirshowHideColumnWrapper div.checkbox:visible").length>0?(e=[],$(ivirTable).css("width","auto"),$("#ivirshowHideColumnWrapper div.checkbox").each(function(t,i){var a=$(this).find("input");a.is(":checked")?$("#newViewTabId").is(":visible")||isOpenSmartStepper||(ivirVisibleColumns.push(a.data("index")),ivirDataTableApi.column(a.data("index")).visible(!0)):(e.push(FieldName[a.data("index")]),$("#newViewTabId").is(":visible")||isOpenSmartStepper||ivirDataTableApi.column(a.data("index")).visible(!1))}),viewLoadedColumns=!1):e.length>0?(FieldName.forEach(function(t,i){-1==e.indexOf(t)&&-1==hiddenColumnIndex.indexOf(i)?$("#newViewTabId").is(":visible")||isOpenSmartStepper||(ivirVisibleColumns.push(i),ivirDataTableApi.column(i).visible(!0)):$("#newViewTabId").is(":visible")||isOpenSmartStepper||ivirDataTableApi.column(i).visible(!1)}),viewLoadedColumns=!0):viewLoadedColumns=!1,requestJSON&&"old"!=iviewButtonStyle&&(1==e.length&&"!"==e[0]&&(e=[],viewLoadedColumns=!1),e.length>0?ivirMainObj.hiddenColumns=e:0==e.length&&(delete ivirMainObj.hiddenColumns,$("#newViewcolumns").val("")),($("#newViewTabId").is(":visible")||isOpenSmartStepper)&&ivirMainObj.hiddenColumns&&ivirMainObj.hiddenColumns.length>0&&$("#newViewcolumns").val(JSON.stringify({hidden:ivirMainObj.hiddenColumns}))),!$("#newViewTabId").is(":visible")&&!isOpenSmartStepper){if($(ivirTable).outerWidth()<$(window).width()&&($(ivirTable).css("width","100%"),ivirDatatable.fnAdjustColumnSizing()),$(ivirTable+" tbody tr").css("height","22px"),ivirDataTableApi.fixedColumns().relayout(),createMainEventsOnGrid(),!jQuery.isEmptyObject(pillDependentCols)){for(var a=pillDependentCols.data,r=pillDependentCols.type,n=pillDependentCols.index,l=a.length,o=0;o0&&arguments[0]!==undefined?arguments[0]:[],t=[];if($("#ivirSortColumnWrapper .checkbox input[type='checkbox']:visible").length>0)e=[],$("#ivirSortColumnWrapper .checkbox input[type='checkbox']").each(function(i,a){if($(this).is(":checked")){i=$(this).data("index");var r=$(this).parent().find("button span.active").data("order"),n=[];n.push(i),n.push(r),t.push(n);var l=[];l.push(FieldName[i]),l.push(r),e.push(l)}}),viewLoadedSort=!1;else if(e.length>0&&"!"!=e[0])t=e.map(function(e){return e[0]=FieldName.indexOf(e[0]),e}),viewLoadedSort=!0;else if(e.length>0&&"!"==e[0]){try{ivirDataTableApi.order.neutral().draw()}catch(i){}viewLoadedSort=!1}else viewLoadedSort=!1;if(requestJSON&&"old"!=iviewButtonStyle&&(1==e.length&&"!"==e[0]&&(e=[],viewLoadedColumns=!1),e.length>0&&(ivirMainObj.sorting=e),($("#newViewTabId").is(":visible")||isOpenSmartStepper)&&0==e.length&&delete ivirMainObj.sorting),""!=groupingCol&&t.push([parseInt(groupingCol),"asc"]),$("#newViewTabId").is(":visible")||isOpenSmartStepper)try{$("#newViewsort").val(JSON.stringify(ivirMainObj.sorting))}catch(i){}else ivirDatatable.fnSort(t)}function ivirRowGrouping(e,t){!$("#newViewTabId").is(":visible")&&!isOpenSmartStepper||"undefined"!=typeof ivirMainObj.group&&0!=ivirMainObj.group.length||void 0===e||(e=undefined);var i,a=$("#grpName"),r=$("#grpColName"),n=!1,l=!1;if(""==a.val())return ivirCustomErrMsg(a,errorMessages.emptyField),!1;if(!testRegex("validName",a.val()))return ivirCustomErrMsg(a,errorMessages.invalidName),!1;if(""==r.val())return ivirCustomErrMsg(r,errorMessages.emptySelect),!1;var o=parseInt(r.find("option:selected").data("index"),10);if(""!=$("#ivirTotalCndtn1 .totalAggrFunction").val()){var s=!1;if($("#ivirTotalCndtnWrapper select:enabled").each(function(e,t){if(""==$(this).val())return ivirCustomErrMsg($(this),errorMessages.emptyField),s=!0,!1}),s)return!1;if(""==$("#ivirTotalCndtn1 .totalAggrFunction").val())return ivirCustomErrMsg($("#ivirTotalCndtn1 .totalAggrFunction"),errorMessages.emptyField),!1;if($("#ivirTotalCndtn1 .totalAggrFunction").next("span.customError").remove(),""==$("#ivirTotalCndtn1 .totalSource").val())return ivirCustomErrMsg($("#ivirTotalCndtn1 .totalSource"),errorMessages.emptyField),!1;$("#ivirTotalCndtn1 .totalSource").next("span.customError").remove();for(var c=$("#ivirTotalCndtnWrapper").data("cndtns"),d=[],p=[],h=0;h=maxNoOfPills&&(n=!0),i=C.length}var y=new Object}else{y=ivirMainObj.group[e];i=e}return n?showAlertDialog("warning",appGlobalVarsObject.lcm[23]):(y.n=g,y.cl=b,y.t=f,y.g=w,$("#newViewTabId").is(":visible")||isOpenSmartStepper?"undefined"!=typeof ivirMainObj.group&&0!=ivirMainObj.group.length||C.push(y):e===undefined?(C.push(y),l||0==$("#ivirFilteredAccordion").length?0==$("#ivirFilteredAccordion").length?createPills("all","first"):($("[id^='grouppillCB']").prop("checked",!1).removeAttr("checked"),createPills("all","last")):$("#ivirFilteredAccordion").length>0&&($("[id^='grouppillCB']").prop("checked",!1).removeAttr("checked"),upateThePills("group",i,g))):(t&&($("[id^='grouppillCB']").prop("checked",!1).removeAttr("checked"),$("#grouppillCB"+e).prop("checked",!0).attr("checked","checked")),$("#grouppillCB"+e).parent().next().find(".ivirCndtnName").attr("title","Edit "+g).text(g))),($("#newViewTabId").is(":visible")||isOpenSmartStepper)&&$("#newViewrowGrouping").val(JSON.stringify(y)),setSmartViewHeight(),!0}function getChartHtml(e){e=e||!1,htmlToShow="",htmlToShow+='
',htmlToShow+='
',htmlToShow+='
",htmlToShow+='
",htmlToShow+='
",htmlToShow+='
",htmlToShow+="
",htmlToShow+="
",htmlToShow+='
',htmlToShow+='
',htmlToShow+='
',htmlToShow+='",htmlToShow+='help_outline',htmlToShow+='
',htmlToShow+='',htmlToShow+="
",htmlToShow+="
",htmlToShow+='
',htmlToShow+=' ",htmlToShow+='help_outline';var t,i,a=getAllColumns("",e);return t=a[0],i=a[1],htmlToShow+='
',htmlToShow+=' ",htmlToShow+="
",htmlToShow+="
",htmlToShow+='
',htmlToShow+=' ",htmlToShow+='help_outline',htmlToShow+='
',htmlToShow+=' ",htmlToShow+="
",htmlToShow+="
",htmlToShow+="
",htmlToShow+="
",htmlToShow+="
",htmlToShow}function getGroupHtml(e){e=e||!1;var t="";return t='
',t+='",t+=' help_outline',t+='',t+="
",t+='
',t+='",t+='help_outline',t+='",t+="
",t+='
',t+='
',t+=getRowGroupingCondtionHtml(),t+="
",t+="
"}function ivirAddTotalCndtn(e){e=parseInt(e,10);var t=!1,i=$("#ivirTotalCndtnWrapper").data("cndtns"),a=i[i.length-1];if(""==$("#ivirTotalCndtn"+a+" .totalAggrFunction").val())return ivirCustomErrMsg($("#ivirTotalCndtn"+a+" .totalAggrFunction"),errorMessages.emptyField),!1;if($("#ivirTotalCndtn"+a+" .totalAggrFunction").next("span.customError").remove(),""==$("#ivirTotalCndtn"+a+" .totalSource").val())return ivirCustomErrMsg($("#ivirTotalCndtn"+a+" .totalSource"),errorMessages.emptyField),!1;$("#ivirTotalCndtn"+a+" .totalSource").next("span.customError").remove(),i.push(e);var r=tmpGroupObj.indexeSelected;r?-1==$.inArray($("#ivirTotalCndtn"+a+" .totalSource option:selected").data("index"),r)&&r.push($("#ivirTotalCndtn"+a+" .totalSource option:selected").data("index")):tmpGroupObj.indexeSelected=[$("#ivirTotalCndtn"+a+" .totalSource option:selected").data("index")],$(".totalAggrFunction").each(function(e,i){"count"==$(this).val()&&(t=!0)});var n='
'+getRowGroupingCondtionHtml()+"
",l='';$("#ivirTotalCndtnWrapper").append(n),$("#ivirTotalCndtn"+e+" .ivirTotalCndtnBtn").show().attr("onclick","ivirAddTotalCndtn("+(e+1)+")"),$("#ivirTotalCndtn"+e+" .grpaddDltBtnWrapper").append(l),$("#ivirTotalCndtn"+e+' label:not(".grndTtlCB"),#ivirTotalCndtn'+e+" .labelP,#ivirTotalCndtn"+e+" a.icon-arrows-question").hide(),$("#ivirTotalCndtn"+e+" .grndTtlCB input").prop("disabled",!0),$("#ivirTotalCndtn"+e+" select").prop("disabled",!1),$("#ivirTotalCndtn"+e+" select").select2({allowClear:!0,placeholder:appGlobalVarsObject.lcm[441]}),$("#ivirTotalCndtnWrapper").data("cndtns",i).attr("data-cndtns","["+i+"]"),$("#ivirTotalCndtn"+a+" .ivirTotalCndtnBtn").hide(),$("#ivirTotalCndtn"+a+" select").prop("disabled",!0),t&&$("#ivirTotalCndtn"+e+' .totalAggrFunction option[value="count"]').remove()}function ivirDeleteTotalCndtn(e){var t=$("#ivirTotalCndtn"+e+" .totalAggrFunction").val(),i=$("#ivirTotalCndtn"+e+" .totalSource option:selected").data("index"),a=tmpGroupObj.indexeSelected,r=a.indexOf(i);r>=0&&a.splice(r,1),"count"==t&&$(".totalAggrFunction").append('');var n=$("#ivirTotalCndtnWrapper").data("cndtns"),l=n.indexOf(e);n.splice(l,1),$("#ivirTotalCndtn"+e+" .totalAggrFunction").is(":disabled")||$("#ivirTotalCndtn"+n[n.length-1]+" .ivirTotalCndtnBtn").show(),$("#ivirTotalCndtn"+e).remove(),1==n.length&&($("#ivirTotalCndtn1 .ivirTotalCndtnBtn").show(),$("#ivirTotalCndtn1 select").prop("disabled",!1));var o=n[n.length-1];if(o>e){var s=$("#ivirTotalCndtn"+o+" .totalAggrFunction"),c=(s.val(),$("#ivirTotalCndtn"+o+" .totalSource")),d=c.val();s.change(),c[0].value=d}$("#ivirTotalCndtnWrapper").data("cndtns",n).attr("data-cndtns","["+n+"]")}function ivirCustomErrMsg(e,t){var i=e.parent().find("label").text();-1!=t.indexOf("_name_")?t=t.replace("_name_",i):t.indexOf(!0)&&(t="Highlight"==i?t.replace("_option_","option"):t.replace("_option_",i.toLowerCase())),$("span.customError").remove(),$(''+t+"").insertAfter(e)}function getHighlightHtml(e,t,i){i=i||!1;htmlToShow='
',htmlToShow+='
',htmlToShow+='
',htmlToShow+='",htmlToShow+='help_outline',htmlToShow+='',htmlToShow+="
",htmlToShow+='
',htmlToShow+='",htmlToShow+='help_outline',htmlToShow+='",htmlToShow+="
",htmlToShow+="
",htmlToShow+='
',htmlToShow+='
',htmlToShow+='",htmlToShow+='help_outline',htmlToShow+='
',htmlToShow+='',htmlToShow+='',htmlToShow+="
",htmlToShow+="
",htmlToShow+='
',htmlToShow+='",htmlToShow+='help_outline',htmlToShow+='
',htmlToShow+='',htmlToShow+='',htmlToShow+="
",htmlToShow+="
",htmlToShow+="
",htmlToShow+=''+callParentNew("lcm")[424]+"",htmlToShow+='
',htmlToShow+='
',htmlToShow+='",htmlToShow+='help_outline',htmlToShow+=' ",htmlToShow+="
",htmlToShow+='
',htmlToShow+='",htmlToShow+='help_outline',htmlToShow+='",htmlToShow+="
",htmlToShow+='
',htmlToShow+='",htmlToShow+='help_outline',htmlToShow+='',htmlToShow+="
",htmlToShow+="
",htmlToShow+="
",htmlToShow+="
",htmlToShow}function getAllColumns(e,t,i){for(var a=ivirDataTableApi.columns(),r="",n="",l="",o=0;o'+s+"","n"==d?r+=" ":n+=" ")}return[r,n,l]}function ivirHighlightRow(e,t,i){($("#newViewTabId").is(":visible")||isOpenSmartStepper)&&"undefined"==typeof ivirMainObj.highlight&&void 0!==e&&(e=undefined),i=i||!1;var a=[],r=[],n=[],l=ivirDataTableApi.rows(),o=l.data();if(!1===i)var s=$("#ivirHltName").val(),c=$("#ivirHighlightType").val(),d=$("#ivirbgColorValue").val(),p=$("#ivirtxtColorValue").val(),h=$("#ivirHighlightCol").find("option:selected").data("index"),u=getPropertyAccess($("#ivirHighlightCol").find("option:selected").val()),v=$("#ivirHighlightCndtn").val(),m=$("#ivirHltValue").val(),g=$("#ivirHighlightCol").find("option:selected").data("type");else{var b=ivirMainObj.highlight[e];s=b.n,c=b.t,d=b.bc,p=b.tc,h=b.cl,u=getPropertyAccess(ivirDataTableApi.context[0].aoColumns[h].mData),v=b.cn,m=b.v,g=b.colType}var f=h,w=!1,C=!1,y="";if("regex"==v){var x=m.replace(/\\/g,"\\");x=new RegExp(x,"i")}if(e===undefined){if(jQuery.isEmptyObject(ivirMainObj)){var k=ivirMainObj.highlight=[];w=!0,y=0}else if(ivirMainObj.highlight===undefined){k=ivirMainObj.highlight=[];y=0}else{w=!1,(k=ivirMainObj.highlight).length>=maxNoOfPills&&(C=!0),y=k.length}var T=new Object}else{if($("#newViewTabId").is(":visible")||isOpenSmartStepper)if(($("#newViewTabId").is(":visible")||isOpenSmartStepper)&&"undefined"==typeof ivirMainObj.highlight)T=new Object;else T=ivirMainObj.highlight[e];else{clearIvirHighlight(e);var T=new Object}y=e}if(C?showAlertDialog("warning",appGlobalVarsObject.lcm[23]):(T.n=s,T.t=c,T.bc=d,T.tc=p,T.cl=h,T.cn=v,T.v=m,T.colType=g,e===undefined?(k.push(T),$("#newViewTabId").is(":visible")||isOpenSmartStepper||(w||0==$("#ivirFilteredAccordion").length?0==$("#ivirFilteredAccordion").length?createPills("all","first"):createPills("all","last"):$("#ivirFilteredAccordion").length>0&&upateThePills("highlight",y,s))):$("#newViewTabId").is(":visible")||isOpenSmartStepper||(t&&$("#highlightpillCB"+e).prop("checked",!0).attr("checked","checked"),$("#highlightpillCB"+e).parent().next().find(".ivirCndtnName").attr("title","Edit "+s).text(s))),$("#newViewTabId").is(":visible")||isOpenSmartStepper)ivirMainObj.highlight&&ivirMainObj.highlight.length>0&&$("#newViewhighlight").val(JSON.stringify(ivirMainObj.highlight[0]));else if(e===undefined||t){for(var S=function(e,t){-1==jQuery.inArray(e,a)&&a.push(e),-1==jQuery.inArray(t,n)&&n.push(t),r.push([e,t])},O=0;Oj&&S(l[0][O],f)}else parseInt(D,10)>parseInt(m,10)&&S(l[0][O],f);else if("greaterthanequalto"==v)if("d"===g){j=moment(m,"YYYY-MM-DD");moment(D,"DD/MM/YYYY")>=j&&S(l[0][O],f)}else parseInt(D,10)>=parseInt(m,10)&&S(l[0][O],f);else"regex"==v&&x.test(D)&&S(l[0][O],f)}if("row"==c)for(var A=0;A0){var t=(r=ivirDataTableApi.columns(".ivirCustomHighlight")).nodes();$(r).removeClass("ivirCustomHighlight").css({"background-color":"inherit",color:"inherit"});for(var i=0;i0&&$(ivirDataTableApi.cells(".ivirCustomHighlight").nodes()).removeClass("ivirCustomHighlight").css({"background-color":"inherit",color:"inherit"}),ivirDataTableApi.rows(".ivirCustomHighlight")[0].length>0&&$(ivirDataTableApi.rows(".ivirCustomHighlight").nodes()).removeClass("ivirCustomHighlight").css({"background-color":"inherit",color:"inherit"})}else if(e!==undefined&&ivirMainObj.highlight&&ivirMainObj.highlight.length>0){var a=ivirMainObj.highlight[e].t;if("cell"==a)ivirDataTableApi.cells(".ivirCustomHighlight.highlight"+e)[0].length>0&&$(ivirDataTableApi.cells(".ivirCustomHighlight.highlight"+e).nodes()).removeClass("ivirCustomHighlight highlight"+e).css({"background-color":"inherit",color:"inherit"});else if("column"==a){if(ivirDataTableApi.columns(".ivirCustomHighlight.highlight"+e)[0].length>0){var r;t=(r=ivirDataTableApi.columns(".ivirCustomHighlight.highlight"+e)).nodes();$(r.header()).removeClass("ivirCustomHighlight highlight"+e);for(i=0;i0&&$(ivirDataTableApi.rows(".ivirCustomHighlight.highlight"+e).nodes()).removeClass("ivirCustomHighlight highlight"+e).css({"background-color":"inherit",color:"inherit"})}""!=fixedColumnsObj&&$(".DTFC_LeftBodyWrapper .ivirCustomHighlight,.DTFC_LeftBodyWrapper .ivirCustomHighlightCell").removeClass("ivirCustomHighlight").css({"background-color":"",color:""})}function createPills(e,t){if(ivirMainObj.highlight||ivirMainObj.group||ivirMainObj.filter){requestJSON&&"old"!=iviewButtonStyle&&(maxNoOfPills=1);var i,a,r="",n="";i=["highlight","group","filter"],a={highlight:"highlight",group:"table_rows",chart:"pie_chart",filter:"filter_alt"};var l="";l+='
',l+='
',l+='',l+='
';for(var o=0;o',l+=''+a[s]+"",l+=''+s+' '+ivirMainObj[s].length+"",l+="")}l+="
",l+='
';for(o=0;omaxNoOfPills){try{r=r.sort(function(e,t){return e.checked===t.checked?0:e.checked?-1:t.checked?1:void 0})}catch(p){}r.splice(maxNoOfPills)}for(var c=0;c',l+='',"first"==t&&0==c?l+='':"last"==t&&c==r[c].length-1?l+='':l+='',l+=''+r[c].n+"",l+='',l+="",l+="
"}}}if(l+="
",$("#pillsWrapper").html(l),requestJSON&&"old"!=iviewButtonStyle){var d=0;$("#ivirAllCndtnPillsList").children().remove(),$.each($("#ivirAllCndtnPills").children("div"),function(e,t){d++,$("#ivirAllCndtnPillsList").append($(t).detach())}),$("#ivirAllCndtnPillsCount").text(d),$("#ivirAllCndtnPillsDiv").css("display","inline-block"),$("#ivirAllCndtnPillsDiv").hide(),$("#pillsWrapper").hide(),setSmartViewHeight()}else $("#pillsWrapper").show("slow")}}function upateThePills(e,t,i){var a,r="",n=e;if(a={highlight:"highlight",group:"table_rows",chart:"pie_chart",filter:"filter_alt"},r+='",requestJSON&&"old"!=iviewButtonStyle?($("#ivirAllCndtnPillsList").append(r),$("#ivirAllCndtnPillsCount").text($("#ivirAllCndtnPillsList").children("div").length)):$("#ivirAllCndtnPills").append(r),0==$("#ivir"+n+"CndtnPill").length){var l="";l+='',l+=''+a[n]+"",l+=''+n+' '+ivirMainObj[n].length+"",l+="",$("#ivirAllCndtns").append(l)}else $("#ivir"+n+"CndtnPill .ivirCndtnLabel").text(ivirMainObj[e].length)}function createChartPills(){var e="",t=ivirMainObj.chart;requestJSON&&"old"!=iviewButtonStyle&&(maxNoOfPills=5),"undefined"!=typeof t.length&&t.length>maxNoOfPills&&t.splice(maxNoOfPills);for(var i=0;i',e+='',requestJSON&&"old"!=iviewButtonStyle&&("undefined"==typeof a.checked||a.checked)||(!requestJSON||"old"==iviewButtonStyle)&&0==i?(e+='',$("#ivirChartWrapper #ivirChart"+i).show(),"undefined"==typeof a.checked&&(a.checked=!0)):(e+='',$("#ivirChartWrapper #ivirChart"+i).hide()),e+=''+a.n+"",e+='',e+="",e+=""}$("#ivirChartPills").addClass("pillsAdded").html(e),requestJSON&&"old"!=iviewButtonStyle?($("#ivirChartPillsList").children().remove(),$.each($("#ivirChartPills").children("div"),function(e,t){$("#ivirChartPillsList").append($(t).detach())}),$("#ivirChartPillsCount").text($("#ivirChartPillsList").children("div").length),$("#ivirAllCndtnPillsDiv").hide(),$("#ivirChartPills").hide()):$("#ivirChartPills").show("slow")}function upateTheChartPills(e,t){var i="";i+='",requestJSON&&"old"!=iviewButtonStyle||$("#ivirChartWrapper .chartWrapper").hide(),$("#ivirChartWrapper #ivirChart"+e).show(),requestJSON&&"old"!=iviewButtonStyle?($("#ivirChartPillsList").append(i),$("#ivirChartPillsdiv").show(),$("#ivirChartPillsCount").text($("#ivirChartPillsList").children("div").length)):$("#ivirChartPills").show().append(i)}function toggleIvirPills(){var e=$("#ivirAllCndtns"),t=$("#ivirAllCndtnPills");e.is(":visible")?($("#ivirCndtnToggleBtn").removeClass("icon-arrows-keyboard-right").addClass("icon-arrows-keyboard-down"),e.hide(),t.addClass("open")):($("#ivirCndtnToggleBtn").removeClass("icon-arrows-keyboard-down").addClass("icon-arrows-keyboard-right"),t.removeClass("open"),e.show()),setSmartViewHeight()}function applyThePill(e,t){if("highlight"==e)ivirHighlightRow(t,!0,!0);else if("group"==e){$("[id^='grouppillCB']").not("#grouppillCB"+t).prop("checked",!1).removeAttr("checked");var i=ivirMainObj[e][t].g;if(i)for(var a=0;a2&&arguments[2]!==undefined&&arguments[2];if("highlight"==e)clearIvirHighlight(t);else if("group"==e){if(ivirMainObj.group&&ivirMainObj.group.length>0){var a=ivirMainObj[e][t].g;if(a)for(var r=0;r0&&ivirVisibleColumns.push(groupingCol),$("#"+e+"pillCB"+t).is(":checked")&&createIvirDataTable("clear",t,"",allGrandTotal)}else if("chart"==e){var l=!1;$("#chartpillCB"+t).is(":checked")&&(l=!0),$("#ivirChart"+t).remove()}$("#ivir"+e+t+"CndtnPill").remove(),reArrangeIndexes(e,t);var o=ivirMainObj[e];if(o){var s=o.splice(t,1);if("chart"!=e){0==o.length?(delete ivirMainObj[e],$("#ivir"+e+"CndtnPill").remove()):$("#ivir"+e+"CndtnPill .ivirCndtnLabel").text(ivirMainObj[e].length);var c=$("[data-pill-type='filter']");if(c.length&&c.find(".ivirFilterCheckBox").is(":checked"))try{advFiltersObjectToApply=ivirMainObj.filter[c.find(".ivirFilterCheckBox:checked").data("index")].data}catch(d){advFiltersObjectToApply={somedummyfilterjsobjectkey:"dummy"}}else advFiltersObjectToApply={somedummyfilterjsobjectkey:"dummy"};ivirDataTableApi.draw(),setFilterInfo(),""==$("#ivirAllCndtns").html()&&$("#pillsWrapper").html(""),requestJSON&&"old"!=iviewButtonStyle&&(0==$("#ivirAllCndtnPillsDiv .popover-content").children("div").length?($("#lnkallCndtnPill").popover("hide"),$("#ivirAllCndtnPillsDiv").hide()):$("#lnkallCndtnPill").popover("reposition"))}else!i&&s&&1==s.length&&requestJSON&&"old"!=iviewButtonStyle&&"charts"==ivirMainObj.key&&deleteCommonChart(s[0]),0==o.length?(toggleGridView("grid"),$("#ivirCButtonsWrapper").hide(),$("#pinnedivirCButtonsWrapper").hide(),delete ivirMainObj[e]):l&&($("#chartpillCB0").prop("checked",!0).attr("checked","checked"),$("#ivirChart0").show()),requestJSON&&iviewButtonStyle,0==$("#ivirChartPillsDiv .popover-content").children("div").length?($("#lnkChartPill").popover("hide"),$("#ivirChartPillsDiv").hide()):$("#lnkChartPill").popover("reposition"),adjustChartBasedWrapperHeight()}else advFiltersObjectToApply={somedummyfilterjsobjectkey:"dummy"};"chart"==e&&0==i&&$("[data-dropdown-value=save]:eq(0)").click()}function reArrangeIndexes(e,t){var i=ivirMainObj[e];if(ivirMainObj[e]&&t!=i.length-1)for(var a=t,r=t+1;r0&&$("#ivirMainDataTableWrapper").show(),i+='',$("#pinnedivirCButtonsWrapper").html(i))):"grid"==e?($(".grdView").addClass("active"),$("#ivirFilteredAccordion").show(),$("#ivirCButtonsWrapper").show(),$("#pinnedivirCButtonsWrapper").show(),$("#ivirMainChartWrapper").hide(),$("#searchSelectColumnButton").prop("disabled",!1),$(ivirTable+"_paginate").show(),$(ivirTable+"_length").show(),$("#ivirMainDataTableWrapper").show(),ivirDataTableApi.columns.adjust().draw(),$("#pillsWrapper").show(),$("#ivirChartPills").hide(),requestJSON&&"old"!=iviewButtonStyle&&($("#pillsWrapper").hide(),$("#ivirChartPills").hide(),$("#ivirAllCndtnPillsList").children("div").length&&$("#ivirAllCndtnPillsDiv").hide(),ivirMainObj&&ivirMainObj.chart&&ivirMainObj.chart.length>0?$("#ivirMainChartWrapper").show():$("#ivirChartPillsDiv").hide().addClass("d-none"),i+='',$("#pinnedivirCButtonsWrapper").html(i))):(e="showChartErrMsg")&&(0==$(t).data("count")?$(t).data("count",1):showAlertDialog("warning",errorMessages.noChartWhileGrpng));try{var a;null===(a=KTMenu)||void 0===a||a.init()}catch(r){}}function columnChart(e,t,i,a,r,n){var l=$(ivirDataTableApi.columns(n).header()).text().trim(),o=$("#ivirMainChartWrapper").outerHeight()-70,s=JSON.parse(t.split("~")[0])[0];toggleGridView("chart");var c="ivirChart"+a;a>maxNoOfPills-1&&($(".ivirChartCheckBox").prop("checked",!1).attr("checked","checked"),$(".chartWrapper").hide(),c="ivirChartCommon"),0==$("#"+c).length&&$("#ivirChartWrapper").append('
'),requestJSON&&"old"!=iviewButtonStyle||$("#ivirChartWrapper .chartWrapper").hide(),$("#ivirChartWrapper #ivirChart"+a).show();try{$(".viewtabEdit").parents("li.active").find(".viewtabEdit").data("name")}catch(p){}if(e){var d=$("#ivirChartWrapper #"+c).highcharts({colors:["#f8bd19","#e44a00","#008ee4","#33bdda","#6baa01","#583e78"],credits:{enabled:!1},chart:{type:r,height:o,options3d:{enabled:!0,alpha:0,beta:20,depth:50},events:{beforePrint:function(){this.exportSVGElements[0].box.hide(),this.exportSVGElements[1].hide()},afterPrint:function(){this.exportSVGElements[0].box.show(),this.exportSVGElements[1].show()}}},title:{text:i,align:"left"},xAxis:{categories:JSON.parse(JSON.stringify(JSON.parse(t.split("~")[0])).replace(/_+/g," "))},tooltip:{formatter:function(){return this.series.name+"
"+l+": "+Highcharts.numberFormat(this.y,-1)+""}},yAxis:{min:0,title:{text:s}},series:JSON.parse(JSON.stringify(JSON.parse(t.split("~")[1])))});requestJSON&&"old"!=iviewButtonStyle&&d.highcharts().setSize(undefined,300,!1),adjustChartBasedWrapperHeight()}else $("#ivirChartWrapper #"+c).html("

".concat(appGlobalVarsObject.lcm[0],"

"))}function pieChart(e,t,i,a,r,n){var l=$(ivirDataTableApi.columns(r).header()).text().trim(),o=$("#ivirMainChartWrapper").outerHeight()-70;toggleGridView("chart");var s="ivirChart"+a;a>maxNoOfPills-1&&($(".ivirChartCheckBox").prop("checked",!1).attr("checked","checked"),$(".chartWrapper").hide(),s="ivirChartCommon"),0==$("#"+s).length&&$("#ivirChartWrapper").append('
'),requestJSON&&"old"!=iviewButtonStyle||$("#ivirChartWrapper .chartWrapper").hide(),$("#ivirChartWrapper #ivirChart"+a).show();try{$(".viewtabEdit").parents("li.active").find(".viewtabEdit").data("name")}catch(d){}if(e){sizeOfInner=n?80:0;var c=$("#ivirChartWrapper #"+s).highcharts({colors:["#f8bd19","#e44a00","#008ee4","#33bdda","#6baa01","#583e78"],credits:{enabled:!1},chart:{type:"pie",height:o,options3d:{enabled:!0,alpha:25,beta:0},events:{beforePrint:function(){this.exportSVGElements[0].box.hide(),this.exportSVGElements[1].hide()},afterPrint:function(){this.exportSVGElements[0].box.show(),this.exportSVGElements[1].show()}}},title:{text:i,align:"left"},tooltip:{pointFormat:l+": {point.y}"},plotOptions:{pie:{allowPointSelect:!0,cursor:"pointer",innerSize:sizeOfInner,depth:35,dataLabels:{enabled:!0,format:"{point.name}"},showInLegend:!0}},series:[{name:i,data:JSON.parse(JSON.stringify(JSON.parse(t)))}]});requestJSON&&"old"!=iviewButtonStyle&&c.highcharts().setSize(undefined,300,!1),adjustChartBasedWrapperHeight()}else $("#ivirChartWrapper #"+s).html("

".concat(appGlobalVarsObject.lcm[0],"

"))}function commaSeparateNumber(e){for(;/(\d+)(\d{3})/.test(e.toString());)e=e.toString().replace(/(\d+)(\d{3})/,"$1,$2");return e}function ivirDuplicateCheck(e,t,i){e=e.toLowerCase();var a=ivirMainObj[e],r="filter"==e?$("#divModalAdvancedFilters .fldNme"):$(".jconfirm-content .fldNme");if(a&&r)for(var n=a.length-1;n>=0;n--)if(""!=r.val().trim()&&a[n].n==r.val().trim()){if(t&&i==n)continue;var l="";return"filter"==e?l=callParentNew("lcm")[231]:"chart"==e?l=callParentNew("lcm")[394]:"group"==e?l=callParentNew("lcm")[395]:"highlight"==e&&(l=callParentNew("lcm")[396]),ivirCustomErrMsg(r,errorMessages.duplicateFld.replace("{0}",l)),!1}return!0}function ivirChartNewDuplicateCheck(e,t,i){if(ivirMainViewObj){var a=$("#ivirgraph .fldNme"),r=callParentNew("lcm")[394];return!(!t&&ivirMainViewObj&&!_.isEmpty(_.find(getAllCommonCharts(),{n:a.val().trim()})))||(ivirCustomErrMsg(a,errorMessages.duplicateFld.replace("{0}",r)),!1)}}function getAllCommonCharts(){var e=ivirMainViewObj&&_.uniqBy(_.flatMap(_.filter(_.mapValues(ivirMainViewObj.views,"chart"))),function(e){return e.n})||[];return e.length&&ivirMainObj&&ivirMainObj.chart&&ivirMainObj.chart.length&&(e=_.uniqBy([].concat(_toConsumableArray(ivirMainObj.chart),_toConsumableArray(e)),function(e){return e.n})||[]),e.length?e:[]}function deleteCommonChart(e){_.each(ivirMainViewObj.views,function(t){t&&t.chart&&t.chart.length&&t.chart.length>0&&(t.chart=t.chart.map(function(t){return t.n!=e.n?t:""}).filter(function(e){return e}),0==t.chart.length&&delete t.chart)}),setTimeout(function(){$("#ivirChartPillsList .ivirChartCheckBox:first").prop("checked",!0).change(),$("#ivirChartPillsDiv .ivirChartCheckBox:first").prop("checked",!0).change()},0)}function testRegex(e,t){var i=regexes[e].replace(/\\/g,"\\");return!!(i=new RegExp(i,"i")).test(t)}function saveInSessionBeforeSave(){$("#IvirActions").val("");var e=!1;try{if("undefined"!=typeof Storage){var t=localStorage.ivInteractiveMainJson;if(t){e=!0;var i=JSON.parse(t);i[iName]=ivirMainObj,saveJsonToDB("set",JSON.stringify(i))}else e=!1}else e=!1}catch(r){e=!1,console.log(r)}if(!e){var a={};a[iName]=ivirMainObj,saveJsonToDB("set",JSON.stringify(a))}}function saveInSessionBeforeSaveNew(e,t,i){if($("#IvirActions").val(""),ivirMainObj.applyTo=i,ivirMainObj.caption=t,ivirMainObj.groupName=e,"main"!=e||"main"!=t){SavePillsCheckedProperty(),ivirMainObj.params=$("#hdnparamValues").val().replace(/`/g,"`"),ivirMainObj.paramsList=getParamsValueList(),ivirMainObj.paramsList&&(ivirMainObj.paramsList=JSON.parse(JSON.stringify(ivirMainObj.paramsList).replace(/&/g,"&")));try{isListView&&$("#hdnLvChangedStructure").val()&&(ivirMainObj.visibleColumns[0].structure=CheckUrlSpecialChars($("#hdnLvChangedStructure").val()))}catch(a){}(ivirMainObj.hiddenColumns||ivirMainObj.visibleColumns)&&(viewLoadedColumns=!0),ivirMainObj.sorting&&(viewLoadedSort=!0),toolbarPinArr.length>0&&(ivirMainViewObj.toolbarPin=_toConsumableArray(new Set(toolbarPinArr)))}ivirMainViewObj.views||(ivirMainViewObj.views={}),ivirMainViewObj.views[e]=JSON.parse(JSON.stringify(ivirMainObj)),SaveSmartviewJsonToDb("set",JSON.stringify(ivirMainViewObj),i,e)}function getViewName(){var htmlToShow="",username=eval(callParent("mainUserName"));htmlToShow='
',htmlToShow+='',htmlToShow+='',htmlToShow+='',htmlToShow+="
",htmlToShow+='
',htmlToShow+='',htmlToShow+='",htmlToShow+="
";var bol=ivirActionDialog("View","view",htmlToShow,"saveInSessionBeforeSaveNew")}function newViewTabClick(e){setTimeout(function(){bkpIvirMainObj=_.cloneDeep(ivirMainObj)},0);var t=!1,i="vw"+(new Date).getTime(),a="";"viewAddTab"==e.attr("id")||"IvirActions"==e.attr("id")&&"saveAs"==e.val()?t=!0:(i=e.data("name"),a=e.data("caption"),(ivirMainObj&&ivirMainObj.groupName&&ivirMainObj.groupName!=i||!ivirMainObj.groupName)&&ivirMainViewObj&&ivirMainViewObj.views&&ivirMainViewObj.views[i]&&(ivirMainObj=ivirMainViewObj.views[i])),smartStepper(t,i,a)}function applyCheckedPillsOnLoad(){$.each(ivirMainObj,function(e,t){switch(e){case"filter":$.each(t,function(e,t){(1==t.checked||requestJSON&&"old"!=iviewButtonStyle)&&$(".ivirFilterCheckBox[data-type='filter'][data-index="+e+"]").trigger("click")});break;case"highlight":$.each(t,function(e,t){(1==t.checked||requestJSON&&"old"!=iviewButtonStyle)&&$(".ivirFilterCheckBox[data-type='highlight'][data-index="+e+"]").trigger("click")});break;case"group":$.each(t,function(e,t){(1==t.checked||requestJSON&&"old"!=iviewButtonStyle)&&$(".ivirFilterCheckBox[data-type='group'][data-index="+e+"]").trigger("click")});break;case"hiddenColumns":ivirshowHideColumns(t);break;case"sorting":ivirSortColumns(t)}})}function SavePillsCheckedProperty(){var e=$("[data-pill-type='filter'],[data-pill-type='highlight'],[data-pill-type='group']");e&&$.each(e,function(e,t){switch(t.dataset.pillType){case"filter":ivirMainObj.filter&&ivirMainObj.filter.length>0&&($(t).find(".ivirFilterCheckBox").is(":checked")?ivirMainObj.filter[$(t).find(".ivirFilterCheckBox").data("index")].checked=!0:ivirMainObj.filter[$(t).find(".ivirFilterCheckBox").data("index")].checked=!1);break;case"highlight":ivirMainObj.highlight&&ivirMainObj.highlight.length>0&&($(t).find(".ivirFilterCheckBox").is(":checked")?ivirMainObj.highlight[$(t).find(".ivirFilterCheckBox").data("index")].checked=!0:ivirMainObj.highlight[$(t).find(".ivirFilterCheckBox").data("index")].checked=!1);break;case"group":ivirMainObj.group&&ivirMainObj.group.length>0&&($(t).find(".ivirFilterCheckBox").is(":checked")?ivirMainObj.group[$(t).find(".ivirFilterCheckBox").data("index")].checked=!0:ivirMainObj.group[$(t).find(".ivirFilterCheckBox").data("index")].checked=!1)}})}function getSavedConditions(){var e=localStorage.ivInteractiveMainJson;if(e){var t;try{(t=JSON.parse(e))[iName]&&jQuery.isEmptyObject(ivirMainObj)&&(ivirMainObj=t[iName])}catch(i){}createIvirDataTable(),createPillsOnLoad()}else saveJsonToDB("get")}function getSavedConditionsNew(e){if(SaveSmartviewJsonToDb("get",arguments.length>1&&arguments[1]!==undefined?arguments[1]:"","",e),getAllCommonCharts().length>0&&requestJSON&&"old"!=iviewButtonStyle&&"charts"==e&&((ivirMainObj={}).key="charts",ivirMainObj.chart=getAllCommonCharts()),"main"!=e&&requestJSON&&"old"!=iviewButtonStyle&&"charts"!=loadViewName){createPillsOnLoad(),applyCheckedPillsOnLoad(),$(".nav-tabs a[id="+e+"]").tab("show"),scrollToActiveView(e);try{checkIfNextDBRowsExist()&&ivirMainObj&&(ivirMainObj.chart&&ivirMainObj.chart.length&&ivirMainObj.chart.length>0||ivirMainObj.highlight&&ivirMainObj.highlight.length&&ivirMainObj.highlight.length>0||ivirMainObj.sorting&&ivirMainObj.sorting.length&&ivirMainObj.sorting.length>0)&&(showChartsWithAllRecords=!0,ShowDimmer(!0),setTimeout(function(){getNextDtRecords(0)},100))}catch(t){}}}function createViewTabs(e){$("#viewTabs").children().remove(),(viewKeys=Object.keys(e)).length>0&&(!isListView||1!=viewKeys.length||"main"!=viewKeys[0])&&($.isEmptyObject(e.main)&&(e.main={}),$.each(e,function(e,t){var i,a=t.caption||e;i='\n \n '),"main"==e&&!isListView||"charts"==e?$("#viewTabs").prepend($(i).find(".viewtabRemove, .viewtabEdit").addClass("d-none").parents("li")):"main"==e&&isListView?$("#viewTabs").prepend(i):$("#viewTabs").append(i)}),$("#viewTabs").append('\n \n '),e.main&&($(".nav-tabs a[id=main]").addClass("active"),$.isEmptyObject(e.main)&&delete e.main)),0!=$("#viewTabs").children("li").length?($("#dvViewtabs").is(":hidden")&&$("#dvViewtabs").show(),reAdjust()):$(".scroller").hide(),setSmartViewHeight(),$("#viewTabs li").length>0?($(".mainTabs").addClass("viewTabsAdded"),isListView&&$("[data-dropdown-value=design]:eq(0)").addClass("d-none")):($(".mainTabs").removeClass("viewTabsAdded"),isListView&&$("[data-dropdown-value=design]:eq(0)").removeClass("d-none"))}function clearExistingPills(){$("#ivirAllCndtnPillsList :input").length&&$($("#ivirAllCndtnPillsList :input").get().reverse()).each(function(e,t){"checkbox"==t.type&&deleteThePill(t.dataset.type,t.dataset.index,!0)}),ivirMainObj.highlight||ivirMainObj.group||ivirMainObj.filter||($("#ivirAllCndtnPillsDiv .popover-content").html(""),$("#ivirAllCndtnPillsList").html("")),$("#ivirChartPillsList :input").length&&$($("#ivirChartPillsList :input").get().reverse()).each(function(e,t){"checkbox"==t.type&&deleteThePill(t.dataset.type,t.dataset.index,!0)}),ivirMainObj.chart||($("#ivirChartPillsDiv .popover-content").html(""),$("#ivirChartPillsList").html(""))}function saveJsonToDB(e,t,i){"set"==e&&""!=t?$.ajax({url:"iview.aspx/SaveJsonInDB",type:"POST",cache:!1,async:!1,data:JSON.stringify({jsonString:t,isListView:isListView}),dataType:"json",contentType:"application/json",success:function(e){"Session Authentication failed..."==e.d?parent.window.location.href="../aspx/sess.aspx":"done"==e.d?(showAlertDialog("success",3030,"client"),localStorage.ivInteractiveMainJson=t):showAlertDialog("warning",3028,"client")},error:function(){showAlertDialog("warning","Error while saving the data.")}}):"get"==e&&$.ajax({url:"iview.aspx/GetJsonFromDB",type:"POST",async:!0,data:JSON.stringify({isListView:isListView}),dataType:"json",contentType:"application/json",success:function(e){try{if("success"==e.d.status){var t=localStorage.ivInteractiveMainJson,i=e.d.result;if(i&&""!==i){var a=!1;if(""!==(t=i)){localStorage.ivInteractiveMainJson=t;var r=JSON.parse(i);r[iName]&&(a=!0,jQuery.isEmptyObject(ivirMainObj)&&(ivirMainObj=r[iName]),allGrandTotal.length>0?createIvirDataTable(undefined,"","",allGrandTotal):createIvirDataTable())}}createPillsOnLoad()}else"Session Authentication failed..."==e.d.result?parent.window.location.href="../aspx/sess.aspx":showAlertDialog("warning",3028,"client")}catch(n){}!a&&allGrandTotal.length>0?createIvirDataTable(undefined,"","",allGrandTotal):a||createIvirDataTable()},error:function(){createIvirDataTable()}})}function SaveSmartviewJsonToDb(e,t,i,a){if("set"==e&&""!=t){var r;($("#newViewTabId").is(":visible")||isOpenSmartStepper)&&(r=function(e){setTimeout(function(){var t=$(".viewtabEdit").parents("li.active").find(".viewtabEdit").data("name")||"main";isListView&&t==e||$("#"+e).click()},0)});var n=JSON.parse(t);n.views&&Object.keys(n.views).forEach(function(e){n.views[e].applyTo!=i&&delete n.views[e]});var l=JSON.stringify(n);ASB.WebService.SaveSmartViews(iName,$("#hdnKey").val(),l,i,function(e){try{if("Session Authentication failed..."==e)parent.window.location.href="../aspx/sess.aspx";else if(e&&(res=JSON.parse(e))&&res.result&&res.result.length&&res.result[0]&&"Saved"==res.result[0].value){var i=JSON.parse(t).views;if(a)"undefined"==typeof i[a]?showAlertDialog("success",3033,"client"):showAlertDialog("success",3030,"client");var n=JSON.parse(t).views;n&&createViewTabs(n),ivirMainObj.groupName&&($(".nav-tabs a[id="+ivirMainObj.groupName+"]").tab("show"),$("#"+a).length>0&&scrollToActiveView(ivirMainObj.groupName),r&&r(ivirMainObj.groupName)),0==$("#viewTabs").children("li").length&&($("#dvViewtabs").hide(),$(".scroller").hide())}else showAlertDialog("warning",3028,"client")}catch(l){showAlertDialog("warning",3028,"client")}},function(e){})}else if("get"==e){var o=!1;try{if(""!=t){var s=t;if(s&&""!==s){var c=JSON.parse(s);try{var d;if(c&&("main"==a||!$("#newViewTabId").is(":visible")&&!isOpenSmartStepper))o=!0,ivirMainObj=ivirMainObj&&requestJSON&&"old"!=iviewButtonStyle&&"charts"!=a?JSON.parse(JSON.stringify((null==c?void 0:null===(d=c.views)||void 0===d?void 0:d[a])||{})):{},ivirMainViewObj=JSON.parse(JSON.stringify(c))}catch(p){}isMobile||c.toolbarPin==undefined||(toolbarPinArr=c.toolbarPin,constructPinnedToolbar()),allGrandTotal.length>0?createIvirDataTable(undefined,"","",allGrandTotal):createIvirDataTable(),ivirMainViewObj.views&&createViewTabs(ivirMainViewObj.views)}}}catch(p){}!o&&allGrandTotal.length>0?createIvirDataTable(undefined,"","",allGrandTotal):o||createIvirDataTable()}}function createPillsOnLoad(){if(jQuery.isEmptyObject(ivirMainObj))return!1;createPills("all","first"),$(".ivirFilterCheckBox").prop("checked",!1).removeAttr("checked");var e=ivirMainObj.chart;if(e)for(var t=0;t0)if("group"==e){r.push(a.cl);var n=a.g;if(n)for(var l=0;l0)return-1==(t=e.find(".filter-body-cont").data("pillindex"))?undefined:t}function showDataTableLoading(){ShowDimmer(!0)}function hideDataTableLoading(){ShowDimmer(!1)}$(document).on("change","#searchSelectColumn",function(e){var t=$(this),i=ivirTable+"_filter",a="",r=$(i+" .ivirSearchFld"),n=$(i+" #customSearchInput"),l=t.data("index");if(a=!n.length>0?r.val()||"":n.val()||"",r.val(""),n.val(""),"all"==t.val())$(i+" #customSearchInput").hide(),$(i+" .ivirSearchFld").show(),""!=a&&($(i+" .ivirSearchFld").val(a),ivirDataTableApi.search("").columns().search("").draw(),ivirDataTableApi.search(a).draw());else{if($(i+" .ivirSearchFld").hide(),0==$(i+" #customSearchInput").length){var o='';$(i+" label").append(o)}else $(i+" #customSearchInput").val(a).show();""!=a&&(ivirDataTableApi.search("").columns().search("").draw(),ivirDataTableApi.columns(l).search(a).draw())}}),$(document).on("keydown",".ivirSearchFld",function(e){$("#ivirCButtonsWrapper").is(":visible")&&!$("#ivirCButtonsWrapper button.active").hasClass("grdView")&&toggleGridView("grid")}),$(document).on("keyup","#customSearchInput",function(e){var t=this.value,i=$("#searchSelectColumn").data("index");ivirDataTableApi.columns(i).search(t).draw()}),$(document).on("change",".DTFC_LeftWrapper table tr input[name='chkItem']",function(e){var t=$(this),i=t.parents("tr").index();t.is(":checked")?$(".dataTables_scrollBody table tbody tr").eq(i).addClass("axSelected").find("input[name='chkItem']").prop("checked",!0):$(".dataTables_scrollBody table tbody tr").eq(i).removeClass("axSelected").find("input[name='chkItem']").prop("checked",!1)}),$(document).on("click",".rightClickMenu ul li",function(){var e=$(this);e.data("value");e.hasClass("icon-arrows-check")?e.data("isChecked",!0):e.data("isChecked",!1),e.find("i").toggleClass("icon-arrows-check")}),saveViewActionRef=function(e,t,i,a,r){if(("group"==t||"chart"==t&&(!requestJSON||"old"==iviewButtonStyle)||"highlight"==t)&&!ivirDuplicateCheck(t,r,n=a==undefined?undefined:a[1]))return!1;if("chart"==t&&requestJSON&&"old"!=iviewButtonStyle){var n=a==undefined?undefined:a[1];if(ivirMainObj&&"charts"!=ivirMainObj.key&&!ivirChartNewDuplicateCheck(t,r,n))return!1}if("highlight"==t&&!validateFields(t))return!1;if(a){var l=a[0],o=a[1];if("highlight"==l||"group"==l||"chart"==l){if(!i(o,$("input#"+l+"pillCB"+o).is(":checked")))return!1;"chart"==t&&$("[data-dropdown-value=save]:eq(0)").click()}}else if("group"==t||"chart"==t||"column"==t||"download"==t){if(!i())return!1;"chart"==t&&$("[data-dropdown-value=save]:eq(0)").click()}else if("view"==t){if(""==$("#viewCaption").val())return ivirCustomErrMsg($("#viewCaption"),errorMessages.emptyField),!1;if("main"==$("#viewName").val().toLowerCase()&&!isListView||requestJSON&&"old"!=iviewButtonStyle&&"charts"==$("#viewName").val().toLowerCase())return ivirCustomErrMsg($("#viewName"),callParentNew("lcm")[483]),!1;if(!validateViewName())return!1;if("Edit View"!=e&&!checkDuplicateViewName())return!1;if(!(toolbarPinArr.length>0||"main"==$("#viewName").val().toLowerCase()&&isListView||ivirMainObj.params||$("#hdnparamValues").val().replace(/`/g,"`")||ivirMainObj.chart||ivirMainObj.filter||ivirMainObj.sorting||ivirMainObj.group||ivirMainObj.visibleColumns||ivirMainObj.hiddenColumns||ivirMainObj.highlight||ivirMainObj.design))return showAlertDialog("warning",3011,"client",appGlobalVarsObject.lcm[335]+' "'+($("#viewCaption").val()||"")+'" '+appGlobalVarsObject.lcm[301].toLowerCase()+" "),!1;window[i]($("#viewName").val(),$("#viewCaption").val(),$("#viewAplyTo option:selected").val())}else i();setSmartViewHeight(),isOpenSmartStepper=!1},cancelViewActionRef=function(e){"Edit View"!=e||_.isEmpty(ivirMainObj)||_.isEmpty(bkpIvirMainObj)||(ivirMainObj=_.cloneDeep(bkpIvirMainObj)),isOpenSmartStepper=!1},onContentReadyRef=function onContentReadyRef(task,showValuesOnOpen,isEditPill){if(disableBackDrop("bind"),isEditPill||checkForPillsLength(task),highlightTheFirstFld(),ivirbindEvents(task),"group"==task&&($("#newViewTabId").is(":visible")||isOpenSmartStepper)&&(showValuesOnOpen=ivirMainObj.group&&ivirMainObj.group.length>0?[task,0]:undefined),"column"==task)requestTstructFieldsObj(),isListView&&""!=$("#hdnListViewFieldsJSON").val()?$(".lstColSelWrapper").each(function(e,t){$(t).find(".ivirLabelWrapper input:checkbox:not(:checked)").length>0?$(t).find("input.showAllColumns[data-isgrid]").prop("checked",!1):$(t).find("input.showAllColumns[data-isgrid]").prop("checked",!0)}):$(".ivirLabelWrapper input:checkbox:not(:checked)").length>0?$("#showAllColumns").prop("checked",!1):$("#showAllColumns").prop("checked",!0);else if("design"==task){var iframe=document.createElement("iframe");$(iframe).attr("id","columnDesigner"),$(iframe).addClass("col-xs-12 col-sm-12 col-md-12 col-lg-12"),$(iframe).css("padding","0px"),$(iframe).attr("frameborder","0"),$(iframe).attr("allowtransparency","True"),$("#ivirDesignColumnWrapper")[0].appendChild(iframe);var iframeWindow=iframe.contentWindow;$(iframeWindow.document.getElementsByTagName("body")).attr("oncontextmenu","return false;").addClass("topSplitDivision").append("
"),iframeWindow.dwbiName=iName,loadAndCall({files:{css:["/Css/thirdparty/bootstrap/3.3.6/bootstrap.min.css","/ThirdParty/DataTables-1.10.13/media/css/jquery.dataTables.min.css","/ThirdParty/DataTables-1.10.13/extensions/Responsive/css/responsive.bootstrap.min.css","/ThirdParty/DataTables-1.10.13/extensions/FixedHeader/css/fixedHeader.dataTables.min.css","/Css/listViewDesigner.min.css?v=1"],js:["/Js/thirdparty/jquery/3.1.1/jquery.min.js","/Js/noConflict.min.js","/ThirdParty/lodash.min.js","/Js/common.min.js?v=98","/ThirdParty/DataTables-1.10.13/media/js/jquery.dataTables.min.js","/ThirdParty/DataTables-1.10.13/media/js/dataTables.bootstrap.min.js","/ThirdParty/DataTables-1.10.13/extensions/FixedHeader/js/dataTables.fixedHeader.min.js","/ThirdParty/DataTables-1.10.13/extensions/ColReorderWithResize/ColReorderWithResize.min.js?v=1","/ThirdParty/DataTables-1.10.13/extensions/Extras/moment.min.js","/ThirdParty/DataTables-1.10.13/extensions/Extras/datetime-moment.js","/Js/iviewColumnBuilder.min.js?v=12"]},callBack:function(){iframeWindow.axDevIvDrawTable(FieldName.map(function(e,t){var i,a,r,n,l;return{f_name:FieldName[t],f_caption:HeaderText[t],column_width:(null===(i=ivirMainObj)||void 0===i?void 0:null===(a=i.design)||void 0===a?void 0:null===(r=a.filter(function(e){return e.name==FieldName[t]}))||void 0===r?void 0:null===(n=r[0])||void 0===n?void 0:n.width)||(null===(l=ivHeadRows[FieldName[t]])||void 0===l?void 0:l["@width"])||minCellWidth.toString(),hidden:HideColumn[t],isquerycol:!1}}).filter(function(e){return"rowno"!=e.f_name})||[],iName)},win:iframeWindow})}else if("sort"==task)$("#ivirSortColumnWrapper .ivirLabelWrapper:first").addClass("labelSelected"),($("#newViewTabId").is(":visible")||isOpenSmartStepper)&&ivirMainObj.sorting&&ivirMainObj.sorting.length>0&&$("#ivirSortColumnWrapper .checkbox input[type='checkbox']").each(function(e,t){$(this).prop("checked",!1),$(this).parent().find("button span").removeClass("active");e=$(this).data("index");var i=FieldName[e],a=ivirMainObj.sorting.filter(function(e){return e[0]==i});a&&1==a.length&&2==a[0].length&&($(this).prop("checked",!0),$(this).parent().find("button span[data-order="+a[0][1]+"]").addClass("active"))});else if("highlight"==task)$(document).find("#ivirtxtColor").spectrum({color:"#000000",clickoutFiresChange:!1,beforeShow:function(e){$("#ivirbgColor").spectrum("set",$("#ivirbgColorValue").val())},change:function(e){$("#ivirtxtColorValue").val(e.toHexString())}}),$(document).find("#ivirbgColor").spectrum({color:"#000000",clickoutFiresChange:!1,beforeShow:function(e){$("#ivirtxtColor").spectrum("set",$("#ivirtxtColorValue").val())},change:function(e){$("#ivirbgColorValue").val(e.toHexString())}}),$("#ivirbgColor, #ivirtxtColor").parent().find(".sp-replacer").addClass("input-group-text"),highlightBindEvents();else if("chart"==task)$("#ivirChartName").focus();else if("view"==task){var username=eval(callParent("mainUserName"));$("#viewAplyTo").val(username),hasBuildAccess||$("#viewAplyTo").prop("disabled",!0),$("#viewCaption").focus()}if(showValuesOnOpen){var ivirMainTypeObj=ivirMainObj[showValuesOnOpen[0]][showValuesOnOpen[1]];if("highlight"==showValuesOnOpen[0]){var name=ivirMainTypeObj.n,highlightType=ivirMainTypeObj.t,bgColor=ivirMainTypeObj.bc,txtColor=ivirMainTypeObj.tc,column=ivirMainTypeObj.cl,condition=ivirMainTypeObj.cn,value=ivirMainTypeObj.v;$("#ivirHltName").val(name),$("#ivirHighlightType").val(highlightType),$("#ivirbgColorValue").val(bgColor),$("#ivirtxtColorValue").val(txtColor),$("#ivirHighlightCol option[data-index="+column+"]").prop("selected",!0).change(),$("#ivirHighlightCndtn").val(condition),$("#ivirHltValue").val(value),$(document).find("#ivirtxtColor").spectrum({color:txtColor,clickoutFiresChange:!1,change:function(e){$("#ivirtxtColorValue").val(e.toHexString())}}),$(document).find("#ivirbgColor").spectrum({color:bgColor,clickoutFiresChange:!1,change:function(e){$("#ivirbgColorValue").val(e.toHexString())}}),$("#ivirbgColor, #ivirtxtColor").parent().find(".sp-replacer").addClass("input-group-text")}else if("group"==showValuesOnOpen[0]){var name=ivirMainTypeObj.n,column=ivirMainTypeObj.cl,totalArray=ivirMainTypeObj.t,grndTotalArray=ivirMainTypeObj.g,totalCndtns=1;if($("#grpName").val(name),$("#grpColName option[data-index="+column+"]").prop("selected",!0).change(),totalArray)for(var i=1;iCount'),t.find('option[value="count"]').last().remove()):t.data("lastSelected",i),t.parents(".ivirTotalCndtn").find(".grndTtlCB input").prop({checked:!1,disabled:!0}),""!=i){"count"==i&&$(".totalAggrFunction").not(this).find('option[value="count"]').remove();var r=[];if("ivirTotalCndtn1"==t.parents(".ivirTotalCndtn ").attr("id"))r=[tmpGroupObj.groupIndex];else{var n=tmpGroupObj.groupIndex,l=tmpGroupObj.indexeSelected;n&&l==undefined?r.push(n):l&&(-1==$.inArray(n,l)&&l.push(n),r=l)}var o=getAllColumns(r);"sum"==i||"max"==i||"min"==i||"avg"==i?t.parents(".ivirTotalCndtn").find("select.totalSource").append(o[0]).trigger("change"):(t.parents(".ivirTotalCndtn").find("select.totalSource").append(o[0]).trigger("change"),t.parents(".ivirTotalCndtn").find("select.totalSource").append(o[1]).trigger("change"))}}),$(document).on("change",".totalSource",function(e){var t=$(this).parents(".ivirTotalCndtn").find(".grndTtlCB input");if("n"==$(this).find("option:selected").data("type")){var i=$(this).find("option:selected").data("index");t.data("index",i).prop("disabled",!1)}else t.prop("disabled",!0)}),$(document).on("change",".ivirChartCheckBox",function(e){var t=$(this),i=t.data("index"),a=t.attr("id");try{requestJSON&&"old"!=iviewButtonStyle&&(ivirMainObj.chart[i].checked=t.is(":checked"))}catch(r){}if(t.is(":checked")){if(requestJSON&&"old"!=iviewButtonStyle&&t.attr("checked","checked"),!checkForPillDependentFlds("chart",i))return t.prop("checked",!1),t.removeAttr("checked"),!1;requestJSON&&"old"!=iviewButtonStyle||($(".ivirChartCheckBox").not("#"+a).prop("checked",!1).removeAttr("checked"),$("#ivirChartWrapper .chartWrapper").hide()),$("#ivirChartWrapper #ivirChart"+i).show(),ivirCreateChart(i,!0,!0)}else requestJSON&&"old"!=iviewButtonStyle&&t.removeAttr("checked"),requestJSON&&"old"!=iviewButtonStyle?$("#ivirChartWrapper #ivirChart"+i).hide():t.prop("checked",!0).attr("checked","checked");adjustChartBasedWrapperHeight(),isChartCreationOnLoad||$("[data-dropdown-value=save]:eq(0)").click()}),$(document).on("change",".ivirFilterCheckBox",function(e){var t=$(this),i=t.data("type");if(t.is(":checked")){if("group"==i){if(!checkForPillDependentFlds("group",t.data("index")))return t.prop("checked",!1),t.removeAttr("checked"),!1;$("#chartActionLi").addClass("subHeader")}else"filter"==i&&(advFiltersObjectToApply=ivirMainObj.filter[t.data("index")].data,ivirDataTableApi.draw(),requestJSON&&"old"!=iviewButtonStyle&&setFilterInfo());t.attr("checked","checked"),applyThePill(i,t.data("index"))}else if(t.removeAttr("checked"),"highlight"==i)clearIvirHighlight(t.data("index"));else if("group"==i){var a=t.data("index"),r=ivirMainObj[i][a].g;if(r)for(var n=0;n0&&ivirVisibleColumns.push(groupingCol),createIvirDataTable("clear",a,"",allGrandTotal),$("#chartActionLi").removeClass("subHeader")}else"filter"==i&&(advFiltersObjectToApply={somedummyfilterjsobjectkey:"dummy"},ivirDataTableApi.draw(),setFilterInfo())}),$(function(){$.fn.popover.Constructor.prototype.reposition=function(){var e=this.tip(),t="function"==typeof this.options.placement?this.options.placement.call(this,e[0],this.$element[0]):this.options.placement,i=this.getPosition(),a=e[0].offsetWidth,r=e[0].offsetHeight,n=t,l=this.getPosition(this.$viewport);t="bottom"===t&&i.bottom+r>l.bottom?"top":"top"===t&&i.top-rl.width?"left":"left"===t&&i.left-a'):a.find(".js-dropdown__current").attr("title","Search "+i.text()).text(i.text()),svHtmlGeneratorRef(i,a.find(".js-dropdown__input"))}}),r.on("click.ui.dropdown",function(t){e(t.target).parents().hasClass("js-dropdown")||(e(i).unbind("keydown.upDownEvents"),e(".js-dropdown").removeClass("is-open"),e(".js-dropdown").find(".dropDownButton__list").css({display:"none"})),e(t.target).hasClass("rightClickMenuIcn")||e(".rightClickMenu").hide()})}(jQuery,window,document),$(window).resize(function(){$(".dataTables_scrollHead table thead tr th:last-child").visible(!0)?$(".dataTables_scrollHead").off("keydown"):$(".dataTables_scrollHead").on("keydown",function(e){9==(e.keyCode||e.which)&&e.preventDefault()})});var createdCell=createCustomElement=function(e,t,i,a,r){"undefined"!=typeof rowRefreshIndex&&(a=rowRefreshIndex),isSpecialRow=!1;var n=FieldName[r],l=getPropertyAccess(n);if(""!=(t=processCellData({td:e,cellData:t,rowData:i,row:a,col:r,colID:n,rowDataAccess:l})))if(0==r)$(e).html(generateCellCheckbox({td:e,cellData:t,rowData:i,row:a,col:r,colID:n,rowDataAccess:l}));else{var o,s,c,d=!0;null!==(o=tstFields.filter(function(e){return e.name==n}))&&void 0!==o&&o.length&&"check box"==(null===(s=tstFields.filter(function(e){return e.name==n})[0])||void 0===s?void 0:null===(c=s.component)||void 0===c?void 0:c.toLowerCase())&&(d=!1,$(e).html(generateFieldCheckbox({td:e,cellData:t,rowData:i,row:a,col:r,colID:n,rowDataAccess:l}))),isSpecialRow?d&&$(e).html(t):$(e).html(generateCellHyperlink({td:e,cellData:t,rowData:i,row:a,col:r,colID:n,rowDataAccess:l})),applyConditionalFormatting({td:e,rowData:i,colID:n}),cellHeaderConf.root_class_index&&$(e).html(generateExpColTree({td:e,cellData:t,rowData:i,row:a,col:r,colID:n,rowDataAccess:l})),""!=HeaderText[r]&&"$nbsp;"!=HeaderText[r]&&enableCardsUi&&!cardTemplatingHTML&&($(e).children().wrap('
'),$(e).prepend(""))}else $(e).html("");iviewWrap?$(e).css({"word-break":"break-word"}):$(e).css({"white-space":"nowrap"});try{var p,h="";try{p=ivTemplates.filter(function(e,t){return getCaseInSensitiveJsonProperty(e,"ELEMENTS")[0].toLowerCase()==n.toLowerCase()})}catch(u){}p&&p.length&&(h=getCaseInSensitiveJsonProperty(p[0],"CVALUE")[0]),h&&renderColumnTemplete({hbHTML:h,td:e,cellData:t,rowData:i,row:a,col:r,colID:n,rowDataAccess:l})}catch(u){}try{createdCellEndCustom(e,t,i,a,r)}catch(u){}return $(e).attr("data-field-name",n),e};function refreshRow(e,t){try{if(t=t||e.data(),isCheckedRowRefresh=!1,"true"==isChkBox)try{isCheckedRowRefresh=$(e.node()).find("td:eq(0) input:checkbox").prop("checked")||!1}catch(a){}e.data(t).invalidate(),rowRefreshIndex=e.index();var i=ivirDataTableApi.row.add(t).draw();$(e.node()).html($(i.node()).html()),i.remove().draw()}catch(a){}}function renderRowTemplete(e,t,i,a){var r=FieldName.reduce(function(e,a){return Object.assign(e,_defineProperty({},a,(cellVal=$(t).find('td[data-field-name="'.concat(a,'"]')).html(),"undefined"!=typeof cellVal?cellVal:i[getPropertyAccess(a)])))},{});r.axRenderProject=callParentNew("thmProj")||proj,r.axRenderIName=iName,r.axRenderRowNo=a+1;try{axPreTemplate(r,t,i,a)}catch(l){}var n="";try{n=Handlebars.compile(e)(r)}catch(o){console.log("Row Templete",o)}n&&$(t).html(n).css({"background-color":"initial"}).addClass("rowTemplate");try{axPostTemplate(r,t,i,a)}catch(l){}}function renderColumnTemplete(e){var t=e.hbHTML,i=e.td,a=e.cellData,r=e.rowData,n=e.row,l=e.col,o=e.colID,s=e.rowDataAccess,c=_objectSpread({},r);c.axRenderThis=$(i).html(),c.axRenderProject=callParentNew("thmProj")||proj,c.axRenderIName=iName,c.axRenderRowNo=n+1;try{axPreColumnTemplate(c,i,a,r,n,l,o,s)}catch(p){}var d="";try{d=Handlebars.compile(t)(c)}catch(h){console.log(o+" Column Templete",h)}d&&$(i).html(d).addClass("columnTemplate");try{axPostColumnTemplate(c,i,a,r,n,l,o,s)}catch(p){}}function constuctDataButton(e){var t="";if(1==requestJSON&&"old"!=iviewButtonStyle){t+='
',t+='',t+='
list_alt
';var i="modern"==iviewButtonStyle?"w-100 w-sm-350px":"w-200px",a="modern"==iviewButtonStyle?"col-4":"menu-item px-3",r="modern"==iviewButtonStyle?"d-flex flex-column flex-center text-center text-gray-800 text-hover-primary bg-hover-light rounded p-3 mb-3":"menu-link px-3",n="modern"==iviewButtonStyle?"":"me-3";t+='",t+="
",$("#filterWrapper").html(t)}else{if(t+='
',t+='',t+=''+callParentNew("lcm")[406]+'',t+='",t+="
",$("#filterWrapper").html(t)}requestJSON&&appGlobalVarsObject._CONSTANTS.compressedMode&&($(".toolbarRightMenu").find(".tb-btn").addClass("btn-sm"),$(".toolbarRightMenu").find(".tb-btn .material-icons.material-icons-style").addClass("material-icons-2"))}function deleteViewtab(e){if(!hasBuildAccess&&"ALL"==ivirMainViewObj.views[e].applyTo)return showAlertDialog("warning",callParentNew("lcm")[484]),!1;var t=$("a#"+e).closest("li").hasClass("active");t&&clearExistingPills(),$("#IvirActions").val("");try{var i=ivirMainViewObj.views[e].applyTo,a=e;delete ivirMainViewObj.views[e],ivirMainObj={},SaveSmartviewJsonToDb("set",JSON.stringify(ivirMainViewObj),i,a)}catch(r){console.log(r)}t?getSavedConditionsNew("main",JSON.stringify(ivirMainViewObj)):($("a#"+e).closest("li").remove(),reAdjust()),0==$("#viewTabs").children("li").length&&($("#dvViewtabs").hide(),$(".scroller").hide()),setSmartViewHeight()}function loadViewTab(e){var t=ivirMainViewObj.views[e].params.replace(/`/g,"`"),i=ivirMainViewObj.views[e].paramsList||"";i&&(i=JSON.parse(JSON.stringify(i).replace(/&/g,"&")));var a="";if(isListView&&ivirMainViewObj.views[e]&&ivirMainViewObj.views[e].visibleColumns&&ivirMainViewObj.views[e].visibleColumns.length>0&&ivirMainViewObj.views[e].visibleColumns[0].structure&&(a=ivirMainViewObj.views[e].visibleColumns),""!=t&&t!=undefined){if(SetParamValues(t,i),"main"!=e&&"charts"!=e){var r=ivirMainViewObj.views[e];r&&r.chart&&r.chart.length&&r.chart.length>0&&$("#hdnWebServiceViewName").val(e)}setTimeout(function(){$("#button1").trigger("click")},0),loadViewName=e}else if(isListView&&a){try{var n=_.map(a[0].dcs,function(e){return e.fields}).reduce(function(e,t){return e=[].concat(_toConsumableArray(e),_toConsumableArray(t))},[]).join(",");$("#hdnLvSelectedCols").val(n),$("#hdnLvSelectedHyperlink").val(a[0].hyperlink),$("#hdnLvChangedStructure").val(ReplaceUrlSpecialChars(a[0].structure))}catch(l){}setTimeout(function(){$("#button1").trigger("click")},0),loadViewName=e}else clearExistingPills(),getSavedConditionsNew(e,JSON.stringify(ivirMainViewObj))}function pinItemToTaskbar(e){var t=$(e).clone();if(t.find("a > i").remove(),t.hasClass("dropdown-submenu")){if(t.removeClass("dropdown-submenu"),t.children("a").append(''),"filterWrapper"==t.attr("id")||"modern"!=iviewButtonStyle&&"ivirCButtonsWrapper"==t.attr("id")?t.find("ul").hasClass("dropdown-menu")&&t.find("ul").removeClass("dropdown-menu"):(t.addClass("dropdown"),t.find("ul").removeAttr("style"),t.find("a#tasks")&&t.find("li").addClass("liTaskItems")),"ivirCButtonsWrapper"==t.attr("id")){var i=t.find("ul a:not(.active):eq(0)");$(i).find(".customIcon").removeClass("customIcon"),$(i).html($(i).html().replace($(i).text(),"")),t.html(i.clone())}}else t.addClass("actionWrapper");t.attr("id")&&t.attr("id","pinned"+t.attr("id")),$.each(t.find("*"),function(e,t){$(t).attr("id")&&$(t).attr("id","pinned"+$(t).attr("id"))}),$("#pinnediconsUl").append(t),"pinnedivirCButtonsWrapper"==t.attr("id")&&"modern"==iviewButtonStyle&&($("#ivirMainDataTableWrapper").is(":visible")?toggleGridView("grid"):toggleGridView("chart")),setPinedIconContainerWidth()}function constructPinnedToolbar(){if(!toolbarPinArr.length)return!1;$("#pinnediconsUl").children().remove();for(var e=0;e i").attr("title","Unpin from taskbar")):(pinItemToTaskbar($("#"+toolbarPinArr[e]).parent("li")),$("#"+toolbarPinArr[e]).parent("li").addClass("pinned"),$("#"+toolbarPinArr[e]).find("i").attr("title","Unpin from taskbar")))}function mergerSmartviewSettings(e){if(""!=e){jsonObj=JSON.parse(e),jsonObj.all&&jsonObj.all.views&&$.each(jsonObj.all.views,function(e,t){"ALL"!=t.applyTo&&delete jsonObj.all.views[e]});var t=callParentNew("mainUserName"),i=$.extend(!0,{},jsonObj.all,jsonObj[t]);return JSON.stringify(i)}}function setFilterInfo(){var e="";!(processObj=Object.keys(advFiltersObjectToApply).length>0?advFiltersObjectToApply:generateSearchString("JSON"))||$.isEmptyObject(processObj)||processObj.somedummyfilterjsobjectkey||(e='\n
\n \n \n '.concat(appGlobalVarsObject.lcm[409],'\n \n \n
\n \n \n \n ').concat(Object.keys(processObj).map(function(e){if("somedummyfilterjsobjectkey"!=e&&processObj[e]){var t=processObj[e],i="";return dateOptionsId.indexOf(t)>-1&&(t=dateOptions[dateOptionsId.indexOf(t)]),"object"==_typeof(t)&&"undefined"!=typeof t.min&&"undefined"!=typeof t.max&&(t="".concat(t.min," to ").concat(t.max)),i=requestJSON?t.toString().replace(/`/g,","):t.toString().replace(/\♣\|♣/g,","),'\n \n \n ').concat(HeaderText[FieldName.indexOf(e)],"\n : ").concat(i,"\n \n ")}return""}).join(". "),"\n \n ")),$("#dvSelectedFilters").is(":visible")?$(".paramPillContent").removeClass("d-none"):$(".paramPillContent").addClass("d-none"),e&&$("#dvSelectedFilters").is(":visible")?$(".paramPillContent, .filterPillContent").addClass("half"):$(".paramPillContent, .filterPillContent").removeClass("half"),$(".filterPillContent").html(e),$("#myFiltersPillInfo").data("filterJsonObj",processObj)}function clearFilters(){advFiltersObjectToApply={somedummyfilterjsobjectkey:"dummy"},ivirDataTableApi.draw(),setFilterInfo(),$("[id^='filterpillCB']").prop("checked",!1).removeAttr("checked")}function adjustChartBasedWrapperHeight(){if($("#ivirChartWrapper .chartWrapper:visible").length>0){$(".iviewTableWrapperNew").addClass("chartsAdded");var e=0;try{$(".ivcaptions").length&&(e=$(".ivcaptions").toArray().reduce(function(e,t){return e+$(t).outerHeight(!0)},0))}catch(a){}var t=0;try{$(".mainTabs").length&&(t=$(".mainTabs").outerHeight(!0))}catch(a){}var i=Math.round($(window).height()-($("#breadcrumb-panel").height()+e+t));$(".iviewTableWrapperNew.chartsAdded").css({height:i+"px"})}else $(".iviewTableWrapperNew").removeClass("chartsAdded"),$(".iviewTableWrapperNew").css({height:""})}function forceColumnWidth(){visibleTableWidth=0,$("#GridView1 tfoot tr td").css({width:"","max-width":""}),$(".dataTables_scrollHead table.gridData thead tr:last th").toArray().forEach(function(e,t){var i,a,r,n,l=$(e).data("headerName"),o=(parseInt((null===(i=ivirMainObj)||void 0===i?void 0:null===(a=i.design)||void 0===a?void 0:null===(r=a.filter(function(e){return e.name==l}))||void 0===r?void 0:null===(n=r[0])||void 0===n?void 0:n.width)||ivHeadRows[l]["@width"]||(isListView&&"rowno"==l?listViewCheckBoxSize:minCellWidth))||0)+widthIncrement;visibleTableWidth+=o,$(".dataTables_scrollHead table.gridData thead tr:last th[data-header-name=".concat(l,"], .dataTables_scrollBody table.gridData thead tr:last th[data-header-name=").concat(l,"], .dataTables_scrollFoot table.gridData tfoot tr td:eq(").concat(t,")")).css({width:"".concat(o,"px"),"max-width":"".concat(o,"px")})}),$(".gridData").css({width:"".concat(visibleTableWidth,"px")})}Handlebars.registerHelper("onclick",function(){for(var e,t=arguments.length,i=new Array(t),a=0;a"),n,l,o)||""}),Handlebars.registerHelper("get",function(){for(var e,t=arguments.length,i=new Array(t),a=0;a\n table#GridView1 {\n width: 70% !important;\n margin: 0 auto;\n }\n\n tr.rowTemplate {\n box-shadow: none !important;\n }\n\n @media (max-width: 960px) {\n table#GridView1 {\n width: 85% !important;\n }\n }\n\n @media (max-width: 768px) {\n table#GridView1 {\n width: 85% !important;\n }\n }\n\n @media (max-width: 600px) {\n table#GridView1 {\n width: 95% !important;\n }\n }\n\n @media (max-width: 480px) {\n table#GridView1 {\n width: 95% !important;\n }\n }\n\n @media (max-width: 320px) {\n table#GridView1 {\n width: 95% !important;\n }\n }\n \n
\n
\n\n
\n
\n
\n {{#is axp_status}}\n {{#is axp_status \'toLower\' \'active\'}}\n \n {{/is}}\n {{#is axp_status \'toLower\' \'delayed\'}}\n \n {{/is}}\n {{#is axp_status \'toLower\' \'progress\'}}\n \n {{/is}}\n {{axp_status}}\n {{/is}} \n\n {{#is axrowoptions}}\n \n {{/is}}\n
\n
\n
\n\n {{#is axp_icon_img}}\n
\n image\n
\n\n {{else}}\n {{#is axp_icon}}\n
\n {{axp_icon}}\n
\n
\n {{/is}}\n {{/is}}\n\n\n
\n

{{{axp_title}}}

\n\n

{{axp_description}}

\n
\n\n
\n
\n\n
\n
\n ';case"tile":return'\n \n
\n
\n
\n
\n {{#is axrowoptions}}\n \n {{/is}}\n
\n
\n
\n {{#is axp_icon_img}}\n
\n Not Found\n
\n {{else}}\n {{#is axp_icon}}\n
\n {{axp_icon}}\n
\n
\n {{/is}}\n {{/is}}\n
\n

\n {{{axp_title}}}\n

\n
\n
\t \t\n
\n
\n
\n
\n

{{axp_description}}

\n
\n {{#is axp_status}}\n
\n
\n {{#is axp_status \'toLower\' \'active\'}}\n \n {{/is}}\n {{#is axp_status \'toLower\' \'delayed\'}}\n \n {{/is}}\n {{#is axp_status \'toLower\' \'progress\'}}\n \n {{/is}}\n {{axp_status}} \n
\n {{/is}}\n
\n
\n
\n
\n ';case"":default:return e}}function parseJSON(e){try{return JSON.parse(e)}catch(t){return!1}}function smartStepper(e,t,i){var a,r,n,l,o,s,c,d,p;ShowDimmer(!0);var h=Object.keys(newBtnGroup).map(function(e){return newBtnGroup[e]}).filter(function(e){return e.visible}),u='saveViewActionRef("'.concat(e?"Add View":"Edit View",'", "view", "saveInSessionBeforeSaveNew", ').concat(e?p:JSON.stringify(["view",1]),", ").concat(!e,")"),v='
\n
\n
\n '.concat(h.map(function(e,t){return'
\n
\n
\n ').concat(e.icon,'\n ').concat(e.icon,'\n
\n
\n

\n ').concat(e.caption,"\n

\n
\n
")}).join(""),' \n
\n
\n
\n
\n
\n ').concat(h.map(function(t,i){return'
\n ').concat(t.html(!e),"\n
")}).join("")," \n
\n
\n
\n
\n "),m='\n \n \n '),g="".concat(e||"main"==t?"":'\n \n delete\n \n '),'\n \n \n \n auto_mode\n \n \n '),b='\n "),f=new BSModal("newViewTabId","",v,function(){h.map(function(t,i){return"filter"==t.task?initMoreFiltersAddOns():("group"!=t.task&&"highlight"!=t.task||e?"column"==t.task&&isListView&&ivirMainObj.visibleColumns&&$("#selColHypOpts").val(ivirMainObj.visibleColumns[0].hyperlink).trigger("change"):ivirMainObj[t.task]&&(p=[t.task,0]),onContentReadyRef(t.task,p,!e))}).join(""),c=document.querySelector("#newViewTabId"),d=new KTStepper(c);var t="".concat(appGlobalVarsObject.lcm[442]," ").concat(d.steps[d.getCurrentStepIndex()-1].getElementsByClassName("stepper-title")[0].innerText);document.getElementsByClassName("sv-btn-apply")[0].innerText=t,d.on("kt.stepper.click",function(e){e.goTo(e.getClickedStepIndex()),t="".concat(appGlobalVarsObject.lcm[442]," ").concat(e.steps[e.getCurrentStepIndex()-1].getElementsByClassName("stepper-title")[0].innerText),document.getElementsByClassName("sv-btn-apply")[0].innerText=t});try{var i;$("select.stepperSelect").select2({allowClear:!0,placeholder:appGlobalVarsObject.lcm[441]}),$("select#viewAplyTo").select2({allowClear:!0,placeholder:appGlobalVarsObject.lcm[441],width:"resolve"}),null===(i=KTApp)||void 0===i||i.initBootstrapTooltips(),hasBuildAccess||$("#viewAplyTo").append(new Option(callParentNew("mainUserName"),callParentNew("mainUserName"),!0,!0)).trigger("change"),$(document).off("click",".sv-btn-apply").on("click",".sv-btn-apply",function(){var t,i,a,r=null===(t=newBtnGroup[d.steps[d.currentStepIndex-1].dataset.svname])||void 0===t?void 0:t.task;saveViewActionRef("".concat(e?"Add View":"Edit View"),"".concat(r),null===(i=newBtnGroup[d.steps[d.currentStepIndex-1].dataset.svname])||void 0===i?void 0:i.apply,e?p:JSON.stringify([r,1]),!e),showAlertDialog("info","".concat(null===(a=newBtnGroup[d.steps[d.currentStepIndex-1].dataset.svname])||void 0===a?void 0:a.caption," applied. Please ").concat(appGlobalVarsObject.lcm[400]," to see the changes."))}).off("click",".sv-btn-reset").on("click",".sv-btn-reset",function(){var e,t;null===(e=newBtnGroup[d.steps[d.currentStepIndex-1].dataset.svname])||void 0===e||e.clear(),showAlertDialog("success","".concat(null===(t=newBtnGroup[d.steps[d.currentStepIndex-1].dataset.svname])||void 0===t?void 0:t.caption," ").concat(appGlobalVarsObject.lcm[393],"."))})}catch(a){}setTimeout(function(){ShowDimmer(!1)},0)},function(){var e;onCloseRef(null===(e=newBtnGroup[d.steps[d.currentStepIndex-1].dataset.svname])||void 0===e?void 0:e.task),d=undefined});f.changeSize("fullscreen"),f.scrollableDialog(),f.okBtn.innerText=appGlobalVarsObject.lcm[400],f.okBtn.setAttribute("onclick","".concat(u)),f.cancelBtn.classList.add("d-none"),(a=f.modalFooter.classList).add.apply(a,_toConsumableArray("hstack gap-2".split(" ")));var w=document.createElement("div");(r=w.classList).add.apply(r,_toConsumableArray("d-flex col-11 gap-5".split(" "))),f.modalHeader.prepend(w),f.headerExtras=w,f.headerExtras.innerHTML=m,null===(n=f.modalHeader.getElementsByClassName("btn-close"))||void 0===n||n[0].setAttribute("onclick",'cancelViewActionRef("'.concat(e?"Add View":"Edit View",'")'));var C=document.createDocumentFragment();f.footerExtras=C;var y=document.createElement("div");(l=y.classList).add.apply(l,_toConsumableArray("vr h-30px bg-dark m-3".split(" "))),f.modalFooter.prepend(y),f.footerExtras.buttonSeparator=y;var x=document.createElement("div");(o=x.classList).add.apply(o,_toConsumableArray("d-flex gap-2".split(" "))),f.modalFooter.prepend(x),f.footerExtras.buttonApply=x,f.footerExtras.buttonApply.innerHTML=b;var k=document.createElement("div");(s=k.classList).add.apply(s,_toConsumableArray("d-flex gap-2 me-auto".split(" "))),f.modalFooter.prepend(k),f.footerExtras.buttonDeleteReset=k,f.footerExtras.buttonDeleteReset.innerHTML=g}function smartCharts(){var e=!(arguments.length>0&&arguments[0]!==undefined)||arguments[0],t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:undefined,i=arguments.length>2&&arguments[2]!==undefined&&arguments[2],a=new BSModal(appGlobalVarsObject.lcm[410],appGlobalVarsObject.lcm[410],getChartHtml(!e),function(){var e;$("select.chartSelect").select2({allowClear:!0,placeholder:appGlobalVarsObject.lcm[441]}),onContentReadyRef("chart",t,i),null===(e=KTApp)||void 0===e||e.initBootstrapTooltips()},function(){});a.changeSize("fullscreen"),a.scrollableDialog(),a.okBtn.innerText=appGlobalVarsObject.lcm[399],a.okBtn.addEventListener("click",function(){saveViewActionRef("Charts","chart",newBtnGroup.charts.apply,t==undefined?t:JSON.stringify(t),i)})}function getRowGroupingCondtionHtml(){return'\n
\n
\n \n \n
\n
\n
\n
\n \n \n help_outline\n \n \n
\n
\n
\n \'\n
\n \n
\n \n
\n ')}