<?php

namespace Limb_Chatbot\Includes\Widgets\Data;

class Privacy_Policy_Widget_Config extends Abstract_Widget_Config {
	public function sanitize( $data ): array {
		$data = is_array( $data ) ? $data : [];

		return [
			'text' => $this->sanitize_textarea( $data['text'] ?? '' ),
			'url'  => $this->sanitize_url_or_empty( $data['url'] ?? '' ),
		];
	}

	public function validate( $data ): bool {
		return is_array( $data );
	}

	public function get_translatable_fields(): array {
		return [
			[ 'path' => 'text', 'type' => 'string' ],
		];
	}
}
