public function scriptWithCallback(array $captchas, $callbackName = 'captchaRenderCallback')
    {
        $script = $this->script($callbackName)->toHtml();

        if ( ! empty($script) && ! empty($captchas)) {
            $script = implode(PHP_EOL, [
                $this->getApiScript()->toHtml(),
                '<script>',
                    "var $callbackName = function() {",
                        $this->renderCaptchas($captchas),
                    '};',
                '</script>',
                $script,
            ]);
        }

        return $this->toHtmlString($script);
    }