let wasm;
export function __wbg_set_wasm(val) {
    wasm = val;
}

function addToExternrefTable0(obj) {
    const idx = wasm.__externref_table_alloc();
    wasm.__wbindgen_externrefs.set(idx, obj);
    return idx;
}

function _assertChar(c) {
    if (typeof(c) === 'number' && (c >= 0x110000 || (c >= 0xD800 && c < 0xE000))) throw new Error(`expected a valid Unicode scalar value, found ${c}`);
}

function _assertClass(instance, klass) {
    if (!(instance instanceof klass)) {
        throw new Error(`expected instance of ${klass.name}`);
    }
}

const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(state => state.dtor(state.a, state.b));

function debugString(val) {
    // primitive types
    const type = typeof val;
    if (type == 'number' || type == 'boolean' || val == null) {
        return  `${val}`;
    }
    if (type == 'string') {
        return `"${val}"`;
    }
    if (type == 'symbol') {
        const description = val.description;
        if (description == null) {
            return 'Symbol';
        } else {
            return `Symbol(${description})`;
        }
    }
    if (type == 'function') {
        const name = val.name;
        if (typeof name == 'string' && name.length > 0) {
            return `Function(${name})`;
        } else {
            return 'Function';
        }
    }
    // objects
    if (Array.isArray(val)) {
        const length = val.length;
        let debug = '[';
        if (length > 0) {
            debug += debugString(val[0]);
        }
        for(let i = 1; i < length; i++) {
            debug += ', ' + debugString(val[i]);
        }
        debug += ']';
        return debug;
    }
    // Test for built-in
    const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
    let className;
    if (builtInMatches && builtInMatches.length > 1) {
        className = builtInMatches[1];
    } else {
        // Failed to match the standard '[object ClassName]'
        return toString.call(val);
    }
    if (className == 'Object') {
        // we're a user defined class or Object
        // JSON.stringify avoids problems with cycles, and is generally much
        // easier than looping through ownProperties of `val`.
        try {
            return 'Object(' + JSON.stringify(val) + ')';
        } catch (_) {
            return 'Object';
        }
    }
    // errors
    if (val instanceof Error) {
        return `${val.name}: ${val.message}\n${val.stack}`;
    }
    // TODO we could test for more things here, like `Set`s and `Map`s.
    return className;
}

function getArrayJsValueFromWasm0(ptr, len) {
    ptr = ptr >>> 0;
    const mem = getDataViewMemory0();
    const result = [];
    for (let i = ptr; i < ptr + 4 * len; i += 4) {
        result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
    }
    wasm.__externref_drop_slice(ptr, len);
    return result;
}

function getArrayU8FromWasm0(ptr, len) {
    ptr = ptr >>> 0;
    return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
}

function getClampedArrayU8FromWasm0(ptr, len) {
    ptr = ptr >>> 0;
    return getUint8ClampedArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
}

let cachedDataViewMemory0 = null;
function getDataViewMemory0() {
    if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
        cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
    }
    return cachedDataViewMemory0;
}

function getStringFromWasm0(ptr, len) {
    ptr = ptr >>> 0;
    return decodeText(ptr, len);
}

let cachedUint8ArrayMemory0 = null;
function getUint8ArrayMemory0() {
    if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
        cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
    }
    return cachedUint8ArrayMemory0;
}

let cachedUint8ClampedArrayMemory0 = null;
function getUint8ClampedArrayMemory0() {
    if (cachedUint8ClampedArrayMemory0 === null || cachedUint8ClampedArrayMemory0.byteLength === 0) {
        cachedUint8ClampedArrayMemory0 = new Uint8ClampedArray(wasm.memory.buffer);
    }
    return cachedUint8ClampedArrayMemory0;
}

function handleError(f, args) {
    try {
        return f.apply(this, args);
    } catch (e) {
        const idx = addToExternrefTable0(e);
        wasm.__wbindgen_exn_store(idx);
    }
}

function isLikeNone(x) {
    return x === undefined || x === null;
}

function makeMutClosure(arg0, arg1, dtor, f) {
    const state = { a: arg0, b: arg1, cnt: 1, dtor };
    const real = (...args) => {

        // First up with a closure we increment the internal reference
        // count. This ensures that the Rust closure environment won't
        // be deallocated while we're invoking it.
        state.cnt++;
        const a = state.a;
        state.a = 0;
        try {
            return f(a, state.b, ...args);
        } finally {
            state.a = a;
            real._wbg_cb_unref();
        }
    };
    real._wbg_cb_unref = () => {
        if (--state.cnt === 0) {
            state.dtor(state.a, state.b);
            state.a = 0;
            CLOSURE_DTORS.unregister(state);
        }
    };
    CLOSURE_DTORS.register(real, state, state);
    return real;
}

function passArray8ToWasm0(arg, malloc) {
    const ptr = malloc(arg.length * 1, 1) >>> 0;
    getUint8ArrayMemory0().set(arg, ptr / 1);
    WASM_VECTOR_LEN = arg.length;
    return ptr;
}

function passStringToWasm0(arg, malloc, realloc) {
    if (realloc === undefined) {
        const buf = cachedTextEncoder.encode(arg);
        const ptr = malloc(buf.length, 1) >>> 0;
        getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
        WASM_VECTOR_LEN = buf.length;
        return ptr;
    }

    let len = arg.length;
    let ptr = malloc(len, 1) >>> 0;

    const mem = getUint8ArrayMemory0();

    let offset = 0;

    for (; offset < len; offset++) {
        const code = arg.charCodeAt(offset);
        if (code > 0x7F) break;
        mem[ptr + offset] = code;
    }
    if (offset !== len) {
        if (offset !== 0) {
            arg = arg.slice(offset);
        }
        ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
        const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
        const ret = cachedTextEncoder.encodeInto(arg, view);

        offset += ret.written;
        ptr = realloc(ptr, len, offset, 1) >>> 0;
    }

    WASM_VECTOR_LEN = offset;
    return ptr;
}

function takeFromExternrefTable0(idx) {
    const value = wasm.__wbindgen_externrefs.get(idx);
    wasm.__externref_table_dealloc(idx);
    return value;
}

let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
cachedTextDecoder.decode();
const MAX_SAFARI_DECODE_BYTES = 2146435072;
let numBytesDecoded = 0;
function decodeText(ptr, len) {
    numBytesDecoded += len;
    if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
        cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
        cachedTextDecoder.decode();
        numBytesDecoded = len;
    }
    return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
}

const cachedTextEncoder = new TextEncoder();

if (!('encodeInto' in cachedTextEncoder)) {
    cachedTextEncoder.encodeInto = function (arg, view) {
        const buf = cachedTextEncoder.encode(arg);
        view.set(buf);
        return {
            read: arg.length,
            written: buf.length
        };
    }
}

let WASM_VECTOR_LEN = 0;

function wasm_bindgen__convert__closures_____invoke__h1a0b091d40d0d4be(arg0, arg1) {
    wasm.wasm_bindgen__convert__closures_____invoke__h1a0b091d40d0d4be(arg0, arg1);
}

function wasm_bindgen__convert__closures_____invoke__h8a105ca3ff48d408(arg0, arg1, arg2) {
    wasm.wasm_bindgen__convert__closures_____invoke__h8a105ca3ff48d408(arg0, arg1, arg2);
}

function wasm_bindgen__convert__closures_____invoke__h1b6eeedec099a8de(arg0, arg1, arg2) {
    wasm.wasm_bindgen__convert__closures_____invoke__h1b6eeedec099a8de(arg0, arg1, arg2);
}

function wasm_bindgen__convert__closures_____invoke__h4d617c7b6d398e2c(arg0, arg1) {
    wasm.wasm_bindgen__convert__closures_____invoke__h4d617c7b6d398e2c(arg0, arg1);
}

function wasm_bindgen__convert__closures_____invoke__h941949ddb830799f(arg0, arg1, arg2, arg3) {
    wasm.wasm_bindgen__convert__closures_____invoke__h941949ddb830799f(arg0, arg1, arg2, arg3);
}

const __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];

const ClipboardDataFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_clipboarddata_free(ptr >>> 0, 1));

const ClipboardItemFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_clipboarditem_free(ptr >>> 0, 1));

const DesktopSizeFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_desktopsize_free(ptr >>> 0, 1));

const DeviceEventFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_deviceevent_free(ptr >>> 0, 1));

const ExtensionFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_extension_free(ptr >>> 0, 1));

const InputTransactionFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_inputtransaction_free(ptr >>> 0, 1));

const IronErrorFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_ironerror_free(ptr >>> 0, 1));

const RdpFileFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_rdpfile_free(ptr >>> 0, 1));

const SessionFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_session_free(ptr >>> 0, 1));

const SessionBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_sessionbuilder_free(ptr >>> 0, 1));

const SessionTerminationInfoFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_sessionterminationinfo_free(ptr >>> 0, 1));

export class ClipboardData {
    static __wrap(ptr) {
        ptr = ptr >>> 0;
        const obj = Object.create(ClipboardData.prototype);
        obj.__wbg_ptr = ptr;
        ClipboardDataFinalization.register(obj, obj.__wbg_ptr, obj);
        return obj;
    }
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        ClipboardDataFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_clipboarddata_free(ptr, 0);
    }
    constructor() {
        const ret = wasm.clipboarddata_create();
        this.__wbg_ptr = ret >>> 0;
        ClipboardDataFinalization.register(this, this.__wbg_ptr, this);
        return this;
    }
    /**
     * @param {string} mime_type
     * @param {string} text
     */
    addText(mime_type, text) {
        const ptr0 = passStringToWasm0(mime_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        const len0 = WASM_VECTOR_LEN;
        const ptr1 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        const len1 = WASM_VECTOR_LEN;
        wasm.clipboarddata_addText(this.__wbg_ptr, ptr0, len0, ptr1, len1);
    }
    /**
     * @param {string} mime_type
     * @param {Uint8Array} binary
     */
    addBinary(mime_type, binary) {
        const ptr0 = passStringToWasm0(mime_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        const len0 = WASM_VECTOR_LEN;
        const ptr1 = passArray8ToWasm0(binary, wasm.__wbindgen_malloc);
        const len1 = WASM_VECTOR_LEN;
        wasm.clipboarddata_addBinary(this.__wbg_ptr, ptr0, len0, ptr1, len1);
    }
    /**
     * @returns {ClipboardItem[]}
     */
    items() {
        const ret = wasm.clipboarddata_items(this.__wbg_ptr);
        var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
        wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
        return v1;
    }
    /**
     * @returns {boolean}
     */
    isEmpty() {
        const ret = wasm.clipboarddata_isEmpty(this.__wbg_ptr);
        return ret !== 0;
    }
}
if (Symbol.dispose) ClipboardData.prototype[Symbol.dispose] = ClipboardData.prototype.free;

export class ClipboardItem {
    static __wrap(ptr) {
        ptr = ptr >>> 0;
        const obj = Object.create(ClipboardItem.prototype);
        obj.__wbg_ptr = ptr;
        ClipboardItemFinalization.register(obj, obj.__wbg_ptr, obj);
        return obj;
    }
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        ClipboardItemFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_clipboarditem_free(ptr, 0);
    }
    /**
     * @returns {string}
     */
    mimeType() {
        let deferred1_0;
        let deferred1_1;
        try {
            const ret = wasm.clipboarditem_mimeType(this.__wbg_ptr);
            deferred1_0 = ret[0];
            deferred1_1 = ret[1];
            return getStringFromWasm0(ret[0], ret[1]);
        } finally {
            wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
        }
    }
    /**
     * @returns {any}
     */
    value() {
        const ret = wasm.clipboarditem_value(this.__wbg_ptr);
        return ret;
    }
}
if (Symbol.dispose) ClipboardItem.prototype[Symbol.dispose] = ClipboardItem.prototype.free;

export class DesktopSize {
    static __wrap(ptr) {
        ptr = ptr >>> 0;
        const obj = Object.create(DesktopSize.prototype);
        obj.__wbg_ptr = ptr;
        DesktopSizeFinalization.register(obj, obj.__wbg_ptr, obj);
        return obj;
    }
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        DesktopSizeFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_desktopsize_free(ptr, 0);
    }
    /**
     * @returns {number}
     */
    get width() {
        const ret = wasm.__wbg_get_desktopsize_width(this.__wbg_ptr);
        return ret;
    }
    /**
     * @param {number} arg0
     */
    set width(arg0) {
        wasm.__wbg_set_desktopsize_width(this.__wbg_ptr, arg0);
    }
    /**
     * @returns {number}
     */
    get height() {
        const ret = wasm.__wbg_get_desktopsize_height(this.__wbg_ptr);
        return ret;
    }
    /**
     * @param {number} arg0
     */
    set height(arg0) {
        wasm.__wbg_set_desktopsize_height(this.__wbg_ptr, arg0);
    }
    /**
     * @param {number} width
     * @param {number} height
     */
    constructor(width, height) {
        const ret = wasm.desktopsize_create(width, height);
        this.__wbg_ptr = ret >>> 0;
        DesktopSizeFinalization.register(this, this.__wbg_ptr, this);
        return this;
    }
}
if (Symbol.dispose) DesktopSize.prototype[Symbol.dispose] = DesktopSize.prototype.free;

export class DeviceEvent {
    static __wrap(ptr) {
        ptr = ptr >>> 0;
        const obj = Object.create(DeviceEvent.prototype);
        obj.__wbg_ptr = ptr;
        DeviceEventFinalization.register(obj, obj.__wbg_ptr, obj);
        return obj;
    }
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        DeviceEventFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_deviceevent_free(ptr, 0);
    }
    /**
     * @param {number} button
     * @returns {DeviceEvent}
     */
    static mouseButtonPressed(button) {
        const ret = wasm.deviceevent_mouseButtonPressed(button);
        return DeviceEvent.__wrap(ret);
    }
    /**
     * @param {number} button
     * @returns {DeviceEvent}
     */
    static mouseButtonReleased(button) {
        const ret = wasm.deviceevent_mouseButtonReleased(button);
        return DeviceEvent.__wrap(ret);
    }
    /**
     * @param {number} x
     * @param {number} y
     * @returns {DeviceEvent}
     */
    static mouseMove(x, y) {
        const ret = wasm.deviceevent_mouseMove(x, y);
        return DeviceEvent.__wrap(ret);
    }
    /**
     * @param {boolean} vertical
     * @param {number} rotation_amount
     * @param {RotationUnit} rotation_unit
     * @returns {DeviceEvent}
     */
    static wheelRotations(vertical, rotation_amount, rotation_unit) {
        const ret = wasm.deviceevent_wheelRotations(vertical, rotation_amount, rotation_unit);
        return DeviceEvent.__wrap(ret);
    }
    /**
     * @param {number} scancode
     * @returns {DeviceEvent}
     */
    static keyPressed(scancode) {
        const ret = wasm.deviceevent_keyPressed(scancode);
        return DeviceEvent.__wrap(ret);
    }
    /**
     * @param {number} scancode
     * @returns {DeviceEvent}
     */
    static keyReleased(scancode) {
        const ret = wasm.deviceevent_keyReleased(scancode);
        return DeviceEvent.__wrap(ret);
    }
    /**
     * @param {string} unicode
     * @returns {DeviceEvent}
     */
    static unicodePressed(unicode) {
        const char0 = unicode.codePointAt(0);
        _assertChar(char0);
        const ret = wasm.deviceevent_unicodePressed(char0);
        return DeviceEvent.__wrap(ret);
    }
    /**
     * @param {string} unicode
     * @returns {DeviceEvent}
     */
    static unicodeReleased(unicode) {
        const char0 = unicode.codePointAt(0);
        _assertChar(char0);
        const ret = wasm.deviceevent_unicodeReleased(char0);
        return DeviceEvent.__wrap(ret);
    }
}
if (Symbol.dispose) DeviceEvent.prototype[Symbol.dispose] = DeviceEvent.prototype.free;

export class Extension {
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        ExtensionFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_extension_free(ptr, 0);
    }
    /**
     * @param {string} ident
     * @param {any} value
     */
    constructor(ident, value) {
        const ptr0 = passStringToWasm0(ident, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        const len0 = WASM_VECTOR_LEN;
        const ret = wasm.extension_create(ptr0, len0, value);
        this.__wbg_ptr = ret >>> 0;
        ExtensionFinalization.register(this, this.__wbg_ptr, this);
        return this;
    }
}
if (Symbol.dispose) Extension.prototype[Symbol.dispose] = Extension.prototype.free;

export class InputTransaction {
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        InputTransactionFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_inputtransaction_free(ptr, 0);
    }
    constructor() {
        const ret = wasm.inputtransaction_create();
        this.__wbg_ptr = ret >>> 0;
        InputTransactionFinalization.register(this, this.__wbg_ptr, this);
        return this;
    }
    /**
     * @param {DeviceEvent} event
     */
    addEvent(event) {
        _assertClass(event, DeviceEvent);
        var ptr0 = event.__destroy_into_raw();
        wasm.inputtransaction_addEvent(this.__wbg_ptr, ptr0);
    }
}
if (Symbol.dispose) InputTransaction.prototype[Symbol.dispose] = InputTransaction.prototype.free;

export class IronError {
    static __wrap(ptr) {
        ptr = ptr >>> 0;
        const obj = Object.create(IronError.prototype);
        obj.__wbg_ptr = ptr;
        IronErrorFinalization.register(obj, obj.__wbg_ptr, obj);
        return obj;
    }
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        IronErrorFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_ironerror_free(ptr, 0);
    }
    /**
     * @returns {string}
     */
    backtrace() {
        let deferred1_0;
        let deferred1_1;
        try {
            const ret = wasm.ironerror_backtrace(this.__wbg_ptr);
            deferred1_0 = ret[0];
            deferred1_1 = ret[1];
            return getStringFromWasm0(ret[0], ret[1]);
        } finally {
            wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
        }
    }
    /**
     * @returns {IronErrorKind}
     */
    kind() {
        const ret = wasm.ironerror_kind(this.__wbg_ptr);
        return ret;
    }
}
if (Symbol.dispose) IronError.prototype[Symbol.dispose] = IronError.prototype.free;

/**
 * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6}
 */
export const IronErrorKind = Object.freeze({
    /**
     * Catch-all error kind
     */
    General: 0, "0": "General",
    /**
     * Incorrect password used
     */
    WrongPassword: 1, "1": "WrongPassword",
    /**
     * Unable to login to machine
     */
    LogonFailure: 2, "2": "LogonFailure",
    /**
     * Insufficient permission, server denied access
     */
    AccessDenied: 3, "3": "AccessDenied",
    /**
     * Something wrong happened when sending or receiving the RDCleanPath message
     */
    RDCleanPath: 4, "4": "RDCleanPath",
    /**
     * Couldn’t connect to proxy
     */
    ProxyConnect: 5, "5": "ProxyConnect",
    /**
     * Protocol negotiation failed
     */
    NegotiationFailure: 6, "6": "NegotiationFailure",
});

export class RdpFile {
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        RdpFileFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_rdpfile_free(ptr, 0);
    }
    constructor() {
        const ret = wasm.rdpfile_create();
        this.__wbg_ptr = ret >>> 0;
        RdpFileFinalization.register(this, this.__wbg_ptr, this);
        return this;
    }
    /**
     * @param {string} config
     */
    parse(config) {
        const ptr0 = passStringToWasm0(config, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        const len0 = WASM_VECTOR_LEN;
        wasm.rdpfile_parse(this.__wbg_ptr, ptr0, len0);
    }
    /**
     * @returns {string}
     */
    write() {
        let deferred1_0;
        let deferred1_1;
        try {
            const ret = wasm.rdpfile_write(this.__wbg_ptr);
            deferred1_0 = ret[0];
            deferred1_1 = ret[1];
            return getStringFromWasm0(ret[0], ret[1]);
        } finally {
            wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
        }
    }
    /**
     * @param {string} key
     * @param {string} value
     */
    insertStr(key, value) {
        const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        const len0 = WASM_VECTOR_LEN;
        const ptr1 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        const len1 = WASM_VECTOR_LEN;
        wasm.rdpfile_insertStr(this.__wbg_ptr, ptr0, len0, ptr1, len1);
    }
    /**
     * @param {string} key
     * @param {number} value
     */
    insertInt(key, value) {
        const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        const len0 = WASM_VECTOR_LEN;
        wasm.rdpfile_insertInt(this.__wbg_ptr, ptr0, len0, value);
    }
    /**
     * @param {string} key
     * @returns {string | undefined}
     */
    getStr(key) {
        const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        const len0 = WASM_VECTOR_LEN;
        const ret = wasm.rdpfile_getStr(this.__wbg_ptr, ptr0, len0);
        let v2;
        if (ret[0] !== 0) {
            v2 = getStringFromWasm0(ret[0], ret[1]).slice();
            wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
        }
        return v2;
    }
    /**
     * @param {string} key
     * @returns {number | undefined}
     */
    getInt(key) {
        const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        const len0 = WASM_VECTOR_LEN;
        const ret = wasm.rdpfile_getInt(this.__wbg_ptr, ptr0, len0);
        return ret === 0x100000001 ? undefined : ret;
    }
}
if (Symbol.dispose) RdpFile.prototype[Symbol.dispose] = RdpFile.prototype.free;

/**
 * @enum {0 | 1 | 2}
 */
export const RotationUnit = Object.freeze({
    Pixel: 0, "0": "Pixel",
    Line: 1, "1": "Line",
    Page: 2, "2": "Page",
});

export class Session {
    static __wrap(ptr) {
        ptr = ptr >>> 0;
        const obj = Object.create(Session.prototype);
        obj.__wbg_ptr = ptr;
        SessionFinalization.register(obj, obj.__wbg_ptr, obj);
        return obj;
    }
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        SessionFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_session_free(ptr, 0);
    }
    /**
     * @returns {Promise<SessionTerminationInfo>}
     */
    run() {
        const ret = wasm.session_run(this.__wbg_ptr);
        return ret;
    }
    /**
     * @returns {DesktopSize}
     */
    desktopSize() {
        const ret = wasm.session_desktopSize(this.__wbg_ptr);
        return DesktopSize.__wrap(ret);
    }
    /**
     * @param {InputTransaction} transaction
     */
    applyInputs(transaction) {
        _assertClass(transaction, InputTransaction);
        var ptr0 = transaction.__destroy_into_raw();
        const ret = wasm.session_applyInputs(this.__wbg_ptr, ptr0);
        if (ret[1]) {
            throw takeFromExternrefTable0(ret[0]);
        }
    }
    releaseAllInputs() {
        const ret = wasm.session_releaseAllInputs(this.__wbg_ptr);
        if (ret[1]) {
            throw takeFromExternrefTable0(ret[0]);
        }
    }
    /**
     * @param {boolean} scroll_lock
     * @param {boolean} num_lock
     * @param {boolean} caps_lock
     * @param {boolean} kana_lock
     */
    synchronizeLockKeys(scroll_lock, num_lock, caps_lock, kana_lock) {
        const ret = wasm.session_synchronizeLockKeys(this.__wbg_ptr, scroll_lock, num_lock, caps_lock, kana_lock);
        if (ret[1]) {
            throw takeFromExternrefTable0(ret[0]);
        }
    }
    shutdown() {
        const ret = wasm.session_shutdown(this.__wbg_ptr);
        if (ret[1]) {
            throw takeFromExternrefTable0(ret[0]);
        }
    }
    /**
     * @param {ClipboardData} content
     * @returns {Promise<void>}
     */
    onClipboardPaste(content) {
        _assertClass(content, ClipboardData);
        const ret = wasm.session_onClipboardPaste(this.__wbg_ptr, content.__wbg_ptr);
        return ret;
    }
    /**
     * @param {number} width
     * @param {number} height
     * @param {number | null} [scale_factor]
     * @param {number | null} [physical_width]
     * @param {number | null} [physical_height]
     */
    resize(width, height, scale_factor, physical_width, physical_height) {
        wasm.session_resize(this.__wbg_ptr, width, height, isLikeNone(scale_factor) ? 0x100000001 : (scale_factor) >>> 0, isLikeNone(physical_width) ? 0x100000001 : (physical_width) >>> 0, isLikeNone(physical_height) ? 0x100000001 : (physical_height) >>> 0);
    }
    /**
     * @returns {boolean}
     */
    supportsUnicodeKeyboardShortcuts() {
        const ret = wasm.session_supportsUnicodeKeyboardShortcuts(this.__wbg_ptr);
        return ret !== 0;
    }
    /**
     * @param {Extension} ext
     * @returns {any}
     */
    invokeExtension(ext) {
        _assertClass(ext, Extension);
        var ptr0 = ext.__destroy_into_raw();
        const ret = wasm.session_invokeExtension(this.__wbg_ptr, ptr0);
        if (ret[2]) {
            throw takeFromExternrefTable0(ret[1]);
        }
        return takeFromExternrefTable0(ret[0]);
    }
}
if (Symbol.dispose) Session.prototype[Symbol.dispose] = Session.prototype.free;

export class SessionBuilder {
    static __wrap(ptr) {
        ptr = ptr >>> 0;
        const obj = Object.create(SessionBuilder.prototype);
        obj.__wbg_ptr = ptr;
        SessionBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
        return obj;
    }
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        SessionBuilderFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_sessionbuilder_free(ptr, 0);
    }
    constructor() {
        const ret = wasm.sessionbuilder_create();
        this.__wbg_ptr = ret >>> 0;
        SessionBuilderFinalization.register(this, this.__wbg_ptr, this);
        return this;
    }
    /**
     * @param {string} username
     * @returns {SessionBuilder}
     */
    username(username) {
        const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        const len0 = WASM_VECTOR_LEN;
        const ret = wasm.sessionbuilder_username(this.__wbg_ptr, ptr0, len0);
        return SessionBuilder.__wrap(ret);
    }
    /**
     * @param {string} destination
     * @returns {SessionBuilder}
     */
    destination(destination) {
        const ptr0 = passStringToWasm0(destination, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        const len0 = WASM_VECTOR_LEN;
        const ret = wasm.sessionbuilder_destination(this.__wbg_ptr, ptr0, len0);
        return SessionBuilder.__wrap(ret);
    }
    /**
     * @param {string} server_domain
     * @returns {SessionBuilder}
     */
    serverDomain(server_domain) {
        const ptr0 = passStringToWasm0(server_domain, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        const len0 = WASM_VECTOR_LEN;
        const ret = wasm.sessionbuilder_serverDomain(this.__wbg_ptr, ptr0, len0);
        return SessionBuilder.__wrap(ret);
    }
    /**
     * @param {string} password
     * @returns {SessionBuilder}
     */
    password(password) {
        const ptr0 = passStringToWasm0(password, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        const len0 = WASM_VECTOR_LEN;
        const ret = wasm.sessionbuilder_password(this.__wbg_ptr, ptr0, len0);
        return SessionBuilder.__wrap(ret);
    }
    /**
     * @param {string} address
     * @returns {SessionBuilder}
     */
    proxyAddress(address) {
        const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        const len0 = WASM_VECTOR_LEN;
        const ret = wasm.sessionbuilder_proxyAddress(this.__wbg_ptr, ptr0, len0);
        return SessionBuilder.__wrap(ret);
    }
    /**
     * @param {string} token
     * @returns {SessionBuilder}
     */
    authToken(token) {
        const ptr0 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
        const len0 = WASM_VECTOR_LEN;
        const ret = wasm.sessionbuilder_authToken(this.__wbg_ptr, ptr0, len0);
        return SessionBuilder.__wrap(ret);
    }
    /**
     * @param {DesktopSize} desktop_size
     * @returns {SessionBuilder}
     */
    desktopSize(desktop_size) {
        _assertClass(desktop_size, DesktopSize);
        var ptr0 = desktop_size.__destroy_into_raw();
        const ret = wasm.sessionbuilder_desktopSize(this.__wbg_ptr, ptr0);
        return SessionBuilder.__wrap(ret);
    }
    /**
     * @param {HTMLCanvasElement} canvas
     * @returns {SessionBuilder}
     */
    renderCanvas(canvas) {
        const ret = wasm.sessionbuilder_renderCanvas(this.__wbg_ptr, canvas);
        return SessionBuilder.__wrap(ret);
    }
    /**
     * @param {Function} callback
     * @returns {SessionBuilder}
     */
    setCursorStyleCallback(callback) {
        const ret = wasm.sessionbuilder_setCursorStyleCallback(this.__wbg_ptr, callback);
        return SessionBuilder.__wrap(ret);
    }
    /**
     * @param {any} context
     * @returns {SessionBuilder}
     */
    setCursorStyleCallbackContext(context) {
        const ret = wasm.sessionbuilder_setCursorStyleCallbackContext(this.__wbg_ptr, context);
        return SessionBuilder.__wrap(ret);
    }
    /**
     * @param {Function} callback
     * @returns {SessionBuilder}
     */
    remoteClipboardChangedCallback(callback) {
        const ret = wasm.sessionbuilder_remoteClipboardChangedCallback(this.__wbg_ptr, callback);
        return SessionBuilder.__wrap(ret);
    }
    /**
     * @param {Function} callback
     * @returns {SessionBuilder}
     */
    forceClipboardUpdateCallback(callback) {
        const ret = wasm.sessionbuilder_forceClipboardUpdateCallback(this.__wbg_ptr, callback);
        return SessionBuilder.__wrap(ret);
    }
    /**
     * @param {Function} callback
     * @returns {SessionBuilder}
     */
    canvasResizedCallback(callback) {
        const ret = wasm.sessionbuilder_canvasResizedCallback(this.__wbg_ptr, callback);
        return SessionBuilder.__wrap(ret);
    }
    /**
     * @param {Extension} ext
     * @returns {SessionBuilder}
     */
    extension(ext) {
        _assertClass(ext, Extension);
        var ptr0 = ext.__destroy_into_raw();
        const ret = wasm.sessionbuilder_extension(this.__wbg_ptr, ptr0);
        return SessionBuilder.__wrap(ret);
    }
    /**
     * @returns {Promise<Session>}
     */
    connect() {
        const ret = wasm.sessionbuilder_connect(this.__wbg_ptr);
        return ret;
    }
}
if (Symbol.dispose) SessionBuilder.prototype[Symbol.dispose] = SessionBuilder.prototype.free;

export class SessionTerminationInfo {
    static __wrap(ptr) {
        ptr = ptr >>> 0;
        const obj = Object.create(SessionTerminationInfo.prototype);
        obj.__wbg_ptr = ptr;
        SessionTerminationInfoFinalization.register(obj, obj.__wbg_ptr, obj);
        return obj;
    }
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        SessionTerminationInfoFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_sessionterminationinfo_free(ptr, 0);
    }
    /**
     * @returns {string}
     */
    reason() {
        let deferred1_0;
        let deferred1_1;
        try {
            const ret = wasm.sessionterminationinfo_reason(this.__wbg_ptr);
            deferred1_0 = ret[0];
            deferred1_1 = ret[1];
            return getStringFromWasm0(ret[0], ret[1]);
        } finally {
            wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
        }
    }
}
if (Symbol.dispose) SessionTerminationInfo.prototype[Symbol.dispose] = SessionTerminationInfo.prototype.free;

export function main() {
    wasm.main();
}

/**
 * @param {string} log_level
 */
export function setup(log_level) {
    const ptr0 = passStringToWasm0(log_level, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
    const len0 = WASM_VECTOR_LEN;
    wasm.setup(ptr0, len0);
}

export function __wbg___wbindgen_boolean_get_dea25b33882b895b(arg0) {
    const v = arg0;
    const ret = typeof(v) === 'boolean' ? v : undefined;
    return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
};

export function __wbg___wbindgen_debug_string_adfb662ae34724b6(arg0, arg1) {
    const ret = debugString(arg1);
    const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
    const len1 = WASM_VECTOR_LEN;
    getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
    getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
};

export function __wbg___wbindgen_is_function_8d400b8b1af978cd(arg0) {
    const ret = typeof(arg0) === 'function';
    return ret;
};

export function __wbg___wbindgen_is_string_704ef9c8fc131030(arg0) {
    const ret = typeof(arg0) === 'string';
    return ret;
};

export function __wbg___wbindgen_is_undefined_f6b95eab589e0269(arg0) {
    const ret = arg0 === undefined;
    return ret;
};

export function __wbg___wbindgen_number_get_9619185a74197f95(arg0, arg1) {
    const obj = arg1;
    const ret = typeof(obj) === 'number' ? obj : undefined;
    getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
    getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
};

export function __wbg___wbindgen_string_get_a2a31e16edf96e42(arg0, arg1) {
    const obj = arg1;
    const ret = typeof(obj) === 'string' ? obj : undefined;
    var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
    var len1 = WASM_VECTOR_LEN;
    getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
    getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
};

export function __wbg___wbindgen_throw_dd24417ed36fc46e(arg0, arg1) {
    throw new Error(getStringFromWasm0(arg0, arg1));
};

export function __wbg__wbg_cb_unref_87dfb5aaa0cbcea7(arg0) {
    arg0._wbg_cb_unref();
};

export function __wbg_addEventListener_6a82629b3d430a48() { return handleError(function (arg0, arg1, arg2, arg3) {
    arg0.addEventListener(getStringFromWasm0(arg1, arg2), arg3);
}, arguments) };

export function __wbg_addEventListener_82cddc614107eb45() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
    arg0.addEventListener(getStringFromWasm0(arg1, arg2), arg3, arg4);
}, arguments) };

export function __wbg_apply_52e9ae668d017009() { return handleError(function (arg0, arg1, arg2) {
    const ret = arg0.apply(arg1, arg2);
    return ret;
}, arguments) };

export function __wbg_arrayBuffer_c04af4fce566092d() { return handleError(function (arg0) {
    const ret = arg0.arrayBuffer();
    return ret;
}, arguments) };

export function __wbg_call_3020136f7a2d6e44() { return handleError(function (arg0, arg1, arg2) {
    const ret = arg0.call(arg1, arg2);
    return ret;
}, arguments) };

export function __wbg_call_abb4ff46ce38be40() { return handleError(function (arg0, arg1) {
    const ret = arg0.call(arg1);
    return ret;
}, arguments) };

export function __wbg_clearTimeout_5a54f8841c30079a(arg0) {
    const ret = clearTimeout(arg0);
    return ret;
};

export function __wbg_clipboarddata_new(arg0) {
    const ret = ClipboardData.__wrap(arg0);
    return ret;
};

export function __wbg_clipboarditem_new(arg0) {
    const ret = ClipboardItem.__wrap(arg0);
    return ret;
};

export function __wbg_close_1db3952de1b5b1cf() { return handleError(function (arg0) {
    arg0.close();
}, arguments) };

export function __wbg_code_85a811fe6ca962be(arg0) {
    const ret = arg0.code;
    return ret;
};

export function __wbg_data_8bf4ae669a78a688(arg0) {
    const ret = arg0.data;
    return ret;
};

export function __wbg_debug_9ad80675faf0c9cf(arg0, arg1, arg2, arg3) {
    console.debug(arg0, arg1, arg2, arg3);
};

export function __wbg_debug_9d0c87ddda3dc485(arg0) {
    console.debug(arg0);
};

export function __wbg_dispatchEvent_50a40ea5c664f9f4() { return handleError(function (arg0, arg1) {
    const ret = arg0.dispatchEvent(arg1);
    return ret;
}, arguments) };

export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
    let deferred0_0;
    let deferred0_1;
    try {
        deferred0_0 = arg0;
        deferred0_1 = arg1;
        console.error(getStringFromWasm0(arg0, arg1));
    } finally {
        wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
    }
};

export function __wbg_error_7bc7d576a6aaf855(arg0) {
    console.error(arg0);
};

export function __wbg_error_ad1ecdacd1bb600d(arg0, arg1, arg2, arg3) {
    console.error(arg0, arg1, arg2, arg3);
};

export function __wbg_fetch_a9bc66c159c18e19(arg0) {
    const ret = fetch(arg0);
    return ret;
};

export function __wbg_getContext_01f42b234e833f0a() { return handleError(function (arg0, arg1, arg2) {
    const ret = arg0.getContext(getStringFromWasm0(arg1, arg2));
    return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
}, arguments) };

export function __wbg_getRandomValues_1c61fac11405ffdc() { return handleError(function (arg0, arg1) {
    globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
}, arguments) };

export function __wbg_getRandomValues_38a1ff1ea09f6cc7() { return handleError(function (arg0, arg1) {
    globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
}, arguments) };

export function __wbg_getTime_ad1e9878a735af08(arg0) {
    const ret = arg0.getTime();
    return ret;
};

export function __wbg_info_b7fa8ce2e59d29c6(arg0, arg1, arg2, arg3) {
    console.info(arg0, arg1, arg2, arg3);
};

export function __wbg_info_ce6bcc489c22f6f0(arg0) {
    console.info(arg0);
};

export function __wbg_instanceof_ArrayBuffer_f3320d2419cd0355(arg0) {
    let result;
    try {
        result = arg0 instanceof ArrayBuffer;
    } catch (_) {
        result = false;
    }
    const ret = result;
    return ret;
};

export function __wbg_instanceof_CanvasRenderingContext2d_d070139aaac1459f(arg0) {
    let result;
    try {
        result = arg0 instanceof CanvasRenderingContext2D;
    } catch (_) {
        result = false;
    }
    const ret = result;
    return ret;
};

export function __wbg_instanceof_Error_3443650560328fa9(arg0) {
    let result;
    try {
        result = arg0 instanceof Error;
    } catch (_) {
        result = false;
    }
    const ret = result;
    return ret;
};

export function __wbg_instanceof_Response_cd74d1c2ac92cb0b(arg0) {
    let result;
    try {
        result = arg0 instanceof Response;
    } catch (_) {
        result = false;
    }
    const ret = result;
    return ret;
};

export function __wbg_ironerror_new(arg0) {
    const ret = IronError.__wrap(arg0);
    return ret;
};

export function __wbg_length_22ac23eaec9d8053(arg0) {
    const ret = arg0.length;
    return ret;
};

export function __wbg_log_f614673762e98966(arg0, arg1, arg2, arg3) {
    console.log(arg0, arg1, arg2, arg3);
};

export function __wbg_message_0305fa7903f4b3d9(arg0) {
    const ret = arg0.message;
    return ret;
};

export function __wbg_name_f33243968228ce95(arg0) {
    const ret = arg0.name;
    return ret;
};

export function __wbg_new_0_23cedd11d9b40c9d() {
    const ret = new Date();
    return ret;
};

export function __wbg_new_1ba21ce319a06297() {
    const ret = new Object();
    return ret;
};

export function __wbg_new_25f239778d6112b9() {
    const ret = new Array();
    return ret;
};

export function __wbg_new_3205bc992762cf38() { return handleError(function () {
    const ret = new URLSearchParams();
    return ret;
}, arguments) };

export function __wbg_new_3c79b3bb1b32b7d3() { return handleError(function () {
    const ret = new Headers();
    return ret;
}, arguments) };

export function __wbg_new_6421f6084cc5bc5a(arg0) {
    const ret = new Uint8Array(arg0);
    return ret;
};

export function __wbg_new_79cb6b4c6069a31e() { return handleError(function (arg0, arg1) {
    const ret = new URL(getStringFromWasm0(arg0, arg1));
    return ret;
}, arguments) };

export function __wbg_new_7c30d1f874652e62() { return handleError(function (arg0, arg1) {
    const ret = new WebSocket(getStringFromWasm0(arg0, arg1));
    return ret;
}, arguments) };

export function __wbg_new_8a6f238a6ece86ea() {
    const ret = new Error();
    return ret;
};

export function __wbg_new_ff12d2b041fb48f1(arg0, arg1) {
    try {
        var state0 = {a: arg0, b: arg1};
        var cb0 = (arg0, arg1) => {
            const a = state0.a;
            state0.a = 0;
            try {
                return wasm_bindgen__convert__closures_____invoke__h941949ddb830799f(a, state0.b, arg0, arg1);
            } finally {
                state0.a = a;
            }
        };
        const ret = new Promise(cb0);
        return ret;
    } finally {
        state0.a = state0.b = 0;
    }
};

export function __wbg_new_from_slice_f9c22b9153b26992(arg0, arg1) {
    const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
    return ret;
};

export function __wbg_new_no_args_cb138f77cf6151ee(arg0, arg1) {
    const ret = new Function(getStringFromWasm0(arg0, arg1));
    return ret;
};

export function __wbg_new_with_event_init_dict_8ce3ab55b0239ca3() { return handleError(function (arg0, arg1, arg2) {
    const ret = new CloseEvent(getStringFromWasm0(arg0, arg1), arg2);
    return ret;
}, arguments) };

export function __wbg_new_with_str_and_init_c5748f76f5108934() { return handleError(function (arg0, arg1, arg2) {
    const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
    return ret;
}, arguments) };

export function __wbg_new_with_str_e8aac3eec73c239d() { return handleError(function (arg0, arg1) {
    const ret = new Request(getStringFromWasm0(arg0, arg1));
    return ret;
}, arguments) };

export function __wbg_new_with_u8_clamped_array_e14490b754099e0e() { return handleError(function (arg0, arg1, arg2) {
    const ret = new ImageData(getClampedArrayU8FromWasm0(arg0, arg1), arg2 >>> 0);
    return ret;
}, arguments) };

export function __wbg_ok_dd98ecb60d721e20(arg0) {
    const ret = arg0.ok;
    return ret;
};

export function __wbg_prototypesetcall_dfe9b766cdc1f1fd(arg0, arg1, arg2) {
    Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
};

export function __wbg_push_7d9be8f38fc13975(arg0, arg1) {
    const ret = arg0.push(arg1);
    return ret;
};

export function __wbg_putImageData_3c4fbe4167460ba2() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
    arg0.putImageData(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
}, arguments) };

export function __wbg_putImageData_d10bd82b00b97fad() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
    arg0.putImageData(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
}, arguments) };

export function __wbg_queueMicrotask_9b549dfce8865860(arg0) {
    const ret = arg0.queueMicrotask;
    return ret;
};

export function __wbg_queueMicrotask_fca69f5bfad613a5(arg0) {
    queueMicrotask(arg0);
};

export function __wbg_readyState_9d0976dcad561aa9(arg0) {
    const ret = arg0.readyState;
    return ret;
};

export function __wbg_reason_d4eb9e40592438c2(arg0, arg1) {
    const ret = arg1.reason;
    const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
    const len1 = WASM_VECTOR_LEN;
    getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
    getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
};

export function __wbg_removeEventListener_565e273024b68b75() { return handleError(function (arg0, arg1, arg2, arg3) {
    arg0.removeEventListener(getStringFromWasm0(arg1, arg2), arg3);
}, arguments) };

export function __wbg_resolve_fd5bfbaa4ce36e1e(arg0) {
    const ret = Promise.resolve(arg0);
    return ret;
};

export function __wbg_search_dbf031078dd8e645(arg0, arg1) {
    const ret = arg1.search;
    const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
    const len1 = WASM_VECTOR_LEN;
    getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
    getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
};

export function __wbg_send_7cc36bb628044281() { return handleError(function (arg0, arg1, arg2) {
    arg0.send(getStringFromWasm0(arg1, arg2));
}, arguments) };

export function __wbg_send_ea59e150ab5ebe08() { return handleError(function (arg0, arg1, arg2) {
    arg0.send(getArrayU8FromWasm0(arg1, arg2));
}, arguments) };

export function __wbg_session_new(arg0) {
    const ret = Session.__wrap(arg0);
    return ret;
};

export function __wbg_sessionterminationinfo_new(arg0) {
    const ret = SessionTerminationInfo.__wrap(arg0);
    return ret;
};

export function __wbg_setTimeout_db2dbaeefb6f39c7() { return handleError(function (arg0, arg1) {
    const ret = setTimeout(arg0, arg1);
    return ret;
}, arguments) };

export function __wbg_set_425eb8b710d5beee() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
    arg0.set(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
}, arguments) };

export function __wbg_set_binaryType_73e8c75df97825f8(arg0, arg1) {
    arg0.binaryType = __wbindgen_enum_BinaryType[arg1];
};

export function __wbg_set_body_8e743242d6076a4f(arg0, arg1) {
    arg0.body = arg1;
};

export function __wbg_set_code_2f1b419c1a6169a3(arg0, arg1) {
    arg0.code = arg1;
};

export function __wbg_set_headers_5671cf088e114d2b(arg0, arg1) {
    arg0.headers = arg1;
};

export function __wbg_set_height_6f8f8ef4cb40e496(arg0, arg1) {
    arg0.height = arg1 >>> 0;
};

export function __wbg_set_height_afe09c24165867f7(arg0, arg1) {
    arg0.height = arg1 >>> 0;
};

export function __wbg_set_method_76c69e41b3570627(arg0, arg1, arg2) {
    arg0.method = getStringFromWasm0(arg1, arg2);
};

export function __wbg_set_once_cb88c6a887803dfa(arg0, arg1) {
    arg0.once = arg1 !== 0;
};

export function __wbg_set_reason_6cb672258b901b3a(arg0, arg1, arg2) {
    arg0.reason = getStringFromWasm0(arg1, arg2);
};

export function __wbg_set_search_cbba29f94329f296(arg0, arg1, arg2) {
    arg0.search = getStringFromWasm0(arg1, arg2);
};

export function __wbg_set_width_0a22c810f06a5152(arg0, arg1) {
    arg0.width = arg1 >>> 0;
};

export function __wbg_set_width_7ff7a22c6e9f423e(arg0, arg1) {
    arg0.width = arg1 >>> 0;
};

export function __wbg_stack_0ed75d68575b0f3c(arg0, arg1) {
    const ret = arg1.stack;
    const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
    const len1 = WASM_VECTOR_LEN;
    getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
    getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
};

export function __wbg_static_accessor_GLOBAL_769e6b65d6557335() {
    const ret = typeof global === 'undefined' ? null : global;
    return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
};

export function __wbg_static_accessor_GLOBAL_THIS_60cf02db4de8e1c1() {
    const ret = typeof globalThis === 'undefined' ? null : globalThis;
    return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
};

export function __wbg_static_accessor_SELF_08f5a74c69739274() {
    const ret = typeof self === 'undefined' ? null : self;
    return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
};

export function __wbg_static_accessor_WINDOW_a8924b26aa92d024() {
    const ret = typeof window === 'undefined' ? null : window;
    return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
};

export function __wbg_statusText_0eec2bbb2c8f22e2(arg0, arg1) {
    const ret = arg1.statusText;
    const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
    const len1 = WASM_VECTOR_LEN;
    getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
    getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
};

export function __wbg_status_9bfc680efca4bdfd(arg0) {
    const ret = arg0.status;
    return ret;
};

export function __wbg_then_429f7caf1026411d(arg0, arg1, arg2) {
    const ret = arg0.then(arg1, arg2);
    return ret;
};

export function __wbg_then_4f95312d68691235(arg0, arg1) {
    const ret = arg0.then(arg1);
    return ret;
};

export function __wbg_toString_14b47ee7542a49ef(arg0) {
    const ret = arg0.toString();
    return ret;
};

export function __wbg_toString_f07112df359c997f(arg0) {
    const ret = arg0.toString();
    return ret;
};

export function __wbg_url_87f30c96ceb3baf7(arg0, arg1) {
    const ret = arg1.url;
    const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
    const len1 = WASM_VECTOR_LEN;
    getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
    getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
};

export function __wbg_warn_165ef4f6bcfc05e7(arg0, arg1, arg2, arg3) {
    console.warn(arg0, arg1, arg2, arg3);
};

export function __wbg_warn_6e567d0d926ff881(arg0) {
    console.warn(arg0);
};

export function __wbg_wasClean_4154a2d59fdb4dd7(arg0) {
    const ret = arg0.wasClean;
    return ret;
};

export function __wbindgen_cast_16e4bd310f9e561f(arg0, arg1) {
    // Cast intrinsic for `Closure(Closure { dtor_idx: 997, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 1000, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
    const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h52a2faaf1da3e630, wasm_bindgen__convert__closures_____invoke__h1b6eeedec099a8de);
    return ret;
};

export function __wbindgen_cast_1a349fbd454798fd(arg0, arg1) {
    // Cast intrinsic for `Closure(Closure { dtor_idx: 997, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 1000, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
    const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h52a2faaf1da3e630, wasm_bindgen__convert__closures_____invoke__h1b6eeedec099a8de);
    return ret;
};

export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
    // Cast intrinsic for `Ref(String) -> Externref`.
    const ret = getStringFromWasm0(arg0, arg1);
    return ret;
};

export function __wbindgen_cast_338ffa609467e971(arg0, arg1) {
    // Cast intrinsic for `Closure(Closure { dtor_idx: 1037, function: Function { arguments: [Externref], shim_idx: 1038, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
    const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hf477c56b59a93d44, wasm_bindgen__convert__closures_____invoke__h8a105ca3ff48d408);
    return ret;
};

export function __wbindgen_cast_81522377aa39a385(arg0, arg1) {
    // Cast intrinsic for `Closure(Closure { dtor_idx: 978, function: Function { arguments: [], shim_idx: 979, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
    const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h0022e787a053a40f, wasm_bindgen__convert__closures_____invoke__h1a0b091d40d0d4be);
    return ret;
};

export function __wbindgen_cast_8d0a21f2bab8347d(arg0, arg1) {
    // Cast intrinsic for `Closure(Closure { dtor_idx: 997, function: Function { arguments: [NamedExternref("Event")], shim_idx: 1000, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
    const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h52a2faaf1da3e630, wasm_bindgen__convert__closures_____invoke__h1b6eeedec099a8de);
    return ret;
};

export function __wbindgen_cast_d6cd19b81560fd6e(arg0) {
    // Cast intrinsic for `F64 -> Externref`.
    const ret = arg0;
    return ret;
};

export function __wbindgen_cast_d86c825cf90cbdb3(arg0, arg1) {
    // Cast intrinsic for `Closure(Closure { dtor_idx: 997, function: Function { arguments: [], shim_idx: 998, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
    const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h52a2faaf1da3e630, wasm_bindgen__convert__closures_____invoke__h4d617c7b6d398e2c);
    return ret;
};

export function __wbindgen_init_externref_table() {
    const table = wasm.__wbindgen_externrefs;
    const offset = table.grow(4);
    table.set(0, undefined);
    table.set(offset + 0, undefined);
    table.set(offset + 1, null);
    table.set(offset + 2, true);
    table.set(offset + 3, false);
};
