function getChartColorsArray(e){if(null!==document.getElementById(e))return e=document.getElementById(e).getAttribute("data-colors"),(e=JSON.parse(e)).map(function(e){var t=e.replace(" ","");return-1===t.indexOf(",")?getComputedStyle(document.documentElement).getPropertyValue(t)||t:2==(e=e.split(",")).length?"rgba("+getComputedStyle(document.documentElement).getPropertyValue(e[0])+","+e[1]+")":t})}var options,chart,chartDonutBasicColors=getChartColorsArray("simple_dount_chart"),url=(chartDonutBasicColors&&(options={series:[98,63,35],labels:["New Application","Approved","Rejected"],chart:{height:300,type:"donut"},legend:{position:"bottom"},dataLabels:{dropShadow:{enabled:!1}},colors:chartDonutBasicColors},(chart=new ApexCharts(document.querySelector("#simple_dount_chart"),options)).render()),"assets/json/"),allJobList="",editList=!1,prevButton=document.getElementById("page-prev"),nextButton=document.getElementById("page-next"),currentPage=1,itemsPerPage=3,getJSON=function(e,t){var n=new XMLHttpRequest;n.open("GET",url+e,!0),n.responseType="json",n.onload=function(){var e=n.status;t(200===e?null:e,n.response)},n.send()};function loadJobListData(e,t){var n=Math.ceil(e.length/itemsPerPage);n<(t=t<1?1:t)&&(t=n),document.querySelector("#job-list").innerHTML="";for(var o,a,i=(t-1)*itemsPerPage;i{a+=''+e+""})),e[i]&&(document.querySelector("#job-list").innerHTML+='
'+e[i].jobTitle+'

'+e[i].companyName+'

'+e[i].description+"

"+a+'
');document.getElementById("total-result").innerHTML=e.length,selectedPage(),1==currentPage?prevButton.parentNode.classList.add("disabled"):prevButton.parentNode.classList.remove("disabled"),currentPage==n?nextButton.parentNode.classList.add("disabled"):nextButton.parentNode.classList.remove("disabled"),jobDetailShow()}function selectedPage(){for(var e=document.getElementById("page-num").getElementsByClassName("clickPageNumber"),t=0;t"+n+"";document.addEventListener("click",function(e){"A"==e.target.nodeName&&e.target.classList.contains("clickPageNumber")&&(currentPage=e.target.textContent,loadJobListData(allJobList,currentPage))}),selectedPage()}getJSON("job-list.json",function(e,t){null!==e?console.log("Something went wrong: "+e):(loadJobListData(allJobList=t,currentPage),paginationEvents(),sortElementsById())});var tagInputField=new Choices("#taginput-choices",{removeItemButton:!0});function fetchIdFromObj(e){return parseInt(e.id)}function findNextId(){var e,t;return 0===allJobList.length?0:(e=fetchIdFromObj(allJobList[allJobList.length-1]))<=(t=fetchIdFromObj(allJobList[0]))?t+1:e+1}function sortElementsById(){loadJobListData(allJobList.sort(function(e,t){e=fetchIdFromObj(e),t=fetchIdFromObj(t);return t"+i+"";loadJobListData(n,currentPage)}),document.getElementById("CreateJobModal").addEventListener("hidden.bs.modal",e=>{clearFields()});