"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 = ["501"];
exports.modules = {
"../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/base/control-message-type.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  R: () => (ScrcpyControlMessageType)
});
// Their IDs change between versions, so always use `options.getControlMessageTypes()`
const ScrcpyControlMessageType = {
    InjectKeyCode: 0,
    InjectText: 1,
    InjectTouch: 2,
    InjectScroll: 3,
    BackOrScreenOn: 4,
    ExpandNotificationPanel: 5,
    ExpandSettingPanel: 6,
    CollapseNotificationPanel: 7,
    GetClipboard: 8,
    SetClipboard: 9,
    SetDisplayPower: 10,
    RotateDevice: 11,
    UHidCreate: 12,
    UHidInput: 13,
    UHidDestroy: 14,
    OpenHardKeyboardSettings: 15,
    StartApp: 16,
    ResetVideo: 17,
};
//# sourceMappingURL=control-message-type.js.map

},
"../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/base/option-value.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  M: () => (toScrcpyOptionValue)
});
function isScrcpyOptionValue(value) {
    return (typeof value === "object" &&
        value !== null &&
        "toOptionValue" in value &&
        typeof value.toOptionValue === "function");
}
function toScrcpyOptionValue(value, empty) {
    if (isScrcpyOptionValue(value)) {
        value = value.toOptionValue();
    }
    // `value` may become `undefined` after `toOptionValue`
    if (value === undefined) {
        return empty;
    }
    if (typeof value !== "string" &&
        typeof value !== "number" &&
        typeof value !== "boolean") {
        throw new TypeError(`Invalid option value: ${JSON.stringify(value)}`);
    }
    return value.toString();
}
//# sourceMappingURL=option-value.js.map

},
"../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/base/video.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  n: () => (ScrcpyVideoCodecId)
});
const ScrcpyVideoCodecId = {
    H264: 0x68_32_36_34,
    H265: 0x68_32_36_35,
    AV1: 0x00_61_76_31,
};
const ScrcpyVideoCodecNameMap = /* #__PURE__ */ (/* unused pure expression or super */ null && ((() => {
    const result = new Map();
    for (const key in ScrcpyVideoCodecId) {
        const value = ScrcpyVideoCodecId[key];
        result.set(value, key);
    }
    return result;
})()));
//# sourceMappingURL=video.js.map

},
"../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/control/empty.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  i: () => (EmptyControlMessage)
});
/* import */ var _yume_chan_struct__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/struct.js");
/* import */ var _yume_chan_struct__rspack_import_1 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/number.js");

const EmptyControlMessage = (0,_yume_chan_struct__rspack_import_0/* .struct */.w3)({ type: _yume_chan_struct__rspack_import_1.u8 }, { littleEndian: false });
//# sourceMappingURL=empty.js.map

},
"../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/index.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  DefaultServerPath: () => (/* reexport */ constants/* .DefaultServerPath */.G),
  ScrcpyOptions3_1: () => (/* reexport */ ScrcpyOptions3_1)
});

// UNUSED EXPORTS: ScrcpyOptions1_21, Av1, h264SearchConfiguration, getSubHeightC, ScrcpyOptionsLatest, ScrcpyUHidCreateControlMessage, ScrcpyControlMessageSerializer, ScrcpyCaptureOrientation, ScrcpyOptions1_17Impl, ScrcpyUHidOutputDeviceMessage, ScrcpyControlMessageWriter, ScrcpyOptions1_22Impl, ScrcpyOptions3_0, NaluSodbBitReader, AndroidHevcProfile, ScrcpyOptions1_15, ScrcpyOptionsLatestImpl, h265ParseVideoParameterSet, ScrcpyOptions1_21Impl, AndroidAv1Profile, ScrcpyInjectTouchControlMessage, ScrcpyVideoCodecId, h265SearchConfiguration, ScrcpyOptions1_15_1Impl, ScrcpyOptions1_18, ScrcpyOptions2_2, ScrcpyOptions1_24, ScrcpyOptions2_6_1Impl, ScrcpyOptions2_2Impl, ScrcpyOptions1_17, ScrcpyOptions2_7Impl, getSubWidthC, h264ParseSequenceParameterSet, ScrcpyOptions2_3, ScrcpyOptions1_15_1, ScrcpyOptions2_5, ScrcpyOptions2_6, h265ParseConfiguration, ScrcpyOptions1_23, ScrcpyOptions1_18Impl, h265ParseSps3dExtension, h265ParseSequenceParameterSet, ScrcpyOptions2_6Impl, isScrcpyOptionValue, AndroidScreenPowerMode, ScrcpyAudioCodec, ScrcpyOptions1_25Impl, ScrcpyPointerId, AndroidMotionEventAction, AndroidAv1Level, ScrcpyNewDisplay, AndroidKeyEventMeta, clamp, ScrcpyBackOrScreenOnControlMessage, ScrcpyOptions1_22, ScrcpyOptions3_0Impl, ScrcpyOptions1_19Impl, omit, ScrcpyLockOrientation, ScrcpyOptions2_4Impl, ScrcpyInjectTextControlMessage, ScrcpyInstanceId, ScrcpyOptions2_0Impl, ScrcpyOptions2_3_1, ScrcpyOptions2_0, AndroidHevcLevel, AndroidAvcLevel, ScrcpyCodecOptions, ScrcpyOptions1_20Impl, ScrcpyOptions2_7, ScrcpyOptions3_0_1, ScrcpyOptions1_19, AndroidKeyNames, AndroidKeyEventAction, ScrcpyVideoCodecNameMap, ScrcpyOptions2_6_1, h265ParseShortTermReferencePictureSet, EmptyControlMessage, ScrcpyControlMessageType, AndroidMotionEventButton, h265ParseSubLayerHrdParameters, ScrcpyOptions3_0_1Impl, ScrcpyOptionsWrapper, h265ParseSpsMultilayerExtension, ScrcpyOptions2_1, ScrcpyOptions1_16, AndroidAvcProfile, ScrcpyOptions3_0_2Impl, ScrcpyInjectKeyCodeControlMessage, ScrcpyOrientation, ScrcpyOptions1_15Impl, ScrcpySetClipboardControlMessage, annexBSplitNalu, ScrcpyOptions1_20, ScrcpyOptions2_1_1Impl, h265ParseScalingListData, h264ParseConfiguration, h265ParseHrdParameters, ScrcpySetDisplayPowerControlMessage, ScrcpyControlMessageTypeMap, h265ParseVuiParameters, ScrcpyOptions2_4, ScrcpyOptions1_25, ScrcpyOptions1_24Impl, ScrcpyOptions2_5Impl, ScrcpyOptions3_1Impl, h265ParseNaluHeader, ScrcpyOptions1_16Impl, ScrcpyCrop, ScrcpyOptions2_3Impl, ScrcpyOptions2_1_1, ScrcpyOptions3_0_2, ScrcpyOptions1_23Impl, ScrcpyOptions2_1Impl, toScrcpyOptionValue, ScrcpyOptions2_3_1Impl, ScrcpyInjectScrollControlMessage, AndroidKeyCode

;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/utils/omit.js
/* #__NO_SIDE_EFFECTS__ */
function omit(value, ...keys) {
    return Object.fromEntries(Object.entries(value).filter(([key]) => !keys.includes(key)));
}
//# sourceMappingURL=omit.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/1_18/impl/init.js
const VideoOrientation = {
    Initial: -2,
    Unlocked: -1,
    Portrait: 0,
    Landscape: 1,
    PortraitFlipped: 2,
    LandscapeFlipped: 3,
};
//# sourceMappingURL=init.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/1_15/impl/init.js
const init_VideoOrientation = {
    Unlocked: -1,
    Portrait: 0,
    Landscape: 1,
    PortraitFlipped: 2,
    LandscapeFlipped: 3,
};
function toDashCase(input) {
    return input.replace(/([A-Z])/g, "-$1").toLowerCase();
}
const CodecOptionTypes = {
    repeatPreviousFrameAfter: "long",
    maxPtsGapToEncoder: "long",
};
class CodecOptions {
    static Empty = /* #__PURE__ */ new CodecOptions();
    options;
    constructor(options = {}) {
        for (const [key, value] of Object.entries(options)) {
            if (value === undefined) {
                continue;
            }
            if (typeof value !== "number") {
                throw new Error(`Invalid option value for ${key}: ${String(value)}`);
            }
        }
        this.options = options;
    }
    toOptionValue() {
        const entries = Object.entries(this.options).filter(([, value]) => value !== undefined);
        if (entries.length === 0) {
            return undefined;
        }
        return entries
            .map(([key, value]) => {
            let result = toDashCase(key);
            const type = CodecOptionTypes[key];
            if (type) {
                result += `:${type}`;
            }
            result += `=${value}`;
            return result;
        })
            .join(",");
    }
}
class Crop {
    width;
    height;
    x;
    y;
    constructor(width, height, x, y) {
        this.width = width;
        this.height = height;
        this.x = x;
        this.y = y;
    }
    toOptionValue() {
        return `${this.width}:${this.height}:${this.x}:${this.y}`;
    }
}
//# sourceMappingURL=init.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/1_15/impl/defaults.js

const Defaults = /* #__PURE__ */ (() => ({
    logLevel: "debug",
    maxSize: 0,
    bitRate: 8_000_000,
    maxFps: 0,
    lockVideoOrientation: init_VideoOrientation.Unlocked,
    tunnelForward: false,
    crop: undefined,
    sendFrameMeta: true,
    control: true,
    displayId: 0,
    showTouches: false,
    stayAwake: false,
    codecOptions: undefined,
}))();
//# sourceMappingURL=defaults.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/1_17/impl/defaults.js

const defaults_Defaults = /* #__PURE__ */ (() => ({
    ...Defaults,
    encoderName: undefined,
}))();
//# sourceMappingURL=defaults.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/1_18/impl/defaults.js


const impl_defaults_Defaults = /* #__PURE__ */ (() => ({
    ...defaults_Defaults,
    logLevel: "debug",
    lockVideoOrientation: VideoOrientation.Unlocked,
    powerOffOnClose: false,
}))();
//# sourceMappingURL=defaults.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/1_21/impl/defaults.js

const _1_21_impl_defaults_Defaults = /* #__PURE__ */ (() => ({
    ...impl_defaults_Defaults,
    clipboardAutosync: true,
}))();
//# sourceMappingURL=defaults.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/1_22/impl/defaults.js

const _1_22_impl_defaults_Defaults = /* #__PURE__ */ (() => ({
    ..._1_21_impl_defaults_Defaults,
    downsizeOnError: true,
    sendDeviceMeta: true,
    sendDummyByte: true,
}))();
//# sourceMappingURL=defaults.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/1_23/impl/defaults.js

const _1_23_impl_defaults_Defaults = /* #__PURE__ */ (() => ({
    ..._1_22_impl_defaults_Defaults,
    cleanup: true,
}))();
//# sourceMappingURL=defaults.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/1_24/impl/defaults.js

const _1_24_impl_defaults_Defaults = /* #__PURE__ */ (() => ({
    ..._1_23_impl_defaults_Defaults,
    powerOn: true,
}))();
//# sourceMappingURL=defaults.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/2_0/impl/defaults.js


const _2_0_impl_defaults_Defaults = /* #__PURE__ */ (() => ({
    ...omit(_1_24_impl_defaults_Defaults, "bitRate", "codecOptions", "encoderName"),
    scid: undefined,
    videoCodec: "h264",
    videoBitRate: 8000000,
    videoCodecOptions: undefined,
    videoEncoder: undefined,
    audio: true,
    audioCodec: "opus",
    audioBitRate: 128000,
    audioCodecOptions: undefined,
    audioEncoder: undefined,
    listEncoders: false,
    listDisplays: false,
    sendCodecMeta: true,
}))();
//# sourceMappingURL=defaults.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/2_1/impl/defaults.js

const _2_1_impl_defaults_Defaults = /* #__PURE__ */ (() => ({
    ..._2_0_impl_defaults_Defaults,
    video: true,
    audioSource: "output",
}))();
//# sourceMappingURL=defaults.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/2_2/impl/defaults.js

const _2_2_impl_defaults_Defaults = /* #__PURE__ */ (() => ({
    ..._2_1_impl_defaults_Defaults,
    videoSource: "display",
    displayId: 0,
    cameraId: undefined,
    cameraSize: undefined,
    cameraFacing: undefined,
    cameraAr: undefined,
    cameraFps: undefined,
    cameraHighSpeed: false,
    listCameras: false,
    listCameraSizes: false,
}))();
//# sourceMappingURL=defaults.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/2_6/impl/defaults.js

const _2_6_impl_defaults_Defaults = /* #__PURE__ */ (() => ({
    ..._2_2_impl_defaults_Defaults,
    audioDup: false,
}))();
//# sourceMappingURL=defaults.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/3_0/impl/defaults.js


const _3_0_impl_defaults_Defaults = /* #__PURE__ */ (() => ({
    ...omit(_2_6_impl_defaults_Defaults, "lockVideoOrientation"),
    captureOrientation: undefined,
    angle: 0,
    screenOffTimeout: undefined,
    listApps: false,
    newDisplay: undefined,
    vdSystemDecorations: true,
}))();
//# sourceMappingURL=defaults.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/3_1/impl/defaults.js

const _3_1_impl_defaults_Defaults = /* #__PURE__ */ (() => ({
    ..._3_0_impl_defaults_Defaults,
    vdDestroyContent: false,
}))();
//# sourceMappingURL=defaults.js.map
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/base/control-message-type.js
var control_message_type = __webpack_require__("../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/base/control-message-type.js");
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/1_15/impl/control-message-types.js

const ControlMessageTypes = 
/* #__PURE__ */ (() => [
    /*  0 */ control_message_type/* .ScrcpyControlMessageType.InjectKeyCode */.R.InjectKeyCode,
    /*  1 */ control_message_type/* .ScrcpyControlMessageType.InjectText */.R.InjectText,
    /*  2 */ control_message_type/* .ScrcpyControlMessageType.InjectTouch */.R.InjectTouch,
    /*  3 */ control_message_type/* .ScrcpyControlMessageType.InjectScroll */.R.InjectScroll,
    /*  4 */ control_message_type/* .ScrcpyControlMessageType.BackOrScreenOn */.R.BackOrScreenOn,
    /*  5 */ control_message_type/* .ScrcpyControlMessageType.ExpandNotificationPanel */.R.ExpandNotificationPanel,
    /*  6 */ control_message_type/* .ScrcpyControlMessageType.CollapseNotificationPanel */.R.CollapseNotificationPanel,
    /*  7 */ control_message_type/* .ScrcpyControlMessageType.GetClipboard */.R.GetClipboard,
    /*  8 */ control_message_type/* .ScrcpyControlMessageType.SetClipboard */.R.SetClipboard,
    /*  9 */ control_message_type/* .ScrcpyControlMessageType.SetDisplayPower */.R.SetDisplayPower,
    /* 10 */ control_message_type/* .ScrcpyControlMessageType.RotateDevice */.R.RotateDevice,
])();
//# sourceMappingURL=control-message-types.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/1_18/impl/control-message-types.js


const control_message_types_ControlMessageTypes = 
/* #__PURE__ */ (() => {
    const result = ControlMessageTypes.slice();
    result.splice(6, 0, control_message_type/* .ScrcpyControlMessageType.ExpandSettingPanel */.R.ExpandSettingPanel);
    return result;
})();
//# sourceMappingURL=control-message-types.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/2_4/impl/control-message-types.js


const impl_control_message_types_ControlMessageTypes = 
/* #__PURE__ */ (() => [
    ...control_message_types_ControlMessageTypes,
    control_message_type/* .ScrcpyControlMessageType.UHidCreate */.R.UHidCreate,
    control_message_type/* .ScrcpyControlMessageType.UHidInput */.R.UHidInput,
    control_message_type/* .ScrcpyControlMessageType.OpenHardKeyboardSettings */.R.OpenHardKeyboardSettings,
])();
//# sourceMappingURL=control-message-types.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/2_7/impl/control-message-types.js


const _2_7_impl_control_message_types_ControlMessageTypes = 
/* #__PURE__ */ (() => {
    const result = impl_control_message_types_ControlMessageTypes.slice();
    result.splice(14, 0, control_message_type/* .ScrcpyControlMessageType.UHidDestroy */.R.UHidDestroy);
    return result;
})();
//# sourceMappingURL=control-message-types.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/3_0/impl/control-message-types.js


const _3_0_impl_control_message_types_ControlMessageTypes = 
/* #__PURE__ */ (() => [
    ..._2_7_impl_control_message_types_ControlMessageTypes,
    control_message_type/* .ScrcpyControlMessageType.StartApp */.R.StartApp,
    control_message_type/* .ScrcpyControlMessageType.ResetVideo */.R.ResetVideo,
])();
//# sourceMappingURL=control-message-types.js.map
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+stream-extra@1.0.0/node_modules/@yume-chan/stream-extra/esm/push-readable.js
var push_readable = __webpack_require__("../../node_modules/.pnpm/@yume-chan+stream-extra@1.0.0/node_modules/@yume-chan/stream-extra/esm/push-readable.js");
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/struct.js
var struct = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/struct.js");
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/string.js
var string = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/string.js");
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/number.js + 3 modules
var number = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/number.js");
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/1_15/impl/clipboard-stream.js


const ClipboardDeviceMessage = (0,struct/* .struct */.w3)({ content: (0,string/* .string */.Y)(number/* .u32 */.DH) }, { littleEndian: false });
class ClipboardStream extends push_readable/* .PushReadableStream */.F {
    #controller;
    constructor() {
        let controller;
        super((controller_) => {
            controller = controller_;
        });
        this.#controller = controller;
    }
    async parse(id, stream) {
        if (id === 0) {
            const message = await ClipboardDeviceMessage.deserialize(stream);
            await this.#controller.enqueue(message.content);
            return true;
        }
        return false;
    }
    close() {
        this.#controller.close();
    }
    error(e) {
        this.#controller.error(e);
    }
}
//# sourceMappingURL=clipboard-stream.js.map
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+async@4.1.3/node_modules/@yume-chan/async/esm/promise-resolver.js
var promise_resolver = __webpack_require__("../../node_modules/.pnpm/@yume-chan+async@4.1.3/node_modules/@yume-chan/async/esm/promise-resolver.js");
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/1_21/impl/set-clipboard.js


const AckClipboardDeviceMessage = (0,struct/* .struct */.w3)({ sequence: number/* .u64 */._l }, { littleEndian: false });
const SetClipboardControlMessage = (0,struct/* .struct */.w3)({
    type: number.u8,
    sequence: number/* .u64 */._l,
    paste: (0,number.u8)(),
    content: (0,string/* .string */.Y)(number/* .u32 */.DH),
}, { littleEndian: false });
class AckClipboardHandler {
    #resolvers = new Map();
    #closed = false;
    async parse(id, stream) {
        if (id !== 1) {
            return false;
        }
        const message = await AckClipboardDeviceMessage.deserialize(stream);
        const resolver = this.#resolvers.get(message.sequence);
        if (resolver) {
            resolver.resolve();
            this.#resolvers.delete(message.sequence);
        }
        return true;
    }
    close() {
        for (const resolver of this.#resolvers.values()) {
            resolver.reject();
        }
        this.#resolvers.clear();
        this.#closed = true;
    }
    error(e) {
        for (const resolver of this.#resolvers.values()) {
            resolver.reject(e);
        }
        this.#resolvers.clear();
        this.#closed = true;
    }
    serializeSetClipboardControlMessage(message) {
        if (message.sequence === 0n) {
            return SetClipboardControlMessage.serialize(message);
        }
        if (this.#closed) {
            throw new Error();
        }
        const resolver = new promise_resolver/* .PromiseResolver */.O();
        this.#resolvers.set(message.sequence, resolver);
        return [
            SetClipboardControlMessage.serialize(message),
            resolver.promise,
        ];
    }
}
//# sourceMappingURL=set-clipboard.js.map
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/buffer.js
var esm_buffer = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/buffer.js");
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/2_4/impl/uhid-output-stream.js


const UHidOutputDeviceMessage = (0,struct/* .struct */.w3)({
    id: number/* .u16 */.NX,
    data: (0,esm_buffer/* .buffer */.r)(number/* .u16 */.NX),
}, { littleEndian: false });
class UHidOutputStream extends push_readable/* .PushReadableStream */.F {
    #controller;
    constructor() {
        let controller;
        super((controller_) => {
            controller = controller_;
        });
        this.#controller = controller;
    }
    async parse(id, stream) {
        if (id !== 2) {
            return false;
        }
        const message = await UHidOutputDeviceMessage.deserialize(stream);
        await this.#controller.enqueue(message);
        return true;
    }
    close() {
        this.#controller.close();
    }
    error(e) {
        this.#controller.error(e);
    }
}
//# sourceMappingURL=uhid-output-stream.js.map
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/base/option-value.js
var option_value = __webpack_require__("../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/base/option-value.js");
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/1_21/impl/serialize.js

function toSnakeCase(input) {
    return input.replace(/([A-Z])/g, "_$1").toLowerCase();
}
// 1.21 changed the format of arguments
function serialize(options, defaults) {
    const result = [];
    for (const [key, value] of Object.entries(options)) {
        const serializedValue = (0,option_value/* .toScrcpyOptionValue */.M)(value, undefined);
        // v3.0 `new_display` option needs to send empty strings to server
        if (serializedValue === undefined) {
            continue;
        }
        const defaultValue = (0,option_value/* .toScrcpyOptionValue */.M)(defaults[key], undefined);
        if (serializedValue === defaultValue) {
            continue;
        }
        result.push(`${toSnakeCase(key)}=${serializedValue}`);
    }
    return result;
}
//# sourceMappingURL=serialize.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/2_0/impl/set-list-display.js
function setListDisplays(options) {
    options.listDisplays = true;
}
//# sourceMappingURL=set-list-display.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/2_2/impl/parse-display.js
function parseDisplay(line) {
    const match = line.match(/^\s+--display-id=(\d+)\s+\(([^)]+)\)$/);
    if (match) {
        const display = {
            id: Number.parseInt(match[1], 10),
        };
        if (match[2] !== "size unknown") {
            display.resolution = match[2];
        }
        return display;
    }
    return undefined;
}
//# sourceMappingURL=parse-display.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/2_0/impl/set-list-encoder.js
function setListEncoders(options) {
    options.listEncoders = true;
}
//# sourceMappingURL=set-list-encoder.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/3_0/impl/parse-encoder.js
const EncoderRegex = /^\s+--(video|audio)-codec=(\S+)\s+--\1-encoder=(\S+)(?:\s*\((sw|hw|hybrid)\))?(?:\s*\[vendor\])?(?:\s*\(alias for (\S+)\))?$/;
function toHardwareType(value) {
    switch (value) {
        case "sw":
            return "software";
        case "hw":
            return "hardware";
        case "hybrid":
            return "hybrid";
        default:
            throw new Error(`Unknown hardware type: ${value}`);
    }
}
function parseEncoder(line) {
    const match = line.match(EncoderRegex);
    return match
        ? {
            type: match[1],
            name: match[3],
            codec: match[2],
            hardwareType: match[4] ? toHardwareType(match[4]) : undefined,
            vendor: !!match[5],
            aliasFor: match[6],
        }
        : undefined;
}
//# sourceMappingURL=parse-encoder.js.map
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+stream-extra@1.0.0/node_modules/@yume-chan/stream-extra/esm/buffered.js
var esm_buffered = __webpack_require__("../../node_modules/.pnpm/@yume-chan+stream-extra@1.0.0/node_modules/@yume-chan/stream-extra/esm/buffered.js");
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/base/video.js
var video = __webpack_require__("../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/base/video.js");
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+no-data-view@1.0.0/node_modules/@yume-chan/no-data-view/esm/uint32.js
var uint32 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+no-data-view@1.0.0/node_modules/@yume-chan/no-data-view/esm/uint32.js");
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/utils.js
var utils = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/utils.js");
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/1_15/impl/parse-video-stream-metadata.js




/**
 * Parse a fixed-length, null-terminated string.
 * @param stream The stream to read from
 * @param maxLength The maximum length of the string, including the null terminator, in bytes
 * @returns The parsed string, without the null terminator
 */
async function readString(stream, maxLength) {
    const buffer = await stream.readExactly(maxLength);
    // If null terminator is not found, `subarray(0, -1)` will remove the last byte
    // But since it's a invalid case, it's fine
    return (0,utils/* .decodeUtf8 */._6)(buffer.subarray(0, buffer.indexOf(0)));
}
async function readU16(stream) {
    const buffer = await stream.readExactly(2);
    return getUint16BigEndian(buffer, 0);
}
async function readU32(stream) {
    const buffer = await stream.readExactly(4);
    return (0,uint32/* .getUint32BigEndian */.HI)(buffer, 0);
}
async function parseVideoStreamMetadata(stream) {
    const buffered = new BufferedReadableStream(stream);
    const metadata = {
        codec: ScrcpyVideoCodecId.H264,
    };
    metadata.deviceName = await readString(buffered, 64);
    metadata.width = await readU16(buffered);
    metadata.height = await readU16(buffered);
    return { stream: buffered.release(), metadata };
}
//# sourceMappingURL=parse-video-stream-metadata.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/2_0/impl/parse-video-stream-metadata.js



function toCodecId(codec) {
    switch (codec) {
        case "h264":
            return video/* .ScrcpyVideoCodecId.H264 */.n.H264;
        case "h265":
            return video/* .ScrcpyVideoCodecId.H265 */.n.H265;
        case "av1":
            return video/* .ScrcpyVideoCodecId.AV1 */.n.AV1;
        default:
            throw new Error(`Unknown video codec: ${codec}`);
    }
}
async function parseAsync(options, stream) {
    const buffered = new esm_buffered/* .BufferedReadableStream */.y(stream);
    // `sendDeviceMeta` now only contains device name,
    // can't use `super.parseVideoStreamMetadata` here
    let deviceName;
    if (options.sendDeviceMeta) {
        deviceName = await readString(buffered, 64);
    }
    let codec;
    let width;
    let height;
    if (options.sendCodecMeta) {
        codec = (await readU32(buffered));
        width = await readU32(buffered);
        height = await readU32(buffered);
    }
    else {
        codec = toCodecId(options.videoCodec);
    }
    return {
        stream: buffered.release(),
        metadata: { deviceName, codec, width, height },
    };
}
function parse_video_stream_metadata_parseVideoStreamMetadata(options, stream) {
    if (!options.sendDeviceMeta && !options.sendCodecMeta) {
        return {
            stream,
            metadata: { codec: toCodecId(options.videoCodec) },
        };
    }
    return parseAsync(options, stream);
}
//# sourceMappingURL=parse-video-stream-metadata.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/base/audio.js
class ScrcpyAudioCodec {
    static Opus = /* #__PURE__ */ new ScrcpyAudioCodec("opus", 0x6f_70_75_73, "audio/opus", "opus");
    static Aac = /* #__PURE__ */ new ScrcpyAudioCodec("aac", 0x00_61_61_63, "audio/aac", "mp4a.66");
    static Flac = /* #__PURE__ */ new ScrcpyAudioCodec("flac", 0x66_6c_61_63, "audio/flac", "flac");
    static Raw = /* #__PURE__ */ new ScrcpyAudioCodec("raw", 0x00_72_61_77, "audio/raw", "");
    optionValue;
    metadataValue;
    mimeType;
    webCodecId;
    constructor(optionValue, metadataValue, mimeType, webCodecId) {
        this.optionValue = optionValue;
        this.metadataValue = metadataValue;
        this.mimeType = mimeType;
        this.webCodecId = webCodecId;
    }
    toOptionValue() {
        return this.optionValue;
    }
}
//# sourceMappingURL=audio.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/2_0/impl/parse-audio-stream-metadata.js



async function parseAudioStreamMetadata(stream, options) {
    const buffered = new esm_buffered/* .BufferedReadableStream */.y(stream);
    const buffer = await buffered.readExactly(4);
    // Treat it as a 32-bit number for simpler comparisons
    const codecMetadataValue = (0,uint32/* .getUint32BigEndian */.HI)(buffer, 0);
    // Server will send `0x00_00_00_00` and `0x00_00_00_01` even if `sendCodecMeta` is false
    switch (codecMetadataValue) {
        case 0x00_00_00_00:
            return {
                type: "disabled",
            };
        case 0x00_00_00_01:
            return {
                type: "errored",
            };
    }
    if (options.sendCodecMeta) {
        let codec;
        switch (codecMetadataValue) {
            case ScrcpyAudioCodec.Raw.metadataValue:
                codec = ScrcpyAudioCodec.Raw;
                break;
            case ScrcpyAudioCodec.Opus.metadataValue:
                codec = ScrcpyAudioCodec.Opus;
                break;
            case ScrcpyAudioCodec.Aac.metadataValue:
                codec = ScrcpyAudioCodec.Aac;
                break;
            case ScrcpyAudioCodec.Flac.metadataValue:
                codec = ScrcpyAudioCodec.Flac;
                break;
            default:
                throw new Error(`Unknown audio codec metadata value: ${codecMetadataValue}`);
        }
        return {
            type: "success",
            codec,
            stream: buffered.release(),
        };
    }
    // Infer codec from `audioCodec` option
    let codec;
    switch (options.audioCodec) {
        case "raw":
            codec = ScrcpyAudioCodec.Raw;
            break;
        case "opus":
            codec = ScrcpyAudioCodec.Opus;
            break;
        case "aac":
            codec = ScrcpyAudioCodec.Aac;
            break;
        case "flac":
            codec = ScrcpyAudioCodec.Flac;
            break;
        default:
            throw new Error(`Unknown audio codec metadata value: ${codecMetadataValue}`);
    }
    return {
        type: "success",
        codec,
        stream: new push_readable/* .PushReadableStream */.F(async (controller) => {
            // Put the first 4 bytes back
            await controller.enqueue(buffer);
            const stream = buffered.release();
            const reader = stream.getReader();
            while (true) {
                const { done, value } = await reader.read();
                if (done) {
                    break;
                }
                await controller.enqueue(value);
            }
        }),
    };
}
//# sourceMappingURL=parse-audio-stream-metadata.js.map
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+stream-extra@1.0.0/node_modules/@yume-chan/stream-extra/esm/stream.js
var esm_stream = __webpack_require__("../../node_modules/.pnpm/@yume-chan+stream-extra@1.0.0/node_modules/@yume-chan/stream-extra/esm/stream.js");
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+stream-extra@1.0.0/node_modules/@yume-chan/stream-extra/esm/struct-deserialize.js + 1 modules
var struct_deserialize = __webpack_require__("../../node_modules/.pnpm/@yume-chan+stream-extra@1.0.0/node_modules/@yume-chan/stream-extra/esm/struct-deserialize.js");
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/1_15/impl/media-stream-transformer.js


const MediaStreamRawPacket = (0,struct/* .struct */.w3)({ pts: number/* .u64 */._l, data: (0,esm_buffer/* .buffer */.r)(number/* .u32 */.DH) }, { littleEndian: false });
const PtsConfig = 1n << 63n;
function createMediaStreamTransformer(options) {
    // Optimized path for video frames only
    if (!options.sendFrameMeta) {
        return new TransformStream({
            transform(chunk, controller) {
                controller.enqueue({
                    type: "data",
                    data: chunk,
                });
            },
        });
    }
    const deserializeStream = new StructDeserializeStream(MediaStreamRawPacket);
    return {
        writable: deserializeStream.writable,
        readable: deserializeStream.readable.pipeThrough(new TransformStream({
            transform(packet, controller) {
                if (packet.pts === PtsConfig) {
                    controller.enqueue({
                        type: "configuration",
                        data: packet.data,
                    });
                    return;
                }
                controller.enqueue({
                    type: "data",
                    pts: packet.pts,
                    data: packet.data,
                });
            },
        })),
    };
}
//# sourceMappingURL=media-stream-transformer.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/1_23/impl/media-stream-transformer.js


const PtsKeyframe = 1n << 62n;
function media_stream_transformer_createMediaStreamTransformer(options) {
    // Optimized path for video frames only
    if (!options.sendFrameMeta) {
        return new esm_stream/* .TransformStream */.Rv({
            transform(chunk, controller) {
                controller.enqueue({
                    type: "data",
                    data: chunk,
                });
            },
        });
    }
    const deserializeStream = new struct_deserialize/* .StructDeserializeStream */.f(MediaStreamRawPacket);
    return {
        writable: deserializeStream.writable,
        readable: deserializeStream.readable.pipeThrough(new esm_stream/* .TransformStream */.Rv({
            transform(packet, controller) {
                if (packet.pts === PtsConfig) {
                    controller.enqueue({
                        type: "configuration",
                        data: packet.data,
                    });
                    return;
                }
                if (packet.pts & PtsKeyframe) {
                    controller.enqueue({
                        type: "data",
                        keyframe: true,
                        pts: packet.pts & ~PtsKeyframe,
                        data: packet.data,
                    });
                    return;
                }
                controller.enqueue({
                    type: "data",
                    keyframe: false,
                    pts: packet.pts,
                    data: packet.data,
                });
            },
        })),
    };
}
//# sourceMappingURL=media-stream-transformer.js.map
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+no-data-view@1.0.0/node_modules/@yume-chan/no-data-view/esm/uint16.js
var uint16 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+no-data-view@1.0.0/node_modules/@yume-chan/no-data-view/esm/uint16.js");
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/bipedal.js
var bipedal = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/bipedal.js");
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/utils/clamp.js
function clamp(value, min, max) {
    if (value < min) {
        return min;
    }
    if (value > max) {
        return max;
    }
    return value;
}
//# sourceMappingURL=clamp.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/1_15/impl/inject-touch.js



const UnsignedFloat = {
    size: 2,
    serialize(value, { buffer, index, littleEndian }) {
        // https://github.com/Genymobile/scrcpy/blob/1f138aef41de651668043b32c4effc2d4adbfc44/app/src/util/binary.h#L51
        value = clamp(value, -1, 1);
        value = value === 1 ? 0xffff : value * 0x10000;
        (0,uint16/* .setUint16 */.An)(buffer, index, value, littleEndian);
    },
    deserialize: (0,bipedal/* .bipedal */.q)(function* (then, { reader, littleEndian }) {
        const data = yield* then(reader.readExactly(2));
        const value = (0,uint16/* .getUint16 */.G2)(data, 0, littleEndian);
        // https://github.com/Genymobile/scrcpy/blob/1f138aef41de651668043b32c4effc2d4adbfc44/server/src/main/java/com/genymobile/scrcpy/Binary.java#L22
        return value === 0xffff ? 1 : value / 0x10000;
    }),
};
const PointerId = (/* unused pure expression or super */ null && ({
    Mouse: -1n,
    Finger: -2n,
    VirtualMouse: -3n,
    VirtualFinger: -4n,
}));
const InjectTouchControlMessage = (0,struct/* .struct */.w3)({
    type: number.u8,
    action: (0,number.u8)(),
    pointerId: number/* .u64 */._l,
    pointerX: number/* .u32 */.DH,
    pointerY: number/* .u32 */.DH,
    screenWidth: number/* .u16 */.NX,
    screenHeight: number/* .u16 */.NX,
    pressure: UnsignedFloat,
    buttons: number/* .u32 */.DH,
}, { littleEndian: false });
function serializeInjectTouchControlMessage(message) {
    return InjectTouchControlMessage.serialize(message);
}
//# sourceMappingURL=inject-touch.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/2_0/impl/inject-touch.js



const inject_touch_InjectTouchControlMessage = /* #__PURE__ */ (() => (0,struct/* .struct */.w3)({
    type: (0,number.u8)(control_message_type/* .ScrcpyControlMessageType.InjectTouch */.R.InjectTouch),
    action: (0,number.u8)(),
    pointerId: number/* .u64 */._l,
    pointerX: number/* .u32 */.DH,
    pointerY: number/* .u32 */.DH,
    screenWidth: number/* .u16 */.NX,
    screenHeight: number/* .u16 */.NX,
    pressure: UnsignedFloat,
    actionButton: number/* .u32 */.DH,
    buttons: number/* .u32 */.DH,
}, { littleEndian: false }))();
function inject_touch_serializeInjectTouchControlMessage(message) {
    return inject_touch_InjectTouchControlMessage.serialize(message);
}
//# sourceMappingURL=inject-touch.js.map
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/control/empty.js
var empty = __webpack_require__("../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/control/empty.js");
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/1_15/impl/back-or-screen-on.js


const BackOrScreenOnControlMessage = empty/* .EmptyControlMessage */.i;
function serializeBackOrScreenOnControlMessage(message) {
    if (message.action === AndroidKeyEventAction.Down) {
        return BackOrScreenOnControlMessage.serialize(message);
    }
    return undefined;
}
//# sourceMappingURL=back-or-screen-on.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/1_18/impl/back-or-screen-on.js


const back_or_screen_on_BackOrScreenOnControlMessage = /* #__PURE__ */ (() => (0,struct/* .struct */.w3)({
    ...BackOrScreenOnControlMessage.fields,
    action: (0,number.u8)(),
}, { littleEndian: false }))();
function back_or_screen_on_serializeBackOrScreenOnControlMessage(message) {
    return back_or_screen_on_BackOrScreenOnControlMessage.serialize(message);
}
//# sourceMappingURL=back-or-screen-on.js.map
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+no-data-view@1.0.0/node_modules/@yume-chan/no-data-view/esm/int16.js
var int16 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+no-data-view@1.0.0/node_modules/@yume-chan/no-data-view/esm/int16.js");
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/1_25/impl/scroll-controller.js




const SignedFloat = {
    size: 2,
    serialize(value, { buffer, index, littleEndian }) {
        // https://github.com/Genymobile/scrcpy/blob/1f138aef41de651668043b32c4effc2d4adbfc44/app/src/util/binary.h#L51
        value = clamp(value, -1, 1);
        value = value === 1 ? 0x7fff : value * 0x8000;
        (0,int16/* .setInt16 */.f2)(buffer, index, value, littleEndian);
    },
    deserialize: (0,bipedal/* .bipedal */.q)(function* (then, { reader, littleEndian }) {
        const data = yield* then(reader.readExactly(2));
        const value = (0,int16/* .getInt16 */.T8)(data, 0, littleEndian);
        // https://github.com/Genymobile/scrcpy/blob/1f138aef41de651668043b32c4effc2d4adbfc44/server/src/main/java/com/genymobile/scrcpy/Binary.java#L34
        return value === 0x7fff ? 1 : value / 0x8000;
    }),
};
const InjectScrollControlMessage = /* #__PURE__ */ (() => (0,struct/* .struct */.w3)({
    type: (0,number.u8)(control_message_type/* .ScrcpyControlMessageType.InjectScroll */.R.InjectScroll),
    pointerX: number/* .u32 */.DH,
    pointerY: number/* .u32 */.DH,
    screenWidth: number/* .u16 */.NX,
    screenHeight: number/* .u16 */.NX,
    scrollX: SignedFloat,
    scrollY: SignedFloat,
    buttons: number/* .u32 */.DH,
}, { littleEndian: false }))();
class ScrollController {
    serializeScrollMessage(message) {
        return InjectScrollControlMessage.serialize(message);
    }
}
function createScrollController() {
    return new ScrollController();
}
//# sourceMappingURL=scroll-controller.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/3_1/impl/serialize-uhid-create.js


const UHidCreateControlMessage = /* #__PURE__ */ (() => (0,struct/* .struct */.w3)({
    type: (0,number.u8)(control_message_type/* .ScrcpyControlMessageType.UHidCreate */.R.UHidCreate),
    id: number/* .u16 */.NX,
    vendorId: number/* .u16 */.NX,
    productId: number/* .u16 */.NX,
    name: (0,string/* .string */.Y)(number.u8),
    data: (0,esm_buffer/* .buffer */.r)(number/* .u16 */.NX),
}, { littleEndian: false }))();
function serializeUHidCreateControlMessage(message) {
    return UHidCreateControlMessage.serialize(message);
}
//# sourceMappingURL=serialize-uhid-create.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/3_1/options.js

class ScrcpyOptions3_1 {
    static Defaults = _3_1_impl_defaults_Defaults;
    version;
    value;
    get controlMessageTypes() {
        return _3_0_impl_control_message_types_ControlMessageTypes;
    }
    #clipboard;
    get clipboard() {
        return this.#clipboard;
    }
    #ackClipboardHandler;
    #uHidOutput;
    get uHidOutput() {
        return this.#uHidOutput;
    }
    constructor(init, version = "3.1") {
        this.value = { ..._3_1_impl_defaults_Defaults, ...init };
        this.version = version;
        if (this.value.videoSource === "camera") {
            this.value.control = false;
        }
        if (this.value.audioDup) {
            this.value.audioSource = "playback";
        }
        if (this.value.control) {
            if (this.value.clipboardAutosync) {
                this.#clipboard = new ClipboardStream();
                this.#ackClipboardHandler = new AckClipboardHandler();
            }
            this.#uHidOutput = new UHidOutputStream();
        }
    }
    serialize() {
        return serialize(this.value, _3_1_impl_defaults_Defaults);
    }
    setListDisplays() {
        setListDisplays(this.value);
    }
    parseDisplay(line) {
        return parseDisplay(line);
    }
    setListEncoders() {
        setListEncoders(this.value);
    }
    parseEncoder(line) {
        return parseEncoder(line);
    }
    parseVideoStreamMetadata(stream) {
        return parse_video_stream_metadata_parseVideoStreamMetadata(this.value, stream);
    }
    parseAudioStreamMetadata(stream) {
        return parseAudioStreamMetadata(stream, this.value);
    }
    async parseDeviceMessage(id, stream) {
        if (await this.#clipboard?.parse(id, stream)) {
            return;
        }
        if (await this.#ackClipboardHandler?.parse(id, stream)) {
            return;
        }
        throw new Error("Unknown device message");
    }
    endDeviceMessageStream(e) {
        if (e) {
            this.#clipboard?.error(e);
            this.#ackClipboardHandler?.error(e);
        }
        else {
            this.#clipboard?.close();
            this.#ackClipboardHandler?.close();
        }
    }
    createMediaStreamTransformer() {
        return media_stream_transformer_createMediaStreamTransformer(this.value);
    }
    serializeInjectTouchControlMessage(message) {
        return inject_touch_serializeInjectTouchControlMessage(message);
    }
    serializeBackOrScreenOnControlMessage(message) {
        return back_or_screen_on_serializeBackOrScreenOnControlMessage(message);
    }
    serializeSetClipboardControlMessage(message) {
        return this.#ackClipboardHandler.serializeSetClipboardControlMessage(message);
    }
    createScrollController() {
        return createScrollController();
    }
    serializeUHidCreateControlMessage(message) {
        return serializeUHidCreateControlMessage(message);
    }
}
//# sourceMappingURL=options.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/3_1/index.js


//# sourceMappingURL=index.js.map
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/utils/constants.js
var constants = __webpack_require__("../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/utils/constants.js");
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/utils/index.js




//# sourceMappingURL=index.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/index.js

































//# sourceMappingURL=index.js.map

},
"../../node_modules/.pnpm/@yume-chan+scrcpy@1.1.0/node_modules/@yume-chan/scrcpy/esm/utils/constants.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  G: () => (DefaultServerPath)
});
const DefaultServerPath = "/data/local/tmp/scrcpy-server.jar";
//# sourceMappingURL=constants.js.map

},
"../../node_modules/.pnpm/@yume-chan+stream-extra@1.0.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@1.0.0/node_modules/@yume-chan/struct/esm/struct.js
var esm_struct = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/struct.js");
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+stream-extra@1.0.0/node_modules/@yume-chan/stream-extra/esm/buffered.js
var esm_buffered = __webpack_require__("../../node_modules/.pnpm/@yume-chan+stream-extra@1.0.0/node_modules/@yume-chan/stream-extra/esm/buffered.js");
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+stream-extra@1.0.0/node_modules/@yume-chan/stream-extra/esm/push-readable.js
var push_readable = __webpack_require__("../../node_modules/.pnpm/@yume-chan+stream-extra@1.0.0/node_modules/@yume-chan/stream-extra/esm/push-readable.js");
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+stream-extra@1.0.0/node_modules/@yume-chan/stream-extra/esm/stream.js
var esm_stream = __webpack_require__("../../node_modules/.pnpm/@yume-chan+stream-extra@1.0.0/node_modules/@yume-chan/stream-extra/esm/stream.js");
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+stream-extra@1.0.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 sourceStreamController;
        const buffered = new esm_buffered/* .BufferedReadableStream */.y(new push_readable/* .PushReadableStream */.F((controller) => {
            sourceStreamController = 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) => {
                // Propagate cancel to the source stream
                // So future writes will be rejected
                return buffered.cancel(reason);
            },
        });
        this.#writable = new esm_stream/* .WritableStream */.ho({
            async write(chunk) {
                await sourceStreamController.enqueue(chunk);
            },
            abort() {
                sourceStreamController.close();
            },
            close() {
                sourceStreamController.close();
            },
        });
    }
}
//# sourceMappingURL=buffered-transform.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+stream-extra@1.0.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

},

};
;