var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f) { throw new TypeError("Private accessor was defined without a setter"); } if ( typeof state === "function" ? receiver !== state || !f : !state.has(receiver) ) { throw new TypeError( "Cannot write private member to an object whose class did not declare it", ); } return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; };var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) { if (kind === "a" && !f) { throw new TypeError("Private accessor was defined without a getter"); } if ( typeof state === "function" ? receiver !== state || !f : !state.has(receiver) ) { throw new TypeError( "Cannot read private member from an object whose class did not declare it", ); } return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); };var _Dialog_client, _Dialog_type, _Dialog_message, _Dialog_defaultValue, _Dialog_handled;import { assert } from "../util/assert.js";export class Dialog { constructor(client, type, message, defaultValue = "") { _Dialog_client.set(this, void 0); _Dialog_type.set(this, void 0); _Dialog_message.set(this, void 0); _Dialog_defaultValue.set(this, void 0); _Dialog_handled.set(this, false); __classPrivateFieldSet(this, _Dialog_client, client, "f"); __classPrivateFieldSet(this, _Dialog_type, type, "f"); __classPrivateFieldSet(this, _Dialog_message, message, "f"); __classPrivateFieldSet(this, _Dialog_defaultValue, defaultValue, "f"); } type() { return __classPrivateFieldGet(this, _Dialog_type, "f"); } message() { return __classPrivateFieldGet(this, _Dialog_message, "f"); } defaultValue() { return __classPrivateFieldGet(this, _Dialog_defaultValue, "f"); } async accept(promptText) { assert( !__classPrivateFieldGet(this, _Dialog_handled, "f"), "Cannot accept dialog which is already handled!", ); __classPrivateFieldSet(this, _Dialog_handled, true, "f"); await __classPrivateFieldGet(this, _Dialog_client, "f").send( "Page.handleJavaScriptDialog", { accept: true, promptText: promptText, }, ); } async dismiss() { assert( !__classPrivateFieldGet(this, _Dialog_handled, "f"), "Cannot dismiss dialog which is already handled!", ); __classPrivateFieldSet(this, _Dialog_handled, true, "f"); await __classPrivateFieldGet(this, _Dialog_client, "f").send( "Page.handleJavaScriptDialog", { accept: false, }, ); }}_Dialog_client = new WeakMap(), _Dialog_type = new WeakMap(), _Dialog_message = new WeakMap(), _Dialog_defaultValue = new WeakMap(), _Dialog_handled = new WeakMap();