"use strict";
const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
  return typeof document === 'undefined'
    ? new (require('url'.replace('', '')).URL)('file:' + __filename).href
    : (document.currentScript && document.currentScript.src) ||
      new URL('main.js', document.baseURI).href;
})();
;
exports.ids = ["293"];
exports.modules = {
"../../node_modules/.pnpm/@yume-chan+adb@2.5.1/node_modules/@yume-chan/adb/esm/commands/base.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  Y: () => (/* binding */ AdbServiceBase)
});

;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+event@2.0.0/node_modules/@yume-chan/event/esm/disposable.js
class AutoDisposable {
    #disposables = [];
    constructor() {
        this.dispose = this.dispose.bind(this);
    }
    addDisposable(disposable) {
        this.#disposables.push(disposable);
        return disposable;
    }
    dispose() {
        for (const disposable of this.#disposables) {
            disposable.dispose();
        }
        this.#disposables = [];
    }
}
class DisposableList extends (/* unused pure expression or super */ null && (AutoDisposable)) {
    add(disposable) {
        return this.addDisposable(disposable);
    }
}
//# sourceMappingURL=disposable.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+adb@2.5.1/node_modules/@yume-chan/adb/esm/commands/base.js

class AdbServiceBase extends AutoDisposable {
    #adb;
    get adb() {
        return this.#adb;
    }
    constructor(adb) {
        super();
        this.#adb = adb;
    }
}
//# sourceMappingURL=base.js.map

},
"../../node_modules/.pnpm/@yume-chan+adb@2.5.1/node_modules/@yume-chan/adb/esm/commands/reverse.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  d4: () => (AdbReverseNotSupportedError),
  nQ: () => (AdbReverseService)
});
/* import */ var _yume_chan_stream_extra__rspack_import_5 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+stream-extra@2.1.0/node_modules/@yume-chan/stream-extra/esm/buffered.js");
/* import */ var _yume_chan_struct__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/struct.js");
/* import */ var _yume_chan_struct__rspack_import_1 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/string.js");
/* import */ var _yume_chan_struct__rspack_import_2 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/extend.js");
/* import */ var _yume_chan_struct__rspack_import_3 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/utils.js");
/* import */ var _yume_chan_struct__rspack_import_8 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/readable.js");
/* import */ var _utils_index_js__rspack_import_6 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+adb@2.5.1/node_modules/@yume-chan/adb/esm/utils/sequence-equal.js");
/* import */ var _utils_index_js__rspack_import_7 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+adb@2.5.1/node_modules/@yume-chan/adb/esm/utils/hex.js");
/* import */ var _base_js__rspack_import_4 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+adb@2.5.1/node_modules/@yume-chan/adb/esm/commands/base.js");
// cspell: ignore killforward




const AdbReverseStringResponse = (0,_yume_chan_struct__rspack_import_0/* .struct */.w3)({
    length: (0,_yume_chan_struct__rspack_import_1/* .string */.Y)(4),
    content: (0,_yume_chan_struct__rspack_import_1/* .string */.Y)({
        field: "length",
        convert(value) {
            return Number.parseInt(value, 16);
        },
        back(value) {
            return value.toString(16).padStart(4, "0");
        },
    }),
}, { littleEndian: true });
class AdbReverseError extends Error {
    constructor(message) {
        super(message);
    }
}
class AdbReverseNotSupportedError extends AdbReverseError {
    constructor() {
        super("ADB reverse tunnel is not supported on this device when connected wirelessly.");
    }
}
const AdbReverseErrorResponse = (0,_yume_chan_struct__rspack_import_2/* .extend */.X)(AdbReverseStringResponse, {}, {
    postDeserialize(value) {
        // https://issuetracker.google.com/issues/37066218
        // ADB on Android <9 can't create reverse tunnels when connected wirelessly (ADB over Wi-Fi),
        // and returns this confusing "more than one device/emulator" error.
        if (value.content === "more than one device/emulator") {
            throw new AdbReverseNotSupportedError();
        }
        else {
            throw new AdbReverseError(value.content);
        }
    },
});
// Like `hexToNumber`, it's much faster than first converting `buffer` to a string
function decimalToNumber(buffer) {
    let value = 0;
    for (const byte of buffer) {
        // Like `parseInt`, return when it encounters a non-digit character
        if (byte < 48 || byte > 57) {
            return value;
        }
        value = value * 10 + byte - 48;
    }
    return value;
}
const OKAY = (0,_yume_chan_struct__rspack_import_3/* .encodeUtf8 */.Af)("OKAY");
class AdbReverseService extends _base_js__rspack_import_4/* .AdbServiceBase */.Y {
    #deviceAddressToLocalAddress = new Map();
    async createBufferedStream(service) {
        const socket = await this.adb.createSocket(service);
        return new _yume_chan_stream_extra__rspack_import_5/* .BufferedReadableStream */.y(socket.readable);
    }
    async sendRequest(service) {
        const stream = await this.createBufferedStream(service);
        const response = await stream.readExactly(4);
        if (!(0,_utils_index_js__rspack_import_6/* .sequenceEqual */.m)(response, OKAY)) {
            await AdbReverseErrorResponse.deserialize(stream);
        }
        return stream;
    }
    /**
     * Get a list of all reverse port forwarding on the device.
     */
    async list() {
        const stream = await this.createBufferedStream("reverse:list-forward");
        const response = await AdbReverseStringResponse.deserialize(stream);
        return response.content
            .split("\n")
            .filter((line) => !!line)
            .map((line) => {
            const [deviceSerial, localName, remoteName] = line.split(" ");
            return { deviceSerial, localName, remoteName };
        });
        // No need to close the stream, device will close it
    }
    /**
     * Add a reverse port forwarding for a program that already listens on a port.
     */
    async addExternal(deviceAddress, localAddress) {
        const stream = await this.sendRequest(`reverse:forward:${deviceAddress};${localAddress}`);
        // `tcp:0` tells the device to pick an available port.
        // On Android >=8, device will respond with the selected port for all `tcp:` requests.
        if (deviceAddress.startsWith("tcp:")) {
            const position = stream.position;
            try {
                const length = (0,_utils_index_js__rspack_import_7/* .hexToNumber */.M)(await stream.readExactly(4));
                const port = decimalToNumber(await stream.readExactly(length));
                deviceAddress = `tcp:${port}`;
            }
            catch (e) {
                if (e instanceof _yume_chan_struct__rspack_import_8/* .ExactReadableEndedError */.s &&
                    stream.position === position) {
                    // Android <8 doesn't have this response.
                    // (the stream is closed now)
                    // Can be safely ignored.
                }
                else {
                    throw e;
                }
            }
        }
        return deviceAddress;
    }
    /**
     * Add a reverse port forwarding.
     */
    async add(deviceAddress, handler, localAddress) {
        localAddress = await this.adb.transport.addReverseTunnel(handler, localAddress);
        try {
            deviceAddress = await this.addExternal(deviceAddress, localAddress);
            this.#deviceAddressToLocalAddress.set(deviceAddress, localAddress);
            return deviceAddress;
        }
        catch (e) {
            await this.adb.transport.removeReverseTunnel(localAddress);
            throw e;
        }
    }
    /**
     * Remove a reverse port forwarding.
     */
    async remove(deviceAddress) {
        const localAddress = this.#deviceAddressToLocalAddress.get(deviceAddress);
        if (localAddress) {
            await this.adb.transport.removeReverseTunnel(localAddress);
        }
        await this.sendRequest(`reverse:killforward:${deviceAddress}`);
        // No need to close the stream, device will close it
    }
    /**
     * Remove all reverse port forwarding, including the ones added by other programs.
     */
    async removeAll() {
        await this.adb.transport.clearReverseTunnels();
        this.#deviceAddressToLocalAddress.clear();
        await this.sendRequest(`reverse:killforward-all`);
        // No need to close the stream, device will close it
    }
}
//# sourceMappingURL=reverse.js.map

},
"../../node_modules/.pnpm/@yume-chan+adb@2.5.1/node_modules/@yume-chan/adb/esm/utils/hex.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  M: () => (hexToNumber),
  h: () => (write4HexDigits)
});
function hexCharToNumber(char) {
    if (char < 48) {
        throw new TypeError(`Invalid hex char ${char}`);
    }
    if (char < 58) {
        // 0-9
        return char - 48;
    }
    if (char < 65) {
        throw new TypeError(`Invalid hex char ${char}`);
    }
    if (char < 71) {
        // A-F
        return char - 55;
    }
    if (char < 97) {
        throw new TypeError(`Invalid hex char ${char}`);
    }
    if (char < 103) {
        // a-f
        return char - 87;
    }
    throw new TypeError(`Invalid hex char ${char}`);
}
// It's 22x faster than converting `data` to string then `Number.parseInt`
// https://jsbench.me/dglha94ozl/1
function hexToNumber(data) {
    let result = 0;
    for (let i = 0; i < data.length; i += 1) {
        result = (result << 4) | hexCharToNumber(data[i]);
    }
    return result;
}
function write4HexDigits(buffer, index, value) {
    const start = index;
    index += 3;
    while (index >= start && value > 0) {
        const digit = value & 0xf;
        value >>= 4;
        if (digit < 10) {
            buffer[index] = digit + 48; // '0'
        }
        else {
            buffer[index] = digit + 87; // 'a' - 10
        }
        index -= 1;
    }
    while (index >= start) {
        buffer[index] = 48; // '0'
        index -= 1;
    }
}
//# sourceMappingURL=hex.js.map

},
"../../node_modules/.pnpm/@yume-chan+adb@2.5.1/node_modules/@yume-chan/adb/esm/utils/no-op.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  H: () => (unreachable),
  t: () => (NOOP)
});
/* #__NO_SIDE_EFFECTS__ */
const NOOP = () => {
    // no-op
};
/**
 * When used in `Promise#catch`, means the promise should never throw errors.
 * An explicit way to suppress ESLint floating promise warnings.
 */
function unreachable(...args) {
    // Trigger runtime's unhandled rejection event.
    throw new Error("Unreachable. Arguments:\n" + args.join("\n"));
}
//# sourceMappingURL=no-op.js.map

},
"../../node_modules/.pnpm/@yume-chan+adb@2.5.1/node_modules/@yume-chan/adb/esm/utils/sequence-equal.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  m: () => (sequenceEqual)
});
function sequenceEqual(a, b) {
    if (a.length !== b.length) {
        return false;
    }
    for (let i = 0; i < a.length; i += 1) {
        if (a[i] !== b[i]) {
            return false;
        }
    }
    return true;
}
//# sourceMappingURL=sequence-equal.js.map

},
"../../node_modules/.pnpm/@yume-chan+event@2.0.0/node_modules/@yume-chan/event/esm/event-emitter.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  b: () => (EventEmitter)
});
class EventEmitter {
    listeners = [];
    constructor() {
        this.event = this.event.bind(this);
    }
    addEventListener(info) {
        this.listeners.push(info);
        const remove = () => {
            const index = this.listeners.indexOf(info);
            if (index !== -1) {
                this.listeners.splice(index, 1);
            }
        };
        remove.dispose = remove;
        return remove;
    }
    event = (listener, thisArg, ...args) => {
        const info = {
            listener: listener,
            thisArg,
            args,
        };
        return this.addEventListener(info);
    };
    fire(e) {
        for (const info of this.listeners.slice()) {
            info.listener.call(info.thisArg, e, ...info.args);
        }
    }
    dispose() {
        this.listeners.length = 0;
    }
}
//# sourceMappingURL=event-emitter.js.map

},
"../../node_modules/.pnpm/@yume-chan+event@2.0.0/node_modules/@yume-chan/event/esm/sticky-event-emitter.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  O: () => (StickyEventEmitter)
});
/* import */ var _event_emitter_js__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+event@2.0.0/node_modules/@yume-chan/event/esm/event-emitter.js");

const Undefined = Symbol("undefined");
class StickyEventEmitter extends _event_emitter_js__rspack_import_0/* .EventEmitter */.b {
    #value = Undefined;
    addEventListener(info) {
        if (this.#value !== Undefined) {
            info.listener.call(info.thisArg, this.#value, ...info.args);
        }
        return super.addEventListener(info);
    }
    fire(e) {
        this.#value = e;
        super.fire(e);
    }
}
//# sourceMappingURL=sticky-event-emitter.js.map

},
"../../node_modules/.pnpm/@yume-chan+no-data-view@2.0.0/node_modules/@yume-chan/no-data-view/esm/int16.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  T8: () => (getInt16),
  f2: () => (setInt16)
});
/* #__NO_SIDE_EFFECTS__ */
function getInt16LittleEndian(buffer, offset) {
    return ((buffer[offset] | (buffer[offset + 1] << 8)) << 16) >> 16;
}
/* #__NO_SIDE_EFFECTS__ */
function getInt16BigEndian(buffer, offset) {
    return (((buffer[offset] << 8) | buffer[offset + 1]) << 16) >> 16;
}
/* #__NO_SIDE_EFFECTS__ */
function getInt16(buffer, offset, littleEndian) {
    return littleEndian
        ? ((buffer[offset] | (buffer[offset + 1] << 8)) << 16) >> 16
        : (((buffer[offset] << 8) | buffer[offset + 1]) << 16) >> 16;
}
/* #__NO_SIDE_EFFECTS__ */
function setInt16LittleEndian(buffer, offset, value) {
    buffer[offset] = value;
    buffer[offset + 1] = value >> 8;
}
function setInt16BigEndian(buffer, offset, value) {
    buffer[offset] = value >> 8;
    buffer[offset + 1] = value;
}
function setInt16(buffer, offset, value, littleEndian) {
    if (littleEndian) {
        buffer[offset] = value;
        buffer[offset + 1] = value >> 8;
    }
    else {
        buffer[offset] = value >> 8;
        buffer[offset + 1] = value;
    }
}
//# sourceMappingURL=int16.js.map

},
"../../node_modules/.pnpm/@yume-chan+no-data-view@2.0.0/node_modules/@yume-chan/no-data-view/esm/uint16.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  An: () => (setUint16),
  G2: () => (getUint16)
});
/* #__NO_SIDE_EFFECTS__ */
function getUint16LittleEndian(buffer, offset) {
    return buffer[offset] | (buffer[offset + 1] << 8);
}
/* #__NO_SIDE_EFFECTS__ */
function getUint16BigEndian(buffer, offset) {
    return (buffer[offset] << 8) | buffer[offset + 1];
}
/* #__NO_SIDE_EFFECTS__ */
function getUint16(buffer, offset, littleEndian) {
    return littleEndian
        ? buffer[offset] | (buffer[offset + 1] << 8)
        : buffer[offset + 1] | (buffer[offset] << 8);
}
function setUint16LittleEndian(buffer, offset, value) {
    buffer[offset] = value;
    buffer[offset + 1] = value >> 8;
}
function setUint16BigEndian(buffer, offset, value) {
    buffer[offset] = value >> 8;
    buffer[offset + 1] = value;
}
function setUint16(buffer, offset, value, littleEndian) {
    if (littleEndian) {
        buffer[offset] = value;
        buffer[offset + 1] = value >> 8;
    }
    else {
        buffer[offset] = value >> 8;
        buffer[offset + 1] = value;
    }
}
//# sourceMappingURL=uint16.js.map

},
"../../node_modules/.pnpm/@yume-chan+no-data-view@2.0.0/node_modules/@yume-chan/no-data-view/esm/uint32.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  FQ: () => (getUint32LittleEndian),
  HI: () => (getUint32BigEndian),
  Qg: () => (getUint32),
  ub: () => (setUint32)
});
/* #__NO_SIDE_EFFECTS__ */
function getUint32LittleEndian(buffer, offset) {
    return ((buffer[offset] |
        (buffer[offset + 1] << 8) |
        (buffer[offset + 2] << 16) |
        (buffer[offset + 3] << 24)) >>>
        0);
}
/* #__NO_SIDE_EFFECTS__ */
function getUint32BigEndian(buffer, offset) {
    return (((buffer[offset] << 24) |
        (buffer[offset + 1] << 16) |
        (buffer[offset + 2] << 8) |
        buffer[offset + 3]) >>>
        0);
}
/* #__NO_SIDE_EFFECTS__ */
function getUint32(buffer, offset, littleEndian) {
    return littleEndian
        ? (buffer[offset] |
            (buffer[offset + 1] << 8) |
            (buffer[offset + 2] << 16) |
            (buffer[offset + 3] << 24)) >>>
            0
        : ((buffer[offset] << 24) |
            (buffer[offset + 1] << 16) |
            (buffer[offset + 2] << 8) |
            buffer[offset + 3]) >>>
            0;
}
function setUint32LittleEndian(buffer, offset, value) {
    buffer[offset] = value;
    buffer[offset + 1] = value >> 8;
    buffer[offset + 2] = value >> 16;
    buffer[offset + 3] = value >> 24;
}
function setUint32BigEndian(buffer, offset, value) {
    buffer[offset] = value >> 24;
    buffer[offset + 1] = value >> 16;
    buffer[offset + 2] = value >> 8;
    buffer[offset + 3] = value;
}
function setUint32(buffer, offset, value, littleEndian) {
    if (littleEndian) {
        buffer[offset] = value;
        buffer[offset + 1] = value >> 8;
        buffer[offset + 2] = value >> 16;
        buffer[offset + 3] = value >> 24;
    }
    else {
        buffer[offset] = value >> 24;
        buffer[offset + 1] = value >> 16;
        buffer[offset + 2] = value >> 8;
        buffer[offset + 3] = value;
    }
}
//# sourceMappingURL=uint32.js.map

},
"../../node_modules/.pnpm/@yume-chan+no-data-view@2.0.0/node_modules/@yume-chan/no-data-view/esm/uint64.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  Hn: () => (getUint64),
  X3: () => (setUint64),
  gw: () => (getUint64LittleEndian)
});
function getUint64LittleEndian(buffer, offset) {
    return (BigInt(buffer[offset]) |
        (BigInt(buffer[offset + 1]) << 8n) |
        (BigInt(buffer[offset + 2]) << 16n) |
        (BigInt(buffer[offset + 3]) << 24n) |
        (BigInt(buffer[offset + 4]) << 32n) |
        (BigInt(buffer[offset + 5]) << 40n) |
        (BigInt(buffer[offset + 6]) << 48n) |
        (BigInt(buffer[offset + 7]) << 56n));
}
function getUint64BigEndian(buffer, offset) {
    return ((BigInt(buffer[offset]) << 56n) |
        (BigInt(buffer[offset + 1]) << 48n) |
        (BigInt(buffer[offset + 2]) << 40n) |
        (BigInt(buffer[offset + 3]) << 32n) |
        (BigInt(buffer[offset + 4]) << 24n) |
        (BigInt(buffer[offset + 5]) << 16n) |
        (BigInt(buffer[offset + 6]) << 8n) |
        BigInt(buffer[offset + 7]));
}
function getUint64(buffer, offset, littleEndian) {
    return littleEndian
        ? BigInt(buffer[offset]) |
            (BigInt(buffer[offset + 1]) << 8n) |
            (BigInt(buffer[offset + 2]) << 16n) |
            (BigInt(buffer[offset + 3]) << 24n) |
            (BigInt(buffer[offset + 4]) << 32n) |
            (BigInt(buffer[offset + 5]) << 40n) |
            (BigInt(buffer[offset + 6]) << 48n) |
            (BigInt(buffer[offset + 7]) << 56n)
        : (BigInt(buffer[offset]) << 56n) |
            (BigInt(buffer[offset + 1]) << 48n) |
            (BigInt(buffer[offset + 2]) << 40n) |
            (BigInt(buffer[offset + 3]) << 32n) |
            (BigInt(buffer[offset + 4]) << 24n) |
            (BigInt(buffer[offset + 5]) << 16n) |
            (BigInt(buffer[offset + 6]) << 8n) |
            BigInt(buffer[offset + 7]);
}
function setUint64LittleEndian(buffer, offset, value) {
    buffer[offset] = Number(value & 0xffn);
    buffer[offset + 1] = Number((value >> 8n) & 0xffn);
    buffer[offset + 2] = Number((value >> 16n) & 0xffn);
    buffer[offset + 3] = Number((value >> 24n) & 0xffn);
    buffer[offset + 4] = Number((value >> 32n) & 0xffn);
    buffer[offset + 5] = Number((value >> 40n) & 0xffn);
    buffer[offset + 6] = Number((value >> 48n) & 0xffn);
    buffer[offset + 7] = Number((value >> 56n) & 0xffn);
}
function setUint64BigEndian(buffer, offset, value) {
    buffer[offset] = Number((value >> 56n) & 0xffn);
    buffer[offset + 1] = Number((value >> 48n) & 0xffn);
    buffer[offset + 2] = Number((value >> 40n) & 0xffn);
    buffer[offset + 3] = Number((value >> 32n) & 0xffn);
    buffer[offset + 4] = Number((value >> 24n) & 0xffn);
    buffer[offset + 5] = Number((value >> 16n) & 0xffn);
    buffer[offset + 6] = Number((value >> 8n) & 0xffn);
    buffer[offset + 7] = Number(value & 0xffn);
}
function setUint64(buffer, offset, value, littleEndian) {
    if (littleEndian) {
        buffer[offset] = Number(value & 0xffn);
        buffer[offset + 1] = Number((value >> 8n) & 0xffn);
        buffer[offset + 2] = Number((value >> 16n) & 0xffn);
        buffer[offset + 3] = Number((value >> 24n) & 0xffn);
        buffer[offset + 4] = Number((value >> 32n) & 0xffn);
        buffer[offset + 5] = Number((value >> 40n) & 0xffn);
        buffer[offset + 6] = Number((value >> 48n) & 0xffn);
        buffer[offset + 7] = Number((value >> 56n) & 0xffn);
    }
    else {
        buffer[offset] = Number((value >> 56n) & 0xffn);
        buffer[offset + 1] = Number((value >> 48n) & 0xffn);
        buffer[offset + 2] = Number((value >> 40n) & 0xffn);
        buffer[offset + 3] = Number((value >> 32n) & 0xffn);
        buffer[offset + 4] = Number((value >> 24n) & 0xffn);
        buffer[offset + 5] = Number((value >> 16n) & 0xffn);
        buffer[offset + 6] = Number((value >> 8n) & 0xffn);
        buffer[offset + 7] = Number(value & 0xffn);
    }
}
//# sourceMappingURL=uint64.js.map

},
"../../node_modules/.pnpm/@yume-chan+stream-extra@2.1.0/node_modules/@yume-chan/stream-extra/esm/buffered.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  y: () => (BufferedReadableStream)
});
/* import */ var _yume_chan_struct__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/readable.js");
/* import */ var _yume_chan_struct__rspack_import_1 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/bipedal.js");
/* import */ var _push_readable_js__rspack_import_2 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+stream-extra@2.1.0/node_modules/@yume-chan/stream-extra/esm/push-readable.js");
/* import */ var _try_close_js__rspack_import_3 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+stream-extra@2.1.0/node_modules/@yume-chan/stream-extra/esm/try-close.js");



class BufferedReadableStream {
    #buffered;
    // PERF: `subarray` is slow
    // don't use it until absolutely necessary
    #bufferedOffset = 0;
    #bufferedLength = 0;
    #position = 0;
    get position() {
        return this.#position;
    }
    stream;
    reader;
    constructor(stream) {
        this.stream = stream;
        this.reader = stream.getReader();
    }
    #readBuffered(length) {
        if (!this.#buffered) {
            return undefined;
        }
        const value = this.#buffered.subarray(this.#bufferedOffset, this.#bufferedOffset + length);
        // PERF: Synchronous path for reading from internal buffer
        if (this.#bufferedLength > length) {
            this.#position += length;
            this.#bufferedOffset += length;
            this.#bufferedLength -= length;
            return value;
        }
        this.#position += this.#bufferedLength;
        this.#buffered = undefined;
        this.#bufferedOffset = 0;
        this.#bufferedLength = 0;
        return value;
    }
    async #readSource(length) {
        const { done, value } = await this.reader.read();
        if (done) {
            throw new _yume_chan_struct__rspack_import_0/* .ExactReadableEndedError */.s();
        }
        if (value.length > length) {
            this.#buffered = value;
            this.#bufferedOffset = length;
            this.#bufferedLength = value.length - length;
            this.#position += length;
            return value.subarray(0, length);
        }
        this.#position += value.length;
        return value;
    }
    iterateExactly(length) {
        let state = this.#buffered ? 0 : 1;
        return {
            next: () => {
                switch (state) {
                    case 0: {
                        const value = this.#readBuffered(length);
                        if (value.length === length) {
                            state = 2;
                        }
                        else {
                            length -= value.length;
                            state = 1;
                        }
                        return { done: false, value };
                    }
                    case 1:
                        state = 3;
                        return {
                            done: false,
                            value: this.#readSource(length).then((value) => {
                                if (value.length === length) {
                                    state = 2;
                                }
                                else {
                                    length -= value.length;
                                    state = 1;
                                }
                                return value;
                            }),
                        };
                    case 2:
                        return { done: true, value: undefined };
                    case 3:
                        throw new Error("Can't call `next` before previous Promise resolves");
                    default:
                        throw new Error("unreachable");
                }
            },
        };
    }
    readExactly = (0,_yume_chan_struct__rspack_import_1/* .bipedal */.q)(function* (then, length) {
        let result;
        let index = 0;
        const initial = this.#readBuffered(length);
        if (initial) {
            if (initial.length === length) {
                return initial;
            }
            result = new Uint8Array(length);
            result.set(initial, index);
            index += initial.length;
            length -= initial.length;
        }
        else {
            result = new Uint8Array(length);
        }
        while (length > 0) {
            const value = yield* then(this.#readSource(length));
            result.set(value, index);
            index += value.length;
            length -= value.length;
        }
        return result;
    });
    /**
     * Return a readable stream with unconsumed data (if any) and
     * all data from the wrapped stream.
     * @returns A `ReadableStream`
     */
    release() {
        if (this.#bufferedLength > 0) {
            return new _push_readable_js__rspack_import_2/* .PushReadableStream */.F(async (controller) => {
                // Put the remaining data back to the stream
                const buffered = this.#buffered.subarray(this.#bufferedOffset);
                await controller.enqueue(buffered);
                controller.abortSignal.addEventListener("abort", () => {
                    void (0,_try_close_js__rspack_import_3/* .tryCancel */.S)(this.reader);
                });
                // Manually pipe the stream
                while (true) {
                    const { done, value } = await this.reader.read();
                    if (done) {
                        return;
                    }
                    await controller.enqueue(value);
                }
            });
        }
        else {
            // Simply release the reader and return the stream
            this.reader.releaseLock();
            return this.stream;
        }
    }
    async cancel(reason) {
        await this.reader.cancel(reason);
    }
}
//# sourceMappingURL=buffered.js.map

},
"../../node_modules/.pnpm/@yume-chan+stream-extra@2.1.0/node_modules/@yume-chan/stream-extra/esm/encoding.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  W: () => (TextDecoderStream)
});
const Global = globalThis;
const TextDecoderStream = Global.TextDecoderStream;
const TextEncoderStream = Global.TextEncoderStream;
//# sourceMappingURL=encoding.js.map

},
"../../node_modules/.pnpm/@yume-chan+stream-extra@2.1.0/node_modules/@yume-chan/stream-extra/esm/struct-deserialize.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  f: () => (/* binding */ StructDeserializeStream)
});

// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/struct.js
var esm_struct = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/struct.js");
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+stream-extra@2.1.0/node_modules/@yume-chan/stream-extra/esm/buffered.js
var esm_buffered = __webpack_require__("../../node_modules/.pnpm/@yume-chan+stream-extra@2.1.0/node_modules/@yume-chan/stream-extra/esm/buffered.js");
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+stream-extra@2.1.0/node_modules/@yume-chan/stream-extra/esm/push-readable.js
var push_readable = __webpack_require__("../../node_modules/.pnpm/@yume-chan+stream-extra@2.1.0/node_modules/@yume-chan/stream-extra/esm/push-readable.js");
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+stream-extra@2.1.0/node_modules/@yume-chan/stream-extra/esm/stream.js
var esm_stream = __webpack_require__("../../node_modules/.pnpm/@yume-chan+stream-extra@2.1.0/node_modules/@yume-chan/stream-extra/esm/stream.js");
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+stream-extra@2.1.0/node_modules/@yume-chan/stream-extra/esm/buffered-transform.js




// TODO: BufferedTransformStream: find better implementation
class BufferedTransformStream {
    #readable;
    get readable() {
        return this.#readable;
    }
    #writable;
    get writable() {
        return this.#writable;
    }
    constructor(transform) {
        // Convert incoming chunks to a `BufferedReadableStream`
        let bufferedStreamController;
        let writableStreamController;
        const buffered = new esm_buffered/* .BufferedReadableStream */.y(new push_readable/* .PushReadableStream */.F((controller) => {
            bufferedStreamController = controller;
        }));
        this.#readable = new esm_stream/* .ReadableStream */.ZY({
            async pull(controller) {
                try {
                    const value = await transform(buffered);
                    controller.enqueue(value);
                }
                catch (e) {
                    // Treat `StructEmptyError` as a normal end.
                    // If the `transform` method doesn't have enough data to return a value,
                    // it should throw another error to indicate that.
                    if (e instanceof esm_struct/* .StructEmptyError */.r1) {
                        controller.close();
                        return;
                    }
                    throw e;
                }
            },
            cancel: (reason) => {
                // If a `ReadableStream` is piping into `#writable`,
                // This will cancel the `ReadableStream` immediately.
                // If upstream is writing using `#writable`'s writer, this will
                // throw errors for any future writes
                return writableStreamController.error(reason);
            },
        });
        this.#writable = new esm_stream/* .WritableStream */.ho({
            start(controller) {
                writableStreamController = controller;
            },
            async write(chunk) {
                await bufferedStreamController.enqueue(chunk);
            },
            abort() {
                bufferedStreamController.close();
            },
            close() {
                bufferedStreamController.close();
            },
        });
    }
}
//# sourceMappingURL=buffered-transform.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+stream-extra@2.1.0/node_modules/@yume-chan/stream-extra/esm/struct-deserialize.js

class StructDeserializeStream extends BufferedTransformStream {
    constructor(struct) {
        super((stream) => {
            return struct.deserialize(stream);
        });
    }
}
//# sourceMappingURL=struct-deserialize.js.map

},
"../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/bipedal.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  q: () => (bipedal)
});
/* import */ var _yume_chan_async__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+async@4.1.3/node_modules/@yume-chan/async/esm/maybe-promise.js");

function advance(iterator, next) {
    while (true) {
        const { done, value } = iterator.next(next);
        if (done) {
            return value;
        }
        if ((0,_yume_chan_async__rspack_import_0/* .isPromiseLike */.$)(value)) {
            return value.then((value) => advance(iterator, { resolved: value }), (error) => advance(iterator, { error }));
        }
        next = value;
    }
}
/* #__NO_SIDE_EFFECTS__ */
function bipedal(fn, bindThis) {
    function result(...args) {
        const iterator = fn.call(this, function* (value) {
            if ((0,_yume_chan_async__rspack_import_0/* .isPromiseLike */.$)(value)) {
                const result = yield value;
                if ("resolved" in result) {
                    return result.resolved;
                }
                else {
                    throw result.error;
                }
            }
            return value;
        }, ...args);
        return advance(iterator, undefined);
    }
    if (bindThis) {
        return result.bind(bindThis);
    }
    else {
        return result;
    }
}
//# sourceMappingURL=bipedal.js.map

},
"../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/buffer.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  j: () => (EmptyUint8Array),
  r: () => (buffer)
});
/* import */ var _field_index_js__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/field/factory.js");

const EmptyUint8Array = new Uint8Array(0);
function copyMaybeDifferentLength(dest, source, index, length) {
    if (source.length < length) {
        dest.set(source, index);
        // Clear trailing bytes
        dest.fill(0, index + source.length, index + length);
    }
    else if (source.length === length) {
        dest.set(source, index);
    }
    else {
        dest.set(source.subarray(0, length), index);
    }
}
/* #__NO_SIDE_EFFECTS__ */
function buffer(lengthOrField, converter) {
    // Fixed length
    if (typeof lengthOrField === "number") {
        let serialize;
        let deserialize;
        let init;
        if (lengthOrField === 0) {
            serialize = () => { };
            if (converter) {
                // eslint-disable-next-line require-yield
                deserialize = function* () {
                    return converter.convert(EmptyUint8Array);
                };
            }
            else {
                // eslint-disable-next-line require-yield
                deserialize = function* () {
                    return EmptyUint8Array;
                };
            }
        }
        else {
            serialize = (value, { buffer, index }) => copyMaybeDifferentLength(buffer, value, index, lengthOrField);
            if (converter) {
                deserialize = function* (then, reader) {
                    const array = reader.readExactly(lengthOrField);
                    return converter.convert(yield* then(array));
                };
                init = (value) => converter.back(value);
            }
            else {
                // eslint-disable-next-line require-yield
                deserialize = function* (_then, reader) {
                    const array = reader.readExactly(lengthOrField);
                    return array;
                };
            }
        }
        return (0,_field_index_js__rspack_import_0/* .field */.Z)(lengthOrField, "byob", serialize, deserialize, { init });
    }
    // Declare length field
    // Some field types are `function`s
    if ((typeof lengthOrField === "object" ||
        typeof lengthOrField === "function") &&
        "serialize" in lengthOrField) {
        let deserialize;
        let init;
        if (converter) {
            deserialize = function* (then, reader, context) {
                const length = yield* then(lengthOrField.deserialize(reader, context));
                const array = length !== 0 ? reader.readExactly(length) : EmptyUint8Array;
                return converter.convert(yield* then(array));
            };
            init = (value) => converter.back(value);
        }
        else {
            deserialize = function* (then, reader, context) {
                const length = yield* then(lengthOrField.deserialize(reader, context));
                const array = length !== 0 ? reader.readExactly(length) : EmptyUint8Array;
                return array;
            };
        }
        return (0,_field_index_js__rspack_import_0/* .field */.Z)(lengthOrField.size, "default", (value, { littleEndian }) => {
            if (lengthOrField.type === "default") {
                const lengthBuffer = lengthOrField.serialize(value.length, {
                    littleEndian,
                });
                if (value.length === 0) {
                    return lengthBuffer;
                }
                const result = new Uint8Array(lengthBuffer.length + value.length);
                result.set(lengthBuffer, 0);
                result.set(value, lengthBuffer.length);
                return result;
            }
            else {
                const result = new Uint8Array(lengthOrField.size + value.length);
                lengthOrField.serialize(value.length, {
                    buffer: result,
                    index: 0,
                    littleEndian,
                });
                result.set(value, lengthOrField.size);
                return result;
            }
        }, deserialize, { init });
    }
    // Reference existing length field
    if (typeof lengthOrField === "string") {
        let deserialize;
        let init;
        if (converter) {
            deserialize = function* (then, reader, { dependencies }) {
                const length = dependencies[lengthOrField];
                const array = length !== 0 ? reader.readExactly(length) : EmptyUint8Array;
                return converter.convert(yield* then(array));
            };
            init = (value, dependencies) => {
                const array = converter.back(value);
                dependencies[lengthOrField] = array.length;
                return array;
            };
        }
        else {
            // eslint-disable-next-line require-yield
            deserialize = function* (_then, reader, { dependencies }) {
                const length = dependencies[lengthOrField];
                const array = length !== 0 ? reader.readExactly(length) : EmptyUint8Array;
                return array;
            };
            init = (value, dependencies) => {
                const array = value;
                dependencies[lengthOrField] = array.length;
                return array;
            };
        }
        return (0,_field_index_js__rspack_import_0/* .field */.Z)(0, "default", (source) => source, deserialize, { init });
    }
    let deserialize;
    let init;
    // Reference existing length field + length converter
    if (converter) {
        deserialize = function* (then, reader, { dependencies }) {
            const rawLength = dependencies[lengthOrField.field];
            const length = lengthOrField.convert(rawLength);
            const array = length !== 0 ? reader.readExactly(length) : EmptyUint8Array;
            return converter.convert(yield* then(array));
        };
        init = (value, dependencies) => {
            const array = converter.back(value);
            dependencies[lengthOrField.field] = lengthOrField.back(array.length);
            return array;
        };
    }
    else {
        // eslint-disable-next-line require-yield
        deserialize = function* (_then, reader, { dependencies }) {
            const rawLength = dependencies[lengthOrField.field];
            const length = lengthOrField.convert(rawLength);
            const array = length !== 0 ? reader.readExactly(length) : EmptyUint8Array;
            return array;
        };
        init = (value, dependencies) => {
            const array = value;
            dependencies[lengthOrField.field] = lengthOrField.back(array.length);
            return array;
        };
    }
    return (0,_field_index_js__rspack_import_0/* .field */.Z)(0, "default", (source) => source, deserialize, { init });
}
//# sourceMappingURL=buffer.js.map

},
"../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/extend.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  X: () => (extend)
});
/* import */ var _struct_js__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/struct.js");

/* #__NO_SIDE_EFFECTS__ */
function extend(base, fields, options) {
    return (0,_struct_js__rspack_import_0/* .struct */.w3)(Object.assign({}, base.fields, fields), {
        littleEndian: options?.littleEndian ?? base.littleEndian,
        extra: base.extra,
        postDeserialize: options?.postDeserialize,
    });
}
//# sourceMappingURL=extend.js.map

},
"../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/field/factory.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  Z: () => (/* binding */ factory_field)
});

// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/bipedal.js
var bipedal = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/bipedal.js");
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/field/serialize.js
/* Adapt default field serializer to universal field serializer */
function defaultFieldSerializer(serializer) {
    return (source, context) => {
        if ("buffer" in context) {
            const buffer = serializer(source, context);
            context.buffer.set(buffer, context.index);
            return buffer.length;
        }
        else {
            return serializer(source, context);
        }
    };
}
/* Adapt byob field serializer to universal field serializer */
function byobFieldSerializer(size, serializer) {
    return (source, context) => {
        if ("buffer" in context) {
            context.index ??= 0;
            serializer(source, context);
            return size;
        }
        else {
            const buffer = new Uint8Array(size);
            serializer(source, {
                buffer,
                index: 0,
                littleEndian: context.littleEndian,
            });
            return buffer;
        }
    };
}
//# sourceMappingURL=serialize.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/field/factory.js


/* #__NO_SIDE_EFFECTS__ */
// eslint-disable-next-line @typescript-eslint/max-params
function _field(size, type, serialize, deserialize, options) {
    const field = {
        size,
        type: type,
        serialize: type === "default"
            ? defaultFieldSerializer(serialize)
            : byobFieldSerializer(size, serialize),
        deserialize: (0,bipedal/* .bipedal */.q)(deserialize),
        omitInit: options?.omitInit,
    };
    if (options?.init) {
        field.init = options.init;
    }
    return field;
}
const factory_field = _field;
//# sourceMappingURL=factory.js.map

},
"../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/number.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  NX: () => (/* binding */ u16),
  DH: () => (/* binding */ u32),
  u8: () => (/* binding */ u8),
  _l: () => (/* binding */ u64)
});

// UNUSED EXPORTS: s16, s32, s64, s8

;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+no-data-view@2.0.0/node_modules/@yume-chan/no-data-view/esm/int8.js
/* #__NO_SIDE_EFFECTS__ */
function getInt8(buffer, offset) {
    return (buffer[offset] << 24) >> 24;
}
//# sourceMappingURL=int8.js.map
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+no-data-view@2.0.0/node_modules/@yume-chan/no-data-view/esm/uint16.js
var uint16 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+no-data-view@2.0.0/node_modules/@yume-chan/no-data-view/esm/uint16.js");
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+no-data-view@2.0.0/node_modules/@yume-chan/no-data-view/esm/int16.js
var int16 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+no-data-view@2.0.0/node_modules/@yume-chan/no-data-view/esm/int16.js");
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+no-data-view@2.0.0/node_modules/@yume-chan/no-data-view/esm/uint32.js
var uint32 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+no-data-view@2.0.0/node_modules/@yume-chan/no-data-view/esm/uint32.js");
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+no-data-view@2.0.0/node_modules/@yume-chan/no-data-view/esm/int32.js
/* #__NO_SIDE_EFFECTS__ */
function getInt32LittleEndian(buffer, offset) {
    return (buffer[offset] |
        (buffer[offset + 1] << 8) |
        (buffer[offset + 2] << 16) |
        (buffer[offset + 3] << 24));
}
/* #__NO_SIDE_EFFECTS__ */
function getInt32BigEndian(buffer, offset) {
    return ((buffer[offset] << 24) |
        (buffer[offset + 1] << 16) |
        (buffer[offset + 2] << 8) |
        buffer[offset + 3]);
}
/* #__NO_SIDE_EFFECTS__ */
function getInt32(buffer, offset, littleEndian) {
    return littleEndian
        ? buffer[offset] |
            (buffer[offset + 1] << 8) |
            (buffer[offset + 2] << 16) |
            (buffer[offset + 3] << 24)
        : (buffer[offset] << 24) |
            (buffer[offset + 1] << 16) |
            (buffer[offset + 2] << 8) |
            buffer[offset + 3];
}
function setInt32LittleEndian(buffer, offset, value) {
    buffer[offset] = value;
    buffer[offset + 1] = value >> 8;
    buffer[offset + 2] = value >> 16;
    buffer[offset + 3] = value >> 24;
}
function setInt32BigEndian(buffer, offset, value) {
    buffer[offset] = value >> 24;
    buffer[offset + 1] = value >> 16;
    buffer[offset + 2] = value >> 8;
    buffer[offset + 3] = value;
}
function setInt32(buffer, offset, value, littleEndian) {
    if (littleEndian) {
        buffer[offset] = value;
        buffer[offset + 1] = value >> 8;
        buffer[offset + 2] = value >> 16;
        buffer[offset + 3] = value >> 24;
    }
    else {
        buffer[offset] = value >> 24;
        buffer[offset + 1] = value >> 16;
        buffer[offset + 2] = value >> 8;
        buffer[offset + 3] = value;
    }
}
//# sourceMappingURL=int32.js.map
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+no-data-view@2.0.0/node_modules/@yume-chan/no-data-view/esm/uint64.js
var uint64 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+no-data-view@2.0.0/node_modules/@yume-chan/no-data-view/esm/uint64.js");
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+no-data-view@2.0.0/node_modules/@yume-chan/no-data-view/esm/int64.js
/* #__NO_SIDE_EFFECTS__ */
function getInt64LittleEndian(buffer, offset) {
    return (BigInt(buffer[offset]) |
        (BigInt(buffer[offset + 1]) << 8n) |
        (BigInt(buffer[offset + 2]) << 16n) |
        (BigInt(buffer[offset + 3]) << 24n) |
        (BigInt(buffer[offset + 4]) << 32n) |
        (BigInt(buffer[offset + 5]) << 40n) |
        (BigInt(buffer[offset + 6]) << 48n) |
        (BigInt(buffer[offset + 7] << 24) << 32n));
}
/* #__NO_SIDE_EFFECTS__ */
function getInt64BigEndian(buffer, offset) {
    return ((BigInt(buffer[offset] << 24) << 32n) |
        (BigInt(buffer[offset + 1]) << 48n) |
        (BigInt(buffer[offset + 2]) << 40n) |
        (BigInt(buffer[offset + 3]) << 32n) |
        (BigInt(buffer[offset + 4]) << 24n) |
        (BigInt(buffer[offset + 5]) << 16n) |
        (BigInt(buffer[offset + 6]) << 8n) |
        BigInt(buffer[offset + 7]));
}
/* #__NO_SIDE_EFFECTS__ */
function getInt64(buffer, offset, littleEndian) {
    return littleEndian
        ? BigInt(buffer[offset]) |
            (BigInt(buffer[offset + 1]) << 8n) |
            (BigInt(buffer[offset + 2]) << 16n) |
            (BigInt(buffer[offset + 3]) << 24n) |
            (BigInt(buffer[offset + 4]) << 32n) |
            (BigInt(buffer[offset + 5]) << 40n) |
            (BigInt(buffer[offset + 6]) << 48n) |
            (BigInt(buffer[offset + 7] << 24) << 32n)
        : (BigInt(buffer[offset] << 24) << 32n) |
            (BigInt(buffer[offset + 1]) << 48n) |
            (BigInt(buffer[offset + 2]) << 40n) |
            (BigInt(buffer[offset + 3]) << 32n) |
            (BigInt(buffer[offset + 4]) << 24n) |
            (BigInt(buffer[offset + 5]) << 16n) |
            (BigInt(buffer[offset + 6]) << 8n) |
            BigInt(buffer[offset + 7]);
}
function setInt64LittleEndian(buffer, offset, value) {
    buffer[offset] = Number(value & 0xffn);
    buffer[offset + 1] = Number((value >> 8n) & 0xffn);
    buffer[offset + 2] = Number((value >> 16n) & 0xffn);
    buffer[offset + 3] = Number((value >> 24n) & 0xffn);
    buffer[offset + 4] = Number((value >> 32n) & 0xffn);
    buffer[offset + 5] = Number((value >> 40n) & 0xffn);
    buffer[offset + 6] = Number((value >> 48n) & 0xffn);
    buffer[offset + 7] = Number((value >> 56n) & 0xffn);
}
function setInt64BigEndian(buffer, offset, value) {
    buffer[offset] = Number((value >> 56n) & 0xffn);
    buffer[offset + 1] = Number((value >> 48n) & 0xffn);
    buffer[offset + 2] = Number((value >> 40n) & 0xffn);
    buffer[offset + 3] = Number((value >> 32n) & 0xffn);
    buffer[offset + 4] = Number((value >> 24n) & 0xffn);
    buffer[offset + 5] = Number((value >> 16n) & 0xffn);
    buffer[offset + 6] = Number((value >> 8n) & 0xffn);
    buffer[offset + 7] = Number(value & 0xffn);
}
function setInt64(buffer, offset, value, littleEndian) {
    if (littleEndian) {
        buffer[offset] = Number(value & 0xffn);
        buffer[offset + 1] = Number((value >> 8n) & 0xffn);
        buffer[offset + 2] = Number((value >> 16n) & 0xffn);
        buffer[offset + 3] = Number((value >> 24n) & 0xffn);
        buffer[offset + 4] = Number((value >> 32n) & 0xffn);
        buffer[offset + 5] = Number((value >> 40n) & 0xffn);
        buffer[offset + 6] = Number((value >> 48n) & 0xffn);
        buffer[offset + 7] = Number((value >> 56n) & 0xffn);
    }
    else {
        buffer[offset] = Number((value >> 56n) & 0xffn);
        buffer[offset + 1] = Number((value >> 48n) & 0xffn);
        buffer[offset + 2] = Number((value >> 40n) & 0xffn);
        buffer[offset + 3] = Number((value >> 32n) & 0xffn);
        buffer[offset + 4] = Number((value >> 24n) & 0xffn);
        buffer[offset + 5] = Number((value >> 16n) & 0xffn);
        buffer[offset + 6] = Number((value >> 8n) & 0xffn);
        buffer[offset + 7] = Number(value & 0xffn);
    }
}
//# sourceMappingURL=int64.js.map
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/field/factory.js + 1 modules
var factory = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/field/factory.js");
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/number.js


/* #__NO_SIDE_EFFECTS__ */
function number(size, serialize, deserialize) {
    const fn = (() => fn);
    Object.assign(fn, (0,factory/* .field */.Z)(size, "byob", serialize, deserialize));
    return fn;
}
const u8 = number(1, (value, { buffer, index }) => {
    buffer[index] = value;
}, function* (then, reader) {
    const data = yield* then(reader.readExactly(1));
    return data[0];
});
const s8 = number(1, (value, { buffer, index }) => {
    buffer[index] = value;
}, function* (then, reader) {
    const data = yield* then(reader.readExactly(1));
    return getInt8(data, 0);
});
const u16 = number(2, (value, { buffer, index, littleEndian }) => {
    (0,uint16/* .setUint16 */.An)(buffer, index, value, littleEndian);
}, function* (then, reader, { littleEndian }) {
    const data = yield* then(reader.readExactly(2));
    return (0,uint16/* .getUint16 */.G2)(data, 0, littleEndian);
});
const s16 = number(2, (value, { buffer, index, littleEndian }) => {
    (0,int16/* .setInt16 */.f2)(buffer, index, value, littleEndian);
}, function* (then, reader, { littleEndian }) {
    const data = yield* then(reader.readExactly(2));
    return (0,int16/* .getInt16 */.T8)(data, 0, littleEndian);
});
const u32 = number(4, (value, { buffer, index, littleEndian }) => {
    (0,uint32/* .setUint32 */.ub)(buffer, index, value, littleEndian);
}, function* (then, reader, { littleEndian }) {
    const data = yield* then(reader.readExactly(4));
    return (0,uint32/* .getUint32 */.Qg)(data, 0, littleEndian);
});
const s32 = number(4, (value, { buffer, index, littleEndian }) => {
    setInt32(buffer, index, value, littleEndian);
}, function* (then, reader, { littleEndian }) {
    const data = yield* then(reader.readExactly(4));
    return getInt32(data, 0, littleEndian);
});
const u64 = number(8, (value, { buffer, index, littleEndian }) => {
    (0,uint64/* .setUint64 */.X3)(buffer, index, value, littleEndian);
}, function* (then, reader, { littleEndian }) {
    const data = yield* then(reader.readExactly(8));
    return (0,uint64/* .getUint64 */.Hn)(data, 0, littleEndian);
});
const s64 = number(8, (value, { buffer, index, littleEndian }) => {
    setInt64(buffer, index, value, littleEndian);
}, function* (then, reader, { littleEndian }) {
    const data = yield* then(reader.readExactly(8));
    return getInt64(data, 0, littleEndian);
});
//# sourceMappingURL=number.js.map

},
"../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/readable.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  s: () => (ExactReadableEndedError)
});
// TODO: allow over reading (returning a `Uint8Array`, an `offset` and a `length`) to avoid copying
class ExactReadableEndedError extends Error {
    constructor() {
        super("ExactReadable ended");
    }
}
class Uint8ArrayExactReadable {
    #data;
    #position;
    get position() {
        return this.#position;
    }
    constructor(data) {
        this.#data = data;
        this.#position = 0;
    }
    readExactly(length) {
        if (this.#position + length > this.#data.length) {
            throw new ExactReadableEndedError();
        }
        const result = this.#data.subarray(this.#position, this.#position + length);
        this.#position += length;
        return result;
    }
}
//# sourceMappingURL=readable.js.map

},
"../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/string.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  Y: () => (string)
});
/* import */ var _buffer_js__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/buffer.js");
/* import */ var _utils_js__rspack_import_1 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/utils.js");


// Prettier will move the annotation and make it invalid
// prettier-ignore
const string = ( /* #__NO_SIDE_EFFECTS__ */(lengthOrField) => {
    const field = (0,_buffer_js__rspack_import_0/* .buffer */.r)(lengthOrField, {
        convert: _utils_js__rspack_import_1/* .decodeUtf8 */._6,
        back: _utils_js__rspack_import_1/* .encodeUtf8 */.Af,
    });
    field.as = () => field;
    return field;
});
//# sourceMappingURL=string.js.map

},
"../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/struct.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  r1: () => (StructEmptyError),
  w3: () => (struct)
});
/* import */ var _bipedal_js__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/bipedal.js");
/* import */ var _readable_js__rspack_import_1 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/readable.js");


class StructDeserializeError extends Error {
    constructor(message) {
        super(message);
    }
}
class StructNotEnoughDataError extends StructDeserializeError {
    constructor() {
        super("The underlying readable was ended before the struct was fully deserialized");
    }
}
class StructEmptyError extends StructDeserializeError {
    constructor() {
        super("The underlying readable doesn't contain any more struct");
    }
}
/* #__NO_SIDE_EFFECTS__ */
function struct(fields, options) {
    const fieldList = Object.entries(fields);
    let size = 0;
    let byob = true;
    for (const [, field] of fieldList) {
        size += field.size;
        if (byob && field.type !== "byob") {
            byob = false;
        }
    }
    const littleEndian = options.littleEndian;
    const extra = options.extra
        ? Object.getOwnPropertyDescriptors(options.extra)
        : undefined;
    return {
        littleEndian,
        fields,
        extra: options.extra,
        type: byob ? "byob" : "default",
        size,
        serialize(source, bufferOrContext) {
            const temp = { ...source };
            for (const [key, field] of fieldList) {
                if (key in temp && "init" in field) {
                    const result = field.init?.(temp[key], temp);
                    temp[key] = result;
                }
            }
            const sizes = new Array(fieldList.length);
            const buffers = new Array(fieldList.length);
            {
                const context = { littleEndian };
                for (const [index, [key, field]] of fieldList.entries()) {
                    if (field.type === "byob") {
                        sizes[index] = field.size;
                    }
                    else {
                        buffers[index] = field.serialize(temp[key], context);
                        sizes[index] = buffers[index].length;
                    }
                }
            }
            const size = sizes.reduce((sum, size) => sum + size, 0);
            let externalBuffer;
            let buffer;
            let index;
            if (bufferOrContext instanceof Uint8Array) {
                if (bufferOrContext.length < size) {
                    throw new Error("Buffer too small");
                }
                externalBuffer = true;
                buffer = bufferOrContext;
                index = 0;
            }
            else if (typeof bufferOrContext === "object" &&
                "buffer" in bufferOrContext) {
                externalBuffer = true;
                buffer = bufferOrContext.buffer;
                index = bufferOrContext.index ?? 0;
                if (buffer.length - index < size) {
                    throw new Error("Buffer too small");
                }
            }
            else {
                externalBuffer = false;
                buffer = new Uint8Array(size);
                index = 0;
            }
            const context = {
                buffer,
                index,
                littleEndian,
            };
            for (const [index, [key, field]] of fieldList.entries()) {
                if (buffers[index]) {
                    buffer.set(buffers[index], context.index);
                }
                else {
                    field.serialize(temp[key], context);
                }
                context.index += sizes[index];
            }
            if (externalBuffer) {
                return size;
            }
            else {
                return buffer;
            }
        },
        deserialize: (0,_bipedal_js__rspack_import_0/* .bipedal */.q)(function* (then, reader) {
            const startPosition = reader.position;
            const result = {};
            const context = {
                dependencies: result,
                littleEndian: littleEndian,
            };
            try {
                for (const [key, field] of fieldList) {
                    result[key] = yield* then(field.deserialize(reader, context));
                }
            }
            catch (e) {
                if (!(e instanceof _readable_js__rspack_import_1/* .ExactReadableEndedError */.s)) {
                    throw e;
                }
                if (reader.position === startPosition) {
                    throw new StructEmptyError();
                }
                else {
                    throw new StructNotEnoughDataError();
                }
            }
            if (extra) {
                Object.defineProperties(result, extra);
            }
            if (options.postDeserialize) {
                return options.postDeserialize.call(result, result);
            }
            else {
                return result;
            }
        }),
    };
}
//# sourceMappingURL=struct.js.map

},
"../../node_modules/.pnpm/@yume-chan+struct@2.3.2/node_modules/@yume-chan/struct/esm/utils.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  Af: () => (encodeUtf8),
  Ay: () => (TextDecoder),
  _6: () => (decodeUtf8)
});
// This library can't use `@types/node` or `lib: dom`
// because they will pollute the global scope
// So `TextEncoder` and `TextDecoder` types are not available
const { TextEncoder, TextDecoder } = globalThis;
const SharedEncoder = /* #__PURE__ */ new TextEncoder();
const SharedDecoder = /* #__PURE__ */ new TextDecoder();
/* #__NO_SIDE_EFFECTS__ */
function encodeUtf8(input) {
    return SharedEncoder.encode(input);
}
/* #__NO_SIDE_EFFECTS__ */
function decodeUtf8(buffer) {
    // `TextDecoder` has internal states in stream mode,
    // but this method is not for stream mode, so the instance can be reused
    return SharedDecoder.decode(buffer);
}
//# sourceMappingURL=utils.js.map

},

};
;