(()=>{"use strict";!function(e){function t(t){if(!t.id)return t.text;var n=e('<span class="status-indicator projects">'+t.text+"</span>"),r=n.text().split(" ").join("").toLowerCase();return"inprogress"===r?n.addClass("in-progress"):"onhold"===r?n.addClass("on-hold"):"completed"===r?n.addClass("completed"):n.addClass("empty"),n}e("#tasks-table").DataTable({language:{searchPlaceholder:"Search...",sSearch:""},pageLength:10}),e("document").on("ready",(function(){var t=e("#task-file-input"),n=t.next("label").find("span"),r=e("i.remove"),a=n.text();t.on("change",(function(e){var c=t.val().split("\\").pop();c?(n.text(c),r.show()):(n.text(a),r.hide())})),r.on("click",(function(e){t.val(""),n.text(a),r.hide(),console.log(t)}))})),e(".select2").select2({minimumResultsForSearch:1/0}),e(".select2-status-search").select2({templateResult:t,templateSelection:t,escapeMarkup:function(e){return e}})}(jQuery);var e=document.querySelector(".sub-list-container");if(e){var t=function(t){e.removeChild(t.target.parentElement)},n=document.querySelector(".sub-list-item"),r=document.querySelector("#addTask"),a=document.querySelector("#subTaskInput"),c=document.querySelector("#errorNote"),l=document.querySelector("#deleteAllTasks"),s=document.querySelector("#completedAll");setTimeout((function(){setInterval((function(){for(var e=document.querySelectorAll(".delete-main"),n=0;n<e.length;n++)e[n].addEventListener("click",t)}),10)}),1);var o=0,i=n.cloneNode(!0);s.addEventListener("click",(function(){var t=e.children;if(o%2!=0)for(var n=0;n<t.length;n++)t[n].classList.remove("task-completed");else for(var r=0;r<t.length;r++)t[r].classList.add("task-completed");o++})),l.addEventListener("click",(function(){e.innerHTML=" "})),r.addEventListener("click",(function(){c.innerText="";var t=i.cloneNode(!0);t.classList.remove("task-completed");var n=a.value;0!==n.length?(e.appendChild(t),t.children[0].children[1].innerText=n,a.value=""):c.innerText="Please Enter Valid Input"}))}!function(){var e=document.querySelectorAll(".reply a"),t=document.createElement("div");t.setAttribute("class","comment mt-5 d-grid w-60");var n=document.createElement("textarea");n.setAttribute("class","form-control"),n.setAttribute("rows","5"),n.innerText="Your Comment";var r=document.createElement("button");r.setAttribute("class","btn btn-danger"),r.innerText="Cancel";var a=document.createElement("div");a.setAttribute("class","btn-list ms-auto mt-2");var c=document.createElement("button");c.setAttribute("class","btn btn-success ms-3"),c.innerText="Submit",t.append(n),t.append(a),a.append(r),a.append(c),e.forEach((function(e,n){e.addEventListener("click",(function(){$(e).parent().append(t),r.addEventListener("click",(function(){t.remove()}))}))}))}()})();