import { getCurrentTheme as e, getNextTheme as t, getThemeLabel as n, toggleTheme as r } from "./ui/index.js";
import { t as i } from "./createLucideIcon-wKpAnzBe.js";
import { useCallback as a, useEffect as o, useState as s } from "react";
import { jsx as c } from "react/jsx-runtime";
var l = i("moon", [["path", {
	d: "M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",
	key: "kfwtm"
}]]), u = i("palette", [
	["path", {
		d: "M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",
		key: "e79jfc"
	}],
	["circle", {
		cx: "13.5",
		cy: "6.5",
		r: ".5",
		fill: "currentColor",
		key: "1okk4w"
	}],
	["circle", {
		cx: "17.5",
		cy: "10.5",
		r: ".5",
		fill: "currentColor",
		key: "f64h9f"
	}],
	["circle", {
		cx: "6.5",
		cy: "12.5",
		r: ".5",
		fill: "currentColor",
		key: "qy21gx"
	}],
	["circle", {
		cx: "8.5",
		cy: "7.5",
		r: ".5",
		fill: "currentColor",
		key: "fotxhn"
	}]
]), d = i("sun", [
	["circle", {
		cx: "12",
		cy: "12",
		r: "4",
		key: "4exip2"
	}],
	["path", {
		d: "M12 2v2",
		key: "tus03m"
	}],
	["path", {
		d: "M12 20v2",
		key: "1lh1kg"
	}],
	["path", {
		d: "m4.93 4.93 1.41 1.41",
		key: "149t6j"
	}],
	["path", {
		d: "m17.66 17.66 1.41 1.41",
		key: "ptbguv"
	}],
	["path", {
		d: "M2 12h2",
		key: "1t8f8n"
	}],
	["path", {
		d: "M20 12h2",
		key: "1q8mjw"
	}],
	["path", {
		d: "m6.34 17.66-1.41 1.41",
		key: "1m8zz5"
	}],
	["path", {
		d: "m19.07 4.93-1.41 1.41",
		key: "1shlcs"
	}]
]);
//#endregion
//#region src/react/theme-toggle/index.tsx
function f({ theme: e, className: t, size: n }) {
	let r = {};
	switch (t !== void 0 && (r.className = t), n !== void 0 && (r.size = n), e) {
		case "light": return /* @__PURE__ */ c(d, { ...r });
		case "monokai":
		case "glass": return /* @__PURE__ */ c(u, { ...r });
		default: return /* @__PURE__ */ c(l, { ...r });
	}
}
function p({ className: e }) {
	let { theme: t, themeLabel: n, toggle: r } = m();
	return /* @__PURE__ */ c("button", {
		type: "button",
		onClick: r,
		title: `${n} — click to switch`,
		className: e,
		children: /* @__PURE__ */ c(f, { theme: t })
	});
}
function m() {
	let [i, c] = s(() => e());
	o(() => {
		let t = new MutationObserver(() => {
			let t = e();
			c((e) => e === t ? e : t);
		});
		return t.observe(document.documentElement, {
			attributes: !0,
			attributeFilter: ["data-theme"]
		}), () => {
			t.disconnect();
		};
	}, []);
	let l = a(() => {
		c(r());
	}, []), u = t(i);
	return {
		theme: i,
		themeLabel: n(i),
		nextTheme: u,
		nextThemeLabel: n(u),
		toggle: l
	};
}
//#endregion
export { p as n, m as r, f as t };

//# sourceMappingURL=theme-toggle-Csyj-tLm.js.map