import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
import { t } from "./debounce-Bp3jy7S5.js";
import { createElementBlock as n, createElementVNode as r, createVNode as i, openBlock as a, resolveComponent as o, resolveDirective as s, toDisplayString as c, withDirectives as l } from "vue";
//#region src/components/wt-pagination/wt-pagination.vue
var u = 10, d = {
	name: "WtPagination",
	model: {
		prop: "size",
		event: "change"
	},
	props: {
		size: { type: [String, Number] },
		next: {
			type: Boolean,
			default: !1
		},
		prev: {
			type: Boolean,
			default: !1
		},
		debounce: {
			type: Boolean,
			default: !1
		},
		debounceDelay: {
			type: Number,
			default: 1e3
		}
	},
	emits: [
		"change",
		"input",
		"prev",
		"next"
	],
	data() {
		return { internalSize: this.size == null ? u : +this.size };
	},
	watch: {
		internalSize(e) {
			e !== null && this.changeSize(e);
		},
		size(e) {
			this.internalSize = e == null ? u : +e;
		}
	},
	created() {
		this.debounce && (this.changeSize = t(this.changeSize, this.debounceDelay));
	},
	methods: {
		inputHandler(e) {
			if (e === null) {
				this.internalSize = null, this.$nextTick(() => {
					this.internalSize = u, this.$emit("input", u);
				});
				return;
			}
			let t = e >= 0 && e <= 1e3 ? e : u;
			this.internalSize = t, this.$emit("input", t);
		},
		changeSize(e) {
			this.$emit("change", e);
		},
		goNext() {
			this.$emit("next");
		},
		goPrev() {
			this.$emit("prev");
		}
	}
}, f = { class: "wt-pagination typo-body-1" }, p = { class: "wt-pagination__size" }, m = { class: "wt-pagination__size-text" }, h = { class: "wt-pagination__page-controls" };
function g(e, t, u, d, g, _) {
	let v = o("wt-input-number"), y = o("wt-icon-btn"), b = s("tooltip");
	return a(), n("footer", f, [r("div", p, [r("div", m, c(e.$t("webitelUI.pagination.sizeText")), 1), i(v, {
		max: 1e3,
		min: 1,
		"model-value": g.internalSize,
		class: "wt-pagination__size-input",
		"onUpdate:modelValue": _.inputHandler
	}, null, 8, ["model-value", "onUpdate:modelValue"])]), r("div", h, [l(i(y, {
		disabled: !u.prev,
		class: "wt-pagination__page-control",
		icon: "arrow-left",
		onClick: _.goPrev
	}, null, 8, ["disabled", "onClick"]), [[b, e.$t("webitelUI.pagination.prev")]]), l(i(y, {
		disabled: !u.next,
		class: "wt-pagination__page-control",
		icon: "arrow-right",
		onClick: _.goNext
	}, null, 8, ["disabled", "onClick"]), [[b, e.$t("webitelUI.pagination.next")]])])]);
}
var _ = /*#__PURE__*/ e(d, [["render", g], ["__scopeId", "data-v-4183dd40"]]);
//#endregion
export { _ as default };
