adapt progressbar function , when it's generating, not generating, false, true, and else. think for yourself on wtf are you trying to accomplish here, and then output. try do some functioning progressbar that simply displays a number of seconds passed since generation start."<div class="progress-bar"> </div>" and "<div class="progress-bar-filled"></div>". so, need to set initial state for prog bar when there's no any data or timeouts available in generateimage, but subsequently it should coun timiouts in generateimage and apply them to these progbar elements in seconds passed since previous attempt in generation timout.the problem that it always counting constantly, while it should predict the time passed since the last generation in generate image async funct. there's two states inside generateimage func "isGenerating = true;" and "isGenerating = false;". need to set initial message in progress bar as "loading" or something, then calculate the generation cooldown for subsequent isGenerating" triggerings inside generateimgae and simply show the numerical value passed inside progbar since generation previous process.there's two states in it already if is generating and if is not generating. async function generateImage() {   if (isGenerating || autoQueueActive) {     return;   }   if (galleryArray.length >= totalLimit) {     if (autoSaveEnabled) {       saveAllImages().then(() => {         clearGallery();       });     } else {       clearGallery();     }     return;   }. why cannot we use or determine the time inside independent function inbetween these two states in generation true/false, except adding some timeout and else crap inside generateimage funct?"function remains the same with the addition of calling a separate calculateCooldown function.". why do I need that? why cannot you do it other fashion? why you cannot get cooldown inbetween true/false states in javascript in async function?you didn't answered in human words: why you cannot get cooldown inbetween true/false states in javascript in async function?"it becomes ". it becomes messy as hell, gpt. now answer how to truly get these states: why you cannot get cooldown inbetween true/false states in javascript in async function?this is not right, gpt. there shall be other ways to get this timeout from isGenerating(); call. because it's already defined and functiong, so why the fuck not?can you not touch async function generateImage() at all? try do it solely from outsider function for progbar. previousGenerationTime = Date.now();". that is illegit.: ```
function handleProgressBar() {
  const progressBarFilled = document.getElementById("progressBarId");
  const startTime = Date.now();
  const timeLeft = Math.floor(estimatedTime / 1000);
  progressBarFilled.style.background =
    "linear-gradient(90deg, rgba(1,1,48,0.9) 10%, rgba(0,14,255,0.65) 20%, rgba(0,126,255,0.9) 30%, rgba(1,1,48,1) 35%, rgba(1,1,48,1) 65%, rgba(0,126,255,0.9) 70%, rgba(0,14,255,0.65) 80%, rgba(1,1,48,0.9) 90%), linear-gradient(to right, transparent 90%, #aabbee 50%, #010130 16px)";
  progressBarFilled.style.backgroundSize = "100%, 10px";
  progressBarFilled.style.backgroundPosition = "center";
  progressBarFilled.style.animation = "whirlpool 60s infinite linear";
}```