buildkit-primevue
Version:
FormKit components and helpers built on PrimeVue v4 with Tailwind CSS
1,238 lines (1,218 loc) • 126 kB
JavaScript
import { defineComponent as Ve, inject as Ke, computed as T, createElementBlock as N, openBlock as O, renderSlot as U, createCommentVNode as be, onMounted as bt, ref as H, onUnmounted as sn, provide as gt, withDirectives as an, createBlock as D, unref as V, normalizeClass as ne, withCtx as ge, createElementVNode as $, createVNode as Ue, createTextVNode as dn, toDisplayString as Pe, vShow as un, readonly as cn, getCurrentInstance as Qe, nextTick as pn, watch as Ce, useId as mn, mergeProps as k, normalizeProps as yt, guardReactiveProps as kt, Fragment as Ee, renderList as Ie, resolveDynamicComponent as he, mergeModels as Ye, useModel as fn, normalizeStyle as hn } from "vue";
import qn from "@primevue/forms/form";
import vn from "@primevue/forms/formfield";
import { resolve as Je, isNotEmpty as De, isObject as bn } from "@primeuix/utils";
import * as ze from "primevue";
import { useResizeObserver as gn } from "@vueuse/core";
import { z as y } from "zod";
const yn = "0.1.35", kn = ["for"], wn = {
key: 0,
class: "text-red-500"
}, wt = /* @__PURE__ */ Ve({
__name: "FormKitLabel",
setup(e) {
const t = Ke("$fcDynamicFormField", void 0), n = T(() => t?.inputId), l = T(() => t?.required);
return (o, u) => (O(), N("label", {
for: n.value,
class: "flex text-xs"
}, [
U(o.$slots, "default"),
l.value ? (O(), N("span", wn, "*")) : be("", !0)
], 8, kn));
}
});
function ce(e, t) {
if (typeof t != "string") return t;
switch (Array.isArray(e) ? e.length ? typeof e[0] : "string" : typeof e) {
case "boolean":
return /^(true|false)$/i.test(t) ? t.toLowerCase() === "true" : t === "1" ? !0 : t === "0" ? !1 : !!t;
case "number": {
const l = Number(t);
return Number.isFinite(l) ? l : t;
}
case "string":
default:
return t;
}
}
function je(e, t) {
if (Array.isArray(t)) {
const l = t.map((o) => ce(e, o));
return Array.isArray(e) ? e.some((o) => l.includes(o)) : l.includes(e);
}
if (Array.isArray(e)) {
const l = ce(e, t);
return e.includes(l);
}
const n = ce(e, t);
return e === n;
}
function Te(e, t) {
const n = Array.isArray(t) ? t : [t];
if (Array.isArray(e))
return n.some((l) => e.includes(ce(e, l)));
if (typeof e == "string") {
const l = e.trim().toLowerCase();
return n.some((o) => {
const u = ce(e, o);
return typeof u == "string" ? l.includes(u.trim().toLowerCase()) : e === u;
});
}
return n.some((l) => {
const o = ce(e, l);
return e === o;
});
}
const $n = { class: "flex flex-col gap-1" }, Sn = ["innerHTML"], xn = {
key: 1,
class: "text-red-500 text-xs"
}, $t = /* @__PURE__ */ Ve({
__name: "FormKitField",
props: {
name: {},
inputId: {},
required: { type: Boolean, default: !1 },
label: { default: "" },
help: {},
rest: { default: () => ({}) },
formApi: { default: () => {
} }
},
setup(e) {
bt(() => {
if (o.value?.field && t?.watchFieldValue) {
try {
d.value = t?.getFieldValue?.(o.value.field) ?? d.value;
} catch {
}
const c = t.watchFieldValue(o.value.field, (q) => {
d.value = q;
});
typeof c == "function" && a.push(c);
}
if (u.value?.field && t?.watchFieldValue) {
try {
i.value = t?.getFieldValue?.(u.value.field) ?? i.value;
} catch {
}
const c = t.watchFieldValue(u.value.field, (q) => {
i.value = q;
});
typeof c == "function" && a.push(c);
}
}), sn(() => {
a.forEach((c) => {
try {
c();
} catch {
}
});
}), gt("$fcDynamicFormField", {
name: e.name,
inputId: e.inputId,
required: e.required
});
const t = Ke("$fcDynamicForm", void 0) ?? e.formApi, n = T(() => [e.rest.class || "", e.rest.className || ""]), l = T(() => e.rest?.as ? {
"items-center flex-row-reverse justify-end gap-3": e.rest?.as === "Checkbox",
"flex-col": e.rest?.as !== "Checkbox"
} : "flex-col"), o = T(() => e.rest?.showWhen), u = T(() => e.rest?.hideWhen), d = H(void 0), i = H(void 0), a = [], p = T(() => {
const c = !!o.value?.field, q = !!u.value?.field;
let h = !0;
if (c) {
const r = o.value;
r?.includes !== void 0 ? h = Te(d.value, r.includes) : h = je(d.value, r?.equals);
}
if (q) {
const r = u.value;
let m = !1;
r?.includes !== void 0 ? m = Te(i.value, r.includes) : m = je(i.value, r?.equals), m && (h = !1);
}
return h;
});
return (c, q) => an((O(), D(V(vn), {
name: String(c.name),
class: ne(["flex flex-col gap-2", n.value])
}, {
default: ge(({ error: h }) => [
$("div", {
class: ne(["flex gap-1", l.value])
}, [
Ue(wt, null, {
default: ge(() => [
dn(Pe(c.label), 1)
]),
_: 1
}),
U(c.$slots, "default")
], 2),
$("div", $n, [
c.help ? (O(), N("small", {
key: 0,
innerHTML: c.help,
class: "text-xs text-surface-500"
}, null, 8, Sn)) : be("", !0),
c.formApi[c.name]?.error ? (O(), N("small", xn, Pe(typeof h == "string" ? h : h?.message ?? ""), 1)) : be("", !0)
])
]),
_: 3
}, 8, ["name", "class"])), [
[un, p.value]
]);
}
});
function He(e) {
return e == null || e === "" || Array.isArray(e) && e.length === 0 || !(e instanceof Date) && typeof e == "object" && Object.keys(e).length === 0;
}
function St(e) {
return typeof e == "function" && "call" in e && "apply" in e;
}
function C(e) {
return !He(e);
}
function pe(e, t = !0) {
return e instanceof Object && e.constructor === Object && (t || Object.keys(e).length !== 0);
}
function R(e, ...t) {
return St(e) ? e(...t) : e;
}
function M(e, t = !0) {
return typeof e == "string" && (t || e !== "");
}
function le(e) {
return M(e) ? e.replace(/(-|_)/g, "").toLowerCase() : e;
}
function xt(e, t = "", n = {}) {
let l = le(t).split("."), o = l.shift();
if (o) {
if (pe(e)) {
let u = Object.keys(e).find((d) => le(d) === o) || "";
return xt(R(e[u], n), l.join("."), n);
}
return;
}
return R(e, n);
}
function _n(e, t = !0) {
return Array.isArray(e) && (t || e.length !== 0);
}
function On(e) {
return C(e) && !isNaN(e);
}
function oe(e, t) {
if (t) {
let n = t.test(e);
return t.lastIndex = 0, n;
}
return !1;
}
function ve(e) {
return e && e.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g, "").replace(/ {2,}/g, " ").replace(/ ([{:}]) /g, "$1").replace(/([;,]) /g, "$1").replace(/ !/g, "!").replace(/: /g, ":").trim();
}
function _t(e) {
return M(e) ? e.replace(/(_)/g, "-").replace(/[A-Z]/g, (t, n) => n === 0 ? t : "-" + t.toLowerCase()).toLowerCase() : e;
}
function Cn() {
let e = /* @__PURE__ */ new Map();
return { on(t, n) {
let l = e.get(t);
return l ? l.push(n) : l = [n], e.set(t, l), this;
}, off(t, n) {
let l = e.get(t);
return l && l.splice(l.indexOf(n) >>> 0, 1), this;
}, emit(t, n) {
let l = e.get(t);
l && l.forEach((o) => {
o(n);
});
}, clear() {
e.clear();
} };
}
var Pn = Object.defineProperty, jn = Object.defineProperties, Tn = Object.getOwnPropertyDescriptors, Ne = Object.getOwnPropertySymbols, Ot = Object.prototype.hasOwnProperty, Ct = Object.prototype.propertyIsEnumerable, Xe = (e, t, n) => t in e ? Pn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, A = (e, t) => {
for (var n in t || (t = {})) Ot.call(t, n) && Xe(e, n, t[n]);
if (Ne) for (var n of Ne(t)) Ct.call(t, n) && Xe(e, n, t[n]);
return e;
}, Fe = (e, t) => jn(e, Tn(t)), K = (e, t) => {
var n = {};
for (var l in e) Ot.call(e, l) && t.indexOf(l) < 0 && (n[l] = e[l]);
if (e != null && Ne) for (var l of Ne(e)) t.indexOf(l) < 0 && Ct.call(e, l) && (n[l] = e[l]);
return n;
}, Nn = Cn(), L = Nn, ye = /{([^}]*)}/g, Pt = /(\d+\s+[\+\-\*\/]\s+\d+)/g, jt = /var\([^)]+\)/g;
function et(e) {
return M(e) ? e.replace(/[A-Z]/g, (t, n) => n === 0 ? t : "." + t.toLowerCase()).toLowerCase() : e;
}
function Vn(e) {
return pe(e) && e.hasOwnProperty("$value") && e.hasOwnProperty("$type") ? e.$value : e;
}
function Ln(e) {
return e.replaceAll(/ /g, "").replace(/[^\w]/g, "-");
}
function Re(e = "", t = "") {
return Ln(`${M(e, !1) && M(t, !1) ? `${e}-` : e}${t}`);
}
function Tt(e = "", t = "") {
return `--${Re(e, t)}`;
}
function zn(e = "") {
let t = (e.match(/{/g) || []).length, n = (e.match(/}/g) || []).length;
return (t + n) % 2 !== 0;
}
function Nt(e, t = "", n = "", l = [], o) {
if (M(e)) {
let u = e.trim();
if (zn(u)) return;
if (oe(u, ye)) {
let d = u.replaceAll(ye, (i) => {
let a = i.replace(/{|}/g, "").split(".").filter((p) => !l.some((c) => oe(p, c)));
return `var(${Tt(n, _t(a.join("-")))}${C(o) ? `, ${o}` : ""})`;
});
return oe(d.replace(jt, "0"), Pt) ? `calc(${d})` : d;
}
return u;
} else if (On(e)) return e;
}
function Fn(e, t, n) {
M(t, !1) && e.push(`${t}:${n};`);
}
function ue(e, t) {
return e ? `${e}{${t}}` : "";
}
function Vt(e, t) {
if (e.indexOf("dt(") === -1) return e;
function n(d, i) {
let a = [], p = 0, c = "", q = null, h = 0;
for (; p <= d.length; ) {
let r = d[p];
if ((r === '"' || r === "'" || r === "`") && d[p - 1] !== "\\" && (q = q === r ? null : r), !q && (r === "(" && h++, r === ")" && h--, (r === "," || p === d.length) && h === 0)) {
let m = c.trim();
m.startsWith("dt(") ? a.push(Vt(m, i)) : a.push(l(m)), c = "", p++;
continue;
}
r !== void 0 && (c += r), p++;
}
return a;
}
function l(d) {
let i = d[0];
if ((i === '"' || i === "'" || i === "`") && d[d.length - 1] === i) return d.slice(1, -1);
let a = Number(d);
return isNaN(a) ? d : a;
}
let o = [], u = [];
for (let d = 0; d < e.length; d++) if (e[d] === "d" && e.slice(d, d + 3) === "dt(") u.push(d), d += 2;
else if (e[d] === ")" && u.length > 0) {
let i = u.pop();
u.length === 0 && o.push([i, d]);
}
if (!o.length) return e;
for (let d = o.length - 1; d >= 0; d--) {
let [i, a] = o[d], p = e.slice(i + 3, a), c = n(p, t), q = t(...c);
e = e.slice(0, i) + q + e.slice(a + 1);
}
return e;
}
var re = (...e) => An(j.getTheme(), ...e), An = (e = {}, t, n, l) => {
if (t) {
let { variable: o, options: u } = j.defaults || {}, { prefix: d, transform: i } = e?.options || u || {}, a = oe(t, ye) ? t : `{${t}}`;
return l === "value" || He(l) && i === "strict" ? j.getTokenValue(t) : Nt(a, void 0, d, [o.excludedKeyRegex], n);
}
return "";
};
function _e(e, ...t) {
if (e instanceof Array) {
let n = e.reduce((l, o, u) => {
var d;
return l + o + ((d = Je(t[u], { dt: re })) != null ? d : "");
}, "");
return Vt(n, re);
}
return Je(e, { dt: re });
}
function En(e, t = {}) {
let n = j.defaults.variable, { prefix: l = n.prefix, selector: o = n.selector, excludedKeyRegex: u = n.excludedKeyRegex } = t, d = [], i = [], a = [{ node: e, path: l }];
for (; a.length; ) {
let { node: c, path: q } = a.pop();
for (let h in c) {
let r = c[h], m = Vn(r), v = oe(h, u) ? Re(q) : Re(q, _t(h));
if (pe(m)) a.push({ node: m, path: v });
else {
let f = Tt(v), s = Nt(m, v, l, [u]);
Fn(i, f, s);
let g = v;
l && g.startsWith(l + "-") && (g = g.slice(l.length + 1)), d.push(g.replace(/-/g, "."));
}
}
}
let p = i.join("");
return { value: i, tokens: d, declarations: p, css: ue(o, p) };
}
var z = { regex: { rules: { class: { pattern: /^\.([a-zA-Z][\w-]*)$/, resolve(e) {
return { type: "class", selector: e, matched: this.pattern.test(e.trim()) };
} }, attr: { pattern: /^\[(.*)\]$/, resolve(e) {
return { type: "attr", selector: `:root${e}`, matched: this.pattern.test(e.trim()) };
} }, media: { pattern: /^@media (.*)$/, resolve(e) {
return { type: "media", selector: e, matched: this.pattern.test(e.trim()) };
} }, system: { pattern: /^system$/, resolve(e) {
return { type: "system", selector: "@media (prefers-color-scheme: dark)", matched: this.pattern.test(e.trim()) };
} }, custom: { resolve(e) {
return { type: "custom", selector: e, matched: !0 };
} } }, resolve(e) {
let t = Object.keys(this.rules).filter((n) => n !== "custom").map((n) => this.rules[n]);
return [e].flat().map((n) => {
var l;
return (l = t.map((o) => o.resolve(n)).find((o) => o.matched)) != null ? l : this.rules.custom.resolve(n);
});
} }, _toVariables(e, t) {
return En(e, { prefix: t?.prefix });
}, getCommon({ name: e = "", theme: t = {}, params: n, set: l, defaults: o }) {
var u, d, i, a, p, c, q;
let { preset: h, options: r } = t, m, v, f, s, g, _, w;
if (C(h) && r.transform !== "strict") {
let { primitive: x, semantic: b, extend: P } = h, E = b || {}, { colorScheme: Z } = E, Q = K(E, ["colorScheme"]), W = P || {}, { colorScheme: Y } = W, J = K(W, ["colorScheme"]), G = Z || {}, { dark: X } = G, ie = K(G, ["dark"]), ee = Y || {}, { dark: se } = ee, ae = K(ee, ["dark"]), B = C(x) ? this._toVariables({ primitive: x }, r) : {}, I = C(Q) ? this._toVariables({ semantic: Q }, r) : {}, te = C(ie) ? this._toVariables({ light: ie }, r) : {}, xe = C(X) ? this._toVariables({ dark: X }, r) : {}, de = C(J) ? this._toVariables({ semantic: J }, r) : {}, We = C(ae) ? this._toVariables({ light: ae }, r) : {}, Ge = C(se) ? this._toVariables({ dark: se }, r) : {}, [Mt, Bt] = [(u = B.declarations) != null ? u : "", B.tokens], [Kt, Ut] = [(d = I.declarations) != null ? d : "", I.tokens || []], [Ht, Zt] = [(i = te.declarations) != null ? i : "", te.tokens || []], [Wt, Gt] = [(a = xe.declarations) != null ? a : "", xe.tokens || []], [Qt, Yt] = [(p = de.declarations) != null ? p : "", de.tokens || []], [Jt, Xt] = [(c = We.declarations) != null ? c : "", We.tokens || []], [en, tn] = [(q = Ge.declarations) != null ? q : "", Ge.tokens || []];
m = this.transformCSS(e, Mt, "light", "variable", r, l, o), v = Bt;
let nn = this.transformCSS(e, `${Kt}${Ht}`, "light", "variable", r, l, o), ln = this.transformCSS(e, `${Wt}`, "dark", "variable", r, l, o);
f = `${nn}${ln}`, s = [.../* @__PURE__ */ new Set([...Ut, ...Zt, ...Gt])];
let on = this.transformCSS(e, `${Qt}${Jt}color-scheme:light`, "light", "variable", r, l, o), rn = this.transformCSS(e, `${en}color-scheme:dark`, "dark", "variable", r, l, o);
g = `${on}${rn}`, _ = [.../* @__PURE__ */ new Set([...Yt, ...Xt, ...tn])], w = R(h.css, { dt: re });
}
return { primitive: { css: m, tokens: v }, semantic: { css: f, tokens: s }, global: { css: g, tokens: _ }, style: w };
}, getPreset({ name: e = "", preset: t = {}, options: n, params: l, set: o, defaults: u, selector: d }) {
var i, a, p;
let c, q, h;
if (C(t) && n.transform !== "strict") {
let r = e.replace("-directive", ""), m = t, { colorScheme: v, extend: f, css: s } = m, g = K(m, ["colorScheme", "extend", "css"]), _ = f || {}, { colorScheme: w } = _, x = K(_, ["colorScheme"]), b = v || {}, { dark: P } = b, E = K(b, ["dark"]), Z = w || {}, { dark: Q } = Z, W = K(Z, ["dark"]), Y = C(g) ? this._toVariables({ [r]: A(A({}, g), x) }, n) : {}, J = C(E) ? this._toVariables({ [r]: A(A({}, E), W) }, n) : {}, G = C(P) ? this._toVariables({ [r]: A(A({}, P), Q) }, n) : {}, [X, ie] = [(i = Y.declarations) != null ? i : "", Y.tokens || []], [ee, se] = [(a = J.declarations) != null ? a : "", J.tokens || []], [ae, B] = [(p = G.declarations) != null ? p : "", G.tokens || []], I = this.transformCSS(r, `${X}${ee}`, "light", "variable", n, o, u, d), te = this.transformCSS(r, ae, "dark", "variable", n, o, u, d);
c = `${I}${te}`, q = [.../* @__PURE__ */ new Set([...ie, ...se, ...B])], h = R(s, { dt: re });
}
return { css: c, tokens: q, style: h };
}, getPresetC({ name: e = "", theme: t = {}, params: n, set: l, defaults: o }) {
var u;
let { preset: d, options: i } = t, a = (u = d?.components) == null ? void 0 : u[e];
return this.getPreset({ name: e, preset: a, options: i, params: n, set: l, defaults: o });
}, getPresetD({ name: e = "", theme: t = {}, params: n, set: l, defaults: o }) {
var u, d;
let i = e.replace("-directive", ""), { preset: a, options: p } = t, c = ((u = a?.components) == null ? void 0 : u[i]) || ((d = a?.directives) == null ? void 0 : d[i]);
return this.getPreset({ name: i, preset: c, options: p, params: n, set: l, defaults: o });
}, applyDarkColorScheme(e) {
return !(e.darkModeSelector === "none" || e.darkModeSelector === !1);
}, getColorSchemeOption(e, t) {
var n;
return this.applyDarkColorScheme(e) ? this.regex.resolve(e.darkModeSelector === !0 ? t.options.darkModeSelector : (n = e.darkModeSelector) != null ? n : t.options.darkModeSelector) : [];
}, getLayerOrder(e, t = {}, n, l) {
let { cssLayer: o } = t;
return o ? `@layer ${R(o.order || o.name || "primeui", n)}` : "";
}, getCommonStyleSheet({ name: e = "", theme: t = {}, params: n, props: l = {}, set: o, defaults: u }) {
let d = this.getCommon({ name: e, theme: t, params: n, set: o, defaults: u }), i = Object.entries(l).reduce((a, [p, c]) => a.push(`${p}="${c}"`) && a, []).join(" ");
return Object.entries(d || {}).reduce((a, [p, c]) => {
if (pe(c) && Object.hasOwn(c, "css")) {
let q = ve(c.css), h = `${p}-variables`;
a.push(`<style type="text/css" data-primevue-style-id="${h}" ${i}>${q}</style>`);
}
return a;
}, []).join("");
}, getStyleSheet({ name: e = "", theme: t = {}, params: n, props: l = {}, set: o, defaults: u }) {
var d;
let i = { name: e, theme: t, params: n, set: o, defaults: u }, a = (d = e.includes("-directive") ? this.getPresetD(i) : this.getPresetC(i)) == null ? void 0 : d.css, p = Object.entries(l).reduce((c, [q, h]) => c.push(`${q}="${h}"`) && c, []).join(" ");
return a ? `<style type="text/css" data-primevue-style-id="${e}-variables" ${p}>${ve(a)}</style>` : "";
}, createTokens(e = {}, t, n = "", l = "", o = {}) {
let u = function(i, a = {}, p = []) {
if (p.includes(this.path)) return console.warn(`Circular reference detected at ${this.path}`), { colorScheme: i, path: this.path, paths: a, value: void 0 };
p.push(this.path), a.name = this.path, a.binding || (a.binding = {});
let c = this.value;
if (typeof this.value == "string" && ye.test(this.value)) {
let q = this.value.trim().replace(ye, (h) => {
var r;
let m = h.slice(1, -1), v = this.tokens[m];
if (!v) return console.warn(`Token not found for path: ${m}`), "__UNRESOLVED__";
let f = v.computed(i, a, p);
return Array.isArray(f) && f.length === 2 ? `light-dark(${f[0].value},${f[1].value})` : (r = f?.value) != null ? r : "__UNRESOLVED__";
});
c = Pt.test(q.replace(jt, "0")) ? `calc(${q})` : q;
}
return He(a.binding) && delete a.binding, p.pop(), { colorScheme: i, path: this.path, paths: a, value: c.includes("__UNRESOLVED__") ? void 0 : c };
}, d = (i, a, p) => {
Object.entries(i).forEach(([c, q]) => {
let h = oe(c, t.variable.excludedKeyRegex) ? a : a ? `${a}.${et(c)}` : et(c), r = p ? `${p}.${c}` : c;
pe(q) ? d(q, h, r) : (o[h] || (o[h] = { paths: [], computed: (m, v = {}, f = []) => {
if (o[h].paths.length === 1) return o[h].paths[0].computed(o[h].paths[0].scheme, v.binding, f);
if (m && m !== "none") for (let s = 0; s < o[h].paths.length; s++) {
let g = o[h].paths[s];
if (g.scheme === m) return g.computed(m, v.binding, f);
}
return o[h].paths.map((s) => s.computed(s.scheme, v[s.scheme], f));
} }), o[h].paths.push({ path: r, value: q, scheme: r.includes("colorScheme.light") ? "light" : r.includes("colorScheme.dark") ? "dark" : "none", computed: u, tokens: o }));
});
};
return d(e, n, l), o;
}, getTokenValue(e, t, n) {
var l;
let o = ((i) => i.split(".").filter((a) => !oe(a.toLowerCase(), n.variable.excludedKeyRegex)).join("."))(t), u = t.includes("colorScheme.light") ? "light" : t.includes("colorScheme.dark") ? "dark" : void 0, d = [(l = e[o]) == null ? void 0 : l.computed(u)].flat().filter((i) => i);
return d.length === 1 ? d[0].value : d.reduce((i = {}, a) => {
let p = a, { colorScheme: c } = p, q = K(p, ["colorScheme"]);
return i[c] = q, i;
}, void 0);
}, getSelectorRule(e, t, n, l) {
return n === "class" || n === "attr" ? ue(C(t) ? `${e}${t},${e} ${t}` : e, l) : ue(e, ue(t ?? ":root", l));
}, transformCSS(e, t, n, l, o = {}, u, d, i) {
if (C(t)) {
let { cssLayer: a } = o;
if (l !== "style") {
let p = this.getColorSchemeOption(o, d);
t = n === "dark" ? p.reduce((c, { type: q, selector: h }) => (C(h) && (c += h.includes("[CSS]") ? h.replace("[CSS]", t) : this.getSelectorRule(h, i, q, t)), c), "") : ue(i ?? ":root", t);
}
if (a) {
let p = { name: "primeui" };
pe(a) && (p.name = R(a.name, { name: e, type: l })), C(p.name) && (t = ue(`@layer ${p.name}`, t), u?.layerNames(p.name));
}
return t;
}
return "";
} }, j = { defaults: { variable: { prefix: "p", selector: ":root", excludedKeyRegex: /^(primitive|semantic|components|directives|variables|colorscheme|light|dark|common|root|states|extend|css)$/gi }, options: { prefix: "p", darkModeSelector: "system", cssLayer: !1 } }, _theme: void 0, _layerNames: /* @__PURE__ */ new Set(), _loadedStyleNames: /* @__PURE__ */ new Set(), _loadingStyles: /* @__PURE__ */ new Set(), _tokens: {}, update(e = {}) {
let { theme: t } = e;
t && (this._theme = Fe(A({}, t), { options: A(A({}, this.defaults.options), t.options) }), this._tokens = z.createTokens(this.preset, this.defaults), this.clearLoadedStyleNames());
}, get theme() {
return this._theme;
}, get preset() {
var e;
return ((e = this.theme) == null ? void 0 : e.preset) || {};
}, get options() {
var e;
return ((e = this.theme) == null ? void 0 : e.options) || {};
}, get tokens() {
return this._tokens;
}, getTheme() {
return this.theme;
}, setTheme(e) {
this.update({ theme: e }), L.emit("theme:change", e);
}, getPreset() {
return this.preset;
}, setPreset(e) {
this._theme = Fe(A({}, this.theme), { preset: e }), this._tokens = z.createTokens(e, this.defaults), this.clearLoadedStyleNames(), L.emit("preset:change", e), L.emit("theme:change", this.theme);
}, getOptions() {
return this.options;
}, setOptions(e) {
this._theme = Fe(A({}, this.theme), { options: e }), this.clearLoadedStyleNames(), L.emit("options:change", e), L.emit("theme:change", this.theme);
}, getLayerNames() {
return [...this._layerNames];
}, setLayerNames(e) {
this._layerNames.add(e);
}, getLoadedStyleNames() {
return this._loadedStyleNames;
}, isStyleNameLoaded(e) {
return this._loadedStyleNames.has(e);
}, setLoadedStyleName(e) {
this._loadedStyleNames.add(e);
}, deleteLoadedStyleName(e) {
this._loadedStyleNames.delete(e);
}, clearLoadedStyleNames() {
this._loadedStyleNames.clear();
}, getTokenValue(e) {
return z.getTokenValue(this.tokens, e, this.defaults);
}, getCommon(e = "", t) {
return z.getCommon({ name: e, theme: this.theme, params: t, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } });
}, getComponent(e = "", t) {
let n = { name: e, theme: this.theme, params: t, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } };
return z.getPresetC(n);
}, getDirective(e = "", t) {
let n = { name: e, theme: this.theme, params: t, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } };
return z.getPresetD(n);
}, getCustomPreset(e = "", t, n, l) {
let o = { name: e, preset: t, options: this.options, selector: n, params: l, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } };
return z.getPreset(o);
}, getLayerOrderCSS(e = "") {
return z.getLayerOrder(e, this.options, { names: this.getLayerNames() }, this.defaults);
}, transformCSS(e = "", t, n = "style", l) {
return z.transformCSS(e, t, l, n, this.options, { layerNames: this.setLayerNames.bind(this) }, this.defaults);
}, getCommonStyleSheet(e = "", t, n = {}) {
return z.getCommonStyleSheet({ name: e, theme: this.theme, params: t, props: n, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } });
}, getStyleSheet(e, t, n = {}) {
return z.getStyleSheet({ name: e, theme: this.theme, params: t, props: n, defaults: this.defaults, set: { layerNames: this.setLayerNames.bind(this) } });
}, onStyleMounted(e) {
this._loadingStyles.add(e);
}, onStyleUpdated(e) {
this._loadingStyles.add(e);
}, onStyleLoaded(e, { name: t }) {
this._loadingStyles.size && (this._loadingStyles.delete(t), L.emit(`theme:${t}:load`, e), !this._loadingStyles.size && L.emit("theme:load"));
} };
function In(e) {
if (e) {
let t = e.parentNode;
return t && t instanceof ShadowRoot && t.host && (t = t.host), t;
}
return null;
}
function Lt(e) {
return !!(e !== null && typeof e < "u" && e.nodeName && In(e));
}
function Le(e) {
return typeof Element < "u" ? e instanceof Element : e !== null && typeof e == "object" && e.nodeType === 1 && typeof e.nodeName == "string";
}
function Me(e, t = {}) {
if (Le(e)) {
let n = (l, o) => {
var u, d;
let i = (u = e?.$attrs) != null && u[l] ? [(d = e?.$attrs) == null ? void 0 : d[l]] : [];
return [o].flat().reduce((a, p) => {
if (p != null) {
let c = typeof p;
if (c === "string" || c === "number") a.push(p);
else if (c === "object") {
let q = Array.isArray(p) ? n(l, p) : Object.entries(p).map(([h, r]) => l === "style" && (r || r === 0) ? `${h.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()}:${r}` : r ? h : void 0);
a = q.length ? a.concat(q.filter((h) => !!h)) : a;
}
}
return a;
}, i);
};
Object.entries(t).forEach(([l, o]) => {
if (o != null) {
let u = l.match(/^on(.+)/);
u ? e.addEventListener(u[1].toLowerCase(), o) : l === "p-bind" || l === "pBind" ? Me(e, o) : (o = l === "class" ? [...new Set(n("class", o))].join(" ").trim() : l === "style" ? n("style", o).join(";").trim() : o, (e.$attrs = e.$attrs || {}) && (e.$attrs[l] = o), e.setAttribute(l, o));
}
});
}
}
function Dn(e, t) {
return Le(e) ? e.matches(t) ? e : e.querySelector(t) : null;
}
function Rn() {
return !!(typeof window < "u" && window.document && window.document.createElement);
}
function Mn(e, t = "", n) {
Le(e) && n !== null && n !== void 0 && e.setAttribute(t, n);
}
var me = {
_loadedStyleNames: /* @__PURE__ */ new Set(),
getLoadedStyleNames: function() {
return this._loadedStyleNames;
},
isStyleNameLoaded: function(t) {
return this._loadedStyleNames.has(t);
},
setLoadedStyleName: function(t) {
this._loadedStyleNames.add(t);
},
deleteLoadedStyleName: function(t) {
this._loadedStyleNames.delete(t);
},
clearLoadedStyleNames: function() {
this._loadedStyleNames.clear();
}
}, Bn = `
*,
::before,
::after {
box-sizing: border-box;
}
/* Non vue overlay animations */
.p-connected-overlay {
opacity: 0;
transform: scaleY(0.8);
transition:
transform 0.12s cubic-bezier(0, 0, 0.2, 1),
opacity 0.12s cubic-bezier(0, 0, 0.2, 1);
}
.p-connected-overlay-visible {
opacity: 1;
transform: scaleY(1);
}
.p-connected-overlay-hidden {
opacity: 0;
transform: scaleY(1);
transition: opacity 0.1s linear;
}
/* Vue based overlay animations */
.p-connected-overlay-enter-from {
opacity: 0;
transform: scaleY(0.8);
}
.p-connected-overlay-leave-to {
opacity: 0;
}
.p-connected-overlay-enter-active {
transition:
transform 0.12s cubic-bezier(0, 0, 0.2, 1),
opacity 0.12s cubic-bezier(0, 0, 0.2, 1);
}
.p-connected-overlay-leave-active {
transition: opacity 0.1s linear;
}
/* Toggleable Content */
.p-toggleable-content-enter-from,
.p-toggleable-content-leave-to {
max-height: 0;
}
.p-toggleable-content-enter-to,
.p-toggleable-content-leave-from {
max-height: 1000px;
}
.p-toggleable-content-leave-active {
overflow: hidden;
transition: max-height 0.45s cubic-bezier(0, 1, 0, 1);
}
.p-toggleable-content-enter-active {
overflow: hidden;
transition: max-height 1s ease-in-out;
}
.p-disabled,
.p-disabled * {
cursor: default;
pointer-events: none;
user-select: none;
}
.p-disabled,
.p-component:disabled {
opacity: dt('disabled.opacity');
}
.pi {
font-size: dt('icon.size');
}
.p-icon {
width: dt('icon.size');
height: dt('icon.size');
}
.p-overlay-mask {
background: dt('mask.background');
color: dt('mask.color');
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.p-overlay-mask-enter {
animation: p-overlay-mask-enter-animation dt('mask.transition.duration') forwards;
}
.p-overlay-mask-leave {
animation: p-overlay-mask-leave-animation dt('mask.transition.duration') forwards;
}
@keyframes p-overlay-mask-enter-animation {
from {
background: transparent;
}
to {
background: dt('mask.background');
}
}
@keyframes p-overlay-mask-leave-animation {
from {
background: dt('mask.background');
}
to {
background: transparent;
}
}
`;
function ke(e) {
"@babel/helpers - typeof";
return ke = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
return typeof t;
} : function(t) {
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
}, ke(e);
}
function tt(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var l = Object.getOwnPropertySymbols(e);
t && (l = l.filter(function(o) {
return Object.getOwnPropertyDescriptor(e, o).enumerable;
})), n.push.apply(n, l);
}
return n;
}
function nt(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t] != null ? arguments[t] : {};
t % 2 ? tt(Object(n), !0).forEach(function(l) {
Kn(e, l, n[l]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : tt(Object(n)).forEach(function(l) {
Object.defineProperty(e, l, Object.getOwnPropertyDescriptor(n, l));
});
}
return e;
}
function Kn(e, t, n) {
return (t = Un(t)) in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function Un(e) {
var t = Hn(e, "string");
return ke(t) == "symbol" ? t : t + "";
}
function Hn(e, t) {
if (ke(e) != "object" || !e) return e;
var n = e[Symbol.toPrimitive];
if (n !== void 0) {
var l = n.call(e, t);
if (ke(l) != "object") return l;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (t === "string" ? String : Number)(e);
}
function Zn(e) {
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
Qe() && Qe().components ? bt(e) : t ? e() : pn(e);
}
var Wn = 0;
function Gn(e) {
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = H(!1), l = H(e), o = H(null), u = Rn() ? window.document : void 0, d = t.document, i = d === void 0 ? u : d, a = t.immediate, p = a === void 0 ? !0 : a, c = t.manual, q = c === void 0 ? !1 : c, h = t.name, r = h === void 0 ? "style_".concat(++Wn) : h, m = t.id, v = m === void 0 ? void 0 : m, f = t.media, s = f === void 0 ? void 0 : f, g = t.nonce, _ = g === void 0 ? void 0 : g, w = t.first, x = w === void 0 ? !1 : w, b = t.onMounted, P = b === void 0 ? void 0 : b, E = t.onUpdated, Z = E === void 0 ? void 0 : E, Q = t.onLoad, W = Q === void 0 ? void 0 : Q, Y = t.props, J = Y === void 0 ? {} : Y, G = function() {
}, X = function(se) {
var ae = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
if (i) {
var B = nt(nt({}, J), ae), I = B.name || r, te = B.id || v, xe = B.nonce || _;
o.value = i.querySelector('style[data-primevue-style-id="'.concat(I, '"]')) || i.getElementById(te) || i.createElement("style"), o.value.isConnected || (l.value = se || e, Me(o.value, {
type: "text/css",
id: te,
media: s,
nonce: xe
}), x ? i.head.prepend(o.value) : i.head.appendChild(o.value), Mn(o.value, "data-primevue-style-id", I), Me(o.value, B), o.value.onload = function(de) {
return W?.(de, {
name: I
});
}, P?.(I)), !n.value && (G = Ce(l, function(de) {
o.value.textContent = de, Z?.(I);
}, {
immediate: !0
}), n.value = !0);
}
}, ie = function() {
!i || !n.value || (G(), Lt(o.value) && i.head.removeChild(o.value), n.value = !1, o.value = null);
};
return p && !q && Zn(X), {
id: v,
name: r,
el: o,
css: l,
unload: ie,
load: X,
isLoaded: cn(n)
};
}
function we(e) {
"@babel/helpers - typeof";
return we = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
return typeof t;
} : function(t) {
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
}, we(e);
}
var lt, ot, rt, it;
function st(e, t) {
return Xn(e) || Jn(e, t) || Yn(e, t) || Qn();
}
function Qn() {
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function Yn(e, t) {
if (e) {
if (typeof e == "string") return at(e, t);
var n = {}.toString.call(e).slice(8, -1);
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? at(e, t) : void 0;
}
}
function at(e, t) {
(t == null || t > e.length) && (t = e.length);
for (var n = 0, l = Array(t); n < t; n++) l[n] = e[n];
return l;
}
function Jn(e, t) {
var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
if (n != null) {
var l, o, u, d, i = [], a = !0, p = !1;
try {
if (u = (n = n.call(e)).next, t !== 0) for (; !(a = (l = u.call(n)).done) && (i.push(l.value), i.length !== t); a = !0) ;
} catch (c) {
p = !0, o = c;
} finally {
try {
if (!a && n.return != null && (d = n.return(), Object(d) !== d)) return;
} finally {
if (p) throw o;
}
}
return i;
}
}
function Xn(e) {
if (Array.isArray(e)) return e;
}
function dt(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var l = Object.getOwnPropertySymbols(e);
t && (l = l.filter(function(o) {
return Object.getOwnPropertyDescriptor(e, o).enumerable;
})), n.push.apply(n, l);
}
return n;
}
function Ae(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t] != null ? arguments[t] : {};
t % 2 ? dt(Object(n), !0).forEach(function(l) {
el(e, l, n[l]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : dt(Object(n)).forEach(function(l) {
Object.defineProperty(e, l, Object.getOwnPropertyDescriptor(n, l));
});
}
return e;
}
function el(e, t, n) {
return (t = tl(t)) in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function tl(e) {
var t = nl(e, "string");
return we(t) == "symbol" ? t : t + "";
}
function nl(e, t) {
if (we(e) != "object" || !e) return e;
var n = e[Symbol.toPrimitive];
if (n !== void 0) {
var l = n.call(e, t);
if (we(l) != "object") return l;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (t === "string" ? String : Number)(e);
}
function Oe(e, t) {
return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } }));
}
var ll = function(t) {
var n = t.dt;
return `
.p-hidden-accessible {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
opacity: 0;
overflow: hidden;
padding: 0;
pointer-events: none;
position: absolute;
white-space: nowrap;
width: 1px;
}
.p-overflow-hidden {
overflow: hidden;
padding-right: `.concat(n("scrollbar.width"), `;
}
`);
}, ol = {}, rl = {}, F = {
name: "base",
css: ll,
style: Bn,
classes: ol,
inlineStyles: rl,
load: function(t) {
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, l = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : function(u) {
return u;
}, o = l(_e(lt || (lt = Oe(["", ""])), t));
return C(o) ? Gn(ve(o), Ae({
name: this.name
}, n)) : {};
},
loadCSS: function() {
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
return this.load(this.css, t);
},
loadStyle: function() {
var t = this, n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, l = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
return this.load(this.style, n, function() {
var o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
return j.transformCSS(n.name || t.name, "".concat(o).concat(_e(ot || (ot = Oe(["", ""])), l)));
});
},
getCommonTheme: function(t) {
return j.getCommon(this.name, t);
},
getComponentTheme: function(t) {
return j.getComponent(this.name, t);
},
getDirectiveTheme: function(t) {
return j.getDirective(this.name, t);
},
getPresetTheme: function(t, n, l) {
return j.getCustomPreset(this.name, t, n, l);
},
getLayerOrderThemeCSS: function() {
return j.getLayerOrderCSS(this.name);
},
getStyleSheet: function() {
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
if (this.css) {
var l = R(this.css, {
dt: re
}) || "", o = ve(_e(rt || (rt = Oe(["", "", ""])), l, t)), u = Object.entries(n).reduce(function(d, i) {
var a = st(i, 2), p = a[0], c = a[1];
return d.push("".concat(p, '="').concat(c, '"')) && d;
}, []).join(" ");
return C(o) ? '<style type="text/css" data-primevue-style-id="'.concat(this.name, '" ').concat(u, ">").concat(o, "</style>") : "";
}
return "";
},
getCommonThemeStyleSheet: function(t) {
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
return j.getCommonStyleSheet(this.name, t, n);
},
getThemeStyleSheet: function(t) {
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, l = [j.getStyleSheet(this.name, t, n)];
if (this.style) {
var o = this.name === "base" ? "global-style" : "".concat(this.name, "-style"), u = _e(it || (it = Oe(["", ""])), R(this.style, {
dt: re
})), d = ve(j.transformCSS(o, u)), i = Object.entries(n).reduce(function(a, p) {
var c = st(p, 2), q = c[0], h = c[1];
return a.push("".concat(q, '="').concat(h, '"')) && a;
}, []).join(" ");
C(d) && l.push('<style type="text/css" data-primevue-style-id="'.concat(o, '" ').concat(i, ">").concat(d, "</style>"));
}
return l.join("");
},
extend: function(t) {
return Ae(Ae({}, this), {}, {
css: void 0,
style: void 0
}, t);
}
};
function il() {
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "pc", t = mn();
return "".concat(e).concat(t.replace("v-", "").replaceAll("-", "_"));
}
var ut = F.extend({
name: "common"
});
function $e(e) {
"@babel/helpers - typeof";
return $e = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
return typeof t;
} : function(t) {
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
}, $e(e);
}
function sl(e) {
return At(e) || al(e) || Ft(e) || zt();
}
function al(e) {
if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
}
function fe(e, t) {
return At(e) || dl(e, t) || Ft(e, t) || zt();
}
function zt() {
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function Ft(e, t) {
if (e) {
if (typeof e == "string") return ct(e, t);
var n = {}.toString.call(e).slice(8, -1);
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? ct(e, t) : void 0;
}
}
function ct(e, t) {
(t == null || t > e.length) && (t = e.length);
for (var n = 0, l = Array(t); n < t; n++) l[n] = e[n];
return l;
}
function dl(e, t) {
var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
if (n != null) {
var l, o, u, d, i = [], a = !0, p = !1;
try {
if (u = (n = n.call(e)).next, t === 0) {
if (Object(n) !== n) return;
a = !1;
} else for (; !(a = (l = u.call(n)).done) && (i.push(l.value), i.length !== t); a = !0) ;
} catch (c) {
p = !0, o = c;
} finally {
try {
if (!a && n.return != null && (d = n.return(), Object(d) !== d)) return;
} finally {
if (p) throw o;
}
}
return i;
}
}
function At(e) {
if (Array.isArray(e)) return e;
}
function pt(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var l = Object.getOwnPropertySymbols(e);
t && (l = l.filter(function(o) {
return Object.getOwnPropertyDescriptor(e, o).enumerable;
})), n.push.apply(n, l);
}
return n;
}
function S(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t] != null ? arguments[t] : {};
t % 2 ? pt(Object(n), !0).forEach(function(l) {
qe(e, l, n[l]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : pt(Object(n)).forEach(function(l) {
Object.defineProperty(e, l, Object.getOwnPropertyDescriptor(n, l));
});
}
return e;
}
function qe(e, t, n) {
return (t = ul(t)) in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function ul(e) {
var t = cl(e, "string");
return $e(t) == "symbol" ? t : t + "";
}
function cl(e, t) {
if ($e(e) != "object" || !e) return e;
var n = e[Symbol.toPrimitive];
if (n !== void 0) {
var l = n.call(e, t);
if ($e(l) != "object") return l;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (t === "string" ? String : Number)(e);
}
var Ze = {
name: "BaseComponent",
props: {
pt: {
type: Object,
default: void 0
},
ptOptions: {
type: Object,
default: void 0
},
unstyled: {
type: Boolean,
default: void 0
},
dt: {
type: Object,
default: void 0
}
},
inject: {
$parentInstance: {
default: void 0
}
},
watch: {
isUnstyled: {
immediate: !0,
handler: function(t) {
L.off("theme:change", this._loadCoreStyles), t || (this._loadCoreStyles(), this._themeChangeListener(this._loadCoreStyles));
}
},
dt: {
immediate: !0,
handler: function(t, n) {
var l = this;
L.off("theme:change", this._themeScopedListener), t ? (this._loadScopedThemeStyles(t), this._themeScopedListener = function() {
return l._loadScopedThemeStyles(t);
}, this._themeChangeListener(this._themeScopedListener)) : this._unloadScopedThemeStyles();
}
}
},
scopedStyleEl: void 0,
rootEl: void 0,
uid: void 0,
$attrSelector: void 0,
beforeCreate: function() {
var t, n, l, o, u, d, i, a, p, c, q, h = (t = this.pt) === null || t === void 0 ? void 0 : t._usept, r = h ? (n = this.pt) === null || n === void 0 || (n = n.originalValue) === null || n === void 0 ? void 0 : n[this.$.type.name] : void 0, m = h ? (l = this.pt) === null || l === void 0 || (l = l.value) === null || l === void 0 ? void 0 : l[this.$.type.name] : this.pt;
(o = m || r) === null || o === void 0 || (o = o.hooks) === null || o === void 0 || (u = o.onBeforeCreate) === null || u === void 0 || u.call(o);
var v = (d = this.$primevueConfig) === null || d === void 0 || (d = d.pt) === null || d === void 0 ? void 0 : d._usept, f = v ? (i = this.$primevue) === null || i === void 0 || (i = i.config) === null || i === void 0 || (i = i.pt) === null || i === void 0 ? void 0 : i.originalValue : void 0, s = v ? (a = this.$primevue) === null || a === void 0 || (a = a.config) === null || a === void 0 || (a = a.pt) === null || a === void 0 ? void 0 : a.value : (p = this.$primevue) === null || p === void 0 || (p = p.config) === null || p === void 0 ? void 0 : p.pt;
(c = s || f) === null || c === void 0 || (c = c[this.$.type.name]) === null || c === void 0 || (c = c.hooks) === null || c === void 0 || (q = c.onBeforeCreate) === null || q === void 0 || q.call(c), this.$attrSelector = il(), this.uid = this.$attrs.id || this.$attrSelector.replace("pc", "pv_id_");
},
created: function() {
this._hook("onCreated");
},
beforeMount: function() {
var t;
this.rootEl = Dn(Le(this.$el) ? this.$el : (t = this.$el) === null || t === void 0 ? void 0 : t.parentElement, "[".concat(this.$attrSelector, "]")), this.rootEl && (this.rootEl.$pc = S({
name: this.$.type.name,
attrSelector: this.$attrSelector
}, this.$params)), this._loadStyles(), this._hook("onBeforeMount");
},
mounted: function() {
this._hook("onMounted");
},
beforeUpdate: function() {
this._hook("onBeforeUpdate");
},
updated: function() {
this._hook("onUpdated");
},
beforeUnmount: function() {
this._hook("onBeforeUnmount");
},
unmounted: function() {
this._removeThemeListeners(), this._unloadScopedThemeStyles(), this._hook("onUnmounted");
},
methods: {
_hook: function(t) {
if (!this.$options.hostName) {
var n = this._usePT(this._getPT(this.pt, this.$.type.name), this._getOptionValue, "hooks.".concat(t)), l = this._useDefaultPT(this._getOptionValue, "hooks.".concat(t));
n?.(), l?.();
}
},
_mergeProps: function(t) {
for (var n = arguments.length, l = new Array(n > 1 ? n - 1 : 0), o = 1; o < n; o++)
l[o - 1] = arguments[o];
return St(t) ? t.apply(void 0, l) : k.apply(void 0, l);
},
_load: function() {
me.isStyleNameLoaded("base") || (F.loadCSS(this.$styleOptions), this._loadGlobalStyles(), me.setLoadedStyleName("base")), this._loadThemeStyles();
},
_loadStyles: function() {
this._load(), this._themeChangeListener(this._load);
},
_loadCoreStyles: function() {
var t, n;
!me.isStyleNameLoaded((t = this.$style) === null || t === void 0 ? void 0 : t.name) && (n = this.$style) !== null && n !== void 0 && n.name && (ut.loadCSS(this.$styleOptions), this.$options.style && this.$style.loadCSS(this.$styleOptions), me.setLoadedStyleName(this.$style.name));
},
_loadGlobalStyles: function() {
var t = this._useGlobalPT(this._getOptionValue, "global.css", this.$params);
C(t) && F.load(t, S({
name: "global"
}, this.$styleOptions));
},
_loadThemeStyles: function() {
var t, n;
if (!(this.isUnstyled || this.$theme === "none")) {
if (!j.isStyleNameLoaded("common")) {
var l, o, u = ((l = this.$style) === null || l === void 0 || (o = l.getCommonTheme) === null || o === void 0 ? void 0 : o.call(l)) || {}, d = u.primitive, i = u.semantic, a = u.global, p = u.style;
F.load(d?.css, S({
name: "primitive-variables"
}, this.$styleOptions)), F.load(i?.css, S({
name: "semantic-variables"
}, this.$styleOptions)), F.load(a?.css, S({
name: "global-variables"
}, this.$styleOptions)), F.loadStyle(S({
name: "global-style"
}, this.$styleOptions), p), j.setLoadedStyleName("common");
}
if (!j.isStyleNameLoaded((t = this.$style) === null || t === void 0 ? void 0 : t.name) && (n = this.$style) !== null && n !== void 0 && n.name) {
var c, q, h, r, m = ((c = this.$style) === null || c === void 0 || (q = c.getComponentTheme) === null || q === void 0 ? void 0 : q.call(c)) || {}, v = m.css, f = m.style;
(h = this.$style) === null || h === void 0 || h.load(v, S({
name: "".concat(this.$style.name, "-variables")
}, this.$styleOptions)), (r = this.$style) === null || r === void 0 || r.loadStyle(S({
name: "".concat(this.$style.name, "-style")
}, this.$styleOptions), f), j.setLoadedStyleName(this.$style.name);
}
if (!j.isStyleNameLoaded("layer-order")) {
var s, g, _ = (s = this.$style) === null || s === void 0 || (g = s.getLayerOrderThemeCSS) === null || g === void 0 ? void 0 : g.call(s);
F.load(_, S({
name: "layer-order",
first: !0
}, this.$styleOptions)), j.setLoadedStyleName("layer-order");
}
}
},
_loadScopedThemeStyles: function(t) {
var n, l, o, u = ((n = this.$style) === null || n === void 0 || (l = n.getPresetTheme) === null || l === void 0 ? void 0 : l.call(n, t, "[".conc