async function showConfirmationDialog(title, info, buttonHandlers) {
  showShadowScreen(true);
  let confirmationBox = document.getElementById("confirmation_box");
  confirmationBox.classList.add("is-confirmation-required");

  let titleSpan = confirmationBox.querySelector("#confirmation_title");
  titleSpan.innerHTML = title;

  let infoSpan = confirmationBox.querySelector("#confirmation_description");
  infoSpan.innerHTML = info;

  let buttonDiv = confirmationBox.querySelector("#confirmation_button_container");
  buttonDiv.querySelectorAll("button").forEach((button) => button.remove());
  
  // return returnValue;
  let promise = new Promise((resolve, reject) => {

    // Append buttons and add their event listeners
    buttonHandlers.forEach((button) => {
      let newButton = document.createElement("button");
      newButton.innerHTML = button.buttonName;
      if (button.color !== "default") {
        newButton.style.setProperty("color", button.color);
        newButton.style.setProperty("border-color", button.color);
      }
      newButton.addEventListener("click", () => {
        resolve(button.returnValue);
        confirmationBox.classList.remove("is-confirmation-required");
        showShadowScreen(false);
      });
      buttonDiv.append(newButton);
    });

    // Set timeout for picking option
    setTimeout(() => {
      resolve(false);
      confirmationBox.classList.remove("is-confirmation-required");
      showShadowScreen(false);
    }, 15000)
  });
  return promise.then();
}
/**
 * Displays a confirmation box with the specified buttons
 * @param {string} title Title of the confirmation box when appearing
 * @param {string} info Information to display after the title
 * @param {Array<{buttonName: string, color: string, returnValue: *}>} buttonHandlers Buttons to create with their respective return values
 * @returns {Promise<*>} 
 */
Displays a confirmation box with the specified buttons
@param {string} title Title of the confirmation box when appearing
@param {string} info Information to display after the title
@param {Array<{buttonName: string, color: string, returnValue: *}>} buttonHandlers Buttons to create with their respective return values
@returns {Promise<*>}
Displays a confirmation box with the specified buttons @param { string } title Title of the confirmation box when appearing @param { string } info Information to display after the title @param { Array< { buttonName : string color : string returnValue : * } > } buttonHandlers Buttons to create with their respective return values @returns { Promise< * > }
async function showConfirmationDialog(title, info, buttonHandlers) {
  showShadowScreen(true);
  let confirmationBox = document.getElementById("confirmation_box");
  confirmationBox.classList.add("is-confirmation-required");
  let titleSpan = confirmationBox.querySelector("#confirmation_title");
  titleSpan.innerHTML = title;
  let infoSpan = confirmationBox.querySelector("#confirmation_description");
  infoSpan.innerHTML = info;
  let buttonDiv = confirmationBox.querySelector("#confirmation_button_container");
  buttonDiv.querySelectorAll("button").forEach((button) => button.remove());
  let promise = new Promise((resolve, reject) => {
    buttonHandlers.forEach((button) => {
      let newButton = document.createElement("button");
      newButton.innerHTML = button.buttonName;
      if (button.color !== "default") {
        newButton.style.setProperty("color", button.color);
        newButton.style.setProperty("border-color", button.color);
      }
      newButton.addEventListener("click", () => {
        resolve(button.returnValue);
        confirmationBox.classList.remove("is-confirmation-required");
        showShadowScreen(false);
      });
      buttonDiv.append(newButton);
    });
    setTimeout(() => {
      resolve(false);
      confirmationBox.classList.remove("is-confirmation-required");
      showShadowScreen(false);
    }, 15000)
  });
  return promise.then();
}
async function showConfirmationDialog ( title , info , buttonHandlers ) { showShadowScreen ( true ) ; let confirmationBox = document . getElementById ( "confirmation_box" ) ; confirmationBox . classList . add ( "is-confirmation-required" ) ; let titleSpan = confirmationBox . querySelector ( "#confirmation_title" ) ; titleSpan . innerHTML = title ; let infoSpan = confirmationBox . querySelector ( "#confirmation_description" ) ; infoSpan . innerHTML = info ; let buttonDiv = confirmationBox . querySelector ( "#confirmation_button_container" ) ; buttonDiv . querySelectorAll ( "button" ) . forEach ( ( button ) => button . remove ( ) ) ; let promise = new Promise ( ( resolve , reject ) => { buttonHandlers . forEach ( ( button ) => { let newButton = document . createElement ( "button" ) ; newButton . innerHTML = button . buttonName ; if ( button . color !== "default" ) { newButton . style . setProperty ( "color" , button . color ) ; newButton . style . setProperty ( "border-color" , button . color ) ; } newButton . addEventListener ( "click" , ( ) => { resolve ( button . returnValue ) ; confirmationBox . classList . remove ( "is-confirmation-required" ) ; showShadowScreen ( false ) ; } ) ; buttonDiv . append ( newButton ) ; } ) ; setTimeout ( ( ) => { resolve ( false ) ; confirmationBox . classList . remove ( "is-confirmation-required" ) ; showShadowScreen ( false ) ; } , 15000 ) } ) ; return promise . then ( ) ; }
Displays a confirmation box with the specified buttons
 @param {string} title Title of the confirmation box when appearing
 @param {string} info Information to display after the title
 @param {Array<{buttonName: string, color: string, returnValue: *}>} buttonHandlers Buttons to create with their respective return values
 @returns {Promise<*>}
Displays a confirmation box with the specified buttons @param { string } title Title of the confirmation box when appearing @param { string } info Information to display after the title @param { Array< { buttonName : string color : string returnValue : * } > } buttonHandlers Buttons to create with their respective return values @returns { Promise< * > }
// return returnValue; // Append buttons and add their event listeners // Set timeout for picking option