"use strict";document.addEventListener("readystatechange",()=>{"complete"===document.readyState&&(refreshIndexState(),window.setInterval(refreshIndexState,5e3),$.notify.addStyle("bootstrap4",{html:'<div>\n      <div class="card shadow" style="width: 18rem;">\n        <div class="card-body">\n          <div class="d-flex justify-content-between align-items-baseline">\n            <div>\n              <h5 class="card-title mb-2" data-notify-html="title"></h5>\n              <h6 class="card-subtitle mb-2 text-muted" data-notify-text="subtitle"></h6>\n            </div>\n            <button type="button" class="close no">\n              <span aria-hidden="true">&times;</span>\n            </button>\n          </div>\n          <p class="card-text" data-notify-text="text"></p>\n        </div>\n      </div>\n    </div>'}),$(document).on("click",".notifyjs-bootstrap4-base .no",function(){$(this).trigger("notify-hide")}),$(document).on("notify-show",".notifyjs-wrapper",function(){var e=Array.from($(".notifyjs-bootstrap4-base",$(this)).get(0).classList).filter(e=>"notifyjs-bootstrap4-base"!=e)[0].split("-");$(".card",$(this)).addClass("bg-"+e[e.length-1])}),$("#includechildren_copy").prop("checked",$("#includechildren").prop("checked")),$("#includechildren_copy").on("click",function(){console.log($(this).prop("checked")),$("#includechildren").prop("checked",$(this).prop("checked")),$("button[type=submit]",$("#includechildren").closest("form")).click()}),$("#includechildren").closest(".form-group").addClass("d-none"))});const refreshIndexState=()=>{const e=document.getElementById("indexState").dataset.src,t=new XMLHttpRequest;t.addEventListener("load",render),t.open("POST",e,!0),t.send()},render=e=>{const t=JSON.parse(e.currentTarget.response),n=document.querySelector("#indexState tbody");n.replaceChildren("");for(const[e,d]of Object.entries(t.stats)){const t=document.createElement("TR");"total"!==e?(appendColumn(t,d.cNameDeutsch),appendColumn(t,d.stats.documentCount),appendColumn(t,readableFileSizeString(d.stats.fileSize))):(appendColumn(t,""),appendColumn(t,d.documentCount),appendColumn(t,readableFileSizeString(d.fileSize))),n.append(t)}},appendColumn=(e,t)=>{const n=document.createElement("TD");n.innerHTML=t,e.append(n)},readableFileSizeString=e=>{var t=-1;do{e/=1024,t++}while(e>1024);return Math.max(e,.1).toFixed(1)+[" kB"," MB"," GB"," TB","PB","EB","ZB","YB"][t]};