"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 = ["964"];
exports.modules = {
"../../node_modules/.pnpm/@yume-chan+async@4.1.3/node_modules/@yume-chan/async/esm/maybe-promise.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  $: () => (isPromiseLike)
});
function isPromiseLike(value) {
    return typeof value === "object" && value !== null && "then" in value;
}
//# sourceMappingURL=maybe-promise.js.map

},
"../../node_modules/.pnpm/@yume-chan+async@4.1.3/node_modules/@yume-chan/async/esm/promise-resolver.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  O: () => (PromiseResolver)
});
class PromiseResolver {
    #promise;
    get promise() { return this.#promise; }
    #resolve;
    #reject;
    #state = 'running';
    get state() { return this.#state; }
    constructor() {
        this.#promise = new Promise((resolve, reject) => {
            this.#resolve = resolve;
            this.#reject = reject;
        });
    }
    resolve = (value) => {
        this.#resolve(value);
        this.#state = 'resolved';
    };
    reject = (reason) => {
        this.#reject(reason);
        this.#state = 'rejected';
    };
}
//# sourceMappingURL=promise-resolver.js.map

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

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

// 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");
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+async@4.1.3/node_modules/@yume-chan/async/esm/maybe-promise.js
var maybe_promise = __webpack_require__("../../node_modules/.pnpm/@yume-chan+async@4.1.3/node_modules/@yume-chan/async/esm/maybe-promise.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/consumable/writable.js


class ConsumableWritableStream extends esm_stream/* .WritableStream */.ho {
    static async write(writer, value) {
        const consumable = new Consumable(value);
        await writer.write(consumable);
        await consumable.consumed;
    }
    constructor(sink, strategy) {
        let wrappedStrategy;
        if (strategy) {
            wrappedStrategy = {};
            if ("highWaterMark" in strategy) {
                wrappedStrategy.highWaterMark = strategy.highWaterMark;
            }
            if ("size" in strategy) {
                wrappedStrategy.size = (chunk) => {
                    return strategy.size(chunk instanceof Consumable ? chunk.value : chunk);
                };
            }
        }
        super({
            start(controller) {
                return sink.start?.(controller);
            },
            write(chunk, controller) {
                return chunk.tryConsume((chunk) => sink.write?.(chunk, controller));
            },
            abort(reason) {
                return sink.abort?.(reason);
            },
            close() {
                return sink.close?.();
            },
        }, wrappedStrategy);
    }
}
//# sourceMappingURL=writable.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+stream-extra@2.1.0/node_modules/@yume-chan/stream-extra/esm/consumable/wrap-writable.js

class ConsumableWrapWritableStream extends esm_stream/* .WritableStream */.ho {
    constructor(stream) {
        const writer = stream.getWriter();
        super({
            write(chunk) {
                return chunk.tryConsume((chunk) => writer.write(chunk));
            },
            abort(reason) {
                return writer.abort(reason);
            },
            close() {
                return writer.close();
            },
        });
    }
}
//# sourceMappingURL=wrap-writable.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+stream-extra@2.1.0/node_modules/@yume-chan/stream-extra/esm/consumable/readable.js


class ConsumableReadableStream extends esm_stream/* .ReadableStream */.ZY {
    static async enqueue(controller, chunk) {
        const output = new Consumable(chunk);
        controller.enqueue(output);
        await output.consumed;
    }
    constructor(source, strategy) {
        let wrappedController;
        let wrappedStrategy;
        if (strategy) {
            wrappedStrategy = {};
            if ("highWaterMark" in strategy) {
                wrappedStrategy.highWaterMark = strategy.highWaterMark;
            }
            if ("size" in strategy) {
                wrappedStrategy.size = (chunk) => {
                    return strategy.size(chunk.value);
                };
            }
        }
        super({
            start(controller) {
                wrappedController = {
                    enqueue(chunk) {
                        return ConsumableReadableStream.enqueue(controller, chunk);
                    },
                    close() {
                        controller.close();
                    },
                    error(reason) {
                        controller.error(reason);
                    },
                };
                return source.start?.(wrappedController);
            },
            pull() {
                return source.pull?.(wrappedController);
            },
            cancel(reason) {
                return source.cancel?.(reason);
            },
        }, wrappedStrategy);
    }
}
//# sourceMappingURL=readable.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+stream-extra@2.1.0/node_modules/@yume-chan/stream-extra/esm/consumable/wrap-byte-readable.js


class ConsumableWrapByteReadableStream extends esm_stream/* .ReadableStream */.ZY {
    constructor(stream, chunkSize, min) {
        const reader = stream.getReader({ mode: "byob" });
        let array = new Uint8Array(chunkSize);
        super({
            async pull(controller) {
                const { done, value } = await reader.read(array, { min });
                if (done) {
                    controller.close();
                    return;
                }
                await ConsumableReadableStream.enqueue(controller, value);
                array = new Uint8Array(value.buffer);
            },
            cancel(reason) {
                return reader.cancel(reason);
            },
        });
    }
}
//# sourceMappingURL=wrap-byte-readable.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+stream-extra@2.1.0/node_modules/@yume-chan/stream-extra/esm/task.js
// `createTask` allows browser DevTools to track the call stack across async boundaries.
const { console } = globalThis;
const createTask = /* #__PURE__ */ (() => console?.createTask?.bind(console) ??
    (() => ({
        run(callback) {
            return callback();
        },
    })))();
//# sourceMappingURL=task.js.map
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+stream-extra@2.1.0/node_modules/@yume-chan/stream-extra/esm/consumable.js



class Consumable {
    static WritableStream = ConsumableWritableStream;
    static WrapWritableStream = ConsumableWrapWritableStream;
    static ReadableStream = ConsumableReadableStream;
    static WrapByteReadableStream = ConsumableWrapByteReadableStream;
    #task;
    #resolver;
    value;
    consumed;
    constructor(value) {
        this.#task = createTask("Consumable");
        this.value = value;
        this.#resolver = new promise_resolver/* .PromiseResolver */.O();
        this.consumed = this.#resolver.promise;
    }
    consume() {
        this.#resolver.resolve();
    }
    error(error) {
        this.#resolver.reject(error);
    }
    tryConsume(callback) {
        try {
            let result = this.#task.run(() => callback(this.value));
            if ((0,maybe_promise/* .isPromiseLike */.$)(result)) {
                result = result.then((value) => {
                    this.#resolver.resolve();
                    return value;
                }, (e) => {
                    this.#resolver.reject(e);
                    throw e;
                });
            }
            else {
                this.#resolver.resolve();
            }
            return result;
        }
        catch (e) {
            this.#resolver.reject(e);
            throw e;
        }
    }
}
//# sourceMappingURL=consumable.js.map

},
"../../node_modules/.pnpm/@yume-chan+stream-extra@2.1.0/node_modules/@yume-chan/stream-extra/esm/push-readable.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  F: () => (PushReadableStream)
});
/* import */ var _yume_chan_async__rspack_import_1 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+async@4.1.3/node_modules/@yume-chan/async/esm/promise-resolver.js");
/* import */ var _stream_js__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+stream-extra@2.1.0/node_modules/@yume-chan/stream-extra/esm/stream.js");


class PushReadableStream extends _stream_js__rspack_import_0/* .ReadableStream */.ZY {
    /**
     * Create a new `PushReadableStream` from a source.
     *
     * @param source If `source` returns a `Promise`, the stream will be closed
     * when the `Promise` is resolved, and be errored when the `Promise` is rejected.
     * @param strategy
     */
    constructor(source, strategy, logger) {
        let waterMarkLow;
        let zeroHighWaterMarkAllowEnqueue = false;
        const abortController = new _stream_js__rspack_import_0/* .AbortController */.z1();
        super({
            start: (controller) => {
                const result = source({
                    abortSignal: abortController.signal,
                    enqueue: async (chunk) => {
                        logger?.({
                            source: "producer",
                            operation: "enqueue",
                            value: chunk,
                            phase: "start",
                        });
                        if (abortController.signal.aborted) {
                            // In original `ReadableStream`, calling `enqueue` or `close`
                            // on an cancelled stream will throw an error,
                            //
                            // But in `PushReadableStream`, `enqueue` is an async function,
                            // the producer can't just check `abortSignal.aborted`
                            // before calling `enqueue`, as it might change when waiting
                            // for the backpressure to be reduced.
                            //
                            // So IMO it's better to handle this for the producer
                            // by simply ignoring the `enqueue` call.
                            //
                            // Note that we check `abortSignal.aborted` instead of `stopped`,
                            // as it's not allowed for the producer to call `enqueue` after
                            // they called `close` or `error`.
                            //
                            // Obviously, the producer should listen to the `abortSignal` and
                            // stop producing, but most pushing data sources don't support that.
                            logger?.({
                                source: "producer",
                                operation: "enqueue",
                                value: chunk,
                                phase: "ignored",
                            });
                            return;
                        }
                        if (controller.desiredSize === null) {
                            // `desiredSize` being `null` means the stream is in error state,
                            // `controller.enqueue` will throw an error for us.
                            controller.enqueue(chunk);
                            // istanbul ignore next
                            return;
                        }
                        if (zeroHighWaterMarkAllowEnqueue) {
                            // When `highWaterMark` is set to `0`,
                            // `controller.desiredSize` will always be `0`,
                            // even if the consumer has called `reader.read()`.
                            // (in this case, each `reader.read()`/`pull`
                            // should allow one `enqueue` of any size)
                            //
                            // If the consumer has already called `reader.read()`,
                            // before the producer tries to `enqueue`,
                            // `controller.desiredSize` is `0` and normal `waterMarkLow` signal
                            // will never trigger,
                            // (because `ReadableStream` prevents reentrance of `pull`)
                            // The stream will stuck.
                            //
                            // So we need a special signal for this case.
                            zeroHighWaterMarkAllowEnqueue = false;
                            controller.enqueue(chunk);
                            logger?.({
                                source: "producer",
                                operation: "enqueue",
                                value: chunk,
                                phase: "complete",
                            });
                            return;
                        }
                        if (controller.desiredSize <= 0) {
                            logger?.({
                                source: "producer",
                                operation: "enqueue",
                                value: chunk,
                                phase: "waiting",
                            });
                            waterMarkLow = new _yume_chan_async__rspack_import_1/* .PromiseResolver */.O();
                            await waterMarkLow.promise;
                            // Recheck consumer cancellation after async operations.
                            if (abortController.signal.aborted) {
                                logger?.({
                                    source: "producer",
                                    operation: "enqueue",
                                    value: chunk,
                                    phase: "ignored",
                                });
                                return;
                            }
                        }
                        controller.enqueue(chunk);
                        logger?.({
                            source: "producer",
                            operation: "enqueue",
                            value: chunk,
                            phase: "complete",
                        });
                    },
                    close() {
                        logger?.({
                            source: "producer",
                            operation: "close",
                            explicit: true,
                            phase: "start",
                        });
                        // Since `enqueue` on an cancelled stream won't throw an error,
                        // so does `close`.
                        if (abortController.signal.aborted) {
                            logger?.({
                                source: "producer",
                                operation: "close",
                                explicit: true,
                                phase: "ignored",
                            });
                            return;
                        }
                        controller.close();
                        logger?.({
                            source: "producer",
                            operation: "close",
                            explicit: true,
                            phase: "complete",
                        });
                    },
                    error(e) {
                        logger?.({
                            source: "producer",
                            operation: "error",
                            explicit: true,
                            phase: "start",
                        });
                        // Calling `error` on an already closed or errored stream is a no-op.
                        controller.error(e);
                        logger?.({
                            source: "producer",
                            operation: "error",
                            explicit: true,
                            phase: "complete",
                        });
                    },
                });
                if (result && "then" in result) {
                    // If `source` returns a `Promise`,
                    // close the stream when the `Promise` is resolved,
                    // and error the stream when the `Promise` is rejected.
                    // The producer can return a never-settling `Promise`
                    // to disable this behavior.
                    result.then(() => {
                        logger?.({
                            source: "producer",
                            operation: "close",
                            explicit: false,
                            phase: "start",
                        });
                        try {
                            controller.close();
                            logger?.({
                                source: "producer",
                                operation: "close",
                                explicit: false,
                                phase: "complete",
                            });
                        }
                        catch {
                            logger?.({
                                source: "producer",
                                operation: "close",
                                explicit: false,
                                phase: "ignored",
                            });
                            // The stream is already closed by the producer,
                            // Or cancelled by the consumer.
                        }
                    }, (e) => {
                        logger?.({
                            source: "producer",
                            operation: "error",
                            explicit: false,
                            phase: "start",
                        });
                        controller.error(e);
                        logger?.({
                            source: "producer",
                            operation: "error",
                            explicit: false,
                            phase: "complete",
                        });
                    });
                }
            },
            pull: () => {
                logger?.({
                    source: "consumer",
                    operation: "pull",
                    phase: "start",
                });
                if (waterMarkLow) {
                    waterMarkLow.resolve();
                }
                else if (strategy?.highWaterMark === 0) {
                    zeroHighWaterMarkAllowEnqueue = true;
                }
                logger?.({
                    source: "consumer",
                    operation: "pull",
                    phase: "complete",
                });
            },
            cancel: (reason) => {
                logger?.({
                    source: "consumer",
                    operation: "cancel",
                    phase: "start",
                });
                abortController.abort(reason);
                // Resolve it on cancellation. `pull` will check `abortSignal.aborted` again.
                waterMarkLow?.resolve();
                logger?.({
                    source: "consumer",
                    operation: "cancel",
                    phase: "complete",
                });
            },
        }, strategy);
    }
}
//# sourceMappingURL=push-readable.js.map

},
"../../node_modules/.pnpm/@yume-chan+stream-extra@2.1.0/node_modules/@yume-chan/stream-extra/esm/stream.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  Rv: () => (TransformStream),
  ZY: () => (ReadableStream),
  ho: () => (WritableStream),
  z1: () => (AbortController)
});


const { AbortController } = globalThis;
const ReadableStream = /* #__PURE__ */ (() => {
    const { ReadableStream } = globalThis;
    if (!ReadableStream.from) {
        ReadableStream.from = function (iterable) {
            const iterator = Symbol.asyncIterator in iterable
                ? iterable[Symbol.asyncIterator]()
                : iterable[Symbol.iterator]();
            return new ReadableStream({
                async pull(controller) {
                    const result = await iterator.next();
                    if (result.done) {
                        controller.close();
                        return;
                    }
                    controller.enqueue(result.value);
                },
                async cancel(reason) {
                    await iterator.return?.(reason);
                },
            });
        };
    }
    if (!ReadableStream.prototype[Symbol.asyncIterator] ||
        !ReadableStream.prototype.values) {
        ReadableStream.prototype.values = async function* (options) {
            const reader = this.getReader();
            try {
                while (true) {
                    const { done, value } = await reader.read();
                    if (done) {
                        return;
                    }
                    yield value;
                }
            }
            finally {
                // Calling `iterator.return` will enter this `finally` block.
                // We don't need to care about the parameter to `iterator.return`,
                // it will be returned as the final `result.value` automatically.
                if (!options?.preventCancel) {
                    await reader.cancel();
                }
                reader.releaseLock();
            }
        };
        ReadableStream.prototype[Symbol.asyncIterator] =
            // eslint-disable-next-line @typescript-eslint/unbound-method
            ReadableStream.prototype.values;
    }
    return ReadableStream;
})();
const { WritableStream, TransformStream } = globalThis;
//# sourceMappingURL=stream.js.map

},
"../../node_modules/.pnpm/@yume-chan+stream-extra@2.1.0/node_modules/@yume-chan/stream-extra/esm/try-close.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  S: () => (tryCancel),
  i: () => (tryClose)
});
function tryClose(controller) {
    try {
        controller.close();
        return true;
    }
    catch {
        return false;
    }
}
async function tryCancel(stream) {
    try {
        await stream.cancel();
        return true;
    }
    catch {
        return false;
    }
}
//# sourceMappingURL=try-close.js.map

},

};
;