import { defineComponent as B, useCssModule as b, useSlots as I, computed as l, resolveComponent as S, openBlock as _, createElementBlock as m, normalizeClass as n, unref as s, createElementVNode as o, createVNode as c, withCtx as h, toDisplayString as a, createTextVNode as p, renderSlot as V, createCommentVNode as X } from "vue";
import { t } from "./locale.js";
import N from "./Button.js";
import { _ as $, V as z, I as M } from "./Illustration.vue_vue_type_script_setup_true_lang-Bs1KwoBm.js";
import { _ as T } from "./Logo.vue_vue_type_script_setup_true_lang-OzVO8dG0.js";
import { _ as D } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const H = { class: "heading-jumbo m-0 mb-3 !text-white" }, J = { class: "mb-8 text-white" }, Y = { class: "mb-4 text-white" }, j = ["href"], A = {
  key: 0,
  class: "flex items-start gap-6"
}, F = /* @__PURE__ */ B({
  __name: "HttpError",
  props: {
    description: { default: "" },
    errorCode: {},
    hideLogoutButton: { type: Boolean, default: !1 },
    onLogout: { type: Function, default: void 0 },
    retryLink: { default: void 0 },
    title: { default: "" }
  },
  setup(f) {
    const d = {
      401: {
        title: t("ll.httpError.401.title"),
        description: t("ll.httpError.401.description")
      },
      403: {
        title: t("ll.httpError.403.title"),
        description: t("ll.httpError.403.description")
      },
      404: {
        title: t("ll.httpError.404.title"),
        description: t("ll.httpError.404.description")
      },
      405: {
        title: t("ll.httpError.405.title"),
        description: t("ll.httpError.405.description")
      },
      500: {
        title: t("ll.httpError.50X.title"),
        description: t("ll.httpError.50X.description")
      },
      502: {
        title: t("ll.httpError.50X.title"),
        description: t("ll.httpError.50X.description")
      },
      503: {
        title: t("ll.httpError.50X.title"),
        description: t("ll.httpError.50X.description")
      },
      504: {
        title: t("ll.httpError.504.title"),
        description: t("ll.httpError.504.description")
      }
    }, r = f, i = b(), E = I(), g = l(() => r.errorCode.toString()), v = l(() => parseInt(g.value, 10)), u = l(() => d[v.value] || d[500]), y = l(() => r.title || u.value.title), k = l(() => r.description || u.value.description), x = l(() => !r.hideLogoutButton && r.onLogout), C = l(() => r.retryLink || window.location.href);
    return (w, e) => {
      const L = S("router-link");
      return _(), m("div", {
        class: n(["stash-http-error px-6 py-12", s(i).root]),
        "data-test": "stash-http-error"
      }, [
        o("div", {
          class: n(s(i).wrapper)
        }, [
          c(L, {
            to: "/",
            class: "mb-8 block"
          }, {
            default: h(() => [
              c(T, {
                color: "white",
                width: "192"
              })
            ]),
            _: 1
          }),
          o("div", {
            class: n(["mb-8 gap-6", s(i).content])
          }, [
            o("div", {
              class: n(["order-2 lg:order-1", s(i).content__text])
            }, [
              o("h1", H, a(y.value), 1),
              o("h2", J, "Error Code: " + a(r.errorCode), 1),
              o("p", Y, [
                p(a(k.value) + " You can ", 1),
                o("a", {
                  href: C.value,
                  class: "link"
                }, "try again", 8, j),
                e[0] || (e[0] = p(" or reach out to ", -1)),
                e[1] || (e[1] = o("a", {
                  href: "mailto:support@leaflink.com",
                  class: "link"
                }, "support@leaflink.com", -1)),
                e[2] || (e[2] = p(" for assistance. ", -1))
              ])
            ], 2),
            o("div", {
              class: n(["order-1 lg:order-2", s(i).illustration])
            }, [
              c($, {
                size: 300,
                type: s(M).Vignette,
                name: s(z).SearchStorefront
              }, null, 8, ["type", "name"])
            ], 2)
          ], 2),
          s(E).actions || x.value ? (_(), m("div", A, [
            V(w.$slots, "actions", {}, () => [
              c(N, {
                tertiary: "",
                onClick: r.onLogout
              }, {
                default: h(() => [...e[3] || (e[3] = [
                  p("Logout", -1)
                ])]),
                _: 1
              }, 8, ["onClick"])
            ])
          ])) : X("", !0)
        ], 2)
      ], 2);
    };
  }
}), K = "_root_l5uIl", O = "_wrapper_OYxKJ", Q = "_content_9rxfz", R = "_illustration_Asd2J", q = "_content__text_aIllQ", G = {
  root: K,
  wrapper: O,
  content: Q,
  illustration: R,
  content__text: q
}, P = {
  $style: G
}, et = /* @__PURE__ */ D(F, [["__cssModules", P]]);
export {
  et as default
};
//# sourceMappingURL=HttpError.js.map
