class HeadlessImpersonationClient {
    _networkClient;
    _subscriptionService;
    dfpProtectedAuth;
    authenticate;
    constructor(_networkClient, _subscriptionService, dfpProtectedAuth){
        this._networkClient = _networkClient;
        this._subscriptionService = _subscriptionService;
        this.dfpProtectedAuth = dfpProtectedAuth;
        this.authenticate = this._subscriptionService.withUpdateSession(async (data)=>{
            const { dfp_telemetry_id, captcha_token } = await this.dfpProtectedAuth.getDFPTelemetryIDAndCaptcha();
            return this._networkClient.retriableFetchSDK({
                url: '/impersonation/authenticate',
                body: {
                    ...data,
                    dfp_telemetry_id,
                    captcha_token
                },
                method: 'POST',
                retryCallback: this.dfpProtectedAuth.retryWithCaptchaAndDFP
            });
        });
    }
}

export { HeadlessImpersonationClient };
//# sourceMappingURL=HeadlessImpersonationClient.mjs.map
