import { html as e, svg as t } from "../../property-information/index.js";
import { htmlVoidElements as n } from "../../html-void-elements/index.js";
import { handle as r } from "./handle/index.js";
//#region ../../node_modules/hast-util-to-html/lib/index.js
var i = {}, a = {}, o = [];
function s(r, o) {
	let s = o || i, u = s.quote || "\"", d = u === "\"" ? "'" : "\"";
	if (u !== "\"" && u !== "'") throw Error("Invalid quote `" + u + "`, expected `'` or `\"`");
	return {
		one: c,
		all: l,
		settings: {
			omitOptionalTags: s.omitOptionalTags || !1,
			allowParseErrors: s.allowParseErrors || !1,
			allowDangerousCharacters: s.allowDangerousCharacters || !1,
			quoteSmart: s.quoteSmart || !1,
			preferUnquoted: s.preferUnquoted || !1,
			tightAttributes: s.tightAttributes || !1,
			upperDoctype: s.upperDoctype || !1,
			tightDoctype: s.tightDoctype || !1,
			bogusComments: s.bogusComments || !1,
			tightCommaSeparatedLists: s.tightCommaSeparatedLists || !1,
			tightSelfClosing: s.tightSelfClosing || !1,
			collapseEmptyAttributes: s.collapseEmptyAttributes || !1,
			allowDangerousHtml: s.allowDangerousHtml || !1,
			voids: s.voids || n,
			characterReferences: s.characterReferences || a,
			closeSelfClosing: s.closeSelfClosing || !1,
			closeEmptyElements: s.closeEmptyElements || !1
		},
		schema: s.space === "svg" ? t : e,
		quote: u,
		alternative: d
	}.one(Array.isArray(r) ? {
		type: "root",
		children: r
	} : r, void 0, void 0);
}
function c(e, t, n) {
	return r(e, t, n, this);
}
function l(e) {
	let t = [], n = e && e.children || o, r = -1;
	for (; ++r < n.length;) t[r] = this.one(n[r], r, e);
	return t.join("");
}
//#endregion
export { s as toHtml };
