import { Use as H, Value as u, prop as et, html as I, attr as a, on as C, WithElement as it, OnDispose as W, aria as N, bind as _t, computedOf as L, style as dt, When as E, NotEmpty as Gt, Fragment as V, ForEach as ft, svg as At, svgAttr as ht, Empty as T, emitValue as P, coalesce as Qt, Ensure as Jt, OneOfType as Kt, Repeat as Pt, signal as Ft, input as K, emitValueAsNullableDate as te, emitValueAsNullableDateTime as ee, emitValueAsNumber as G, emit as ne, Task as Bt } from "@tempots/dom";
import { f as se } from "./colors-WfmhQ5e1.js";
import { g as re } from "./timer-DzWb416P.js";
import { ElementRect as jt, AutoSelect as le } from "@tempots/ui";
import { a as X, b as O, f as ae, I as z, C as j, d as yt, T as oe, L as ce, c as Vt, e as ie, B as gt } from "./translations-djDSPqdb.js";
import { C as $t, m as ue, d as pe, I as Ht, E as de, P as fe, S as ct, s as me, e as bt, O as lt, f as Lt } from "./notice-CQZseCQs.js";
class he extends Error {
  constructor(e = "Missing implementation") {
    super(e), this.name = "MissingImplementationError";
  }
}
const un = (t) => ge(t).split("_").join(" "), ge = (t) => (t = t.replace(/::/g, "/"), t = t.replace(/([A-Z]+)([A-Z][a-z])/g, "$1_$2"), t = t.replace(/([a-z\d])([A-Z])/g, "$1_$2"), t = t.replace(/-/g, "_"), t.toLowerCase()), pn = (t) => t.substring(0, 1).toUpperCase() + t.substring(1), be = (t) => {
  if (typeof Buffer < "u")
    return Buffer.from(t, "base64").toString("utf8");
  if (typeof atob < "u")
    return atob(t);
  throw new he(
    "No implementation found for base64 decoding"
  );
};
function Et({
  onChange: t,
  value: e,
  accept: r = "*/*",
  enableClick: n = !0,
  content: s,
  disabled: c = !1,
  allowMultiple: l
}) {
  return H(X, (i) => {
    const o = u.deriveProp(e ?? []), p = et(!1), m = (g) => {
      g.preventDefault(), g.stopPropagation(), p.value = !0;
    }, f = (g) => {
      g.preventDefault(), g.stopPropagation(), (!g.currentTarget || !g.currentTarget.contains(g.relatedTarget)) && (p.value = !1);
    }, v = (g) => {
      g.preventDefault(), g.stopPropagation(), p.value = !1;
      const b = Array.from(g.dataTransfer?.files || []);
      b.length > 0 && (o.value = b, t(b));
    }, d = (g) => {
      u.get(n) && g.currentTarget.querySelector(
        'input[type="file"]'
      )?.click();
    };
    let x = null;
    const h = () => {
      if (x == null) return;
      const g = Array.from(x.files ?? []);
      g.length > 0 && (o.value = g, t(g)), x.value = "";
    }, y = (g) => {
      u.get(n) && (g.key === "Enter" || g.key === " ") && (g.preventDefault(), d(g));
    };
    return I.div(
      a.role("button"),
      a.tabindex(
        u.map(n, (g) => g ? 0 : -1)
      ),
      a.style("position: relative;"),
      C.dragover(m),
      C.dragleave(f),
      C.drop(v),
      C.click(d),
      C.keydown(y),
      // Hidden file input
      I.input(
        a.type("file"),
        a.disabled(c),
        a.accept(r),
        a.multiple(l),
        a.style(
          "position: absolute; left: -9999px; opacity: 0; pointer-events: none;"
        ),
        C.change(h),
        it((g) => (x = g, W(
          o.on((b) => {
            const D = globalThis.DataTransfer;
            if (D != null) {
              const k = new D();
              b.forEach((_) => k.items.add(_)), g.files = k.files;
            }
          })
        )))
      ),
      // Screen reader instructions
      N.label(_t(i.$.dropZoneInstructions)(n)),
      // Content
      s({ files: o, clear: () => o.value = [], change: o.set })
    );
  });
}
function ve(t, e) {
  return t.length === e.length && t.every((r, n) => r === e[n]);
}
function xe(t, e) {
  const r = ["bc-segmented-control", `bc-segmented-control--size-${t}`];
  return e && r.push("bc-segmented-control--disabled"), r.join(" ");
}
function dn({
  options: t,
  value: e,
  onChange: r,
  size: n = "md",
  disabled: s = !1
}, ...c) {
  const l = se(t).map(([i, o]) => ({
    key: i,
    label: o
  }));
  return it(() => {
    const i = Object.fromEntries(
      l.map((p, m) => [p.key, m])
    ), o = et(
      l.map(() => ({ left: 0, width: 0 })),
      ve
    );
    return I.div(
      a.class(
        L(
          n,
          s
        )(
          (p, m) => xe(p ?? "md", m ?? !1)
        )
      ),
      I.div(
        a.class("bc-segmented-control__container"),
        I.div(
          a.class("bc-segmented-control__indicator"),
          dt.width(
            L(
              e,
              o
            )((p, m) => {
              const { width: f } = m[i[p] ?? 0];
              return `${f}px`;
            })
          ),
          dt.left(
            L(
              e,
              o
            )((p, m) => {
              const { left: f } = m[i[p] ?? 0];
              return `${f}px`;
            })
          )
        ),
        // clickable buttons
        l.map(({ label: p, key: m }, f) => I.button(
          a.type("button"),
          C.click((v) => {
            v.preventDefault(), u.get(s) || r?.(m);
          }),
          a.disabled(s),
          a.class("bc-segmented-control__segment"),
          a.class(
            u.map(e, (v) => v === m ? "bc-segmented-control__segment--active" : "bc-segmented-control__segment--inactive")
          ),
          jt((v) => {
            function d() {
              o.update((h) => {
                const y = [...h];
                return y[f] = {
                  width: v.value.width,
                  left: v.value.localLeft
                }, y;
              });
            }
            const x = re(d);
            return W(x, v.on(d));
          }),
          p
        ))
      ),
      ...c
    );
  });
}
function we(t) {
  const e = t.type.toLowerCase();
  return e.startsWith("image/") && (e.includes("jpeg") || e.includes("jpg") || e.includes("png") || e.includes("gif") || e.includes("webp") || e.includes("svg"));
}
function _e(t) {
  const e = t.type.toLowerCase();
  return e.startsWith("image/") ? "vscode-icons:file-type-image" : e.startsWith("video/") ? "vscode-icons:file-type-video" : e.startsWith("audio/") ? "vscode-icons:file-type-audio" : e.includes("pdf") ? "vscode-icons:file-type-pdf2" : e.includes("word") || e.includes("document") ? "vscode-icons:file-type-word" : e.includes("excel") || e.includes("spreadsheet") ? "vscode-icons:file-type-excel" : e.includes("powerpoint") || e.includes("presentation") ? "vscode-icons:file-type-powerpoint" : e.includes("zip") || e.includes("archive") ? "vscode-icons:file-type-zip" : e.includes("text") ? "vscode-icons:file-type-text" : e.includes("json") ? "vscode-icons:file-type-json-official" : e.includes("csv") ? "vscode-icons:file-type-csv" : e.includes("xml") ? "vscode-icons:file-type-xml" : e.includes("yaml") ? "vscode-icons:file-type-yaml-official" : "vscode-icons:file-type-binary";
}
function Ut(t) {
  return E(
    t.map(we),
    () => {
      const e = et(null);
      return t.on((r) => {
        e.value && URL.revokeObjectURL(e.value);
        const n = URL.createObjectURL(r);
        e.value = n;
      }), I.div(
        a.class("bc-file-input__thumbnail-container"),
        I.img(
          a.src(e),
          a.alt(t.map((r) => r.name)),
          a.class("bc-file-input__thumbnail"),
          W(() => {
            e.value && URL.revokeObjectURL(e.value);
          })
        )
      );
    },
    () => z({ icon: t.map(_e) })
  );
}
const ye = (t, ...e) => {
  const {
    value: r = et([]),
    accept: n = "*/*",
    maxFiles: s,
    maxFileSize: c,
    onChange: l,
    onBlur: i,
    disabled: o,
    hasError: p,
    mode: m = "default",
    showFileList: f = !0,
    ...v
  } = t, d = r, x = u.map(m, (k) => k === "compact"), h = (k) => {
    let _ = k;
    if (s != null) {
      const w = u.get(s);
      _ = _.slice(0, w);
    }
    if (c) {
      const w = u.get(c);
      _ = _.filter(($) => $.size <= w);
    }
    l?.(_);
  }, y = (k) => {
    const w = d.value.filter(($, M) => M !== k);
    l?.(w);
  }, g = () => {
    l?.([]);
  }, b = ({
    files: k,
    clear: _,
    change: w
  }) => H(
    X,
    ($) => I.div(
      a.class("bc-file-input__drop-zone"),
      I.div(
        a.class(
          "bc-file-input__drop-zone-content bc-file-input__drop-zone-content--empty"
        ),
        z({ icon: "mdi:cloud-upload-outline", size: "xl" }),
        I.div(
          a.class("bc-file-input__drop-zone-text"),
          _t($.$.filesInputInstructions)(
            s,
            c,
            $.$.fileSizeUnits.value
          )
        )
      )
    )
  ), D = ({
    files: k
  }) => H(
    X,
    (_) => I.div(
      a.class("bc-file-input__compact-input"),
      E(
        k.map((w) => w.length > 0),
        () => I.span(
          a.class("bc-file-input__compact-value"),
          ft(
            k,
            (w) => I.span(
              a.class("bc-file-input__compact-value-item"),
              Ut(w),
              I.span(
                a.class("bc-file-input__compact-value-item-name"),
                w.$.name
              )
            )
          )
        ),
        () => I.span(
          a.class("bc-file-input__compact-placeholder"),
          z({ icon: "mdi:cloud-upload-outline", size: "sm" }),
          " ",
          _t(_.$.filesInputInstructions)(
            s,
            c,
            _.$.fileSizeUnits.value
          )
        )
      )
    )
  );
  return H(
    X,
    (k) => O(
      {
        baseContainer: u.map(x, (_) => !_),
        disabled: o,
        hasError: p,
        after: E(
          x,
          () => E(
            d.map(({ length: _ }) => _ > 0),
            () => $t(
              {
                size: "sm",
                label: k.$.clearAllFiles,
                disabled: o,
                onClick: g
              },
              a.class("bc-file-input__compact-clear")
            )
          )
        ),
        ...v,
        input: E(
          x,
          () => I.div(
            a.class("bc-file-input bc-file-input--compact"),
            Et({
              value: d,
              accept: n,
              enableClick: !0,
              allowMultiple: u.map(s ?? 1 / 0, (_) => _ > 1),
              disabled: o,
              onChange: h,
              content: D
            })
          ),
          () => I.div(
            a.class("bc-file-input"),
            Et({
              value: d,
              accept: n,
              enableClick: !0,
              allowMultiple: u.map(s ?? 1 / 0, (_) => _ > 1),
              disabled: o,
              onChange: h,
              content: b
            }),
            E(
              f,
              () => Gt(
                d,
                () => V(
                  I.div(
                    a.class("bc-file-input__file-list"),
                    ft(d, (_, w) => {
                      const $ = w.index;
                      return I.div(
                        a.class("bc-file-input__file-item"),
                        I.div(
                          a.class("bc-file-input__file-icon"),
                          Ut(_)
                        ),
                        I.div(
                          a.class("bc-file-input__file-info"),
                          I.div(
                            a.class("bc-file-input__file-name"),
                            a.title(_.$.name),
                            _.$.name
                          ),
                          I.div(
                            a.class("bc-file-input__file-meta"),
                            L(
                              _.$.size,
                              k.$.fileSizeUnits
                            )(
                              (M, A) => ae(M, { units: A })
                            ),
                            " • ",
                            L(
                              _.$.type,
                              k.$.unknownType
                            )((M, A) => M || A)
                          )
                        ),
                        $t(
                          {
                            size: "sm",
                            label: k.$.removeFile,
                            disabled: o,
                            onClick: () => y($)
                          },
                          a.class("bc-file-input__remove-button")
                        )
                      );
                    })
                  ),
                  E(
                    d.map(({ length: _ }) => _ > 1),
                    () => I.div(
                      a.class(
                        "bc-file-input__clear-all-button-container"
                      ),
                      I.button(
                        a.type("button"),
                        a.class("bc-file-input__clear-all-button"),
                        a.disabled(o),
                        k.$.clearAllFiles,
                        C.click((_) => {
                          _.preventDefault(), _.stopPropagation(), g();
                        })
                      )
                    )
                  )
                )
              )
            )
          )
        )
      },
      ...e
    )
  );
};
async function $e(t) {
  return new Promise((e, r) => {
    const n = new FileReader();
    n.readAsDataURL(t), n.onload = () => {
      const s = n.result;
      e(s.split(",")[1]);
    }, n.onerror = (s) => r(s);
  });
}
function ke(t) {
  return Promise.all(t.map($e));
}
function Ie(t) {
  if (t.length >= 4) {
    if (t[0] === 137 && t[1] === 80 && t[2] === 78 && t[3] === 71)
      return "image/png";
    if (t[0] === 255 && t[1] === 216) return "image/jpeg";
    if (t[0] === 71 && t[1] === 73 && t[2] === 70)
      return "image/gif";
    if (t[0] === 82 && t[1] === 73 && t[2] === 70 && t[3] === 70 && t.length >= 12 && t[8] === 87 && t[9] === 69 && t[10] === 66 && t[11] === 80)
      return "image/webp";
  }
  try {
    if (new TextDecoder("utf-8").decode(t.slice(0, 256)).includes("<svg")) return "image/svg+xml";
  } catch {
  }
  return "application/octet-stream";
}
function Ce(t) {
  const e = be(t ?? ""), r = e.length, n = new Uint8Array(r);
  for (let s = 0; s < r; s++) n[s] = e.charCodeAt(s);
  return n;
}
function Me(t) {
  const {
    value: e,
    onChange: r,
    onInput: n,
    ...s
  } = t, c = /* @__PURE__ */ new Map(), l = u.toSignal(e).map((m) => m.map((f, v) => {
    const d = c.get(f), x = Ce(f ?? ""), h = d?.type || Ie(x), y = d?.name ?? `file-${v}`, g = x.buffer.slice(
      x.byteOffset,
      x.byteOffset + x.byteLength
    ), b = new Blob([g], { type: h });
    return new File([b], y, { type: h });
  })), i = (m) => (f) => {
    m && ke(f).then((v) => {
      for (const [d, x] of v.entries())
        c.set(x, { name: f[d].name, type: f[d].type });
      m(v);
    });
  }, o = i(r), p = i(n);
  return ye({
    ...s,
    value: l,
    onChange: o,
    onInput: p
  });
}
function fn(t) {
  const {
    value: e,
    onInput: r,
    onChange: n,
    ...s
  } = t;
  return Me({
    ...s,
    maxFiles: 1,
    value: u.map(e, (c) => c == null ? [] : [c]),
    onChange: (c) => {
      n?.(c[0]);
    },
    onInput: (c) => {
      r?.(c[0]);
    }
  });
}
function kt(t) {
  const e = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);
  return e ? [parseInt(e[1], 16), parseInt(e[2], 16), parseInt(e[3], 16)] : [0, 0, 0];
}
function It(t, e, r) {
  const n = (s) => s.toString(16).padStart(2, "0");
  return `#${n(Math.max(0, Math.min(255, t)))}${n(
    Math.max(0, Math.min(255, e))
  )}${n(Math.max(0, Math.min(255, r)))}`;
}
function De(t) {
  if (!t) return [0, 0, 0, 1];
  const r = t.trim().match(
    /^#?([a-fA-F0-9]{3,4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$/
  );
  if (r) {
    const f = r[1];
    if (f.length === 8) {
      const v = parseInt(f.slice(0, 2), 16), d = parseInt(f.slice(2, 4), 16), x = parseInt(f.slice(4, 6), 16), h = parseInt(f.slice(6, 8), 16) / 255;
      return [v, d, x, h];
    }
    if (f.length === 6)
      return [
        parseInt(f.slice(0, 2), 16),
        parseInt(f.slice(2, 4), 16),
        parseInt(f.slice(4, 6), 16),
        1
      ];
    if (f.length === 4) {
      const v = parseInt(f[0] + f[0], 16), d = parseInt(f[1] + f[1], 16), x = parseInt(f[2] + f[2], 16), h = parseInt(f[3] + f[3], 16) / 255;
      return [v, d, x, h];
    }
    if (f.length === 3) {
      const v = parseInt(f[0] + f[0], 16), d = parseInt(f[1] + f[1], 16), x = parseInt(f[2] + f[2], 16);
      return [v, d, x, 1];
    }
  }
  const n = t.match(
    /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0|1|0?\.\d+)\s*\)$/i
  );
  if (n)
    return [
      parseInt(n[1], 10),
      parseInt(n[2], 10),
      parseInt(n[3], 10),
      parseFloat(n[4])
    ];
  const s = t.match(
    /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i
  );
  if (s)
    return [parseInt(s[1], 10), parseInt(s[2], 10), parseInt(s[3], 10), 1];
  const c = t.match(
    /^hsla?\(\s*([+-]?[\d.]+)(?:deg)?\s*[ ,]?\s*([\d.]+)%\s*[ ,]?\s*([\d.]+)%\s*(?:[/,]\s*(\d?(?:\.\d+)?))?\s*\)$/i
  );
  if (c) {
    const f = parseFloat(c[1]), v = parseFloat(c[2]), d = parseFloat(c[3]), x = c[4] != null ? parseFloat(c[4]) : 1, [h, y, g] = Wt(f, v / 100, d / 100);
    return [h, y, g, x];
  }
  const l = t.match(
    /^hwb\(\s*([+-]?[\d.]+)(?:deg)?\s*[, ]\s*([\d.]+)%\s*[, ]\s*([\d.]+)%\s*(?:[/]\s*(\d?(?:\.\d+)?))?\s*\)$/i
  );
  if (l) {
    const f = parseFloat(l[1]), v = parseFloat(l[2]) / 100, d = parseFloat(l[3]) / 100, x = l[4] != null ? parseFloat(l[4]) : 1, [h, y, g] = Ae(f, v, d);
    return [h, y, g, x];
  }
  const i = t.match(
    /^oklch\(\s*([+-]?[\d.]+%?)\s+([\d.]+)\s+([+-]?[\d.]+)(?:deg)?(?:\s*\/\s*(\d?(?:\.\d+)?))?\s*\)$/i
  );
  if (i) {
    const f = i[1], v = parseFloat(i[2]), d = parseFloat(i[3]), x = i[4] != null ? parseFloat(i[4]) : 1, h = f.endsWith("%") ? Math.max(0, Math.min(1, parseFloat(f) / 100)) : Math.max(0, Math.min(1, parseFloat(f))), [y, g, b] = Be(h, v, d);
    return [y, g, b, x];
  }
  const [o, p, m] = kt(t);
  return [o, p, m, 1];
}
const Se = (t, e, r, n) => `rgba(${Math.round(t)}, ${Math.round(e)}, ${Math.round(r)}, ${Math.max(
  0,
  Math.min(1, Math.round(n * 100) / 100)
)})`;
function Te(t) {
  let e = t + 1831565813;
  return function() {
    return e = Math.imul(e ^ e >>> 15, e | 1), e ^= e + Math.imul(e ^ e >>> 7, e | 61), ((e ^ e >>> 14) >>> 0) / 4294967296;
  };
}
function Wt(t, e, r) {
  t = (t % 360 + 360) % 360;
  const n = (1 - Math.abs(2 * r - 1)) * e, s = n * (1 - Math.abs(t / 60 % 2 - 1)), c = r - n / 2;
  let l = 0, i = 0, o = 0;
  return 0 <= t && t < 60 ? [l, i, o] = [n, s, 0] : 60 <= t && t < 120 ? [l, i, o] = [s, n, 0] : 120 <= t && t < 180 ? [l, i, o] = [0, n, s] : 180 <= t && t < 240 ? [l, i, o] = [0, s, n] : 240 <= t && t < 300 ? [l, i, o] = [s, 0, n] : [l, i, o] = [n, 0, s], [
    Math.round((l + c) * 255),
    Math.round((i + c) * 255),
    Math.round((o + c) * 255)
  ];
}
function Ae(t, e, r) {
  t = (t % 360 + 360) % 360;
  const n = e + r;
  n > 1 && (e /= n, r /= n);
  const [s, c, l] = Wt(t, 1, 0.5).map((f) => f / 255), i = 1 - e - r, o = s * i + e, p = c * i + e, m = l * i + e;
  return [Math.round(o * 255), Math.round(p * 255), Math.round(m * 255)];
}
function Ct(t, e, r) {
  t /= 255, e /= 255, r /= 255;
  const n = Math.max(t, e, r), s = Math.min(t, e, r);
  let c = 0, l = 0;
  const i = (n + s) / 2, o = n - s;
  if (o !== 0) {
    switch (l = i > 0.5 ? o / (2 - n - s) : o / (n + s), n) {
      case t:
        c = (e - r) / o + (e < r ? 6 : 0);
        break;
      case e:
        c = (r - t) / o + 2;
        break;
      default:
        c = (t - e) / o + 4;
    }
    c *= 60;
  }
  return [Math.round(c), Math.round(l * 100), Math.round(i * 100)];
}
function Fe(t, e, r) {
  const [n] = Ct(t, e, r), s = t / 255, c = e / 255, l = r / 255, i = Math.min(s, c, l), o = 1 - Math.max(s, c, l);
  return [n, Math.round(i * 100), Math.round(o * 100)];
}
function vt(t) {
  const e = t / 255;
  return e <= 0.04045 ? e / 12.92 : Math.pow((e + 0.055) / 1.055, 2.4);
}
function xt(t) {
  const e = t <= 31308e-7 ? 12.92 * t : 1.055 * Math.pow(t, 0.4166666666666667) - 0.055;
  return Math.round(Math.max(0, Math.min(1, e)) * 255);
}
function Be(t, e, r) {
  const n = r * Math.PI / 180, s = Math.cos(n) * e, c = Math.sin(n) * e, l = t + 0.3963377774 * s + 0.2158037573 * c, i = t - 0.1055613458 * s - 0.0638541728 * c, o = t - 0.0894841775 * s - 1.291485548 * c, p = l * l * l, m = i * i * i, f = o * o * o, v = 4.0767416621 * p - 3.3077115913 * m + 0.2309699292 * f, d = -1.2684380046 * p + 2.6097574011 * m - 0.3413193965 * f, x = -0.0041960863 * p - 0.7034186147 * m + 1.707614701 * f;
  return [xt(v), xt(d), xt(x)];
}
function Ve(t, e, r) {
  const n = vt(t), s = vt(e), c = vt(r), l = 0.4122214708 * n + 0.5363325363 * s + 0.0514459929 * c, i = 0.2119034982 * n + 0.6806995451 * s + 0.1073969566 * c, o = 0.0883024619 * n + 0.2817188376 * s + 0.6299787005 * c, p = Math.cbrt(l), m = Math.cbrt(i), f = Math.cbrt(o), v = 0.2104542553 * p + 0.793617785 * m - 0.0040720468 * f, d = 1.9779984951 * p - 2.428592205 * m + 0.4505937099 * f, x = 0.0259040371 * p + 0.7827717662 * m - 0.808675766 * f, h = Math.sqrt(d * d + x * x);
  let y = Math.atan2(x, d) * 180 / Math.PI;
  return y < 0 && (y += 360), [v, h, y];
}
function at(t, e, r, n, s, c) {
  switch (s) {
    case "hex":
      if (c) {
        const l = (o) => o.toString(16).padStart(2, "0"), i = Math.max(0, Math.min(255, Math.round(n * 255)));
        return `#${l(t)}${l(e)}${l(r)}${l(i)}`;
      }
      return It(t, e, r);
    case "rgb":
      return `rgb(${t}, ${e}, ${r})`;
    case "rgba":
      return `rgba(${t}, ${e}, ${r}, ${Math.round(n * 100) / 100})`;
    case "hsl": {
      const [l, i, o] = Ct(t, e, r);
      return `hsl(${l}, ${i}%, ${o}%)`;
    }
    case "hsla": {
      const [l, i, o] = Ct(t, e, r);
      return `hsla(${l}, ${i}%, ${o}%, ${Math.round(n * 100) / 100})`;
    }
    case "hwb": {
      const [l, i, o] = Fe(t, e, r);
      return n < 1 ? `hwb(${l} ${i}% ${o}% / ${Math.round(n * 100) / 100})` : `hwb(${l} ${i}% ${o}%)`;
    }
    case "oklch": {
      const [l, i, o] = Ve(t, e, r), p = (Math.round(l * 1e3) / 1e3).toFixed(3), m = (Math.round(i * 1e3) / 1e3).toFixed(3), f = (Math.round(o * 10) / 10).toFixed(1), v = Math.round(n * 100) / 100;
      return c || n < 1 ? `oklch(${p} ${m} ${f} / ${v})` : `oklch(${p} ${m} ${f})`;
    }
  }
}
function ot(t, e) {
  return e ? t === "rgb" ? "rgba" : t === "hsl" ? "hsla" : t : t === "rgba" ? "rgb" : t === "hsla" ? "hsl" : t;
}
function Le(t, e) {
  const [r, n, s] = t, c = r << 16 ^ n << 8 ^ s, l = Te(c), i = 6 + Math.floor(l() * 5), o = 0.18 + l() * 0.06, p = [];
  for (let d = 0; d < i; d++) {
    const x = d / i * Math.PI * 2, h = e * (1 + (l() * 2 - 1) * o), y = Math.cos(x) * h, g = Math.sin(x) * h;
    p.push({ x: y, y: g });
  }
  const m = (p[0].x + p[i - 1].x) / 2, f = (p[0].y + p[i - 1].y) / 2;
  let v = `M ${m.toFixed(3)} ${f.toFixed(3)}`;
  for (let d = 0; d < i; d++) {
    const x = p[d], h = p[(d + 1) % i], y = (x.x + h.x) / 2, g = (x.y + h.y) / 2;
    v += ` Q ${x.x.toFixed(3)} ${x.y.toFixed(3)} ${y.toFixed(3)} ${g.toFixed(3)}`;
  }
  return v += " Z", v;
}
const mn = (t) => {
  const { value: e, onBlur: r, onChange: n, onInput: s, displayValue: c, size: l, withAlpha: i } = t, o = u.map(l ?? 32, (w) => w), p = u.map(e, (w) => De(w ?? "#000000")), m = u.map(
    p,
    ([w, $, M]) => [w, $, M]
  ), f = u.map(p, ([, , , w]) => w), v = et(u.get(f) ?? 1), d = u.map(i ?? !1, (w) => w), x = u.map(
    t.colorTextFormat ?? "rgb",
    (w) => w
  ), h = L(
    m,
    v,
    x,
    d
  )(
    ([w, $, M], A, F, S) => at(w, $, M, A ?? 1, ot(F, S), S)
  ), y = u.map(
    t.colorTextFormat ?? "hex",
    (w) => w
  ), g = u.map(o, (w) => `${-w / 2} ${-w / 2} ${w} ${w}`), b = L(
    m,
    o
  )((w, $) => Le(w, $ / 2)), D = L(
    m,
    v,
    d
  )(
    ([w, $, M], A, F) => F || A < 1 ? Se(w, $, M, A) : It(w, $, M)
  ), k = I.div(
    a.class("bc-color-input__control"),
    a.class(
      u.map(
        d,
        (w) => w ? "bc-color-input__control--alpha" : ""
      )
    ),
    a.style(
      L(o)((w) => `min-width:${w + 2}px;height:${w + 2}px`)
    ),
    // The SVG blob preview
    At.svg(
      a.class("bc-color-input__svg"),
      ht.viewBox(g),
      At.path(ht.d(b), ht.fill(D))
    ),
    // Invisible native input overlays the blob for picker and accessibility
    I.input(
      a.type("color"),
      j(t),
      // Native color input needs hex without alpha
      a.value(u.map(m, ([w, $, M]) => It(w, $, M))),
      a.class("bc-input bc-color-input bc-color-input__native"),
      r != null ? C.blur(r) : T,
      n != null ? C.change((w) => {
        const $ = w.target.value;
        if (!n) return;
        const [M, A, F] = kt($), S = u.get(v) ?? 1, B = ot(
          u.get(y),
          u.get(d)
        ), R = at(M, A, F, S, B, u.get(d));
        n(R);
      }) : T,
      s != null ? C.input((w) => {
        const $ = w.target.value;
        if (!s) return;
        const [M, A, F] = kt($), S = u.get(v) ?? 1, B = ot(
          u.get(y),
          u.get(d)
        ), R = at(M, A, F, S, B, u.get(d));
        s(R);
      }) : T
    )
  ), _ = E(
    d,
    () => I.input(
      a.type("range"),
      a.class("bc-color-input__alpha"),
      a.min(0),
      a.max(1),
      a.step(0.01),
      a.value(u.map(v, (w) => String(w ?? 1))),
      a.disabled(t.disabled),
      C.input((w) => {
        const $ = parseFloat(w.target.value);
        v.set($);
        const [M, A, F] = u.get(m), S = ot(
          u.get(y),
          u.get(d)
        ), B = at(M, A, F, $, S, u.get(d));
        s?.(B);
      }),
      C.change((w) => {
        const $ = parseFloat(w.target.value);
        v.set($);
        const [M, A, F] = u.get(m), S = ot(
          u.get(y),
          u.get(d)
        ), B = at(M, A, F, $, S, u.get(d));
        n?.(B);
      })
    )
  );
  return O({
    baseContainer: !0,
    ...t,
    // ensure our control does not try to grow
    growInput: !1,
    input: k,
    // If caller provided an `after`, append RGB before it
    after: V(
      E(
        c ?? !1,
        () => I.span(a.class("bc-color-input__rgb"), h)
      ),
      _,
      t.after
    )
  });
}, Dt = "$$tts-exp-", Ee = (t, e) => it((r) => {
  const n = `${Dt}${t}`;
  return W(u.on(e, (s) => Reflect.set(r, n, s)));
}), hn = (t, e) => {
  const r = `${Dt}${t}`;
  return (n) => {
    e(Reflect.get(n.target, r));
  };
}, Ue = (t, e) => {
  const r = `${Dt}${t}`;
  return (n) => {
    const s = n.target, c = s.selectedIndex, l = s.options[c];
    e(Reflect.get(l, r));
  };
};
function Ne(t, e, r) {
  const n = ["bc-card"];
  return t !== "default" && n.push(`bc-card--${t}`), e !== "md" && n.push(`bc-card--padding-${e}`), r !== "lg" && n.push(`bc-card--rounded-${r}`), n.join(" ");
}
function gn({ variant: t = "default", size: e = "md", roundedness: r = "lg" } = {}, ...n) {
  return I.div(
    a.class(
      L(
        t,
        e,
        r
      )(
        (s, c, l) => Ne(
          s ?? "default",
          c ?? "md",
          l ?? "lg"
        )
      )
    ),
    ...n
  );
}
function pt(...t) {
  return I.div(a.class("bc-group"), ...t);
}
const bn = ({
  startEditing: t,
  value: e,
  onChange: r,
  placeholder: n,
  disabled: s
}) => {
  const c = u.deriveProp(t ?? !1), l = et(!1), i = u.map(s ?? !1, (o) => o);
  return I.div(
    a.class("bc-editable-text"),
    a.class(
      u.map(
        i,
        (o) => o ? "bc-editable-text--disabled" : ""
      )
    ),
    N.disabled(i),
    E(
      c,
      () => I.input(
        a.placeholder(n),
        a.value(e),
        a.class("bc-editable-text__input"),
        le(),
        C.keydown((o) => {
          o.key === "Enter" ? c.set(!1) : o.key === "Escape" && (l.set(!0), c.set(!1));
        }),
        C.blur(
          P((o) => {
            if (c.set(!1), l.value) {
              l.set(!1);
              return;
            }
            r(o);
          })
        )
      ),
      () => I.span(
        C.click(() => {
          u.get(i) || c.set(!0);
        }),
        a.class("bc-editable-text__display"),
        E(
          u.map(e, (o) => o != null && o.trim() !== ""),
          () => I.span(a.class("bc-editable-text__text"), e),
          () => I.span(
            a.class("bc-editable-text__placeholder"),
            n
          )
        ),
        E(
          u.map(i, (o) => !o),
          () => I.button(
            a.type("button"),
            a.class("bc-editable-text__edit-button"),
            H(X, (o) => N.label(o.$.editLabel)),
            C.click(() => c.set(!0)),
            z({ icon: "line-md/pencil", color: "neutral" })
          )
        )
      )
    )
  );
}, Zt = (t, e, r) => Jt(
  t,
  (n) => Kt(n, {
    value: (s) => {
      const c = L(
        s,
        r
      )((l, i) => e(l.value, i));
      return I.option(
        W(c.dispose),
        a.selected(c),
        Ee("value", s.$.value),
        s.$.label
      );
    },
    group: (s) => I.optgroup(
      a.label(s.$.group),
      ft(
        s.$.options,
        (c) => Zt(
          c,
          e,
          r
        )
      )
    ),
    break: () => I.hr()
  })
), ze = (t) => {
  const {
    value: e,
    onBlur: r,
    onChange: n,
    options: s,
    unselectedLabel: c,
    equality: l = (p, m) => p === m,
    after: i
  } = t;
  let o;
  return O(
    {
      ...t,
      after: V(
        z({
          icon: "ph:caret-down-bold",
          color: "neutral",
          size: "sm"
        }),
        i
      ),
      input: I.select(
        it((p) => {
          o = p;
          const m = new MutationObserver((f) => {
            const { removedNodes: v } = f[0];
            v.length > 0 && (o.selectedIndex = 0);
          });
          return m.observe(p, { childList: !0 }), W(() => m.disconnect());
        }),
        j(t),
        a.class("bc-native-select bc-input"),
        H(
          X,
          (p) => I.option(
            a.hidden("hidden"),
            Qt(c, p.$.selectOne)
          )
        ),
        ft(s, (p) => Zt(p, l, e)),
        r != null ? C.blur(r) : T,
        n != null ? C.change(Ue("value", (p) => n(p))) : T
      )
    },
    C.click(() => {
      o?.focus(), typeof o?.showPicker == "function" && o.showPicker();
    })
  );
};
function Re(t) {
  const { controller: e, onChange: r, onBlur: n, ...s } = t;
  return ze({
    ...s,
    value: e.signal,
    onChange: pe(e, r),
    onBlur: ue(e, n)
  });
}
function vn(t) {
  return Ht({
    ...t,
    content: Re(t)
  });
}
function Oe(t, e, r) {
  const n = t.length.map((s) => s);
  return V(
    W(() => n.dispose()),
    Pt(
      n,
      (s) => {
        const c = t.item(s.index), l = [];
        return V(
          W(() => {
            c.dispose(), l.forEach((i) => i());
          }),
          e({
            list: t,
            item: c,
            position: s,
            remove: () => t.removeAt(s.index),
            move: (i) => {
              switch (i) {
                case "up":
                  if (s.index === 0) return;
                  t.move(s.index, s.index - 1);
                  break;
                case "down":
                  if (s.index === t.length.value - 1) return;
                  t.move(s.index, s.index + 1);
                  break;
                case "first":
                  t.move(s.index, 0);
                  break;
                case "last":
                  t.move(s.index, t.length.value - 1);
              }
            },
            canMove: (i) => {
              const o = (() => {
                switch (i) {
                  case "up":
                    return Ft(s.index > 0);
                  case "down":
                    return t.length.map((p) => s.index < p - 1);
                }
              })();
              return l.push(() => o.dispose()), o;
            },
            cannotMove: (i) => {
              const o = (() => {
                switch (i) {
                  case "up":
                    return Ft(s.index === 0);
                  case "down":
                    return t.length.map((p) => s.index === p - 1);
                }
              })();
              return l.push(() => o.dispose()), o;
            }
          })
        );
      },
      r
    )
  );
}
const Nt = {
  9: { pattern: /^[0-9]$/ },
  A: { pattern: /^[A-Za-z]$/, transform: (t) => t.toUpperCase() },
  "*": { pattern: /^.$/ }
}, Pe = (t) => t instanceof RegExp;
function Yt(t, e, r) {
  if (t == null) return [];
  const n = r ? { ...Nt, ...e } : e ?? Nt, s = (l, i) => {
    const o = n[i];
    o ? l.push({ type: "pattern", name: i, ...o }) : l.push({ type: "literal", char: i });
  }, c = [];
  if (typeof t == "string") {
    for (const l of t) s(c, l);
    return c;
  }
  for (const l of t)
    if (typeof l == "string")
      if (l.length <= 1) s(c, l);
      else for (const i of l) s(c, i);
    else Pe(l) ? c.push({ type: "pattern", pattern: l }) : typeof l == "object" && l && c.push(l);
  return c;
}
function je(t, e) {
  return (r) => {
    switch (t) {
      case "digits":
        return /[0-9]/.test(r);
      case "letters":
        return /[A-Za-z]/.test(r);
      case "alphanumeric":
        return /[A-Za-z0-9]/.test(r);
      case "custom":
        return e?.(r) ?? !0;
      default:
        return !0;
    }
  };
}
function zt(t, e, r, n, s, c) {
  const l = {
    raw: t,
    previousConformed: e,
    cursor: s ?? t.length,
    completed: !1
  }, i = n.definitions ?? {}, o = typeof r == "function" ? r(t, l) : r, p = Yt(
    o,
    i,
    n.useDefaultDefinitions ?? !0
  ), m = je(n.allowMode, n.allow), f = /* @__PURE__ */ new Set();
  for (const S of p) S.type === "literal" && f.add(S.char);
  if (n.prefix) for (const S of n.prefix) f.add(S);
  if (n.suffix) for (const S of n.suffix) f.add(S);
  const v = Array.from(t).filter((S) => m(S) && !f.has(S));
  if (v.length === 0) return { value: "", cursor: 0, completed: !1 };
  const d = [], x = [];
  let h = 0, y = 0, g = 0, b = -1;
  for (const S of p) {
    if (S.type === "literal") {
      d.push(S.char), x.push({ kind: "literal", filled: !0 });
      continue;
    }
    y += S.optional ? 0 : 1;
    const B = v[h];
    if (B == null)
      break;
    if (S.type === "any") {
      g++, d.push(S.transform ? S.transform(B) : B), x.push({ kind: "slot", filled: !0 }), b = x.length - 1, h++;
      continue;
    }
    if (S.type === "pattern")
      if (S.pattern.test(B)) {
        g++;
        const R = S.transform ? S.transform(B) : B;
        d.push(R), x.push({ kind: "slot", filled: !0 }), b = x.length - 1, h++;
      } else {
        h++;
        continue;
      }
  }
  const D = d.join(""), k = (n.prefix ?? "") + D + (n.suffix ?? "");
  let w = (n.prefix ?? "").length;
  if (b >= 0) {
    let S = b + 1;
    if ((c?.policy ?? "smart") !== "sticky")
      for (; S < x.length && x[S].kind === "literal"; ) S++;
    w += S;
  }
  const $ = n.completion?.mode === "min" ? (n.completion.minChars ?? 0) <= g : n.completion?.mode === "custom" ? !!n.completion.isComplete?.(k) : y > 0 && g >= y, M = n.pipe?.(k, { ...l, completed: $ });
  let A, F = w;
  return M === !1 ? (A = e, F = e.length) : typeof M == "string" ? (A = M, F = M.length) : typeof M == "object" && M ? (A = M.value, F = M.cursor ?? M.value.length) : A = k, { value: A, cursor: F, completed: $ };
}
function He(t, e) {
  const r = e?.strategy ?? "none";
  return r === "custom" && e?.unmask ? e.unmask(t) : r === "strip" ? t.replace(/[^A-Za-z0-9]/g, "") : t;
}
const Xt = (t) => {
  const {
    value: e,
    onBlur: r,
    onChange: n,
    onInput: s,
    onAccept: c,
    onComplete: l,
    mask: i,
    definitions: o,
    useDefaultDefinitions: p,
    extraLiterals: m,
    prefix: f,
    suffix: v,
    autofix: d,
    pipe: x,
    completion: h,
    unmask: y,
    allowMode: g,
    allow: b,
    placeholder: D,
    placeholderOptions: k
  } = t, _ = L(
    e,
    i,
    o,
    p,
    m,
    f,
    v,
    d,
    h,
    y,
    g,
    D,
    k
  )(($, M, A, F, S, B, R, st, rt, tt, Q, ut, q) => M ? zt($ ?? "", "", M, {
    definitions: A ?? {},
    useDefaultDefinitions: F ?? !0,
    extraLiterals: S ?? [],
    autofix: st ?? "none",
    completion: rt ?? { mode: "mask" },
    pipe: x ?? ((U) => U),
    unmask: tt ?? { strategy: "none" },
    allowMode: Q ?? "all",
    allow: b,
    prefix: B,
    suffix: R
  }).value : $ ?? ""), w = ($, M) => {
    const A = $.value ?? "", F = u.get(e) ?? "", S = i != null ? u.get(i) : null, B = o != null ? u.get(o) : void 0, R = p != null ? u.get(p) : void 0, st = m != null ? u.get(m) : void 0, rt = d != null ? u.get(d) : void 0, tt = h != null ? u.get(h) : void 0, Q = y != null ? u.get(y) : void 0, ut = g != null ? u.get(g) : void 0, q = f != null ? u.get(f) : void 0, U = v != null ? u.get(v) : void 0, {
      value: J,
      cursor: mt,
      completed: St
    } = S ? zt(
      A,
      F,
      S,
      {
        definitions: B ?? {},
        useDefaultDefinitions: R ?? !0,
        extraLiterals: st ?? [],
        autofix: rt ?? "none",
        completion: tt ?? { mode: "mask" },
        pipe: x ?? ((qt) => qt),
        unmask: Q ?? { strategy: "none" },
        allowMode: ut ?? "all",
        allow: b,
        prefix: q,
        suffix: U
      },
      $.selectionStart ?? A.length,
      t.cursor ? u.get(t.cursor) : void 0
    ) : { value: A, cursor: A.length, completed: !0 };
    if (J !== A) {
      $.value = J;
      try {
        $.setSelectionRange(mt, mt);
      } catch {
      }
    }
    const Tt = He(J, Q);
    c?.({
      raw: Tt,
      conformed: J,
      completed: St,
      cursor: mt
    }), M === "input" ? s?.(J) : (n?.(J), St && l?.({ raw: Tt, conformed: J }));
  };
  return O({
    ...t,
    input: K.text(
      j(t),
      a.value(_),
      a.class("bc-input"),
      r != null ? C.blur(r) : T,
      it(
        ($) => $ instanceof HTMLInputElement ? V(
          C.input(() => w($, "input")),
          C.change(() => w($, "change")),
          C.keydown((M) => {
            if (M.key !== "Backspace" || !(t.cursor ? u.get(t.cursor)?.backspaceRubberBand ?? !0 : !0)) return;
            const F = $.selectionStart ?? 0, S = $.selectionEnd ?? F;
            if (F !== S || F <= 0) return;
            const B = $.value ?? "", R = i != null ? u.get(i) : null;
            if (!R) return;
            const st = o != null ? u.get(o) : void 0, rt = p != null ? u.get(p) : !0, tt = f != null ? u.get(f) : void 0, Q = v != null ? u.get(v) : void 0, ut = Yt(
              typeof R == "function" ? R(B, {
                raw: B,
                previousConformed: B,
                cursor: F,
                completed: !1
              }) : R,
              st ?? {},
              rt ?? !0
            ), q = /* @__PURE__ */ new Set();
            for (const U of ut)
              U.type === "literal" && q.add(U.char);
            if (tt) for (const U of tt) q.add(U);
            if (Q) for (const U of Q) q.add(U);
            if (q.has(B[F - 1])) {
              let U = F - 1;
              for (; U >= 0 && q.has(B[U]); ) U--;
              U >= 0 && (M.preventDefault(), M.stopPropagation(), $.value = B.slice(0, U) + B.slice(U + 1), w($, "input"));
            }
          })
        ) : T
      )
    )
  });
};
function Y(t, e, r) {
  const n = u.map(t, (c) => c != null), s = yt.clearValue;
  return E(
    n,
    () => I.button(
      a.type("button"),
      a.class("bc-input-container__reset"),
      N.label(s),
      a.title(s),
      a.disabled(e ?? !1),
      z({ icon: "mdi:close", size: "sm" }),
      C.click((c) => {
        c.preventDefault(), c.stopPropagation(), r?.(null);
      })
    )
  );
}
const xn = (t) => {
  const { value: e, onBlur: r, onChange: n, after: s, disabled: c } = t, l = Y(e, c, n);
  return O({
    ...t,
    input: K.date(
      j(t),
      a.valueAsDate(e),
      a.class("bc-input"),
      r != null ? C.blur(P(r)) : T,
      n != null ? C.change(te(n)) : T
    ),
    after: s != null ? V(l, s) : l
  });
}, We = (t) => {
  const e = t.getFullYear(), r = t.getMonth() + 1, n = t.getDate(), s = t.getHours(), c = t.getMinutes(), l = t.getSeconds();
  return `${e}-${r.toString().padStart(2, "0")}-${n.toString().padStart(2, "0")}T${s.toString().padStart(2, "0")}:${c.toString().padStart(2, "0")}:${l.toString().padStart(2, "0")}`;
}, wn = (t) => {
  const { value: e, onBlur: r, onChange: n, after: s, disabled: c } = t, l = u.map(e, (o) => o != null ? We(o) : null), i = Y(e, c, n);
  return O({
    ...t,
    input: K["datetime-local"](
      j(t),
      a.value(u.map(l, (o) => o ?? null)),
      a.class("bc-input"),
      r != null ? C.blur(P(r)) : T,
      n != null ? C.change(ee(n)) : T
    ),
    after: s != null ? V(i, s) : i
  });
}, Z = (t) => typeof t == "string" && t.trim() === "" ? null : t, nt = (t) => t ?? "", _n = (t) => {
  const { value: e, onBlur: r, onChange: n, onInput: s, after: c, disabled: l, ...i } = t, o = Y(e, l, n);
  return oe({
    ...i,
    value: u.map(e, nt),
    onChange: n != null ? (p) => n(Z(p)) : void 0,
    onInput: s != null ? (p) => s(Z(p)) : void 0,
    onBlur: r,
    after: c != null ? V(o, c) : o
  });
}, yn = (t) => {
  const { value: e, onBlur: r, onChange: n, onInput: s, after: c, disabled: l, ...i } = t, o = Y(e, l, n);
  return de({
    ...i,
    value: u.map(e, nt),
    onChange: n != null ? (p) => n(Z(p)) : void 0,
    onInput: s != null ? (p) => s(Z(p)) : void 0,
    onBlur: r,
    after: c != null ? V(o, c) : o
  });
}, $n = (t) => {
  const { value: e, onBlur: r, onChange: n, onInput: s, after: c, disabled: l, ...i } = t, o = Y(e, l, n);
  return fe({
    ...i,
    value: u.map(e, nt),
    onChange: n != null ? (p) => n(Z(p)) : void 0,
    onInput: s != null ? (p) => s(Z(p)) : void 0,
    onBlur: r,
    after: c != null ? V(o, c) : o
  });
}, Ze = (t) => {
  const { value: e, onBlur: r, onChange: n, onInput: s, rows: c } = t;
  return O({
    ...t,
    input: I.textarea(
      j(t),
      a.rows(c ?? 3),
      a.value(e),
      a.class("bc-input"),
      r != null ? C.blur(P(r)) : T,
      n != null ? C.change(P(n)) : T,
      s != null ? C.input(P(s)) : T
    )
  });
}, kn = (t) => {
  const { value: e, onBlur: r, onChange: n, onInput: s, after: c, disabled: l, ...i } = t, o = Y(e, l, n);
  return Ze({
    ...i,
    value: u.map(e, nt),
    onChange: n != null ? (p) => n(Z(p)) : void 0,
    onInput: s != null ? (p) => s(Z(p)) : void 0,
    onBlur: r,
    after: c != null ? V(o, c) : o
  });
}, In = (t) => {
  const { value: e, step: r, min: n, max: s, onBlur: c, onChange: l, onInput: i, after: o } = t, p = (v) => {
    const d = n != null ? u.get(n) : void 0, x = s != null ? u.get(s) : void 0;
    return d != null && v < d ? d : x != null && v > x ? x : v;
  }, m = r != null ? H(X, (v) => {
    const d = L(
      e,
      n
    )((g, b) => b == null ? !0 : (g ?? 0) > b), x = L(
      e,
      s
    )((g, b) => b == null ? !0 : (g ?? 0) < b), h = (g) => {
      const b = u.get(e) ?? 0, D = u.get(r), k = g?.shiftKey ? 10 : 1, _ = b - D * k, w = n != null ? u.get(n) : void 0;
      if (w != null && _ < w)
        return;
      const $ = p(_);
      $ !== b && l && l($);
    }, y = (g) => {
      const b = u.get(e) ?? 0, D = u.get(r), k = g?.shiftKey ? 10 : 1, _ = b + D * k, w = s != null ? u.get(s) : void 0;
      if (w != null && _ > w)
        return;
      const $ = p(_);
      $ !== b && l && l($);
    };
    return ct(
      a.class("bc-number-input-steppers"),
      // Increment second
      I.button(
        a.type("button"),
        a.class(
          "bc-button bc-number-input-steppers-button bc-number-input-steppers-button--increment"
        ),
        a.disabled(
          L(
            x,
            t.disabled ?? !1
          )((g, b) => !g || b)
        ),
        C.click((g) => y(g)),
        N.label(v.$.incrementValue),
        z({ icon: "line-md:plus", size: "xs" })
      ),
      // Decrement first (matches tests expecting first button to be decrement)
      I.button(
        a.type("button"),
        a.class(
          "bc-button bc-number-input-steppers-button bc-number-input-steppers-button--decrement"
        ),
        a.disabled(
          L(
            d,
            t.disabled ?? !1
          )((g, b) => !g || b)
        ),
        C.click((g) => h(g)),
        N.label(v.$.decrementValue),
        z({ icon: "line-md:minus", size: "xs" })
      )
    );
  }) : null, f = o != null && m != null ? V(m, o) : o ?? m;
  return O({
    ...t,
    input: K.number(
      n != null ? V(
        a.min(n),
        W(
          u.on(n, (v) => {
            v < u.get(e);
          })
        )
      ) : T,
      s != null ? V(
        a.max(s),
        W(
          u.on(s, (v) => {
            v > u.get(e);
          })
        )
      ) : T,
      j(t),
      a.valueAsNumber(e),
      a.step(r),
      a.class("bc-input bc-number-input"),
      c != null ? C.blur(P(c)) : T,
      l != null ? C.change(G(l)) : T,
      i != null ? C.input(G(i)) : T,
      // Add wheel event support when step is defined
      r != null ? C.wheel((v) => {
        v.preventDefault();
        const d = u.get(e) ?? 0, x = u.get(r), h = v.shiftKey ? 10 : 1, y = v.deltaY < 0 ? x * h : -x * h, g = p(d + y);
        g !== d && l && l(g);
      }) : T
    ),
    after: f
  });
}, Rt = (t) => {
  if (t == null || t === "") return null;
  const e = Number(t);
  return Number.isNaN(e) ? null : e;
}, Cn = (t) => {
  const { value: e, step: r, min: n, max: s, onBlur: c, onChange: l, onInput: i, after: o } = t, p = (d) => {
    const x = n != null ? u.get(n) : void 0, h = s != null ? u.get(s) : void 0;
    return x != null && d < x ? x : h != null && d > h ? h : d;
  }, m = (() => {
    if (r == null) return null;
    const d = L(
      e,
      n
    )((b, D) => {
      const k = b ?? 0;
      return D == null ? !0 : k > D;
    }), x = L(
      e,
      s
    )((b, D) => {
      const k = b ?? 0;
      return D == null ? !0 : k < D;
    }), h = (b) => {
      const D = u.get(e) ?? 0, k = u.get(r), _ = b?.shiftKey ? 10 : 1, w = D - k * _, $ = n != null ? u.get(n) : void 0;
      if ($ != null && w < $) return;
      const M = p(w);
      M !== D && l && l(M);
    }, y = (b) => {
      const D = u.get(e) ?? 0, k = u.get(r), _ = b?.shiftKey ? 10 : 1, w = D + k * _, $ = s != null ? u.get(s) : void 0;
      if ($ != null && w > $) return;
      const M = p(w);
      M !== D && l && l(M);
    };
    return ((b, D) => ct(
      a.class("bc-number-input-steppers"),
      I.button(
        a.type("button"),
        a.class(
          "bc-button bc-number-input-steppers-button bc-number-input-steppers-button--increment"
        ),
        a.disabled(
          L(
            x,
            t.disabled ?? !1
          )((k, _) => !k || _)
        ),
        C.click((k) => y(k)),
        N.label(b),
        z({ icon: "line-md:plus", size: "xs" })
      ),
      I.button(
        a.type("button"),
        a.class(
          "bc-button bc-number-input-steppers-button bc-number-input-steppers-button--decrement"
        ),
        a.disabled(
          L(
            d,
            t.disabled ?? !1
          )((k, _) => !k || _)
        ),
        C.click((k) => h(k)),
        N.label(D),
        z({ icon: "line-md:minus", size: "xs" })
      )
    ))(
      yt.incrementValue,
      yt.decrementValue
    );
  })(), f = Y(e, t.disabled, l), v = o != null && m != null ? V(m, f, o) : o != null ? V(f, o) : m != null ? V(m, f) : f;
  return O({
    ...t,
    input: K.number(
      // min/max attributes and reactive watchers (no forced correction)
      n != null ? V(
        a.min(n),
        W(
          u.on(n, (d) => {
          })
        )
      ) : T,
      s != null ? V(
        a.max(s),
        W(
          u.on(s, (d) => {
          })
        )
      ) : T,
      j(t),
      // Represent null as empty string so the field can be cleared
      a.value(u.map(e, (d) => d == null ? "" : String(d))),
      a.step(r),
      a.class("bc-input bc-number-input"),
      c != null ? C.blur(P(c)) : T,
      l != null ? C.change(
        P((d) => {
          const x = Rt(d);
          l(x);
        })
      ) : T,
      i != null ? C.input(
        P((d) => {
          const x = Rt(d);
          i(x);
        })
      ) : T,
      // Wheel support when step is defined
      r != null ? C.wheel((d) => {
        d.preventDefault();
        const x = u.get(e) ?? 0, h = u.get(r), y = d.shiftKey ? 10 : 1, g = d.deltaY < 0 ? h * y : -h * y, b = p(x + g);
        b !== x && l && l(b);
      }) : T
    ),
    after: v
  });
}, Mn = ({
  value: t,
  onChange: e,
  onInput: r,
  onBlur: n,
  offLabel: s,
  onLabel: c,
  disabled: l = !1,
  size: i = "md",
  id: o,
  color: p = "primary"
}) => {
  const m = o ?? me("switch");
  function f(h, y) {
    const g = [
      "bc-switch",
      `bc-switch--size-${y}`,
      `bc-switch--${y}`
    ];
    return h && g.push("bc-switch--disabled"), g.join(" ");
  }
  function v(h) {
    const y = h ?? "primary", g = /* @__PURE__ */ new Map(), b = Vt(y, "solid", "light"), D = Vt(y, "solid", "dark");
    return g.set("--switch-track-on-bg", b.backgroundColor), g.set("--switch-track-on-label", b.textColor), g.set("--switch-track-on-bg-dark", D.backgroundColor), g.set("--switch-track-on-label-dark", D.textColor), g.set(
      "--switch-track-on-border-dark",
      ie(y, "dark")
    ), Array.from(g.entries()).map(([k, _]) => `${k}: ${_}`).join("; ");
  }
  const d = () => {
    u.get(l) || (e?.(!u.get(t)), r?.(!u.get(t)));
  }, x = (h) => {
    u.get(l) || (h.key === " " || h.key === "Enter") && (h.preventDefault(), d());
  };
  return I.div(
    a.class(
      L(
        l ?? !1,
        i
      )(
        (h, y) => f(h ?? !1, y ?? "md")
      )
    ),
    a.style(
      L(p)(
        (h) => v(h)
      )
    ),
    a.id(m),
    a.role("switch"),
    a.tabindex(
      u.map(l, (h) => h ? -1 : 0)
    ),
    N.checked(t),
    N.disabled(l),
    C.click(d),
    C.keydown(x),
    n != null ? C.blur(n) : null,
    I.div(
      a.class("bc-switch__track"),
      a.class(
        u.map(
          t,
          (h) => h ? "bc-switch__track--on" : "bc-switch__track--off"
        )
      ),
      s != null ? I.div(
        N.hidden(!0),
        a.class("bc-switch__track-label bc-switch__track-label--off"),
        a.class(
          u.map(
            t,
            (h) => h ? "bc-switch__track-label--hidden" : "bc-switch__track-label--visible"
          )
        ),
        s
      ) : null,
      c != null ? I.div(
        a.class("bc-switch__track-label bc-switch__track-label--on"),
        a.class(
          u.map(
            t,
            (h) => h ? "bc-switch__track-label--visible" : "bc-switch__track-label--hidden"
          )
        ),
        c
      ) : null,
      jt(
        (h) => H(
          ce,
          ({ direction: y }) => I.div(
            a.class("bc-switch__thumb"),
            a.class(
              u.map(
                t,
                (g) => g ? "bc-switch__thumb--on" : "bc-switch__thumb--off"
              )
            ),
            dt.transform(
              L(
                t,
                h,
                i,
                y
              )((g, { width: b }, D, k) => {
                const _ = (() => {
                  switch (D) {
                    case "xs":
                      return 5;
                    case "sm":
                      return 5.5;
                    case "md":
                      return 6;
                    case "lg":
                      return 7;
                    case "xl":
                      return 8;
                  }
                })(), w = k === "rtl" ? `calc((var(--spacing-base) * ${_}) - ${b}px)` : `calc(${b}px - (var(--spacing-base) * ${_}))`;
                return g ? `translateX(${w})` : "translateX(0)";
              })
            )
          )
        )
      )
    )
  );
}, Ye = (t) => {
  const e = {
    type: "pattern",
    pattern: /[0-9A-Fa-f]/,
    transform: (n) => n.toLowerCase()
  };
  return Xt({
    ...t,
    mask: [
      e,
      e,
      e,
      e,
      e,
      e,
      e,
      e,
      "-",
      e,
      e,
      e,
      e,
      "-",
      e,
      e,
      e,
      e,
      "-",
      e,
      e,
      e,
      e,
      "-",
      e,
      e,
      e,
      e,
      e,
      e,
      e,
      e,
      e,
      e,
      e,
      e
    ],
    // Sensible default placeholder; can be overridden via options.placeholder
    placeholder: t.placeholder ?? "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
  });
}, Dn = (t) => {
  const { value: e, onBlur: r, onChange: n, onInput: s, after: c, disabled: l, ...i } = t, o = Y(e, l, n);
  return Ye({
    ...i,
    value: u.map(e, nt),
    onChange: n != null ? (p) => n(Z(p)) : void 0,
    onInput: s != null ? (p) => s(Z(p)) : void 0,
    onBlur: r,
    after: c != null ? V(o, c) : o
  });
}, Xe = "line-md:star-alt-filled", qe = "line-md:star-alt", Ge = (t) => {
  const {
    value: e,
    onChange: r,
    disabled: n,
    max: s = 5,
    fullColor: c = "yellow",
    emptyColor: l = "neutral",
    fullIcon: i = Xe,
    emptyIcon: o = qe,
    size: p = "md",
    onBlur: m,
    rounding: f = 1
  } = t, v = () => {
    const b = u.get(f);
    return b > 0 ? b : 1;
  }, d = (b) => Math.min(Math.max(b, 0), u.get(s)), x = (b, D) => {
    if (u.get(n ?? !1)) return;
    const _ = b.currentTarget.getBoundingClientRect(), w = (b.clientX - _.left) / _.width, $ = D - 1 + w, M = v(), A = Math.ceil($ / M) * M, F = d(A);
    r?.(F);
  }, h = (b) => {
    if (u.get(n ?? !1)) return;
    const D = v(), k = u.get(e) ?? 0;
    let _;
    switch (b.key) {
      case "ArrowRight":
      case "ArrowUp":
        _ = d(k + D);
        break;
      case "ArrowLeft":
      case "ArrowDown":
        _ = d(k - D);
        break;
      case "Home":
        _ = 0;
        break;
      case "End":
        _ = u.get(s);
        break;
      default:
        return;
    }
    b.preventDefault(), r?.(_);
  }, y = u.map(p, (b) => `bc-icon--${b}`), g = ({ index: b, counter: D }) => I.span(
    a.class("bc-rating-input__icon-container"),
    a.class(y),
    z(
      { icon: o, size: p, color: l, tone: "soft" },
      a.class("bc-rating-input__icon-empty")
    ),
    I.span(
      a.class("bc-rating-input__icon-clipper"),
      a.class(y),
      dt.width(
        u.map(e, (k) => {
          const _ = Math.floor(k);
          return _ > b ? "100%" : _ < b ? "0%" : `${(k - b) * 100}%`;
        })
      ),
      z(
        { icon: i, size: p, color: c, tone: "soft" },
        a.class("bc-rating-input__icon-full")
      )
    ),
    C.click(
      ne((k) => x(k, D), {
        preventDefault: !0,
        stopPropagation: !0
      })
    )
  );
  return O({
    baseContainer: !0,
    growInput: !1,
    focusableSelector: '[role="slider"]',
    ...t,
    input: I.div(
      // Common input attributes (id, required, invalid, custom classes, etc.)
      j(t),
      a.class("bc-rating-input"),
      // ARIA slider semantics
      a.role("slider"),
      a.tabindex(u.map(n ?? !1, (b) => b ? -1 : 0)),
      N.disabled(n ?? !1),
      N.valuemin(0),
      N.valuemax(u.map(s, (b) => b ?? 0)),
      N.valuenow(u.map(e, (b) => b ?? 0)),
      N.valuetext(
        L(
          e,
          s
        )((b, D) => {
          const k = b ?? 0, _ = D ?? 0;
          return `${String(k)} / ${String(_)}`;
        })
      ),
      // Keyboard & focus handlers
      C.keydown(h),
      m != null ? C.blur(m) : null,
      Pt(s, g)
    )
  });
}, Sn = (t) => {
  const { value: e, onChange: r, onBlur: n, after: s, disabled: c, ...l } = t, i = Y(e, c, r);
  return Ge({
    ...l,
    // Map null -> 0 for display so the control shows as empty when null
    value: u.map(e, (o) => o ?? 0),
    // Pass through numeric changes; clear button will call onChange(null)
    onChange: r,
    onBlur: n,
    after: s != null ? V(i, s) : i
  });
}, Tn = (t) => {
  const { value: e, step: r, min: n, max: s, onBlur: c, onChange: l, onInput: i } = t;
  return O({
    ...t,
    // Make sure clicks anywhere focus the range input
    focusableSelector: 'input[type="range"]',
    input: I.input(
      a.type("range"),
      j(t),
      a.min(n),
      a.max(s),
      a.step(r),
      // Using value as number to keep it in sync
      a.valueAsNumber(e),
      a.class("bc-input bc-slider-input"),
      c != null ? C.blur(G(c)) : T,
      l != null ? C.change(G(l)) : T,
      i != null ? C.input(G(i)) : T
    )
  });
}, An = (t) => {
  const { value: e, step: r, min: n, max: s, onBlur: c, onChange: l, onInput: i } = t, o = u.map(e, (m) => {
    if (m != null) return m;
    const f = n != null ? u.get(n) : void 0;
    return typeof f == "number" ? f : 0;
  }), p = Y(e, t.disabled, (m) => {
    l?.(m);
  });
  return O(
    {
      ...t,
      focusableSelector: 'input[type="range"]',
      after: p,
      input: I.input(
        a.type("range"),
        j(t),
        a.min(n),
        a.max(s),
        a.step(r),
        a.valueAsNumber(o),
        a.class("bc-input bc-slider-input"),
        c != null ? C.blur(G(c)) : T,
        l != null ? C.change(
          G((m) => {
            l(m);
          })
        ) : T,
        i != null ? C.input(
          G((m) => {
            i(m);
          })
        ) : T
      )
    },
    // Ensure container grows input naturally
    V()
  );
};
let wt = null;
async function Mt() {
  const t = globalThis;
  return t.Temporal ? t.Temporal : (wt || (wt = import("./index.esm-DPNh6inz.js").then((e) => {
    const r = e.Temporal;
    return t.Temporal || (t.Temporal = r), r;
  })), wt);
}
const Qe = (t, e) => e ? Bt(Mt, {
  then: t,
  pending: e.pending,
  error: e.error
}) : Bt(Mt, t), Je = /^P(\d+([YMWD]|$)){0,4}(T(\d+([HMS]|$)){0,3})?$/i, Ke = /^P(?:(\d+Y)?(\d+M)?(\d+W)?(\d+D)?)(T(\d+H)?(\d+M)?(\d+S)?)?$/i;
function tn(t) {
  return {
    mask: null,
    allowMode: "custom",
    allow: (e) => /[0-9ptwdhms]/i.test(e),
    pipe: (e) => {
      const r = e.toUpperCase();
      return r.length === 0 ? r : !r.startsWith("P") || !Je.test(r) ? !1 : r;
    },
    completion: {
      mode: "custom",
      isComplete: (e) => {
        const r = e.toUpperCase();
        if (!Ke.test(r)) return !1;
        try {
          return t(r), !0;
        } catch {
          return !1;
        }
      }
    }
  };
}
const Ot = (t, e) => {
  if (t == null) return null;
  try {
    return t.Duration.from(e);
  } catch {
    return null;
  }
}, Fn = (t) => {
  const { value: e, onChange: r, after: n, disabled: s, onBlur: c } = t, l = () => {
    const p = Y(e, s, r);
    return n != null ? V(p, n) : p;
  }, i = t.placeholder != null ? T : a.placeholder("P0DT0H0M0S");
  return Qe(
    (p) => Xt({
      ...t,
      value: u.map(e, (m) => m?.toString() ?? ""),
      onChange: r ? (m) => r(m === "" ? null : p.Duration.from(m)) : void 0,
      onInput: void 0,
      ...tn(p.Duration.from),
      placeholder: "P0DT0H0M0S",
      after: l()
    }),
    { pending: () => O({
      ...t,
      input: K.text(
        j(t),
        a.value(u.map(e, (p) => p?.toString() ?? "")),
        a.class("bc-input"),
        i,
        c != null ? C.blur(() => c()) : T,
        r != null ? C.change((p) => {
          const f = p.currentTarget?.value ?? "";
          if (f === "") {
            r(null);
            return;
          }
          const v = globalThis.Temporal, d = Ot(v, f);
          if (d != null) {
            r(d);
            return;
          }
          Mt().then((x) => {
            const h = Ot(x, f);
            h != null && r(h);
          }).catch(() => {
          });
        }) : T
      ),
      after: l()
    }) }
  );
}, en = (t) => {
  const { value: e, onBlur: r, onChange: n, onInput: s } = t;
  return O({
    ...t,
    input: K.url(
      j(t),
      a.value(e),
      a.class("bc-input"),
      r != null ? C.blur(P(r)) : T,
      n != null ? C.change(P(n)) : T,
      s != null ? C.input(P(s)) : T
    )
  });
}, Bn = (t) => {
  const { value: e, onBlur: r, onChange: n, onInput: s, after: c, disabled: l, ...i } = t, o = Y(e, l, n);
  return en({
    ...i,
    value: u.map(e, nt),
    onChange: n != null ? (p) => n(Z(p)) : void 0,
    onInput: s != null ? (p) => s(Z(p)) : void 0,
    onBlur: r,
    after: c != null ? V(o, c) : o
  });
}, nn = (t) => {
  const {
    controller: e,
    element: r,
    separator: n,
    showMove: s = !0,
    showRemove: c = !0,
    showAdd: l = !0,
    createItem: i,
    addLabel: o,
    controlsLayout: p = "aside",
    removeDisabled: m,
    addDisabled: f
  } = t, v = u.toSignal(p).map((h) => h === "aside"), d = (h) => {
    const y = E(
      s ?? !1,
      () => I.div(
        a.class("bc-group--align-center"),
        a.class(
          v.map(
            (b) => b ? "bc-group--direction-column bc-group--gap-1" : "bc-group--direction-row bc-group--gap-1"
          )
        ),
        gt(
          {
            size: "xs",
            roundedness: "full",
            variant: "text",
            onClick: () => h.move("up"),
            disabled: h.cannotMove("up")
          },
          H(
            X,
            (b) => z({
              size: "xs",
              icon: "line-md:arrow-up",
              title: b.$.incrementValue
            })
          )
        ),
        gt(
          {
            size: "xs",
            roundedness: "full",
            variant: "text",
            onClick: () => h.move("down"),
            disabled: h.cannotMove("down")
          },
          H(
            X,
            (b) => z({
              size: "xs",
              icon: "line-md:arrow-down",
              title: b.$.decrementValue
            })
          )
        )
      )
    ), g = E(
      c,
      () => H(
        X,
        (b) => $t({
          size: "xs",
          // Use a lowercase label to satisfy tests that query with [aria-label*="remove"]
          label: u.map(b.$.removeItem, (D) => D.toLowerCase()),
          color: "danger",
          disabled: m,
          onClick: h.remove
        })
      )
    );
    return (b) => E(
      v,
      () => pt(
        a.class("bc-group--gap-1 bc-group--align-center"),
        ct(a.class("bc-stack--grow"), b),
        ct(
          a.class("bc-stack--align-center"),
          E(
            e.signal.map((D) => D.length > 1),
            () => y
          ),
          g
        )
      ),
      () => ct(
        a.class("bc-stack--gap-2"),
        b,
        pt(
          a.class("bc-group--gap-2 bc-group--justify-between"),
          E(
            e.signal.map((D) => D.length > 1),
            () => y,
            () => I.div()
          ),
          g
        )
      )
    );
  }, x = E(
    L(l, i)((h, y) => h && y != null),
    () => pt(
      a.class(
        "bc-group--gap-2 bc-group--align-center bc-group--justify-center"
      ),
      gt(
        {
          size: "sm",
          variant: "filled",
          onClick: () => e.push(i()),
          disabled: L(
            e.disabled,
            f ?? !1
          )(
            (h, y) => h || y
          )
        },
        H(
          X,
          (h) => pt(
            a.class("bc-group--gap-2"),
            z({ icon: "line-md:plus" }),
            o ?? h.$.addLabel
          )
        )
      )
    )
  );
  return V(
    Oe(
      e,
      (h) => d(h)(r(h)),
      n
    ),
    x
  );
}, Vn = (t, ...e) => {
  const {
    controller: r,
    element: n,
    separator: s,
    showMove: c,
    showRemove: l,
    showAdd: i,
    createItem: o,
    addLabel: p,
    controlsLayout: m,
    removeDisabled: f,
    addDisabled: v,
    ...d
  } = t;
  return Ht(
    {
      ...d,
      content: nn({
        controller: r,
        element: n,
        separator: s,
        showMove: c,
        showRemove: l,
        showAdd: i,
        createItem: o,
        addLabel: p,
        controlsLayout: m,
        removeDisabled: f,
        addDisabled: v
      })
    },
    ...e
  );
};
class Ln extends bt {
  branches;
  activeBranch;
  #e;
  #t = /* @__PURE__ */ new Map();
  constructor(e, r, n, s, c, l, i = lt) {
    super(e, r, n, s, c, i), this.branches = l;
    const o = (m) => {
      for (const f of l)
        if (f.detect(m))
          return f.key;
      return l[0]?.key ?? "unknown";
    };
    this.activeBranch = n.map(o, lt);
    const p = (m) => {
      if (this.#t.has(m))
        return this.#t.get(m);
      const f = l.find((d) => d.key === m);
      if (!f)
        throw new Error(`Unknown branch: ${m}`);
      const v = new bt(
        [...e, m],
        (d) => {
          this.change(d);
        },
        this.signal.map(
          (d) => f.detect(d) ? d : f.defaultValue(),
          i
        ),
        s.map(Lt([m])),
        {
          disabled: this.disabled,
          validationMode: this.parent.validationMode
        },
        i
      );
      return this.#t.set(m, v), v;
    };
    this.#e = this.activeBranch.map(
      (m) => p(m),
      lt
    ), this.onDispose(() => {
      for (const m of this.#t.values())
        m.dispose();
      this.#t.clear(), this.activeBranch.dispose(), this.#e.dispose();
    });
  }
  /**
   * Get the controller for the currently active branch
   */
  get activeController() {
    return u.get(this.#e);
  }
  /**
   * Get a controller for a specific branch
   */
  getBranchController(e) {
    const r = this.branches.find((s) => s.key === e);
    if (!r)
      throw new Error(`Unknown branch: ${e}`);
    if (this.#t.has(e))
      return this.#t.get(e);
    const n = new bt(
      [...this.path, e],
      (s) => {
        this.change(s);
      },
      this.signal.map(
        (s) => r.detect(s) ? s : r.defaultValue(),
        lt
      ),
      this.status.map(Lt([e])),
      {
        disabled: this.disabled,
        validationMode: this.parent.validationMode
      },
      lt
    );
    return this.#t.set(e, n), n;
  }
  /**
   * Switch to a different branch
   */
  switchToBranch(e, r = !1) {
    const n = this.branches.find((l) => l.key === e);
    if (!n)
      throw new Error(`Unknown branch: ${e}`);
    const s = u.get(this.signal);
    if (n.detect(s))
      return !0;
    if (n.convert) {
      const l = n.convert(s);
      if (l.ok)
        return this.change(l.value), !0;
    }
    if (r && typeof window == "object" && typeof window.confirm == "function" && !window.confirm(
      "Changing type will clear the current value. Continue?"
    ))
      return !1;
    const c = n.defaultValue();
    return this.change(c), !0;
  }
  /**
   * Get the current active branch definition
   */
  get activeBranchDefinition() {
    const e = u.get(this.activeBranch);
    return this.branches.find((r) => r.key === e);
  }
}
function En(t) {
  return t.transform(
    (e) => e ?? null,
    (e) => e ?? void 0
  );
}
function Un(t) {
  return t.transform(
    (e) => e ?? "",
    (e) => e === "" ? void 0 : e
  );
}
function Nn(t) {
  return t.transform(
    (e) => e ?? void 0,
    (e) => e ?? null
  );
}
export {
  Sn as A,
  nn as B,
  mn as C,
  Tn as D,
  Ee as E,
  ye as F,
  pt as G,
  An as H,
  Fn as I,
  en as J,
  Bn as K,
  Vn as L,
  Xt as M,
  ze as N,
  gn as O,
  hn as P,
  Ue as Q,
  Ge as R,
  dn as S,
  Ze as T,
  Et as U,
  Mt as V,
  Qe as W,
  un as X,
  pn as _,
  Y as a,
  Ln as b,
  Un as c,
  tn as d,
  Z as e,
  Nn as f,
  fn as g,
  $e as h,
  Me as i,
  bn as j,
  Oe as k,
  Re as l,
  vn as m,
  nt as n,
  xn as o,
  wn as p,
  yn as q,
  $n as r,
  kn as s,
  En as t,
  _n as u,
  In as v,
  Cn as w,
  Mn as x,
  Ye as y,
  Dn as z
};
