import { defineComponent as B, defineAsyncComponent as d, computed as h, ref as P, createElementBlock as i, openBlock as t, createElementVNode as u, createCommentVNode as l, normalizeClass as k, Fragment as N, renderList as $, createBlock as m, unref as s, createVNode as v } from "vue";
const j = { class: "pointer-events-none absolute inset-0 z-10" }, A = { class: "relative h-full w-full" }, O = {
  key: 0,
  class: "flex items-center gap-2 border-b border-r border-accent/25"
}, z = { class: "flex flex-auto items-center gap-0.5 px-2 py-1" }, E = { class: "flex items-center gap-0.5 px-2 py-1" }, T = {
  key: 1,
  class: "flex-auto overflow-auto border-r border-gray-700/25"
}, F = { class: "absolute right-0 inset-y-0 bg-foreground/15" }, q = /* @__PURE__ */ B({
  __name: "index",
  props: {
    modelValue: { type: Boolean, default: !1 },
    options: { default: () => ({
      thumbnails: !0,
      bookmarks: !0,
      attachments: !0
    }) },
    outline: {},
    attachments: {},
    pdf: {},
    page: { default: 1 },
    rotation: { default: 0 }
  },
  emits: ["update:modelValue", "changePage"],
  setup(y, { emit: C }) {
    const p = d(() => import("./DN-aONkm.js")), V = d(() => import("./DW4iNCJt.js")), x = d(() => import("./Dr4MB3dR.js")), _ = d(
      () => import("./DYig_lRG.js").then((e) => e.i)
    ), o = y, f = C, c = h({
      get: () => o.modelValue,
      set: (e) => f("update:modelValue", e)
    }), w = h(() => {
      let e = {};
      return o.options.thumbnails && Object.assign(e, {
        thumbnails: {
          label: "Page Thumbnails",
          icon: "file_copy"
        }
      }), o.options.bookmarks && Object.assign(e, {
        bookmarks: {
          label: "Bookmarks",
          icon: "bookmark_border"
        }
      }), o.options.attachments && Object.assign(e, {
        attachments: {
          label: "Attachments",
          icon: "attachment"
        }
      }), e;
    }), a = P("bookmarks"), g = (e) => {
      e && f("changePage", { page: e.page, offset: e.offset });
    };
    return (e, n) => (t(), i("div", j, [
      u("div", A, [
        o.modelValue ? (t(), i("div", {
          key: 0,
          class: "pointer-events-auto absolute inset-0 block bg-foreground/15 md:hidden",
          onClick: n[0] || (n[0] = (r) => f("update:modelValue", !1))
        })) : l("", !0),
        u("div", {
          class: k(["pointer-events-auto relative flex h-full min-w-0 flex-auto flex-col pr-4 bg-background/75 transition-all", {
            "w-4": !o.modelValue,
            "w-72": o.modelValue
          }])
        }, [
          e.modelValue ? (t(), i("div", O, [
            u("div", z, [
              (t(!0), i(N, null, $(w.value, (r, b) => (t(), m(s(p), {
                key: r.label,
                icon: r.icon,
                class: k(["rounded-lg px-1 py-0.5 text-2xl", {
                  "bg-secondary/30": a.value === b,
                  "hover:text-primary": a.value !== b
                }]),
                onClick: (I) => a.value = b
              }, null, 8, ["icon", "class", "onClick"]))), 128))
            ]),
            u("div", E, [
              v(s(p), {
                icon: "close",
                class: "rounded-full p-1",
                onClick: n[1] || (n[1] = (r) => c.value = !1)
              })
            ])
          ])) : l("", !0),
          e.modelValue ? (t(), i("div", T, [
            e.options.thumbnails && a.value == "thumbnails" && e.pdf ? (t(), m(s(V), {
              key: 0,
              pdf: e.pdf,
              page: e.page,
              rotation: e.rotation,
              class: "overflow-x-hidden",
              onChangePage: g
            }, null, 8, ["pdf", "page", "rotation"])) : l("", !0),
            a.value == "bookmarks" ? (t(), m(s(x), {
              key: 1,
              outline: e.outline,
              onChangePage: g
            }, null, 8, ["outline"])) : l("", !0),
            a.value == "attachments" ? (t(), m(s(_), {
              key: 2,
              attachments: e.attachments
            }, null, 8, ["attachments"])) : l("", !0)
          ])) : l("", !0),
          u("span", F, [
            v(s(p), {
              icon: "arrow_right",
              class: "h-full",
              iconClass: {
                "rotate-180": c.value
              },
              onClick: n[2] || (n[2] = (r) => c.value = !c.value)
            }, null, 8, ["iconClass"])
          ])
        ], 2)
      ])
    ]));
  }
});
export {
  q as default
};
//# sourceMappingURL=J-i-D8Jl.js.map
