import { defineComponent as b, ref as f, computed as y, onMounted as B, openBlock as w, createElementBlock as $, createElementVNode as a, createStaticVNode as z, createTextVNode as R, toDisplayString as E, unref as S, renderSlot as D, createBlock as N, createCommentVNode as V, createVNode as t } from "vue";
import { _ as L } from "./D1tIOvOH.js";
import { _ as r } from "./BsYOzjHA.js";
import { _ as P } from "./C0cpdFtd.js";
import { DemoCodeEditor as _, CSSHelper as d, AjaxHelper as T } from "@bryntum/taskboard";
const j = { class: "demo-header b-bryntum" }, A = ["href"], H = {
  id: "tools",
  class: "tools"
}, s = "../", I = /* @__PURE__ */ b({
  __name: "BryntumDemoHeader",
  props: {
    title: {},
    themeCombo: { type: Boolean, default: !0 }
  },
  setup(v, { expose: x }) {
    const g = v, i = f(null), c = f(null), l = document.title.split(" - ")[1] || document.title, k = document.location.search.includes("test"), m = `https://bryntum.com/download/?product=${document.location.href.match(/\/(\w+)(-trial)?\/[-\w]*examples\//)?.[1]?.toLowerCase() || "taskboard"}`, n = !_.monacoCodePath;
    let p;
    const h = y(() => {
      const e = /(.*?\/)(examples.*?\/frameworks\/.*?)\/dist/.exec(document.location.href);
      return e?.[1] && e?.[2] ? `${e[1]}examples/#example-${e[2].replace(/\//gm, "-").replace("examples-frameworks", "frameworks")}` : "#";
    }), u = async () => {
      p = await _.toggleCodeEditor(
        p,
        i.value.instance.value,
        {
          appFolder: s,
          preferredSources: [
            /App\.vue/,
            /\w+Config\.[tj]s/
          ]
        }
      );
    }, C = async () => {
      const e = (await T.get(`${s}app.config.json`, { parseJson: !0 })).parsedJson;
      if (e.zip || k) {
        const o = c.value.instance.value;
        o.hidden = !1, o.href = `${s}${e.zip}`;
      }
    };
    return B(() => {
      n || (d.insertRule("body { flex-direction : row !important }"), d.insertRule("#__nuxt, #container, #app { flex : 1 !important; overflow : hidden !important }"), d.insertRule(".b-codeeditor-header { padding : 0.5em !important }"), C()), new URLSearchParams(window.location.search).has("screenshot") && (document.body.classList.add("b-screenshot"), window.bryntum.noAnimations = !0);
    }), x({
      link: h,
      headerTitle: l,
      hiddenEditor: n,
      downloadLink: m,
      toggleCodeEditor: u
    }), (e, o) => (w(), $("header", j, [
      a("a", {
        id: "title",
        class: "title",
        href: h.value
      }, [
        a("h1", null, [
          o[0] || (o[0] = z('<svg viewBox="0 0 354.9 144.52" xmlns="http://www.w3.org/2000/svg"><g><path d="m305.63 144.52c-12.47 0-23.53-4.83-31.58-13.28v11.06h-25.54v-142.3h26.75v48.58c7.84-7.64 18.5-12.07 30.37-12.07 27.15 0 49.28 23.33 49.28 54.1s-22.12 53.9-49.28 53.9zm-3.82-83.47c-14.68 0-26.55 13.27-26.55 29.77s11.87 29.16 26.55 29.16 26.55-12.67 26.55-29.16-11.87-29.77-26.55-29.77z"></path><path d="m148.02 0h74.01v29.78h-74.01z"></path><path d="m0 56.26h222.03v29.78h-222.03z"></path><path d="m74.01 112.52h148.02v29.6h-148.02z"></path></g></svg>', 1)),
          R(" " + E(S(l)), 1)
        ])
      ], 8, A),
      D(e.$slots, "default"),
      a("div", H, [
        g.themeCombo ? (w(), N(P, { key: 0 })) : V("", !0),
        t(r, {
          text: "Download Trial",
          href: m,
          rendition: "filled"
        }),
        t(r, {
          ref_key: "codeButtonRef",
          ref: i,
          icon: "b-icon-code",
          tooltip: "Click to show the code viewer",
          rendition: "text",
          hidden: n,
          onClick: u
        }, null, 512),
        t(r, {
          ref_key: "downloadButtonRef",
          ref: c,
          icon: "b-icon-download",
          tooltip: "Download this demo zip archive",
          rendition: "text",
          href: "#",
          hidden: !0
        }, null, 512),
        t(L)
      ])
    ]));
  }
});
export {
  I as _
};
//# sourceMappingURL=mIfLQ5Tf.js.map
