Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_rolldown_runtime = require("./chunks/rolldown-runtime-C34Jxks9.cjs");
require("./chunks/SuperConverter-BFs3Wrk0.cjs");
require("./chunks/jszip-4KbV_vHe.cjs");
require("./chunks/xml-js-B2J5tNmr.cjs");
const require_create_headless_toolbar = require("./chunks/create-headless-toolbar-BC6RwkXA.cjs");
require("./chunks/constants-DDSbERiY.cjs");
require("./chunks/dist-kRpWoWUg.cjs");
require("./chunks/unified-DgEQofGI.cjs");
let vue = require("vue");
var EMPTY_SNAPSHOT = {
	context: null,
	commands: {}
};
function useHeadlessToolbar(superdoc, commands) {
	if (!superdoc) return {
		snapshot: (0, vue.shallowRef)(EMPTY_SNAPSHOT),
		execute: () => false
	};
	const controller = require_create_headless_toolbar.createHeadlessToolbar({
		superdoc,
		commands
	});
	const snapshot = (0, vue.shallowRef)(controller.getSnapshot());
	const unsub = controller.subscribe(({ snapshot: s }) => {
		snapshot.value = s;
	});
	(0, vue.onBeforeUnmount)(() => {
		unsub();
		controller.destroy();
	});
	const execute = ((...args) => {
		return controller.execute(...args);
	});
	return {
		snapshot,
		execute
	};
}
exports.useHeadlessToolbar = useHeadlessToolbar;
