import { I18nService } from "../abstractions/i18n.service" ; import { IFrameComponent } from "./iframe_component" ; export class CaptchaIFrame extends IFrameComponent { constructor ( win , webVaultUrl , private i18nService , successCallback , errorCallback , infoCallback ) { super ( win , webVaultUrl , "captcha-connector.html" , "hcaptcha_iframe" , successCallback , errorCallback , ( message ) => { const parsedMessage = JSON . parse ( message ) ; if ( typeof parsedMessage !== "string" ) { this . iframe . height = parsedMessage . height . toString ( ) ; this . iframe . width = parsedMessage . width . toString ( ) ; } else { infoCallback ( parsedMessage ) ; } } ) ; } init ( siteKey ) { super . initComponent ( this . createParams ( { siteKey : siteKey , locale : this . i18nService . translationLocale } , 1 ) ) ; } }