import e from "../PlTooltip/PlTooltip.js";
import "../PlTooltip/index.js";
import { getErrorMessage as t } from "../../helpers/error.js";
import './pl-btn-group.css';/* empty css             */
import n from "../../utils/InnerBorder.js";
import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, normalizeClass as d, openBlock as f, renderList as p, renderSlot as m, toDisplayString as h, unref as g, useSlots as _, withCtx as v, withKeys as y } from "vue";
var b = { key: 0 }, x = [
	"tabindex",
	"onKeydown",
	"onClick"
], S = {
	key: 1,
	class: "pl-btn-group__helper"
}, C = {
	key: 2,
	class: "pl-btn-group__error"
}, w = /* @__PURE__ */ u({
	name: "PlBtnGroup",
	props: {
		modelValue: {},
		label: {},
		options: {},
		disabled: { type: Boolean },
		compact: { type: Boolean },
		helper: {},
		error: {}
	},
	emits: ["update:modelValue"],
	setup(u, { emit: w }) {
		let T = _(), E = w, D = (e) => E("update:modelValue", e), O = u, k = i(() => O.options.map((e) => ({
			label: "label" in e ? e.label : e.text,
			value: e.value
		})));
		return (i, _) => (f(), s("div", { class: d(["pl-btn-group", {
			disabled: u.disabled,
			compact: u.compact
		}]) }, [
			u.label ? (f(), s("label", b, [c("span", null, h(u.label), 1), g(T).tooltip ? (f(), a(g(e), {
				key: 0,
				class: "info",
				position: "top"
			}, {
				tooltip: v(() => [m(i.$slots, "tooltip")]),
				_: 3
			})) : o("", !0)])) : o("", !0),
			l(n, { class: "pl-btn-group__container" }, {
				default: v(() => [(f(!0), s(r, null, p(k.value, (e, t) => (f(), s("div", {
					key: t,
					class: d(["pl-btn-group__option text-s", { active: u.modelValue === e.value }]),
					tabindex: u.modelValue === e.value || u.disabled ? void 0 : 0,
					onKeydown: y((t) => D(e.value), ["enter"]),
					onClick: (t) => D(e.value)
				}, h(e.label), 43, x))), 128))]),
				_: 1
			}),
			u.helper ? (f(), s("div", S, h(u.helper), 1)) : u.error ? (f(), s("div", C, h(g(t)(u.error)), 1)) : o("", !0)
		], 2));
	}
});
export { w as default };

//# sourceMappingURL=PlBtnGroup.vue2.js.map