"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const index = require("../../../../hooks/use-locale/index.js");
const index$1 = require("../../../../hooks/use-namespace/index.js");
const index$2 = require("../../../input/index.js");
const usePagination = require("../usePagination.js");
const jumper = require("./jumper.js");
const vue = require("vue");
const _hoisted_1 = ["disabled"];
var jumper_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ vue.defineComponent({
  name: "ElPaginationJumper",
  __name: "jumper",
  props: jumper.paginationJumperProps,
  setup(__props) {
    const { t } = index.useLocale();
    const ns = index$1.useNamespace("pagination");
    const { pageCount, disabled, currentPage, changeEvent } = usePagination.usePagination();
    const userInput = vue.ref();
    const innerValue = vue.computed(() => userInput.value ?? (currentPage == null ? void 0 : currentPage.value));
    function handleInput(val) {
      userInput.value = val ? +val : "";
    }
    function handleChange(val) {
      val = Math.trunc(+val);
      changeEvent == null ? void 0 : changeEvent(val);
      userInput.value = void 0;
    }
    return (_ctx, _cache) => {
      return vue.openBlock(), vue.createElementBlock("span", {
        class: vue.normalizeClass(vue.unref(ns).e("jump")),
        disabled: vue.unref(disabled)
      }, [
        vue.createElementVNode("span", { class: vue.normalizeClass([vue.unref(ns).e("goto")]) }, vue.toDisplayString(vue.unref(t)("el.pagination.goto")), 3),
        vue.createVNode(vue.unref(index$2.ElInput), {
          size: _ctx.size,
          class: vue.normalizeClass([vue.unref(ns).e("editor"), vue.unref(ns).is("in-pagination")]),
          min: 1,
          max: vue.unref(pageCount),
          disabled: vue.unref(disabled),
          "model-value": innerValue.value,
          "validate-event": false,
          "aria-label": vue.unref(t)("el.pagination.page"),
          type: "number",
          "onUpdate:modelValue": handleInput,
          onChange: handleChange
        }, null, 8, [
          "size",
          "class",
          "max",
          "disabled",
          "model-value",
          "aria-label"
        ]),
        vue.createElementVNode("span", { class: vue.normalizeClass([vue.unref(ns).e("classifier")]) }, vue.toDisplayString(vue.unref(t)("el.pagination.pageClassifier")), 3)
      ], 10, _hoisted_1);
    };
  }
});
exports.default = jumper_vue_vue_type_script_setup_true_lang_default;
