/**
 * External dependencies.
 */
import http from '@wordpress/api-fetch';

/**
 * Internal dependencies.
 */
import localizedBlockEditorData from '@spectra-pro-helpers/block-editor-data';

// Add nonce middleware for secure REST API authentication.
http.use( http.createNonceMiddleware( localizedBlockEditorData.nonce ) );

// Add root URL middleware to prepend the REST API base URL.
http.use( http.createRootURLMiddleware( localizedBlockEditorData.rootApiUrl ) );

export default http;
