public function render($namespace = 'config')
    {
        foreach ($this->variables as $key => $variable) {
            if ($variable instanceof Closure) {
                $variable = $variable();

                if (is_array($variable)) {
                    $this->add($variable);
                }
            }
        }

        $variables = array_filter($this->variables, function ($variable) {
            return !$variable instanceof Closure;
        });

        return new HtmlString(
            '<script>window.'.$namespace.' = '.json_encode($variables).';</script>'
        );
    }