function axiosOptions(options = {}) {
	options = lodash.merge(
		{
			url: "",
			method: "",
			headers: {},
			params: {},
			data: {},
		},
		options,
	);

	// replace "wpjson://" by "https://current-host/wp-json/etc"
	// if (options.url.startsWith("wpjson://")) {
	// 	options.url = options.url.replace(
	// 		"wpjson://",
	// 		`${window.env.site_url}/wp-json/`,
	// 	);
	// }

	// replace "saswp://" by "https://current-host/wp-json/saswp/etc"
	// if (options.url.startsWith("saswp://")) {
	// 	options.url = options.url.replace(
	// 		"saswp://",
	// 		`${window.site_url}/wp-json/saswp/`,
	// 	);
	// }
	//
	// replace "/etc" by "https://host.com/api/etc"
	// if (options.url.startsWith("sasapi://")) {
	// 	options.url = options.url.replace("sasapi://", `${window.api_url}/`);
	//
	// 	if (window.api_token) {
	// 		if (
	// 			typeof options.headers["SearchAndStayApiToken"] == "undefined"
	// 		) {
	// 			// options.headers['SearchAndStayApiToken'] = window.SASWP.settings.sas_api_token;
	// 		}
	// 		// if (typeof options.headers['Authorization']=='undefined' && (typeof options.headers['SearchAndStayApiToken']=='undefined' || options.headers['SearchAndStayApiToken']===null)) {
	// 		//   options.headers['Authorization'] = `Bearer ${window.SASWP.env.sas_api_token}`;
	// 		// }
	// 	}
	//
	// 	if (window.SASWP && window.SASWP.env.saswp_vendor_token) {
	// 		if (typeof options.headers["Authorization"] == "undefined") {
	// 			options.headers["Authorization"] = `Bearer ${
	// 				window.useUserStore().getLogin?.access_token
	// 			}`;
	// 		}
	// 	}
	// }

	for (let name in options.headers) {
		if (!options.headers[name]) {
			delete options.headers[name];
		}
	}

	return options;
}

window.axiosOptions = axiosOptions;
