'use strict';

var index = require('../messageBox/index.js');

const confirmBox = async (options, handle) => {
  await index.GmMessageBox.confirm(options.message, options.title || "\u7CFB\u7EDF\u63D0\u793A", {
    confirmButtonText: "\u786E\u5B9A",
    cancelButtonText: "\u53D6\u6D88",
    type: "warning",
    beforeClose: async (action, instance, done) => {
      if (action === "confirm") {
        instance.confirmButtonLoading = true;
        try {
          await handle?.();
          done();
          instance.confirmButtonDisabled = true;
        } finally {
          instance.confirmButtonLoading = false;
        }
      } else {
        done();
      }
    }
  });
};

exports.confirmBox = confirmBox;
//# sourceMappingURL=method.js.map
